vmes-flowable
Version:
ceshibao
2 lines • 163 kB
JavaScript
/*! bpmn-js - bpmn-viewer v6.5.1 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).BpmnJS=t()}(this,function(){"use strict";var e=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return void 0!==e}function r(e){return"[object Array]"===t.call(e)}function a(e){return"[object Object]"===t.call(e)}function o(e){return"[object Number]"===t.call(e)}function s(e){var n=t.call(e);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function p(e){return"[object String]"===t.call(e)}function l(e,t){return n.call(e,t)}function c(e,t){var n;return t=function(e){return s(e)?e:function(t){return t===e}}(t),h(e,function(e,i){if(t(e,i))return n=e,!1}),n}function u(e,t){var n=[];return h(e,function(e,i){t(e,i)&&n.push(e)}),n}function h(e,t){var n;if(void 0!==e){var i=r(e)?g:y;for(var a in e)if(l(e,a)&&!1===t(n=e[a],i(a)))return n}}function m(e,t,n){return h(e,function(e,i){n=t(n,e,i)}),n}function f(e,t){return!!m(e,function(e,n,i){return e&&t(n,i)},!0)}function d(e){return function(t){return f(e,function(e,n){return t[n]===e})}}function y(e){return e}function g(e){return Number(e)}function v(e,t){return e.bind(t)}function x(){return(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}).apply(this,arguments)}function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return x.apply(void 0,[e].concat(n))}var E=1e3;function w(e,t){var n=this;t=t||E,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)})}function A(e,t){var n=_(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function _(e){return e&&e.businessObject||e}function S(e){return!A(e,"bpmn:CallActivity")&&(A(e,"bpmn:SubProcess")?!!_(e).di.isExpanded:!A(e,"bpmn:Participant")||!!_(e).processRef)}function R(e){var t=e.businessObject,n=function(e){return A(e,"bpmn:FlowElement")||A(e,"bpmn:Participant")||A(e,"bpmn:Lane")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")?"name":A(e,"bpmn:TextAnnotation")?"text":A(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function C(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function M(e,t){return C(t,e),e}w.prototype.canRender=function(){},w.prototype.drawShape=function(){},w.prototype.drawConnection=function(){},w.prototype.getShapePath=function(){},w.prototype.getConnectionPath=function(){};var k=2,P={"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":k,"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":k,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function N(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=P[i];r?(r===k&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function T(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return P[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);N(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)N(e,i,t[i])}(e,t);return e}function D(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 O=/\s+/,B=Object.prototype.toString;function L(e){return void 0!==e}function I(e){return new F(e)}function F(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function j(e){var t=e.parentNode;return t&&t.removeChild(e),e}F.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~D(t,e)||t.push(e),L(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},F.prototype.remove=function(e){if("[object RegExp]"===B.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=D(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},F.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},F.prototype.toggle=function(e,t){return this.list?(L(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(L(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},F.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(O);return""===e[0]&&e.shift(),e},F.prototype.has=F.prototype.contains=function(e){return this.list?this.list.contains(e):!!~D(this.array(),e)};var V={svg:"http://www.w3.org/2000/svg"},W='<svg xmlns="'+V.svg+'"';function z(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(V.svg)&&(e=W+e.substring(4)):(e=W+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function G(e,t){var n;return"<"===e.charAt(0)?(n=z(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(V.svg,e),t&&T(n,t),n}var $=G("svg");function H(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function K(e){return e?$.createSVGTransformFromMatrix(e):$.createSVGTransform()}var U=/([&<>]{1})/g,q=/([\n\r"]{1})/g,Y={"&":"&","<":"<",">":">",'"':"'"};function X(e,t){return e.replace(t,function(e,t){return Y[t]||t})}function Z(e,t){var n,i,r,a,o;switch(e.nodeType){case 3:t.push(X(e.textContent,U));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,'="',X(a.value,q),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(o=e.childNodes).length;n<i;++n)Z(o.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",X(e.nodeValue,U),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function J(e,t){var n=z(t);if(function(e){for(var t;t=e.firstChild;)j(t)}(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),a=0;a<r.length;a++)C(r[a],e)}}function Q(e,t){if(void 0!==t){try{J(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)Z(t,n),t=t.nextSibling;return n.join("")}(e)}function ee(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function te(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(ee(e,i))}(n,t)),n.consolidate()}function ne(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function ie(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function re(e,t){var n=G("polyline");return T(n,{points:ie(e)}),t&&T(n,t),n}function ae(e,t,n){return function(e,t){return!!c(e,t)}(e.eventDefinitions,function(i){return i.$type===t&&function(e,t){return f(t,function(t,n){return e[n]==t})}(e,n)})}function oe(e){return e.businessObject.di}function se(e){return e.businessObject}function pe(e,t){return oe(e).get("bioc:fill")||t||"white"}function le(e,t){return oe(e).get("bioc:stroke")||t||"black"}var ce=[].indexOf,ue=function(e,t){if(ce)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},he=/\s+/,me=Object.prototype.toString;function fe(e){return new de(e)}function de(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ye(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}de.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~ue(t,e)||t.push(e),this.el.className=t.join(" "),this},de.prototype.remove=function(e){if("[object RegExp]"==me.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=ue(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},de.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},de.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)},de.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(he);return""===e[0]&&e.shift(),e},de.prototype.has=de.prototype.contains=function(e){return this.list?this.list.contains(e):!!~ue(this.array(),e)};var ge="undefined"!=typeof Element?Element.prototype:{},ve=(ge.matches||ge.matchesSelector||ge.webkitMatchesSelector||ge.mozMatchesSelector||ge.msMatchesSelector||ge.oMatchesSelector,Element.prototype),xe=ve.matchesSelector||ve.webkitMatchesSelector||ve.mozMatchesSelector||ve.msMatchesSelector||ve.oMatchesSelector,be=function(e,t){if(xe)return xe.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 Ee,we=window.addEventListener?"addEventListener":"attachEvent",Ae=window.removeEventListener?"removeEventListener":"detachEvent",_e="addEventListener"!==we?"on":"",Se={bind:function(e,t,n,i){return e[we](_e+t,n,i||!1),n},unbind:function(e,t,n,i){return e[Ae](_e+t,n,i||!1),n}},Re=["focus","blur"],Ce={bind:function(e,t,n,i,r){return-1!==Re.indexOf(n)&&(r=!0),Se.bind(e,n,function(n){var r=n.target||n.srcElement;n.delegateTarget=function(e,t,n){for(var i=n?e:e.parentNode;i&&i!==document;){if(be(i,t))return i;i=i.parentNode}}(r,t,!0),n.delegateTarget&&i.call(e,n)},r)},unbind:function(e,t,n,i){-1!==Re.indexOf(t)&&(i=!0),Se.unbind(e,t,n,i)}},Me=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=Pe[i]||Pe._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},ke=!1;"undefined"!=typeof document&&((Ee=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',ke=!Ee.getElementsByTagName("link").length,Ee=void 0);var Pe={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:ke?[1,"X<div>","</div>"]:[0,"",""]};function Ne(e,t){return(t=t||document).querySelector(e)}function Te(e){e.parentNode&&e.parentNode.removeChild(e)}function De(e,t,n){var i=K();i.setTranslate(t,n),te(e,i)}Pe.td=Pe.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Pe.option=Pe.optgroup=[1,'<select multiple="multiple">',"</select>"],Pe.thead=Pe.tbody=Pe.colgroup=Pe.caption=Pe.tfoot=[1,"<table>","</table>"],Pe.polyline=Pe.ellipse=Pe.polygon=Pe.circle=Pe.text=Pe.line=Pe.path=Pe.rect=Pe.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Oe=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var a=i-Math.floor(i),o="";for(r=0;r<Math.floor(i);r++){o=Math.floor(Math.random()*n).toString(n)+o}if(a){var s=Math.pow(n,a);o=Math.floor(Math.random()*s).toString(n)+o}var p=parseInt(o,n);return p!==1/0&&p>=Math.pow(2,e)?t(e,n):o};t.rack=function(e,n,i){var r=function(r){var o=0;do{if(o++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(a,s));return a[s]=r,s},a=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}});function Be(e){if(!(this instanceof Be))return new Be(e);e=e||[128,36,1],this._seed=e.length?Oe.rack(e[0],e[1],e[2]):e}Be.prototype.next=function(e){return this._seed(e||!0)},Be.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},Be.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Be.prototype.assigned=function(e){return this._seed.get(e)||!1},Be.prototype.unclaim=function(e){delete this._seed.hats[e]},Be.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var Le=new Be,Ie=10,Fe=3,je=.95,Ve=.35;function We(e,t,n,i,r,o,s){w.call(this,t,s);var p=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,c=Le.next(),u={},m=n.computeStyle;function f(e,t){var n=b({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},a=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var o=G("marker");T(t.element,n),M(o,t.element),T(o,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*a,markerHeight:20*a,orient:"auto"});var s=Ne("defs",r._svg);s||(s=G("defs"),M(r._svg,s)),M(s,o),u[e]=o}function d(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function y(e,t,n){var i=e+"-"+d(t)+"-"+d(n)+"-"+c;return u[i]||function(e,t,n,i){if("sequenceflow-end"===t){var r=G("path");T(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(e,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var a=G("circle");T(a,{cx:6,cy:6,r:3.5}),f(e,{element:a,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var o=G("path");T(o,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(e,{element:o,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var s=G("path");T(s,{d:"M 11 5 L 1 10 L 11 15"}),f(e,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var p=G("path");T(p,{d:"M 1 5 L 11 10 L 1 15"}),f(e,{element:p,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var l=G("path");T(l,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(e,{element:l,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var c=G("path");T(c,{d:"M 6 4 L 10 16"}),f(e,{element:c,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function g(e,t,n,i,r){a(i)&&(r=i,i=0),i=i||0,"none"===(r=m(r,{stroke:"black",strokeWidth:2,fill:"white"})).fill&&delete r.fillOpacity;var o=t/2,s=n/2,p=G("circle");return T(p,{cx:o,cy:s,r:Math.round((t+n)/4-i)}),T(p,r),M(e,p),p}function v(e,t,n,i,r,o){a(r)&&(o=r,r=0),r=r||0,o=m(o,{stroke:"black",strokeWidth:2,fill:"white"});var s=G("rect");return T(s,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),T(s,o),M(e,s),s}function x(e,t,n){var i=re(t,n=m(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return M(e,i),i}function E(e,t,n){n=m(n,["no-fill"],{strokeWidth:2,stroke:"black"});var i=G("path");return T(i,{d:t}),T(i,n),M(e,i),i}function A(e,t,n,i){return E(t,n,b({"data-marker":e},i))}function C(e){return function(t,n){return L[e](t,n)}}function k(e){return L[e]}function P(e,t){var n=se(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?k("bpmn:ParallelMultipleEventDefinition")(t,e,i):k("bpmn:MultipleEventDefinition")(t,e,i):ae(n,"bpmn:MessageEventDefinition")?k("bpmn:MessageEventDefinition")(t,e,i):ae(n,"bpmn:TimerEventDefinition")?k("bpmn:TimerEventDefinition")(t,e,i):ae(n,"bpmn:ConditionalEventDefinition")?k("bpmn:ConditionalEventDefinition")(t,e):ae(n,"bpmn:SignalEventDefinition")?k("bpmn:SignalEventDefinition")(t,e,i):ae(n,"bpmn:EscalationEventDefinition")?k("bpmn:EscalationEventDefinition")(t,e,i):ae(n,"bpmn:LinkEventDefinition")?k("bpmn:LinkEventDefinition")(t,e,i):ae(n,"bpmn:ErrorEventDefinition")?k("bpmn:ErrorEventDefinition")(t,e,i):ae(n,"bpmn:CancelEventDefinition")?k("bpmn:CancelEventDefinition")(t,e,i):ae(n,"bpmn:CompensateEventDefinition")?k("bpmn:CompensateEventDefinition")(t,e,i):ae(n,"bpmn:TerminateEventDefinition")?k("bpmn:TerminateEventDefinition")(t,e,i):null}function N(e,t,n){n=b({size:{width:100}},n);var i=o.createText(t||"",n);return I(i).add("djs-label"),M(e,i),i}function D(e,t,n){return N(e,se(t).name,{box:t,align:n,padding:5,style:{fill:le(t,l)}})}function O(e,t,n){!function(e,t,n,i,r){var a=K();a.setTranslate(t,n);var o=K();o.setRotate(i||0,0,0);var s=K();s.setScale(r||1,r||1),te(e,[a,o,s])}(N(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:le(n,l)}}),0,-(-1*n.height),270)}function B(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i<t.length;i++)n+="L"+t[i].x+","+t[i].y+" ";return n}var L=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=je),g(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:pe(t,p),stroke:le(t,l)};se(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:pe(t,p),stroke:le(t,l)});var i=k("bpmn:Event")(e,t,n);return P(t,e),i},"bpmn:MessageEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?le(t,l):pe(t,p),stroke:n?pe(t,p):le(t,l)})},"bpmn:TimerEventDefinition":function(e,t){var n=g(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:pe(t,p),stroke:le(t,l)});E(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:le(t,l)});for(var r=0;r<12;r++){var a=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),o=t.width/2;E(e,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+o+")",stroke:le(t,l)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?le(t,l):"none",stroke:le(t,l)})},"bpmn:ConditionalEventDefinition":function(e,t){return E(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:le(t,l)})},"bpmn:LinkEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?le(t,l):"none",stroke:le(t,l)})},"bpmn:ErrorEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:n?le(t,l):"none",stroke:le(t,l)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=E(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:n?le(t,l):"none",stroke:le(t,l)});return function(e,t){var n=K();n.setRotate(t,0,0),te(e,n)}(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?le(t,l):"none",stroke:le(t,l)})},"bpmn:SignalEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?le(t,l):"none",stroke:le(t,l)})},"bpmn:MultipleEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:n?le(t,l):"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return E(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:le(t,l),stroke:le(t,l)})},"bpmn:EndEvent":function(e,t){var n=k("bpmn:Event")(e,t,{strokeWidth:4,fill:pe(t,p),stroke:le(t,l)});return P(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return g(e,t.width,t.height,8,{strokeWidth:4,fill:le(t,l),stroke:le(t,l)})},"bpmn:IntermediateEvent":function(e,t){var n=k("bpmn:Event")(e,t,{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)});return g(e,t.width,t.height,Fe,{strokeWidth:1,fill:pe(t,"none"),stroke:le(t,l)}),P(t,e),n},"bpmn:IntermediateCatchEvent":C("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":C("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=je),v(e,t.width,t.height,Ie,n)},"bpmn:Task":function(e,t){var n={fill:pe(t,p),stroke:le(t,l)},i=k("bpmn:Activity")(e,t,n);return D(e,t,"center-middle"),F(e,t),i},"bpmn:ServiceTask":function(e,t){var n=k("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)}),E(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:pe(t,p)}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)}),n},"bpmn:UserTask":function(e,t){var n=k("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:pe(t,p),stroke:le(t,l)}),E(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:pe(t,p),stroke:le(t,l)}),E(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:le(t,l),stroke:le(t,l)}),n},"bpmn:ManualTask":function(e,t){var n=k("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:pe(t,p),stroke:le(t,l)}),n},"bpmn:SendTask":function(e,t){var n=k("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:le(t,l),stroke:pe(t,p)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=se(t),a=k("bpmn:Task")(e,t);return r.instantiate?(g(e,28,28,4.4,{strokeWidth:1}),n=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):n=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),E(e,n,{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)}),a},"bpmn:ScriptTask":function(e,t){var n=k("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:le(t,l)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=k("bpmn:Task")(e,t);return T(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:pe(t,"#aaaaaa"),stroke:le(t,l)}),T(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:le(t,l)}),n},"bpmn:SubProcess":function(e,t,n){n=b({fill:pe(t,p),stroke:le(t,l)},n);var i=k("bpmn:Activity")(e,t,n),r=S(t);return function(e){return e&&!!_(e).triggeredByEvent}(t)&&T(i,{strokeDasharray:"1,2"}),D(e,t,r?"center-top":"center-middle"),r?F(e,t):F(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return k("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=k("bpmn:SubProcess")(e,t),r=n.style(["no-fill","no-events"],{stroke:le(t,l)});return v(e,t.width,t.height,Ie-2,Fe,r),i},"bpmn:CallActivity":function(e,t){return k("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:je,fill:pe(t,p),stroke:le(t,l)},i=k("bpmn:Lane")(e,t,n);S(t)?(x(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:le(t,l)}),O(e,se(t).name,t)):N(e,se(t).name,{box:t,align:"center-middle",style:{fill:le(t,l)}});return!!se(t).participantMultiplicity&&k("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=v(e,t.width,t.height,0,b({fill:pe(t,p),fillOpacity:Ve,stroke:le(t,l)},n)),r=se(t);"bpmn:Lane"===r.$type&&O(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=k("bpmn:Gateway")(e,t);return g(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:pe(t,p),stroke:le(t,l)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=k("bpmn:Gateway")(e,t),r=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return oe(t).isMarkerVisible&&E(e,r,{strokeWidth:1,fill:le(t,l),stroke:le(t,l)}),n},"bpmn:ComplexGateway":function(e,t){var n=k("bpmn:Gateway")(e,t);return E(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:le(t,l),stroke:le(t,l)}),n},"bpmn:ParallelGateway":function(e,t){var n=k("bpmn:Gateway")(e,t);return E(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:le(t,l),stroke:le(t,l)}),n},"bpmn:EventBasedGateway":function(e,t){var n=se(t),r=k("bpmn:Gateway")(e,t);g(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:le(t,l)});var a=n.eventGatewayType,o=!!n.instantiate;if("Parallel"===a){var s=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});T(E(e,s),{strokeWidth:1,fill:"none"})}else if("Exclusive"===a){if(!o)T(g(e,t.width,t.height,.26*t.height),{strokeWidth:1,fill:"none",stroke:le(t,l)});!function(){var n=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:pe(t,"none"),stroke:le(t,l)};E(e,n,r)}()}return r},"bpmn:Gateway":function(e,t){var n={fill:pe(t,p),fillOpacity:je,stroke:le(t,l)};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=m(i,{stroke:"black",strokeWidth:2,fill:"white"});var s=G("polygon");return T(s,{points:o}),T(s,i),M(e,s),s}(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=B(t),r=pe(t,p),a=le(t,l),o=E(e,i,{strokeLinejoin:"round",markerEnd:y("sequenceflow-end",r,a),stroke:le(t,l)}),s=se(t);return t.source&&(n=t.source.businessObject,s.conditionExpression&&n.$instanceOf("bpmn:Activity")&&T(o,{markerStart:y("conditional-flow-marker",r,a)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===s&&T(o,{markerStart:y("conditional-default-flow-marker",r,a)})),o},"bpmn:Association":function(e,t,n){var i=se(t),r=pe(t,p),a=le(t,l);return n=b({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:le(t,l)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=y("association-end",r,a)),"Both"===i.associationDirection&&(n.markerStart=y("association-start",r,a)),x(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=pe(t,p),i=le(t,l);return k("bpmn:Association")(e,t,{markerEnd:y("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=pe(t,p),i=le(t,l);return k("bpmn:Association")(e,t,{markerEnd:y("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=se(t),r=oe(t),a=pe(t,p),o=le(t,l),s=E(e,B(t),{markerEnd:y("messageflow-end",a,o),markerStart:y("messageflow-start",a,o),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:le(t,l)});if(n.messageRef){var c=s.getPointAtLength(s.getTotalLength()/2),u=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:c.x,y:c.y}}),h={strokeWidth:1};"initiating"===r.messageVisibleKind?(h.fill="white",h.stroke="black"):(h.fill="#888",h.stroke="white"),E(e,u,h)}return s},"bpmn:DataObject":function(e,t){var n=E(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:pe(t,p),fillOpacity:je,stroke:le(t,l)});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(se(t))&&function(e,t){var n=(t.height-16)/t.height,r=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.451,my:n}});E(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":C("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=k("bpmn:DataObject")(e,t);return E(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=k("bpmn:DataObject")(e,t);return E(e,n,{strokeWidth:1,fill:"black"}),r},"bpmn:DataStoreReference":function(e,t){return E(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:pe(t,p),fillOpacity:je,stroke:le(t,l)})},"bpmn:BoundaryEvent":function(e,t){var n=se(t).cancelActivity,i={strokeWidth:1,fill:pe(t,p),stroke:le(t,l)};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=b({},i,{fillOpacity:1}),a=b({},i,{fill:"none"}),o=k("bpmn:Event")(e,t,r);return g(e,t.width,t.height,Fe,a),P(t,e),o},"bpmn:Group":function(e,t){return v(e,t.width,t.height,Ie,{stroke:le(t,l),strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return N(e,R(t),{box:n,fitBox:!0,style:b({},o.getExternalStyle(),{fill:le(t,l)})})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=v(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return E(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:le(t,l)}),N(e,se(t).text||"",{box:t,align:"left-top",padding:5,style:{fill:le(t,l)}}),n},ParticipantMultiplicityMarker:function(e,t){A("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)})},SubProcessMarker:function(e,t){De(v(e,14,14,0,{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)}),t.width/2-7.5,t.height-20),A("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:pe(t,p),stroke:le(t,l)})},ParallelMarker:function(e,t,n){A("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.parallel)/t.width,my:(t.height-20)/t.height}}),{fill:pe(t,p),stroke:le(t,l)})},SequentialMarker:function(e,t,n){A("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:pe(t,p),stroke:le(t,l)})},CompensationMarker:function(e,t,n){A("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)})},LoopMarker:function(e,t,n){A("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1,fill:pe(t,p),stroke:le(t,l),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){A("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:le(t,l),stroke:le(t,l)})}};function F(e,t,n){var i,r=se(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},h(n,function(n){k(n)(e,t,i)}),r.isForCompensation&&k("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&k("AdhocMarker")(e,t,i);var o=r.loopCharacteristics,s=o&&o.isSequential;o&&(void 0===s&&k("LoopMarker")(e,t,i),!1===s&&k("ParallelMarker")(e,t,i),!0===s&&k("SequentialMarker")(e,t,i))}this._drawPath=E}e(We,w),We.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],We.prototype.canRender=function(e){return A(e,"bpmn:BaseElement")},We.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},We.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},We.prototype.getShapePath=function(e){return A(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,ne([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):A(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,a=e.height;return ne([["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"]])}(e,Ie):A(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return ne([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,i=e.width;return ne([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var ze=0,Ge={width:150,height:50};function $e(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function He(e,t,n){for(var i,r=e.shift(),a=r;;){if((i=$e(a,n)).width=a?i.width:0," "===a||""===a||i.width<Math.round(t)||a.length<2)return Ke(e,a,r,i);a=Ue(a,i.width,t)}}function Ke(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 Ue(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 qe(e){this._config=b({},{size:Ge,padding:ze,style:{},align:"center-top"},e||{})}qe.prototype.createText=function(e,t){return this.layoutText(e,t).element},qe.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},qe.prototype.layoutText=function(e,t){var n=b({},this._config.size,t.box),i=b({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return a(e)?b({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),s=t.fitBox||!1,p=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),l=e.split(/\r?\n/g),c=[],u=n.width-o.left-o.right,f=G("text");for(T(f,{x:0,y:0}),T(f,i),M(function(){var e=document.getElementById("helper-svg");return e||(T(e=G("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(e)),e}(),f);l.length;)c.push(He(l,u,f));"middle"===r.vertical&&(o.top=o.bottom=0);var d=m(c,function(e,t,n){return e+(p||t.height)},0)+o.top+o.bottom,y=m(c,function(e,t,n){return t.width>e?t.width:e},0),g=o.top;"middle"===r.vertical&&(g+=(n.height-d)/2),g-=(p||c[0].height)/4;var v=G("text");return T(v,i),h(c,function(e){var t;switch(g+=p||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?y:u)-o.right-e.width;break;default:t=Math.max(((s?y:u)-e.width)/2+o.left,0)}var n=G("tspan");T(n,{x:t,y:g}),n.textContent=e.text,M(v,n)}),j(f),{dimensions:{width:y,height:d},element:v}};var Ye=12,Xe=1.2,Ze=30;function Je(e){var t=b({fontFamily:"Arial, sans-serif",fontSize:Ye,fontWeight:"normal",lineHeight:Xe},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=b({},t,{fontSize:n},e&&e.externalStyle||{}),r=new qe({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(Ze,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}Je.$inject=["config.textRenderer"];var Qe=/\{([^}]+)\}/g,et=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var tt={__init__:["bpmnRenderer"],bpmnRenderer:["type",We],textRenderer:["type",Je],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m {mx}, {my} m 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(Qe,function(e,t){return function(e,t,n){var i=n;return t.replace(et,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)})}}]};var nt={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,