var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(t,n,i)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,s=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&a(e,n,t[n]);if(i)for(var n of i(t))o.call(t,n)&&a(e,n,t[n]);return e},l=(e,i)=>t(e,n(i)),c=(e,t,n)=>new Promise(((i,r)=>{var o=e=>{try{s(n.next(e))}catch(t){r(t)}},a=e=>{try{s(n.throw(e))}catch(t){r(t)}},s=e=>e.done?i(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())}));import{g as p}from"./index-C-c3zR6K.js";function u(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function h(e){return Array.prototype.concat.apply([],e)}const f=Object.prototype.toString,m=Object.prototype.hasOwnProperty;function d(e){return void 0===e}function y(e){return void 0!==e}function g(e){return null==e}function v(e){return"[object Array]"===f.call(e)}function x(e){return"[object Object]"===f.call(e)}function b(e){return"[object Number]"===f.call(e)}function w(e){const t=f.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function E(e){return"[object String]"===f.call(e)}function _(e,t){return!g(e)&&m.call(e,t)}function A(e,t){const n=z(t);let i;return C(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function S(e,t){const n=z(t);let i=v(e)?-1:void 0;return C(e,(function(e,t){if(n(e,t))return i=t,!1})),i}function R(e,t){const n=z(t);let i=[];return C(e,(function(e,t){n(e,t)&&i.push(e)})),i}function C(e,t){let n,i;if(d(e))return;const r=v(e)?G:$;for(let o in e)if(_(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function M(e,t){if(d(e))return[];!function(e){if(!v(e))throw new Error("must supply array")}(e);const n=z(t);return e.filter((function(e,t){return!n(e,t)}))}function k(e,t,n){return C(e,(function(e,i){n=t(n,e,i)})),n}function P(e,t){return!!k(e,(function(e,n,i){return e&&t(n,i)}),!0)}function D(e,t){return!!A(e,t)}function O(e,t){let n=[];return C(e,(function(e,i){n.push(t(e,i))})),n}function T(e){return e&&Object.keys(e)||[]}function N(e){return T(e).length}function B(e){return O(e,(e=>e))}function L(e,t,n={}){return t=W(t),C(e,(function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)})),n}function I(e,...t){e=W(e);let n={};return C(t,(t=>L(t,e,n))),O(n,(function(e,t){return e[0]}))}const j=I;function F(e,t){t=W(t);let n=[];return C(e,(function(e,i){let r=t(e,i),o={d:r,v:e};for(var a=0;ae.v))}function V(e){return function(t){return P(e,(function(e,n){return t[n]===e}))}}function W(e){return w(e)?e:t=>t[e]}function z(e){return w(e)?e:t=>t===e}function $(e){return e}function G(e){return Number(e)}function H(e,t){let n,i,r,o;function a(n){let a=Date.now(),c=n?0:o+t-a;if(c>0)return s(c);e.apply(r,i),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function c(...e){o=Date.now(),i=e,r=this,n||s(t)}return c.flush=function(){n&&a(!0),l()},c.cancel=l,c}function K(e,t){return e.bind(t)}function q(e,...t){return Object.assign(e,...t)}function U(e,t){let n={},i=Object(e);return C(t,(function(t){t in i&&(n[t]=e[t])})),n}function Y(e,t){let n={};return C(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}function X(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,a):n.drawConnection(o,r,a)})),e.on(["render.getShapePath","render.getConnectionPath"],t,(function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)}))}function Z(e,t){var n=J(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function Q(e,t){return D(t,(function(t){return Z(e,t)}))}function J(e){return e&&e.businessObject||e}function ee(e){return e&&e.di}function te(e,t){return!Z(e,"bpmn:CallActivity")&&(Z(e,"bpmn:SubProcess")?!(!(t=t||ee(e))||!Z(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!Z(e,"bpmn:Participant")||!!J(e).processRef)}function ne(e){return e&&!1!==J(e).isInterrupting}function ie(e){return e&&!!J(e).triggeredByEvent}function re(e,t){var n=J(e),i=!1;return n.eventDefinitions&&C(n.eventDefinitions,(function(e){Z(e,t)&&(i=!0)})),i}function oe(e){return re(e,"bpmn:ErrorEventDefinition")}function ae(e){return re(e,"bpmn:EscalationEventDefinition")}function se(e){return re(e,"bpmn:CompensateEventDefinition")}function le(e){return Z(e,"bpmn:FlowElement")||Z(e,"bpmn:Participant")||Z(e,"bpmn:Lane")||Z(e,"bpmn:SequenceFlow")||Z(e,"bpmn:MessageFlow")||Z(e,"bpmn:DataInput")||Z(e,"bpmn:DataOutput")?"name":Z(e,"bpmn:TextAnnotation")?"text":Z(e,"bpmn:Group")?"categoryValueRef":void 0}function ce(e){var t=e.businessObject,n=le(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function pe(e,t,n){var i=e.businessObject,r=le(i);return r&&("categoryValueRef"===r?i.categoryValueRef.value=t:i[r]=t),e}function ue(e,t){return function(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(n){}return e}(e,t))}(t,e),e}X.prototype.canRender=function(e){},X.prototype.drawShape=function(e,t){},X.prototype.drawConnection=function(e,t){},X.prototype.getShapePath=function(e){},X.prototype.getConnectionPath=function(e){};var he={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function fe(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=he[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function me(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return he[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);fe(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)fe(e,i,t[i])}(e,t);return e}const de=Object.prototype.toString;function ye(e){return new ge(e)}function ge(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ve(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function xe(e){return e.cloneNode(!0)}ge.prototype.add=function(e){return this.list.add(e),this},ge.prototype.remove=function(e){return"[object RegExp]"==de.call(e)?this.removeMatching(e):(this.list.remove(e),this)},ge.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n"+e+"",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 _e(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=Ee(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(be,e),t&&me(n,t),n}var Ae=null;function Se(){return null===Ae&&(Ae=_e("svg")),Ae}function Re(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Ce(e){return Se().createSVGTransform()}var Me=/([&<>]{1})/g,ke=/([&<>\n\r"]{1})/g,Pe={"&":"&","<":"<",">":">",'"':"'"};function De(e,t){return e.replace(t,(function(e,t){return Pe[t]||t}))}function Oe(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(De(e.textContent,Me));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n"),n=0,i=(a=e.childNodes).length;n")}else t.push("/>");break;case 8:t.push("\x3c!--",De(e.nodeValue,Me),"--\x3e");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Te(e,t){return function(e){for(var t=e.firstChild,n=[];t;)Oe(t,n),t=t.nextSibling;return n.join("")}(e)}function Ne(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Be(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Le(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(Be(e,i))}(n,t)),n.consolidate()}function Ie(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function je(e){return["L",e.x,e.y]}function Fe(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,a,s;for(let l=1;l
a',Et=!xt.getElementsByTagName("link").length,xt=void 0);var _t={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:Et?[1,"X
","
"]:[0,"",""]};_t.td=_t.th=[3,"","
"],_t.option=_t.optgroup=[1,'"],_t.thead=_t.tbody=_t.colgroup=_t.caption=_t.tfoot=[1,"","
"],_t.polyline=_t.ellipse=_t.polygon=_t.circle=_t.text=_t.line=_t.path=_t.rect=_t.g=[1,'',""];var At=wt;function St(e,t){return e&&"function"==typeof e.matches&&e.matches(t)||!1}function Rt(e,t){return(t=t||document).querySelector(e)}function Ct(e,t){return(t=t||document).querySelectorAll(e)}function Mt(e){e.parentNode&&e.parentNode.removeChild(e)}function kt(e,t,n,i,r){var o=Ce();o.setTranslate(t,n);var a=Ce();a.setRotate(i||0,0,0);var s=Ce();s.setScale(1,1),Le(e,[o,a,s])}function Pt(e,t,n){var i=Ce();i.setTranslate(t,n),Le(e,i)}function Dt(e,t){var n=Ce();n.setRotate(t,0,0),Le(e,n)}var Ot,Tt,Nt=(Ot=function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}},Ot(Tt={exports:{}},Tt.exports),Tt.exports);function Bt(e){if(!(this instanceof Bt))return new Bt(e);e=e||[128,36,1],this._seed=e.length?Nt.rack(e[0],e[1],e[2]):e}Bt.prototype.next=function(e){return this._seed(e||!0)},Bt.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},Bt.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Bt.prototype.assigned=function(e){return this._seed.get(e)||!1},Bt.prototype.unclaim=function(e){delete this._seed.hats[e]},Bt.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var Lt=new Bt,It=.95;function jt(e,t,n,i,r,o,a){X.call(this,t,a);var c=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,u=e&&e.defaultLabelColor,h=Lt.next(),f={};function m(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Ge,strokeWidth:2,fill:"white"})}function d(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Ge,strokeWidth:2})}function y(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o}=t,a=_e("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});ue(a,o);var s=Rt("defs",r._svg);s||(s=_e("defs"),ue(r._svg,s)),ue(s,a),f[e]=a}function g(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function v(e,t,n){var i=e+"-"+g(t)+"-"+g(n)+"-"+h;return f[i]||function(e,t,n,i){if("sequenceflow-end"===t){y(e,{element:_e("path",s({d:"M 1 5 L 11 10 L 1 15 Z"},m({fill:i,stroke:i,strokeWidth:1}))),ref:{x:11,y:10},scale:.5})}if("messageflow-start"===t){y(e,{element:_e("circle",s({cx:6,cy:6,r:3.5},m({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]}))),ref:{x:6,y:6}})}if("messageflow-end"===t){y(e,{element:_e("path",s({d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"},m({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]}))),ref:{x:8.5,y:5}})}if("association-start"===t){y(e,{element:_e("path",s({d:"M 11 5 L 1 10 L 11 15"},d({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]}))),ref:{x:1,y:10},scale:.5})}if("association-end"===t){y(e,{element:_e("path",s({d:"M 1 5 L 11 10 L 1 15"},d({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]}))),ref:{x:11,y:10},scale:.5})}if("conditional-flow-marker"===t){y(e,{element:_e("path",s({d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"},m({fill:n,stroke:i}))),ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){y(e,{element:_e("path",s({d:"M 6 4 L 10 16"},m({stroke:i}))),ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function b(e,t,n,i,r){x(i)&&(r=i,i=0),i=i||0,"none"===(r=m(r)).fill&&delete r.fillOpacity;var o=_e("circle",s({cx:t/2,cy:n/2,r:Math.round((t+n)/4-i)},r));return ue(e,o),o}function w(e,t,n,i,r,o){x(r)&&(o=r,r=0),r=r||0,o=m(o);var a=_e("rect",s({x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i},o));return ue(e,a),a}function E(e,t,n,i){var r=ze(t,n=d(n),i);return ue(e,r),r}function _(e,t,n){return E(e,t,n,5)}function A(e,t,n){n=d(n);var i=_e("path",l(s({},n),{d:t}));return ue(e,i),i}function S(e,t,n,i){return A(t,n,q({"data-marker":e},i))}function R(e){return T[e]}function M(e){return function(t,n){return R(e)(t,n)}}function k(e,t){var n=Ke(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?R("bpmn:ParallelMultipleEventDefinition")(t,e,i):R("bpmn:MultipleEventDefinition")(t,e,i):He(n,"bpmn:MessageEventDefinition")?R("bpmn:MessageEventDefinition")(t,e,i):He(n,"bpmn:TimerEventDefinition")?R("bpmn:TimerEventDefinition")(t,e,i):He(n,"bpmn:ConditionalEventDefinition")?R("bpmn:ConditionalEventDefinition")(t,e):He(n,"bpmn:SignalEventDefinition")?R("bpmn:SignalEventDefinition")(t,e,i):He(n,"bpmn:EscalationEventDefinition")?R("bpmn:EscalationEventDefinition")(t,e,i):He(n,"bpmn:LinkEventDefinition")?R("bpmn:LinkEventDefinition")(t,e,i):He(n,"bpmn:ErrorEventDefinition")?R("bpmn:ErrorEventDefinition")(t,e,i):He(n,"bpmn:CancelEventDefinition")?R("bpmn:CancelEventDefinition")(t,e,i):He(n,"bpmn:CompensateEventDefinition")?R("bpmn:CompensateEventDefinition")(t,e,i):He(n,"bpmn:TerminateEventDefinition")?R("bpmn:TerminateEventDefinition")(t,e,i):null}function P(e,t,n){n=q({size:{width:100}},n);var i=o.createText(t||"",n);return ye(i).add("djs-label"),ue(e,i),i}function D(e,t,n){return P(e,Ke(t).name,{box:t,align:n,padding:7,style:{fill:Ye(t,u,p)}})}function O(e,t,n){kt(P(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:Ye(n,u,p)}}),0,-(-1*n.height),270)}var T=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=It),b(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:qe(t,c),stroke:Ue(t,p)};Ke(t).isInterrupting||(n={strokeDasharray:"6",fill:qe(t,c),stroke:Ue(t,p)});var i=R("bpmn:Event")(e,t,n);return k(t,e),i},"bpmn:MessageEventDefinition":function(e,t,n){return A(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?Ue(t,p):qe(t,c),stroke:n?qe(t,c):Ue(t,p)})},"bpmn:TimerEventDefinition":function(e,t){var n=b(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:qe(t,c),stroke:Ue(t,p)});A(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,stroke:Ue(t,p)});for(var r=0;r<12;r++){var o=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),a=t.width/2;A(e,o,{strokeWidth:1,transform:"rotate("+30*r+","+t.height/2+","+a+")",stroke:Ue(t,p)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return A(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?Ue(t,p):"none",stroke:Ue(t,p)})},"bpmn:ConditionalEventDefinition":function(e,t){return A(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:Ue(t,p)})},"bpmn:LinkEventDefinition":function(e,t,n){return A(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?Ue(t,p):"none",stroke:Ue(t,p)})},"bpmn:ErrorEventDefinition":function(e,t,n){return A(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?Ue(t,p):"none",stroke:Ue(t,p)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=A(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?Ue(t,p):"none",stroke:Ue(t,p)});return Dt(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,n){return A(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?Ue(t,p):"none",stroke:Ue(t,p)})},"bpmn:SignalEventDefinition":function(e,t,n){return A(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?Ue(t,p):"none",stroke:Ue(t,p)})},"bpmn:MultipleEventDefinition":function(e,t,n){return A(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?Ue(t,p):"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return A(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:Ue(t,p),stroke:Ue(t,p)})},"bpmn:EndEvent":function(e,t){var n=R("bpmn:Event")(e,t,{strokeWidth:4,fill:qe(t,c),stroke:Ue(t,p)});return k(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return b(e,t.width,t.height,8,{strokeWidth:4,fill:Ue(t,p),stroke:Ue(t,p)})},"bpmn:IntermediateEvent":function(e,t){var n=R("bpmn:Event")(e,t,{strokeWidth:1.5,fill:qe(t,c),stroke:Ue(t,p)});return b(e,t.width,t.height,3,{strokeWidth:1.5,fill:qe(t,"none"),stroke:Ue(t,p)}),k(t,e),n},"bpmn:IntermediateCatchEvent":M("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":M("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=It),w(e,t.width,t.height,10,n)},"bpmn:Task":function(e,t){var n={fill:qe(t,c),stroke:Ue(t,p)},i=R("bpmn:Activity")(e,t,n);return D(e,t,"center-middle"),N(e,t),i},"bpmn:ServiceTask":function(e,t){var n=R("bpmn:Task")(e,t);return A(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:qe(t,c),stroke:Ue(t,p)}),A(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:qe(t,c)}),A(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:qe(t,c),stroke:Ue(t,p)}),n},"bpmn:UserTask":function(e,t){var n=R("bpmn:Task")(e,t);return A(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:qe(t,c),stroke:Ue(t,p)}),A(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:qe(t,c),stroke:Ue(t,p)}),A(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Ue(t,p),stroke:Ue(t,p)}),n},"bpmn:ManualTask":function(e,t){var n=R("bpmn:Task")(e,t);return A(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:qe(t,c),stroke:Ue(t,p)}),n},"bpmn:SendTask":function(e,t){var n=R("bpmn:Task")(e,t);return A(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:Ue(t,p),stroke:qe(t,c)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=Ke(t),o=R("bpmn:Task")(e,t);return r.instantiate?(b(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}}),A(e,n,{strokeWidth:1,fill:qe(t,c),stroke:Ue(t,p)}),o},"bpmn:ScriptTask":function(e,t){var n=R("bpmn:Task")(e,t);return A(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:Ue(t,p)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=R("bpmn:Task")(e,t);return me(A(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:qe(t,"#aaaaaa"),stroke:Ue(t,p)}),me(A(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:Ue(t,p)}),n},"bpmn:SubProcess":function(e,t,n){n=s({fill:qe(t,c),stroke:Ue(t,p)},n);var i=R("bpmn:Activity")(e,t,n),r=te(t);return ie(t)&&me(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),D(e,t,r?"center-top":"center-middle"),r?N(e,t):N(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return R("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=R("bpmn:SubProcess")(e,t,{strokeWidth:1.5}),r=n.style(["no-fill","no-events"],{stroke:Ue(t,p),strokeWidth:1.5});return w(e,t.width,t.height,7,3,r),i},"bpmn:CallActivity":function(e,t){return R("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:It,fill:qe(t,c),stroke:Ue(t,p),strokeWidth:1.5},i=R("bpmn:Lane")(e,t,n);te(t)?(E(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:Ue(t,p),strokeWidth:1.5}),O(e,Ke(t).name,t)):P(e,Ke(t).name,{box:t,align:"center-middle",style:{fill:Ye(t,u,p)}});return!!Ke(t).participantMultiplicity&&R("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=w(e,t.width,t.height,0,s({fill:qe(t,c),fillOpacity:.35,stroke:Ue(t,p),strokeWidth:1.5},n)),r=Ke(t);"bpmn:Lane"===r.$type&&O(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=R("bpmn:Gateway")(e,t);return b(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:qe(t,c),stroke:Ue(t,p)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=R("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 ee(t).isMarkerVisible&&A(e,r,{strokeWidth:1,fill:Ue(t,p),stroke:Ue(t,p)}),n},"bpmn:ComplexGateway":function(e,t){var n=R("bpmn:Gateway")(e,t);return A(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:Ue(t,p),stroke:Ue(t,p)}),n},"bpmn:ParallelGateway":function(e,t){var n=R("bpmn:Gateway")(e,t);return A(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:Ue(t,p),stroke:Ue(t,p)}),n},"bpmn:EventBasedGateway":function(e,t){var n=Ke(t),r=R("bpmn:Gateway")(e,t);b(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:Ue(t,p)});var o,a=n.eventGatewayType,s=!!n.instantiate;if("Parallel"===a){var l=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});A(e,l,{strokeWidth:1,fill:"none"})}else"Exclusive"===a&&(s||b(e,t.width,t.height,.26*t.height,{strokeWidth:1,fill:"none",stroke:Ue(t,p)}),o=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),A(e,o,{strokeWidth:2,fill:qe(t,"none"),stroke:Ue(t,p)}));return r},"bpmn:Gateway":function(e,t){return function(e,t,n,i){var r=t/2,o=n/2,a=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");i=m(i);var c=_e("polygon",l(s({},i),{points:a}));return ue(e,c),c}(e,t.width,t.height,{fill:qe(t,c),fillOpacity:It,stroke:Ue(t,p)})},"bpmn:SequenceFlow":function(e,t){var n,i=qe(t,c),r=Ue(t,p),o=_(e,t.waypoints,{markerEnd:v("sequenceflow-end",i,r),stroke:Ue(t,p)}),a=Ke(t);return t.source&&(n=t.source.businessObject,a.conditionExpression&&n.$instanceOf("bpmn:Activity")&&me(o,{markerStart:v("conditional-flow-marker",i,r)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===a&&me(o,{markerStart:v("conditional-default-flow-marker",i,r)})),o},"bpmn:Association":function(e,t,n){var i=Ke(t),r=qe(t,c),o=Ue(t,p);return n=s({strokeDasharray:"0, 5",stroke:Ue(t,p)},n),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=v("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=v("association-start",r,o)),_(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=qe(t,c),i=Ue(t,p);return R("bpmn:Association")(e,t,{markerEnd:v("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=qe(t,c),i=Ue(t,p);return R("bpmn:Association")(e,t,{markerEnd:v("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=Ke(t),r=ee(t),o=qe(t,c),a=Ue(t,p),s=_(e,t.waypoints,{markerEnd:v("messageflow-end",o,a),markerStart:v("messageflow-start",o,a),strokeDasharray:"10, 11",strokeWidth:1.5,stroke:Ue(t,p)});if(n.messageRef){var l=s.getPointAtLength(s.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:l.x,y:l.y}}),f={strokeWidth:1};"initiating"===r.messageVisibleKind?(f.fill="white",f.stroke=Ge):(f.fill="#888",f.stroke="white");var m=A(e,h,f),d=P(e,n.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:Ue(t,u)}}),y=m.getBBox(),g=d.getBBox();kt(d,l.x-g.width/2,l.y+y.height/2+10,0)}return s},"bpmn:DataObject":function(e,t){var n=A(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:qe(t,c),fillOpacity:It,stroke:Ue(t,p)});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(Ke(t))&&function(e,t){var n=(t.height-18)/t.height,r=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:n}});A(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":M("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=R("bpmn:DataObject")(e,t);return A(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=R("bpmn:DataObject")(e,t);return A(e,n,{strokeWidth:1,fill:Ge}),r},"bpmn:DataStoreReference":function(e,t){return A(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:qe(t,c),fillOpacity:It,stroke:Ue(t,p)})},"bpmn:BoundaryEvent":function(e,t){var n=Ke(t).cancelActivity,i={strokeWidth:1.5,fill:qe(t,c),stroke:Ue(t,p)};n||(i.strokeDasharray="6");var r=l(s({},i),{fillOpacity:1}),o=l(s({},i),{fill:"none"}),a=R("bpmn:Event")(e,t,r);return b(e,t.width,t.height,3,o),k(t,e),a},"bpmn:Group":function(e,t){return w(e,t.width,t.height,10,{stroke:Ue(t,p),strokeWidth:1.5,strokeDasharray:"10,6,0,6",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 P(e,ce(t),{box:n,fitBox:!0,style:q({},o.getExternalStyle(),{fill:Ye(t,u,p)})})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=w(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return A(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:Ue(t,p)}),P(e,Ke(t).text||"",{box:t,align:"left-top",padding:7,style:{fill:Ye(t,u,p)}}),n},ParticipantMultiplicityMarker:function(e,t){S("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}}),{strokeWidth:2,fill:qe(t,c),stroke:Ue(t,p)})},SubProcessMarker:function(e,t){Pt(w(e,14,14,0,{strokeWidth:1,fill:qe(t,c),stroke:Ue(t,p)}),t.width/2-7.5,t.height-20),S("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:qe(t,c),stroke:Ue(t,p)})},ParallelMarker:function(e,t,n){S("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:qe(t,c),stroke:Ue(t,p)})},SequentialMarker:function(e,t,n){S("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:qe(t,c),stroke:Ue(t,p)})},CompensationMarker:function(e,t,n){S("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:qe(t,c),stroke:Ue(t,p)})},LoopMarker:function(e,t,n){S("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.5,fill:qe(t,c),stroke:Ue(t,p),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){S("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:Ue(t,p),stroke:Ue(t,p)})}};function N(e,t,n){var i,r=Ke(t),o=n&&-1!==n.indexOf("SubProcessMarker");i=o?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},C(n,(function(n){R(n)(e,t,i)})),r.isForCompensation&&R("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&R("AdhocMarker")(e,t,i);var a=r.loopCharacteristics,s=a&&a.isSequential;a&&(void 0===s&&R("LoopMarker")(e,t,i),!1===s&&R("ParallelMarker")(e,t,i),!0===s&&R("SequentialMarker")(e,t,i))}this._drawPath=A,this._renderer=R}u(jt,X),jt.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],jt.prototype.canRender=function(e){return Z(e,"bpmn:BaseElement")},jt.prototype.drawShape=function(e,t){var n=t.type;return this._renderer(n)(e,t)},jt.prototype.drawConnection=function(e,t){var n=t.type;return this._renderer(n)(e,t)},jt.prototype.getShapePath=function(e){return Z(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,Ie([["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"]])):Z(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return Ie([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-10,t],["l",2*t-r,0],["a",t,t,0,0,1,-10,-10],["l",0,2*t-o],["a",t,t,0,0,1,t,-10],["z"]])}(e,10):Z(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return Ie([["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 Ie([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var Ft={width:150,height:50};function Vt(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(o){return{width:0,height:0}}}function Wt(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=Vt(o,n)).width=o?i.width:0," "===o||""===o||i.width1)for(;n=i.shift();){if(!(n.length+oe?t.width:e}),0),m=o.top;"middle"===r.vertical&&(m+=(n.height-h)/2),m-=(s||c[0].height)/4;var d=_e("text");return me(d,i),C(c,(function(e){var t;switch(m+=s||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(a?f:p)-o.right-e.width;break;default:t=Math.max(((a?f:p)-e.width)/2+o.left,0)}var n=_e("tspan");me(n,{x:t,y:m}),n.textContent=e.text,ue(d,n)})),Ne(u),{dimensions:{width:f,height:h},element:d}};function Kt(e){var t=q({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=q({},t,{fontSize:n},e&&e.externalStyle||{}),r=new Ht({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}Kt.$inject=["config.textRenderer"];var qt=/\{([^{}]+)\}/g,Ut=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const Yt={__init__:["bpmnRenderer"],bpmnRenderer:["type",jt],textRenderer:["type",Kt],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o,a,s={};if(t.position){for(var l=t.containerHeight/r.height*t.yScaleFactor,c=t.containerWidth/r.width*t.xScaleFactor,p=0;pt.x-n&&e.y>t.y-n&&e.x=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function b(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function w(e,t,i,r,o,a,s,l,c){null==c&&(c=1);for(var p=(c=c>1?1:c<0?0:c)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,m=0;m<12;m++){var d=p*u[m]+p,y=b(d,e,i,o,s),g=b(d,t,r,a,l),v=y*y+g*g;f+=h[m]*n.sqrt(v)}return p*f}function E(e,t,n,i,a,s,l,c){if(!(o(e,n)o(a,l)||o(t,i)o(s,c))){var p=(e*i-t*n)*(s-c)-(t-i)*(a*c-s*l),u=(e-n)*(s-c)-(t-i)*(a-l);if(u){var h=_(((e*i-t*n)*(a-l)-(e-n)*(a*c-s*l))/u),f=_(p/u),m=+h.toFixed(2),d=+f.toFixed(2);if(!(m<+r(e,n).toFixed(2)||m>+o(e,n).toFixed(2)||m<+r(a,l).toFixed(2)||m>+o(a,l).toFixed(2)||d<+r(t,i).toFixed(2)||d>+o(t,i).toFixed(2)||d<+r(s,c).toFixed(2)||d>+o(s,c).toFixed(2)))return{x:h,y:f}}}}function _(e){return Math.round(1e11*e)/1e11}function A(e,t,n){if(!function(e,t){return e=m(e),x(t=m(t),e.x,e.y)||x(t,e.x2,e.y)||x(t,e.x,e.y2)||x(t,e.x2,e.y2)||x(e,t.x,t.y)||x(e,t.x2,t.y)||x(e,t.x,t.y2)||x(e,t.x2,t.y2)||(e.xt.x||t.xe.x)&&(e.yt.y||t.ye.y)}(v(e),v(t)))return n?0:[];for(var i=w.apply(0,e),r=w.apply(0,t),o=R(e)?1:~~(i/5)||1,a=R(t)?1:~~(r/5)||1,l=[],c=[],p={},u=n?0:[],h=0;h=0&&P<=1&&D>=0&&D<=1&&(n?u++:u.push({x:k.x,y:k.y,t1:P,t2:D}))}}return u}function S(e){var t=f(e);if(t.abs)return y(t.abs);if(p(e)&&p(e&&e[0])||(e=function(e){if(!e)return null;var t=f(e);if(t.arr)return h(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return p(e)&&p(e[0])&&(i=h(e)),i.length||String(e).replace(l,(function(e,t,r){var o=[],a=t.toLowerCase();for(r.replace(c,(function(e,t){t&&o.push(+t)})),"m"==a&&o.length>2&&(i.push([t].concat(o.splice(0,2))),a="l",t="m"==t?"l":"L");o.length>=n[a]&&(i.push([t].concat(o.splice(0,n[a]))),n[a]););})),i.toString=f.toString,t.arr=h(i),i}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,s=0,u=0;"M"==e[0][0]&&(a=r=+e[0][1],s=o=+e[0][2],u++,i[0]=["M",r,o]);for(var m,g,v=u,x=e.length;v=1e3&&delete i[r.shift()],r.push(n),i[n]=d.apply(0,t),i[n])});if(f)M=f[0],P=f[1],R=f[2],C=f[3];else{e=(m=x(e,t,-g)).x,t=m.y;var b=(e-(p=(m=x(p,h,-g)).x))/2,w=(t-(h=m.y))/2,E=b*b/(r*r)+w*w/(o*o);E>1&&(r*=E=n.sqrt(E),o*=E);var _=r*r,A=o*o,S=(l==c?-1:1)*n.sqrt(s((_*A-_*w*w-A*b*b)/(_*w*w+A*b*b))),R=S*r*w/o+(e+p)/2,C=S*-o*b/r+(t+h)/2,M=n.asin(((t-C)/o).toFixed(9)),P=n.asin(((h-C)/o).toFixed(9));(M=eP&&(M-=2*i),!c&&P>M&&(P-=2*i)}var D=P-M;if(s(D)>y){var O=P,T=p,N=h;P=M+y*(c&&P>M?1:-1),v=k(p=R+r*n.cos(P),h=C+o*n.sin(P),r,o,a,0,c,T,N,[P,O,R,C])}D=P-M;var B=n.cos(M),L=n.sin(M),I=n.cos(P),j=n.sin(P),F=n.tan(D/4),V=4/3*r*F,W=4/3*o*F,z=[e,t],$=[e+V*L,t-W*B],G=[p+V*j,h-W*I],H=[p,h];if($[0]=2*z[0]-$[0],$[1]=2*z[1]-$[1],f)return[$,G,H].concat(v);for(var K=[],q=0,U=(v=[$,G,H].concat(v).join().split(",")).length;q7){e[t].shift();for(var n=e[t];n.length;)s[t]="A",e.splice(t++,0,["C"].concat(n.splice(0,6)));e.splice(t,1),u=i.length}},s=[],l="",c="",p=0,u=i.length;p=r.right,s=i.top-n.y>=r.bottom,l=o?"top":s?"bottom":null,c=i.right+n.x<=r.left?"left":a?"right":null;return c&&l?l+"-"+c:c||l||"intersect"}function bn(e,t,n){var i=hn(e,t);return 1===i.length||2===i.length&&rn(i[0],i[1])<1?mn(i[0]):i.length>1?mn((i=F(i,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})))[n?0:i.length-1]):null}function wn(e){e=e.slice();for(var t,n,i,r=0;e[r];)t=e[r],n=e[r-1],0===rn(t,i=e[r+1])||on(n,i,t)?e.splice(r,1):r++;return e}function En(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}function _n(e,t,n){return q({id:e.id,type:e.$type,businessObject:e,di:t},n)}function An(e,t,n){var i=e.waypoint;return!i||i.length<2?[vn(t),vn(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function Sn(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:En(n),referenced:En(t),property:i}))}function Rn(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}Rn.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Rn.prototype.add=function(e,t,n){var i,r,o,a,s,l,c,p=this._translate;if(Z(t,"bpmndi:BPMNPlane")){var u=Z(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(_n(e,t,u)),this._canvas.addRootElement(i)}else if(Z(t,"bpmndi:BPMNShape")){var h=!te(e,t),f=function(e){return Z(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var m=t.bounds;i=this._elementFactory.createShape(_n(e,t,{collapsed:h,hidden:r,x:Math.round(m.x),y:Math.round(m.y),width:Math.round(m.width),height:Math.round(m.height),isFrame:f})),Z(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),Z(e,"bpmn:Lane")&&(o=0),Z(e,"bpmn:DataStoreReference")&&(a=n,s=vn(m),l=s.x,c=s.y,l>=a.x&&l<=a.x+a.width&&c>=a.y&&c<=a.y+a.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!Z(t,"bpmndi:BPMNEdge"))throw new Error(p("unknown di {di} for element {semantic}",{di:En(t),semantic:En(e)}));var d=this._getSource(e),y=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(_n(e,t,{hidden:r,source:d,target:y,waypoints:An(t,d,y)})),Z(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return Qt(e)&&ce(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Rn.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:En(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Sn(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},Rn.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Zt.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=tn(t),i=Zt),q({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=ce(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(_n(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!ce(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},Rn.prototype._getEnd=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?Sn(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:En(e),side:t}))},Rn.prototype._getSource=function(e){return this._getEnd(e,"source")},Rn.prototype._getTarget=function(e){return this._getEnd(e,"target")},Rn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};const Cn={__depends__:[Yt,{__depends__:[Xt],bpmnImporter:["type",Rn]}]};function Mn(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function kn(e){return e.originalEvent||e.srcEvent}function Pn(e,t){Mn(e),Mn(kn(e))}function Dn(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function On(e,t){return(kn(e)||e).button===t}function Tn(e){return On(e,0)}function Nn(e){var t=kn(e)||e;return!!Tn(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function Bn(e){var t=kn(e)||e;return Tn(e)&&t.shiftKey}function Ln(e){return!0}function In(e){return Tn(e)||function(e){return On(e,1)}(e)}function jn(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){return!(l[e]||Tn)(t)})(n,i)||(r?a=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(a=o,r=t.get(a)),a&&r&&!1===e.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function a(e){return o[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":Ln,"element.mousedown":In,"element.mouseup":In,"element.click":In,"element.dblclick":In};function c(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(l[n]=i),a.$delegate=bt.bind(e,"svg, .djs-element",t,a)}function p(e,t,n){var i=a(n);i&&bt.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,C(s,(function(e,n){p(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,C(s,(function(e,n){c(t,n,e)}))})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)}));var u=m("djs-hit djs-hit-stroke"),h=m("djs-hit djs-hit-click-stroke"),f={all:m("djs-hit djs-hit-all"),"click-stroke":h,stroke:u,"no-move":m("djs-hit djs-hit-no-move")};function m(e,t){return t=q({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function d(e,t){var n=f[t];if(!n)throw new Error("invalid hit type <"+t+">");return me(e,n),e}function y(e,t){ue(e,t)}this.removeHits=function(e){C(Ct(".djs-hit",e),Ne)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=ze(t);return d(n,"stroke"),y(e,n),n},this.createBoxHit=function(e,t,n){n=q({x:0,y:0},n);var i=_e("rect");return d(i,t),me(i,n),y(e,i),i},this.updateDefaultHit=function(e,t){var n=Rt(".djs-hit",t);if(n)return e.waypoints?$e(n,e.waypoints):me(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=s[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=a,this.registerEvent=c,this.unregisterEvent=p}jn.$inject=["eventBus","elementRegistry","styles"];const Fn={__init__:["interactionEvents"],interactionEvents:["type",jn]};function Vn(e){return R(e,(function(t){return!A(e,(function(e){return e!==t&&Wn(t,e)}))}))}function Wn(e,t){if(t){if(e===t)return t;if(e.parent)return Wn(e.parent,t)}}function zn(e,t,n){var i=!n||-1===e.indexOf(t);return i&&e.push(t),i}function $n(e,t,n){n=n||0,v(e)||(e=[e]),C(e,(function(e,i){var r=t(e,i,n);v(r)&&r.length&&$n(r,t,n+1)}))}function Gn(e,t){return function(e,t){var n=[],i=[];return $n(e,(function(e,r,o){zn(n,e,t);var a=e.children;if(a&&zn(i,a,t))return a})),n}(e,!t)}function Hn(e,t,n){d(t)&&(t=!0),x(t)&&(n=t,t=!0);var i=Xn((n=n||{}).allShapes),r=Xn(n.allConnections),o=Xn(n.enclosedElements),a=Xn(n.enclosedConnections),s=Xn(n.topLevel,t&&L(e,(function(e){return e.id})));function l(e){s[e.source.id]&&s[e.target.id]&&(s[e.id]=[e]),i[e.source.id]&&i[e.target.id]&&(a[e.id]=o[e.id]=e),r[e.id]=e}return $n(e,(function(e){if(o[e.id]=e,!e.waypoints)return i[e.id]=e,C(e.incoming,l),C(e.outgoing,l),e.children;a[e.id]=r[e.id]=e})),{allShapes:i,allConnections:r,topLevel:s,enclosedConnections:a,enclosedElements:o}}function Kn(e,t){var n,i,r,o;return t=!!t,v(e)||(e=[e]),C(e,(function(e){var a=e;e.waypoints&&!t&&(a=Kn(e.waypoints,!0));var s=a.x,l=a.y,c=a.height||0,p=a.width||0;(sr||void 0===r)&&(r=s+p),(l+c>o||void 0===o)&&(o=l+c)})),{x:n,y:i,height:o-i,width:r-n}}function qn(e,t){var n={};return C(e,(function(e){var i=e;i.waypoints&&(i=Kn(i)),!b(t.y)&&i.x>t.x&&(n[e.id]=e),!b(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(b(t.width)&&b(t.height)&&i.width+i.x1,a=Nn(e)||Bn(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function ri(e){return!e.hidden}ni.$inject=["canvas","eventBus","selection"],ni.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");ve(t);var n=e.length>1;if(ye(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(Kn(e)),r=_e("rect");me(r,q({rx:3},i)),ye(r).add("djs-selection-outline"),ue(t,r)}},ii.$inject=["eventBus","selection","canvas","elementRegistry"];const oi={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Fn,Qn],selection:["type",Jn],selectionVisuals:["type",ni],selectionBehavior:["type",ii]};function ai(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}ai.prototype.next=function(){return this._prefix+ ++this._counter};var si=new ai("ov");function li(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=si,this._overlayDefaults=q({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),it(o=At('
'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function ci(e,t,n){it(e,{left:t+"px",top:n+"px"})}function pi(e,t){e.style.display=!1===t?"none":""}function ui(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}li.$inject=["config.overlays","eventBus","canvas","elementRegistry"],li.prototype.get=function(e){if(E(e)&&(e={id:e}),E(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?R(t.overlays,V({type:e.type})):t.overlays.slice():[]}return e.type?R(this._overlays,V({type:e.type})):e.id?this._overlays[e.id]:null},li.prototype.add=function(e,t,n){if(x(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=q({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},li.prototype.remove=function(e){var t=this.get(e)||[];v(t)||(t=[t]);var n=this;C(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Mt(e.html),Mt(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)}}))},li.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},li.prototype.show=function(){pi(this._overlayRoot)},li.prototype.hide=function(){pi(this._overlayRoot,!1)},li.prototype.clear=function(){this._overlays={},this._overlayContainers=[],lt(this._overlayRoot)},li.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Kn(t);i=o.x,r=o.y}ci(n,i,r),rt(e.html,"data-container-id",t.id)},li.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,s=i.top;void 0!==i.right&&(t=o.waypoints?Kn(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?Kn(o).height:o.height,s=-1*i.bottom+n);ci(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},li.prototype._createOverlayContainer=function(e){var t=At('
');it(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},li.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";ui(this._overlayRoot,n)},li.prototype._getOverlayContainer=function(e,t){var n=A(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},li.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),E(o)&&(o=At(o)),n=this._getOverlayContainer(r),it(t=At('
'),{position:"absolute"}),t.appendChild(o),e.type&&at(t).add("djs-overlay-"+e.type),pi(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},li.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=!0;(i!==this._canvas.getRootElement()||n&&(y(r)&&r>t.scale||y(o)&&oi&&(r=(1/t.scale||1)*i)),y(r)&&(s="scale("+r+","+r+")"),ui(a,s)},li.prototype._updateOverlaysVisibilty=function(e){var t=this;C(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},li.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;C(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Mt(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}})),e.on("element.changed",500,(function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(C(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&&at(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};const hi={__init__:["overlays"],overlays:["type",li]};function fi(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(Un(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}fi.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const mi={__init__:["changeSupport"],changeSupport:["type",fi]};function di(e){this._eventBus=e}di.$inject=["eventBus"],di.prototype.on=function(e,t,n,i,r,o){if((w(t)||b(t))&&(o=r,r=i,i=n,n=t,t=null),w(n)&&(o=r,r=i,i=n,n=1e3),x(r)&&(o=r,r=!1),!w(i))throw new Error("handlerFn must be a function");v(e)||(e=[e]);var a=this._eventBus;C(e,(function(e){var s=["commandStack",e,t].filter((function(e){return e})).join(".");a.on(s,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)}))};function yi(e,t){t.invoke(di,this),this.executed((function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()})),this.revert((function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)}))}C(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],(function(e){di.prototype[e]=function(t,n,i,r,o){(w(t)||b(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}})),u(yi,di),yi.$inject=["canvas","injector"];const gi={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",yi]};function vi(e){return CSS.escape(e)}var xi={"&":"&","<":"<",">":">",'"':""","'":"'"};function bi(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return xi[e]}))}var wi="_plane";function Ei(e){return function(e){return e.replace(new RegExp(wi+"$"),"")}(e.id)}function _i(e){var t=e.id;return Z(e,"bpmn:SubProcess")?Ri(t):t}function Ai(e){return Ri(e)}function Si(e){return Z(ee(e),"bpmndi:BPMNPlane")}function Ri(e){return e+wi}function Ci(e,t,n,i){var r=At('
    '),o=i.getContainer(),a=at(o);o.appendChild(r);var s=[];function l(e){e&&(s=function(e){for(var t=J(e),n=[],i=t;i;i=i.$parent)(Z(i,"bpmn:SubProcess")||Z(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var n=s.map((function(e){var n=bi(e.name||e.id),r=At('
  • '+n+"
  • "),o=i.findRoot(_i(e))||i.findRoot(e.id);if(!o&&Z(e,"bpmn:Process")){var a=t.find((function(t){var n=J(t);return n&&n.processRef&&n.processRef===e}));o=i.findRoot(a.id)}return r.addEventListener("click",(function(){i.setRootElement(o)})),r}));r.innerHTML="";var o=n.length>1;a.toggle("bjs-breadcrumbs-shown",o),n.forEach((function(e){r.appendChild(e)}))}e.on("element.changed",(function(e){var t=J(e.element);A(s,(function(e){return e===t}))&&l()})),e.on("root.set",(function(e){l(e.element)}))}function Mi(e,t){var n=null,i=new ki;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),a=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!Z(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,l=(o.y-a.y)*o.scale;0===s&&0===l||t.scroll({dx:s,dy:l}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function ki(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}Ci.$inject=["eventBus","elementRegistry","overlays","canvas"],Mi.$inject=["eventBus","canvas"];var Pi=180,Di=160;function Oi(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,(function(e,t){n.handleImport(t.definitions)}))}function Ti(e){return Z(e,"bpmndi:BPMNDiagram")?e:Ti(e.$parent)}Oi.prototype.handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t.createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t.movePlaneElementsToOrigin(e.plane)}))}},Oi.prototype.createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;Z(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!Z(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(Q(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}}));var r=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t.createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}})),i.forEach((function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t.moveToDiPlane(i,o.plane)}})),r},Oi.prototype.movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach((function(e){if(e.bounds){var n=dn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),yn(t)}(e),i=n.x-Pi,r=n.y-Di;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-i,e.y=e.y-r})):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)}))},Oi.prototype.moveToDiPlane=function(e,t){var n=Ti(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},Oi.prototype.createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Oi.$inject=["eventBus","moddle"];var Ni=250;function Bi(e,t,n,i){di.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",Ni,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",Ni,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],Ni,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r.canDrillDown(i)&&r.addOverlay(i),r.updateDrilldownOverlay(t),r.updateDrilldownOverlay(n),r.updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],Ni,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r.canDrillDown(i)&&r.addOverlay(i),r.updateDrilldownOverlay(t),r.updateDrilldownOverlay(n),r.updateDrilldownOverlay(i)}),!0),t.on("import.render.complete",(function(){n.filter((function(e){return r.canDrillDown(e)})).map((function(e){r.addOverlay(e)}))}))}u(Bi,di),Bi.prototype.updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this.updateOverlayVisibility(n)}},Bi.prototype.canDrillDown=function(e){var t=this._canvas;return Z(e,"bpmn:SubProcess")&&t.findRoot(_i(e))},Bi.prototype.updateOverlayVisibility=function(e){var t=this._overlays,n=e.businessObject,i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.flowElements&&n.flowElements.length;at(i.html).toggle("bjs-drilldown-empty",!r)}},Bi.prototype.addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this.removeOverlay(e);var i=At('');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(_i(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this.updateOverlayVisibility(e)},Bi.prototype.removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Bi.$inject=["canvas","eventBus","elementRegistry","overlays"];const Li={__depends__:[hi,mi,gi],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Ci],drilldownCentering:["type",Mi],drilldownOverlayBehavior:["type",Bi],subprocessCompatibility:["type",Oi]},Ii=/^class[ {]/;function ji(e){return Array.isArray(e)}function Fi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Vi(...e){1===e.length&&ji(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const Wi=/constructor\s*[^(]*\(\s*([^)]*)\)/m,zi=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,$i=/\/\*([^*]*)\*\//m;function Gi(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return Ii.test(e.toString())}(e)?Wi:zi);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match($i);return(t&&t[1]||e).trim()}))||[]}function Hi(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}};const n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(e){const t=n.join(" -> ");return n.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function s(e,o){if(!i[e]&&-1!==e.indexOf(".")){const t=e.split(".");let n=s(t.shift());for(;t.length;)n=n[t.shift()];return n}if(Fi(r,e))return r[e];if(Fi(i,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),r[e]=i[e][0](i[e][1]),n.pop(),r[e]}return t.get(e,o)}function l(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!ji(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=Vi(e.slice())}return{fn:e,dependencies:(e.$inject||Gi(e)).map((e=>Fi(t,e)?t[e]:s(e)))}}function c(e){const{fn:t,dependencies:n}=l(e);return new(Function.prototype.bind.apply(t,[null].concat(n)))}function p(e,t,n){const{fn:i,dependencies:r}=l(e,n);return i.apply(t,r)}function u(e){return Vi((t=>e.get(t)))}function h(e,t){if(t&&t.length){const n=Object.create(null),r=Object.create(null),o=[],a=[],s=[];let l,c,p,h;for(let e in i)l=i[e],-1!==t.indexOf(e)&&("private"===l[2]?(c=o.indexOf(l[3]),-1===c?(p=l[3].createChild([],t),h=u(p),o.push(l[3]),a.push(p),s.push(h),n[e]=[h,e,"private",p]):n[e]=[s[c],e,"private",a[c]]):n[e]=[l[2],l[1]],r[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach((t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[1]],r[t]=!0)}));t.forEach((e=>{if(!r[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new Hi(e,o)}const f={factory:p,type:c,value:function(e){return e}};function m(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function d(e){const t=e.__exports__;if(t){const n=e.__modules__,r=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=h((n||[]).concat(r)),a=Vi((function(e){return o.get(e)}));t.forEach((function(e){i[e]=[a,e,"private",o]}));const s=(e.__init__||[]).slice();return s.unshift((function(){o.init()})),m(e=Object.assign({},e,{__init__:s}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;if("private"===e[t][2])return void(i[t]=e[t]);const n=e[t][0],r=e[t][1];i[t]=[f[n],Ki(n,r),n]})),m(e,o)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=s,this.invoke=p,this.instantiate=c,this.createChild=h,this.init=function(e){const t=e.reduce(y,[]).map(d);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function Ki(e,t){return"value"!==e&&ji(t)&&(t=Vi(t.slice())),t}function qi(e,t){X.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}u(qi,X),qi.prototype.canRender=function(){return!0},qi.prototype.drawShape=function(e,t,n){var i=_e("rect");return me(i,{x:0,y:0,width:t.width||0,height:t.height||0}),Yn(t)?me(i,q({},this.FRAME_STYLE,n||{})):me(i,q({},this.SHAPE_STYLE,n||{})),ue(e,i),i},qi.prototype.drawConnection=function(e,t,n){var i=ze(t.waypoints,q({},this.CONNECTION_STYLE,n||{}));return ue(e,i),i},qi.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return Ie([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},qi.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 Ie(r)},qi.$inject=["eventBus","styles"];const Ui={__init__:["defaultRenderer"],defaultRenderer:["type",qi],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return q(this.style(t,n),{class:e})},this.style=function(t,n){v(t)||n||(n=t,t=[]);var i=k(t,(function(t,n){return q(t,e[n]||{})}),{});return n?q(i,n):i},this.computeStyle=function(e,n,i){return v(n)||(i=n,n=[]),t.style(n||[],q({},i,e||{}))}}]};function Yi(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function Xi(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function Zi(e,t){return e&&t?e.indexOf(t):-1}function Qi(e,t){return Math.round(e*t)/t}function Ji(e){return b(e)?e+"px":e}function er(e,t,n){const i=_e("g");ye(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const tr={shape:["x","y","width","height"],connection:["waypoints"]};function nr(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function ir(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}nr.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],nr.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=q({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),it(n,{position:"relative",overflow:"hidden",width:Ji(e.width),height:Ji(e.height)}),t.appendChild(n),n}(e),i=this._svg=_e("svg");me(i,{width:"100%",height:"100%"}),ue(n,i);const r=this._viewport=er(i,"viewport");!1!==e.deferUpdate&&(this._viewboxChanged=H(K(this._viewboxChanged,this),300)),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:i,viewport:r})})),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(()=>{delete this._cachedViewbox})),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},nr.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},nr.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=Un(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},nr.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},nr.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},nr.prototype._getChildIndex=function(e){return k(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},nr.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:er(this._viewport,"layer-"+e,n),index:t,visible:!0}},nr.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},nr.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible?(Ne(n),t.visible=!1,n):n},nr.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Ne(t.group))},nr.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},nr.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),!e)return;const t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement},nr.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},nr.prototype._findPlaneForRoot=function(e){return A(this._planes,(function(t){return t.rootElement===e}))},nr.prototype.getContainer=function(){return this._container},nr.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(C([i.gfx,i.secondaryGfx],(function(e){e&&(n?ye(e).add(t):ye(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},nr.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},nr.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},nr.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));return ye(this.getGraphics(e)).has(t)},nr.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},nr.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},nr.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},nr.prototype.removeRootElement=function(e){"string"==typeof e&&(e=this._elementRegistry.get(e));if(this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},nr.prototype.setRootElement=function(e,t){if(y(t))throw new Error("override not supported");if(e===this._rootElement)return;let n;if(!e)throw new Error("rootElement required");return n=this._findPlaneForRoot(e),n||(e=this.addRootElement(e)),this._setRoot(e),e},nr.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},nr.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},nr.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},nr.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=tr[e];if(!P(n,(function(e){return void 0!==t[e]})))throw new Error("must supply { "+n.join(", ")+" } with "+e)},nr.prototype._setParent=function(e,t,n){Xi(t.children,e,n),e.parent=t},nr.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},nr.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},nr.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},nr.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),Yi(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},nr.prototype.removeShape=function(e){return this._removeElement(e,"shape")},nr.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},nr.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},nr.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},nr.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},nr.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,a,s,l,c;return e?(this._changeViewbox((function(){s=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Le(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=Le(t),r=a?a.matrix:function(e,t,n,i,r,o){var a=Se().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Re(a,e);case 6:return Re(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),s=Qi(r.a,1e3),l=Qi(-r.e||0,1e3),c=Qi(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/s:0,y:c?c/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},nr.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=q({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),ir(t,n)})),{x:n.e,y:n.f}},nr.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);i!==this.getRootElement()&&this.setRootElement(i),t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=Kn(e),o=dn(r),a=this.viewbox(),s=this.zoom();let l,c;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const p=dn(a);if(r.width=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},nr.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,l,c,p;l=i.getCTM();const u=l.a;return t?(a=q(o,t),s=a.matrixTransform(l.inverse()),c=r.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),p=l.multiply(c)):p=r.scale(e),ir(this._viewport,p),p},nr.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},nr.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;if(e.waypoints){n=this.getGraphics(e).getBBox()}else n=e;return{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},nr.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var rr="data-element-id";function or(e){this._elements={},this._eventBus=e}or.$inject=["eventBus"],or.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),me(t,rr,i),n&&me(n,rr,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},or.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(me(i.gfx,rr,""),i.secondaryGfx&&me(i.secondaryGfx,rr,""),delete t[n])},or.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)},or.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&me(t,rr,i),t},or.prototype.get=function(e){var t;t="string"==typeof e?e:e&&me(e,rr);var n=this._elements[t];return n&&n.element},or.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},or.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i in ref");n=this.props[n]}n.collection?t(this,n,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,n,e)},n.prototype.ensureRefsCollection=function(n,i){var r=n[i.name];return e.isExtended(r)||t(this,i,n),r},n.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},n.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},n.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)},sr=n}const mr=p((cr||(cr=1,pr.exports=fr(),pr.exports.Collection=hr()),pr.exports));var dr=new mr({name:"children",enumerable:!0,collection:!0},{name:"parent"}),yr=new mr({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),gr=new mr({name:"attachers",collection:!0},{name:"host"}),vr=new mr({name:"outgoing",collection:!0},{name:"source"}),xr=new mr({name:"incoming",collection:!0},{name:"target"});function br(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),dr.bind(this,"parent"),yr.bind(this,"labels"),vr.bind(this,"outgoing"),xr.bind(this,"incoming")}function wr(){br.call(this),dr.bind(this,"children"),gr.bind(this,"host"),gr.bind(this,"attachers")}function Er(){wr.call(this)}function _r(){wr.call(this),yr.bind(this,"labelTarget")}function Ar(){br.call(this),vr.bind(this,"source"),xr.bind(this,"target")}u(wr,br),u(Er,wr),u(_r,wr),u(Ar,br);var Sr={connection:Ar,shape:wr,label:_r,root:Er};function Rr(){this._uid=12}Rr.prototype.createRoot=function(e){return this.create("root",e)},Rr.prototype.createLabel=function(e){return this.create("label",e)},Rr.prototype.createShape=function(e){return this.create("shape",e)},Rr.prototype.createConnection=function(e){return this.create("connection",e)},Rr.prototype.create=function(e,t){return(t=q({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Sr[e];if(!n)throw new Error("unknown type: <"+e+">");return q(new n,t)}(e,t)};var Cr="__fn",Mr=Array.prototype.slice;function kr(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Pr(){}function Dr(e){return e.childNodes[0]}function Or(e,t){this._eventBus=e,this._elementRegistry=t}function Tr(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}kr.prototype.on=function(e,t,n,i){if(e=v(e)?e:[e],w(t)&&(i=n,n=t,t=1e3),!b(t))throw new Error("priority must be a number");var r=n;i&&((r=K(n,i))[Cr]=n[Cr]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},kr.prototype.once=function(e,t,n,i){var r=this;if(w(t)&&(i=n,n=t,t=1e3),!b(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[Cr]=n,this.on(e,t,o)},kr.prototype.off=function(e,t){e=v(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},kr.prototype.createEvent=function(e){var t=new Pr;return t.init(e),t},kr.prototype.fire=function(e,t){var n,i,r,o;if(o=Mr.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof Pr?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},kr.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},kr.prototype._destroy=function(){this._listeners={}},kr.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},kr.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(r){if(!this.handleError(r))throw r}return i},kr.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority or , got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Hr(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Kr(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,C(e,K(this.registerPackage,this))}function qr(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Ur(e){this.model=e}function Yr(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Xr(e){return e.replace(/^:/,"")}function Zr(e,t={}){this.properties=new Ur(this),this.factory=new jr(this,this.properties),this.registry=new Kr(e,this.properties),this.typeCache={},this.config=t}Hr.prototype.build=function(){return U(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Hr.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)},Hr.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(-1===s)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},Hr.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Gr(r[0],i),a=Gr(r[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Hr.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},Hr.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Hr.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},Hr.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},Hr.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},Hr.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")},Hr.prototype.hasProperty=function(e){return this.propertiesByName[e]},Hr.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(C(e.properties,K((function(n){n=q({},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)},Kr.prototype.getPackage=function(e){return this.packageMap[e]},Kr.prototype.getPackages=function(){return this.packages},Kr.prototype.registerPackage=function(e){e=q({},e);var t=this.packageMap;qr(t,e,"prefix"),qr(t,e,"uri"),C(e.types,K((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Kr.prototype.registerType=function(e,t){var n=Gr((e=q({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:q(e.meta||{})})).name,t.prefix),i=n.name,r={};C(e.properties,K((function(e){var t=Gr(e.name,n.prefix),i=t.name;zr(e.type)||(e.type=Gr(e.type,t.prefix).name),q(e,{ns:t,name:i}),r[i]=e}),this)),q(e,{ns:n,name:i,propertiesByName:r}),C(e.extends,K((function(e){var t=Gr(e,n.prefix),r=this.typeMap[t.name];r.traits=r.traits||[],r.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},Kr.prototype.mapTypes=function(e,t,n){var i=zr(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=Gr(n,zr(n)?"":e.prefix);r.mapTypes(o,t,i)}function a(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");C(i.superClass,n?a:function(e){return o(e,!1)}),t(i,!n),C(i.traits,a)},Kr.prototype.getEffectiveDescriptor=function(e){var t=Gr(e),n=new Hr(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},Kr.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Ur.prototype.set=function(e,t,n){if(!E(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[Xr(t)]:i?r in e?e[r]=n:Yr(e,i,n):e.$attrs[Xr(t)]=n},Ur.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Xr(t)];var i=n.name;return!e[i]&&n.isMany&&Yr(e,n,[]),e[i]},Ur.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=q({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Ur.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Ur.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Ur.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(void 0!==r){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n}return null},Zr.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Zr.prototype.getType=function(e){var t=this.typeCache,n=E(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Zr.prototype.createAny=function(e,t,n){var i=Gr(e),r={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){!function(e,t,n){let i=e;C(t,(function(e,r){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let o=t[r+1],a=i[e];y(o)&&g(a)&&(a=i[e]=isNaN(+o)?{}:[]),d(o)?d(n)?delete i[e]:i[e]=n:i=a}))}(this,[e],t)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),C(n,(function(e,t){x(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},Zr.prototype.getPackage=function(e){return this.registry.getPackage(e)},Zr.prototype.getPackages=function(){return this.registry.getPackages()},Zr.prototype.getElementDescriptor=function(e){return e.$descriptor},Zr.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Zr.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Zr.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Qr=String.fromCharCode,Jr=Object.prototype.hasOwnProperty,eo=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,to={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function no(e,t,n,i){return i?Jr.call(to,i)?to[i]:"&"+i+";":Qr(t||parseInt(n,16))}function io(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(eo,no):e}Object.keys(to).forEach((function(e){to[e.toUpperCase()]=to[e]}));var ro="xsi:type",oo="non-whitespace outside of root node";function ao(e){return new Error(e)}function so(e){return"missing namespace for prefix <"+e+">"}function lo(e){return{get:e,enumerable:!0}}function co(e){var t,n={};for(t in e)n[t]=e[t];return n}function po(e){return e+"$uri"}function uo(){return{line:0,column:0}}function ho(e){throw e}function fo(e){if(!this)return new fo(e);var t,n,i,r,o,a,s,l,c,p=e&&e.proxy,u=ho,h=uo,f=!1,m=!1,d=null,y=!1;function g(e){e instanceof Error||(e=ao(e)),d=e,u(e,h)}function v(e){o&&(e instanceof Error||(e=ao(e)),o(e,h))}this.on=function(e,c){if("function"!=typeof c)throw ao("required args ");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":i=c;break;case"error":u=c;break;case"warn":o=c;break;case"cdata":r=c;break;case"attention":l=c;break;case"question":s=c;break;case"comment":a=c;break;default:throw ao("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw ao("required args ");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",m=!0,c=n,this},this.parse=function(e){if("string"!=typeof e)throw ao("required args ");return d=null,function(e){var o,u,d,x,b,w,E,_,A,S,R,C=m?[]:null,M=m?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[po(n)]=t;return i}(c):null,k=[],P=0,D=!1,O=!1,T=0,N=0,B="",L=0;function I(){if(null!==R)return R;var e,t,n,i,r,o,a,s,l,p,u,h=m&&M.xmlns,d=m&&f?[]:null,y=L,g=B,x=g.length,b={},w={};e:for(;y8)){for((p<65||p>122||p>90&&p<97)&&95!==p&&58!==p&&(v("illegal first char attribute name"),l=!0),u=y+1;u96&&p<123||p>64&&p<91||p>47&&p<59||46===p||45===p||95===p)){if(32===p||p<14&&p>8){v("missing attribute value"),y=u;continue e}if(61===p)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),l=!0),34===(p=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),l=!0);else if(39===p)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u8);u++);for(-1===u&&(v("missing closing quotes"),u=x,l=!0),l||(o=g.substring(y,u)),y=u;u+18);u++)y===u&&(v("illegal character after attribute end"),l=!0);if(y=u+1,!l)if(s in w)v("attribute <"+s+"> already defined");else if(w[s]=!0,m)if(f){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=io(o),t=po(r),!(a=c[e])){if("xmlns"===r||t in M&&M[t]!==e)do{a="ns"+P++}while(void 0!==M[a]);else a=r;c[e]=a}M[r]!==a&&(i||(M=co(M),i=!0),M[r]=a,"xmlns"===r&&(M[po(a)]=e,h=a),M[t]=e),b[s]=o;continue}d.push(s,o)}else-1!==(p=s.indexOf(":"))?(n=M[s.substring(0,p)])?((s=h===n?s.substr(p+1):n+s.substr(p))===ro&&(-1!==(p=o.indexOf(":"))?(n=o.substring(0,p),o=(n=M[n]||n)+o.substring(p)):o=h+":"+o),b[s]=o):v(so(s.substring(0,p))):b[s]=o;else b[s]=o}if(f)for(y=0,x=d.length;y=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>T);)r+=1,a=s;return-1==T?(o=s,n=e.substring(N)):0===N?n=e.substring(N,T):(o=T-a,n=-1==N?e.substring(T):e.substring(T,N+1)),{data:n,line:r,column:o}}h=j,p&&(S=Object.create({},{name:lo((function(){return _})),originalName:lo((function(){return A})),attrs:lo(I),ns:lo((function(){return M}))}));for(;-1!==N;){if(-1===(T=60===e.charCodeAt(N)?N:e.indexOf("<",N)))return k.length?g("unexpected end of file"):0===N?g("missing start tag"):void(N",T)))return g("unclosed cdata");if(r&&(r(e.substring(T+9,N),h),y))return;N+=3;continue}if(45===x&&45===e.charCodeAt(T+3)){if(-1===(N=e.indexOf("--\x3e",T)))return g("unclosed comment");if(a&&(a(e.substring(T+4,N),io,h),y))return;N+=3;continue}}if(63!==b){for(u=T+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return N=-1,g("unclosed tag");if(34===w)u=-1!==(x=e.indexOf('"',u+1))?x:u;else if(39===w)u=-1!==(x=e.indexOf("'",u+1))?x:u;else if(62===w){N=u;break}}if(33!==b){if(R={},47===b){if(D=!1,O=!0,!k.length)return g("missing open tag");if(u=_=k.pop(),x=T+2+u.length,e.substring(T+2,x)!==u)return g("closing tag mismatch");for(;x8&&b<14))return g("close tag")}else{if(47===e.charCodeAt(N-1)?(u=_=e.substring(T+1,N-1),D=!0,O=!0):(u=_=e.substring(T+1,N),D=!0,O=!1),!(b>96&&b<123||b>64&&b<91||95===b||58===b))return g("illegal first char nodeName");for(x=1,d=u.length;x96&&b<123||b>64&&b<91||b>47&&b<59||45===b||95===b||46==b)){if(32===b||b<14&&b>8){_=u.substring(0,x),R=null;break}return g("invalid nodeName")}O||k.push(_)}if(m){if(o=M,D&&(O||C.push(o),null===R&&(f=-1!==u.indexOf("xmlns",x))&&(L=x,B=u,I(),f=!1)),A=_,-1!==(b=_.indexOf(":"))){if(!(E=M[_.substring(0,b)]))return g("missing namespace on <"+A+">");_=_.substr(b+1)}else E=M.xmlns;E&&(_=E+":"+_)}if(D&&(L=x,B=u,n&&(p?n(S,io,O,h):n(_,I,io,O,h),y)))return;if(O){if(i&&(i(p?S:_,io,D,h),y))return;m&&(M=D?o:C.pop())}N+=1}else{if(l&&(l(e.substring(T,N+1),io,h),y))return;N+=1}}else{if(-1===(N=e.indexOf("?>",T)))return g("unclosed question");if(s&&(s(e.substring(T,N+2),h),y))return;N+=2}}}(e),h=uo,y=!1,d},this.stop=function(){y=!0}}function mo(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var yo={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},go="xsi:type";function vo(e){return e.xml&&e.xml.serialize}function xo(e){return vo(e)===go}function bo(e,t){return mo(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function wo(e){return new Error(e)}function Eo(e){return e.$descriptor}function _o(e){q(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw wo("expected element");var t,n=this.elementsById,i=Eo(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw wo("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Ao(){}function So(){}function Ro(){}function Co(e,t){this.property=e,this.context=t}function Mo(e,t){this.element=t,this.propertyDesc=e}function ko(){}function Po(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Do(e,t,n){Po.call(this,e,t,n)}function Oo(e,t,n){this.model=e,this.context=n}function To(e){e instanceof Zr&&(e={model:e}),q(this,{lax:!1},e)}Ao.prototype.handleEnd=function(){},Ao.prototype.handleText=function(){},Ao.prototype.handleNode=function(){},So.prototype=Object.create(Ao.prototype),So.prototype.handleNode=function(){return this},Ro.prototype=Object.create(Ao.prototype),Ro.prototype.handleText=function(e){this.body=(this.body||"")+e},Co.prototype=Object.create(Ro.prototype),Co.prototype.handleNode=function(e){if(this.element)throw wo("expected no sub nodes");return this.element=this.createReference(e),this},Co.prototype.handleEnd=function(){this.element.id=this.body},Co.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Mo.prototype=Object.create(Ro.prototype),Mo.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Wr(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},ko.prototype=Object.create(Ro.prototype),ko.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},Po.prototype=Object.create(ko.prototype),Po.prototype.addReference=function(e){this.context.addReference(e)},Po.prototype.handleText=function(e){if(!Eo(this.element).bodyProperty)throw wo("unexpected body text <"+e+">");Ro.prototype.handleText.call(this,e)},Po.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Eo(t).bodyProperty;n&&void 0!==e&&(e=Wr(n.type,e),t.set(n.name,e))},Po.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Eo(i),o=this.context,a=new i({}),s=this.model;return C(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?C(e.split(" "),(function(e){o.addReference({element:a,property:i.ns.name,id:e})})):o.addReference({element:a,property:i.ns.name,id:e}):(i?e=Wr(i.type,e):"xmlns"!==n&&(t=Gr(n,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},Po.prototype.getPropertyForNode=function(e){var t,n,i=Gr(e.name),r=this.type,o=this.model,a=Eo(r),s=i.name,l=a.propertiesByName[s];if(l&&!l.isAttr)return xo(l)&&(t=e.attributes[go])?(t=function(e,t){var n=Gr(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),q({},l,{effectiveType:Eo(n=o.getType(t)).name})):l;var c=o.getPackage(i.prefix);if(c){if(t=bo(i,c),n=o.getType(t),l=A(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return q({},l,{effectiveType:Eo(n).name})}else if(l=A(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw wo("unrecognized element <"+i.name+">")},Po.prototype.toString=function(){return"ElementDescriptor["+Eo(this.type).name+"]"},Po.prototype.valueHandler=function(e,t){return new Mo(e,t)},Po.prototype.referenceHandler=function(e){return new Co(e,this.context)},Po.prototype.handler=function(e){return"Element"===e?new Oo(this.model,e,this.context):new Po(this.model,e,this.context)},Po.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,$r(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(q(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Do.prototype=Object.create(Po.prototype),Do.prototype.createElement=function(e){var t=e.name,n=Gr(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&bo(n,o)||t;if(!r.hasType(a))throw wo("unexpected element <"+e.originalName+">");return Po.prototype.createElement.call(this,e)},Oo.prototype=Object.create(ko.prototype),Oo.prototype.createElement=function(e){var t=e.name,n=Gr(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Oo.prototype.handleChild=function(e){var t=new Oo(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},Oo.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},To.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Po?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,a=new _o(q({},t,{rootHandler:i})),s=new fo({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function c(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw wo(l)}function p(e,t){return c(e,t,!0)}i.context=a,l.push(i);var u=/^<\?xml /i,h=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function m(e,t){try{l.peek().handleText(e)}catch(n){p(n,t)}}var d=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(d).on("openTag",(function(e,t,n,i){var r=e.attrs||{},a=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(i){c(i,t,o)&&l.push(new So)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=h.exec(e),n=t&&t[1];n&&!f.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",m).on("text",(function(e,t,n){!function(e,t){e.trim()&&m(e,t)}(t(e),n)})).on("error",c).on("warn",p),new Promise((function(t,n){var r;try{s.parse(e),function(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=Eo(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=r.get(s.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else r.set(s.name,o)}}()}catch(u){r=u}var o=i.element;r||o||(r=wo("failed to parse document as <"+i.type.$descriptor.name+">"));var l=a.warnings,c=a.references,p=a.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:p,references:c,warnings:l})}))},To.prototype.handler=function(e){return new Do(this.model,e)};var No=/<|>|'|"|&|\n\r|\n/g,Bo=/<|>|&/g;function Lo(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function Io(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function jo(e){return E(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var Fo={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Vo={"<":"lt",">":"gt","&":"amp"};function Wo(e,t,n){return(e=E(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function zo(e){this.tagName=e}function $o(){}function Go(e){this.tagName=e}function Ho(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Ko(e,t){Ho.call(this,e,t)}function qo(){this.value="",this.write=function(e){this.value+=e}}function Uo(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Yo(e){return e=q({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new qo,r=new Uo(i,e.format);if(e.preamble&&r.append('\n'),(new Ho).build(t).serializeTo(r),!n)return i.value}}}function Xo(e,t){Zr.call(this,e,t)}zo.prototype.build=function(e){return this.element=e,this},zo.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()},$o.prototype.serializeValue=$o.prototype.serializeTo=function(e){e.append(this.escape?Wo(this.value,Bo,Vo):this.value)},$o.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Bo)&&(this.escape=!0),this},Io(Go,$o),Go.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()},Ho.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return R(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!_(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(R(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return R(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},Ho.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?q({localName:t.ns.localName},e):q({localName:(n=t.ns.localName,i=t.$pkg,mo(i)?(r=n).charAt(0).toLowerCase()+r.slice(1):n)},e);var n,i,r}(this.logNamespaceUsed(e.ns),e)},Ho.prototype.nsPropertyTagName=function(e){return function(e,t){return q({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Ho.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ho.prototype.nsAttributeName=function(e){var t;if(t=E(e)?Gr(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}:q({localName:t.localName},n)},Ho.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return C(e,(function(r,o){"$body"===o?n.push((new $o).build({type:"String"},r)):"$children"===o?C(r,(function(e){n.push(new Ho(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},Ho.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Gr(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},Ho.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return C(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},Ho.prototype.parseGenericAttributes=function(e,t){var n=this;C(t,(function(e){if(e.name!==go)try{n.addAttribute(n.nsAttributeName(e.name),e.value)}catch(t){}}))},Ho.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;C(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new $o).build(e,r[0]));else if($r(e.type))C(r,(function(i){n.push(new Go(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)C(r,(function(i){n.push(new zo(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var a=xo(e),s=function(e){return"property"===vo(e)}(e);C(r,(function(i){var r;r=a?new Ko(t,e):s?new Ho(t,e):new Ho(t),n.push(r.build(i))}))}}))},Ho.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Lo(t):n=t),n},Ho.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Ho.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(r=yo[s]||o&&(o.getPackage(s)||{}).uri,!(l=l||r||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(l))){for(n=s,i=1;a.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return s&&a.mapPrefix(s,l),e},Ho.prototype.parseAttributes=function(e){var t=this,n=this.element;C(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];C(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Ho.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),jo(e)},Ho.prototype.addAttribute=function(e,t){var n=this.attrs;E(t)&&(t=Wo(t,No,Fo));var i=S(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},Ho.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),C(t,(function(t){e.append(" ").append(jo(t.name)).append('="').append(t.value).append('"')}))},Ho.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==$o;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),C(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()},Io(Ko,Ho),Ko.prototype.parseNsAttributes=function(e){var t=Ho.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(go),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},Ko.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Xo.prototype=Object.create(Zr.prototype),Xo.prototype.fromXML=function(e,t,n){E(t)||(n=t,t="bpmn:Definitions");var i=new To(q({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Xo.prototype.toXML=function(e,t){var n=new Yo(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(r){return i(r)}}))};var Zo={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function Qo(e,t){return new Xo(q({},Zo,e),t)}function Jo(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(!(t>=1&&w(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1],i=Array.prototype.slice.call(arguments,0,-1);e.apply(this,i).then((function(e){var t=Object.keys(e)[0];return n(null,e[t])}),(function(e){return n(e,e.warnings)}))}}function ea(e){_(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error("Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472")}})}function ta(e,t){return e.$instanceOf(t)}function na(e,t){var n={},i=[],r={};function o(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function s(n,i){try{var o=r[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:En(n)}));return e.element(n,r[n.id],i)}(n,i);return a(n),o}catch(s){l(s.message,{element:n,error:s})}}function l(t,n){e.error(t,n)}function c(e){var n=e.bpmnElement;n?r[n.id]?l(t("multiple DI elements defined for {element}",{element:En(n)}),{element:n}):(r[n.id]=e,ea(n)):l(t("no bpmnElement referenced in {element}",{element:En(e)}),{element:e})}function p(e){var t;c(t=e.plane),C(t.planeElement,u)}function u(e){c(e)}function h(){for(;i.length;)i.shift()()}function f(e,t){k(e,t),b(e.ioSpecification,t),x(e.artifacts,t),a(e)}function m(e,t){s(e,t)}function d(e,t){s(e,t)}function y(e,t){s(e,t)}function g(e,t){s(e,t)}function v(e,t){s(e,t)}function x(e,t){C(e,(function(e){ta(e,"bpmn:Association")?i.push((function(){v(e,t)})):v(e,t)}))}function b(e,t){e&&(C(e.dataInputs,o(y,t)),C(e.dataOutputs,o(g,t)))}function w(e,t){k(e,t),x(e.artifacts,t)}function E(e,t){var n=s(e,t);ta(e,"bpmn:SubProcess")&&w(e,n||t),ta(e,"bpmn:Activity")&&b(e.ioSpecification,t),i.push((function(){C(e.dataInputAssociations,o(d,t)),C(e.dataOutputAssociations,o(d,t))}))}function _(e,t){s(e,t)}function S(e,t){i.push((function(){var n=s(e,t);e.childLaneSet&&M(e.childLaneSet,n||t),function(e){C(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function M(e,t){C(e.lanes,o(S,t))}function k(e,n){!function(e,n){C(e,(function(e){ta(e,"bpmn:SequenceFlow")?i.push((function(){!function(e,t){s(e,t)}(e,n)})):ta(e,"bpmn:BoundaryEvent")?i.unshift((function(){E(e,n)})):ta(e,"bpmn:FlowNode")?E(e,n):ta(e,"bpmn:DataObject")||(ta(e,"bpmn:DataStoreReference")||ta(e,"bpmn:DataObjectReference")?_(e,n):l(t("unrecognized flowElement {element} in context {context}",{element:En(e),context:n?En(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){C(e,o(M,t))}(e.laneSets,n)}function P(e,t){var n=s(e,t),i=e.processRef;i&&f(i,n||t)}return{handleDeferred:h,handleDefinitions:function(a,s){var u=a.diagrams;if(s&&-1===u.indexOf(s))throw new Error(t("diagram not part of bpmn:Definitions"));if(!s&&u&&u.length&&(s=u[0]),!s)throw new Error(t("no diagram to display"));r={},p(s);var d=s.plane;if(!d)throw new Error(t("no plane for {element}",{element:En(s)}));var y=d.bpmnElement;if(!y){if(y=function(e){return A(e.rootElements,(function(e){return ta(e,"bpmn:Process")||ta(e,"bpmn:Collaboration")}))}(a),!y)throw new Error(t("no process or collaboration to display"));l(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:En(d),rootElement:En(y)})),d.bpmnElement=y,c(d)}var g,v,b=function(t,n){return e.root(t,r[t.id],n)}(y,d);if(ta(y,"bpmn:Process")||ta(y,"bpmn:SubProcess"))f(y,b);else{if(!ta(y,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:En(d),rootElement:En(y)}));v=b,C((g=y).participants,o(P,v)),x(g.artifacts,v),i.push((function(){!function(e,t){C(e,o(m,t))}(g.messageFlows,v)})),function(e,t){R(e,(function(e){return!n[e.id]&&ta(e,"bpmn:Process")&&e.laneSets})).forEach(o(f,t))}(a.rootElements,b)}h()},handleSubProcess:w,registerDi:c}}function ia(e,t,n){var i,r,o,a,s=[];function l(e,t){var n=new na({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}},o);t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;Z(i,"bpmn:Process")||Z(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(Z(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=Z(r,"bpmn:Collaboration")?r:A(e.rootElements,(function(e){if(Z(e,"bpmn:Collaboration"))return A(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=O(n.participants,(function(e){return e.processRef}))).push(n);var a=ra(o),s=[t],l=[i];return C(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===l.indexOf(t)&&(s.push(e),l.push(t))})),s}(e,t);if(!r)throw new Error(o("no diagram to display"));C(r,(function(t){n.handleDefinitions(e,t)}));var l=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(l+"_plane")||a.findRoot(l))}return new Promise((function(c,p){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),a=e.get("canvas"),r.fire("import.render.start",{definitions:t}),l(t,n),r.fire("import.render.complete",{error:undefined,warnings:s}),c({warnings:s})}catch(u){return u.warnings=s,p(u)}}))}function ra(e){var t=[];return C(e,(function(e){e&&(t.push(e),t=t.concat(ra(e.flowElements)))})),t}var oa,aa='',sa={verticalAlign:"middle"},la={color:"#404040"},ca={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},pa={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},ua={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},ha='
    '+aa+'Web-based tooling for BPMN, DMN and CMMN diagrams powered by bpmn.io.
    ';function fa(){oa||(it(oa=At(ha),ca),it(Rt("svg",oa),sa),it(Rt(".backdrop",oa),pa),it(Rt(".notice",oa),ua),it(Rt(".link",oa),la,{margin:"15px 20px 15px 10px",alignSelf:"center"}),bt.bind(oa,".backdrop","click",(function(e){document.body.removeChild(oa)}))),document.body.appendChild(oa)}function ma(e){e=q({},ya,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=At(''+aa+"");it(Rt("svg",t),sa),it(t,la,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),gt.bind(t,"click",(function(e){fa(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function da(e,t){return e.warnings=t,e}u(ma,Lr),ma.prototype.importXML=Jo((function(e,t){return c(this,null,(function*(){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=yield this._moddle.fromXML(e,"bpmn:Definitions")}catch(r){throw this._emit("import.parse.complete",{error:r}),r}let a=o.rootElement;const s=o.references,l=o.warnings,c=o.elementsById;i=i.concat(l),a=this._emit("import.parse.complete",function(e){const t=n.get("eventBus").createEvent(e);return Object.defineProperty(t,"context",{enumerable:!0,get:function(){return{warnings:e.warnings,references:e.references,elementsById:e.elementsById}}}),t}({error:null,definitions:a,elementsById:c,references:s,warnings:i}))||a;const p=yield this.importDefinitions(a,t);return i=i.concat(p.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(o){let e=o;throw i=i.concat(e.warnings||[]),da(e,i),e=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(e),this._emit("import.done",{error:e,warnings:e.warnings}),e}}))})),ma.prototype.importDefinitions=Jo((function(e,t){return c(this,null,(function*(){this._setDefinitions(e);return{warnings:(yield this.open(t)).warnings}}))})),ma.prototype.open=Jo((function(e){return c(this,null,(function*(){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw da(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return A(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw da(t,[]),t}try{this.clear()}catch(r){throw da(r,[]),r}const{warnings:i}=yield ia(this,t,n);return{warnings:i}}))})),ma.prototype.saveXML=Jo((function(e){return c(this,null,(function*(){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(yield this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(o){t=o}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r}))})),ma.prototype.saveSVG=Jo((function(){return c(this,arguments,(function*(e={}){let t,n;this._emit("saveSVG.start");try{const e=this.get("canvas"),n=e.getActiveLayer(),i=Rt("defs",e._svg),r=Te(n),o=i?""+Te(i)+"":"",a=n.getBBox();t='\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n\n'+o+r+""}catch(i){n=i}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}}))})),ma.prototype._setDefinitions=function(e){this._definitions=e},ma.prototype.getModules=function(e){return this._modules},ma.prototype.clear=function(){this.getDefinitions()&&Lr.prototype.clear.call(this)},ma.prototype.destroy=function(){Lr.prototype.destroy.call(this),Mt(this._container)},ma.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},ma.prototype.off=function(e,t){this.get("eventBus").off(e,t)},ma.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=Rt(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},ma.prototype.getDefinitions=function(){return this._definitions},ma.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},ma.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=q(Y(n,["additionalModules"]),{canvas:q({},n.canvas,{container:e}),modules:o});Lr.call(this,a),n&&n.container&&this.attachTo(n.container)},ma.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},ma.prototype._createContainer=function(e){const t=At('
    ');return it(t,{width:ga(e.width),height:ga(e.height),position:e.position}),t},ma.prototype._createModdle=function(e){return new Qo(q({},this._moddleExtensions,e.moddleExtensions))},ma.prototype._modules=[];const ya={width:"100%",height:"100%",position:"relative"};function ga(e){return e+(b(e)?"px":"")}function va(e){ma.call(this,e)}function xa(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function ba(e,t){return{x:e.x-t.x,y:e.y-t.y}}function wa(e){return Math.log(e)/Math.log(10)}function Ea(e,t){var n=wa(e.min),i=wa(e.max);return(Math.abs(n)+Math.abs(i))/t}u(va,ma),va.prototype._modules=[Cn,Xt,oi,hi,Li],va.prototype._moddleExtensions={};var _a=Math.sign||function(e){return e>=0?1:-1},Aa={min:.2,max:4};function Sa(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=K(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}Sa.$inject=["config.zoomScroll","eventBus","canvas"],Sa.prototype.scroll=function(e){this._canvas.scroll(e)},Sa.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Sa.prototype.zoom=function(e,t){var n=Ea(Aa,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Sa.prototype._handleWheel=function(e){if(!ct(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*_a(e.deltaY)*o,this.zoom(n,s)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},Sa.prototype.stepZoom=function(e,t){var n=Ea(Aa,10);this._zoom(e,t,n)},Sa.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=wa(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s,l,c=Math.pow(10,a);i.zoom((s=Aa,l=c,Math.max(s.min,Math.min(s.max,l))),t)},Sa.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&>[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Sa.prototype._init=function(e){this.toggle(e)};const Ra={__init__:["zoomScroll"],zoomScroll:["type",Sa]};var Ca=/^djs-cursor-.*$/;function Ma(e){var t=at(document.body);t.removeMatching(Ca),e&&t.add("djs-cursor-"+e)}function ka(){Ma(null)}function Pa(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function Da(e,t){var n;function i(i){var r,o=n.start,a=n.button,s=Dn(i),l=ba(s,o);(!n.dragging&&(r=l,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&Pa(e),Ma("grab")),n.dragging)&&(l=ba(s,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=s);i.preventDefault()}function r(e){gt.unbind(document,"mousemove",i),gt.unbind(document,"mouseup",r),n=null,ka()}e.on("element.mousedown",500,(function(e){return function(e){if(ct(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:Dn(e)},gt.bind(document,"mousemove",i),gt.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}Da.$inject=["eventBus","canvas"];const Oa={__init__:["moveCanvas"],moveCanvas:["type",Da]};export{Pa as $,Y as A,ma as B,di as C,Vn as D,k as E,A as F,xn as G,dn as H,Bt as I,vn as J,Q as K,Z as L,Oa as M,h as N,hi as O,B as P,L as Q,V as R,yn as S,U as T,ba as U,va as V,Ma as W,Pn as X,ka as Y,Ra as Z,kn as _,gt as a,Rr as a$,oi as a0,rn as a1,hn as a2,un as a3,ln as a4,ye as a5,Pt as a6,Dt as a7,Ne as a8,Tn as a9,ce as aA,Qt as aB,Jt as aC,tn as aD,mi as aE,Yi as aF,Xi as aG,mn as aH,xa as aI,Gn as aJ,re as aK,_i as aL,Si as aM,Ai as aN,Ei as aO,ne as aP,oe as aQ,ae as aR,se as aS,S as aT,Xt as aU,I as aV,ai as aW,it as aX,Zi as aY,j as aZ,_r as a_,Ct as aa,wn as ab,on as ac,g as ad,x as ae,ve as af,bn as ag,ze as ah,K as ai,xe as aj,Dr as ak,b as al,O as am,$n as an,J as ao,ee as ap,d as aq,_ as ar,ie as as,te as at,Nn as au,lt as av,nn as aw,E as ax,fn as ay,kt as az,w as b,Zt as b0,ea as b1,Hn as b2,br as b3,T as b4,pe as b5,M as b6,pn as b7,N as b8,Qn as b9,Bn as ba,qn as bb,H as bc,bi as bd,Jo as be,ct as c,q as d,u as e,C as f,_e as g,me as h,v as i,ue as j,Fn as k,R as l,St as m,y as n,D as o,rt as p,At as q,Rt as r,F as s,Dn as t,vi as u,at as v,bt as w,P as x,Kn as y,Mt as z};