bpmn-js 0.30.0 → 0.31.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,2 @@
1
- /*! bpmn-js - bpmn-navigated-viewer v0.30.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2
- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).BpmnJS=e()}}(function(){var e,t,n={exports:{}};e=this,t=function(e){"use strict";function t(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}function n(e,n){return n.appendChild(t(e,n)),e}var i=2,r={"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":i,"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":i,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function a(e,t,n){var a=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=r[a];o?(o===i&&"number"==typeof n&&(n=String(n)+"px"),e.style[a]=n):e.setAttributeNS(null,t,n)}function o(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return r[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);a(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)a(e,i,t[i])}(e,t);return e}function s(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 p=/\s+/,l=Object.prototype.toString;function c(e){return void 0!==e}function u(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function h(e){var t=e.parentNode;return t&&t.removeChild(e),e}function m(e){for(var t;t=e.firstChild;)h(t);return e}u.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~s(t,e)||t.push(e),c(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},u.prototype.remove=function(e){if("[object RegExp]"===l.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=s(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},u.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},u.prototype.toggle=function(e,t){return this.list?(c(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(c(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},u.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(p);return""===e[0]&&e.shift(),e},u.prototype.has=u.prototype.contains=function(e){return this.list?this.list.contains(e):!!~s(this.array(),e)};var f={svg:"http://www.w3.org/2000/svg"},d='<svg xmlns="'+f.svg+'"';function y(e){return"<svg"===e.substring(0,4)?-1===e.indexOf(f.svg)&&(e=d+e.substring(4)):e=d+">"+e+"</svg>",function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e)}function g(e,t){var n;return"<"===e.charAt(0)?(n=y(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(f.svg,e),t&&o(n,t),n}var v=g("svg");function x(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}var b=/([&<>]{1})/g,E=/([\n\r"]{1})/g,w={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function _(e,t){return e.replace(t,function(e,t){return w[t]||t})}function A(e,t){var n,i,r,a,o;switch(e.nodeType){case 3:t.push(_(e.textContent,b));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)a=r.item(n),t.push(" ",a.name,'="',_(a.value,E),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(o=e.childNodes).length;n<i;++n)A(o.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",_(e.nodeValue,b),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function S(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}e.append=function(e,t){return n(t,e),e},e.attr=o,e.classes=function(e){return new u(e)},e.create=g,e.innerSVG=function(e,t){if(void 0!==t){try{!function(e,t){var i,r=y(t).documentElement;if(m(e),t)for(i=r.firstChild;i;)n(i,e),i=i.nextSibling}(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)A(t,n),t=t.nextSibling;return n.join("")}(e)},e.remove=h,e.transform=function(e,t){var n=e.transform.baseVal;if(1===arguments.length)return n.consolidate();t.length?function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(S(e,i));e.consolidate()}(n,t):n.initialize(S(n,t))},e.createMatrix=function(e,t,n,i,r,a){var o=v.createSVGMatrix();switch(arguments.length){case 0:return o;case 6:e={a:e,b:t,c:n,d:i,e:r,f:a}}return x(o,e)},e.createTransform=function(e){return e?v.createSVGTransformFromMatrix(e):v.createSVGTransform()},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof n.exports?t(n.exports):t(e.TinySVG={});var i={},r=(n=n.exports).attr,a=n.create;function o(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}i.componentsToPath=function(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")},i.createLine=function(e,t){var n=a("polyline");return r(n,{points:o(e)}),t&&r(n,t),n},i.updateLine=function(e,t){return r(e,{points:o(t)}),e};var s={exports:{}};!function(e,t){"object"==typeof s.exports?t(s.exports):t(e.MinDash={})}(this,function(e){"use strict";var t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return null==e}function r(e){return"[object Array]"===t.call(e)}function a(e){return"[object Object]"===t.call(e)}function o(e){return"[object Function]"===t.call(e)}function s(e,t){return n.call(e,t)}function p(e,t){var n;return t=d(t),l(e,function(e,i){if(t(e,i))return n=e,!1}),n}function l(e,t){if(!i(e)){var n=r(e)?g:y;for(var a in e){if(s(e,a))if(!1===t(e[a],n(a)))return}}}function c(e,t,n){return l(e,function(e,i){n=t(n,e,i)}),n}function u(e,t){return c(e,function(e,n,i){return e&&t(n,i)},!0)}function h(e,t){var n=[];return l(e,function(e,i){n.push(t(e,i))}),n}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=f(t),l(e,function(e){var i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)}),n}function f(e){return o(e)?e:function(t){return t[e]}}function d(e){return o(e)?e:function(t){return t===e}}function y(e){return e}function g(e){return Number(e)}var v=Array.prototype.slice;var x=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};e.find=p,e.filter=function(e,t){var n=[];return l(e,function(e,i){t(e,i)&&n.push(e)}),n},e.forEach=l,e.reduce=c,e.every=u,e.some=function(e,t){return!!p(e,t)},e.map=h,e.groupBy=m,e.matchPattern=function(e){return function(t){return u(e,function(e,n){return t[n]===e})}},e.debounce=function(e,t){var n;return function(){var i=v.call(arguments);n&&clearTimeout(n),n=setTimeout(function(){e.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i))},t)}},e.bind=function(e,t){return e.bind(t)},e.isArray=r,e.isObject=a,e.isNumber=function(e){return"[object Number]"===t.call(e)},e.isFunction=o,e.isString=function(e){return"[object String]"===t.call(e)},e.assign=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return x.apply(void 0,[e].concat(n))},e.pick=function(e,t){var n={},i=Object(e);return l(t,function(t){t in i&&(n[t]=e[t])}),n},e.omit=function(e,t){var n={};return l(Object(e),function(e,i){-1===t.indexOf(i)&&(n[i]=e)}),n},Object.defineProperty(e,"__esModule",{value:!0})});var p={},l=(s=s.exports).every,c=s.some,u=i.componentsToPath;function h(e){return e.businessObject.di}p.isTypedEvent=function(e,t,n){return c(e.eventDefinitions,function(i){return i.$type===t&&function(e,t){return l(t,function(t,n){return e[n]==t})}(e,n)})},p.isThrowEvent=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type},p.isCollection=function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection},p.getDi=h,p.getSemantic=function(e){return e.businessObject},p.getFillColor=function(e,t){return h(e).get("bioc:fill")||t||"white"},p.getStrokeColor=function(e,t){return h(e).get("bioc:stroke")||t||"black"},p.getCirclePath=function(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2;return u([["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]])},p.getRoundRectPath=function(e,t){var n=e.x,i=e.y,r=e.width,a=e.height;return u([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,a-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-a],["a",t,t,0,0,1,t,-t],["z"]])},p.getDiamondPath=function(e){var t=e.width,n=e.height,i=e.x,r=e.y,a=t/2,o=n/2;return u([["M",i+a,r],["l",a,o],["l",-a,o],["l",-a,-o],["z"]])},p.getRectPath=function(e){var t=e.x,n=e.y,i=e.width,r=e.height;return u([["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]])};var m={};function f(e){return e&&e.businessObject||e}m.is=function(e,t){var n=f(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)},m.getBusinessObject=f;var d={},y=m.is,g=m.getBusinessObject;s.forEach;d.isExpanded=function(e){return!y(e,"bpmn:CallActivity")&&(y(e,"bpmn:SubProcess")?!!g(e).di.isExpanded:!y(e,"bpmn:Participant")||!!g(e).processRef)},d.isEventSubProcess=function(e){return e&&!!g(e).triggeredByEvent};var v=1e3;function x(e,t){var n=this;t=t||v,e.on(["render.shape","render.connection"],t,function(e,t){var i=e.type,r=t.element,a=t.gfx;if(n.canRender(r))return"render.shape"===i?n.drawShape(a,r):n.drawConnection(a,r)}),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)})}x.prototype.canRender=function(){},x.prototype.drawShape=function(){},x.prototype.drawConnection=function(){},x.prototype.getShapePath=function(){},x.prototype.getConnectionPath=function(){};var b=x,E={},w=n.transform,_=n.createTransform;E.transform=function(e,t,n,i,r){var a=_();a.setTranslate(t,n);var o=_();o.setRotate(i,0,0);var s=_();s.setScale(r||1,r||1),w(e,[a,o,s])},E.translate=function(e,t,n){var i=_();i.setTranslate(t,n),w(e,i)},E.rotate=function(e,t){var n=_();n.setRotate(t,0,0),w(e,n)};var A=s.isObject,S=s.assign,C=s.pick,R=s.forEach,M=s.reduce,k=n.append,P=n.attr,T=n.create,N=n.remove,D=0,O={width:150,height:50};function B(e,t){t.textContent=e;try{var n,i=""===e;return t.textContent=i?"dummy":e,n=C(t.getBBox(),["width","height"]),i&&(n.width=0),n}catch(e){return{width:0,height:0}}}function L(e,t,n){for(var i,r=e.shift(),a=r;;){if((i=B(a,n)).width=a?i.width:0," "===a||""===a||i.width<Math.round(t)||a.length<2)return I(e,a,r,i);a=j(a,i.width,t)}}function I(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 j(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-)/g),r=[],a=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+a<t)){"-"===n&&r.pop();break}r.push(n),a+=n.length}return r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function F(e){this._config=S({},{size:O,padding:D,style:{},align:"center-top"},e||{})}F.prototype.createText=function(e,t){return this.layoutText(e,t).element},F.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},F.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),a=function(e){return A(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),o=t.fitBox||!1,s=e.split(/\r?\n/g),p=[],l=n.width-a.left-a.right,c=T("text");P(c,{x:0,y:0}),P(c,i);var u=function(){var e=document.getElementById("helper-svg");return e||(e=T("svg"),P(e,{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(e)),e}();for(k(u,c);s.length;)p.push(L(s,l,c));var h,m,f=M(p,function(e,t,n){return e+t.height},0),d=M(p,function(e,t,n){return t.width>e?t.width:e},0);switch(r.vertical){case"middle":h=(n.height-f)/2-p[0].height/4;break;default:h=a.top}var y=T("text");return P(y,i),R(p,function(e){switch(h+=e.height,r.horizontal){case"left":m=a.left;break;case"right":m=(o?d:l)-a.right-e.width;break;default:m=Math.max(((o?d:l)-e.width)/2+a.left,0)}var t=T("tspan");P(t,{x:m,y:h}),t.textContent=e.text,k(y,t)}),N(c),{dimensions:{width:d,height:f},element:y}};var V=F,W={},z=W=function(e,t){if(t||(t=16),void 0===e&&(e=128),e<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),i=2;n===1/0;i*=2)n=Math.log(Math.pow(2,e/i))/Math.log(t)*i;var r=n-Math.floor(n),a="";for(i=0;i<Math.floor(n);i++){a=Math.floor(Math.random()*t).toString(t)+a}if(r){var o=Math.pow(t,r);a=Math.floor(Math.random()*o).toString(t)+a}var s=parseInt(a,t);return s!==1/0&&s>=Math.pow(2,e)?z(e,t):a};function G(e){if(!(this instanceof G))return new G(e);e=e||[128,36,1],this._seed=e.length?W.rack(e[0],e[1],e[2]):e}z.rack=function(e,t,n){var i=function(i){var a=0;do{if(a++>10){if(!n)throw new Error("too many ID collisions, use more bits");e+=n}var o=z(e,t)}while(Object.hasOwnProperty.call(r,o));return r[o]=i,o},r=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=t||16,i};var $=G;G.prototype.next=function(e){return this._seed(e||!0)},G.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},G.prototype.claim=function(e,t){this._seed.set(e,t||!0)},G.prototype.assigned=function(e){return this._seed.get(e)||!1},G.prototype.unclaim=function(e){delete this._seed.hats[e]},G.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var H={};H="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var K={exports:{}};!function(e,t){"object"==typeof K.exports?t(K.exports):t(e.MinDom={})}(this,function(e){"use strict";var t=[].indexOf,n=function(e,n){if(t)return e.indexOf(n);for(var i=0;i<e.length;++i)if(e[i]===n)return i;return-1},i=/\s+/,r=Object.prototype.toString;function a(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}a.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~n(t,e)||t.push(e),this.el.className=t.join(" "),this},a.prototype.remove=function(e){if("[object RegExp]"==r.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),i=n(t,e);return~i&&t.splice(i,1),this.el.className=t.join(" "),this},a.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},a.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)},a.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(i);return""===e[0]&&e.shift(),e},a.prototype.has=a.prototype.contains=function(e){return this.list?this.list.contains(e):!!~n(this.array(),e)};var o=Element.prototype,s=o.matchesSelector||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector,p=function(e,t){if(s)return s.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 l,c=function(e,t,n){for(var i=n?e:e.parentNode;i&&i!==document;){if(p(i,t))return i;i=i.parentNode}},u=window.addEventListener?"addEventListener":"attachEvent",h=window.removeEventListener?"removeEventListener":"detachEvent",m="addEventListener"!==u?"on":"",f={bind:function(e,t,n,i){return e[u](m+t,n,i||!1),n},unbind:function(e,t,n,i){return e[h](m+t,n,i||!1),n}},d=["focus","blur"],y={bind:function(e,t,n,i,r){return-1!==d.indexOf(n)&&(r=!0),f.bind(e,n,function(n){var r=n.target||n.srcElement;n.delegateTarget=c(r,t,!0),n.delegateTarget&&i.call(e,n)},r)},unbind:function(e,t,n,i){-1!==d.indexOf(t)&&(i=!0),f.unbind(e,t,n,i)}},g=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){var r=t.createElement("html");return r.innerHTML=e,r.removeChild(r.lastChild)}var a=x[i]||x._default,o=a[0],s=a[1],p=a[2];(r=t.createElement("div")).innerHTML=s+e+p;for(;o--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var l=t.createDocumentFragment();for(;r.firstChild;)l.appendChild(r.removeChild(r.firstChild));return l},v=!1;"undefined"!=typeof document&&((l=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',v=!l.getElementsByTagName("link").length,l=void 0);var x={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:v?[1,"X<div>","</div>"]:[0,"",""]};x.td=x.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],x.option=x.optgroup=[1,'<select multiple="multiple">',"</select>"],x.thead=x.tbody=x.colgroup=x.caption=x.tfoot=[1,"<table>","</table>"],x.polyline=x.ellipse=x.polygon=x.circle=x.text=x.line=x.path=x.rect=x.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var b="undefined"!=typeof Element?Element.prototype:{};b.matches||b.matchesSelector||b.webkitMatchesSelector||b.mozMatchesSelector||b.msMatchesSelector||b.oMatchesSelector;e.attr=function(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)},e.classes=function(e){return new a(e)},e.clear=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},e.closest=c,e.delegate=y,e.domify=g,e.event=f,e.query=function(e,t){return(t=t||document).querySelector(e)},e.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)},Object.defineProperty(e,"__esModule",{value:!0})}),K=K.exports;var U=s.isObject,q=s.assign,Y=s.forEach,X=m.is,Z=i.createLine,J=p.isTypedEvent,Q=p.isThrowEvent,ee=p.isCollection,te=p.getDi,ne=p.getSemantic,ie=p.getCirclePath,re=p.getRoundRectPath,ae=p.getDiamondPath,oe=p.getRectPath,se=p.getFillColor,pe=p.getStrokeColor,le=K.query,ce=n.append,ue=n.attr,he=n.create,me=n.classes,fe=E.rotate,de=E.transform,ye=E.translate,ge=new $,ve=10,xe=3,be={fontFamily:"Arial, sans-serif",fontSize:12},Ee=.95,we=.35;function _e(e,t,n,i,r){b.call(this,e,r);var a=ge.next(),o=new V({style:be,size:{width:100}}),s={},p=t.computeStyle;function l(e,t){var n=q({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),r=t.ref||{x:0,y:0},a=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var o=he("marker");ue(t.element,n),ce(o,t.element),ue(o,{id:e,viewBox:"0 0 20 20",refX:r.x,refY:r.y,markerWidth:20*a,markerHeight:20*a,orient:"auto"});var p=le("defs",i._svg);p||(p=he("defs"),ce(i._svg,p)),ce(p,o),s[e]=o}function c(e,t,n){var i=e+"-"+t+"-"+n+"-"+a;return s[i]||function(e,t,n){var i=e+"-"+t+"-"+n+"-"+a;if("sequenceflow-end"===e){var r=he("path");ue(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),l(i,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:n,stroke:n}})}if("messageflow-start"===e){var o=he("circle");ue(o,{cx:6,cy:6,r:3.5}),l(i,{element:o,attrs:{fill:t,stroke:n},ref:{x:6,y:6}})}if("messageflow-end"===e){var s=he("path");ue(s,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),l(i,{element:s,attrs:{fill:t,stroke:n,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===e){var p=he("path");ue(p,{d:"M 11 5 L 1 10 L 11 15"}),l(i,{element:p,attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===e){var c=he("path");ue(c,{d:"M 1 5 L 11 10 L 1 15"}),l(i,{element:c,attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===e){var u=he("path");ue(u,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),l(i,{element:u,attrs:{fill:t,stroke:n},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===e){var h=he("path");ue(h,{d:"M 6 4 L 10 16"}),l(i,{element:h,attrs:{stroke:n},ref:{x:0,y:10},scale:.5})}}(e,t,n),"url(#"+i+")"}function u(e,t,n,i,r){U(i)&&(r=i,i=0),i=i||0,r=p(r,{stroke:"black",strokeWidth:2,fill:"white"});var a=t/2,o=n/2,s=he("circle");return ue(s,{cx:a,cy:o,r:Math.round((t+n)/4-i)}),ue(s,r),ce(e,s),s}function h(e,t,n,i,r,a){U(r)&&(a=r,r=0),r=r||0,a=p(a,{stroke:"black",strokeWidth:2,fill:"white"});var o=he("rect");return ue(o,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),ue(o,a),ce(e,o),o}function m(e,t,n){n=p(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"});var i=Z(t,n);return ce(e,i),i}function f(e,t,n){n=p(n,["no-fill"],{strokeWidth:2,stroke:"black"});var i=he("path");return ue(i,{d:t}),ue(i,n),ce(e,i),i}function y(e,t,n,i){return f(t,n,q({"data-marker":e},i))}function g(e){return function(t,n){return S[e](t,n)}}function v(e){return S[e]}function x(e,t){var n=ne(e),i=Q(n);return J(n,"bpmn:MessageEventDefinition")?v("bpmn:MessageEventDefinition")(t,e,i):J(n,"bpmn:TimerEventDefinition")?v("bpmn:TimerEventDefinition")(t,e,i):J(n,"bpmn:ConditionalEventDefinition")?v("bpmn:ConditionalEventDefinition")(t,e):J(n,"bpmn:SignalEventDefinition")?v("bpmn:SignalEventDefinition")(t,e,i):J(n,"bpmn:CancelEventDefinition")&&J(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!1})?v("bpmn:MultipleEventDefinition")(t,e,i):J(n,"bpmn:CancelEventDefinition")&&J(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!0})?v("bpmn:ParallelMultipleEventDefinition")(t,e,i):J(n,"bpmn:EscalationEventDefinition")?v("bpmn:EscalationEventDefinition")(t,e,i):J(n,"bpmn:LinkEventDefinition")?v("bpmn:LinkEventDefinition")(t,e,i):J(n,"bpmn:ErrorEventDefinition")?v("bpmn:ErrorEventDefinition")(t,e,i):J(n,"bpmn:CancelEventDefinition")?v("bpmn:CancelEventDefinition")(t,e,i):J(n,"bpmn:CompensateEventDefinition")?v("bpmn:CompensateEventDefinition")(t,e,i):J(n,"bpmn:TerminateEventDefinition")?v("bpmn:TerminateEventDefinition")(t,e,i):null}function E(e,t,n){var i=o.createText(t||"",n);return me(i).add("djs-label"),ce(e,i),i}function w(e,t,n){return E(e,ne(t).name,{box:t,align:n,padding:5,style:{fill:pe(t)}})}function _(e,t,n){var i=E(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:pe(n)}}),r=-1*n.height;de(i,0,-r,270)}function A(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 S=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=Ee),u(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:se(t),stroke:pe(t)};ne(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round"});var i=v("bpmn:Event")(e,t,n);return x(t,e),i},"bpmn:MessageEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:i?pe(t):se(t),stroke:i?se(t):pe(t)})},"bpmn:TimerEventDefinition":function(e,t){var i=u(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:se(t),stroke:pe(t)});f(e,n.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:pe(t)});for(var r=0;r<12;r++){var a=n.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),o=t.width/2;f(e,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+o+")",stroke:pe(t)})}return i},"bpmn:EscalationEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:ConditionalEventDefinition":function(e,t){return f(e,n.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:pe(t)})},"bpmn:LinkEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:ErrorEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:CancelEventDefinition":function(e,t,i){var r=f(e,n.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:i?"black":"none"});return fe(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:SignalEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:MultipleEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:i?"black":"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return f(e,n.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:pe(t),stroke:pe(t)})},"bpmn:EndEvent":function(e,t){var n=v("bpmn:Event")(e,t,{strokeWidth:4,fill:se(t),stroke:pe(t)});return x(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return u(e,t.width,t.height,8,{strokeWidth:4,fill:pe(t),stroke:pe(t)})},"bpmn:IntermediateEvent":function(e,t){var n=v("bpmn:Event")(e,t,{strokeWidth:1,fill:se(t),stroke:pe(t)});return u(e,t.width,t.height,xe,{strokeWidth:1,fill:se(t,"none"),stroke:pe(t)}),x(t,e),n},"bpmn:IntermediateCatchEvent":g("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":g("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=Ee),h(e,t.width,t.height,ve,n)},"bpmn:Task":function(e,t){var n={fill:se(t),stroke:pe(t)},i=v("bpmn:Activity")(e,t,n);return w(e,t,"center-middle"),C(e,t),i},"bpmn:ServiceTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:se(t),stroke:pe(t)}),f(e,n.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:se(t)}),f(e,n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:se(t),stroke:pe(t)}),i},"bpmn:UserTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:se(t),stroke:pe(t)}),f(e,n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:se(t),stroke:pe(t)}),f(e,n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:pe(t),stroke:pe(t)}),i},"bpmn:ManualTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:se(t),stroke:pe(t)}),i},"bpmn:SendTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:pe(t),stroke:se(t)}),i},"bpmn:ReceiveTask":function(e,t){var i,r=ne(t),a=v("bpmn:Task")(e,t);return r.instantiate?(u(e,28,28,4.4,{strokeWidth:1}),i=n.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):i=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),f(e,i,{strokeWidth:1,fill:se(t),stroke:pe(t)}),a},"bpmn:ScriptTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:pe(t)}),i},"bpmn:BusinessRuleTask":function(e,t){var i=v("bpmn:Task")(e,t),r=f(e,n.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}));ue(r,{strokeWidth:1,fill:se(t,"#aaaaaa"),stroke:pe(t)});var a=f(e,n.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}));return ue(a,{strokeWidth:1,stroke:pe(t)}),i},"bpmn:SubProcess":function(e,t,n){n=q({fill:se(t),stroke:pe(t)},n);var i=v("bpmn:Activity")(e,t,n),r=d.isExpanded(t);return d.isEventSubProcess(t)&&ue(i,{strokeDasharray:"1,2"}),w(e,t,r?"center-top":"center-middle"),r?C(e,t):C(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return v("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,n){var i=v("bpmn:SubProcess")(e,n),r=t.style(["no-fill","no-events"],{stroke:pe(n)});return h(e,n.width,n.height,ve-2,xe,r),i},"bpmn:CallActivity":function(e,t){return v("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:Ee,fill:se(t),stroke:pe(t)},i=v("bpmn:Lane")(e,t,n);d.isExpanded(t)?(m(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:pe(t)}),_(e,ne(t).name,t)):E(e,ne(t).name,{box:t,align:"center-middle",style:{fill:pe(t)}});return!!ne(t).participantMultiplicity&&v("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=h(e,t.width,t.height,0,q({fill:se(t),fillOpacity:we,stroke:pe(t)},n)),r=ne(t);"bpmn:Lane"===r.$type&&_(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=v("bpmn:Gateway")(e,t);return u(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:se(t),stroke:pe(t)}),n},"bpmn:ExclusiveGateway":function(e,t){var i=v("bpmn:Gateway")(e,t),r=n.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return te(t).isMarkerVisible&&f(e,r,{strokeWidth:1,fill:pe(t),stroke:pe(t)}),i},"bpmn:ComplexGateway":function(e,t){var i=v("bpmn:Gateway")(e,t);return f(e,n.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:pe(t),stroke:pe(t)}),i},"bpmn:ParallelGateway":function(e,t){var i=v("bpmn:Gateway")(e,t);return f(e,n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:pe(t),stroke:pe(t)}),i},"bpmn:EventBasedGateway":function(e,t){var i=ne(t),r=v("bpmn:Gateway")(e,t);u(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:pe(t)});var a=i.eventGatewayType,o=!!i.instantiate;if("Parallel"===a){var s=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),p=f(e,s);ue(p,{strokeWidth:1,fill:"none"})}else if("Exclusive"===a){if(!o){var l=u(e,t.width,t.height,.26*t.height);ue(l,{strokeWidth:1,fill:"none",stroke:pe(t)})}!function(){var i=n.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:se(t,"none"),stroke:pe(t)};f(e,i,r)}()}return r},"bpmn:Gateway":function(e,t){var n={fill:se(t),fillOpacity:Ee,stroke:pe(t)};return function(e,t,n,i){var r=t/2,a=n/2,o=[{x:r,y:0},{x:t,y:a},{x:r,y:n},{x:0,y:a}].map(function(e){return e.x+","+e.y}).join(" ");i=p(i,{stroke:"black",strokeWidth:2,fill:"white"});var s=he("polygon");return ue(s,{points:o}),ue(s,i),ce(e,s),s}(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=A(t),r=se(t),a=pe(t),o=f(e,i,{strokeLinejoin:"round",markerEnd:c("sequenceflow-end",r,a),stroke:pe(t)}),s=ne(t);return t.source&&(n=t.source.businessObject,s.conditionExpression&&n.$instanceOf("bpmn:Activity")&&ue(o,{markerStart:c("conditional-flow-marker",r,a)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===s&&ue(o,{markerStart:c("conditional-default-flow-marker",r,a)})),o},"bpmn:Association":function(e,t,n){var i=ne(t),r=se(t),a=pe(t);return n=q({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:pe(t)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=c("association-end",r,a)),"Both"===i.associationDirection&&(n.markerStart=c("association-start",r,a)),m(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=se(t),i=pe(t);return v("bpmn:Association")(e,t,{markerEnd:c("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=se(t),i=pe(t);return v("bpmn:Association")(e,t,{markerEnd:c("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var i=ne(t),r=te(t),a=se(t),o=pe(t),s=f(e,A(t),{markerEnd:c("messageflow-end",a,o),markerStart:c("messageflow-start",a,o),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:pe(t)});if(i.messageRef){var p=s.getPointAtLength(s.getTotalLength()/2),l=n.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:p.x,y:p.y}}),u={strokeWidth:1};"initiating"===r.messageVisibleKind?(u.fill="white",u.stroke="black"):(u.fill="#888",u.stroke="white"),f(e,l,u)}return s},"bpmn:DataObject":function(e,t){var i=f(e,n.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:se(t),fillOpacity:Ee,stroke:pe(t)}),r=ne(t);return ee(r)&&function(e,t){var i=(t.height-16)/t.height,r=n.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.451,my:i}});f(e,r,{strokeWidth:2})}(e,t),i},"bpmn:DataObjectReference":g("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var i=n.getRawPath("DATA_ARROW"),r=v("bpmn:DataObject")(e,t);return f(e,i,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var i=n.getRawPath("DATA_ARROW"),r=v("bpmn:DataObject")(e,t);return f(e,i,{strokeWidth:1,fill:"black"}),r},"bpmn:DataStoreReference":function(e,t){return f(e,n.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:se(t),fillOpacity:Ee,stroke:pe(t)})},"bpmn:BoundaryEvent":function(e,t){var n=ne(t).cancelActivity,i={strokeWidth:1,fill:se(t),stroke:pe(t),fillOpacity:1};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=v("bpmn:Event")(e,t,i);return u(e,t.width,t.height,xe,q(i,{fill:"none"})),x(t,e),r},"bpmn:Group":function(e,t){return h(e,t.width,t.height,ve,{strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n=ne(t),i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return E(e,n.name,{box:i,fitBox:!0,style:{fontSize:"11px"}})}(e,t)},"bpmn:TextAnnotation":function(e,t){var i=h(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return f(e,n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:pe(t)}),E(e,ne(t).text||"",{box:t,align:"left-top",padding:5}),i},ParticipantMultiplicityMarker:function(e,t){y("participant-multiplicity",e,n.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}}))},SubProcessMarker:function(e,t){var i=h(e,14,14,0,{strokeWidth:1,fill:se(t),stroke:pe(t)});ye(i,t.width/2-7.5,t.height-20),y("sub-process",e,n.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:se(t),stroke:pe(t)})},ParallelMarker:function(e,t,i){y("parallel",e,n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.parallel)/t.width,my:(t.height-20)/t.height}}))},SequentialMarker:function(e,t,i){y("sequential",e,n.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.seq)/t.width,my:(t.height-19)/t.height}}))},CompensationMarker:function(e,t,i){y("compensation",e,n.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1})},LoopMarker:function(e,t,i){y("loop",e,n.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1,fill:"none",strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,i){y("adhoc",e,n.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:"black"})}};function C(e,t,n){var i,r=ne(t),a=n&&-1!==n.indexOf("SubProcessMarker");i=a?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},Y(n,function(n){v(n)(e,t,i)}),r.isForCompensation&&v("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&v("AdhocMarker")(e,t,i);var o=r.loopCharacteristics,s=o&&o.isSequential;o&&(void 0===s&&v("LoopMarker")(e,t,i),!1===s&&v("ParallelMarker")(e,t,i),!0===s&&v("SequentialMarker")(e,t,i))}this._drawPath=f}H(_e,b),_e.$inject=["eventBus","styles","pathMap","canvas"];var Ae=_e;_e.prototype.canRender=function(e){return X(e,"bpmn:BaseElement")},_e.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},_e.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},_e.prototype.getShapePath=function(e){return X(e,"bpmn:Event")?ie(e):X(e,"bpmn:Activity")?re(e,ve):X(e,"bpmn:Gateway")?ae(e):oe(e)};var Se=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 0 15 l 0 -15 m 4 15 l 0 -15 m 4 15 l 0 -15 ",height:61,width:51,heightElements:[12],widthElements:[1,6,12,15]},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 a,o,s={};if(t.position){for(var p=t.containerHeight/r.height*t.yScaleFactor,l=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)s["y"+c]=r.heightElements[c]*p;for(var u=0;u<r.widthElements.length;u++)s["x"+u]=r.widthElements[u]*l}return a=r.d,o={mx:n,my:i,e:s},String(a).replace(Ce,function(e,t){return function(e,t,n){var i=n;return t.replace(Re,function(e,t,n,r,a){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&a&&(i=i()))}),i=(null==i||i==n?e:i)+""}(e,t,o)})}},Ce=/\{([^}]+)\}/g,Re=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Me={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ae],pathMap:["type",Se]},ke={elementToString:function(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}},Pe={},Te=s.assign,Ne=m.is,De={width:90,height:20},Oe=15;function Be(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=Le(e),a=Math.atan((i.y-n.y)/(i.x-n.x)),o=r.x,s=r.y;return Math.abs(a)<Math.PI/2?s-=Oe:o+=Oe,{x:o,y:s}}function Le(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}}function Ie(e){return e.waypoints?Be(e.waypoints):{x:e.x+e.width/2,y:e.y+e.height+De.height/2}}Pe.hasExternalLabel=function(e){return Ne(e,"bpmn:Event")||Ne(e,"bpmn:Gateway")||Ne(e,"bpmn:DataStoreReference")||Ne(e,"bpmn:DataObjectReference")||Ne(e,"bpmn:SequenceFlow")||Ne(e,"bpmn:MessageFlow")},Pe.getExternalLabelBounds=function(e,t){var n,i,r,a=e.di.label;return a&&a.bounds?(r=a.bounds,i={width:Math.max(De.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Ie(t),i=De),Te({x:n.x-i.width/2,y:n.y-i.height/2},i)};var je=s.assign,Fe=s.map,Ve=m.is,We=Pe.hasExternalLabel,ze=Pe.getExternalLabelBounds,Ge=d.isExpanded,$e=ke.elementToString;function He(e,t){return je({id:e.id,type:e.$type,businessObject:e},t)}function Ke(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:$e(n),referenced:$e(t),property:i}))}function Ue(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textUtil=new V}Ue.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate"];var qe=Ue;Ue.prototype.add=function(e,t){var n,i,r,a,o=e.di,s=this._translate;if(Ve(o,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(He(e)),this._canvas.setRootElement(n);else if(Ve(o,"bpmndi:BPMNShape")){var p=!Ge(e);i=t&&(t.hidden||t.collapsed);var l=e.di.bounds;n=this._elementFactory.createShape(He(e,{collapsed:p,hidden:i,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height)})),Ve(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,n),Ve(e,"bpmn:Lane")&&(r=0),this._canvas.addShape(n,t,r)}else{if(!Ve(o,"bpmndi:BPMNEdge"))throw new Error(s("unknown di {di} for element {semantic}",{di:$e(o),semantic:$e(e)}));var c=this._getSource(e),u=this._getTarget(e);i=t&&(t.hidden||t.collapsed),n=this._elementFactory.createConnection(He(e,{hidden:i,source:c,target:u,waypoints:(a=e.di.waypoint,Fe(a,function(e){return{x:e.x,y:e.y}}))})),Ve(e,"bpmn:DataAssociation")&&(t=null),Ve(e,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,t,r)}return We(e)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},Ue.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:$e(e)}));var r=this._elementRegistry.get(i.id),a=r&&r.attachers;if(!r)throw Ke(n,e,i,"attachedToRef");t.host=r,a||(r.attachers=a=[]),-1===a.indexOf(t)&&a.push(t)},Ue.prototype.addLabel=function(e,t){var n,i,r;return n=ze(e,t),(i=e.name)&&(n=function(e,t,n){var i=n.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:Ye});return{x:Math.round(e.x+e.width/2-i.width/2),y:Math.round(e.y),width:Math.ceil(i.width),height:Math.ceil(i.height)}}(n,i,this._textUtil)),r=this._elementFactory.createLabel(He(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!e.name,x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,t.parent)},Ue.prototype._getEnd=function(e,t){var n,i,r=e.$type,a=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?Ke(a,e,i,t+"Ref"):new Error(a("{semantic}#{side} Ref not specified",{semantic:$e(e),side:t}))},Ue.prototype._getSource=function(e){return this._getEnd(e,"source")},Ue.prototype._getTarget=function(e){return this._getEnd(e,"target")},Ue.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Ye={fontFamily:"Arial, sans-serif",fontSize:"11px"};var Xe={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}]},Ze={__depends__:[Me,{__depends__:[Xe],bpmnImporter:["type",qe]}]},Je={};function Qe(e,t,n){Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:Je.extend(n[t.name]||[],e,t,n)})}function et(e,t){if(!(this instanceof et))return new et(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Je.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){this.contains(e)||(this.push(e),t.set(e,r,i))}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},Je.isExtended=function(e){return!0===e.__refs_collection},et.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?Qe(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var a=r;r=null,a&&e.unset(a,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},et.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Je.isExtended(n)||Qe(this,t,e),n},et.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},et.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},et.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var tt={};(tt=et).Collection=Je;var nt=s.filter,it=s.find,rt=s.forEach,at=ke.elementToString,ot=new tt({name:"bpmnElement",enumerable:!0},{name:"di"});function st(e,t){return e.$instanceOf(t)}var pt=function(e,t){var n={},i=[];function r(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function o(n,i){try{var r=n.di&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:at(n)}));return e.element(n,i)}(n,i);return a(n),r}catch(e){s(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:at(n)})),console.error(e)}}function s(t,n){e.error(t,n)}function p(e){var n=e.bpmnElement;n?n.di?s(t("multiple DI elements defined for {element}",{element:at(n)}),{element:n}):(ot.bind(n,"di"),n.di=e):s(t("no bpmnElement referenced in {element}",{element:at(e)}),{element:e})}function l(e){var t;p(t=e.plane),rt(t.planeElement,c)}function c(e){p(e)}function u(e,t){_(e,t),v(e.ioSpecification,t),g(e.artifacts,t),a(e)}function h(e,t){o(e,t)}function m(e,t){o(e,t)}function f(e,t){o(e,t)}function d(e,t){o(e,t)}function y(e,t){o(e,t)}function g(e,t){rt(e,function(e){st(e,"bpmn:Association")?i.push(function(){y(e,t)}):y(e,t)})}function v(e,t){e&&(rt(e.dataInputs,r(f,t)),rt(e.dataOutputs,r(d,t)))}function x(e,t){var n=o(e,t);st(e,"bpmn:SubProcess")&&function(e,t){_(e,t),g(e.artifacts,t)}(e,n||t),st(e,"bpmn:Activity")&&v(e.ioSpecification,t),i.push(function(){rt(e.dataInputAssociations,r(m,t)),rt(e.dataOutputAssociations,r(m,t))})}function b(e,t){o(e,t)}function E(e,t){i.push(function(){var n=o(e,t);e.childLaneSet&&w(e.childLaneSet,n||t),function(e){rt(e.flowNodeRef,function(t){var n=t.get("lanes");n&&n.push(e)})}(e)})}function w(e,t){rt(e.lanes,r(E,t))}function _(e,n){!function(e,n){rt(e,function(e){st(e,"bpmn:SequenceFlow")?i.push(function(){!function(e,t){o(e,t)}(e,n)}):st(e,"bpmn:BoundaryEvent")?i.unshift(function(){!function(e,t){o(e,t)}(e,n)}):st(e,"bpmn:FlowNode")?x(e,n):st(e,"bpmn:DataObject")||(st(e,"bpmn:DataStoreReference")?b(e,n):st(e,"bpmn:DataObjectReference")?b(e,n):s(t("unrecognized flowElement {element} in context {context}",{element:at(e),context:n?at(n.businessObject):"null"}),{element:e,context:n}))})}(e.flowElements,n),e.laneSets&&function(e,t){rt(e,r(w,t))}(e.laneSets,n)}function A(e,t){var n=o(e,t),i=e.processRef;i&&u(i,n||t)}return{handleDefinitions:function(a,o){var c=a.diagrams;if(o&&-1===c.indexOf(o))throw new Error(t("diagram not part of bpmn:Definitions"));if(!o&&c&&c.length&&(o=c[0]),!o)throw new Error(t("no diagram to display"));l(o);var m=o.plane;if(!m)throw new Error(t("no plane for {element}",{element:at(o)}));var f=m.bpmnElement;if(!f){if(!(f=function(e){return it(e.rootElements,function(e){return st(e,"bpmn:Process")||st(e,"bpmn:Collaboration")})}(a)))throw new Error(t("no process or collaboration to display"));s(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:at(m),rootElement:at(f)})),m.bpmnElement=f,p(m)}var d,y,v=function(t,n){return e.root(t,n)}(f,m);if(st(f,"bpmn:Process"))u(f,v);else{if(!st(f,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:at(m),rootElement:at(f)}));rt((y=f).participants,r(A)),g(y.artifacts),i.push(function(){var e,t;e=y.messageFlows,rt(e,r(h,t))}),d=a.rootElements,nt(d,function(e){return!n[e.id]&&st(e,"bpmn:Process")&&e.laneSets}).forEach(r(u))}!function(e){for(;e.length;)e.shift()()}(i)}}},lt={};lt.importBpmnDiagram=function(e,t,n){var i,r,a,o,s=[];try{i=e.get("bpmnImporter"),r=e.get("eventBus"),a=e.get("translate"),r.fire("import.render.start",{definitions:t}),function(e){new pt({root:function(e){return i.add(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){s.push({message:e,context:t})}},a).handleDefinitions(e)}(t),r.fire("import.render.complete",{error:o,warnings:s})}catch(e){o=e}n(o,s)};var ct={},ut=K.domify,ht=K.delegate,mt='<img width="52" height="52" src="'+("data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960"><path fill="#fff" d="M960 60v839c0 33-27 61-60 61H60c-33 0-60-27-60-60V60C0 27 27 0 60 0h839c34 0 61 27 61 60z"/><path fill="#52b415" d="M217 548a205 205 0 0 0-144 58 202 202 0 0 0-4 286 202 202 0 0 0 285 3 200 200 0 0 0 48-219 203 203 0 0 0-185-128zM752 6a206 206 0 0 0-192 285 206 206 0 0 0 269 111 207 207 0 0 0 111-260A204 204 0 0 0 752 6zM62 0A62 62 0 0 0 0 62v398l60 46a259 259 0 0 1 89-36c5-28 10-57 14-85l99 2 12 85a246 246 0 0 1 88 38l70-52 69 71-52 68c17 30 29 58 35 90l86 14-2 100-86 12a240 240 0 0 1-38 89l43 58h413c37 0 60-27 60-61V407a220 220 0 0 1-44 40l21 85-93 39-45-76a258 258 0 0 1-98 1l-45 76-94-39 22-85a298 298 0 0 1-70-69l-86 22-38-94 76-45a258 258 0 0 1-1-98l-76-45 40-94 85 22a271 271 0 0 1 41-47z"/></svg>'))+'" />';function ft(e){return e.join(";")}var dt,yt='<div class="bjs-powered-by-lightbox" style="'+ft(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+ft(["width: 100%","height: 100%","background: rgba(0,0,0,0.2)"])+'"></div><div class="notice" style="'+ft(["position: absolute","left: 50%","top: 40%","margin: 0 -130px","width: 260px","padding: 10px","background: white","border: solid 1px #AAA","border-radius: 3px","font-family: Helvetica, Arial, sans-serif","font-size: 14px","line-height: 1.2em"])+'"><a href="http://bpmn.io" target="_blank" style="float: left; margin-right: 10px">'+mt+'</a>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="http://bpmn.io" target="_blank">bpmn.io</a>.</div></div>';ct.open=function(){dt||(dt=ut(yt),ht.bind(dt,".backdrop","click",function(e){document.body.removeChild(dt)})),document.body.appendChild(dt)},ct.BPMNIO_IMG=mt;var gt={};gt.hasLowerCaseAlias=function(e){return e.xml&&"lowerCase"===e.xml.tagAlias},gt.DEFAULT_NS_MAP={xsi:"http://www.w3.org/2001/XMLSchema-instance"};var vt=gt.XSI_TYPE="xsi:type";function xt(e){return e.xml&&e.xml.serialize}function bt(){}gt.serializeAsType=function(e){return xt(e)===vt},gt.serializeAsProperty=function(e){return"property"===xt(e)},bt.prototype.get=function(e){return this.$model.properties.get(this,e)},bt.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};var Et=bt,wt=s.forEach,_t=s.bind;function At(e,t){this.model=e,this.properties=t}var St=At;At.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Et.prototype);wt(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 a(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),wt(e,_t(function(e,t){this.set(t,e)},this))}return a.prototype=i,a.hasType=i.$instanceOf=this.model.hasType,n.defineModel(a,t),n.defineDescriptor(a,e),a};var Ct={};function Rt(e){this.model=e}Ct.parseName=function(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}};var Mt=Rt;function kt(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}Rt.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:kt(e,i,n):e.$attrs[t]=n},Rt.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&&kt(e,n,[]),e[i]},Rt.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},Rt.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Rt.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};var Pt=s.pick,Tt=s.assign,Nt=s.forEach,Dt=s.bind,Ot=Ct.parseName;function Bt(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}var Lt=Bt;Bt.prototype.build=function(){return Pt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Bt.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)},Bt.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,a=this.propertiesByName,o=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,o),a[i.name]=a[i.localName]=t},Bt.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),a=Ot(r[0],i),o=Ot(r[1],a.prefix).name,s=this.propertiesByName[o];if(!s)throw new Error("refined property <"+o+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Bt.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},Bt.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Bt.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},Bt.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},Bt.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")},Bt.prototype.hasProperty=function(e){return this.propertiesByName[e]},Bt.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(Nt(e.properties,Dt(function(n){n=Tt({},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)};var It={},jt={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ft={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};It.coerceType=function(e,t){var n=Ft[e];return n?n(t):t},It.isBuiltIn=function(e){return!!jt[e]},It.isSimple=function(e){return!!Ft[e]};var Vt=s.assign,Wt=s.forEach,zt=s.bind,Gt=Ct.parseName,$t=It.isBuiltIn;function Ht(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,Wt(e,zt(this.registerPackage,this))}var Kt=Ht;function Ut(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}Ht.prototype.getPackage=function(e){return this.packageMap[e]},Ht.prototype.getPackages=function(){return this.packages},Ht.prototype.registerPackage=function(e){e=Vt({},e);var t=this.packageMap;Ut(t,e,"prefix"),Ut(t,e,"uri"),Wt(e.types,zt(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Ht.prototype.registerType=function(e,t){e=Vt({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:Vt(e.meta||{})});var n=Gt(e.name,t.prefix),i=n.name,r={};Wt(e.properties,zt(function(e){var t=Gt(e.name,n.prefix),i=t.name;$t(e.type)||(e.type=Gt(e.type,t.prefix).name),Vt(e,{ns:t,name:i}),r[i]=e},this)),Vt(e,{ns:n,name:i,propertiesByName:r}),Wt(e.extends,zt(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Ht.prototype.mapTypes=function(e,t,n){var i=$t(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function a(e){return o(e,!0)}function o(n,i){var a=Gt(n,$t(n)?"":e.prefix);r.mapTypes(a,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");Wt(i.superClass,n?a:o),t(i,!n),Wt(i.traits,a)},Ht.prototype.getEffectiveDescriptor=function(e){var t=Gt(e),n=new Lt(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},Ht.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};var qt=s.isString,Yt=s.isObject,Xt=s.forEach,Zt=Ct.parseName;function Jt(e){this.properties=new Mt(this),this.factory=new St(this,this.properties),this.registry=new Kt(e,this.properties),this.typeCache={}}var Qt=Jt;Jt.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Jt.prototype.getType=function(e){var t=this.typeCache,n=qt(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Jt.prototype.createAny=function(e,t,n){var i=Zt(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},a={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,a),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),Xt(n,function(e,t){Yt(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e}),r},Jt.prototype.getPackage=function(e){return this.registry.getPackage(e)},Jt.prototype.getPackages=function(){return this.registry.getPackages()},Jt.prototype.getElementDescriptor=function(e){return e.$descriptor},Jt.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Jt.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Jt.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var en=Qt,tn={exports:{}};!function(e,t){"object"==typeof tn.exports?t(tn.exports):t(e.Saxen={})}(this,function(e){"use strict";var t=String.fromCharCode,n=Object.prototype.hasOwnProperty,i=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,r={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function a(e,i,a,o){return o?n.call(r,o)?r[o]:"&"+o+";":t(i||parseInt(a,16))}function o(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(i,a):e}Object.keys(r).forEach(function(e){r[e.toUpperCase()]=r[e]});var s="http://www.w3.org/2001/XMLSchema-instance",p="xsi",l="xsi:type";function c(e){return new Error(e)}function u(e){return"missing namespace for prefix <"+e+">"}function h(e){return{get:e,enumerable:!0}}function m(e){var t,n={};for(t in e)n[t]=e[t];return n}function f(e){return e+"$uri"}function d(){return{line:0,column:0}}function y(e){throw e}e.Parser=function e(t){if(!this)return new e(t);var n,i,r,a,g,v,x,b,E,w=t&&t.proxy,_=y,A=d,S=!1,C=!1,R=null,M=!1;function k(e){e instanceof Error||(e=c(e)),R=e,_(e,A)}function P(e){g&&(e instanceof Error||(e=c(e)),g(e,A))}this.on=function(e,t){if("function"!=typeof t)throw c("required args <name, cb>");switch(e){case"openTag":i=t;break;case"text":n=t;break;case"closeTag":r=t;break;case"error":_=t;break;case"warn":g=t;break;case"cdata":a=t;break;case"attention":b=t;break;case"question":x=t;break;case"comment":v=t;break;default:throw c("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw c("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n[s]=p,C=!0,E=n,this},this.parse=function(e){if("string"!=typeof e)throw c("required args <xml=string>");return R=null,function(e){var t,s,p,c,d,y,g,_,R,T,N=C?[]:null,D=C?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[f(n)]=t;return i}(E):null,O=[],B=0,L=!1,I=!1,j=0,F=0,V="",W=0;function z(){if(null!==T)return T;var e,t,n,i,r,a,s,p,c,h,d,y=C&&D.xmlns,g=C&&S?[]:null,v=W,x=V,b=x.length,w={},_={};e:for(;v<b;v++)if(c=!1,!(32===(h=x.charCodeAt(v))||h<14&&h>8)){for((h<65||h>122||h>90&&h<97)&&95!==h&&58!==h&&(P("illegal first char attribute name"),c=!0),d=v+1;d<b;d++)if(!((h=x.charCodeAt(d))>96&&h<123||h>64&&h<91||h>47&&h<59||46===h||45===h||95===h)){if(32===h||h<14&&h>8){P("missing attribute value"),v=d;continue e}if(61===h)break;P("illegal attribute name char"),c=!0}if("xmlns:xmlns"===(p=x.substring(v,d))&&(P("illegal declaration of xmlns"),c=!0),34===(h=x.charCodeAt(d+1)))-1===(d=x.indexOf('"',v=d+2))&&-1!==(d=x.indexOf("'",v))&&(P("attribute value quote missmatch"),c=!0);else if(39===h)-1===(d=x.indexOf("'",v=d+2))&&-1!==(d=x.indexOf('"',v))&&(P("attribute value quote missmatch"),c=!0);else for(P("missing attribute value quotes"),c=!0,d+=1;d<b&&!(32===(h=x.charCodeAt(d+1))||h<14&&h>8);d++);for(-1===d&&(P("missing closing quotes"),d=b,c=!0),c||(a=x.substring(v,d)),v=d;d+1<b&&!(32===(h=x.charCodeAt(d+1))||h<14&&h>8);d++)v===d&&(P("illegal character after attribute end"),c=!0);if(v=d+1,!c)if(p in _)P("attribute <"+p+"> already defined");else if(_[p]=!0,C)if(S){if(null!==(r="xmlns"===p?"xmlns":120===p.charCodeAt(0)&&"xmlns:"===p.substr(0,6)?p.substr(6):null)){if(e=o(a),t=f(r),!(s=E[e])){if("xmlns"===r||t in D&&D[t]!==e)do{s="ns"+B++}while(void 0!==D[s]);else s=r;E[e]=s}D[r]!==s&&(i||(D=m(D),i=!0),D[r]=s,"xmlns"===r&&(D[f(s)]=e,y=s),D[t]=e),w[p]=a;continue}g.push(p,a)}else-1!==(h=p.indexOf(":"))?(n=D[p.substring(0,h)])?((p=y===n?p.substr(h+1):n+p.substr(h))===l&&(-1!==(h=a.indexOf(":"))?(n=a.substring(0,h),n=D[n]||n,a=n+a.substring(h)):a=y+":"+a),w[p]=a):P(u(p.substring(0,h))):w[p]=a;else w[p]=a}if(S)for(v=0,b=g.length;v<b;v++){if(p=g[v++],a=g[v],-1!==(h=p.indexOf(":"))){if(!(n=D[p.substring(0,h)])){P(u(p.substring(0,h)));continue}(p=y===n?p.substr(h+1):n+p.substr(h))===l&&(-1!==(h=a.indexOf(":"))?(n=a.substring(0,h),n=D[n]||n,a=n+a.substring(h)):a=y+":"+a)}w[p]=a}return T=w}for(A=function(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,a=0,o=0,s=F;j>=o&&(t=i.exec(e))&&!((s=t[0].length+t.index)>j);)r+=1,o=s;return-1==j?(a=s,n=""):(a=j-o,n=-1==F?e.substring(j):e.substring(j,F+1)),{data:n,line:r,column:a}},w&&(R=Object.create({},{name:h(function(){return g}),originalName:h(function(){return _}),attrs:h(z),ns:h(function(){return D})}));-1!==F;){if(-1===(j=60===e.charCodeAt(F)?F:e.indexOf("<",F)))return O.length?k("unexpected end of file"):0===F?k("missing start tag"):void 0;if(F!==j&&n&&(n(e.substring(F,j),o,A),M))return;if(33!==(d=e.charCodeAt(j+1)))if(63!==d){if(-1==(F=e.indexOf(">",j+1)))return k("unclosed tag");if(T={},47===d){if(L=!1,I=!0,!O.length)return k("missing open tag");if(s=g=O.pop(),c=j+2+s.length,e.substring(j+2,c)!==s)return k("closing tag mismatch");for(;c<F;c++)if(!(32===(d=e.charCodeAt(c))||d>8&&d<14))return k("close tag")}else{if(47===e.charCodeAt(F-1)?(s=g=e.substring(j+1,F-1),L=!0,I=!0):(s=g=e.substring(j+1,F),L=!0,I=!1),!(d>96&&d<123||d>64&&d<91||95===d||58===d))return k("illegal first char nodeName");for(c=1,p=s.length;c<p;c++)if(!((d=s.charCodeAt(c))>96&&d<123||d>64&&d<91||d>47&&d<59||45===d||95===d)){if(32===d||d<14&&d>8){g=s.substring(0,c),T=null;break}return k("invalid nodeName")}I||O.push(g)}if(C){if(t=D,L&&(I||N.push(t),null===T&&(S=-1!==s.indexOf("xmlns",c))&&(W=c,V=s,z(),S=!1)),_=g,-1!==(d=g.indexOf(":"))){if(!(y=D[g.substring(0,d)]))return k("missing namespace on <"+_+">");g=g.substr(d+1)}else y=D.xmlns;y&&(g=y+":"+g)}if(L&&(W=c,V=s,i&&(w?i(R,o,I,A):i(g,z,o,I,A),M)))return;if(I){if(r&&(r(w?R:g,o,L,A),M))return;C&&(D=L?t:N.pop())}F+=1}else{if(-1===(F=e.indexOf("?>",j)))return k("unclosed question");if(x&&(x(e.substring(j,F+2),A),M))return;F+=2}else{if(91===(d=e.charCodeAt(j+2))&&"CDATA["===e.substr(j+3,6)){if(-1===(F=e.indexOf("]]>",j)))return k("unclosed cdata");if(a&&(a(e.substring(j+9,F),A),M))return;F+=3;continue}if(45===d&&45===e.charCodeAt(j+3)){if(-1===(F=e.indexOf("--\x3e",j)))return k("unclosed comment");if(v&&(v(e.substring(j+4,F),o,A),M))return;F+=3;continue}if(-1===(F=e.indexOf(">",j+1)))return k("unclosed tag");if(b&&(b(e.substring(j,F+1),o,A),M))return;F+=1}}}(e),A=d,M=!1,R},this.stop=function(){M=!0}},Object.defineProperty(e,"__esModule",{value:!0})}),tn=tn.exports;var nn={};!function(e){"use strict";function t(){this.data=[null],this.top=0}function n(){return new t}t.prototype.clear=function(){return this.data=[null],this.top=0,this},t.prototype.length=function(){return this.top},t.prototype.peek=function(){return this.data[this.top]},t.prototype.pop=function(){return this.top>0?(this.top--,this.data.pop()):void 0},t.prototype.push=function(e){return this.data[++this.top]=e,this},void 0!==nn?nn=n:e.stack=n}(this);var rn={},an=s.forEach,on=s.find,sn=s.assign,pn=tn.Parser,ln=Ct.parseName,cn=It.coerceType,un=It.isSimple,hn=gt.XSI_TYPE,mn=gt.serializeAsType,fn=gt.hasLowerCaseAlias;function dn(e,t){return fn(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function yn(e){return new Error(e)}function gn(e){return e.$descriptor}function vn(){}function xn(){}function bn(){}function En(e,t){this.property=e,this.context=t}function wn(e,t){this.element=t,this.propertyDesc=e}function _n(){}function An(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Sn(e,t,n){An.call(this,e,t,n)}function Cn(e,t,n){this.model=e,this.context=n}function Rn(e){e instanceof en&&(e={model:e}),sn(this,{lax:!1},e)}vn.prototype.handleEnd=function(){},vn.prototype.handleText=function(){},vn.prototype.handleNode=function(){},xn.prototype=Object.create(vn.prototype),xn.prototype.handleNode=function(){return this},bn.prototype=Object.create(vn.prototype),bn.prototype.handleText=function(e){this.body=(this.body||"")+e},En.prototype=Object.create(bn.prototype),En.prototype.handleNode=function(e){if(this.element)throw yn("expected no sub nodes");return this.element=this.createReference(e),this},En.prototype.handleEnd=function(){this.element.id=this.body},En.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},wn.prototype=Object.create(bn.prototype),wn.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=cn(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},_n.prototype=Object.create(bn.prototype),_n.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},An.prototype=Object.create(_n.prototype),An.prototype.addReference=function(e){this.context.addReference(e)},An.prototype.handleEnd=function(){var e=this.body,t=this.element,n=gn(t).bodyProperty;n&&void 0!==e&&(e=cn(n.type,e),t.set(n.name,e))},An.prototype.createElement=function(e){var t=e.attributes,n=this.type,i=gn(n),r=this.context,a=new n({});return an(t,function(e,t){var n,o=i.propertiesByName[t];o&&o.isReference?o.isMany?(n=e.split(" "),an(n,function(e){r.addReference({element:a,property:o.ns.name,id:e})})):r.addReference({element:a,property:o.ns.name,id:e}):(o&&(e=cn(o.type,e)),a.set(t,e))}),a},An.prototype.getPropertyForNode=function(e){var t,n,i=e.name,r=ln(i),a=this.type,o=this.model,s=gn(a),p=r.name,l=s.propertiesByName[p];if(l)return mn(l)&&(t=e.attributes[hn])?(t=function(e,t){var n=ln(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),n=o.getType(t),sn({},l,{effectiveType:gn(n).name})):l;var c=o.getPackage(r.prefix);if(c){if(t=dn(r,c),n=o.getType(t),l=on(s.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return sn({},l,{effectiveType:gn(n).name})}else if(l=on(s.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return l;throw yn("unrecognized element <"+r.name+">")},An.prototype.toString=function(){return"ElementDescriptor["+gn(this.type).name+"]"},An.prototype.valueHandler=function(e,t){return new wn(e,t)},An.prototype.referenceHandler=function(e){return new En(e,this.context)},An.prototype.handler=function(e){return"Element"===e?new Cn(this.model,e,this.context):new An(this.model,e,this.context)},An.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,n=t.effectiveType||t.type,un(n))return this.valueHandler(t,i);var a=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==a&&(t.isMany?i.get(t.name).push(a):i.set(t.name,a),t.isReference?(sn(a,{element:i}),this.context.addReference(a)):a.$parent=i),r},Sn.prototype=Object.create(An.prototype),Sn.prototype.createElement=function(e){var t=e.name,n=ln(t),i=this.model,r=this.type,a=i.getPackage(n.prefix),o=a&&dn(n,a)||t;if(!r.hasType(o))throw yn("unexpected element <"+e.originalName+">");return An.prototype.createElement.call(this,e)},Cn.prototype=Object.create(_n.prototype),Cn.prototype.createElement=function(e){var t=e.name,n=ln(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Cn.prototype.handleChild=function(e){var t=new Cn(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},Cn.prototype.handleText=function(e){this.body=this.body||""+e},Cn.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Rn.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof An?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,a=this.lax,o=new function(e){sn(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw yn("expected element");var t,n=this.elementsById,i=gn(e).idProperty;if(i&&(t=e.get(i.name))){if(n[t])throw yn("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}(sn({},t,{rootHandler:i})),s=new pn({proxy:!0}),p=new nn;function l(e,t,n){var i=t(),r=i.line,a=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var p="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+a+"\n\tnested error: "+e.message;if(n)return o.addWarning({message:p,error:e}),console.warn("could not parse node"),console.warn(e),!0;throw console.error("could not parse document"),console.error(e),yn(p)}i.context=o,p.push(i);var c=/^<\?xml /i,u=/ encoding="([^"]+)"/i,h=/^utf-8$/i;var m=r.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});s.ns(m).on("openTag",function(e,t,n,i){var r=e.attrs||{},o=Object.keys(r).reduce(function(e,n){var i=t(r[n]);return e[n]=i,e},{});!function(e,t){var n=p.peek();try{p.push(n.handleNode(e))}catch(e){l(e,t,a)&&p.push(new xn)}}({name:e.name,originalName:e.originalName,attributes:o,ns:e.ns},i)}).on("question",function(e){if(c.test(e)){var t=u.exec(e),n=t&&t[1];n&&!h.test(n)&&o.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){p.pop().handleEnd()}).on("cdata",function(e){p.peek().handleText(e)}).on("text",function(e,t){!function(e){(e=e.trim())&&p.peek().handleText(e)}(t(e))}).on("error",l).on("warn",function(e,t){return l(e,t,!0)}),setTimeout(function(){var t;try{s.parse(e),function(){var e,t,n=o.elementsById,i=o.references;for(e=0;t=i[e];e++){var r=t.element,a=n[t.id],s=gn(r).propertiesByName[t.property];if(a||o.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var p=r.get(s.name),l=p.indexOf(t);-1===l&&(l=p.length),a?p[l]=a:p.splice(l,1)}else r.set(s.name,a)}}()}catch(e){t=e}var r=i.element;t||r||(t=yn("failed to parse document as <"+i.type.$descriptor.name+">")),n(t,t?void 0:r,o)},0)},Rn.prototype.handler=function(e){return new Sn(this.model,e)},(rn=Rn).ElementHandler=An;var Mn=s.map,kn=s.forEach,Pn=s.isString,Tn=s.filter,Nn=s.assign,Dn=Ct.parseName,On=gt.hasLowerCaseAlias,Bn=gt.serializeAsType,Ln=gt.serializeAsProperty,In='<?xml version="1.0" encoding="UTF-8"?>\n',jn=/(<|>|'|"|&|\n\r|\n)/g,Fn=gt.DEFAULT_NS_MAP,Vn=gt.XSI_TYPE;function Wn(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function zn(e){return Pn(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Gn(e,t){return t.isGeneric?Nn({localName:t.ns.localName},e):Nn({localName:(n=t.ns.localName,i=t.$pkg,On(i)?(r=n).charAt(0).toLowerCase()+r.slice(1):n)},e);var n,i,r}var $n={"\n":"10","\n\r":"10",'"':"34","'":"39","<":"60",">":"62","&":"38"};function Hn(e){this.tagName=e}function Kn(){}function Un(e){this.tagName=e}function qn(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Yn(e,t){qn.call(this,e,t)}Hn.prototype.build=function(e){return this.element=e,this},Hn.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Kn.prototype.serializeValue=Kn.prototype.serializeTo=function(e){var t=this.escape;t&&e.append("<![CDATA["),e.append(this.value),t&&e.append("]]>")},Kn.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(jn)&&(this.escape=!0),this},Wn(Un,Kn),Un.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},qn.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,a=i.isGeneric;return t=a?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),a||(n=function(e){var t=e.$descriptor;return Tn(t.properties,function(t){var n=t.name;if(t.isVirtual)return!1;if(!e.hasOwnProperty(n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)})}(e),this.parseAttributes(Tn(n,function(e){return e.isAttr})),this.parseContainments(function(e){return Tn(e,function(e){return!e.isAttr})}(n))),this.parseGenericAttributes(e,t),this},qn.prototype.nsTagName=function(e){return Gn(this.logNamespaceUsed(e.ns),e)},qn.prototype.nsPropertyTagName=function(e){return function(e,t){return Nn({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},qn.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},qn.prototype.nsAttributeName=function(e){var t;if(t=Pn(e)?Dn(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}:Nn({localName:t.localName},n)},qn.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return kn(e,function(r,a){"$body"===a?n.push((new Kn).build({type:"String"},r)):"$children"===a?kn(r,function(e){n.push(new qn(t).build(e))}):0!==a.indexOf("$")&&t.parseNsAttribute(e,a,r)&&i.push({name:a,value:r})}),i},qn.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,a=Dn(t);if("xmlns"===a.prefix&&(i={prefix:a.localName,uri:n}),a.prefix||"xmlns"!==a.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var o=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(o)}},qn.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return kn(i,function(t,i){var a=n.parseNsAttribute(e,i,t);a&&r.push(a)}),r},qn.prototype.parseGenericAttributes=function(e,t){var n=this;kn(t,function(t){if(t.name!==Vn)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}})},qn.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;kn(e,function(e){var r=i.get(e.name),a=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Kn).build(e,r[0]));else if(It.isSimple(e.type))kn(r,function(i){n.push(new Un(t.addTagName(t.nsPropertyTagName(e))).build(e,i))});else if(a)kn(r,function(i){n.push(new Hn(t.addTagName(t.nsPropertyTagName(e))).build(i))});else{var o=Bn(e),s=Ln(e);kn(r,function(i){var r;r=o?new Yn(t,e):s?new qn(t,e):new qn(t),n.push(r.build(i))})}})},qn.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new function(e){var t={},n={},i={},r=[],a=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):a.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.logUsed=function(e){var t=e.uri;i[t]=this.byUri(t)},this.getUsed=function(e){return[].concat(r,a).filter(function(e){return i[e.uri]})}}(t):n=t),n},qn.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,a=e.prefix;return i.byUri(r)||i.add(e,t),i.mapPrefix(a,r),e},qn.prototype.logNamespaceUsed=function(e,t){var n,i,r,a=this.element.$model,o=this.getNamespaces(t),s=e.prefix,p=e.uri;if(!s&&!p)return{localName:e.localName};if(r=Fn[s]||a&&(a.getPackage(s)||{}).uri,!(p=p||r||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=o.byUri(p))){for(n=s,i=1;o.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:p},r===p)}return s&&o.mapPrefix(s,p),e},qn.prototype.parseAttributes=function(e){var t=this,n=this.element;kn(e,function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];kn(i,function(e){r.push(e.id)}),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)})},qn.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),zn(e)},qn.prototype.addAttribute=function(e,t){var n,i=this.attrs;Pn(t)&&(t=(n=Pn(n=t)?n:""+n).replace(jn,function(e){return"&#"+$n[e]+";"})),i.push({name:e,value:t})},qn.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return Mn(e.getUsed(),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})}(n).concat(t)),kn(t,function(t){e.append(" ").append(zn(t.name)).append('="').append(t.value).append('"')})},qn.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Kn;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),kn(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Wn(Yn,qn),Yn.prototype.parseNsAttributes=function(e){var t=qn.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),a=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Vn),(i.prefix?i.prefix+":":"")+a+n.ns.localName),t},Yn.prototype.isLocalNs=function(e){return e.uri===this.typeNs.uri};var Xn=function(e){return e=Nn({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new function(){this.value="",this.write=function(e){this.value+=e}},r=new function(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}}(i,e.format);if(e.preamble&&r.append(In),(new qn).build(t).serializeTo(r),!n)return i.value}}},Zn=s.isString,Jn=s.isFunction,Qn=s.assign;function ei(e,t){en.call(this,e,t)}ei.prototype=Object.create(en.prototype);var ti=ei;ei.prototype.fromXML=function(e,t,n,i){Zn(t)||(i=n,n=t,t="bpmn:Definitions"),Jn(n)&&(i=n,n={});var r=new rn(Qn({model:this,lax:!0},n)),a=r.handler(t);r.fromXML(e,a,i)},ei.prototype.toXML=function(e,t,n){Jn(t)&&(n=t,t={});var i,r,a=new Xn(t);try{i=a.toXML(e)}catch(e){r=e}return n(r,i)};var ni=s.assign,ii={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",type:"String",isAttr:!0}]},{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",type:"String",isAttr:!0}]},{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",type:"LaneSet",isMany:!0,replaces:"FlowElementsContainer#laneSets"},{name:"flowElements",type:"FlowElement",isMany:!0,replaces:"FlowElementsContainer#flowElements"},{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:"assignment",type:"Assignment",isMany:!0},{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isVirtual:!0,isMany:!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",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isVirtual:!0,isMany:!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:"participantRefs",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",type:"String",isBody:!0}]},{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",type:"String",isAttr:!0},{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",isVirtual:!0,isMany:!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",isVirtual:!0,isMany:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isVirtual:!0,isMany:!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"}]},{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:"participantRefs",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:["FlowElementsContainer","Collaboration"]},{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",isVirtual:!0,isMany:!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:"Expression",xml:{serialize:"xsi:type"}}]},{name:"CallActivity",superClass:["Activity"],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}]},{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"}]}],prefix:"bpmn",xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",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:[],prefix:"bpmndi"},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/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}]}],prefix:"dc",associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",type:"String",isAttr:!0,isId:!0},{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,isVirtual:!0,isMany:!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",type:"String",isAttr:!0,isId:!0},{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,isVirtual:!0,isMany:!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",isVirtual:!0,isMany:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isVirtual:!0,isMany:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",type:"String",isAttr:!0,isId:!0}]},{name:"Extension",properties:[{name:"values",type:"Element",isMany:!0}]}],associations:[],prefix:"di",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:[]}},ri=function(e,t){return new ti(ni({},ii,e),t)},ai={remove:function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n},add: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)}}},oi={},si=s.isArray,pi=(s.isNumber,s.groupBy,s.forEach);function li(e,t){var n,i,r,a;return t=!!t,si(e)||(e=[e]),pi(e,function(e){var o=e;e.waypoints&&!t&&(o=li(e.waypoints,!0));var s=o.x,p=o.y,l=o.height||0,c=o.width||0;(s<n||void 0===n)&&(n=s),(p<i||void 0===i)&&(i=p),(s+c>r||void 0===r)&&(r=s+c),(p+l>a||void 0===a)&&(a=p+l)}),{x:n,y:i,height:a-i,width:r-n}}oi.getBBox=li,oi.getType=function(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"};var ci=s.isNumber,ui=s.assign,hi=s.forEach,mi=s.every,fi=s.debounce,di=s.bind,yi=s.reduce,gi=n.append,vi=n.attr,xi=n.classes,bi=n.create,Ei=n.transform,wi=n.createMatrix;function _i(e,t){return Math.round(e*t)/t}function Ai(e){return ci(e)?e+"px":e}function Si(e,t,n){var i=bi("g");xi(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]),i}var Ci={shape:["x","y","width","height"],connection:["waypoints"]};function Ri(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}Ri.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];var Mi=Ri;function ki(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Ri.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=ui({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),ui(n.style,{position:"relative",overflow:"hidden",width:Ai(e.width),height:Ai(e.height)}),t.appendChild(n),n}(e),i=this._svg=bi("svg");vi(i,{width:"100%",height:"100%"}),gi(n,i);var r=this._viewport=Si(i,"viewport");this._layers={},!1!==e.deferUpdate&&(this._viewboxChanged=fi(di(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"],function(){delete this._cachedViewbox},this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Ri.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._rootElement,delete this._viewport},Ri.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=oi.getType(t);"root"===n?e.setRootElement(null,!0):e._removeElement(t,n)}),delete this._cachedViewbox},Ri.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Ri.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},Ri.prototype._createLayer=function(e,t){t||(t=0);var n=yi(this._layers,function(e,n){return t>=n.index&&e++,e},0);return{group:Si(this._viewport,"layer-"+e,n),index:t}},Ri.prototype.getContainer=function(){return this._container},Ri.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(hi([i.gfx,i.secondaryGfx],function(e){e&&(n?xi(e).add(t):xi(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Ri.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Ri.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Ri.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));var n=this.getGraphics(e);return xi(n).has(t)},Ri.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Ri.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},Ri.prototype.setRootElement=function(e,t){e&&this._ensureValid("root",e);var n=this._rootElement,i=this._elementRegistry,r=this._eventBus;if(n){if(!t)throw new Error("rootElement already set, need to specify override");r.fire("root.remove",{element:n}),r.fire("root.removed",{element:n}),i.remove(n)}if(e){var a=this.getDefaultLayer();r.fire("root.add",{element:e}),i.add(e,a,this._svg),r.fire("root.added",{element:e,gfx:a})}return this._rootElement=e,e},Ri.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 with id "+t.id+" already exists");var n=Ci[e];if(!mi(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},Ri.prototype._setParent=function(e,t,n){ai.add(t.children,e,n),e.parent=t},Ri.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,a=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var o=a.create(e,t,i);return this._elementRegistry.add(t,o),a.update(e,t,o),r.fire(e+".added",{element:t,gfx:o}),t},Ri.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Ri.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Ri.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),ai.remove(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Ri.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Ri.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Ri.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Ri.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Ri.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Ri.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,a,o,s=this._viewport,p=this.getSize();return e?(this._changeViewbox(function(){r=Math.min(p.width/e.width,p.height/e.height);var t=this._svg.createSVGMatrix().scale(r).translate(-e.x,-e.y);Ei(s,t)}),e):(t=this.getDefaultLayer().getBBox(),n=(i=Ei(s))?i.matrix:wi(),r=_i(n.a,1e3),a=_i(-n.e||0,1e3),o=_i(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/r:0,y:o?o/r:0,width:p.width/r,height:p.height/r,scale:r,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:p})},Ri.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=ui({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),ki(t,n)}),{x:n.e,y:n.f}},Ri.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)}),_i(i.a,1e3)):this.viewbox(e).scale;var n,i},Ri.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,a=i.inner;return a.x>=0&&a.y>=0&&a.x+a.width<=r.width&&a.y+a.height<=r.height&&!e?n={x:0,y:0,width:Math.max(a.width+a.x,r.width),height:Math.max(a.height+a.y,r.height)}:(t=Math.min(1,r.width/a.width,r.height/a.height),n={x:a.x+(e?a.width/2-r.width/t/2:0),y:a.y+(e?a.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},Ri.prototype._setZoom=function(e,t){var n,i,r,a,o=this._svg,s=this._viewport,p=o.createSVGMatrix(),l=o.createSVGPoint(),c=(i=s.getCTM()).a;return t?(n=ui(l,t).matrixTransform(i.inverse()),r=p.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),a=i.multiply(r)):a=p.scale(e),ki(this._viewport,a),a},Ri.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Ri.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}},Ri.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Pi={},Ti=s.assign,Ni=new tt({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Di=new tt({name:"label",enumerable:!0},{name:"labelTarget"}),Oi=new tt({name:"attachers",collection:!0},{name:"host"}),Bi=new tt({name:"outgoing",collection:!0},{name:"source"}),Li=new tt({name:"incoming",collection:!0},{name:"target"});function Ii(){Object.defineProperty(this,"businessObject",{writable:!0}),Ni.bind(this,"parent"),Di.bind(this,"label"),Bi.bind(this,"outgoing"),Li.bind(this,"incoming")}function ji(){Ii.call(this),Ni.bind(this,"children"),Oi.bind(this,"host"),Oi.bind(this,"attachers")}function Fi(){ji.call(this)}function Vi(){ji.call(this),Di.bind(this,"labelTarget")}function Wi(){Ii.call(this),Bi.bind(this,"source"),Li.bind(this,"target")}H(ji,Ii),H(Fi,ji),H(Vi,ji),H(Wi,Ii);var zi={connection:Wi,shape:ji,label:Vi,root:Fi};Pi.create=function(e,t){var n=zi[e];if(!n)throw new Error("unknown type: <"+e+">");return Ti(new n,t)};var Gi=s.assign;function $i(){this._uid=12}var Hi=$i;$i.prototype.createRoot=function(e){return this.create("root",e)},$i.prototype.createLabel=function(e){return this.create("label",e)},$i.prototype.createShape=function(e){return this.create("shape",e)},$i.prototype.createConnection=function(e){return this.create("connection",e)},$i.prototype.create=function(e,t){return(t=Gi({},t||{})).id||(t.id=e+"_"+this._uid++),Pi.create(e,t)};var Ki="data-element-id",Ui=n.attr;function qi(e){this._elements={},this._eventBus=e}qi.$inject=["eventBus"];var Yi=qi;qi.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),Ui(t,Ki,i),n&&Ui(n,Ki,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},qi.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(Ui(i.gfx,Ki,""),i.secondaryGfx&&Ui(i.secondaryGfx,Ki,""),delete t[n])},qi.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)},qi.prototype.get=function(e){var t;t="string"==typeof e?e:e&&Ui(e,Ki);var n=this._elements[t];return n&&n.element},qi.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},qi.prototype.getAll=function(){return this.filter(function(e){return e})},qi.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,a=i.gfx;return e(r,a)})},qi.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},qi.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 Xi=s.isFunction,Zi=s.isArray,Ji=s.isNumber,Qi=s.bind,er=s.assign,tr=Array.prototype.slice;function nr(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}var ir=nr;function rr(){}nr.prototype.on=function(e,t,n,i){if(e=Zi(e)?e:[e],Xi(t)&&(i=n,n=t,t=1e3),!Ji(t))throw new Error("priority must be a number");var r=n;i&&((r=Qi(n,i)).__fn=n.__fn||n);var a=this,o={priority:t,callback:r};e.forEach(function(e){a._addListener(e,o)})},nr.prototype.once=function(e,t,n,i){var r=this;if(Xi(t)&&(i=n,n=t,t=1e3),!Ji(t))throw new Error("priority must be a number");function a(){return r.off(e,a),n.apply(i,arguments)}a.__fn=n,this.on(e,t,a)},nr.prototype.off=function(e,t){var n,i,r,a=this._getListeners(e);if(t)for(r=a.length-1;n=a[r];r--)(i=n.callback)!==t&&i.__fn!==t||a.splice(r,1);else a.length=0},nr.prototype.createEvent=function(e){var t=new rr;return t.init(e),t},nr.prototype.fire=function(e,t){var n,i,r,a;if(a=tr.call(arguments),"object"==typeof e&&(e=(n=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof rr?t:this.createEvent(t),a[0]=n;var o=n.type;e!==o&&(n.type=e);try{r=this._invokeListeners(n,a,i)}finally{e!==o&&(n.type=o)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},nr.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},nr.prototype._destroy=function(){this._listeners={}},nr.prototype._invokeListeners=function(e,t,n){var i,r,a;for(i=0;(r=n[i])&&!e.cancelBubble;i++)a=this._invokeListener(e,t,r);return a},nr.prototype._invokeListener=function(e,t,n){var i;try{void 0!==(i=function(e,t){return e.apply(null,t)}(n.callback,t))&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener"),console.error(e.stack),e}return i},nr.prototype._addListener=function(e,t){var n,i,r=this._getListeners(e);for(i=0;n=r[i];i++)if(n.priority<t.priority)return void r.splice(i,0,t);r.push(t)},nr.prototype._getListeners=function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t},rr.prototype.stopPropagation=function(){this.cancelBubble=!0},rr.prototype.preventDefault=function(){this.defaultPrevented=!0},rr.prototype.init=function(e){er(this,e||{})};var ar={},or=K.query;ar.getVisual=function(e){return or(".djs-visual",e)},ar.getChildren=function(e){return e.parentNode.childNodes[1]};var sr=s.forEach,pr=s.reduce,lr=E.translate,cr=K.clear,ur=n.append,hr=n.attr,mr=n.classes,fr=n.create,dr=n.remove;function yr(e,t){this._eventBus=e,this._elementRegistry=t}yr.$inject=["eventBus","elementRegistry"];var gr=yr;function vr(e,t,n){t.insertBefore(e,n||t.firstChild)}yr.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=ar.getChildren(n))||(t=fr("g"),mr(t).add("djs-children"),ur(n.parentNode,t)):t=n,t},yr.prototype._clear=function(e){var t=ar.getVisual(e);return cr(t),t},yr.prototype._createContainer=function(e,t,n){var i=fr("g");mr(i).add("djs-group"),void 0!==n?vr(i,t,t.childNodes[n]):ur(t,i);var r=fr("g");mr(r).add("djs-element"),mr(r).add("djs-"+e),ur(i,r);var a=fr("g");return mr(a).add("djs-visual"),ur(r,a),r},yr.prototype.create=function(e,t,n){var i=this._getChildren(t.parent);return this._createContainer(e,i,n)},yr.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=pr(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),sr(t,function(e){var t=e.children;if(t){var r=n._getChildren(e);sr(t.slice().reverse(),function(e){vr(i.getGraphics(e).parentNode,r)})}})},yr.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},yr.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},yr.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},yr.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},yr.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),lr(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?hr(n,"display","none"):hr(n,"display","block")}},yr.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);dr(t.parentNode)};var xr=i.componentsToPath,br=i.createLine,Er=n.append,wr=n.attr,_r=n.create,Ar=1;function Sr(e,t){b.call(this,e,Ar),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2})}H(Sr,b),Sr.prototype.canRender=function(){return!0},Sr.prototype.drawShape=function(e,t){var n=_r("rect");return wr(n,{x:0,y:0,width:t.width||0,height:t.height||0}),wr(n,this.SHAPE_STYLE),Er(e,n),n},Sr.prototype.drawConnection=function(e,t){var n=br(t.waypoints,this.CONNECTION_STYLE);return Er(e,n),n},Sr.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width,r=e.height;return xr([["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]])},Sr.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 xr(r)},Sr.$inject=["eventBus","styles"];var Cr=Sr,Rr=s.isArray,Mr=s.assign,kr=s.reduce;var Pr={__depends__:[{__init__:["defaultRenderer"],defaultRenderer:["type",Cr],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){var i=this.style(t,n);return Mr(i,{class:e})},this.style=function(t,n){Rr(t)||n||(n=t,t=[]);var i=kr(t,function(t,n){return Mr(t,e[n]||{})},{});return n?Mr(i,n):i},this.computeStyle=function(e,n,i){return Rr(n)||(i=n,n=[]),t.style(n||[],Mr({},i,e||{}))}}]}],__init__:["canvas"],canvas:["type",Mi],elementRegistry:["type",Yi],elementFactory:["type",Hi],eventBus:["type",ir],graphicsFactory:["type",gr]},Tr={exports:{}};!function(e,t){"object"==typeof Tr.exports?t(Tr.exports):t(e.didi={})}(this,function(e){"use strict";var t=/^class /;function n(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(){var e=Array.prototype.slice.call(arguments);1===e.length&&n(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var r=/constructor\s*[^(]*\(\s*([^)]*)\)/m,a=/^function\s*[^(]*\(\s*([^)]*)\)/m,o=/\/\*([^*]*)\*\//m;function s(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var n=e.toString().match(function(e){return t.test(e.toString())}(e)?r:a);return n&&n[1]&&n[1].split(",").map(function(e){return(n=e.match(o))?n[1].trim():e.trim()})||[]}function p(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function c(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function u(e,t){return Object.hasOwnProperty.call(e,t)}e.Injector=function e(t,r){r=r||{get:function(e,t){if(a.push(e),!1===t)return null;throw f('No provider for "'+e+'"!')}};var a=[],o=this._providers=Object.create(r._providers||null),h=this._instances=Object.create(null),m=h.injector=this,f=function(e){var t=a.join(" -> ");return a.length=0,new Error(t?e+" (Resolving: "+t+")":e)},d=function e(t,n){if(!o[t]&&-1!==t.indexOf(".")){for(var i=t.split("."),s=e(i.shift());i.length;)s=s[i.shift()];return s}if(u(h,t))return h[t];if(u(o,t)){if(-1!==a.indexOf(t))throw a.push(t),f("Cannot resolve circular dependency!");return a.push(t),h[t]=o[t][0](o[t][1]),a.pop(),h[t]}return r.get(t,n)},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e){if(!n(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=i(e.slice())}return{fn:e,dependencies:(e.$inject||s(e)).map(function(e){return u(t,e)?t[e]:d(e)})}},g=function(e){var t=y(e),n=t.dependencies,i=t.fn;return new(Function.prototype.bind.apply(i,[null].concat(c(n))))},v=function(e,t,n){var i=y(e,n),r=i.dependencies,a=i.fn;return a.call.apply(a,[t].concat(c(r)))},x=function(e){return i(function(t){return e.get(t)})},b={factory:v,type:g,value:function(e){return e}};t.forEach(function(t){function r(e,t){return"value"!==e&&n(t)&&(t=i(t.slice())),t}if(t instanceof p)t.forEach(function(e){var t=e[0],n=e[1],i=e[2];o[t]=[b[n],r(n,i),n]});else if("object"===(void 0===t?"undefined":l(t)))if(t.__exports__){var a=Object.keys(t).reduce(function(e,n){return"__"!==n.substring(0,2)&&(e[n]=t[n]),e},Object.create(null)),s=new e((t.__modules__||[]).concat([a]),m),c=i(function(e){return s.get(e)});t.__exports__.forEach(function(e){o[e]=[c,e,"private",s]})}else Object.keys(t).forEach(function(e){if("private"!==t[e][2]){var n=t[e][0],i=t[e][1];o[e]=[b[n],r(n,i),n]}else o[e]=t[e]})}),this.get=d,this.invoke=v,this.instantiate=g,this.createChild=function(t,n){if(n&&n.length){var i,r,a,s,p=Object.create(null),l=Object.create(null),c=[],u=[],h=[];for(var f in o)i=o[f],-1!==n.indexOf(f)&&("private"===i[2]?-1===(r=c.indexOf(i[3]))?(a=i[3].createChild([],n),s=x(a),c.push(i[3]),u.push(a),h.push(s),p[f]=[s,f,"private",a]):p[f]=[h[r],f,"private",u[r]]:p[f]=[i[2],i[1]],l[f]=!0),"factory"!==i[2]&&"type"!==i[2]||!i[1].$scope||n.forEach(function(e){-1!==i[1].$scope.indexOf(e)&&(p[f]=[i[2],i[1]],l[e]=!0)});n.forEach(function(e){if(!l[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),t.unshift(p)}return new e(t,m)}},Object.defineProperty(e,"__esModule",{value:!0})});var Nr=(Tr=Tr.exports).Injector;function Dr(e){var t=[],n=[];function i(e){return t.indexOf(e)>=0}e.forEach(function e(r){i(r)||((r.__depends__||[]).forEach(e),i(r)||(function(e){t.push(e)}(r),(r.__init__||[]).forEach(function(e){n.push(e)})))});var r=new Nr(t);return n.forEach(function(e){try{r["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}}),r}function Or(e,t){this.injector=t=t||function(e){return Dr([{config:["value",e=e||{}]},Pr].concat(e.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}var Br=Or;Or.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Or.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var Lr=Br;function Ir(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}var jr=Ir;Ir.prototype.next=function(){return this._prefix+ ++this._counter};var Fr=s.isArray,Vr=s.isString,Wr=s.isObject,zr=s.assign,Gr=s.forEach,$r=s.find,Hr=s.filter,Kr=s.matchPattern,Ur=K.domify,qr=K.classes,Yr=K.attr,Xr=K.remove,Zr=K.clear,Jr=oi.getBBox,Qr=new jr("ov");function ea(e,t,n){zr(e.style,{left:t+"px",top:n+"px"})}function ta(e,t){e.style.display=!1===t?"none":""}function na(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}function ia(e){return void 0!==e}function ra(e,t,n,i){var r,a;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Qr,this._overlayDefaults=zr({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),a=Ur('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(a,r.firstChild),a),this._init()}ra.$inject=["config.overlays","eventBus","canvas","elementRegistry"];var aa=ra;ra.prototype.get=function(e){if(Vr(e)&&(e={id:e}),Vr(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?Hr(t.overlays,Kr({type:e.type})):t.overlays.slice():[]}return e.type?Hr(this._overlays,Kr({type:e.type})):e.id?this._overlays[e.id]:null},ra.prototype.add=function(e,t,n){if(Wr(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=zr({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},ra.prototype.remove=function(e){var t=this.get(e)||[];Fr(t)||(t=[t]);var n=this;Gr(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Xr(e.html),Xr(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)}})},ra.prototype.show=function(){ta(this._overlayRoot)},ra.prototype.hide=function(){ta(this._overlayRoot,!1)},ra.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Zr(this._overlayRoot)},ra.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var a=Jr(t);i=a.x,r=a.y}ea(n,i,r),Yr(e.html,"data-container-id",t.id)},ra.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,a=e.element,o=i.left,s=i.top;void 0!==i.right&&(t=a.waypoints?Jr(a).width:a.width,o=-1*i.right+t);void 0!==i.bottom&&(n=a.waypoints?Jr(a).height:a.height,s=-1*i.bottom+n);ea(r,o||0,s||0)},ra.prototype._createOverlayContainer=function(e){var t=Ur('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ra.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";na(this._overlayRoot,n)},ra.prototype._getOverlayContainer=function(e,t){var n=$r(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},ra.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,a=e.html;a.get&&a.constructor.prototype.jquery&&(a=a.get(0)),Vr(a)&&(a=Ur(a)),n=this._getOverlayContainer(r),(t=Ur('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(a),e.type&&qr(t).add("djs-overlay-"+e.type),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ra.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=n&&n.minZoom,r=n&&n.maxZoom,a=e.htmlContainer,o=!0;n&&((ia(i)&&i>t.scale||ia(r)&&r<t.scale)&&(o=!1),ta(a,o)),this._updateOverlayScale(e,t)},ra.prototype._updateOverlayScale=function(e,t){var n,i,r,a=e.scale,o=e.htmlContainer,s="";!0!==a&&(!1===a?(n=1,i=1):(n=a.min,i=a.max),ia(n)&&t.scale<n&&(r=(1/t.scale||1)*n),ia(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),ia(r)&&(s="scale("+r+","+r+")"),na(o,s)},ra.prototype._updateOverlaysVisibilty=function(e){var t=this;Gr(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},ra.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,i=t.get({element:n});Gr(i,function(e){t.remove(e.id)});var r=t._getOverlayContainer(n);if(r){Xr(r.html);var a=t._overlayContainers.indexOf(r);-1!==a&&t._overlayContainers.splice(a,1)}}),e.on("element.changed",500,function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(Gr(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&&qr(n.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var oa={__init__:["overlays"],overlays:["type",aa]},sa={};function pa(e){return e.originalEvent||e.srcEvent}sa.getOriginal=pa,sa.toPoint=function(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null};var la={isMac:function(){return/mac/i.test(navigator.platform)}},ca={},ua=sa.getOriginal,ha=la.isMac;function ma(e){return!(ua(e)||e).button}ca.isPrimaryButton=ma,ca.hasPrimaryModifier=function(e){var t=ua(e)||e;return!!ma(e)&&(ha()?t.metaKey:t.ctrlKey)};var fa=s.forEach,da=K.delegate,ya=ca.isPrimaryButton,ga=n.append,va=n.attr,xa=n.create,ba=K.query,Ea=i.createLine,wa=i.updateLine;function _a(e){return!0}var Aa=500;function Sa(e,t,n){var i=n.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15});function r(n,i,r){var a,o;(function(e,t){return!(p[e]||ya)(t)})(n,i)||(r?o=t.getGraphics(r):(a=i.delegateTarget||i.target)&&(o=a,r=t.get(o)),o&&r&&!1===e.fire(n,{element:r,gfx:o,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var a={};function o(e){return a[e]}var s={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mouseup:"element.mouseup",contextmenu:"element.contextmenu"},p={"element.contextmenu":_a};var l="svg, .djs-element";function c(e,t,n,i){var o=a[n]=function(e){r(n,e)};i&&(p[n]=i),o.$delegate=da.bind(e,l,t,o)}function u(e,t,n){var i=o(n);i&&da.unbind(e,t,i.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,fa(s,function(e,n){u(t,n,e)})}),e.on("canvas.init",function(e){var t;t=e.svg,fa(s,function(e,n){c(t,n,e)})}),e.on(["shape.added","connection.added"],function(e){var t,n=e.element,r=e.gfx;n.waypoints?t=Ea(n.waypoints):(t=xa("rect"),va(t,{x:0,y:0,width:n.width,height:n.height})),va(t,i),ga(r,t)}),e.on("shape.changed",Aa,function(e){var t=e.element,n=e.gfx,i=ba(".djs-hit",n);va(i,{width:t.width,height:t.height})}),e.on("connection.changed",function(e){var t=e.element,n=e.gfx,i=ba(".djs-hit",n);wa(i,t.waypoints)}),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=o,this.registerEvent=c,this.unregisterEvent=u}Sa.$inject=["eventBus","elementRegistry","styles"];var Ca={__init__:["interactionEvents"],interactionEvents:["type",Sa]},Ra=oi.getBBox,Ma=500,ka=n.append,Pa=n.attr,Ta=n.create,Na=K.query,Da=s.assign;function Oa(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function a(e,t){var n=Ta("rect");return Pa(n,Da({x:10,y:10,width:100,height:100},i)),ka(e,n),n}e.on(["shape.added","shape.changed"],Ma,function(e){var t=e.element,n=e.gfx,i=Na(".djs-outline",n);i||(i=a(n)),r.updateShapeOutline(i,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,i=Na(".djs-outline",n);i||(i=a(n)),r.updateConnectionOutline(i,t)})}Oa.prototype.updateShapeOutline=function(e,t){Pa(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Oa.prototype.updateConnectionOutline=function(e,t){var n=Ra(t);Pa(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Oa.$inject=["eventBus","styles","elementRegistry"];var Ba={__init__:["outline"],outline:["type",Oa]},La=s.isArray,Ia=s.forEach;function ja(e){this._eventBus=e,this._selectedElements=[];var t=this;e.on(["shape.remove","connection.remove"],function(e){var n=e.element;t.deselect(n)}),e.on(["diagram.clear"],function(e){t.select(null)})}ja.$inject=["eventBus"];var Fa=ja;ja.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})}},ja.prototype.get=function(){return this._selectedElements},ja.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},ja.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();La(e)||(e=e?[e]:[]),t?Ia(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 Va=ca.hasPrimaryModifier,Wa=s.find;function za(e,t,n,i){e.on("create.end",500,function(e){e.context.canExecute&&t.select(e.context.shape)}),e.on("connect.end",500,function(e){e.context.canExecute&&e.context.target&&t.select(e.context.target)}),e.on("shape.move.end",500,function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);Wa(n,function(e){return r.id===e.id})||t.select(r)}),e.on("element.click",function(e){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),a=t.get().length>1,o=Va(e);if(r&&a)return o?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,o)})}za.$inject=["eventBus","selection","canvas","elementRegistry"];var Ga=za,$a=s.forEach,Ha="hover",Ka="selected";function Ua(e,t,n,i){function r(e,n){t.addMarker(e,n)}function a(e,n){t.removeMarker(e,n)}this._multiSelectionBox=null,e.on("element.hover",function(e){r(e.element,Ha)}),e.on("element.out",function(e){a(e.element,Ha)}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;$a(t,function(e){-1===n.indexOf(e)&&a(e,Ka)}),$a(n,function(e){-1===t.indexOf(e)&&r(e,Ka)})})}Ua.$inject=["eventBus","canvas","selection","styles"];var qa={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Ca,Ba],selection:["type",Fa],selectionVisuals:["type",Ua],selectionBehavior:["type",Ga]},Ya=s.assign,Xa=s.isNumber,Za=s.omit,Ja=K.domify,Qa=K.query,eo=K.remove,to=n.innerSVG,no=lt.importBpmnDiagram;var io={width:"100%",height:"100%",position:"relative"};function ro(e){return e+(Xa(e)?"px":"")}function ao(e){var t,n,i;e=Ya({},io,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=ct.BPMNIO_IMG,i=Ja('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100">'+n+"</a>"),t.appendChild(i),so.bind(i,"click",function(e){ct.open(),e.preventDefault()}),this._init(this._container,this._moddle,e)}H(ao,Lr);var oo=ao;ao.prototype.importXML=function(e,t){t=t||function(){};var n=this;e=this._emit("import.parse.start",{xml:e})||e,this._moddle.fromXML(e,"bpmn:Definitions",function(e,i,r){i=n._emit("import.parse.complete",{error:e,definitions:i,context:r})||i;var a=r.warnings;if(e)return e=function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]),e}(e),n._emit("import.done",{error:e,warnings:a}),t(e,a);n.importDefinitions(i,function(e,i){var r=[].concat(a,i||[]);n._emit("import.done",{error:e,warnings:r}),t(e,r)})})},ao.prototype.saveXML=function(e,t){t||(t=e,e={});var n=this._definitions;if(!n)return t(new Error("no definitions loaded"));this._moddle.toXML(n,e,t)},ao.prototype.saveSVG=function(e,t){var n,i;t||(t=e,e={});try{var r=this.get("canvas"),a=r.getDefaultLayer(),o=Qa("defs",r._svg),s=to(a),p=o?"<defs>"+to(o)+"</defs>":"",l=a.getBBox();n='<?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="'+l.width+'" height="'+l.height+'" viewBox="'+l.x+" "+l.y+" "+l.width+" "+l.height+'" version="1.1">'+p+s+"</svg>"}catch(e){i=e}t(i,n)},ao.prototype.importDefinitions=function(e,t){try{this._definitions&&this.clear(),this._definitions=e}catch(e){return t(e)}return no(this,e,t)},ao.prototype.getModules=function(){return this._modules},ao.prototype.destroy=function(){Lr.prototype.destroy.call(this),eo(this._container)},ao.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},ao.prototype.off=function(e,t){this.get("eventBus").off(e,t)},ao.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=Qa(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},ao.prototype.getDefinitions=function(){return this._definitions},ao.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},ao.prototype._init=function(e,t,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],a=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),o=Ya(Za(n,["additionalModules"]),{canvas:Ya({},n.canvas,{container:e}),modules:a});Lr.call(this,o),n&&n.container&&this.attachTo(n.container)},ao.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},ao.prototype._createContainer=function(e){var t=Ja('<div class="bjs-container"></div>');return Ya(t.style,{width:ro(e.width),height:ro(e.height),position:e.position}),t},ao.prototype._createModdle=function(e){var t=Ya({},this._moddleExtensions,e.moddleExtensions);return new ri(t)},ao.prototype._modules=[Ze,Xe,qa,oa],ao.prototype._moddleExtensions={};var so=K.event;var po={},lo=5e3;po.install=function(e,t){function n(){return!1}return t=t||"element.click",e.once(t,lo,n),function(){e.off(t,n)}};var co={},uo=K.classes,ho=/^djs-cursor-.*$/;co.set=function(e){var t=uo(document.body);t.removeMatching(ho),e&&t.add("djs-cursor-"+e)},co.unset=function(){this.set(null)};var mo={};mo.log10=function(e){return Math.log(e)/Math.log(10)},mo.substract=function(e,t){return{x:e.x-t.x,y:e.y-t.y}};var fo=mo.substract,yo=K.event,go=K.closest;var vo=15;function xo(e,t){var n;function i(i){var r,a=n.start,o=sa.toPoint(i),s=fo(o,a);if(!n.dragging&&(r=s,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>vo)&&(n.dragging=!0,po.install(e),co.set("grab")),n.dragging){var p=n.last||n.start;s=fo(o,p),t.scroll({dx:s.x,dy:s.y}),n.last=o}i.preventDefault()}function r(e){yo.unbind(document,"mousemove",i),yo.unbind(document,"mouseup",r),n=null,co.unset()}e.on("element.mousedown",500,function(e){return function(e){if(!go(e.target,".djs-draggable")&&!(e.button||e.ctrlKey||e.shiftKey||e.altKey))return n={start:sa.toPoint(e)},yo.bind(document,"mousemove",i),yo.bind(document,"mouseup",r),!0}(e.originalEvent)})}xo.$inject=["eventBus","canvas"];var bo={__init__:["moveCanvas"],moveCanvas:["type",xo]},Eo={},wo=mo.log10;Eo.getStepSize=function(e,t){var n=wo(e.min),i=wo(e.max);return(Math.abs(n)+Math.abs(i))/t},Eo.cap=function(e,t){return Math.max(e.min,Math.min(e.max,t))};var _o=K.event,Ao=K.closest,So=Eo.getStepSize,Co=Eo.cap,Ro=mo.log10,Mo=s.bind,ko=Math.sign||function(e){return e>=0?1:-1},Po={min:.2,max:4},To=.75;function No(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=Mo(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||To;var i=this;t.on("canvas.init",function(t){i._init(!1!==e.enabled)})}No.$inject=["config.zoomScroll","eventBus","canvas"];var Do=No;No.prototype.scroll=function(e){this._canvas.scroll(e)},No.prototype.reset=function(){this._canvas.zoom("fit-viewport")},No.prototype.zoom=function(e,t){var n=So(Po,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},No.prototype._handleWheel=function(e){if(!Ao(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,a=-1*this._scale;if(a*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var o=t.getBoundingClientRect(),s={x:e.clientX-o.left,y:e.clientY-o.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*ko(e.deltaY)*a,this.zoom(n,s)}else n=r?{dx:a*e.deltaY,dy:0}:{dx:a*e.deltaX,dy:a*e.deltaY},this.scroll(n)}},No.prototype.stepZoom=function(e,t){var n=So(Po,10);this._zoom(e,t,n)},No.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,a=Ro(i.zoom()),o=Math.round(a/n)*n;o+=n*r;var s=Math.pow(10,o);i.zoom(Co(Po,s),t)},No.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&_o[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},No.prototype._init=function(e){this.toggle(e)};var Oo={__init__:["zoomScroll"],zoomScroll:["type",Do]};function Bo(e){oo.call(this,e)}H(Bo,oo);var Lo=Bo;return Bo.prototype._navigationModules=[Oo,bo],Bo.prototype._modules=[].concat(Bo.prototype._modules,Bo.prototype._navigationModules),Lo});
1
+ /*! bpmn-js - bpmn-navigated-viewer v0.31.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).BpmnJS=e()}}(function(){var e,t,n={exports:{}};e=this,t=function(e){"use strict";function t(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}function n(e,n){return n.appendChild(t(e,n)),e}var i=2,r={"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":i,"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":i,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function a(e,t,n){var a=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=r[a];o?(o===i&&"number"==typeof n&&(n=String(n)+"px"),e.style[a]=n):e.setAttributeNS(null,t,n)}function o(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return r[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);a(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)a(e,i,t[i])}(e,t);return e}function s(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 p=/\s+/,l=Object.prototype.toString;function c(e){return void 0!==e}function u(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function h(e){var t=e.parentNode;return t&&t.removeChild(e),e}function m(e){for(var t;t=e.firstChild;)h(t);return e}u.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~s(t,e)||t.push(e),c(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},u.prototype.remove=function(e){if("[object RegExp]"===l.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=s(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},u.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},u.prototype.toggle=function(e,t){return this.list?(c(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(c(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},u.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(p);return""===e[0]&&e.shift(),e},u.prototype.has=u.prototype.contains=function(e){return this.list?this.list.contains(e):!!~s(this.array(),e)};var f={svg:"http://www.w3.org/2000/svg"},d='<svg xmlns="'+f.svg+'"';function y(e){return"<svg"===e.substring(0,4)?-1===e.indexOf(f.svg)&&(e=d+e.substring(4)):e=d+">"+e+"</svg>",function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e)}function g(e,t){var n;return"<"===e.charAt(0)?(n=y(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(f.svg,e),t&&o(n,t),n}var v=g("svg");function x(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}var b=/([&<>]{1})/g,E=/([\n\r"]{1})/g,w={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function _(e,t){return e.replace(t,function(e,t){return w[t]||t})}function A(e,t){var n,i,r,a,o;switch(e.nodeType){case 3:t.push(_(e.textContent,b));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)a=r.item(n),t.push(" ",a.name,'="',_(a.value,E),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(o=e.childNodes).length;n<i;++n)A(o.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",_(e.nodeValue,b),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function S(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}e.append=function(e,t){return n(t,e),e},e.attr=o,e.classes=function(e){return new u(e)},e.create=g,e.innerSVG=function(e,t){if(void 0!==t){try{!function(e,t){var i,r=y(t).documentElement;if(m(e),t)for(i=r.firstChild;i;)n(i,e),i=i.nextSibling}(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)A(t,n),t=t.nextSibling;return n.join("")}(e)},e.remove=h,e.transform=function(e,t){var n=e.transform.baseVal;if(1===arguments.length)return n.consolidate();t.length?function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(S(e,i));e.consolidate()}(n,t):n.initialize(S(n,t))},e.createMatrix=function(e,t,n,i,r,a){var o=v.createSVGMatrix();switch(arguments.length){case 0:return o;case 6:e={a:e,b:t,c:n,d:i,e:r,f:a}}return x(o,e)},e.createTransform=function(e){return e?v.createSVGTransformFromMatrix(e):v.createSVGTransform()},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof n.exports?t(n.exports):t(e.TinySVG={});var i={},r=(n=n.exports).attr,a=n.create;function o(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}i.componentsToPath=function(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")},i.createLine=function(e,t){var n=a("polyline");return r(n,{points:o(e)}),t&&r(n,t),n},i.updateLine=function(e,t){return r(e,{points:o(t)}),e};var s={exports:{}};!function(e,t){"object"==typeof s.exports?t(s.exports):t(e.MinDash={})}(this,function(e){"use strict";var t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return null==e}function r(e){return"[object Array]"===t.call(e)}function a(e){return"[object Object]"===t.call(e)}function o(e){return"[object Function]"===t.call(e)}function s(e,t){return n.call(e,t)}function p(e,t){var n;return t=d(t),l(e,function(e,i){if(t(e,i))return n=e,!1}),n}function l(e,t){if(!i(e)){var n=r(e)?g:y;for(var a in e){if(s(e,a))if(!1===t(e[a],n(a)))return}}}function c(e,t,n){return l(e,function(e,i){n=t(n,e,i)}),n}function u(e,t){return c(e,function(e,n,i){return e&&t(n,i)},!0)}function h(e,t){var n=[];return l(e,function(e,i){n.push(t(e,i))}),n}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=f(t),l(e,function(e){var i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)}),n}function f(e){return o(e)?e:function(t){return t[e]}}function d(e){return o(e)?e:function(t){return t===e}}function y(e){return e}function g(e){return Number(e)}var v=Array.prototype.slice;var x=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};e.find=p,e.filter=function(e,t){var n=[];return l(e,function(e,i){t(e,i)&&n.push(e)}),n},e.forEach=l,e.reduce=c,e.every=u,e.some=function(e,t){return!!p(e,t)},e.map=h,e.groupBy=m,e.matchPattern=function(e){return function(t){return u(e,function(e,n){return t[n]===e})}},e.debounce=function(e,t){var n;return function(){var i=v.call(arguments);n&&clearTimeout(n),n=setTimeout(function(){e.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i))},t)}},e.bind=function(e,t){return e.bind(t)},e.isArray=r,e.isObject=a,e.isNumber=function(e){return"[object Number]"===t.call(e)},e.isFunction=o,e.isString=function(e){return"[object String]"===t.call(e)},e.assign=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return x.apply(void 0,[e].concat(n))},e.pick=function(e,t){var n={},i=Object(e);return l(t,function(t){t in i&&(n[t]=e[t])}),n},e.omit=function(e,t){var n={};return l(Object(e),function(e,i){-1===t.indexOf(i)&&(n[i]=e)}),n},Object.defineProperty(e,"__esModule",{value:!0})});var p={},l=(s=s.exports).every,c=s.some,u=i.componentsToPath;function h(e){return e.businessObject.di}p.isTypedEvent=function(e,t,n){return c(e.eventDefinitions,function(i){return i.$type===t&&function(e,t){return l(t,function(t,n){return e[n]==t})}(e,n)})},p.isThrowEvent=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type},p.isCollection=function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection},p.getDi=h,p.getSemantic=function(e){return e.businessObject},p.getFillColor=function(e,t){return h(e).get("bioc:fill")||t||"white"},p.getStrokeColor=function(e,t){return h(e).get("bioc:stroke")||t||"black"},p.getCirclePath=function(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2;return u([["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]])},p.getRoundRectPath=function(e,t){var n=e.x,i=e.y,r=e.width,a=e.height;return u([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,a-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-a],["a",t,t,0,0,1,t,-t],["z"]])},p.getDiamondPath=function(e){var t=e.width,n=e.height,i=e.x,r=e.y,a=t/2,o=n/2;return u([["M",i+a,r],["l",a,o],["l",-a,o],["l",-a,-o],["z"]])},p.getRectPath=function(e){var t=e.x,n=e.y,i=e.width,r=e.height;return u([["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]])};var m={};function f(e){return e&&e.businessObject||e}m.is=function(e,t){var n=f(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)},m.getBusinessObject=f;var d={},y=m.is,g=m.getBusinessObject;s.forEach;d.isExpanded=function(e){return!y(e,"bpmn:CallActivity")&&(y(e,"bpmn:SubProcess")?!!g(e).di.isExpanded:!y(e,"bpmn:Participant")||!!g(e).processRef)},d.isEventSubProcess=function(e){return e&&!!g(e).triggeredByEvent};var v=1e3;function x(e,t){var n=this;t=t||v,e.on(["render.shape","render.connection"],t,function(e,t){var i=e.type,r=t.element,a=t.gfx;if(n.canRender(r))return"render.shape"===i?n.drawShape(a,r):n.drawConnection(a,r)}),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)})}x.prototype.canRender=function(){},x.prototype.drawShape=function(){},x.prototype.drawConnection=function(){},x.prototype.getShapePath=function(){},x.prototype.getConnectionPath=function(){};var b=x,E={},w=n.transform,_=n.createTransform;E.transform=function(e,t,n,i,r){var a=_();a.setTranslate(t,n);var o=_();o.setRotate(i,0,0);var s=_();s.setScale(r||1,r||1),w(e,[a,o,s])},E.translate=function(e,t,n){var i=_();i.setTranslate(t,n),w(e,i)},E.rotate=function(e,t){var n=_();n.setRotate(t,0,0),w(e,n)};var A=s.isObject,S=s.assign,C=s.pick,R=s.forEach,M=s.reduce,k=n.append,P=n.attr,T=n.create,N=n.remove,D=0,O={width:150,height:50};function B(e,t){t.textContent=e;try{var n,i=""===e;return t.textContent=i?"dummy":e,n=C(t.getBBox(),["width","height"]),i&&(n.width=0),n}catch(e){return{width:0,height:0}}}function L(e,t,n){for(var i,r=e.shift(),a=r;;){if((i=B(a,n)).width=a?i.width:0," "===a||""===a||i.width<Math.round(t)||a.length<2)return I(e,a,r,i);a=j(a,i.width,t)}}function I(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 j(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-)/g),r=[],a=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+a<t)){"-"===n&&r.pop();break}r.push(n),a+=n.length}return r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function F(e){this._config=S({},{size:O,padding:D,style:{},align:"center-top"},e||{})}F.prototype.createText=function(e,t){return this.layoutText(e,t).element},F.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},F.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),a=function(e){return A(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),o=t.fitBox||!1,s=e.split(/\r?\n/g),p=[],l=n.width-a.left-a.right,c=T("text");P(c,{x:0,y:0}),P(c,i);var u=function(){var e=document.getElementById("helper-svg");return e||(e=T("svg"),P(e,{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(e)),e}();for(k(u,c);s.length;)p.push(L(s,l,c));var h,m,f=M(p,function(e,t,n){return e+t.height},0),d=M(p,function(e,t,n){return t.width>e?t.width:e},0);switch(r.vertical){case"middle":h=(n.height-f)/2-p[0].height/4;break;default:h=a.top}var y=T("text");return P(y,i),R(p,function(e){switch(h+=e.height,r.horizontal){case"left":m=a.left;break;case"right":m=(o?d:l)-a.right-e.width;break;default:m=Math.max(((o?d:l)-e.width)/2+a.left,0)}var t=T("tspan");P(t,{x:m,y:h}),t.textContent=e.text,k(y,t)}),N(c),{dimensions:{width:d,height:f},element:y}};var V=F,W={},z=W=function(e,t){if(t||(t=16),void 0===e&&(e=128),e<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),i=2;n===1/0;i*=2)n=Math.log(Math.pow(2,e/i))/Math.log(t)*i;var r=n-Math.floor(n),a="";for(i=0;i<Math.floor(n);i++){a=Math.floor(Math.random()*t).toString(t)+a}if(r){var o=Math.pow(t,r);a=Math.floor(Math.random()*o).toString(t)+a}var s=parseInt(a,t);return s!==1/0&&s>=Math.pow(2,e)?z(e,t):a};function G(e){if(!(this instanceof G))return new G(e);e=e||[128,36,1],this._seed=e.length?W.rack(e[0],e[1],e[2]):e}z.rack=function(e,t,n){var i=function(i){var a=0;do{if(a++>10){if(!n)throw new Error("too many ID collisions, use more bits");e+=n}var o=z(e,t)}while(Object.hasOwnProperty.call(r,o));return r[o]=i,o},r=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=t||16,i};var $=G;G.prototype.next=function(e){return this._seed(e||!0)},G.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},G.prototype.claim=function(e,t){this._seed.set(e,t||!0)},G.prototype.assigned=function(e){return this._seed.get(e)||!1},G.prototype.unclaim=function(e){delete this._seed.hats[e]},G.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var H={};H="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var K={exports:{}};!function(e,t){"object"==typeof K.exports?t(K.exports):t(e.MinDom={})}(this,function(e){"use strict";var t=[].indexOf,n=function(e,n){if(t)return e.indexOf(n);for(var i=0;i<e.length;++i)if(e[i]===n)return i;return-1},i=/\s+/,r=Object.prototype.toString;function a(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}a.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~n(t,e)||t.push(e),this.el.className=t.join(" "),this},a.prototype.remove=function(e){if("[object RegExp]"==r.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),i=n(t,e);return~i&&t.splice(i,1),this.el.className=t.join(" "),this},a.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},a.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)},a.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(i);return""===e[0]&&e.shift(),e},a.prototype.has=a.prototype.contains=function(e){return this.list?this.list.contains(e):!!~n(this.array(),e)};var o=Element.prototype,s=o.matchesSelector||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector,p=function(e,t){if(s)return s.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 l,c=function(e,t,n){for(var i=n?e:e.parentNode;i&&i!==document;){if(p(i,t))return i;i=i.parentNode}},u=window.addEventListener?"addEventListener":"attachEvent",h=window.removeEventListener?"removeEventListener":"detachEvent",m="addEventListener"!==u?"on":"",f={bind:function(e,t,n,i){return e[u](m+t,n,i||!1),n},unbind:function(e,t,n,i){return e[h](m+t,n,i||!1),n}},d=["focus","blur"],y={bind:function(e,t,n,i,r){return-1!==d.indexOf(n)&&(r=!0),f.bind(e,n,function(n){var r=n.target||n.srcElement;n.delegateTarget=c(r,t,!0),n.delegateTarget&&i.call(e,n)},r)},unbind:function(e,t,n,i){-1!==d.indexOf(t)&&(i=!0),f.unbind(e,t,n,i)}},g=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){var r=t.createElement("html");return r.innerHTML=e,r.removeChild(r.lastChild)}var a=x[i]||x._default,o=a[0],s=a[1],p=a[2];(r=t.createElement("div")).innerHTML=s+e+p;for(;o--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var l=t.createDocumentFragment();for(;r.firstChild;)l.appendChild(r.removeChild(r.firstChild));return l},v=!1;"undefined"!=typeof document&&((l=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',v=!l.getElementsByTagName("link").length,l=void 0);var x={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:v?[1,"X<div>","</div>"]:[0,"",""]};x.td=x.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],x.option=x.optgroup=[1,'<select multiple="multiple">',"</select>"],x.thead=x.tbody=x.colgroup=x.caption=x.tfoot=[1,"<table>","</table>"],x.polyline=x.ellipse=x.polygon=x.circle=x.text=x.line=x.path=x.rect=x.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var b="undefined"!=typeof Element?Element.prototype:{};b.matches||b.matchesSelector||b.webkitMatchesSelector||b.mozMatchesSelector||b.msMatchesSelector||b.oMatchesSelector;e.attr=function(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)},e.classes=function(e){return new a(e)},e.clear=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},e.closest=c,e.delegate=y,e.domify=g,e.event=f,e.query=function(e,t){return(t=t||document).querySelector(e)},e.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)},Object.defineProperty(e,"__esModule",{value:!0})}),K=K.exports;var U=s.isObject,q=s.assign,Y=s.forEach,X=m.is,Z=i.createLine,J=p.isTypedEvent,Q=p.isThrowEvent,ee=p.isCollection,te=p.getDi,ne=p.getSemantic,ie=p.getCirclePath,re=p.getRoundRectPath,ae=p.getDiamondPath,oe=p.getRectPath,se=p.getFillColor,pe=p.getStrokeColor,le=K.query,ce=n.append,ue=n.attr,he=n.create,me=n.classes,fe=E.rotate,de=E.transform,ye=E.translate,ge=new $,ve=10,xe=3,be={fontFamily:"Arial, sans-serif",fontSize:12},Ee=.95,we=.35;function _e(e,t,n,i,r){b.call(this,e,r);var a=ge.next(),o=new V({style:be,size:{width:100}}),s={},p=t.computeStyle;function l(e,t){var n=q({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),r=t.ref||{x:0,y:0},a=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var o=he("marker");ue(t.element,n),ce(o,t.element),ue(o,{id:e,viewBox:"0 0 20 20",refX:r.x,refY:r.y,markerWidth:20*a,markerHeight:20*a,orient:"auto"});var p=le("defs",i._svg);p||(p=he("defs"),ce(i._svg,p)),ce(p,o),s[e]=o}function c(e,t,n){var i=e+"-"+t+"-"+n+"-"+a;return s[i]||function(e,t,n){var i=e+"-"+t+"-"+n+"-"+a;if("sequenceflow-end"===e){var r=he("path");ue(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),l(i,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:n,stroke:n}})}if("messageflow-start"===e){var o=he("circle");ue(o,{cx:6,cy:6,r:3.5}),l(i,{element:o,attrs:{fill:t,stroke:n},ref:{x:6,y:6}})}if("messageflow-end"===e){var s=he("path");ue(s,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),l(i,{element:s,attrs:{fill:t,stroke:n,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===e){var p=he("path");ue(p,{d:"M 11 5 L 1 10 L 11 15"}),l(i,{element:p,attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===e){var c=he("path");ue(c,{d:"M 1 5 L 11 10 L 1 15"}),l(i,{element:c,attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===e){var u=he("path");ue(u,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),l(i,{element:u,attrs:{fill:t,stroke:n},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===e){var h=he("path");ue(h,{d:"M 6 4 L 10 16"}),l(i,{element:h,attrs:{stroke:n},ref:{x:0,y:10},scale:.5})}}(e,t,n),"url(#"+i+")"}function u(e,t,n,i,r){U(i)&&(r=i,i=0),i=i||0,r=p(r,{stroke:"black",strokeWidth:2,fill:"white"});var a=t/2,o=n/2,s=he("circle");return ue(s,{cx:a,cy:o,r:Math.round((t+n)/4-i)}),ue(s,r),ce(e,s),s}function h(e,t,n,i,r,a){U(r)&&(a=r,r=0),r=r||0,a=p(a,{stroke:"black",strokeWidth:2,fill:"white"});var o=he("rect");return ue(o,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),ue(o,a),ce(e,o),o}function m(e,t,n){n=p(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"});var i=Z(t,n);return ce(e,i),i}function f(e,t,n){n=p(n,["no-fill"],{strokeWidth:2,stroke:"black"});var i=he("path");return ue(i,{d:t}),ue(i,n),ce(e,i),i}function y(e,t,n,i){return f(t,n,q({"data-marker":e},i))}function g(e){return function(t,n){return S[e](t,n)}}function v(e){return S[e]}function x(e,t){var n=ne(e),i=Q(n);return J(n,"bpmn:MessageEventDefinition")?v("bpmn:MessageEventDefinition")(t,e,i):J(n,"bpmn:TimerEventDefinition")?v("bpmn:TimerEventDefinition")(t,e,i):J(n,"bpmn:ConditionalEventDefinition")?v("bpmn:ConditionalEventDefinition")(t,e):J(n,"bpmn:SignalEventDefinition")?v("bpmn:SignalEventDefinition")(t,e,i):J(n,"bpmn:CancelEventDefinition")&&J(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!1})?v("bpmn:MultipleEventDefinition")(t,e,i):J(n,"bpmn:CancelEventDefinition")&&J(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!0})?v("bpmn:ParallelMultipleEventDefinition")(t,e,i):J(n,"bpmn:EscalationEventDefinition")?v("bpmn:EscalationEventDefinition")(t,e,i):J(n,"bpmn:LinkEventDefinition")?v("bpmn:LinkEventDefinition")(t,e,i):J(n,"bpmn:ErrorEventDefinition")?v("bpmn:ErrorEventDefinition")(t,e,i):J(n,"bpmn:CancelEventDefinition")?v("bpmn:CancelEventDefinition")(t,e,i):J(n,"bpmn:CompensateEventDefinition")?v("bpmn:CompensateEventDefinition")(t,e,i):J(n,"bpmn:TerminateEventDefinition")?v("bpmn:TerminateEventDefinition")(t,e,i):null}function E(e,t,n){var i=o.createText(t||"",n);return me(i).add("djs-label"),ce(e,i),i}function w(e,t,n){return E(e,ne(t).name,{box:t,align:n,padding:5,style:{fill:pe(t)}})}function _(e,t,n){var i=E(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:pe(n)}}),r=-1*n.height;de(i,0,-r,270)}function A(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 S=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=Ee),u(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:se(t),stroke:pe(t)};ne(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round"});var i=v("bpmn:Event")(e,t,n);return x(t,e),i},"bpmn:MessageEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:i?pe(t):se(t),stroke:i?se(t):pe(t)})},"bpmn:TimerEventDefinition":function(e,t){var i=u(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:se(t),stroke:pe(t)});f(e,n.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:pe(t)});for(var r=0;r<12;r++){var a=n.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),o=t.width/2;f(e,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+o+")",stroke:pe(t)})}return i},"bpmn:EscalationEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:ConditionalEventDefinition":function(e,t){return f(e,n.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:pe(t)})},"bpmn:LinkEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:ErrorEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:CancelEventDefinition":function(e,t,i){var r=f(e,n.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:i?"black":"none"});return fe(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:SignalEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:MultipleEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:i?"black":"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return f(e,n.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:pe(t),stroke:pe(t)})},"bpmn:EndEvent":function(e,t){var n=v("bpmn:Event")(e,t,{strokeWidth:4,fill:se(t),stroke:pe(t)});return x(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return u(e,t.width,t.height,8,{strokeWidth:4,fill:pe(t),stroke:pe(t)})},"bpmn:IntermediateEvent":function(e,t){var n=v("bpmn:Event")(e,t,{strokeWidth:1,fill:se(t),stroke:pe(t)});return u(e,t.width,t.height,xe,{strokeWidth:1,fill:se(t,"none"),stroke:pe(t)}),x(t,e),n},"bpmn:IntermediateCatchEvent":g("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":g("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=Ee),h(e,t.width,t.height,ve,n)},"bpmn:Task":function(e,t){var n={fill:se(t),stroke:pe(t)},i=v("bpmn:Activity")(e,t,n);return w(e,t,"center-middle"),C(e,t),i},"bpmn:ServiceTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:se(t),stroke:pe(t)}),f(e,n.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:se(t)}),f(e,n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:se(t),stroke:pe(t)}),i},"bpmn:UserTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:se(t),stroke:pe(t)}),f(e,n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:se(t),stroke:pe(t)}),f(e,n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:pe(t),stroke:pe(t)}),i},"bpmn:ManualTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:se(t),stroke:pe(t)}),i},"bpmn:SendTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:pe(t),stroke:se(t)}),i},"bpmn:ReceiveTask":function(e,t){var i,r=ne(t),a=v("bpmn:Task")(e,t);return r.instantiate?(u(e,28,28,4.4,{strokeWidth:1}),i=n.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):i=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),f(e,i,{strokeWidth:1,fill:se(t),stroke:pe(t)}),a},"bpmn:ScriptTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:pe(t)}),i},"bpmn:BusinessRuleTask":function(e,t){var i=v("bpmn:Task")(e,t),r=f(e,n.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}));ue(r,{strokeWidth:1,fill:se(t,"#aaaaaa"),stroke:pe(t)});var a=f(e,n.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}));return ue(a,{strokeWidth:1,stroke:pe(t)}),i},"bpmn:SubProcess":function(e,t,n){n=q({fill:se(t),stroke:pe(t)},n);var i=v("bpmn:Activity")(e,t,n),r=d.isExpanded(t);return d.isEventSubProcess(t)&&ue(i,{strokeDasharray:"1,2"}),w(e,t,r?"center-top":"center-middle"),r?C(e,t):C(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return v("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,n){var i=v("bpmn:SubProcess")(e,n),r=t.style(["no-fill","no-events"],{stroke:pe(n)});return h(e,n.width,n.height,ve-2,xe,r),i},"bpmn:CallActivity":function(e,t){return v("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:Ee,fill:se(t),stroke:pe(t)},i=v("bpmn:Lane")(e,t,n);d.isExpanded(t)?(m(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:pe(t)}),_(e,ne(t).name,t)):E(e,ne(t).name,{box:t,align:"center-middle",style:{fill:pe(t)}});return!!ne(t).participantMultiplicity&&v("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=h(e,t.width,t.height,0,q({fill:se(t),fillOpacity:we,stroke:pe(t)},n)),r=ne(t);"bpmn:Lane"===r.$type&&_(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=v("bpmn:Gateway")(e,t);return u(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:se(t),stroke:pe(t)}),n},"bpmn:ExclusiveGateway":function(e,t){var i=v("bpmn:Gateway")(e,t),r=n.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return te(t).isMarkerVisible&&f(e,r,{strokeWidth:1,fill:pe(t),stroke:pe(t)}),i},"bpmn:ComplexGateway":function(e,t){var i=v("bpmn:Gateway")(e,t);return f(e,n.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:pe(t),stroke:pe(t)}),i},"bpmn:ParallelGateway":function(e,t){var i=v("bpmn:Gateway")(e,t);return f(e,n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:pe(t),stroke:pe(t)}),i},"bpmn:EventBasedGateway":function(e,t){var i=ne(t),r=v("bpmn:Gateway")(e,t);u(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:pe(t)});var a=i.eventGatewayType,o=!!i.instantiate;if("Parallel"===a){var s=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),p=f(e,s);ue(p,{strokeWidth:1,fill:"none"})}else if("Exclusive"===a){if(!o){var l=u(e,t.width,t.height,.26*t.height);ue(l,{strokeWidth:1,fill:"none",stroke:pe(t)})}!function(){var i=n.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:se(t,"none"),stroke:pe(t)};f(e,i,r)}()}return r},"bpmn:Gateway":function(e,t){var n={fill:se(t),fillOpacity:Ee,stroke:pe(t)};return function(e,t,n,i){var r=t/2,a=n/2,o=[{x:r,y:0},{x:t,y:a},{x:r,y:n},{x:0,y:a}].map(function(e){return e.x+","+e.y}).join(" ");i=p(i,{stroke:"black",strokeWidth:2,fill:"white"});var s=he("polygon");return ue(s,{points:o}),ue(s,i),ce(e,s),s}(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=A(t),r=se(t),a=pe(t),o=f(e,i,{strokeLinejoin:"round",markerEnd:c("sequenceflow-end",r,a),stroke:pe(t)}),s=ne(t);return t.source&&(n=t.source.businessObject,s.conditionExpression&&n.$instanceOf("bpmn:Activity")&&ue(o,{markerStart:c("conditional-flow-marker",r,a)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===s&&ue(o,{markerStart:c("conditional-default-flow-marker",r,a)})),o},"bpmn:Association":function(e,t,n){var i=ne(t),r=se(t),a=pe(t);return n=q({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:pe(t)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=c("association-end",r,a)),"Both"===i.associationDirection&&(n.markerStart=c("association-start",r,a)),m(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=se(t),i=pe(t);return v("bpmn:Association")(e,t,{markerEnd:c("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=se(t),i=pe(t);return v("bpmn:Association")(e,t,{markerEnd:c("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var i=ne(t),r=te(t),a=se(t),o=pe(t),s=f(e,A(t),{markerEnd:c("messageflow-end",a,o),markerStart:c("messageflow-start",a,o),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:pe(t)});if(i.messageRef){var p=s.getPointAtLength(s.getTotalLength()/2),l=n.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:p.x,y:p.y}}),u={strokeWidth:1};"initiating"===r.messageVisibleKind?(u.fill="white",u.stroke="black"):(u.fill="#888",u.stroke="white"),f(e,l,u)}return s},"bpmn:DataObject":function(e,t){var i=f(e,n.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:se(t),fillOpacity:Ee,stroke:pe(t)}),r=ne(t);return ee(r)&&function(e,t){var i=(t.height-16)/t.height,r=n.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.451,my:i}});f(e,r,{strokeWidth:2})}(e,t),i},"bpmn:DataObjectReference":g("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var i=n.getRawPath("DATA_ARROW"),r=v("bpmn:DataObject")(e,t);return f(e,i,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var i=n.getRawPath("DATA_ARROW"),r=v("bpmn:DataObject")(e,t);return f(e,i,{strokeWidth:1,fill:"black"}),r},"bpmn:DataStoreReference":function(e,t){return f(e,n.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:se(t),fillOpacity:Ee,stroke:pe(t)})},"bpmn:BoundaryEvent":function(e,t){var n=ne(t).cancelActivity,i={strokeWidth:1,fill:se(t),stroke:pe(t),fillOpacity:1};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=v("bpmn:Event")(e,t,i);return u(e,t.width,t.height,xe,q(i,{fill:"none"})),x(t,e),r},"bpmn:Group":function(e,t){return h(e,t.width,t.height,ve,{strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n=ne(t),i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return E(e,n.name,{box:i,fitBox:!0,style:{fontSize:"11px"}})}(e,t)},"bpmn:TextAnnotation":function(e,t){var i=h(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return f(e,n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:pe(t)}),E(e,ne(t).text||"",{box:t,align:"left-top",padding:5}),i},ParticipantMultiplicityMarker:function(e,t){y("participant-multiplicity",e,n.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}}))},SubProcessMarker:function(e,t){var i=h(e,14,14,0,{strokeWidth:1,fill:se(t),stroke:pe(t)});ye(i,t.width/2-7.5,t.height-20),y("sub-process",e,n.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:se(t),stroke:pe(t)})},ParallelMarker:function(e,t,i){y("parallel",e,n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.parallel)/t.width,my:(t.height-20)/t.height}}))},SequentialMarker:function(e,t,i){y("sequential",e,n.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.seq)/t.width,my:(t.height-19)/t.height}}))},CompensationMarker:function(e,t,i){y("compensation",e,n.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1})},LoopMarker:function(e,t,i){y("loop",e,n.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1,fill:"none",strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,i){y("adhoc",e,n.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:"black"})}};function C(e,t,n){var i,r=ne(t),a=n&&-1!==n.indexOf("SubProcessMarker");i=a?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},Y(n,function(n){v(n)(e,t,i)}),r.isForCompensation&&v("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&v("AdhocMarker")(e,t,i);var o=r.loopCharacteristics,s=o&&o.isSequential;o&&(void 0===s&&v("LoopMarker")(e,t,i),!1===s&&v("ParallelMarker")(e,t,i),!0===s&&v("SequentialMarker")(e,t,i))}this._drawPath=f}H(_e,b),_e.$inject=["eventBus","styles","pathMap","canvas"];var Ae=_e;_e.prototype.canRender=function(e){return X(e,"bpmn:BaseElement")},_e.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},_e.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},_e.prototype.getShapePath=function(e){return X(e,"bpmn:Event")?ie(e):X(e,"bpmn:Activity")?re(e,ve):X(e,"bpmn:Gateway")?ae(e):oe(e)};var Se=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 0 15 l 0 -15 m 4 15 l 0 -15 m 4 15 l 0 -15 ",height:61,width:51,heightElements:[12],widthElements:[1,6,12,15]},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 a,o,s={};if(t.position){for(var p=t.containerHeight/r.height*t.yScaleFactor,l=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)s["y"+c]=r.heightElements[c]*p;for(var u=0;u<r.widthElements.length;u++)s["x"+u]=r.widthElements[u]*l}return a=r.d,o={mx:n,my:i,e:s},String(a).replace(Ce,function(e,t){return function(e,t,n){var i=n;return t.replace(Re,function(e,t,n,r,a){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&a&&(i=i()))}),i=(null==i||i==n?e:i)+""}(e,t,o)})}},Ce=/\{([^}]+)\}/g,Re=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Me={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ae],pathMap:["type",Se]},ke={elementToString:function(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}},Pe={},Te=s.assign,Ne=m.is,De={width:90,height:20},Oe=15;function Be(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=Le(e),a=Math.atan((i.y-n.y)/(i.x-n.x)),o=r.x,s=r.y;return Math.abs(a)<Math.PI/2?s-=Oe:o+=Oe,{x:o,y:s}}function Le(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}}function Ie(e){return e.waypoints?Be(e.waypoints):{x:e.x+e.width/2,y:e.y+e.height+De.height/2}}Pe.hasExternalLabel=function(e){return Ne(e,"bpmn:Event")||Ne(e,"bpmn:Gateway")||Ne(e,"bpmn:DataStoreReference")||Ne(e,"bpmn:DataObjectReference")||Ne(e,"bpmn:SequenceFlow")||Ne(e,"bpmn:MessageFlow")},Pe.getExternalLabelBounds=function(e,t){var n,i,r,a=e.di.label;return a&&a.bounds?(r=a.bounds,i={width:Math.max(De.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Ie(t),i=De),Te({x:n.x-i.width/2,y:n.y-i.height/2},i)};var je=s.assign,Fe=s.map,Ve=m.is,We=Pe.hasExternalLabel,ze=Pe.getExternalLabelBounds,Ge=d.isExpanded,$e=ke.elementToString;function He(e,t){return je({id:e.id,type:e.$type,businessObject:e},t)}function Ke(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:$e(n),referenced:$e(t),property:i}))}function Ue(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textUtil=new V}Ue.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate"];var qe=Ue;Ue.prototype.add=function(e,t){var n,i,r,a,o=e.di,s=this._translate;if(Ve(o,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(He(e)),this._canvas.setRootElement(n);else if(Ve(o,"bpmndi:BPMNShape")){var p=!Ge(e);i=t&&(t.hidden||t.collapsed);var l=e.di.bounds;n=this._elementFactory.createShape(He(e,{collapsed:p,hidden:i,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height)})),Ve(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,n),Ve(e,"bpmn:Lane")&&(r=0),this._canvas.addShape(n,t,r)}else{if(!Ve(o,"bpmndi:BPMNEdge"))throw new Error(s("unknown di {di} for element {semantic}",{di:$e(o),semantic:$e(e)}));var c=this._getSource(e),u=this._getTarget(e);i=t&&(t.hidden||t.collapsed),n=this._elementFactory.createConnection(He(e,{hidden:i,source:c,target:u,waypoints:(a=e.di.waypoint,Fe(a,function(e){return{x:e.x,y:e.y}}))})),Ve(e,"bpmn:DataAssociation")&&(t=null),Ve(e,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,t,r)}return We(e)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},Ue.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:$e(e)}));var r=this._elementRegistry.get(i.id),a=r&&r.attachers;if(!r)throw Ke(n,e,i,"attachedToRef");t.host=r,a||(r.attachers=a=[]),-1===a.indexOf(t)&&a.push(t)},Ue.prototype.addLabel=function(e,t){var n,i,r;return n=ze(e,t),(i=e.name)&&(n=function(e,t,n){var i=n.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:Ye});return{x:Math.round(e.x+e.width/2-i.width/2),y:Math.round(e.y),width:Math.ceil(i.width),height:Math.ceil(i.height)}}(n,i,this._textUtil)),r=this._elementFactory.createLabel(He(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!e.name,x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,t.parent)},Ue.prototype._getEnd=function(e,t){var n,i,r=e.$type,a=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?Ke(a,e,i,t+"Ref"):new Error(a("{semantic}#{side} Ref not specified",{semantic:$e(e),side:t}))},Ue.prototype._getSource=function(e){return this._getEnd(e,"source")},Ue.prototype._getTarget=function(e){return this._getEnd(e,"target")},Ue.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Ye={fontFamily:"Arial, sans-serif",fontSize:"11px"};var Xe={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}]},Ze={__depends__:[Me,{__depends__:[Xe],bpmnImporter:["type",qe]}]},Je={};function Qe(e,t,n){Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:Je.extend(n[t.name]||[],e,t,n)})}function et(e,t){if(!(this instanceof et))return new et(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Je.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){this.contains(e)||(this.push(e),t.set(e,r,i))}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},Je.isExtended=function(e){return!0===e.__refs_collection},et.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?Qe(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var a=r;r=null,a&&e.unset(a,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},et.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Je.isExtended(n)||Qe(this,t,e),n},et.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},et.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},et.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var tt={};(tt=et).Collection=Je;var nt=s.filter,it=s.find,rt=s.forEach,at=ke.elementToString,ot=new tt({name:"bpmnElement",enumerable:!0},{name:"di"});function st(e,t){return e.$instanceOf(t)}var pt=function(e,t){var n={},i=[];function r(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function o(n,i){try{var r=n.di&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:at(n)}));return e.element(n,i)}(n,i);return a(n),r}catch(e){s(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:at(n)})),console.error(e)}}function s(t,n){e.error(t,n)}function p(e){var n=e.bpmnElement;n?n.di?s(t("multiple DI elements defined for {element}",{element:at(n)}),{element:n}):(ot.bind(n,"di"),n.di=e):s(t("no bpmnElement referenced in {element}",{element:at(e)}),{element:e})}function l(e){var t;p(t=e.plane),rt(t.planeElement,c)}function c(e){p(e)}function u(e,t){_(e,t),v(e.ioSpecification,t),g(e.artifacts,t),a(e)}function h(e,t){o(e,t)}function m(e,t){o(e,t)}function f(e,t){o(e,t)}function d(e,t){o(e,t)}function y(e,t){o(e,t)}function g(e,t){rt(e,function(e){st(e,"bpmn:Association")?i.push(function(){y(e,t)}):y(e,t)})}function v(e,t){e&&(rt(e.dataInputs,r(f,t)),rt(e.dataOutputs,r(d,t)))}function x(e,t){var n=o(e,t);st(e,"bpmn:SubProcess")&&function(e,t){_(e,t),g(e.artifacts,t)}(e,n||t),st(e,"bpmn:Activity")&&v(e.ioSpecification,t),i.push(function(){rt(e.dataInputAssociations,r(m,t)),rt(e.dataOutputAssociations,r(m,t))})}function b(e,t){o(e,t)}function E(e,t){i.push(function(){var n=o(e,t);e.childLaneSet&&w(e.childLaneSet,n||t),function(e){rt(e.flowNodeRef,function(t){var n=t.get("lanes");n&&n.push(e)})}(e)})}function w(e,t){rt(e.lanes,r(E,t))}function _(e,n){!function(e,n){rt(e,function(e){st(e,"bpmn:SequenceFlow")?i.push(function(){!function(e,t){o(e,t)}(e,n)}):st(e,"bpmn:BoundaryEvent")?i.unshift(function(){!function(e,t){o(e,t)}(e,n)}):st(e,"bpmn:FlowNode")?x(e,n):st(e,"bpmn:DataObject")||(st(e,"bpmn:DataStoreReference")?b(e,n):st(e,"bpmn:DataObjectReference")?b(e,n):s(t("unrecognized flowElement {element} in context {context}",{element:at(e),context:n?at(n.businessObject):"null"}),{element:e,context:n}))})}(e.flowElements,n),e.laneSets&&function(e,t){rt(e,r(w,t))}(e.laneSets,n)}function A(e,t){var n=o(e,t),i=e.processRef;i&&u(i,n||t)}return{handleDefinitions:function(a,o){var c=a.diagrams;if(o&&-1===c.indexOf(o))throw new Error(t("diagram not part of bpmn:Definitions"));if(!o&&c&&c.length&&(o=c[0]),!o)throw new Error(t("no diagram to display"));l(o);var m=o.plane;if(!m)throw new Error(t("no plane for {element}",{element:at(o)}));var f=m.bpmnElement;if(!f){if(!(f=function(e){return it(e.rootElements,function(e){return st(e,"bpmn:Process")||st(e,"bpmn:Collaboration")})}(a)))throw new Error(t("no process or collaboration to display"));s(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:at(m),rootElement:at(f)})),m.bpmnElement=f,p(m)}var d,y,v=function(t,n){return e.root(t,n)}(f,m);if(st(f,"bpmn:Process"))u(f,v);else{if(!st(f,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:at(m),rootElement:at(f)}));rt((y=f).participants,r(A)),g(y.artifacts),i.push(function(){var e,t;e=y.messageFlows,rt(e,r(h,t))}),d=a.rootElements,nt(d,function(e){return!n[e.id]&&st(e,"bpmn:Process")&&e.laneSets}).forEach(r(u))}!function(e){for(;e.length;)e.shift()()}(i)}}},lt={};lt.importBpmnDiagram=function(e,t,n){var i,r,a,o,s=[];try{i=e.get("bpmnImporter"),r=e.get("eventBus"),a=e.get("translate"),r.fire("import.render.start",{definitions:t}),function(e){new pt({root:function(e){return i.add(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){s.push({message:e,context:t})}},a).handleDefinitions(e)}(t),r.fire("import.render.complete",{error:o,warnings:s})}catch(e){o=e}n(o,s)};var ct={},ut=K.domify,ht=K.delegate,mt='<img width="52" height="52" src="'+("data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960"><path fill="#fff" d="M960 60v839c0 33-27 61-60 61H60c-33 0-60-27-60-60V60C0 27 27 0 60 0h839c34 0 61 27 61 60z"/><path fill="#52b415" d="M217 548a205 205 0 0 0-144 58 202 202 0 0 0-4 286 202 202 0 0 0 285 3 200 200 0 0 0 48-219 203 203 0 0 0-185-128zM752 6a206 206 0 0 0-192 285 206 206 0 0 0 269 111 207 207 0 0 0 111-260A204 204 0 0 0 752 6zM62 0A62 62 0 0 0 0 62v398l60 46a259 259 0 0 1 89-36c5-28 10-57 14-85l99 2 12 85a246 246 0 0 1 88 38l70-52 69 71-52 68c17 30 29 58 35 90l86 14-2 100-86 12a240 240 0 0 1-38 89l43 58h413c37 0 60-27 60-61V407a220 220 0 0 1-44 40l21 85-93 39-45-76a258 258 0 0 1-98 1l-45 76-94-39 22-85a298 298 0 0 1-70-69l-86 22-38-94 76-45a258 258 0 0 1-1-98l-76-45 40-94 85 22a271 271 0 0 1 41-47z"/></svg>'))+'" />';function ft(e){return e.join(";")}var dt,yt='<div class="bjs-powered-by-lightbox" style="'+ft(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+ft(["width: 100%","height: 100%","background: rgba(0,0,0,0.2)"])+'"></div><div class="notice" style="'+ft(["position: absolute","left: 50%","top: 40%","margin: 0 -130px","width: 260px","padding: 10px","background: white","border: solid 1px #AAA","border-radius: 3px","font-family: Helvetica, Arial, sans-serif","font-size: 14px","line-height: 1.2em"])+'"><a href="http://bpmn.io" target="_blank" style="float: left; margin-right: 10px">'+mt+'</a>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="http://bpmn.io" target="_blank">bpmn.io</a>.</div></div>';ct.open=function(){dt||(dt=ut(yt),ht.bind(dt,".backdrop","click",function(e){document.body.removeChild(dt)})),document.body.appendChild(dt)},ct.BPMNIO_IMG=mt;var gt={};gt.hasLowerCaseAlias=function(e){return e.xml&&"lowerCase"===e.xml.tagAlias},gt.DEFAULT_NS_MAP={xsi:"http://www.w3.org/2001/XMLSchema-instance"};var vt=gt.XSI_TYPE="xsi:type";function xt(e){return e.xml&&e.xml.serialize}function bt(){}gt.serializeAsType=function(e){return xt(e)===vt},gt.serializeAsProperty=function(e){return"property"===xt(e)},bt.prototype.get=function(e){return this.$model.properties.get(this,e)},bt.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};var Et=bt,wt=s.forEach,_t=s.bind;function At(e,t){this.model=e,this.properties=t}var St=At;At.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Et.prototype);wt(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 a(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),wt(e,_t(function(e,t){this.set(t,e)},this))}return a.prototype=i,a.hasType=i.$instanceOf=this.model.hasType,n.defineModel(a,t),n.defineDescriptor(a,e),a};var Ct={};function Rt(e){this.model=e}Ct.parseName=function(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}};var Mt=Rt;function kt(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}Rt.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:kt(e,i,n):e.$attrs[t]=n},Rt.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&&kt(e,n,[]),e[i]},Rt.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},Rt.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Rt.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};var Pt=s.pick,Tt=s.assign,Nt=s.forEach,Dt=s.bind,Ot=Ct.parseName;function Bt(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}var Lt=Bt;Bt.prototype.build=function(){return Pt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Bt.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)},Bt.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,a=this.propertiesByName,o=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,o),a[i.name]=a[i.localName]=t},Bt.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),a=Ot(r[0],i),o=Ot(r[1],a.prefix).name,s=this.propertiesByName[o];if(!s)throw new Error("refined property <"+o+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Bt.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},Bt.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Bt.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},Bt.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},Bt.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")},Bt.prototype.hasProperty=function(e){return this.propertiesByName[e]},Bt.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(Nt(e.properties,Dt(function(n){n=Tt({},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)};var It={},jt={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ft={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};It.coerceType=function(e,t){var n=Ft[e];return n?n(t):t},It.isBuiltIn=function(e){return!!jt[e]},It.isSimple=function(e){return!!Ft[e]};var Vt=s.assign,Wt=s.forEach,zt=s.bind,Gt=Ct.parseName,$t=It.isBuiltIn;function Ht(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,Wt(e,zt(this.registerPackage,this))}var Kt=Ht;function Ut(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}Ht.prototype.getPackage=function(e){return this.packageMap[e]},Ht.prototype.getPackages=function(){return this.packages},Ht.prototype.registerPackage=function(e){e=Vt({},e);var t=this.packageMap;Ut(t,e,"prefix"),Ut(t,e,"uri"),Wt(e.types,zt(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Ht.prototype.registerType=function(e,t){e=Vt({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:Vt(e.meta||{})});var n=Gt(e.name,t.prefix),i=n.name,r={};Wt(e.properties,zt(function(e){var t=Gt(e.name,n.prefix),i=t.name;$t(e.type)||(e.type=Gt(e.type,t.prefix).name),Vt(e,{ns:t,name:i}),r[i]=e},this)),Vt(e,{ns:n,name:i,propertiesByName:r}),Wt(e.extends,zt(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Ht.prototype.mapTypes=function(e,t,n){var i=$t(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function a(e){return o(e,!0)}function o(n,i){var a=Gt(n,$t(n)?"":e.prefix);r.mapTypes(a,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");Wt(i.superClass,n?a:o),t(i,!n),Wt(i.traits,a)},Ht.prototype.getEffectiveDescriptor=function(e){var t=Gt(e),n=new Lt(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},Ht.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};var qt=s.isString,Yt=s.isObject,Xt=s.forEach,Zt=Ct.parseName;function Jt(e){this.properties=new Mt(this),this.factory=new St(this,this.properties),this.registry=new Kt(e,this.properties),this.typeCache={}}var Qt=Jt;Jt.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Jt.prototype.getType=function(e){var t=this.typeCache,n=qt(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Jt.prototype.createAny=function(e,t,n){var i=Zt(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},a={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,a),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),Xt(n,function(e,t){Yt(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e}),r},Jt.prototype.getPackage=function(e){return this.registry.getPackage(e)},Jt.prototype.getPackages=function(){return this.registry.getPackages()},Jt.prototype.getElementDescriptor=function(e){return e.$descriptor},Jt.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Jt.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Jt.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var en=Qt,tn={exports:{}};!function(e,t){"object"==typeof tn.exports?t(tn.exports):t(e.Saxen={})}(this,function(e){"use strict";var t=String.fromCharCode,n=Object.prototype.hasOwnProperty,i=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,r={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function a(e,i,a,o){return o?n.call(r,o)?r[o]:"&"+o+";":t(i||parseInt(a,16))}function o(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(i,a):e}Object.keys(r).forEach(function(e){r[e.toUpperCase()]=r[e]});var s="http://www.w3.org/2001/XMLSchema-instance",p="xsi",l="xsi:type";function c(e){return new Error(e)}function u(e){return"missing namespace for prefix <"+e+">"}function h(e){return{get:e,enumerable:!0}}function m(e){var t,n={};for(t in e)n[t]=e[t];return n}function f(e){return e+"$uri"}function d(){return{line:0,column:0}}function y(e){throw e}e.Parser=function e(t){if(!this)return new e(t);var n,i,r,a,g,v,x,b,E,w=t&&t.proxy,_=y,A=d,S=!1,C=!1,R=null,M=!1;function k(e){e instanceof Error||(e=c(e)),R=e,_(e,A)}function P(e){g&&(e instanceof Error||(e=c(e)),g(e,A))}this.on=function(e,t){if("function"!=typeof t)throw c("required args <name, cb>");switch(e){case"openTag":i=t;break;case"text":n=t;break;case"closeTag":r=t;break;case"error":_=t;break;case"warn":g=t;break;case"cdata":a=t;break;case"attention":b=t;break;case"question":x=t;break;case"comment":v=t;break;default:throw c("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw c("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n[s]=p,C=!0,E=n,this},this.parse=function(e){if("string"!=typeof e)throw c("required args <xml=string>");return R=null,function(e){var t,s,p,c,d,y,g,_,R,T,N=C?[]:null,D=C?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[f(n)]=t;return i}(E):null,O=[],B=0,L=!1,I=!1,j=0,F=0,V="",W=0;function z(){if(null!==T)return T;var e,t,n,i,r,a,s,p,c,h,d,y=C&&D.xmlns,g=C&&S?[]:null,v=W,x=V,b=x.length,w={},_={};e:for(;v<b;v++)if(c=!1,!(32===(h=x.charCodeAt(v))||h<14&&h>8)){for((h<65||h>122||h>90&&h<97)&&95!==h&&58!==h&&(P("illegal first char attribute name"),c=!0),d=v+1;d<b;d++)if(!((h=x.charCodeAt(d))>96&&h<123||h>64&&h<91||h>47&&h<59||46===h||45===h||95===h)){if(32===h||h<14&&h>8){P("missing attribute value"),v=d;continue e}if(61===h)break;P("illegal attribute name char"),c=!0}if("xmlns:xmlns"===(p=x.substring(v,d))&&(P("illegal declaration of xmlns"),c=!0),34===(h=x.charCodeAt(d+1)))-1===(d=x.indexOf('"',v=d+2))&&-1!==(d=x.indexOf("'",v))&&(P("attribute value quote missmatch"),c=!0);else if(39===h)-1===(d=x.indexOf("'",v=d+2))&&-1!==(d=x.indexOf('"',v))&&(P("attribute value quote missmatch"),c=!0);else for(P("missing attribute value quotes"),c=!0,d+=1;d<b&&!(32===(h=x.charCodeAt(d+1))||h<14&&h>8);d++);for(-1===d&&(P("missing closing quotes"),d=b,c=!0),c||(a=x.substring(v,d)),v=d;d+1<b&&!(32===(h=x.charCodeAt(d+1))||h<14&&h>8);d++)v===d&&(P("illegal character after attribute end"),c=!0);if(v=d+1,!c)if(p in _)P("attribute <"+p+"> already defined");else if(_[p]=!0,C)if(S){if(null!==(r="xmlns"===p?"xmlns":120===p.charCodeAt(0)&&"xmlns:"===p.substr(0,6)?p.substr(6):null)){if(e=o(a),t=f(r),!(s=E[e])){if("xmlns"===r||t in D&&D[t]!==e)do{s="ns"+B++}while(void 0!==D[s]);else s=r;E[e]=s}D[r]!==s&&(i||(D=m(D),i=!0),D[r]=s,"xmlns"===r&&(D[f(s)]=e,y=s),D[t]=e),w[p]=a;continue}g.push(p,a)}else-1!==(h=p.indexOf(":"))?(n=D[p.substring(0,h)])?((p=y===n?p.substr(h+1):n+p.substr(h))===l&&(-1!==(h=a.indexOf(":"))?(n=a.substring(0,h),n=D[n]||n,a=n+a.substring(h)):a=y+":"+a),w[p]=a):P(u(p.substring(0,h))):w[p]=a;else w[p]=a}if(S)for(v=0,b=g.length;v<b;v++){if(p=g[v++],a=g[v],-1!==(h=p.indexOf(":"))){if(!(n=D[p.substring(0,h)])){P(u(p.substring(0,h)));continue}(p=y===n?p.substr(h+1):n+p.substr(h))===l&&(-1!==(h=a.indexOf(":"))?(n=a.substring(0,h),n=D[n]||n,a=n+a.substring(h)):a=y+":"+a)}w[p]=a}return T=w}for(A=function(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,a=0,o=0,s=F;j>=o&&(t=i.exec(e))&&!((s=t[0].length+t.index)>j);)r+=1,o=s;return-1==j?(a=s,n=""):(a=j-o,n=-1==F?e.substring(j):e.substring(j,F+1)),{data:n,line:r,column:a}},w&&(R=Object.create({},{name:h(function(){return g}),originalName:h(function(){return _}),attrs:h(z),ns:h(function(){return D})}));-1!==F;){if(-1===(j=60===e.charCodeAt(F)?F:e.indexOf("<",F)))return O.length?k("unexpected end of file"):0===F?k("missing start tag"):void 0;if(F!==j&&n&&(n(e.substring(F,j),o,A),M))return;if(33!==(d=e.charCodeAt(j+1)))if(63!==d){if(-1==(F=e.indexOf(">",j+1)))return k("unclosed tag");if(T={},47===d){if(L=!1,I=!0,!O.length)return k("missing open tag");if(s=g=O.pop(),c=j+2+s.length,e.substring(j+2,c)!==s)return k("closing tag mismatch");for(;c<F;c++)if(!(32===(d=e.charCodeAt(c))||d>8&&d<14))return k("close tag")}else{if(47===e.charCodeAt(F-1)?(s=g=e.substring(j+1,F-1),L=!0,I=!0):(s=g=e.substring(j+1,F),L=!0,I=!1),!(d>96&&d<123||d>64&&d<91||95===d||58===d))return k("illegal first char nodeName");for(c=1,p=s.length;c<p;c++)if(!((d=s.charCodeAt(c))>96&&d<123||d>64&&d<91||d>47&&d<59||45===d||95===d)){if(32===d||d<14&&d>8){g=s.substring(0,c),T=null;break}return k("invalid nodeName")}I||O.push(g)}if(C){if(t=D,L&&(I||N.push(t),null===T&&(S=-1!==s.indexOf("xmlns",c))&&(W=c,V=s,z(),S=!1)),_=g,-1!==(d=g.indexOf(":"))){if(!(y=D[g.substring(0,d)]))return k("missing namespace on <"+_+">");g=g.substr(d+1)}else y=D.xmlns;y&&(g=y+":"+g)}if(L&&(W=c,V=s,i&&(w?i(R,o,I,A):i(g,z,o,I,A),M)))return;if(I){if(r&&(r(w?R:g,o,L,A),M))return;C&&(D=L?t:N.pop())}F+=1}else{if(-1===(F=e.indexOf("?>",j)))return k("unclosed question");if(x&&(x(e.substring(j,F+2),A),M))return;F+=2}else{if(91===(d=e.charCodeAt(j+2))&&"CDATA["===e.substr(j+3,6)){if(-1===(F=e.indexOf("]]>",j)))return k("unclosed cdata");if(a&&(a(e.substring(j+9,F),A),M))return;F+=3;continue}if(45===d&&45===e.charCodeAt(j+3)){if(-1===(F=e.indexOf("--\x3e",j)))return k("unclosed comment");if(v&&(v(e.substring(j+4,F),o,A),M))return;F+=3;continue}if(-1===(F=e.indexOf(">",j+1)))return k("unclosed tag");if(b&&(b(e.substring(j,F+1),o,A),M))return;F+=1}}}(e),A=d,M=!1,R},this.stop=function(){M=!0}},Object.defineProperty(e,"__esModule",{value:!0})}),tn=tn.exports;var nn={};!function(e){"use strict";function t(){this.data=[null],this.top=0}function n(){return new t}t.prototype.clear=function(){return this.data=[null],this.top=0,this},t.prototype.length=function(){return this.top},t.prototype.peek=function(){return this.data[this.top]},t.prototype.pop=function(){return this.top>0?(this.top--,this.data.pop()):void 0},t.prototype.push=function(e){return this.data[++this.top]=e,this},void 0!==nn?nn=n:e.stack=n}(this);var rn={},an=s.forEach,on=s.find,sn=s.assign,pn=tn.Parser,ln=Ct.parseName,cn=It.coerceType,un=It.isSimple,hn=gt.XSI_TYPE,mn=gt.serializeAsType,fn=gt.hasLowerCaseAlias;function dn(e,t){return fn(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function yn(e){return new Error(e)}function gn(e){return e.$descriptor}function vn(){}function xn(){}function bn(){}function En(e,t){this.property=e,this.context=t}function wn(e,t){this.element=t,this.propertyDesc=e}function _n(){}function An(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Sn(e,t,n){An.call(this,e,t,n)}function Cn(e,t,n){this.model=e,this.context=n}function Rn(e){e instanceof en&&(e={model:e}),sn(this,{lax:!1},e)}vn.prototype.handleEnd=function(){},vn.prototype.handleText=function(){},vn.prototype.handleNode=function(){},xn.prototype=Object.create(vn.prototype),xn.prototype.handleNode=function(){return this},bn.prototype=Object.create(vn.prototype),bn.prototype.handleText=function(e){this.body=(this.body||"")+e},En.prototype=Object.create(bn.prototype),En.prototype.handleNode=function(e){if(this.element)throw yn("expected no sub nodes");return this.element=this.createReference(e),this},En.prototype.handleEnd=function(){this.element.id=this.body},En.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},wn.prototype=Object.create(bn.prototype),wn.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=cn(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},_n.prototype=Object.create(bn.prototype),_n.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},An.prototype=Object.create(_n.prototype),An.prototype.addReference=function(e){this.context.addReference(e)},An.prototype.handleEnd=function(){var e=this.body,t=this.element,n=gn(t).bodyProperty;n&&void 0!==e&&(e=cn(n.type,e),t.set(n.name,e))},An.prototype.createElement=function(e){var t=e.attributes,n=this.type,i=gn(n),r=this.context,a=new n({});return an(t,function(e,t){var n,o=i.propertiesByName[t];o&&o.isReference?o.isMany?(n=e.split(" "),an(n,function(e){r.addReference({element:a,property:o.ns.name,id:e})})):r.addReference({element:a,property:o.ns.name,id:e}):(o&&(e=cn(o.type,e)),a.set(t,e))}),a},An.prototype.getPropertyForNode=function(e){var t,n,i=e.name,r=ln(i),a=this.type,o=this.model,s=gn(a),p=r.name,l=s.propertiesByName[p];if(l)return mn(l)&&(t=e.attributes[hn])?(t=function(e,t){var n=ln(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),n=o.getType(t),sn({},l,{effectiveType:gn(n).name})):l;var c=o.getPackage(r.prefix);if(c){if(t=dn(r,c),n=o.getType(t),l=on(s.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return sn({},l,{effectiveType:gn(n).name})}else if(l=on(s.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return l;throw yn("unrecognized element <"+r.name+">")},An.prototype.toString=function(){return"ElementDescriptor["+gn(this.type).name+"]"},An.prototype.valueHandler=function(e,t){return new wn(e,t)},An.prototype.referenceHandler=function(e){return new En(e,this.context)},An.prototype.handler=function(e){return"Element"===e?new Cn(this.model,e,this.context):new An(this.model,e,this.context)},An.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,n=t.effectiveType||t.type,un(n))return this.valueHandler(t,i);var a=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==a&&(t.isMany?i.get(t.name).push(a):i.set(t.name,a),t.isReference?(sn(a,{element:i}),this.context.addReference(a)):a.$parent=i),r},Sn.prototype=Object.create(An.prototype),Sn.prototype.createElement=function(e){var t=e.name,n=ln(t),i=this.model,r=this.type,a=i.getPackage(n.prefix),o=a&&dn(n,a)||t;if(!r.hasType(o))throw yn("unexpected element <"+e.originalName+">");return An.prototype.createElement.call(this,e)},Cn.prototype=Object.create(_n.prototype),Cn.prototype.createElement=function(e){var t=e.name,n=ln(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Cn.prototype.handleChild=function(e){var t=new Cn(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},Cn.prototype.handleText=function(e){this.body=this.body||""+e},Cn.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Rn.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof An?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,a=this.lax,o=new function(e){sn(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw yn("expected element");var t,n=this.elementsById,i=gn(e).idProperty;if(i&&(t=e.get(i.name))){if(n[t])throw yn("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}(sn({},t,{rootHandler:i})),s=new pn({proxy:!0}),p=new nn;function l(e,t,n){var i=t(),r=i.line,a=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var p="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+a+"\n\tnested error: "+e.message;if(n)return o.addWarning({message:p,error:e}),console.warn("could not parse node"),console.warn(e),!0;throw console.error("could not parse document"),console.error(e),yn(p)}i.context=o,p.push(i);var c=/^<\?xml /i,u=/ encoding="([^"]+)"/i,h=/^utf-8$/i;var m=r.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});s.ns(m).on("openTag",function(e,t,n,i){var r=e.attrs||{},o=Object.keys(r).reduce(function(e,n){var i=t(r[n]);return e[n]=i,e},{});!function(e,t){var n=p.peek();try{p.push(n.handleNode(e))}catch(e){l(e,t,a)&&p.push(new xn)}}({name:e.name,originalName:e.originalName,attributes:o,ns:e.ns},i)}).on("question",function(e){if(c.test(e)){var t=u.exec(e),n=t&&t[1];n&&!h.test(n)&&o.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){p.pop().handleEnd()}).on("cdata",function(e){p.peek().handleText(e)}).on("text",function(e,t){!function(e){(e=e.trim())&&p.peek().handleText(e)}(t(e))}).on("error",l).on("warn",function(e,t){return l(e,t,!0)}),setTimeout(function(){var t;try{s.parse(e),function(){var e,t,n=o.elementsById,i=o.references;for(e=0;t=i[e];e++){var r=t.element,a=n[t.id],s=gn(r).propertiesByName[t.property];if(a||o.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var p=r.get(s.name),l=p.indexOf(t);-1===l&&(l=p.length),a?p[l]=a:p.splice(l,1)}else r.set(s.name,a)}}()}catch(e){t=e}var r=i.element;t||r||(t=yn("failed to parse document as <"+i.type.$descriptor.name+">")),n(t,t?void 0:r,o)},0)},Rn.prototype.handler=function(e){return new Sn(this.model,e)},(rn=Rn).ElementHandler=An;var Mn=s.map,kn=s.forEach,Pn=s.isString,Tn=s.filter,Nn=s.assign,Dn=Ct.parseName,On=gt.hasLowerCaseAlias,Bn=gt.serializeAsType,Ln=gt.serializeAsProperty,In='<?xml version="1.0" encoding="UTF-8"?>\n',jn=/<|>|'|"|&|\n\r|\n/g,Fn=/<|>|&/g,Vn=gt.DEFAULT_NS_MAP,Wn=gt.XSI_TYPE;function zn(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Gn(e){return Pn(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function $n(e,t){return t.isGeneric?Nn({localName:t.ns.localName},e):Nn({localName:(n=t.ns.localName,i=t.$pkg,On(i)?(r=n).charAt(0).toLowerCase()+r.slice(1):n)},e);var n,i,r}var Hn={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Kn={"<":"lt",">":"gt","&":"amp"};function Un(e,t,n){return(e=Pn(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function qn(e){this.tagName=e}function Yn(){}function Xn(e){this.tagName=e}function Zn(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Jn(e,t){Zn.call(this,e,t)}qn.prototype.build=function(e){return this.element=e,this},qn.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Yn.prototype.serializeValue=Yn.prototype.serializeTo=function(e){e.append(this.escape?Un(this.value,Fn,Kn):this.value)},Yn.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Fn)&&(this.escape=!0),this},zn(Xn,Yn),Xn.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Zn.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,a=i.isGeneric;return t=a?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),a||(n=function(e){var t=e.$descriptor;return Tn(t.properties,function(t){var n=t.name;if(t.isVirtual)return!1;if(!e.hasOwnProperty(n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)})}(e),this.parseAttributes(Tn(n,function(e){return e.isAttr})),this.parseContainments(function(e){return Tn(e,function(e){return!e.isAttr})}(n))),this.parseGenericAttributes(e,t),this},Zn.prototype.nsTagName=function(e){return $n(this.logNamespaceUsed(e.ns),e)},Zn.prototype.nsPropertyTagName=function(e){return function(e,t){return Nn({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Zn.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Zn.prototype.nsAttributeName=function(e){var t;if(t=Pn(e)?Dn(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}:Nn({localName:t.localName},n)},Zn.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return kn(e,function(r,a){"$body"===a?n.push((new Yn).build({type:"String"},r)):"$children"===a?kn(r,function(e){n.push(new Zn(t).build(e))}):0!==a.indexOf("$")&&t.parseNsAttribute(e,a,r)&&i.push({name:a,value:r})}),i},Zn.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,a=Dn(t);if("xmlns"===a.prefix&&(i={prefix:a.localName,uri:n}),a.prefix||"xmlns"!==a.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var o=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(o)}},Zn.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return kn(i,function(t,i){var a=n.parseNsAttribute(e,i,t);a&&r.push(a)}),r},Zn.prototype.parseGenericAttributes=function(e,t){var n=this;kn(t,function(t){if(t.name!==Wn)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}})},Zn.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;kn(e,function(e){var r=i.get(e.name),a=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Yn).build(e,r[0]));else if(It.isSimple(e.type))kn(r,function(i){n.push(new Xn(t.addTagName(t.nsPropertyTagName(e))).build(e,i))});else if(a)kn(r,function(i){n.push(new qn(t.addTagName(t.nsPropertyTagName(e))).build(i))});else{var o=Bn(e),s=Ln(e);kn(r,function(i){var r;r=o?new Jn(t,e):s?new Zn(t,e):new Zn(t),n.push(r.build(i))})}})},Zn.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new function(e){var t={},n={},i={},r=[],a=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):a.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.logUsed=function(e){var t=e.uri;i[t]=this.byUri(t)},this.getUsed=function(e){return[].concat(r,a).filter(function(e){return i[e.uri]})}}(t):n=t),n},Zn.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,a=e.prefix;return i.byUri(r)||i.add(e,t),i.mapPrefix(a,r),e},Zn.prototype.logNamespaceUsed=function(e,t){var n,i,r,a=this.element.$model,o=this.getNamespaces(t),s=e.prefix,p=e.uri;if(!s&&!p)return{localName:e.localName};if(r=Vn[s]||a&&(a.getPackage(s)||{}).uri,!(p=p||r||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=o.byUri(p))){for(n=s,i=1;o.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:p},r===p)}return s&&o.mapPrefix(s,p),e},Zn.prototype.parseAttributes=function(e){var t=this,n=this.element;kn(e,function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];kn(i,function(e){r.push(e.id)}),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)})},Zn.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Gn(e)},Zn.prototype.addAttribute=function(e,t){var n=this.attrs;Pn(t)&&(t=Un(t,jn,Hn)),n.push({name:e,value:t})},Zn.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return Mn(e.getUsed(),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})}(n).concat(t)),kn(t,function(t){e.append(" ").append(Gn(t.name)).append('="').append(t.value).append('"')})},Zn.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Yn;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),kn(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},zn(Jn,Zn),Jn.prototype.parseNsAttributes=function(e){var t=Zn.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),a=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Wn),(i.prefix?i.prefix+":":"")+a+n.ns.localName),t},Jn.prototype.isLocalNs=function(e){return e.uri===this.typeNs.uri};var Qn=function(e){return e=Nn({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new function(){this.value="",this.write=function(e){this.value+=e}},r=new function(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}}(i,e.format);if(e.preamble&&r.append(In),(new Zn).build(t).serializeTo(r),!n)return i.value}}},ei=s.isString,ti=s.isFunction,ni=s.assign;function ii(e,t){en.call(this,e,t)}ii.prototype=Object.create(en.prototype);var ri=ii;ii.prototype.fromXML=function(e,t,n,i){ei(t)||(i=n,n=t,t="bpmn:Definitions"),ti(n)&&(i=n,n={});var r=new rn(ni({model:this,lax:!0},n)),a=r.handler(t);r.fromXML(e,a,i)},ii.prototype.toXML=function(e,t,n){ti(t)&&(n=t,t={});var i,r,a=new Qn(t);try{i=a.toXML(e)}catch(e){r=e}return n(r,i)};var ai=s.assign,oi={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",type:"String",isAttr:!0}]},{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",type:"String",isAttr:!0}]},{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",type:"LaneSet",isMany:!0,replaces:"FlowElementsContainer#laneSets"},{name:"flowElements",type:"FlowElement",isMany:!0,replaces:"FlowElementsContainer#flowElements"},{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:"assignment",type:"Assignment",isMany:!0},{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isVirtual:!0,isMany:!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",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isVirtual:!0,isMany:!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:"participantRefs",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",type:"String",isBody:!0}]},{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",type:"String",isAttr:!0},{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",isVirtual:!0,isMany:!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",isVirtual:!0,isMany:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isVirtual:!0,isMany:!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"}]},{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:"participantRefs",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:["FlowElementsContainer","Collaboration"]},{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",isVirtual:!0,isMany:!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:"Expression",xml:{serialize:"xsi:type"}}]},{name:"CallActivity",superClass:["Activity"],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}]},{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"}]}],prefix:"bpmn",xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",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:[],prefix:"bpmndi"},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/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}]}],prefix:"dc",associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",type:"String",isAttr:!0,isId:!0},{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,isVirtual:!0,isMany:!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",type:"String",isAttr:!0,isId:!0},{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,isVirtual:!0,isMany:!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",isVirtual:!0,isMany:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isVirtual:!0,isMany:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",type:"String",isAttr:!0,isId:!0}]},{name:"Extension",properties:[{name:"values",type:"Element",isMany:!0}]}],associations:[],prefix:"di",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:[]}},si=function(e,t){return new ri(ai({},oi,e),t)},pi={remove:function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n},add: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)}}},li={},ci=s.isArray,ui=(s.isNumber,s.groupBy,s.forEach);function hi(e,t){var n,i,r,a;return t=!!t,ci(e)||(e=[e]),ui(e,function(e){var o=e;e.waypoints&&!t&&(o=hi(e.waypoints,!0));var s=o.x,p=o.y,l=o.height||0,c=o.width||0;(s<n||void 0===n)&&(n=s),(p<i||void 0===i)&&(i=p),(s+c>r||void 0===r)&&(r=s+c),(p+l>a||void 0===a)&&(a=p+l)}),{x:n,y:i,height:a-i,width:r-n}}li.getBBox=hi,li.getType=function(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"};var mi=s.isNumber,fi=s.assign,di=s.forEach,yi=s.every,gi=s.debounce,vi=s.bind,xi=s.reduce,bi=n.append,Ei=n.attr,wi=n.classes,_i=n.create,Ai=n.transform,Si=n.createMatrix;function Ci(e,t){return Math.round(e*t)/t}function Ri(e){return mi(e)?e+"px":e}function Mi(e,t,n){var i=_i("g");wi(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]),i}var ki={shape:["x","y","width","height"],connection:["waypoints"]};function Pi(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}Pi.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];var Ti=Pi;function Ni(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Pi.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=fi({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),fi(n.style,{position:"relative",overflow:"hidden",width:Ri(e.width),height:Ri(e.height)}),t.appendChild(n),n}(e),i=this._svg=_i("svg");Ei(i,{width:"100%",height:"100%"}),bi(n,i);var r=this._viewport=Mi(i,"viewport");this._layers={},!1!==e.deferUpdate&&(this._viewboxChanged=gi(vi(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"],function(){delete this._cachedViewbox},this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Pi.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._rootElement,delete this._viewport},Pi.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=li.getType(t);"root"===n?e.setRootElement(null,!0):e._removeElement(t,n)}),delete this._cachedViewbox},Pi.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Pi.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},Pi.prototype._createLayer=function(e,t){t||(t=0);var n=xi(this._layers,function(e,n){return t>=n.index&&e++,e},0);return{group:Mi(this._viewport,"layer-"+e,n),index:t}},Pi.prototype.getContainer=function(){return this._container},Pi.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(di([i.gfx,i.secondaryGfx],function(e){e&&(n?wi(e).add(t):wi(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Pi.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Pi.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Pi.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));var n=this.getGraphics(e);return wi(n).has(t)},Pi.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Pi.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},Pi.prototype.setRootElement=function(e,t){e&&this._ensureValid("root",e);var n=this._rootElement,i=this._elementRegistry,r=this._eventBus;if(n){if(!t)throw new Error("rootElement already set, need to specify override");r.fire("root.remove",{element:n}),r.fire("root.removed",{element:n}),i.remove(n)}if(e){var a=this.getDefaultLayer();r.fire("root.add",{element:e}),i.add(e,a,this._svg),r.fire("root.added",{element:e,gfx:a})}return this._rootElement=e,e},Pi.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 with id "+t.id+" already exists");var n=ki[e];if(!yi(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},Pi.prototype._setParent=function(e,t,n){pi.add(t.children,e,n),e.parent=t},Pi.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,a=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var o=a.create(e,t,i);return this._elementRegistry.add(t,o),a.update(e,t,o),r.fire(e+".added",{element:t,gfx:o}),t},Pi.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Pi.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Pi.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),pi.remove(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Pi.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Pi.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Pi.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Pi.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Pi.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Pi.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,a,o,s=this._viewport,p=this.getSize();return e?(this._changeViewbox(function(){r=Math.min(p.width/e.width,p.height/e.height);var t=this._svg.createSVGMatrix().scale(r).translate(-e.x,-e.y);Ai(s,t)}),e):(t=this.getDefaultLayer().getBBox(),n=(i=Ai(s))?i.matrix:Si(),r=Ci(n.a,1e3),a=Ci(-n.e||0,1e3),o=Ci(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/r:0,y:o?o/r:0,width:p.width/r,height:p.height/r,scale:r,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:p})},Pi.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=fi({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Ni(t,n)}),{x:n.e,y:n.f}},Pi.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)}),Ci(i.a,1e3)):this.viewbox(e).scale;var n,i},Pi.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,a=i.inner;return a.x>=0&&a.y>=0&&a.x+a.width<=r.width&&a.y+a.height<=r.height&&!e?n={x:0,y:0,width:Math.max(a.width+a.x,r.width),height:Math.max(a.height+a.y,r.height)}:(t=Math.min(1,r.width/a.width,r.height/a.height),n={x:a.x+(e?a.width/2-r.width/t/2:0),y:a.y+(e?a.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},Pi.prototype._setZoom=function(e,t){var n,i,r,a,o=this._svg,s=this._viewport,p=o.createSVGMatrix(),l=o.createSVGPoint(),c=(i=s.getCTM()).a;return t?(n=fi(l,t).matrixTransform(i.inverse()),r=p.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),a=i.multiply(r)):a=p.scale(e),Ni(this._viewport,a),a},Pi.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Pi.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}},Pi.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Di={},Oi=s.assign,Bi=new tt({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Li=new tt({name:"label",enumerable:!0},{name:"labelTarget"}),Ii=new tt({name:"attachers",collection:!0},{name:"host"}),ji=new tt({name:"outgoing",collection:!0},{name:"source"}),Fi=new tt({name:"incoming",collection:!0},{name:"target"});function Vi(){Object.defineProperty(this,"businessObject",{writable:!0}),Bi.bind(this,"parent"),Li.bind(this,"label"),ji.bind(this,"outgoing"),Fi.bind(this,"incoming")}function Wi(){Vi.call(this),Bi.bind(this,"children"),Ii.bind(this,"host"),Ii.bind(this,"attachers")}function zi(){Wi.call(this)}function Gi(){Wi.call(this),Li.bind(this,"labelTarget")}function $i(){Vi.call(this),ji.bind(this,"source"),Fi.bind(this,"target")}H(Wi,Vi),H(zi,Wi),H(Gi,Wi),H($i,Vi);var Hi={connection:$i,shape:Wi,label:Gi,root:zi};Di.create=function(e,t){var n=Hi[e];if(!n)throw new Error("unknown type: <"+e+">");return Oi(new n,t)};var Ki=s.assign;function Ui(){this._uid=12}var qi=Ui;Ui.prototype.createRoot=function(e){return this.create("root",e)},Ui.prototype.createLabel=function(e){return this.create("label",e)},Ui.prototype.createShape=function(e){return this.create("shape",e)},Ui.prototype.createConnection=function(e){return this.create("connection",e)},Ui.prototype.create=function(e,t){return(t=Ki({},t||{})).id||(t.id=e+"_"+this._uid++),Di.create(e,t)};var Yi="data-element-id",Xi=n.attr;function Zi(e){this._elements={},this._eventBus=e}Zi.$inject=["eventBus"];var Ji=Zi;Zi.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),Xi(t,Yi,i),n&&Xi(n,Yi,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Zi.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(Xi(i.gfx,Yi,""),i.secondaryGfx&&Xi(i.secondaryGfx,Yi,""),delete t[n])},Zi.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)},Zi.prototype.get=function(e){var t;t="string"==typeof e?e:e&&Xi(e,Yi);var n=this._elements[t];return n&&n.element},Zi.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Zi.prototype.getAll=function(){return this.filter(function(e){return e})},Zi.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,a=i.gfx;return e(r,a)})},Zi.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Zi.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 Qi=s.isFunction,er=s.isArray,tr=s.isNumber,nr=s.bind,ir=s.assign,rr=Array.prototype.slice;function ar(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}var or=ar;function sr(){}ar.prototype.on=function(e,t,n,i){if(e=er(e)?e:[e],Qi(t)&&(i=n,n=t,t=1e3),!tr(t))throw new Error("priority must be a number");var r=n;i&&((r=nr(n,i)).__fn=n.__fn||n);var a=this,o={priority:t,callback:r};e.forEach(function(e){a._addListener(e,o)})},ar.prototype.once=function(e,t,n,i){var r=this;if(Qi(t)&&(i=n,n=t,t=1e3),!tr(t))throw new Error("priority must be a number");function a(){return r.off(e,a),n.apply(i,arguments)}a.__fn=n,this.on(e,t,a)},ar.prototype.off=function(e,t){var n,i,r,a=this._getListeners(e);if(t)for(r=a.length-1;n=a[r];r--)(i=n.callback)!==t&&i.__fn!==t||a.splice(r,1);else a.length=0},ar.prototype.createEvent=function(e){var t=new sr;return t.init(e),t},ar.prototype.fire=function(e,t){var n,i,r,a;if(a=rr.call(arguments),"object"==typeof e&&(e=(n=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof sr?t:this.createEvent(t),a[0]=n;var o=n.type;e!==o&&(n.type=e);try{r=this._invokeListeners(n,a,i)}finally{e!==o&&(n.type=o)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},ar.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},ar.prototype._destroy=function(){this._listeners={}},ar.prototype._invokeListeners=function(e,t,n){var i,r,a;for(i=0;(r=n[i])&&!e.cancelBubble;i++)a=this._invokeListener(e,t,r);return a},ar.prototype._invokeListener=function(e,t,n){var i;try{void 0!==(i=function(e,t){return e.apply(null,t)}(n.callback,t))&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener"),console.error(e.stack),e}return i},ar.prototype._addListener=function(e,t){var n,i,r=this._getListeners(e);for(i=0;n=r[i];i++)if(n.priority<t.priority)return void r.splice(i,0,t);r.push(t)},ar.prototype._getListeners=function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t},sr.prototype.stopPropagation=function(){this.cancelBubble=!0},sr.prototype.preventDefault=function(){this.defaultPrevented=!0},sr.prototype.init=function(e){ir(this,e||{})};var pr={},lr=K.query;pr.getVisual=function(e){return lr(".djs-visual",e)},pr.getChildren=function(e){return e.parentNode.childNodes[1]};var cr=s.forEach,ur=s.reduce,hr=E.translate,mr=K.clear,fr=n.append,dr=n.attr,yr=n.classes,gr=n.create,vr=n.remove;function xr(e,t){this._eventBus=e,this._elementRegistry=t}xr.$inject=["eventBus","elementRegistry"];var br=xr;function Er(e,t,n){t.insertBefore(e,n||t.firstChild)}xr.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=pr.getChildren(n))||(t=gr("g"),yr(t).add("djs-children"),fr(n.parentNode,t)):t=n,t},xr.prototype._clear=function(e){var t=pr.getVisual(e);return mr(t),t},xr.prototype._createContainer=function(e,t,n){var i=gr("g");yr(i).add("djs-group"),void 0!==n?Er(i,t,t.childNodes[n]):fr(t,i);var r=gr("g");yr(r).add("djs-element"),yr(r).add("djs-"+e),fr(i,r);var a=gr("g");return yr(a).add("djs-visual"),fr(r,a),r},xr.prototype.create=function(e,t,n){var i=this._getChildren(t.parent);return this._createContainer(e,i,n)},xr.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=ur(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),cr(t,function(e){var t=e.children;if(t){var r=n._getChildren(e);cr(t.slice().reverse(),function(e){Er(i.getGraphics(e).parentNode,r)})}})},xr.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},xr.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},xr.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},xr.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},xr.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),hr(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?dr(n,"display","none"):dr(n,"display","block")}},xr.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);vr(t.parentNode)};var wr=i.componentsToPath,_r=i.createLine,Ar=n.append,Sr=n.attr,Cr=n.create,Rr=1;function Mr(e,t){b.call(this,e,Rr),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2})}H(Mr,b),Mr.prototype.canRender=function(){return!0},Mr.prototype.drawShape=function(e,t){var n=Cr("rect");return Sr(n,{x:0,y:0,width:t.width||0,height:t.height||0}),Sr(n,this.SHAPE_STYLE),Ar(e,n),n},Mr.prototype.drawConnection=function(e,t){var n=_r(t.waypoints,this.CONNECTION_STYLE);return Ar(e,n),n},Mr.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width,r=e.height;return wr([["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]])},Mr.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 wr(r)},Mr.$inject=["eventBus","styles"];var kr=Mr,Pr=s.isArray,Tr=s.assign,Nr=s.reduce;var Dr={__depends__:[{__init__:["defaultRenderer"],defaultRenderer:["type",kr],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){var i=this.style(t,n);return Tr(i,{class:e})},this.style=function(t,n){Pr(t)||n||(n=t,t=[]);var i=Nr(t,function(t,n){return Tr(t,e[n]||{})},{});return n?Tr(i,n):i},this.computeStyle=function(e,n,i){return Pr(n)||(i=n,n=[]),t.style(n||[],Tr({},i,e||{}))}}]}],__init__:["canvas"],canvas:["type",Ti],elementRegistry:["type",Ji],elementFactory:["type",qi],eventBus:["type",or],graphicsFactory:["type",br]},Or={exports:{}};!function(e,t){"object"==typeof Or.exports?t(Or.exports):t(e.didi={})}(this,function(e){"use strict";var t=/^class /;function n(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(){var e=Array.prototype.slice.call(arguments);1===e.length&&n(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var r=/constructor\s*[^(]*\(\s*([^)]*)\)/m,a=/^function\s*[^(]*\(\s*([^)]*)\)/m,o=/\/\*([^*]*)\*\//m;function s(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var n=e.toString().match(function(e){return t.test(e.toString())}(e)?r:a);return n&&n[1]&&n[1].split(",").map(function(e){return(n=e.match(o))?n[1].trim():e.trim()})||[]}function p(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function c(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function u(e,t){return Object.hasOwnProperty.call(e,t)}e.Injector=function e(t,r){r=r||{get:function(e,t){if(a.push(e),!1===t)return null;throw f('No provider for "'+e+'"!')}};var a=[],o=this._providers=Object.create(r._providers||null),h=this._instances=Object.create(null),m=h.injector=this,f=function(e){var t=a.join(" -> ");return a.length=0,new Error(t?e+" (Resolving: "+t+")":e)},d=function e(t,n){if(!o[t]&&-1!==t.indexOf(".")){for(var i=t.split("."),s=e(i.shift());i.length;)s=s[i.shift()];return s}if(u(h,t))return h[t];if(u(o,t)){if(-1!==a.indexOf(t))throw a.push(t),f("Cannot resolve circular dependency!");return a.push(t),h[t]=o[t][0](o[t][1]),a.pop(),h[t]}return r.get(t,n)},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e){if(!n(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=i(e.slice())}return{fn:e,dependencies:(e.$inject||s(e)).map(function(e){return u(t,e)?t[e]:d(e)})}},g=function(e){var t=y(e),n=t.dependencies,i=t.fn;return new(Function.prototype.bind.apply(i,[null].concat(c(n))))},v=function(e,t,n){var i=y(e,n),r=i.dependencies,a=i.fn;return a.call.apply(a,[t].concat(c(r)))},x=function(e){return i(function(t){return e.get(t)})},b={factory:v,type:g,value:function(e){return e}};t.forEach(function(t){function r(e,t){return"value"!==e&&n(t)&&(t=i(t.slice())),t}if(t instanceof p)t.forEach(function(e){var t=e[0],n=e[1],i=e[2];o[t]=[b[n],r(n,i),n]});else if("object"===(void 0===t?"undefined":l(t)))if(t.__exports__){var a=Object.keys(t).reduce(function(e,n){return"__"!==n.substring(0,2)&&(e[n]=t[n]),e},Object.create(null)),s=new e((t.__modules__||[]).concat([a]),m),c=i(function(e){return s.get(e)});t.__exports__.forEach(function(e){o[e]=[c,e,"private",s]})}else Object.keys(t).forEach(function(e){if("private"!==t[e][2]){var n=t[e][0],i=t[e][1];o[e]=[b[n],r(n,i),n]}else o[e]=t[e]})}),this.get=d,this.invoke=v,this.instantiate=g,this.createChild=function(t,n){if(n&&n.length){var i,r,a,s,p=Object.create(null),l=Object.create(null),c=[],u=[],h=[];for(var f in o)i=o[f],-1!==n.indexOf(f)&&("private"===i[2]?-1===(r=c.indexOf(i[3]))?(a=i[3].createChild([],n),s=x(a),c.push(i[3]),u.push(a),h.push(s),p[f]=[s,f,"private",a]):p[f]=[h[r],f,"private",u[r]]:p[f]=[i[2],i[1]],l[f]=!0),"factory"!==i[2]&&"type"!==i[2]||!i[1].$scope||n.forEach(function(e){-1!==i[1].$scope.indexOf(e)&&(p[f]=[i[2],i[1]],l[e]=!0)});n.forEach(function(e){if(!l[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),t.unshift(p)}return new e(t,m)}},Object.defineProperty(e,"__esModule",{value:!0})});var Br=(Or=Or.exports).Injector;function Lr(e){var t=[],n=[];function i(e){return t.indexOf(e)>=0}e.forEach(function e(r){i(r)||((r.__depends__||[]).forEach(e),i(r)||(function(e){t.push(e)}(r),(r.__init__||[]).forEach(function(e){n.push(e)})))});var r=new Br(t);return n.forEach(function(e){try{r["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}}),r}function Ir(e,t){this.injector=t=t||function(e){return Lr([{config:["value",e=e||{}]},Dr].concat(e.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}var jr=Ir;Ir.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Ir.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var Fr=jr;function Vr(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}var Wr=Vr;Vr.prototype.next=function(){return this._prefix+ ++this._counter};var zr=s.isArray,Gr=s.isString,$r=s.isObject,Hr=s.assign,Kr=s.forEach,Ur=s.find,qr=s.filter,Yr=s.matchPattern,Xr=K.domify,Zr=K.classes,Jr=K.attr,Qr=K.remove,ea=K.clear,ta=li.getBBox,na=new Wr("ov");function ia(e,t,n){Hr(e.style,{left:t+"px",top:n+"px"})}function ra(e,t){e.style.display=!1===t?"none":""}function aa(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}function oa(e){return void 0!==e}function sa(e,t,n,i){var r,a;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=na,this._overlayDefaults=Hr({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),a=Xr('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(a,r.firstChild),a),this._init()}sa.$inject=["config.overlays","eventBus","canvas","elementRegistry"];var pa=sa;sa.prototype.get=function(e){if(Gr(e)&&(e={id:e}),Gr(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?qr(t.overlays,Yr({type:e.type})):t.overlays.slice():[]}return e.type?qr(this._overlays,Yr({type:e.type})):e.id?this._overlays[e.id]:null},sa.prototype.add=function(e,t,n){if($r(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=Hr({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},sa.prototype.remove=function(e){var t=this.get(e)||[];zr(t)||(t=[t]);var n=this;Kr(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Qr(e.html),Qr(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)}})},sa.prototype.show=function(){ra(this._overlayRoot)},sa.prototype.hide=function(){ra(this._overlayRoot,!1)},sa.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ea(this._overlayRoot)},sa.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var a=ta(t);i=a.x,r=a.y}ia(n,i,r),Jr(e.html,"data-container-id",t.id)},sa.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,a=e.element,o=i.left,s=i.top;void 0!==i.right&&(t=a.waypoints?ta(a).width:a.width,o=-1*i.right+t);void 0!==i.bottom&&(n=a.waypoints?ta(a).height:a.height,s=-1*i.bottom+n);ia(r,o||0,s||0)},sa.prototype._createOverlayContainer=function(e){var t=Xr('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},sa.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";aa(this._overlayRoot,n)},sa.prototype._getOverlayContainer=function(e,t){var n=Ur(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},sa.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,a=e.html;a.get&&a.constructor.prototype.jquery&&(a=a.get(0)),Gr(a)&&(a=Xr(a)),n=this._getOverlayContainer(r),(t=Xr('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(a),e.type&&Zr(t).add("djs-overlay-"+e.type),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},sa.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=n&&n.minZoom,r=n&&n.maxZoom,a=e.htmlContainer,o=!0;n&&((oa(i)&&i>t.scale||oa(r)&&r<t.scale)&&(o=!1),ra(a,o)),this._updateOverlayScale(e,t)},sa.prototype._updateOverlayScale=function(e,t){var n,i,r,a=e.scale,o=e.htmlContainer,s="";!0!==a&&(!1===a?(n=1,i=1):(n=a.min,i=a.max),oa(n)&&t.scale<n&&(r=(1/t.scale||1)*n),oa(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),oa(r)&&(s="scale("+r+","+r+")"),aa(o,s)},sa.prototype._updateOverlaysVisibilty=function(e){var t=this;Kr(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},sa.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,i=t.get({element:n});Kr(i,function(e){t.remove(e.id)});var r=t._getOverlayContainer(n);if(r){Qr(r.html);var a=t._overlayContainers.indexOf(r);-1!==a&&t._overlayContainers.splice(a,1)}}),e.on("element.changed",500,function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(Kr(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&&Zr(n.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var la={__init__:["overlays"],overlays:["type",pa]},ca={};function ua(e){return e.originalEvent||e.srcEvent}ca.getOriginal=ua,ca.toPoint=function(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null};var ha={isMac:function(){return/mac/i.test(navigator.platform)}},ma={},fa=ca.getOriginal,da=ha.isMac;function ya(e){return!(fa(e)||e).button}ma.isPrimaryButton=ya,ma.hasPrimaryModifier=function(e){var t=fa(e)||e;return!!ya(e)&&(da()?t.metaKey:t.ctrlKey)};var ga=s.forEach,va=K.delegate,xa=ma.isPrimaryButton,ba=n.append,Ea=n.attr,wa=n.create,_a=K.query,Aa=i.createLine,Sa=i.updateLine;function Ca(e){return!0}var Ra=500;function Ma(e,t,n){var i=n.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15});function r(n,i,r){var a,o;(function(e,t){return!(p[e]||xa)(t)})(n,i)||(r?o=t.getGraphics(r):(a=i.delegateTarget||i.target)&&(o=a,r=t.get(o)),o&&r&&!1===e.fire(n,{element:r,gfx:o,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var a={};function o(e){return a[e]}var s={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mouseup:"element.mouseup",contextmenu:"element.contextmenu"},p={"element.contextmenu":Ca};var l="svg, .djs-element";function c(e,t,n,i){var o=a[n]=function(e){r(n,e)};i&&(p[n]=i),o.$delegate=va.bind(e,l,t,o)}function u(e,t,n){var i=o(n);i&&va.unbind(e,t,i.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,ga(s,function(e,n){u(t,n,e)})}),e.on("canvas.init",function(e){var t;t=e.svg,ga(s,function(e,n){c(t,n,e)})}),e.on(["shape.added","connection.added"],function(e){var t,n=e.element,r=e.gfx;n.waypoints?t=Aa(n.waypoints):(t=wa("rect"),Ea(t,{x:0,y:0,width:n.width,height:n.height})),Ea(t,i),ba(r,t)}),e.on("shape.changed",Ra,function(e){var t=e.element,n=e.gfx,i=_a(".djs-hit",n);Ea(i,{width:t.width,height:t.height})}),e.on("connection.changed",function(e){var t=e.element,n=e.gfx,i=_a(".djs-hit",n);Sa(i,t.waypoints)}),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=o,this.registerEvent=c,this.unregisterEvent=u}Ma.$inject=["eventBus","elementRegistry","styles"];var ka={__init__:["interactionEvents"],interactionEvents:["type",Ma]},Pa=li.getBBox,Ta=500,Na=n.append,Da=n.attr,Oa=n.create,Ba=K.query,La=s.assign;function Ia(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function a(e,t){var n=Oa("rect");return Da(n,La({x:10,y:10,width:100,height:100},i)),Na(e,n),n}e.on(["shape.added","shape.changed"],Ta,function(e){var t=e.element,n=e.gfx,i=Ba(".djs-outline",n);i||(i=a(n)),r.updateShapeOutline(i,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,i=Ba(".djs-outline",n);i||(i=a(n)),r.updateConnectionOutline(i,t)})}Ia.prototype.updateShapeOutline=function(e,t){Da(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Ia.prototype.updateConnectionOutline=function(e,t){var n=Pa(t);Da(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Ia.$inject=["eventBus","styles","elementRegistry"];var ja={__init__:["outline"],outline:["type",Ia]},Fa=s.isArray,Va=s.forEach;function Wa(e){this._eventBus=e,this._selectedElements=[];var t=this;e.on(["shape.remove","connection.remove"],function(e){var n=e.element;t.deselect(n)}),e.on(["diagram.clear"],function(e){t.select(null)})}Wa.$inject=["eventBus"];var za=Wa;Wa.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})}},Wa.prototype.get=function(){return this._selectedElements},Wa.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Wa.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();Fa(e)||(e=e?[e]:[]),t?Va(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 Ga=ma.hasPrimaryModifier,$a=s.find;function Ha(e,t,n,i){e.on("create.end",500,function(e){e.context.canExecute&&t.select(e.context.shape)}),e.on("connect.end",500,function(e){e.context.canExecute&&e.context.target&&t.select(e.context.target)}),e.on("shape.move.end",500,function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);$a(n,function(e){return r.id===e.id})||t.select(r)}),e.on("element.click",function(e){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),a=t.get().length>1,o=Ga(e);if(r&&a)return o?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,o)})}Ha.$inject=["eventBus","selection","canvas","elementRegistry"];var Ka=Ha,Ua=s.forEach,qa="hover",Ya="selected";function Xa(e,t,n,i){function r(e,n){t.addMarker(e,n)}function a(e,n){t.removeMarker(e,n)}this._multiSelectionBox=null,e.on("element.hover",function(e){r(e.element,qa)}),e.on("element.out",function(e){a(e.element,qa)}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;Ua(t,function(e){-1===n.indexOf(e)&&a(e,Ya)}),Ua(n,function(e){-1===t.indexOf(e)&&r(e,Ya)})})}Xa.$inject=["eventBus","canvas","selection","styles"];var Za={__init__:["selectionVisuals","selectionBehavior"],__depends__:[ka,ja],selection:["type",za],selectionVisuals:["type",Xa],selectionBehavior:["type",Ka]},Ja=s.assign,Qa=s.isNumber,eo=s.omit,to=K.domify,no=K.query,io=K.remove,ro=n.innerSVG,ao=lt.importBpmnDiagram;var oo={width:"100%",height:"100%",position:"relative"};function so(e){return e+(Qa(e)?"px":"")}function po(e){var t,n,i;e=Ja({},oo,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=ct.BPMNIO_IMG,i=to('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100">'+n+"</a>"),t.appendChild(i),co.bind(i,"click",function(e){ct.open(),e.preventDefault()}),this._init(this._container,this._moddle,e)}H(po,Fr);var lo=po;po.prototype.importXML=function(e,t){t=t||function(){};var n=this;e=this._emit("import.parse.start",{xml:e})||e,this._moddle.fromXML(e,"bpmn:Definitions",function(e,i,r){i=n._emit("import.parse.complete",{error:e,definitions:i,context:r})||i;var a=r.warnings;if(e)return e=function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]),e}(e),n._emit("import.done",{error:e,warnings:a}),t(e,a);n.importDefinitions(i,function(e,i){var r=[].concat(a,i||[]);n._emit("import.done",{error:e,warnings:r}),t(e,r)})})},po.prototype.saveXML=function(e,t){t||(t=e,e={});var n=this._definitions;if(!n)return t(new Error("no definitions loaded"));this._moddle.toXML(n,e,t)},po.prototype.saveSVG=function(e,t){var n,i;t||(t=e,e={});try{var r=this.get("canvas"),a=r.getDefaultLayer(),o=no("defs",r._svg),s=ro(a),p=o?"<defs>"+ro(o)+"</defs>":"",l=a.getBBox();n='<?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="'+l.width+'" height="'+l.height+'" viewBox="'+l.x+" "+l.y+" "+l.width+" "+l.height+'" version="1.1">'+p+s+"</svg>"}catch(e){i=e}t(i,n)},po.prototype.importDefinitions=function(e,t){try{this._definitions&&this.clear(),this._definitions=e}catch(e){return t(e)}return ao(this,e,t)},po.prototype.getModules=function(){return this._modules},po.prototype.destroy=function(){Fr.prototype.destroy.call(this),io(this._container)},po.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},po.prototype.off=function(e,t){this.get("eventBus").off(e,t)},po.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=no(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},po.prototype.getDefinitions=function(){return this._definitions},po.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},po.prototype._init=function(e,t,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],a=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),o=Ja(eo(n,["additionalModules"]),{canvas:Ja({},n.canvas,{container:e}),modules:a});Fr.call(this,o),n&&n.container&&this.attachTo(n.container)},po.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},po.prototype._createContainer=function(e){var t=to('<div class="bjs-container"></div>');return Ja(t.style,{width:so(e.width),height:so(e.height),position:e.position}),t},po.prototype._createModdle=function(e){var t=Ja({},this._moddleExtensions,e.moddleExtensions);return new si(t)},po.prototype._modules=[Ze,Xe,Za,la],po.prototype._moddleExtensions={};var co=K.event;var uo={},ho=5e3;uo.install=function(e,t){function n(){return!1}return t=t||"element.click",e.once(t,ho,n),function(){e.off(t,n)}};var mo={},fo=K.classes,yo=/^djs-cursor-.*$/;mo.set=function(e){var t=fo(document.body);t.removeMatching(yo),e&&t.add("djs-cursor-"+e)},mo.unset=function(){this.set(null)};var go={};go.log10=function(e){return Math.log(e)/Math.log(10)},go.substract=function(e,t){return{x:e.x-t.x,y:e.y-t.y}};var vo=go.substract,xo=K.event,bo=K.closest;var Eo=15;function wo(e,t){var n;function i(i){var r,a=n.start,o=ca.toPoint(i),s=vo(o,a);if(!n.dragging&&(r=s,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>Eo)&&(n.dragging=!0,uo.install(e),mo.set("grab")),n.dragging){var p=n.last||n.start;s=vo(o,p),t.scroll({dx:s.x,dy:s.y}),n.last=o}i.preventDefault()}function r(e){xo.unbind(document,"mousemove",i),xo.unbind(document,"mouseup",r),n=null,mo.unset()}e.on("element.mousedown",500,function(e){return function(e){if(!bo(e.target,".djs-draggable")&&!(e.button||e.ctrlKey||e.shiftKey||e.altKey))return n={start:ca.toPoint(e)},xo.bind(document,"mousemove",i),xo.bind(document,"mouseup",r),!0}(e.originalEvent)})}wo.$inject=["eventBus","canvas"];var _o={__init__:["moveCanvas"],moveCanvas:["type",wo]},Ao={},So=go.log10;Ao.getStepSize=function(e,t){var n=So(e.min),i=So(e.max);return(Math.abs(n)+Math.abs(i))/t},Ao.cap=function(e,t){return Math.max(e.min,Math.min(e.max,t))};var Co=K.event,Ro=K.closest,Mo=Ao.getStepSize,ko=Ao.cap,Po=go.log10,To=s.bind,No=Math.sign||function(e){return e>=0?1:-1},Do={min:.2,max:4},Oo=.75;function Bo(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=To(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||Oo;var i=this;t.on("canvas.init",function(t){i._init(!1!==e.enabled)})}Bo.$inject=["config.zoomScroll","eventBus","canvas"];var Lo=Bo;Bo.prototype.scroll=function(e){this._canvas.scroll(e)},Bo.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Bo.prototype.zoom=function(e,t){var n=Mo(Do,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Bo.prototype._handleWheel=function(e){if(!Ro(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,a=-1*this._scale;if(a*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var o=t.getBoundingClientRect(),s={x:e.clientX-o.left,y:e.clientY-o.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*No(e.deltaY)*a,this.zoom(n,s)}else n=r?{dx:a*e.deltaY,dy:0}:{dx:a*e.deltaX,dy:a*e.deltaY},this.scroll(n)}},Bo.prototype.stepZoom=function(e,t){var n=Mo(Do,10);this._zoom(e,t,n)},Bo.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,a=Po(i.zoom()),o=Math.round(a/n)*n;o+=n*r;var s=Math.pow(10,o);i.zoom(ko(Do,s),t)},Bo.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&Co[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Bo.prototype._init=function(e){this.toggle(e)};var Io={__init__:["zoomScroll"],zoomScroll:["type",Lo]};function jo(e){lo.call(this,e)}H(jo,lo);var Fo=jo;return jo.prototype._navigationModules=[Io,_o],jo.prototype._modules=[].concat(jo.prototype._modules,jo.prototype._navigationModules),Fo});