camunda-bpmn-js 0.18.0 → 0.20.0

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,2 +1,3 @@
1
- !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).BpmnViewer=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){var t={exports:{}};return e(t,t.exports),t.exports}var n=t((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}}));function i(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var r=Object.prototype.toString,o=Object.prototype.hasOwnProperty;function a(e){return void 0!==e}function s(e){return"[object Array]"===r.call(e)}function l(e){return"[object Object]"===r.call(e)}function p(e){return"[object Number]"===r.call(e)}function c(e){var t=r.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function u(e){return"[object String]"===r.call(e)}function m(e,t){return o.call(e,t)}function h(e,t){var n;return t=x(t),d(e,(function(e,i){if(t(e,i))return n=e,!1})),n}function f(e,t){var n=[];return d(e,(function(e,i){t(e,i)&&n.push(e)})),n}function d(e,t){var n;if(void 0!==e){var i=s(e)?E:w;for(var r in e)if(m(e,r)&&!1===t(n=e[r],i(r)))return n}}function y(e,t,n){return d(e,(function(e,i){n=t(n,e,i)})),n}function g(e,t){return!!y(e,(function(e,n,i){return e&&t(n,i)}),!0)}function v(e,t){return!!h(e,t)}function b(e){return function(t){return g(e,(function(e,n){return t[n]===e}))}}function x(e){return c(e)?e:function(t){return t===e}}function w(e){return e}function E(e){return Number(e)}function _(e,t){return e.bind(t)}function A(){return A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},A.apply(this,arguments)}function S(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return A.apply(void 0,[e].concat(n))}function R(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 C(e,t){var n=k(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function k(e){return e&&e.businessObject||e}function M(e){return e&&e.di}function P(e,t){return!C(e,"bpmn:CallActivity")&&(C(e,"bpmn:SubProcess")?!(!(t=t||M(e))||!C(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!C(e,"bpmn:Participant")||!!k(e).processRef)}function T(e){var t=e.businessObject,n=function(e){return C(e,"bpmn:FlowElement")||C(e,"bpmn:Participant")||C(e,"bpmn:Lane")||C(e,"bpmn:SequenceFlow")||C(e,"bpmn:MessageFlow")||C(e,"bpmn:DataInput")||C(e,"bpmn:DataOutput")?"name":C(e,"bpmn:TextAnnotation")?"text":C(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function D(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}R.prototype.canRender=function(){},R.prototype.drawShape=function(){},R.prototype.drawConnection=function(){},R.prototype.getShapePath=function(){},R.prototype.getConnectionPath=function(){};var N={"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 O(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=N[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function B(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return N[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);O(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)O(e,i,t[i])}(e,t);return e}function L(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var I=/\s+/,j=Object.prototype.toString;function F(e){return void 0!==e}function V(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 W(e){var t=e.parentNode;return t&&t.removeChild(e),e}z.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~L(t,e)||t.push(e),F(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},z.prototype.remove=function(e){if("[object RegExp]"===j.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=L(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},z.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},z.prototype.toggle=function(e,t){return this.list?(F(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(F(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},z.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(I);return""===e[0]&&e.shift(),e},z.prototype.has=z.prototype.contains=function(e){return this.list?this.list.contains(e):!!~L(this.array(),e)};var G="http://www.w3.org/2000/svg",$='<svg xmlns="'+G+'"';function H(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(G)&&(e=$+e.substring(4)):(e=$+">"+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 U(e,t){var n;return"<"===e.charAt(0)?(n=H(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(G,e),t&&B(n,t),n}var K=U("svg");function q(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Y(e){return e?K.createSVGTransformFromMatrix(e):K.createSVGTransform()}function X(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Z(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(X(e,i))}(n,t)),n.consolidate()}function J(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function Q(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function ee(e,t){var n=U("polyline");return B(n,{points:Q(e)}),t&&B(n,t),n}var te="hsl(225, 10%, 15%)";function ne(e,t,n){return v(e.eventDefinitions,(function(i){return i.$type===t&&function(e,t){return g(t,(function(t,n){return e[n]==t}))}(e,n)}))}function ie(e){return e.businessObject}function re(e,t){var n=M(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function oe(e,t){var n=M(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||te}function ae(e,t,n){var i=M(e).get("label");return i&&i.get("color:color")||t||oe(e,n)}var se=Object.prototype.toString,le=Object.prototype.hasOwnProperty;function pe(e,t){return le.call(e,t)}function ce(e,t){var n;if(void 0!==e){var i=function(e){return"[object Array]"===se.call(e)}(e)?me:ue;for(var r in e)if(pe(e,r)&&!1===t(n=e[r],i(r)))return n}}function ue(e){return e}function me(e){return Number(e)}function he(e){for(var t=e.style,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return ce(i,(function(e){e&&ce(e,(function(e,n){t[n]=e}))})),e}var fe=[].indexOf,de=function(e,t){if(fe)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},ye=/\s+/,ge=Object.prototype.toString;function ve(e){return new be(e)}function be(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function xe(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}be.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~de(t,e)||t.push(e),this.el.className=t.join(" "),this},be.prototype.remove=function(e){if("[object RegExp]"==ge.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=de(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},be.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},be.prototype.toggle=function(e,t){return this.list?(void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},be.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(ye);return""===e[0]&&e.shift(),e},be.prototype.has=be.prototype.contains=function(e){return this.list?this.list.contains(e):!!~de(this.array(),e)};var we="undefined"!=typeof Element?Element.prototype:{},Ee=we.matches||we.matchesSelector||we.webkitMatchesSelector||we.mozMatchesSelector||we.msMatchesSelector||we.oMatchesSelector,_e=function(e,t){if(!e||1!==e.nodeType)return!1;if(Ee)return Ee.call(e,t);for(var n=e.parentNode.querySelectorAll(t),i=0;i<n.length;i++)if(n[i]==e)return!0;return!1};var Ae=window.addEventListener?"addEventListener":"attachEvent",Se=window.removeEventListener?"removeEventListener":"detachEvent",Re="addEventListener"!==Ae?"on":"",Ce=function(e,t,n,i){return e[Ae](Re+t,n,i||!1),n},ke=function(e,t,n,i){return e[Se](Re+t,n,i||!1),n},Me=["focus","blur"];var Pe,Te={bind:function(e,t,n,i,r){return-1!==Me.indexOf(n)&&(r=!0),Ce(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=function(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(_e(i,t))return i;i=i.parentNode}return _e(i,t)?i:null}(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==Me.indexOf(t)&&(i=!0),ke(e,t,n,i)}},De=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild)}var r,o=Oe[i]||Oe._default,a=o[0],s=o[1],l=o[2];(r=t.createElement("div")).innerHTML=s+e+l;for(;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var p=t.createDocumentFragment();for(;r.firstChild;)p.appendChild(r.removeChild(r.firstChild));return p},Ne=!1;"undefined"!=typeof document&&((Pe=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Ne=!Pe.getElementsByTagName("link").length,Pe=void 0);var Oe={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Ne?[1,"X<div>","</div>"]:[0,"",""]};function Be(e,t){return(t=t||document).querySelector(e)}function Le(e){e.parentNode&&e.parentNode.removeChild(e)}function Ie(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function je(e,t){return Ie(t,e),e}Oe.td=Oe.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Oe.option=Oe.optgroup=[1,'<select multiple="multiple">',"</select>"],Oe.thead=Oe.tbody=Oe.colgroup=Oe.caption=Oe.tfoot=[1,"<table>","</table>"],Oe.polyline=Oe.ellipse=Oe.polygon=Oe.circle=Oe.text=Oe.line=Oe.path=Oe.rect=Oe.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Fe={"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 Ve(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Fe[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function ze(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return Fe[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);Ve(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)Ve(e,i,t[i])}(e,t);return e}function We(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var Ge=/\s+/,$e=Object.prototype.toString;function He(e){return void 0!==e}function Ue(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ke(e){var t=e.parentNode;return t&&t.removeChild(e),e}Ue.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~We(t,e)||t.push(e),He(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},Ue.prototype.remove=function(e){if("[object RegExp]"===$e.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=We(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},Ue.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ue.prototype.toggle=function(e,t){return this.list?(He(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(He(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},Ue.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(Ge);return""===e[0]&&e.shift(),e},Ue.prototype.has=Ue.prototype.contains=function(e){return this.list?this.list.contains(e):!!~We(this.array(),e)};var qe="http://www.w3.org/2000/svg",Ye='<svg xmlns="'+qe+'"';function Xe(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(qe)&&(e=Ye+e.substring(4)):(e=Ye+">"+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 Ze(e,t){var n;return"<"===e.charAt(0)?(n=Xe(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(qe,e),t&&ze(n,t),n}var Je=/([&<>]{1})/g,Qe=/([\n\r"]{1})/g,et={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function tt(e,t){return e.replace(t,(function(e,t){return et[t]||t}))}function nt(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(tt(e.textContent,Je));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,'="',tt(o.value,Qe),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)nt(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",tt(e.nodeValue,Je),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function it(e,t){var n=Xe(t);if(function(e){for(var t;t=e.firstChild;)Ke(t)}(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)Ie(r[o],e)}}function rt(e,t){if(void 0!==t){try{it(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)nt(t,n),t=t.nextSibling;return n.join("")}(e)}function ot(e,t,n,i,r){var o=Y();o.setTranslate(t,n);var a=Y();a.setRotate(i||0,0,0);var s=Y();s.setScale(r||1,r||1),Z(e,[o,a,s])}function at(e,t,n){var i=Y();i.setTranslate(t,n),Z(e,i)}var st=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/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 l=parseInt(a,n);return l!==1/0&&l>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,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");e+=i}var s=t(e,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=e||128,r.base=n||16,r}}));function lt(e){if(!(this instanceof lt))return new lt(e);e=e||[128,36,1],this._seed=e.length?st.rack(e[0],e[1],e[2]):e}lt.prototype.next=function(e){return this._seed(e||!0)},lt.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},lt.prototype.claim=function(e,t){this._seed.set(e,t||!0)},lt.prototype.assigned=function(e){return this._seed.get(e)||!1},lt.prototype.unclaim=function(e){delete this._seed.hats[e]},lt.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var pt=new lt,ct=.95;function ut(e,t,n,i,r,o,a){R.call(this,t,a);var s=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor,u=pt.next(),m={},h=n.computeStyle;function f(e,t){var n=S({fill:te,strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},o=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=Ze("marker");ze(t.element,n),je(a,t.element),ze(a,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*o,markerHeight:20*o,orient:"auto"});var s=Be("defs",r._svg);s||(s=Ze("defs"),je(r._svg,s)),je(s,a),m[e]=a}function y(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function g(e,t,n){var i=e+"-"+y(t)+"-"+y(n)+"-"+u;return m[i]||function(e,t,n,i){if("sequenceflow-end"===t){var r=Ze("path");ze(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(e,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var o=Ze("circle");ze(o,{cx:6,cy:6,r:3.5}),f(e,{element:o,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var a=Ze("path");ze(a,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(e,{element:a,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var s=Ze("path");ze(s,{d:"M 11 5 L 1 10 L 11 15"}),f(e,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var l=Ze("path");ze(l,{d:"M 1 5 L 11 10 L 1 15"}),f(e,{element:l,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var p=Ze("path");ze(p,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(e,{element:p,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var c=Ze("path");ze(c,{d:"M 6 4 L 10 16"}),f(e,{element:c,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function v(e,t,n,i,r){l(i)&&(r=i,i=0),i=i||0,"none"===(r=h(r,{stroke:te,strokeWidth:2,fill:"white"})).fill&&delete r.fillOpacity;var o=t/2,a=n/2,s=Ze("circle");return ze(s,{cx:o,cy:a,r:Math.round((t+n)/4-i)}),ze(s,r),je(e,s),s}function b(e,t,n,i,r,o){l(r)&&(o=r,r=0),r=r||0,o=h(o,{stroke:te,strokeWidth:2,fill:"white"});var a=Ze("rect");return ze(a,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),ze(a,o),je(e,a),a}function x(e,t,n){var i=ee(t,n=h(n,["no-fill"],{stroke:te,strokeWidth:2,fill:"none"}));return je(e,i),i}function w(e,t,n){n=h(n,["no-fill"],{strokeWidth:2,stroke:te});var i=Ze("path");return ze(i,{d:t}),ze(i,n),je(e,i),i}function E(e,t,n,i){return w(t,n,S({"data-marker":e},i))}function _(e){return L[e]}function A(e){return function(t,n){return _(e)(t,n)}}function C(e,t){var n=ie(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?_("bpmn:ParallelMultipleEventDefinition")(t,e,i):_("bpmn:MultipleEventDefinition")(t,e,i):ne(n,"bpmn:MessageEventDefinition")?_("bpmn:MessageEventDefinition")(t,e,i):ne(n,"bpmn:TimerEventDefinition")?_("bpmn:TimerEventDefinition")(t,e,i):ne(n,"bpmn:ConditionalEventDefinition")?_("bpmn:ConditionalEventDefinition")(t,e):ne(n,"bpmn:SignalEventDefinition")?_("bpmn:SignalEventDefinition")(t,e,i):ne(n,"bpmn:EscalationEventDefinition")?_("bpmn:EscalationEventDefinition")(t,e,i):ne(n,"bpmn:LinkEventDefinition")?_("bpmn:LinkEventDefinition")(t,e,i):ne(n,"bpmn:ErrorEventDefinition")?_("bpmn:ErrorEventDefinition")(t,e,i):ne(n,"bpmn:CancelEventDefinition")?_("bpmn:CancelEventDefinition")(t,e,i):ne(n,"bpmn:CompensateEventDefinition")?_("bpmn:CompensateEventDefinition")(t,e,i):ne(n,"bpmn:TerminateEventDefinition")?_("bpmn:TerminateEventDefinition")(t,e,i):null}function D(e,t,n){n=S({size:{width:100}},n);var i,r=o.createText(t||"",n);return(i=r,new Ue(i)).add("djs-label"),je(e,r),r}function N(e,t,n){return D(e,ie(t).name,{box:t,align:n,padding:5,style:{fill:ae(t,c,p)}})}function O(e,t,n){ot(D(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:ae(n,c,p)}}),0,-(-1*n.height),270)}function B(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i<t.length;i++)n+="L"+t[i].x+","+t[i].y+" ";return n}var L=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=ct),v(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:re(t,s),stroke:oe(t,p)};ie(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:re(t,s),stroke:oe(t,p)});var i=_("bpmn:Event")(e,t,n);return C(t,e),i},"bpmn:MessageEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?oe(t,p):re(t,s),stroke:n?re(t,s):oe(t,p)})},"bpmn:TimerEventDefinition":function(e,t){var n=v(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:re(t,s),stroke:oe(t,p)});w(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:oe(t,p)});for(var r=0;r<12;r++){var o=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),a=t.width/2;w(e,o,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+a+")",stroke:oe(t,p)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?oe(t,p):"none",stroke:oe(t,p)})},"bpmn:ConditionalEventDefinition":function(e,t){return w(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:oe(t,p)})},"bpmn:LinkEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?oe(t,p):"none",stroke:oe(t,p)})},"bpmn:ErrorEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:n?oe(t,p):"none",stroke:oe(t,p)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=w(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:n?oe(t,p):"none",stroke:oe(t,p)});return function(e,t){var n=Y();n.setRotate(t,0,0),Z(e,n)}(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?oe(t,p):"none",stroke:oe(t,p)})},"bpmn:SignalEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?oe(t,p):"none",stroke:oe(t,p)})},"bpmn:MultipleEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:n?oe(t,p):"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return w(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:oe(t,p),stroke:oe(t,p)})},"bpmn:EndEvent":function(e,t){var n=_("bpmn:Event")(e,t,{strokeWidth:4,fill:re(t,s),stroke:oe(t,p)});return C(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return v(e,t.width,t.height,8,{strokeWidth:4,fill:oe(t,p),stroke:oe(t,p)})},"bpmn:IntermediateEvent":function(e,t){var n=_("bpmn:Event")(e,t,{strokeWidth:1,fill:re(t,s),stroke:oe(t,p)});return v(e,t.width,t.height,3,{strokeWidth:1,fill:re(t,"none"),stroke:oe(t,p)}),C(t,e),n},"bpmn:IntermediateCatchEvent":A("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":A("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=ct),b(e,t.width,t.height,10,n)},"bpmn:Task":function(e,t){var n={fill:re(t,s),stroke:oe(t,p)},i=_("bpmn:Activity")(e,t,n);return N(e,t,"center-middle"),I(e,t),i},"bpmn:ServiceTask":function(e,t){var n=_("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:re(t,s),stroke:oe(t,p)}),w(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:re(t,s)}),w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:re(t,s),stroke:oe(t,p)}),n},"bpmn:UserTask":function(e,t){var n=_("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:re(t,s),stroke:oe(t,p)}),w(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:re(t,s),stroke:oe(t,p)}),w(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:oe(t,p),stroke:oe(t,p)}),n},"bpmn:ManualTask":function(e,t){var n=_("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:re(t,s),stroke:oe(t,p)}),n},"bpmn:SendTask":function(e,t){var n=_("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:oe(t,p),stroke:re(t,s)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=ie(t),o=_("bpmn:Task")(e,t);return r.instantiate?(v(e,28,28,4.4,{strokeWidth:1}),n=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):n=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),w(e,n,{strokeWidth:1,fill:re(t,s),stroke:oe(t,p)}),o},"bpmn:ScriptTask":function(e,t){var n=_("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:oe(t,p)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=_("bpmn:Task")(e,t);return ze(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:re(t,"#aaaaaa"),stroke:oe(t,p)}),ze(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:oe(t,p)}),n},"bpmn:SubProcess":function(e,t,n){n=S({fill:re(t,s),stroke:oe(t,p)},n);var i=_("bpmn:Activity")(e,t,n),r=P(t);return function(e){return e&&!!k(e).triggeredByEvent}(t)&&ze(i,{strokeDasharray:"1,2"}),N(e,t,r?"center-top":"center-middle"),r?I(e,t):I(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return _("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=_("bpmn:SubProcess")(e,t),r=n.style(["no-fill","no-events"],{stroke:oe(t,p)});return b(e,t.width,t.height,8,3,r),i},"bpmn:CallActivity":function(e,t){return _("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:ct,fill:re(t,s),stroke:oe(t,p)},i=_("bpmn:Lane")(e,t,n);P(t)?(x(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:oe(t,p)}),O(e,ie(t).name,t)):D(e,ie(t).name,{box:t,align:"center-middle",style:{fill:ae(t,c,p)}});return!!ie(t).participantMultiplicity&&_("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=b(e,t.width,t.height,0,S({fill:re(t,s),fillOpacity:.35,stroke:oe(t,p)},n)),r=ie(t);"bpmn:Lane"===r.$type&&O(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=_("bpmn:Gateway")(e,t);return v(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:re(t,s),stroke:oe(t,p)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=_("bpmn:Gateway")(e,t),r=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return M(t).isMarkerVisible&&w(e,r,{strokeWidth:1,fill:oe(t,p),stroke:oe(t,p)}),n},"bpmn:ComplexGateway":function(e,t){var n=_("bpmn:Gateway")(e,t);return w(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:oe(t,p),stroke:oe(t,p)}),n},"bpmn:ParallelGateway":function(e,t){var n=_("bpmn:Gateway")(e,t);return w(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:oe(t,p),stroke:oe(t,p)}),n},"bpmn:EventBasedGateway":function(e,t){var n=ie(t),r=_("bpmn:Gateway")(e,t);v(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:oe(t,p)});var o=n.eventGatewayType,a=!!n.instantiate;if("Parallel"===o){var s=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});ze(w(e,s),{strokeWidth:1,fill:"none"})}else if("Exclusive"===o){if(!a)ze(v(e,t.width,t.height,.26*t.height),{strokeWidth:1,fill:"none",stroke:oe(t,p)});!function(){var n=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:re(t,"none"),stroke:oe(t,p)};w(e,n,r)}()}return r},"bpmn:Gateway":function(e,t){var n={fill:re(t,s),fillOpacity:ct,stroke:oe(t,p)};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=h(i,{stroke:te,strokeWidth:2,fill:"white"});var s=Ze("polygon");return ze(s,{points:a}),ze(s,i),je(e,s),s}(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=B(t),r=re(t,s),o=oe(t,p),a=w(e,i,{strokeLinejoin:"round",markerEnd:g("sequenceflow-end",r,o),stroke:oe(t,p)}),l=ie(t);return t.source&&(n=t.source.businessObject,l.conditionExpression&&n.$instanceOf("bpmn:Activity")&&ze(a,{markerStart:g("conditional-flow-marker",r,o)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===l&&ze(a,{markerStart:g("conditional-default-flow-marker",r,o)})),a},"bpmn:Association":function(e,t,n){var i=ie(t),r=re(t,s),o=oe(t,p);return n=S({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:oe(t,p)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=g("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=g("association-start",r,o)),x(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=re(t,s),i=oe(t,p);return _("bpmn:Association")(e,t,{markerEnd:g("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=re(t,s),i=oe(t,p);return _("bpmn:Association")(e,t,{markerEnd:g("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=ie(t),r=M(t),o=re(t,s),a=oe(t,p),l=w(e,B(t),{markerEnd:g("messageflow-end",o,a),markerStart:g("messageflow-start",o,a),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:oe(t,p)});if(n.messageRef){var u=l.getPointAtLength(l.getTotalLength()/2),m=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),h={strokeWidth:1};"initiating"===r.messageVisibleKind?(h.fill="white",h.stroke=te):(h.fill="#888",h.stroke="white");var f=w(e,m,h),d=D(e,n.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:oe(t,c)}}),y=f.getBBox(),v=d.getBBox();ot(d,u.x-v.width/2,u.y+y.height/2+10,0)}return l},"bpmn:DataObject":function(e,t){var n=w(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:re(t,s),fillOpacity:ct,stroke:oe(t,p)});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(ie(t))&&function(e,t){var n=(t.height-18)/t.height,r=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:n}});w(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":A("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=_("bpmn:DataObject")(e,t);return w(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=_("bpmn:DataObject")(e,t);return w(e,n,{strokeWidth:1,fill:te}),r},"bpmn:DataStoreReference":function(e,t){return w(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:re(t,s),fillOpacity:ct,stroke:oe(t,p)})},"bpmn:BoundaryEvent":function(e,t){var n=ie(t).cancelActivity,i={strokeWidth:1,fill:re(t,s),stroke:oe(t,p)};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=S({},i,{fillOpacity:1}),o=S({},i,{fill:"none"}),a=_("bpmn:Event")(e,t,r);return v(e,t.width,t.height,3,o),C(t,e),a},"bpmn:Group":function(e,t){return b(e,t.width,t.height,10,{stroke:oe(t,p),strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return D(e,T(t),{box:n,fitBox:!0,style:S({},o.getExternalStyle(),{fill:ae(t,c,p)})})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=b(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return w(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:oe(t,p)}),D(e,ie(t).text||"",{box:t,align:"left-top",padding:5,style:{fill:ae(t,c,p)}}),n},ParticipantMultiplicityMarker:function(e,t){E("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}}),{strokeWidth:2,fill:re(t,s),stroke:oe(t,p)})},SubProcessMarker:function(e,t){at(b(e,14,14,0,{strokeWidth:1,fill:re(t,s),stroke:oe(t,p)}),t.width/2-7.5,t.height-20),E("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:re(t,s),stroke:oe(t,p)})},ParallelMarker:function(e,t,n){E("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.parallel)/t.width,my:(t.height-20)/t.height}}),{fill:re(t,s),stroke:oe(t,p)})},SequentialMarker:function(e,t,n){E("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:re(t,s),stroke:oe(t,p)})},CompensationMarker:function(e,t,n){E("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:re(t,s),stroke:oe(t,p)})},LoopMarker:function(e,t,n){E("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1,fill:re(t,s),stroke:oe(t,p),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){E("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:oe(t,p),stroke:oe(t,p)})}};function I(e,t,n){var i,r=ie(t),o=n&&-1!==n.indexOf("SubProcessMarker");i=o?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},d(n,(function(n){_(n)(e,t,i)})),r.isForCompensation&&_("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&_("AdhocMarker")(e,t,i);var a=r.loopCharacteristics,s=a&&a.isSequential;a&&(void 0===s&&_("LoopMarker")(e,t,i),!1===s&&_("ParallelMarker")(e,t,i),!0===s&&_("SequentialMarker")(e,t,i))}this._drawPath=w,this._renderer=_}i(ut,R),ut.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],ut.prototype.canRender=function(e){return C(e,"bpmn:BaseElement")},ut.prototype.drawShape=function(e,t){var n=t.type;return this._renderer(n)(e,t)},ut.prototype.drawConnection=function(e,t){var n=t.type;return this._renderer(n)(e,t)},ut.prototype.getShapePath=function(e){return C(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,J([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):C(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return J([["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"]])}(e,10):C(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return J([["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 J([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var mt={width:150,height:50};function ht(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function ft(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=ht(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return dt(e,o,r,i);o=yt(o,i.width,t)}}function dt(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}}function yt(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||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&"­"===a&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function gt(e){this._config=S({},{size:mt,padding:0,style:{},align:"center-top"},e||{})}gt.prototype.createText=function(e,t){return this.layoutText(e,t).element},gt.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},gt.prototype.layoutText=function(e,t){var n=S({},this._config.size,t.box),i=S({},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 l(e)?S({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),p=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right,m=U("text");for(B(m,{x:0,y:0}),B(m,i),D(function(){var e=document.getElementById("helper-svg");return e||(B(e=U("svg"),{id:"helper-svg"}),he(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),m);p.length;)c.push(ft(p,u,m));"middle"===r.vertical&&(o.top=o.bottom=0);var h=y(c,(function(e,t,n){return e+(s||t.height)}),0)+o.top+o.bottom,f=y(c,(function(e,t,n){return t.width>e?t.width:e}),0),g=o.top;"middle"===r.vertical&&(g+=(n.height-h)/2),g-=(s||c[0].height)/4;var v=U("text");return B(v,i),d(c,(function(e){var t;switch(g+=s||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(a?f:u)-o.right-e.width;break;default:t=Math.max(((a?f:u)-e.width)/2+o.left,0)}var n=U("tspan");B(n,{x:t,y:g}),n.textContent=e.text,D(v,n)})),W(m),{dimensions:{width:f,height:h},element:v}};function vt(e){var t=S({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=S({},t,{fontSize:n},e&&e.externalStyle||{}),r=new gt({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}vt.$inject=["config.textRenderer"];var bt=/\{([^{}]+)\}/g,xt=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var wt={__init__:["bpmnRenderer"],bpmnRenderer:["type",ut],textRenderer:["type",vt],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,l=0;l<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*a;for(var p=0;p<r.widthElements.length;p++)o["x"+p]=r.widthElements[p]*s}var c,u,m=(c=r.d,u={mx:n,my:i,e:o},String(c).replace(bt,(function(e,t){return function(e,t,n){var i=n;return t.replace(xt,(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 m}}]};var Et={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]},_t={width:90,height:20};function At(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 St(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(_t.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=function(e){return e.waypoints?At(e.waypoints):C(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+_t.height/2}:{x:e.x+e.width/2,y:e.y+e.height+_t.height/2}}(t),i=_t),S({x:n.x-i.width/2,y:n.y-i.height/2},i)}function Rt(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Ct(e){return t={x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2},{x:Math.round(t.x),y:Math.round(t.y)};var t}function kt(e){for(var t=e.waypoints,n=t.reduce((function(e,n,i){var r,o,a=t[i-1];if(a){var s=e[e.length-1],l=s&&s.endLength||0,p=(r=a,o=n,Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)));e.push({start:a,end:n,startLength:l,endLength:l+p,length:p})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0)/2,r=0,o=n[r];o.endLength<i;)o=n[++r];var a=(i-o.startLength)/o.length;return{x:o.start.x+(o.end.x-o.start.x)*a,y:o.start.y+(o.end.y-o.start.y)*a}}function Mt(e){return function(e){return!!e.waypoints}(e)?kt(e):Ct(e)}function Pt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function Tt(e,t,n){return S({id:e.id,type:e.$type,businessObject:e,di:t},n)}function Dt(e,t,n){var i=e.waypoint;return!i||i.length<2?[Mt(t),Mt(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function Nt(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:Pt(n),referenced:Pt(t),property:i}))}function Ot(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}Ot.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Ot.prototype.add=function(e,t,n){var i,r,o,a,s,l,p,c=this._translate;if(C(t,"bpmndi:BPMNPlane")){var u=C(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Tt(e,t,u)),this._canvas.addRootElement(i)}else if(C(t,"bpmndi:BPMNShape")){var m=!P(e,t),h=function(e){return C(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var f=t.bounds;i=this._elementFactory.createShape(Tt(e,t,{collapsed:m,hidden:r,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:h})),C(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),C(e,"bpmn:Lane")&&(o=0),C(e,"bpmn:DataStoreReference")&&(a=n,s=Mt(f),l=s.x,p=s.y,l>=a.x&&l<=a.x+a.width&&p>=a.y&&p<=a.y+a.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!C(t,"bpmndi:BPMNEdge"))throw new Error(c("unknown di {di} for element {semantic}",{di:Pt(t),semantic:Pt(e)}));var d=this._getSource(e),y=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Tt(e,t,{hidden:r,source:d,target:y,waypoints:Dt(t,d,y)})),C(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return function(e){return C(e,"bpmn:Event")||C(e,"bpmn:Gateway")||C(e,"bpmn:DataStoreReference")||C(e,"bpmn:DataObjectReference")||C(e,"bpmn:DataInput")||C(e,"bpmn:DataOutput")||C(e,"bpmn:SequenceFlow")||C(e,"bpmn:MessageFlow")||C(e,"bpmn:Group")}(e)&&T(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Ot.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Pt(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Nt(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},Ot.prototype.addLabel=function(e,t,n){var i,r,o;return i=St(t,n),(r=T(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Tt(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!T(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)},Ot.prototype._getEnd=function(e,t){var n,i,r=e.$type,o=this._translate;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?Nt(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Pt(e),side:t}))},Ot.prototype._getSource=function(e){return this._getEnd(e,"source")},Ot.prototype._getTarget=function(e){return this._getEnd(e,"target")},Ot.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Bt={__depends__:[wt,{__depends__:[Et],bpmnImporter:["type",Ot]}]};function Lt(e){return e.originalEvent||e.srcEvent}function It(e,t){return(Lt(e)||e).button===t}function jt(e){return It(e,0)}function Ft(e){var t=Lt(e)||e;return!!jt(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function Vt(e){return!0}function zt(e){return jt(e)||function(e){return It(e,1)}(e)}function Wt(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){return!(l[e]||jt)(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"},l={"element.contextmenu":Vt,"element.mousedown":zt,"element.mouseup":zt,"element.click":zt,"element.dblclick":zt};function p(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(l[n]=i),a.$delegate=Te.bind(e,"svg, .djs-element",t,a)}function c(e,t,n){var i=a(n);i&&Te.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,d(s,(function(e,n){c(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,d(s,(function(e,n){p(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"),m=f("djs-hit djs-hit-click-stroke"),h={all:f("djs-hit djs-hit-all"),"click-stroke":m,stroke:u,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=S({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function y(e,t){var n=h[t];if(!n)throw new Error("invalid hit type <"+t+">");return B(e,n),e}function g(e,t){D(e,t)}this.removeHits=function(e){var t;d((t=".djs-hit",(e||document).querySelectorAll(t)),W)},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=ee(t);return y(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=S({x:0,y:0},n);var i=U("rect");return y(i,t),B(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=Be(".djs-hit",t);if(n)return e.waypoints?function(e,t){B(e,{points:Q(t)})}(n,e.waypoints):B(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=p,this.unregisterEvent=c}Wt.$inject=["eventBus","elementRegistry","styles"];var Gt={__init__:["interactionEvents"],interactionEvents:["type",Wt]};function $t(e,t){var n,i,r,o;return t=!!t,s(e)||(e=[e]),d(e,(function(e){var a=e;e.waypoints&&!t&&(a=$t(e.waypoints,!0));var s=a.x,l=a.y,p=a.height||0,c=a.width||0;(s<n||void 0===n)&&(n=s),(l<i||void 0===i)&&(i=l),(s+c>r||void 0===r)&&(r=s+c),(l+p>o||void 0===o)&&(o=l+p)})),{x:n,y:i,height:o-i,width:r-n}}function Ht(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Ut(e){return!(!e||!e.isFrame)}function Kt(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function o(e,t){var n=U("rect");return B(n,S({x:10,y:10,rx:3,width:100,height:100},i)),D(e,n),n}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,i=Be(".djs-outline",n);i||(i=o(n)),r.updateShapeOutline(i,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,i=Be(".djs-outline",n);i||(i=o(n)),r.updateConnectionOutline(i,t)}))}Kt.prototype.updateShapeOutline=function(e,t){B(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Kt.prototype.updateConnectionOutline=function(e,t){var n=$t(t);B(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Kt.$inject=["eventBus","styles","elementRegistry"];var qt={__init__:["outline"],outline:["type",Kt]};function Yt(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];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)}))}Yt.$inject=["eventBus","canvas"],Yt.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},Yt.prototype.get=function(){return this._selectedElements},Yt.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Yt.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();s(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return o===t})),t?d(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Xt="hover",Zt="selected";function Jt(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,Xt)})),t.on("element.out",(function(e){o(e.element,Xt)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;d(t,(function(e){-1===n.indexOf(e)&&o(e,Zt)})),d(n,(function(e){-1===t.indexOf(e)&&r(e,Zt)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function Qt(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;s(o)?t.select(o):t.select(r.filter(en))}})),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);h(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(jt(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=Ft(e)||function(e){var t=Lt(e)||e;return jt(e)&&t.shiftKey}(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function en(e){return!e.hidden}Jt.$inject=["canvas","eventBus","selection"],Jt.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");!function(e){for(var t;t=e.firstChild;)W(t)}(t);var n=e.length>1;if(V(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}($t(e)),r=U("rect");B(r,S({rx:3},i)),V(r).add("djs-selection-outline"),D(t,r)}},Qt.$inject=["eventBus","selection","canvas","elementRegistry"];var tn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Gt,qt],selection:["type",Yt],selectionVisuals:["type",Jt],selectionBehavior:["type",Qt]};function nn(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}nn.prototype.next=function(){return this._prefix+ ++this._counter};var rn=new nn("ov");function on(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=rn,this._overlayDefaults=S({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),he(o=De('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function an(e,t,n){he(e,{left:t+"px",top:n+"px"})}function sn(e,t){e.style.display=!1===t?"none":""}function ln(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}on.$inject=["config.overlays","eventBus","canvas","elementRegistry"],on.prototype.get=function(e){if(u(e)&&(e={id:e}),u(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?f(t.overlays,b({type:e.type})):t.overlays.slice():[]}return e.type?f(this._overlays,b({type:e.type})):e.id?this._overlays[e.id]:null},on.prototype.add=function(e,t,n){if(l(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=S({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},on.prototype.remove=function(e){var t=this.get(e)||[];s(t)||(t=[t]);var n=this;d(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Le(e.html),Le(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)}}))},on.prototype.show=function(){sn(this._overlayRoot)},on.prototype.hide=function(){sn(this._overlayRoot,!1)},on.prototype.clear=function(){this._overlays={},this._overlayContainers=[],xe(this._overlayRoot)},on.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=$t(t);i=o.x,r=o.y}an(n,i,r),function(e,t,n){2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):e.setAttribute(t,n)}(e.html,"data-container-id",t.id)},on.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?$t(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?$t(o).height:o.height,s=-1*i.bottom+n);an(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},on.prototype._createOverlayContainer=function(e){var t=De('<div class="djs-overlays" />');he(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},on.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";ln(this._overlayRoot,n)},on.prototype._getOverlayContainer=function(e,t){var n=h(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},on.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)),u(o)&&(o=De(o)),n=this._getOverlayContainer(r),he(t=De('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&ve(t).add("djs-overlay-"+e.type),sn(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())},on.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,s=e.htmlContainer,l=!0;(i!==this._canvas.getRootElement()||n&&(a(r)&&r>t.scale||a(o)&&o<t.scale))&&(l=!1),sn(s,l),this._updateOverlayScale(e,t)},on.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,s=e.htmlContainer,l="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),a(n)&&t.scale<n&&(r=(1/t.scale||1)*n),a(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),a(r)&&(l="scale("+r+","+r+")"),ln(s,l)},on.prototype._updateOverlaysVisibilty=function(e){var t=this;d(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},on.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;d(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Le(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&&(d(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&&ve(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 pn={__init__:["overlays"],overlays:["type",on]};function cn(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(Ht(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)}))}cn.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var un={__init__:["changeSupport"],changeSupport:["type",cn]};function mn(e){this._eventBus=e}mn.$inject=["eventBus"],mn.prototype.on=function(e,t,n,i,r,o){if((c(t)||p(t))&&(o=r,r=i,i=n,n=t,t=null),c(n)&&(o=r,r=i,i=n,n=1e3),l(r)&&(o=r,r=!1),!c(i))throw new Error("handlerFn must be a function");s(e)||(e=[e]);var a=this._eventBus;d(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)}))};function hn(e,t){t.invoke(mn,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)}))}d(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],(function(e){mn.prototype[e]=function(t,n,i,r,o){(c(t)||p(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}})),i(hn,mn),hn.$inject=["canvas","injector"];var fn={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",hn]};
2
- /*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */t((function(t,n){var i;i=e,t.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),i=n.length,r=-1,o="",a=n.charCodeAt(0);++r<i;)0!=(t=n.charCodeAt(r))?o+=t>=1&&t<=31||127==t||0==r&&t>=48&&t<=57||1==r&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==r&&1==i&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(r):n.charAt(r):o+="�";return o};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(i)}));var dn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var yn="_plane";function gn(e){var t=e.id;return C(e,"bpmn:SubProcess")?function(e){return e+yn}(t):t}function vn(e,t,n,i){var r=De('<ul class="bjs-breadcrumbs"></ul>'),o=i.getContainer(),a=ve(o);o.appendChild(r);var s=[];function l(e){e&&(s=function(e){for(var t=k(e),n=[],i=t;i;i=i.$parent)(C(i,"bpmn:SubProcess")||C(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var n=s.map((function(e){var n,r=(n=""+(n=e.name||e.id))&&n.replace(/[&<>"']/g,(function(e){return dn[e]})),o=De('<li><span class="bjs-crumb"><a title="'+r+'">'+r+"</a></span></li>"),a=i.findRoot(gn(e))||i.findRoot(e.id);if(!a&&C(e,"bpmn:Process")){var s=t.find((function(t){var n=k(t);return n&&n.processRef&&n.processRef===e}));a=i.findRoot(s.id)}return o.addEventListener("click",(function(){i.setRootElement(a)})),o}));r.innerHTML="";var o=n.length>1;a.toggle("bjs-breadcrumbs-shown",o),n.forEach((function(e){r.appendChild(e)}))}e.on("element.changed",(function(e){var t=k(e.element);h(s,(function(e){return e===t}))&&l()})),e.on("root.set",(function(e){l(e.element)}))}function bn(e,t){var n=null,i=new xn;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,!C(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,l=(o.y-a.y)*o.scale;0===s&&0===l||t.scroll({dx:s,dy:l}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function xn(){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)}}vn.$inject=["eventBus","elementRegistry","overlays","canvas"],bn.$inject=["eventBus","canvas"];var wn=180,En=160;function _n(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 An(e){return C(e,"bpmndi:BPMNDiagram")?e:An(e.$parent)}_n.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)}));var n=[];e.diagrams.forEach((function(e){var i=t.createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t.movePlaneElementsToOrigin(e.plane)}))}},_n.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;C(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!C(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(function(e,t){return v(t,(function(t){return C(e,t)}))}(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},_n.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=Rt(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),function(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}(t)}(e),i=n.x-wn,r=n.y-En;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)}))},_n.prototype.moveToDiPlane=function(e,t){var n=An(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},_n.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},_n.$inject=["eventBus","moddle"];var Sn=250;function Rn(e,t,n,i){mn.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",Sn,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",Sn,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],Sn,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r.canDrillDown(i)&&r.addOverlay(i),r.updateDrilldownOverlay(t),r.updateDrilldownOverlay(n),r.updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],Sn,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r.canDrillDown(i)&&r.addOverlay(i),r.updateDrilldownOverlay(t),r.updateDrilldownOverlay(n),r.updateDrilldownOverlay(i)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return r.canDrillDown(e)})).map((function(e){r.addOverlay(e)}))}))}i(Rn,mn),Rn.prototype.updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this.updateOverlayVisibility(n)}},Rn.prototype.canDrillDown=function(e){var t=this._canvas;return C(e,"bpmn:SubProcess")&&t.findRoot(gn(e))},Rn.prototype.updateOverlayVisibility=function(e){var t=this._overlays,n=e.businessObject,i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.flowElements&&n.flowElements.length;ve(i.html).toggle("bjs-drilldown-empty",!r)}},Rn.prototype.addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this.removeOverlay(e);var i=De('<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>');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(gn(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this.updateOverlayVisibility(e)},Rn.prototype.removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Rn.$inject=["canvas","eventBus","elementRegistry","overlays"];var Cn={__depends__:[pn,un,fn],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",vn],drilldownCentering:["type",bn],drilldownOverlayBehavior:["type",Rn],subprocessCompatibility:["type",_n]},kn=/^class /;function Mn(e){return"[object Array]"===Object.prototype.toString.call(e)}function Pn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Tn(){var e=Array.prototype.slice.call(arguments);1===e.length&&Mn(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var Dn=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Nn=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,On=/\/\*([^*]*)\*\//m;function Bn(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(e){return kn.test(e.toString())}(e)?Dn:Nn);if(!t)return[];var n=t[1]||t[2];return n&&n.split(",").map((function(e){var t=e.match(On);return(t&&t[1]||e).trim()}))||[]}function Ln(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a('No provider for "'+e+'"!')}};var n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(e){var t=n.join(" -> ");return n.length=0,new Error(t?e+" (Resolving: "+t+")":e)};function s(e,o){if(!i[e]&&-1!==e.indexOf(".")){for(var l=e.split("."),p=s(l.shift());l.length;)p=p[l.shift()];return p}if(Pn(r,e))return r[e];if(Pn(i,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),r[e]=i[e][0](i[e][1]),n.pop(),r[e]}return t.get(e,o)}function l(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Mn(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=Tn(e.slice())}return{fn:e,dependencies:(e.$inject||Bn(e)).map((function(e){return Pn(t,e)?t[e]:s(e)}))}}function p(e){var t=l(e),n=t.fn,i=t.dependencies;return new(Function.prototype.bind.apply(n,[null].concat(i)))}function c(e,t,n){var i=l(e,n),r=i.fn,o=i.dependencies;return r.apply(t,o)}function u(e){return Tn((function(t){return e.get(t)}))}function m(e,t){if(t&&t.length){var n,r,a,s,l=Object.create(null),p=Object.create(null),c=[],m=[],h=[];for(var f in i)n=i[f],-1!==t.indexOf(f)&&("private"===n[2]?-1===(r=c.indexOf(n[3]))?(s=u(a=n[3].createChild([],t)),c.push(n[3]),m.push(a),h.push(s),l[f]=[s,f,"private",a]):l[f]=[h[r],f,"private",m[r]]:l[f]=[n[2],n[1]],p[f]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach((function(e){-1!==n[1].$scope.indexOf(e)&&(l[f]=[n[2],n[1]],p[e]=!0)}));t.forEach((function(e){if(!p[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(l)}return new Ln(e,o)}var h,f,d={factory:c,type:p,value:function(e){return e}};function y(e,t){var n=e.__init__||[];return function(){n.forEach((function(e){"string"==typeof e?t.get(e):t.invoke(e)}))}}function g(e){var t=e.__exports__;if(t){var n=e.__modules__,r=Object.keys(e).reduce((function(t,n){return"__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t}),Object.create(null)),a=m((n||[]).concat(r)),s=Tn((function(e){return a.get(e)}));t.forEach((function(e){i[e]=[s,e,"private",a]}));var l=(e.__init__||[]).slice();return l.unshift((function(){a.init()})),y(e=Object.assign({},e,{__init__:l}),a)}return Object.keys(e).forEach((function(t){if("__init__"!==t&&"__depends__"!==t)if("private"!==e[t][2]){var n=e[t][0],r=e[t][1];i[t]=[d[n],In(n,r),n]}else i[t]=e[t]})),y(e,o)}function v(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(v,e)).indexOf(t)?e:e.concat(t)}this.get=s,this.invoke=c,this.instantiate=p,this.createChild=m,this.init=(h=e.reduce(v,[]).map(g),f=!1,function(){f||(f=!0,h.forEach((function(e){return e()})))})}function In(e,t){return"value"!==e&&Mn(t)&&(t=Tn(t.slice())),t}function jn(e,t){R.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})}i(jn,R),jn.prototype.canRender=function(){return!0},jn.prototype.drawShape=function(e,t,n){var i=U("rect");return B(i,{x:0,y:0,width:t.width||0,height:t.height||0}),Ut(t)?B(i,S({},this.FRAME_STYLE,n||{})):B(i,S({},this.SHAPE_STYLE,n||{})),D(e,i),i},jn.prototype.drawConnection=function(e,t,n){var i=ee(t.waypoints,S({},this.CONNECTION_STYLE,n||{}));return D(e,i),i},jn.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return J([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},jn.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 J(r)},jn.$inject=["eventBus","styles"];var Fn={__init__:["defaultRenderer"],defaultRenderer:["type",jn],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 S(this.style(t,n),{class:e})},this.style=function(t,n){s(t)||n||(n=t,t=[]);var i=y(t,(function(t,n){return S(t,e[n]||{})}),{});return n?S(i,n):i},this.computeStyle=function(e,n,i){return s(n)||(i=n,n=[]),t.style(n||[],S({},i,e||{}))}}]};function Vn(e,t){return Math.round(e*t)/t}function zn(e){return p(e)?e+"px":e}function Wn(e,t,n){var i=U("g");V(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var Gn={shape:["x","y","width","height"],connection:["waypoints"]};function $n(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function Hn(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}$n.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],$n.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=S({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),he(n,{position:"relative",overflow:"hidden",width:zn(e.width),height:zn(e.height)}),t.appendChild(n),n}(e),i=this._svg=U("svg");B(i,{width:"100%",height:"100%"}),D(n,i);var r=this._viewport=Wn(i,"viewport");!1!==e.deferUpdate&&(this._viewboxChanged=function(e,t){var n,i,r,o;function a(n){var a=Date.now(),p=n?0:o+t-a;if(p>0)return s(p);e.apply(r,i),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function p(){o=Date.now();for(var e=arguments.length,a=new Array(e),l=0;l<e;l++)a[l]=arguments[l];i=a,r=this,n||s(t)}return p.flush=function(){n&&a(!0),l()},p.cancel=l,p}(_(this._viewboxChanged,this),300)),t.on("diagram.init",(function(){t.fire("canvas.init",{svg:i,viewport:r})}),this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(function(){delete this._cachedViewbox}),this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},$n.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},$n.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach((function(t){var n=Ht(t);"root"===n?e.removeRootElement(t):e._removeElement(t,n)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},$n.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},$n.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},$n.prototype._getChildIndex=function(e){return y(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},$n.prototype._createLayer=function(e,t){void 0===t&&(t=1);var n=this._getChildIndex(t);return{group:Wn(this._viewport,"layer-"+e,n),index:t,visible:!0}},$n.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;var o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},$n.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=t.group;return t.visible?(W(n),t.visible=!1,n):n},$n.prototype._removeLayer=function(e){var t=this._layers[e];t&&(delete this._layers[e],W(t.group))},$n.prototype.getActiveLayer=function(){var e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},$n.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),e){var t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement}},$n.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},$n.prototype._findPlaneForRoot=function(e){return h(this._planes,(function(t){return t.rootElement===e}))},$n.prototype.getContainer=function(){return this._container},$n.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(d([i.gfx,i.secondaryGfx],(function(e){e&&(n?V(e).add(t):V(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},$n.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},$n.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},$n.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),V(this.getGraphics(e)).has(t)},$n.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},$n.prototype.getRootElement=function(){var e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},$n.prototype.addRootElement=function(e){var t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});var n=e.layer="root-"+t;this._ensureValid("root",e);var i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},$n.prototype.removeRootElement=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},$n.prototype.setRootElement=function(e,t){if(a(t))throw new Error("override not supported");if(e!==this._rootElement){if(!e)throw new Error("rootElement required");return this._findPlaneForRoot(e)||(e=this.addRootElement(e)),this._setRoot(e),e}},$n.prototype._removeRoot=function(e){var t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},$n.prototype._addRoot=function(e,t){var n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},$n.prototype._setRoot=function(e,t){var n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},$n.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");var n=Gn[e],i=g(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},$n.prototype._setParent=function(e,t,n){!function(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)}}(t.children,e,n),e.parent=t},$n.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},$n.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},$n.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},$n.prototype._removeElement=function(e,t){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},$n.prototype.removeShape=function(e){return this._removeElement(e,"shape")},$n.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},$n.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},$n.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},$n.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},$n.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,o,a,s,l=this._viewport,p=this.getSize();return e?(this._changeViewbox((function(){o=Math.min(p.width/e.width,p.height/e.height);var t=this._svg.createSVGMatrix().scale(o).translate(-e.x,-e.y);Z(l,t)})),e):(t=(i=this._rootElement?this.getActiveLayer():null)&&i.getBBox()||{},n=(r=Z(l))?r.matrix:function(e,t,n,i,r,o){var a=K.createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return q(a,e);case 6:return q(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),o=Vn(n.a,1e3),a=Vn(-n.e||0,1e3),s=Vn(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/o:0,y:s?s/o:0,width:p.width/o,height:p.height/o,scale:o,inner:{width:t.width||0,height:t.height||0,x:t.x||0,y:t.y||0},outer:p})},$n.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox((function(){e=S({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Hn(t,n)})),{x:n.e,y:n.f}},$n.prototype.scrollToElement=function(e,t){var n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));var i=this.findRoot(e);i!==this.getRootElement()&&this.setRootElement(i),t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var r,o,a=$t(e),s=Rt(a),l=this.viewbox(),p=this.zoom();l.y+=t.top/p,l.x+=t.left/p,l.width-=(t.right+t.left)/p,l.height-=(t.bottom+t.top)/p;var c=Rt(l);if(a.width<l.width&&a.height<l.height){var u=Math.max(0,s.right-c.right),m=Math.min(0,s.left-c.left),h=Math.max(0,s.bottom-c.bottom),f=Math.min(0,s.top-c.top);r=u||m,o=h||f}else r=a.x-l.x,o=a.y-l.y;this.scroll({dx:-r*p,dy:-o*p})},$n.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),Vn(i.a,1e3)):this.viewbox(e).scale;var n,i},$n.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,o=i.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(t=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(e?o.width/2-r.width/t/2:0),y:o.y+(e?o.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},$n.prototype._setZoom=function(e,t){var n,i,r,o,a=this._svg,s=this._viewport,l=a.createSVGMatrix(),p=a.createSVGPoint(),c=(i=s.getCTM()).a;return t?(n=S(p,t).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),o=i.multiply(r)):o=l.scale(e),Hn(this._viewport,o),o},$n.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},$n.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();e.waypoints?t=this.getGraphics(e).getBBox():t=e;return{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},$n.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Un="data-element-id";function Kn(e){this._elements={},this._eventBus=e}Kn.$inject=["eventBus"],Kn.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),B(t,Un,i),n&&B(n,Un,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Kn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(B(i.gfx,Un,""),i.secondaryGfx&&B(i.secondaryGfx,Un,""),delete t[n])},Kn.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Kn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&B(t,Un,i),t},Kn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&B(e,Un);var n=this._elements[t];return n&&n.element},Kn.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},Kn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},Kn.prototype.getAll=function(){return this.filter((function(e){return e}))},Kn.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},Kn.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Kn.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var qn=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},Yn=function(e){return!0===e.__refs_collection},Xn={extend:qn,isExtended:Yn};function Zn(e,t,n){var i=Xn.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach((function(i){e.set(i,t.inverse,n)}))}function Jn(e,t){if(!(this instanceof Jn))return new Jn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Jn.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Zn(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},Jn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Xn.isExtended(n)||Zn(this,t,e),n},Jn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Jn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Jn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Qn=Jn,ei=Xn;Qn.Collection=ei;var ti=new Qn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),ni=new Qn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),ii=new Qn({name:"attachers",collection:!0},{name:"host"}),ri=new Qn({name:"outgoing",collection:!0},{name:"source"}),oi=new Qn({name:"incoming",collection:!0},{name:"target"});function ai(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),ti.bind(this,"parent"),ni.bind(this,"labels"),ri.bind(this,"outgoing"),oi.bind(this,"incoming")}function si(){ai.call(this),ti.bind(this,"children"),ii.bind(this,"host"),ii.bind(this,"attachers")}function li(){si.call(this)}function pi(){si.call(this),ni.bind(this,"labelTarget")}function ci(){ai.call(this),ri.bind(this,"source"),oi.bind(this,"target")}i(si,ai),i(li,si),i(pi,si),i(ci,ai);var ui={connection:ci,shape:si,label:pi,root:li};function mi(){this._uid=12}mi.prototype.createRoot=function(e){return this.create("root",e)},mi.prototype.createLabel=function(e){return this.create("label",e)},mi.prototype.createShape=function(e){return this.create("shape",e)},mi.prototype.createConnection=function(e){return this.create("connection",e)},mi.prototype.create=function(e,t){return(t=S({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=ui[e];if(!n)throw new Error("unknown type: <"+e+">");return S(new n,t)}(e,t)};var hi=Array.prototype.slice;function fi(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function di(){}function yi(e,t){this._eventBus=e,this._elementRegistry=t}function gi(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}fi.prototype.on=function(e,t,n,i){if(e=s(e)?e:[e],c(t)&&(i=n,n=t,t=1e3),!p(t))throw new Error("priority must be a number");var r=n;i&&((r=_(n,i)).__fn=n.__fn||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},fi.prototype.once=function(e,t,n,i){var r=this;if(c(t)&&(i=n,n=t,t=1e3),!p(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o.__fn=n,this.on(e,t,o)},fi.prototype.off=function(e,t){e=s(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},fi.prototype.createEvent=function(e){var t=new di;return t.init(e),t},fi.prototype.fire=function(e,t){var n,i,r,o;if(o=hi.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof di?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},fi.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},fi.prototype._destroy=function(){this._listeners={}},fi.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},fi.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},fi.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},fi.prototype._getListeners=function(e){return this._listeners[e]},fi.prototype._setListeners=function(e,t){this._listeners[e]=t},fi.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r.__fn!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},di.prototype.stopPropagation=function(){this.cancelBubble=!0},di.prototype.preventDefault=function(){this.defaultPrevented=!0},di.prototype.init=function(e){S(this,e||{})},yi.$inject=["eventBus","elementRegistry"],yi.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(V(t=U("g")).add("djs-children"),D(n.parentNode,t))):t=n,t},yi.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return xe(t),t},yi.prototype._createContainer=function(e,t,n,i){var r=U("g");V(r).add("djs-group"),void 0!==n?gi(r,t,t.childNodes[n]):D(t,r);var o=U("g");V(o).add("djs-element"),V(o).add("djs-"+e),i&&V(o).add("djs-frame"),D(r,o);var a=U("g");return V(a).add("djs-visual"),D(o,a),o},yi.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,Ut(t))},yi.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=y(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),d(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e);d(t.slice().reverse(),(function(e){gi(i.getGraphics(e).parentNode,r)}))}}))},yi.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},yi.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},yi.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},yi.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},yi.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),at(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?B(n,"display","none"):B(n,"display","block")}},yi.prototype.remove=function(e){W(this._elementRegistry.getGraphics(e).parentNode)};var vi={__depends__:[Fn],__init__:["canvas"],canvas:["type",$n],elementRegistry:["type",Kn],elementFactory:["type",mi],eventBus:["type",fi],graphicsFactory:["type",yi]};function bi(e){return function(e){var t=new Ln(e);return t.init(),t}([{config:["value",e=e||{}]},vi].concat(e.modules||[]))}function xi(e,t){this.injector=t=t||bi(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function wi(){}function Ei(e,t){this.model=e,this.properties=t}xi.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},xi.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},wi.prototype.get=function(e){return this.$model.properties.get(this,e)},wi.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Ei.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(wi.prototype);d(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),d(e,_((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var _i={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ai={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Si(e,t){var n=Ai[e];return n?n(t):t}function Ri(e){return!!_i[e]}function Ci(e){return!!Ai[e]}function ki(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Mi(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Pi(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,d(e,_(this.registerPackage,this))}function Ti(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Di(e){this.model=e}function Ni(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Oi(e){this.properties=new Di(this),this.factory=new Ei(this,this.properties),this.registry=new Pi(e,this.properties),this.typeCache={}}Mi.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},i=Object(e),d(t,(function(t){t in i&&(n[t]=e[t])})),n;var e,t,n,i},Mi.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},Mi.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(-1===s)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},Mi.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=ki(r[0],i),a=ki(r[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Mi.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Mi.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Mi.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Mi.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Mi.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Mi.prototype.hasProperty=function(e){return this.propertiesByName[e]},Mi.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(d(e.properties,_((function(n){n=S({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},Pi.prototype.getPackage=function(e){return this.packageMap[e]},Pi.prototype.getPackages=function(){return this.packages},Pi.prototype.registerPackage=function(e){e=S({},e);var t=this.packageMap;Ti(t,e,"prefix"),Ti(t,e,"uri"),d(e.types,_((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Pi.prototype.registerType=function(e,t){var n=ki((e=S({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:S(e.meta||{})})).name,t.prefix),i=n.name,r={};d(e.properties,_((function(e){var t=ki(e.name,n.prefix),i=t.name;Ri(e.type)||(e.type=ki(e.type,t.prefix).name),S(e,{ns:t,name:i}),r[i]=e}),this)),S(e,{ns:n,name:i,propertiesByName:r}),d(e.extends,_((function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},Pi.prototype.mapTypes=function(e,t,n){var i=Ri(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(e){return a(e,!0)}function a(n,i){var o=ki(n,Ri(n)?"":e.prefix);r.mapTypes(o,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");d(i.superClass,n?o:a),t(i,!n),d(i.traits,o)},Pi.prototype.getEffectiveDescriptor=function(e){var t=ki(e),n=new Mi(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Pi.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Di.prototype.set=function(e,t,n){var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:Ni(e,i,n):e.$attrs[t]=n},Di.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&Ni(e,n,[]),e[i]},Di.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=S({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Di.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Di.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Oi.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Oi.prototype.getType=function(e){var t=this.typeCache,n=u(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Oi.prototype.createAny=function(e,t,n){var i=ki(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),d(n,(function(e,t){l(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},Oi.prototype.getPackage=function(e){return this.registry.getPackage(e)},Oi.prototype.getPackages=function(){return this.registry.getPackages()},Oi.prototype.getElementDescriptor=function(e){return e.$descriptor},Oi.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Oi.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Oi.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Bi=String.fromCharCode,Li=Object.prototype.hasOwnProperty,Ii=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ji={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Fi(e,t,n,i){return i?Li.call(ji,i)?ji[i]:"&"+i+";":Bi(t||parseInt(n,16))}function Vi(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Ii,Fi):e}Object.keys(ji).forEach((function(e){ji[e.toUpperCase()]=ji[e]}));var zi="xsi:type",Wi="non-whitespace outside of root node";function Gi(e){return new Error(e)}function $i(e){return"missing namespace for prefix <"+e+">"}function Hi(e){return{get:e,enumerable:!0}}function Ui(e){var t,n={};for(t in e)n[t]=e[t];return n}function Ki(e){return e+"$uri"}function qi(){return{line:0,column:0}}function Yi(e){throw e}function Xi(e){if(!this)return new Xi(e);var t,n,i,r,o,a,s,l,p,c=e&&e.proxy,u=Yi,m=qi,h=!1,f=!1,d=null,y=!1;function g(e){e instanceof Error||(e=Gi(e)),d=e,u(e,m)}function v(e){o&&(e instanceof Error||(e=Gi(e)),o(e,m))}this.on=function(e,p){if("function"!=typeof p)throw Gi("required args <name, cb>");switch(e){case"openTag":n=p;break;case"text":t=p;break;case"closeTag":i=p;break;case"error":u=p;break;case"warn":o=p;break;case"cdata":r=p;break;case"attention":l=p;break;case"question":s=p;break;case"comment":a=p;break;default:throw Gi("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Gi("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,p=n,this},this.parse=function(e){if("string"!=typeof e)throw Gi("required args <xml=string>");return d=null,function(e){var o,u,d,b,x,w,E,_,A,S,R,C=f?[]:null,k=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[Ki(n)]=t;return i}(p):null,M=[],P=0,T=!1,D=!1,N=0,O=0,B="",L=0;function I(){if(null!==R)return R;var e,t,n,i,r,o,a,s,l,c,u,m=f&&k.xmlns,d=f&&h?[]:null,y=L,g=B,b=g.length,x={},w={};e:for(;y<b;y++)if(l=!1,!(32===(c=g.charCodeAt(y))||c<14&&c>8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(v("illegal first char attribute name"),l=!0),u=y+1;u<b;u++)if(!((c=g.charCodeAt(u))>96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){v("missing attribute value"),y=u;continue e}if(61===c)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),l=!0),34===(c=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),l=!0);else if(39===c)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u<b&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++);for(-1===u&&(v("missing closing quotes"),u=b,l=!0),l||(o=g.substring(y,u)),y=u;u+1<b&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++)y===u&&(v("illegal character after attribute end"),l=!0);if(y=u+1,!l)if(s in w)v("attribute <"+s+"> already defined");else if(w[s]=!0,f)if(h){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=Vi(o),t=Ki(r),!(a=p[e])){if("xmlns"===r||t in k&&k[t]!==e)do{a="ns"+P++}while(void 0!==k[a]);else a=r;p[e]=a}k[r]!==a&&(i||(k=Ui(k),i=!0),k[r]=a,"xmlns"===r&&(k[Ki(a)]=e,m=a),k[t]=e),x[s]=o;continue}d.push(s,o)}else-1!==(c=s.indexOf(":"))?(n=k[s.substring(0,c)])?((s=m===n?s.substr(c+1):n+s.substr(c))===zi&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=k[n]||n)+o.substring(c)):o=m+":"+o),x[s]=o):v($i(s.substring(0,c))):x[s]=o;else x[s]=o}if(h)for(y=0,b=d.length;y<b;y++){if(s=d[y++],o=d[y],-1!==(c=s.indexOf(":"))){if(!(n=k[s.substring(0,c)])){v($i(s.substring(0,c)));continue}(s=m===n?s.substr(c+1):n+s.substr(c))===zi&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=k[n]||n)+o.substring(c)):o=m+":"+o)}x[s]=o}return R=x}function j(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,s=O;N>=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>N);)r+=1,a=s;return-1==N?(o=s,n=e.substring(O)):0===O?n=e.substring(O,N):(o=N-a,n=-1==O?e.substring(N):e.substring(N,O+1)),{data:n,line:r,column:o}}m=j,c&&(S=Object.create({},{name:Hi((function(){return _})),originalName:Hi((function(){return A})),attrs:Hi(I),ns:Hi((function(){return k}))}));for(;-1!==O;){if(-1===(N=60===e.charCodeAt(O)?O:e.indexOf("<",O)))return M.length?g("unexpected end of file"):0===O?g("missing start tag"):void(O<e.length&&e.substring(O).trim()&&v(Wi));if(O!==N)if(M.length){if(t&&(t(e.substring(O,N),Vi,m),y))return}else if(e.substring(O,N).trim()&&(v(Wi),y))return;if(33===(x=e.charCodeAt(N+1))){if(91===(b=e.charCodeAt(N+2))&&"CDATA["===e.substr(N+3,6)){if(-1===(O=e.indexOf("]]>",N)))return g("unclosed cdata");if(r&&(r(e.substring(N+9,O),m),y))return;O+=3;continue}if(45===b&&45===e.charCodeAt(N+3)){if(-1===(O=e.indexOf("--\x3e",N)))return g("unclosed comment");if(a&&(a(e.substring(N+4,O),Vi,m),y))return;O+=3;continue}}if(63!==x){for(u=N+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return O=-1,g("unclosed tag");if(34===w)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===w)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===w){O=u;break}}if(33!==x){if(R={},47===x){if(T=!1,D=!0,!M.length)return g("missing open tag");if(u=_=M.pop(),b=N+2+u.length,e.substring(N+2,b)!==u)return g("closing tag mismatch");for(;b<O;b++)if(!(32===(x=e.charCodeAt(b))||x>8&&x<14))return g("close tag")}else{if(47===e.charCodeAt(O-1)?(u=_=e.substring(N+1,O-1),T=!0,D=!0):(u=_=e.substring(N+1,O),T=!0,D=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return g("illegal first char nodeName");for(b=1,d=u.length;b<d;b++)if(!((x=u.charCodeAt(b))>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){_=u.substring(0,b),R=null;break}return g("invalid nodeName")}D||M.push(_)}if(f){if(o=k,T&&(D||C.push(o),null===R&&(h=-1!==u.indexOf("xmlns",b))&&(L=b,B=u,I(),h=!1)),A=_,-1!==(x=_.indexOf(":"))){if(!(E=k[_.substring(0,x)]))return g("missing namespace on <"+A+">");_=_.substr(x+1)}else E=k.xmlns;E&&(_=E+":"+_)}if(T&&(L=b,B=u,n&&(c?n(S,Vi,D,m):n(_,I,Vi,D,m),y)))return;if(D){if(i&&(i(c?S:_,Vi,T,m),y))return;f&&(k=T?o:C.pop())}O+=1}else{if(l&&(l(e.substring(N,O+1),Vi,m),y))return;O+=1}}else{if(-1===(O=e.indexOf("?>",N)))return g("unclosed question");if(s&&(s(e.substring(N,O+2),m),y))return;O+=2}}}(e),m=qi,y=!1,d},this.stop=function(){y=!0}}function Zi(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Ji={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Qi="xsi:type";function er(e){return e.xml&&e.xml.serialize}function tr(e){return er(e)===Qi}function nr(e,t){return Zi(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function ir(e){return new Error(e)}function rr(e){return e.$descriptor}function or(e){S(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw ir("expected element");var t,n=this.elementsById,i=rr(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw ir("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function ar(){}function sr(){}function lr(){}function pr(e,t){this.property=e,this.context=t}function cr(e,t){this.element=t,this.propertyDesc=e}function ur(){}function mr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function hr(e,t,n){mr.call(this,e,t,n)}function fr(e,t,n){this.model=e,this.context=n}function dr(e){e instanceof Oi&&(e={model:e}),S(this,{lax:!1},e)}ar.prototype.handleEnd=function(){},ar.prototype.handleText=function(){},ar.prototype.handleNode=function(){},sr.prototype=Object.create(ar.prototype),sr.prototype.handleNode=function(){return this},lr.prototype=Object.create(ar.prototype),lr.prototype.handleText=function(e){this.body=(this.body||"")+e},pr.prototype=Object.create(lr.prototype),pr.prototype.handleNode=function(e){if(this.element)throw ir("expected no sub nodes");return this.element=this.createReference(e),this},pr.prototype.handleEnd=function(){this.element.id=this.body},pr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},cr.prototype=Object.create(lr.prototype),cr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Si(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},ur.prototype=Object.create(lr.prototype),ur.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},mr.prototype=Object.create(ur.prototype),mr.prototype.addReference=function(e){this.context.addReference(e)},mr.prototype.handleText=function(e){if(!rr(this.element).bodyProperty)throw ir("unexpected body text <"+e+">");lr.prototype.handleText.call(this,e)},mr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=rr(t).bodyProperty;n&&void 0!==e&&(e=Si(n.type,e),t.set(n.name,e))},mr.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=rr(i),o=this.context,a=new i({}),s=this.model;return d(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?d(e.split(" "),(function(e){o.addReference({element:a,property:i.ns.name,id:e})})):o.addReference({element:a,property:i.ns.name,id:e}):(i?e=Si(i.type,e):"xmlns"!==n&&(t=ki(n,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},mr.prototype.getPropertyForNode=function(e){var t,n,i=ki(e.name),r=this.type,o=this.model,a=rr(r),s=i.name,l=a.propertiesByName[s];if(l&&!l.isAttr)return tr(l)&&(t=e.attributes[Qi])?(t=function(e,t){var n=ki(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,o),S({},l,{effectiveType:rr(n=o.getType(t)).name})):l;var p=o.getPackage(i.prefix);if(p){if(t=nr(i,p),n=o.getType(t),l=h(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return S({},l,{effectiveType:rr(n).name})}else if(l=h(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw ir("unrecognized element <"+i.name+">")},mr.prototype.toString=function(){return"ElementDescriptor["+rr(this.type).name+"]"},mr.prototype.valueHandler=function(e,t){return new cr(e,t)},mr.prototype.referenceHandler=function(e){return new pr(e,this.context)},mr.prototype.handler=function(e){return"Element"===e?new fr(this.model,e,this.context):new mr(this.model,e,this.context)},mr.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Ci(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(S(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},hr.prototype=Object.create(mr.prototype),hr.prototype.createElement=function(e){var t=e.name,n=ki(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&nr(n,o)||t;if(!r.hasType(a))throw ir("unexpected element <"+e.originalName+">");return mr.prototype.createElement.call(this,e)},fr.prototype=Object.create(ur.prototype),fr.prototype.createElement=function(e){var t=e.name,n=ki(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},fr.prototype.handleChild=function(e){var t=new fr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},fr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},dr.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof mr?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,a=new or(S({},t,{rootHandler:i})),s=new Xi({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function p(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw ir(l)}function c(e,t){return p(e,t,!0)}i.context=a,l.push(i);var u=/^<\?xml /i,m=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var d=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(d).on("openTag",(function(e,t,n,i){var r=e.attrs||{},a=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){p(e,t,o)&&l.push(new sr)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=m.exec(e),n=t&&t[1];n&&!h.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",p).on("warn",c),new Promise((function(t,n){var r;try{s.parse(e),function(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=rr(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=r.get(s.name),p=l.indexOf(t);-1===p&&(p=l.length),o?l[p]=o:l.splice(p,1)}else r.set(s.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=ir("failed to parse document as <"+i.type.$descriptor.name+">"));var l=a.warnings,p=a.references,c=a.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:c,references:p,warnings:l})}))},dr.prototype.handler=function(e){return new hr(this.model,e)};var yr=/<|>|'|"|&|\n\r|\n/g,gr=/<|>|&/g;function vr(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function br(e,t){return Zi(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function xr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function wr(e){return u(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var Er={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},_r={"<":"lt",">":"gt","&":"amp"};function Ar(e,t,n){return(e=u(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Sr(e){this.tagName=e}function Rr(){}function Cr(e){this.tagName=e}function kr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Mr(e,t){kr.call(this,e,t)}function Pr(){this.value="",this.write=function(e){this.value+=e}}function Tr(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Dr(e){return e=S({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Pr,r=new Tr(i,e.format);if(e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new kr).build(t).serializeTo(r),!n)return i.value}}}function Nr(e,t){Oi.call(this,e,t)}Sr.prototype.build=function(e){return this.element=e,this},Sr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Rr.prototype.serializeValue=Rr.prototype.serializeTo=function(e){e.append(this.escape?Ar(this.value,gr,_r):this.value)},Rr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(gr)&&(this.escape=!0),this},xr(Cr,Rr),Cr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},kr.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return f(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!m(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(f(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return f(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},kr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?S({localName:t.ns.localName},e):S({localName:br(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},kr.prototype.nsPropertyTagName=function(e){return function(e,t){return S({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},kr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},kr.prototype.nsAttributeName=function(e){var t;if(t=u(e)?ki(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:S({localName:t.localName},n)},kr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return d(e,(function(r,o){"$body"===o?n.push((new Rr).build({type:"String"},r)):"$children"===o?d(r,(function(e){n.push(new kr(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},kr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=ki(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},kr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return d(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},kr.prototype.parseGenericAttributes=function(e,t){var n=this;d(t,(function(t){if(t.name!==Qi)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},kr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;d(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Rr).build(e,r[0]));else if(Ci(e.type))d(r,(function(i){n.push(new Cr(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)d(r,(function(i){n.push(new Sr(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var a=tr(e),s=function(e){return"property"===er(e)}(e);d(r,(function(i){var r;r=a?new Mr(t,e):s?new kr(t,e):new kr(t),n.push(r.build(i))}))}}))},kr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new vr(t):n=t),n},kr.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},kr.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(r=Ji[s]||o&&(o.getPackage(s)||{}).uri,!(l=l||r||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(l))){for(n=s,i=1;a.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return s&&a.mapPrefix(s,l),e},kr.prototype.parseAttributes=function(e){var t=this,n=this.element;d(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];d(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},kr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),wr(e)},kr.prototype.addAttribute=function(e,t){var n=this.attrs;u(t)&&(t=Ar(t,yr,Er));var i=function(e,t){t=x(t);var n=s(e)?-1:void 0;return d(e,(function(e,i){if(t(e,i))return n=i,!1})),n}(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},kr.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),d(t,(function(t){e.append(" ").append(wr(t.name)).append('="').append(t.value).append('"')}))},kr.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Rr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),d(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},xr(Mr,kr),Mr.prototype.parseNsAttributes=function(e){var t=kr.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Qi),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},Mr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Nr.prototype=Object.create(Oi.prototype),Nr.prototype.fromXML=function(e,t,n){u(t)||(n=t,t="bpmn:Definitions");var i=new dr(S({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Nr.prototype.toXML=function(e,t){var n=new Dr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var Or={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function Br(e,t){return new Nr(S({},Or,e),t)}function Lr(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(!(t>=1&&c(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+e.name+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var i=Array.prototype.slice.call(arguments,0,-1);e.apply(this,i).then((function(e){var t=Object.keys(e)[0];return n(null,e[t])}),(function(e){return n(e,e.warnings)}))}}function Ir(e,t){return e.$instanceOf(t)}function jr(e,t){var n={},i=[],r={};function o(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function s(n,i){try{var o=r[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:Pt(n)}));return e.element(n,r[n.id],i)}(n,i);return a(n),o}catch(e){l(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:Pt(n)})),console.error(e)}}function l(t,n){e.error(t,n)}function p(e){var n,i=e.bpmnElement;i?r[i.id]?l(t("multiple DI elements defined for {element}",{element:Pt(i)}),{element:i}):(r[i.id]=e,m(n=i,"di")||Object.defineProperty(n,"di",{enumerable:!1,get:function(){throw new Error("Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472")}})):l(t("no bpmnElement referenced in {element}",{element:Pt(e)}),{element:e})}function c(e){var t;p(t=e.plane),d(t.planeElement,u)}function u(e){p(e)}function y(){for(;i.length;)i.shift()()}function g(e,t){P(e,t),A(e.ioSpecification,t),_(e.artifacts,t),a(e)}function v(e,t){s(e,t)}function b(e,t){s(e,t)}function x(e,t){s(e,t)}function w(e,t){s(e,t)}function E(e,t){s(e,t)}function _(e,t){d(e,(function(e){Ir(e,"bpmn:Association")?i.push((function(){E(e,t)})):E(e,t)}))}function A(e,t){e&&(d(e.dataInputs,o(x,t)),d(e.dataOutputs,o(w,t)))}function S(e,t){P(e,t),_(e.artifacts,t)}function R(e,t){var n=s(e,t);Ir(e,"bpmn:SubProcess")&&S(e,n||t),Ir(e,"bpmn:Activity")&&A(e.ioSpecification,t),i.push((function(){d(e.dataInputAssociations,o(b,t)),d(e.dataOutputAssociations,o(b,t))}))}function C(e,t){s(e,t)}function k(e,t){i.push((function(){var n=s(e,t);e.childLaneSet&&M(e.childLaneSet,n||t),function(e){d(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function M(e,t){d(e.lanes,o(k,t))}function P(e,n){!function(e,n){d(e,(function(e){Ir(e,"bpmn:SequenceFlow")?i.push((function(){!function(e,t){s(e,t)}(e,n)})):Ir(e,"bpmn:BoundaryEvent")?i.unshift((function(){R(e,n)})):Ir(e,"bpmn:FlowNode")?R(e,n):Ir(e,"bpmn:DataObject")||(Ir(e,"bpmn:DataStoreReference")||Ir(e,"bpmn:DataObjectReference")?C(e,n):l(t("unrecognized flowElement {element} in context {context}",{element:Pt(e),context:n?Pt(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){d(e,o(M,t))}(e.laneSets,n)}function T(e,t){var n=s(e,t),i=e.processRef;i&&g(i,n||t)}return{handleDeferred:y,handleDefinitions:function(a,s){var u=a.diagrams;if(s&&-1===u.indexOf(s))throw new Error(t("diagram not part of bpmn:Definitions"));if(!s&&u&&u.length&&(s=u[0]),!s)throw new Error(t("no diagram to display"));r={},c(s);var m=s.plane;if(!m)throw new Error(t("no plane for {element}",{element:Pt(s)}));var b=m.bpmnElement;if(!b){if(b=function(e){return h(e.rootElements,(function(e){return Ir(e,"bpmn:Process")||Ir(e,"bpmn:Collaboration")}))}(a),!b)throw new Error(t("no process or collaboration to display"));l(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Pt(m),rootElement:Pt(b)})),m.bpmnElement=b,p(m)}var x,w,E=function(t,n){return e.root(t,r[t.id],n)}(b,m);if(Ir(b,"bpmn:Process")||Ir(b,"bpmn:SubProcess"))g(b,E);else{if(!Ir(b,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:Pt(m),rootElement:Pt(b)}));w=E,d((x=b).participants,o(T,w)),_(x.artifacts,w),i.push((function(){!function(e,t){d(e,o(v,t))}(x.messageFlows,w)})),function(e,t){var i=f(e,(function(e){return!n[e.id]&&Ir(e,"bpmn:Process")&&e.laneSets}));i.forEach(o(g,t))}(a.rootElements,E)}y()},handleSubProcess:S,registerDi:p}}function Fr(e,t,n){var i,r,o,a,s=[];function l(e,t){var n=new jr({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}},o);t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;C(i,"bpmn:Process")||C(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(C(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=C(r,"bpmn:Collaboration")?r:h(e.rootElements,(function(e){if(C(e,"bpmn:Collaboration"))return h(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=function(e,t){var n=[];return d(e,(function(e,i){n.push(t(e,i))})),n}(n.participants,(function(e){return e.processRef})),o.push(n));var a=Vr(o),s=[t],l=[i];return d(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===l.indexOf(t)&&(s.push(e),l.push(t))})),s}(e,t);if(!r)throw new Error(o("no diagram to display"));d(r,(function(t){n.handleDefinitions(e,t)}));var l=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(l+"_plane")||a.findRoot(l))}return new Promise((function(p,c){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),a=e.get("canvas"),r.fire("import.render.start",{definitions:t}),l(t,n),r.fire("import.render.complete",{error:undefined,warnings:s}),p({warnings:s})}catch(e){return e.warnings=s,c(e)}}))}function Vr(e){var t=[];return d(e,(function(e){e&&(t.push(e),t=t.concat(Vr(e.flowElements)))})),t}var zr,Wr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',Gr={verticalAlign:"middle"},$r={color:"#404040"},Hr={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Ur={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Kr={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"};function qr(){zr||(he(zr=De('<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg></a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>'),Hr),he(Be("svg",zr),Gr),he(Be(".backdrop",zr),Ur),he(Be(".notice",zr),Kr),he(Be(".link",zr),$r,{margin:"15px 20px 15px 10px",alignSelf:"center"}),Te.bind(zr,".backdrop","click",(function(e){document.body.removeChild(zr)}))),document.body.appendChild(zr)}function Yr(e){var t,n;e=S({},Zr,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,he(Be("svg",n=De('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Wr+"</a>")),Gr),he(n,$r,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),t.appendChild(n),Ce(n,"click",(function(e){qr(),e.preventDefault()})),this._init(this._container,this._moddle,e)}function Xr(e,t){return e.warnings=t,e}i(Yr,xi),Yr.prototype.importXML=Lr((function(e,t){var n=this;return new Promise((function(i,r){e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"bpmn:Definitions").then((function(e){var o,a,s=e.rootElement,l=e.references,p=e.warnings,c=e.elementsById;s=n._emit("import.parse.complete",(o={error:null,definitions:s,elementsById:c,references:l,warnings:p},a=n.get("eventBus").createEvent(o),Object.defineProperty(a,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:o.warnings,references:o.references,elementsById:o.elementsById}}}),a))||s,n.importDefinitions(s,t).then((function(e){var t=[].concat(p,e.warnings||[]);return n._emit("import.done",{error:null,warnings:t}),i({warnings:t})})).catch((function(e){var t=[].concat(p,e.warnings||[]);return n._emit("import.done",{error:e,warnings:t}),r(Xr(e,t))}))})).catch((function(e){return n._emit("import.parse.complete",{error:e}),e=function(e){var 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}(e),n._emit("import.done",{error:e,warnings:e.warnings}),r(e)}))}))})),Yr.prototype.importDefinitions=Lr((function(e,t){var n=this;return new Promise((function(i,r){n._setDefinitions(e),n.open(t).then((function(e){var t=e.warnings;return i({warnings:t})})).catch((function(e){return r(e)}))}))})),Yr.prototype.open=Lr((function(e){var t=this._definitions,n=e,i=this;return new Promise((function(r,o){if(!t){var a=new Error("no XML imported");return o(Xr(a,[]))}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return h(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){var s=new Error("BPMNDiagram <"+e+"> not found");return o(Xr(s,[]))}try{i.clear()}catch(e){return o(Xr(e,[]))}Fr(i,t,n).then((function(e){var t=e.warnings;return r({warnings:t})})).catch((function(e){return o(e)}))}))})),Yr.prototype.saveXML=Lr((function(e){e=e||{};var t=this,n=this._definitions;return new Promise((function(i){if(!n)return i({error:new Error("no definitions loaded")});n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then((function(e){var n=e.xml;return n=t._emit("saveXML.serialized",{xml:n})||n,i({xml:n})}))})).catch((function(e){return{error:e}})).then((function(e){t._emit("saveXML.done",e);var n=e.error;return n?Promise.reject(n):e}))})),Yr.prototype.saveSVG=Lr((function(e){var t=this;return new Promise((function(e,n){var i,r;t._emit("saveSVG.start");try{var o=t.get("canvas"),a=o.getActiveLayer(),s=Be("defs",o._svg),l=rt(a),p=s?"<defs>"+rt(s)+"</defs>":"",c=a.getBBox();i='<?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="'+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+p+l+"</svg>"}catch(e){r=e}return t._emit("saveSVG.done",{error:r,svg:i}),r?n(r):e({svg:i})}))})),Yr.prototype._setDefinitions=function(e){this._definitions=e},Yr.prototype.getModules=function(){return this._modules},Yr.prototype.clear=function(){this.getDefinitions()&&xi.prototype.clear.call(this)},Yr.prototype.destroy=function(){xi.prototype.destroy.call(this),Le(this._container)},Yr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Yr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Yr.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=Be(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Yr.prototype.getDefinitions=function(){return this._definitions},Yr.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Yr.prototype._init=function(e,t,n){var i,r,o=n.modules||this.getModules(),a=n.additionalModules||[],s=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],o,a),l=S((i=["additionalModules"],r={},d(Object(n),(function(e,t){-1===i.indexOf(t)&&(r[t]=e)})),r),{canvas:S({},n.canvas,{container:e}),modules:s});xi.call(this,l),n&&n.container&&this.attachTo(n.container)},Yr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Yr.prototype._createContainer=function(e){var t=De('<div class="bjs-container"></div>');return he(t,{width:Jr(e.width),height:Jr(e.height),position:e.position}),t},Yr.prototype._createModdle=function(e){return new Br(S({},this._moddleExtensions,e.moddleExtensions))},Yr.prototype._modules=[];var Zr={width:"100%",height:"100%",position:"relative"};function Jr(e){return e+(p(e)?"px":"")}function Qr(e){Yr.call(this,e)}i(Qr,Yr),Qr.prototype._modules=[Bt,Et,tn,pn,Cn],Qr.prototype._moddleExtensions={};var eo={"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 to(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=eo[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function no(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return eo[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);to(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)to(e,i,t[i])}(e,t);return e}var io="http://www.w3.org/2000/svg",ro='<svg xmlns="'+io+'"';function oo(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(io)&&(e=ro+e.substring(4)):(e=ro+">"+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 ao(e,t){var n;return"<"===e.charAt(0)?(n=oo(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(io,e),t&&no(n,t),n}function so(e){return k(e).get("zeebe:modelerTemplateIcon")}ao("svg");function lo(e,t){this._bpmnRenderer=e,R.call(this,t,1250)}n(lo,R),lo.prototype.canRender=function(e){return!function(e){return e&&!!e.labelTarget}(e)&&(C(e,"bpmn:Task")&&!!so(e))},lo.prototype.drawShape=function(e,t){var n=(0,this._bpmnRenderer.handlers["bpmn:Task"])(e,t),i=so(t),r=ao("image");return no(r,{href:i,x:5,y:5,width:18,height:18}),function(e,t){(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,r),n},lo.$inject=["bpmnRenderer","eventBus"];const po=[{drilldownOverlayBehavior:["value",null]},{__init__:["elementTemplatesIconsRenderer"],elementTemplatesIconsRenderer:["type",lo]}],co={zeebe:{name:"zeebe",prefix:"zeebe",uri:"http://camunda.org/schema/zeebe/1.0",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"ZeebeServiceTask",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:SendTask","bpmn:EndEvent","bpmn:IntermediateThrowEvent"],properties:[{name:"retryCounter",type:"String",isAttr:!0}]},{name:"IoMapping",superClass:["Element"],properties:[{name:"ioMapping",type:"IoMapping"},{name:"inputParameters",isMany:!0,type:"Input"},{name:"outputParameters",isMany:!0,type:"Output"}],meta:{allowedIn:["bpmn:CallActivity","bpmn:Event","bpmn:ReceiveTask","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"InputOutputParameter",properties:[{name:"source",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"}]},{name:"Subscription",superClass:["Element"],properties:[{name:"correlationKey",isAttr:!0,type:"String"}]},{name:"Input",superClass:["InputOutputParameter"],meta:{allowedIn:["bpmn:CallActivity","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"Output",superClass:["InputOutputParameter"],meta:{allowedIn:["bpmn:CallActivity","bpmn:Event","bpmn:ReceiveTask","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"TaskHeaders",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask","bpmn:UserTask"]},properties:[{name:"values",type:"Header",isMany:!0}]},{name:"Header",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"key",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"TaskDefinition",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask"]},properties:[{name:"type",type:"String",isAttr:!0},{name:"retries",type:"String",isAttr:!0}]},{name:"LoopCharacteristics",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask","bpmn:ReceiveTask","bpmn:SubProcess"]},properties:[{name:"inputCollection",type:"String",isAttr:!0},{name:"inputElement",type:"String",isAttr:!0},{name:"outputCollection",type:"String",isAttr:!0},{name:"outputElement",type:"String",isAttr:!0}]},{name:"CalledElement",superClass:["Element"],meta:{allowedIn:["bpmn:CallActivity"]},properties:[{name:"processId",type:"String",isAttr:!0},{name:"processIdExpression",type:"String",isAttr:!0},{name:"propagateAllChildVariables",isAttr:!0,type:"Boolean"}]},{name:"UserTaskForm",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"body",type:"String",isBody:!0}]},{name:"FormDefinition",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"formKey",type:"String",isAttr:!0}]},{name:"CalledDecision",superClass:["Element"],meta:{allowedIn:["bpmn:BusinessRuleTask"]},properties:[{name:"decisionId",type:"String",isAttr:!0},{name:"resultVariable",type:"String",isAttr:!0}]},{name:"AssignmentDefinition",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"assignee",type:"String",isAttr:!0},{name:"candidateGroups",type:"String",isAttr:!0}]},{name:"Properties",superClass:["Element"],properties:[{name:"properties",type:"Property",isMany:!0}],meta:{allowedIn:["zeebe:PropertiesHolder"]}},{name:"Property",properties:[{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}],meta:{allowedIn:["zeebe:PropertiesHolder"]}},{name:"PropertiesHolder",isAbstract:!0,extends:["bpmn:FlowNode"]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Collaboration","bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"},{name:"modelerTemplateIcon",isAttr:!0,type:"String"}]}]}};function uo(e={}){e={...e,moddleExtensions:{...co,...e.moddleExtensions}},Qr.call(this,e)}return n(uo,Qr),uo.prototype._camundaCloudModules=[...po],uo.prototype._modules=[].concat(Qr.prototype._modules,uo.prototype._camundaCloudModules),uo}));
1
+ !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).BpmnViewer=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n={exports:{}};function i(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}"function"==typeof Object.create?n.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:n.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};const r=Object.prototype.toString,o=Object.prototype.hasOwnProperty;function a(e){return void 0!==e}function s(e){return"[object Array]"===r.call(e)}function l(e){return"[object Object]"===r.call(e)}function p(e){return"[object Number]"===r.call(e)}function c(e){const t=r.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function u(e){return"[object String]"===r.call(e)}function m(e,t){return o.call(e,t)}function h(e,t){let n;return t=function(e){return c(e)?e:t=>t===e}(t),d(e,(function(e,i){if(t(e,i))return n=e,!1})),n}function f(e,t){let n=[];return d(e,(function(e,i){t(e,i)&&n.push(e)})),n}function d(e,t){let n,i;if(void 0===e)return;const r=s(e)?w:x;for(let o in e)if(m(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function y(e,t,n){return d(e,(function(e,i){n=t(n,e,i)})),n}function g(e,t){return!!y(e,(function(e,n,i){return e&&t(n,i)}),!0)}function v(e,t){return!!h(e,t)}function b(e){return function(t){return g(e,(function(e,n){return t[n]===e}))}}function x(e){return e}function w(e){return Number(e)}function E(e,t){return e.bind(t)}function _(e,...t){return Object.assign(e,...t)}function A(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 S(e,t){var n=R(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function R(e){return e&&e.businessObject||e}function C(e){return e&&e.di}function k(e,t){return!S(e,"bpmn:CallActivity")&&(S(e,"bpmn:SubProcess")?!(!(t=t||C(e))||!S(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!S(e,"bpmn:Participant")||!!R(e).processRef)}function M(e){var t=e.businessObject,n=function(e){return S(e,"bpmn:FlowElement")||S(e,"bpmn:Participant")||S(e,"bpmn:Lane")||S(e,"bpmn:SequenceFlow")||S(e,"bpmn:MessageFlow")||S(e,"bpmn:DataInput")||S(e,"bpmn:DataOutput")?"name":S(e,"bpmn:TextAnnotation")?"text":S(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function P(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}A.prototype.canRender=function(){},A.prototype.drawShape=function(){},A.prototype.drawConnection=function(){},A.prototype.getShapePath=function(){},A.prototype.getConnectionPath=function(){};var T={"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 O(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=T[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function D(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return T[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);O(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)O(e,i,t[i])}(e,t);return e}const N=Object.prototype.toString;function B(e){return new L(e)}function L(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function I(e){var t=e.parentNode;return t&&t.removeChild(e),e}L.prototype.add=function(e){return this.list.add(e),this},L.prototype.remove=function(e){return"[object RegExp]"==N.call(e)?this.removeMatching(e):(this.list.remove(e),this)},L.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},L.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},L.prototype.array=function(){return Array.from(this.list)},L.prototype.has=L.prototype.contains=function(e){return this.list.contains(e)};var j="http://www.w3.org/2000/svg",F='<svg xmlns="'+j+'"';function V(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(j)&&(e=F+e.substring(4)):(e=F+">"+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 z(e,t){var n;return"<"===e.charAt(0)?(n=V(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(j,e),t&&D(n,t),n}var W=null;function G(){return null===W&&(W=z("svg")),W}function $(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function H(e){return e?G().createSVGTransformFromMatrix(e):G().createSVGTransform()}function U(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function K(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(U(e,i))}(n,t)),n.consolidate()}function q(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function Y(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function X(e,t){var n=z("polyline");return D(n,{points:Y(e)}),t&&D(n,t),n}var Z="hsl(225, 10%, 15%)";function J(e,t,n){return v(e.eventDefinitions,(function(i){return i.$type===t&&function(e,t){return g(t,(function(t,n){return e[n]==t}))}(e,n)}))}function Q(e){return e.businessObject}function ee(e,t){var n=C(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function te(e,t){var n=C(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||Z}function ne(e,t,n){var i=C(e).get("label");return i&&i.get("color:color")||t||te(e,n)}function ie(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)}var re=Object.prototype.toString,oe=Object.prototype.hasOwnProperty;function ae(e,t){return oe.call(e,t)}function se(e,t){var n;if(void 0!==e){var i=function(e){return"[object Array]"===re.call(e)}(e)?pe:le;for(var r in e)if(ae(e,r)&&!1===t(n=e[r],i(r)))return n}}function le(e){return e}function pe(e){return Number(e)}function ce(e,...t){const n=e.style;return se(t,(function(e){e&&se(e,(function(e,t){n[t]=e}))})),e}const ue=Object.prototype.toString;function me(e){return new he(e)}function he(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function fe(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}function de(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}he.prototype.add=function(e){return this.list.add(e),this},he.prototype.remove=function(e){return"[object RegExp]"==ue.call(e)?this.removeMatching(e):(this.list.remove(e),this)},he.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},he.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},he.prototype.array=function(){return Array.from(this.list)},he.prototype.has=he.prototype.contains=function(e){return this.list.contains(e)};var ye={},ge=window.addEventListener?"addEventListener":"attachEvent",ve=window.removeEventListener?"removeEventListener":"detachEvent",be="addEventListener"!==ge?"on":"",xe=ie({__proto__:null,bind:ye.bind=function(e,t,n,i){return e[ge](be+t,n,i||!1),n},unbind:ye.unbind=function(e,t,n,i){return e[ve](be+t,n,i||!1),n},default:ye},[ye]),we=["focus","blur"];var Ee,_e={bind:function(e,t,n,i,r){return-1!==we.indexOf(n)&&(r=!0),xe.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=function(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(de(i,t))return i;i=i.parentNode}return de(i,t)?i:null}(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==we.indexOf(t)&&(i=!0),xe.unbind(e,t,n,i)}},Ae=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild)}var r,o=Object.prototype.hasOwnProperty.call(Re,i)?Re[i]:Re._default,a=o[0],s=o[1],l=o[2];(r=t.createElement("div")).innerHTML=s+e+l;for(;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var p=t.createDocumentFragment();for(;r.firstChild;)p.appendChild(r.removeChild(r.firstChild));return p},Se=!1;"undefined"!=typeof document&&((Ee=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Se=!Ee.getElementsByTagName("link").length,Ee=void 0);var Re={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Se?[1,"X<div>","</div>"]:[0,"",""]};Re.td=Re.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Re.option=Re.optgroup=[1,'<select multiple="multiple">',"</select>"],Re.thead=Re.tbody=Re.colgroup=Re.caption=Re.tfoot=[1,"<table>","</table>"],Re.polyline=Re.ellipse=Re.polygon=Re.circle=Re.text=Re.line=Re.path=Re.rect=Re.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Ce=Ae;function ke(e,t){return(t=t||document).querySelector(e)}function Me(e){e.parentNode&&e.parentNode.removeChild(e)}function Pe(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function Te(e,t){return Pe(t,e),e}var Oe={"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=Oe[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function Ne(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return Oe[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 Be=Object.prototype.toString;function Le(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ie(e){var t=e.parentNode;return t&&t.removeChild(e),e}Le.prototype.add=function(e){return this.list.add(e),this},Le.prototype.remove=function(e){return"[object RegExp]"==Be.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Le.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},Le.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Le.prototype.array=function(){return Array.from(this.list)},Le.prototype.has=Le.prototype.contains=function(e){return this.list.contains(e)};var je="http://www.w3.org/2000/svg",Fe='<svg xmlns="'+je+'"';function Ve(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(je)&&(e=Fe+e.substring(4)):(e=Fe+">"+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 ze(e,t){var n;return"<"===e.charAt(0)?(n=Ve(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(je,e),t&&Ne(n,t),n}var We=/([&<>]{1})/g,Ge=/([\n\r"]{1})/g,$e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function He(e,t){return e.replace(t,(function(e,t){return $e[t]||t}))}function Ue(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(He(e.textContent,We));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,'="',He(o.value,Ge),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)Ue(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",He(e.nodeValue,We),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Ke(e,t){var n=Ve(t);if(function(e){for(var t;t=e.firstChild;)Ie(t)}(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)Pe(r[o],e)}}function qe(e,t){if(void 0!==t){try{Ke(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)Ue(t,n),t=t.nextSibling;return n.join("")}(e)}function Ye(e,t,n,i,r){var o=H();o.setTranslate(t,n);var a=H();a.setRotate(i||0,0,0);var s=H();s.setScale(r||1,r||1),K(e,[o,a,s])}function Xe(e,t,n){var i=H();i.setTranslate(t,n),K(e,i)}var Ze=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/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 l=parseInt(a,n);return l!==1/0&&l>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,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");e+=i}var s=t(e,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=e||128,r.base=n||16,r}}));function Je(e){if(!(this instanceof Je))return new Je(e);e=e||[128,36,1],this._seed=e.length?Ze.rack(e[0],e[1],e[2]):e}Je.prototype.next=function(e){return this._seed(e||!0)},Je.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},Je.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Je.prototype.assigned=function(e){return this._seed.get(e)||!1},Je.prototype.unclaim=function(e){delete this._seed.hats[e]},Je.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var Qe=new Je,et=.95;function tt(e,t,n,i,r,o,a){A.call(this,t,a);var s=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor,u=Qe.next(),m={},h=n.computeStyle;function f(e,t){var n=_({fill:Z,strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},o=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=ze("marker");Ne(t.element,n),Te(a,t.element),Ne(a,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*o,markerHeight:20*o,orient:"auto"});var s=ke("defs",r._svg);s||(s=ze("defs"),Te(r._svg,s)),Te(s,a),m[e]=a}function y(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function g(e,t,n){var i=e+"-"+y(t)+"-"+y(n)+"-"+u;return m[i]||function(e,t,n,i){if("sequenceflow-end"===t){var r=ze("path");Ne(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(e,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var o=ze("circle");Ne(o,{cx:6,cy:6,r:3.5}),f(e,{element:o,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var a=ze("path");Ne(a,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(e,{element:a,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var s=ze("path");Ne(s,{d:"M 11 5 L 1 10 L 11 15"}),f(e,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var l=ze("path");Ne(l,{d:"M 1 5 L 11 10 L 1 15"}),f(e,{element:l,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var p=ze("path");Ne(p,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(e,{element:p,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var c=ze("path");Ne(c,{d:"M 6 4 L 10 16"}),f(e,{element:c,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function v(e,t,n,i,r){l(i)&&(r=i,i=0),i=i||0,"none"===(r=h(r,{stroke:Z,strokeWidth:2,fill:"white"})).fill&&delete r.fillOpacity;var o=t/2,a=n/2,s=ze("circle");return Ne(s,{cx:o,cy:a,r:Math.round((t+n)/4-i)}),Ne(s,r),Te(e,s),s}function b(e,t,n,i,r,o){l(r)&&(o=r,r=0),r=r||0,o=h(o,{stroke:Z,strokeWidth:2,fill:"white"});var a=ze("rect");return Ne(a,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),Ne(a,o),Te(e,a),a}function x(e,t,n){var i=X(t,n=h(n,["no-fill"],{stroke:Z,strokeWidth:2,fill:"none"}));return Te(e,i),i}function w(e,t,n){n=h(n,["no-fill"],{strokeWidth:2,stroke:Z});var i=ze("path");return Ne(i,{d:t}),Ne(i,n),Te(e,i),i}function E(e,t,n,i){return w(t,n,_({"data-marker":e},i))}function S(e){return L[e]}function P(e){return function(t,n){return S(e)(t,n)}}function T(e,t){var n=Q(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?S("bpmn:ParallelMultipleEventDefinition")(t,e,i):S("bpmn:MultipleEventDefinition")(t,e,i):J(n,"bpmn:MessageEventDefinition")?S("bpmn:MessageEventDefinition")(t,e,i):J(n,"bpmn:TimerEventDefinition")?S("bpmn:TimerEventDefinition")(t,e,i):J(n,"bpmn:ConditionalEventDefinition")?S("bpmn:ConditionalEventDefinition")(t,e):J(n,"bpmn:SignalEventDefinition")?S("bpmn:SignalEventDefinition")(t,e,i):J(n,"bpmn:EscalationEventDefinition")?S("bpmn:EscalationEventDefinition")(t,e,i):J(n,"bpmn:LinkEventDefinition")?S("bpmn:LinkEventDefinition")(t,e,i):J(n,"bpmn:ErrorEventDefinition")?S("bpmn:ErrorEventDefinition")(t,e,i):J(n,"bpmn:CancelEventDefinition")?S("bpmn:CancelEventDefinition")(t,e,i):J(n,"bpmn:CompensateEventDefinition")?S("bpmn:CompensateEventDefinition")(t,e,i):J(n,"bpmn:TerminateEventDefinition")?S("bpmn:TerminateEventDefinition")(t,e,i):null}function O(e,t,n){n=_({size:{width:100}},n);var i,r=o.createText(t||"",n);return(i=r,new Le(i)).add("djs-label"),Te(e,r),r}function D(e,t,n){return O(e,Q(t).name,{box:t,align:n,padding:5,style:{fill:ne(t,c,p)}})}function N(e,t,n){Ye(O(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:ne(n,c,p)}}),0,-(-1*n.height),270)}function B(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i<t.length;i++)n+="L"+t[i].x+","+t[i].y+" ";return n}var L=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=et),v(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:ee(t,s),stroke:te(t,p)};Q(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:ee(t,s),stroke:te(t,p)});var i=S("bpmn:Event")(e,t,n);return T(t,e),i},"bpmn:MessageEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?te(t,p):ee(t,s),stroke:n?ee(t,s):te(t,p)})},"bpmn:TimerEventDefinition":function(e,t){var n=v(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:ee(t,s),stroke:te(t,p)});w(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:te(t,p)});for(var r=0;r<12;r++){var o=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),a=t.width/2;w(e,o,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+a+")",stroke:te(t,p)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?te(t,p):"none",stroke:te(t,p)})},"bpmn:ConditionalEventDefinition":function(e,t){return w(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:te(t,p)})},"bpmn:LinkEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?te(t,p):"none",stroke:te(t,p)})},"bpmn:ErrorEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:n?te(t,p):"none",stroke:te(t,p)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=w(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:n?te(t,p):"none",stroke:te(t,p)});return function(e,t){var n=H();n.setRotate(t,0,0),K(e,n)}(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?te(t,p):"none",stroke:te(t,p)})},"bpmn:SignalEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?te(t,p):"none",stroke:te(t,p)})},"bpmn:MultipleEventDefinition":function(e,t,n){return w(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:n?te(t,p):"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return w(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:te(t,p),stroke:te(t,p)})},"bpmn:EndEvent":function(e,t){var n=S("bpmn:Event")(e,t,{strokeWidth:4,fill:ee(t,s),stroke:te(t,p)});return T(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return v(e,t.width,t.height,8,{strokeWidth:4,fill:te(t,p),stroke:te(t,p)})},"bpmn:IntermediateEvent":function(e,t){var n=S("bpmn:Event")(e,t,{strokeWidth:1,fill:ee(t,s),stroke:te(t,p)});return v(e,t.width,t.height,3,{strokeWidth:1,fill:ee(t,"none"),stroke:te(t,p)}),T(t,e),n},"bpmn:IntermediateCatchEvent":P("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":P("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=et),b(e,t.width,t.height,10,n)},"bpmn:Task":function(e,t){var n={fill:ee(t,s),stroke:te(t,p)},i=S("bpmn:Activity")(e,t,n);return D(e,t,"center-middle"),I(e,t),i},"bpmn:ServiceTask":function(e,t){var n=S("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:ee(t,s),stroke:te(t,p)}),w(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:ee(t,s)}),w(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:ee(t,s),stroke:te(t,p)}),n},"bpmn:UserTask":function(e,t){var n=S("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ee(t,s),stroke:te(t,p)}),w(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ee(t,s),stroke:te(t,p)}),w(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:te(t,p),stroke:te(t,p)}),n},"bpmn:ManualTask":function(e,t){var n=S("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:ee(t,s),stroke:te(t,p)}),n},"bpmn:SendTask":function(e,t){var n=S("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:te(t,p),stroke:ee(t,s)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=Q(t),o=S("bpmn:Task")(e,t);return r.instantiate?(v(e,28,28,4.4,{strokeWidth:1}),n=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):n=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),w(e,n,{strokeWidth:1,fill:ee(t,s),stroke:te(t,p)}),o},"bpmn:ScriptTask":function(e,t){var n=S("bpmn:Task")(e,t);return w(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:te(t,p)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=S("bpmn:Task")(e,t);return Ne(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:ee(t,"#aaaaaa"),stroke:te(t,p)}),Ne(w(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:te(t,p)}),n},"bpmn:SubProcess":function(e,t,n){n=_({fill:ee(t,s),stroke:te(t,p)},n);var i=S("bpmn:Activity")(e,t,n),r=k(t);return function(e){return e&&!!R(e).triggeredByEvent}(t)&&Ne(i,{strokeDasharray:"1,2"}),D(e,t,r?"center-top":"center-middle"),r?I(e,t):I(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return S("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=S("bpmn:SubProcess")(e,t),r=n.style(["no-fill","no-events"],{stroke:te(t,p)});return b(e,t.width,t.height,8,3,r),i},"bpmn:CallActivity":function(e,t){return S("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:et,fill:ee(t,s),stroke:te(t,p)},i=S("bpmn:Lane")(e,t,n);k(t)?(x(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:te(t,p)}),N(e,Q(t).name,t)):O(e,Q(t).name,{box:t,align:"center-middle",style:{fill:ne(t,c,p)}});return!!Q(t).participantMultiplicity&&S("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=b(e,t.width,t.height,0,_({fill:ee(t,s),fillOpacity:.35,stroke:te(t,p)},n)),r=Q(t);"bpmn:Lane"===r.$type&&N(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=S("bpmn:Gateway")(e,t);return v(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:ee(t,s),stroke:te(t,p)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=S("bpmn:Gateway")(e,t),r=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return C(t).isMarkerVisible&&w(e,r,{strokeWidth:1,fill:te(t,p),stroke:te(t,p)}),n},"bpmn:ComplexGateway":function(e,t){var n=S("bpmn:Gateway")(e,t);return w(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:te(t,p),stroke:te(t,p)}),n},"bpmn:ParallelGateway":function(e,t){var n=S("bpmn:Gateway")(e,t);return w(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:te(t,p),stroke:te(t,p)}),n},"bpmn:EventBasedGateway":function(e,t){var n=Q(t),r=S("bpmn:Gateway")(e,t);v(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:te(t,p)});var o=n.eventGatewayType,a=!!n.instantiate;if("Parallel"===o){var s=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});Ne(w(e,s),{strokeWidth:1,fill:"none"})}else if("Exclusive"===o){if(!a)Ne(v(e,t.width,t.height,.26*t.height),{strokeWidth:1,fill:"none",stroke:te(t,p)});!function(){var n=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:ee(t,"none"),stroke:te(t,p)};w(e,n,r)}()}return r},"bpmn:Gateway":function(e,t){var n={fill:ee(t,s),fillOpacity:et,stroke:te(t,p)};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=h(i,{stroke:Z,strokeWidth:2,fill:"white"});var s=ze("polygon");return Ne(s,{points:a}),Ne(s,i),Te(e,s),s}(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=B(t),r=ee(t,s),o=te(t,p),a=w(e,i,{strokeLinejoin:"round",markerEnd:g("sequenceflow-end",r,o),stroke:te(t,p)}),l=Q(t);return t.source&&(n=t.source.businessObject,l.conditionExpression&&n.$instanceOf("bpmn:Activity")&&Ne(a,{markerStart:g("conditional-flow-marker",r,o)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===l&&Ne(a,{markerStart:g("conditional-default-flow-marker",r,o)})),a},"bpmn:Association":function(e,t,n){var i=Q(t),r=ee(t,s),o=te(t,p);return n=_({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:te(t,p)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=g("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=g("association-start",r,o)),x(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=ee(t,s),i=te(t,p);return S("bpmn:Association")(e,t,{markerEnd:g("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=ee(t,s),i=te(t,p);return S("bpmn:Association")(e,t,{markerEnd:g("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=Q(t),r=C(t),o=ee(t,s),a=te(t,p),l=w(e,B(t),{markerEnd:g("messageflow-end",o,a),markerStart:g("messageflow-start",o,a),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:te(t,p)});if(n.messageRef){var u=l.getPointAtLength(l.getTotalLength()/2),m=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),h={strokeWidth:1};"initiating"===r.messageVisibleKind?(h.fill="white",h.stroke=Z):(h.fill="#888",h.stroke="white");var f=w(e,m,h),d=O(e,n.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:te(t,c)}}),y=f.getBBox(),v=d.getBBox();Ye(d,u.x-v.width/2,u.y+y.height/2+10,0)}return l},"bpmn:DataObject":function(e,t){var n=w(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:ee(t,s),fillOpacity:et,stroke:te(t,p)});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(Q(t))&&function(e,t){var n=(t.height-18)/t.height,r=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:n}});w(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":P("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=S("bpmn:DataObject")(e,t);return w(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=S("bpmn:DataObject")(e,t);return w(e,n,{strokeWidth:1,fill:Z}),r},"bpmn:DataStoreReference":function(e,t){return w(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:ee(t,s),fillOpacity:et,stroke:te(t,p)})},"bpmn:BoundaryEvent":function(e,t){var n=Q(t).cancelActivity,i={strokeWidth:1,fill:ee(t,s),stroke:te(t,p)};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=_({},i,{fillOpacity:1}),o=_({},i,{fill:"none"}),a=S("bpmn:Event")(e,t,r);return v(e,t.width,t.height,3,o),T(t,e),a},"bpmn:Group":function(e,t){return b(e,t.width,t.height,10,{stroke:te(t,p),strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return O(e,M(t),{box:n,fitBox:!0,style:_({},o.getExternalStyle(),{fill:ne(t,c,p)})})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=b(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return w(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:te(t,p)}),O(e,Q(t).text||"",{box:t,align:"left-top",padding:5,style:{fill:ne(t,c,p)}}),n},ParticipantMultiplicityMarker:function(e,t){E("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}}),{strokeWidth:2,fill:ee(t,s),stroke:te(t,p)})},SubProcessMarker:function(e,t){Xe(b(e,14,14,0,{strokeWidth:1,fill:ee(t,s),stroke:te(t,p)}),t.width/2-7.5,t.height-20),E("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:ee(t,s),stroke:te(t,p)})},ParallelMarker:function(e,t,n){E("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.parallel)/t.width,my:(t.height-20)/t.height}}),{fill:ee(t,s),stroke:te(t,p)})},SequentialMarker:function(e,t,n){E("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:ee(t,s),stroke:te(t,p)})},CompensationMarker:function(e,t,n){E("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:ee(t,s),stroke:te(t,p)})},LoopMarker:function(e,t,n){E("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1,fill:ee(t,s),stroke:te(t,p),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){E("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:te(t,p),stroke:te(t,p)})}};function I(e,t,n){var i,r=Q(t),o=n&&-1!==n.indexOf("SubProcessMarker");i=o?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},d(n,(function(n){S(n)(e,t,i)})),r.isForCompensation&&S("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&S("AdhocMarker")(e,t,i);var a=r.loopCharacteristics,s=a&&a.isSequential;a&&(void 0===s&&S("LoopMarker")(e,t,i),!1===s&&S("ParallelMarker")(e,t,i),!0===s&&S("SequentialMarker")(e,t,i))}this._drawPath=w,this._renderer=S}i(tt,A),tt.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],tt.prototype.canRender=function(e){return S(e,"bpmn:BaseElement")},tt.prototype.drawShape=function(e,t){var n=t.type;return this._renderer(n)(e,t)},tt.prototype.drawConnection=function(e,t){var n=t.type;return this._renderer(n)(e,t)},tt.prototype.getShapePath=function(e){return S(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,q([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):S(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return q([["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"]])}(e,10):S(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return q([["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 q([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var nt={width:150,height:50};function it(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function rt(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=it(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return ot(e,o,r,i);o=at(o,i.width,t)}}function ot(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}}function at(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||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&"­"===a&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function st(e){this._config=_({},{size:nt,padding:0,style:{},align:"center-top"},e||{})}st.prototype.createText=function(e,t){return this.layoutText(e,t).element},st.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},st.prototype.layoutText=function(e,t){var n=_({},this._config.size,t.box),i=_({},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 l(e)?_({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),p=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right,m=z("text");for(D(m,{x:0,y:0}),D(m,i),P(function(){var e=document.getElementById("helper-svg");return e||(D(e=z("svg"),{id:"helper-svg"}),ce(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),m);p.length;)c.push(rt(p,u,m));"middle"===r.vertical&&(o.top=o.bottom=0);var h=y(c,(function(e,t,n){return e+(s||t.height)}),0)+o.top+o.bottom,f=y(c,(function(e,t,n){return t.width>e?t.width:e}),0),g=o.top;"middle"===r.vertical&&(g+=(n.height-h)/2),g-=(s||c[0].height)/4;var v=z("text");return D(v,i),d(c,(function(e){var t;switch(g+=s||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(a?f:u)-o.right-e.width;break;default:t=Math.max(((a?f:u)-e.width)/2+o.left,0)}var n=z("tspan");D(n,{x:t,y:g}),n.textContent=e.text,P(v,n)})),I(m),{dimensions:{width:f,height:h},element:v}};function lt(e){var t=_({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=_({},t,{fontSize:n},e&&e.externalStyle||{}),r=new st({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}lt.$inject=["config.textRenderer"];var pt=/\{([^{}]+)\}/g,ct=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var ut={__init__:["bpmnRenderer"],bpmnRenderer:["type",tt],textRenderer:["type",lt],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,l=0;l<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*a;for(var p=0;p<r.widthElements.length;p++)o["x"+p]=r.widthElements[p]*s}var c,u,m=(c=r.d,u={mx:n,my:i,e:o},String(c).replace(pt,(function(e,t){return function(e,t,n){var i=n;return t.replace(ct,(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 m}}]};var mt={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]},ht={width:90,height:20};function ft(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 dt(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(ht.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=function(e){return e.waypoints?ft(e.waypoints):S(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+ht.height/2}:{x:e.x+e.width/2,y:e.y+e.height+ht.height/2}}(t),i=ht),_({x:n.x-i.width/2,y:n.y-i.height/2},i)}function yt(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function gt(e){return t={x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2},{x:Math.round(t.x),y:Math.round(t.y)};var t}function vt(e){for(var t=e.waypoints,n=t.reduce((function(e,n,i){var r,o,a=t[i-1];if(a){var s=e[e.length-1],l=s&&s.endLength||0,p=(r=a,o=n,Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)));e.push({start:a,end:n,startLength:l,endLength:l+p,length:p})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0)/2,r=0,o=n[r];o.endLength<i;)o=n[++r];var a=(i-o.startLength)/o.length;return{x:o.start.x+(o.end.x-o.start.x)*a,y:o.start.y+(o.end.y-o.start.y)*a}}function bt(e){return function(e){return!!e.waypoints}(e)?vt(e):gt(e)}function xt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function wt(e,t,n){return _({id:e.id,type:e.$type,businessObject:e,di:t},n)}function Et(e,t,n){var i=e.waypoint;return!i||i.length<2?[bt(t),bt(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function _t(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:xt(n),referenced:xt(t),property:i}))}function At(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}At.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],At.prototype.add=function(e,t,n){var i,r,o,a,s,l,p,c=this._translate;if(S(t,"bpmndi:BPMNPlane")){var u=S(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(wt(e,t,u)),this._canvas.addRootElement(i)}else if(S(t,"bpmndi:BPMNShape")){var m=!k(e,t),h=function(e){return S(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var f=t.bounds;i=this._elementFactory.createShape(wt(e,t,{collapsed:m,hidden:r,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:h})),S(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),S(e,"bpmn:Lane")&&(o=0),S(e,"bpmn:DataStoreReference")&&(a=n,s=bt(f),l=s.x,p=s.y,l>=a.x&&l<=a.x+a.width&&p>=a.y&&p<=a.y+a.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!S(t,"bpmndi:BPMNEdge"))throw new Error(c("unknown di {di} for element {semantic}",{di:xt(t),semantic:xt(e)}));var d=this._getSource(e),y=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(wt(e,t,{hidden:r,source:d,target:y,waypoints:Et(t,d,y)})),S(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return function(e){return S(e,"bpmn:Event")||S(e,"bpmn:Gateway")||S(e,"bpmn:DataStoreReference")||S(e,"bpmn:DataObjectReference")||S(e,"bpmn:DataInput")||S(e,"bpmn:DataOutput")||S(e,"bpmn:SequenceFlow")||S(e,"bpmn:MessageFlow")||S(e,"bpmn:Group")}(e)&&M(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},At.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:xt(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw _t(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},At.prototype.addLabel=function(e,t,n){var i,r,o;return i=dt(t,n),(r=M(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(wt(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!M(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)},At.prototype._getEnd=function(e,t){var n,i,r=e.$type,o=this._translate;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?_t(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:xt(e),side:t}))},At.prototype._getSource=function(e){return this._getEnd(e,"source")},At.prototype._getTarget=function(e){return this._getEnd(e,"target")},At.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var St={__depends__:[ut,{__depends__:[mt],bpmnImporter:["type",At]}]};function Rt(e){return e.originalEvent||e.srcEvent}function Ct(e,t){return(Rt(e)||e).button===t}function kt(e){return Ct(e,0)}function Mt(e){var t=Rt(e)||e;return!!kt(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function Pt(e){return!0}function Tt(e){return kt(e)||function(e){return Ct(e,1)}(e)}function Ot(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){return!(l[e]||kt)(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"},l={"element.contextmenu":Pt,"element.mousedown":Tt,"element.mouseup":Tt,"element.click":Tt,"element.dblclick":Tt};function p(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(l[n]=i),a.$delegate=_e.bind(e,"svg, .djs-element",t,a)}function c(e,t,n){var i=a(n);i&&_e.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,d(s,(function(e,n){c(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,d(s,(function(e,n){p(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"),m=f("djs-hit djs-hit-click-stroke"),h={all:f("djs-hit djs-hit-all"),"click-stroke":m,stroke:u,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=_({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function y(e,t){var n=h[t];if(!n)throw new Error("invalid hit type <"+t+">");return D(e,n),e}function g(e,t){P(e,t)}this.removeHits=function(e){var t;d((t=".djs-hit",(e||document).querySelectorAll(t)),I)},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=X(t);return y(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=_({x:0,y:0},n);var i=z("rect");return y(i,t),D(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=ke(".djs-hit",t);if(n)return e.waypoints?function(e,t){D(e,{points:Y(t)})}(n,e.waypoints):D(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=p,this.unregisterEvent=c}Ot.$inject=["eventBus","elementRegistry","styles"];var Dt={__init__:["interactionEvents"],interactionEvents:["type",Ot]};function Nt(e,t){var n,i,r,o;return t=!!t,s(e)||(e=[e]),d(e,(function(e){var a=e;e.waypoints&&!t&&(a=Nt(e.waypoints,!0));var s=a.x,l=a.y,p=a.height||0,c=a.width||0;(s<n||void 0===n)&&(n=s),(l<i||void 0===i)&&(i=l),(s+c>r||void 0===r)&&(r=s+c),(l+p>o||void 0===o)&&(o=l+p)})),{x:n,y:i,height:o-i,width:r-n}}function Bt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Lt(e){return!(!e||!e.isFrame)}function It(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function o(e,t){var n=z("rect");return D(n,_({x:10,y:10,rx:3,width:100,height:100},i)),P(e,n),n}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,i=ke(".djs-outline",n);i||(i=o(n)),r.updateShapeOutline(i,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,i=ke(".djs-outline",n);i||(i=o(n)),r.updateConnectionOutline(i,t)}))}It.prototype.updateShapeOutline=function(e,t){D(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},It.prototype.updateConnectionOutline=function(e,t){var n=Nt(t);D(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},It.$inject=["eventBus","styles","elementRegistry"];var jt={__init__:["outline"],outline:["type",It]};function Ft(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];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)}))}Ft.$inject=["eventBus","canvas"],Ft.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},Ft.prototype.get=function(){return this._selectedElements},Ft.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Ft.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();s(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return o===t})),t?d(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Vt="hover",zt="selected";function Wt(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,Vt)})),t.on("element.out",(function(e){o(e.element,Vt)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;d(t,(function(e){-1===n.indexOf(e)&&o(e,zt)})),d(n,(function(e){-1===t.indexOf(e)&&r(e,zt)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function Gt(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;s(o)?t.select(o):t.select(r.filter($t))}})),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);h(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(kt(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=Mt(e)||function(e){var t=Rt(e)||e;return kt(e)&&t.shiftKey}(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function $t(e){return!e.hidden}Wt.$inject=["canvas","eventBus","selection"],Wt.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");!function(e){for(var t;t=e.firstChild;)I(t)}(t);var n=e.length>1;if(B(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(Nt(e)),r=z("rect");D(r,_({rx:3},i)),B(r).add("djs-selection-outline"),P(t,r)}},Gt.$inject=["eventBus","selection","canvas","elementRegistry"];var Ht={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Dt,jt],selection:["type",Ft],selectionVisuals:["type",Wt],selectionBehavior:["type",Gt]};function Ut(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Ut.prototype.next=function(){return this._prefix+ ++this._counter};var Kt=new Ut("ov");function qt(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Kt,this._overlayDefaults=_({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),ce(o=Ce('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function Yt(e,t,n){ce(e,{left:t+"px",top:n+"px"})}function Xt(e,t){e.style.display=!1===t?"none":""}function Zt(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}qt.$inject=["config.overlays","eventBus","canvas","elementRegistry"],qt.prototype.get=function(e){if(u(e)&&(e={id:e}),u(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?f(t.overlays,b({type:e.type})):t.overlays.slice():[]}return e.type?f(this._overlays,b({type:e.type})):e.id?this._overlays[e.id]:null},qt.prototype.add=function(e,t,n){if(l(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=_({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},qt.prototype.remove=function(e){var t=this.get(e)||[];s(t)||(t=[t]);var n=this;d(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Me(e.html),Me(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)}}))},qt.prototype.show=function(){Xt(this._overlayRoot)},qt.prototype.hide=function(){Xt(this._overlayRoot,!1)},qt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],fe(this._overlayRoot)},qt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Nt(t);i=o.x,r=o.y}Yt(n,i,r),function(e,t,n){2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):e.setAttribute(t,n)}(e.html,"data-container-id",t.id)},qt.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?Nt(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?Nt(o).height:o.height,s=-1*i.bottom+n);Yt(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},qt.prototype._createOverlayContainer=function(e){var t=Ce('<div class="djs-overlays" />');ce(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},qt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Zt(this._overlayRoot,n)},qt.prototype._getOverlayContainer=function(e,t){var n=h(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},qt.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)),u(o)&&(o=Ce(o)),n=this._getOverlayContainer(r),ce(t=Ce('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&me(t).add("djs-overlay-"+e.type),Xt(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())},qt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,s=e.htmlContainer,l=!0;(i!==this._canvas.getRootElement()||n&&(a(r)&&r>t.scale||a(o)&&o<t.scale))&&(l=!1),Xt(s,l),this._updateOverlayScale(e,t)},qt.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,s=e.htmlContainer,l="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),a(n)&&t.scale<n&&(r=(1/t.scale||1)*n),a(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),a(r)&&(l="scale("+r+","+r+")"),Zt(s,l)},qt.prototype._updateOverlaysVisibilty=function(e){var t=this;d(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},qt.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;d(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Me(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&&(d(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&&me(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 Jt={__init__:["overlays"],overlays:["type",qt]};function Qt(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(Bt(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)}))}Qt.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var en={__init__:["changeSupport"],changeSupport:["type",Qt]};function tn(e){this._eventBus=e}tn.$inject=["eventBus"],tn.prototype.on=function(e,t,n,i,r,o){if((c(t)||p(t))&&(o=r,r=i,i=n,n=t,t=null),c(n)&&(o=r,r=i,i=n,n=1e3),l(r)&&(o=r,r=!1),!c(i))throw new Error("handlerFn must be a function");s(e)||(e=[e]);var a=this._eventBus;d(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)}))};function nn(e,t){t.invoke(tn,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)}))}d(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],(function(e){tn.prototype[e]=function(t,n,i,r,o){(c(t)||p(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}})),i(nn,tn),nn.$inject=["canvas","injector"];var rn={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",nn]};
2
+ /*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
3
+ !function(t,n){var i;i=e,t.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),i=n.length,r=-1,o="",a=n.charCodeAt(0);++r<i;)0!=(t=n.charCodeAt(r))?o+=t>=1&&t<=31||127==t||0==r&&t>=48&&t<=57||1==r&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==r&&1==i&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(r):n.charAt(r):o+="�";return o};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(i)}({exports:{}});var on={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var an="_plane";function sn(e){var t=e.id;return S(e,"bpmn:SubProcess")?function(e){return e+an}(t):t}function ln(e,t,n,i){var r=Ce('<ul class="bjs-breadcrumbs"></ul>'),o=i.getContainer(),a=me(o);o.appendChild(r);var s=[];function l(e){e&&(s=function(e){for(var t=R(e),n=[],i=t;i;i=i.$parent)(S(i,"bpmn:SubProcess")||S(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var n=s.map((function(e){var n,r=(n=""+(n=e.name||e.id))&&n.replace(/[&<>"']/g,(function(e){return on[e]})),o=Ce('<li><span class="bjs-crumb"><a title="'+r+'">'+r+"</a></span></li>"),a=i.findRoot(sn(e))||i.findRoot(e.id);if(!a&&S(e,"bpmn:Process")){var s=t.find((function(t){var n=R(t);return n&&n.processRef&&n.processRef===e}));a=i.findRoot(s.id)}return o.addEventListener("click",(function(){i.setRootElement(a)})),o}));r.innerHTML="";var o=n.length>1;a.toggle("bjs-breadcrumbs-shown",o),n.forEach((function(e){r.appendChild(e)}))}e.on("element.changed",(function(e){var t=R(e.element);h(s,(function(e){return e===t}))&&l()})),e.on("root.set",(function(e){l(e.element)}))}function pn(e,t){var n=null,i=new cn;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,!S(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,l=(o.y-a.y)*o.scale;0===s&&0===l||t.scroll({dx:s,dy:l}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function cn(){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)}}ln.$inject=["eventBus","elementRegistry","overlays","canvas"],pn.$inject=["eventBus","canvas"];var un=180,mn=160;function hn(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 fn(e){return S(e,"bpmndi:BPMNDiagram")?e:fn(e.$parent)}hn.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)}));var n=[];e.diagrams.forEach((function(e){var i=t.createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t.movePlaneElementsToOrigin(e.plane)}))}},hn.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;S(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!S(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(function(e,t){return v(t,(function(t){return S(e,t)}))}(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},hn.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=yt(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),function(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}(t)}(e),i=n.x-un,r=n.y-mn;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)}))},hn.prototype.moveToDiPlane=function(e,t){var n=fn(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},hn.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},hn.$inject=["eventBus","moddle"];var dn=250;function yn(e,t,n,i){tn.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",dn,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",dn,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],dn,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r.canDrillDown(i)&&r.addOverlay(i),r.updateDrilldownOverlay(t),r.updateDrilldownOverlay(n),r.updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],dn,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r.canDrillDown(i)&&r.addOverlay(i),r.updateDrilldownOverlay(t),r.updateDrilldownOverlay(n),r.updateDrilldownOverlay(i)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return r.canDrillDown(e)})).map((function(e){r.addOverlay(e)}))}))}i(yn,tn),yn.prototype.updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this.updateOverlayVisibility(n)}},yn.prototype.canDrillDown=function(e){var t=this._canvas;return S(e,"bpmn:SubProcess")&&t.findRoot(sn(e))},yn.prototype.updateOverlayVisibility=function(e){var t=this._overlays,n=e.businessObject,i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.flowElements&&n.flowElements.length;me(i.html).toggle("bjs-drilldown-empty",!r)}},yn.prototype.addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this.removeOverlay(e);var i=Ce('<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>');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(sn(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this.updateOverlayVisibility(e)},yn.prototype.removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},yn.$inject=["canvas","eventBus","elementRegistry","overlays"];var gn={__depends__:[Jt,en,rn],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",ln],drilldownCentering:["type",pn],drilldownOverlayBehavior:["type",yn],subprocessCompatibility:["type",hn]};const vn=/^class[ {]/;function bn(e){return Array.isArray(e)}function xn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wn(...e){1===e.length&&bn(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const En=/constructor\s*[^(]*\(\s*([^)]*)\)/m,_n=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,An=/\/\*([^*]*)\*\//m;function Sn(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return vn.test(e.toString())}(e)?En:_n);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(An);return(t&&t[1]||e).trim()}))||[]}function Rn(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}};const n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(e){const t=n.join(" -> ");return n.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function s(e,o){if(!i[e]&&-1!==e.indexOf(".")){const t=e.split(".");let n=s(t.shift());for(;t.length;)n=n[t.shift()];return n}if(xn(r,e))return r[e];if(xn(i,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),r[e]=i[e][0](i[e][1]),n.pop(),r[e]}return t.get(e,o)}function l(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!bn(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=wn(e.slice())}return{fn:e,dependencies:(e.$inject||Sn(e)).map((e=>xn(t,e)?t[e]:s(e)))}}function p(e){const{fn:t,dependencies:n}=l(e);return new(Function.prototype.bind.apply(t,[null].concat(n)))}function c(e,t,n){const{fn:i,dependencies:r}=l(e,n);return i.apply(t,r)}function u(e){return wn((t=>e.get(t)))}function m(e,t){if(t&&t.length){const n=Object.create(null),r=Object.create(null),o=[],a=[],s=[];let l,p,c,m;for(let e in i)l=i[e],-1!==t.indexOf(e)&&("private"===l[2]?(p=o.indexOf(l[3]),-1===p?(c=l[3].createChild([],t),m=u(c),o.push(l[3]),a.push(c),s.push(m),n[e]=[m,e,"private",c]):n[e]=[s[p],e,"private",a[p]]):n[e]=[l[2],l[1]],r[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach((t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[1]],r[t]=!0)}));t.forEach((e=>{if(!r[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new Rn(e,o)}const h={factory:c,type:p,value:function(e){return e}};function f(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function d(e){const t=e.__exports__;if(t){const n=e.__modules__,r=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=m((n||[]).concat(r)),a=wn((function(e){return o.get(e)}));t.forEach((function(e){i[e]=[a,e,"private",o]}));const s=(e.__init__||[]).slice();return s.unshift((function(){o.init()})),f(e=Object.assign({},e,{__init__:s}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;if("private"===e[t][2])return void(i[t]=e[t]);const n=e[t][0],r=e[t][1];i[t]=[h[n],Cn(n,r),n]})),f(e,o)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=s,this.invoke=c,this.instantiate=p,this.createChild=m,this.init=function(e){const t=e.reduce(y,[]).map(d);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function Cn(e,t){return"value"!==e&&bn(t)&&(t=wn(t.slice())),t}function kn(e,t){A.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})}i(kn,A),kn.prototype.canRender=function(){return!0},kn.prototype.drawShape=function(e,t,n){var i=z("rect");return D(i,{x:0,y:0,width:t.width||0,height:t.height||0}),Lt(t)?D(i,_({},this.FRAME_STYLE,n||{})):D(i,_({},this.SHAPE_STYLE,n||{})),P(e,i),i},kn.prototype.drawConnection=function(e,t,n){var i=X(t.waypoints,_({},this.CONNECTION_STYLE,n||{}));return P(e,i),i},kn.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return q([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},kn.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 q(r)},kn.$inject=["eventBus","styles"];var Mn={__init__:["defaultRenderer"],defaultRenderer:["type",kn],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 _(this.style(t,n),{class:e})},this.style=function(t,n){s(t)||n||(n=t,t=[]);var i=y(t,(function(t,n){return _(t,e[n]||{})}),{});return n?_(i,n):i},this.computeStyle=function(e,n,i){return s(n)||(i=n,n=[]),t.style(n||[],_({},i,e||{}))}}]};function Pn(e,t){return Math.round(e*t)/t}function Tn(e){return p(e)?e+"px":e}function On(e,t,n){const i=z("g");B(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const Dn={shape:["x","y","width","height"],connection:["waypoints"]};function Nn(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function Bn(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Nn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Nn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=_({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),ce(n,{position:"relative",overflow:"hidden",width:Tn(e.width),height:Tn(e.height)}),t.appendChild(n),n}(e),i=this._svg=z("svg");D(i,{width:"100%",height:"100%"}),P(n,i);const r=this._viewport=On(i,"viewport");!1!==e.deferUpdate&&(this._viewboxChanged=function(e,t){let n,i,r,o;function a(n){let a=Date.now(),p=n?0:o+t-a;if(p>0)return s(p);e.apply(r,i),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function p(...e){o=Date.now(),i=e,r=this,n||s(t)}return p.flush=function(){n&&a(!0),l()},p.cancel=l,p}(E(this._viewboxChanged,this),300)),t.on("diagram.init",(function(){t.fire("canvas.init",{svg:i,viewport:r})}),this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(function(){delete this._cachedViewbox}),this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Nn.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},Nn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=Bt(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Nn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Nn.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},Nn.prototype._getChildIndex=function(e){return y(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Nn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:On(this._viewport,"layer-"+e,n),index:t,visible:!0}},Nn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},Nn.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible?(I(n),t.visible=!1,n):n},Nn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],I(t.group))},Nn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Nn.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),!e)return;const t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement},Nn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Nn.prototype._findPlaneForRoot=function(e){return h(this._planes,(function(t){return t.rootElement===e}))},Nn.prototype.getContainer=function(){return this._container},Nn.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(d([i.gfx,i.secondaryGfx],(function(e){e&&(n?B(e).add(t):B(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Nn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Nn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Nn.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));return B(this.getGraphics(e)).has(t)},Nn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Nn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Nn.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},Nn.prototype.removeRootElement=function(e){"string"==typeof e&&(e=this._elementRegistry.get(e));if(this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},Nn.prototype.setRootElement=function(e,t){if(a(t))throw new Error("override not supported");if(e===this._rootElement)return;let n;if(!e)throw new Error("rootElement required");return n=this._findPlaneForRoot(e),n||(e=this.addRootElement(e)),this._setRoot(e),e},Nn.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},Nn.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},Nn.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},Nn.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=Dn[e],i=g(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Nn.prototype._setParent=function(e,t,n){!function(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)}}(t.children,e,n),e.parent=t},Nn.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},Nn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Nn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Nn.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Nn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Nn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Nn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Nn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Nn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Nn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,a,s,l,p;return e?(this._changeViewbox((function(){s=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);K(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=K(t),r=a?a.matrix:function(e,t,n,i,r,o){var a=G().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return $(a,e);case 6:return $(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),s=Pn(r.a,1e3),l=Pn(-r.e||0,1e3),p=Pn(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/s:0,y:p?p/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},Nn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=_({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Bn(t,n)})),{x:n.e,y:n.f}},Nn.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);i!==this.getRootElement()&&this.setRootElement(i),t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=Nt(e),o=yt(r),a=this.viewbox(),s=this.zoom();let l,p;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const c=yt(a);if(r.width<a.width&&r.height<a.height){const e=Math.max(0,o.right-c.right),t=Math.min(0,o.left-c.left),n=Math.max(0,o.bottom-c.bottom),i=Math.min(0,o.top-c.top);l=e||t,p=n||i}else l=r.x-a.x,p=r.y-a.y;this.scroll({dx:-l*s,dy:-p*s})},Nn.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,i;return this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),Pn(i.a,1e3)},Nn.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},Nn.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,l,p,c;l=i.getCTM();const u=l.a;return t?(a=_(o,t),s=a.matrixTransform(l.inverse()),p=r.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),c=l.multiply(p)):c=r.scale(e),Bn(this._viewport,c),c},Nn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Nn.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;if(e.waypoints){n=this.getGraphics(e).getBBox()}else n=e;return{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},Nn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Ln="data-element-id";function In(e){this._elements={},this._eventBus=e}In.$inject=["eventBus"],In.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),D(t,Ln,i),n&&D(n,Ln,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},In.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(D(i.gfx,Ln,""),i.secondaryGfx&&D(i.secondaryGfx,Ln,""),delete t[n])},In.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},In.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&D(t,Ln,i),t},In.prototype.get=function(e){var t;t="string"==typeof e?e:e&&D(e,Ln);var n=this._elements[t];return n&&n.element},In.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},In.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},In.prototype.getAll=function(){return this.filter((function(e){return e}))},In.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},In.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},In.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var jn={exports:{}},Fn={};Fn.extend=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},Fn.isExtended=function(e){return!0===e.__refs_collection};var Vn=Fn;function zn(e,t,n){var i=Vn.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach((function(i){e.set(i,t.inverse,n)}))}function Wn(e,t){if(!(this instanceof Wn))return new Wn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Wn.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?zn(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},Wn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Vn.isExtended(n)||zn(this,t,e),n},Wn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Wn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Wn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Gn=Wn;!function(e){e.exports=Gn,e.exports.Collection=Fn}(jn);var $n=t(jn.exports),Hn=new $n({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Un=new $n({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Kn=new $n({name:"attachers",collection:!0},{name:"host"}),qn=new $n({name:"outgoing",collection:!0},{name:"source"}),Yn=new $n({name:"incoming",collection:!0},{name:"target"});function Xn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Hn.bind(this,"parent"),Un.bind(this,"labels"),qn.bind(this,"outgoing"),Yn.bind(this,"incoming")}function Zn(){Xn.call(this),Hn.bind(this,"children"),Kn.bind(this,"host"),Kn.bind(this,"attachers")}function Jn(){Zn.call(this)}function Qn(){Zn.call(this),Un.bind(this,"labelTarget")}function ei(){Xn.call(this),qn.bind(this,"source"),Yn.bind(this,"target")}i(Zn,Xn),i(Jn,Zn),i(Qn,Zn),i(ei,Xn);var ti={connection:ei,shape:Zn,label:Qn,root:Jn};function ni(){this._uid=12}ni.prototype.createRoot=function(e){return this.create("root",e)},ni.prototype.createLabel=function(e){return this.create("label",e)},ni.prototype.createShape=function(e){return this.create("shape",e)},ni.prototype.createConnection=function(e){return this.create("connection",e)},ni.prototype.create=function(e,t){return(t=_({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=ti[e];if(!n)throw new Error("unknown type: <"+e+">");return _(new n,t)}(e,t)};var ii=Array.prototype.slice;function ri(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function oi(){}function ai(e,t){this._eventBus=e,this._elementRegistry=t}function si(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}ri.prototype.on=function(e,t,n,i){if(e=s(e)?e:[e],c(t)&&(i=n,n=t,t=1e3),!p(t))throw new Error("priority must be a number");var r=n;i&&((r=E(n,i)).__fn=n.__fn||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},ri.prototype.once=function(e,t,n,i){var r=this;if(c(t)&&(i=n,n=t,t=1e3),!p(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o.__fn=n,this.on(e,t,o)},ri.prototype.off=function(e,t){e=s(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},ri.prototype.createEvent=function(e){var t=new oi;return t.init(e),t},ri.prototype.fire=function(e,t){var n,i,r,o;if(o=ii.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof oi?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},ri.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},ri.prototype._destroy=function(){this._listeners={}},ri.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},ri.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},ri.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},ri.prototype._getListeners=function(e){return this._listeners[e]},ri.prototype._setListeners=function(e,t){this._listeners[e]=t},ri.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r.__fn!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},oi.prototype.stopPropagation=function(){this.cancelBubble=!0},oi.prototype.preventDefault=function(){this.defaultPrevented=!0},oi.prototype.init=function(e){_(this,e||{})},ai.$inject=["eventBus","elementRegistry"],ai.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(B(t=z("g")).add("djs-children"),P(n.parentNode,t))):t=n,t},ai.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return fe(t),t},ai.prototype._createContainer=function(e,t,n,i){var r=z("g");B(r).add("djs-group"),void 0!==n?si(r,t,t.childNodes[n]):P(t,r);var o=z("g");B(o).add("djs-element"),B(o).add("djs-"+e),i&&B(o).add("djs-frame"),P(r,o);var a=z("g");return B(a).add("djs-visual"),P(o,a),o},ai.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,Lt(t))},ai.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=y(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),d(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e);d(t.slice().reverse(),(function(e){si(i.getGraphics(e).parentNode,r)}))}}))},ai.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},ai.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},ai.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},ai.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},ai.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),Xe(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?D(n,"display","none"):D(n,"display","block")}},ai.prototype.remove=function(e){I(this._elementRegistry.getGraphics(e).parentNode)};var li={__depends__:[Mn],__init__:["canvas"],canvas:["type",Nn],elementRegistry:["type",In],elementFactory:["type",ni],eventBus:["type",ri],graphicsFactory:["type",ai]};function pi(e){return function(e){var t=new Rn(e);return t.init(),t}([{config:["value",e=e||{}]},li].concat(e.modules||[]))}function ci(e,t){this.injector=t=t||pi(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}ci.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},ci.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var ui=Object.prototype.toString;function mi(){return mi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},mi.apply(this,arguments)}function hi(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return mi.apply(void 0,[e].concat(n))}var fi=Object.prototype.toString,di=Object.prototype.hasOwnProperty;function yi(e,t){return di.call(e,t)}function gi(e,t){var n;if(void 0!==e){var i=function(e){return"[object Array]"===fi.call(e)}(e)?bi:vi;for(var r in e)if(yi(e,r)&&!1===t(n=e[r],i(r)))return n}}function vi(e){return e}function bi(e){return Number(e)}function xi(e,t){return e.bind(t)}function wi(){return wi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},wi.apply(this,arguments)}function Ei(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return wi.apply(void 0,[e].concat(n))}function _i(){}function Ai(e,t){this.model=e,this.properties=t}_i.prototype.get=function(e){return this.$model.properties.get(this,e)},_i.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Ai.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(_i.prototype);gi(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),gi(e,xi((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Si={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ri={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Ci(e,t){var n=Ri[e];return n?n(t):t}function ki(e){return!!Si[e]}function Mi(e){return!!Ri[e]}function Pi(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Ti(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Oi(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,gi(e,xi(this.registerPackage,this))}function Di(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Ni(e){this.model=e}function Bi(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Li(e){this.properties=new Ni(this),this.factory=new Ai(this,this.properties),this.registry=new Oi(e,this.properties),this.typeCache={}}Ti.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},i=Object(e),gi(t,(function(t){t in i&&(n[t]=e[t])})),n;var e,t,n,i},Ti.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},Ti.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(-1===s)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},Ti.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Pi(r[0],i),a=Pi(r[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Ti.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Ti.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Ti.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Ti.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Ti.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Ti.prototype.hasProperty=function(e){return this.propertiesByName[e]},Ti.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(gi(e.properties,xi((function(n){n=Ei({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[r]=e)},Oi.prototype.getPackage=function(e){return this.packageMap[e]},Oi.prototype.getPackages=function(){return this.packages},Oi.prototype.registerPackage=function(e){e=Ei({},e);var t=this.packageMap;Di(t,e,"prefix"),Di(t,e,"uri"),gi(e.types,xi((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Oi.prototype.registerType=function(e,t){var n=Pi((e=Ei({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:Ei(e.meta||{})})).name,t.prefix),i=n.name,r={};gi(e.properties,xi((function(e){var t=Pi(e.name,n.prefix),i=t.name;ki(e.type)||(e.type=Pi(e.type,t.prefix).name),Ei(e,{ns:t,name:i}),r[i]=e}),this)),Ei(e,{ns:n,name:i,propertiesByName:r}),gi(e.extends,xi((function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},Oi.prototype.mapTypes=function(e,t,n){var i=ki(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(e){return a(e,!0)}function a(n,i){var o=Pi(n,ki(n)?"":e.prefix);r.mapTypes(o,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");gi(i.superClass,n?o:a),t(i,!n),gi(i.traits,o)},Oi.prototype.getEffectiveDescriptor=function(e){var t=Pi(e),n=new Ti(t);this.mapTypes(t,(function(e,t){n.addTrait(e,t)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Oi.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Ni.prototype.set=function(e,t,n){var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:Bi(e,i,n):e.$attrs[t]=n},Ni.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&Bi(e,n,[]),e[i]},Ni.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=Ei({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Ni.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Ni.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Li.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Li.prototype.getType=function(e){var t,n=this.typeCache,i=(t=e,"[object String]"===fi.call(t)?e:e.ns.name),r=n[i];return r||(e=this.registry.getEffectiveDescriptor(i),r=n[i]=this.factory.createType(e)),r},Li.prototype.createAny=function(e,t,n){var i=Pi(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),gi(n,(function(e,t){var n;n=e,"[object Object]"===fi.call(n)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},Li.prototype.getPackage=function(e){return this.registry.getPackage(e)},Li.prototype.getPackages=function(){return this.registry.getPackages()},Li.prototype.getElementDescriptor=function(e){return e.$descriptor},Li.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Li.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Li.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Ii=Object.prototype.toString,ji=Object.prototype.hasOwnProperty;function Fi(e){return"[object Array]"===Ii.call(e)}function Vi(e){return"[object String]"===Ii.call(e)}function zi(e,t){return ji.call(e,t)}function Wi(e,t){var n;return t=Hi(t),$i(e,(function(e,i){if(t(e,i))return n=e,!1})),n}function Gi(e,t){var n=[];return $i(e,(function(e,i){t(e,i)&&n.push(e)})),n}function $i(e,t){var n;if(void 0!==e){var i=Fi(e)?Ki:Ui;for(var r in e)if(zi(e,r)&&!1===t(n=e[r],i(r)))return n}}function Hi(e){return t=e,"[object Function]"===(n=Ii.call(t))||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n?e:function(t){return t===e};var t,n}function Ui(e){return e}function Ki(e){return Number(e)}function qi(){return qi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},qi.apply(this,arguments)}function Yi(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return qi.apply(void 0,[e].concat(n))}var Xi=String.fromCharCode,Zi=Object.prototype.hasOwnProperty,Ji=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Qi={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function er(e,t,n,i){return i?Zi.call(Qi,i)?Qi[i]:"&"+i+";":Xi(t||parseInt(n,16))}function tr(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Ji,er):e}Object.keys(Qi).forEach((function(e){Qi[e.toUpperCase()]=Qi[e]}));var nr="xsi:type",ir="non-whitespace outside of root node";function rr(e){return new Error(e)}function or(e){return"missing namespace for prefix <"+e+">"}function ar(e){return{get:e,enumerable:!0}}function sr(e){var t,n={};for(t in e)n[t]=e[t];return n}function lr(e){return e+"$uri"}function pr(){return{line:0,column:0}}function cr(e){throw e}function ur(e){if(!this)return new ur(e);var t,n,i,r,o,a,s,l,p,c=e&&e.proxy,u=cr,m=pr,h=!1,f=!1,d=null,y=!1;function g(e){e instanceof Error||(e=rr(e)),d=e,u(e,m)}function v(e){o&&(e instanceof Error||(e=rr(e)),o(e,m))}this.on=function(e,p){if("function"!=typeof p)throw rr("required args <name, cb>");switch(e){case"openTag":n=p;break;case"text":t=p;break;case"closeTag":i=p;break;case"error":u=p;break;case"warn":o=p;break;case"cdata":r=p;break;case"attention":l=p;break;case"question":s=p;break;case"comment":a=p;break;default:throw rr("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw rr("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,p=n,this},this.parse=function(e){if("string"!=typeof e)throw rr("required args <xml=string>");return d=null,function(e){var o,u,d,b,x,w,E,_,A,S,R,C=f?[]:null,k=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[lr(n)]=t;return i}(p):null,M=[],P=0,T=!1,O=!1,D=0,N=0,B="",L=0;function I(){if(null!==R)return R;var e,t,n,i,r,o,a,s,l,c,u,m=f&&k.xmlns,d=f&&h?[]:null,y=L,g=B,b=g.length,x={},w={};e:for(;y<b;y++)if(l=!1,!(32===(c=g.charCodeAt(y))||c<14&&c>8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(v("illegal first char attribute name"),l=!0),u=y+1;u<b;u++)if(!((c=g.charCodeAt(u))>96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){v("missing attribute value"),y=u;continue e}if(61===c)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),l=!0),34===(c=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),l=!0);else if(39===c)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u<b&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++);for(-1===u&&(v("missing closing quotes"),u=b,l=!0),l||(o=g.substring(y,u)),y=u;u+1<b&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++)y===u&&(v("illegal character after attribute end"),l=!0);if(y=u+1,!l)if(s in w)v("attribute <"+s+"> already defined");else if(w[s]=!0,f)if(h){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=tr(o),t=lr(r),!(a=p[e])){if("xmlns"===r||t in k&&k[t]!==e)do{a="ns"+P++}while(void 0!==k[a]);else a=r;p[e]=a}k[r]!==a&&(i||(k=sr(k),i=!0),k[r]=a,"xmlns"===r&&(k[lr(a)]=e,m=a),k[t]=e),x[s]=o;continue}d.push(s,o)}else-1!==(c=s.indexOf(":"))?(n=k[s.substring(0,c)])?((s=m===n?s.substr(c+1):n+s.substr(c))===nr&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=k[n]||n)+o.substring(c)):o=m+":"+o),x[s]=o):v(or(s.substring(0,c))):x[s]=o;else x[s]=o}if(h)for(y=0,b=d.length;y<b;y++){if(s=d[y++],o=d[y],-1!==(c=s.indexOf(":"))){if(!(n=k[s.substring(0,c)])){v(or(s.substring(0,c)));continue}(s=m===n?s.substr(c+1):n+s.substr(c))===nr&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=k[n]||n)+o.substring(c)):o=m+":"+o)}x[s]=o}return R=x}function j(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,s=N;D>=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>D);)r+=1,a=s;return-1==D?(o=s,n=e.substring(N)):0===N?n=e.substring(N,D):(o=D-a,n=-1==N?e.substring(D):e.substring(D,N+1)),{data:n,line:r,column:o}}m=j,c&&(S=Object.create({},{name:ar((function(){return _})),originalName:ar((function(){return A})),attrs:ar(I),ns:ar((function(){return k}))}));for(;-1!==N;){if(-1===(D=60===e.charCodeAt(N)?N:e.indexOf("<",N)))return M.length?g("unexpected end of file"):0===N?g("missing start tag"):void(N<e.length&&e.substring(N).trim()&&v(ir));if(N!==D)if(M.length){if(t&&(t(e.substring(N,D),tr,m),y))return}else if(e.substring(N,D).trim()&&(v(ir),y))return;if(33===(x=e.charCodeAt(D+1))){if(91===(b=e.charCodeAt(D+2))&&"CDATA["===e.substr(D+3,6)){if(-1===(N=e.indexOf("]]>",D)))return g("unclosed cdata");if(r&&(r(e.substring(D+9,N),m),y))return;N+=3;continue}if(45===b&&45===e.charCodeAt(D+3)){if(-1===(N=e.indexOf("--\x3e",D)))return g("unclosed comment");if(a&&(a(e.substring(D+4,N),tr,m),y))return;N+=3;continue}}if(63!==x){for(u=D+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return N=-1,g("unclosed tag");if(34===w)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===w)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===w){N=u;break}}if(33!==x){if(R={},47===x){if(T=!1,O=!0,!M.length)return g("missing open tag");if(u=_=M.pop(),b=D+2+u.length,e.substring(D+2,b)!==u)return g("closing tag mismatch");for(;b<N;b++)if(!(32===(x=e.charCodeAt(b))||x>8&&x<14))return g("close tag")}else{if(47===e.charCodeAt(N-1)?(u=_=e.substring(D+1,N-1),T=!0,O=!0):(u=_=e.substring(D+1,N),T=!0,O=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return g("illegal first char nodeName");for(b=1,d=u.length;b<d;b++)if(!((x=u.charCodeAt(b))>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){_=u.substring(0,b),R=null;break}return g("invalid nodeName")}O||M.push(_)}if(f){if(o=k,T&&(O||C.push(o),null===R&&(h=-1!==u.indexOf("xmlns",b))&&(L=b,B=u,I(),h=!1)),A=_,-1!==(x=_.indexOf(":"))){if(!(E=k[_.substring(0,x)]))return g("missing namespace on <"+A+">");_=_.substr(x+1)}else E=k.xmlns;E&&(_=E+":"+_)}if(T&&(L=b,B=u,n&&(c?n(S,tr,O,m):n(_,I,tr,O,m),y)))return;if(O){if(i&&(i(c?S:_,tr,T,m),y))return;f&&(k=T?o:C.pop())}N+=1}else{if(l&&(l(e.substring(D,N+1),tr,m),y))return;N+=1}}else{if(-1===(N=e.indexOf("?>",D)))return g("unclosed question");if(s&&(s(e.substring(D,N+2),m),y))return;N+=2}}}(e),m=pr,y=!1,d},this.stop=function(){y=!0}}function mr(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var hr={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},fr="xsi:type";function dr(e){return e.xml&&e.xml.serialize}function yr(e){return dr(e)===fr}function gr(e,t){return mr(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function vr(e){return new Error(e)}function br(e){return e.$descriptor}function xr(e){Yi(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw vr("expected element");var t,n=this.elementsById,i=br(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw vr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function wr(){}function Er(){}function _r(){}function Ar(e,t){this.property=e,this.context=t}function Sr(e,t){this.element=t,this.propertyDesc=e}function Rr(){}function Cr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function kr(e,t,n){Cr.call(this,e,t,n)}function Mr(e,t,n){this.model=e,this.context=n}function Pr(e){e instanceof Li&&(e={model:e}),Yi(this,{lax:!1},e)}wr.prototype.handleEnd=function(){},wr.prototype.handleText=function(){},wr.prototype.handleNode=function(){},Er.prototype=Object.create(wr.prototype),Er.prototype.handleNode=function(){return this},_r.prototype=Object.create(wr.prototype),_r.prototype.handleText=function(e){this.body=(this.body||"")+e},Ar.prototype=Object.create(_r.prototype),Ar.prototype.handleNode=function(e){if(this.element)throw vr("expected no sub nodes");return this.element=this.createReference(e),this},Ar.prototype.handleEnd=function(){this.element.id=this.body},Ar.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Sr.prototype=Object.create(_r.prototype),Sr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Ci(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Rr.prototype=Object.create(_r.prototype),Rr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},Cr.prototype=Object.create(Rr.prototype),Cr.prototype.addReference=function(e){this.context.addReference(e)},Cr.prototype.handleText=function(e){if(!br(this.element).bodyProperty)throw vr("unexpected body text <"+e+">");_r.prototype.handleText.call(this,e)},Cr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=br(t).bodyProperty;n&&void 0!==e&&(e=Ci(n.type,e),t.set(n.name,e))},Cr.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=br(i),o=this.context,a=new i({}),s=this.model;return $i(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?$i(e.split(" "),(function(e){o.addReference({element:a,property:i.ns.name,id:e})})):o.addReference({element:a,property:i.ns.name,id:e}):(i?e=Ci(i.type,e):"xmlns"!==n&&(t=Pi(n,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},Cr.prototype.getPropertyForNode=function(e){var t,n,i=Pi(e.name),r=this.type,o=this.model,a=br(r),s=i.name,l=a.propertiesByName[s];if(l&&!l.isAttr)return yr(l)&&(t=e.attributes[fr])?(t=function(e,t){var n=Pi(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,o),Yi({},l,{effectiveType:br(n=o.getType(t)).name})):l;var p=o.getPackage(i.prefix);if(p){if(t=gr(i,p),n=o.getType(t),l=Wi(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return Yi({},l,{effectiveType:br(n).name})}else if(l=Wi(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw vr("unrecognized element <"+i.name+">")},Cr.prototype.toString=function(){return"ElementDescriptor["+br(this.type).name+"]"},Cr.prototype.valueHandler=function(e,t){return new Sr(e,t)},Cr.prototype.referenceHandler=function(e){return new Ar(e,this.context)},Cr.prototype.handler=function(e){return"Element"===e?new Mr(this.model,e,this.context):new Cr(this.model,e,this.context)},Cr.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Mi(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(Yi(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},kr.prototype=Object.create(Cr.prototype),kr.prototype.createElement=function(e){var t=e.name,n=Pi(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&gr(n,o)||t;if(!r.hasType(a))throw vr("unexpected element <"+e.originalName+">");return Cr.prototype.createElement.call(this,e)},Mr.prototype=Object.create(Rr.prototype),Mr.prototype.createElement=function(e){var t=e.name,n=Pi(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Mr.prototype.handleChild=function(e){var t=new Mr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},Mr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Pr.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Cr?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,a=new xr(Yi({},t,{rootHandler:i})),s=new ur({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function p(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw vr(l)}function c(e,t){return p(e,t,!0)}i.context=a,l.push(i);var u=/^<\?xml /i,m=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var d=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(d).on("openTag",(function(e,t,n,i){var r=e.attrs||{},a=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){p(e,t,o)&&l.push(new Er)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=m.exec(e),n=t&&t[1];n&&!h.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",p).on("warn",c),new Promise((function(t,n){var r;try{s.parse(e),function(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=br(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=r.get(s.name),p=l.indexOf(t);-1===p&&(p=l.length),o?l[p]=o:l.splice(p,1)}else r.set(s.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=vr("failed to parse document as <"+i.type.$descriptor.name+">"));var l=a.warnings,p=a.references,c=a.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:c,references:p,warnings:l})}))},Pr.prototype.handler=function(e){return new kr(this.model,e)};var Tr=/<|>|'|"|&|\n\r|\n/g,Or=/<|>|&/g;function Dr(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function Nr(e,t){return mr(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function Br(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Lr(e){return Vi(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var Ir={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},jr={"<":"lt",">":"gt","&":"amp"};function Fr(e,t,n){return(e=Vi(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Vr(e){this.tagName=e}function zr(){}function Wr(e){this.tagName=e}function Gr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function $r(e,t){Gr.call(this,e,t)}function Hr(){this.value="",this.write=function(e){this.value+=e}}function Ur(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Kr(e){return e=Yi({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Hr,r=new Ur(i,e.format);if(e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new Gr).build(t).serializeTo(r),!n)return i.value}}}function qr(e,t){Li.call(this,e,t)}Vr.prototype.build=function(e){return this.element=e,this},Vr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},zr.prototype.serializeValue=zr.prototype.serializeTo=function(e){e.append(this.escape?Fr(this.value,Or,jr):this.value)},zr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Or)&&(this.escape=!0),this},Br(Wr,zr),Wr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Gr.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return Gi(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!zi(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(Gi(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return Gi(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},Gr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?Yi({localName:t.ns.localName},e):Yi({localName:Nr(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Gr.prototype.nsPropertyTagName=function(e){return function(e,t){return Yi({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Gr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Gr.prototype.nsAttributeName=function(e){var t;if(t=Vi(e)?Pi(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:Yi({localName:t.localName},n)},Gr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return $i(e,(function(r,o){"$body"===o?n.push((new zr).build({type:"String"},r)):"$children"===o?$i(r,(function(e){n.push(new Gr(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},Gr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Pi(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},Gr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return $i(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},Gr.prototype.parseGenericAttributes=function(e,t){var n=this;$i(t,(function(t){if(t.name!==fr)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},Gr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;$i(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new zr).build(e,r[0]));else if(Mi(e.type))$i(r,(function(i){n.push(new Wr(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)$i(r,(function(i){n.push(new Vr(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var a=yr(e),s=function(e){return"property"===dr(e)}(e);$i(r,(function(i){var r;r=a?new $r(t,e):s?new Gr(t,e):new Gr(t),n.push(r.build(i))}))}}))},Gr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Dr(t):n=t),n},Gr.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Gr.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(r=hr[s]||o&&(o.getPackage(s)||{}).uri,!(l=l||r||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(l))){for(n=s,i=1;a.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return s&&a.mapPrefix(s,l),e},Gr.prototype.parseAttributes=function(e){var t=this,n=this.element;$i(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];$i(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Gr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Lr(e)},Gr.prototype.addAttribute=function(e,t){var n=this.attrs;Vi(t)&&(t=Fr(t,Tr,Ir));var i=function(e,t){t=Hi(t);var n=Fi(e)?-1:void 0;return $i(e,(function(e,i){if(t(e,i))return n=i,!1})),n}(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},Gr.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),$i(t,(function(t){e.append(" ").append(Lr(t.name)).append('="').append(t.value).append('"')}))},Gr.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==zr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),$i(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Br($r,Gr),$r.prototype.parseNsAttributes=function(e){var t=Gr.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(fr),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},$r.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},qr.prototype=Object.create(Li.prototype),qr.prototype.fromXML=function(e,t,n){var i;i=t,"[object String]"!==ui.call(i)&&(n=t,t="bpmn:Definitions");var r=new Pr(hi({model:this,lax:!0},n)),o=r.handler(t);return r.fromXML(e,o)},qr.prototype.toXML=function(e,t){var n=new Kr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var Yr={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function Xr(e,t){return new qr(hi({},Yr,e),t)}function Zr(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(!(t>=1&&c(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+e.name+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var i=Array.prototype.slice.call(arguments,0,-1);e.apply(this,i).then((function(e){var t=Object.keys(e)[0];return n(null,e[t])}),(function(e){return n(e,e.warnings)}))}}function Jr(e,t){return e.$instanceOf(t)}function Qr(e,t){var n={},i=[],r={};function o(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function s(n,i){try{var o=r[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:xt(n)}));return e.element(n,r[n.id],i)}(n,i);return a(n),o}catch(e){l(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:xt(n)})),console.error(e)}}function l(t,n){e.error(t,n)}function p(e){var n,i=e.bpmnElement;i?r[i.id]?l(t("multiple DI elements defined for {element}",{element:xt(i)}),{element:i}):(r[i.id]=e,m(n=i,"di")||Object.defineProperty(n,"di",{enumerable:!1,get:function(){throw new Error("Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472")}})):l(t("no bpmnElement referenced in {element}",{element:xt(e)}),{element:e})}function c(e){var t;p(t=e.plane),d(t.planeElement,u)}function u(e){p(e)}function y(){for(;i.length;)i.shift()()}function g(e,t){P(e,t),A(e.ioSpecification,t),_(e.artifacts,t),a(e)}function v(e,t){s(e,t)}function b(e,t){s(e,t)}function x(e,t){s(e,t)}function w(e,t){s(e,t)}function E(e,t){s(e,t)}function _(e,t){d(e,(function(e){Jr(e,"bpmn:Association")?i.push((function(){E(e,t)})):E(e,t)}))}function A(e,t){e&&(d(e.dataInputs,o(x,t)),d(e.dataOutputs,o(w,t)))}function S(e,t){P(e,t),_(e.artifacts,t)}function R(e,t){var n=s(e,t);Jr(e,"bpmn:SubProcess")&&S(e,n||t),Jr(e,"bpmn:Activity")&&A(e.ioSpecification,t),i.push((function(){d(e.dataInputAssociations,o(b,t)),d(e.dataOutputAssociations,o(b,t))}))}function C(e,t){s(e,t)}function k(e,t){i.push((function(){var n=s(e,t);e.childLaneSet&&M(e.childLaneSet,n||t),function(e){d(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function M(e,t){d(e.lanes,o(k,t))}function P(e,n){!function(e,n){d(e,(function(e){Jr(e,"bpmn:SequenceFlow")?i.push((function(){!function(e,t){s(e,t)}(e,n)})):Jr(e,"bpmn:BoundaryEvent")?i.unshift((function(){R(e,n)})):Jr(e,"bpmn:FlowNode")?R(e,n):Jr(e,"bpmn:DataObject")||(Jr(e,"bpmn:DataStoreReference")||Jr(e,"bpmn:DataObjectReference")?C(e,n):l(t("unrecognized flowElement {element} in context {context}",{element:xt(e),context:n?xt(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){d(e,o(M,t))}(e.laneSets,n)}function T(e,t){var n=s(e,t),i=e.processRef;i&&g(i,n||t)}return{handleDeferred:y,handleDefinitions:function(a,s){var u=a.diagrams;if(s&&-1===u.indexOf(s))throw new Error(t("diagram not part of bpmn:Definitions"));if(!s&&u&&u.length&&(s=u[0]),!s)throw new Error(t("no diagram to display"));r={},c(s);var m=s.plane;if(!m)throw new Error(t("no plane for {element}",{element:xt(s)}));var b=m.bpmnElement;if(!b){if(b=function(e){return h(e.rootElements,(function(e){return Jr(e,"bpmn:Process")||Jr(e,"bpmn:Collaboration")}))}(a),!b)throw new Error(t("no process or collaboration to display"));l(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:xt(m),rootElement:xt(b)})),m.bpmnElement=b,p(m)}var x,w,E=function(t,n){return e.root(t,r[t.id],n)}(b,m);if(Jr(b,"bpmn:Process")||Jr(b,"bpmn:SubProcess"))g(b,E);else{if(!Jr(b,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:xt(m),rootElement:xt(b)}));w=E,d((x=b).participants,o(T,w)),_(x.artifacts,w),i.push((function(){!function(e,t){d(e,o(v,t))}(x.messageFlows,w)})),function(e,t){var i=f(e,(function(e){return!n[e.id]&&Jr(e,"bpmn:Process")&&e.laneSets}));i.forEach(o(g,t))}(a.rootElements,E)}y()},handleSubProcess:S,registerDi:p}}function eo(e,t,n){var i,r,o,a,s=[];function l(e,t){var n=new Qr({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}},o);t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;S(i,"bpmn:Process")||S(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(S(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=S(r,"bpmn:Collaboration")?r:h(e.rootElements,(function(e){if(S(e,"bpmn:Collaboration"))return h(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=function(e,t){let n=[];return d(e,(function(e,i){n.push(t(e,i))})),n}(n.participants,(function(e){return e.processRef})),o.push(n));var a=to(o),s=[t],l=[i];return d(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===l.indexOf(t)&&(s.push(e),l.push(t))})),s}(e,t);if(!r)throw new Error(o("no diagram to display"));d(r,(function(t){n.handleDefinitions(e,t)}));var l=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(l+"_plane")||a.findRoot(l))}return new Promise((function(p,c){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),a=e.get("canvas"),r.fire("import.render.start",{definitions:t}),l(t,n),r.fire("import.render.complete",{error:undefined,warnings:s}),p({warnings:s})}catch(e){return e.warnings=s,c(e)}}))}function to(e){var t=[];return d(e,(function(e){e&&(t.push(e),t=t.concat(to(e.flowElements)))})),t}var no,io='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',ro={verticalAlign:"middle"},oo={color:"#404040"},ao={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},so={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},lo={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"};function po(){no||(ce(no=Ce('<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg></a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>'),ao),ce(ke("svg",no),ro),ce(ke(".backdrop",no),so),ce(ke(".notice",no),lo),ce(ke(".link",no),oo,{margin:"15px 20px 15px 10px",alignSelf:"center"}),_e.bind(no,".backdrop","click",(function(e){document.body.removeChild(no)}))),document.body.appendChild(no)}function co(e){e=_({},mo,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=Ce('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+io+"</a>");ce(ke("svg",t),ro),ce(t,oo,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),xe.bind(t,"click",(function(e){po(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function uo(e,t){return e.warnings=t,e}i(co,ci),co.prototype.importXML=Zr((async function(e,t){const n=this;let i=[];try{let r;e=this._emit("import.parse.start",{xml:e})||e;try{r=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let o=r.rootElement;const a=r.references,s=r.warnings,l=r.elementsById;i=i.concat(s),o=this._emit("import.parse.complete",function(e){const t=n.get("eventBus").createEvent(e);return Object.defineProperty(t,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:e.warnings,references:e.references,elementsById:e.elementsById}}}),t}({error:null,definitions:o,elementsById:l,references:a,warnings:i}))||o;const p=await this.importDefinitions(o,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||[]),uo(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}})),co.prototype.importDefinitions=Zr((async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}})),co.prototype.open=Zr((async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw uo(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return h(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw uo(t,[]),t}try{this.clear()}catch(e){throw uo(e,[]),e}const{warnings:i}=await eo(this,t,n);return{warnings:i}})),co.prototype.saveXML=Zr((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})),co.prototype.saveSVG=Zr((async function(e={}){let t,n;this._emit("saveSVG.start");try{const e=this.get("canvas"),n=e.getActiveLayer(),i=ke("defs",e._svg),r=qe(n),o=i?"<defs>"+qe(i)+"</defs>":"",a=n.getBBox();t='<?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="'+a.width+'" height="'+a.height+'" viewBox="'+a.x+" "+a.y+" "+a.width+" "+a.height+'" version="1.1">'+o+r+"</svg>"}catch(e){n=e}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}})),co.prototype._setDefinitions=function(e){this._definitions=e},co.prototype.getModules=function(){return this._modules},co.prototype.clear=function(){this.getDefinitions()&&ci.prototype.clear.call(this)},co.prototype.destroy=function(){ci.prototype.destroy.call(this),Me(this._container)},co.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},co.prototype.off=function(e,t){this.get("eventBus").off(e,t)},co.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=ke(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},co.prototype.getDefinitions=function(){return this._definitions},co.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},co.prototype._init=function(e,t,n){const i=n.modules||this.getModules(),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=_(function(e,t){let n={};return d(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}(n,["additionalModules"]),{canvas:_({},n.canvas,{container:e}),modules:o});ci.call(this,a),n&&n.container&&this.attachTo(n.container)},co.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},co.prototype._createContainer=function(e){const t=Ce('<div class="bjs-container"></div>');return ce(t,{width:ho(e.width),height:ho(e.height),position:e.position}),t},co.prototype._createModdle=function(e){return new Xr(_({},this._moddleExtensions,e.moddleExtensions))},co.prototype._modules=[];const mo={width:"100%",height:"100%",position:"relative"};function ho(e){return e+(p(e)?"px":"")}function fo(e){co.call(this,e)}i(fo,co),fo.prototype._modules=[St,mt,Ht,Jt,gn],fo.prototype._moddleExtensions={};var yo={"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 go(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=yo[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function vo(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return yo[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);go(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)go(e,i,t[i])}(e,t);return e}var bo="http://www.w3.org/2000/svg",xo='<svg xmlns="'+bo+'"';function wo(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(bo)&&(e=xo+e.substring(4)):(e=xo+">"+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 Eo(e){return R(e).get("zeebe:modelerTemplateIcon")}function _o(e,t){this._bpmnRenderer=e,A.call(this,t,1250)}n.exports(_o,A),_o.prototype.canRender=function(e){return!function(e){return e&&!!e.labelTarget}(e)&&(S(e,"bpmn:Task")&&!!Eo(e))},_o.prototype.drawShape=function(e,t){var n=(0,this._bpmnRenderer.handlers["bpmn:Task"])(e,t),i=Eo(t),r=function(e,t){var n;return"<"===e.charAt(0)?(n=wo(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(bo,e),t&&vo(n,t),n}("image");return vo(r,{href:i,x:5,y:5,width:18,height:18}),function(e,t){(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,r),n},_o.$inject=["bpmnRenderer","eventBus"];const Ao=[{drilldownOverlayBehavior:["value",null]},{__init__:["elementTemplatesIconsRenderer"],elementTemplatesIconsRenderer:["type",_o]}],So={zeebe:{name:"zeebe",prefix:"zeebe",uri:"http://camunda.org/schema/zeebe/1.0",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"ZeebeServiceTask",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:SendTask","bpmn:EndEvent","bpmn:IntermediateThrowEvent"],properties:[{name:"retryCounter",type:"String",isAttr:!0}]},{name:"IoMapping",superClass:["Element"],properties:[{name:"ioMapping",type:"IoMapping"},{name:"inputParameters",isMany:!0,type:"Input"},{name:"outputParameters",isMany:!0,type:"Output"}],meta:{allowedIn:["bpmn:CallActivity","bpmn:Event","bpmn:ReceiveTask","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"InputOutputParameter",properties:[{name:"source",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"}]},{name:"Subscription",superClass:["Element"],properties:[{name:"correlationKey",isAttr:!0,type:"String"}]},{name:"Input",superClass:["InputOutputParameter"],meta:{allowedIn:["bpmn:CallActivity","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"Output",superClass:["InputOutputParameter"],meta:{allowedIn:["bpmn:CallActivity","bpmn:Event","bpmn:ReceiveTask","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"TaskHeaders",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask","bpmn:UserTask"]},properties:[{name:"values",type:"Header",isMany:!0}]},{name:"Header",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"key",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"TaskDefinition",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask"]},properties:[{name:"type",type:"String",isAttr:!0},{name:"retries",type:"String",isAttr:!0}]},{name:"LoopCharacteristics",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask","bpmn:ReceiveTask","bpmn:SubProcess"]},properties:[{name:"inputCollection",type:"String",isAttr:!0},{name:"inputElement",type:"String",isAttr:!0},{name:"outputCollection",type:"String",isAttr:!0},{name:"outputElement",type:"String",isAttr:!0}]},{name:"CalledElement",superClass:["Element"],meta:{allowedIn:["bpmn:CallActivity"]},properties:[{name:"processId",type:"String",isAttr:!0},{name:"processIdExpression",type:"String",isAttr:!0},{name:"propagateAllChildVariables",isAttr:!0,type:"Boolean"}]},{name:"UserTaskForm",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"body",type:"String",isBody:!0}]},{name:"FormDefinition",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"formKey",type:"String",isAttr:!0}]},{name:"CalledDecision",superClass:["Element"],meta:{allowedIn:["bpmn:BusinessRuleTask"]},properties:[{name:"decisionId",type:"String",isAttr:!0},{name:"resultVariable",type:"String",isAttr:!0}]},{name:"AssignmentDefinition",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"assignee",type:"String",isAttr:!0},{name:"candidateGroups",type:"String",isAttr:!0}]},{name:"Properties",superClass:["Element"],properties:[{name:"properties",type:"Property",isMany:!0}],meta:{allowedIn:["zeebe:PropertiesHolder"]}},{name:"Property",properties:[{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}],meta:{allowedIn:["zeebe:PropertiesHolder"]}},{name:"PropertiesHolder",isAbstract:!0,extends:["bpmn:FlowNode"]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Collaboration","bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"},{name:"modelerTemplateIcon",isAttr:!0,type:"String"}]}]}};function Ro(e={}){e={...e,moddleExtensions:{...So,...e.moddleExtensions}},fo.call(this,e)}return n.exports(Ro,fo),Ro.prototype._camundaCloudModules=[...Ao],Ro.prototype._modules=[].concat(fo.prototype._modules,Ro.prototype._camundaCloudModules),Ro}));