camunda-bpmn-js 4.8.0 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/diagram-js.css +990 -990
- package/dist/base-modeler.development.js +51883 -55778
- package/dist/base-modeler.production.min.js +35 -40
- package/dist/base-navigated-viewer.development.js +10883 -11388
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +8244 -8759
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +42729 -46627
- package/dist/camunda-cloud-modeler.production.min.js +37 -42
- package/dist/camunda-cloud-navigated-viewer.development.js +10650 -11155
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +8476 -8991
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +51741 -55665
- package/dist/camunda-platform-modeler.production.min.js +40 -45
- package/dist/camunda-platform-navigated-viewer.development.js +10882 -11387
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +8161 -8676
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BpmnViewer=t()}(this,(function(){"use strict";function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}const t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return void 0===e}function r(e){return void 0!==e}function o(e){return"[object Array]"===t.call(e)}function a(e){return"[object Object]"===t.call(e)}function s(e){return"[object Number]"===t.call(e)}function l(e){const n=t.call(e);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function p(e){return"[object String]"===t.call(e)}function c(e,t){return n.call(e,t)}function u(e,t){const n=v(t);let i;return h(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function m(e,t){const n=v(t);let i=[];return h(e,(function(e,t){n(e,t)&&i.push(e)})),i}function h(e,t){let n,r;if(i(e))return;const a=o(e)?x:b;for(let i in e)if(c(e,i)&&(n=e[i],r=t(n,a(i)),!1===r))return n}function f(e,t,n){return h(e,(function(e,i){n=t(n,e,i)})),n}function d(e,t){return!!f(e,(function(e,n,i){return e&&t(n,i)}),!0)}function y(e,t){return!!u(e,t)}function g(e){return function(t){return d(e,(function(e,n){return t[n]===e}))}}function v(e){return l(e)?e:t=>t===e}function b(e){return e}function x(e){return Number(e)}function w(e,t){return e.bind(t)}function E(e,...t){return Object.assign(e,...t)}var _=1e3;function A(e,t){var n=this;t=t||_,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,a):n.drawConnection(o,r,a)})),e.on(["render.getShapePath","render.getConnectionPath"],t,(function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)}))}function S(e,t){var n=k(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function R(e,t){return y(t,(function(t){return S(e,t)}))}function k(e){return e&&e.businessObject||e}function C(e){return e&&e.di}function M(e,t){return!S(e,"bpmn:CallActivity")&&(S(e,"bpmn:SubProcess")?!(!(t=t||C(e))||!S(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!S(e,"bpmn:Participant")||!!k(e).processRef)}function P(e){if(S(e,"bpmn:Participant")||S(e,"bpmn:Lane")){var t=C(e).isHorizontal;return void 0===t||t}}function T(e){return a(e)&&c(e,"labelTarget")}A.prototype.canRender=function(e){},A.prototype.drawShape=function(e,t){},A.prototype.drawConnection=function(e,t){},A.prototype.getShapePath=function(e){},A.prototype.getConnectionPath=function(e){};var O={width:90,height:20},N=15;function D(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=N:a+=N,{x:a,y:s}}function B(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(O.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=function(e){return e.waypoints?D(e.waypoints):S(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+O.height/2}:{x:e.x+e.width/2,y:e.y+e.height+O.height/2}}(t),i=O),E({x:n.x-i.width/2,y:n.y-i.height/2},i)}function I(e){var t=e.businessObject,n=function(e){return S(e,"bpmn:FlowElement")||S(e,"bpmn:Participant")||S(e,"bpmn:Lane")||S(e,"bpmn:SequenceFlow")||S(e,"bpmn:MessageFlow")||S(e,"bpmn:DataInput")||S(e,"bpmn:DataOutput")?"name":S(e,"bpmn:TextAnnotation")?"text":S(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function L(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function j(e,t){return L(t,e),e}var F=2,V={"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":F,"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":F,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function W(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=V[i];r?(r===F&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function z(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return V[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);W(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)W(e,i,t[i])}(e,t);return e}const $=Object.prototype.toString;function G(e){return new H(e)}function H(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function U(e){var t=e.parentNode;return t&&t.removeChild(e),e}function K(e){for(var t;t=e.firstChild;)U(t);return e}H.prototype.add=function(e){return this.list.add(e),this},H.prototype.remove=function(e){return"[object RegExp]"==$.call(e)?this.removeMatching(e):(this.list.remove(e),this)},H.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},H.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},H.prototype.array=function(){return Array.from(this.list)},H.prototype.has=H.prototype.contains=function(e){return this.list.contains(e)};var q={svg:"http://www.w3.org/2000/svg"},Y='<svg xmlns="'+q.svg+'"';function X(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(q.svg)&&(e=Y+e.substring(4)):(e=Y+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function Z(e,t){var n;return"<"===e.charAt(0)?(n=X(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(q.svg,e),t&&z(n,t),n}var J=null;function Q(){return null===J&&(J=Z("svg")),J}function ee(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function te(e){return e?Q().createSVGTransformFromMatrix(e):Q().createSVGTransform()}var ne=/([&<>]{1})/g,ie=/([\n\r"]{1})/g,re={"&":"&","<":"<",">":">",'"':"'"};function oe(e,t){return e.replace(t,(function(e,t){return re[t]||t}))}function ae(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(oe(e.textContent,ne));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',oe(o.value,ie),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)ae(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",oe(e.nodeValue,ne),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function se(e,t){var n=X(t);if(K(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)L(r[o],e)}}function le(e,t){if(void 0!==t){try{se(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)ae(t,n),t=t.nextSibling;return n.join("")}(e)}function pe(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function ce(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(pe(e,i))}(n,t)),n.consolidate()}function ue(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function me(e){return["L",e.x,e.y]}function he(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,a,s;for(let r=1;r<n;r++){const n=e[r-1],l=e[r],p=e[r+1];if(!p||!t){i.push(me(l));continue}const c=Math.min(t,de(l.x-n.x,l.y-n.y),de(p.x-l.x,p.y-l.y));if(!c){i.push(me(l));continue}const u=fe(l,n,c),m=fe(l,n,.5*c),h=fe(l,p,c),f=fe(l,p,.5*c);i.push(me(u)),i.push((a=f,s=h,["C",(o=m).x,o.y,a.x,a.y,s.x,s.y]))}return i}function fe(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=n/de(i,r);return{x:e.x+i*o,y:e.y+r*o}}function de(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ye(e,t,n){s(t)&&(n=t,t=null),t||(t={});const i=Z("path",t);return s(n)&&(i.dataset.cornerRadius=String(n)),ge(i,e)}function ge(e,t){return z(e,{d:ue(he(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}var ve="hsl(225, 10%, 15%)",be="white";function xe(e,t){return y(e.eventDefinitions,(function(e){return e.$type===t}))}function we(e,t,n){var i=C(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||be}function Ee(e,t,n){var i=C(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||ve}function _e(e,t,n,i){var r=C(e).get("label");return i||r&&r.get("color:color")||t||Ee(e,n)}function Ae(e,t={}){return{width:Se(e,t),height:Re(e,t)}}function Se(e,t={}){return c(t,"width")?t.width:e.width}function Re(e,t={}){return c(t,"height")?t.height:e.height}function ke(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const Ce=Object.prototype.toString,Me=Object.prototype.hasOwnProperty;function Pe(e,t){return Me.call(e,t)}function Te(e,t){let n,i;if(void 0===e)return;const r=function(e){return"[object Array]"===Ce.call(e)}(e)?Ne:Oe;for(let o in e)if(Pe(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function Oe(e){return e}function Ne(e){return Number(e)}function De(e,...t){const n=e.style;return Te(t,(function(e){e&&Te(e,(function(e,t){n[t]=e}))})),e}const Be=Object.prototype.toString;function Ie(e){return new Le(e)}function Le(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function je(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}Le.prototype.add=function(e){return this.list.add(e),this},Le.prototype.remove=function(e){return"[object RegExp]"==Be.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Le.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Le.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Le.prototype.array=function(){return Array.from(this.list)},Le.prototype.has=Le.prototype.contains=function(e){return this.list.contains(e)};var Fe,Ve,We,ze={};function $e(){Fe=window.addEventListener?"addEventListener":"attachEvent",Ve=window.removeEventListener?"removeEventListener":"detachEvent",We="addEventListener"!==Fe?"on":""}var Ge=ke({__proto__:null,bind:ze.bind=function(e,t,n,i){return Fe||$e(),e[Fe](We+t,n,i||!1),n},unbind:ze.unbind=function(e,t,n,i){return Ve||$e(),e[Ve](We+t,n,i||!1),n},default:ze},[ze]),He=["focus","blur"];var Ue,Ke={bind:function(e,t,n,i,r){return-1!==He.indexOf(n)&&(r=!0),Ge.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=function(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(je(i,t))return i;i=i.parentNode}return je(i,t)?i:null}(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==He.indexOf(t)&&(i=!0),Ge.unbind(e,t,n,i)}},qe=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild)}var r,o=Object.prototype.hasOwnProperty.call(Xe,i)?Xe[i]:Xe._default,a=o[0],s=o[1],l=o[2];(r=t.createElement("div")).innerHTML=s+e+l;for(;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var p=t.createDocumentFragment();for(;r.firstChild;)p.appendChild(r.removeChild(r.firstChild));return p},Ye=!1;"undefined"!=typeof document&&((Ue=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Ye=!Ue.getElementsByTagName("link").length,Ue=void 0);var Xe={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Ye?[1,"X<div>","</div>"]:[0,"",""]};Xe.td=Xe.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Xe.option=Xe.optgroup=[1,'<select multiple="multiple">',"</select>"],Xe.thead=Xe.tbody=Xe.colgroup=Xe.caption=Xe.tfoot=[1,"<table>","</table>"],Xe.polyline=Xe.ellipse=Xe.polygon=Xe.circle=Xe.text=Xe.line=Xe.path=Xe.rect=Xe.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Ze=qe;function Je(e,t){return(t=t||document).querySelector(e)}function Qe(e,t,n,i,r){var o=te();o.setTranslate(t,n);var a=te();a.setRotate(i||0,0,0);var s=te();s.setScale(r||1,r||1),ce(e,[o,a,s])}function et(e,t,n){var i=te();i.setTranslate(t,n),ce(e,i)}var tt=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r<Math.floor(i);r++){a=Math.floor(Math.random()*n).toString(n)+a}if(o){var s=Math.pow(n,o);a=Math.floor(Math.random()*s).toString(n)+a}var l=parseInt(a,n);return l!==1/0&&l>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}}));function nt(e){if(!(this instanceof nt))return new nt(e);e=e||[128,36,1],this._seed=e.length?tt.rack(e[0],e[1],e[2]):e}nt.prototype.next=function(e){return this._seed(e||!0)},nt.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},nt.prototype.claim=function(e,t){this._seed.set(e,t||!0)},nt.prototype.assigned=function(e){return this._seed.get(e)||!1},nt.prototype.unclaim=function(e){delete this._seed.hats[e]},nt.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var it=new nt,rt=.95;function ot(e,t,n,i,r,o,s){A.call(this,t,s);var l=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor,u=it.next(),m={};function f(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:ve,strokeWidth:2,fill:"white"})}function d(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:ve,strokeWidth:2})}function y(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o}=t,a=Z("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});j(a,o);var s=Je("defs",r._svg);s||(s=Z("defs"),j(r._svg,s)),j(s,a),m[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)+"-"+u;return m[i]||function(e,t,n,i){if("sequenceflow-end"===t){y(e,{element:Z("path",{d:"M 1 5 L 11 10 L 1 15 Z",...f({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5})}if("messageflow-start"===t){y(e,{element:Z("circle",{cx:6,cy:6,r:3.5,...f({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6}})}if("messageflow-end"===t){y(e,{element:Z("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...f({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5}})}if("association-start"===t){y(e,{element:Z("path",{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:Z("path",{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:Z("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...f({fill:n,stroke:i})}),ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){y(e,{element:Z("path",{d:"M 6 4 L 10 16",...f({stroke:i})}),ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function b(e,t,n,i,r={}){a(i)&&(r=i,i=0),i=i||0,r=f(r);var o=Z("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return j(e,o),o}function x(e,t,n,i,r,o){a(r)&&(o=r,r=0),r=r||0,o=f(o);var s=Z("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return j(e,s),s}function w(e,t,n,i){var r=ye(t,n=d(n),i);return j(e,r),r}function _(e,t,n){return w(e,t,n,5)}function R(e,t,n){n=d(n);var i=Z("path",{...n,d:t});return j(e,i),i}function T(e,t,n,i){return R(t,n,E({"data-marker":e},i))}function O(e){return fe[e]}function N(e){return function(t,n,i){return O(e)(t,n,i)}}var D=function(e,t,n={},r){return R(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:r?we(t,l,n.fill):Ee(t,p,n.stroke),strokeWidth:1})},B=function(e,t,n={}){var r=b(e,t.width,t.height,.2*t.height,{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:2});R(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{stroke:Ee(t,p,n.stroke),strokeWidth:2});for(var o=0;o<12;o++){var a=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),s=t.width/2,c=t.height/2;R(e,a,{strokeWidth:1,stroke:Ee(t,p,n.stroke),transform:"rotate("+30*o+","+c+","+s+")"})}return r},L=function(e,t,n={},r){return R(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},F=function(e,t,n={}){return R(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},V=function(e,t,n={},r){return R(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},W=function(e,t,n={},r){return R(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},$=function(e,t,n={},r){var o=R(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?Ee(t,p,n.stroke):"none",stroke:Ee(t,p,n.stroke),strokeWidth:1});return function(e,t){var n=te();n.setRotate(t,0,0),ce(e,n)}(o,45),o},H=function(e,t,n={},r){return R(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},U=function(e,t,n={},r){return R(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},K=function(e,t,n={},r){return R(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),strokeWidth:1})},q=function(e,t,n={}){return R(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},Y=function(e,t,n={}){return b(e,t.width,t.height,8,{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:4})};function X(e,t,n={}){var i=k(e),r=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(i);return i.get("eventDefinitions")&&i.get("eventDefinitions").length>1?i.get("parallelMultiple")?q(t,e,n,r):K(t,e,n,r):xe(i,"bpmn:MessageEventDefinition")?D(t,e,n,r):xe(i,"bpmn:TimerEventDefinition")?B(t,e,n,r):xe(i,"bpmn:ConditionalEventDefinition")?F(t,e,n,r):xe(i,"bpmn:SignalEventDefinition")?U(t,e,n,r):xe(i,"bpmn:EscalationEventDefinition")?L(t,e,n,r):xe(i,"bpmn:LinkEventDefinition")?V(t,e,n,r):xe(i,"bpmn:ErrorEventDefinition")?W(t,e,n,r):xe(i,"bpmn:CancelEventDefinition")?$(t,e,n,r):xe(i,"bpmn:CompensateEventDefinition")?H(t,e,n,r):xe(i,"bpmn:TerminateEventDefinition")?Y(t,e,n,r):null}var J={ParticipantMultiplicityMarker:function(e,t,n={}){var r=Se(t,n),o=Re(t,n);T("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2-6)/r,my:(o-15)/o}}),{strokeWidth:2,fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},SubProcessMarker:function(e,t,n={}){et(x(e,14,14,0,{strokeWidth:1,fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)}),t.width/2-7.5,t.height-20),T("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:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},ParallelMarker:function(e,t,n){var r=Se(t,n),o=Re(t,n);T("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.parallel)/r,my:(o-20)/o}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},SequentialMarker:function(e,t,n){T("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:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},CompensationMarker:function(e,t,n){T("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:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},LoopMarker:function(e,t,n){var r=Se(t,n),o=Re(t,n);T("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.loop)/r,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:Ee(t,p,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=Se(t,n),o=Re(t,n);T("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.adhoc)/r,my:(o-15)/o}}),{strokeWidth:1,fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke)})}};function Q(e,t,n,i){J[e](t,n,i)}function ee(e,t,n,i={}){i={fill:i.fill,stroke:i.stroke,width:Se(t,i),height:Re(t,i)};var r=k(t),o=n&&n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},h(n,(function(n){Q(n,e,t,i)})),r.get("isForCompensation")&&Q("CompensationMarker",e,t,i),S(r,"bpmn:AdHocSubProcess")&&Q("AdhocMarker",e,t,i);var a=r.get("loopCharacteristics"),s=a&&a.get("isSequential");a&&(void 0===s&&Q("LoopMarker",e,t,i),!1===s&&Q("ParallelMarker",e,t,i),!0===s&&Q("SequentialMarker",e,t,i))}function ne(e,t,n={}){n=E({size:{width:100}},n);var i=o.createText(t||"",n);return G(i).add("djs-label"),j(e,i),i}function ie(e,t,n,i={}){var r=k(t),o=Ae({x:t.x,y:t.y,width:t.width,height:t.height},i);return ne(e,r.name,{align:n,box:o,padding:7,style:{fill:_e(t,c,p,i.stroke)}})}function re(e,t,n,i={}){var r=P(n),o=ne(e,t,{box:{height:30,width:r?Re(n,i):Se(n,i)},align:"center-middle",style:{fill:_e(n,c,p,i.stroke)}});r&&Qe(o,0,-(-1*Re(n,i)),270)}function oe(e,t,n={}){var{width:i,height:r}=Ae(t,n);return x(e,i,r,10,{...n,fill:we(t,l,n.fill),fillOpacity:rt,stroke:Ee(t,p,n.stroke)})}function ae(e,t,n={}){var i=k(t),r=we(t,l,n.fill),o=Ee(t,p,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=v("association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=v("association-start",r,o)),n=at(n,["markerStart","markerEnd"]),_(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function se(e,t,n={}){var r=we(t,l,n.fill),o=Ee(t,p,n.stroke),a=R(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:rt,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(k(t))&&R(e,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:r,stroke:o});return a}function le(e,t,n={}){return b(e,t.width,t.height,{fillOpacity:rt,...n,fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})}function pe(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,a=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");i=f(i);var s=Z("polygon",{...i,points:a});return j(e,s),s}(e,t.width,t.height,{fill:we(t,l,n.fill),fillOpacity:rt,stroke:Ee(t,p,n.stroke)})}function ue(e,t,n={}){var i=x(e,Se(t,n),Re(t,n),0,{fill:we(t,l,n.fill),fillOpacity:n.fillOpacity||rt,stroke:Ee(t,p,n.stroke),strokeWidth:1.5}),r=k(t);S(r,"bpmn:Lane")&&re(e,r.get("name"),t,n);return i}function me(e,t,n={}){var i=oe(e,t,n);(function(e){return e&&!!k(e).triggeredByEvent})(t)&&z(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var r=M(t);return ie(e,t,r?"center-top":"center-middle",n),ee(e,t,r?void 0:["SubProcessMarker"],n),i}function he(e,t,n={}){var i=oe(e,t,n);return ie(e,t,"center-middle",n),ee(e,t,void 0,n),i}var fe=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return me(e,t,n=M(t)?at(n,["fill","stroke","width","height"]):at(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return ae(e,t,n=at(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=at(n,["fill","stroke"]);var r=k(t).get("cancelActivity");n={strokeWidth:1.5,fill:we(t,l,n.fill),fillOpacity:1,stroke:Ee(t,p,n.stroke)},r||(n.strokeDasharray="6");var o=le(e,t,n);return b(e,t.width,t.height,3,{...n,fill:"none"}),i&&X(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=he(e,t,n=at(n,["fill","stroke"]));return z(R(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),z(R(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=at(n,["fill","stroke"]),me(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=pe(e,t,n=at(n,["fill","stroke"]));return R(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=at(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=se(e,t,n);return R(e,r,{fill:"none",stroke:Ee(t,p,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=at(n,["fill","stroke"]),ae(e,t,{...n,markerEnd:v("association-end",we(t,l,n.fill),Ee(t,p,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return se(e,t,n=at(n,["fill","stroke"]))},"bpmn:DataObjectReference":N("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=at(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=se(e,t,n);return R(e,r,{strokeWidth:1,fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=at(n,["fill","stroke"]),ae(e,t,{...n,markerEnd:v("association-end",we(t,l,n.fill),Ee(t,p,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=at(n,["fill","stroke"]),R(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:we(t,l,n.fill),fillOpacity:rt,stroke:Ee(t,p,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=at(n,["fill","stroke"]);var r=le(e,t,{...n,strokeWidth:4});return i&&X(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=at(n,["fill","stroke"]);var r=k(t),o=pe(e,t,n);b(e,t.width,t.height,.2*t.height,{fill:we(t,"none",n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1});var a=r.get("eventGatewayType"),s=!!r.get("instantiate");if("Parallel"===a){var l=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});R(e,l,{fill:"none",stroke:Ee(t,p,n.stroke),strokeWidth:1})}else"Exclusive"===a&&(s||b(e,t.width,t.height,.26*t.height,{fill:"none",stroke:Ee(t,p,n.stroke),strokeWidth:1}),function(){var r=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});R(e,r,{fill:"none",stroke:Ee(t,p,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=pe(e,t,n=at(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return C(t).get("isMarkerVisible")&&R(e,o,{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return pe(e,t,n=at(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=at(n,["fill","stroke","width","height"]),x(e,t.width,t.height,10,{stroke:Ee(t,p,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:Se(t,n),height:Re(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=pe(e,t,n=at(n,["fill","stroke"]));return b(e,t.width,t.height,.24*t.height,{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=at(n,["fill","stroke"]);var r=le(e,t,{...n,strokeWidth:1.5});return b(e,t.width,t.height,3,{fill:"none",stroke:Ee(t,p,n.stroke),strokeWidth:1.5}),i&&X(t,e,n),r},"bpmn:IntermediateCatchEvent":N("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":N("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=at(n,["fill","stroke","width","height"]),ue(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=he(e,t,n=at(n,["fill","stroke"]));return R(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=at(n,["fill","stroke"]);var r=k(t),o=C(t),a=we(t,l,n.fill),s=Ee(t,p,n.stroke),c=_(e,t.waypoints,{markerEnd:v("messageflow-end",a,s),markerStart:v("messageflow-start",a,s),stroke:s,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=c.getPointAtLength(c.getTotalLength()/2),m=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),h={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(h.fill=a,h.stroke=s):(h.fill=s,h.stroke=a);var f=R(e,m,h),d=ne(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:s}}),y=f.getBBox(),g=d.getBBox();Qe(d,u.x-g.width/2,u.y+y.height/2+10,0)}return c},"bpmn:ParallelGateway":function(e,t,n={}){var r=pe(e,t,n=at(n,["fill","stroke"]));return R(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=ue(e,t,n=at(n,["fill","stroke","width","height"])),r=M(t),o=P(t),a=k(t),s=a.get("name");if(r){w(e,o?[{x:30,y:0},{x:30,y:Re(t,n)}]:[{x:0,y:30},{x:Se(t,n),y:30}],{stroke:Ee(t,p,n.stroke),strokeWidth:1.5}),re(e,s,t,n)}else{var l=Ae(t,n);o||(l.height=Se(t,n),l.width=Re(t,n));var u=ne(e,s,{box:l,align:"center-middle",style:{fill:_e(t,c,p,n.stroke)}});if(!o)Qe(u,0,-(-1*Re(t,n)),270)}return a.get("participantMultiplicity")&&Q("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=at(n,["fill","stroke"]);var r,o=k(t),a=he(e,t,n);return o.get("instantiate")?(b(e,28,28,4.4,{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),R(e,r,{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){var r=he(e,t,n=at(n,["fill","stroke"]));return R(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=he(e,t,n=at(n,["fill","stroke"]));return R(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:Ee(t,p,n.stroke),stroke:we(t,l,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=at(n,["fill","stroke"]);var i=we(t,l,n.fill),r=Ee(t,p,n.stroke),o=_(e,t.waypoints,{markerEnd:v("sequenceflow-end",i,r),stroke:r}),a=k(t),{source:s}=t;if(s){var c=k(s);a.get("conditionExpression")&&S(c,"bpmn:Activity")&&z(o,{markerStart:v("conditional-flow-marker",i,r)}),c.get("default")&&(S(c,"bpmn:Gateway")||S(c,"bpmn:Activity"))&&c.get("default")===a&&z(o,{markerStart:v("conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=he(e,t,n=at(n,["fill","stroke"]));return b(e,10,10,{fill:we(t,l,n.fill),stroke:"none",transform:"translate(6, 6)"}),R(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),b(e,10,10,{fill:we(t,l,n.fill),stroke:"none",transform:"translate(11, 10)"}),R(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=at(n,["fill","stroke"]),k(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=le(e,t,n);return i&&X(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return me(e,t,n=M(t)?at(n,["fill","stroke","width","height"]):at(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return he(e,t,n=at(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=at(n,["fill","stroke","width","height"]);var{width:r,height:o}=Ae(t,n),a=x(e,r,o,0,0,{fill:"none",stroke:"none"});return R(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:Ee(t,p,n.stroke)}),ne(e,k(t).get("text")||"",{align:"left-top",box:Ae(t,n),padding:7,style:{fill:_e(t,c,p,n.stroke)}}),a},"bpmn:Transaction":function(e,t,i={}){i=M(t)?at(i,["fill","stroke","width","height"]):at(i,["fill","stroke"]);var r=me(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:Ee(t,p,i.stroke),strokeWidth:1.5});return M(t)||(i={}),x(e,Se(t,i),Re(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=he(e,t,n=at(n,["fill","stroke"]));return R(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:.5}),R(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:.5}),R(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return ne(e,I(t),{box:i,fitBox:!0,style:E({},o.getExternalStyle(),{fill:_e(t,c,p,n.stroke)})})}(e,t,n)}};this._drawPath=R,this._renderer=O}function at(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}function st(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}e(ot,A),ot.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],ot.prototype.canRender=function(e){return S(e,"bpmn:BaseElement")},ot.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},ot.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},ot.prototype.getShapePath=function(e){return S(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,ue([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):S(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return ue([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}(e,10):S(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return ue([["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 ue([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};const lt=Object.prototype.toString,pt=Object.prototype.hasOwnProperty;function ct(e,t){return pt.call(e,t)}function ut(e,t){let n,i;if(void 0===e)return;const r=function(e){return"[object Array]"===lt.call(e)}(e)?ht:mt;for(let o in e)if(ct(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function mt(e){return e}function ht(e){return Number(e)}function ft(e,...t){const n=e.style;return ut(t,(function(e){e&&ut(e,(function(e,t){n[t]=e}))})),e}const dt=Object.prototype.toString;function yt(e){return new gt(e)}function gt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function vt(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}function bt(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}gt.prototype.add=function(e){return this.list.add(e),this},gt.prototype.remove=function(e){return"[object RegExp]"==dt.call(e)?this.removeMatching(e):(this.list.remove(e),this)},gt.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},gt.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},gt.prototype.array=function(){return Array.from(this.list)},gt.prototype.has=gt.prototype.contains=function(e){return this.list.contains(e)};var xt,wt,Et,_t={};function At(){xt=window.addEventListener?"addEventListener":"attachEvent",wt=window.removeEventListener?"removeEventListener":"detachEvent",Et="addEventListener"!==xt?"on":""}var St=st({__proto__:null,bind:_t.bind=function(e,t,n,i){return xt||At(),e[xt](Et+t,n,i||!1),n},unbind:_t.unbind=function(e,t,n,i){return wt||At(),e[wt](Et+t,n,i||!1),n},default:_t},[_t]),Rt=["focus","blur"];var kt,Ct={bind:function(e,t,n,i,r){return-1!==Rt.indexOf(n)&&(r=!0),St.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=function(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(bt(i,t))return i;i=i.parentNode}return bt(i,t)?i:null}(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==Rt.indexOf(t)&&(i=!0),St.unbind(e,t,n,i)}},Mt=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild)}var r,o=Object.prototype.hasOwnProperty.call(Tt,i)?Tt[i]:Tt._default,a=o[0],s=o[1],l=o[2];(r=t.createElement("div")).innerHTML=s+e+l;for(;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var p=t.createDocumentFragment();for(;r.firstChild;)p.appendChild(r.removeChild(r.firstChild));return p},Pt=!1;"undefined"!=typeof document&&((kt=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Pt=!kt.getElementsByTagName("link").length,kt=void 0);var Tt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Pt?[1,"X<div>","</div>"]:[0,"",""]};Tt.td=Tt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Tt.option=Tt.optgroup=[1,'<select multiple="multiple">',"</select>"],Tt.thead=Tt.tbody=Tt.colgroup=Tt.caption=Tt.tfoot=[1,"<table>","</table>"],Tt.polyline=Tt.ellipse=Tt.polygon=Tt.circle=Tt.text=Tt.line=Tt.path=Tt.rect=Tt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Ot=Mt;function Nt(e,t){return(t=t||document).querySelector(e)}function Dt(e){e.parentNode&&e.parentNode.removeChild(e)}var Bt=0,It={width:150,height:50};function Lt(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function jt(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=Lt(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return Ft(e,o,r,i);o=Wt(o,i.width,t)}}function Ft(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}var Vt="";function Wt(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<t)){"-"!==n&&n!==Vt||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&a===Vt&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function zt(e){this._config=E({},{size:It,padding:Bt,style:{},align:"center-top"},e||{})}zt.prototype.createText=function(e,t){return this.layoutText(e,t).element},zt.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},zt.prototype.layoutText=function(e,t){var n=E({},this._config.size,t.box),i=E({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return a(e)?E({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),s=t.fitBox||!1,l=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),p=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right,m=Z("text");for(z(m,{x:0,y:0}),z(m,i),j(function(){var e=document.getElementById("helper-svg");return e||(z(e=Z("svg"),{id:"helper-svg"}),ft(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),m);p.length;)c.push(jt(p,u,m));"middle"===r.vertical&&(o.top=o.bottom=0);var d=f(c,(function(e,t,n){return e+(l||t.height)}),0)+o.top+o.bottom,y=f(c,(function(e,t,n){return t.width>e?t.width:e}),0),g=o.top;"middle"===r.vertical&&(g+=(n.height-d)/2),g-=(l||c[0].height)/4;var v=Z("text");return z(v,i),h(c,(function(e){var t;switch(g+=l||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?y:u)-o.right-e.width;break;default:t=Math.max(((s?y:u)-e.width)/2+o.left,0)}var n=Z("tspan");z(n,{x:t,y:g}),n.textContent=e.text,j(v,n)})),U(m),{dimensions:{width:y,height:d},element:v}};function $t(e){var t=E({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=E({},t,{fontSize:n},e&&e.externalStyle||{}),r=new zt({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30},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}}$t.$inject=["config.textRenderer"];var Gt=/\{([^{}]+)\}/g,Ht=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Ut={__init__:["bpmnRenderer"],bpmnRenderer:["type",ot],textRenderer:["type",$t],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,s=t.containerWidth/r.width*t.xScaleFactor,l=0;l<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*a;for(var p=0;p<r.widthElements.length;p++)o["x"+p]=r.widthElements[p]*s}var c,u,m=(c=r.d,u={mx:n,my:i,e:o},String(c).replace(Gt,(function(e,t){return function(e,t,n){var i=n;return t.replace(Ht,(function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))})),i=(null==i||i==n?e:i)+""}(e,t,u)})));return m}}]};var Kt={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};function qt(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Yt(e){return t={x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2},{x:Math.round(t.x),y:Math.round(t.y)};var t}function Xt(e){for(var t=e.waypoints,n=t.reduce((function(e,n,i){var r,o,a=t[i-1];if(a){var s=e[e.length-1],l=s&&s.endLength||0,p=(r=a,o=n,Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)));e.push({start:a,end:n,startLength:l,endLength:l+p,length:p})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0)/2,r=0,o=n[r];o.endLength<i;)o=n[++r];var a=(i-o.startLength)/o.length;return{x:o.start.x+(o.end.x-o.start.x)*a,y:o.start.y+(o.end.y-o.start.y)*a}}function Zt(e){return a(t=e)&&c(t,"waypoints")?Xt(e):Yt(e);var t}function Jt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function Qt(e,t,n){return E({id:e.id,type:e.$type,businessObject:e,di:t},n)}function en(e,t,n){var i=e.waypoint;return!i||i.length<2?[Zt(t),Zt(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function tn(e,t,n){return new Error(`element ${Jt(t)} referenced by ${Jt(e)}#${n} not yet drawn`)}function nn(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}nn.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],nn.prototype.add=function(e,t,n){var i,r,o,a,s,l,p;if(S(t,"bpmndi:BPMNPlane")){var c=S(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Qt(e,t,c)),this._canvas.addRootElement(i)}else if(S(t,"bpmndi:BPMNShape")){var u=!M(e,t),m=function(e){return S(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var h=t.bounds;i=this._elementFactory.createShape(Qt(e,t,{collapsed:u,hidden:r,x:Math.round(h.x),y:Math.round(h.y),width:Math.round(h.width),height:Math.round(h.height),isFrame:m})),S(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),S(e,"bpmn:Lane")&&(o=0),S(e,"bpmn:DataStoreReference")&&(a=n,s=Zt(h),l=s.x,p=s.y,l>=a.x&&l<=a.x+a.width&&p>=a.y&&p<=a.y+a.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!S(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${Jt(t)} for element ${Jt(e)}`);var f=this._getSource(e),d=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Qt(e,t,{hidden:r,source:f,target:d,waypoints:en(t,f,d)})),S(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return function(e){return S(e,"bpmn:Event")||S(e,"bpmn:Gateway")||S(e,"bpmn:DataStoreReference")||S(e,"bpmn:DataObjectReference")||S(e,"bpmn:DataInput")||S(e,"bpmn:DataOutput")||S(e,"bpmn:SequenceFlow")||S(e,"bpmn:MessageFlow")||S(e,"bpmn:Group")}(e)&&I(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},nn.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${Jt(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw tn(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),-1===r.indexOf(t)&&r.push(t)},nn.prototype.addLabel=function(e,t,n){var i,r,o;return i=B(t,n),(r=I(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Qt(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!I(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)},nn.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?tn(e,i,t+"Ref"):new Error(`${Jt(e)}#${t} Ref not specified`)},nn.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},nn.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},nn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var rn={__depends__:[Ut,{__depends__:[Kt],bpmnImporter:["type",nn]}]};function on(e,t){var n,i,r,a;return t=!!t,o(e)||(e=[e]),h(e,(function(e){var o=e;e.waypoints&&!t&&(o=on(e.waypoints,!0));var s=o.x,l=o.y,p=o.height||0,c=o.width||0;(s<n||void 0===n)&&(n=s),(l<i||void 0===i)&&(i=l),(s+c>r||void 0===r)&&(r=s+c),(l+p>a||void 0===a)&&(a=l+p)})),{x:n,y:i,height:a-i,width:r-n}}function an(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function sn(e){return!(!e||!e.isFrame)}function ln(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}ln.prototype.next=function(){return this._prefix+ ++this._counter};var pn=new ln("ov");function cn(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=pn,this._overlayDefaults=E({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),ft(o=Ot('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function un(e,t,n){ft(e,{left:t+"px",top:n+"px"})}function mn(e,t){e.style.display=!1===t?"none":""}function hn(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}cn.$inject=["config.overlays","eventBus","canvas","elementRegistry"],cn.prototype.get=function(e){if(p(e)&&(e={id:e}),p(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?m(t.overlays,g({type:e.type})):t.overlays.slice():[]}return e.type?m(this._overlays,g({type:e.type})):e.id?this._overlays[e.id]:null},cn.prototype.add=function(e,t,n){if(a(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=E({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},cn.prototype.remove=function(e){var t=this.get(e)||[];o(t)||(t=[t]);var n=this;h(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Dt(e.html),Dt(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)}}))},cn.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},cn.prototype.show=function(){mn(this._overlayRoot)},cn.prototype.hide=function(){mn(this._overlayRoot,!1)},cn.prototype.clear=function(){this._overlays={},this._overlayContainers=[],vt(this._overlayRoot)},cn.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=on(t);i=o.x,r=o.y}un(n,i,r),function(e,t,n){2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):e.setAttribute(t,n)}(e.html,"data-container-id",t.id)},cn.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?on(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?on(o).height:o.height,s=-1*i.bottom+n);un(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},cn.prototype._createOverlayContainer=function(e){var t=Ot('<div class="djs-overlays" />');ft(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},cn.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";hn(this._overlayRoot,n)},cn.prototype._getOverlayContainer=function(e,t){var n=u(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},cn.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)),p(o)&&(o=Ot(o)),n=this._getOverlayContainer(r),ft(t=Ot('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&yt(t).add("djs-overlay-"+e.type),mn(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())},cn.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),o=n&&n.minZoom,a=n&&n.maxZoom,s=e.htmlContainer,l=!0;(i!==this._canvas.getRootElement()||n&&(r(o)&&o>t.scale||r(a)&&a<t.scale))&&(l=!1),mn(s,l),this._updateOverlayScale(e,t)},cn.prototype._updateOverlayScale=function(e,t){var n,i,o,a=e.scale,s=e.htmlContainer,l="";!0!==a&&(!1===a?(n=1,i=1):(n=a.min,i=a.max),r(n)&&t.scale<n&&(o=(1/t.scale||1)*n),r(i)&&t.scale>i&&(o=(1/t.scale||1)*i)),r(o)&&(l="scale("+o+","+o+")"),hn(s,l)},cn.prototype._updateOverlaysVisibilty=function(e){var t=this;h(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},cn.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;h(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Dt(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&&(h(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&&yt(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};var fn={__init__:["overlays"],overlays:["type",cn]};function dn(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(an(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)}))}dn.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var yn={__init__:["changeSupport"],changeSupport:["type",dn]};function gn(e){this._eventBus=e}function vn(e){return function(t,n,i,r,o){(l(t)||s(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function bn(e,t){t.invoke(gn,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)}))}gn.$inject=["eventBus"],gn.prototype.on=function(e,t,n,i,r,p){if((l(t)||s(t))&&(p=r,r=i,i=n,n=t,t=null),l(n)&&(p=r,r=i,i=n,n=1e3),a(r)&&(p=r,r=!1),!l(i))throw new Error("handlerFn must be a function");o(e)||(e=[e]);var c=this._eventBus;h(e,(function(e){var o=["commandStack",e,t].filter((function(e){return e})).join(".");c.on(o,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,p):i,p)}))},gn.prototype.canExecute=vn("canExecute"),gn.prototype.preExecute=vn("preExecute"),gn.prototype.preExecuted=vn("preExecuted"),gn.prototype.execute=vn("execute"),gn.prototype.executed=vn("executed"),gn.prototype.postExecute=vn("postExecute"),gn.prototype.postExecuted=vn("postExecuted"),gn.prototype.revert=vn("revert"),gn.prototype.reverted=vn("reverted"),e(bn,gn),bn.$inject=["canvas","injector"];var xn={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",bn]},wn={"&":"&","<":"<",">":">",'"':""","'":"'"};var En="_plane";function _n(e){var t=e.id;return S(e,"bpmn:SubProcess")?function(e){return e+En}(t):t}function An(e,t,n){var i=Ze('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=Ie(r);r.appendChild(i);var a=[];function s(e){e&&(a=function(e){for(var t=k(e),n=[],i=t;i;i=i.$parent)(S(i,"bpmn:SubProcess")||S(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=a.map((function(e){var i,r=(i=""+(i=e.name||e.id))&&i.replace(/[&<>"']/g,(function(e){return wn[e]})),o=Ze('<li><span class="bjs-crumb"><a title="'+r+'">'+r+"</a></span></li>"),a=n.findRoot(_n(e))||n.findRoot(e.id);if(!a&&S(e,"bpmn:Process")){var s=t.find((function(t){var n=k(t);return n&&n.get("processRef")&&n.get("processRef")===e}));a=n.findRoot(s.id)}return o.addEventListener("click",(function(){n.setRootElement(a)})),o}));i.innerHTML="";var s=r.length>1;o.toggle("bjs-breadcrumbs-shown",s),r.forEach((function(e){i.appendChild(e)}))}e.on("element.changed",(function(e){var t=k(e.element);u(a,(function(e){return e===t}))&&s()})),e.on("root.set",(function(e){s(e.element)}))}function Sn(e,t){var n=null,i=new Rn;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),a=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!S(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,l=(o.y-a.y)*o.scale;0===s&&0===l||t.scroll({dx:s,dy:l}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function Rn(){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)}}An.$inject=["eventBus","elementRegistry","canvas"],Sn.$inject=["eventBus","canvas"];var kn=180,Cn=160;function Mn(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 Pn(e){return S(e,"bpmndi:BPMNDiagram")?e:Pn(e.$parent)}Mn.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)})),e.diagrams.filter((e=>e.plane)).flatMap((e=>t._createNewDiagrams(e.plane))).forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},Mn.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;S(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!S(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(R(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},Mn.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=qt(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),function(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}(t)}(e),i=n.x-kn,r=n.y-Cn;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)}))},Mn.prototype._moveToDiPlane=function(e,t){var n=Pn(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},Mn.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},Mn.$inject=["eventBus","moddle"];var Tn=250;function On(e,t,n,i){gn.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",Tn,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",Tn,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],Tn,(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"],Tn,(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)}))}))}e(On,gn),On.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},On.prototype._canDrillDown=function(e){var t=this._canvas;return S(e,"bpmn:SubProcess")&&t.findRoot(_n(e))},On.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=k(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;Ie(i.html).toggle("bjs-drilldown-empty",!r)}},On.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=Ze('<button class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(_n(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},On.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},On.$inject=["canvas","eventBus","elementRegistry","overlays"];var Nn={__depends__:[fn,yn,xn],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",An],drilldownCentering:["type",Sn],drilldownOverlayBehavior:["type",On],subprocessCompatibility:["type",Mn]};function Dn(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(e){var t=Z("rect");return z(t,E({x:0,y:0,rx:4,width:100,height:100},n)),t}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=Nt(".djs-outline",n);o||j(n,o=i.getOutline(t)||r()),i.updateShapeOutline(o,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,o=Nt(".djs-outline",n);o||j(n,o=r()),i.updateConnectionOutline(o,t)}))}Dn.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&h(i,(function(i){n=n||i.updateOutline(t,e)})),n||z(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Dn.prototype.updateConnectionOutline=function(e,t){var n=on(t);z(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Dn.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,(function(e){e.providers.push(t)}))},Dn.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Dn.prototype.getOutline=function(e){var t;return h(this._getProviders(),(function(n){l(n.getOutline)&&(t=t||n.getOutline(e))})),t},Dn.$inject=["eventBus","styles","elementRegistry"];var Bn={__init__:["outline"],outline:["type",Dn]};const In={width:36,height:50},Ln={width:50,height:50};function jn(e,t,n){return Z("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}function Fn(e,t){this._styles=t,e.registerProvider(this)}function Vn(e,t){var n;return"bpmn:DataObjectReference"===t?n=In:"bpmn:DataStoreReference"===t&&(n=Ln),e.width===n.width&&e.height===n.height}Fn.$inject=["outline","styles"],Fn.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!T(e))return S(e,"bpmn:Gateway")?(E((n=Z("rect")).style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),z(n,E({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):R(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?z(n=Z("rect"),E({x:-5,y:-5,rx:14,width:e.width+10,height:e.height+10},t)):S(e,"bpmn:EndEvent")?z(n=Z("circle"),E({cx:e.width/2,cy:e.height/2,r:e.width/2+5+1},t)):S(e,"bpmn:Event")?z(n=Z("circle"),E({cx:e.width/2,cy:e.height/2,r:e.width/2+5},t)):S(e,"bpmn:DataObjectReference")&&Vn(e,"bpmn:DataObjectReference")?n=jn("M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",{x:-6,y:-6},t):S(e,"bpmn:DataStoreReference")&&Vn(e,"bpmn:DataStoreReference")&&(n=jn("M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",{x:-6,y:-6},t)),n},Fn.prototype.updateOutline=function(e,t){if(!T(e))return R(e,["bpmn:SubProcess","bpmn:Group"])?(z(t,{width:e.width+10,height:e.height+10}),!0):!!R(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};var Wn={__depends__:[Bn],__init__:["outlineProvider"],outlineProvider:["type",Fn]};function zn(e){return e.originalEvent||e.srcEvent}function $n(e,t){return(zn(e)||e).button===t}function Gn(e){return $n(e,0)}function Hn(e){return!0}function Un(e){return Gn(e)||function(e){return $n(e,1)}(e)}function Kn(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){var n=l[e]||Gn;return!n(t)})(n,i)||(r?a=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(a=o,r=t.get(a)),a&&r&&!1===e.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function a(e){return o[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":Hn,"element.mousedown":Un,"element.mouseup":Un,"element.click":Un,"element.dblclick":Un};var p="svg, .djs-element";function c(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(l[n]=i),a.$delegate=Ct.bind(e,p,t,a)}function u(e,t,n){var i=a(n);i&&Ct.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,h(s,(function(e,n){u(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,h(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 m=y("djs-hit djs-hit-stroke"),f=y("djs-hit djs-hit-click-stroke"),d={all:y("djs-hit djs-hit-all"),"click-stroke":f,stroke:m,"no-move":y("djs-hit djs-hit-no-move")};function y(e,t){return t=E({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function g(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return z(e,n),e}function v(e,t){j(e,t)}this.removeHits=function(e){var t;h((t=".djs-hit",(e||document).querySelectorAll(t)),U)},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=ye(t);return g(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=E({x:0,y:0},n);var i=Z("rect");return g(i,t),z(i,n),v(e,i),i},this.updateDefaultHit=function(e,t){var n=Nt(".djs-hit",t);if(n)return e.waypoints?ge(n,e.waypoints):z(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=u}Kn.$inject=["eventBus","elementRegistry","styles"];var qn={__init__:["interactionEvents"],interactionEvents:["type",Kn]};function Yn(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){var t=e.element;n.deselect(t)})),e.on(["diagram.clear","root.set"],(function(e){n.select(null)}))}Yn.$inject=["eventBus","canvas"],Yn.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},Yn.prototype.get=function(){return this._selectedElements},Yn.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Yn.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();o(e)||(e=e?[e]:[]);var r=this._canvas,a=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return a===t})),t?h(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Xn="hover",Zn="selected";function Jn(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,Xn)})),t.on("element.out",(function(e){o(e.element,Xn)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;h(t,(function(e){-1===n.indexOf(e)&&o(e,Zn)})),h(n,(function(e){-1===t.indexOf(e)&&r(e,Zn)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function Qn(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,a=(n.hints||{}).autoSelect;if(i){if(!1===a)return;o(a)?t.select(a):t.select(r.filter(ei))}})),e.on("connect.end",500,(function(e){var n=e.context.connection;n&&t.select(n)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);u(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(Gn(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=function(e){var t=zn(e)||e;return Gn(e)&&t.shiftKey}(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function ei(e){return!e.hidden}Jn.$inject=["canvas","eventBus","selection"],Jn.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");K(t);var n=e.length>1;if(G(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}}(on(e)),r=Z("rect");z(r,E({rx:3},i)),G(r).add("djs-selection-outline"),j(t,r)}},Qn.$inject=["eventBus","selection","canvas","elementRegistry"];var ti={__init__:["selectionVisuals","selectionBehavior"],__depends__:[qn,Bn],selection:["type",Yn],selectionVisuals:["type",Jn],selectionBehavior:["type",Qn]};const ni=/^class[ {]/;function ii(e){return Array.isArray(e)}function ri(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function oi(...e){1===e.length&&ii(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const ai=/constructor\s*[^(]*\(\s*([^)]*)\)/m,si=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,li=/\/\*([^*]*)\*\//m;function pi(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return ni.test(e.toString())}(e)?ai:si);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(li);return(t&&t[1]||e).trim()}))||[]}function ci(e,t){const n=t||{get:function(e,t){if(i.push(e),!1===t)return null;throw s(`No provider for "${e}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(e){const t=i.join(" -> ");return i.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function l(e,t){if(!r[e]&&e.includes(".")){const t=e.split(".");let n=l(t.shift());for(;t.length;)n=n[t.shift()];return n}if(ri(o,e))return o[e];if(ri(r,e)){if(-1!==i.indexOf(e))throw i.push(e),s("Cannot resolve circular dependency!");return i.push(e),o[e]=r[e][0](r[e][1]),i.pop(),o[e]}return n.get(e,t)}function p(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!ii(e))throw s(`Cannot invoke "${e}". Expected a function!`);e=oi(e.slice())}return{fn:e,dependencies:(e.$inject||pi(e)).map((e=>ri(t,e)?t[e]:l(e)))}}function c(e){const{fn:t,dependencies:n}=p(e);return new(Function.prototype.bind.call(t,null,...n))}function u(e,t,n){const{fn:i,dependencies:r}=p(e,n);return i.apply(t,r)}function m(e){return oi((t=>e.get(t)))}function h(e,t){if(t&&t.length){const n=Object.create(null),i=Object.create(null),o=[],a=[],s=[];let l,p,c,u;for(let e in r)l=r[e],-1!==t.indexOf(e)&&("private"===l[2]?(p=o.indexOf(l[3]),-1===p?(c=l[3].createChild([],t),u=m(c),o.push(l[3]),a.push(c),s.push(u),n[e]=[u,e,"private",c]):n[e]=[s[p],e,"private",a[p]]):n[e]=[l[2],l[1]],i[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]],i[t]=!0)}));t.forEach((e=>{if(!i[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new ci(e,a)}const f={factory:u,type:c,value:function(e){return e}};function d(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function y(e){const t=e.__exports__;if(t){const n=e.__modules__,i=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=h((n||[]).concat(i)),a=oi((function(e){return o.get(e)}));t.forEach((function(e){r[e]=[a,e,"private",o]}));const s=(e.__init__||[]).slice();return s.unshift((function(){o.init()})),d(e=Object.assign({},e,{__init__:s}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;const n=e[t];if("private"===n[2])return void(r[t]=n);const i=n[0],o=n[1];r[t]=[f[i],ui(i,o),i]})),d(e,a)}function g(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(g,e)).indexOf(t)?e:e.concat(t)}this.get=l,this.invoke=u,this.instantiate=c,this.createChild=h,this.init=function(e){const t=e.reduce(g,[]).map(y);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function ui(e,t){return"value"!==e&&ii(t)&&(t=oi(t.slice())),t}function mi(e,t){A.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}e(mi,A),mi.prototype.canRender=function(){return!0},mi.prototype.drawShape=function(e,t,n){var i=Z("rect");return z(i,{x:0,y:0,width:t.width||0,height:t.height||0}),sn(t)?z(i,E({},this.FRAME_STYLE,n||{})):z(i,E({},this.SHAPE_STYLE,n||{})),j(e,i),i},mi.prototype.drawConnection=function(e,t,n){var i=ye(t.waypoints,E({},this.CONNECTION_STYLE,n||{}));return j(e,i),i},mi.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return ue([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},mi.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 ue(r)},mi.$inject=["eventBus","styles"];var hi={__init__:["defaultRenderer"],defaultRenderer:["type",mi],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 E(this.style(t,n),{class:e})},this.style=function(t,n){o(t)||n||(n=t,t=[]);var i=f(t,(function(t,n){return E(t,e[n]||{})}),{});return n?E(i,n):i},this.computeStyle=function(e,n,i){return o(n)||(i=n,n=[]),t.style(n||[],E({},i,e||{}))}}]};function fi(e,t){return Math.round(e*t)/t}function di(e){return s(e)?e+"px":e}function yi(e,t,n){const i=Z("g");G(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const gi={shape:["x","y","width","height"],connection:["waypoints"]};function vi(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 bi(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}vi.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],vi.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=E({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),ft(n,{position:"relative",overflow:"hidden",width:di(e.width),height:di(e.height)}),t.appendChild(n),n}(e),i=this._svg=Z("svg");z(i,{width:"100%",height:"100%"}),j(n,i);const r=this._viewport=yi(i,"viewport");e.deferUpdate&&(this._viewboxChanged=function(e,t){let n,i,r,o;function a(n){let a=Date.now(),p=n?0:o+t-a;if(p>0)return s(p);e.apply(r,i),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function p(...e){o=Date.now(),i=e,r=this,n||s(t)}return p.flush=function(){n&&a(!0),l()},p.cancel=l,p}(w(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)},vi.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},vi.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=an(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},vi.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},vi.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},vi.prototype._getChildIndex=function(e){return f(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},vi.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:yi(this._viewport,"layer-"+e,n),index:t,visible:!0}},vi.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},vi.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?(U(n),t.visible=!1,n):n},vi.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],U(t.group))},vi.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},vi.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},vi.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},vi.prototype._findPlaneForRoot=function(e){return u(this._planes,(function(t){return t.rootElement===e}))},vi.prototype.getContainer=function(){return this._container},vi.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(h([i.gfx,i.secondaryGfx],(function(e){e&&(n?G(e).add(t):G(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},vi.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},vi.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},vi.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));return G(this.getGraphics(e)).has(t)},vi.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},vi.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},vi.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},vi.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},vi.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},vi.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)},vi.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})},vi.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})},vi.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=gi[e],i=d(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},vi.prototype._setParent=function(e,t,n){!function(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}(t.children,e,n),e.parent=t},vi.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},vi.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},vi.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},vi.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},vi.prototype.removeShape=function(e){return this._removeElement(e,"shape")},vi.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},vi.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},vi.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},vi.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},vi.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,a,s,l,p;return e?(this._changeViewbox((function(){s=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);ce(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=ce(t),r=a?a.matrix:function(e,t,n,i,r,o){var a=Q().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return ee(a,e);case 6:return ee(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),s=fi(r.a,1e3),l=fi(-r.e||0,1e3),p=fi(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/s:0,y:p?p/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},vi.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=E({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),bi(t,n)})),{x:n.e,y:n.f}},vi.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;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=on(e),o=qt(r),a=this.viewbox(),s=this.zoom();let l,p;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const c=qt(a);if(r.width<a.width&&r.height<a.height){const e=Math.max(0,o.right-c.right),t=Math.min(0,o.left-c.left),n=Math.max(0,o.bottom-c.bottom),i=Math.min(0,o.top-c.top);l=e||t,p=n||i}else l=r.x-a.x,p=r.y-a.y;this.scroll({dx:-l*s,dy:-p*s})},vi.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,i;return this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),fi(i.a,1e3)},vi.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},vi.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,l,p,c;l=i.getCTM();const u=l.a;return t?(a=E(o,t),s=a.matrixTransform(l.inverse()),p=r.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),c=l.multiply(p)):c=r.scale(e),bi(this._viewport,c),c},vi.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},vi.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}},vi.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var xi="data-element-id";function wi(e){this._elements={},this._eventBus=e}function Ei(e,t,n){var i=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach((function(i){e.set(i,t.inverse,n)}))}function _i(e,t){if(!(this instanceof _i))return new _i(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}wi.$inject=["eventBus"],wi.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),z(t,xi,i),n&&z(n,xi,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},wi.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(z(i.gfx,xi,""),i.secondaryGfx&&z(i.secondaryGfx,xi,""),delete t[n])},wi.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)},wi.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&z(t,xi,i),t},wi.prototype.get=function(e){var t;t="string"==typeof e?e:e&&z(e,xi);var n=this._elements[t];return n&&n.element},wi.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},wi.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},wi.prototype.getAll=function(){return this.filter((function(e){return e}))},wi.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},wi.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},wi.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")},_i.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Ei(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},_i.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||Ei(this,t,e),n},_i.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},_i.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},_i.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Ai=new _i({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Si=new _i({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Ri=new _i({name:"attachers",collection:!0},{name:"host"}),ki=new _i({name:"outgoing",collection:!0},{name:"source"}),Ci=new _i({name:"incoming",collection:!0},{name:"target"});function Mi(){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)}}),Ai.bind(this,"parent"),Si.bind(this,"labels"),ki.bind(this,"outgoing"),Ci.bind(this,"incoming")}function Pi(){Mi.call(this),Ai.bind(this,"children"),Ri.bind(this,"host"),Ri.bind(this,"attachers")}function Ti(){Mi.call(this),Ai.bind(this,"children")}function Oi(){Pi.call(this),Si.bind(this,"labelTarget")}function Ni(){Mi.call(this),ki.bind(this,"source"),Ci.bind(this,"target")}e(Pi,Mi),e(Ti,Pi),e(Oi,Pi),e(Ni,Mi);var Di={connection:Ni,shape:Pi,label:Oi,root:Ti};function Bi(){this._uid=12}Bi.prototype.createRoot=function(e){return this.create("root",e)},Bi.prototype.createLabel=function(e){return this.create("label",e)},Bi.prototype.createShape=function(e){return this.create("shape",e)},Bi.prototype.createConnection=function(e){return this.create("connection",e)},Bi.prototype.create=function(e,t){return(t=E({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Di[e];if(!n)throw new Error("unknown type: <"+e+">");return E(new n,t)}(e,t)};var Ii="__fn",Li=Array.prototype.slice;function ji(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Fi(){}function Vi(e,t){this._eventBus=e,this._elementRegistry=t}function Wi(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}ji.prototype.on=function(e,t,n,i){if(e=o(e)?e:[e],l(t)&&(i=n,n=t,t=1e3),!s(t))throw new Error("priority must be a number");var r=n;i&&((r=w(n,i))[Ii]=n[Ii]||n);var a=this;e.forEach((function(e){a._addListener(e,{priority:t,callback:r,next:null})}))},ji.prototype.once=function(e,t,n,i){var r=this;if(l(t)&&(i=n,n=t,t=1e3),!s(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[Ii]=n,this.on(e,t,o)},ji.prototype.off=function(e,t){e=o(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},ji.prototype.createEvent=function(e){var t=new Fi;return t.init(e),t},ji.prototype.fire=function(e,t){var n,i,r,o;if(o=Li.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 Fi?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}},ji.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},ji.prototype._destroy=function(){this._listeners={}},ji.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},ji.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},ji.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},ji.prototype._getListeners=function(e){return this._listeners[e]},ji.prototype._setListeners=function(e,t){this._listeners[e]=t},ji.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[Ii]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},Fi.prototype.stopPropagation=function(){this.cancelBubble=!0},Fi.prototype.preventDefault=function(){this.defaultPrevented=!0},Fi.prototype.init=function(e){E(this,e||{})},Vi.$inject=["eventBus","elementRegistry"],Vi.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(G(t=Z("g")).add("djs-children"),j(n.parentNode,t))):t=n,t},Vi.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return vt(t),t},Vi.prototype._createContainer=function(e,t,n,i){var r=Z("g");G(r).add("djs-group"),void 0!==n?Wi(r,t,t.childNodes[n]):j(t,r);var o=Z("g");G(o).add("djs-element"),G(o).add("djs-"+e),i&&G(o).add("djs-frame"),j(r,o);var a=Z("g");return G(a).add("djs-visual"),j(o,a),o},Vi.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,sn(t))},Vi.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=f(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),h(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e);h(t.slice().reverse(),(function(e){Wi(i.getGraphics(e).parentNode,r)}))}}))},Vi.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},Vi.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Vi.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},Vi.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Vi.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),et(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?z(n,"display","none"):z(n,"display","block")}},Vi.prototype.remove=function(e){U(this._elementRegistry.getGraphics(e).parentNode)};var zi={__depends__:[hi],__init__:["canvas"],canvas:["type",vi],elementRegistry:["type",wi],elementFactory:["type",Bi],eventBus:["type",ji],graphicsFactory:["type",Vi]};function $i(e){return function(e){var t=new ci(e);return t.init(),t}([{config:["value",e=e||{}]},zi].concat(e.modules||[]))}function Gi(e,t){this._injector=t||$i(e),this.get("eventBus").fire("diagram.init")}function Hi(){}function Ui(e,t){this.model=e,this.properties=t}Gi.prototype.get=function(e,t){return this._injector.get(e,t)},Gi.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Gi.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Gi.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Hi.prototype.get=function(e){return this.$model.properties.get(this,e)},Hi.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Ui.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Hi.prototype);h(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),h(e,w((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Ki={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},qi={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Yi(e,t){var n=qi[e];return n?n(t):t}function Xi(e){return!!Ki[e]}function Zi(e){return!!qi[e]}function Ji(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Qi(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function er(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,h(e,w(this.registerPackage,this))}function tr(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function nr(e){this.model=e}function ir(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function rr(e){return e.replace(/^:/,"")}function or(e,t={}){this.properties=new nr(this),this.factory=new Ui(this,this.properties),this.registry=new er(e,this.properties),this.typeCache={},this.config=t}Qi.prototype.build=function(){return function(e,t){let n={},i=Object(e);return h(t,(function(t){t in i&&(n[t]=e[t])})),n}(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Qi.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)},Qi.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},Qi.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Ji(r[0],i),a=Ji(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},Qi.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},Qi.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Qi.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},Qi.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},Qi.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},Qi.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")},Qi.prototype.hasProperty=function(e){return this.propertiesByName[e]},Qi.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(h(e.properties,w((function(n){n=E({},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)},er.prototype.getPackage=function(e){return this.packageMap[e]},er.prototype.getPackages=function(){return this.packages},er.prototype.registerPackage=function(e){e=E({},e);var t=this.packageMap;tr(t,e,"prefix"),tr(t,e,"uri"),h(e.types,w((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},er.prototype.registerType=function(e,t){var n=Ji((e=E({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:E(e.meta||{})})).name,t.prefix),i=n.name,r={};h(e.properties,w((function(e){var t=Ji(e.name,n.prefix),i=t.name;Xi(e.type)||(e.type=Ji(e.type,t.prefix).name),E(e,{ns:t,name:i}),r[i]=e}),this)),E(e,{ns:n,name:i,propertiesByName:r}),h(e.extends,w((function(e){var t=Ji(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},er.prototype.mapTypes=function(e,t,n){var i=Xi(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=Ji(n,Xi(n)?"":e.prefix);r.mapTypes(o,t,i)}function a(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");h(i.superClass,n?a:function(e){return o(e,!1)}),t(i,!n),h(i.traits,a)},er.prototype.getEffectiveDescriptor=function(e){var t=Ji(e),n=new Qi(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},er.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},nr.prototype.set=function(e,t,n){if(!p(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[rr(t)]:i?r in e?e[r]=n:ir(e,i,n):e.$attrs[rr(t)]=n},nr.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[rr(t)];var i=n.name;return!e[i]&&n.isMany&&ir(e,n,[]),e[i]},nr.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=E({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},nr.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},nr.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},nr.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;"undefined"!=typeof console&&console.warn(n)}return null},or.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},or.prototype.getType=function(e){var t=this.typeCache,n=p(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},or.prototype.createAny=function(e,t,n){var o=Ji(e),s={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){!function(e,t,n){let o=e;h(t,(function(e,a){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 s=t[a+1],l=o[e];r(s)&&null==l&&(l=o[e]=isNaN(+s)?{}:[]),i(s)?i(n)?delete o[e]:o[e]=n:o=l}))}(this,[e],t)}},l={name:e,isGeneric:!0,ns:{prefix:o.prefix,localName:o.localName,uri:t}};return this.properties.defineDescriptor(s,l),this.properties.defineModel(s,this),this.properties.define(s,"get",{enumerable:!1,writable:!0}),this.properties.define(s,"set",{enumerable:!1,writable:!0}),this.properties.define(s,"$parent",{enumerable:!1,writable:!0}),this.properties.define(s,"$instanceOf",{enumerable:!1,writable:!0}),h(n,(function(e,t){a(e)&&void 0!==e.value?s[e.name]=e.value:s[t]=e})),s},or.prototype.getPackage=function(e){return this.registry.getPackage(e)},or.prototype.getPackages=function(){return this.registry.getPackages()},or.prototype.getElementDescriptor=function(e){return e.$descriptor},or.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},or.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},or.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ar=String.fromCharCode,sr=Object.prototype.hasOwnProperty,lr=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,pr={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function cr(e,t,n,i){return i?sr.call(pr,i)?pr[i]:"&"+i+";":ar(t||parseInt(n,16))}function ur(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(lr,cr):e}Object.keys(pr).forEach((function(e){pr[e.toUpperCase()]=pr[e]}));var mr="xsi:type",hr="non-whitespace outside of root node";function fr(e){return new Error(e)}function dr(e){return"missing namespace for prefix <"+e+">"}function yr(e){return{get:e,enumerable:!0}}function gr(e){var t,n={};for(t in e)n[t]=e[t];return n}function vr(e){return e+"$uri"}function br(){return{line:0,column:0}}function xr(e){throw e}function wr(e){if(!this)return new wr(e);var t,n,i,r,o,a,s,l,p,c=e&&e.proxy,u=xr,m=br,h=!1,f=!1,d=null,y=!1;function g(e){e instanceof Error||(e=fr(e)),d=e,u(e,m)}function v(e){o&&(e instanceof Error||(e=fr(e)),o(e,m))}this.on=function(e,p){if("function"!=typeof p)throw fr("required args <name, cb>");switch(e){case"openTag":n=p;break;case"text":t=p;break;case"closeTag":i=p;break;case"error":u=p;break;case"warn":o=p;break;case"cdata":r=p;break;case"attention":l=p;break;case"question":s=p;break;case"comment":a=p;break;default:throw fr("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw fr("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,p=n,this},this.parse=function(e){if("string"!=typeof e)throw fr("required args <xml=string>");return d=null,function(e){var o,u,d,b,x,w,E,_,A,S,R,k=f?[]:null,C=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[vr(n)]=t;return i}(p):null,M=[],P=0,T=!1,O=!1,N=0,D=0,B="",I=0;function L(){if(null!==R)return R;var e,t,n,i,r,o,a,s,l,c,u,m=f&&C.xmlns,d=f&&h?[]:null,y=I,g=B,b=g.length,x={},w={};e:for(;y<b;y++)if(l=!1,!(32===(c=g.charCodeAt(y))||c<14&&c>8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(v("illegal first char attribute name"),l=!0),u=y+1;u<b;u++)if(!((c=g.charCodeAt(u))>96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){v("missing attribute value"),y=u;continue e}if(61===c)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),l=!0),34===(c=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),l=!0);else if(39===c)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u<b&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++);for(-1===u&&(v("missing closing quotes"),u=b,l=!0),l||(o=g.substring(y,u)),y=u;u+1<b&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++)y===u&&(v("illegal character after attribute end"),l=!0);if(y=u+1,!l)if(s in w)v("attribute <"+s+"> already defined");else if(w[s]=!0,f)if(h){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=ur(o),t=vr(r),!(a=p[e])){if("xmlns"===r||t in C&&C[t]!==e)do{a="ns"+P++}while(void 0!==C[a]);else a=r;p[e]=a}C[r]!==a&&(i||(C=gr(C),i=!0),C[r]=a,"xmlns"===r&&(C[vr(a)]=e,m=a),C[t]=e),x[s]=o;continue}d.push(s,o)}else-1!==(c=s.indexOf(":"))?(n=C[s.substring(0,c)])?((s=m===n?s.substr(c+1):n+s.substr(c))===mr&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=C[n]||n)+o.substring(c)):o=m+":"+o),x[s]=o):v(dr(s.substring(0,c))):x[s]=o;else x[s]=o}if(h)for(y=0,b=d.length;y<b;y++){if(s=d[y++],o=d[y],-1!==(c=s.indexOf(":"))){if(!(n=C[s.substring(0,c)])){v(dr(s.substring(0,c)));continue}(s=m===n?s.substr(c+1):n+s.substr(c))===mr&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=C[n]||n)+o.substring(c)):o=m+":"+o)}x[s]=o}return R=x}function j(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,s=D;N>=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>N);)r+=1,a=s;return-1==N?(o=s,n=e.substring(D)):0===D?n=e.substring(D,N):(o=N-a,n=-1==D?e.substring(N):e.substring(N,D+1)),{data:n,line:r,column:o}}m=j,c&&(S=Object.create({},{name:yr((function(){return _})),originalName:yr((function(){return A})),attrs:yr(L),ns:yr((function(){return C}))}));for(;-1!==D;){if(-1===(N=60===e.charCodeAt(D)?D:e.indexOf("<",D)))return M.length?g("unexpected end of file"):0===D?g("missing start tag"):void(D<e.length&&e.substring(D).trim()&&v(hr));if(D!==N)if(M.length){if(t&&(t(e.substring(D,N),ur,m),y))return}else if(e.substring(D,N).trim()&&(v(hr),y))return;if(33===(x=e.charCodeAt(N+1))){if(91===(b=e.charCodeAt(N+2))&&"CDATA["===e.substr(N+3,6)){if(-1===(D=e.indexOf("]]>",N)))return g("unclosed cdata");if(r&&(r(e.substring(N+9,D),m),y))return;D+=3;continue}if(45===b&&45===e.charCodeAt(N+3)){if(-1===(D=e.indexOf("--\x3e",N)))return g("unclosed comment");if(a&&(a(e.substring(N+4,D),ur,m),y))return;D+=3;continue}}if(63!==x){for(u=N+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return D=-1,g("unclosed tag");if(34===w)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===w)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===w){D=u;break}}if(33!==x){if(R={},47===x){if(T=!1,O=!0,!M.length)return g("missing open tag");if(u=_=M.pop(),b=N+2+u.length,e.substring(N+2,b)!==u)return g("closing tag mismatch");for(;b<D;b++)if(!(32===(x=e.charCodeAt(b))||x>8&&x<14))return g("close tag")}else{if(47===e.charCodeAt(D-1)?(u=_=e.substring(N+1,D-1),T=!0,O=!0):(u=_=e.substring(N+1,D),T=!0,O=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return g("illegal first char nodeName");for(b=1,d=u.length;b<d;b++)if(!((x=u.charCodeAt(b))>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){_=u.substring(0,b),R=null;break}return g("invalid nodeName")}O||M.push(_)}if(f){if(o=C,T&&(O||k.push(o),null===R&&(h=-1!==u.indexOf("xmlns",b))&&(I=b,B=u,L(),h=!1)),A=_,-1!==(x=_.indexOf(":"))){if(!(E=C[_.substring(0,x)]))return g("missing namespace on <"+A+">");_=_.substr(x+1)}else E=C.xmlns;E&&(_=E+":"+_)}if(T&&(I=b,B=u,n&&(c?n(S,ur,O,m):n(_,L,ur,O,m),y)))return;if(O){if(i&&(i(c?S:_,ur,T,m),y))return;f&&(C=T?o:k.pop())}D+=1}else{if(l&&(l(e.substring(N,D+1),ur,m),y))return;D+=1}}else{if(-1===(D=e.indexOf("?>",N)))return g("unclosed question");if(s&&(s(e.substring(N,D+2),m),y))return;D+=2}}}(e),m=br,y=!1,d},this.stop=function(){y=!0}}function Er(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var _r={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Ar="xsi:type";function Sr(e){return e.xml&&e.xml.serialize}function Rr(e){return Sr(e)===Ar}function kr(e,t){return Er(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Cr(e){return new Error(e)}function Mr(e){return e.$descriptor}function Pr(e){E(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Cr("expected element");var t,n=this.elementsById,i=Mr(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 Cr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Tr(){}function Or(){}function Nr(){}function Dr(e,t){this.property=e,this.context=t}function Br(e,t){this.element=t,this.propertyDesc=e}function Ir(){}function Lr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function jr(e,t,n){Lr.call(this,e,t,n)}function Fr(e,t,n){this.model=e,this.context=n}function Vr(e){e instanceof or&&(e={model:e}),E(this,{lax:!1},e)}Tr.prototype.handleEnd=function(){},Tr.prototype.handleText=function(){},Tr.prototype.handleNode=function(){},Or.prototype=Object.create(Tr.prototype),Or.prototype.handleNode=function(){return this},Nr.prototype=Object.create(Tr.prototype),Nr.prototype.handleText=function(e){this.body=(this.body||"")+e},Dr.prototype=Object.create(Nr.prototype),Dr.prototype.handleNode=function(e){if(this.element)throw Cr("expected no sub nodes");return this.element=this.createReference(e),this},Dr.prototype.handleEnd=function(){this.element.id=this.body},Dr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Br.prototype=Object.create(Nr.prototype),Br.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Yi(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Ir.prototype=Object.create(Nr.prototype),Ir.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},Lr.prototype=Object.create(Ir.prototype),Lr.prototype.addReference=function(e){this.context.addReference(e)},Lr.prototype.handleText=function(e){if(!Mr(this.element).bodyProperty)throw Cr("unexpected body text <"+e+">");Nr.prototype.handleText.call(this,e)},Lr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Mr(t).bodyProperty;n&&void 0!==e&&(e=Yi(n.type,e),t.set(n.name,e))},Lr.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Mr(i),o=this.context,a=new i({}),s=this.model;return h(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?h(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=Yi(i.type,e):"xmlns"!==n&&(t=Ji(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},Lr.prototype.getPropertyForNode=function(e){var t,n,i=Ji(e.name),r=this.type,o=this.model,a=Mr(r),s=i.name,l=a.propertiesByName[s];if(l&&!l.isAttr)return Rr(l)&&(t=e.attributes[Ar])?(t=function(e,t){var n=Ji(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),E({},l,{effectiveType:Mr(n=o.getType(t)).name})):l;var p=o.getPackage(i.prefix);if(p){if(t=kr(i,p),n=o.getType(t),l=u(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return E({},l,{effectiveType:Mr(n).name})}else if(l=u(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw Cr("unrecognized element <"+i.name+">")},Lr.prototype.toString=function(){return"ElementDescriptor["+Mr(this.type).name+"]"},Lr.prototype.valueHandler=function(e,t){return new Br(e,t)},Lr.prototype.referenceHandler=function(e){return new Dr(e,this.context)},Lr.prototype.handler=function(e){return"Element"===e?new Fr(this.model,e,this.context):new Lr(this.model,e,this.context)},Lr.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Zi(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?(E(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},jr.prototype=Object.create(Lr.prototype),jr.prototype.createElement=function(e){var t=e.name,n=Ji(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&kr(n,o)||t;if(!r.hasType(a))throw Cr("unexpected element <"+e.originalName+">");return Lr.prototype.createElement.call(this,e)},Fr.prototype=Object.create(Ir.prototype),Fr.prototype.createElement=function(e){var t=e.name,n=Ji(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Fr.prototype.handleChild=function(e){var t=new Fr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},Fr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Vr.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Lr?(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 Pr(E({},t,{rootHandler:i})),s=new wr({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function p(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw Cr(l)}function c(e,t){return p(e,t,!0)}i.context=a,l.push(i);var u=/^<\?xml /i,m=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var d=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(d).on("openTag",(function(e,t,n,i){var r=e.attrs||{},a=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){p(e,t,o)&&l.push(new Or)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=m.exec(e),n=t&&t[1];n&&!h.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",p).on("warn",c),new Promise((function(t,n){var r;try{s.parse(e),function(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=Mr(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=r.get(s.name),p=l.indexOf(t);-1===p&&(p=l.length),o?l[p]=o:l.splice(p,1)}else r.set(s.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=Cr("failed to parse document as <"+i.type.$descriptor.name+">"));var l=a.warnings,p=a.references,c=a.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:c,references:p,warnings:l})}))},Vr.prototype.handler=function(e){return new jr(this.model,e)};var Wr=/<|>|'|"|&|\n\r|\n/g,zr=/<|>|&/g;function $r(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 Gr(e,t){return Er(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function Hr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Ur(e){return p(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var Kr={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},qr={"<":"lt",">":"gt","&":"amp"};function Yr(e,t,n){return(e=p(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Xr(e){this.tagName=e}function Zr(){}function Jr(e){this.tagName=e}function Qr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function eo(e,t){Qr.call(this,e,t)}function to(){this.value="",this.write=function(e){this.value+=e}}function no(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 io(e){return e=E({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new to,r=new no(i,e.format);if(e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new Qr).build(t).serializeTo(r),!n)return i.value}}}function ro(e,t){or.call(this,e,t)}Xr.prototype.build=function(e){return this.element=e,this},Xr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Zr.prototype.serializeValue=Zr.prototype.serializeTo=function(e){e.append(this.escape?Yr(this.value,zr,qr):this.value)},Zr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(zr)&&(this.escape=!0),this},Hr(Jr,Zr),Jr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Qr.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 m(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!c(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(m(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return m(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},Qr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?E({localName:t.ns.localName},e):E({localName:Gr(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Qr.prototype.nsPropertyTagName=function(e){return function(e,t){return E({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Qr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Qr.prototype.nsAttributeName=function(e){var t;if(t=p(e)?Ji(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}:E({localName:t.localName},n)},Qr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return h(e,(function(r,o){"$body"===o?n.push((new Zr).build({type:"String"},r)):"$children"===o?h(r,(function(e){n.push(new Qr(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},Qr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Ji(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)}},Qr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return h(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},Qr.prototype.parseGenericAttributes=function(e,t){var n=this;h(t,(function(t){if(t.name!==Ar)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},Qr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;h(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Zr).build(e,r[0]));else if(Zi(e.type))h(r,(function(i){n.push(new Jr(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)h(r,(function(i){n.push(new Xr(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var a=Rr(e),s=function(e){return"property"===Sr(e)}(e);h(r,(function(i){var r;r=a?new eo(t,e):s?new Qr(t,e):new Qr(t),n.push(r.build(i))}))}}))},Qr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new $r(t):n=t),n},Qr.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},Qr.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=_r[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},Qr.prototype.parseAttributes=function(e){var t=this,n=this.element;h(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];h(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Qr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Ur(e)},Qr.prototype.addAttribute=function(e,t){var n=this.attrs;p(t)&&(t=Yr(t,Wr,Kr));var i=function(e,t){const n=v(t);let i=o(e)?-1:void 0;return h(e,(function(e,t){if(n(e,t))return i=t,!1})),i}(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)},Qr.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)),h(t,(function(t){e.append(" ").append(Ur(t.name)).append('="').append(t.value).append('"')}))},Qr.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Zr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),h(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Hr(eo,Qr),eo.prototype.parseNsAttributes=function(e){var t=Qr.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(Ar),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},eo.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},ro.prototype=Object.create(or.prototype),ro.prototype.fromXML=function(e,t,n){p(t)||(n=t,t="bpmn:Definitions");var i=new Vr(E({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},ro.prototype.toXML=function(e,t){var n=new io(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var oo={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 ao(e,t){return new ro(E({},oo,e),t)}var so="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 lo(e,t){return e.$instanceOf(t)}function po(e){var t={},n=[],i={};function r(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function a(t,n){try{var r=i[t.id]&&function(t,n){if(t.gfx)throw new Error(`already rendered ${Jt(t)}`);return e.element(t,i[t.id],n)}(t,n);return o(t),r}catch(e){s(e.message,{element:t,error:e}),console.error(`failed to import ${Jt(t)}`,e)}}function s(t,n){e.error(t,n)}var l=this.registerDi=function(e){var t,n=e.bpmnElement;n?i[n.id]?s(`multiple DI elements defined for ${Jt(n)}`,{element:n}):(i[n.id]=e,c(t=n,"di")||Object.defineProperty(t,"di",{enumerable:!1,get:function(){throw new Error(so)}})):s(`no bpmnElement referenced in ${Jt(e)}`,{element:e})};function p(e){var t;t=e.plane,l(t),h(t.planeElement,f)}function f(e){l(e)}this.handleDefinitions=function(o,a){var c=o.diagrams;if(a&&-1===c.indexOf(a))throw new Error("diagram not part of <bpmn:Definitions />");if(!a&&c&&c.length&&(a=c[0]),!a)throw new Error("no diagram to display");i={},p(a);var f=a.plane;if(!f)throw new Error(`no plane for ${Jt(a)}`);var v=f.bpmnElement;if(!v){if(v=function(e){return u(e.rootElements,(function(e){return lo(e,"bpmn:Process")||lo(e,"bpmn:Collaboration")}))}(o),!v)throw new Error("no process or collaboration to display");s(`correcting missing bpmnElement on ${Jt(f)} to ${Jt(v)}`),f.bpmnElement=v,l(f)}var b,x,w=function(t,n){return e.root(t,i[t.id],n)}(v,f);if(lo(v,"bpmn:Process")||lo(v,"bpmn:SubProcess"))y(v,w);else{if(!lo(v,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${Jt(f)}: ${Jt(v)}`);x=w,h((b=v).participants,r(P,x)),E(b.artifacts,x),n.push((function(){!function(e,t){h(e,r(g,t))}(b.messageFlows,x)})),function(e,n){var i=m(e,(function(e){return!t[e.id]&&lo(e,"bpmn:Process")&&e.laneSets}));i.forEach(r(y,n))}(o.rootElements,w)}d(n)};var d=this.handleDeferred=function(){for(;n.length;)n.shift()()};function y(e,t){M(e,t),_(e.ioSpecification,t),E(e.artifacts,t),o(e)}function g(e,t){a(e,t)}function v(e,t){a(e,t)}function b(e,t){a(e,t)}function x(e,t){a(e,t)}function w(e,t){a(e,t)}function E(e,t){h(e,(function(e){lo(e,"bpmn:Association")?n.push((function(){w(e,t)})):w(e,t)}))}function _(e,t){e&&(h(e.dataInputs,r(b,t)),h(e.dataOutputs,r(x,t)))}var A=this.handleSubProcess=function(e,t){M(e,t),E(e.artifacts,t)};function S(e,t){var i=a(e,t);lo(e,"bpmn:SubProcess")&&A(e,i||t),lo(e,"bpmn:Activity")&&_(e.ioSpecification,t),n.push((function(){h(e.dataInputAssociations,r(v,t)),h(e.dataOutputAssociations,r(v,t))}))}function R(e,t){a(e,t)}function k(e,t){n.push((function(){var n=a(e,t);e.childLaneSet&&C(e.childLaneSet,n||t),function(e){h(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function C(e,t){h(e.lanes,r(k,t))}function M(e,t){!function(e,t){h(e,(function(e){lo(e,"bpmn:SequenceFlow")?n.push((function(){!function(e,t){a(e,t)}(e,t)})):lo(e,"bpmn:BoundaryEvent")?n.unshift((function(){S(e,t)})):lo(e,"bpmn:FlowNode")?S(e,t):lo(e,"bpmn:DataObject")||(lo(e,"bpmn:DataStoreReference")||lo(e,"bpmn:DataObjectReference")?R(e,t):s(`unrecognized flowElement ${Jt(e)} in context ${Jt(t&&t.businessObject)}`,{element:e,context:t}))}))}(e.flowElements,t),e.laneSets&&function(e,t){h(e,r(C,t))}(e.laneSets,t)}function P(e,t){var n=a(e,t),i=e.processRef;i&&y(i,n||t)}}function co(e,t,n){var i,r,o,a=[];function s(e,t){var n=new po({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){a.push({message:e,context:t})}});t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t||!t.plane)return;var n,i=t.plane.bpmnElement,r=i;S(i,"bpmn:Process")||S(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(S(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=S(r,"bpmn:Collaboration")?r:u(e.rootElements,(function(e){if(S(e,"bpmn:Collaboration"))return u(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=function(e,t){let n=[];return h(e,(function(e,i){n.push(t(e,i))})),n}(n.participants,(function(e){return e.processRef}))).push(n);var a=uo(o),s=[t],l=[i];return h(e.diagrams,(function(e){if(e.plane){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("no diagram to display");h(r,(function(t){n.handleDefinitions(e,t)}));var s=t.plane.bpmnElement.id;o.setRootElement(o.findRoot(s+"_plane")||o.findRoot(s))}return new Promise((function(l,p){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("canvas"),r.fire("import.render.start",{definitions:t}),s(t,n),r.fire("import.render.complete",{error:undefined,warnings:a}),l({warnings:a})}catch(e){return e.warnings=a,p(e)}}))}function uo(e){var t=[];return h(e,(function(e){e&&(t.push(e),t=t.concat(uo(e.flowElements)))})),t}var mo,ho='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',fo={verticalAlign:"middle"},yo={color:"#404040"},go={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},vo={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},bo={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"},xo='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+ho+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';function wo(){mo||(De(mo=Ze(xo),go),De(Je("svg",mo),fo),De(Je(".backdrop",mo),vo),De(Je(".notice",mo),bo),De(Je(".link",mo),yo,{margin:"15px 20px 15px 10px",alignSelf:"center"}),Ke.bind(mo,".backdrop","click",(function(e){document.body.removeChild(mo)}))),document.body.appendChild(mo)}function Eo(e){e=E({},Ao,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=Ze('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+ho+"</a>");De(Je("svg",t),fo),De(t,yo,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),Ge.bind(t,"click",(function(e){wo(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function _o(e,t){return e.warnings=t,e}e(Eo,Gi),Eo.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let a=o.rootElement;const s=o.references,l=o.warnings,p=o.elementsById;i=i.concat(l),a=this._emit("import.parse.complete",(r={error:null,definitions:a,elementsById:p,references:s,warnings:i},n.get("eventBus").createEvent(r)))||a;const c=await this.importDefinitions(a,t);return i=i.concat(c.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),_o(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},Eo.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},Eo.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw _o(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return u(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw _o(t,[]),t}try{this.clear()}catch(e){throw _o(e,[]),e}const{warnings:i}=await co(this,t,n);return{warnings:i}},Eo.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},Eo.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=Je("defs",t._svg),r=le(n),o=i?"<defs>"+le(i)+"</defs>":"",a=n.getBBox();e='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a.width+'" height="'+a.height+'" viewBox="'+a.x+" "+a.y+" "+a.width+" "+a.height+'" version="1.1">'+o+r+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},Eo.prototype._setDefinitions=function(e){this._definitions=e},Eo.prototype.getModules=function(){return this._modules},Eo.prototype.clear=function(){this.getDefinitions()&&Gi.prototype.clear.call(this)},Eo.prototype.destroy=function(){var e;Gi.prototype.destroy.call(this),(e=this._container).parentNode&&e.parentNode.removeChild(e)},Eo.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Eo.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Eo.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=Je(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Eo.prototype.getDefinitions=function(){return this._definitions},Eo.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Eo.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=E(function(e,t){let n={};return h(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}(n,["additionalModules"]),{canvas:E({},n.canvas,{container:e}),modules:o});Gi.call(this,a),n&&n.container&&this.attachTo(n.container)},Eo.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Eo.prototype._createContainer=function(e){const t=Ze('<div class="bjs-container"></div>');return De(t,{width:So(e.width),height:So(e.height),position:e.position}),t},Eo.prototype._createModdle=function(e){return new ao(E({},this._moddleExtensions,e.moddleExtensions))},Eo.prototype._modules=[];const Ao={width:"100%",height:"100%",position:"relative"};function So(e){return e+(s(e)?"px":"")}function Ro(e){Eo.call(this,e)}e(Ro,Eo),Ro.prototype._modules=[rn,Nn,Wn,fn,ti,Kt],Ro.prototype._moddleExtensions={};function ko(e,t,n){this._bpmnRenderer=t,this._iconProperty=e&&e.iconProperty,A.call(this,n,1250)}e(ko,A),ko.prototype.canRender=function(e){return!T(e)&&!(!R(e,["bpmn:Task","bpmn:Event"])||!this._getIcon(e))},ko.prototype._getIcon=function(e){return function(e,t){return t=t||"zeebe:modelerTemplateIcon",k(e).get(t)}(e,this._iconProperty)},ko.prototype.drawShape=function(e,t,n={}){var i=(0,this._bpmnRenderer.handlers[["bpmn:BoundaryEvent","bpmn:EndEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:StartEvent","bpmn:Task"].find((e=>S(t,e)))])(e,t,{...n,renderIcon:!1}),r=this._getIcon(t),o=S(t,"bpmn:Task")?{x:5,y:5}:{x:(t.width-18)/2,y:(t.height-18)/2},a=Z("image");return z(a,{href:r,width:18,height:18,...o}),j(e,a),i},ko.$inject=["config.elementTemplateIconRenderer","bpmnRenderer","eventBus"];const Co=[{__init__:["elementTemplateIconRenderer"],elementTemplateIconRenderer:["type",ko]}],Mo={zeebe:{name:"zeebe",prefix:"zeebe",uri:"http://camunda.org/schema/zeebe/1.0",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"ZeebeServiceTask",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:SendTask","bpmn:EndEvent","bpmn:IntermediateThrowEvent"],properties:[{name:"retryCounter",type:"String",isAttr:!0}]},{name:"IoMapping",superClass:["Element"],properties:[{name:"ioMapping",type:"IoMapping"},{name:"inputParameters",isMany:!0,type:"Input"},{name:"outputParameters",isMany:!0,type:"Output"}],meta:{allowedIn:["bpmn:CallActivity","bpmn:Event","bpmn:ReceiveTask","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"InputOutputParameter",properties:[{name:"source",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"}]},{name:"Subscription",superClass:["Element"],properties:[{name:"correlationKey",isAttr:!0,type:"String"}]},{name:"Input",superClass:["InputOutputParameter"],meta:{allowedIn:["bpmn:CallActivity","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"Output",superClass:["InputOutputParameter"],meta:{allowedIn:["bpmn:CallActivity","bpmn:Event","bpmn:ReceiveTask","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"TaskHeaders",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask","bpmn:UserTask"]},properties:[{name:"values",type:"Header",isMany:!0}]},{name:"Header",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"key",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"TaskDefinition",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask"]},properties:[{name:"type",type:"String",isAttr:!0},{name:"retries",type:"String",isAttr:!0}]},{name:"LoopCharacteristics",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask","bpmn:ReceiveTask","bpmn:SubProcess"]},properties:[{name:"inputCollection",type:"String",isAttr:!0},{name:"inputElement",type:"String",isAttr:!0},{name:"outputCollection",type:"String",isAttr:!0},{name:"outputElement",type:"String",isAttr:!0}]},{name:"CalledElement",superClass:["Element"],meta:{allowedIn:["bpmn:CallActivity"]},properties:[{name:"processId",type:"String",isAttr:!0},{name:"processIdExpression",type:"String",isAttr:!0},{name:"propagateAllChildVariables",isAttr:!0,type:"Boolean"},{name:"propagateAllParentVariables",isAttr:!0,type:"Boolean",default:!0}]},{name:"UserTaskForm",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"body",type:"String",isBody:!0}]},{name:"FormDefinition",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"formKey",type:"String",isAttr:!0},{name:"formId",type:"String",isAttr:!0},{name:"externalReference",type:"String",isAttr:!0}]},{name:"UserTask",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[]},{name:"CalledDecision",superClass:["Element"],meta:{allowedIn:["bpmn:BusinessRuleTask"]},properties:[{name:"decisionId",type:"String",isAttr:!0},{name:"resultVariable",type:"String",isAttr:!0}]},{name:"AssignmentDefinition",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"assignee",type:"String",isAttr:!0},{name:"candidateGroups",type:"String",isAttr:!0},{name:"candidateUsers",type:"String",isAttr:!0}]},{name:"TaskSchedule",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"dueDate",type:"String",isAttr:!0},{name:"followUpDate",type:"String",isAttr:!0}]},{name:"Properties",superClass:["Element"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"Property",properties:[{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Collaboration","bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"},{name:"modelerTemplateIcon",isAttr:!0,type:"String"}]},{name:"TemplatedRootElement",isAbstract:!0,extends:["bpmn:Error","bpmn:Escalation","bpmn:Message","bpmn:Signal"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Script",superClass:["Element"],meta:{allowedIn:["bpmn:ScriptTask"]},properties:[{name:"expression",type:"String",isAttr:!0},{name:"resultVariable",type:"String",isAttr:!0}]}]}};function Po(e={}){e={...e,moddleExtensions:{...Mo,...e.moddleExtensions}},Ro.call(this,e)}return e(Po,Ro),Po.prototype._camundaCloudModules=[...Co],Po.prototype._modules=[].concat(Ro.prototype._modules,Po.prototype._camundaCloudModules),Po}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BpmnViewer=t()}(this,(function(){"use strict";function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}const t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return void 0===e}function r(e){return void 0!==e}function o(e){return"[object Array]"===t.call(e)}function a(e){return"[object Object]"===t.call(e)}function s(e){return"[object Number]"===t.call(e)}function l(e){const n=t.call(e);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function p(e){return"[object String]"===t.call(e)}function c(e,t){return n.call(e,t)}function u(e,t){const n=v(t);let i;return h(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function m(e,t){const n=v(t);let i=[];return h(e,(function(e,t){n(e,t)&&i.push(e)})),i}function h(e,t){let n,r;if(i(e))return;const a=o(e)?b:x;for(let i in e)if(c(e,i)&&(n=e[i],r=t(n,a(i)),!1===r))return n}function f(e,t,n){return h(e,(function(e,i){n=t(n,e,i)})),n}function d(e,t){return!!f(e,(function(e,n,i){return e&&t(n,i)}),!0)}function y(e,t){return!!u(e,t)}function g(e){return function(t){return d(e,(function(e,n){return t[n]===e}))}}function v(e){return l(e)?e:t=>t===e}function x(e){return e}function b(e){return Number(e)}function w(e,t){return e.bind(t)}function E(e,...t){return Object.assign(e,...t)}var _=1e3;function A(e,t){var n=this;t=t||_,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,a):n.drawConnection(o,r,a)})),e.on(["render.getShapePath","render.getConnectionPath"],t,(function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)}))}function S(e,t){var n=k(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function R(e,t){return y(t,(function(t){return S(e,t)}))}function k(e){return e&&e.businessObject||e}function C(e){return e&&e.di}function M(e,t){return!S(e,"bpmn:CallActivity")&&(S(e,"bpmn:SubProcess")?!(!(t=t||C(e))||!S(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!S(e,"bpmn:Participant")||!!k(e).processRef)}function P(e){if(S(e,"bpmn:Participant")||S(e,"bpmn:Lane")){var t=C(e).isHorizontal;return void 0===t||t}}function T(e){return a(e)&&c(e,"labelTarget")}A.prototype.canRender=function(e){},A.prototype.drawShape=function(e,t){},A.prototype.drawConnection=function(e,t){},A.prototype.getShapePath=function(e){},A.prototype.getConnectionPath=function(e){};var O={width:90,height:20},N=15;function D(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=N:a+=N,{x:a,y:s}}function B(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(O.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=function(e){return e.waypoints?D(e.waypoints):S(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+O.height/2}:{x:e.x+e.width/2,y:e.y+e.height+O.height/2}}(t),i=O),E({x:n.x-i.width/2,y:n.y-i.height/2},i)}function I(e){var t=e.businessObject,n=function(e){return S(e,"bpmn:FlowElement")||S(e,"bpmn:Participant")||S(e,"bpmn:Lane")||S(e,"bpmn:SequenceFlow")||S(e,"bpmn:MessageFlow")||S(e,"bpmn:DataInput")||S(e,"bpmn:DataOutput")?"name":S(e,"bpmn:TextAnnotation")?"text":S(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function L(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function j(e,t){return L(t,e),e}var F=2,V={"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":F,"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":F,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function W(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=V[i];r?(r===F&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function z(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return V[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);W(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)W(e,i,t[i])}(e,t);return e}const $=Object.prototype.toString;function G(e){return new H(e)}function H(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function U(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}H.prototype.add=function(e){return this.list.add(e),this},H.prototype.remove=function(e){return"[object RegExp]"==$.call(e)?this.removeMatching(e):(this.list.remove(e),this)},H.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},H.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},H.prototype.array=function(){return Array.from(this.list)},H.prototype.has=H.prototype.contains=function(e){return this.list.contains(e)};var K={svg:"http://www.w3.org/2000/svg"},q='<svg xmlns="'+K.svg+'"';function Y(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(K.svg)&&(e=q+e.substring(4)):(e=q+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function X(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=Y(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(K.svg,e),t&&z(n,t),n}var Z=null;function J(){return null===Z&&(Z=X("svg")),Z}function Q(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function ee(e){return e?J().createSVGTransformFromMatrix(e):J().createSVGTransform()}var te=/([&<>]{1})/g,ne=/([\n\r"]{1})/g,ie={"&":"&","<":"<",">":">",'"':"'"};function re(e,t){return e.replace(t,(function(e,t){return ie[t]||t}))}function oe(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(re(e.textContent,te));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',re(o.value,ne),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)oe(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",re(e.nodeValue,te),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function ae(e,t){var n=Y(t);if(U(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)L(r[o],e)}}function se(e,t){if(void 0!==t){try{ae(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)oe(t,n),t=t.nextSibling;return n.join("")}(e)}function le(e){var t=e.parentNode;return t&&t.removeChild(e),e}function pe(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function ce(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(pe(e,i))}(n,t)),n.consolidate()}function ue(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function me(e){return["L",e.x,e.y]}function he(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,a,s;for(let r=1;r<n;r++){const n=e[r-1],l=e[r],p=e[r+1];if(!p||!t){i.push(me(l));continue}const c=Math.min(t,de(l.x-n.x,l.y-n.y),de(p.x-l.x,p.y-l.y));if(!c){i.push(me(l));continue}const u=fe(l,n,c),m=fe(l,n,.5*c),h=fe(l,p,c),f=fe(l,p,.5*c);i.push(me(u)),i.push((a=f,s=h,["C",(o=m).x,o.y,a.x,a.y,s.x,s.y]))}return i}function fe(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=n/de(i,r);return{x:e.x+i*o,y:e.y+r*o}}function de(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ye(e,t,n){s(t)&&(n=t,t=null),t||(t={});const i=X("path",t);return s(n)&&(i.dataset.cornerRadius=String(n)),ge(i,e)}function ge(e,t){return z(e,{d:ue(he(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}var ve="hsl(225, 10%, 15%)",xe="white";function be(e,t){return y(e.eventDefinitions,(function(e){return e.$type===t}))}function we(e,t,n){var i=C(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||xe}function Ee(e,t,n){var i=C(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||ve}function _e(e,t,n,i){var r=C(e).get("label");return i||r&&r.get("color:color")||t||Ee(e,n)}function Ae(e,t={}){return{width:Se(e,t),height:Re(e,t)}}function Se(e,t={}){return c(t,"width")?t.width:e.width}function Re(e,t={}){return c(t,"height")?t.height:e.height}function ke(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}const Ce=Object.prototype.toString,Me=Object.prototype.hasOwnProperty;function Pe(e,t){return Me.call(e,t)}function Te(e,t){let n,i;if(void 0===e)return;const r=function(e){return"[object Array]"===Ce.call(e)}(e)?Ne:Oe;for(let o in e)if(Pe(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function Oe(e){return e}function Ne(e){return Number(e)}function De(e,...t){const n=e.style;return Te(t,(function(e){e&&Te(e,(function(e,t){n[t]=e}))})),e}const Be=Object.prototype.toString;function Ie(e){return new Le(e)}function Le(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function je(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}Le.prototype.add=function(e){return this.list.add(e),this},Le.prototype.remove=function(e){return"[object RegExp]"==Be.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Le.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Le.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Le.prototype.array=function(){return Array.from(this.list)},Le.prototype.has=Le.prototype.contains=function(e){return this.list.contains(e)};var Fe,Ve,We,ze={};function $e(){Fe=window.addEventListener?"addEventListener":"attachEvent",Ve=window.removeEventListener?"removeEventListener":"detachEvent",We="addEventListener"!==Fe?"on":""}var Ge=ke({__proto__:null,bind:ze.bind=function(e,t,n,i){return Fe||$e(),e[Fe](We+t,n,i||!1),n},unbind:ze.unbind=function(e,t,n,i){return Ve||$e(),e[Ve](We+t,n,i||!1),n},default:ze},[ze]),He=["focus","blur"];var Ue,Ke={bind:function(e,t,n,i,r){return-1!==He.indexOf(n)&&(r=!0),Ge.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=function(e,t,n){var i=n?e:e.parentNode;return i&&"function"==typeof i.closest&&i.closest(t)||null}(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==He.indexOf(t)&&(i=!0),Ge.unbind(e,t,n,i)}},qe=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild)}var r,o=Object.prototype.hasOwnProperty.call(Xe,i)?Xe[i]:Xe._default,a=o[0],s=o[1],l=o[2];(r=t.createElement("div")).innerHTML=s+e+l;for(;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var p=t.createDocumentFragment();for(;r.firstChild;)p.appendChild(r.removeChild(r.firstChild));return p},Ye=!1;"undefined"!=typeof document&&((Ue=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Ye=!Ue.getElementsByTagName("link").length,Ue=void 0);var Xe={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Ye?[1,"X<div>","</div>"]:[0,"",""]};Xe.td=Xe.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Xe.option=Xe.optgroup=[1,'<select multiple="multiple">',"</select>"],Xe.thead=Xe.tbody=Xe.colgroup=Xe.caption=Xe.tfoot=[1,"<table>","</table>"],Xe.polyline=Xe.ellipse=Xe.polygon=Xe.circle=Xe.text=Xe.line=Xe.path=Xe.rect=Xe.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Ze=qe;function Je(e,t){return(t=t||document).querySelector(e)}function Qe(e){e.parentNode&&e.parentNode.removeChild(e)}function et(e,t,n,i,r){var o=ee();o.setTranslate(t,n);var a=ee();a.setRotate(i||0,0,0);var s=ee();s.setScale(r||1,r||1),ce(e,[o,a,s])}function tt(e,t,n){var i=ee();i.setTranslate(t,n),ce(e,i)}var nt=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r<Math.floor(i);r++){a=Math.floor(Math.random()*n).toString(n)+a}if(o){var s=Math.pow(n,o);a=Math.floor(Math.random()*s).toString(n)+a}var l=parseInt(a,n);return l!==1/0&&l>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}}));function it(e){if(!(this instanceof it))return new it(e);e=e||[128,36,1],this._seed=e.length?nt.rack(e[0],e[1],e[2]):e}it.prototype.next=function(e){return this._seed(e||!0)},it.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},it.prototype.claim=function(e,t){this._seed.set(e,t||!0)},it.prototype.assigned=function(e){return this._seed.get(e)||!1},it.prototype.unclaim=function(e){delete this._seed.hats[e]},it.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var rt=new it,ot=.95;function at(e,t,n,i,r,o,s){A.call(this,t,s);var l=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor;function u(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:ve,strokeWidth:2,fill:"white"})}function m(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:ve,strokeWidth:2})}function f(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o,parentGfx:a=r._svg}=t,s=X("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});j(s,o);var l=Je(":scope > defs",a);l||j(a,l=X("defs")),j(l,s)}function d(e,t,n,i){var r=rt.nextPrefixed("marker-");return function(e,t,n,i,r){if("sequenceflow-end"===n){f(t,{element:X("path",{d:"M 1 5 L 11 10 L 1 15 Z",...u({fill:r,stroke:r,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("messageflow-start"===n){f(t,{element:X("circle",{cx:6,cy:6,r:3.5,...u({fill:i,stroke:r,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:e})}if("messageflow-end"===n){f(t,{element:X("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:i,stroke:r,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:e})}if("association-start"===n){f(t,{element:X("path",{d:"M 11 5 L 1 10 L 11 15",...m({fill:"none",stroke:r,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:e})}if("association-end"===n){f(t,{element:X("path",{d:"M 1 5 L 11 10 L 1 15",...m({fill:"none",stroke:r,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("conditional-flow-marker"===n){f(t,{element:X("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:i,stroke:r})}),ref:{x:-1,y:10},scale:.5,parentGfx:e})}if("conditional-default-flow-marker"===n){f(t,{element:X("path",{d:"M 6 4 L 10 16",...u({stroke:r,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:e})}}(e,r,t,n,i),"url(#"+r+")"}function y(e,t,n,i,r={}){a(i)&&(r=i,i=0),i=i||0,r=u(r);var o=X("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return j(e,o),o}function g(e,t,n,i,r,o){a(r)&&(o=r,r=0),r=r||0,o=u(o);var s=X("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return j(e,s),s}function v(e,t,n,i){var r=ye(t,n=m(n),i);return j(e,r),r}function x(e,t,n){return v(e,t,n,5)}function b(e,t,n){n=m(n);var i=X("path",{...n,d:t});return j(e,i),i}function w(e,t,n,i){return b(t,n,E({"data-marker":e},i))}function _(e){return ue[e]}function R(e){return function(t,n,i){return _(e)(t,n,i)}}var T=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:r?we(t,l,n.fill):Ee(t,p,n.stroke),strokeWidth:1})},O=function(e,t,n={}){var r=y(e,t.width,t.height,.2*t.height,{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:2});b(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{stroke:Ee(t,p,n.stroke),strokeWidth:2});for(var o=0;o<12;o++){var a=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),s=t.width/2,c=t.height/2;b(e,a,{strokeWidth:1,stroke:Ee(t,p,n.stroke),transform:"rotate("+30*o+","+c+","+s+")"})}return r},N=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},D=function(e,t,n={}){return b(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},B=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},L=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},F=function(e,t,n={},r){var o=b(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?Ee(t,p,n.stroke):"none",stroke:Ee(t,p,n.stroke),strokeWidth:1});return function(e,t){var n=ee();n.setRotate(t,0,0),ce(e,n)}(o,45),o},V=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},W=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},$=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{fill:r?Ee(t,p,n.stroke):we(t,l,n.fill),strokeWidth:1})},H=function(e,t,n={}){return b(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1})},U=function(e,t,n={}){return y(e,t.width,t.height,8,{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:4})};function K(e,t,n={}){var i=k(e),r=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(i);return i.get("eventDefinitions")&&i.get("eventDefinitions").length>1?i.get("parallelMultiple")?H(t,e,n,r):$(t,e,n,r):be(i,"bpmn:MessageEventDefinition")?T(t,e,n,r):be(i,"bpmn:TimerEventDefinition")?O(t,e,n,r):be(i,"bpmn:ConditionalEventDefinition")?D(t,e,n,r):be(i,"bpmn:SignalEventDefinition")?W(t,e,n,r):be(i,"bpmn:EscalationEventDefinition")?N(t,e,n,r):be(i,"bpmn:LinkEventDefinition")?B(t,e,n,r):be(i,"bpmn:ErrorEventDefinition")?L(t,e,n,r):be(i,"bpmn:CancelEventDefinition")?F(t,e,n,r):be(i,"bpmn:CompensateEventDefinition")?V(t,e,n,r):be(i,"bpmn:TerminateEventDefinition")?U(t,e,n,r):null}var q={ParticipantMultiplicityMarker:function(e,t,n={}){var r=Se(t,n),o=Re(t,n);w("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2-6)/r,my:(o-15)/o}}),{strokeWidth:2,fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},SubProcessMarker:function(e,t,n={}){tt(g(e,14,14,0,{strokeWidth:1,fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)}),t.width/2-7.5,t.height-20),w("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:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},ParallelMarker:function(e,t,n){var r=Se(t,n),o=Re(t,n);w("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.parallel)/r,my:(o-20)/o}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},SequentialMarker:function(e,t,n){w("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:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},CompensationMarker:function(e,t,n){w("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:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})},LoopMarker:function(e,t,n){var r=Se(t,n),o=Re(t,n);w("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.loop)/r,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:Ee(t,p,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=Se(t,n),o=Re(t,n);w("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.adhoc)/r,my:(o-15)/o}}),{strokeWidth:1,fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke)})}};function Y(e,t,n,i){q[e](t,n,i)}function Z(e,t,n,i={}){i={fill:i.fill,stroke:i.stroke,width:Se(t,i),height:Re(t,i)};var r=k(t),o=n&&n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},h(n,(function(n){Y(n,e,t,i)})),r.get("isForCompensation")&&Y("CompensationMarker",e,t,i),S(r,"bpmn:AdHocSubProcess")&&Y("AdhocMarker",e,t,i);var a=r.get("loopCharacteristics"),s=a&&a.get("isSequential");a&&(void 0===s&&Y("LoopMarker",e,t,i),!1===s&&Y("ParallelMarker",e,t,i),!0===s&&Y("SequentialMarker",e,t,i))}function J(e,t,n={}){n=E({size:{width:100}},n);var i=o.createText(t||"",n);return G(i).add("djs-label"),j(e,i),i}function Q(e,t,n,i={}){var r=k(t),o=Ae({x:t.x,y:t.y,width:t.width,height:t.height},i);return J(e,r.name,{align:n,box:o,padding:7,style:{fill:_e(t,c,p,i.stroke)}})}function te(e,t,n,i={}){var r=P(n),o=J(e,t,{box:{height:30,width:r?Re(n,i):Se(n,i)},align:"center-middle",style:{fill:_e(n,c,p,i.stroke)}});r&&et(o,0,-(-1*Re(n,i)),270)}function ne(e,t,n={}){var{width:i,height:r}=Ae(t,n);return g(e,i,r,10,{...n,fill:we(t,l,n.fill),fillOpacity:ot,stroke:Ee(t,p,n.stroke)})}function ie(e,t,n={}){var i=k(t),r=we(t,l,n.fill),o=Ee(t,p,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=d(e,"association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=d(e,"association-start",r,o)),n=st(n,["markerStart","markerEnd"]),x(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function re(e,t,n={}){var r=we(t,l,n.fill),o=Ee(t,p,n.stroke),a=b(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:ot,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(k(t))&&b(e,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:r,stroke:o});return a}function oe(e,t,n={}){return y(e,t.width,t.height,{fillOpacity:ot,...n,fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)})}function ae(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,a=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");i=u(i);var s=X("polygon",{...i,points:a});return j(e,s),s}(e,t.width,t.height,{fill:we(t,l,n.fill),fillOpacity:ot,stroke:Ee(t,p,n.stroke)})}function se(e,t,n={}){var i=g(e,Se(t,n),Re(t,n),0,{fill:we(t,l,n.fill),fillOpacity:n.fillOpacity||ot,stroke:Ee(t,p,n.stroke),strokeWidth:1.5}),r=k(t);S(r,"bpmn:Lane")&&te(e,r.get("name"),t,n);return i}function le(e,t,n={}){var i=ne(e,t,n);(function(e){return e&&!!k(e).triggeredByEvent})(t)&&z(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var r=M(t);return Q(e,t,r?"center-top":"center-middle",n),Z(e,t,r?void 0:["SubProcessMarker"],n),i}function pe(e,t,n={}){var i=ne(e,t,n);return Q(e,t,"center-middle",n),Z(e,t,void 0,n),i}var ue=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return le(e,t,n=M(t)?st(n,["fill","stroke","width","height"]):st(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return ie(e,t,n=st(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=st(n,["fill","stroke"]);var r=k(t).get("cancelActivity");n={strokeWidth:1.5,fill:we(t,l,n.fill),fillOpacity:1,stroke:Ee(t,p,n.stroke)},r||(n.strokeDasharray="6");var o=oe(e,t,n);return y(e,t.width,t.height,3,{...n,fill:"none"}),i&&K(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=pe(e,t,n=st(n,["fill","stroke"]));return z(b(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),z(b(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=st(n,["fill","stroke"]),le(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=ae(e,t,n=st(n,["fill","stroke"]));return b(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=st(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=re(e,t,n);return b(e,r,{fill:"none",stroke:Ee(t,p,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=st(n,["fill","stroke"]),ie(e,t,{...n,markerEnd:d(e,"association-end",we(t,l,n.fill),Ee(t,p,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return re(e,t,n=st(n,["fill","stroke"]))},"bpmn:DataObjectReference":R("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=st(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=re(e,t,n);return b(e,r,{strokeWidth:1,fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=st(n,["fill","stroke"]),ie(e,t,{...n,markerEnd:d(e,"association-end",we(t,l,n.fill),Ee(t,p,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=st(n,["fill","stroke"]),b(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:we(t,l,n.fill),fillOpacity:ot,stroke:Ee(t,p,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=st(n,["fill","stroke"]);var r=oe(e,t,{...n,strokeWidth:4});return i&&K(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=st(n,["fill","stroke"]);var r=k(t),o=ae(e,t,n);y(e,t.width,t.height,.2*t.height,{fill:we(t,"none",n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1});var a=r.get("eventGatewayType"),s=!!r.get("instantiate");if("Parallel"===a){var l=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});b(e,l,{fill:"none",stroke:Ee(t,p,n.stroke),strokeWidth:1})}else"Exclusive"===a&&(s||y(e,t.width,t.height,.26*t.height,{fill:"none",stroke:Ee(t,p,n.stroke),strokeWidth:1}),function(){var r=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});b(e,r,{fill:"none",stroke:Ee(t,p,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=ae(e,t,n=st(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return C(t).get("isMarkerVisible")&&b(e,o,{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return ae(e,t,n=st(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=st(n,["fill","stroke","width","height"]),g(e,t.width,t.height,10,{stroke:Ee(t,p,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:Se(t,n),height:Re(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=ae(e,t,n=st(n,["fill","stroke"]));return y(e,t.width,t.height,.24*t.height,{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=st(n,["fill","stroke"]);var r=oe(e,t,{...n,strokeWidth:1.5});return y(e,t.width,t.height,3,{fill:"none",stroke:Ee(t,p,n.stroke),strokeWidth:1.5}),i&&K(t,e,n),r},"bpmn:IntermediateCatchEvent":R("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":R("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=st(n,["fill","stroke","width","height"]),se(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=pe(e,t,n=st(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=st(n,["fill","stroke"]);var r=k(t),o=C(t),a=we(t,l,n.fill),s=Ee(t,p,n.stroke),c=x(e,t.waypoints,{markerEnd:d(e,"messageflow-end",a,s),markerStart:d(e,"messageflow-start",a,s),stroke:s,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=c.getPointAtLength(c.getTotalLength()/2),m=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),h={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(h.fill=a,h.stroke=s):(h.fill=s,h.stroke=a);var f=b(e,m,h),y=J(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:s}}),g=f.getBBox(),v=y.getBBox();et(y,u.x-v.width/2,u.y+g.height/2+10,0)}return c},"bpmn:ParallelGateway":function(e,t,n={}){var r=ae(e,t,n=st(n,["fill","stroke"]));return b(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=se(e,t,n=st(n,["fill","stroke","width","height"])),r=M(t),o=P(t),a=k(t),s=a.get("name");if(r){v(e,o?[{x:30,y:0},{x:30,y:Re(t,n)}]:[{x:0,y:30},{x:Se(t,n),y:30}],{stroke:Ee(t,p,n.stroke),strokeWidth:1.5}),te(e,s,t,n)}else{var l=Ae(t,n);o||(l.height=Se(t,n),l.width=Re(t,n));var u=J(e,s,{box:l,align:"center-middle",style:{fill:_e(t,c,p,n.stroke)}});if(!o)et(u,0,-(-1*Re(t,n)),270)}return a.get("participantMultiplicity")&&Y("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=st(n,["fill","stroke"]);var r,o=k(t),a=pe(e,t,n);return o.get("instantiate")?(y(e,28,28,4.4,{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),b(e,r,{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){var r=pe(e,t,n=st(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=pe(e,t,n=st(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:Ee(t,p,n.stroke),stroke:we(t,l,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=st(n,["fill","stroke"]);var i=we(t,l,n.fill),r=Ee(t,p,n.stroke),o=x(e,t.waypoints,{markerEnd:d(e,"sequenceflow-end",i,r),stroke:r}),a=k(t),{source:s}=t;if(s){var c=k(s);a.get("conditionExpression")&&S(c,"bpmn:Activity")&&z(o,{markerStart:d(e,"conditional-flow-marker",i,r)}),c.get("default")&&(S(c,"bpmn:Gateway")||S(c,"bpmn:Activity"))&&c.get("default")===a&&z(o,{markerStart:d(e,"conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=pe(e,t,n=st(n,["fill","stroke"]));return y(e,10,10,{fill:we(t,l,n.fill),stroke:"none",transform:"translate(6, 6)"}),b(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),y(e,10,10,{fill:we(t,l,n.fill),stroke:"none",transform:"translate(11, 10)"}),b(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=st(n,["fill","stroke"]),k(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=oe(e,t,n);return i&&K(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return le(e,t,n=M(t)?st(n,["fill","stroke","width","height"]):st(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return pe(e,t,n=st(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=st(n,["fill","stroke","width","height"]);var{width:r,height:o}=Ae(t,n),a=g(e,r,o,0,0,{fill:"none",stroke:"none"});return b(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:Ee(t,p,n.stroke)}),J(e,k(t).get("text")||"",{align:"left-top",box:Ae(t,n),padding:7,style:{fill:_e(t,c,p,n.stroke)}}),a},"bpmn:Transaction":function(e,t,i={}){i=M(t)?st(i,["fill","stroke","width","height"]):st(i,["fill","stroke"]);var r=le(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:Ee(t,p,i.stroke),strokeWidth:1.5});return M(t)||(i={}),g(e,Se(t,i),Re(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=pe(e,t,n=st(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:.5}),b(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:we(t,l,n.fill),stroke:Ee(t,p,n.stroke),strokeWidth:.5}),b(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:Ee(t,p,n.stroke),stroke:Ee(t,p,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return J(e,I(t),{box:i,fitBox:!0,style:E({},o.getExternalStyle(),{fill:_e(t,c,p,n.stroke)})})}(e,t,n)}};this._drawPath=b,this._renderer=_}function st(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}e(at,A),at.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],at.prototype.canRender=function(e){return S(e,"bpmn:BaseElement")},at.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},at.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},at.prototype.getShapePath=function(e){return S(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,ue([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):S(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return ue([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}(e,10):S(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return ue([["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 ue([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var lt=0,pt={width:150,height:50};function ct(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function ut(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=ct(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return mt(e,o,r,i);o=ft(o,i.width,t)}}function mt(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}var ht="";function ft(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<t)){"-"!==n&&n!==ht||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&a===ht&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function dt(e){this._config=E({},{size:pt,padding:lt,style:{},align:"center-top"},e||{})}dt.prototype.createText=function(e,t){return this.layoutText(e,t).element},dt.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},dt.prototype.layoutText=function(e,t){var n=E({},this._config.size,t.box),i=E({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return a(e)?E({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),s=t.fitBox||!1,l=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),p=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right,m=X("text");for(z(m,{x:0,y:0}),z(m,i),j(function(){var e=document.getElementById("helper-svg");return e||(z(e=X("svg"),{id:"helper-svg"}),De(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}(),m);p.length;)c.push(ut(p,u,m));"middle"===r.vertical&&(o.top=o.bottom=0);var d=f(c,(function(e,t,n){return e+(l||t.height)}),0)+o.top+o.bottom,y=f(c,(function(e,t,n){return t.width>e?t.width:e}),0),g=o.top;"middle"===r.vertical&&(g+=(n.height-d)/2),g-=(l||c[0].height)/4;var v=X("text");return z(v,i),h(c,(function(e){var t;switch(g+=l||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?y:u)-o.right-e.width;break;default:t=Math.max(((s?y:u)-e.width)/2+o.left,0)}var n=X("tspan");z(n,{x:t,y:g}),n.textContent=e.text,j(v,n)})),le(m),{dimensions:{width:y,height:d},element:v}};function yt(e){var t=E({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=E({},t,{fontSize:n},e&&e.externalStyle||{}),r=new dt({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30},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}}yt.$inject=["config.textRenderer"];var gt=/\{([^{}]+)\}/g,vt=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var xt={__init__:["bpmnRenderer"],bpmnRenderer:["type",at],textRenderer:["type",yt],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,s=t.containerWidth/r.width*t.xScaleFactor,l=0;l<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*a;for(var p=0;p<r.widthElements.length;p++)o["x"+p]=r.widthElements[p]*s}var c,u,m=(c=r.d,u={mx:n,my:i,e:o},String(c).replace(gt,(function(e,t){return function(e,t,n){var i=n;return t.replace(vt,(function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))})),i=(null==i||i==n?e:i)+""}(e,t,u)})));return m}}]};var bt={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};function wt(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Et(e){return t={x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2},{x:Math.round(t.x),y:Math.round(t.y)};var t}function _t(e){for(var t=e.waypoints,n=t.reduce((function(e,n,i){var r,o,a=t[i-1];if(a){var s=e[e.length-1],l=s&&s.endLength||0,p=(r=a,o=n,Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)));e.push({start:a,end:n,startLength:l,endLength:l+p,length:p})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0)/2,r=0,o=n[r];o.endLength<i;)o=n[++r];var a=(i-o.startLength)/o.length;return{x:o.start.x+(o.end.x-o.start.x)*a,y:o.start.y+(o.end.y-o.start.y)*a}}function At(e){return a(t=e)&&c(t,"waypoints")?_t(e):Et(e);var t}function St(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function Rt(e,t,n){return E({id:e.id,type:e.$type,businessObject:e,di:t},n)}function kt(e,t,n){var i=e.waypoint;return!i||i.length<2?[At(t),At(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function Ct(e,t,n){return new Error(`element ${St(t)} referenced by ${St(e)}#${n} not yet drawn`)}function Mt(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}Mt.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],Mt.prototype.add=function(e,t,n){var i,r,o,a,s,l,p;if(S(t,"bpmndi:BPMNPlane")){var c=S(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Rt(e,t,c)),this._canvas.addRootElement(i)}else if(S(t,"bpmndi:BPMNShape")){var u=!M(e,t),m=function(e){return S(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var h=t.bounds;i=this._elementFactory.createShape(Rt(e,t,{collapsed:u,hidden:r,x:Math.round(h.x),y:Math.round(h.y),width:Math.round(h.width),height:Math.round(h.height),isFrame:m})),S(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),S(e,"bpmn:Lane")&&(o=0),S(e,"bpmn:DataStoreReference")&&(a=n,s=At(h),l=s.x,p=s.y,l>=a.x&&l<=a.x+a.width&&p>=a.y&&p<=a.y+a.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!S(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${St(t)} for element ${St(e)}`);var f=this._getSource(e),d=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Rt(e,t,{hidden:r,source:f,target:d,waypoints:kt(t,f,d)})),S(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return function(e){return S(e,"bpmn:Event")||S(e,"bpmn:Gateway")||S(e,"bpmn:DataStoreReference")||S(e,"bpmn:DataObjectReference")||S(e,"bpmn:DataInput")||S(e,"bpmn:DataOutput")||S(e,"bpmn:SequenceFlow")||S(e,"bpmn:MessageFlow")||S(e,"bpmn:Group")}(e)&&I(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Mt.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${St(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw Ct(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),-1===r.indexOf(t)&&r.push(t)},Mt.prototype.addLabel=function(e,t,n){var i,r,o;return i=B(t,n),(r=I(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Rt(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!I(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)},Mt.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?Ct(e,i,t+"Ref"):new Error(`${St(e)}#${t} Ref not specified`)},Mt.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Mt.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Mt.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Pt={__depends__:[xt,{__depends__:[bt],bpmnImporter:["type",Mt]}]};function Tt(e,t){var n,i,r,a;return t=!!t,o(e)||(e=[e]),h(e,(function(e){var o=e;e.waypoints&&!t&&(o=Tt(e.waypoints,!0));var s=o.x,l=o.y,p=o.height||0,c=o.width||0;(s<n||void 0===n)&&(n=s),(l<i||void 0===i)&&(i=l),(s+c>r||void 0===r)&&(r=s+c),(l+p>a||void 0===a)&&(a=l+p)})),{x:n,y:i,height:a-i,width:r-n}}function Ot(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Nt(e){return!(!e||!e.isFrame)}function Dt(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Dt.prototype.next=function(){return this._prefix+ ++this._counter};var Bt=new Dt("ov");function It(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Bt,this._overlayDefaults=E({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),De(o=Ze('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function Lt(e,t,n){De(e,{left:t+"px",top:n+"px"})}function jt(e,t){e.style.display=!1===t?"none":""}function Ft(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}It.$inject=["config.overlays","eventBus","canvas","elementRegistry"],It.prototype.get=function(e){if(p(e)&&(e={id:e}),p(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?m(t.overlays,g({type:e.type})):t.overlays.slice():[]}return e.type?m(this._overlays,g({type:e.type})):e.id?this._overlays[e.id]:null},It.prototype.add=function(e,t,n){if(a(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=E({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},It.prototype.remove=function(e){var t=this.get(e)||[];o(t)||(t=[t]);var n=this;h(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Qe(e.html),Qe(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)}}))},It.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},It.prototype.show=function(){jt(this._overlayRoot)},It.prototype.hide=function(){jt(this._overlayRoot,!1)},It.prototype.clear=function(){this._overlays={},this._overlayContainers=[],je(this._overlayRoot)},It.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Tt(t);i=o.x,r=o.y}Lt(n,i,r),function(e,t,n){2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):e.setAttribute(t,n)}(e.html,"data-container-id",t.id)},It.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?Tt(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?Tt(o).height:o.height,s=-1*i.bottom+n);Lt(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},It.prototype._createOverlayContainer=function(e){var t=Ze('<div class="djs-overlays" />');De(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},It.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Ft(this._overlayRoot,n)},It.prototype._getOverlayContainer=function(e,t){var n=u(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},It.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)),p(o)&&(o=Ze(o)),n=this._getOverlayContainer(r),De(t=Ze('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&Ie(t).add("djs-overlay-"+e.type),jt(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())},It.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),o=n&&n.minZoom,a=n&&n.maxZoom,s=e.htmlContainer,l=!0;(i!==this._canvas.getRootElement()||n&&(r(o)&&o>t.scale||r(a)&&a<t.scale))&&(l=!1),jt(s,l),this._updateOverlayScale(e,t)},It.prototype._updateOverlayScale=function(e,t){var n,i,o,a=e.scale,s=e.htmlContainer,l="";!0!==a&&(!1===a?(n=1,i=1):(n=a.min,i=a.max),r(n)&&t.scale<n&&(o=(1/t.scale||1)*n),r(i)&&t.scale>i&&(o=(1/t.scale||1)*i)),r(o)&&(l="scale("+o+","+o+")"),Ft(s,l)},It.prototype._updateOverlaysVisibilty=function(e){var t=this;h(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},It.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;h(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Qe(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&&(h(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&&Ie(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};var Vt={__init__:["overlays"],overlays:["type",It]};function Wt(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(Ot(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)}))}Wt.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var zt={__init__:["changeSupport"],changeSupport:["type",Wt]};function $t(e){this._eventBus=e}function Gt(e){return function(t,n,i,r,o){(l(t)||s(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function Ht(e,t){t.invoke($t,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)}))}$t.$inject=["eventBus"],$t.prototype.on=function(e,t,n,i,r,p){if((l(t)||s(t))&&(p=r,r=i,i=n,n=t,t=null),l(n)&&(p=r,r=i,i=n,n=1e3),a(r)&&(p=r,r=!1),!l(i))throw new Error("handlerFn must be a function");o(e)||(e=[e]);var c=this._eventBus;h(e,(function(e){var o=["commandStack",e,t].filter((function(e){return e})).join(".");c.on(o,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,p):i,p)}))},$t.prototype.canExecute=Gt("canExecute"),$t.prototype.preExecute=Gt("preExecute"),$t.prototype.preExecuted=Gt("preExecuted"),$t.prototype.execute=Gt("execute"),$t.prototype.executed=Gt("executed"),$t.prototype.postExecute=Gt("postExecute"),$t.prototype.postExecuted=Gt("postExecuted"),$t.prototype.revert=Gt("revert"),$t.prototype.reverted=Gt("reverted"),e(Ht,$t),Ht.$inject=["canvas","injector"];var Ut={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Ht]},Kt={"&":"&","<":"<",">":">",'"':""","'":"'"};var qt="_plane";function Yt(e){var t=e.id;return S(e,"bpmn:SubProcess")?function(e){return e+qt}(t):t}function Xt(e,t,n){var i=Ze('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=Ie(r);r.appendChild(i);var a=[];function s(e){e&&(a=function(e){for(var t=k(e),n=[],i=t;i;i=i.$parent)(S(i,"bpmn:SubProcess")||S(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=a.flatMap((function(e){var i=n.findRoot(Yt(e))||n.findRoot(e.id);if(!i&&S(e,"bpmn:Process")){var r=t.find((function(t){var n=k(t);return n&&n.get("processRef")===e}));i=r&&n.findRoot(r.id)}if(!i)return[];var o,a=(o=""+(o=e.name||e.id))&&o.replace(/[&<>"']/g,(function(e){return Kt[e]})),s=Ze('<li><span class="bjs-crumb"><a title="'+a+'">'+a+"</a></span></li>");return s.addEventListener("click",(function(){n.setRootElement(i)})),s}));i.innerHTML="";var s=r.length>1;o.toggle("bjs-breadcrumbs-shown",s),r.forEach((function(e){i.appendChild(e)}))}e.on("element.changed",(function(e){var t=k(e.element);u(a,(function(e){return e===t}))&&s()})),e.on("root.set",(function(e){s(e.element)}))}function Zt(e,t){var n=null,i=new Jt;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),a=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,S(r,"bpmn:SubProcess")||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 Jt(){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)}}Xt.$inject=["eventBus","elementRegistry","canvas"],Zt.$inject=["eventBus","canvas"];var Qt=180,en=160;function tn(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 nn(e){return S(e,"bpmndi:BPMNDiagram")?e:nn(e.$parent)}tn.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)})),e.diagrams.filter((e=>e.plane)).flatMap((e=>t._createNewDiagrams(e.plane))).forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},tn.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;S(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!S(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(R(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},tn.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=wt(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),function(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}(t)}(e),i=n.x-Qt,r=n.y-en;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-i,e.y=e.y-r})):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)}))},tn.prototype._moveToDiPlane=function(e,t){var n=nn(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},tn.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},tn.$inject=["eventBus","moddle"];var rn=250;function on(e,t,n,i){$t.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",rn,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",rn,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],rn,(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"],rn,(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)}))}))}e(on,$t),on.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},on.prototype._canDrillDown=function(e){var t=this._canvas;return S(e,"bpmn:SubProcess")&&t.findRoot(Yt(e))},on.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=k(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;Ie(i.html).toggle("bjs-drilldown-empty",!r)}},on.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=Ze('<button class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(Yt(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},on.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},on.$inject=["canvas","eventBus","elementRegistry","overlays"];var an={__depends__:[Vt,zt,Ut],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Xt],drilldownCentering:["type",Zt],drilldownOverlayBehavior:["type",on],subprocessCompatibility:["type",tn]};function sn(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(e){var t=X("rect");return z(t,E({x:0,y:0,rx:4,width:100,height:100},n)),t}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=Je(".djs-outline",n);o||j(n,o=i.getOutline(t)||r()),i.updateShapeOutline(o,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,o=Je(".djs-outline",n);o||j(n,o=r()),i.updateConnectionOutline(o,t)}))}sn.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&h(i,(function(i){n=n||i.updateOutline(t,e)})),n||z(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},sn.prototype.updateConnectionOutline=function(e,t){var n=Tt(t);z(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},sn.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,(function(e){e.providers.push(t)}))},sn.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},sn.prototype.getOutline=function(e){var t;return h(this._getProviders(),(function(n){l(n.getOutline)&&(t=t||n.getOutline(e))})),t},sn.$inject=["eventBus","styles","elementRegistry"];var ln={__init__:["outline"],outline:["type",sn]};const pn={width:36,height:50},cn={width:50,height:50};function un(e,t,n){return X("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}function mn(e,t){this._styles=t,e.registerProvider(this)}function hn(e,t){var n;return"bpmn:DataObjectReference"===t?n=pn:"bpmn:DataStoreReference"===t&&(n=cn),e.width===n.width&&e.height===n.height}mn.$inject=["outline","styles"],mn.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!T(e))return S(e,"bpmn:Gateway")?(E((n=X("rect")).style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),z(n,E({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):R(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?z(n=X("rect"),E({x:-5,y:-5,rx:14,width:e.width+10,height:e.height+10},t)):S(e,"bpmn:EndEvent")?z(n=X("circle"),E({cx:e.width/2,cy:e.height/2,r:e.width/2+5+1},t)):S(e,"bpmn:Event")?z(n=X("circle"),E({cx:e.width/2,cy:e.height/2,r:e.width/2+5},t)):S(e,"bpmn:DataObjectReference")&&hn(e,"bpmn:DataObjectReference")?n=un("M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",{x:-6,y:-6},t):S(e,"bpmn:DataStoreReference")&&hn(e,"bpmn:DataStoreReference")&&(n=un("M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",{x:-6,y:-6},t)),n},mn.prototype.updateOutline=function(e,t){if(!T(e))return R(e,["bpmn:SubProcess","bpmn:Group"])?(z(t,{width:e.width+10,height:e.height+10}),!0):!!R(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};var fn={__depends__:[ln],__init__:["outlineProvider"],outlineProvider:["type",mn]};function dn(e){return e.originalEvent||e.srcEvent}function yn(e,t){return(dn(e)||e).button===t}function gn(e){return yn(e,0)}function vn(e){return!0}function xn(e){return gn(e)||function(e){return yn(e,1)}(e)}function bn(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){var n=l[e]||gn;return!n(t)})(n,i)||(r?a=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(a=o,r=t.get(a)),a&&r&&!1===e.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function a(e){return o[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":vn,"element.mousedown":xn,"element.mouseup":xn,"element.click":xn,"element.dblclick":xn};var p="svg, .djs-element";function c(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(l[n]=i),a.$delegate=Ke.bind(e,p,t,a)}function u(e,t,n){var i=a(n);i&&Ke.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,h(s,(function(e,n){u(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,h(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 m=y("djs-hit djs-hit-stroke"),f=y("djs-hit djs-hit-click-stroke"),d={all:y("djs-hit djs-hit-all"),"click-stroke":f,stroke:m,"no-move":y("djs-hit djs-hit-no-move")};function y(e,t){return t=E({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function g(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return z(e,n),e}function v(e,t){j(e,t)}this.removeHits=function(e){var t;h((t=".djs-hit",(e||document).querySelectorAll(t)),le)},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=ye(t);return g(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=E({x:0,y:0},n);var i=X("rect");return g(i,t),z(i,n),v(e,i),i},this.updateDefaultHit=function(e,t){var n=Je(".djs-hit",t);if(n)return e.waypoints?ge(n,e.waypoints):z(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=u}bn.$inject=["eventBus","elementRegistry","styles"];var wn={__init__:["interactionEvents"],interactionEvents:["type",bn]};function En(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){var t=e.element;n.deselect(t)})),e.on(["diagram.clear","root.set"],(function(e){n.select(null)}))}En.$inject=["eventBus","canvas"],En.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},En.prototype.get=function(){return this._selectedElements},En.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},En.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();o(e)||(e=e?[e]:[]);var r=this._canvas,a=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return a===t})),t?h(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var _n="hover",An="selected";function Sn(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,_n)})),t.on("element.out",(function(e){o(e.element,_n)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;h(t,(function(e){-1===n.indexOf(e)&&o(e,An)})),h(n,(function(e){-1===t.indexOf(e)&&r(e,An)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function Rn(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,a=(n.hints||{}).autoSelect;if(i){if(!1===a)return;o(a)?t.select(a):t.select(r.filter(kn))}})),e.on("connect.end",500,(function(e){var n=e.context.connection;n&&t.select(n)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);u(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(gn(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=function(e){var t=dn(e)||e;return gn(e)&&t.shiftKey}(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function kn(e){return!e.hidden}Sn.$inject=["canvas","eventBus","selection"],Sn.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");U(t);var n=e.length>1;if(G(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}}(Tt(e)),r=X("rect");z(r,E({rx:3},i)),G(r).add("djs-selection-outline"),j(t,r)}},Rn.$inject=["eventBus","selection","canvas","elementRegistry"];var Cn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[wn,ln],selection:["type",En],selectionVisuals:["type",Sn],selectionBehavior:["type",Rn]};const Mn=/^class[ {]/;function Pn(e){return Array.isArray(e)}function Tn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function On(...e){1===e.length&&Pn(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const Nn=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Dn=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Bn=/\/\*([^*]*)\*\//m;function In(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return Mn.test(e.toString())}(e)?Nn:Dn);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(Bn);return(t&&t[1]||e).trim()}))||[]}function Ln(e,t){const n=t||{get:function(e,t){if(i.push(e),!1===t)return null;throw s(`No provider for "${e}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(e){const t=i.join(" -> ");return i.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function l(e,t){if(!r[e]&&e.includes(".")){const t=e.split(".");let n=l(t.shift());for(;t.length;)n=n[t.shift()];return n}if(Tn(o,e))return o[e];if(Tn(r,e)){if(-1!==i.indexOf(e))throw i.push(e),s("Cannot resolve circular dependency!");return i.push(e),o[e]=r[e][0](r[e][1]),i.pop(),o[e]}return n.get(e,t)}function p(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Pn(e))throw s(`Cannot invoke "${e}". Expected a function!`);e=On(e.slice())}return{fn:e,dependencies:(e.$inject||In(e)).map((e=>Tn(t,e)?t[e]:l(e)))}}function c(e){const{fn:t,dependencies:n}=p(e);return new(Function.prototype.bind.call(t,null,...n))}function u(e,t,n){const{fn:i,dependencies:r}=p(e,n);return i.apply(t,r)}function m(e){return On((t=>e.get(t)))}function h(e,t){if(t&&t.length){const n=Object.create(null),i=Object.create(null),o=[],a=[],s=[];let l,p,c,u;for(let e in r)l=r[e],-1!==t.indexOf(e)&&("private"===l[2]?(p=o.indexOf(l[3]),-1===p?(c=l[3].createChild([],t),u=m(c),o.push(l[3]),a.push(c),s.push(u),n[e]=[u,e,"private",c]):n[e]=[s[p],e,"private",a[p]]):n[e]=[l[2],l[1]],i[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]],i[t]=!0)}));t.forEach((e=>{if(!i[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new Ln(e,a)}const f={factory:u,type:c,value:function(e){return e}};function d(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function y(e){const t=e.__exports__;if(t){const n=e.__modules__,i=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=h((n||[]).concat(i)),a=On((function(e){return o.get(e)}));t.forEach((function(e){r[e]=[a,e,"private",o]}));const s=(e.__init__||[]).slice();return s.unshift((function(){o.init()})),d(e=Object.assign({},e,{__init__:s}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;const n=e[t];if("private"===n[2])return void(r[t]=n);const i=n[0],o=n[1];r[t]=[f[i],jn(i,o),i]})),d(e,a)}function g(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(g,e)).indexOf(t)?e:e.concat(t)}this.get=l,this.invoke=u,this.instantiate=c,this.createChild=h,this.init=function(e){const t=e.reduce(g,[]).map(y);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function jn(e,t){return"value"!==e&&Pn(t)&&(t=On(t.slice())),t}function Fn(e,t){A.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}e(Fn,A),Fn.prototype.canRender=function(){return!0},Fn.prototype.drawShape=function(e,t,n){var i=X("rect");return z(i,{x:0,y:0,width:t.width||0,height:t.height||0}),Nt(t)?z(i,E({},this.FRAME_STYLE,n||{})):z(i,E({},this.SHAPE_STYLE,n||{})),j(e,i),i},Fn.prototype.drawConnection=function(e,t,n){var i=ye(t.waypoints,E({},this.CONNECTION_STYLE,n||{}));return j(e,i),i},Fn.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return ue([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},Fn.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 ue(r)},Fn.$inject=["eventBus","styles"];var Vn={__init__:["defaultRenderer"],defaultRenderer:["type",Fn],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 E(this.style(t,n),{class:e})},this.style=function(t,n){o(t)||n||(n=t,t=[]);var i=f(t,(function(t,n){return E(t,e[n]||{})}),{});return n?E(i,n):i},this.computeStyle=function(e,n,i){return o(n)||(i=n,n=[]),t.style(n||[],E({},i,e||{}))}}]};function Wn(e,t){return Math.round(e*t)/t}function zn(e){return s(e)?e+"px":e}function $n(e,t,n){const i=X("g");G(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const Gn={shape:["x","y","width","height"],connection:["waypoints"]};function Hn(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 Un(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Hn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Hn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=E({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),De(n,{position:"relative",overflow:"hidden",width:zn(e.width),height:zn(e.height)}),t.appendChild(n),n}(e),i=this._svg=X("svg");z(i,{width:"100%",height:"100%"}),j(n,i);const r=this._viewport=$n(i,"viewport");e.deferUpdate&&(this._viewboxChanged=function(e,t){let n,i,r,o;function a(n){let a=Date.now(),p=n?0:o+t-a;if(p>0)return s(p);e.apply(r,i),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function p(...e){o=Date.now(),i=e,r=this,n||s(t)}return p.flush=function(){n&&a(!0),l()},p.cancel=l,p}(w(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)},Hn.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},Hn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=Ot(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Hn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Hn.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},Hn.prototype._getChildIndex=function(e){return f(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Hn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:$n(this._viewport,"layer-"+e,n),index:t,visible:!0}},Hn.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},Hn.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?(le(n),t.visible=!1,n):n},Hn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],le(t.group))},Hn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Hn.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},Hn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Hn.prototype._findPlaneForRoot=function(e){return u(this._planes,(function(t){return t.rootElement===e}))},Hn.prototype.getContainer=function(){return this._container},Hn.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(h([i.gfx,i.secondaryGfx],(function(e){e&&(n?G(e).add(t):G(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Hn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Hn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Hn.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));return G(this.getGraphics(e)).has(t)},Hn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Hn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Hn.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},Hn.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},Hn.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},Hn.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)},Hn.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})},Hn.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})},Hn.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=Gn[e],i=d(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Hn.prototype._setParent=function(e,t,n){!function(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}(t.children,e,n),e.parent=t},Hn.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},Hn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Hn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Hn.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Hn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Hn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Hn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Hn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Hn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Hn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,a,s,l,p;return e?(this._changeViewbox((function(){s=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);ce(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=ce(t),r=a?a.matrix:function(e,t,n,i,r,o){var a=J().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Q(a,e);case 6:return Q(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),s=Wn(r.a,1e3),l=Wn(-r.e||0,1e3),p=Wn(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/s:0,y:p?p/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},Hn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=E({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Un(t,n)})),{x:n.e,y:n.f}},Hn.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;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=Tt(e),o=wt(r),a=this.viewbox(),s=this.zoom();let l,p;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const c=wt(a);if(r.width<a.width&&r.height<a.height){const e=Math.max(0,o.right-c.right),t=Math.min(0,o.left-c.left),n=Math.max(0,o.bottom-c.bottom),i=Math.min(0,o.top-c.top);l=e||t,p=n||i}else l=r.x-a.x,p=r.y-a.y;this.scroll({dx:-l*s,dy:-p*s})},Hn.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,i;return this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),Wn(i.a,1e3)},Hn.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},Hn.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,l,p,c;l=i.getCTM();const u=l.a;return t?(a=E(o,t),s=a.matrixTransform(l.inverse()),p=r.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),c=l.multiply(p)):c=r.scale(e),Un(this._viewport,c),c},Hn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Hn.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}},Hn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Kn="data-element-id";function qn(e){this._elements={},this._eventBus=e}function Yn(e,t,n){var i=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach((function(i){e.set(i,t.inverse,n)}))}function Xn(e,t){if(!(this instanceof Xn))return new Xn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}qn.$inject=["eventBus"],qn.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),z(t,Kn,i),n&&z(n,Kn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},qn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(z(i.gfx,Kn,""),i.secondaryGfx&&z(i.secondaryGfx,Kn,""),delete t[n])},qn.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)},qn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&z(t,Kn,i),t},qn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&z(e,Kn);var n=this._elements[t];return n&&n.element},qn.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},qn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},qn.prototype.getAll=function(){return this.filter((function(e){return e}))},qn.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)}))},qn.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},qn.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")},Xn.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Yn(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},Xn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||Yn(this,t,e),n},Xn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Xn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Xn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Zn=new Xn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Jn=new Xn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Qn=new Xn({name:"attachers",collection:!0},{name:"host"}),ei=new Xn({name:"outgoing",collection:!0},{name:"source"}),ti=new Xn({name:"incoming",collection:!0},{name:"target"});function ni(){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)}}),Zn.bind(this,"parent"),Jn.bind(this,"labels"),ei.bind(this,"outgoing"),ti.bind(this,"incoming")}function ii(){ni.call(this),Zn.bind(this,"children"),Qn.bind(this,"host"),Qn.bind(this,"attachers")}function ri(){ni.call(this),Zn.bind(this,"children")}function oi(){ii.call(this),Jn.bind(this,"labelTarget")}function ai(){ni.call(this),ei.bind(this,"source"),ti.bind(this,"target")}e(ii,ni),e(ri,ii),e(oi,ii),e(ai,ni);var si={connection:ai,shape:ii,label:oi,root:ri};function li(){this._uid=12}li.prototype.createRoot=function(e){return this.create("root",e)},li.prototype.createLabel=function(e){return this.create("label",e)},li.prototype.createShape=function(e){return this.create("shape",e)},li.prototype.createConnection=function(e){return this.create("connection",e)},li.prototype.create=function(e,t){return(t=E({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=si[e];if(!n)throw new Error("unknown type: <"+e+">");return E(new n,t)}(e,t)};var pi="__fn",ci=Array.prototype.slice;function ui(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function mi(){}function hi(e,t){this._eventBus=e,this._elementRegistry=t}function fi(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}ui.prototype.on=function(e,t,n,i){if(e=o(e)?e:[e],l(t)&&(i=n,n=t,t=1e3),!s(t))throw new Error("priority must be a number");var r=n;i&&((r=w(n,i))[pi]=n[pi]||n);var a=this;e.forEach((function(e){a._addListener(e,{priority:t,callback:r,next:null})}))},ui.prototype.once=function(e,t,n,i){var r=this;if(l(t)&&(i=n,n=t,t=1e3),!s(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[pi]=n,this.on(e,t,o)},ui.prototype.off=function(e,t){e=o(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},ui.prototype.createEvent=function(e){var t=new mi;return t.init(e),t},ui.prototype.fire=function(e,t){var n,i,r,o;if(o=ci.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 mi?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}},ui.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},ui.prototype._destroy=function(){this._listeners={}},ui.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},ui.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},ui.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},ui.prototype._getListeners=function(e){return this._listeners[e]},ui.prototype._setListeners=function(e,t){this._listeners[e]=t},ui.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[pi]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},mi.prototype.stopPropagation=function(){this.cancelBubble=!0},mi.prototype.preventDefault=function(){this.defaultPrevented=!0},mi.prototype.init=function(e){E(this,e||{})},hi.$inject=["eventBus","elementRegistry"],hi.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(G(t=X("g")).add("djs-children"),j(n.parentNode,t))):t=n,t},hi.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return je(t),t},hi.prototype._createContainer=function(e,t,n,i){var r=X("g");G(r).add("djs-group"),void 0!==n?fi(r,t,t.childNodes[n]):j(t,r);var o=X("g");G(o).add("djs-element"),G(o).add("djs-"+e),i&&G(o).add("djs-frame"),j(r,o);var a=X("g");return G(a).add("djs-visual"),j(o,a),o},hi.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,Nt(t))},hi.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=f(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{}),h(t,(function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e);h(t.slice().reverse(),(function(e){fi(i.getGraphics(e).parentNode,r)}))}}))},hi.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},hi.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},hi.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},hi.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},hi.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),tt(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?z(n,"display","none"):z(n,"display","block")}},hi.prototype.remove=function(e){le(this._elementRegistry.getGraphics(e).parentNode)};var di={__depends__:[Vn],__init__:["canvas"],canvas:["type",Hn],elementRegistry:["type",qn],elementFactory:["type",li],eventBus:["type",ui],graphicsFactory:["type",hi]};function yi(e){return function(e){var t=new Ln(e);return t.init(),t}([{config:["value",e=e||{}]},di].concat(e.modules||[]))}function gi(e,t){this._injector=t||yi(e),this.get("eventBus").fire("diagram.init")}function vi(){}function xi(e,t){this.model=e,this.properties=t}gi.prototype.get=function(e,t){return this._injector.get(e,t)},gi.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},gi.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},gi.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},vi.prototype.get=function(e){return this.$model.properties.get(this,e)},vi.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},xi.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(vi.prototype);h(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),h(e,w((function(e,t){this.set(t,e)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var bi={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},wi={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Ei(e,t){var n=wi[e];return n?n(t):t}function _i(e){return!!bi[e]}function Ai(e){return!!wi[e]}function Si(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Ri(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function ki(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,h(e,w(this.registerPackage,this))}function Ci(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Mi(e){this.model=e}function Pi(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Ti(e){return e.replace(/^:/,"")}function Oi(e,t={}){this.properties=new Mi(this),this.factory=new xi(this,this.properties),this.registry=new ki(e,this.properties),this.typeCache={},this.config=t}Ri.prototype.build=function(){return function(e,t){let n={},i=Object(e);return h(t,(function(t){t in i&&(n[t]=e[t])})),n}(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Ri.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)},Ri.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},Ri.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Si(r[0],i),a=Si(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},Ri.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},Ri.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Ri.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},Ri.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},Ri.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},Ri.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")},Ri.prototype.hasProperty=function(e){return this.propertiesByName[e]},Ri.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(h(e.properties,w((function(n){n=E({},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)},ki.prototype.getPackage=function(e){return this.packageMap[e]},ki.prototype.getPackages=function(){return this.packages},ki.prototype.registerPackage=function(e){e=E({},e);var t=this.packageMap;Ci(t,e,"prefix"),Ci(t,e,"uri"),h(e.types,w((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},ki.prototype.registerType=function(e,t){var n=Si((e=E({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:E(e.meta||{})})).name,t.prefix),i=n.name,r={};h(e.properties,w((function(e){var t=Si(e.name,n.prefix),i=t.name;_i(e.type)||(e.type=Si(e.type,t.prefix).name),E(e,{ns:t,name:i}),r[i]=e}),this)),E(e,{ns:n,name:i,propertiesByName:r}),h(e.extends,w((function(e){var t=Si(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},ki.prototype.mapTypes=function(e,t,n){var i=_i(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=Si(n,_i(n)?"":e.prefix);r.mapTypes(o,t,i)}function a(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");h(i.superClass,n?a:function(e){return o(e,!1)}),t(i,!n),h(i.traits,a)},ki.prototype.getEffectiveDescriptor=function(e){var t=Si(e),n=new Ri(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},ki.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Mi.prototype.set=function(e,t,n){if(!p(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[Ti(t)]:i?r in e?e[r]=n:Pi(e,i,n):e.$attrs[Ti(t)]=n},Mi.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Ti(t)];var i=n.name;return!e[i]&&n.isMany&&Pi(e,n,[]),e[i]},Mi.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=E({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Mi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Mi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Mi.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;"undefined"!=typeof console&&console.warn(n)}return null},Oi.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Oi.prototype.getType=function(e){var t=this.typeCache,n=p(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Oi.prototype.createAny=function(e,t,n){var o=Si(e),s={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){!function(e,t,n){let o=e;h(t,(function(e,a){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 s=t[a+1],l=o[e];r(s)&&null==l&&(l=o[e]=isNaN(+s)?{}:[]),i(s)?i(n)?delete o[e]:o[e]=n:o=l}))}(this,[e],t)}},l={name:e,isGeneric:!0,ns:{prefix:o.prefix,localName:o.localName,uri:t}};return this.properties.defineDescriptor(s,l),this.properties.defineModel(s,this),this.properties.define(s,"get",{enumerable:!1,writable:!0}),this.properties.define(s,"set",{enumerable:!1,writable:!0}),this.properties.define(s,"$parent",{enumerable:!1,writable:!0}),this.properties.define(s,"$instanceOf",{enumerable:!1,writable:!0}),h(n,(function(e,t){a(e)&&void 0!==e.value?s[e.name]=e.value:s[t]=e})),s},Oi.prototype.getPackage=function(e){return this.registry.getPackage(e)},Oi.prototype.getPackages=function(){return this.registry.getPackages()},Oi.prototype.getElementDescriptor=function(e){return e.$descriptor},Oi.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Oi.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Oi.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Ni=String.fromCharCode,Di=Object.prototype.hasOwnProperty,Bi=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Ii={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Li(e,t,n,i){return i?Di.call(Ii,i)?Ii[i]:"&"+i+";":Ni(t||parseInt(n,16))}function ji(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Bi,Li):e}Object.keys(Ii).forEach((function(e){Ii[e.toUpperCase()]=Ii[e]}));var Fi="xsi:type",Vi="non-whitespace outside of root node";function Wi(e){return new Error(e)}function zi(e){return"missing namespace for prefix <"+e+">"}function $i(e){return{get:e,enumerable:!0}}function Gi(e){var t,n={};for(t in e)n[t]=e[t];return n}function Hi(e){return e+"$uri"}function Ui(){return{line:0,column:0}}function Ki(e){throw e}function qi(e){if(!this)return new qi(e);var t,n,i,r,o,a,s,l,p,c=e&&e.proxy,u=Ki,m=Ui,h=!1,f=!1,d=null,y=!1;function g(e){e instanceof Error||(e=Wi(e)),d=e,u(e,m)}function v(e){o&&(e instanceof Error||(e=Wi(e)),o(e,m))}this.on=function(e,p){if("function"!=typeof p)throw Wi("required args <name, cb>");switch(e){case"openTag":n=p;break;case"text":t=p;break;case"closeTag":i=p;break;case"error":u=p;break;case"warn":o=p;break;case"cdata":r=p;break;case"attention":l=p;break;case"question":s=p;break;case"comment":a=p;break;default:throw Wi("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Wi("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,p=n,this},this.parse=function(e){if("string"!=typeof e)throw Wi("required args <xml=string>");return d=null,function(e){var o,u,d,x,b,w,E,_,A,S,R,k=f?[]:null,C=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[Hi(n)]=t;return i}(p):null,M=[],P=0,T=!1,O=!1,N=0,D=0,B="",I=0;function L(){if(null!==R)return R;var e,t,n,i,r,o,a,s,l,c,u,m=f&&C.xmlns,d=f&&h?[]:null,y=I,g=B,x=g.length,b={},w={};e:for(;y<x;y++)if(l=!1,!(32===(c=g.charCodeAt(y))||c<14&&c>8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(v("illegal first char attribute name"),l=!0),u=y+1;u<x;u++)if(!((c=g.charCodeAt(u))>96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){v("missing attribute value"),y=u;continue e}if(61===c)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),l=!0),34===(c=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),l=!0);else if(39===c)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u<x&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++);for(-1===u&&(v("missing closing quotes"),u=x,l=!0),l||(o=g.substring(y,u)),y=u;u+1<x&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++)y===u&&(v("illegal character after attribute end"),l=!0);if(y=u+1,!l)if(s in w)v("attribute <"+s+"> already defined");else if(w[s]=!0,f)if(h){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=ji(o),t=Hi(r),!(a=p[e])){if("xmlns"===r||t in C&&C[t]!==e)do{a="ns"+P++}while(void 0!==C[a]);else a=r;p[e]=a}C[r]!==a&&(i||(C=Gi(C),i=!0),C[r]=a,"xmlns"===r&&(C[Hi(a)]=e,m=a),C[t]=e),b[s]=o;continue}d.push(s,o)}else-1!==(c=s.indexOf(":"))?(n=C[s.substring(0,c)])?((s=m===n?s.substr(c+1):n+s.substr(c))===Fi&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=C[n]||n)+o.substring(c)):o=m+":"+o),b[s]=o):v(zi(s.substring(0,c))):b[s]=o;else b[s]=o}if(h)for(y=0,x=d.length;y<x;y++){if(s=d[y++],o=d[y],-1!==(c=s.indexOf(":"))){if(!(n=C[s.substring(0,c)])){v(zi(s.substring(0,c)));continue}(s=m===n?s.substr(c+1):n+s.substr(c))===Fi&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=C[n]||n)+o.substring(c)):o=m+":"+o)}b[s]=o}return R=b}function j(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,s=D;N>=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>N);)r+=1,a=s;return-1==N?(o=s,n=e.substring(D)):0===D?n=e.substring(D,N):(o=N-a,n=-1==D?e.substring(N):e.substring(N,D+1)),{data:n,line:r,column:o}}m=j,c&&(S=Object.create({},{name:$i((function(){return _})),originalName:$i((function(){return A})),attrs:$i(L),ns:$i((function(){return C}))}));for(;-1!==D;){if(-1===(N=60===e.charCodeAt(D)?D:e.indexOf("<",D)))return M.length?g("unexpected end of file"):0===D?g("missing start tag"):void(D<e.length&&e.substring(D).trim()&&v(Vi));if(D!==N)if(M.length){if(t&&(t(e.substring(D,N),ji,m),y))return}else if(e.substring(D,N).trim()&&(v(Vi),y))return;if(33===(b=e.charCodeAt(N+1))){if(91===(x=e.charCodeAt(N+2))&&"CDATA["===e.substr(N+3,6)){if(-1===(D=e.indexOf("]]>",N)))return g("unclosed cdata");if(r&&(r(e.substring(N+9,D),m),y))return;D+=3;continue}if(45===x&&45===e.charCodeAt(N+3)){if(-1===(D=e.indexOf("--\x3e",N)))return g("unclosed comment");if(a&&(a(e.substring(N+4,D),ji,m),y))return;D+=3;continue}}if(63!==b){for(u=N+1;;u++){if(w=e.charCodeAt(u),isNaN(w))return D=-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){D=u;break}}if(33!==b){if(R={},47===b){if(T=!1,O=!0,!M.length)return g("missing open tag");if(u=_=M.pop(),x=N+2+u.length,e.substring(N+2,x)!==u)return g("closing tag mismatch");for(;x<D;x++)if(!(32===(b=e.charCodeAt(x))||b>8&&b<14))return g("close tag")}else{if(47===e.charCodeAt(D-1)?(u=_=e.substring(N+1,D-1),T=!0,O=!0):(u=_=e.substring(N+1,D),T=!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;x<d;x++)if(!((b=u.charCodeAt(x))>96&&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||M.push(_)}if(f){if(o=C,T&&(O||k.push(o),null===R&&(h=-1!==u.indexOf("xmlns",x))&&(I=x,B=u,L(),h=!1)),A=_,-1!==(b=_.indexOf(":"))){if(!(E=C[_.substring(0,b)]))return g("missing namespace on <"+A+">");_=_.substr(b+1)}else E=C.xmlns;E&&(_=E+":"+_)}if(T&&(I=x,B=u,n&&(c?n(S,ji,O,m):n(_,L,ji,O,m),y)))return;if(O){if(i&&(i(c?S:_,ji,T,m),y))return;f&&(C=T?o:k.pop())}D+=1}else{if(l&&(l(e.substring(N,D+1),ji,m),y))return;D+=1}}else{if(-1===(D=e.indexOf("?>",N)))return g("unclosed question");if(s&&(s(e.substring(N,D+2),m),y))return;D+=2}}}(e),m=Ui,y=!1,d},this.stop=function(){y=!0}}function Yi(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Xi={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Zi="xsi:type";function Ji(e){return e.xml&&e.xml.serialize}function Qi(e){return Ji(e)===Zi}function er(e,t){return Yi(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function tr(e){return new Error(e)}function nr(e){return e.$descriptor}function ir(e){E(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw tr("expected element");var t,n=this.elementsById,i=nr(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 tr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function rr(){}function or(){}function ar(){}function sr(e,t){this.property=e,this.context=t}function lr(e,t){this.element=t,this.propertyDesc=e}function pr(){}function cr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function ur(e,t,n){cr.call(this,e,t,n)}function mr(e,t,n){this.model=e,this.context=n}function hr(e){e instanceof Oi&&(e={model:e}),E(this,{lax:!1},e)}rr.prototype.handleEnd=function(){},rr.prototype.handleText=function(){},rr.prototype.handleNode=function(){},or.prototype=Object.create(rr.prototype),or.prototype.handleNode=function(){return this},ar.prototype=Object.create(rr.prototype),ar.prototype.handleText=function(e){this.body=(this.body||"")+e},sr.prototype=Object.create(ar.prototype),sr.prototype.handleNode=function(e){if(this.element)throw tr("expected no sub nodes");return this.element=this.createReference(e),this},sr.prototype.handleEnd=function(){this.element.id=this.body},sr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},lr.prototype=Object.create(ar.prototype),lr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Ei(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},pr.prototype=Object.create(ar.prototype),pr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},cr.prototype=Object.create(pr.prototype),cr.prototype.addReference=function(e){this.context.addReference(e)},cr.prototype.handleText=function(e){if(!nr(this.element).bodyProperty)throw tr("unexpected body text <"+e+">");ar.prototype.handleText.call(this,e)},cr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=nr(t).bodyProperty;n&&void 0!==e&&(e=Ei(n.type,e),t.set(n.name,e))},cr.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=nr(i),o=this.context,a=new i({}),s=this.model;return h(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?h(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=Ei(i.type,e):"xmlns"!==n&&(t=Si(n,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},cr.prototype.getPropertyForNode=function(e){var t,n,i=Si(e.name),r=this.type,o=this.model,a=nr(r),s=i.name,l=a.propertiesByName[s];if(l&&!l.isAttr)return Qi(l)&&(t=e.attributes[Zi])?(t=function(e,t){var n=Si(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),E({},l,{effectiveType:nr(n=o.getType(t)).name})):l;var p=o.getPackage(i.prefix);if(p){if(t=er(i,p),n=o.getType(t),l=u(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return E({},l,{effectiveType:nr(n).name})}else if(l=u(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw tr("unrecognized element <"+i.name+">")},cr.prototype.toString=function(){return"ElementDescriptor["+nr(this.type).name+"]"},cr.prototype.valueHandler=function(e,t){return new lr(e,t)},cr.prototype.referenceHandler=function(e){return new sr(e,this.context)},cr.prototype.handler=function(e){return"Element"===e?new mr(this.model,e,this.context):new cr(this.model,e,this.context)},cr.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Ai(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?(E(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},ur.prototype=Object.create(cr.prototype),ur.prototype.createElement=function(e){var t=e.name,n=Si(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&er(n,o)||t;if(!r.hasType(a))throw tr("unexpected element <"+e.originalName+">");return cr.prototype.createElement.call(this,e)},mr.prototype=Object.create(pr.prototype),mr.prototype.createElement=function(e){var t=e.name,n=Si(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},mr.prototype.handleChild=function(e){var t=new mr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},mr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},hr.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof cr?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,a=new ir(E({},t,{rootHandler:i})),s=new qi({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function p(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw tr(l)}function c(e,t){return p(e,t,!0)}i.context=a,l.push(i);var u=/^<\?xml /i,m=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var d=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(d).on("openTag",(function(e,t,n,i){var r=e.attrs||{},a=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){p(e,t,o)&&l.push(new or)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=m.exec(e),n=t&&t[1];n&&!h.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",p).on("warn",c),new Promise((function(t,n){var r;try{s.parse(e),function(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=nr(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=r.get(s.name),p=l.indexOf(t);-1===p&&(p=l.length),o?l[p]=o:l.splice(p,1)}else r.set(s.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=tr("failed to parse document as <"+i.type.$descriptor.name+">"));var l=a.warnings,p=a.references,c=a.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:c,references:p,warnings:l})}))},hr.prototype.handler=function(e){return new ur(this.model,e)};var fr=/<|>|'|"|&|\n\r|\n/g,dr=/<|>|&/g;function yr(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 gr(e,t){return Yi(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function vr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function xr(e){return p(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var br={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},wr={"<":"lt",">":"gt","&":"amp"};function Er(e,t,n){return(e=p(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function _r(e){this.tagName=e}function Ar(){}function Sr(e){this.tagName=e}function Rr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function kr(e,t){Rr.call(this,e,t)}function Cr(){this.value="",this.write=function(e){this.value+=e}}function Mr(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 Pr(e){return e=E({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Cr,r=new Mr(i,e.format);if(e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new Rr).build(t).serializeTo(r),!n)return i.value}}}function Tr(e,t){Oi.call(this,e,t)}_r.prototype.build=function(e){return this.element=e,this},_r.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Ar.prototype.serializeValue=Ar.prototype.serializeTo=function(e){e.append(this.escape?Er(this.value,dr,wr):this.value)},Ar.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(dr)&&(this.escape=!0),this},vr(Sr,Ar),Sr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Rr.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 m(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!c(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(m(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return m(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},Rr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?E({localName:t.ns.localName},e):E({localName:gr(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Rr.prototype.nsPropertyTagName=function(e){return function(e,t){return E({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Rr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Rr.prototype.nsAttributeName=function(e){var t;if(t=p(e)?Si(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}:E({localName:t.localName},n)},Rr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return h(e,(function(r,o){"$body"===o?n.push((new Ar).build({type:"String"},r)):"$children"===o?h(r,(function(e){n.push(new Rr(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},Rr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Si(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)}},Rr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return h(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},Rr.prototype.parseGenericAttributes=function(e,t){var n=this;h(t,(function(t){if(t.name!==Zi)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},Rr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;h(e,(function(e){var r=i.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Ar).build(e,r[0]));else if(Ai(e.type))h(r,(function(i){n.push(new Sr(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)h(r,(function(i){n.push(new _r(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var a=Qi(e),s=function(e){return"property"===Ji(e)}(e);h(r,(function(i){var r;r=a?new kr(t,e):s?new Rr(t,e):new Rr(t),n.push(r.build(i))}))}}))},Rr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new yr(t):n=t),n},Rr.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},Rr.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=Xi[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},Rr.prototype.parseAttributes=function(e){var t=this,n=this.element;h(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];h(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},Rr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),xr(e)},Rr.prototype.addAttribute=function(e,t){var n=this.attrs;p(t)&&(t=Er(t,fr,br));var i=function(e,t){const n=v(t);let i=o(e)?-1:void 0;return h(e,(function(e,t){if(n(e,t))return i=t,!1})),i}(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)},Rr.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)),h(t,(function(t){e.append(" ").append(xr(t.name)).append('="').append(t.value).append('"')}))},Rr.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Ar;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),h(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},vr(kr,Rr),kr.prototype.parseNsAttributes=function(e){var t=Rr.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(Zi),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},kr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Tr.prototype=Object.create(Oi.prototype),Tr.prototype.fromXML=function(e,t,n){p(t)||(n=t,t="bpmn:Definitions");var i=new hr(E({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Tr.prototype.toXML=function(e,t){var n=new Pr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var Or={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",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 Nr(e,t){return new Tr(E({},Or,e),t)}var Dr="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 Br(e,t){return e.$instanceOf(t)}function Ir(e){var t={},n=[],i={};function r(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function a(t,n){try{var r=i[t.id]&&function(t,n){if(t.gfx)throw new Error(`already rendered ${St(t)}`);return e.element(t,i[t.id],n)}(t,n);return o(t),r}catch(e){s(e.message,{element:t,error:e}),console.error(`failed to import ${St(t)}`,e)}}function s(t,n){e.error(t,n)}var l=this.registerDi=function(e){var t,n=e.bpmnElement;n?i[n.id]?s(`multiple DI elements defined for ${St(n)}`,{element:n}):(i[n.id]=e,c(t=n,"di")||Object.defineProperty(t,"di",{enumerable:!1,get:function(){throw new Error(Dr)}})):s(`no bpmnElement referenced in ${St(e)}`,{element:e})};function p(e){var t;t=e.plane,l(t),h(t.planeElement,f)}function f(e){l(e)}this.handleDefinitions=function(o,a){var c=o.diagrams;if(a&&-1===c.indexOf(a))throw new Error("diagram not part of <bpmn:Definitions />");if(!a&&c&&c.length&&(a=c[0]),!a)throw new Error("no diagram to display");i={},p(a);var f=a.plane;if(!f)throw new Error(`no plane for ${St(a)}`);var v=f.bpmnElement;if(!v){if(v=function(e){return u(e.rootElements,(function(e){return Br(e,"bpmn:Process")||Br(e,"bpmn:Collaboration")}))}(o),!v)throw new Error("no process or collaboration to display");s(`correcting missing bpmnElement on ${St(f)} to ${St(v)}`),f.bpmnElement=v,l(f)}var x,b,w=function(t,n){return e.root(t,i[t.id],n)}(v,f);if(Br(v,"bpmn:Process")||Br(v,"bpmn:SubProcess"))y(v,w);else{if(!Br(v,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${St(f)}: ${St(v)}`);b=w,h((x=v).participants,r(P,b)),E(x.artifacts,b),n.push((function(){!function(e,t){h(e,r(g,t))}(x.messageFlows,b)})),function(e,n){var i=m(e,(function(e){return!t[e.id]&&Br(e,"bpmn:Process")&&e.laneSets}));i.forEach(r(y,n))}(o.rootElements,w)}d(n)};var d=this.handleDeferred=function(){for(;n.length;)n.shift()()};function y(e,t){M(e,t),_(e.ioSpecification,t),E(e.artifacts,t),o(e)}function g(e,t){a(e,t)}function v(e,t){a(e,t)}function x(e,t){a(e,t)}function b(e,t){a(e,t)}function w(e,t){a(e,t)}function E(e,t){h(e,(function(e){Br(e,"bpmn:Association")?n.push((function(){w(e,t)})):w(e,t)}))}function _(e,t){e&&(h(e.dataInputs,r(x,t)),h(e.dataOutputs,r(b,t)))}var A=this.handleSubProcess=function(e,t){M(e,t),E(e.artifacts,t)};function S(e,t){var i=a(e,t);Br(e,"bpmn:SubProcess")&&A(e,i||t),Br(e,"bpmn:Activity")&&_(e.ioSpecification,t),n.push((function(){h(e.dataInputAssociations,r(v,t)),h(e.dataOutputAssociations,r(v,t))}))}function R(e,t){a(e,t)}function k(e,t){n.push((function(){var n=a(e,t);e.childLaneSet&&C(e.childLaneSet,n||t),function(e){h(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function C(e,t){h(e.lanes,r(k,t))}function M(e,t){!function(e,t){h(e,(function(e){Br(e,"bpmn:SequenceFlow")?n.push((function(){!function(e,t){a(e,t)}(e,t)})):Br(e,"bpmn:BoundaryEvent")?n.unshift((function(){S(e,t)})):Br(e,"bpmn:FlowNode")?S(e,t):Br(e,"bpmn:DataObject")||(Br(e,"bpmn:DataStoreReference")||Br(e,"bpmn:DataObjectReference")?R(e,t):s(`unrecognized flowElement ${St(e)} in context ${St(t&&t.businessObject)}`,{element:e,context:t}))}))}(e.flowElements,t),e.laneSets&&function(e,t){h(e,r(C,t))}(e.laneSets,t)}function P(e,t){var n=a(e,t),i=e.processRef;i&&y(i,n||t)}}function Lr(e,t,n){var i,r,o,a=[];function s(e,t){var n=new Ir({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){a.push({message:e,context:t})}});t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t||!t.plane)return;var n,i=t.plane.bpmnElement,r=i;S(i,"bpmn:Process")||S(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(S(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=S(r,"bpmn:Collaboration")?r:u(e.rootElements,(function(e){if(S(e,"bpmn:Collaboration"))return u(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=function(e,t){let n=[];return h(e,(function(e,i){n.push(t(e,i))})),n}(n.participants,(function(e){return e.processRef}))).push(n);var a=jr(o),s=[t],l=[i];return h(e.diagrams,(function(e){if(e.plane){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("no diagram to display");h(r,(function(t){n.handleDefinitions(e,t)}));var s=t.plane.bpmnElement.id;o.setRootElement(o.findRoot(s+"_plane")||o.findRoot(s))}return new Promise((function(l,p){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("canvas"),r.fire("import.render.start",{definitions:t}),s(t,n),r.fire("import.render.complete",{error:undefined,warnings:a}),l({warnings:a})}catch(e){return e.warnings=a,p(e)}}))}function jr(e){var t=[];return h(e,(function(e){e&&(t.push(e),t=t.concat(jr(e.flowElements)))})),t}var Fr,Vr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',Wr={verticalAlign:"middle"},zr={color:"#404040"},$r={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Gr={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Hr={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"},Ur='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+Vr+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';function Kr(){Fr||(De(Fr=Ze(Ur),$r),De(Je("svg",Fr),Wr),De(Je(".backdrop",Fr),Gr),De(Je(".notice",Fr),Hr),De(Je(".link",Fr),zr,{margin:"15px 20px 15px 10px",alignSelf:"center"}),Ke.bind(Fr,".backdrop","click",(function(e){document.body.removeChild(Fr)}))),document.body.appendChild(Fr)}function qr(e){e=E({},Xr,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=Ze('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Vr+"</a>");De(Je("svg",t),Wr),De(t,zr,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),Ge.bind(t,"click",(function(e){Kr(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function Yr(e,t){return e.warnings=t,e}e(qr,gi),qr.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let a=o.rootElement;const s=o.references,l=o.warnings,p=o.elementsById;i=i.concat(l),a=this._emit("import.parse.complete",(r={error:null,definitions:a,elementsById:p,references:s,warnings:i},n.get("eventBus").createEvent(r)))||a;const c=await this.importDefinitions(a,t);return i=i.concat(c.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),Yr(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},qr.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},qr.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw Yr(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return u(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw Yr(t,[]),t}try{this.clear()}catch(e){throw Yr(e,[]),e}const{warnings:i}=await Lr(this,t,n);return{warnings:i}},qr.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},qr.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=Je(":scope > defs",t._svg),r=se(n),o=i?"<defs>"+se(i)+"</defs>":"",a=n.getBBox();e='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a.width+'" height="'+a.height+'" viewBox="'+a.x+" "+a.y+" "+a.width+" "+a.height+'" version="1.1">'+o+r+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},qr.prototype._setDefinitions=function(e){this._definitions=e},qr.prototype.getModules=function(){return this._modules},qr.prototype.clear=function(){this.getDefinitions()&&gi.prototype.clear.call(this)},qr.prototype.destroy=function(){gi.prototype.destroy.call(this),Qe(this._container)},qr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},qr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},qr.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=Je(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},qr.prototype.getDefinitions=function(){return this._definitions},qr.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},qr.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=E(function(e,t){let n={};return h(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}(n,["additionalModules"]),{canvas:E({},n.canvas,{container:e}),modules:o});gi.call(this,a),n&&n.container&&this.attachTo(n.container)},qr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},qr.prototype._createContainer=function(e){const t=Ze('<div class="bjs-container"></div>');return De(t,{width:Zr(e.width),height:Zr(e.height),position:e.position}),t},qr.prototype._createModdle=function(e){return new Nr(E({},this._moddleExtensions,e.moddleExtensions))},qr.prototype._modules=[];const Xr={width:"100%",height:"100%",position:"relative"};function Zr(e){return e+(s(e)?"px":"")}function Jr(e){qr.call(this,e)}e(Jr,qr),Jr.prototype._modules=[Pt,an,fn,Vt,Cn,bt],Jr.prototype._moddleExtensions={};function Qr(e,t,n){this._bpmnRenderer=t,this._iconProperty=e&&e.iconProperty,A.call(this,n,1250)}e(Qr,A),Qr.prototype.canRender=function(e){return!T(e)&&!(!R(e,["bpmn:Task","bpmn:Event"])||!this._getIcon(e))},Qr.prototype._getIcon=function(e){return function(e,t){return t=t||"zeebe:modelerTemplateIcon",k(e).get(t)}(e,this._iconProperty)},Qr.prototype.drawShape=function(e,t,n={}){var i=(0,this._bpmnRenderer.handlers[["bpmn:BoundaryEvent","bpmn:EndEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:StartEvent","bpmn:Task"].find((e=>S(t,e)))])(e,t,{...n,renderIcon:!1}),r=this._getIcon(t),o=S(t,"bpmn:Task")?{x:5,y:5}:{x:(t.width-18)/2,y:(t.height-18)/2},a=X("image");return z(a,{href:r,width:18,height:18,...o}),j(e,a),i},Qr.$inject=["config.elementTemplateIconRenderer","bpmnRenderer","eventBus"];const eo=[{__init__:["elementTemplateIconRenderer"],elementTemplateIconRenderer:["type",Qr]}],to={zeebe:{name:"zeebe",prefix:"zeebe",uri:"http://camunda.org/schema/zeebe/1.0",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"ZeebeServiceTask",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:SendTask","bpmn:EndEvent","bpmn:IntermediateThrowEvent"],properties:[{name:"retryCounter",type:"String",isAttr:!0}]},{name:"IoMapping",superClass:["Element"],properties:[{name:"ioMapping",type:"IoMapping"},{name:"inputParameters",isMany:!0,type:"Input"},{name:"outputParameters",isMany:!0,type:"Output"}],meta:{allowedIn:["bpmn:CallActivity","bpmn:Event","bpmn:ReceiveTask","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"InputOutputParameter",properties:[{name:"source",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"}]},{name:"Subscription",superClass:["Element"],properties:[{name:"correlationKey",isAttr:!0,type:"String"}]},{name:"Input",superClass:["InputOutputParameter"],meta:{allowedIn:["bpmn:CallActivity","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"Output",superClass:["InputOutputParameter"],meta:{allowedIn:["bpmn:CallActivity","bpmn:Event","bpmn:ReceiveTask","zeebe:ZeebeServiceTask","bpmn:SubProcess","bpmn:UserTask"]}},{name:"TaskHeaders",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask","bpmn:UserTask"]},properties:[{name:"values",type:"Header",isMany:!0}]},{name:"Header",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"key",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"TaskDefinition",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask"]},properties:[{name:"type",type:"String",isAttr:!0},{name:"retries",type:"String",isAttr:!0}]},{name:"LoopCharacteristics",superClass:["Element"],meta:{allowedIn:["zeebe:ZeebeServiceTask","bpmn:ReceiveTask","bpmn:SubProcess"]},properties:[{name:"inputCollection",type:"String",isAttr:!0},{name:"inputElement",type:"String",isAttr:!0},{name:"outputCollection",type:"String",isAttr:!0},{name:"outputElement",type:"String",isAttr:!0}]},{name:"CalledElement",superClass:["Element"],meta:{allowedIn:["bpmn:CallActivity"]},properties:[{name:"processId",type:"String",isAttr:!0},{name:"processIdExpression",type:"String",isAttr:!0},{name:"propagateAllChildVariables",isAttr:!0,type:"Boolean"},{name:"propagateAllParentVariables",isAttr:!0,type:"Boolean",default:!0}]},{name:"UserTaskForm",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"body",type:"String",isBody:!0}]},{name:"FormDefinition",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"formKey",type:"String",isAttr:!0},{name:"formId",type:"String",isAttr:!0},{name:"externalReference",type:"String",isAttr:!0}]},{name:"UserTask",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[]},{name:"CalledDecision",superClass:["Element"],meta:{allowedIn:["bpmn:BusinessRuleTask"]},properties:[{name:"decisionId",type:"String",isAttr:!0},{name:"resultVariable",type:"String",isAttr:!0}]},{name:"AssignmentDefinition",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"assignee",type:"String",isAttr:!0},{name:"candidateGroups",type:"String",isAttr:!0},{name:"candidateUsers",type:"String",isAttr:!0}]},{name:"TaskSchedule",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"dueDate",type:"String",isAttr:!0},{name:"followUpDate",type:"String",isAttr:!0}]},{name:"Properties",superClass:["Element"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"Property",properties:[{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Collaboration","bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"},{name:"modelerTemplateIcon",isAttr:!0,type:"String"}]},{name:"TemplatedRootElement",isAbstract:!0,extends:["bpmn:Error","bpmn:Escalation","bpmn:Message","bpmn:Signal"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Script",superClass:["Element"],meta:{allowedIn:["bpmn:ScriptTask"]},properties:[{name:"expression",type:"String",isAttr:!0},{name:"resultVariable",type:"String",isAttr:!0}]}]}};function no(e={}){e={...e,moddleExtensions:{...to,...e.moddleExtensions}},Jr.call(this,e)}return e(no,Jr),no.prototype._camundaCloudModules=[...eo],no.prototype._modules=[].concat(Jr.prototype._modules,no.prototype._camundaCloudModules),no}));
|