diff --git a/dist/bpmn.js b/dist/bpmn.js index 25810a38..e7065f47 100644 --- a/dist/bpmn.js +++ b/dist/bpmn.js @@ -1,7 +1,7 @@ /*! For license information please see bpmn.js.LICENSE.txt */ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,(()=>(()=>{var e={907:(e,t,n)=>{"use strict";n.d(t,{Z:()=>bt});var i=n(398),r=n(674),o=n(487);const a=/^class[ {]/;function s(e){return Array.isArray(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function p(...e){1===e.length&&s(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const l=/constructor\s*[^(]*\(\s*([^)]*)\)/m,u=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,h=/\/\*([^*]*)\*\//m;function d(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return a.test(e.toString())}(e)?l:u);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(h);return(t&&t[1]||e).trim()}))||[]}function f(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}};const n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(e){const t=n.join(" -> ");return n.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function l(e,o){if(!i[e]&&-1!==e.indexOf(".")){const t=e.split(".");let n=l(t.shift());for(;t.length;)n=n[t.shift()];return n}if(c(r,e))return r[e];if(c(i,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),r[e]=i[e][0](i[e][1]),n.pop(),r[e]}return t.get(e,o)}function u(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!s(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=p(e.slice())}return{fn:e,dependencies:(e.$inject||d(e)).map((e=>c(t,e)?t[e]:l(e)))}}function h(e){const{fn:t,dependencies:n}=u(e);return new(Function.prototype.bind.apply(t,[null].concat(n)))}function v(e,t,n){const{fn:i,dependencies:r}=u(e,n);return i.apply(t,r)}function g(e){return p((t=>e.get(t)))}function y(e,t){if(t&&t.length){const n=Object.create(null),r=Object.create(null),o=[],a=[],s=[];let c,p,l,u;for(let e in i)c=i[e],-1!==t.indexOf(e)&&("private"===c[2]?(p=o.indexOf(c[3]),-1===p?(l=c[3].createChild([],t),u=g(l),o.push(c[3]),a.push(l),s.push(u),n[e]=[u,e,"private",l]):n[e]=[s[p],e,"private",a[p]]):n[e]=[c[2],c[1]],r[e]=!0),"factory"!==c[2]&&"type"!==c[2]||!c[1].$scope||t.forEach((t=>{-1!==c[1].$scope.indexOf(t)&&(n[e]=[c[2],c[1]],r[t]=!0)}));t.forEach((e=>{if(!r[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new f(e,o)}const b={factory:v,type:h,value:function(e){return e}};function _(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function x(e){const t=e.__exports__;if(t){const n=e.__modules__,r=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=y((n||[]).concat(r)),a=p((function(e){return o.get(e)}));t.forEach((function(e){i[e]=[a,e,"private",o]}));const s=(e.__init__||[]).slice();return s.unshift((function(){o.init()})),_(e=Object.assign({},e,{__init__:s}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;if("private"===e[t][2])return void(i[t]=e[t]);const n=e[t][0],r=e[t][1];i[t]=[b[n],m(n,r),n]})),_(e,o)}function E(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(E,e)).indexOf(t)?e:e.concat(t)}this.get=l,this.invoke=v,this.instantiate=h,this.createChild=y,this.init=function(e){const t=e.reduce(E,[]).map(x);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function m(e,t){return"value"!==e&&s(t)&&(t=p(t.slice())),t}var v=n(66),g=n(858),y=n(230),b=n(490);function _(e,t){g.Z.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})}(0,v.Z)(_,g.Z),_.prototype.canRender=function(){return!0},_.prototype.drawShape=function(e,t,n){var r=(0,o.Ue)("rect");return(0,o.Lj)(r,{x:0,y:0,width:t.width||0,height:t.height||0}),(0,b.He)(t)?(0,o.Lj)(r,(0,i.f0)({},this.FRAME_STYLE,n||{})):(0,o.Lj)(r,(0,i.f0)({},this.SHAPE_STYLE,n||{})),(0,o.R3)(e,r),r},_.prototype.drawConnection=function(e,t,n){var r=(0,y.W5)(t.waypoints,(0,i.f0)({},this.CONNECTION_STYLE,n||{}));return(0,o.R3)(e,r),r},_.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width,r=[["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]];return(0,y.KO)(r)},_.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(0,y.KO)(r)},_.$inject=["eventBus","styles"];const x={__init__:["defaultRenderer"],defaultRenderer:["type",_],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){var r=this.style(t,n);return(0,i.f0)(r,{class:e})},this.style=function(t,n){(0,i.kJ)(t)||n||(n=t,t=[]);var r=(0,i.u4)(t,(function(t,n){return(0,i.f0)(t,e[n]||{})}),{});return n?(0,i.f0)(r,n):r},this.computeStyle=function(e,n,r){return(0,i.kJ)(n)||(r=n,n=[]),t.style(n||[],(0,i.f0)({},r,e||{}))}}]};var E=n(943),w=n(935);function S(e,t){return Math.round(e*t)/t}function k(e){return(0,i.hj)(e)?e+"px":e}function C(e,t,n){const i=(0,o.Ue)("g");(0,o.Sh)(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const R={shape:["x","y","width","height"],connection:["waypoints"]};function A(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 P(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}A.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],A.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=(0,i.f0)({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),(0,r.i5)(n,{position:"relative",overflow:"hidden",width:k(e.width),height:k(e.height)}),t.appendChild(n),n}(e),a=this._svg=(0,o.Ue)("svg");(0,o.Lj)(a,{width:"100%",height:"100%"}),(0,o.R3)(n,a);const s=this._viewport=C(a,"viewport");e.deferUpdate&&(this._viewboxChanged=(0,i.Ds)((0,i.ak)(this._viewboxChanged,this),300)),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:a,viewport:s})})),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)},A.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},A.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=(0,b.oL)(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},A.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},A.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},A.prototype._getChildIndex=function(e){return(0,i.u4)(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},A.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:C(this._viewport,"layer-"+e,n),index:t,visible:!0}},A.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},A.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?((0,o.Od)(n),t.visible=!1,n):n},A.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],(0,o.Od)(t.group))},A.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},A.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},A.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},A.prototype._findPlaneForRoot=function(e){return(0,i.sE)(this._planes,(function(t){return t.rootElement===e}))},A.prototype.getContainer=function(){return this._container},A.prototype._updateMarker=function(e,t,n){let r;e.id||(e=this._elementRegistry.get(e)),r=this._elementRegistry._elements[e.id],r&&((0,i.Ed)([r.gfx,r.secondaryGfx],(function(e){e&&(n?(0,o.Sh)(e).add(t):(0,o.Sh)(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},A.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},A.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},A.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));const n=this.getGraphics(e);return(0,o.Sh)(n).has(t)},A.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},A.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},A.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},A.prototype.removeRootElement=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},A.prototype.setRootElement=function(e){if(e===this._rootElement)return;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},A.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)},A.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})},A.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})},A.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=R[e];if(!(0,i.yW)(n,(function(e){return void 0!==t[e]})))throw new Error("must supply { "+n.join(", ")+" } with "+e)},A.prototype._setParent=function(e,t,n){(0,E.IH)(t.children,e,n),e.parent=t},A.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},A.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},A.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},A.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),(0,E.Od)(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},A.prototype.removeShape=function(e){return this._removeElement(e,"shape")},A.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},A.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},A.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},A.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},A.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,a,s,c,p,l;return e?(this._changeViewbox((function(){c=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(c).translate(-e.x,-e.y);(0,o.vs)(t,i)})),e):(a=this._rootElement?this.getActiveLayer():null,i=a&&a.getBBox()||{},s=(0,o.vs)(t),r=s?s.matrix:(0,o.wz)(),c=S(r.a,1e3),p=S(-r.e||0,1e3),l=S(-r.f||0,1e3),e=this._cachedViewbox={x:p?p/c:0,y:l?l/c:0,width:n.width/c,height:n.height/c,scale:c,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},A.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=(0,i.f0)({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),P(t,n)})),{x:n.e,y:n.f}},A.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=(0,b.jY)(e),o=(0,w.JA)(r),a=this.viewbox(),s=this.zoom();let c,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 l=(0,w.JA)(a);if(r.width=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},A.prototype._setZoom=function(e,t){const n=this._svg,r=this._viewport,o=n.createSVGMatrix(),a=n.createSVGPoint();let s,c,p,l,u;p=r.getCTM();const h=p.a;return t?(s=(0,i.f0)(a,t),c=s.matrixTransform(p.inverse()),l=o.translate(c.x,c.y).scale(1/h*e).translate(-c.x,-c.y),u=p.multiply(l)):u=o.scale(e),P(this._viewport,u),u},A.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},A.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;return n=e.waypoints?this.getGraphics(e).getBBox():e,{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}},A.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var T="data-element-id";function M(e){this._elements={},this._eventBus=e}M.$inject=["eventBus"],M.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),(0,o.Lj)(t,T,i),n&&(0,o.Lj)(n,T,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},M.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&((0,o.Lj)(i.gfx,T,""),i.secondaryGfx&&(0,o.Lj)(i.secondaryGfx,T,""),delete t[n])},M.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)},M.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&(0,o.Lj)(t,T,i),t},M.prototype.get=function(e){var t;t="string"==typeof e?e:e&&(0,o.Lj)(e,T);var n=this._elements[t];return n&&n.element},M.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},M.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i or , got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function X(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Y(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,(0,i.Ed)(e,(0,i.ak)(this.registerPackage,this))}function Q(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function ee(e){this.model=e}function te(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function ne(e){return e.replace(/^:/,"")}function ie(e,t={}){this.properties=new ee(this),this.factory=new W(this,this.properties),this.registry=new Y(e,this.properties),this.typeCache={},this.config=t}X.prototype.build=function(){return(0,i.ei)(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},X.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)},X.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},X.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=q(r[0],i),a=q(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},X.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},X.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},X.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},X.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},X.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},X.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")},X.prototype.hasProperty=function(e){return this.propertiesByName[e]},X.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,o=e.name;o in n||((0,i.Ed)(e.properties,(0,i.ak)((function(n){n=(0,i.f0)({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var r=n.replaces,o=n.redefines;r||o?this.redefineProperty(n,r||o,r):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),r.push(e),n[o]=e)},Y.prototype.getPackage=function(e){return this.packageMap[e]},Y.prototype.getPackages=function(){return this.packages},Y.prototype.registerPackage=function(e){e=(0,i.f0)({},e);var t=this.packageMap;Q(t,e,"prefix"),Q(t,e,"uri"),(0,i.Ed)(e.types,(0,i.ak)((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Y.prototype.registerType=function(e,t){var n=q((e=(0,i.f0)({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:(0,i.f0)(e.meta||{})})).name,t.prefix),r=n.name,o={};(0,i.Ed)(e.properties,(0,i.ak)((function(e){var t=q(e.name,n.prefix),r=t.name;K(e.type)||(e.type=q(e.type,t.prefix).name),(0,i.f0)(e,{ns:t,name:r}),o[r]=e}),this)),(0,i.f0)(e,{ns:n,name:r,propertiesByName:o}),(0,i.Ed)(e.extends,(0,i.ak)((function(e){var t=q(e,n.prefix),i=this.typeMap[t.name];i.traits=i.traits||[],i.traits.push(r)}),this)),this.definePackage(e,t),this.typeMap[r]=e},Y.prototype.mapTypes=function(e,t,n){var r=K(e.name)?{name:e.name}:this.typeMap[e.name],o=this;function a(n,i){var r=q(n,K(n)?"":e.prefix);o.mapTypes(r,t,i)}function s(e){return a(e,!0)}if(!r)throw new Error("unknown type <"+e.name+">");(0,i.Ed)(r.superClass,n?s:function(e){return a(e,!1)}),t(r,!n),(0,i.Ed)(r.traits,s)},Y.prototype.getEffectiveDescriptor=function(e){var t=q(e),n=new X(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},Y.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},ee.prototype.set=function(e,t,n){if(!(0,i.HD)(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),o=r&&r.name;void 0===n?r?delete e[o]:delete e.$attrs[ne(t)]:r?o in e?e[o]=n:te(e,r,n):e.$attrs[ne(t)]=n},ee.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[ne(t)];var i=n.name;return!e[i]&&n.isMany&&te(e,n,[]),e[i]},ee.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;delete(n=(0,i.f0)({},n,{get:function(){return r}})).value}Object.defineProperty(e,t,n)},ee.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},ee.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},ee.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},ie.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},ie.prototype.getType=function(e){var t=this.typeCache,n=(0,i.HD)(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},ie.prototype.createAny=function(e,t,n){var r=q(e),o={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){(0,i.t8)(this,[e],t)}},a={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(o,a),this.properties.defineModel(o,this),this.properties.define(o,"get",{enumerable:!1,writable:!0}),this.properties.define(o,"set",{enumerable:!1,writable:!0}),this.properties.define(o,"$parent",{enumerable:!1,writable:!0}),this.properties.define(o,"$instanceOf",{enumerable:!1,writable:!0}),(0,i.Ed)(n,(function(e,t){(0,i.Kn)(e)&&void 0!==e.value?o[e.name]=e.value:o[t]=e})),o},ie.prototype.getPackage=function(e){return this.registry.getPackage(e)},ie.prototype.getPackages=function(){return this.registry.getPackages()},ie.prototype.getElementDescriptor=function(e){return e.$descriptor},ie.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},ie.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},ie.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var re=String.fromCharCode,oe=Object.prototype.hasOwnProperty,ae=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,se={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function ce(e,t,n,i){return i?oe.call(se,i)?se[i]:"&"+i+";":re(t||parseInt(n,16))}function pe(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(ae,ce):e}Object.keys(se).forEach((function(e){se[e.toUpperCase()]=se[e]}));var le="xsi:type",ue="non-whitespace outside of root node";function he(e){return new Error(e)}function de(e){return"missing namespace for prefix <"+e+">"}function fe(e){return{get:e,enumerable:!0}}function me(e){var t,n={};for(t in e)n[t]=e[t];return n}function ve(e){return e+"$uri"}function ge(){return{line:0,column:0}}function ye(e){throw e}function be(e){if(!this)return new be(e);var t,n,i,r,o,a,s,c,p,l=e&&e.proxy,u=ye,h=ge,d=!1,f=!1,m=null,v=!1;function g(e){e instanceof Error||(e=he(e)),m=e,u(e,h)}function y(e){o&&(e instanceof Error||(e=he(e)),o(e,h))}this.on=function(e,p){if("function"!=typeof p)throw he("required args ");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":c=p;break;case"question":s=p;break;case"comment":a=p;break;default:throw he("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw he("required args ");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 he("required args ");return m=null,function(e){var o,u,m,b,_,x,E,w,S,k,C,R=f?[]:null,A=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[ve(n)]=t;return i}(p):null,P=[],T=0,M=!1,D=!1,B=0,j=0,N="",O=0;function L(){if(null!==C)return C;var e,t,n,i,r,o,a,s,c,l,u,h=f&&A.xmlns,m=f&&d?[]:null,v=O,g=N,b=g.length,_={},x={};e:for(;v8)){for((l<65||l>122||l>90&&l<97)&&95!==l&&58!==l&&(y("illegal first char attribute name"),c=!0),u=v+1;u96&&l<123||l>64&&l<91||l>47&&l<59||46===l||45===l||95===l)){if(32===l||l<14&&l>8){y("missing attribute value"),v=u;continue e}if(61===l)break;y("illegal attribute name char"),c=!0}if("xmlns:xmlns"===(s=g.substring(v,u))&&(y("illegal declaration of xmlns"),c=!0),34===(l=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',v=u+2))&&-1!==(u=g.indexOf("'",v))&&(y("attribute value quote missmatch"),c=!0);else if(39===l)-1===(u=g.indexOf("'",v=u+2))&&-1!==(u=g.indexOf('"',v))&&(y("attribute value quote missmatch"),c=!0);else for(y("missing attribute value quotes"),c=!0,u+=1;u8);u++);for(-1===u&&(y("missing closing quotes"),u=b,c=!0),c||(o=g.substring(v,u)),v=u;u+18);u++)v===u&&(y("illegal character after attribute end"),c=!0);if(v=u+1,!c)if(s in x)y("attribute <"+s+"> already defined");else if(x[s]=!0,f)if(d){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=pe(o),t=ve(r),!(a=p[e])){if("xmlns"===r||t in A&&A[t]!==e)do{a="ns"+T++}while(void 0!==A[a]);else a=r;p[e]=a}A[r]!==a&&(i||(A=me(A),i=!0),A[r]=a,"xmlns"===r&&(A[ve(a)]=e,h=a),A[t]=e),_[s]=o;continue}m.push(s,o)}else-1!==(l=s.indexOf(":"))?(n=A[s.substring(0,l)])?((s=h===n?s.substr(l+1):n+s.substr(l))===le&&(-1!==(l=o.indexOf(":"))?(n=o.substring(0,l),o=(n=A[n]||n)+o.substring(l)):o=h+":"+o),_[s]=o):y(de(s.substring(0,l))):_[s]=o;else _[s]=o}if(d)for(v=0,b=m.length;v=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>B);)r+=1,a=s;return-1==B?(o=s,n=e.substring(j)):0===j?n=e.substring(j,B):(o=B-a,n=-1==j?e.substring(B):e.substring(B,j+1)),{data:n,line:r,column:o}},l&&(k=Object.create({},{name:fe((function(){return w})),originalName:fe((function(){return S})),attrs:fe(L),ns:fe((function(){return A}))}));-1!==j;){if(-1===(B=60===e.charCodeAt(j)?j:e.indexOf("<",j)))return P.length?g("unexpected end of file"):0===j?g("missing start tag"):void(j",B)))return g("unclosed cdata");if(r&&(r(e.substring(B+9,j),h),v))return;j+=3;continue}if(45===b&&45===e.charCodeAt(B+3)){if(-1===(j=e.indexOf("--\x3e",B)))return g("unclosed comment");if(a&&(a(e.substring(B+4,j),pe,h),v))return;j+=3;continue}}if(63!==_){for(u=B+1;;u++){if(x=e.charCodeAt(u),isNaN(x))return j=-1,g("unclosed tag");if(34===x)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===x)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===x){j=u;break}}if(33!==_){if(C={},47===_){if(M=!1,D=!0,!P.length)return g("missing open tag");if(u=w=P.pop(),b=B+2+u.length,e.substring(B+2,b)!==u)return g("closing tag mismatch");for(;b8&&_<14))return g("close tag")}else{if(47===e.charCodeAt(j-1)?(u=w=e.substring(B+1,j-1),M=!0,D=!0):(u=w=e.substring(B+1,j),M=!0,D=!1),!(_>96&&_<123||_>64&&_<91||95===_||58===_))return g("illegal first char nodeName");for(b=1,m=u.length;b96&&_<123||_>64&&_<91||_>47&&_<59||45===_||95===_||46==_)){if(32===_||_<14&&_>8){w=u.substring(0,b),C=null;break}return g("invalid nodeName")}D||P.push(w)}if(f){if(o=A,M&&(D||R.push(o),null===C&&(d=-1!==u.indexOf("xmlns",b))&&(O=b,N=u,L(),d=!1)),S=w,-1!==(_=w.indexOf(":"))){if(!(E=A[w.substring(0,_)]))return g("missing namespace on <"+S+">");w=w.substr(_+1)}else E=A.xmlns;E&&(w=E+":"+w)}if(M&&(O=b,N=u,n&&(l?n(k,pe,D,h):n(w,L,pe,D,h),v)))return;if(D){if(i&&(i(l?k:w,pe,M,h),v))return;f&&(A=M?o:R.pop())}j+=1}else{if(c&&(c(e.substring(B,j+1),pe,h),v))return;j+=1}}else{if(-1===(j=e.indexOf("?>",B)))return g("unclosed question");if(s&&(s(e.substring(B,j+2),h),v))return;j+=2}}}(e),h=ge,v=!1,m},this.stop=function(){v=!0}}function _e(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var xe={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Ee="xsi:type";function we(e){return e.xml&&e.xml.serialize}function Se(e){return we(e)===Ee}function ke(e,t){return _e(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Ce(e){return new Error(e)}function Re(e){return e.$descriptor}function Ae(e){(0,i.f0)(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Ce("expected element");var t,n=this.elementsById,i=Re(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 Ce("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Pe(){}function Te(){}function Me(){}function De(e,t){this.property=e,this.context=t}function Be(e,t){this.element=t,this.propertyDesc=e}function je(){}function Ne(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Oe(e,t,n){Ne.call(this,e,t,n)}function Le(e,t,n){this.model=e,this.context=n}function Ie(e){e instanceof ie&&(e={model:e}),(0,i.f0)(this,{lax:!1},e)}Pe.prototype.handleEnd=function(){},Pe.prototype.handleText=function(){},Pe.prototype.handleNode=function(){},Te.prototype=Object.create(Pe.prototype),Te.prototype.handleNode=function(){return this},Me.prototype=Object.create(Pe.prototype),Me.prototype.handleText=function(e){this.body=(this.body||"")+e},De.prototype=Object.create(Me.prototype),De.prototype.handleNode=function(e){if(this.element)throw Ce("expected no sub nodes");return this.element=this.createReference(e),this},De.prototype.handleEnd=function(){this.element.id=this.body},De.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Be.prototype=Object.create(Me.prototype),Be.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=G(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},je.prototype=Object.create(Me.prototype),je.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},Ne.prototype=Object.create(je.prototype),Ne.prototype.addReference=function(e){this.context.addReference(e)},Ne.prototype.handleText=function(e){if(!Re(this.element).bodyProperty)throw Ce("unexpected body text <"+e+">");Me.prototype.handleText.call(this,e)},Ne.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Re(t).bodyProperty;n&&void 0!==e&&(e=G(n.type,e),t.set(n.name,e))},Ne.prototype.createElement=function(e){var t,n=e.attributes,r=this.type,o=Re(r),a=this.context,s=new r({}),c=this.model;return(0,i.Ed)(n,(function(e,n){var r,p=o.propertiesByName[n];p&&p.isReference?p.isMany?(r=e.split(" "),(0,i.Ed)(r,(function(e){a.addReference({element:s,property:p.ns.name,id:e})}))):a.addReference({element:s,property:p.ns.name,id:e}):(p?e=G(p.type,e):"xmlns"!==n&&(t=q(n,o.ns.prefix),c.getPackage(t.prefix)&&a.addWarning({message:"unknown attribute <"+n+">",element:s,property:n,value:e})),s.set(n,e))})),s},Ne.prototype.getPropertyForNode=function(e){var t,n,r=q(e.name),o=this.type,a=this.model,s=Re(o),c=r.name,p=s.propertiesByName[c];if(p&&!p.isAttr)return Se(p)&&(t=e.attributes[Ee])?(t=function(e,t){var n=q(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,a),n=a.getType(t),(0,i.f0)({},p,{effectiveType:Re(n).name})):p;var l=a.getPackage(r.prefix);if(l){if(t=ke(r,l),n=a.getType(t),p=(0,i.sE)(s.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return(0,i.f0)({},p,{effectiveType:Re(n).name})}else if(p=(0,i.sE)(s.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return p;throw Ce("unrecognized element <"+r.name+">")},Ne.prototype.toString=function(){return"ElementDescriptor["+Re(this.type).name+"]"},Ne.prototype.valueHandler=function(e,t){return new Be(e,t)},Ne.prototype.referenceHandler=function(e){return new De(e,this.context)},Ne.prototype.handler=function(e){return"Element"===e?new Le(this.model,e,this.context):new Ne(this.model,e,this.context)},Ne.prototype.handleChild=function(e){var t,n,r,o;if(t=this.getPropertyForNode(e),r=this.element,J(n=t.effectiveType||t.type))return this.valueHandler(t,r);var a=(o=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==a&&(t.isMany?r.get(t.name).push(a):r.set(t.name,a),t.isReference?((0,i.f0)(a,{element:r}),this.context.addReference(a)):a.$parent=r),o},Oe.prototype=Object.create(Ne.prototype),Oe.prototype.createElement=function(e){var t=e.name,n=q(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&ke(n,o)||t;if(!r.hasType(a))throw Ce("unexpected element <"+e.originalName+">");return Ne.prototype.createElement.call(this,e)},Le.prototype=Object.create(je.prototype),Le.prototype.createElement=function(e){var t=e.name,n=q(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Le.prototype.handleChild=function(e){var t=new Le(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},Le.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Ie.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Ne?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var o=this.model,a=this.lax,s=new Ae((0,i.f0)({},t,{rootHandler:r})),c=new be({proxy:!0}),p=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function l(e,t,n){var i=t(),r=i.line,o=i.column,a=i.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var c="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:c,error:e}),!0;throw Ce(c)}function u(e,t){return l(e,t,!0)}r.context=s,p.push(r);var h=/^<\?xml /i,d=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function m(e,t){try{p.peek().handleText(e)}catch(e){u(e,t)}}var v=o.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return c.ns(v).on("openTag",(function(e,t,n,i){var r=e.attrs||{},o=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=p.peek();try{p.push(n.handleNode(e))}catch(e){l(e,t,a)&&p.push(new Te)}}({name:e.name,originalName:e.originalName,attributes:o,ns:e.ns},i)})).on("question",(function(e){if(h.test(e)){var t=d.exec(e),n=t&&t[1];n&&!f.test(n)&&s.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){p.pop().handleEnd()})).on("cdata",m).on("text",(function(e,t,n){!function(e,t){e.trim()&&m(e,t)}(t(e),n)})).on("error",l).on("warn",u),new Promise((function(t,n){var i;try{c.parse(e),function(){var e,t,n=s.elementsById,i=s.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],a=Re(r).propertiesByName[t.property];if(o||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var c=r.get(a.name),p=c.indexOf(t);-1===p&&(p=c.length),o?c[p]=o:c.splice(p,1)}else r.set(a.name,o)}}()}catch(e){i=e}var o=r.element;i||o||(i=Ce("failed to parse document as <"+r.type.$descriptor.name+">"));var a=s.warnings,p=s.references,l=s.elementsById;return i?(i.warnings=a,n(i)):t({rootElement:o,elementsById:l,references:p,warnings:a})}))},Ie.prototype.handler=function(e){return new Oe(this.model,e)};var $e=/<|>|'|"|&|\n\r|\n/g,ze=/<|>|&/g;function Fe(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 He(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Ze(e){return(0,i.HD)(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var We={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Ue={"<":"lt",">":"gt","&":"amp"};function Ve(e,t,n){return(e=(0,i.HD)(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Ge(e){this.tagName=e}function Ke(){}function Je(e){this.tagName=e}function qe(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Xe(e,t){qe.call(this,e,t)}function Ye(){this.value="",this.write=function(e){this.value+=e}}function Qe(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 et(e){return e=(0,i.f0)({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Ye,r=new Qe(i,e.format);if(e.preamble&&r.append('\n'),(new qe).build(t).serializeTo(r),!n)return i.value}}}function tt(e,t){ie.call(this,e,t)}Ge.prototype.build=function(e){return this.element=e,this},Ge.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()},Ke.prototype.serializeValue=Ke.prototype.serializeTo=function(e){e.append(this.escape?Ve(this.value,ze,Ue):this.value)},Ke.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(ze)&&(this.escape=!0),this},He(Je,Ke),Je.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()},qe.prototype.build=function(e){this.element=e;var t,n,r,o=e.$descriptor,a=this.propertyDescriptor,s=o.isGeneric;return t=s?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=a?this.nsPropertyTagName(a):this.nsTagName(o),this.tagName=this.addTagName(this.ns),s||(n=function(e){var t=e.$descriptor;return(0,i.hX)(t.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!(0,i.e$)(e,n))return!1;var r=e[n];return r!==t.default&&null!==r&&(!t.isMany||r.length)}))}(e),this.parseAttributes((r=n,(0,i.hX)(r,(function(e){return e.isAttr})))),this.parseContainments(function(e){return(0,i.hX)(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},qe.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?(0,i.f0)({localName:t.ns.localName},e):(0,i.f0)({localName:(n=t.ns.localName,r=t.$pkg,_e(r)?(o=n).charAt(0).toLowerCase()+o.slice(1):n)},e);var n,r,o}(this.logNamespaceUsed(e.ns),e)},qe.prototype.nsPropertyTagName=function(e){return function(e,t){return(0,i.f0)({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},qe.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},qe.prototype.nsAttributeName=function(e){var t;if(t=(0,i.HD)(e)?q(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}:(0,i.f0)({localName:t.localName},n)},qe.prototype.parseGeneric=function(e){var t=this,n=this.body,r=[];return(0,i.Ed)(e,(function(o,a){"$body"===a?n.push((new Ke).build({type:"String"},o)):"$children"===a?(0,i.Ed)(o,(function(e){n.push(new qe(t).build(e))})):0!==a.indexOf("$")&&t.parseNsAttribute(e,a,o)&&r.push({name:a,value:o})})),r},qe.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=q(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)}},qe.prototype.parseNsAttributes=function(e,t){var n=this,r=e.$attrs,o=[];return(0,i.Ed)(r,(function(t,i){var r=n.parseNsAttribute(e,i,t);r&&o.push(r)})),o},qe.prototype.parseGenericAttributes=function(e,t){var n=this;(0,i.Ed)(t,(function(t){if(t.name!==Ee)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},qe.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;(0,i.Ed)(e,(function(e){var o=r.get(e.name),a=e.isReference;if(e.isMany||(o=[o]),e.isBody)n.push((new Ke).build(e,o[0]));else if(J(e.type))(0,i.Ed)(o,(function(i){n.push(new Je(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(a)(0,i.Ed)(o,(function(i){n.push(new Ge(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var s=Se(e),c=function(e){return"property"===we(e)}(e);(0,i.Ed)(o,(function(i){var r;r=s?new Xe(t,e):c?new qe(t,e):new qe(t),n.push(r.build(i))}))}}))},qe.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Fe(t):n=t),n},qe.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},qe.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,c=e.uri;if(!s&&!c)return{localName:e.localName};if(r=xe[s]||o&&(o.getPackage(s)||{}).uri,!(c=c||r||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(c))){for(n=s,i=1;a.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:c},r===c)}return s&&a.mapPrefix(s,c),e},qe.prototype.parseAttributes=function(e){var t=this,n=this.element;(0,i.Ed)(e,(function(e){var r=n.get(e.name);if(e.isReference)if(e.isMany){var o=[];(0,i.Ed)(r,(function(e){o.push(e.id)})),r=o.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(e),r)}))},qe.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Ze(e)},qe.prototype.addAttribute=function(e,t){var n=this.attrs;(0,i.HD)(t)&&(t=Ve(t,$e,We));var r=(0,i.cx)(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),o={name:e,value:t};-1!==r?n.splice(r,1,o):n.push(o)},qe.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)),(0,i.Ed)(t,(function(t){e.append(" ").append(Ze(t.name)).append('="').append(t.value).append('"')}))},qe.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Ke;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),(0,i.Ed)(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()},He(Xe,qe),Xe.prototype.parseNsAttributes=function(e){var t=qe.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(Ee),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},Xe.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},tt.prototype=Object.create(ie.prototype),tt.prototype.fromXML=function(e,t,n){(0,i.HD)(t)||(n=t,t="bpmn:Definitions");var r=new Ie((0,i.f0)({model:this,lax:!0},n)),o=r.handler(t);return r.fromXML(e,o)},tt.prototype.toXML=function(e,t){var n=new et(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var nt={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 it(e,t){return new tt((0,i.f0)({},nt,e),t)}var rt=n(658),ot=n(990);function at(e,t){return e.$instanceOf(t)}function st(e,t){var n={},r=[],o={};function a(e,t){return function(n){e(n,t)}}function s(e){n[e.id]=e}function c(n,i){try{var r=o[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:(0,rt.x)(n)}));return e.element(n,o[n.id],i)}(n,i);return s(n),r}catch(e){p(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:(0,rt.x)(n)})),console.error(e)}}function p(t,n){e.error(t,n)}var l=this.registerDi=function(e){var n=e.bpmnElement;n?o[n.id]?p(t("multiple DI elements defined for {element}",{element:(0,rt.x)(n)}),{element:n}):(o[n.id]=e,(0,ot.S)(n)):p(t("no bpmnElement referenced in {element}",{element:(0,rt.x)(e)}),{element:e})};function u(e){l(e)}this.handleDefinitions=function(s,c){var m=s.diagrams;if(c&&-1===m.indexOf(c))throw new Error(t("diagram not part of bpmn:Definitions"));if(!c&&m&&m.length&&(c=m[0]),!c)throw new Error(t("no diagram to display"));o={},function(e){var t;t=e.plane,l(t),(0,i.Ed)(t.planeElement,u)}(c);var v=c.plane;if(!v)throw new Error(t("no plane for {element}",{element:(0,rt.x)(c)}));var g=v.bpmnElement;if(!g){if(g=function(e){return(0,i.sE)(e.rootElements,(function(e){return at(e,"bpmn:Process")||at(e,"bpmn:Collaboration")}))}(s),!g)throw new Error(t("no process or collaboration to display"));p(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:(0,rt.x)(v),rootElement:(0,rt.x)(g)})),v.bpmnElement=g,l(v)}var y,_,x=function(t,n){return e.root(t,o[t.id],n)}(g,v);if(at(g,"bpmn:Process")||at(g,"bpmn:SubProcess"))d(g,x);else{if(!at(g,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:(0,rt.x)(v),rootElement:(0,rt.x)(g)}));y=g,_=x,(0,i.Ed)(y.participants,a(C,_)),b(y.artifacts,_),r.push((function(){!function(e,t){(0,i.Ed)(e,a(f,t))}(y.messageFlows,_)})),function(e,t){(0,i.hX)(e,(function(e){return!n[e.id]&&at(e,"bpmn:Process")&&e.laneSets})).forEach(a(d,t))}(s.rootElements,x)}h(r)};var h=this.handleDeferred=function(){for(;r.length;)r.shift()()};function d(e,t){k(e,t),_(e.ioSpecification,t),b(e.artifacts,t),s(e)}function f(e,t){c(e,t)}function m(e,t){c(e,t)}function v(e,t){c(e,t)}function g(e,t){c(e,t)}function y(e,t){c(e,t)}function b(e,t){(0,i.Ed)(e,(function(e){at(e,"bpmn:Association")?r.push((function(){y(e,t)})):y(e,t)}))}function _(e,t){e&&((0,i.Ed)(e.dataInputs,a(v,t)),(0,i.Ed)(e.dataOutputs,a(g,t)))}var x=this.handleSubProcess=function(e,t){k(e,t),b(e.artifacts,t)};function E(e,t){var n=c(e,t);at(e,"bpmn:SubProcess")&&x(e,n||t),at(e,"bpmn:Activity")&&_(e.ioSpecification,t),r.push((function(){(0,i.Ed)(e.dataInputAssociations,a(m,t)),(0,i.Ed)(e.dataOutputAssociations,a(m,t))}))}function w(e,t){r.push((function(){var n=c(e,t);e.childLaneSet&&S(e.childLaneSet,n||t),function(e){(0,i.Ed)(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function S(e,t){(0,i.Ed)(e.lanes,a(w,t))}function k(e,n){!function(e,n){(0,i.Ed)(e,(function(e){at(e,"bpmn:SequenceFlow")?r.push((function(){!function(e,t){c(e,t)}(e,n)})):at(e,"bpmn:BoundaryEvent")?r.unshift((function(){E(e,n)})):at(e,"bpmn:FlowNode")?E(e,n):at(e,"bpmn:DataObject")||(at(e,"bpmn:DataStoreReference")||at(e,"bpmn:DataObjectReference")?function(e,t){c(e,t)}(e,n):p(t("unrecognized flowElement {element} in context {context}",{element:(0,rt.x)(e),context:n?(0,rt.x)(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){(0,i.Ed)(e,a(S,t))}(e.laneSets,n)}function C(e,t){var n=c(e,t),i=e.processRef;i&&d(i,n||t)}}var ct=n(252);function pt(e,t,n){var r,o,a,s,c=[];function p(e,t){var n=new st({root:function(e,t){return r.add(e,t)},element:function(e,t,n){return r.add(e,t,n)},error:function(e,t){c.push({message:e,context:t})}},a);t=t||e.diagrams&&e.diagrams[0];var o=function(e,t){if(t){var n,r=t.plane.bpmnElement,o=r;(0,ct.is)(r,"bpmn:Process")||(0,ct.is)(r,"bpmn:Collaboration")||(o=function(e){for(var t=e;t;){if((0,ct.is)(t,"bpmn:Process"))return t;t=t.$parent}}(r)),n=(0,ct.is)(o,"bpmn:Collaboration")?o:(0,i.sE)(e.rootElements,(function(e){if((0,ct.is)(e,"bpmn:Collaboration"))return(0,i.sE)(e.participants,(function(e){return e.processRef===o}))}));var a=[o];n&&(a=(0,i.UI)(n.participants,(function(e){return e.processRef}))).push(n);var s=lt(a),c=[t],p=[r];return(0,i.Ed)(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==s.indexOf(t)&&-1===p.indexOf(t)&&(c.push(e),p.push(t))})),c}}(e,t);if(!o)throw new Error(a("no diagram to display"));(0,i.Ed)(o,(function(t){n.handleDefinitions(e,t)}));var p=t.plane.bpmnElement.id;s.setRootElement(s.findRoot(p+"_plane")||s.findRoot(p))}return new Promise((function(i,l){try{return r=e.get("bpmnImporter"),o=e.get("eventBus"),a=e.get("translate"),s=e.get("canvas"),o.fire("import.render.start",{definitions:t}),p(t,n),o.fire("import.render.complete",{error:void 0,warnings:c}),i({warnings:c})}catch(e){return e.warnings=c,l(e)}}))}function lt(e){var t=[];return(0,i.Ed)(e,(function(e){e&&(t.push(e),t=t.concat(lt(e.flowElements)))})),t}var ut,ht='',dt={verticalAlign:"middle"},ft={color:"#404040"},mt={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},vt={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},gt={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"},yt='
'+ht+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
';function bt(e){e=(0,i.f0)({},xt,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=''+ht+"",n=(0,r.H6)(t);(0,r.i5)((0,r.IO)("svg",n),dt),(0,r.i5)(n,ft,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(n),r.B.bind(n,"click",(function(e){ut||(ut=(0,r.H6)(yt),(0,r.i5)(ut,mt),(0,r.i5)((0,r.IO)("svg",ut),dt),(0,r.i5)((0,r.IO)(".backdrop",ut),vt),(0,r.i5)((0,r.IO)(".notice",ut),gt),(0,r.i5)((0,r.IO)(".link",ut),ft,{margin:"15px 20px 15px 10px",alignSelf:"center"}),r.cl.bind(ut,".backdrop","click",(function(e){document.body.removeChild(ut)}))),document.body.appendChild(ut),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function _t(e,t){return e.warnings=t,e}(0,v.Z)(bt,H),bt.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,c=o.warnings,p=o.elementsById;i=i.concat(c),a=this._emit("import.parse.complete",(r={error:null,definitions:a,elementsById:p,references:s,warnings:i},n.get("eventBus").createEvent(r)))||a;const l=await this.importDefinitions(a,t);return i=i.concat(l.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),_t(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]),e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},bt.prototype.importDefinitions=async function(e,t){return this._setDefinitions(e),{warnings:(await this.open(t)).warnings}},bt.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw _t(e,[]),e}if("string"==typeof e&&(n=function(e,t){return t&&(0,i.sE)(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw _t(t,[]),t}try{this.clear()}catch(e){throw _t(e,[]),e}const{warnings:r}=await pt(this,t,n);return{warnings:r}},bt.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},bt.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=(0,r.IO)("defs",t._svg),a=(0,o.db)(n),s=i?""+(0,o.db)(i)+"":"",c=n.getBBox();e='\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n\n'+s+a+""}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},bt.prototype._setDefinitions=function(e){this._definitions=e},bt.prototype.getModules=function(){return this._modules},bt.prototype.clear=function(){this.getDefinitions()&&H.prototype.clear.call(this)},bt.prototype.destroy=function(){H.prototype.destroy.call(this),(0,r.Od)(this._container)},bt.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},bt.prototype.off=function(e,t){this.get("eventBus").off(e,t)},bt.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=(0,r.IO)(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},bt.prototype.getDefinitions=function(){return this._definitions},bt.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},bt.prototype._init=function(e,t,n){const r=n.modules||this.getModules(n),o=n.additionalModules||[],a=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],r,o),s=(0,i.f0)((0,i.CE)(n,["additionalModules"]),{canvas:(0,i.f0)({},n.canvas,{container:e}),modules:a});H.call(this,s),n&&n.container&&this.attachTo(n.container)},bt.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},bt.prototype._createContainer=function(e){const t=(0,r.H6)('
');return(0,r.i5)(t,{width:Et(e.width),height:Et(e.height),position:e.position}),t},bt.prototype._createModdle=function(e){return new it((0,i.f0)({},this._moddleExtensions,e.moddleExtensions))},bt.prototype._modules=[];const xt={width:"100%",height:"100%",position:"relative"};function Et(e){return e+((0,i.hj)(e)?"px":"")}},133:(e,t,n)=>{"use strict";n.d(t,{Z:()=>te});var i=n(66),r=n(398),o=n(858),a=n(517),s=n(507),c=n(252),p=n(230),l=n(312),u=n(674),h=n(487),d=n(168),f=new(n(88).Z),m=.95;function v(e,t,n,i,v,y,b){o.Z.call(this,t,b);var _=e&&e.defaultFillColor,x=e&&e.defaultStrokeColor,E=e&&e.defaultLabelColor,w=f.next(),S={};function k(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:l.Sn,strokeWidth:2,fill:"white"})}function C(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:l.Sn,strokeWidth:2})}function R(e,t){var{ref:n={x:0,y:0},scale:i=1,element:r}=t,o=(0,h.Ue)("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});(0,h.R3)(o,r);var a=(0,u.IO)("defs",v._svg);a||(a=(0,h.Ue)("defs"),(0,h.R3)(v._svg,a)),(0,h.R3)(a,o),S[e]=o}function A(e){return e.replace(/[^0-9a-zA-Z]+/g,"_")}function P(e,t,n){var i=e+"-"+A(t)+"-"+A(n)+"-"+w;return S[i]||function(e,t,n,i){"sequenceflow-end"===t&&R(e,{element:(0,h.Ue)("path",{d:"M 1 5 L 11 10 L 1 15 Z",...k({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5}),"messageflow-start"===t&&R(e,{element:(0,h.Ue)("circle",{cx:6,cy:6,r:3.5,...k({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6}}),"messageflow-end"===t&&R(e,{element:(0,h.Ue)("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...k({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5}}),"association-start"===t&&R(e,{element:(0,h.Ue)("path",{d:"M 11 5 L 1 10 L 11 15",...C({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5}),"association-end"===t&&R(e,{element:(0,h.Ue)("path",{d:"M 1 5 L 11 10 L 1 15",...C({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5}),"conditional-flow-marker"===t&&R(e,{element:(0,h.Ue)("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...k({fill:n,stroke:i})}),ref:{x:-1,y:10},scale:.5}),"conditional-default-flow-marker"===t&&R(e,{element:(0,h.Ue)("path",{d:"M 6 4 L 10 16",...k({stroke:i})}),ref:{x:0,y:10},scale:.5})}(i,e,t,n),"url(#"+i+")"}function T(e,t,n,i,o={}){(0,r.Kn)(i)&&(o=i,i=0),i=i||0,o=k(o);var a=t/2,s=n/2,c=(0,h.Ue)("circle",{cx:a,cy:s,r:Math.round((t+n)/4-i),...o});return(0,h.R3)(e,c),c}function M(e,t,n,i,o,a){(0,r.Kn)(o)&&(a=o,o=0),o=o||0,a=k(a);var s=(0,h.Ue)("rect",{x:o,y:o,width:t-2*o,height:n-2*o,rx:i,ry:i,...a});return(0,h.R3)(e,s),s}function D(e,t,n,i){n=C(n);var r=(0,p.W5)(t,n,i);return(0,h.R3)(e,r),r}function B(e,t,n){return D(e,t,n,5)}function j(e,t,n){n=C(n);var i=(0,h.Ue)("path",{...n,d:t});return(0,h.R3)(e,i),i}function N(e,t,n,i){return j(t,n,(0,r.f0)({"data-marker":e},i))}function O(e){return Q[e]}function L(e){return function(t,n,i){return O(e)(t,n,i)}}function I(e,t,n={}){var r=(0,c.SS)(e),o=(0,l.gT)(r);return r.get("eventDefinitions")&&r.get("eventDefinitions").length>1?r.get("parallelMultiple")?function(e,t,n={}){return j(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{fill:(0,l.$Z)(t,x,n.stroke),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1})}(t,e,n):function(e,t,n={},r){return j(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{fill:r?(0,l.$Z)(t,x,n.stroke):(0,l.W7)(t,_,n.fill),strokeWidth:1})}(t,e,n,o):(0,l.iY)(r,"bpmn:MessageEventDefinition")?function(e,t,n={},r){return j(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{fill:r?(0,l.$Z)(t,x,n.stroke):(0,l.W7)(t,_,n.fill),stroke:r?(0,l.W7)(t,_,n.fill):(0,l.$Z)(t,x,n.stroke),strokeWidth:1})}(t,e,n,o):(0,l.iY)(r,"bpmn:TimerEventDefinition")?function(e,t,n={}){var r=T(e,t.width,t.height,.2*t.height,{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:2});j(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{stroke:(0,l.$Z)(t,x,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;j(e,a,{strokeWidth:1,stroke:(0,l.$Z)(t,x,n.stroke),transform:"rotate("+30*o+","+c+","+s+")"})}return r}(t,e,n):(0,l.iY)(r,"bpmn:ConditionalEventDefinition")?function(e,t,n={}){return j(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1})}(t,e,n):(0,l.iY)(r,"bpmn:SignalEventDefinition")?function(e,t,n={},r){return j(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?(0,l.$Z)(t,x,n.stroke):(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke)})}(t,e,n,o):(0,l.iY)(r,"bpmn:EscalationEventDefinition")?function(e,t,n={},r){return j(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{fill:r?(0,l.$Z)(t,x,n.stroke):(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1})}(t,e,n,o):(0,l.iY)(r,"bpmn:LinkEventDefinition")?function(e,t,n={},r){return j(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?(0,l.$Z)(t,x,n.stroke):(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1})}(t,e,n,o):(0,l.iY)(r,"bpmn:ErrorEventDefinition")?function(e,t,n={},r){return j(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{fill:r?(0,l.$Z)(t,x,n.stroke):(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1})}(t,e,n,o):(0,l.iY)(r,"bpmn:CancelEventDefinition")?function(e,t,n={},r){var o=j(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?(0,l.$Z)(t,x,n.stroke):"none",stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1});return(0,d.U1)(o,45),o}(t,e,n,o):(0,l.iY)(r,"bpmn:CompensateEventDefinition")?function(e,t,n={},r){return j(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{fill:r?(0,l.$Z)(t,x,n.stroke):(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1})}(t,e,n,o):(0,l.iY)(r,"bpmn:TerminateEventDefinition")?function(e,t,n={}){return T(e,t.width,t.height,8,{fill:(0,l.$Z)(t,x,n.stroke),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:4})}(t,e,n):null}var $={ParticipantMultiplicityMarker:function(e,t,n={}){var r=(0,l.dz)(t,n),o=(0,l.Cr)(t,n);N("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:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke)})},SubProcessMarker:function(e,t,n={}){var r=M(e,14,14,0,{strokeWidth:1,fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke)});(0,d.Iu)(r,t.width/2-7.5,t.height-20),N("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:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke)})},ParallelMarker:function(e,t,n){var r=(0,l.dz)(t,n),o=(0,l.Cr)(t,n);N("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:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke)})},SequentialMarker:function(e,t,n){N("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:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke)})},CompensationMarker:function(e,t,n){N("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:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke)})},LoopMarker:function(e,t,n){var r=(0,l.dz)(t,n),o=(0,l.Cr)(t,n);N("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:(0,l.$Z)(t,x,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=(0,l.dz)(t,n),o=(0,l.Cr)(t,n);N("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:(0,l.$Z)(t,x,n.stroke),stroke:(0,l.$Z)(t,x,n.stroke)})}};function z(e,t,n,i){$[e](t,n,i)}function F(e,t,n,i={}){i={fill:i.fill,stroke:i.stroke,width:(0,l.dz)(t,i),height:(0,l.Cr)(t,i)};var o=(0,c.SS)(t),a=n&&n.includes("SubProcessMarker");i=a?{...i,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},(0,r.Ed)(n,(function(n){z(n,e,t,i)})),o.get("isForCompensation")&&z("CompensationMarker",e,t,i),(0,c.is)(o,"bpmn:AdHocSubProcess")&&z("AdhocMarker",e,t,i);var s=o.get("loopCharacteristics"),p=s&&s.get("isSequential");s&&(void 0===p&&z("LoopMarker",e,t,i),!1===p&&z("ParallelMarker",e,t,i),!0===p&&z("SequentialMarker",e,t,i))}function H(e,t,n={}){n=(0,r.f0)({size:{width:100}},n);var i=y.createText(t||"",n);return(0,h.Sh)(i).add("djs-label"),(0,h.R3)(e,i),i}function Z(e,t,n,i={}){var r=(0,c.SS)(t),o=(0,l.zX)({x:t.x,y:t.y,width:t.width,height:t.height},i);return H(e,r.name,{align:n,box:o,padding:7,style:{fill:(0,l.Ou)(t,E,x,i.stroke)}})}function W(e,t,n,i={}){var r=(0,a.wE)(n),o=H(e,t,{box:{height:30,width:r?(0,l.Cr)(n,i):(0,l.dz)(n,i)},align:"center-middle",style:{fill:(0,l.Ou)(n,E,x,i.stroke)}});if(r){var s=-1*(0,l.Cr)(n,i);(0,d.vs)(o,0,-s,270)}}function U(e,t,n={}){var{width:i,height:r}=(0,l.zX)(t,n);return M(e,i,r,10,{...n,fill:(0,l.W7)(t,_,n.fill),fillOpacity:m,stroke:(0,l.$Z)(t,x,n.stroke)})}function V(e,t,n={}){var i=(0,c.SS)(t),r=(0,l.W7)(t,_,n.fill),o=(0,l.$Z)(t,x,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=P("association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=P("association-start",r,o)),n=g(n,["markerStart","markerEnd"]),B(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function G(e,t,n={}){var r=(0,l.W7)(t,_,n.fill),o=(0,l.$Z)(t,x,n.stroke),a=j(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:m,stroke:o}),s=(0,c.SS)(t);return(0,l.uZ)(s)&&j(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}),a}function K(e,t,n={}){return T(e,t.width,t.height,{fillOpacity:m,...n,fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke)})}function J(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=k(i);var s=(0,h.Ue)("polygon",{...i,points:a});return(0,h.R3)(e,s),s}(e,t.width,t.height,{fill:(0,l.W7)(t,_,n.fill),fillOpacity:m,stroke:(0,l.$Z)(t,x,n.stroke)})}function q(e,t,n={}){var i=M(e,(0,l.dz)(t,n),(0,l.Cr)(t,n),0,{fill:(0,l.W7)(t,_,n.fill),fillOpacity:n.fillOpacity||m,stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1.5}),r=(0,c.SS)(t);return(0,c.is)(r,"bpmn:Lane")&&W(e,r.get("name"),t,n),i}function X(e,t,n={}){var i=U(e,t,n);(0,a.J5)(t)&&(0,h.Lj)(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var r=(0,a.ul)(t);return Z(e,t,r?"center-top":"center-middle",n),F(e,t,r?void 0:["SubProcessMarker"],n),i}function Y(e,t,n={}){var i=U(e,t,n);return Z(e,t,"center-middle",n),F(e,t,void 0,n),i}var Q=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return X(e,t,n=(0,a.ul)(t)?g(n,["fill","stroke","width","height"]):g(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return V(e,t,n=g(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=g(n,["fill","stroke"]);var r=(0,c.SS)(t).get("cancelActivity");n={strokeWidth:1.5,fill:(0,l.W7)(t,_,n.fill),fillOpacity:1,stroke:(0,l.$Z)(t,x,n.stroke)},r||(n.strokeDasharray="6");var o=K(e,t,n);return T(e,t.width,t.height,3,{...n,fill:"none"}),i&&I(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=Y(e,t,n=g(n,["fill","stroke"])),o=j(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}));(0,h.Lj)(o,{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1});var a=j(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}));return(0,h.Lj)(a,{fill:(0,l.$Z)(t,x,n.stroke),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=g(n,["fill","stroke"]),X(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=J(e,t,n=g(n,["fill","stroke"]));return j(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:(0,l.$Z)(t,x,n.stroke),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=g(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=G(e,t,n);return j(e,r,{fill:"none",stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=g(n,["fill","stroke"]),V(e,t,{...n,markerEnd:P("association-end",(0,l.W7)(t,_,n.fill),(0,l.$Z)(t,x,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return G(e,t,n=g(n,["fill","stroke"]))},"bpmn:DataObjectReference":L("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=g(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=G(e,t,n);return j(e,r,{strokeWidth:1,fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=g(n,["fill","stroke"]),V(e,t,{...n,markerEnd:P("association-end",(0,l.W7)(t,_,n.fill),(0,l.$Z)(t,x,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=g(n,["fill","stroke"]),j(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:(0,l.W7)(t,_,n.fill),fillOpacity:m,stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=g(n,["fill","stroke"]);var r=K(e,t,{...n,strokeWidth:4});return i&&I(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=g(n,["fill","stroke"]);var r=(0,c.SS)(t),o=J(e,t,n);T(e,t.width,t.height,.2*t.height,{fill:(0,l.W7)(t,"none",n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1});var a=r.get("eventGatewayType"),s=!!r.get("instantiate");if("Parallel"===a){var p=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});j(e,p,{fill:"none",stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1})}else"Exclusive"===a&&(s||T(e,t.width,t.height,.26*t.height,{fill:"none",stroke:(0,l.$Z)(t,x,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}});j(e,r,{fill:"none",stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=J(e,t,n=g(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return(0,c.DN)(t).get("isMarkerVisible")&&j(e,o,{fill:(0,l.$Z)(t,x,n.stroke),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return J(e,t,n=g(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=g(n,["fill","stroke","width","height"]),M(e,t.width,t.height,10,{stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:(0,l.dz)(t,n),height:(0,l.Cr)(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=J(e,t,n=g(n,["fill","stroke"]));return T(e,t.width,t.height,.24*t.height,{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=g(n,["fill","stroke"]);var r=K(e,t,{...n,strokeWidth:1.5});return T(e,t.width,t.height,3,{fill:"none",stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1.5}),i&&I(t,e,n),r},"bpmn:IntermediateCatchEvent":L("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":L("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=g(n,["fill","stroke","width","height"]),q(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=Y(e,t,n=g(n,["fill","stroke"]));return j(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=g(n,["fill","stroke"]);var r=(0,c.SS)(t),o=(0,c.DN)(t),a=(0,l.W7)(t,_,n.fill),s=(0,l.$Z)(t,x,n.stroke),p=B(e,t.waypoints,{markerEnd:P("messageflow-end",a,s),markerStart:P("messageflow-start",a,s),stroke:s,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=p.getPointAtLength(p.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),f={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(f.fill=a,f.stroke=s):(f.fill=s,f.stroke=a);var m=j(e,h,f),v=H(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:s}}),y=m.getBBox(),b=v.getBBox(),E=u.x-b.width/2,w=u.y+y.height/2+10;(0,d.vs)(v,E,w,0)}return p},"bpmn:ParallelGateway":function(e,t,n={}){var r=J(e,t,n=g(n,["fill","stroke"]));return j(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:(0,l.$Z)(t,x,n.stroke),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=q(e,t,n=g(n,["fill","stroke","width","height"])),r=(0,a.ul)(t),o=(0,a.wE)(t),s=(0,c.SS)(t),p=s.get("name");if(r)D(e,o?[{x:30,y:0},{x:30,y:(0,l.Cr)(t,n)}]:[{x:0,y:30},{x:(0,l.dz)(t,n),y:30}],{stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1.5}),W(e,p,t,n);else{var u=(0,l.zX)(t,n);o||(u.height=(0,l.dz)(t,n),u.width=(0,l.Cr)(t,n));var h=H(e,p,{box:u,align:"center-middle",style:{fill:(0,l.Ou)(t,E,x,n.stroke)}});if(!o){var f=-1*(0,l.Cr)(t,n);(0,d.vs)(h,0,-f,270)}}return s.get("participantMultiplicity")&&z("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=g(n,["fill","stroke"]);var r,o=(0,c.SS)(t),a=Y(e,t,n);return o.get("instantiate")?(T(e,28,28,4.4,{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,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}}),j(e,r,{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){var r=Y(e,t,n=g(n,["fill","stroke"]));return j(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=Y(e,t,n=g(n,["fill","stroke"]));return j(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:(0,l.$Z)(t,x,n.stroke),stroke:(0,l.W7)(t,_,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=g(n,["fill","stroke"]);var i=(0,l.W7)(t,_,n.fill),r=(0,l.$Z)(t,x,n.stroke),o=B(e,t.waypoints,{markerEnd:P("sequenceflow-end",i,r),stroke:r}),a=(0,c.SS)(t),{source:s}=t;if(s){var p=(0,c.SS)(s);a.get("conditionExpression")&&(0,c.is)(p,"bpmn:Activity")&&(0,h.Lj)(o,{markerStart:P("conditional-flow-marker",i,r)}),p.get("default")&&((0,c.is)(p,"bpmn:Gateway")||(0,c.is)(p,"bpmn:Activity"))&&p.get("default")===a&&(0,h.Lj)(o,{markerStart:P("conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=Y(e,t,n=g(n,["fill","stroke"]));return T(e,10,10,{fill:(0,l.W7)(t,_,n.fill),stroke:"none",transform:"translate(6, 6)"}),j(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1}),T(e,10,10,{fill:(0,l.W7)(t,_,n.fill),stroke:"none",transform:"translate(11, 10)"}),j(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=g(n,["fill","stroke"]),(0,c.SS)(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=K(e,t,n);return i&&I(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return X(e,t,n=(0,a.ul)(t)?g(n,["fill","stroke","width","height"]):g(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return Y(e,t,n=g(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=g(n,["fill","stroke","width","height"]);var{width:r,height:o}=(0,l.zX)(t,n),a=M(e,r,o,0,0,{fill:"none",stroke:"none"});return j(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:(0,l.$Z)(t,x,n.stroke)}),H(e,(0,c.SS)(t).get("text")||"",{align:"left-top",box:(0,l.zX)(t,n),padding:7,style:{fill:(0,l.Ou)(t,E,x,n.stroke)}}),a},"bpmn:Transaction":function(e,t,i={}){i=(0,a.ul)(t)?g(i,["fill","stroke","width","height"]):g(i,["fill","stroke"]);var r=X(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:(0,l.$Z)(t,x,i.stroke),strokeWidth:1.5});return(0,a.ul)(t)||(i={}),M(e,(0,l.dz)(t,i),(0,l.Cr)(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=Y(e,t,n=g(n,["fill","stroke"]));return j(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:.5}),j(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:(0,l.W7)(t,_,n.fill),stroke:(0,l.$Z)(t,x,n.stroke),strokeWidth:.5}),j(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:(0,l.$Z)(t,x,n.stroke),stroke:(0,l.$Z)(t,x,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 H(e,(0,s.id)(t),{box:i,fitBox:!0,style:(0,r.f0)({},y.getExternalStyle(),{fill:(0,l.Ou)(t,E,x,n.stroke)})})}(e,t,n)}};this._drawPath=j,this._renderer=O}function g(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}(0,i.Z)(v,o.Z),v.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],v.prototype.canRender=function(e){return(0,c.is)(e,"bpmn:BaseElement")},v.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},v.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},v.prototype.getShapePath=function(e){return(0,c.is)(e,"bpmn:Event")?(0,l.iu)(e):(0,c.is)(e,"bpmn:Activity")?(0,l.H)(e,10):(0,c.is)(e,"bpmn:Gateway")?(0,l.j3)(e):(0,l.lr)(e)};var y=0,b={width:150,height:50};function _(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 x(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=_(o,n)).width=o?i.width:0," "===o||""===o||i.width1)for(;n=i.shift();){if(!(n.length+oe?t.width:e}),0),y=a.top;"middle"===o.vertical&&(y+=(n.height-v)/2),y-=(c||l[0].height)/4;var b=(0,h.Ue)("text");return(0,h.Lj)(b,i),(0,r.Ed)(l,(function(e){var t;switch(y+=c||e.height,o.horizontal){case"left":t=a.left;break;case"right":t=(s?g:d)-a.right-e.width;break;default:t=Math.max(((s?g:d)-e.width)/2+a.left,0)}var n=(0,h.Ue)("tspan");(0,h.Lj)(n,{x:t,y}),n.textContent=e.text,(0,h.R3)(b,n)})),(0,h.Od)(f),{dimensions:{width:g,height:v},element:b}},C.$inject=["config.textRenderer"];var R=/\{([^{}]+)\}/g,A=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const P={__init__:["bpmnRenderer"],bpmnRenderer:["type",v],textRenderer:["type",C],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o,a,s={};if(t.position){for(var c=t.containerHeight/r.height*t.yScaleFactor,p=t.containerWidth/r.width*t.xScaleFactor,l=0;l=p.x&&u<=p.x+p.width&&h>=p.y&&h<=p.y+p.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!(0,c.is)(t,"bpmndi:BPMNEdge"))throw new Error(d("unknown di {di} for element {semantic}",{di:(0,D.x)(t),semantic:(0,D.x)(e)}));var y=this._getSource(e),b=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(B(e,t,{hidden:r,source:y,target:b,waypoints:j(t,y,b)})),(0,c.is)(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return(0,s.ly)(e)&&(0,s.id)(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},O.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:(0,D.x)(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw N(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},O.prototype.addLabel=function(e,t,n){var i,r,o;return i=(0,s.lq)(t,n),(r=(0,s.id)(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(B(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!(0,s.id)(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)},O.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?N(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:(0,D.x)(e),side:t}))},O.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},O.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},O.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};const L={__depends__:[P,{__depends__:[T.Z],bpmnImporter:["type",O]}]};var I=n(945),$=n(832),z=n(448),F=n(594);function H(e,t){t.invoke(F.Z,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)}))}(0,i.Z)(H,F.Z),H.$inject=["canvas","injector"];const Z={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",H]};var W=n(670),U=n(826);function V(e,t,n){var i=(0,u.H6)('
    '),o=n.getContainer(),a=(0,u.Sh)(o);o.appendChild(i);var s=[];function p(e){e&&(s=function(e){for(var t=[],n=(0,c.SS)(e);n;n=n.$parent)((0,c.is)(n,"bpmn:SubProcess")||(0,c.is)(n,"bpmn:Process"))&&t.push(n);return t.reverse()}(e));var r=s.map((function(e){var i=(0,W.r)(e.name||e.id),r=(0,u.H6)('
  • '+i+"
  • "),o=n.findRoot((0,U.sU)(e))||n.findRoot(e.id);if(!o&&(0,c.is)(e,"bpmn:Process")){var a=t.find((function(t){var n=(0,c.SS)(t);return n&&n.get("processRef")&&n.get("processRef")===e}));o=n.findRoot(a.id)}return r.addEventListener("click",(function(){n.setRootElement(o)})),r}));i.innerHTML="";var o=r.length>1;a.toggle("bjs-breadcrumbs-shown",o),r.forEach((function(e){i.appendChild(e)}))}e.on("element.changed",(function(e){var t=e.element,n=(0,c.SS)(t);(0,r.sE)(s,(function(e){return e===n}))&&p()})),e.on("root.set",(function(e){p(e.element)}))}function G(e,t){var n=null,i=new K;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,!(0,c.is)(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,p=(o.y-a.y)*o.scale;0===s&&0===p||t.scroll({dx:s,dy:p}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function K(){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)}}V.$inject=["eventBus","elementRegistry","canvas"],G.$inject=["eventBus","canvas"];function J(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 q(e){return(0,c.is)(e,"bpmndi:BPMNDiagram")?e:q(e.$parent)}J.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t._createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},J.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;(0,c.is)(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;return!(!(0,c.is)(n,"bpmn:SubProcess")||n===t.bpmnElement)&&!(0,c.JZ)(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"])}(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},J.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=(0,M.JA)(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),(0,M.z_)(t)}(e),i=n.x-180,r=n.y-160;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)}))},J.prototype._moveToDiPlane=function(e,t){var n=q(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},J.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},J.$inject=["eventBus","moddle"];var X=250;function Y(e,t,n,i){F.Z.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",X,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",X,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],X,(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"],X,(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)}))}))}(0,i.Z)(Y,F.Z),Y.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Y.prototype._canDrillDown=function(e){var t=this._canvas;return(0,c.is)(e,"bpmn:SubProcess")&&t.findRoot((0,U.sU)(e))},Y.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=(0,c.SS)(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;(0,u.Sh)(i.html).toggle("bjs-drilldown-empty",!r)}},Y.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=(0,u.H6)('');i.addEventListener("click",(function(){t.setRootElement(t.findRoot((0,U.sU)(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},Y.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Y.$inject=["canvas","eventBus","elementRegistry","overlays"];const Q={__depends__:[$.Z,z.Z,Z],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",V],drilldownCentering:["type",G],drilldownOverlayBehavior:["type",Y],subprocessCompatibility:["type",J]};var ee=n(907);function te(e){ee.Z.call(this,e)}(0,i.Z)(te,ee.Z),te.prototype._modules=[L,T.Z,I.Z,$.Z,Q],te.prototype._moddleExtensions={}},312:(e,t,n)=>{"use strict";n.d(t,{$Z:()=>h,Cr:()=>_,H:()=>m,Ou:()=>d,Sn:()=>a,W7:()=>u,dz:()=>b,gT:()=>p,iY:()=>c,iu:()=>f,j3:()=>v,lr:()=>g,uZ:()=>l,zX:()=>y});var i=n(398),r=n(252),o=n(230),a="hsl(225, 10%, 15%)",s="white";function c(e,t){return(0,i.G)(e.eventDefinitions,(function(e){return e.$type===t}))}function p(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}function l(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function u(e,t,n){var i=(0,r.DN)(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||s}function h(e,t,n){var i=(0,r.DN)(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||a}function d(e,t,n,i){var o=(0,r.DN)(e).get("label");return i||o&&o.get("color:color")||t||h(e,n)}function f(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2,r=[["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]];return(0,o.KO)(r)}function m(e,t){var n=e.x,i=e.y,r=e.width,a=e.height,s=[["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,a-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-a],["a",t,t,0,0,1,t,-t],["z"]];return(0,o.KO)(s)}function v(e){var t=e.width/2,n=e.height/2,i=[["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]];return(0,o.KO)(i)}function g(e){var t=e.x,n=e.y,i=e.width,r=[["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]];return(0,o.KO)(r)}function y(e,t={}){return{width:b(e,t),height:_(e,t)}}function b(e,t={}){return(0,i.e$)(t,"width")?t.width:e.width}function _(e,t={}){return(0,i.e$)(t,"height")?t.height:e.height}},658:(e,t,n)=>{"use strict";function i(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}n.d(t,{x:()=>i})},990:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var i=n(398),r="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 o(e){(0,i.e$)(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(r)}})}},517:(e,t,n)=>{"use strict";n.d(t,{J5:()=>c,JG:()=>p,_Z:()=>h,sm:()=>l,ul:()=>o,wE:()=>a,wQ:()=>u,yU:()=>s});var i=n(252),r=n(398);function o(e,t){return!(0,i.is)(e,"bpmn:CallActivity")&&((0,i.is)(e,"bpmn:SubProcess")?!(!(t=t||(0,i.DN)(e))||!(0,i.is)(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!(0,i.is)(e,"bpmn:Participant")||!!(0,i.SS)(e).processRef)}function a(e){if((0,i.is)(e,"bpmn:Participant")||(0,i.is)(e,"bpmn:Lane")){var t=(0,i.DN)(e).isHorizontal;return void 0===t||t}}function s(e){return e&&!1!==(0,i.SS)(e).isInterrupting}function c(e){return e&&!!(0,i.SS)(e).triggeredByEvent}function p(e,t){var n=(0,i.SS)(e).eventDefinitions;return(0,r.G)(n,(function(e){return(0,i.is)(e,t)}))}function l(e){return p(e,"bpmn:ErrorEventDefinition")}function u(e){return p(e,"bpmn:EscalationEventDefinition")}function h(e){return p(e,"bpmn:CompensateEventDefinition")}},826:(e,t,n)=>{"use strict";n.d(t,{Ln:()=>o,UK:()=>s,k3:()=>c,sU:()=>a});var i=n(252),r="_plane";function o(e){return e.id.replace(new RegExp(r+"$"),"")}function a(e){var t=e.id;return(0,i.is)(e,"bpmn:SubProcess")?p(t):t}function s(e){return p(e)}function c(e){var t=(0,i.DN)(e);return(0,i.is)(t,"bpmndi:BPMNPlane")}function p(e){return e+r}},507:(e,t,n)=>{"use strict";n.d(t,{DN:()=>a,fF:()=>p,id:()=>d,l6:()=>f,lq:()=>u,ly:()=>c,qe:()=>l});var i=n(398),r=n(252),o=n(384),a={width:90,height:20},s=15;function c(e){return(0,r.is)(e,"bpmn:Event")||(0,r.is)(e,"bpmn:Gateway")||(0,r.is)(e,"bpmn:DataStoreReference")||(0,r.is)(e,"bpmn:DataObjectReference")||(0,r.is)(e,"bpmn:DataInput")||(0,r.is)(e,"bpmn:DataOutput")||(0,r.is)(e,"bpmn:SequenceFlow")||(0,r.is)(e,"bpmn:MessageFlow")||(0,r.is)(e,"bpmn:Group")}function p(e){return(0,o.j_)(e.label)}function l(e){return e.waypoints?(t=e.waypoints,n=t.length/2-1,i=t[Math.floor(n)],o=t[Math.ceil(n+.01)],c=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}}(t),p=Math.atan((o.y-i.y)/(o.x-i.x)),l=c.x,u=c.y,Math.abs(p){"use strict";n.d(t,{DN:()=>s,JZ:()=>o,SS:()=>a,is:()=>r});var i=n(398);function r(e,t){var n=a(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function o(e,t){return(0,i.G)(t,(function(t){return r(e,t)}))}function a(e){return e&&e.businessObject||e}function s(e){return e&&e.di}},594:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(398);function r(e){this._eventBus=e}function o(e){return function(t,n,r,o,a){((0,i.mf)(t)||(0,i.hj)(t))&&(a=o,o=r,r=n,n=t,t=null),this.on(t,e,n,r,o,a)}}r.$inject=["eventBus"],r.prototype.on=function(e,t,n,r,o,a){if(((0,i.mf)(t)||(0,i.hj)(t))&&(a=o,o=r,r=n,n=t,t=null),(0,i.mf)(n)&&(a=o,o=r,r=n,n=1e3),(0,i.Kn)(o)&&(a=o,o=!1),!(0,i.mf)(r))throw new Error("handlerFn must be a function");(0,i.kJ)(e)||(e=[e]);var s=this._eventBus;(0,i.Ed)(e,(function(e){var i=["commandStack",e,t].filter((function(e){return e})).join(".");s.on(i,n,o?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(r,a):r,a)}))},r.prototype.canExecute=o("canExecute"),r.prototype.preExecute=o("preExecute"),r.prototype.preExecuted=o("preExecuted"),r.prototype.execute=o("execute"),r.prototype.executed=o("executed"),r.prototype.postExecute=o("postExecute"),r.prototype.postExecuted=o("postExecuted"),r.prototype.revert=o("revert"),r.prototype.reverted=o("reverted")},149:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(311),r=n(398);function o(){this._uid=12}o.prototype.createRoot=function(e){return this.create("root",e)},o.prototype.createLabel=function(e){return this.create("label",e)},o.prototype.createShape=function(e){return this.create("shape",e)},o.prototype.createConnection=function(e){return this.create("connection",e)},o.prototype.create=function(e,t){return(t=(0,r.f0)({},t||{})).id||(t.id=e+"_"+this._uid++),(0,i.U)(e,t)}},858:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=1e3;function r(e,t){var n=this;t=t||i,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)}))}r.prototype.canRender=function(e){},r.prototype.drawShape=function(e,t){},r.prototype.drawConnection=function(e,t){},r.prototype.getShapePath=function(e){},r.prototype.getConnectionPath=function(e){}},448:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(490);function r(e,t,n,r){e.on("element.changed",(function(r){var o=r.element;(o.parent||o===t.getRootElement())&&(r.gfx=n.getGraphics(o)),r.gfx&&e.fire((0,i.oL)(o)+".changed",r)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),r.updateContainments(n)})),e.on("shape.changed",(function(e){r.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){r.update("connection",e.element,e.gfx)}))}r.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const o={__init__:["changeSupport"],changeSupport:["type",r]}},111:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i=n(398),r=n(674),o=n(470),a=n(487),s=n(230);function c(e){return!0}function p(e){return(0,o.Id)(e)||(0,o.L7)(e)}function l(e,t,n){var l=this;function u(n,i,r){var a,s;(function(e,t){return!(m[e]||o.Id)(t)})(n,i)||(r?s=t.getGraphics(r):(a=i.delegateTarget||i.target)&&(s=a,r=t.get(s)),s&&r&&!1===e.fire(n,{element:r,gfx:s,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var h={};function d(e){return h[e]}var f={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},m={"element.contextmenu":c,"element.mousedown":p,"element.mouseup":p,"element.click":p,"element.dblclick":p};function v(e,t,n,i){var o=h[n]=function(e){u(n,e)};i&&(m[n]=i),o.$delegate=r.cl.bind(e,"svg, .djs-element",t,o)}function g(e,t,n){var i=d(n);i&&r.cl.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,(0,i.Ed)(f,(function(e,n){g(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,(0,i.Ed)(f,(function(e,n){v(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;l.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;l.updateDefaultHit(t,n)}));var y=x("djs-hit djs-hit-stroke"),b=x("djs-hit djs-hit-click-stroke"),_={all:x("djs-hit djs-hit-all"),"click-stroke":b,stroke:y,"no-move":x("djs-hit djs-hit-no-move")};function x(e,t){return t=(0,i.f0)({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function E(e,t){var n=_[t];if(!n)throw new Error("invalid hit type <"+t+">");return(0,a.Lj)(e,n),e}function w(e,t){(0,a.R3)(e,t)}this.removeHits=function(e){var t=(0,r.Kt)(".djs-hit",e);(0,i.Ed)(t,a.Od)},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=(0,s.W5)(t);return E(n,"stroke"),w(e,n),n},this.createBoxHit=function(e,t,n){n=(0,i.f0)({x:0,y:0},n);var r=(0,a.Ue)("rect");return E(r,t),(0,a.Lj)(r,n),w(e,r),r},this.updateDefaultHit=function(e,t){var n=(0,r.IO)(".djs-hit",t);if(n)return e.waypoints?(0,s.cq)(n,e.waypoints):(0,a.Lj)(n,{width:e.width,height:e.height}),n},this.fire=u,this.triggerMouseEvent=function(e,t,n){var i=f[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return u(i,t,n)},this.mouseHandler=d,this.registerEvent=v,this.unregisterEvent=g}l.$inject=["eventBus","elementRegistry","styles"];const u={__init__:["interactionEvents"],interactionEvents:["type",l]}},797:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(490),r=n(487),o=n(674),a=n(398);function s(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function s(e){var t=(0,r.Ue)("rect");return(0,r.Lj)(t,(0,a.f0)({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,a=(0,o.IO)(".djs-outline",n);a||(a=i.getOutline(t)||s(),(0,r.R3)(n,a)),i.updateShapeOutline(a,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,a=(0,o.IO)(".djs-outline",n);a||(a=s(),(0,r.R3)(n,a)),i.updateConnectionOutline(a,t)}))}s.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&(0,a.Ed)(i,(function(i){n=n||i.updateOutline(t,e)})),n||(0,r.Lj)(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},s.prototype.updateConnectionOutline=function(e,t){var n=(0,i.jY)(t);(0,r.Lj)(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},s.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,(function(e){e.providers.push(t)}))},s.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},s.prototype.getOutline=function(e){var t,n=this._getProviders();return(0,a.Ed)(n,(function(n){(0,a.mf)(n.getOutline)&&(t=t||n.getOutline(e))})),t},s.$inject=["eventBus","styles","elementRegistry"];const c={__init__:["outline"],outline:["type",s]}},832:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i=n(398),r=n(674),o=n(490),a=new(n(237).Z)("ov");function s(e,t,n,o){var s,c;this._eventBus=t,this._canvas=n,this._elementRegistry=o,this._ids=a,this._overlayDefaults=(0,i.f0)({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(s=n.getContainer(),c=(0,r.H6)('
    '),(0,r.i5)(c,{position:"absolute",width:0,height:0}),s.insertBefore(c,s.firstChild),c),this._init()}function c(e,t,n){(0,r.i5)(e,{left:t+"px",top:n+"px"})}function p(e,t){e.style.display=!1===t?"none":""}function l(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}s.$inject=["config.overlays","eventBus","canvas","elementRegistry"],s.prototype.get=function(e){if((0,i.HD)(e)&&(e={id:e}),(0,i.HD)(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?(0,i.hX)(t.overlays,(0,i.KQ)({type:e.type})):t.overlays.slice():[]}return e.type?(0,i.hX)(this._overlays,(0,i.KQ)({type:e.type})):e.id?this._overlays[e.id]:null},s.prototype.add=function(e,t,n){if((0,i.Kn)(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 r=this._ids.next();return n=(0,i.f0)({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},s.prototype.remove=function(e){var t=this.get(e)||[];(0,i.kJ)(t)||(t=[t]);var n=this;(0,i.Ed)(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&((0,r.Od)(e.html),(0,r.Od)(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)}}))},s.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},s.prototype.show=function(){p(this._overlayRoot)},s.prototype.hide=function(){p(this._overlayRoot,!1)},s.prototype.clear=function(){this._overlays={},this._overlayContainers=[],(0,r.ZH)(this._overlayRoot)},s.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,a=t.y;if(t.waypoints){var s=(0,o.jY)(t);i=s.x,a=s.y}c(n,i,a),(0,r.Lj)(e.html,"data-container-id",t.id)},s.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,a=e.element,s=i.left,p=i.top;void 0!==i.right&&(t=a.waypoints?(0,o.jY)(a).width:a.width,s=-1*i.right+t),void 0!==i.bottom&&(n=a.waypoints?(0,o.jY)(a).height:a.height,p=-1*i.bottom+n),c(r,s||0,p||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},s.prototype._createOverlayContainer=function(e){var t=(0,r.H6)('
    ');(0,r.i5)(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},s.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";l(this._overlayRoot,n)},s.prototype._getOverlayContainer=function(e,t){var n=(0,i.sE)(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},s.prototype._addOverlay=function(e){var t,n,o=e.id,a=e.element,s=e.html;s.get&&s.constructor.prototype.jquery&&(s=s.get(0)),(0,i.HD)(s)&&(s=(0,r.H6)(s)),n=this._getOverlayContainer(a),t=(0,r.H6)('
    '),(0,r.i5)(t,{position:"absolute"}),t.appendChild(s),e.type&&(0,r.Sh)(t).add("djs-overlay-"+e.type),p(t,this._canvas.findRoot(a)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[o]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},s.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),o=n&&n.minZoom,a=n&&n.maxZoom,s=e.htmlContainer,c=!0;(r!==this._canvas.getRootElement()||n&&((0,i.$K)(o)&&o>t.scale||(0,i.$K)(a)&&ar&&(o=(1/t.scale||1)*r)),(0,i.$K)(o)&&(c="scale("+o+","+o+")"),l(s,c)},s.prototype._updateOverlaysVisibilty=function(e){var t=this;(0,i.Ed)(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},s.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,o=t.get({element:n});(0,i.Ed)(o,(function(e){t.remove(e.id)}));var a=t._getOverlayContainer(n);if(a){(0,r.Od)(a.html);var s=t._overlayContainers.indexOf(a);-1!==s&&t._overlayContainers.splice(s,1)}})),e.on("element.changed",500,(function(e){var n=e.element,r=t._getOverlayContainer(n,!0);r&&((0,i.Ed)(r.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(r))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&(0,r.Sh)(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};const u={__init__:["overlays"],overlays:["type",s]}},945:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var i=n(111),r=n(797),o=n(398);function a(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)}))}a.$inject=["eventBus","canvas"],a.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})}},a.prototype.get=function(){return this._selectedElements},a.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},a.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();(0,o.kJ)(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?(0,o.Ed)(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 s=n(487),c=n(490),p="hover",l="selected";function u(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function a(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,p)})),t.on("element.out",(function(e){a(e.element,p)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;(0,o.Ed)(t,(function(e){-1===n.indexOf(e)&&a(e,l)})),(0,o.Ed)(n,(function(e){-1===t.indexOf(e)&&r(e,l)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}u.$inject=["canvas","eventBus","selection"],u.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");(0,s.ZH)(t);var n=e.length>1,i=this._canvas.getContainer();if((0,s.Sh)(i)[n?"add":"remove"]("djs-multi-select"),n){var r=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}((0,c.jY)(e)),a=(0,s.Ue)("rect");(0,s.Lj)(a,(0,o.f0)({rx:3},r)),(0,s.Sh)(a).add("djs-selection-outline"),(0,s.R3)(t,a)}};var h=n(470);function d(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;(0,o.kJ)(a)?t.select(a):t.select(r.filter(f))}})),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);(0,o.sE)(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if((0,h.Id)(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=(0,h.RJ)(e)||(0,h.Dw)(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function f(e){return!e.hidden}d.$inject=["eventBus","selection","canvas","elementRegistry"];const m={__init__:["selectionVisuals","selectionBehavior"],__depends__:[i.Z,r.Z],selection:["type",a],selectionVisuals:["type",u],selectionBehavior:["type",d]}},805:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]}},935:(e,t,n)=>{"use strict";n.d(t,{Hz:()=>d,JA:()=>p,Re:()=>f,T8:()=>h,aR:()=>s,ex:()=>c,wS:()=>u,z_:()=>l});var i=n(398),r=n(349),o=n(686),a=n(384);function s(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function c(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function p(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function l(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function u(e){return(0,a.Ho)(e)?function(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],c=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:c,endLength:c+p,length:p})}return e}),[]),i=n.reduce((function(e,t){return e+t.length}),0)/2,r=0,o=n[r];o.endLength=o.right,c=r.top-n.y>=o.bottom,l=a?"top":c?"bottom":null,u=r.right+n.x<=o.left?"left":s?"right":null;return u&&l?l+"-"+u:u||l||"intersect"}function d(e,t,n){var a,s,p=(a=e,s=t,(0,o.Z)(a,s));return 1===p.length||2===p.length&&(0,r.tW)(p[0],p[1])<1?c(p[0]):p.length>1?c((p=(0,i.MR)(p,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})))[n?0:p.length-1]):null}function f(e){e=e.slice();for(var t,n,i,o=0;e[o];)t=e[o],n=e[o-1],i=e[o+1],0===(0,r.tW)(t,i)||(0,r.ZS)(n,i,t)?e.splice(o,1):o++;return e}},311:(e,t,n)=>{"use strict";n.d(t,{U:()=>y,g:()=>b});var i=n(398),r=n(66);function o(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 a(e,t){if(!(this instanceof a))return new a(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}a.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?o(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)},a.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||o(this,t,e),n},a.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},a.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},a.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var s=new a({name:"children",enumerable:!0,collection:!0},{name:"parent"}),c=new a({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),p=new a({name:"attachers",collection:!0},{name:"host"}),l=new a({name:"outgoing",collection:!0},{name:"source"}),u=new a({name:"incoming",collection:!0},{name:"target"});function h(){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)}}),s.bind(this,"parent"),c.bind(this,"labels"),l.bind(this,"outgoing"),u.bind(this,"incoming")}function d(){h.call(this),s.bind(this,"children"),p.bind(this,"host"),p.bind(this,"attachers")}function f(){h.call(this),s.bind(this,"children")}function m(){d.call(this),c.bind(this,"labelTarget")}function v(){h.call(this),l.bind(this,"source"),u.bind(this,"target")}(0,r.Z)(d,h),(0,r.Z)(f,d),(0,r.Z)(m,d),(0,r.Z)(v,h);var g={connection:v,shape:d,label:m,root:f};function y(e,t){var n=g[e];if(!n)throw new Error("unknown type: <"+e+">");return(0,i.f0)(new n,t)}function b(e){return e instanceof h}},892:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var i=n(422),r=n(53),o=n(419),a=n(674),s=n(752);function c(e,t){var n;function c(a){var c,p=n.start,l=n.button,u=(0,s.jt)(a),h=(0,o.p)(u,p);if(!n.dragging&&(c=h,Math.sqrt(Math.pow(c.x,2)+Math.pow(c.y,2))>15)&&(n.dragging=!0,0===l&&(0,r.N)(e),(0,i.t8)("grab")),n.dragging){var d=n.last||n.start;h=(0,o.p)(u,d),t.scroll({dx:h.x,dy:h.y}),n.last=u}a.preventDefault()}function p(e){a.B.unbind(document,"mousemove",c),a.B.unbind(document,"mouseup",p),n=null,(0,i.zN)()}e.on("element.mousedown",500,(function(e){return function(e){if(!(0,a.oq)(e.target,".djs-draggable")){var t=e.button;if(!(t>=2||e.ctrlKey||e.shiftKey||e.altKey))return n={button:t,start:(0,s.jt)(e)},a.B.bind(document,"mousemove",c),a.B.bind(document,"mouseup",p),!0}}(e.originalEvent)})),this.isActive=function(){return!!n}}c.$inject=["eventBus","canvas"];const p={__init__:["moveCanvas"],moveCanvas:["type",c]}},728:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i=n(674);function r(e){return Math.log(e)/Math.log(10)}function o(e,t){var n=r(e.min),i=r(e.max);return(Math.abs(n)+Math.abs(i))/t}var a=n(640),s=n(398),c=Math.sign||function(e){return e>=0?1:-1},p={min:.2,max:4};function l(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=(0,s.ak)(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}l.$inject=["config.zoomScroll","eventBus","canvas"],l.prototype.scroll=function(e){this._canvas.scroll(e)},l.prototype.reset=function(){this._canvas.zoom("fit-viewport")},l.prototype.zoom=function(e,t){var n=o(p,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},l.prototype._handleWheel=function(e){if(!(0,i.oq)(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,r=e.ctrlKey||(0,a.V)()&&e.metaKey,o=e.shiftKey,s=-1*this._scale;if(s*=r?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,r){var p=t.getBoundingClientRect(),l={x:e.clientX-p.left,y:e.clientY-p.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*c(e.deltaY)*s,this.zoom(n,l)}else n=o?{dx:s*e.deltaY,dy:0}:{dx:s*e.deltaX,dy:s*e.deltaY},this.scroll(n)}},l.prototype.stepZoom=function(e,t){var n=o(p,10);this._zoom(e,t,n)},l.prototype._zoom=function(e,t,n){var i=this._canvas,o=e>0?1:-1,a=r(i.zoom()),s=Math.round(a/n)*n;s+=n*o;var c,l,u=Math.pow(10,s);i.zoom((c=p,l=u,Math.max(c.min,Math.min(c.max,l))),t)},l.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,r=this._enabled;return void 0===e&&(e=!r),r!==e&&i.B[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},l.prototype._init=function(e){this.toggle(e)};const u={__init__:["zoomScroll"],zoomScroll:["type",l]}},53:(e,t,n)=>{"use strict";n.d(t,{N:()=>r});var i=5e3;function r(e,t){function n(){return!1}return t=t||"element.click",e.once(t,i,n),function(){e.off(t,n)}}},943:(e,t,n)=>{"use strict";function i(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function r(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function o(e,t){return e&&t?e.indexOf(t):-1}n.d(t,{IH:()=>r,Od:()=>i,cq:()=>o})},422:(e,t,n)=>{"use strict";n.d(t,{t8:()=>o,zN:()=>a});var i=n(674),r=/^djs-cursor-.*$/;function o(e){var t=(0,i.Sh)(document.body);t.removeMatching(r),e&&t.add("djs-cursor-"+e)}function a(){o(null)}},490:(e,t,n)=>{"use strict";n.d(t,{He:()=>d,PB:()=>c,RH:()=>u,cd:()=>r,jY:()=>l,oL:()=>h,om:()=>s,vA:()=>p});var i=n(398);function r(e){return(0,i.hX)(e,(function(t){return!(0,i.sE)(e,(function(e){return e!==t&&o(t,e)}))}))}function o(e,t){if(t){if(e===t)return t;if(e.parent)return o(e.parent,t)}}function a(e,t,n){var i=!n||-1===e.indexOf(t);return i&&e.push(t),i}function s(e,t,n){n=n||0,(0,i.kJ)(e)||(e=[e]),(0,i.Ed)(e,(function(e,r){var o=t(e,r,n);(0,i.kJ)(o)&&o.length&&s(o,t,n+1)}))}function c(e,t){return function(e,t,n){var i=[],r=[];return s(e,(function(e,o,s){a(i,e,t);var c=e.children;if((-1===n||so||void 0===o)&&(o=s+u),(c+p>a||void 0===a)&&(a=c+p)})),{x:n,y:r,height:a-r,width:o-n}}function u(e,t){var n={};return(0,i.Ed)(e,(function(e){var r=e;r.waypoints&&(r=l(r)),!(0,i.hj)(t.y)&&r.x>t.x&&(n[e.id]=e),!(0,i.hj)(t.x)&&r.y>t.y&&(n[e.id]=e),r.x>t.x&&r.y>t.y&&((0,i.hj)(t.width)&&(0,i.hj)(t.height)&&r.width+r.x{"use strict";function i(e){return CSS.escape(e)}n.d(t,{D:()=>i,r:()=>o});var r={"&":"&","<":"<",">":">",'"':""","'":"'"};function o(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return r[e]}))}},752:(e,t,n)=>{"use strict";function i(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function r(e){return e.originalEvent||e.srcEvent}function o(e){i(e),i(r(e))}function a(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}n.d(t,{Ku:()=>r,UW:()=>o,jt:()=>a})},349:(e,t,n)=>{"use strict";n.d(t,{Or:()=>s,SO:()=>l,ZS:()=>o,qr:()=>p,tW:()=>r});var i=n(398);function r(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function o(e,t,n,i){if(void 0===i&&(i=5),!e||!t||!n)return!1;var o=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),a=r(e,t);return Math.abs(o/a)<=i}var a=2;function s(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[e,t]of Object.entries(i))if(c(e,n))return t;return!1}function c(e,t){const n=t[0];return(0,i.yW)(t,(function(t){return Math.abs(n[e]-t[e])<=a}))}function p(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x{"use strict";function i(e){return e.childNodes[0]}function r(e){return e.parentNode.childNodes[1]}n.d(t,{G:()=>r,s:()=>i})},237:(e,t,n)=>{"use strict";function i(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}n.d(t,{Z:()=>i}),i.prototype.next=function(){return this._prefix+ ++this._counter}},384:(e,t,n)=>{"use strict";n.d(t,{Ho:()=>r,j_:()=>o});var i=n(398);function r(e){return(0,i.Kn)(e)&&(0,i.e$)(e,"waypoints")}function o(e){return(0,i.Kn)(e)&&(0,i.e$)(e,"labelTarget")}},470:(e,t,n)=>{"use strict";n.d(t,{Dw:()=>p,Id:()=>a,L7:()=>s,RJ:()=>c});var i=n(752),r=n(640);function o(e,t){return((0,i.Ku)(e)||e).button===t}function a(e){return o(e,0)}function s(e){return o(e,1)}function c(e){var t=(0,i.Ku)(e)||e;return!!a(e)&&((0,r.V)()?t.metaKey:t.ctrlKey)}function p(e){var t=(0,i.Ku)(e)||e;return a(e)&&t.shiftKey}},640:(e,t,n)=>{"use strict";function i(){return/mac/i.test(navigator.platform)}n.d(t,{V:()=>i})},419:(e,t,n)=>{"use strict";function i(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function r(e,t){return{x:e.x-t.x,y:e.y-t.y}}n.d(t,{b:()=>i,p:()=>r})},230:(e,t,n)=>{"use strict";n.d(t,{KO:()=>o,W5:()=>l,cq:()=>u});var i=n(398),r=n(487);function o(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function a(e){return["L",e.x,e.y]}function s(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,s,l;for(let r=1;r{"use strict";n.d(t,{Iu:()=>o,U1:()=>a,vs:()=>r});var i=n(487);function r(e,t,n,r,o){var a=(0,i.pH)();a.setTranslate(t,n);var s=(0,i.pH)();s.setRotate(r||0,0,0);var c=(0,i.pH)();c.setScale(o||1,o||1),(0,i.vs)(e,[a,s,c])}function o(e,t,n){var r=(0,i.pH)();r.setTranslate(t,n),(0,i.vs)(e,r)}function a(e,t){var n=(0,i.pH)();n.setRotate(t,0,0),(0,i.vs)(e,n)}},840:(e,t,n)=>{var i;!function(r,o,a,s){"use strict";var c,p=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),u="function",h=Math.round,d=Math.abs,f=Date.now;function m(e,t,n){return setTimeout(E(e,n),t)}function v(e,t,n){return!!Array.isArray(e)&&(g(e,n[t],n),!0)}function g(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,i,n),e.apply(this,arguments)}}c="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function P(e){return e.trim().split(/\s+/g)}function T(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]})):i.sort()),i}function B(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),o=0;o1&&!n.firstMultiple?n.firstMultiple=ie(t):1===r&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,c=a?a.center:o.center,p=t.center=re(i);t.timeStamp=f(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=ce(c,p),t.distance=se(c,p),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};t.eventType!==H&&o.eventType!==Z||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l,u,h=oe(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=d(h.x)>d(h.y)?h.x:h.y,t.scale=a?(l=a.pointers,se((u=i)[0],u[1],ee)/se(l[0],l[1],ee)):1,t.rotation=a?function(e,t){return ce(t[1],t[0],ee)+ce(e[1],e[0],ee)}(a.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,o,a=e.lastInterval||t,c=t.timeStamp-a.timeStamp;if(t.eventType!=W&&(c>F||a.velocity===s)){var p=t.deltaX-a.deltaX,l=t.deltaY-a.deltaY,u=oe(c,p,l);i=u.x,r=u.y,n=d(u.x)>d(u.y)?u.x:u.y,o=ae(p,l),e.lastInterval=t}else n=a.velocity,i=a.velocityX,r=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=o}(n,t);var m=e.element;R(t.srcEvent.target,m)&&(m=t.srcEvent.target),t.target=m}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ie(e){for(var t=[],n=0;n=d(t)?e<0?V:G:t<0?K:J}function se(e,t,n){n||(n=Q);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function ce(e,t,n){n||(n=Q);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}te.prototype={handler:function(){},init:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(N(this.element),this.evWin,this.domHandler)}};var pe={mousedown:H,mousemove:2,mouseup:Z},le="mousedown",ue="mousemove mouseup";function he(){this.evEl=le,this.evWin=ue,this.pressed=!1,te.apply(this,arguments)}x(he,te,{handler:function(e){var t=pe[e.type];t&H&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=Z),this.pressed&&(t&Z&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:z,srcEvent:e}))}});var de={pointerdown:H,pointermove:2,pointerup:Z,pointercancel:W,pointerout:W},fe={2:$,3:"pen",4:z,5:"kinect"},me="pointerdown",ve="pointermove pointerup pointercancel";function ge(){this.evEl=me,this.evWin=ve,te.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(me="MSPointerDown",ve="MSPointerMove MSPointerUp MSPointerCancel"),x(ge,te,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=de[i],o=fe[e.pointerType]||e.pointerType,a=o==$,s=T(t,e.pointerId,"pointerId");r&H&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):r&(Z|W)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var ye={touchstart:H,touchmove:2,touchend:Z,touchcancel:W};function be(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,te.apply(this,arguments)}function _e(e,t){var n=M(e.touches),i=M(e.changedTouches);return t&(Z|W)&&(n=D(n.concat(i),"identifier",!0)),[n,i]}x(be,te,{handler:function(e){var t=ye[e.type];if(t===H&&(this.started=!0),this.started){var n=_e.call(this,e,t);t&(Z|W)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:$,srcEvent:e})}}});var xe={touchstart:H,touchmove:2,touchend:Z,touchcancel:W},Ee="touchstart touchmove touchend touchcancel";function we(){this.evTarget=Ee,this.targetIds={},te.apply(this,arguments)}function Se(e,t){var n=M(e.touches),i=this.targetIds;if(t&(2|H)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,a=M(e.changedTouches),s=[],c=this.target;if(o=n.filter((function(e){return R(e.target,c)})),t===H)for(r=0;r-1&&i.splice(e,1)}),ke)}}function Pe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n<8&&i(t.options.event+Ze(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=8&&i(t.options.event+Ze(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Fe},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return Ve.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=We(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ke,Ve,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ne]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Je,He,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(Z|W)&&!r)this.reset();else if(e.eventType&H)this.reset(),this._timer=m((function(){this.state=8,this.tryEmit()}),t.time,this);else if(e.eventType&Z)return 8;return Fe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&Z?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),x(qe,Ve,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ne]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),x(Xe,Ve,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:q|X,pointers:1},getTouchAction:function(){return Ge.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(q|X)?t=e.overallVelocity:n&q?t=e.overallVelocityX:n&X&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&Z},emit:function(e){var t=We(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x(Ye,He,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[je]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance{"use strict";n.d(t,{Z:()=>o});var i=function(e,t){return function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}}(t={exports:{}}),t.exports}();function r(e){if(!(this instanceof r))return new r(e);e=e||[128,36,1],this._seed=e.length?i.rack(e[0],e[1],e[2]):e}r.prototype.next=function(e){return this._seed(e||!0)},r.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},r.prototype.claim=function(e,t){this._seed.set(e,t||!0)},r.prototype.assigned=function(e){return this._seed.get(e)||!1},r.prototype.unclaim=function(e){delete this._seed.hats[e]},r.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};const o=r},66:(e,t,n)=>{"use strict";function i(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}n.d(t,{Z:()=>i})},717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},674:(e,t,n)=>{"use strict";function i(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)}n.d(t,{B:()=>S,H6:()=>P,IO:()=>T,Kt:()=>M,Lj:()=>u,Od:()=>D,Sh:()=>d,ZH:()=>m,cl:()=>C,i5:()=>l,oq:()=>g,wB:()=>v});const r=Object.prototype.toString,o=Object.prototype.hasOwnProperty;function a(e,t){return o.call(e,t)}function s(e,t){let n,i;if(void 0===e)return;const o=(s=e,"[object Array]"===r.call(s)?p:c);var s;for(let r in e)if(a(e,r)&&(n=e[r],i=t(n,o(r)),!1===i))return n}function c(e){return e}function p(e){return Number(e)}function l(e,...t){const n=e.style;return s(t,(function(e){e&&s(e,(function(e,t){n[t]=e}))})),e}function u(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}const h=Object.prototype.toString;function d(e){return new f(e)}function f(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function m(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}function v(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}function g(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(v(i,t))return i;i=i.parentNode}return v(i,t)?i:null}f.prototype.add=function(e){return this.list.add(e),this},f.prototype.remove=function(e){return"[object RegExp]"==h.call(e)?this.removeMatching(e):(this.list.remove(e),this)},f.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n
    a',R=!w.getElementsByTagName("link").length,w=void 0);var A={legend:[1,"
    ","
    "],tr:[2,"","
    "],col:[2,"","
    "],_default:R?[1,"X
    ","
    "]:[0,"",""]};A.td=A.th=[3,"","
    "],A.option=A.optgroup=[1,'"],A.thead=A.tbody=A.colgroup=A.caption=A.tfoot=[1,"","
    "],A.polyline=A.ellipse=A.polygon=A.circle=A.text=A.line=A.path=A.rect=A.g=[1,'',""];var P=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(A,i)?A[i]:A._default,a=o[0],s=o[1],c=o[2];for((r=t.createElement("div")).innerHTML=s+e+c;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var p=t.createDocumentFragment();r.firstChild;)p.appendChild(r.removeChild(r.firstChild));return p};function T(e,t){return(t=t||document).querySelector(e)}function M(e,t){return(t=t||document).querySelectorAll(e)}function D(e){e.parentNode&&e.parentNode.removeChild(e)}},487:(e,t,n)=>{"use strict";function i(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 r(e,t){return i(t,e),e}n.d(t,{Lj:()=>c,Od:()=>h,R3:()=>r,Sh:()=>l,Ue:()=>y,ZH:()=>d,d9:()=>f,db:()=>P,pH:()=>w,vs:()=>M,wz:()=>E});var o=2,a={"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":o,"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":o,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function s(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=a[i];r?(r===o&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function c(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return a[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);s(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)s(e,i,t[i])}(e,t);return e}const p=Object.prototype.toString;function l(e){return new u(e)}function u(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function h(e){var t=e.parentNode;return t&&t.removeChild(e),e}function d(e){for(var t;t=e.firstChild;)h(t);return e}function f(e){return e.cloneNode(!0)}u.prototype.add=function(e){return this.list.add(e),this},u.prototype.remove=function(e){return"[object RegExp]"==p.call(e)?this.removeMatching(e):(this.list.remove(e),this)},u.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n"+e+"",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function y(e,t){var n;return"<"===e.charAt(0)?(n=g(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(m.svg,e),t&&c(n,t),n}var b=null;function _(){return null===b&&(b=y("svg")),b}function x(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function E(e,t,n,i,r,o){var a=_().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return x(a,e);case 6:return x(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}function w(e){return e?_().createSVGTransformFromMatrix(e):_().createSVGTransform()}var S=/([&<>]{1})/g,k=/([\n\r"]{1})/g,C={"&":"&","<":"<",">":">",'"':"'"};function R(e,t){return e.replace(t,(function(e,t){return C[t]||t}))}function A(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(R(e.textContent,S));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n"),n=0,i=(a=e.childNodes).length;n")}else t.push("/>");break;case 8:t.push("\x3c!--",R(e.nodeValue,S),"--\x3e");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function P(e,t){if(void 0!==t){try{!function(e,t){var n=g(t);if(d(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var r,o=(r=n.childNodes,Array.prototype.slice.call(r)),a=0;a{"use strict";n.d(t,{Z:()=>i});class i{constructor(e,t,n,i,o,a){this.modeler=e,this.zoomScroll=this.modeler.get("zoomScroll"),this.container=n,this.callBack=i,this.bypassfullscreenChanged=!1,this.persistStateName=o,this.stepZoom=1,this.eventBus=t,this.fullScreenElementSelector=a,this.currentDim=new r(0,0),this.observer=new MutationObserver(((e,t)=>{var n;for(const t of e)if("childList"===t.type){var i=t.addedNodes[0];i&&(i.id.includes("alertify")||i.classList.contains("wait-screen"))&&(null===(n=$(this.fullScreenElementSelector))||void 0===n||n.append(i))}}))}Render(){window.bpmnZoom=this,this.canvas=this.modeler.get("canvas"),this.persistStateName&&this.eventBus.on("canvas.viewbox.changed",(e=>{const t=window.bpmnZoom,n=t.canvas.zoom();n!=t.stepZoom?(t.stepZoom=n,localStorage.setItem(t.persistStateName+"_zoom",t.stepZoom)):e.viewbox.x==t.currentDim.X&&e.viewbox.x==t.currentDim.Y||(t.currentDim.X=e.viewbox.x,t.currentDim.Y=e.viewbox.y,t.currentDim.Width=e.viewbox.width,t.currentDim.Height=e.viewbox.height,localStorage.setItem(t.persistStateName+"_dim",t.currentDim.ToString()))}));let e=document.createElement("div");e.classList.add("zoom-part-container"),screen.height<712?e.style.marginTop="-2.5rem":e.style.marginTop="-2.75rem",this.generateSetCentral(e),this.generateZoomIn(e),this.generateZoomOut(e),this.generateReset(e),e.style.zIndex=9998,e.style.position="relative",this.container.appendChild(e)}generateZoomIn(e){const t=this;let n=this.generateBtn("zoom-in-btn");n.setAttribute("title","zoom in"),n.addEventListener("click",(e=>t.changeZoomStep(1))),e.appendChild(n)}generateZoomOut(e){const t=this;let n=this.generateBtn("zoom-out-btn");n.setAttribute("title","zoom out"),n.addEventListener("click",(e=>t.changeZoomStep(-1))),e.appendChild(n)}generateSetCentral(e){const t=this;let n=this.generateBtn("zoom-central-btn");n.setAttribute("title","full screen"),n.addEventListener("click",(e=>t.fullScreenZoom(e,t))),e.appendChild(n)}generateReset(e){const t=this;let n=this.generateBtn("zoom-reset-btn");n.setAttribute("title","reset"),n.addEventListener("click",(e=>t.changeZoomStep(0))),e.appendChild(n)}generateBtn(e){var t=document.createElement("button");t.classList.add(e);var n=document.createElement("i");return t.appendChild(n),t}fullScreenZoom(e,t){e.preventDefault(),t.container&&t.reverseFullScreen(t.container,t)}reverseFullScreen(e,t){t.IsFullScreen?t.IsFullScreen&&document.exitFullscreen&&t.exitFullScreen(null):null===document.fullscreenElement&&t.gotoFullScreen(t.container,t)}gotoFullScreen(e,t){e.requestFullscreen&&e.requestFullscreen().catch((e=>{console.log(`Error attempting to enable fullscreen mode: ${e.message} (${e.name})`)})).then((()=>{t.IsFullScreen=!0,t.InvokeCallback(t,!0),t.container.parentElement.setAttribute(t.isFullScreenAttrName,"true"),t.sideMenu&&(t.sideMenu.style.opacity="0"),t.leftPanel&&(t.leftPanel.style.opacity="0"),t.bypassfullscreenChanged=!0,document.documentElement.addEventListener("fullscreenchange",t.exitFullScreen);var e=document.querySelector("body");this.observer.observe(e,{childList:!0,subtree:!1})}))}exitFullScreen(e){var t;let n=window.bpmnZoom;n.bypassfullscreenChanged?n.bypassfullscreenChanged=!1:(document.documentElement.removeEventListener("fullscreenchange",n.exitFullScreen),n.IsFullScreen=!1,n.sideMenu&&(n.sideMenu.style.opacity="1"),n.leftPanel&&(n.leftPanel.style.opacity="1"),n.container.parentElement.removeAttribute(n.isFullScreenAttrName),n.InvokeCallback(n,!0),document.exitFullscreen().catch((e=>console.log(`Error attempting to exit fullscreen mode: ${e.message} (${e.name})`))),null===(t=this.observer)||void 0===t||t.disconnect())}InvokeCallback(e,t=!1){e.CallBack&&e.CallBack(e.currentState.ZoomLevel,t)}changeZoomStep(e){0==e?(this.zoomScroll.reset(),localStorage.removeItem(this.persistStateName+"_zoom")):(this.zoomScroll.stepZoom(e),this.stepZoom=this.canvas.zoom(),localStorage.setItem(this.persistStateName+"_zoom",this.stepZoom))}SetDefaultZoom(){this.stepZoom=localStorage.getItem(this.persistStateName+"_zoom"),this.stepZoom?this.canvas.zoom(this.stepZoom):this.stepZoom=1;var e=localStorage.getItem(this.persistStateName+"_dim");e&&(this.currentDim.Parse(e),this.canvas.viewbox({x:this.currentDim.X,y:this.currentDim.Y,width:this.currentDim.Width,height:this.currentDim.Height}))}InvestigateDialog(){var e,t;if(!this.IsFullScreen)return;let n=$(".modal.show");if(n){let i=$(this.fullScreenElementSelector);null==i||i.append(n),null==i||i.append($(".modal-backdrop.show")),null===(t=null===(e=n[0])||void 0===e?void 0:e.querySelector(".modal-dialog"))||void 0===t||t.classList.add("modal-dialog-centered");let r=$("#alertify");r.length>0&&(null==i||i.append(r))}}}class r{constructor(e,t,n,i){this.X=e,this.Y=t,this.Width=n,this.height=i}Parse(e){var t=e.split(":");if(4!=t.length)throw new Error("dimenssions is not correct");this.X=Number(t[0]),this.Y=Number(t[1]),this.Width=Number(t[2]),this.Height=Number(t[3])}ToString(){return`${this.X}:${this.Y}:${this.Width}:${this.Height}`}}},472:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i,r=n(858),o=n(487),a=n(398),s=n(312),c=n(252),p=n(517),l=n(230);class u extends r.Z{constructor(e,t,n,r){super(e,1500),this.bpmnRenderer=t,i=n.computeStyle,this.textRenderer=r}canRender(e){return(0,c.JZ)(e,["bpmn:Participant"])&&!e.labelTarget}drawShape(e,t){var n={fillOpacity:.95,fill:(0,s.W7)(t,this.bpmnRenderer.defaultFillColor),stroke:(0,s.$Z)(t,this.bpmnRenderer.defaultStrokeColor)},i=this.renderer("bpmn:Lane")(e,t,n);if((0,p.ul)(t)){this.drawLine(e,[{x:0,y:30},{x:t.width,y:30}],{stroke:(0,s.$Z)(t,this.bpmnRenderer.defaultStrokeColor)});var r=(0,c.SS)(t).name;this.renderLaneLabel(e,r,t)}else{var o=(0,c.SS)(t).name;this.bpmnRenderer.renderLabel(e,o,{box:t,align:"center-middle",style:{fill:(0,s.Ou)(t,this.bpmnRenderer.defaultLabelColor,this.bpmnRenderer.defaultStrokeColor)}})}return!!(0,c.SS)(t).participantMultiplicity&&this.renderer("ParticipantMultiplicityMarker")(e,t),i}renderer(e){return this.bpmnRenderer.handlers[e]}drawLine(e,t,n){n=i(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"});var r=(0,l.W5)(t,n);return(0,o.R3)(e,r),r}renderLaneLabel(e,t,n){this.renderLabel(e,t,{box:{height:30,width:n.width},align:"center-middle",style:{fill:(0,s.Ou)(n,this.bpmnRenderer.defaultLabelColor,this.bpmnRenderer.defaultStrokeColor)}})}renderLabel(e,t,n){n=(0,a.f0)({size:{width:e.width}},n);var i=this.textRenderer.createText(t||"Actor/Integration",n);return(0,o.Sh)(i).add("djs-label"),(0,o.R3)(e,i),i}}u.$inject=["eventBus","bpmnRenderer","styles","textRenderer"]},398:(e,t,n)=>{"use strict";function i(e){return Array.prototype.concat.apply([],e)}n.d(t,{$K:()=>s,CE:()=>F,Ds:()=>O,Ed:()=>y,G:()=>E,HD:()=>d,KQ:()=>M,Kn:()=>l,MR:()=>T,UI:()=>w,VO:()=>C,XP:()=>S,ak:()=>L,cx:()=>v,dp:()=>k,e$:()=>f,ei:()=>z,f0:()=>I,hX:()=>g,hj:()=>u,kJ:()=>p,kK:()=>c,mf:()=>h,o8:()=>a,qZ:()=>P,sE:()=>m,t8:()=>$,u4:()=>_,uw:()=>A,vM:()=>R,xH:()=>i,yW:()=>x,zu:()=>b});const r=Object.prototype.toString,o=Object.prototype.hasOwnProperty;function a(e){return void 0===e}function s(e){return void 0!==e}function c(e){return null==e}function p(e){return"[object Array]"===r.call(e)}function l(e){return"[object Object]"===r.call(e)}function u(e){return"[object Number]"===r.call(e)}function h(e){const t=r.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function d(e){return"[object String]"===r.call(e)}function f(e,t){return o.call(e,t)}function m(e,t){const n=B(t);let i;return y(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function v(e,t){const n=B(t);let i=p(e)?-1:void 0;return y(e,(function(e,t){if(n(e,t))return i=t,!1})),i}function g(e,t){const n=B(t);let i=[];return y(e,(function(e,t){n(e,t)&&i.push(e)})),i}function y(e,t){let n,i;if(a(e))return;const r=p(e)?N:j;for(let o in e)if(f(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function b(e,t){if(a(e))return[];!function(e){if(!p(e))throw new Error("must supply array")}(e);const n=B(t);return e.filter((function(e,t){return!n(e,t)}))}function _(e,t,n){return y(e,(function(e,i){n=t(n,e,i)})),n}function x(e,t){return!!_(e,(function(e,n,i){return e&&t(n,i)}),!0)}function E(e,t){return!!m(e,t)}function w(e,t){let n=[];return y(e,(function(e,i){n.push(t(e,i))})),n}function S(e){return e&&Object.keys(e)||[]}function k(e){return S(e).length}function C(e){return w(e,(e=>e))}function R(e,t,n={}){return t=D(t),y(e,(function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)})),n}function A(e,...t){e=D(e);let n={};return y(t,(t=>R(t,e,n))),w(n,(function(e,t){return e[0]}))}const P=A;function T(e,t){t=D(t);let n=[];return y(e,(function(e,i){let r=t(e,i),o={d:r,v:e};for(var a=0;ae.v))}function M(e){return function(t){return x(e,(function(e,n){return t[n]===e}))}}function D(e){return h(e)?e:t=>t[e]}function B(e){return h(e)?e:t=>t===e}function j(e){return e}function N(e){return Number(e)}function O(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),c()}function s(e){n=setTimeout(a,e)}function c(){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),c()},p.cancel=c,p}function L(e,t){return e.bind(t)}function I(e,...t){return Object.assign(e,...t)}function $(e,t,n){let i=e;return y(t,(function(e,r){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let o=t[r+1],p=i[e];s(o)&&c(p)&&(p=i[e]=isNaN(+o)?{}:[]),a(o)?a(n)?delete i[e]:i[e]=n:i=p})),e}function z(e,t){let n={},i=Object(e);return y(t,(function(t){t in i&&(n[t]=e[t])})),n}function F(e,t){let n={};return y(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}},686:(e,t,n)=>{"use strict";n.d(t,{Z:()=>A});var i=/,?([a-z]),?/gi,r=parseFloat,o=Math,a=o.PI,s=o.min,c=o.max,p=o.pow,l=o.abs,u=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,h=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,d=Array.isArray||function(e){return e instanceof Array};function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function m(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)f(e,n)&&(t[n]=m(e[n]));return t}function v(e){var t=v.ps=v.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout((function(){for(var n in t)f(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])})),t[e]}function g(e,t,n,i){return 1===arguments.length&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function y(){return this.join(",").replace(i,"$1")}function b(e){var t=m(e);return t.toString=y,t}function _(e,t,n,i,r,o,a,s,c){var l=1-c,u=p(l,3),h=p(l,2),d=c*c*c,f=u*t+3*h*c*i+3*l*c*c*o+d*s;return{x:C(u*e+3*h*c*n+3*l*c*c*r+d*a),y:C(f)}}function x(e){var t=function(e,t,n,i,r,a,p,u){for(var h,d,f,m,v,g,y,b,_=[],x=[[],[]],E=0;E<2;++E)if(0==E?(d=6*e-12*n+6*r,h=-3*e+9*n-9*r+3*p,f=3*n-3*e):(d=6*t-12*i+6*a,h=-3*t+9*i-9*a+3*u,f=3*i-3*t),l(h)<1e-12){if(l(d)<1e-12)continue;0<(m=-f/d)&&m<1&&_.push(m)}else y=d*d-4*f*h,b=o.sqrt(y),y<0||(0<(v=(-d+b)/(2*h))&&v<1&&_.push(v),0<(g=(-d-b)/(2*h))&&g<1&&_.push(g));for(var w,S=_.length,k=S;S--;)w=1-(m=_[S]),x[0][S]=w*w*w*e+3*w*w*m*n+3*w*m*m*r+m*m*m*p,x[1][S]=w*w*w*t+3*w*w*m*i+3*w*m*m*a+m*m*m*u;return x[0][k]=e,x[1][k]=t,x[0][k+1]=p,x[1][k+1]=u,x[0].length=x[1].length=k+2,{x0:s(...x[0]),y0:s(...x[1]),x1:c(...x[0]),y1:c(...x[1])}}(...e);return g(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function E(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function w(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function S(e,t,n,i,r,a,s,c,p){null==p&&(p=1);for(var l=(p=p>1?1:p<0?0:p)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,f=0;f<12;f++){var m=l*u[f]+l,v=w(m,e,n,r,s),g=w(m,t,i,a,c),y=v*v+g*g;d+=h[f]*o.sqrt(y)}return l*d}function k(e,t,n,i,r,o,a,p){if(!(c(e,n)c(r,a)||c(t,i)c(o,p))){var l=(e*i-t*n)*(o-p)-(t-i)*(r*p-o*a),u=(e-n)*(o-p)-(t-i)*(r-a);if(u){var h=C(((e*i-t*n)*(r-a)-(e-n)*(r*p-o*a))/u),d=C(l/u),f=+h.toFixed(2),m=+d.toFixed(2);if(!(f<+s(e,n).toFixed(2)||f>+c(e,n).toFixed(2)||f<+s(r,a).toFixed(2)||f>+c(r,a).toFixed(2)||m<+s(t,i).toFixed(2)||m>+c(t,i).toFixed(2)||m<+s(o,p).toFixed(2)||m>+c(o,p).toFixed(2)))return{x:h,y:d}}}}function C(e){return Math.round(1e11*e)/1e11}function R(e,t,n){if(i=x(e),r=x(t),i=g(i),!(E(r=g(r),i.x,i.y)||E(r,i.x2,i.y)||E(r,i.x,i.y2)||E(r,i.x2,i.y2)||E(i,r.x,r.y)||E(i,r.x2,r.y)||E(i,r.x,r.y2)||E(i,r.x2,r.y2)||(i.xr.x||r.xi.x)&&(i.yr.y||r.yi.y)))return n?0:[];for(var i,r,o=S(...e),a=S(...t),s=T(e)?1:~~(o/5)||1,c=T(t)?1:~~(a/5)||1,p=[],u=[],h={},d=n?0:[],f=0;f=0&&D<=1&&B>=0&&B<=1&&(n?d++:d.push({x:M.x,y:M.y,t1:D,t2:B}))}}return d}function A(e,t,n){e=j(e),t=j(t);for(var i,r,o,a,s,c,p,l,u,h,d=n?0:[],f=0,m=e.length;f2&&(i.push([t,...o.splice(0,2)]),a="l",t="m"==t?"l":"L");o.length>=n[a]&&(i.push([t,...o.splice(0,n[a])]),n[a]););})),i.toString=v.toString,t.arr=m(i),i}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,s=0,c=0;"M"==e[0][0]&&(a=r=+e[0][1],s=o=+e[0][2],c++,i[0]=["M",r,o]);for(var p,l,f=c,g=e.length;f=1e3&&delete n[i.shift()],i.push(t),n[t]=m(...arguments),n[t])});if(h)A=h[0],P=h[1],C=h[2],R=h[3];else{e=(d=b(e,t,-g)).x,t=d.y;var _=(e-(p=(d=b(p,u,-g)).x))/2,x=(t-(u=d.y))/2,E=_*_/(n*n)+x*x/(i*i);E>1&&(n*=E=o.sqrt(E),i*=E);var w=n*n,S=i*i,k=(s==c?-1:1)*o.sqrt(l((w*S-w*x*x-S*_*_)/(w*x*x+S*_*_))),C=k*n*x/i+(e+p)/2,R=k*-i*_/n+(t+u)/2,A=o.asin(((t-R)/i).toFixed(9)),P=o.asin(((u-R)/i).toFixed(9));(A=eP&&(A-=2*a),!c&&P>A&&(P-=2*a)}var T=P-A;if(l(T)>v){var M=P,D=p,j=u;P=A+v*(c&&P>A?1:-1),y=B(p=C+n*o.cos(P),u=R+i*o.sin(P),n,i,r,0,c,D,j,[P,M,C,R])}T=P-A;var N=o.cos(A),O=o.sin(A),L=o.cos(P),I=o.sin(P),$=o.tan(T/4),z=4/3*n*$,F=4/3*i*$,H=[e,t],Z=[e+z*O,t-F*N],W=[p+z*I,u-F*L],U=[p,u];if(Z[0]=2*H[0]-Z[0],Z[1]=2*H[1]-Z[1],h)return[Z,W,U].concat(y);for(var V=[],G=0,K=(y=[Z,W,U].concat(y).join().split(",")).length;G7){e[t].shift();for(var i=e[t];i.length;)s[t]="A",e.splice(t++,0,["C",...i.splice(0,6)]);e.splice(t,1),u=n.length}},s=[],c="",p="",l=0,u=n.length;l{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";var e=n(66),t=n(88),i=n(907);function r(e){i.Z.call(this,e),this.on("import.parse.complete",(function(e){e.error||this._collectIds(e.definitions,e.elementsById)}),this),this.on("diagram.destroy",(function(){this.get("moddle").ids.clear()}),this)}(0,e.Z)(r,i.Z),r.prototype._createModdle=function(e){var n=i.Z.prototype._createModdle.call(this,e);return n.ids=new t.Z([32,36,1]),n},r.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var o=n(133),a=n(398),s=n(674),c=["c","C"],p=["v","V"],l=["y","Y"],u=["z","Z"];function h(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function d(e,t){return-1!==(e=(0,a.kJ)(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function f(e){return e.shiftKey}var m="keyboard.keydown",v="input-handle-modified-keys";function g(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),t.on("diagram.init",(function(){n._fire("init")})),t.on("attach",(function(){e&&e.bindTo&&n.bind(e.bindTo)})),t.on("detach",(function(){n.unbind()}))}g.$inject=["config.keyboard","eventBus"],g.prototype._keydownHandler=function(e){this._keyHandler(e,m)},g.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},g.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||m,n)&&e.preventDefault()}},g.prototype._isEventIgnored=function(e){return!!e.defaultPrevented||(t=e.target)&&((0,s.wB)(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},g.prototype._isModifiedKeyIgnored=function(e){return!h(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},g.prototype._getAllowedModifiers=function(e){var t=(0,s.oq)(e,"["+v+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(v).split(",")},g.prototype.bind=function(e){this.unbind(),this._node=e,s.B.bind(e,"keydown",this._keydownHandler),s.B.bind(e,"keyup",this._keyupHandler),this._fire("bind")},g.prototype.getBinding=function(){return this._node},g.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),s.B.unbind(e,"keydown",this._keydownHandler),s.B.unbind(e,"keyup",this._keyupHandler)),this._node=null},g.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},g.prototype.addListener=function(e,t,n){(0,a.mf)(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||m,e,t)},g.prototype.removeListener=function(e,t){this._eventBus.off(t||m,e)},g.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},g.prototype.isCmd=h,g.prototype.isShift=f,g.prototype.isKey=d;var y=500;function b(e,t){var n=this;e.on("editorActions.init",y,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}b.$inject=["eventBus","keyboard"],b.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(h(n=e.keyEvent)&&!f(n)&&d(u,n))return t.trigger("undo"),!0;var n})),n("redo",(function(e){if(h(n=e.keyEvent)&&(d(l,n)||d(u,n)&&f(n)))return t.trigger("redo"),!0;var n})),n("copy",(function(e){if(h(n=e.keyEvent)&&d(c,n))return t.trigger("copy"),!0;var n})),n("paste",(function(e){if(h(n=e.keyEvent)&&d(p,n))return t.trigger("paste"),!0;var n})),n("stepZoom",(function(e){var n=e.keyEvent;if(d(["+","Add","="],n)&&h(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(d(["-","Subtract"],n)&&h(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(d("0",n)&&h(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(d(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};const _={__init__:["keyboard","keyboardBindings"],keyboard:["type",g],keyboardBindings:["type",b]};var x={moveSpeed:50,moveSpeedAccelerated:200};function E(e,t,n){var i=this;this._config=(0,a.f0)({},x,e||{}),t.addListener((function(e){var n=e.keyEvent,r=i._config;if(t.isCmd(n)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,a=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:a,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}E.$inject=["config.keyboardMove","keyboard","canvas"];const w={__depends__:[_],__init__:["keyboardMove"],keyboardMove:["type",E]};var S=n(892),k=n(728);function C(e){o.Z.call(this,e)}(0,e.Z)(C,o.Z),C.prototype._navigationModules=[w,S.Z,k.Z],C.prototype._modules=[].concat(o.Z.prototype._modules,C.prototype._navigationModules);var R=n(111),A=n(840),P=n.n(A),T=n(752),M=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function D(e,t){return t.get(e,!1)}function B(e){e.preventDefault(),"function"==typeof e.stopPropagation?e.stopPropagation():e.srcEvent&&"function"==typeof e.srcEvent.stopPropagation&&e.srcEvent.stopPropagation(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation()}function j(e){function t(t){setTimeout((function(){(0,a.Ed)(M,(function(t){s.B.unbind(e,t,B,!0)}))}),500)}s.B.bind(e,"touchstart",(function(t){(0,a.Ed)(M,(function(t){s.B.bind(e,t,B,!0)}))}),!0),s.B.bind(e,"touchend",t,!0),s.B.bind(e,"touchcancel",t,!0);var n=new(P().Manager)(e,{inputClass:P().TouchInput,recognizers:[],domEvents:!0}),i=new(P().Tap),r=new(P().Pan)({threshold:10}),o=new(P().Press),c=new(P().Pinch),p=new(P().Tap)({event:"doubletap",taps:2});return c.requireFailure(r),c.requireFailure(o),n.add([r,o,c,p,i]),n.reset=function(e){var t=this.recognizers,i=this.session;i.stopped||(n.stop(e),setTimeout((function(){var e,n;for(e=0;n=t[e];e++)n.reset(),n.state=8;i.curRecognizer=null}),0))},n.on("hammer.input",(function(e){e.srcEvent.defaultPrevented&&n.reset(!0)})),n}function N(e,t,n,i,r){var o,a=D("dragging",e),c=D("move",e),p=D("contextPad",e),l=D("palette",e);function u(e,t){return function(n){var o=h(n.target),a=o&&i.get(o);return t&&(n.srcEvent.button=t),r.fire(e,n,a)}}function h(e){return(0,s.oq)(e,"svg, .djs-element",!0)}a&&n.on("drag.move",(function(e){var t=e.originalEvent;if(t&&!(t instanceof MouseEvent)){var n=(0,T.jt)(t),r=h(document.elementFromPoint(n.x,n.y)),o=r&&i.get(r);o!==e.hover&&(e.hover&&a.out(e),o&&(a.hover({element:o,gfx:r}),e.hover=o,e.hoverGfx=r))}})),p&&n.on("contextPad.create",(function(e){var t=j(e.pad.html);t.on("panstart",(function(e){p.trigger("dragstart",e,!0)})),t.on("press",(function(e){p.trigger("dragstart",e,!0)})),t.on("tap",(function(e){p.trigger("click",e)}))})),l&&n.on("palette.create",(function(e){var t=j(e.container);t.on("panstart",(function(e){l.trigger("dragstart",e,!0)})),t.on("press",(function(e){l.trigger("dragstart",e,!0)})),t.on("tap",(function(e){l.trigger("click",e)}))})),n.on("canvas.init",(function(e){!function(e){function n(e){var n=h(e.target),r=n&&i.get(n);if(c&&t.getRootElement()!==r)return c.start(e,r,!0);!function(e){var n=0,i=0;function r(e){var r=e.deltaX-n,o=e.deltaY-i;t.scroll({dx:r,dy:o}),n=e.deltaX,i=e.deltaY}function a(e){o.off("panmove",r),o.off("panend",a),o.off("pancancel",a)}o.on("panmove",r),o.on("panend",a),o.on("pancancel",a)}()}(o=j(e)).on("tap",u("element.click")),o.on("doubletap",u("element.dblclick",1)),o.on("panstart",n),o.on("press",n),o.on("pinchstart",(function(e){var n=t.zoom(),i=e.center;function r(e){var r=1-(1-e.scale)/1.5,o=Math.max(.2,Math.min(4,r*n));t.zoom(o,i),B(e)}function a(e){o.off("pinchmove",r),o.off("pinchend",a),o.off("pinchcancel",a),o.reset(!0)}o.on("pinchmove",r),o.on("pinchend",a),o.on("pinchcancel",a)}))}(e.svg)}))}N.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"];var O=n(487);function L(e){var t=this;e.on("canvas.init",(function(e){t.addBBoxMarker(e.svg)}))}L.$inject=["eventBus"],L.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=(0,O.Ue)("rect");(0,O.Lj)(n,{x:-1e4,y:1e4,width:10,height:10}),(0,O.Lj)(n,t),(0,O.R3)(e,n);var i=(0,O.Ue)("rect");(0,O.Lj)(i,{x:1e4,y:1e4,width:10,height:10}),(0,O.Lj)(i,t),(0,O.R3)(e,i)};const I={__depends__:[{__depends__:[R.Z],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",N],touchFix:["type",L]}]};function $(e){return e&&e[e.length-1]}function z(e){return e.y}function F(e){return e.x}var H={left:F,center:F,right:function(e){return e.x+e.width},top:z,middle:z,bottom:function(e){return e.y+e.height}};function Z(e,t){this._modeling=e,this._rules=t}Z.$inject=["modeling","rules"],Z.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},Z.prototype._isType=function(e,t){return-1!==t.indexOf(e)},Z.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),s=o.axis,c=o.dimension,p={},l={},u=!1;if(this._isType(e,["left","top"]))p[e]=t[0][s];else if(this._isType(e,["right","bottom"]))r=$(t),p[e]=r[s]+r[c];else if(this._isType(e,["center","middle"])){if((0,a.Ed)(t,(function(e){var t=e[s]+Math.round(e[c]/2);l[t]?l[t].elements.push(e):l[t]={elements:[e],center:t}})),n=(0,a.MR)(l,(function(e){return e.elements.length>1&&(u=!0),e.elements.length})),u)return p[e]=$(n).center,p;i=t[0],r=$(t=(0,a.MR)(t,(function(e){return e[s]+e[c]}))),p[e]=function(e,t){return Math.round((e[s]+t[s]+t[c])/2)}(i,r)}return p},Z.prototype.trigger=function(e,t){var n,i=this._modeling,r=(0,a.hX)(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));if(n=this._rules.allowed("elements.align",{elements:r}),(0,a.kJ)(n)&&(r=n),!(r.length<2)&&n){var o=H[t],s=(0,a.MR)(r,o),c=this._alignmentPosition(t,s);i.alignElements(s,c)}};const W={__init__:["alignElements"],alignElements:["type",Z]};var U=n(832),V=n(490),G=n(670),K=n(384),J=".entry";function q(e,t,n,i){this._canvas=e,this._eventBus=n,this._overlays=i;var r=(0,a.$K)(t&&t.scale)?t.scale:{min:1,max:1.5};this._overlaysConfig={scale:r},this._current=null,this._init()}function X(e,t){return-1!==e.indexOf(t)}q.$inject=["canvas","config.contextPad","eventBus","overlays"],q.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",(function(t){var n=t.newSelection,i=n.length?1===n.length?n[0]:n:null;i?e.open(i,!0):e.close()})),this._eventBus.on("elements.changed",(function(t){var n=t.elements,i=e._current;if(i){var r=i.target;(0,a.G)((0,a.kJ)(r)?r:[r],(function(e){return X(n,e)}))&&e.open(r,!0)}}))},q.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},q.prototype.getEntries=function(e){var t=this._getProviders(),n=(0,a.kJ)(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return(0,a.Ed)(t,(function(t){if((0,a.mf)(t[n])){var r=t[n](e);(0,a.mf)(r)?i=r(i):(0,a.Ed)(r,(function(e,t){i[t]=e}))}})),i},q.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=(0,s.Lj)(o,"data-action"),r=t.originalEvent||t,"mouseover"===e?this._timeout=setTimeout((()=>{this._mouseout=this.triggerEntry(i,"hover",r,n)}),300):"mouseout"===e&&(clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null)),this.triggerEntry(i,e,r,n)):t.preventDefault()},q.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries[e];if(o){var s=o.action;if(!1!==this._eventBus.fire("contextPad.trigger",{entry:o,event:n})){if((0,a.mf)(s)){if("click"===t)return s(n,r,i)}else if(s[t])return s[t](n,r,i);n.preventDefault()}}}},q.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},q.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},q.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this.getPad(e),r=i.html;(0,a.Ed)(n,(function(e,n){var i,o,c,p,l=e.group||"default",u=(0,s.H6)(e.html||'
    ');(0,s.Lj)(u,"data-action",n),(i=(0,s.IO)("[data-group="+(0,G.D)(l)+"]",r))||(i=(0,s.H6)('
    '),(0,s.Lj)(i,"data-group",l),r.appendChild(i)),i.appendChild(u),e.className&&(o=u,c=e.className,p=(0,s.Sh)(o),(c=(0,a.kJ)(c)?c:c.split(/\s+/g)).forEach((function(e){p.add(e)}))),e.title&&(0,s.Lj)(u,"title",e.title),e.imageUrl&&(t=(0,s.H6)(""),(0,s.Lj)(t,"src",e.imageUrl),t.style.width="100%",t.style.height="100%",u.appendChild(t))})),(0,s.Sh)(r).add("open"),this._current={target:e,entries:n,pad:i},this._eventBus.fire("contextPad.open",{current:this._current})},q.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=(0,s.H6)('
    '),r=this._getPosition(e),o=(0,a.f0)({html:i},this._overlaysConfig,r);s.cl.bind(i,J,"click",(function(e){t.trigger("click",e)})),s.cl.bind(i,J,"dragstart",(function(e){t.trigger("dragstart",e)})),s.cl.bind(i,J,"mouseover",(function(e){t.trigger("mouseover",e)})),s.cl.bind(i,J,"mouseout",(function(e){t.trigger("mouseout",e)})),s.B.bind(i,"mousedown",(function(e){e.stopPropagation()}));var c=this._canvas.getRootElement();this._overlayId=n.add(c,"context-pad",o);var p=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{target:e,pad:p}),p},q.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},q.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return(0,a.kJ)(e)===(0,a.kJ)(n)&&((0,a.kJ)(e)?e.length===n.length&&(0,a.yW)(e,(function(e){return X(n,e)})):n===e)},q.prototype.isShown=function(){return this.isOpen()&&this._overlays.isShown()},q.prototype._getPosition=function(e){var t;e=(0,K.Ho)(e)?(t=e).waypoints[t.waypoints.length-1]:e;var n=(0,a.kJ)(e)?e:[e],i=(0,V.jY)(n);return{position:{left:i.x+i.width+12,top:i.y-6}}};const Y={__depends__:[R.Z,U.Z],contextPad:["type",q]};var Q,ee,te,ne,ie,re,oe,ae={},se=[],ce=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pe=Array.isArray;function le(e,t){for(var n in t)e[n]=t[n];return e}function ue(e){var t=e.parentNode;t&&t.removeChild(e)}function he(e,t,n){var i,r,o,a={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Q.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return de(e,a,i,r,null)}function de(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++te:r,__i:-1,__u:0};return null==r&&null!=ee.vnode&&ee.vnode(o),o}function fe(e){return e.children}function me(e,t){this.props=e,this.context=t}function ve(e,t){if(null==t)return e.__?ve(e.__,e.__i+1):null;for(var n;tt&&ne.sort(oe));be.__r=0}function _e(e,t,n,i,r,o,a,s,c,p,l){var u,h,d,f,m,v=i&&i.__k||se,g=t.length;for(n.__d=c,xe(n,t,v),c=n.__d,u=0;u0?de(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,s=we(r,n,a=i+u,l),r.__i=s,o=null,-1!==s&&(l--,(o=n[s])&&(o.__u|=131072)),null==o||null===o.__v?(-1==s&&u--,"function"!=typeof r.type&&(r.__u|=65536)):s!==a&&(s===a+1?u++:s>a?l>c-a?u+=s-a:u--:u=s(null!=c&&0==(131072&c.__u)?1:0))for(;a>=0||s=0){if((c=t[a])&&0==(131072&c.__u)&&r==c.key&&o===c.type)return a;a--}if(s=5&&((r||!e&&5===i)&&(a.push(i,0,r,n),i=6),e&&(a.push(i,e,0,n),i=6)),r=""},c=0;c"===t?(i=1,r=""):r=t+r[0]:o?t===o?o="":r+=t:'"'===t||"'"===t?o=t:">"===t?(s(),i=1):i&&("="===t?(i=5,n=r,r=""):"/"===t&&(i<5||">"===e[c][p+1])?(s(),3===i&&(a=a[0]),i=a,(a=a[0]).push(2,0,i),i=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(s(),i=2):r+=t),3===i&&"!--"===r&&(i=4,a=a[0])}return s(),a}(e)),t),arguments,[])).length>1?t:t[0]}.bind(he),He=0,Ze=[],We=[],Ue=ee.__b,Ve=ee.__r,Ge=ee.diffed,Ke=ee.__c,Je=ee.unmount;function qe(e,t){ee.__h&&ee.__h(Oe,e,He||t),He=0;var n=Oe.__H||(Oe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:We}),n.__[e]}function Xe(e){return He=1,function(e,t,n){var i=qe(Ne++,2);if(i.t=e,!i.__c&&(i.__=[pt(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Oe,!Oe.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var a=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&i.__c.props===e)&&(!o||o.call(this,e,t,n))};Oe.u=!0;var o=Oe.shouldComponentUpdate,a=Oe.componentWillUpdate;Oe.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}a&&a.call(this,e,t,n)},Oe.shouldComponentUpdate=r}return i.__N||i.__}(pt,e)}function Ye(e,t){var n=qe(Ne++,3);!ee.__s&&ct(n.__H,t)&&(n.__=e,n.i=t,Oe.__H.__h.push(n))}function Qe(e,t){var n=qe(Ne++,4);!ee.__s&&ct(n.__H,t)&&(n.__=e,n.i=t,Oe.__h.push(n))}function et(e){return He=5,tt((function(){return{current:e}}),[])}function tt(e,t){var n=qe(Ne++,7);return ct(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function nt(e,t){return He=8,tt((function(){return e}),t)}function it(){for(var e;e=Ze.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(at),e.__H.__h.forEach(st),e.__H.__h=[]}catch(t){e.__H.__h=[],ee.__e(t,e.__v)}}ee.__b=function(e){Oe=null,Ue&&Ue(e)},ee.__r=function(e){Ve&&Ve(e),Ne=0;var t=(Oe=e.__c).__H;t&&(Le===Oe?(t.__h=[],Oe.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=We,e.__N=e.i=void 0}))):(t.__h.forEach(at),t.__h.forEach(st),t.__h=[],Ne=0)),Le=Oe},ee.diffed=function(e){Ge&&Ge(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ze.push(t)&&Ie===ee.requestAnimationFrame||((Ie=ee.requestAnimationFrame)||ot)(it)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==We&&(e.__=e.__V),e.i=void 0,e.__V=We}))),Le=Oe=null},ee.__c=function(e,t){t.some((function(e){try{e.__h.forEach(at),e.__h=e.__h.filter((function(e){return!e.__||st(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ee.__e(n,e.__v)}})),Ke&&Ke(e,t)},ee.unmount=function(e){Je&&Je(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{at(e)}catch(e){t=e}})),n.__H=void 0,t&&ee.__e(t,n.__v))};var rt="function"==typeof requestAnimationFrame;function ot(e){var t,n=function(){clearTimeout(i),rt&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);rt&&(t=requestAnimationFrame(n))}function at(e){var t=Oe,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Oe=t}function st(e){var t=Oe;e.__c=e.__(),Oe=t}function ct(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function pt(e,t){return"function"==typeof t?t(e):t}function lt(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t(()=>{var e={840:(e,t,n)=>{var i;!function(r,o,a,s){"use strict";var c,p=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),u="function",h=Math.round,d=Math.abs,f=Date.now;function m(e,t,n){return setTimeout(w(e,n),t)}function g(e,t,n){return!!Array.isArray(e)&&(v(e,n[t],n),!0)}function v(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,i,n),e.apply(this,arguments)}}c="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function T(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]})):i.sort()),i}function B(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),o=0;o1&&!n.firstMultiple?n.firstMultiple=ie(t):1===r&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,c=a?a.center:o.center,p=t.center=re(i);t.timeStamp=f(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=ce(c,p),t.distance=se(c,p),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};t.eventType!==H&&o.eventType!==V||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l,u,h=oe(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=d(h.x)>d(h.y)?h.x:h.y,t.scale=a?(l=a.pointers,se((u=i)[0],u[1],ee)/se(l[0],l[1],ee)):1,t.rotation=a?function(e,t){return ce(t[1],t[0],ee)+ce(e[1],e[0],ee)}(a.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,o,a=e.lastInterval||t,c=t.timeStamp-a.timeStamp;if(t.eventType!=W&&(c>F||a.velocity===s)){var p=t.deltaX-a.deltaX,l=t.deltaY-a.deltaY,u=oe(c,p,l);i=u.x,r=u.y,n=d(u.x)>d(u.y)?u.x:u.y,o=ae(p,l),e.lastInterval=t}else n=a.velocity,i=a.velocityX,r=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=o}(n,t);var m=e.element;R(t.srcEvent.target,m)&&(m=t.srcEvent.target),t.target=m}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ie(e){for(var t=[],n=0;n=d(t)?e<0?U:q:t<0?K:Y}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function ce(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}te.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(O(this.element),this.evWin,this.domHandler)}};var pe={mousedown:H,mousemove:2,mouseup:V},le="mousedown",ue="mousemove mouseup";function he(){this.evEl=le,this.evWin=ue,this.pressed=!1,te.apply(this,arguments)}x(he,te,{handler:function(e){var t=pe[e.type];t&H&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:z,srcEvent:e}))}});var de={pointerdown:H,pointermove:2,pointerup:V,pointercancel:W,pointerout:W},fe={2:$,3:"pen",4:z,5:"kinect"},me="pointerdown",ge="pointermove pointerup pointercancel";function ve(){this.evEl=me,this.evWin=ge,te.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(me="MSPointerDown",ge="MSPointerMove MSPointerUp MSPointerCancel"),x(ve,te,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=de[i],o=fe[e.pointerType]||e.pointerType,a=o==$,s=A(t,e.pointerId,"pointerId");r&H&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):r&(V|W)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var ye={touchstart:H,touchmove:2,touchend:V,touchcancel:W};function be(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,te.apply(this,arguments)}function _e(e,t){var n=M(e.touches),i=M(e.changedTouches);return t&(V|W)&&(n=D(n.concat(i),"identifier",!0)),[n,i]}x(be,te,{handler:function(e){var t=ye[e.type];if(t===H&&(this.started=!0),this.started){var n=_e.call(this,e,t);t&(V|W)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:$,srcEvent:e})}}});var xe={touchstart:H,touchmove:2,touchend:V,touchcancel:W},we="touchstart touchmove touchend touchcancel";function Ee(){this.evTarget=we,this.targetIds={},te.apply(this,arguments)}function Se(e,t){var n=M(e.touches),i=this.targetIds;if(t&(2|H)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,a=M(e.changedTouches),s=[],c=this.target;if(o=n.filter((function(e){return R(e.target,c)})),t===H)for(r=0;r-1&&i.splice(e,1)}),Ce)}}function Te(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n<8&&i(t.options.event+Ve(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=8&&i(t.options.event+Ve(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Fe},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return Ue.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=We(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ke,Ue,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Oe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Ye,He,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|W)&&!r)this.reset();else if(e.eventType&H)this.reset(),this._timer=m((function(){this.state=8,this.tryEmit()}),t.time,this);else if(e.eventType&V)return 8;return Fe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),x(Xe,Ue,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Oe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),x(Ze,Ue,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:X|Z,pointers:1},getTouchAction:function(){return qe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(X|Z)?t=e.overallVelocity:n&X?t=e.overallVelocityX:n&Z&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=We(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x(Qe,He,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ne]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"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}}))}n.r(i),n.d(i,{vsbpmn:()=>r_,vsbpmnViewer:()=>a_});var t=function(e,t){return function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}}(t={exports:{}}),t.exports}();function r(e){if(!(this instanceof r))return new r(e);e=e||[128,36,1],this._seed=e.length?t.rack(e[0],e[1],e[2]):e}r.prototype.next=function(e){return this._seed(e||!0)},r.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},r.prototype.claim=function(e,t){this._seed.set(e,t||!0)},r.prototype.assigned=function(e){return this._seed.get(e)||!1},r.prototype.unclaim=function(e){delete this._seed.hats[e]},r.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};const o=r;function a(e){return Array.prototype.concat.apply([],e)}const s=Object.prototype.toString,c=Object.prototype.hasOwnProperty;function p(e){return void 0===e}function l(e){return void 0!==e}function u(e){return null==e}function h(e){return"[object Array]"===s.call(e)}function d(e){return"[object Object]"===s.call(e)}function f(e){return"[object Number]"===s.call(e)}function m(e){const t=s.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function g(e){return"[object String]"===s.call(e)}function v(e,t){return c.call(e,t)}function y(e,t){const n=N(t);let i;return x(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function b(e,t){const n=N(t);let i=h(e)?-1:void 0;return x(e,(function(e,t){if(n(e,t))return i=t,!1})),i}function _(e,t){const n=N(t);let i=[];return x(e,(function(e,t){n(e,t)&&i.push(e)})),i}function x(e,t){let n,i;if(p(e))return;const r=h(e)?j:O;for(let o in e)if(v(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function w(e,t,n){return x(e,(function(e,i){n=t(n,e,i)})),n}function E(e,t){return!!w(e,(function(e,n,i){return e&&t(n,i)}),!0)}function S(e,t){return!!y(e,t)}function C(e,t){let n=[];return x(e,(function(e,i){n.push(t(e,i))})),n}function k(e){return e&&Object.keys(e)||[]}function R(e){return C(e,(e=>e))}function P(e,t,n={}){return t=B(t),x(e,(function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)})),n}function T(e,...t){e=B(e);let n={};return x(t,(t=>P(t,e,n))),C(n,(function(e,t){return e[0]}))}const A=T;function M(e,t){t=B(t);let n=[];return x(e,(function(e,i){let r=t(e,i),o={d:r,v:e};for(var a=0;ae.v))}function D(e){return function(t){return E(e,(function(e,n){return t[n]===e}))}}function B(e){return m(e)?e:t=>t[e]}function N(e){return m(e)?e:t=>t===e}function O(e){return e}function j(e){return Number(e)}function L(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),c()}function s(e){n=setTimeout(a,e)}function c(){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),c()},p.cancel=c,p}function I(e,t){return e.bind(t)}function z(e,...t){return Object.assign(e,...t)}function F(e,t){let n={},i=Object(e);return x(t,(function(t){t in i&&(n[t]=e[t])})),n}function H(e,t){let n={};return x(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}function V(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 W=Object.prototype.toString,G=Object.prototype.hasOwnProperty;function U(e,t){return G.call(e,t)}function q(e,t){let n,i;if(void 0===e)return;const r=(o=e,"[object Array]"===W.call(o)?Y:K);var o;for(let o in e)if(U(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function K(e){return e}function Y(e){return Number(e)}function X(e,...t){const n=e.style;return q(t,(function(e){e&&q(e,(function(e,t){n[t]=e}))})),e}function Z(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}const Q=Object.prototype.toString;function J(e){return new ee(e)}function ee(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function te(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}function ne(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}function ie(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(ne(i,t))return i;i=i.parentNode}return ne(i,t)?i:null}ee.prototype.add=function(e){return this.list.add(e),this},ee.prototype.remove=function(e){return"[object RegExp]"==Q.call(e)?this.removeMatching(e):(this.list.remove(e),this)},ee.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n
    a',de=!pe.getElementsByTagName("link").length,pe=void 0);var fe={legend:[1,"
    ","
    "],tr:[2,"","
    "],col:[2,"","
    "],_default:de?[1,"X
    ","
    "]:[0,"",""]};fe.td=fe.th=[3,"","
    "],fe.option=fe.optgroup=[1,'"],fe.thead=fe.tbody=fe.colgroup=fe.caption=fe.tfoot=[1,"","
    "],fe.polyline=fe.ellipse=fe.polygon=fe.circle=fe.text=fe.line=fe.path=fe.rect=fe.g=[1,'',""];var me=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i)return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild);var r,o=Object.prototype.hasOwnProperty.call(fe,i)?fe[i]:fe._default,a=o[0],s=o[1],c=o[2];for((r=t.createElement("div")).innerHTML=s+e+c;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var p=t.createDocumentFragment();r.firstChild;)p.appendChild(r.removeChild(r.firstChild));return p};function ge(e,t){return(t=t||document).querySelector(e)}function ve(e,t){return(t=t||document).querySelectorAll(e)}function ye(e){e.parentNode&&e.parentNode.removeChild(e)}function be(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 _e(e,t){return be(t,e),e}var xe=2,we={"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":xe,"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":xe,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Ee(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=we[i];r?(r===xe&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function Se(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return we[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);Ee(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)Ee(e,i,t[i])}(e,t);return e}const Ce=Object.prototype.toString;function ke(e){return new Re(e)}function Re(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Pe(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Te(e){for(var t;t=e.firstChild;)Pe(t);return e}function Ae(e){return e.cloneNode(!0)}Re.prototype.add=function(e){return this.list.add(e),this},Re.prototype.remove=function(e){return"[object RegExp]"==Ce.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Re.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n"+e+"",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function Ne(e,t){var n;return"<"===e.charAt(0)?(n=Be(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Me.svg,e),t&&Se(n,t),n}var Oe=null;function je(){return null===Oe&&(Oe=Ne("svg")),Oe}function Le(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Ie(e){return e?je().createSVGTransformFromMatrix(e):je().createSVGTransform()}var $e=/([&<>]{1})/g,ze=/([\n\r"]{1})/g,Fe={"&":"&","<":"<",">":">",'"':"'"};function He(e,t){return e.replace(t,(function(e,t){return Fe[t]||t}))}function Ve(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(He(e.textContent,$e));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n"),n=0,i=(a=e.childNodes).length;n")}else t.push("/>");break;case 8:t.push("\x3c!--",He(e.nodeValue,$e),"--\x3e");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function We(e,t){if(void 0!==t){try{!function(e,t){var n=Be(t);if(Te(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{const t=e.match(Je);return(t&&t[1]||e).trim()}))||[]}function tt(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}};const n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(e){const t=n.join(" -> ");return n.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function s(e,o){if(!i[e]&&-1!==e.indexOf(".")){const t=e.split(".");let n=s(t.shift());for(;t.length;)n=n[t.shift()];return n}if(Ye(r,e))return r[e];if(Ye(i,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),r[e]=i[e][0](i[e][1]),n.pop(),r[e]}return t.get(e,o)}function c(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Ke(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=Xe(e.slice())}return{fn:e,dependencies:(e.$inject||et(e)).map((e=>Ye(t,e)?t[e]:s(e)))}}function p(e){const{fn:t,dependencies:n}=c(e);return new(Function.prototype.bind.apply(t,[null].concat(n)))}function l(e,t,n){const{fn:i,dependencies:r}=c(e,n);return i.apply(t,r)}function u(e){return Xe((t=>e.get(t)))}function h(e,t){if(t&&t.length){const n=Object.create(null),r=Object.create(null),o=[],a=[],s=[];let c,p,l,h;for(let e in i)c=i[e],-1!==t.indexOf(e)&&("private"===c[2]?(p=o.indexOf(c[3]),-1===p?(l=c[3].createChild([],t),h=u(l),o.push(c[3]),a.push(l),s.push(h),n[e]=[h,e,"private",l]):n[e]=[s[p],e,"private",a[p]]):n[e]=[c[2],c[1]],r[e]=!0),"factory"!==c[2]&&"type"!==c[2]||!c[1].$scope||t.forEach((t=>{-1!==c[1].$scope.indexOf(t)&&(n[e]=[c[2],c[1]],r[t]=!0)}));t.forEach((e=>{if(!r[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new tt(e,o)}const d={factory:l,type:p,value:function(e){return e}};function f(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function m(e){const t=e.__exports__;if(t){const n=e.__modules__,r=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=h((n||[]).concat(r)),a=Xe((function(e){return o.get(e)}));t.forEach((function(e){i[e]=[a,e,"private",o]}));const s=(e.__init__||[]).slice();return s.unshift((function(){o.init()})),f(e=Object.assign({},e,{__init__:s}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;if("private"===e[t][2])return void(i[t]=e[t]);const n=e[t][0],r=e[t][1];i[t]=[d[n],nt(n,r),n]})),f(e,o)}function g(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(g,e)).indexOf(t)?e:e.concat(t)}this.get=s,this.invoke=l,this.instantiate=p,this.createChild=h,this.init=function(e){const t=e.reduce(g,[]).map(m);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function nt(e,t){return"value"!==e&&Ke(t)&&(t=Xe(t.slice())),t}var it=1e3;function rt(e,t){var n=this;t=t||it,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 ot(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function at(e){return["L",e.x,e.y]}function st(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,a,s;for(let r=1;rr||void 0===r)&&(r=s+l),(c+p>o||void 0===o)&&(o=c+p)})),{x:n,y:i,height:o-i,width:r-n}}function yt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function bt(e){return!(!e||!e.isFrame)}function _t(e,t){return z({},e||{},t||{})}function xt(e,t){rt.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})}rt.prototype.canRender=function(e){},rt.prototype.drawShape=function(e,t){},rt.prototype.drawConnection=function(e,t){},rt.prototype.getShapePath=function(e){},rt.prototype.getConnectionPath=function(e){},e(xt,rt),xt.prototype.canRender=function(){return!0},xt.prototype.drawShape=function(e,t,n){var i=Ne("rect");return Se(i,{x:0,y:0,width:t.width||0,height:t.height||0}),bt(t)?Se(i,z({},this.FRAME_STYLE,n||{})):Se(i,z({},this.SHAPE_STYLE,n||{})),_e(e,i),i},xt.prototype.drawConnection=function(e,t,n){var i=lt(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return _e(e,i),i},xt.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return ot([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},xt.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 ot(r)},xt.$inject=["eventBus","styles"];const wt={__init__:["defaultRenderer"],defaultRenderer:["type",xt],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 z(this.style(t,n),{class:e})},this.style=function(t,n){h(t)||n||(n=t,t=[]);var i=w(t,(function(t,n){return z(t,e[n]||{})}),{});return n?z(i,n):i},this.computeStyle=function(e,n,i){return h(n)||(i=n,n=[]),t.style(n||[],z({},i,e||{}))}}]};function Et(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function St(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function Ct(e,t){return e&&t?e.indexOf(t):-1}function kt(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function Rt(e,t,n,i){if(void 0===i&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=kt(e,t);return Math.abs(r/o)<=i}var Pt=2;function Tt(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[e,t]of Object.entries(i))if(At(e,n))return t;return!1}function At(e,t){const n=t[0];return E(t,(function(t){return Math.abs(n[e]-t[e])<=Pt}))}function Mt(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Jt(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function en(e,t,n,i,r,o,a,s,c){null==c&&(c=1);for(var p=(c=c>1?1:c<0?0:c)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],u=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,d=0;d<12;d++){var f=p*l[d]+p,m=Jt(f,e,n,r,a),g=Jt(f,t,i,o,s),v=m*m+g*g;h+=u[d]*Ot.sqrt(v)}return p*h}function tn(e,t,n,i,r,o,a,s){if(!(It(e,n)It(r,a)||It(t,i)It(o,s))){var c=(e*i-t*n)*(o-s)-(t-i)*(r*s-o*a),p=(e-n)*(o-s)-(t-i)*(r-a);if(p){var l=nn(((e*i-t*n)*(r-a)-(e-n)*(r*s-o*a))/p),u=nn(c/p),h=+l.toFixed(2),d=+u.toFixed(2);if(!(h<+Lt(e,n).toFixed(2)||h>+It(e,n).toFixed(2)||h<+Lt(r,a).toFixed(2)||h>+It(r,a).toFixed(2)||d<+Lt(t,i).toFixed(2)||d>+It(t,i).toFixed(2)||d<+Lt(o,s).toFixed(2)||d>+It(o,s).toFixed(2)))return{x:l,y:u}}}}function nn(e){return Math.round(1e11*e)/1e11}function rn(e,t,n){if(i=Zt(e),r=Zt(t),i=qt(i),!(Qt(r=qt(r),i.x,i.y)||Qt(r,i.x2,i.y)||Qt(r,i.x,i.y2)||Qt(r,i.x2,i.y2)||Qt(i,r.x,r.y)||Qt(i,r.x2,r.y)||Qt(i,r.x,r.y2)||Qt(i,r.x2,r.y2)||(i.xr.x||r.xi.x)&&(i.yr.y||r.yi.y)))return n?0:[];for(var i,r,o=en(...e),a=en(...t),s=sn(e)?1:~~(o/5)||1,c=sn(t)?1:~~(a/5)||1,p=[],l=[],u={},h=n?0:[],d=0;d=0&&S<=1&&C>=0&&C<=1&&(n?h++:h.push({x:E.x,y:E.y,t1:S,t2:C}))}}return h}function on(e,t,n){e=un(e),t=un(t);for(var i,r,o,a,s,c,p,l,u,h,d=n?0:[],f=0,m=e.length;f2&&(i.push([t,...o.splice(0,2)]),a="l",t="m"==t?"l":"L");o.length>=n[a]&&(i.push([t,...o.splice(0,n[a])]),n[a]););})),i.toString=Ut.toString,t.arr=Gt(i),i}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,s=0,c=0;"M"==e[0][0]&&(a=r=+e[0][1],s=o=+e[0][2],c++,i[0]=["M",r,o]);for(var p,l,u=c,h=e.length;u=1e3&&delete n[i.shift()],i.push(t),n[t]=function(e,t,n){return{x:e*Ot.cos(n)-t*Ot.sin(n),y:e*Ot.sin(n)+t*Ot.cos(n)}}(...arguments),n[t])};if(p)E=p[0],S=p[1],x=p[2],w=p[3];else{e=(l=f(e,t,-h)).x,t=l.y;var m=(e-(s=(l=f(s,c,-h)).x))/2,g=(t-(c=l.y))/2,v=m*m/(n*n)+g*g/(i*i);v>1&&(n*=v=Ot.sqrt(v),i*=v);var y=n*n,b=i*i,_=(o==a?-1:1)*Ot.sqrt(zt((y*b-y*g*g-b*m*m)/(y*g*g+b*m*m))),x=_*n*g/i+(e+s)/2,w=_*-i*m/n+(t+c)/2,E=Ot.asin(((t-w)/i).toFixed(9)),S=Ot.asin(((c-w)/i).toFixed(9));(E=eS&&(E-=2*jt),!a&&S>E&&(S-=2*jt)}var C=S-E;if(zt(C)>u){var k=S,R=s,P=c;S=E+u*(a&&S>E?1:-1),d=ln(s=x+n*Ot.cos(S),c=w+i*Ot.sin(S),n,i,r,0,a,R,P,[S,k,x,w])}C=S-E;var T=Ot.cos(E),A=Ot.sin(E),M=Ot.cos(S),D=Ot.sin(S),B=Ot.tan(C/4),N=4/3*n*B,O=4/3*i*B,j=[e,t],L=[e+N*A,t-O*T],I=[s+N*D,c-O*M],$=[s,c];if(L[0]=2*j[0]-L[0],L[1]=2*j[1]-L[1],p)return[L,I,$].concat(d);for(var z=[],F=0,H=(d=[L,I,$].concat(d).join().split(",")).length;F7){e[t].shift();for(var i=e[t];i.length;)a[t]="A",e.splice(t++,0,["C",...i.splice(0,6)]);e.splice(t,1),l=n.length}},a=[],s="",c="",p=0,l=n.length;p=r.right,s=i.top-n.y>=r.bottom,c=o?"top":s?"bottom":null,p=i.right+n.x<=r.left?"left":a?"right":null;return p&&c?c+"-"+p:p||c||"intersect"}function _n(e,t,n){var i=function(e,t){return on(e,t)}(e,t);return 1===i.length||2===i.length&&kt(i[0],i[1])<1?mn(i[0]):i.length>1?(i=M(i,(function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t})),mn(i[n?0:i.length-1])):null}function xn(e,t){return Math.round(e*t)/t}function wn(e){return f(e)?e+"px":e}function En(e,t,n){const i=Ne("g");ke(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const Sn={shape:["x","y","width","height"],connection:["waypoints"]};function Cn(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 kn(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Cn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Cn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=z({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),X(n,{position:"relative",overflow:"hidden",width:wn(e.width),height:wn(e.height)}),t.appendChild(n),n}(e),i=this._svg=Ne("svg");Se(i,{width:"100%",height:"100%"}),_e(n,i);const r=this._viewport=En(i,"viewport");e.deferUpdate&&(this._viewboxChanged=L(I(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)},Cn.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},Cn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=yt(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Cn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Cn.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},Cn.prototype._getChildIndex=function(e){return w(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Cn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:En(this._viewport,"layer-"+e,n),index:t,visible:!0}},Cn.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},Cn.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?(Pe(n),t.visible=!1,n):n},Cn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Pe(t.group))},Cn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Cn.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},Cn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Cn.prototype._findPlaneForRoot=function(e){return y(this._planes,(function(t){return t.rootElement===e}))},Cn.prototype.getContainer=function(){return this._container},Cn.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(x([i.gfx,i.secondaryGfx],(function(e){e&&(n?ke(e).add(t):ke(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Cn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Cn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Cn.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),ke(this.getGraphics(e)).has(t)},Cn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Cn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Cn.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},Cn.prototype.removeRootElement=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},Cn.prototype.setRootElement=function(e){if(e===this._rootElement)return;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},Cn.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)},Cn.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})},Cn.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})},Cn.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=Sn[e],i=E(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Cn.prototype._setParent=function(e,t,n){St(t.children,e,n),e.parent=t},Cn.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},Cn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Cn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Cn.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),Et(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Cn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Cn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Cn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Cn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Cn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Cn.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,c,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);Ue(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=Ue(t),r=a?a.matrix:function(e,t,n,i,r,o){var a=je().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Le(a,e);case 6:return Le(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),s=xn(r.a,1e3),c=xn(-r.e||0,1e3),p=xn(-r.f||0,1e3),e=this._cachedViewbox={x:c?c/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})},Cn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),kn(t,n)})),{x:n.e,y:n.f}},Cn.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=vt(e),o=gn(r),a=this.viewbox(),s=this.zoom();let c,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 l=gn(a);if(r.width=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},Cn.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,c,p,l;c=i.getCTM();const u=c.a;return t?(a=z(o,t),s=a.matrixTransform(c.inverse()),p=r.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),l=c.multiply(p)):l=r.scale(e),kn(this._viewport,l),l},Cn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Cn.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;return n=e.waypoints?this.getGraphics(e).getBBox():e,{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}},Cn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Rn="data-element-id";function Pn(e){this._elements={},this._eventBus=e}function Tn(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 An(e,t){if(!(this instanceof An))return new An(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Pn.$inject=["eventBus"],Pn.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),Se(t,Rn,i),n&&Se(n,Rn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Pn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(Se(i.gfx,Rn,""),i.secondaryGfx&&Se(i.secondaryGfx,Rn,""),delete t[n])},Pn.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)},Pn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&Se(t,Rn,i),t},Pn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&Se(e,Rn);var n=this._elements[t];return n&&n.element},Pn.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},Pn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i in ref");t=this.props[t]}t.collection?Tn(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)},An.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||Tn(this,t,e),n},An.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},An.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},An.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Mn=new An({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Dn=new An({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Bn=new An({name:"attachers",collection:!0},{name:"host"}),Nn=new An({name:"outgoing",collection:!0},{name:"source"}),On=new An({name:"incoming",collection:!0},{name:"target"});function jn(){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)}}),Mn.bind(this,"parent"),Dn.bind(this,"labels"),Nn.bind(this,"outgoing"),On.bind(this,"incoming")}function Ln(){jn.call(this),Mn.bind(this,"children"),Bn.bind(this,"host"),Bn.bind(this,"attachers")}function In(){jn.call(this),Mn.bind(this,"children")}function $n(){Ln.call(this),Dn.bind(this,"labelTarget")}function zn(){jn.call(this),Nn.bind(this,"source"),On.bind(this,"target")}e(Ln,jn),e(In,Ln),e($n,Ln),e(zn,jn);var Fn={connection:zn,shape:Ln,label:$n,root:In};function Hn(){this._uid=12}Hn.prototype.createRoot=function(e){return this.create("root",e)},Hn.prototype.createLabel=function(e){return this.create("label",e)},Hn.prototype.createShape=function(e){return this.create("shape",e)},Hn.prototype.createConnection=function(e){return this.create("connection",e)},Hn.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Fn[e];if(!n)throw new Error("unknown type: <"+e+">");return z(new n,t)}(e,t)};var Vn="__fn",Wn=Array.prototype.slice;function Gn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Un(){}function qn(e){return e.childNodes[0]}function Kn(e,t,n,i,r){var o=Ie();o.setTranslate(t,n);var a=Ie();a.setRotate(i||0,0,0);var s=Ie();s.setScale(r||1,r||1),Ue(e,[o,a,s])}function Yn(e,t,n){var i=Ie();i.setTranslate(t,n),Ue(e,i)}function Xn(e,t){var n=Ie();n.setRotate(t,0,0),Ue(e,n)}function Zn(e,t){this._eventBus=e,this._elementRegistry=t}function Qn(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}Gn.prototype.on=function(e,t,n,i){if(e=h(e)?e:[e],m(t)&&(i=n,n=t,t=1e3),!f(t))throw new Error("priority must be a number");var r=n;i&&((r=I(n,i))[Vn]=n[Vn]||n);var o=this;e.forEach((function(e){o._addListener(e,{priority:t,callback:r,next:null})}))},Gn.prototype.once=function(e,t,n,i){var r=this;if(m(t)&&(i=n,n=t,t=1e3),!f(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[Vn]=n,this.on(e,t,o)},Gn.prototype.off=function(e,t){e=h(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},Gn.prototype.createEvent=function(e){var t=new Un;return t.init(e),t},Gn.prototype.fire=function(e,t){var n,i,r,o;if(o=Wn.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 Un?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}},Gn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Gn.prototype._destroy=function(){this._listeners={}},Gn.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Gn.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},Gn.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority or , got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function pi(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function li(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,x(e,I(this.registerPackage,this))}function ui(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function hi(e){this.model=e}function di(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function fi(e){return e.replace(/^:/,"")}function mi(e,t={}){this.properties=new hi(this),this.factory=new ni(this,this.properties),this.registry=new li(e,this.properties),this.typeCache={},this.config=t}pi.prototype.build=function(){return F(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},pi.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)},pi.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},pi.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=ci(r[0],i),a=ci(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},pi.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},pi.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},pi.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},pi.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},pi.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},pi.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")},pi.prototype.hasProperty=function(e){return this.propertiesByName[e]},pi.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(x(e.properties,I((function(n){n=z({},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)},li.prototype.getPackage=function(e){return this.packageMap[e]},li.prototype.getPackages=function(){return this.packages},li.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;ui(t,e,"prefix"),ui(t,e,"uri"),x(e.types,I((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},li.prototype.registerType=function(e,t){var n=ci((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z(e.meta||{})})).name,t.prefix),i=n.name,r={};x(e.properties,I((function(e){var t=ci(e.name,n.prefix),i=t.name;ai(e.type)||(e.type=ci(e.type,t.prefix).name),z(e,{ns:t,name:i}),r[i]=e}),this)),z(e,{ns:n,name:i,propertiesByName:r}),x(e.extends,I((function(e){var t=ci(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},li.prototype.mapTypes=function(e,t,n){var i=ai(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=ci(n,ai(n)?"":e.prefix);r.mapTypes(o,t,i)}function a(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");x(i.superClass,n?a:function(e){return o(e,!1)}),t(i,!n),x(i.traits,a)},li.prototype.getEffectiveDescriptor=function(e){var t=ci(e),n=new pi(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},li.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},hi.prototype.set=function(e,t,n){if(!g(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[fi(t)]:i?r in e?e[r]=n:di(e,i,n):e.$attrs[fi(t)]=n},hi.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[fi(t)];var i=n.name;return!e[i]&&n.isMany&&di(e,n,[]),e[i]},hi.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},hi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},hi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},hi.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},mi.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},mi.prototype.getType=function(e){var t=this.typeCache,n=g(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},mi.prototype.createAny=function(e,t,n){var i=ci(e),r={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){!function(e,t,n){let i=e;x(t,(function(e,r){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let o=t[r+1],a=i[e];l(o)&&u(a)&&(a=i[e]=isNaN(+o)?{}:[]),p(o)?p(n)?delete i[e]:i[e]=n:i=a}))}(this,[e],t)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),x(n,(function(e,t){d(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},mi.prototype.getPackage=function(e){return this.registry.getPackage(e)},mi.prototype.getPackages=function(){return this.registry.getPackages()},mi.prototype.getElementDescriptor=function(e){return e.$descriptor},mi.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},mi.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},mi.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var gi=String.fromCharCode,vi=Object.prototype.hasOwnProperty,yi=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,bi={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function _i(e,t,n,i){return i?vi.call(bi,i)?bi[i]:"&"+i+";":gi(t||parseInt(n,16))}function xi(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(yi,_i):e}Object.keys(bi).forEach((function(e){bi[e.toUpperCase()]=bi[e]}));var wi="xsi:type",Ei="non-whitespace outside of root node";function Si(e){return new Error(e)}function Ci(e){return"missing namespace for prefix <"+e+">"}function ki(e){return{get:e,enumerable:!0}}function Ri(e){var t,n={};for(t in e)n[t]=e[t];return n}function Pi(e){return e+"$uri"}function Ti(){return{line:0,column:0}}function Ai(e){throw e}function Mi(e){if(!this)return new Mi(e);var t,n,i,r,o,a,s,c,p,l=e&&e.proxy,u=Ai,h=Ti,d=!1,f=!1,m=null,g=!1;function v(e){e instanceof Error||(e=Si(e)),m=e,u(e,h)}function y(e){o&&(e instanceof Error||(e=Si(e)),o(e,h))}this.on=function(e,p){if("function"!=typeof p)throw Si("required args ");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":c=p;break;case"question":s=p;break;case"comment":a=p;break;default:throw Si("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Si("required args ");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 Si("required args ");return m=null,function(e){var o,u,m,b,_,x,w,E,S,C,k,R=f?[]:null,P=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[Pi(n)]=t;return i}(p):null,T=[],A=0,M=!1,D=!1,B=0,N=0,O="",j=0;function L(){if(null!==k)return k;var e,t,n,i,r,o,a,s,c,l,u,h=f&&P.xmlns,m=f&&d?[]:null,g=j,v=O,b=v.length,_={},x={};e:for(;g8)){for((l<65||l>122||l>90&&l<97)&&95!==l&&58!==l&&(y("illegal first char attribute name"),c=!0),u=g+1;u96&&l<123||l>64&&l<91||l>47&&l<59||46===l||45===l||95===l)){if(32===l||l<14&&l>8){y("missing attribute value"),g=u;continue e}if(61===l)break;y("illegal attribute name char"),c=!0}if("xmlns:xmlns"===(s=v.substring(g,u))&&(y("illegal declaration of xmlns"),c=!0),34===(l=v.charCodeAt(u+1)))-1===(u=v.indexOf('"',g=u+2))&&-1!==(u=v.indexOf("'",g))&&(y("attribute value quote missmatch"),c=!0);else if(39===l)-1===(u=v.indexOf("'",g=u+2))&&-1!==(u=v.indexOf('"',g))&&(y("attribute value quote missmatch"),c=!0);else for(y("missing attribute value quotes"),c=!0,u+=1;u8);u++);for(-1===u&&(y("missing closing quotes"),u=b,c=!0),c||(o=v.substring(g,u)),g=u;u+18);u++)g===u&&(y("illegal character after attribute end"),c=!0);if(g=u+1,!c)if(s in x)y("attribute <"+s+"> already defined");else if(x[s]=!0,f)if(d){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=xi(o),t=Pi(r),!(a=p[e])){if("xmlns"===r||t in P&&P[t]!==e)do{a="ns"+A++}while(void 0!==P[a]);else a=r;p[e]=a}P[r]!==a&&(i||(P=Ri(P),i=!0),P[r]=a,"xmlns"===r&&(P[Pi(a)]=e,h=a),P[t]=e),_[s]=o;continue}m.push(s,o)}else-1!==(l=s.indexOf(":"))?(n=P[s.substring(0,l)])?((s=h===n?s.substr(l+1):n+s.substr(l))===wi&&(-1!==(l=o.indexOf(":"))?(n=o.substring(0,l),o=(n=P[n]||n)+o.substring(l)):o=h+":"+o),_[s]=o):y(Ci(s.substring(0,l))):_[s]=o;else _[s]=o}if(d)for(g=0,b=m.length;g=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>B);)r+=1,a=s;return-1==B?(o=s,n=e.substring(N)):0===N?n=e.substring(N,B):(o=B-a,n=-1==N?e.substring(B):e.substring(B,N+1)),{data:n,line:r,column:o}},l&&(C=Object.create({},{name:ki((function(){return E})),originalName:ki((function(){return S})),attrs:ki(L),ns:ki((function(){return P}))}));-1!==N;){if(-1===(B=60===e.charCodeAt(N)?N:e.indexOf("<",N)))return T.length?v("unexpected end of file"):0===N?v("missing start tag"):void(N",B)))return v("unclosed cdata");if(r&&(r(e.substring(B+9,N),h),g))return;N+=3;continue}if(45===b&&45===e.charCodeAt(B+3)){if(-1===(N=e.indexOf("--\x3e",B)))return v("unclosed comment");if(a&&(a(e.substring(B+4,N),xi,h),g))return;N+=3;continue}}if(63!==_){for(u=B+1;;u++){if(x=e.charCodeAt(u),isNaN(x))return N=-1,v("unclosed tag");if(34===x)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===x)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===x){N=u;break}}if(33!==_){if(k={},47===_){if(M=!1,D=!0,!T.length)return v("missing open tag");if(u=E=T.pop(),b=B+2+u.length,e.substring(B+2,b)!==u)return v("closing tag mismatch");for(;b8&&_<14))return v("close tag")}else{if(47===e.charCodeAt(N-1)?(u=E=e.substring(B+1,N-1),M=!0,D=!0):(u=E=e.substring(B+1,N),M=!0,D=!1),!(_>96&&_<123||_>64&&_<91||95===_||58===_))return v("illegal first char nodeName");for(b=1,m=u.length;b96&&_<123||_>64&&_<91||_>47&&_<59||45===_||95===_||46==_)){if(32===_||_<14&&_>8){E=u.substring(0,b),k=null;break}return v("invalid nodeName")}D||T.push(E)}if(f){if(o=P,M&&(D||R.push(o),null===k&&(d=-1!==u.indexOf("xmlns",b))&&(j=b,O=u,L(),d=!1)),S=E,-1!==(_=E.indexOf(":"))){if(!(w=P[E.substring(0,_)]))return v("missing namespace on <"+S+">");E=E.substr(_+1)}else w=P.xmlns;w&&(E=w+":"+E)}if(M&&(j=b,O=u,n&&(l?n(C,xi,D,h):n(E,L,xi,D,h),g)))return;if(D){if(i&&(i(l?C:E,xi,M,h),g))return;f&&(P=M?o:R.pop())}N+=1}else{if(c&&(c(e.substring(B,N+1),xi,h),g))return;N+=1}}else{if(-1===(N=e.indexOf("?>",B)))return v("unclosed question");if(s&&(s(e.substring(B,N+2),h),g))return;N+=2}}}(e),h=Ti,g=!1,m},this.stop=function(){g=!0}}function Di(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Bi={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Ni="xsi:type";function Oi(e){return e.xml&&e.xml.serialize}function ji(e){return Oi(e)===Ni}function Li(e,t){return Di(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Ii(e){return new Error(e)}function $i(e){return e.$descriptor}function zi(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Ii("expected element");var t,n=this.elementsById,i=$i(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 Ii("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Fi(){}function Hi(){}function Vi(){}function Wi(e,t){this.property=e,this.context=t}function Gi(e,t){this.element=t,this.propertyDesc=e}function Ui(){}function qi(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Ki(e,t,n){qi.call(this,e,t,n)}function Yi(e,t,n){this.model=e,this.context=n}function Xi(e){e instanceof mi&&(e={model:e}),z(this,{lax:!1},e)}Fi.prototype.handleEnd=function(){},Fi.prototype.handleText=function(){},Fi.prototype.handleNode=function(){},Hi.prototype=Object.create(Fi.prototype),Hi.prototype.handleNode=function(){return this},Vi.prototype=Object.create(Fi.prototype),Vi.prototype.handleText=function(e){this.body=(this.body||"")+e},Wi.prototype=Object.create(Vi.prototype),Wi.prototype.handleNode=function(e){if(this.element)throw Ii("expected no sub nodes");return this.element=this.createReference(e),this},Wi.prototype.handleEnd=function(){this.element.id=this.body},Wi.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Gi.prototype=Object.create(Vi.prototype),Gi.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=oi(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Ui.prototype=Object.create(Vi.prototype),Ui.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},qi.prototype=Object.create(Ui.prototype),qi.prototype.addReference=function(e){this.context.addReference(e)},qi.prototype.handleText=function(e){if(!$i(this.element).bodyProperty)throw Ii("unexpected body text <"+e+">");Vi.prototype.handleText.call(this,e)},qi.prototype.handleEnd=function(){var e=this.body,t=this.element,n=$i(t).bodyProperty;n&&void 0!==e&&(e=oi(n.type,e),t.set(n.name,e))},qi.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=$i(i),o=this.context,a=new i({}),s=this.model;return x(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?x(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=oi(i.type,e):"xmlns"!==n&&(t=ci(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},qi.prototype.getPropertyForNode=function(e){var t,n,i=ci(e.name),r=this.type,o=this.model,a=$i(r),s=i.name,c=a.propertiesByName[s];if(c&&!c.isAttr)return ji(c)&&(t=e.attributes[Ni])?(t=function(e,t){var n=ci(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),z({},c,{effectiveType:$i(n=o.getType(t)).name})):c;var p=o.getPackage(i.prefix);if(p){if(t=Li(i,p),n=o.getType(t),c=y(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})),c)return z({},c,{effectiveType:$i(n).name})}else if(c=y(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})),c)return c;throw Ii("unrecognized element <"+i.name+">")},qi.prototype.toString=function(){return"ElementDescriptor["+$i(this.type).name+"]"},qi.prototype.valueHandler=function(e,t){return new Gi(e,t)},qi.prototype.referenceHandler=function(e){return new Wi(e,this.context)},qi.prototype.handler=function(e){return"Element"===e?new Yi(this.model,e,this.context):new qi(this.model,e,this.context)},qi.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,si(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?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Ki.prototype=Object.create(qi.prototype),Ki.prototype.createElement=function(e){var t=e.name,n=ci(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&Li(n,o)||t;if(!r.hasType(a))throw Ii("unexpected element <"+e.originalName+">");return qi.prototype.createElement.call(this,e)},Yi.prototype=Object.create(Ui.prototype),Yi.prototype.createElement=function(e){var t=e.name,n=ci(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Yi.prototype.handleChild=function(e){var t=new Yi(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},Yi.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Xi.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof qi?(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 zi(z({},t,{rootHandler:i})),s=new Mi({proxy:!0}),c=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 c="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:c,error:e}),!0;throw Ii(c)}function l(e,t){return p(e,t,!0)}i.context=a,c.push(i);var u=/^<\?xml /i,h=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function f(e,t){try{c.peek().handleText(e)}catch(e){l(e,t)}}var m=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(m).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=c.peek();try{c.push(n.handleNode(e))}catch(e){p(e,t,o)&&c.push(new Hi)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=h.exec(e),n=t&&t[1];n&&!d.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){c.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",l),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=$i(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 c=r.get(s.name),p=c.indexOf(t);-1===p&&(p=c.length),o?c[p]=o:c.splice(p,1)}else r.set(s.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=Ii("failed to parse document as <"+i.type.$descriptor.name+">"));var c=a.warnings,p=a.references,l=a.elementsById;return r?(r.warnings=c,n(r)):t({rootElement:o,elementsById:l,references:p,warnings:c})}))},Xi.prototype.handler=function(e){return new Ki(this.model,e)};var Zi=/<|>|'|"|&|\n\r|\n/g,Qi=/<|>|&/g;function Ji(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 er(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function tr(e){return g(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var nr={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},ir={"<":"lt",">":"gt","&":"amp"};function rr(e,t,n){return(e=g(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function or(e){this.tagName=e}function ar(){}function sr(e){this.tagName=e}function cr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function pr(e,t){cr.call(this,e,t)}function lr(){this.value="",this.write=function(e){this.value+=e}}function ur(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function hr(e){return e=z({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new lr,r=new ur(i,e.format);if(e.preamble&&r.append('\n'),(new cr).build(t).serializeTo(r),!n)return i.value}}}function dr(e,t){mi.call(this,e,t)}or.prototype.build=function(e){return this.element=e,this},or.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()},ar.prototype.serializeValue=ar.prototype.serializeTo=function(e){e.append(this.escape?rr(this.value,Qi,ir):this.value)},ar.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Qi)&&(this.escape=!0),this},er(sr,ar),sr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()},cr.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 _(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!v(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(_(n,(function(e){return e.isAttr}))),this.parseContainments(_(n,(function(e){return!e.isAttr})))),this.parseGenericAttributes(e,t),this},cr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?z({localName:t.ns.localName},e):z({localName:(n=t.ns.localName,i=t.$pkg,Di(i)?(r=n).charAt(0).toLowerCase()+r.slice(1):n)},e);var n,i,r}(this.logNamespaceUsed(e.ns),e)},cr.prototype.nsPropertyTagName=function(e){return function(e,t){return z({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},cr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},cr.prototype.nsAttributeName=function(e){var t;if(t=g(e)?ci(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}:z({localName:t.localName},n)},cr.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return x(e,(function(r,o){"$body"===o?n.push((new ar).build({type:"String"},r)):"$children"===o?x(r,(function(e){n.push(new cr(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},cr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=ci(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)}},cr.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return x(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},cr.prototype.parseGenericAttributes=function(e,t){var n=this;x(t,(function(t){if(t.name!==Ni)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},cr.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;x(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(si(e.type))x(r,(function(i){n.push(new sr(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)x(r,(function(i){n.push(new or(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var a=ji(e),s=function(e){return"property"===Oi(e)}(e);x(r,(function(i){var r;r=a?new pr(t,e):s?new cr(t,e):new cr(t),n.push(r.build(i))}))}}))},cr.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Ji(t):n=t),n},cr.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},cr.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,c=e.uri;if(!s&&!c)return{localName:e.localName};if(r=Bi[s]||o&&(o.getPackage(s)||{}).uri,!(c=c||r||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(c))){for(n=s,i=1;a.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:c},r===c)}return s&&a.mapPrefix(s,c),e},cr.prototype.parseAttributes=function(e){var t=this,n=this.element;x(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];x(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},cr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),tr(e)},cr.prototype.addAttribute=function(e,t){var n=this.attrs;g(t)&&(t=rr(t,Zi,nr));var i=b(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)},cr.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)),x(t,(function(t){e.append(" ").append(tr(t.name)).append('="').append(t.value).append('"')}))},cr.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(),x(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()},er(pr,cr),pr.prototype.parseNsAttributes=function(e){var t=cr.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(Ni),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},pr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},dr.prototype=Object.create(mi.prototype),dr.prototype.fromXML=function(e,t,n){g(t)||(n=t,t="bpmn:Definitions");var i=new Xi(z({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},dr.prototype.toXML=function(e,t){var n=new hr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var fr={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 mr(e,t){return new dr(z({},fr,e),t)}function gr(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}var vr="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 yr(e){v(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(vr)}})}function br(e,t){return e.$instanceOf(t)}function _r(e,t){var n={},i=[],r={};function o(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function s(n,i){try{var o=r[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:gr(n)}));return e.element(n,r[n.id],i)}(n,i);return a(n),o}catch(e){c(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:gr(n)})),console.error(e)}}function c(t,n){e.error(t,n)}var p=this.registerDi=function(e){var n=e.bpmnElement;n?r[n.id]?c(t("multiple DI elements defined for {element}",{element:gr(n)}),{element:n}):(r[n.id]=e,yr(n)):c(t("no bpmnElement referenced in {element}",{element:gr(e)}),{element:e})};function l(e){p(e)}this.handleDefinitions=function(a,s){var f=a.diagrams;if(s&&-1===f.indexOf(s))throw new Error(t("diagram not part of bpmn:Definitions"));if(!s&&f&&f.length&&(s=f[0]),!s)throw new Error(t("no diagram to display"));r={},function(e){var t;t=e.plane,p(t),x(t.planeElement,l)}(s);var m=s.plane;if(!m)throw new Error(t("no plane for {element}",{element:gr(s)}));var g=m.bpmnElement;if(!g){if(g=function(e){return y(e.rootElements,(function(e){return br(e,"bpmn:Process")||br(e,"bpmn:Collaboration")}))}(a),!g)throw new Error(t("no process or collaboration to display"));c(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:gr(m),rootElement:gr(g)})),m.bpmnElement=g,p(m)}var v,w,E=function(t,n){return e.root(t,r[t.id],n)}(g,m);if(br(g,"bpmn:Process")||br(g,"bpmn:SubProcess"))h(g,E);else{if(!br(g,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:gr(m),rootElement:gr(g)}));w=E,x((v=g).participants,o(P,w)),b(v.artifacts,w),i.push((function(){!function(e,t){x(e,o(d,t))}(v.messageFlows,w)})),function(e,t){var i=_(e,(function(e){return!n[e.id]&&br(e,"bpmn:Process")&&e.laneSets}));i.forEach(o(h,t))}(a.rootElements,E)}u(i)};var u=this.handleDeferred=function(){for(;i.length;)i.shift()()};function h(e,t){R(e,t),w(e.ioSpecification,t),b(e.artifacts,t),a(e)}function d(e,t){s(e,t)}function f(e,t){s(e,t)}function m(e,t){s(e,t)}function g(e,t){s(e,t)}function v(e,t){s(e,t)}function b(e,t){x(e,(function(e){br(e,"bpmn:Association")?i.push((function(){v(e,t)})):v(e,t)}))}function w(e,t){e&&(x(e.dataInputs,o(m,t)),x(e.dataOutputs,o(g,t)))}var E=this.handleSubProcess=function(e,t){R(e,t),b(e.artifacts,t)};function S(e,t){var n=s(e,t);br(e,"bpmn:SubProcess")&&E(e,n||t),br(e,"bpmn:Activity")&&w(e.ioSpecification,t),i.push((function(){x(e.dataInputAssociations,o(f,t)),x(e.dataOutputAssociations,o(f,t))}))}function C(e,t){i.push((function(){var n=s(e,t);e.childLaneSet&&k(e.childLaneSet,n||t),function(e){x(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function k(e,t){x(e.lanes,o(C,t))}function R(e,n){!function(e,n){x(e,(function(e){br(e,"bpmn:SequenceFlow")?i.push((function(){!function(e,t){s(e,t)}(e,n)})):br(e,"bpmn:BoundaryEvent")?i.unshift((function(){S(e,n)})):br(e,"bpmn:FlowNode")?S(e,n):br(e,"bpmn:DataObject")||(br(e,"bpmn:DataStoreReference")||br(e,"bpmn:DataObjectReference")?function(e,t){s(e,t)}(e,n):c(t("unrecognized flowElement {element} in context {context}",{element:gr(e),context:n?gr(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){x(e,o(k,t))}(e.laneSets,n)}function P(e,t){var n=s(e,t),i=e.processRef;i&&h(i,n||t)}}function xr(e,t){var n=Er(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function wr(e,t){return S(t,(function(t){return xr(e,t)}))}function Er(e){return e&&e.businessObject||e}function Sr(e){return e&&e.di}function Cr(e,t,n){var i,r,o,a,s=[];function c(e,t){var n=new _r({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}},o);t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(t){var n,i=t.plane.bpmnElement,r=i;xr(i,"bpmn:Process")||xr(i,"bpmn:Collaboration")||(r=function(e){for(var t=e;t;){if(xr(t,"bpmn:Process"))return t;t=t.$parent}}(i)),n=xr(r,"bpmn:Collaboration")?r:y(e.rootElements,(function(e){if(xr(e,"bpmn:Collaboration"))return y(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=C(n.participants,(function(e){return e.processRef}))).push(n);var a=kr(o),s=[t],c=[i];return x(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===c.indexOf(t)&&(s.push(e),c.push(t))})),s}}(e,t);if(!r)throw new Error(o("no diagram to display"));x(r,(function(t){n.handleDefinitions(e,t)}));var c=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(c+"_plane")||a.findRoot(c))}return new Promise((function(p,l){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),a=e.get("canvas"),r.fire("import.render.start",{definitions:t}),c(t,n),r.fire("import.render.complete",{error:void 0,warnings:s}),p({warnings:s})}catch(e){return e.warnings=s,l(e)}}))}function kr(e){var t=[];return x(e,(function(e){e&&(t.push(e),t=t.concat(kr(e.flowElements)))})),t}var Rr,Pr='',Tr={verticalAlign:"middle"},Ar={color:"#404040"},Mr={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Dr={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Br={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"},Nr='
    '+Pr+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
    ';function Or(e){e=z({},Lr,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){const t=me(''+Pr+"");X(ge("svg",t),Tr),X(t,Ar,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),le.bind(t,"click",(function(e){Rr||(X(Rr=me(Nr),Mr),X(ge("svg",Rr),Tr),X(ge(".backdrop",Rr),Dr),X(ge(".notice",Rr),Br),X(ge(".link",Rr),Ar,{margin:"15px 20px 15px 10px",alignSelf:"center"}),he.bind(Rr,".backdrop","click",(function(e){document.body.removeChild(Rr)}))),document.body.appendChild(Rr),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function jr(e,t){return e.warnings=t,e}e(Or,ei),Or.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,c=o.warnings,p=o.elementsById;i=i.concat(c),a=this._emit("import.parse.complete",(r={error:null,definitions:a,elementsById:p,references:s,warnings:i},n.get("eventBus").createEvent(r)))||a;const l=await this.importDefinitions(a,t);return i=i.concat(l.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),jr(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]),e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},Or.prototype.importDefinitions=async function(e,t){return this._setDefinitions(e),{warnings:(await this.open(t)).warnings}},Or.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw jr(e,[]),e}if("string"==typeof e&&(n=function(e,t){return t&&y(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw jr(t,[]),t}try{this.clear()}catch(e){throw jr(e,[]),e}const{warnings:i}=await Cr(this,t,n);return{warnings:i}},Or.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},Or.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=ge("defs",t._svg),r=We(n),o=i?""+We(i)+"":"",a=n.getBBox();e='\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n\n'+o+r+""}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},Or.prototype._setDefinitions=function(e){this._definitions=e},Or.prototype.getModules=function(){return this._modules},Or.prototype.clear=function(){this.getDefinitions()&&ei.prototype.clear.call(this)},Or.prototype.destroy=function(){ei.prototype.destroy.call(this),ye(this._container)},Or.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Or.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Or.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=ge(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Or.prototype.getDefinitions=function(){return this._definitions},Or.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Or.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=z(H(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});ei.call(this,a),n&&n.container&&this.attachTo(n.container)},Or.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Or.prototype._createContainer=function(e){const t=me('
    ');return X(t,{width:Ir(e.width),height:Ir(e.height),position:e.position}),t},Or.prototype._createModdle=function(e){return new mr(z({},this._moddleExtensions,e.moddleExtensions))},Or.prototype._modules=[];const Lr={width:"100%",height:"100%",position:"relative"};function Ir(e){return e+(f(e)?"px":"")}function $r(e){Or.call(this,e),this.on("import.parse.complete",(function(e){e.error||this._collectIds(e.definitions,e.elementsById)}),this),this.on("diagram.destroy",(function(){this.get("moddle").ids.clear()}),this)}function zr(e,t){return!xr(e,"bpmn:CallActivity")&&(xr(e,"bpmn:SubProcess")?!(!(t=t||Sr(e))||!xr(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!xr(e,"bpmn:Participant")||!!Er(e).processRef)}function Fr(e){if(xr(e,"bpmn:Participant")||xr(e,"bpmn:Lane")){var t=Sr(e).isHorizontal;return void 0===t||t}}function Hr(e){return e&&!!Er(e).triggeredByEvent}function Vr(e,t){return S(Er(e).eventDefinitions,(function(e){return xr(e,t)}))}e($r,Or),$r.prototype._createModdle=function(e){var t=Or.prototype._createModdle.call(this,e);return t.ids=new o([32,36,1]),t},$r.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Wr={width:90,height:20},Gr=15;function Ur(e){return xr(e,"bpmn:Event")||xr(e,"bpmn:Gateway")||xr(e,"bpmn:DataStoreReference")||xr(e,"bpmn:DataObjectReference")||xr(e,"bpmn:DataInput")||xr(e,"bpmn:DataOutput")||xr(e,"bpmn:SequenceFlow")||xr(e,"bpmn:MessageFlow")||xr(e,"bpmn:Group")}function qr(e){return dn(e.label)}function Kr(e){return e.waypoints?function(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)1?o.get("parallelMultiple")?function(e,t,n={}){return E(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{fill:to(t,c,n.stroke),stroke:to(t,c,n.stroke),strokeWidth:1})}(t,e,n):function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{fill:r?to(t,c,n.stroke):eo(t,s,n.fill),strokeWidth:1})}(t,e,n,a):Jr(o,"bpmn:MessageEventDefinition")?function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{fill:r?to(t,c,n.stroke):eo(t,s,n.fill),stroke:r?eo(t,s,n.fill):to(t,c,n.stroke),strokeWidth:1})}(t,e,n,a):Jr(o,"bpmn:TimerEventDefinition")?function(e,t,n={}){var r=y(e,t.width,t.height,.2*t.height,{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:2});E(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{stroke:to(t,c,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}}),p=t.width/2,l=t.height/2;E(e,a,{strokeWidth:1,stroke:to(t,c,n.stroke),transform:"rotate("+30*o+","+l+","+p+")"})}return r}(t,e,n):Jr(o,"bpmn:ConditionalEventDefinition")?function(e,t,n={}){return E(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:1})}(t,e,n):Jr(o,"bpmn:SignalEventDefinition")?function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?to(t,c,n.stroke):eo(t,s,n.fill),stroke:to(t,c,n.stroke)})}(t,e,n,a):Jr(o,"bpmn:EscalationEventDefinition")?function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{fill:r?to(t,c,n.stroke):eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:1})}(t,e,n,a):Jr(o,"bpmn:LinkEventDefinition")?function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?to(t,c,n.stroke):eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:1})}(t,e,n,a):Jr(o,"bpmn:ErrorEventDefinition")?function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{fill:r?to(t,c,n.stroke):eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:1})}(t,e,n,a):Jr(o,"bpmn:CancelEventDefinition")?function(e,t,n={},r){var o=E(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?to(t,c,n.stroke):"none",stroke:to(t,c,n.stroke),strokeWidth:1});return Xn(o,45),o}(t,e,n,a):Jr(o,"bpmn:CompensateEventDefinition")?function(e,t,n={},r){return E(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{fill:r?to(t,c,n.stroke):eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:1})}(t,e,n,a):Jr(o,"bpmn:TerminateEventDefinition")?function(e,t,n={}){return y(e,t.width,t.height,8,{fill:to(t,c,n.stroke),stroke:to(t,c,n.stroke),strokeWidth:4})}(t,e,n):null}var P={ParticipantMultiplicityMarker:function(e,t,n={}){var r=ro(t,n),o=oo(t,n);S("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:eo(t,s,n.fill),stroke:to(t,c,n.stroke)})},SubProcessMarker:function(e,t,n={}){Yn(b(e,14,14,0,{strokeWidth:1,fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke)}),t.width/2-7.5,t.height-20),S("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke)})},ParallelMarker:function(e,t,n){var r=ro(t,n),o=oo(t,n);S("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:eo(t,s,n.fill),stroke:to(t,c,n.stroke)})},SequentialMarker:function(e,t,n){S("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke)})},CompensationMarker:function(e,t,n){S("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke)})},LoopMarker:function(e,t,n){var r=ro(t,n),o=oo(t,n);S("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:to(t,c,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=ro(t,n),o=oo(t,n);S("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:to(t,c,n.stroke),stroke:to(t,c,n.stroke)})}};function T(e,t,n,i){P[e](t,n,i)}function A(e,t,n,i={}){i={fill:i.fill,stroke:i.stroke,width:ro(t,i),height:oo(t,i)};var r=Er(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},x(n,(function(n){T(n,e,t,i)})),r.get("isForCompensation")&&T("CompensationMarker",e,t,i),xr(r,"bpmn:AdHocSubProcess")&&T("AdhocMarker",e,t,i);var a=r.get("loopCharacteristics"),s=a&&a.get("isSequential");a&&(void 0===s&&T("LoopMarker",e,t,i),!1===s&&T("ParallelMarker",e,t,i),!0===s&&T("SequentialMarker",e,t,i))}function M(e,t,n={}){n=z({size:{width:100}},n);var i=o.createText(t||"",n);return ke(i).add("djs-label"),_e(e,i),i}function D(e,t,n,i={}){var r=Er(t),o=io({x:t.x,y:t.y,width:t.width,height:t.height},i);return M(e,r.name,{align:n,box:o,padding:7,style:{fill:no(t,p,c,i.stroke)}})}function B(e,t,n,i={}){var r=Fr(n),o=M(e,t,{box:{height:30,width:r?oo(n,i):ro(n,i)},align:"center-middle",style:{fill:no(n,p,c,i.stroke)}});r&&Kn(o,0,1*oo(n,i),270)}function N(e,t,n={}){var{width:i,height:r}=io(t,n);return b(e,i,r,10,{...n,fill:eo(t,s,n.fill),fillOpacity:so,stroke:to(t,c,n.stroke)})}function O(e,t,n={}){var i=Er(t),r=eo(t,s,n.fill),o=to(t,c,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=po(n,["markerStart","markerEnd"]),w(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function j(e,t,n={}){var r=eo(t,s,n.fill),o=to(t,c,n.stroke),a=E(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:so,stroke:o});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(Er(t))&&E(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}),a}function L(e,t,n={}){return y(e,t.width,t.height,{fillOpacity:so,...n,fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke)})}function I(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=h(i);var s=Ne("polygon",{...i,points:a});return _e(e,s),s}(e,t.width,t.height,{fill:eo(t,s,n.fill),fillOpacity:so,stroke:to(t,c,n.stroke)})}function $(e,t,n={}){var i=b(e,ro(t,n),oo(t,n),0,{fill:eo(t,s,n.fill),fillOpacity:n.fillOpacity||so,stroke:to(t,c,n.stroke),strokeWidth:1.5}),r=Er(t);return xr(r,"bpmn:Lane")&&B(e,r.get("name"),t,n),i}function F(e,t,n={}){var i=N(e,t,n);Hr(t)&&Se(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var r=zr(t);return D(e,t,r?"center-top":"center-middle",n),A(e,t,r?void 0:["SubProcessMarker"],n),i}function H(e,t,n={}){var i=N(e,t,n);return D(e,t,"center-middle",n),A(e,t,void 0,n),i}var V=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return F(e,t,n=zr(t)?po(n,["fill","stroke","width","height"]):po(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return O(e,t,n=po(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=po(n,["fill","stroke"]);var r=Er(t).get("cancelActivity");n={strokeWidth:1.5,fill:eo(t,s,n.fill),fillOpacity:1,stroke:to(t,c,n.stroke)},r||(n.strokeDasharray="6");var o=L(e,t,n);return y(e,t.width,t.height,3,{...n,fill:"none"}),i&&R(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=H(e,t,n=po(n,["fill","stroke"]));return Se(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:1}),Se(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:to(t,c,n.stroke),stroke:to(t,c,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=po(n,["fill","stroke"]),F(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=I(e,t,n=po(n,["fill","stroke"]));return E(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:to(t,c,n.stroke),stroke:to(t,c,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=po(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=j(e,t,n);return E(e,r,{fill:"none",stroke:to(t,c,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=po(n,["fill","stroke"]),O(e,t,{...n,markerEnd:v("association-end",eo(t,s,n.fill),to(t,c,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return j(e,t,n=po(n,["fill","stroke"]))},"bpmn:DataObjectReference":k("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=po(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=j(e,t,n);return E(e,r,{strokeWidth:1,fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=po(n,["fill","stroke"]),O(e,t,{...n,markerEnd:v("association-end",eo(t,s,n.fill),to(t,c,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=po(n,["fill","stroke"]),E(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:eo(t,s,n.fill),fillOpacity:so,stroke:to(t,c,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=po(n,["fill","stroke"]);var r=L(e,t,{...n,strokeWidth:4});return i&&R(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=po(n,["fill","stroke"]);var r=Er(t),o=I(e,t,n);y(e,t.width,t.height,.2*t.height,{fill:eo(t,"none",n.fill),stroke:to(t,c,n.stroke),strokeWidth:1});var a=r.get("eventGatewayType"),s=!!r.get("instantiate");if("Parallel"===a){var p=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});E(e,p,{fill:"none",stroke:to(t,c,n.stroke),strokeWidth:1})}else"Exclusive"===a&&(s||y(e,t.width,t.height,.26*t.height,{fill:"none",stroke:to(t,c,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}});E(e,r,{fill:"none",stroke:to(t,c,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=I(e,t,n=po(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return Sr(t).get("isMarkerVisible")&&E(e,o,{fill:to(t,c,n.stroke),stroke:to(t,c,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return I(e,t,n=po(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=po(n,["fill","stroke","width","height"]),b(e,t.width,t.height,10,{stroke:to(t,c,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:ro(t,n),height:oo(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=I(e,t,n=po(n,["fill","stroke"]));return y(e,t.width,t.height,.24*t.height,{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=po(n,["fill","stroke"]);var r=L(e,t,{...n,strokeWidth:1.5});return y(e,t.width,t.height,3,{fill:"none",stroke:to(t,c,n.stroke),strokeWidth:1.5}),i&&R(t,e,n),r},"bpmn:IntermediateCatchEvent":k("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":k("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=po(n,["fill","stroke","width","height"]),$(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=H(e,t,n=po(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=po(n,["fill","stroke"]);var r=Er(t),o=Sr(t),a=eo(t,s,n.fill),p=to(t,c,n.stroke),l=w(e,t.waypoints,{markerEnd:v("messageflow-end",a,p),markerStart:v("messageflow-start",a,p),stroke:p,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=l.getPointAtLength(l.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),d={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(d.fill=a,d.stroke=p):(d.fill=p,d.stroke=a);var f=E(e,h,d),m=M(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:p}}),g=f.getBBox(),y=m.getBBox();Kn(m,u.x-y.width/2,u.y+g.height/2+10,0)}return l},"bpmn:ParallelGateway":function(e,t,n={}){var r=I(e,t,n=po(n,["fill","stroke"]));return E(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:to(t,c,n.stroke),stroke:to(t,c,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=$(e,t,n=po(n,["fill","stroke","width","height"])),r=zr(t),o=Fr(t),a=Er(t),s=a.get("name");if(r)_(e,o?[{x:30,y:0},{x:30,y:oo(t,n)}]:[{x:0,y:30},{x:ro(t,n),y:30}],{stroke:to(t,c,n.stroke),strokeWidth:1.5}),B(e,s,t,n);else{var l=io(t,n);o||(l.height=ro(t,n),l.width=oo(t,n));var u=M(e,s,{box:l,align:"center-middle",style:{fill:no(t,p,c,n.stroke)}});o||Kn(u,0,1*oo(t,n),270)}return a.get("participantMultiplicity")&&T("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=po(n,["fill","stroke"]);var r,o=Er(t),a=H(e,t,n);return o.get("instantiate")?(y(e,28,28,4.4,{fill:eo(t,s,n.fill),stroke:to(t,c,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}}),E(e,r,{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){var r=H(e,t,n=po(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=H(e,t,n=po(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:to(t,c,n.stroke),stroke:eo(t,s,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=po(n,["fill","stroke"]);var i=eo(t,s,n.fill),r=to(t,c,n.stroke),o=w(e,t.waypoints,{markerEnd:v("sequenceflow-end",i,r),stroke:r}),a=Er(t),{source:p}=t;if(p){var l=Er(p);a.get("conditionExpression")&&xr(l,"bpmn:Activity")&&Se(o,{markerStart:v("conditional-flow-marker",i,r)}),l.get("default")&&(xr(l,"bpmn:Gateway")||xr(l,"bpmn:Activity"))&&l.get("default")===a&&Se(o,{markerStart:v("conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=H(e,t,n=po(n,["fill","stroke"]));return y(e,10,10,{fill:eo(t,s,n.fill),stroke:"none",transform:"translate(6, 6)"}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:1}),y(e,10,10,{fill:eo(t,s,n.fill),stroke:"none",transform:"translate(11, 10)"}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=po(n,["fill","stroke"]),Er(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=L(e,t,n);return i&&R(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return F(e,t,n=zr(t)?po(n,["fill","stroke","width","height"]):po(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return H(e,t,n=po(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=po(n,["fill","stroke","width","height"]);var{width:r,height:o}=io(t,n),a=b(e,r,o,0,0,{fill:"none",stroke:"none"});return E(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:to(t,c,n.stroke)}),M(e,Er(t).get("text")||"",{align:"left-top",box:io(t,n),padding:7,style:{fill:no(t,p,c,n.stroke)}}),a},"bpmn:Transaction":function(e,t,i={}){i=zr(t)?po(i,["fill","stroke","width","height"]):po(i,["fill","stroke"]);var r=F(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:to(t,c,i.stroke),strokeWidth:1.5});return zr(t)||(i={}),b(e,ro(t,i),oo(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=H(e,t,n=po(n,["fill","stroke"]));return E(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:.5}),E(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:eo(t,s,n.fill),stroke:to(t,c,n.stroke),strokeWidth:.5}),E(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:to(t,c,n.stroke),stroke:to(t,c,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 M(e,Xr(t),{box:i,fitBox:!0,style:z({},o.getExternalStyle(),{fill:no(t,p,c,n.stroke)})})}(e,t,n)}};this._drawPath=E,this._renderer=C}function po(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}e(co,rt),co.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],co.prototype.canRender=function(e){return xr(e,"bpmn:BaseElement")},co.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},co.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},co.prototype.getShapePath=function(e){return xr(e,"bpmn:Event")?ot([["M",(t=e).x+t.width/2,t.y+t.height/2],["m",0,-(n=t.width/2)],["a",n,n,0,1,1,0,2*n],["a",n,n,0,1,1,0,-2*n],["z"]]):xr(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return ot([["M",n+t,i],["l",r-20,0],["a",t,t,0,0,1,t,t],["l",0,o-20],["a",t,t,0,0,1,-10,t],["l",20-r,0],["a",t,t,0,0,1,-10,-10],["l",0,20-o],["a",t,t,0,0,1,t,-10],["z"]])}(e,10):xr(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return ot([["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 ot([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n};var lo=0,uo={width:150,height:50};function ho(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 fo(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=ho(o,n)).width=o?i.width:0," "===o||""===o||i.width1)for(;n=i.shift();){if(!(n.length+oe?t.width:e}),0),g=a.top;"middle"===o.vertical&&(g+=(i.height-f)/2),g-=(c||l[0].height)/4;var v=Ne("text");return Se(v,r),x(l,(function(e){var t;switch(g+=c||e.height,o.horizontal){case"left":t=a.left;break;case"right":t=(s?m:u)-a.right-e.width;break;default:t=Math.max(((s?m:u)-e.width)/2+a.left,0)}var n=Ne("tspan");Se(n,{x:t,y:g}),n.textContent=e.text,_e(v,n)})),Pe(h),{dimensions:{width:m,height:f},element:v}},bo.$inject=["config.textRenderer"];var _o=/\{([^{}]+)\}/g,xo=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const wo={__init__:["bpmnRenderer"],bpmnRenderer:["type",co],textRenderer:["type",bo],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o,a,s={};if(t.position){for(var c=t.containerHeight/r.height*t.yScaleFactor,p=t.containerWidth/r.width*t.xScaleFactor,l=0;l=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}(n,yn(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!xr(t,"bpmndi:BPMNEdge"))throw new Error(a("unknown di {di} for element {semantic}",{di:gr(t),semantic:gr(e)}));var u=this._getSource(e),h=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(So(e,t,{hidden:r,source:u,target:h,waypoints:Co(t,u,h)})),xr(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return Ur(e)&&Xr(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Ro.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:gr(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw ko(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},Ro.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Wr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Kr(t),i=Wr),z({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=Xr(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(So(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!Xr(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)},Ro.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?ko(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:gr(e),side:t}))},Ro.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Ro.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Ro.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};const Po={__depends__:[wo,{__depends__:[Eo],bpmnImporter:["type",Ro]}]};function To(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function Ao(e){return e.originalEvent||e.srcEvent}function Mo(e){To(e),To(Ao(e))}function Do(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Bo(){return/mac/i.test(navigator.platform)}function No(e,t){return(Ao(e)||e).button===t}function Oo(e){return No(e,0)}function jo(e){var t=Ao(e)||e;return!!Oo(e)&&(Bo()?t.metaKey:t.ctrlKey)}function Lo(e){var t=Ao(e)||e;return Oo(e)&&t.shiftKey}function Io(e){return!0}function $o(e){return Oo(e)||function(e){return No(e,1)}(e)}function zo(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){return!(c[e]||Oo)(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"},c={"element.contextmenu":Io,"element.mousedown":$o,"element.mouseup":$o,"element.click":$o,"element.dblclick":$o};function p(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(c[n]=i),a.$delegate=he.bind(e,"svg, .djs-element",t,a)}function l(e,t,n){var i=a(n);i&&he.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,x(s,(function(e,n){l(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,x(s,(function(e,n){p(t,n,e)}))})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)}));var u=f("djs-hit djs-hit-stroke"),h=f("djs-hit djs-hit-click-stroke"),d={all:f("djs-hit djs-hit-all"),"click-stroke":h,stroke:u,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=z({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return Se(e,n),e}function g(e,t){_e(e,t)}this.removeHits=function(e){x(ve(".djs-hit",e),Pe)},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=lt(t);return m(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=z({x:0,y:0},n);var i=Ne("rect");return m(i,t),Se(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=ge(".djs-hit",t);if(n)return e.waypoints?ut(n,e.waypoints):Se(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=s[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=l}zo.$inject=["eventBus","elementRegistry","styles"];const Fo={__init__:["interactionEvents"],interactionEvents:["type",zo]};function Ho(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(e){var t=Ne("rect");return Se(t,z({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=ge(".djs-outline",n);o||_e(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=ge(".djs-outline",n);o||_e(n,o=r()),i.updateConnectionOutline(o,t)}))}Ho.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&x(i,(function(i){n=n||i.updateOutline(t,e)})),n||Se(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Ho.prototype.updateConnectionOutline=function(e,t){var n=vt(t);Se(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Ho.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,(function(e){e.providers.push(t)}))},Ho.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Ho.prototype.getOutline=function(e){var t;return x(this._getProviders(),(function(n){m(n.getOutline)&&(t=t||n.getOutline(e))})),t},Ho.$inject=["eventBus","styles","elementRegistry"];const Vo={__init__:["outline"],outline:["type",Ho]};function Wo(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)}))}Wo.$inject=["eventBus","canvas"],Wo.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})}},Wo.prototype.get=function(){return this._selectedElements},Wo.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Wo.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();h(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return o===t})),t?x(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 Go="hover",Uo="selected";function qo(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,Go)})),t.on("element.out",(function(e){o(e.element,Go)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;x(t,(function(e){-1===n.indexOf(e)&&function(e){o(e,Uo)}(e)})),x(n,(function(e){-1===t.indexOf(e)&&function(e){r(e,Uo)}(e)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function Ko(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;h(o)?t.select(o):t.select(r.filter(Yo))}})),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);y(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(Oo(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=jo(e)||Lo(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function Yo(e){return!e.hidden}qo.$inject=["canvas","eventBus","selection"],qo.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Te(t);var n=e.length>1;if(ke(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}}(vt(e)),r=Ne("rect");Se(r,z({rx:3},i)),ke(r).add("djs-selection-outline"),_e(t,r)}},Ko.$inject=["eventBus","selection","canvas","elementRegistry"];const Xo={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Fo,Vo],selection:["type",Wo],selectionVisuals:["type",qo],selectionBehavior:["type",Ko]};function Zo(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Zo.prototype.next=function(){return this._prefix+ ++this._counter};var Qo=new Zo("ov");function Jo(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Qo,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),X(o=me('
    '),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function ea(e,t,n){X(e,{left:t+"px",top:n+"px"})}function ta(e,t){e.style.display=!1===t?"none":""}function na(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}Jo.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Jo.prototype.get=function(e){if(g(e)&&(e={id:e}),g(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?_(t.overlays,D({type:e.type})):t.overlays.slice():[]}return e.type?_(this._overlays,D({type:e.type})):e.id?this._overlays[e.id]:null},Jo.prototype.add=function(e,t,n){if(d(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=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},Jo.prototype.remove=function(e){var t=this.get(e)||[];h(t)||(t=[t]);var n=this;x(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(ye(e.html),ye(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)}}))},Jo.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},Jo.prototype.show=function(){ta(this._overlayRoot)},Jo.prototype.hide=function(){ta(this._overlayRoot,!1)},Jo.prototype.clear=function(){this._overlays={},this._overlayContainers=[],te(this._overlayRoot)},Jo.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=vt(t);i=o.x,r=o.y}ea(n,i,r),Z(e.html,"data-container-id",t.id)},Jo.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?vt(o).width:o.width,a=-1*i.right+t),void 0!==i.bottom&&(n=o.waypoints?vt(o).height:o.height,s=-1*i.bottom+n),ea(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Jo.prototype._createOverlayContainer=function(e){var t=me('
    ');X(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Jo.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";na(this._overlayRoot,n)},Jo.prototype._getOverlayContainer=function(e,t){var n=y(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},Jo.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)),g(o)&&(o=me(o)),n=this._getOverlayContainer(r),X(t=me('
    '),{position:"absolute"}),t.appendChild(o),e.type&&J(t).add("djs-overlay-"+e.type),ta(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())},Jo.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=!0;(i!==this._canvas.getRootElement()||n&&(l(r)&&r>t.scale||l(o)&&oi&&(r=(1/t.scale||1)*i)),l(r)&&(s="scale("+r+","+r+")"),na(a,s)},Jo.prototype._updateOverlaysVisibilty=function(e){var t=this;x(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},Jo.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;x(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){ye(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&&(x(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&&J(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};const ia={__init__:["overlays"],overlays:["type",Jo]};function ra(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(yt(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)}))}ra.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const oa={__init__:["changeSupport"],changeSupport:["type",ra]};function aa(e){this._eventBus=e}function sa(e){return function(t,n,i,r,o){(m(t)||f(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function ca(e,t){t.invoke(aa,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)}))}aa.$inject=["eventBus"],aa.prototype.on=function(e,t,n,i,r,o){if((m(t)||f(t))&&(o=r,r=i,i=n,n=t,t=null),m(n)&&(o=r,r=i,i=n,n=1e3),d(r)&&(o=r,r=!1),!m(i))throw new Error("handlerFn must be a function");h(e)||(e=[e]);var a=this._eventBus;x(e,(function(e){var s=["commandStack",e,t].filter((function(e){return e})).join(".");a.on(s,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)}))},aa.prototype.canExecute=sa("canExecute"),aa.prototype.preExecute=sa("preExecute"),aa.prototype.preExecuted=sa("preExecuted"),aa.prototype.execute=sa("execute"),aa.prototype.executed=sa("executed"),aa.prototype.postExecute=sa("postExecute"),aa.prototype.postExecuted=sa("postExecuted"),aa.prototype.revert=sa("revert"),aa.prototype.reverted=sa("reverted"),e(ca,aa),ca.$inject=["canvas","injector"];const pa={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",ca]};function la(e){return CSS.escape(e)}var ua={"&":"&","<":"<",">":">",'"':""","'":"'"};function ha(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return ua[e]}))}var da="_plane";function fa(e){return e.id.replace(new RegExp(da+"$"),"")}function ma(e){var t=e.id;return xr(e,"bpmn:SubProcess")?ya(t):t}function ga(e){return ya(e)}function va(e){return xr(Sr(e),"bpmndi:BPMNPlane")}function ya(e){return e+da}function ba(e,t,n){var i=me('
      '),r=n.getContainer(),o=J(r);r.appendChild(i);var a=[];function s(e){e&&(a=function(e){for(var t=[],n=Er(e);n;n=n.$parent)(xr(n,"bpmn:SubProcess")||xr(n,"bpmn:Process"))&&t.push(n);return t.reverse()}(e));var r=a.map((function(e){var i=ha(e.name||e.id),r=me('
    • '+i+"
    • "),o=n.findRoot(ma(e))||n.findRoot(e.id);if(!o&&xr(e,"bpmn:Process")){var a=t.find((function(t){var n=Er(t);return n&&n.get("processRef")&&n.get("processRef")===e}));o=n.findRoot(a.id)}return r.addEventListener("click",(function(){n.setRootElement(o)})),r}));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=Er(e.element);y(a,(function(e){return e===t}))&&s()})),e.on("root.set",(function(e){s(e.element)}))}function _a(e,t){var n=null,i=new xa;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,!xr(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,c=(o.y-a.y)*o.scale;0===s&&0===c||t.scroll({dx:s,dy:c}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function xa(){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)}}ba.$inject=["eventBus","elementRegistry","canvas"],_a.$inject=["eventBus","canvas"];function wa(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 Ea(e){return xr(e,"bpmndi:BPMNDiagram")?e:Ea(e.$parent)}wa.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t._createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t._movePlaneElementsToOrigin(e.plane)}))}},wa.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;xr(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;return!(!xr(n,"bpmn:SubProcess")||n===t.bpmnElement)&&!wr(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"])}(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},wa.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=gn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),vn(t)}(e),i=n.x-180,r=n.y-160;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)}))},wa.prototype._moveToDiPlane=function(e,t){var n=Ea(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},wa.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},wa.$inject=["eventBus","moddle"];var Sa=250;function Ca(e,t,n,i){aa.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",Sa,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",Sa,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],Sa,(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"],Sa,(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(Ca,aa),Ca.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Ca.prototype._canDrillDown=function(e){var t=this._canvas;return xr(e,"bpmn:SubProcess")&&t.findRoot(ma(e))},Ca.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=Er(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;J(i.html).toggle("bjs-drilldown-empty",!r)}},Ca.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=me('');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(ma(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},Ca.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Ca.$inject=["canvas","eventBus","elementRegistry","overlays"];const ka={__depends__:[ia,oa,pa],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",ba],drilldownCentering:["type",_a],drilldownOverlayBehavior:["type",Ca],subprocessCompatibility:["type",wa]};function Ra(e){Or.call(this,e)}e(Ra,Or),Ra.prototype._modules=[Po,Eo,Xo,ia,ka],Ra.prototype._moddleExtensions={};var Pa=["c","C"],Ta=["v","V"],Aa=["y","Y"],Ma=["z","Z"];function Da(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Ba(e,t){return-1!==(e=h(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function Na(e){return e.shiftKey}var Oa="keyboard.keydown",ja="input-handle-modified-keys";function La(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),t.on("diagram.init",(function(){n._fire("init")})),t.on("attach",(function(){e&&e.bindTo&&n.bind(e.bindTo)})),t.on("detach",(function(){n.unbind()}))}La.$inject=["config.keyboard","eventBus"],La.prototype._keydownHandler=function(e){this._keyHandler(e,Oa)},La.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},La.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Oa,n)&&e.preventDefault()}},La.prototype._isEventIgnored=function(e){return!!e.defaultPrevented||(t=e.target)&&(ne(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},La.prototype._isModifiedKeyIgnored=function(e){return!Da(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},La.prototype._getAllowedModifiers=function(e){var t=ie(e,"["+ja+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(ja).split(",")},La.prototype.bind=function(e){this.unbind(),this._node=e,le.bind(e,"keydown",this._keydownHandler),le.bind(e,"keyup",this._keyupHandler),this._fire("bind")},La.prototype.getBinding=function(){return this._node},La.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),le.unbind(e,"keydown",this._keydownHandler),le.unbind(e,"keyup",this._keyupHandler)),this._node=null},La.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},La.prototype.addListener=function(e,t,n){m(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Oa,e,t)},La.prototype.removeListener=function(e,t){this._eventBus.off(t||Oa,e)},La.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},La.prototype.isCmd=Da,La.prototype.isShift=Na,La.prototype.isKey=Ba;var Ia=500;function $a(e,t){var n=this;e.on("editorActions.init",Ia,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}$a.$inject=["eventBus","keyboard"],$a.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(Da(n=e.keyEvent)&&!Na(n)&&Ba(Ma,n))return t.trigger("undo"),!0;var n})),n("redo",(function(e){if(Da(n=e.keyEvent)&&(Ba(Aa,n)||Ba(Ma,n)&&Na(n)))return t.trigger("redo"),!0;var n})),n("copy",(function(e){if(Da(n=e.keyEvent)&&Ba(Pa,n))return t.trigger("copy"),!0;var n})),n("paste",(function(e){if(Da(n=e.keyEvent)&&Ba(Ta,n))return t.trigger("paste"),!0;var n})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ba(["+","Add","="],n)&&Da(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ba(["-","Subtract"],n)&&Da(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(Ba("0",n)&&Da(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(Ba(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};const za={__init__:["keyboard","keyboardBindings"],keyboard:["type",La],keyboardBindings:["type",$a]};var Fa={moveSpeed:50,moveSpeedAccelerated:200};function Ha(e,t,n){var i=this;this._config=z({},Fa,e||{}),t.addListener((function(e){var n=e.keyEvent,r=i._config;if(t.isCmd(n)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,a=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:a,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}Ha.$inject=["config.keyboardMove","keyboard","canvas"];const Va={__depends__:[za],__init__:["keyboardMove"],keyboardMove:["type",Ha]};var Wa=/^djs-cursor-.*$/;function Ga(e){var t=J(document.body);t.removeMatching(Wa),e&&t.add("djs-cursor-"+e)}function Ua(){Ga(null)}var qa=5e3;function Ka(e,t){function n(){return!1}return t=t||"element.click",e.once(t,qa,n),function(){e.off(t,n)}}function Ya(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Xa(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Za(e,t){var n;function i(i){var r,o=n.start,a=n.button,s=Do(i),c=Xa(s,o);!n.dragging&&(r=c,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&Ka(e),Ga("grab")),n.dragging&&(c=Xa(s,n.last||n.start),t.scroll({dx:c.x,dy:c.y}),n.last=s),i.preventDefault()}function r(e){le.unbind(document,"mousemove",i),le.unbind(document,"mouseup",r),n=null,Ua()}e.on("element.mousedown",500,(function(e){return function(e){if(!ie(e.target,".djs-draggable")){var t=e.button;if(!(t>=2||e.ctrlKey||e.shiftKey||e.altKey))return n={button:t,start:Do(e)},le.bind(document,"mousemove",i),le.bind(document,"mouseup",r),!0}}(e.originalEvent)})),this.isActive=function(){return!!n}}Za.$inject=["eventBus","canvas"];const Qa={__init__:["moveCanvas"],moveCanvas:["type",Za]};function Ja(e){return Math.log(e)/Math.log(10)}function es(e,t){var n=Ja(e.min),i=Ja(e.max);return(Math.abs(n)+Math.abs(i))/t}var ts=Math.sign||function(e){return e>=0?1:-1},ns={min:.2,max:4};function is(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=I(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}is.$inject=["config.zoomScroll","eventBus","canvas"],is.prototype.scroll=function(e){this._canvas.scroll(e)},is.prototype.reset=function(){this._canvas.zoom("fit-viewport")},is.prototype.zoom=function(e,t){var n=es(ns,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},is.prototype._handleWheel=function(e){if(!ie(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||Bo()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*ts(e.deltaY)*o,this.zoom(n,s)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},is.prototype.stepZoom=function(e,t){var n=es(ns,10);this._zoom(e,t,n)},is.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Ja(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s,c,p=Math.pow(10,a);i.zoom((s=ns,c=p,Math.max(s.min,Math.min(s.max,c))),t)},is.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&le[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},is.prototype._init=function(e){this.toggle(e)};const rs={__init__:["zoomScroll"],zoomScroll:["type",is]};function os(e){Ra.call(this,e)}e(os,Ra),os.prototype._navigationModules=[Va,Qa,rs],os.prototype._modules=[].concat(Ra.prototype._modules,os.prototype._navigationModules);var as=n(840),ss=n.n(as),cs=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function ps(e,t){return t.get(e,!1)}function ls(e){e.preventDefault(),"function"==typeof e.stopPropagation?e.stopPropagation():e.srcEvent&&"function"==typeof e.srcEvent.stopPropagation&&e.srcEvent.stopPropagation(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation()}function us(e){function t(t){setTimeout((function(){x(cs,(function(t){le.unbind(e,t,ls,!0)}))}),500)}le.bind(e,"touchstart",(function(t){x(cs,(function(t){le.bind(e,t,ls,!0)}))}),!0),le.bind(e,"touchend",t,!0),le.bind(e,"touchcancel",t,!0);var n=new(ss().Manager)(e,{inputClass:ss().TouchInput,recognizers:[],domEvents:!0}),i=new(ss().Tap),r=new(ss().Pan)({threshold:10}),o=new(ss().Press),a=new(ss().Pinch),s=new(ss().Tap)({event:"doubletap",taps:2});return a.requireFailure(r),a.requireFailure(o),n.add([r,o,a,s,i]),n.reset=function(e){var t=this.recognizers,i=this.session;i.stopped||(n.stop(e),setTimeout((function(){var e,n;for(e=0;n=t[e];e++)n.reset(),n.state=8;i.curRecognizer=null}),0))},n.on("hammer.input",(function(e){e.srcEvent.defaultPrevented&&n.reset(!0)})),n}function hs(e,t,n,i,r){var o,a=ps("dragging",e),s=ps("move",e),c=ps("contextPad",e),p=ps("palette",e);function l(e,t){return function(n){var o=u(n.target),a=o&&i.get(o);return t&&(n.srcEvent.button=t),r.fire(e,n,a)}}function u(e){return ie(e,"svg, .djs-element",!0)}a&&n.on("drag.move",(function(e){var t=e.originalEvent;if(t&&!(t instanceof MouseEvent)){var n=Do(t),r=u(document.elementFromPoint(n.x,n.y)),o=r&&i.get(r);o!==e.hover&&(e.hover&&a.out(e),o&&(a.hover({element:o,gfx:r}),e.hover=o,e.hoverGfx=r))}})),c&&n.on("contextPad.create",(function(e){var t=us(e.pad.html);t.on("panstart",(function(e){c.trigger("dragstart",e,!0)})),t.on("press",(function(e){c.trigger("dragstart",e,!0)})),t.on("tap",(function(e){c.trigger("click",e)}))})),p&&n.on("palette.create",(function(e){var t=us(e.container);t.on("panstart",(function(e){p.trigger("dragstart",e,!0)})),t.on("press",(function(e){p.trigger("dragstart",e,!0)})),t.on("tap",(function(e){p.trigger("click",e)}))})),n.on("canvas.init",(function(e){!function(e){function n(e){var n=u(e.target),r=n&&i.get(n);if(s&&t.getRootElement()!==r)return s.start(e,r,!0);!function(e){var n=0,i=0;function r(e){var r=e.deltaX-n,o=e.deltaY-i;t.scroll({dx:r,dy:o}),n=e.deltaX,i=e.deltaY}function a(e){o.off("panmove",r),o.off("panend",a),o.off("pancancel",a)}o.on("panmove",r),o.on("panend",a),o.on("pancancel",a)}()}(o=us(e)).on("tap",l("element.click")),o.on("doubletap",l("element.dblclick",1)),o.on("panstart",n),o.on("press",n),o.on("pinchstart",(function(e){var n=t.zoom(),i=e.center;function r(e){var r=1-(1-e.scale)/1.5,o=Math.max(.2,Math.min(4,r*n));t.zoom(o,i),ls(e)}function a(e){o.off("pinchmove",r),o.off("pinchend",a),o.off("pinchcancel",a),o.reset(!0)}o.on("pinchmove",r),o.on("pinchend",a),o.on("pinchcancel",a)}))}(e.svg)}))}function ds(e){var t=this;e.on("canvas.init",(function(e){t.addBBoxMarker(e.svg)}))}hs.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],ds.$inject=["eventBus"],ds.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=Ne("rect");Se(n,{x:-1e4,y:1e4,width:10,height:10}),Se(n,t),_e(e,n);var i=Ne("rect");Se(i,{x:1e4,y:1e4,width:10,height:10}),Se(i,t),_e(e,i)};const fs={__depends__:[{__depends__:[Fo],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",hs],touchFix:["type",ds]}]};function ms(e){return e&&e[e.length-1]}function gs(e){return e.y}function vs(e){return e.x}var ys={left:vs,center:vs,right:function(e){return e.x+e.width},top:gs,middle:gs,bottom:function(e){return e.y+e.height}};function bs(e,t){this._modeling=e,this._rules=t}bs.$inject=["modeling","rules"],bs.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},bs.prototype._isType=function(e,t){return-1!==t.indexOf(e)},bs.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),a=o.axis,s=o.dimension,c={},p={},l=!1;if(this._isType(e,["left","top"]))c[e]=t[0][a];else if(this._isType(e,["right","bottom"]))r=ms(t),c[e]=r[a]+r[s];else if(this._isType(e,["center","middle"])){if(x(t,(function(e){var t=e[a]+Math.round(e[s]/2);p[t]?p[t].elements.push(e):p[t]={elements:[e],center:t}})),n=M(p,(function(e){return e.elements.length>1&&(l=!0),e.elements.length})),l)return c[e]=ms(n).center,c;i=t[0],r=ms(t=M(t,(function(e){return e[a]+e[s]}))),c[e]=function(e,t){return Math.round((e[a]+t[a]+t[s])/2)}(i,r)}return c},bs.prototype.trigger=function(e,t){var n,i=this._modeling,r=_(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));if(h(n=this._rules.allowed("elements.align",{elements:r}))&&(r=n),!(r.length<2)&&n){var o=M(r,ys[t]),a=this._alignmentPosition(t,o);i.alignElements(o,a)}};const _s={__init__:["alignElements"],alignElements:["type",bs]};var xs=".entry";function ws(e,t,n,i){this._canvas=e,this._eventBus=n,this._overlays=i;var r=l(t&&t.scale)?t.scale:{min:1,max:1.5};this._overlaysConfig={scale:r},this._current=null,this._init()}function Es(e,t){return-1!==e.indexOf(t)}ws.$inject=["canvas","config.contextPad","eventBus","overlays"],ws.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",(function(t){var n=t.newSelection,i=n.length?1===n.length?n[0]:n:null;i?e.open(i,!0):e.close()})),this._eventBus.on("elements.changed",(function(t){var n=t.elements,i=e._current;if(i){var r=i.target;S(h(r)?r:[r],(function(e){return Es(n,e)}))&&e.open(r,!0)}}))},ws.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},ws.prototype.getEntries=function(e){var t=this._getProviders(),n=h(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return x(t,(function(t){if(m(t[n])){var r=t[n](e);m(r)?i=r(i):x(r,(function(e,t){i[t]=e}))}})),i},ws.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=Z(o,"data-action"),r=t.originalEvent||t,"mouseover"===e?this._timeout=setTimeout((()=>{this._mouseout=this.triggerEntry(i,"hover",r,n)}),300):"mouseout"===e&&(clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null)),this.triggerEntry(i,e,r,n)):t.preventDefault()},ws.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries[e];if(o){var a=o.action;if(!1!==this._eventBus.fire("contextPad.trigger",{entry:o,event:n})){if(m(a)){if("click"===t)return a(n,r,i)}else if(a[t])return a[t](n,r,i);n.preventDefault()}}}},ws.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},ws.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ws.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this.getPad(e),r=i.html;x(n,(function(e,n){var i,o=e.group||"default",a=me(e.html||'
      ');Z(a,"data-action",n),(i=ge("[data-group="+la(o)+"]",r))||(Z(i=me('
      '),"data-group",o),r.appendChild(i)),i.appendChild(a),e.className&&function(e,t){var n=J(e);(t=h(t)?t:t.split(/\s+/g)).forEach((function(e){n.add(e)}))}(a,e.className),e.title&&Z(a,"title",e.title),e.imageUrl&&(Z(t=me(""),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",a.appendChild(t))})),J(r).add("open"),this._current={target:e,entries:n,pad:i},this._eventBus.fire("contextPad.open",{current:this._current})},ws.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=me('
      '),r=this._getPosition(e),o=z({html:i},this._overlaysConfig,r);he.bind(i,xs,"click",(function(e){t.trigger("click",e)})),he.bind(i,xs,"dragstart",(function(e){t.trigger("dragstart",e)})),he.bind(i,xs,"mouseover",(function(e){t.trigger("mouseover",e)})),he.bind(i,xs,"mouseout",(function(e){t.trigger("mouseout",e)})),le.bind(i,"mousedown",(function(e){e.stopPropagation()}));var a=this._canvas.getRootElement();this._overlayId=n.add(a,"context-pad",o);var s=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{target:e,pad:s}),s},ws.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},ws.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return h(e)===h(n)&&(h(e)?e.length===n.length&&E(e,(function(e){return Es(n,e)})):n===e)},ws.prototype.isShown=function(){return this.isOpen()&&this._overlays.isShown()},ws.prototype._getPosition=function(e){var t,n=vt(h(e=hn(e)?(t=e).waypoints[t.waypoints.length-1]:e)?e:[e]);return{position:{left:n.x+n.width+12,top:n.y-6}}};const Ss={__depends__:[Fo,ia],contextPad:["type",ws]};var Cs,ks,Rs,Ps,Ts,As,Ms,Ds={},Bs=[],Ns=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Os=Array.isArray;function js(e,t){for(var n in t)e[n]=t[n];return e}function Ls(e){var t=e.parentNode;t&&t.removeChild(e)}function Is(e,t,n){var i,r,o,a={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Cs.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return $s(e,a,i,r,null)}function $s(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++Rs:r,__i:-1,__u:0};return null==r&&null!=ks.vnode&&ks.vnode(o),o}function zs(e){return e.children}function Fs(e,t){this.props=e,this.context=t}function Hs(e,t){if(null==t)return e.__?Hs(e.__,e.__i+1):null;for(var n;tt&&Ps.sort(Ms));Gs.__r=0}function Us(e,t,n,i,r,o,a,s,c,p,l){var u,h,d,f,m,g=i&&i.__k||Bs,v=t.length;for(n.__d=c,qs(n,t,g),c=n.__d,u=0;u0?$s(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,s=Ys(r,n,a=i+u,l),r.__i=s,o=null,-1!==s&&(l--,(o=n[s])&&(o.__u|=131072)),null==o||null===o.__v?(-1==s&&u--,"function"!=typeof r.type&&(r.__u|=65536)):s!==a&&(s===a+1?u++:s>a?l>c-a?u+=s-a:u--:u=s(null!=c&&0==(131072&c.__u)?1:0))for(;a>=0||s=0){if((c=t[a])&&0==(131072&c.__u)&&r==c.key&&o===c.type)return a;a--}if(s=5&&((r||!e&&5===i)&&(a.push(i,0,r,n),i=6),e&&(a.push(i,e,0,n),i=6)),r=""},c=0;c"===t?(i=1,r=""):r=t+r[0]:o?t===o?o="":r+=t:'"'===t||"'"===t?o=t:">"===t?(s(),i=1):i&&("="===t?(i=5,n=r,r=""):"/"===t&&(i<5||">"===e[c][p+1])?(s(),3===i&&(a=a[0]),i=a,(a=a[0]).push(2,0,i),i=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(s(),i=2):r+=t),3===i&&"!--"===r&&(i=4,a=a[0])}return s(),a}(e)),t),arguments,[])).length>1?t:t[0]}.bind(Is),fc=0,mc=[],gc=[],vc=ks.__b,yc=ks.__r,bc=ks.diffed,_c=ks.__c,xc=ks.unmount;function wc(e,t){ks.__h&&ks.__h(cc,e,fc||t),fc=0;var n=cc.__H||(cc.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:gc}),n.__[e]}function Ec(e){return fc=1,function(e,t,n){var i=wc(sc++,2);if(i.t=e,!i.__c&&(i.__=[Oc(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=cc,!cc.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var a=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&i.__c.props===e)&&(!o||o.call(this,e,t,n))};cc.u=!0;var o=cc.shouldComponentUpdate,a=cc.componentWillUpdate;cc.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}a&&a.call(this,e,t,n)},cc.shouldComponentUpdate=r}return i.__N||i.__}(Oc,e)}function Sc(e,t){var n=wc(sc++,3);!ks.__s&&Nc(n.__H,t)&&(n.__=e,n.i=t,cc.__H.__h.push(n))}function Cc(e,t){var n=wc(sc++,4);!ks.__s&&Nc(n.__H,t)&&(n.__=e,n.i=t,cc.__h.push(n))}function kc(e){return fc=5,Rc((function(){return{current:e}}),[])}function Rc(e,t){var n=wc(sc++,7);return Nc(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Pc(e,t){return fc=8,Rc((function(){return e}),t)}function Tc(){for(var e;e=mc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Dc),e.__H.__h.forEach(Bc),e.__H.__h=[]}catch(t){e.__H.__h=[],ks.__e(t,e.__v)}}ks.__b=function(e){cc=null,vc&&vc(e)},ks.__r=function(e){yc&&yc(e),sc=0;var t=(cc=e.__c).__H;t&&(pc===cc?(t.__h=[],cc.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=gc,e.__N=e.i=void 0}))):(t.__h.forEach(Dc),t.__h.forEach(Bc),t.__h=[],sc=0)),pc=cc},ks.diffed=function(e){bc&&bc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==mc.push(t)&&lc===ks.requestAnimationFrame||((lc=ks.requestAnimationFrame)||Mc)(Tc)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==gc&&(e.__=e.__V),e.i=void 0,e.__V=gc}))),pc=cc=null},ks.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Dc),e.__h=e.__h.filter((function(e){return!e.__||Bc(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ks.__e(n,e.__v)}})),_c&&_c(e,t)},ks.unmount=function(e){xc&&xc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Dc(e)}catch(e){t=e}})),n.__H=void 0,t&&ks.__e(t,n.__v))};var Ac="function"==typeof requestAnimationFrame;function Mc(e){var t,n=function(){clearTimeout(i),Ac&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);Ac&&(t=requestAnimationFrame(n))}function Dc(e){var t=cc,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),cc=t}function Bc(e){var t=cc;e.__c=e.__(),cc=t}function Nc(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Oc(e,t){return"function"==typeof t?t(e):t}function jc(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t
      - ${t.imageUrl&&Fe``||t.imageHtml&&Fe`
      `} + ${t.imageUrl&&dc``||t.imageHtml&&dc`
      `} - ${t.label?Fe` + ${t.label?dc` ${t.label} `:null} - ${t.description&&Fe` + ${t.description&&dc` `}
      - ${t.documentationRef&&Fe` + ${t.documentationRef&&dc`
      `} - `}function dt(e){const{selectedEntry:t,setSelectedEntry:n,entries:i,...r}=e,o=et(),a=tt((()=>function(e){const t=[],n=e=>t.find((t=>e.id===t.id));return e.forEach((e=>{const i=e.group?(e=>"string"==typeof e?{id:e}:e)(e.group):{id:"default"};(e=>!!n(e))(i)?n(i).entries.push(e):t.push({...i,entries:[e]})})),t}(i)),[i]);return Qe((()=>{const e=o.current;if(!e)return;const t=e.querySelector(".selected");var n;t&&("function"==typeof(n=t).scrollIntoViewIfNeeded?n.scrollIntoViewIfNeeded():n.scrollIntoView({scrollMode:"if-needed",block:"nearest"}))}),[t]),Fe` + `}function $c(e){const{selectedEntry:t,setSelectedEntry:n,entries:i,...r}=e,o=kc(),a=Rc((()=>function(e){const t=[],n=e=>t.find((t=>e.id===t.id));return e.forEach((e=>{const i=e.group?(e=>"string"==typeof e?{id:e}:e)(e.group):{id:"default"};(e=>!!n(e))(i)?n(i).entries.push(e):t.push({...i,entries:[e]})})),t}(i)),[i]);return Cc((()=>{const e=o.current;if(!e)return;const t=e.querySelector(".selected");var n;t&&("function"==typeof(n=t).scrollIntoViewIfNeeded?n.scrollIntoViewIfNeeded():n.scrollIntoView({scrollMode:"if-needed",block:"nearest"}))}),[t]),dc`
      - ${a.map((e=>Fe` - ${e.name&&Fe` + ${a.map((e=>dc` + ${e.name&&dc`
      ${e.name}
      `}
        - ${e.entries.map((e=>Fe` - <${ht} + ${e.entries.map((e=>dc` + <${Ic} key=${e.id} entry=${e} selected=${e===t} @@ -69,82 +69,82 @@
      `))}
      - `}function ft(e){const{onClose:t,onSelect:n,className:i,headerEntries:r,position:o,title:c,width:p,scale:l,search:u,entries:h,onOpened:d,onClosed:f}=e,m=tt((()=>!!(0,a.$K)(u)&&h.length>5),[u,h]),v=et(),[g,y]=Xe(""),b=nt(((e,t)=>m?e.filter((e=>{if(!t)return(e.rank||0)>=0;if(!1===e.searchable)return!1;const n=[e.description||"",e.label||"",e.search||""].join("---").toLowerCase();return t.toLowerCase().split(/\s/g).every((e=>n.includes(e)))})):e),[m]),[_,x]=Xe(b(h,g)),[E,w]=Xe(_[0]),S=nt((e=>{E&&e.includes(E)||w(e[0]),x(e)}),[E,x,w]);Ye((()=>{S(b(h,g))}),[g,h]),Ye((()=>{const e=e=>{if("Escape"===e.key)return e.preventDefault(),t()};return document.documentElement.addEventListener("keydown",e),()=>{document.documentElement.removeEventListener("keydown",e)}}),[]),Qe((()=>{v.current&&v.current.focus()}),[]);const k=nt((e=>{let t=_.indexOf(E)+e;t<0&&(t=_.length-1),t>=_.length&&(t=0),w(_[t])}),[_,E,w]),C=nt((e=>"Enter"===e.key&&E?n(e,E):"ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey?(k(-1),e.preventDefault()):"ArrowDown"===e.key||"Tab"===e.key?(k(1),e.preventDefault()):void 0),[n,t,E,k]),R=nt((e=>{(0,s.wB)(e.target,"input")&&y((()=>e.target.value))}),[y]);Ye((()=>(d(),()=>{f()})),[]);const A=tt((()=>c||r.length>0),[c,r]);return Fe` - <${mt} + `}function zc(e){const{onClose:t,onSelect:n,className:i,headerEntries:r,position:o,title:a,width:s,scale:c,search:p,entries:u,onOpened:h,onClosed:d}=e,f=Rc((()=>!!l(p)&&u.length>5),[p,u]),m=kc(),[g,v]=Ec(""),y=Pc(((e,t)=>f?e.filter((e=>{if(!t)return(e.rank||0)>=0;if(!1===e.searchable)return!1;const n=[e.description||"",e.label||"",e.search||""].join("---").toLowerCase();return t.toLowerCase().split(/\s/g).every((e=>n.includes(e)))})):e),[f]),[b,_]=Ec(y(u,g)),[x,w]=Ec(b[0]),E=Pc((e=>{x&&e.includes(x)||w(e[0]),_(e)}),[x,_,w]);Sc((()=>{E(y(u,g))}),[g,u]),Sc((()=>{const e=e=>{if("Escape"===e.key)return e.preventDefault(),t()};return document.documentElement.addEventListener("keydown",e),()=>{document.documentElement.removeEventListener("keydown",e)}}),[]),Cc((()=>{m.current&&m.current.focus()}),[]);const S=Pc((e=>{let t=b.indexOf(x)+e;t<0&&(t=b.length-1),t>=b.length&&(t=0),w(b[t])}),[b,x,w]),C=Pc((e=>"Enter"===e.key&&x?n(e,x):"ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey?(S(-1),e.preventDefault()):"ArrowDown"===e.key||"Tab"===e.key?(S(1),e.preventDefault()):void 0),[n,t,x,S]),k=Pc((e=>{ne(e.target,"input")&&v((()=>e.target.value))}),[v]);Sc((()=>(h(),()=>{d()})),[]);const R=Rc((()=>a||r.length>0),[a,r]);return dc` + <${Fc} onClose=${t} - onKeyup=${R} + onKeyup=${k} onKeydown=${C} className=${i} position=${o} - width=${p} - scale=${l} + width=${s} + scale=${c} > - ${A&&Fe` + ${R&&dc`
      -

      ${c}

      - ${r.map((e=>Fe` +

      ${a}

      + ${r.map((e=>dc` n(t,e)} title=${e.title||e.label} data-id=${e.id} onMouseEnter=${()=>w(e)} onMouseLeave=${()=>w(null)} > - ${e.imageUrl&&Fe``||e.imageHtml&&Fe`
      `} + ${e.imageUrl&&dc``||e.imageHtml&&dc`
      `} - ${e.label?Fe` + ${e.label?dc` ${e.label} `:null} `))}
      `} - ${h.length>0&&Fe` + ${u.length>0&&dc`
      - ${m&&Fe` + ${f&&dc` `} - <${dt} - entries=${_} - selectedEntry=${E} + <${$c} + entries=${b} + selectedEntry=${x} setSelectedEntry=${w} onAction=${n} />
      - ${0===_.length&&Fe` + ${0===b.length&&dc`
      No matching entries found.
      `} `} - - `}function mt(e){const{onClose:t,onKeydown:n,onKeyup:i,className:r,children:o,position:a}=e,c=et(),p=nt((e=>{(0,s.oq)(e.target,".djs-popup",!0)||t()}),[t]);return Qe((()=>{if("function"!=typeof a)return;const e=c.current,t=a(e);e.style.left=`${t.x}px`,e.style.top=`${t.y}px`}),[c.current,a]),Qe((()=>{c.current&&c.current.focus()}),[]),Fe` + + `}function Fc(e){const{onClose:t,onKeydown:n,onKeyup:i,className:r,children:o,position:a}=e,s=kc(),c=Pc((e=>{ie(e.target,".djs-popup",!0)||t()}),[t]);return Cc((()=>{if("function"!=typeof a)return;const e=s.current,t=a(e);e.style.left=`${t.x}px`,e.style.top=`${t.y}px`}),[s.current,a]),Cc((()=>{s.current&&s.current.focus()}),[]),dc`
      ${o}
      - `}var vt=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function gt(e,t,n){this._eventBus=t,this._canvas=n,this._current=null;var i=(0,a.$K)(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:i},t.on("diagram.destroy",(()=>{this.close()})),t.on("element.changed",(e=>{const t=this.isOpen()&&this._current.target;e.element===t&&this._render()}))}gt.$inject=["config.popupMenu","eventBus","canvas"],gt.prototype._render=function(){const{position:e,className:t,entries:n,headerEntries:i,options:r}=this._current,o=Object.entries(n).map((([e,t])=>({id:e,...t}))),a=Object.entries(i).map((([e,t])=>({id:e,...t}))),s=e&&(t=>this._ensureVisible(t,e)),c=this._updateScale(this._current.container);je(Fe` - <${ft} + `}var Hc=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function Vc(e,t,n){this._eventBus=t,this._canvas=n,this._current=null;var i=l(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:i},t.on("diagram.destroy",(()=>{this.close()})),t.on("element.changed",(e=>{const t=this.isOpen()&&this._current.target;e.element===t&&this._render()}))}Vc.$inject=["config.popupMenu","eventBus","canvas"],Vc.prototype._render=function(){const{position:e,className:t,entries:n,headerEntries:i,options:r}=this._current,o=Object.entries(n).map((([e,t])=>({id:e,...t}))),a=Object.entries(i).map((([e,t])=>({id:e,...t}))),s=e&&(t=>this._ensureVisible(t,e)),c=this._updateScale(this._current.container);ac(dc` + <${zc} onClose=${e=>this.close(e)} onSelect=${(e,t,n)=>this.trigger(e,t,n)} position=${s} @@ -156,4 +156,4 @@ onClosed=${this._onClosed.bind(this)} ...${{...r}} /> - `,this._current.container)},gt.prototype.open=function(e,t,n,i){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{entries:r,headerEntries:o}=this._getContext(e,t);this._current={position:n,className:t,target:e,entries:r,headerEntries:o,container:this._createContainer({provider:t}),options:i},this._emit("open"),this._bindAutoClose(),this._render()},gt.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const i=this._getEntries(e,n),r=this._getHeaderEntries(e,n);return{entries:i,headerEntries:r,empty:!(Object.keys(i).length||Object.keys(r).length)}},gt.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._current=null)},gt.prototype.reset=function(){const e=this._current.container;je(null,e),(0,s.Od)(e)},gt.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},gt.prototype._onOpened=function(){this._emit("opened")},gt.prototype._onClosed=function(){this._emit("closed")},gt.prototype._createContainer=function(e){var t=this._canvas.getContainer();const n=(0,s.H6)(`
      `);return t.appendChild(n),n},gt.prototype._bindAutoClose=function(){this._eventBus.once(vt,this.close,this)},gt.prototype._unbindAutoClose=function(){this._eventBus.off(vt,this.close,this)},gt.prototype._updateScale=function(){var e,t,n=this._canvas.zoom(),i=this._config.scale,r=n;return!0!==i&&(!1===i?(e=1,t=1):(e=i.min,t=i.max),(0,a.$K)(e)&&nt&&(r=t)),r},gt.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect(),r={},o=t.x,a=t.y;return t.x+i.width>n.width&&(r.x=!0),t.y+i.height>n.height&&(r.y=!0),r.x&&r.y?(o=t.x-i.width,a=t.y-i.height):r.x?(o=t.x-i.width,a=t.y):r.y&&t.y\n \n \n \n ',bottom:'\n \n \n \n ',center:'\n \n \n \n ',left:'\n \n \n \n ',right:'\n \n \n \n ',top:'\n \n \n \n ',middle:'\n \n \n \n '};function _t(e,t,n,i){e.registerProvider(900,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}_t.$inject=["contextPad","popupMenu","translate","canvas"],_t.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&(0,a.f0)(t,this._getEntries(e)),t},_t.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},_t.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`
      ${bt.align}
      `,action:{click:function(t,n){var i=e._getMenuPosition(n);(0,a.f0)(i,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",i)}}}}},_t.prototype._getMenuPosition=function(e){var t=this._contextPad.getPad(e).html.getBoundingClientRect();return{x:t.left,y:t.bottom+5}};var xt=["left","center","right","top","middle","bottom"];function Et(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}Et.$inject=["popupMenu","alignElements","translate","rules"],Et.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&(0,a.f0)(t,this._getEntries(e)),t},Et.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},Et.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return(0,a.Ed)(xt,(function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:bt[o],action:function(){t.trigger(e,o),i.close()}}})),r};var wt=n(594);function St(e){wt.Z.call(this,e),this.init()}function kt(e){St.call(this,e)}St.$inject=["eventBus"],(0,e.Z)(St,wt.Z),St.prototype.addRule=function(e,t,n){var i=this;"string"==typeof e&&(e=[e]),e.forEach((function(e){i.canExecute(e,t,(function(e,t,i){return n(e)}),!0)}))},St.prototype.init=function(){},kt.$inject=["eventBus"],(0,e.Z)(kt,St),kt.prototype.init=function(){this.addRule("elements.align",(function(e){var t=e.elements,n=(0,a.hX)(t,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));return!((n=(0,V.cd)(n)).length<2)&&n}))};const Ct={__depends__:[W,Y,yt],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",_t],alignElementsMenuProvider:["type",Et],bpmnAlignElements:["type",kt]};var Rt=n(935),At=10,Pt=50,Tt=250;function Mt(e,t,n,i){for(var r;r=Bt(e,n,t);)n=i(t,n,r);return n}function Dt(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach((function(o){var a=e[o];if(a){var s="x"===o?"width":"height",c=a.margin,p=a.minDistance;r[o]=c<0?Math.min(i[o]+c-t[s]/2,n[o]-p+c):Math.max(i[o]+i[s]+c+t[s]/2,n[o]+p+c)}})),r}}function Bt(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=function(e){var t=jt(e);return e.host&&(t=t.concat(jt(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce((function(e,t){return e.concat(jt(t))}),[]))),t}(e);return(0,a.sE)(r,(function(e){return e!==n&&"intersect"===(0,Rt.T8)(e,i,At)}))}function jt(e){return(t=e,t.outgoing.map((function(e){return e.target}))).concat(function(e){return e.incoming.map((function(e){return e.source}))}(e));var t}function Nt(){return!0}function Ot(e,t,n){e.on("autoPlace",100,(function(e){var t=e.shape;return function(e,t,n){n||(n={});var i=n.defaultDistance||Pt,r=(0,Rt.wS)(e);return{x:(0,Rt.JA)(e).right+i+t.width/2,y:r.y}}(e.source,t)})),e.on("autoPlace.end",(function(e){n.scrollToElement(e.shape)})),this.append=function(n,i,r){e.fire("autoPlace.start",{source:n,shape:i});var o=e.fire("autoPlace",{source:n,shape:i}),a=t.appendShape(n,i,o,n.parent,r);return e.fire("autoPlace.end",{source:n,shape:a}),a}}function Lt(e,t){e.on("autoPlace.end",500,(function(e){t.select(e.shape)}))}Ot.$inject=["eventBus","modeling","canvas"],Lt.$inject=["eventBus","selection"];const It={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Ot],autoPlaceSelectionBehavior:["type",Lt]};var $t=n(252);function zt(e,t){return(0,$t.is)(t,"bpmn:TextAnnotation")?function(e,t){var n=(0,Rt.JA)(e),i={x:n.right+t.width/2,y:n.top-50-t.height/2};return(0,K.Ho)(e)&&((i=(0,Rt.wS)(e)).x+=100,i.y-=50),Mt(e,t,i,Dt({y:{margin:-30,minDistance:20}}))}(e,t):(0,$t.JZ)(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(e,t){var n=(0,Rt.JA)(e);return Mt(e,t,{x:n.right-10+t.width/2,y:n.bottom+40+t.width/2},Dt({x:{margin:30,minDistance:30}}))}(e,t):(0,$t.is)(t,"bpmn:FlowNode")?function(e,t){var n=(0,Rt.JA)(e),i=(0,Rt.wS)(e),r=function(e,t){t||(t={});var n=t.defaultDistance||Pt,i=t.direction||"e",r=t.filter,o=t.getWeight||function(t){return t.source===e?1:-1},s=t.maxDistance||Tt,c=t.reference||"start";function p(e,t){return"n"===i?"start"===c?(0,Rt.JA)(e).top-(0,Rt.JA)(t).bottom:"center"===c?(0,Rt.JA)(e).top-(0,Rt.wS)(t).y:(0,Rt.JA)(e).top-(0,Rt.JA)(t).top:"w"===i?"start"===c?(0,Rt.JA)(e).left-(0,Rt.JA)(t).right:"center"===c?(0,Rt.JA)(e).left-(0,Rt.wS)(t).x:(0,Rt.JA)(e).left-(0,Rt.JA)(t).left:"s"===i?"start"===c?(0,Rt.JA)(t).top-(0,Rt.JA)(e).bottom:"center"===c?(0,Rt.wS)(t).y-(0,Rt.JA)(e).bottom:(0,Rt.JA)(t).bottom-(0,Rt.JA)(e).bottom:"start"===c?(0,Rt.JA)(t).left-(0,Rt.JA)(e).right:"center"===c?(0,Rt.wS)(t).x-(0,Rt.JA)(e).right:(0,Rt.JA)(t).right-(0,Rt.JA)(e).right}r||(r=Nt);var l=e.incoming.filter(r).map((function(t){var n=o(t),i=n<0?p(t.source,e):p(e,t.source);return{id:t.source.id,distance:i,weight:n}})),u=e.outgoing.filter(r).map((function(t){var n=o(t),i=n>0?p(e,t.target):p(t.target,e);return{id:t.target.id,distance:i,weight:n}})),h=l.concat(u).reduce((function(e,t){return e[t.id+"__weight_"+t.weight]=t,e}),{});return(0,a.u4)(h,(function(e,t){var n=t.distance,i=t.weight;return n<0||n>s||(e[String(n)]||(e[String(n)]=0),e[String(n)]+=1*i,(!e.distance||e[e.distance]t.top&&(n=n.concat("n")),e.rightt.left&&(n=n.concat("e")),n}((0,a.ei)(t,["x","y","width","height"]),n);this.resize(t,n,{autoResize:i});var r=t.parent;r&&this._expand([t],r)}}},Wt.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},Wt.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},Wt.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},Ut.$inject=["injector"],(0,e.Z)(Ut,Wt),Ut.prototype.resize=function(e,t,n){(0,$t.is)(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},Vt.$inject=["eventBus"],(0,e.Z)(Vt,St),Vt.prototype.canResize=function(e,t){return!1},(0,e.Z)(Gt,Vt),Gt.$inject=["eventBus","modeling"],Gt.prototype.canResize=function(e,t){if((0,$t.is)(t.di,"bpmndi:BPMNPlane"))return!1;if(!(0,$t.is)(t,"bpmn:Participant")&&!(0,$t.is)(t,"bpmn:Lane")&&!(0,$t.is)(t,"bpmn:SubProcess"))return!1;var n=!0;return(0,a.Ed)(e,(function(e){((0,$t.is)(e,"bpmn:Lane")||(0,K.j_)(e))&&(n=!1)})),n};const Kt={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Ut],bpmnAutoResizeProvider:["type",Gt]};function Jt(e,t,n){var i,r,o=this,a=n.get("dragging",!1);a&&t.on("drag.start",(function(n){t.once("drag.move",1500,(function(t){!function(t){if(!t.hover){var n=t.originalEvent,i=o._findTargetGfx(n),r=i&&e.get(i);i&&r&&(t.stopPropagation(),a.hover({element:r,gfx:i}),a.move(n))}}(t)}))})),t.on("element.hover",(function(e){i=e.gfx,r=e.element})),t.on("element.hover",1500,(function(e){r&&t.fire("element.out",{element:r,gfx:i})})),t.on("element.out",(function(){i=null,r=null})),this._findTargetGfx=function(e){var t,n;if(e instanceof MouseEvent)return t=(0,T.jt)(e),n=document.elementFromPoint(t.x,t.y),(0,s.oq)(n,"svg, .djs-element",!0)}}Jt.$inject=["elementRegistry","eventBus","injector"];const qt={__init__:["hoverFix"],hoverFix:["type",Jt]};var Xt=n(945),Yt=n(422),Qt=n(53),en=n(419),tn=Math.round,nn="djs-drag-active";function rn(e){e.preventDefault()}function on(e,t,n,i){var r,o={threshold:5,trapClick:!0};function c(e){var n=t.viewbox(),i=t._container.getBoundingClientRect();return{x:n.x+(e.x-i.left)/n.scale,y:n.y+(e.y-i.top)/n.scale}}function p(t,n){n=n||r;var i=e.createEvent((0,a.f0)({},n.payload,n.data,{isTouch:n.isTouch}));return!1!==e.fire("drag."+t,i)&&e.fire(n.prefix+"."+t,i)}function l(e,i){var o,s=r.payload,l=r.displacement,u=r.globalStart,h=(0,T.jt)(e),d=(0,en.p)(h,u),f=r.localStart,m=c(h),v=(0,en.p)(m,f);if(!r.active&&(i||(o=d,Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2))>r.threshold))){if((0,a.f0)(s,{x:tn(f.x+l.x),y:tn(f.y+l.y),dx:0,dy:0},{originalEvent:e}),!1===p("start"))return y();r.active=!0,r.keepSelection||(s.previousSelection=n.get(),n.select(null)),r.cursor&&(0,Yt.t8)(r.cursor),t.addMarker(t.getRootElement(),nn)}(0,T.UW)(e),r.active&&((0,a.f0)(s,{x:tn(m.x+l.x),y:tn(m.y+l.y),dx:tn(v.x),dy:tn(v.y)},{originalEvent:e}),p("move"))}function u(e){var t=!0;r.active&&(e&&(r.payload.originalEvent=e,(0,T.UW)(e)),t=p("end")),!1===t&&p("rejected"),p("ended",b(!0!==t))}function h(e){d("Escape",e)&&(rn(e),y())}function f(t){var n;r.active&&(n=(0,Qt.N)(e),setTimeout(n,400),rn(t)),u(t)}function m(e){l(e)}function v(e){var t=r.payload;t.hoverGfx=e.gfx,t.hover=e.element,p("hover")}function g(e){p("out");var t=r.payload;t.hoverGfx=null,t.hover=null}function y(e){var t;if(r){var n=r.active;n&&p("cancel"),t=b(e),n&&p("canceled",t)}}function b(o){var a,c;p("cleanup"),(0,Yt.zN)(),c=r.trapClick?f:u,s.B.unbind(document,"mousemove",l),s.B.unbind(document,"dragstart",rn),s.B.unbind(document,"selectstart",rn),s.B.unbind(document,"mousedown",c,!0),s.B.unbind(document,"mouseup",c,!0),s.B.unbind(document,"keyup",h),s.B.unbind(document,"touchstart",m,!0),s.B.unbind(document,"touchcancel",y,!0),s.B.unbind(document,"touchmove",l,!0),s.B.unbind(document,"touchend",u,!0),e.off("element.hover",v),e.off("element.out",g),t.removeMarker(t.getRootElement(),nn);var d=r.payload.previousSelection;return!1!==o&&d&&!n.get().length&&function(e){var t=e.filter((function(e){return i.get(e.id)}));t.length&&n.select(t)}(d),a=r,r=null,a}e.on("diagram.destroy",y),this.init=function(t,n,i,d){r&&y(!1),"string"==typeof n&&(d=i,i=n,n=null);var b,_,x,E,w,S=(d=(0,a.f0)({},o,d||{})).data||{};E=d.trapClick?f:u,t?(b=(0,T.Ku)(t)||t,_=(0,T.jt)(t),(0,T.UW)(t),"dragstart"===b.type&&rn(b)):(b=null,_={x:0,y:0}),x=c(_),n||(n=x),w=function(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}(b),r=(0,a.f0)({prefix:i,data:S,payload:{},globalStart:_,displacement:(0,en.p)(n,x),localStart:x,isTouch:w},d),d.manual||(w?(s.B.bind(document,"touchstart",m,!0),s.B.bind(document,"touchcancel",y,!0),s.B.bind(document,"touchmove",l,!0),s.B.bind(document,"touchend",u,!0)):(s.B.bind(document,"mousemove",l),s.B.bind(document,"dragstart",rn),s.B.bind(document,"selectstart",rn),s.B.bind(document,"mousedown",E,!0),s.B.bind(document,"mouseup",E,!0)),s.B.bind(document,"keyup",h),e.on("element.hover",v),e.on("element.out",g)),p("init"),d.autoActivate&&l(t,!0)},this.move=l,this.hover=v,this.out=g,this.end=u,this.cancel=y,this.context=function(){return r},this.setOptions=function(e){(0,a.f0)(o,e)}}on.$inject=["eventBus","canvas","selection","elementRegistry"];const an={__depends__:[qt,Xt.Z],dragging:["type",on]};function sn(e,t,n){this._canvas=n,this._opts=(0,a.f0)({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",(function(e){var t=i._toBorderPoint(e);i.startScroll(t)})),t.on(["drag.cleanup"],(function(){i.stopScroll()}))}sn.$inject=["config.autoScroll","eventBus","canvas"],sn.prototype.startScroll=function(e){var t,n,i,r=this._canvas,o=this._opts,a=this,s=r.getContainer().getBoundingClientRect(),c=[e.x,e.y,s.width-e.x,s.height-e.y];this.stopScroll();for(var p=0,l=0,u=0;u<4;u++)t=c[u],n=o.scrollThresholdOut[u],i=o.scrollThresholdIn[u],nm-3&&(n=(0,Rt.T8)(r.target,f),a===m-2?"intersect"===n&&(h.pop(),h[h.length-1]=f):"intersect"!==n&&h.push(l)),i.newWaypoints=r.waypoints=s(r,h),function(e,t,n){var i,r,o,a,s,c,p=e.newWaypoints,l=(i=n,r=p[e.segmentStartIndex+t],o=p[e.segmentEndIndex+t],a=Kn(e.axis),s=Math.max(r[a],o[a]),c=Math.min(r[a],o[a]),Gn(r,a,Math.min(Math.max(c+20,i[a]),s-20)));(0,hn.Iu)(e.draggerGfx,l.x,l.y)}(i,v,e),i.newSegmentStartIndex=o+v,c(e)})),t.on("connectionSegment.move.hover",(function(e){e.context.hover=e.hover,n.addMarker(e.hover,Wn)})),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],(function(e){var t=e.context.hover;t&&n.removeMarker(t,Wn)})),t.on("connectionSegment.move.cleanup",(function(e){var t=e.context,i=t.connection;t.draggerGfx&&(0,O.Od)(t.draggerGfx),n.removeMarker(i,Un)})),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],(function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,c(e)})),t.on("connectionSegment.move.end",(function(e){var t=e.context,n=t.connection,i=t.newWaypoints,r=t.newSegmentStartIndex;i=i.map((function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}}));var a=function(e,t){var n=0,i=e.filter((function(i,r){return!(0,un.ZS)(e[r-1],e[r+1],i)||(n=r<=t?n-1:n,!1)}));return{waypoints:i,segmentOffset:n}}(i,r),c=s(n,a.waypoints),p=a.segmentOffset,l={segmentMove:{segmentStartIndex:t.segmentStartIndex,newSegmentStartIndex:r+p}};o.updateWaypoints(n,c,l)}))}qn.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var Xn=Math.abs,Yn=Math.round;function Qn(e){return{x:e.x,y:e.y}}function ei(e){return{x:e.x+e.width,y:e.y+e.height}}function ti(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:Yn(e.x+e.width/2),y:Yn(e.y+e.height/2)}}function ni(e,t){var n=e.snapped;return!!n&&("string"==typeof t?n[t]:n.x&&n.y)}function ii(e,t,n){if("string"!=typeof t)throw new Error("axis must be in [x, y]");if("number"!=typeof n&&!1!==n)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return!1===n?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function ri(e){return e.children||[]}var oi=Math.abs,ai=Math.round;function si(e){function t(e,t){if((0,a.kJ)(e)){for(var n=e.length;n--;)if(oi(e[n]-t)<=10)return e[n]}else{var i=t%(e=+e);if(i<10)return t-i;if(i>e-10)return t-i+e}return t}function n(e,t){return e.waypoints?(i=function(e,t){for(var n,i=t.waypoints,r=1/0,o=0;oo.length-3&&h.unshift(n(r.target,e)),t.snapPoints=i={horizontal:[],vertical:[]},(0,a.Ed)(h,(function(e){e&&(e=e.original||e,"y"===u&&i.horizontal.push(e.y),"x"===u&&i.vertical.push(e.x))})),i}(e),s=e.x,c=e.y;if(o){var p=s-(i=t(o.vertical,s)),l=c-(r=t(o.horizontal,c));(0,a.f0)(e,{dx:e.dx-p,dy:e.dy-l,x:i,y:r}),(p||-1!==o.vertical.indexOf(s))&&ii(e,"x",i),(l||-1!==o.horizontal.indexOf(c))&&ii(e,"y",r)}})),e.on(["connect.hover","connect.move","connect.end"],1500,(function(e){var t=e.context.hover,i=t&&n(t,e);(0,K.Ho)(t)&&i&&i.x&&i.y&&(ii(e,"x",i.x),ii(e,"y",i.y))})),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,(function(e){var i,r,o=e.context,s=function(e){var t=e.snapPoints,n=e.connection.waypoints,i=e.bendpointIndex;if(t)return t;var r=[n[i-1],n[i+1]];return e.snapPoints=t={horizontal:[],vertical:[]},(0,a.Ed)(r,(function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))})),t}(o),c=o.hover,p=c&&n(c,e),l=e.x,u=e.y;if(s){var h=l-(i=t(p?s.vertical.concat([p.x]):s.vertical,l)),d=u-(r=t(p?s.horizontal.concat([p.y]):s.horizontal,u));(0,a.f0)(e,{dx:e.dx-h,dy:e.dy-d,x:e.x-h,y:e.y-d}),(h||-1!==s.vertical.indexOf(l))&&ii(e,"x",i),(d||-1!==s.horizontal.indexOf(u))&&ii(e,"y",r)}}))}si.$inject=["eventBus"];const ci={__depends__:[an,ln],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Tn],bendpointMove:["type",Nn],bendpointMovePreview:["type",Zn],connectionSegmentMove:["type",qn],bendpointSnapping:["type",si]};function pi(e,t,n,i){function r(e,t){return i.allowed("connection.create",{source:e,target:t})}e.on("connect.hover",(function(e){var t,n=e.context,i=n.start,o=e.hover;if(n.hover=o,t=n.canExecute=r(i,o),!(0,a.kK)(t)){if(!1!==t)return n.source=i,void(n.target=o);t=n.canExecute=r(o,i),(0,a.kK)(t)||!1!==t&&(n.source=o,n.target=i)}})),e.on(["connect.out","connect.cleanup"],(function(e){var t=e.context;t.hover=null,t.source=null,t.target=null,t.canExecute=!1})),e.on("connect.end",(function(e){var t=e.context,i=t.canExecute,r=t.connectionStart,o={x:e.x,y:e.y},s=t.source,c=t.target;if(!i)return!1;var p=null,l={connectionStart:li(t)?o:r,connectionEnd:li(t)?r:o};(0,a.Kn)(i)&&(p=i),t.connection=n.connect(s,c,p,l)})),this.start=function(e,n,i,r){(0,a.Kn)(i)||(r=i,i=(0,Rt.wS)(n)),t.init(e,"connect",{autoActivate:r,data:{shape:n,context:{start:n,connectionStart:i}}})}}function li(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}pi.$inject=["eventBus","dragging","modeling","rules"];var ui="connect-ok",hi="connect-not-ok";function di(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",(function(e){var t=e.context,n=t.canExecute,r=t.hover,o=t.source,a=t.start,s=t.startPosition,c=t.target,p=t.connectionStart||s,l=t.connectionEnd||{x:e.x,y:e.y},u=p,h=l;li(t)&&(u=l,h=p),i.drawPreview(t,n,{source:o||a,target:c||r,connectionStart:u,connectionEnd:h})})),t.on("connect.hover",900,(function(e){var t=e.context,i=e.hover,r=t.canExecute;null!==r&&n.addMarker(i,r?ui:hi)})),t.on(["connect.out","connect.cleanup"],1100,(function(e){var t=e.hover;t&&(n.removeMarker(t,ui),n.removeMarker(t,hi))})),i&&t.on("connect.cleanup",(function(e){i.cleanUp(e.context)}))}di.$inject=["injector","eventBus","canvas"];const fi={__depends__:[Xt.Z,ln,an],__init__:["connectPreview"],connect:["type",pi],connectPreview:["type",di]};var mi=n(230);function vi(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}vi.$inject=["injector","canvas","graphicsFactory","elementFactory"],vi.prototype.drawPreview=function(e,t,n){n=n||{};var i,r,o,a=e.connectionPreviewGfx,s=e.getConnection,c=n.source,p=n.target,l=n.waypoints,u=n.connectionStart,h=n.connectionEnd,d=n.noLayout,f=n.noCropping,m=n.noNoop,v=this;a||(a=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),(0,O.ZH)(a),s||(s=e.getConnection=(r=function(e,t,n){return v.getConnection(e,t,n)},o={},function(e){var t=JSON.stringify(e),n=o[t];return n||(n=o[t]=r.apply(null,arguments)),n})),t&&(i=s(t,c,p)),i?(i.waypoints=l||[],this._layouter&&!d&&(i.waypoints=this._layouter.layoutConnection(i,{source:c,target:p,connectionStart:u,connectionEnd:h,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[c?(0,Rt.wS)(c):u,p?(0,Rt.wS)(p):h]),this._connectionDocking&&(c||p)&&!f&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,c,p)),this._graphicsFactory.drawConnection(a,i,{stroke:"var(--element-dragger-color)"})):!m&&this.drawNoopPreview(a,n)},vi.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||(0,Rt.wS)(n),o=t.connectionEnd||(0,Rt.wS)(i),a=this.cropWaypoints(r,o,n,i),s=this.createNoopConnection(a[0],a[1]);(0,O.R3)(e,s)},vi.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return[e=n&&(0,Rt.Hz)(o,s,!0)||e,t=i&&(0,Rt.Hz)(a,s,!1)||t]},vi.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&(0,O.Od)(e.connectionPreviewGfx)},vi.prototype.getConnection=function(e){var t=function(e){return(0,a.Kn)(e)?e:{}}(e);return this._elementFactory.createConnection(t)},vi.prototype.createConnectionPreviewGfx=function(){var e=(0,O.Ue)("g");return(0,O.Lj)(e,{pointerEvents:"none"}),(0,O.Sh)(e).add("djs-dragger"),(0,O.R3)(this._canvas.getActiveLayer(),e),e},vi.prototype.createNoopConnection=function(e,t){return(0,mi.W5)([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};const gi={__init__:["connectionPreview"],connectionPreview:["type",vi]};var yi=n(23),bi=["marker-start","marker-mid","marker-end"],_i=["circle","ellipse","line","path","polygon","polyline","path","rect"];function xi(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;t.on("drag.cleanup",(function(){r.cleanUp()}))}xi.$inject=["elementRegistry","eventBus","canvas","styles"],xi.prototype.cleanUp=function(){(0,a.Ed)(this._clonedMarkers,(function(e){(0,O.Od)(e)})),this._clonedMarkers={}},xi.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},xi.prototype.addDragger=function(e,t,n,i="djs-dragger"){n=n||this.getGfx(e);var r=(0,O.d9)(n),o=n.getBoundingClientRect();return this._cloneMarkers((0,yi.s)(r),i),(0,O.Lj)(r,this._styles.cls(i,[],{x:o.top,y:o.left})),(0,O.R3)(t,r),(0,O.Lj)(r,"data-preview-support-element-id",e.id),r},xi.prototype.addFrame=function(e,t){var n=(0,O.Ue)("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return(0,O.R3)(t,n),(0,O.Lj)(n,"data-preview-support-element-id",e.id),n},xi.prototype._cloneMarkers=function(e,t="djs-dragger"){var n,i=this;if(e.childNodes)for(var r=0;r!function(e){return e.hidden}(e))).forEach((e=>{let t;(0,K.Ho)(e)?(t=this._graphicsFactory._createContainer("connection",(0,O.Ue)("g")),this._graphicsFactory.drawConnection((0,yi.s)(t),e)):(t=this._graphicsFactory._createContainer("shape",(0,O.Ue)("g")),this._graphicsFactory.drawShape((0,yi.s)(t),e),(0,hn.Iu)(t,e.x,e.y)),this._previewSupport.addDragger(e,o,t)})),n.forEach((({element:e,delta:t})=>{this._previewSupport.addDragger(e,o,void 0,"djs-dragging"),this._canvas.addMarker(e,"djs-element-hidden"),this._markers.push([e,"djs-element-hidden"]);const n=this._previewSupport.addDragger(e,o);(0,K.Ho)(e)?(0,hn.Iu)(n,t.x,t.y):(0,hn.Iu)(n,e.x+t.x,e.y+t.y)})),i.forEach((e=>{this._previewSupport.addDragger(e,o,void 0,"djs-dragging"),this._canvas.addMarker(e,"djs-element-hidden"),this._markers.push([e,"djs-element-hidden"])})),r.forEach((({shape:e,bounds:t})=>{this._canvas.addMarker(e,"djs-hidden"),this._markers.push([e,"djs-hidden"]),this._previewSupport.addDragger(e,o,void 0,"djs-dragging");const n=this._graphicsFactory._createContainer("shape",(0,O.Ue)("g"));this._graphicsFactory.drawShape((0,yi.s)(n),e,{width:t.width,height:t.height}),(0,hn.Iu)(n,t.x,t.y),this._previewSupport.addDragger(e,o,n)}))}cleanUp(){(0,O.ZH)(this._canvas.getLayer(wi)),this._markers.forEach((([e,t])=>this._canvas.removeMarker(e,t))),this._markers=[],this._previewSupport.cleanUp()}show(){this._canvas.showLayer(wi)}hide(){this._canvas.hideLayer(wi)}}Si.$inject=["canvas","graphicsFactory","previewSupport"];const ki={__depends__:[Ei],__init__:["complexPreview"],complexPreview:["type",Si]};var Ci=n(507),Ri=["top","bottom","left","right"];function Ai(e,t){function n(e){if((0,Ci.fF)(e)){var n=function(e){var t=(0,Rt.wS)(e.label),n=Pi((0,Rt.wS)(e),t);if(i=n,-1!==Ri.indexOf(i)){var i,r=function(e){var t=(0,Rt.wS)(e),n=[].concat(e.incoming.map((function(e){return e.waypoints[e.waypoints.length-2]})),e.outgoing.map((function(e){return e.waypoints[1]}))).map((function(e){return Pi(t,e)}));return n}(e);if(e.host){var o=function(e){var t,n=e.host,i=(0,Rt.wS)(e),r=(0,Rt.T8)(i,n);return t=r.indexOf("-")>=0?r.split("-"):[r],Ri.filter((function(e){return-1===t.indexOf(e)}))}(e);r=r.concat(o)}var a=Ri.filter((function(e){return-1===r.indexOf(e)}));if(-1===a.indexOf(n))return a[0]}}(e);n&&function(e,n){var i=(0,Rt.wS)(e),r=e.label,o=(0,Rt.wS)(r);if(r.parent){var a,s=(0,Rt.JA)(e);switch(n){case"top":a={x:i.x,y:s.top-10-r.height/2};break;case"left":a={x:s.left-10-r.width/2,y:i.y};break;case"bottom":a={x:i.x,y:s.bottom+10+r.height/2};break;case"right":a={x:s.right+10+r.width/2,y:i.y}}var c=(0,en.p)(a,o);t.moveShape(r,c)}}(e,n)}}wt.Z.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],(function(e){var t=e.context,i=t.connection,r=i.source,o=i.target;!1!==(t.hints||{}).createElementsBehavior&&(n(r),n(o))})),this.postExecuted(["label.create"],(function(e){var t=e.context,i=t.shape;!1!==(t.hints||{}).createElementsBehavior&&n(i.labelTarget)})),this.postExecuted(["elements.create"],(function(e){var t=e.context,i=t.elements;!1!==(t.hints||{}).createElementsBehavior&&i.forEach((function(e){n(e)}))}))}function Pi(e,t){return(0,Rt.T8)(t,e,5)}function Ti(e){wt.Z.call(this,e),this.preExecute("shape.append",(function(e){var t=e.source,n=e.shape;e.position||((0,$t.is)(n,"bpmn:TextAnnotation")?e.position={x:t.x+t.width/2+75,y:t.y-50-n.height/2}:e.position={x:t.x+t.width+80+n.width/2,y:t.y+t.height/2})}),!0)}function Mi(e,t){e.invoke(wt.Z,this),this.postExecute("shape.move",(function(e){var n=e.newParent,i=e.shape,r=(0,a.hX)(i.incoming.concat(i.outgoing),(function(e){return(0,$t.is)(e,"bpmn:Association")}));(0,a.Ed)(r,(function(e){t.moveConnection(e,{x:0,y:0},n)}))}),!0)}function Di(e,t){t.invoke(wt.Z,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;1===(t=t.filter((function(e){return Bi(e,e.host)}))).length&&t.map((function(e){return t.indexOf(e)})).forEach((function(i){var r=t[i];e.elements[i]=n._replaceShape(t[i],r)}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;if(1===t.length){var r=t[0];Bi(r,i)&&(e.shapes=[n._replaceShape(r,i)])}}),!0)}function Bi(e,t){return!(0,K.j_)(e)&&(0,$t.JZ)(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function ji(e,t){function n(e){return(0,a.hX)(e.attachers,(function(e){return(0,$t.is)(e,"bpmn:BoundaryEvent")}))}wt.Z.call(this,e),this.postExecute("connection.create",(function(e){var i=e.context.source,r=e.context.target,o=n(r);(0,$t.is)(i,"bpmn:EventBasedGateway")&&(0,$t.is)(r,"bpmn:ReceiveTask")&&o.length>0&&t.removeElements(o)})),this.postExecute("connection.reconnect",(function(e){var i=e.context.oldSource,r=e.context.newSource;(0,$t.is)(i,"bpmn:Gateway")&&(0,$t.is)(r,"bpmn:EventBasedGateway")&&(0,a.Ed)(r.outgoing,(function(e){var i=e.target,r=n(i);(0,$t.is)(i,"bpmn:ReceiveTask")&&r.length>0&&t.removeElements(r)}))}))}(0,e.Z)(Ai,wt.Z),Ai.$inject=["eventBus","modeling"],(0,e.Z)(Ti,wt.Z),Ti.$inject=["eventBus"],(0,e.Z)(Mi,wt.Z),Mi.$inject=["injector","modeling"],Di.$inject=["bpmnReplace","injector"],(0,e.Z)(Di,wt.Z),Di.prototype._replaceShape=function(e,t){var n,i,r=(n=e,(i=(0,$t.SS)(n).eventDefinitions)&&i[0]),o={type:"bpmn:BoundaryEvent",host:t};return r&&(o.eventDefinitionType=r.$type),this._bpmnReplace.replaceElement(e,o,{layoutConnection:!1})},ji.$inject=["eventBus","modeling"],(0,e.Z)(ji,wt.Z);var Ni=n(517);function Oi(e,t,n){function i(e){t.updateProperties(e,{isForCompensation:!0})}function r(e){t.updateProperties(e,{isForCompensation:void 0})}wt.Z.call(this,e),this.preExecute("shape.replace",(function(e){const{newData:n,oldShape:i}=e;if(Ii(e.oldShape)&&"bpmn:CompensateEventDefinition"!==n.eventDefinitionType||"bpmn:BoundaryEvent"!==n.type){const t=i.outgoing.find((({target:e})=>Li(e)));t&&t.target&&(e._connectionTarget=t.target)}else if(!Ii(e.oldShape)&&"bpmn:CompensateEventDefinition"===n.eventDefinitionType&&"bpmn:BoundaryEvent"===n.type){const n=i.outgoing.find((({target:e})=>$i(e)));n&&n.target&&(e._connectionTarget=n.target),function(e){const n=e.outgoing.filter((e=>(0,$t.is)(e,"bpmn:SequenceFlow")));t.removeElements(n)}(i)}}),!0),this.postExecuted("shape.replace",(function(e){const{_connectionTarget:n,newShape:i}=e;n&&t.connect(i,n)}),!0),this.preExecute("connection.create",(function(e){const n=e.connection,r=e.source,o=e.target;Ii(r)&&$i(o)&&(i(o),function(e,n){const i=e.outgoing.filter((e=>(0,$t.is)(e,"bpmn:Association")));i.filter((e=>Li(e.target)&&!n.includes(e))).forEach((e=>t.removeConnection(e)))}(r,[n]))}),!0),this.postExecuted("connection.delete",(function(e){const t=e.source,n=e.target;Ii(t)&&Li(n)&&r(n)}),!0),this.postExecuted("connection.reconnect",(function(e){const t=e.newTarget,n=e.oldSource,o=e.oldTarget;if(o!==t){const e=n;Li(o)&&r(o),Ii(e)&&$i(t)&&i(t)}}),!0),this.postExecuted("element.updateProperties",(function(e){const{element:i}=e;Li(i)?(function(e){for(const i of e.incoming)n.canConnect(i.source,e)||t.removeConnection(i);for(const i of e.outgoing)n.canConnect(e,i.target)||t.removeConnection(i)}(i),function(e){const n=e.attachers.slice();n.length&&t.removeElements(n)}(i)):$i(i)&&function(e){const n=e.incoming.filter((e=>Ii(e.source)));t.removeElements(n)}(i)}),!0)}function Li(e){const t=(0,$t.SS)(e);return t&&t.get("isForCompensation")}function Ii(e){return e&&(0,$t.is)(e,"bpmn:BoundaryEvent")&&(0,Ni.JG)(e,"bpmn:CompensateEventDefinition")}function $i(e){return e&&(0,$t.is)(e,"bpmn:Activity")&&!(0,Ni.J5)(e)}function zi(e,t){for((0,a.HD)(t)&&(t=[t]);e=e.parent;)if((0,$t.JZ)(e,t))return e;return null}function Fi(e){e.invoke(wt.Z,this),this.preExecute("shape.create",1500,(function(e){var t=e.context,n=t.parent,i=t.shape;(0,$t.is)(n,"bpmn:Lane")&&!(0,$t.is)(i,"bpmn:Lane")&&(t.parent=zi(n,"bpmn:Participant"))}))}function Hi(e,t){wt.Z.call(this,e),this.preExecute("shape.create",(function(e){var n=e.context.shape;if((0,$t.is)(n,"bpmn:DataObjectReference")&&"label"!==n.type){var i=t.create("bpmn:DataObject");n.businessObject.dataObjectRef=i}}))}(0,e.Z)(Oi,wt.Z),Oi.$inject=["eventBus","modeling","bpmnRules"],Fi.$inject=["injector"],(0,e.Z)(Fi,wt.Z),Hi.$inject=["eventBus","bpmnFactory"],(0,e.Z)(Hi,wt.Z);var Zi=2e3;function Wi(e,t,n){function i(){var t=e.getRootElement();return(0,$t.is)(t,"bpmn:Collaboration")?t:n.makeCollaboration()}wt.Z.call(this,t),t.on(["create.start","shape.move.start"],Zi,(function(t){var n=t.context,i=n.shape,r=e.getRootElement();if((0,$t.is)(i,"bpmn:Participant")&&(0,$t.is)(r,"bpmn:Process")&&r.children.length){var o=r.children.filter((function(e){return!(0,$t.is)(e,"bpmn:Group")&&!(0,K.j_)(e)&&!(0,K.Ho)(e)}));if(o.length){var s=(0,V.jY)(o),c=function(e,t){t={width:t.width+40+30,height:t.height+40};var n=Math.max(e.width,t.width),i=Math.max(e.height,t.height);return{x:-n/2,y:-i/2,width:n,height:i}}(i,s);(0,a.f0)(i,c),n.createConstraints=function(e,t){return{bottom:(t=(0,Rt.JA)(t)).top+e.height/2-20,left:t.right-e.width/2+20,top:t.bottom-e.height/2+20,right:t.left+e.width/2-20-30}}(i,s)}}})),t.on("create.start",Zi,(function(n){var i=n.context.shape,r=e.getRootElement(),o=e.getGraphics(r);function a(e){e.element=r,e.gfx=o}(0,$t.is)(i,"bpmn:Participant")&&(0,$t.is)(r,"bpmn:Process")&&(t.on("element.hover",Zi,a),t.once("create.cleanup",(function(){t.off("element.hover",a)})))})),this.preExecute("elements.create",Zi,(function(e){var t,n=e.elements,r=e.parent,o=function(e){return(0,a.sE)(e,(function(e){return(0,$t.is)(e,"bpmn:Participant")}))}(n);o&&(0,$t.is)(r,"bpmn:Process")&&(e.parent=i(),(t=e.hints=e.hints||{}).participant=o,t.process=r,t.processRef=(0,$t.SS)(o).get("processRef"))}),!0),this.preExecute("shape.create",(function(e){var t=e.parent,n=e.shape;(0,$t.is)(n,"bpmn:Participant")&&(0,$t.is)(t,"bpmn:Process")&&(e.parent=i(),e.process=t,e.processRef=(0,$t.SS)(n).get("processRef"))}),!0),this.execute("shape.create",(function(e){var t=e.hints||{},n=e.process||t.process,i=e.shape,r=t.participant;!n||r&&i!==r||(0,$t.SS)(i).set("processRef",(0,$t.SS)(n))}),!0),this.revert("shape.create",(function(e){var t=e.hints||{},n=e.process||t.process,i=e.processRef||t.processRef,r=e.shape,o=t.participant;!n||o&&r!==o||(0,$t.SS)(r).set("processRef",i)}),!0),this.postExecute("shape.create",(function(e){var t=e.hints||{},i=e.process||e.hints.process,r=e.shape,o=t.participant;if(i){var a=i.children.slice();o?r===o&&n.moveElements(a,{x:0,y:0},o):n.moveElements(a,{x:0,y:0},r)}}),!0)}Wi.$inject=["canvas","eventBus","modeling"],(0,e.Z)(Wi,wt.Z);var Ui=n(943),Vi="__targetRef_placeholder";function Gi(e,t){function n(e,n){var i=e.get("properties"),r=(0,a.sE)(i,(function(e){return e.name===Vi}));return!r&&n&&(r=t.create("bpmn:Property",{name:Vi}),(0,Ui.IH)(i,r)),r}function i(e,t){var i=n(e);i&&(function(e,t,n){var i=e.get("dataInputAssociations");return(0,a.sE)(i,(function(e){return e!==n&&e.targetRef===t}))}(e,i,t)||(0,Ui.Od)(e.get("properties"),i))}function r(e){var t,r=e.context,o=r.connection,a=o.businessObject,s=o.target,c=s&&s.businessObject,p=r.newTarget,l=p&&p.businessObject,u=r.oldTarget||r.target,h=u&&u.businessObject,d=o.businessObject;h&&h!==c&&i(h,a),l&&l!==c&&i(l,a),c?(t=n(c,!0),d.targetRef=t):d.targetRef=null}wt.Z.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Ki(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Ki(r))}function Ki(e){return function(t){var n=t.context.connection;if((0,$t.is)(n,"bpmn:DataInputAssociation"))return e(t)}}function Ji(e){this._bpmnUpdater=e}function qi(e,t,n,i){function r(e){return e.children.filter((function(e){return(0,$t.is)(e,"bpmn:DataStoreReference")&&!e.labelTarget}))}function o(e,i){var r=e.businessObject||e;if(i=i||n.filter((function(e){return(0,$t.is)(e,"bpmn:Participant")&&(0,$t.SS)(e).processRef}))[0]){var o=i.businessObject||i;t.execute("dataStore.updateContainment",{dataStoreBo:r,dataStoreDi:(0,$t.DN)(e),newSemanticParent:o.processRef||o,newDiParent:(0,$t.DN)(i)})}}wt.Z.call(this,i),t.registerHandler("dataStore.updateContainment",Ji),this.preExecute("shape.create",(function(e){var t=e.context,n=t.shape;(0,$t.is)(n,"bpmn:DataStoreReference")&&"label"!==n.type&&(t.hints||(t.hints={}),t.hints.autoResize=!1)})),this.preExecute("elements.move",(function(e){var t=e.context,n=t.shapes;n.filter((function(e){return(0,$t.is)(e,"bpmn:DataStoreReference")})).length&&(t.hints||(t.hints={}),t.hints.autoResize=n.filter((function(e){return!(0,$t.is)(e,"bpmn:DataStoreReference")})))})),this.postExecute("shape.create",(function(e){var t=e.context.shape,n=t.parent;(0,$t.is)(t,"bpmn:DataStoreReference")&&"label"!==t.type&&(0,$t.is)(n,"bpmn:Collaboration")&&o(t)})),this.postExecute("shape.move",(function(e){var t=e.context,n=t.shape,i=t.oldParent,r=n.parent;(0,$t.is)(i,"bpmn:Collaboration")||(0,$t.is)(n,"bpmn:DataStoreReference")&&"label"!==n.type&&(0,$t.is)(r,"bpmn:Collaboration")&&o(n,(0,$t.is)(i,"bpmn:Participant")?i:function(e,t){for(;e.parent;){if((0,$t.is)(e.parent,"bpmn:Participant"))return e.parent;e=e.parent}}(i))})),this.postExecute("shape.delete",(function(t){var n=t.context.shape,i=e.getRootElement();(0,$t.JZ)(n,["bpmn:Participant","bpmn:SubProcess"])&&(0,$t.is)(i,"bpmn:Collaboration")&&r(i).filter((function(e){return function(e,t){for(var n=e.businessObject||e,i=t.businessObject||t;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}(e,n)})).forEach((function(e){o(e)}))})),this.postExecute("canvas.updateRoot",(function(e){var t=e.context,n=t.oldRoot,i=t.newRoot;r(n).forEach((function(e){(0,$t.is)(i,"bpmn:Process")&&o(e,i)}))}))}Gi.$inject=["eventBus","bpmnFactory"],(0,e.Z)(Gi,wt.Z),Ji.$inject=["bpmnUpdater"],Ji.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.newSemanticParent,r=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},Ji.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.oldSemanticParent,r=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},qi.$inject=["canvas","commandStack","elementRegistry","eventBus"],(0,e.Z)(qi,wt.Z);var Xi=Math.max,Yi=Math.min,Qi=20;function er(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function tr(e,t){return{x:e.x+(t.left||0),y:e.y+(t.top||0),width:e.width-(t.left||0)+(t.right||0),height:e.height-(t.top||0)+(t.bottom||0)}}function nr(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return(0,a.hj)(r)&&(i=(/top|left/.test(e)?Yi:Xi)(i,r)),(0,a.hj)(o)&&(i=(/top|left/.test(e)?Xi:Yi)(i,o)),i}function ir(e,t){return void 0!==e?e:Qi}function rr(e){return!e.waypoints&&"label"!==e.type}function or(e,t){var n;if((n=void 0===e.length?(0,a.hX)(e.children,rr):e).length)return function(e,t){var n,i,r,o;return"object"==typeof t?(n=ir(t.left),i=ir(t.right),r=ir(t.top),o=ir(t.bottom)):n=i=r=o=ir(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}((0,V.jY)(n),t)}var ar=Math.abs,sr=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],cr=30;function pr(e,t){return t=t||[],e.children.filter((function(e){(0,$t.is)(e,"bpmn:Lane")&&(pr(e,t),t.push(e))})),t}function lr(e){return e.children.filter((function(e){return(0,$t.is)(e,"bpmn:Lane")}))}function ur(e){return zi(e,sr)||e}function hr(e,t){wt.Z.call(this,e),this.postExecuted("shape.delete",500,(function(e){var n=e.context,i=n.hints,r=n.shape,o=n.oldParent;(0,$t.is)(r,"bpmn:Lane")&&(i&&i.nested||function(e,n){var i,r,o,a,s,c=(0,Ni.wE)(e),p=lr(n),l=[],u=[],h=[],d=[];(0,V.om)(p,(function(t){return c?t.y>e.y?u.push(t):l.push(t):t.x>e.x?d.push(t):h.push(t),t.children})),p.length&&(i=c?u.length&&l.length?e.height/2:e.height:d.length&&h.length?e.width/2:e.width,l.length&&(r=t.calculateAdjustments(l,"y",i,e.y-10),t.makeSpace(r.movingShapes,r.resizingShapes,{x:0,y:i},"s")),u.length&&(o=t.calculateAdjustments(u,"y",-i,e.y+e.height+10),t.makeSpace(o.movingShapes,o.resizingShapes,{x:0,y:-i},"n")),h.length&&(a=t.calculateAdjustments(h,"x",i,e.x-10),t.makeSpace(a.movingShapes,a.resizingShapes,{x:i,y:0},"e")),d.length&&(s=t.calculateAdjustments(d,"x",-i,e.x+e.width+10),t.makeSpace(s.movingShapes,s.resizingShapes,{x:-i,y:0},"w")))}(r,o))}))}function dr(e,t){t.invoke(wt.Z,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;t.filter((function(e){return fr(e,e.host)})).map((function(e){return t.indexOf(e)})).forEach((function(i){e.elements[i]=n._replaceShape(t[i])}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;t.forEach((function(e,r){var o,a=e.host;fr(e,(o=a,-1!==t.indexOf(o)?a:i))&&(t[r]=n._replaceShape(e))}))}),!0)}function fr(e,t){return!(0,K.j_)(e)&&(0,$t.is)(e,"bpmn:BoundaryEvent")&&!t}function mr(e,t,n){function i(e,i,r){var o,s,c,p,l,u,h,d,f=i.waypoints,m=e.outgoing.slice(),v=e.incoming.slice(),g=gn(f,d=(0,a.hj)(r.width)?(0,Rt.wS)(r):r);if(g){if(o=f.slice(0,g.index),s=f.slice(g.index+(g.bendpoint?1:0)),!o.length||!s.length)return;c=g.bendpoint?f[g.index]:d,1!==o.length&&vr(e,o[o.length-1])||o.push(gr(c)),1!==s.length&&vr(e,s[0])||s.unshift(gr(c))}p=i.source,l=i.target,t.canConnect(p,e,i)&&(n.reconnectEnd(i,e,o||d),u=i),t.canConnect(e,l,i)&&(u?h=n.connect(e,l,{type:i.type,waypoints:s}):(n.reconnectStart(i,e,s||d),h=i));var y=[].concat(u&&(0,a.hX)(v,(function(e){return e.source===u.source}))||[],h&&(0,a.hX)(m,(function(e){return e.target===h.target}))||[]);y.length&&n.removeElements(y)}wt.Z.call(this,e),this.preExecute("elements.move",(function(e){var n=e.newParent,i=e.shapes,r=e.delta,o=i[0];if(o&&n){n&&n.waypoints&&(e.newParent=n=n.parent);var s=(0,Rt.wS)(o),c={x:s.x+r.x,y:s.y+r.y},p=(0,a.sE)(n.children,(function(e){return t.canInsert(i,e)&&gn(e.waypoints,c)}));p&&(e.targetFlow=p,e.position=c)}}),!0),this.postExecuted("elements.move",(function(e){var t=e.shapes,n=e.targetFlow,r=e.position;n&&i(t[0],n,r)}),!0),this.preExecute("shape.create",(function(e){var n=e.parent,i=e.shape;t.canInsert(i,n)&&(e.targetFlow=n,e.parent=n.parent)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.targetFlow,r=e.position;n&&i(t,n,r)}),!0)}function vr(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function gr(e){return(0,a.f0)({},e)}function yr(e,t){wt.Z.call(this,e),this.preExecuted("connection.create",(function(e){var n=e.context,i=n.connection,r=n.source,o=n.target,a=n.hints;a&&!1===a.createElementsBehavior||!br(i)||((0,$t.is)(r,"bpmn:EventBasedGateway")?o.incoming.filter((e=>e!==i&&br(e))):o.incoming.filter((e=>e!==i&&br(e)&&(0,$t.is)(e.source,"bpmn:EventBasedGateway")))).forEach((function(e){t.removeConnection(e)}))})),this.preExecuted("shape.replace",(function(e){var n=e.context.newShape;(0,$t.is)(n,"bpmn:EventBasedGateway")&&n.outgoing.filter(br).reduce((function(e,t){return e.includes(t.target)?e:e.concat(t.target)}),[]).forEach((function(e){e.incoming.filter(br).forEach((function(i){const r=e.incoming.filter(br).filter((function(e){return e.source===n}));(i.source!==n||r.length>1)&&t.removeConnection(i)}))}))}))}function br(e){return(0,$t.is)(e,"bpmn:SequenceFlow")}hr.$inject=["eventBus","spaceTool"],(0,e.Z)(hr,wt.Z),dr.$inject=["bpmnReplace","injector"],(0,e.Z)(dr,wt.Z),dr.prototype._replaceShape=function(e){var t,n,i,r=(n=e,(i=(0,$t.SS)(n).eventDefinitions)&&i[0]);return t=r?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:r.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},(0,e.Z)(mr,wt.Z),mr.$inject=["eventBus","bpmnRules","modeling"],yr.$inject=["eventBus","modeling"],(0,e.Z)(yr,wt.Z);var _r=1500;function xr(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],_r,(function(t){var i=t.context.shape||t.shape,r=t.hover;(0,$t.is)(r,"bpmn:Lane")&&!(0,$t.JZ)(i,["bpmn:Lane","bpmn:Participant"])&&(t.hover=ur(r),t.hoverGfx=e.getGraphics(t.hover));var o=n.getRootElement();r!==o&&(i.labelTarget||(0,$t.JZ)(i,["bpmn:Group","bpmn:TextAnnotation"]))&&(t.hover=o,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],_r,(function(t){var n=t.hover;(0,$t.is)(n,"bpmn:Lane")&&(t.hover=ur(n)||n,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["bendpoint.move.hover"],_r,(function(t){var n=t.context,i=t.hover,r=n.type;(0,$t.is)(i,"bpmn:Lane")&&/reconnect/.test(r)&&(t.hover=ur(i)||i,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.start"],_r,(function(e){var t=e.context,n=t.start;(0,$t.is)(n,"bpmn:Lane")&&(t.start=ur(n)||n)})),t.on("shape.move.start",2e3,(function(e){var t=e.shape;(0,$t.is)(t,"bpmn:Lane")&&(e.shape=ur(t)||t)})),t.on("spaceTool.move",2e3,(function(e){var t=e.hover;t&&(0,$t.is)(t,"bpmn:Lane")&&(e.hover=ur(t))}))}function Er(e,t,n,i,r,o){function a(e,t,i){var r=n.filter((function(e){return(0,$t.is)(e,"bpmn:Group")})).filter((function(e){return e.businessObject!==i}));t&&!function(e,t){return e.some((function(e){var n=(0,$t.SS)(e);return(n.categoryValueRef&&n.categoryValueRef.$parent)===t}))}(r,t)&&function(e){var t=e.$parent;t&&((0,Ui.Od)(t.get("rootElements"),e),e.$parent=null)}(t),e&&!function(e,t){return e.some((function(e){return(0,$t.SS)(e).categoryValueRef===t}))}(r,e)&&function(e){var t=e.$parent;t&&((0,Ui.Od)(t.get("categoryValue"),e),e.$parent=null)}(e)}function s(e,n){return function(e,t,n){return(0,Ui.IH)(t.get("categoryValue"),e),e.$parent=t,(0,Ui.IH)(n.get("rootElements"),t),t.$parent=n,e}(e,n,t.getDefinitions())}function c(n,i){var r=(0,$t.SS)(n),o=r.categoryValueRef;o||(o=r.categoryValueRef=i.categoryValue=i.categoryValue||function(e){return e.create("bpmn:CategoryValue")}(e));var a=o.$parent;a||(a=o.$parent=i.category=i.category||function(e){return e.create("bpmn:Category")}(e)),s(o,a,t.getDefinitions())}function p(e,t){var n=t.category,i=t.categoryValue,r=(0,$t.SS)(e);i?(r.categoryValueRef=null,a(i,n,r)):a(null,r.categoryValueRef.$parent,r)}function l(t,n){var i=e.create(t.$type);return o.copyElement(t,i,null,n)}r.invoke(wt.Z,this),this.execute("label.create",(function(e){var t=e.context,n=t.labelTarget;(0,$t.is)(n,"bpmn:Group")&&c(n,t)})),this.revert("label.create",(function(e){var t=e.context,n=t.labelTarget;(0,$t.is)(n,"bpmn:Group")&&p(n,t)})),this.execute("shape.delete",(function(e){var t=e.context,n=t.shape,i=(0,$t.SS)(n);if((0,$t.is)(n,"bpmn:Group")&&!n.labelTarget){var r=t.categoryValue=i.categoryValueRef;r&&(a(r,t.category=r.$parent,i),i.categoryValueRef=null)}})),this.reverted("shape.delete",(function(e){var t=e.context,n=t.shape;if((0,$t.is)(n,"bpmn:Group")&&!n.labelTarget){var i=t.category,r=t.categoryValue,o=(0,$t.SS)(n);r&&(o.categoryValueRef=r,s(r,i))}})),this.execute("shape.create",(function(e){var t=e.context,n=t.shape;(0,$t.is)(n,"bpmn:Group")&&!n.labelTarget&&(0,$t.SS)(n).categoryValueRef&&c(n,t)})),this.reverted("shape.create",(function(e){var t=e.context,n=t.shape;(0,$t.is)(n,"bpmn:Group")&&!n.labelTarget&&(0,$t.SS)(n).categoryValueRef&&p(n,t)})),i.on("copyPaste.copyElement",770,(function(e){var t=e.descriptor,n=e.element;if((0,$t.is)(n,"bpmn:Group")&&!n.labelTarget){var i=(0,$t.SS)(n);if(i.categoryValueRef){var r=i.categoryValueRef;t.categoryValue=l(r,!0),r.$parent&&(t.category=l(r.$parent,!0))}}})),i.on("copyPaste.pasteElement",770,(function(e){var t=e.descriptor,n=t.businessObject,i=t.categoryValue,r=t.category;i&&(i=n.categoryValueRef=l(i)),r&&(i.$parent=l(r)),delete t.category,delete t.categoryValue}))}function wr(e,t,n,i){var r,o,a,s;return 0==(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))?null:(o=e.y-n.y,a=e.x-n.x,s=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function Sr(e){function t(e,t,n){var i,r={x:n.x,y:n.y-50},o={x:n.x-50,y:n.y},a=wr(e,t,n,r),s=wr(e,t,n,o);i=a&&s?kr(a,n)>kr(s,n)?s:a:a||s,e.original=i}e.on("bpmnElement.added",(function(e){var n,i,r=e.element;r.waypoints&&(t((i=(n=r).waypoints)[0],i[1],(0,Rt.wS)(n.source)),t(i[i.length-1],i[i.length-2],(0,Rt.wS)(n.target)))}))}function kr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Cr(e){wt.Z.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],(function(e){var n=e.context.shape,i=(0,$t.SS)(n),r=(0,$t.DN)(n);if((0,$t.JZ)(i,t)){var o=r.get("isHorizontal");void 0===o&&(o=!0),r.set("isHorizontal",o)}}))}xr.$inject=["elementRegistry","eventBus","canvas"],Er.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],(0,e.Z)(Er,wt.Z),Sr.$inject=["eventBus"],Cr.$inject=["eventBus"],(0,e.Z)(Cr,wt.Z);var Rr=Math.sqrt,Ar=Math.min,Pr=Math.max,Tr=Math.abs;function Mr(e){return Math.pow(e,2)}function Dr(e,t){return Rr(Mr(e.x-t.x)+Mr(e.y-t.y))}function Br(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,p=(r*a+o*s)/c,l=p*p-(a*a+s*s-i*i)/c;if(l<0&&l>-1e-6&&(l=0),l<0)return[];var u=Rr(l),h=-p+u,d=-p-u,f={x:e.x-r*h,y:e.y-o*h};return 0===l?[f]:[f,{x:e.x-r*d,y:e.y-o*d}].filter((function(n){return function(e,t,n){return jr(e.x,t.x,n.x)&&jr(e.y,t.y,n.y)}(n,e,t)}))}function jr(e,t,n){return e>=Ar(t,n)-Nr&&e<=Pr(t,n)+Nr}var Nr=.1;function Or(e,t){return Tr(e.x-t.x)<=Nr&&Tr(e.y-t.y)<=Nr}function Lr(e,t,n,i){var r=0,o=0,a={point:e,delta:{x:0,y:0}},s=function(e,t){var n,i,r,o,a,s,c,p,l,u,h,d,f=0;for(f=0;f line intersections");1===s.length&&(c={type:"bendpoint",position:s[0],segmentIndex:f,bendpointIndex:Or(n,s[0])?f:f+1}),2===s.length&&(h=s[0],d=s[1],c={type:"segment",position:a={x:(h.x+d.x)/2,y:(h.y+d.y)/2},segmentIndex:f,relativeLocation:Dr(n,a)/Dr(n,i)}),p=Dr(c.position,e),(!u||l>p)&&(u=c,l=p)}return u}(e,n),c=s.segmentIndex,p=function(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o=l&&(c=p?r+1:r-1),rt.length-2||null===p)return a;var l,u,h,d,f,m,v=$r(n,c),g=$r(t,p),y=s.position,b=(d=y,f=En((h=v)[0],h[1]),m=En(h[0],d),0===f?0:m/f),_=(l=g,u=bn(v),bn(l)-u);if("bendpoint"===s.type){var x=t.length-n.length,E=s.bendpointIndex,w=n[E];if(-1!==t.indexOf(w))return a;if(0===x){var S=t[E];return{delta:{x:r=S.x-s.position.x,y:o=S.y-s.position.y},point:{x:e.x+r,y:e.y+o}}}x<0&&0!==E&&E{(0,$t.SS)(e.context.element)===e.context.moddleElement&&r(e)})),this.postExecute(["shape.create","connection.create"],(function(e){var n=e.context;if(!1!==(n.hints||{}).createElementsBehavior){var i=n.shape||n.connection;!(0,K.j_)(i)&&(0,Ci.ly)(i)&&(0,Ci.id)(i)&&t.updateLabel(i,(0,Ci.id)(i))}})),this.postExecute("shape.delete",(function(e){var n=e.context,i=n.labelTarget,r=n.hints||{};i&&!1!==r.unsetLabel&&t.updateLabel(i,null,null,{removeShape:!1})})),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var n=e.context;if(!1!==(n.hints||{}).labelBehavior){var i,r=n.connection.label;r&&r.parent&&(i=function(e){var t=e.context,n=t.connection,i=n.label,r=(0,a.f0)({},t.hints),o=t.newWaypoints||n.waypoints,s=t.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),function(e,t,n,i){return Lr((0,Rt.wS)(e),t,n,i).delta}(i,o,s,r)}(e),t.moveShape(r,i))}})),this.postExecute(["shape.replace"],(function(e){var t=e.context,n=t.newShape,i=t.oldShape,r=(0,$t.SS)(n);r&&(0,Ci.ly)(r)&&i.label&&n.label&&(n.label.x=i.label.x,n.label.y=i.label.y)})),this.postExecute("shape.resize",(function(e){var n,i=e.context,r=i.shape,o=i.newBounds,s=i.oldBounds;if((0,Ci.fF)(r)){var c=r.label,p=function(e,t){if(t.length){var n=function(e,t){var n=t.map((function(t){return{line:t,distance:xn(e,t)}}));return(0,a.MR)(n,"distance")[0].line}(e,t);return _n(e,n)}}((0,Rt.wS)(c),[[{x:(n=s).x,y:n.y},{x:n.x+(n.width||0),y:n.y}],[{x:n.x+(n.width||0),y:n.y},{x:n.x+(n.width||0),y:n.y+(n.height||0)}],[{x:n.x,y:n.y+(n.height||0)},{x:n.x+(n.width||0),y:n.y+(n.height||0)}],[{x:n.x,y:n.y},{x:n.x,y:n.y+(n.height||0)}]]),l=function(e,t,n){var i=zr(e,t,n);return(0,Rt.ex)((0,en.p)(i,e))}(p,s,o);t.moveShape(c,l)}}))}function Ur(e,t){function n(e,t){var n=e.context,i=n.connection,r=(0,a.f0)({},n.hints),o=n.newWaypoints||i.waypoints,s=n.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),function(e,t,n,i){return Lr(e,t,n,i).point}(t,o,s,r)}wt.Z.call(this,e),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var i=e.context.connection,r=i.outgoing;i.incoming.forEach((function(i){var r=i.waypoints[i.waypoints.length-1],o=n(e,r),a=[].concat(i.waypoints.slice(0,-1),[o]);t.updateWaypoints(i,a)})),r.forEach((function(i){var r=i.waypoints[0],o=n(e,r),a=[].concat([o],i.waypoints.slice(1));t.updateWaypoints(i,a)}))})),this.postExecute(["connection.move"],(function(e){var n=e.context,i=n.connection,r=i.outgoing,o=i.incoming,a=n.delta;o.forEach((function(e){var n=e.waypoints[e.waypoints.length-1],i={x:n.x+a.x,y:n.y+a.y},r=[].concat(e.waypoints.slice(0,-1),[i]);t.updateWaypoints(e,r)})),r.forEach((function(e){var n=e.waypoints[0],i={x:n.x+a.x,y:n.y+a.y},r=[].concat([i],e.waypoints.slice(1));t.updateWaypoints(e,r)}))}))}function Vr(e,t,n){var i=Xr(e),r=Yr(i,t),o=i[0];return r.length?r[r.length-1]:zr(o.original||o,n,t)}function Gr(e,t,n){var i=Xr(e),r=Yr(i,t),o=i[i.length-1];return r.length?r[0]:zr(o.original||o,n,t)}function Kr(e,t,n){var i=Xr(e),r=qr(t,n),o=i[0];return zr(o.original||o,r,t)}function Jr(e,t,n){var i=Xr(e),r=qr(t,n),o=i[i.length-1];return zr(o.original||o,r,t)}function qr(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Xr(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Yr(e,t){var n=(0,a.UI)(e,Qr);return(0,a.hX)(n,(function(e){return function(e,t){return"intersect"===(0,Rt.T8)(t,e,1)}(e,t)}))}function Qr(e){return e.original||e}function eo(e,t){wt.Z.call(this,e),this.postExecute("shape.replace",(function(e){var n=e.oldShape,i=e.newShape;if(function(e,t){return(0,$t.is)(e,"bpmn:Participant")&&(0,Ni.ul)(e)&&(0,$t.is)(t,"bpmn:Participant")&&!(0,Ni.ul)(t)}(n,i)){var r,o,a,s,c=(r=n,o=(0,V.PB)([r],!1),a=[],s=[],o.forEach((function(e){e!==r&&(e.incoming.forEach((function(e){(0,$t.is)(e,"bpmn:MessageFlow")&&a.push(e)})),e.outgoing.forEach((function(e){(0,$t.is)(e,"bpmn:MessageFlow")&&s.push(e)})))}),[]),{incoming:a,outgoing:s});c.incoming.forEach((function(e){var r=Gr(e,i,n);t.reconnectEnd(e,i,r)})),c.outgoing.forEach((function(e){var r=Vr(e,i,n);t.reconnectStart(e,i,r)}))}}),!0)}(0,e.Z)(Wr,wt.Z),Wr.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],(0,e.Z)(Ur,wt.Z),Ur.$inject=["eventBus","modeling"],eo.$inject=["eventBus","modeling"],(0,e.Z)(eo,wt.Z);const to=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function no(e){const t=(0,$t.SS)(e);if(!((0,$t.is)(t,"bpmn:BoundaryEvent")||(0,$t.is)(t,"bpmn:StartEvent")&&(0,Ni.J5)(t.$parent)))return!1;const n=t.get("eventDefinitions");return!(!n||!n.length)&&to.some((e=>(0,$t.is)(n[0],e)))}function io(e){return(0,$t.is)(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function ro(e,t){e.invoke(wt.Z,this),this.postExecuted("shape.replace",(function(e){const n=e.context.oldShape,i=e.context.newShape,r=e.context.hints;if(!no(i))return;const o=io(i);if(r.targetElement&&void 0!==r.targetElement[o])return;const a=(0,$t.SS)(n).get(o);a!==(0,$t.SS)(i).get(o)&&t.updateProperties(i,{[o]:a})}))}function oo(e,t){wt.Z.call(this,e),this.preExecute("shape.resize",(function(e){var n=e.shape,i=(0,$t.DN)(n),r=i&&i.get("label");r&&r.get("bounds")&&t.updateModdleProperties(n,r,{bounds:void 0})}),!0)}function ao(e,t,n){wt.Z.call(this,e),this.preExecute("shape.delete",(function(e){var i,r,o,a=e.context.shape;if(1===a.incoming.length&&1===a.outgoing.length){var s=a.incoming[0],c=a.outgoing[0];if((0,$t.is)(s,"bpmn:SequenceFlow")&&(0,$t.is)(c,"bpmn:SequenceFlow")&&t.canConnect(s.source,c.target,s)){var p=(i=s.waypoints,r=c.waypoints,(o=wr(so(i[i.length-2]),so(i[i.length-1]),so(r[1]),so(r[0])))?[].concat(i.slice(0,i.length-1),[o],r.slice(1)):[so(i[0]),so(r[r.length-1])]);n.reconnectEnd(s,c.target,p)}}}))}function so(e){return e.original||e}function co(e,t){wt.Z.call(this,e),this.preExecute("shape.delete",(function(e){var t=e.shape,n=t.parent;(0,$t.is)(t,"bpmn:Participant")&&(e.collaborationRoot=n)}),!0),this.postExecute("shape.delete",(function(e){var n=e.collaborationRoot;n&&!n.businessObject.participants.length&&t.makeProcess()}),!0)}function po(e,t,n,i){wt.Z.call(this,e);var r=i.get("dragging",!1);function o(e){var i,r,o=e.source,a=e.target;e.parent&&((0,$t.is)(e,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(o,a)||(r=!0),n.canConnectMessageFlow(o,a)&&(i="bpmn:MessageFlow")),(0,$t.is)(e,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(o,a)||(r=!0),n.canConnectSequenceFlow(o,a)&&(i="bpmn:SequenceFlow")),r&&t.removeConnection(e),i&&t.connect(o,a,{type:i,waypoints:e.waypoints.slice()}))}this.postExecuted("elements.move",(function(e){var t=e.closure.allConnections;(0,a.Ed)(t,o)}),!0),this.preExecute("connection.reconnect",(function(e){var i,o,a=e.context,s=a.connection,c=a.newSource||s.source,p=a.newTarget||s.target;(i=n.canConnect(c,p))&&i.type!==s.type&&(o=t.connect(c,p,{type:i.type,associationDirection:i.associationDirection,waypoints:s.waypoints.slice()}),s.parent&&t.removeConnection(s),a.connection=o,r&&function(e,t){var n,i=r.context(),o=i&&i.payload.previousSelection;o&&o.length&&-1!==(n=o.indexOf(e))&&o.splice(n,1,t)}(s,o))})),this.postExecuted("element.updateProperties",(function(e){var n,i=e.context,r=i.properties,o=i.element,s=o.businessObject;r.default&&(n=(0,a.sE)(o.outgoing,(0,a.KQ)({id:o.businessObject.default.id})))&&t.updateProperties(n,{conditionExpression:void 0}),r.conditionExpression&&s.sourceRef.default===s&&t.updateProperties(o.source,{default:void 0})}))}function lo(e,t,n,i,r,o){i.invoke(wt.Z,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,(function(e){var n=e.context,i=n.parent,r=n.elements,o=(0,a.u4)(r,(function(e,n){var r=t.canReplace([n],n.host||n.parent||i);return r?e.concat(r.replacements):e}),[]);o.length&&this._replaceElements(r,o)}),this),this.postExecuted(["elements.move"],500,(function(e){var n=e.context,i=n.newParent,r=n.newHost,o=[];(0,a.Ed)(n.closure.topLevel,(function(e){o=(0,Ni.J5)(e)?o.concat(e.children):o.concat(e)})),1===o.length&&r&&(i=r);var s=t.canReplace(o,i);s&&this._replaceElements(o,s.replacements,r)}),this),this.postExecute(["shape.replace"],1500,(function(e){var n,i=e.context,r=i.oldShape,o=i.newShape,a=r.attachers;a&&a.length&&(n=t.canReplace(a,o),this._replaceElements(a,n.replacements))}),this),this.postExecuted(["shape.replace"],1500,(function(e){var t=e.context,n=t.oldShape,i=t.newShape;r.unclaimId(n.businessObject.id,n.businessObject),r.updateProperties(i,{id:n.id})}))}ro.$inject=["injector","modeling"],(0,e.Z)(ro,wt.Z),(0,e.Z)(oo,wt.Z),oo.$inject=["eventBus","modeling"],(0,e.Z)(ao,wt.Z),ao.$inject=["eventBus","bpmnRules","modeling"],co.$inject=["eventBus","modeling"],(0,e.Z)(co,wt.Z),(0,e.Z)(po,wt.Z),po.$inject=["eventBus","modeling","bpmnRules","injector"],(0,e.Z)(lo,wt.Z),lo.prototype._replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;(0,a.Ed)(t,(function(t){var r={type:t.newElementType},o=n.get(t.oldElementId),a=e.indexOf(o);e[a]=i.replaceElement(o,r,{select:!1})})),t&&r.select(e)},lo.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var uo={width:140,height:120},ho={width:300,height:60},fo={width:60,height:300},mo={width:300,height:150},vo={width:150,height:300},go={width:140,height:120},yo={width:50,height:30};function bo(e){e.on("resize.start",1500,(function(e){var t=e.context,n=t.shape,i=t.direction,r=t.balanced;((0,$t.is)(n,"bpmn:Lane")||(0,$t.is)(n,"bpmn:Participant"))&&(t.resizeConstraints=function(e,t,n){var i=ur(e),r=!0,o=!0,a=pr(i,[i]),s=(0,Rt.JA)(e),c={},p={},l=(0,Ni.wE)(e),u=l?ho:fo;/n/.test(t)?p.top=s.bottom-u.height:/e/.test(t)?p.right=s.left+u.width:/s/.test(t)?p.bottom=s.top+u.height:/w/.test(t)&&(p.left=s.right-u.width),a.forEach((function(e){var i=(0,Rt.JA)(e);/n/.test(t)&&(l&&i.tops.right+10&&(o=!1),n&&_o(s.right-i.left)<10&&So(c,"right",i.right-u.width),_o(s.right-i.right)<5&&ko(p,"right",i.left+u.width)),/s/.test(t)&&(l&&i.bottom>s.bottom+10&&(o=!1),n&&_o(s.bottom-i.top)<10&&So(c,"bottom",i.bottom-u.height),_o(s.bottom-i.bottom)<5&&ko(p,"bottom",i.top+u.height)),/w/.test(t)&&(!l&&i.left=r.y&&t<=r.y+r.height||n&&t>=r.x&&t<=r.x+r.width)return(o=lr(r)).length?jo(o,t,n):r}Mo.$inject=["eventBus"];var No=n(826);function Oo(e,t,n,i,r,o,s){wt.Z.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=s;var c=this;function p(e){return(0,$t.is)(e,"bpmn:SubProcess")&&!(0,Ni.ul)(e)}function l(t){var n=t.shape,i=t.newRootElement,r=(0,$t.SS)(n);i=c._addDiagram(i||r),t.newRootElement=e.addRootElement(i)}function u(t){var n=t.shape,i=(0,$t.SS)(n);c._removeDiagram(i);var r=t.newRootElement=s.get((0,No.sU)(i));e.removeRootElement(r)}this.executed("shape.create",(function(e){p(e.shape)&&l(e)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.newRootElement;n&&t.children&&(c._showRecursively(t.children),c._moveChildrenToShape(t,n))}),!0),this.reverted("shape.create",(function(e){p(e.shape)&&u(e)}),!0),this.preExecuted("shape.delete",(function(e){var t=e.shape;if(p(t)){var i=s.get((0,No.sU)(t));i&&n.removeElements(i.children.slice())}}),!0),this.executed("shape.delete",(function(e){p(e.shape)&&u(e)}),!0),this.reverted("shape.delete",(function(e){p(e.shape)&&l(e)}),!0),this.preExecuted("shape.replace",(function(t){var n=t.oldShape,i=t.newShape;p(n)&&p(i)&&(t.oldRoot=e.removeRootElement((0,No.sU)(n)))}),!0),this.postExecuted("shape.replace",(function(t){var i=t.newShape,r=t.oldRoot,o=e.findRoot((0,No.sU)(i));if(r&&o){var a=r.children;n.moveElements(a,{x:0,y:0},o)}}),!0),this.executed("element.updateProperties",(function(e){var t=e.element;if((0,$t.is)(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties.id,r=n.id;if(i!==r){if((0,No.k3)(t))return s.updateId(t,(0,No.UK)(r)),void s.updateId(i,r);s.get((0,No.UK)(i))&&s.updateId((0,No.UK)(i),(0,No.UK)(r))}}}),!0),this.reverted("element.updateProperties",(function(e){var t=e.element;if((0,$t.is)(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties.id,r=n.id;if(i!==r){if((0,No.k3)(t))return s.updateId(t,(0,No.UK)(i)),void s.updateId(r,i);var o=s.get((0,No.UK)(r));o&&s.updateId(o,(0,No.UK)(i))}}}),!0),t.on("element.changed",(function(e){var n=e.element;if((0,No.k3)(n)){var i=n,r=s.get((0,No.Ln)(i));r&&r!==i&&t.fire("element.changed",{element:r})}})),this.executed("shape.toggleCollapse",400,(function(e){var t=e.shape;(0,$t.is)(t,"bpmn:SubProcess")&&((0,Ni.ul)(t)?u(e):(l(e),c._showRecursively(t.children)))}),!0),this.reverted("shape.toggleCollapse",400,(function(e){var t=e.shape;(0,$t.is)(t,"bpmn:SubProcess")&&((0,Ni.ul)(t)?u(e):(l(e),c._showRecursively(t.children)))}),!0),this.postExecuted("shape.toggleCollapse",600,(function(e){var t=e.shape;if((0,$t.is)(t,"bpmn:SubProcess")){var n=e.newRootElement;n&&((0,Ni.ul)(t)?c._moveChildrenToShape(n,t):c._moveChildrenToShape(t,n))}}),!0),t.on("copyPaste.createTree",(function(e){var t=e.element,n=e.children;if(p(t)){var i=(0,No.sU)(t),r=s.get(i);r&&n.push.apply(n,r.children)}})),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element,i=e.elements,r=n.parent;if((0,$t.is)((0,$t.DN)(r),"bpmndi:BPMNPlane")){var o=(0,No.Ln)(r),s=(0,a.sE)(i,(function(e){return e.id===o}));s&&(t.parent=s.id)}})),t.on("copyPaste.pasteElement",(function(e){var t=e.descriptor;t.parent&&(p(t.parent)||t.parent.hidden)&&(t.hidden=!0)}))}function Lo(e,t){e.invoke(wt.Z,this),this.postExecuted("shape.replace",(function(e){var n=e.context.oldShape,i=e.context.newShape;if((0,$t.is)(i,"bpmn:SubProcess")&&((0,$t.is)(n,"bpmn:Task")||(0,$t.is)(n,"bpmn:CallActivity"))&&(0,Ni.ul)(i)){var r,o={x:(r=i).x+r.width/6,y:r.y+r.height/2};t.createShape({type:"bpmn:StartEvent"},o,i)}}))}function Io(e){wt.Z.call(this,e),this.preExecute("connection.create",(function(e){const{target:t}=e;(0,$t.is)(t,"bpmn:TextAnnotation")&&(e.parent=t.parent)}),!0),this.preExecute(["shape.create","shape.resize","elements.move"],(function(e){const t=e.shapes||[e.shape];1===t.length&&(0,$t.is)(t[0],"bpmn:TextAnnotation")&&(e.hints=e.hints||{},e.hints.autoResize=!1)}),!0)}function $o(e,t){wt.Z.call(this,e),this.postExecuted("shape.toggleCollapse",1500,(function(e){var n=e.shape;if(!(0,Ni.ul)(n)){var i=(0,V.PB)(n);i.forEach((function(e){var t=e.incoming.slice(),n=e.outgoing.slice();(0,a.Ed)(t,(function(e){r(e,!0)})),(0,a.Ed)(n,(function(e){r(e,!1)}))}))}function r(e,r){-1!==i.indexOf(e.source)&&-1!==i.indexOf(e.target)||(r?t.reconnectEnd(e,n,(0,Rt.wS)(n)):t.reconnectStart(e,n,(0,Rt.wS)(n)))}}),!0)}function zo(e,t,n){wt.Z.call(this,e),this.executed(["shape.toggleCollapse"],500,(function(e){var t,n=e.context.shape;(0,$t.is)(n,"bpmn:SubProcess")&&(n.collapsed?(0,$t.DN)(n).isExpanded=!1:((t=n.children).length&&t.forEach((function(e){"label"!==e.type||e.businessObject.name||(e.hidden=!0)})),(0,$t.DN)(n).isExpanded=!0))})),this.reverted(["shape.toggleCollapse"],500,(function(e){var t=e.context.shape;t.collapsed?(0,$t.DN)(t).isExpanded=!1:(0,$t.DN)(t).isExpanded=!0})),this.postExecuted(["shape.toggleCollapse"],500,(function(e){var i,r=e.context.shape,o=t.getDefaultSize(r);i=r.collapsed?function(e,t){return{x:e.x+(e.width-t.width)/2,y:e.y+(e.height-t.height)/2,width:t.width,height:t.height}}(r,o):function(e,t){var n,i,r,o=t;return n=(r=e.children,r.filter((function(e){return!e.hidden}))).concat([e]),(i=or(n))?(o.width=Math.max(i.width,o.width),o.height=Math.max(i.height,o.height),o.x=i.x+(i.width-o.width)/2,o.y=i.y+(i.height-o.height)/2):(o.x=e.x+(e.width-o.width)/2,o.y=e.y+(e.height-o.height)/2),o}(r,o),n.resizeShape(r,i,null,{autoResize:!r.collapsed&&"nwse"})}))}function Fo(e,t,n,i){t.invoke(wt.Z,this),this.preExecute("shape.delete",(function(e){var t=e.context.shape,r=t.businessObject;(0,K.j_)(t)||((0,$t.is)(t,"bpmn:Participant")&&(0,Ni.ul)(t)&&n.ids.unclaim(r.processRef.id),i.unclaimId(r.id,r))})),this.preExecute("connection.delete",(function(e){var t=e.context.connection.businessObject;i.unclaimId(t.id,t)})),this.preExecute("canvas.updateRoot",(function(){var t=e.getRootElement(),i=t.businessObject;(0,$t.is)(t,"bpmn:Collaboration")&&n.ids.unclaim(i.id)}))}function Ho(e,t){wt.Z.call(this,e),this.preExecute("connection.delete",(function(e){var n=e.context.connection,i=n.source;(function(e,t){if(!(0,$t.is)(e,"bpmn:SequenceFlow"))return!1;var n=(0,$t.SS)(t),i=(0,$t.SS)(e);return n.get("default")===i})(n,i)&&t.updateProperties(i,{default:null})}))}function Zo(e,t,n){var i;wt.Z.call(this,e);var r=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(r,5e3,(function(e){(i=i||new Wo).enter()})),this.postExecuted(r,500,(function(e){!function(){if(!i)throw new Error(n("out of bounds release"));i.leave()&&(t.updateLaneRefs(i.flowNodes,i.lanes),i=null)}()})),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],(function(e){var t=e.context.shape,r=function(){if(!i)throw new Error(n("out of bounds release"));return i}();t.labelTarget||((0,$t.is)(t,"bpmn:Lane")&&r.addLane(t),(0,$t.is)(t,"bpmn:FlowNode")&&r.addFlowNode(t))}))}function Wo(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}(0,e.Z)(Oo,wt.Z),Oo.prototype._moveChildrenToShape=function(e,t){var n,i=this._modeling,r=e.children;if(r){var o=(r=r.concat(r.reduce((function(t,n){return n.label&&n.label.parent!==e?t.concat(n.label):t}),[]))).filter((function(e){return!e.hidden}));if(o.length){var a=(0,V.jY)(o);if(t.x){var s=(0,Rt.wS)(t),c=(0,Rt.wS)(a);n={x:s.x-c.x,y:s.y-c.y}}else n={x:180-a.x,y:160-a.y};i.moveElements(r,n,t,{autoResize:!1})}else i.moveElements(r,{x:0,y:0},t,{autoResize:!1})}},Oo.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach((function(e){e.hidden=!!t,i=i.concat(e),e.children&&(i=i.concat(n._showRecursively(e.children,e.collapsed||t)))})),i},Oo.prototype._addDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),t.push(e.di.$parent),e},Oo.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,i=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),r=t.create("bpmndi:BPMNDiagram",{plane:i});return i.$parent=r,n.createRoot({id:(0,No.sU)(e),type:e.$type,di:i,businessObject:e,collapsed:!0})},Oo.prototype._removeDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams,n=(0,a.sE)(t,(function(t){return t.plane.bpmnElement.id===e.id}));return t.splice(t.indexOf(n),1),n},Oo.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"],Lo.$inject=["injector","modeling"],(0,e.Z)(Lo,wt.Z),(0,e.Z)(Io,wt.Z),Io.$inject=["eventBus"],(0,e.Z)($o,wt.Z),$o.$inject=["eventBus","modeling"],(0,e.Z)(zo,wt.Z),zo.$inject=["eventBus","elementFactory","modeling"],(0,e.Z)(Fo,wt.Z),Fo.$inject=["canvas","injector","moddle","modeling"],(0,e.Z)(Ho,wt.Z),Ho.$inject=["eventBus","modeling"],Zo.$inject=["eventBus","modeling","translate"],(0,e.Z)(Zo,wt.Z);const Uo={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","compensateBoundaryEventBehaviour","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","nonInterruptingBehavior","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","textAnnotationBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior"],adaptiveLabelPositioningBehavior:["type",Ai],appendBehavior:["type",Ti],associationBehavior:["type",Mi],attachEventBehavior:["type",Di],boundaryEventBehavior:["type",ji],compensateBoundaryEventBehaviour:["type",Oi],createBehavior:["type",Fi],createDataObjectBehavior:["type",Hi],createParticipantBehavior:["type",Wi],dataInputAssociationBehavior:["type",Gi],dataStoreBehavior:["type",qi],deleteLaneBehavior:["type",hr],detachEventBehavior:["type",dr],dropOnFlowBehavior:["type",mr],eventBasedGatewayBehavior:["type",yr],fixHoverBehavior:["type",xr],groupBehavior:["type",Er],importDockingFix:["type",Sr],isHorizontalFix:["type",Cr],labelBehavior:["type",Wr],layoutConnectionBehavior:["type",Ur],messageFlowBehavior:["type",eo],nonInterruptingBehavior:["type",ro],removeElementBehavior:["type",ao],removeEmbeddedLabelBoundsBehavior:["type",oo],removeParticipantBehavior:["type",co],replaceConnectionBehavior:["type",po],replaceElementBehaviour:["type",lo],resizeBehavior:["type",bo],resizeLaneBehavior:["type",Ao],rootElementReferenceBehavior:["type",Po],spaceToolBehavior:["type",Mo],subProcessPlaneBehavior:["type",Oo],subProcessStartEventBehavior:["type",Lo],textAnnotationBehavior:["type",Io],toggleCollapseConnectionBehaviour:["type",$o],toggleElementCollapseBehaviour:["type",zo],unclaimIdBehavior:["type",Fo],unsetDefaultFlowBehavior:["type",Ho],updateFlowNodeRefsBehavior:["type",Zo]};function Vo(e,t){var n=(0,Rt.T8)(e,t,-15);return"intersect"!==n?n:null}function Go(e){St.call(this,e)}function Ko(e){return!e||(0,K.j_)(e)}function Jo(e){do{if((0,$t.is)(e,"bpmn:Process"))return(0,$t.SS)(e);if((0,$t.is)(e,"bpmn:Participant"))return(0,$t.SS)(e).processRef||(0,$t.SS)(e)}while(e=e.parent)}function qo(e){return(0,$t.is)(e,"bpmn:TextAnnotation")}function Xo(e){return(0,$t.is)(e,"bpmn:Group")&&!e.labelTarget}function Yo(e){return(0,$t.is)(e,"bpmn:BoundaryEvent")&&na(e,"bpmn:CompensateEventDefinition")}function Qo(e){return(0,$t.SS)(e).isForCompensation}function ea(e){for(var t=e;t=t.parent;){if((0,$t.is)(t,"bpmn:FlowElementsContainer"))return(0,$t.SS)(t);if((0,$t.is)(t,"bpmn:Participant"))return(0,$t.SS)(t).processRef}return null}function ta(e,t){return ea(e)===ea(t)}function na(e,t){var n=(0,$t.SS)(e);return!!(0,a.sE)(n.eventDefinitions||[],(function(e){return(0,$t.is)(e,t)}))}function ia(e,t){return((0,$t.SS)(e).eventDefinitions||[]).every((function(e){return(0,$t.is)(e,t)}))}function ra(e,t){var n=function(e){for(var t=[];e;)(e=e.parent)&&t.push(e);return t}(t);return-1!==n.indexOf(e)}function oa(e,t,n){if(Ko(e)||Ko(t))return null;if(!(0,$t.is)(n,"bpmn:DataAssociation")){if(ya(e,t))return{type:"bpmn:MessageFlow"};if(ba(e,t))return{type:"bpmn:SequenceFlow"}}return _a(e,t)||(ga(e,t)?{type:"bpmn:Association",associationDirection:"One"}:!!va(e,t)&&{type:"bpmn:Association",associationDirection:"None"})}function aa(e,t){return!(!(0,K.j_)(e)&&!Xo(e))||!((0,$t.is)(t,"bpmn:Participant")&&!(0,Ni.ul)(t))&&((0,$t.is)(e,"bpmn:Participant")?(0,$t.is)(t,"bpmn:Process")||(0,$t.is)(t,"bpmn:Collaboration"):(0,$t.JZ)(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:(0,$t.is)(e,"bpmn:Lane")?(0,$t.is)(t,"bpmn:Participant")||(0,$t.is)(t,"bpmn:Lane"):!((0,$t.is)(e,"bpmn:BoundaryEvent")&&(n=e,!(0,$t.SS)(n).cancelActivity||!ca(n)&&!pa(n)))&&((0,$t.is)(e,"bpmn:FlowElement")&&!(0,$t.is)(e,"bpmn:DataStoreReference")?(0,$t.is)(t,"bpmn:FlowElementsContainer")?(0,Ni.ul)(t):(0,$t.JZ)(t,["bpmn:Participant","bpmn:Lane"]):(0,$t.is)(e,"bpmn:DataStoreReference")&&(0,$t.is)(t,"bpmn:Collaboration")?(0,a.G)((0,$t.SS)(t).get("participants"),(function(e){return!!e.get("processRef")})):(0,$t.JZ)(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?(0,$t.JZ)(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!(0,$t.is)(e,"bpmn:MessageFlow")&&((0,$t.is)(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)));var n}function sa(e){return(0,$t.is)(e,"bpmn:Lane")}function ca(e){var t=(0,$t.SS)(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function pa(e){return la(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function la(e,t){return t.some((function(t){return na(e,t)}))}function ua(e,t,n,i){if(Array.isArray(e)||(e=[e]),1!==e.length)return!1;var r=e[0];return!(0,K.j_)(r)&&!!function(e){return!!function(e){return!(0,K.j_)(e)&&(0,$t.is)(e,"bpmn:BoundaryEvent")}(e)||!(!(0,$t.is)(e,"bpmn:IntermediateThrowEvent")||!ca(e))||(0,$t.is)(e,"bpmn:IntermediateCatchEvent")&&pa(e)}(r)&&!(0,Ni.J5)(t)&&!(!(0,$t.is)(t,"bpmn:Activity")||Qo(t))&&!(i&&!Vo(i,t))&&!function(e){return(0,$t.is)(e,"bpmn:ReceiveTask")&&(0,a.sE)(e.incoming,(function(e){return(0,$t.is)(e.source,"bpmn:EventBasedGateway")}))}(t)&&"attach"}function ha(e,t,n){if(!t)return!1;var i={replacements:[]};return(0,a.Ed)(e,(function(e){(0,Ni.J5)(t)||(0,$t.is)(e,"bpmn:StartEvent")&&"label"!==e.type&&aa(e,t)&&((0,Ni.yU)(e)||i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),((0,Ni.sm)(e)||(0,Ni.wQ)(e)||(0,Ni._Z)(e))&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),la(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&(0,$t.is)(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"})),(0,$t.is)(t,"bpmn:Transaction")||na(e,"bpmn:CancelEventDefinition")&&"label"!==e.type&&((0,$t.is)(e,"bpmn:EndEvent")&&aa(e,t)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:EndEvent"}),(0,$t.is)(e,"bpmn:BoundaryEvent")&&ua(e,t,0,n)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:BoundaryEvent"}))})),!!i.replacements.length&&i}function da(e,t){return!(0,a.G)(e,sa)&&(!t||e.every((function(e){return aa(e,t)})))}function fa(e,t,n,i){return!!t&&(!(!(0,K.j_)(e)&&!Xo(e))||!function(e,t){return e===t}(n,t)&&(!n||!ra(n,t))&&(aa(e,t)||xa(e,t)))}function ma(e,t){return(0,$t.is)(e,"bpmn:SubProcess")?(0,Ni.ul)(e)&&(!t||t.width>=100&&t.height>=80):!!((0,$t.is)(e,"bpmn:Lane")||(0,$t.is)(e,"bpmn:Participant")||qo(e)||Xo(e))}function va(e,t){return!(ra(t,e)||ra(e,t)||!function(e,t){var n=qo(e),i=qo(t);return(n||i)&&n!==i}(e,t)&&!_a(e,t))}function ga(e,t){return ta(e,t)&&Yo(e)&&(0,$t.is)(t,"bpmn:Activity")&&(n=e,!t.attachers.includes(n))&&!(0,Ni.J5)(t);var n}function ya(e,t){return!(wa(e)&&!wa(t))&&(n=e,(0,$t.is)(n,"bpmn:InteractionNode")&&!(0,$t.is)(n,"bpmn:BoundaryEvent")&&(!(0,$t.is)(n,"bpmn:Event")||(0,$t.is)(n,"bpmn:ThrowEvent")&&ia(n,"bpmn:MessageEventDefinition"))&&function(e){return(0,$t.is)(e,"bpmn:InteractionNode")&&!Qo(e)&&(!(0,$t.is)(e,"bpmn:Event")||(0,$t.is)(e,"bpmn:CatchEvent")&&ia(e,"bpmn:MessageEventDefinition"))&&!((0,$t.is)(e,"bpmn:BoundaryEvent")&&!na(e,"bpmn:MessageEventDefinition"))}(t)&&!function(e,t){return Jo(e)===Jo(t)}(e,t));var n}function ba(e,t){return n=e,(0,$t.is)(n,"bpmn:FlowNode")&&!(0,$t.is)(n,"bpmn:EndEvent")&&!(0,Ni.J5)(n)&&!((0,$t.is)(n,"bpmn:IntermediateThrowEvent")&&na(n,"bpmn:LinkEventDefinition"))&&!Yo(n)&&!Qo(n)&&function(e){return(0,$t.is)(e,"bpmn:FlowNode")&&!(0,$t.is)(e,"bpmn:StartEvent")&&!(0,$t.is)(e,"bpmn:BoundaryEvent")&&!(0,Ni.J5)(e)&&!((0,$t.is)(e,"bpmn:IntermediateCatchEvent")&&na(e,"bpmn:LinkEventDefinition"))&&!Qo(e)}(t)&&ta(e,t)&&!((0,$t.is)(e,"bpmn:EventBasedGateway")&&!function(e){return(0,$t.is)(e,"bpmn:ReceiveTask")||(0,$t.is)(e,"bpmn:IntermediateCatchEvent")&&(na(e,"bpmn:MessageEventDefinition")||na(e,"bpmn:TimerEventDefinition")||na(e,"bpmn:ConditionalEventDefinition")||na(e,"bpmn:SignalEventDefinition"))}(t));var n}function _a(e,t){return(0,$t.JZ)(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&(0,$t.JZ)(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!(0,$t.JZ)(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!(0,$t.JZ)(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function xa(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(1!==e.length)return!1;e=e[0]}return t.source!==e&&t.target!==e&&(0,$t.JZ)(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!(0,K.j_)(t)&&(0,$t.is)(e,"bpmn:FlowNode")&&!(0,$t.is)(e,"bpmn:BoundaryEvent")&&aa(e,t.parent)}function Ea(e,t){return!!(0,K.j_)(t)||!((0,$t.is)(t,"bpmn:Lane")&&!function(e,t){return e&&t&&-1!==e.indexOf(t)}(e,t.parent))}function wa(e){return zi(e,"bpmn:Process")||zi(e,"bpmn:Collaboration")}(0,e.Z)(Go,St),Go.$inject=["eventBus"],Go.prototype.init=function(){this.addRule("connection.start",(function(e){return Ko(t=e.source)?null:(0,$t.JZ)(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"]);var t})),this.addRule("connection.create",(function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return oa(t,n)}finally{r&&(n.parent=null)}})),this.addRule("connection.reconnect",(function(e){var t=e.connection;return oa(e.source,e.target,t)})),this.addRule("connection.updateWaypoints",(function(e){return{type:e.connection.type}})),this.addRule("shape.resize",(function(e){return ma(e.shape,e.newBounds)})),this.addRule("elements.create",(function(e){var t=e.elements,n=e.position,i=e.target;return!((0,K.Ho)(i)&&!xa(t,i))&&(0,a.yW)(t,(function(e){return(0,K.Ho)(e)?oa(e.source,e.target,e):e.host?ua(e,e.host,0,n):fa(e,i,null)}))})),this.addRule("elements.move",(function(e){var t=e.target,n=e.shapes,i=e.position;return ua(n,t,0,i)||ha(n,t,i)||da(n,t)||xa(n,t)})),this.addRule("shape.create",(function(e){return fa(e.shape,e.target,e.source,e.position)})),this.addRule("shape.attach",(function(e){return ua(e.shape,e.target,0,e.position)})),this.addRule("element.copy",(function(e){var t=e.element;return Ea(e.elements,t)}))},Go.prototype.canConnectMessageFlow=ya,Go.prototype.canConnectSequenceFlow=ba,Go.prototype.canConnectDataAssociation=_a,Go.prototype.canConnectAssociation=va,Go.prototype.canConnectCompensationAssociation=ga,Go.prototype.canMove=da,Go.prototype.canAttach=ua,Go.prototype.canReplace=ha,Go.prototype.canDrop=aa,Go.prototype.canInsert=xa,Go.prototype.canCreate=fa,Go.prototype.canConnect=oa,Go.prototype.canResize=ma,Go.prototype.canCopy=Ea;const Sa={__depends__:[ln],__init__:["bpmnRules"],bpmnRules:["type",Go]};function ka(e,t){e.on("saveXML.start",2e3,(function(){var e=t.getRootElements();(0,a.Ed)(e,(function(e){var t,n,i=(0,$t.DN)(e);t=(0,V.PB)([e],!1),t=(0,a.hX)(t,(function(t){return t!==e&&!t.labelTarget})),n=(0,a.UI)(t,$t.DN),i.set("planeElement",n)}))}))}ka.$inject=["eventBus","canvas"];const Ca={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",ka]};var Ra=n(805);function Aa(e){wt.Z.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.parent=o.parent),n.parentIndex=o.index)})),this.preExecute(["shape.move","connection.move"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.newParent||i.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.newParent=o.parent),n.newParentIndex=o.index)}))}function Pa(e,t,n){Aa.call(this,e);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:TextAnnotation",order:{level:9}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(e){var t=e.order;if(t||(e.order=t=function(e){if(e.labelTarget)return{level:10};var t=(0,a.sE)(i,(function(t){return(0,$t.JZ)(e,[t.type])}));return t&&t.order||{level:1}}(e)),!t)throw new Error("no order for <"+e.id+">");return t}this.getOrdering=function(e,n){if(e.labelTarget||(0,$t.is)(e,"bpmn:TextAnnotation"))return{parent:t.findRoot(n)||t.getRootElement(),index:-1};var i=r(e);i.containers&&(n=function(e,t,n){for(var i=t;i&&!(0,$t.JZ)(i,n);)i=i.parent;if(!i)throw new Error("no parent for <"+e.id+"> in <"+(t&&t.id)+">");return i}(e,n,i.containers));var o=n.children.indexOf(e),s=(0,a.cx)(n.children,(function(t){return!(!e.labelTarget&&t.labelTarget)&&i.levelds(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(ds(i)<5)return!1;i<0&&(i*=-1),(0,Pn.RJ)(e)&&(i*=-1);var o=function(e,t){if("x"===e){if(t>0)return"e";if(t<0)return"w"}if("y"===e){if(t>0)return"s";if(t<0)return"n"}return null}(n,i),s=this._canvas.getRootElement();!(0,Pn.Dw)(e)&&e.hover&&(s=e.hover);var c=[...(0,V.PB)(s,!0),...s.attachers||[]],p=this.calculateAdjustments(c,n,i,r),l=function(e,t,n,i,r){var o=e.movingShapes,s=e.resizingShapes;if(s.length){var c,p,l={};return(0,a.Ed)(s,(function(e){var u,h,d,f,m,v,g=e.attachers,y=e.children,b=(0,Rt.JA)(e),_=(0,a.hX)(y,(function(e){return!((0,K.Ho)(e)||(0,K.j_)(e)||ws(o,e)||ws(s,e))})),x=(0,a.hX)(y,(function(e){return!(0,K.Ho)(e)&&!(0,K.j_)(e)&&ws(o,e)})),E=[],w=[];_.length&&(h=xs((0,Rt.JA)((0,V.jY)(_))),u=i-b[gs[n]]+h[gs[n]],"n"===n?l.bottom=p=(0,a.hj)(p)?Math.min(p,u):u:"w"===n?l.right=p=(0,a.hj)(p)?Math.min(p,u):u:"s"===n?l.top=c=(0,a.hj)(c)?Math.max(c,u):u:"e"===n&&(l.left=c=(0,a.hj)(c)?Math.max(c,u):u)),x.length&&(d=xs((0,Rt.JA)((0,V.jY)(x))),u=i-d[gs[bs[n]]]+b[gs[bs[n]]],"n"===n?l.bottom=p=(0,a.hj)(p)?Math.min(p,u):u:"w"===n?l.right=p=(0,a.hj)(p)?Math.min(p,u):u:"s"===n?l.top=c=(0,a.hj)(c)?Math.max(c,u):u:"e"===n&&(l.left=c=(0,a.hj)(c)?Math.max(c,u):u)),g&&g.length&&(g.forEach((function(e){ws(o,e)?E.push(e):w.push(e)})),E.length&&(f=(0,Rt.JA)((0,V.jY)(E.map(Rt.wS))),m=b[gs[bs[n]]]-(f[gs[bs[n]]]-i)),w.length&&(v=(0,Rt.JA)((0,V.jY)(w.map(Rt.wS)))[gs[n]]-(b[gs[n]]-i)),"n"===n?(u=Math.min(m||1/0,v||1/0),l.bottom=p=(0,a.hj)(p)?Math.min(p,u):u):"w"===n?(u=Math.min(m||1/0,v||1/0),l.right=p=(0,a.hj)(p)?Math.min(p,u):u):"s"===n?(u=Math.max(m||-1/0,v||-1/0),l.top=c=(0,a.hj)(c)?Math.max(c,u):u):"e"===n&&(u=Math.max(m||-1/0,v||-1/0),l.left=c=(0,a.hj)(c)?Math.max(c,u):u));var S=r&&r[e.id];S&&("n"===n?(u=i+e[ms[t]]-S[ms[t]],l.bottom=p=(0,a.hj)(p)?Math.min(p,u):u):"w"===n?(u=i+e[ms[t]]-S[ms[t]],l.right=p=(0,a.hj)(p)?Math.min(p,u):u):"s"===n?(u=i-e[ms[t]]+S[ms[t]],l.top=c=(0,a.hj)(c)?Math.max(c,u):u):"e"===n&&(u=i-e[ms[t]]+S[ms[t]],l.left=c=(0,a.hj)(c)?Math.max(c,u):u))})),l}}(p,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:p.resizingShapes,start:r}));return(0,a.f0)(t,p,{axis:n,direction:o,spaceToolConstraints:l,start:r}),(0,Yt.t8)("resize-"+("x"===n?"ew":"ns")),!0},_s.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],s=[],c=[],p=[];function l(e){o.includes(e)||o.push(e);var t=e.label;t&&!o.includes(t)&&o.push(t)}(0,a.Ed)(e,(function(e){if(e.parent&&!(0,K.j_)(e))if((0,K.Ho)(e))p.push(e);else{var o=e[t],a=o+e[ms[t]];if(function(e){return!!e.host}(e)&&(n>0&&(0,Rt.wS)(e)[t]>i||n<0&&(0,Rt.wS)(e)[t]0&&o>i||n<0&&ai&&r.allowed("shape.resize",{shape:e})?(u=e,void(s.includes(u)||s.push(u))):void 0;l(e)}}})),(0,a.Ed)(o,(function(e){var t=e.attachers;t&&(0,a.Ed)(t,(function(e){l(e)}))}));var u=o.concat(s);return(0,a.Ed)(c,(function(e){var t=e.host;ws(u,t)&&l(e)})),u=o.concat(s),(0,a.Ed)(p,(function(e){var t=e.source,n=e.target,i=e.label;ws(u,t)&&ws(u,n)&&i&&l(i)})),{movingShapes:o,resizingShapes:s}},_s.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},_s.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^spaceTool/.test(e.prefix)};var Ss="djs-dragging",ks="djs-resizing",Cs=Math.max;function Rs(e,t,n,i,r){function o(e,t){(0,a.Ed)(e,(function(e){r.addDragger(e,t),n.addMarker(e,Ss)}))}e.on("spaceTool.selection.start",(function(e){var t=n.getLayer("space"),r=e.context,o=(0,O.Ue)("g");(0,O.Lj)(o,i.cls("djs-crosshair-group",["no-events"])),(0,O.R3)(t,o);var a=(0,O.Ue)("path");(0,O.Lj)(a,"d","M 0,-10000 L 0,10000"),(0,O.Sh)(a).add("djs-crosshair"),(0,O.R3)(o,a);var s=(0,O.Ue)("path");(0,O.Lj)(s,"d","M -10000,0 L 10000,0"),(0,O.Sh)(s).add("djs-crosshair"),(0,O.R3)(o,s),r.crosshairGroup=o})),e.on("spaceTool.selection.move",(function(e){var t=e.context.crosshairGroup;(0,hn.Iu)(t,e.x,e.y)})),e.on("spaceTool.selection.cleanup",(function(e){var t=e.context.crosshairGroup;t&&(0,O.Od)(t)})),e.on("spaceTool.move",250,(function(e){var s=e.context,c=s.line,p=s.axis,l=s.movingShapes,u=s.resizingShapes;if(s.initialized){if(!s.dragGroup){var h=n.getLayer("space");c=(0,O.Ue)("path"),(0,O.Lj)(c,"d","M0,0 L0,0"),(0,O.Sh)(c).add("djs-crosshair"),(0,O.R3)(h,c),s.line=c;var d=(0,O.Ue)("g");(0,O.Lj)(d,i.cls("djs-drag-group",["no-events"])),(0,O.R3)(n.getActiveLayer(),d),o(l,d),o(s.movingConnections=t.filter((function(e){var t=!1;(0,a.Ed)(l,(function(n){(0,a.Ed)(n.outgoing,(function(n){e===n&&(t=!0)}))}));var n=!1;(0,a.Ed)(l,(function(t){(0,a.Ed)(t.incoming,(function(t){e===t&&(n=!0)}))}));var i=!1;(0,a.Ed)(u,(function(t){(0,a.Ed)(t.outgoing,(function(t){e===t&&(i=!0)}))}));var r=!1;return(0,a.Ed)(u,(function(t){(0,a.Ed)(t.incoming,(function(t){e===t&&(r=!0)}))})),(0,K.Ho)(e)&&(t||i)&&(n||r)})),d),s.dragGroup=d}if(!s.frameGroup){var f=(0,O.Ue)("g");(0,O.Lj)(f,i.cls("djs-frame-group",["no-events"])),(0,O.R3)(n.getActiveLayer(),f);var m=[];(0,a.Ed)(u,(function(e){var t=r.addFrame(e,f),i=t.getBBox();m.push({element:t,initialBounds:i}),n.addMarker(e,ks)})),s.frameGroup=f,s.frames=m}var v={x:"M"+e.x+", -10000 L"+e.x+", 10000",y:"M -10000, "+e.y+" L 10000, "+e.y};(0,O.Lj)(c,{d:v[p]});var g={x:e.dx,y:e.dy};g[{x:"y",y:"x"}[s.axis]]=0,(0,hn.Iu)(s.dragGroup,g.x,g.y),(0,a.Ed)(s.frames,(function(e){var t,n,i=e.element,r=e.initialBounds;"e"===s.direction?(0,O.Lj)(i,{width:Cs(r.width+g.x,5)}):(t=Cs(r.width-g.x,5),(0,O.Lj)(i,{width:t,x:r.x+r.width-t})),"s"===s.direction?(0,O.Lj)(i,{height:Cs(r.height+g.y,5)}):(n=Cs(r.height-g.y,5),(0,O.Lj)(i,{height:n,y:r.y+r.height-n}))}))}})),e.on("spaceTool.cleanup",(function(e){var t=e.context,i=t.movingShapes,r=t.movingConnections,o=t.resizingShapes,s=t.line,c=t.dragGroup,p=t.frameGroup;(0,a.Ed)(i,(function(e){n.removeMarker(e,Ss)})),(0,a.Ed)(r,(function(e){n.removeMarker(e,Ss)})),c&&((0,O.Od)(s),(0,O.Od)(c)),(0,a.Ed)(o,(function(e){n.removeMarker(e,ks)})),p&&(0,O.Od)(p)}))}Rs.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const As={__init__:["spaceToolPreview"],__depends__:[an,ln,us,Ei,Wa],spaceTool:["type",_s],spaceToolPreview:["type",Rs]};function Ps(e){e.invoke(_s,this)}Ps.$inject=["injector"],(0,e.Z)(Ps,_s),Ps.prototype.calculateAdjustments=function(e,t,n,i){var r=_s.prototype.calculateAdjustments.call(this,e,t,n,i);return r.resizingShapes=r.resizingShapes.filter((function(e){return!((0,$t.is)(e,"bpmn:TextAnnotation")||function(e){return(0,$t.is)(e,"bpmn:Participant")&&!(0,$t.SS)(e).processRef}(e)&&("y"===t&&(0,Ni.wE)(e)||"x"===t&&!(0,Ni.wE)(e)))})),r};const Ts={__depends__:[As],spaceTool:["type",Ps]};function Ms(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],(function(){this.clear(!1)}),this)}Ms.$inject=["eventBus","injector"],Ms.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},Ms.prototype.canExecute=function(e,t){const n={command:e,context:t},i=this._getHandler(e);let r=this._fire(e,"canExecute",n);if(void 0===r){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Ms.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,!1!==e&&this._fire("changed",{trigger:"clear"})},Ms.prototype.undo=function(){let e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),e=this._getUndoAction(),e&&e.id===t.id);)t=e;this._popAction()}},Ms.prototype.redo=function(){let e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),e=this._getRedoAction(),e&&e.id===t.id);)t=e;this._popAction()}},Ms.prototype.register=function(e,t){this._setHandler(e,t)},Ms.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},Ms.prototype.canUndo=function(){return!!this._getUndoAction()},Ms.prototype.canRedo=function(){return!!this._getRedoAction()},Ms.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Ms.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Ms.prototype._internalUndo=function(e){const t=e.command,n=e.context,i=this._getHandler(t);this._atomicDo((()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)}))},Ms.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const i=t?[e+"."+t,t]:[e];let r;n=this._eventBus.createEvent(n);for(const e of i)if(r=this._eventBus.fire("commandStack."+e,n),n.cancelBubble)break;return r},Ms.prototype._createId=function(){return this._uid++},Ms.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Ms.prototype._internalExecute=function(e,t){const n=e.command,i=e.context,r=this._getHandler(n);if(!r)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),r.preExecute&&r.preExecute(i),this._fire(n,"preExecuted",e)),this._atomicDo((()=>{this._fire(n,"execute",e),r.execute&&this._markDirty(r.execute(i)),this._executedAction(e,t),this._fire(n,"executed",e)})),t||(this._fire(n,"postExecute",e),r.postExecute&&r.postExecute(i),this._fire(n,"postExecuted",e)),this._popAction()},Ms.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in or phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Ms.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:(0,a.uw)("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Ms.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=(0,a.kJ)(e)?e:[e],t.dirty=t.dirty.concat(e))},Ms.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Ms.prototype._revertedAction=function(e){this._stackIdx--},Ms.prototype._getHandler=function(e){return this._handlerMap[e]},Ms.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const Ds={commandStack:["type",Ms]};function Bs(e,t){if("function"!=typeof t)throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}function js(e,t,n){wt.Z.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,(function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=Ns(n),t.validatedShapes=Ns(i)})),i&&t.on("shape.move.start",250,(function(e){var t=e.context,n=t.shapes,r=[];(0,a.Ed)(n,(function(e){(0,a.Ed)(e.labels,(function(n){n.hidden||-1!==t.shapes.indexOf(n)||r.push(n),e.labelTarget&&r.push(e)}))})),(0,a.Ed)(r,(function(e){i.makeDraggable(t,e,!0)}))})),this.preExecuted("elements.move",1400,(function(e){var t=e.context.closure,n=t.enclosedElements,i=[];(0,a.Ed)(n,(function(e){(0,a.Ed)(e.labels,(function(e){n[e.id]||i.push(e)}))})),t.addAll(i)})),this.preExecute(["connection.delete","shape.delete"],(function(e){var t=e.context;Bs((t.connection||t.shape).labels,(function(e){n.removeShape(e,{nested:!0})}))})),this.execute("shape.delete",(function(e){var t=e.context,n=t.shape,i=n.labelTarget;i&&(t.labelTargetIndex=(0,Ui.cq)(i.labels,n),t.labelTarget=i,n.labelTarget=null)})),this.revert("shape.delete",(function(e){var t=e.context,n=t.shape,i=t.labelTarget,r=t.labelTargetIndex;i&&((0,Ui.IH)(i.labels,n,r),n.labelTarget=i)}))}function Ns(e){return(0,a.hX)(e,(function(t){return-1===e.indexOf(t.labelTarget)}))}(0,e.Z)(js,wt.Z),js.$inject=["injector","eventBus","modeling"];const Os={__init__:["labelSupport"],labelSupport:["type",js]};var Ls="attach-ok";function Is(e,t,n,i,r){wt.Z.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",1401,(function(e){var t,n,i=e.context,r=i.shapes,o=i.validatedShapes;i.shapes=(n=$s(t=r),(0,a.qZ)("id",t,n)),i.validatedShapes=function(e){var t=(0,a.vM)(e,"id");return(0,a.hX)(e,(function(e){for(;e;){if(e.host&&t[e.host.id])return!1;e=e.parent}return!0}))}(o)})),o&&t.on("shape.move.start",251,(function(e){var t=e.context,n=$s(t.shapes);(0,a.Ed)(n,(function(e){o.makeDraggable(t,e,!0),(0,a.Ed)(e.labels,(function(e){o.makeDraggable(t,e,!0)}))}))})),o&&t.on("shape.move.start",(function(e){var i=e.context.shapes;if(1===i.length){var r=i[0].host;r&&(n.addMarker(r,Ls),t.once(["shape.move.out","shape.move.cleanup"],(function(){n.removeMarker(r,Ls)})))}})),this.preExecuted("elements.move",1401,(function(e){var t=e.context,n=t.closure,i=$s(t.shapes);(0,a.Ed)(i,(function(e){n.add(e,n.topLevel[e.host.id])}))})),this.postExecuted("elements.move",(function(e){var t,n=e.context,i=n.shapes,o=n.newHost;o&&1!==i.length||(t=o?i:(0,a.hX)(i,(function(e){var t,n=e.host;return function(e){return!!e.host}(e)&&(t=n,!(-1!==i.indexOf(t)))})),(0,a.Ed)(t,(function(e){r.updateAttachment(e,o)})))})),this.postExecuted("elements.move",(function(e){var t=e.context.shapes;(0,a.Ed)(t,(function(e){(0,a.Ed)(e.attachers,(function(e){(0,a.Ed)(e.outgoing.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)})),(0,a.Ed)(e.incoming.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)}))}))}))})),this.postExecute("shape.create",(function(e){var t=e.context,n=t.shape,i=t.host;i&&r.updateAttachment(n,i)})),this.postExecute("shape.replace",(function(e){var t=e.context,n=t.oldShape,o=t.newShape;Bs(n.attachers,(function(e){"attach"===i.allowed("elements.move",{target:o,shapes:[e]})?r.updateAttachment(e,o):r.removeShape(e)})),o.attachers.length&&(0,a.Ed)(o.attachers,(function(e){var t=Fr(e,n,o);r.moveShape(e,t,e.parent)}))})),this.postExecute("shape.resize",(function(e){var t=e.context,n=t.shape,i=t.oldBounds,o=t.newBounds,s=n.attachers;!1!==(t.hints||{}).attachSupport&&(0,a.Ed)(s,(function(e){var t=Fr(e,i,o);r.moveShape(e,t,e.parent),(0,a.Ed)(e.labels,(function(e){r.moveShape(e,t,e.parent)}))}))})),this.preExecute("shape.delete",(function(e){var t=e.context.shape;Bs(t.attachers,(function(e){r.removeShape(e)})),t.host&&r.updateAttachment(t,null)}))}function $s(e){return(0,a.xH)((0,a.UI)(e,(function(e){return e.attachers||[]})))}(0,e.Z)(Is,wt.Z),Is.$inject=["injector","eventBus","canvas","rules","modeling"];const zs={__depends__:[ln],__init__:["attachSupport"],attachSupport:["type",Is]};var Fs=n(448);function Hs(e){this._model=e}function Zs(e,t,n,i){wt.Z.call(this,e),this._bpmnFactory=t,this._translate=i;var r=this;function o(e){var t=e.context.oldRoot.children;(0,a.Ed)(t,(function(e){(0,$t.is)(e,"bpmn:BaseElement")&&r.updateParent(e)}))}function s(e){var t=e.context.shape;(0,$t.is)(t,"bpmn:BaseElement")&&r.updateBounds(t)}function c(e){r.updateConnection(e.context)}function p(e){r.updateConnectionWaypoints(e.context.connection)}function l(e){r.updateAttachment(e.context)}function u(e){const{element:n}=e.context,i=(0,Ci.id)(n),r=(0,$t.DN)(n),o=r&&r.get("label");(0,Ci.ly)(n)||(0,No.k3)(n)||(i&&!o?r.set("label",t.create("bpmndi:BPMNLabel")):!i&&o&&r.set("label",void 0))}this.executed(["connection.layout","connection.create"],(function(e){var t,i=e.context,r=i.hints||{};i.cropped||!1===r.createElementsBehavior||((t=i.connection).waypoints=n.getCroppedWaypoints(t),i.cropped=!0)})),this.reverted(["connection.layout"],(function(e){delete e.context.cropped})),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Ws((function(e){var t=e.context;r.updateParent(t.shape||t.connection,t.oldParent)}))),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Ws((function(e){var t=e.context,n=t.shape||t.connection,i=t.parent||t.newParent;r.updateParent(n,i)}))),this.executed(["canvas.updateRoot"],o),this.reverted(["canvas.updateRoot"],o),this.executed(["shape.move","shape.create","shape.resize"],Ws((function(e){"label"!==e.context.shape.type&&s(e)}))),this.reverted(["shape.move","shape.create","shape.resize"],Ws((function(e){"label"!==e.context.shape.type&&s(e)}))),e.on("shape.changed",(function(e){"label"===e.element.type&&s({context:{shape:e.element}})})),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Ws(c)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Ws(c)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Ws(p)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Ws(p)),this.executed("connection.reconnect",Ws((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=(0,$t.SS)(n),a=(0,$t.SS)(i),s=(0,$t.SS)(r);o.conditionExpression&&!(0,$t.JZ)(s,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(t.oldConditionExpression=o.conditionExpression,delete o.conditionExpression),i!==r&&a.default===o&&(t.oldDefault=a.default,delete a.default)}))),this.reverted("connection.reconnect",Ws((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=(0,$t.SS)(n),a=(0,$t.SS)(i),s=(0,$t.SS)(r);t.oldConditionExpression&&(o.conditionExpression=t.oldConditionExpression),t.oldDefault&&(a.default=t.oldDefault,delete s.default)}))),this.executed(["element.updateAttachment"],Ws(l)),this.reverted(["element.updateAttachment"],Ws(l)),this.executed("element.updateLabel",Ws(u)),this.reverted("element.updateLabel",Ws(u))}function Ws(e){return function(t){var n=t.context,i=n.shape||n.connection||n.element;(0,$t.is)(i,"bpmn:BaseElement")&&e(t)}}Hs.$inject=["moddle"],Hs.prototype._needsId=function(e){return(0,$t.JZ)(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},Hs.prototype._ensureId=function(e){var t;e.id?this._model.ids.claim(e.id,e):(t=(0,$t.is)(e,"bpmn:Activity")?"Activity":(0,$t.is)(e,"bpmn:Event")?"Event":(0,$t.is)(e,"bpmn:Gateway")?"Gateway":(0,$t.JZ)(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e)))},Hs.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Hs.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Hs.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",(0,a.f0)({bpmnElement:e,bounds:this.createDiBounds()},t))},Hs.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Hs.prototype.createDiWaypoints=function(e){var t=this;return(0,a.UI)(e,(function(e){return t.createDiWaypoint(e)}))},Hs.prototype.createDiWaypoint=function(e){return this.create("dc:Point",(0,a.ei)(e,["x","y"]))},Hs.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",(0,a.f0)({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},Hs.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",(0,a.f0)({bpmnElement:e},t))},(0,e.Z)(Zs,wt.Z),Zs.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Zs.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Zs.prototype.updateParent=function(e,t){if(!((0,K.j_)(e)||(0,$t.is)(e,"bpmn:DataStoreReference")&&e.parent&&(0,$t.is)(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=(0,$t.DN)(e),o=n&&n.businessObject,a=(0,$t.DN)(n);(0,$t.is)(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,t&&t.businessObject),(0,$t.is)(e,"bpmn:DataOutputAssociation")&&(o=e.source?e.source.businessObject:null),(0,$t.is)(e,"bpmn:DataInputAssociation")&&(o=e.target?e.target.businessObject:null),this.updateSemanticParent(i,o),(0,$t.is)(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,a)}},Zs.prototype.updateBounds=function(e){var t=(0,$t.DN)(e),n=function(e){if((0,$t.is)(e,"bpmn:Activity")){var t=(0,$t.DN)(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}(e);if(n){var i=(0,en.p)(n,t.get("bounds"));(0,a.f0)(n,{x:e.x+i.x,y:e.y+i.y})}var r=(0,K.j_)(e)?this._getLabel(t):t,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),(0,a.f0)(o,{x:e.x,y:e.y,width:e.width,height:e.height})},Zs.prototype.updateFlowNodeRefs=function(e,t,n){var i,r;n!==t&&((0,$t.is)(n,"bpmn:Lane")&&(i=n.get("flowNodeRef"),(0,Ui.Od)(i,e)),(0,$t.is)(t,"bpmn:Lane")&&(r=t.get("flowNodeRef"),(0,Ui.IH)(r,e)))},Zs.prototype.updateDiConnection=function(e,t,n){var i=(0,$t.DN)(e),r=(0,$t.DN)(t),o=(0,$t.DN)(n);i.sourceElement&&i.sourceElement.bpmnElement!==(0,$t.SS)(t)&&(i.sourceElement=t&&r),i.targetElement&&i.targetElement.bpmnElement!==(0,$t.SS)(n)&&(i.targetElement=n&&o)},Zs.prototype.updateDiParent=function(e,t){if(t&&!(0,$t.is)(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):((0,Ui.Od)(n,e),e.$parent=null)}},Zs.prototype.getLaneSet=function(e){var t,n;return(0,$t.is)(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):((0,$t.is)(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},Zs.prototype.updateSemanticParent=function(e,t,n){var i,r=this._translate;if(e.$parent!==t&&(!(0,$t.is)(e,"bpmn:DataInput")&&!(0,$t.is)(e,"bpmn:DataOutput")||((0,$t.is)(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if((0,$t.is)(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if((0,$t.is)(e,"bpmn:FlowElement")){if(t)if((0,$t.is)(t,"bpmn:Participant"))t=t.processRef;else if((0,$t.is)(t,"bpmn:Lane"))do{t=t.$parent.$parent}while((0,$t.is)(t,"bpmn:Lane"));i="flowElements"}else if((0,$t.is)(e,"bpmn:Artifact")){for(;t&&!(0,$t.is)(t,"bpmn:Process")&&!(0,$t.is)(t,"bpmn:SubProcess")&&!(0,$t.is)(t,"bpmn:Collaboration");){if((0,$t.is)(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if((0,$t.is)(e,"bpmn:MessageFlow"))i="messageFlows";else if((0,$t.is)(e,"bpmn:Participant")){i="participants";var o,a=e.processRef;a&&(o=function(e){for(;e&&!(0,$t.is)(e,"bpmn:Definitions");)e=e.$parent;return e}(e.$parent||t),e.$parent&&((0,Ui.Od)(o.get("rootElements"),a),a.$parent=null),t&&((0,Ui.IH)(o.get("rootElements"),a),a.$parent=o))}else(0,$t.is)(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":(0,$t.is)(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:e.id,parent:t.id}));var s;if(e.$parent&&(s=e.$parent.get(i),(0,Ui.Od)(s,e)),t?((s=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var c=n.get(i);(0,Ui.Od)(s,e),t&&(c||(c=[],t.set(i,c)),c.push(e))}}},Zs.prototype.updateConnectionWaypoints=function(e){(0,$t.DN)(e).set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Zs.prototype.updateConnection=function(e){var t,n=e.connection,i=(0,$t.SS)(n),r=n.source,o=(0,$t.SS)(r),a=n.target,s=(0,$t.SS)(n.target);if((0,$t.is)(i,"bpmn:DataAssociation"))(0,$t.is)(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=o,t=e.parent||e.newParent||s,this.updateSemanticParent(i,s,t)):(0,$t.is)(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t),i.targetRef=s);else{var c=(0,$t.is)(i,"bpmn:SequenceFlow");i.sourceRef!==o&&(c&&((0,Ui.Od)(i.sourceRef&&i.sourceRef.get("outgoing"),i),o&&o.get("outgoing")&&o.get("outgoing").push(i)),i.sourceRef=o),i.targetRef!==s&&(c&&((0,Ui.Od)(i.targetRef&&i.targetRef.get("incoming"),i),s&&s.get("incoming")&&s.get("incoming").push(i)),i.targetRef=s)}this.updateConnectionWaypoints(n),this.updateDiConnection(n,r,a)},Zs.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};var Us=n(149),Vs=n(990);function Gs(e,t,n){Us.Z.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function Ks(e,t,n){return void 0===t[n]?t:(e[n]=t[n],(0,a.CE)(t,[n]))}function Js(e,t){this._modeling=e,this._canvas=t}function qs(e){this._modeling=e}function Xs(e,t){this._canvas=e,this._layouter=t}(0,e.Z)(Gs,Us.Z),Gs.$inject=["bpmnFactory","moddle","translate"],Gs.prototype._baseCreate=Us.Z.prototype.create,Gs.prototype.create=function(e,t){if("label"===e){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,(0,a.f0)({type:"label",di:n},Ci.DN,t))}return this.createElement(e,t)},Gs.prototype.createElement=function(e,t){var n,i,r,o,s=this._translate,c=(t=(0,a.f0)({},t||{})).businessObject,p=t.di;if(!c){if(!t.type)throw new Error(s("no shape type specified"));c=this._bpmnFactory.create(t.type),(0,Vs.S)(c)}if(i=p,!(0,$t.JZ)(i,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])){var l=(0,a.f0)({},p||{},{id:c.id+"_di"});p="root"===e?this._bpmnFactory.createDiPlane(c,l):"connection"===e?this._bpmnFactory.createDiEdge(c,l):this._bpmnFactory.createDiShape(c,l)}return(0,$t.is)(c,"bpmn:Group")&&(t=(0,a.f0)({isFrame:!0},t)),t=function(e,t,n){return(0,a.Ed)(["processRef","isInterrupting","associationDirection","isForCompensation"],(function(n){t=Ks(e,t,n)})),t}(c,t),t.isExpanded&&(t=Ks(p,t,"isExpanded")),(0,$t.is)(c,"bpmn:SubProcess")&&(t.collapsed=!(0,Ni.ul)(c,p)),(0,$t.is)(c,"bpmn:ExclusiveGateway")&&((0,a.e$)(t,"isMarkerVisible")?void 0===t.isMarkerVisible?p.isMarkerVisible=!1:t=Ks(p,t,"isMarkerVisible"):p.isMarkerVisible=!0),(0,a.$K)(t.triggeredByEvent)&&(c.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),(0,a.$K)(t.cancelActivity)&&(c.cancelActivity=t.cancelActivity,delete t.cancelActivity),t.eventDefinitionType&&(r=c.get("eventDefinitions")||[],o=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),"bpmn:ConditionalEventDefinition"===t.eventDefinitionType&&(o.condition=this._bpmnFactory.create("bpmn:FormalExpression")),r.push(o),o.$parent=c,c.eventDefinitions=r,delete t.eventDefinitionType),n=this.getDefaultSize(c,p),t=(0,a.f0)({id:c.id},n,t,{businessObject:c,di:p}),this._baseCreate(e,t)},Gs.prototype.getDefaultSize=function(e,t){var n=(0,$t.SS)(e);return t=t||(0,$t.DN)(e),(0,$t.is)(n,"bpmn:SubProcess")?(0,Ni.ul)(n,t)?{width:350,height:200}:{width:100,height:80}:(0,$t.is)(n,"bpmn:Task")?{width:100,height:80}:(0,$t.is)(n,"bpmn:Gateway")?{width:50,height:50}:(0,$t.is)(n,"bpmn:Event")?{width:36,height:36}:(0,$t.is)(n,"bpmn:Participant")?(0,Ni.ul)(n,t)?{width:600,height:250}:{width:400,height:60}:(0,$t.is)(n,"bpmn:Lane")?{width:400,height:100}:(0,$t.is)(n,"bpmn:DataObjectReference")?{width:36,height:50}:(0,$t.is)(n,"bpmn:DataStoreReference")?{width:50,height:50}:(0,$t.is)(n,"bpmn:TextAnnotation")?{width:100,height:30}:(0,$t.is)(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},Gs.prototype.createParticipantShape=function(e){return(0,a.Kn)(e)||(e={isExpanded:e}),!1!==(e=(0,a.f0)({type:"bpmn:Participant"},e||{})).isExpanded&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},Js.$inject=["modeling","canvas"],Js.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;(0,a.Ed)(n,(function(e){var n={x:0,y:0};(0,a.$K)(i.left)?n.x=i.left-e.x:(0,a.$K)(i.right)?n.x=i.right-e.width-e.x:(0,a.$K)(i.center)?n.x=i.center-Math.round(e.width/2)-e.x:(0,a.$K)(i.top)?n.y=i.top-e.y:(0,a.$K)(i.bottom)?n.y=i.bottom-e.height-e.y:(0,a.$K)(i.middle)&&(n.y=i.middle-Math.round(e.height/2)-e.y),t.moveElements([e],n,e.parent)}))},Js.prototype.postExecute=function(e){},qs.$inject=["modeling"],qs.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},qs.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,(0,a.G)(t.outgoing,(function(e){return e.target===n}))||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},Xs.$inject=["canvas","layouter"],Xs.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},Xs.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Ys=Math.round;function Qs(e){this._modeling=e}Qs.$inject=["modeling"],Qs.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,s=this._modeling;(0,a.Ed)(t,(function(e){(0,a.hj)(e.x)||(e.x=0),(0,a.hj)(e.y)||(e.y=0)}));var c=(0,a.hX)(t,(function(e){return!e.hidden})),p=(0,V.jY)(c);(0,a.Ed)(t,(function(e){(0,K.Ho)(e)&&(e.waypoints=(0,a.UI)(e.waypoints,(function(e){return{x:Ys(e.x-p.x-p.width/2+r.x),y:Ys(e.y-p.y-p.height/2+r.y)}}))),(0,a.f0)(e,{x:Ys(e.x-p.x-p.width/2+r.x),y:Ys(e.y-p.y-p.height/2+r.y)})}));var l=(0,V.cd)(t),u={};(0,a.Ed)(t,(function(e){if((0,K.Ho)(e))u[e.id]=(0,a.hj)(i)?s.createConnection(u[e.source.id],u[e.target.id],i,e,e.parent||n,o):s.createConnection(u[e.source.id],u[e.target.id],e,e.parent||n,o);else{var t=(0,a.f0)({},o);-1===l.indexOf(e)&&(t.autoResize=!1),(0,K.j_)(e)&&(t=(0,a.CE)(t,["attach"])),u[e.id]=(0,a.hj)(i)?s.createShape(e,(0,a.ei)(e,["x","y","width","height"]),e.parent||n,i,t):s.createShape(e,(0,a.ei)(e,["x","y","width","height"]),e.parent||n,t)}})),e.elements=(0,a.VO)(u)};var ec=Math.round;function tc(e){this._canvas=e}function nc(e){tc.call(this,e)}tc.$inject=["canvas"],tc.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return void 0!==n.width?(0,a.f0)(t,n):(0,a.f0)(t,{x:n.x-ec(t.width/2),y:n.y-ec(t.height/2)}),this._canvas.addShape(t,i,r),t},tc.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},(0,e.Z)(nc,tc),nc.$inject=["canvas"];var ic=tc.prototype.execute;nc.prototype.execute=function(e){var t=e.shape;return function(e){["width","height"].forEach((function(t){void 0===e[t]&&(e[t]=0)}))}(t),t.labelTarget=e.labelTarget,ic.call(this,e)};var rc=tc.prototype.revert;function oc(e,t){this._canvas=e,this._modeling=t}function ac(e,t){this._modeling=e,this._elementRegistry=t}function sc(e,t){this._canvas=e,this._modeling=t}function cc(e){this._modeling=e}nc.prototype.revert=function(e){return e.shape.labelTarget=null,rc.call(this,e)},oc.$inject=["canvas","modeling"],oc.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;Bs(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),Bs(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})}))},oc.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=(0,Ui.cq)(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},oc.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,(0,Ui.IH)(n.children,t,i),this._canvas.addConnection(t,n),t},ac.$inject=["modeling","elementRegistry"],ac.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,i=e.elements;(0,a.Ed)(i,(function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))}))},sc.$inject=["canvas","modeling"],sc.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;Bs(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),Bs(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})})),Bs(n.children,(function(e){(0,K.Ho)(e)?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})}))},sc.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=(0,Ui.cq)(i.children,n),t.removeShape(n),n},sc.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return(0,Ui.IH)(i.children,n,r),t.addShape(n,i),n},cc.$inject=["modeling"];var pc={x:"y",y:"x"};function lc(e,t){this._layouter=e,this._canvas=t}function uc(){}function hc(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function dc(e){this._modeling=e}function fc(e){this._helper=new dc(e)}function mc(e){this._modeling=e,this._helper=new dc(e)}function vc(e){this._modeling=e}function gc(e){return e.original||e}function yc(e,t){this._modeling=e,this._rules=t}function bc(e){this._modeling=e}function _c(e){this._modeling=e}function xc(e){return(0,a.f0)({},e)}function Ec(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function wc(e,t,n){var i=Ec(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i] required");var r=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||function(e,t){return(0,a.u4)(t,(function(t,n){return t[n]=e.get(n),t}),{})}(n,(0,a.XP)(i));return Oc(n,i),e.oldProperties=o,e.changed=r,r},Nc.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return Oc(n,t),i},Nc.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return(0,$t.is)(e,"bpmn:DataObject")?function(e,t){return t.filter((function(t){return(0,$t.is)(t,"bpmn:DataObjectReference")&&(0,$t.SS)(t).dataObjectRef===e}))}(e,t):[]};var Lc="default",Ic="id",$c={width:0,height:0};function zc(e,t,n,i,r){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=r}function Fc(e,t){return Ic in e&&e[Ic]!==t[Ic]}function Hc(e,t){var n=e.businessObject,i=(0,$t.DN)(e);(0,a.Ed)(t,(function(e,t){"di"!==t?n.set(t,e):i&&function(e,t){(0,a.Ed)(t,(function(t,n){e.set(n,t)}))}(i,e)}))}zc.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],zc.prototype.execute=function(e){var t=e.element,n=[t],i=this._translate;if(!t)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,s=t.businessObject,c=function(e){var t=(0,a.f0)({},e);return Zc.forEach((function(n){n in e&&(t[n]=(0,$t.SS)(t[n]))})),t}(e.properties),p=e.oldProperties||function(e,t){var n=(0,a.XP)(t),i=e.businessObject,r=(0,$t.DN)(e);return(0,a.u4)(n,(function(e,n){return e[n]="di"!==n?i.get(n):function(e,t){return(0,a.u4)(t,(function(t,n){return t[n]=e&&e.get(n),t}),{})}(r,(0,a.XP)(t.di)),e}),{})}(t,c);return Fc(c,s)&&(o.unclaim(s[Ic]),r.updateId(t,c[Ic]),o.claim(c[Ic],s)),Lc in c&&(c[Lc]&&n.push(r.get(c[Lc].id)),s[Lc]&&n.push(r.get(s[Lc].id))),Hc(t,c),e.oldProperties=p,e.changed=n,n},zc.prototype.postExecute=function(e){var t=e.element.label,n=t&&(0,$t.SS)(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,$c)}},zc.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Hc(t,i),Fc(n,r)&&(a.unclaim(n[Ic]),o.updateId(t,i[Ic]),a.claim(i[Ic],r)),e.changed};var Zc=["default"];function Wc(e,t){this._canvas=e,this._modeling=t}function Uc(e,t){this._modeling=e,this._spaceTool=t}function Vc(e,t){this._modeling=e,this._translate=t}function Gc(e,t){this._modeling=e,this._spaceTool=t}Wc.$inject=["canvas","modeling"],Wc.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=(0,$t.DN)(r);return t.setRootElement(n),t.removeRootElement(r),(0,Ui.IH)(a.rootElements,i),i.$parent=a,(0,Ui.Od)(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,e.oldRoot=r,[]},Wc.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,a=i.$parent,s=(0,$t.DN)(n);return t.setRootElement(r),t.removeRootElement(n),(0,Ui.Od)(a.rootElements,i),i.$parent=null,(0,Ui.IH)(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s,[]},Uc.$inject=["modeling","spaceTool"],Uc.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=ur(i),s=o===i,c=s?i:i.parent;lr(c).length||n.createShape({type:"bpmn:Lane"},{x:i.x+cr,y:i.y,width:i.width-cr,height:i.height},c);var p=[];(0,V.om)(o,(function(e){return p.push(e),e.label&&p.push(e.label),e===i?[]:(0,a.hX)(e.children,(function(e){return e!==i}))}));var l="top"===r?-120:120,u="top"===r?i.y:i.y+i.height,h=u+("top"===r?10:-10),d="top"===r?"n":"s",f=t.calculateAdjustments(p,"y",l,h);t.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:l},d,h),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(s?cr:0),y:u-("top"===r?120:0),width:i.width-(s?cr:0),height:120},c)},Vc.$inject=["modeling","translate"],Vc.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=lr(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var s,c,p,l,u,h=Math.round(i.height/r);for(u=0;u0||p.bottom<0?-n:n,a=s.calculateAdjustments(u,"y",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(p.left||p.right)&&(n=p.right||p.left,i=e.x+(p.right?e.width:0)+(p.right?-10:100),r=p.right?"e":"w",o=p.left>0||p.right<0?-n:n,a=s.calculateAdjustments(h,"x",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var Kc="flowNodeRef",Jc="lanes";function qc(e){this._elementRegistry=e}function Xc(e){this._moddle=e}qc.$inject=["elementRegistry"],qc.prototype._computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(e){-1===n.indexOf(e)&&(o.push(e),n.push(e))}return t.forEach((function(e){var t=ur(e);if(t&&-1===n.indexOf(t)){var i=t.children.filter((function(e){return(0,$t.is)(e,"bpmn:FlowNode")}));i.forEach(a),n.push(t)}})),e.forEach(a),o.forEach((function(e){var t=e.businessObject,n=t.get(Jc).slice(),o=function(e){if(!e.parent)return[];var t=function(e){var t=ur(e);return r[t.id]||(r[t.id]=pr(t)),r[t.id]}(e);return t.filter((function(t){return n=e,i=t,r=(0,Rt.JA)(i),o=n.x+n.width/2,a=n.y+n.height/2,o>r.left&&or.top&&a: must be specified as : with start/end in { h,v,t,r,b,l }");if(vp(n)){var i=function(e,t,n){return lp(e,t,n)}(e,t,n),r=function(e,t,n){var i=lp(t,e,up(n));return{waypoints:i.waypoints.slice().reverse(),directions:up(i.directions),turnNextDirections:i.turnNextDirections}}(e,t,n),o=function(e,t){var n=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(n="h"==n?"v":"h"),t.turnNextDirections&&(i="h"==i?"v":"h");var r=n+":"+i;return{waypoints:hp(e.waypoints[e.waypoints.length-1],t.waypoints[0],r),directions:r}}(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return function(e,t,n){var i=sp((t.x-e.x)/2+e.x),r=sp((t.y-e.y)/2+e.y);if("h:v"===n)return[{x:t.x,y:e.y}];if("v:h"===n)return[{x:e.x,y:t.y}];if("h:h"===n)return[{x:i,y:e.y},{x:i,y:t.y}];if("v:v"===n)return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(e,t,n)}function dp(e,t,n,i,r,o){var s;return(0,a.kJ)(n)&&(r=n,o=i,n=(0,Rt.wS)(e),i=(0,Rt.wS)(t)),r=r||[],s=-1!==(o=(0,a.f0)({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")&&function(e,t,n,i,r){var o,a,s={};return a=(0,Rt.T8)(e,t),/^(top|bottom|left|right)$/.test(a)?(/top|bottom/.test(a)&&(o="x"),/left|right/.test(a)&&(o="y"),"target"===r.preserveDocking?fp(o,i,e)?(s[o]=i[o],[{x:void 0!==s.x?s.x:n.x,y:void 0!==s.y?s.y:n.y,original:{x:void 0!==s.x?s.x:n.x,y:void 0!==s.y?s.y:n.y}},{x:i.x,y:i.y}]):null:fp(o,n,t)?(s[o]=n[o],[{x:n.x,y:n.y},{x:void 0!==s.x?s.x:i.x,y:void 0!==s.y?s.y:i.y,original:{x:void 0!==s.x?s.x:i.x,y:void 0!==s.y?s.y:i.y}}]):null):null}(e,t,n,i,o),s||(s=o.connectionEnd&&function(e,t,n,i){var r=i.slice().reverse();return(r=mp(e,t,n,r))?r.reverse():null}(t,e,i,r),s||(s=o.connectionStart&&mp(e,t,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:function(e,t,n,i,r){var o=r&&r.preferredLayouts||[],s=(0,a.zu)(o,"straight")[0]||"h:h",c=pp[s]||0,p=(0,Rt.T8)(e,t,c),l=function(e,t){if(vp(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}(p,s);n=n||(0,Rt.wS)(e),i=i||(0,Rt.wS)(t);var u=l.split(":"),h=gp(n,e,u[0],function(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}(p));return function(e,t,n){var i=hp(e,t,n);return i.unshift(e),i.push(t),yp(i)}(h,gp(i,t,u[1],p),l)}(e,t,n,i,o)))}function fp(e,t,n){return function(e,t,n){return e>=t&&e<=n}(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function mp(e,t,n,i){if(function(e){return e.length<3||!(e.length>4)&&!!(0,a.sE)(e,(function(t,n){var i=e[n-1];return i&&(0,un.tW)(t,i)<3}))}(i))return null;var r,o=i[0],s=i.slice();return s[0]=n,s[1]=function(e,t,n){switch((0,un.Or)(t,e)){case"v":return{x:n.x,y:e.y};case"h":return{x:e.x,y:n.y}}return{x:e.x,y:e.y}}(s[1],o,n),r=function(e,t,n){var i;for(i=e.length-2;0!==i;i--)if((0,un.qr)(e[i],t,cp)||(0,un.qr)(e[i],n,cp))return e.slice(i);return e}(s,e,t),r!==s&&(s=mp(e,t,n,r)),s&&(0,un.Or)(s)?null:s}function vp(e){return e&&/t|r|b|l/.test(e)}function gp(e,t,n,i){if("h"===n&&(n=/left/.test(i)?"l":"r"),"v"===n&&(n=/top/.test(i)?"t":"b"),"t"===n)return{original:e,x:e.x,y:t.y};if("r"===n)return{original:e,x:t.x+t.width,y:e.y};if("b"===n)return{original:e,x:e.x,y:t.y+t.height};if("l"===n)return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function yp(e){return e.reduce((function(t,n,i){var r=t[t.length-1],o=e[i+1];return(0,un.ZS)(r,o,n,0)||t.push(n),t}),[])}var bp=40,_p={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},xp={top:"t",right:"r",bottom:"b",left:"l"};function Ep(){}function wp(e,t){return(0,$t.is)(t,"bpmn:Participant")?"source":(0,$t.is)(e,"bpmn:Participant")?"target":Rp(t)?"source":Rp(e)||(0,$t.is)(t,"bpmn:Event")?"target":(0,$t.is)(e,"bpmn:Event")?"source":null}function Sp(e){return Rp(e)?"target":"source"}function kp(e,t){return e?e.original||e:(0,Rt.wS)(t)}function Cp(e,t){return(0,$t.is)(t,"bpmn:Activity")&&(0,$t.is)(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Rp(e){return(0,$t.is)(e,"bpmn:SubProcess")&&(0,Ni.ul)(e)}function Ap(e,t){return e===t}function Pp(e){var t=/right|left/.exec(e);return t&&t[0]}function Tp(e){var t=/top|bottom/.exec(e);return t&&t[0]}function Mp(e){return"right"===e||"left"===e}function Dp(e,t){var n=t.waypoints,i=n&&n.length&&(0,Rt.T8)(n[0],e);return"top"===i?["t:r"]:"right"===i?["r:b"]:"left"===i?["l:t"]:["b:l"]}function Bp(e,t,n){var i,r,o,a,s=(0,Rt.wS)(e),c=(0,Rt.wS)(t),p=(a=(o=e).host,(0,Rt.T8)((0,Rt.wS)(o),a,-10)),l=Ap(e.host,t),u=-1!==["top","right","bottom","left"].indexOf(p),h=(0,Rt.T8)(c,s,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return l?function(e,t,n,i,r){var o=t?e:Tp(e);return[xp[o]+":"+(t?Mp(e)?jp("y",n,i,r)?"h":"b":jp("x",n,i,r)?"v":"l":"v")]}(p,u,e,t,n):(i=function(e,t,n){return n?xp[e]:Ap(Tp(e),Tp(t))||function(e,t){return _p[e]===t}(Pp(e),Pp(t))?xp[Tp(e)]:xp[Pp(e)]}(p,h,u),r=function(e,t,n){return n?Mp(e)?function(e,t){var n=Pp(e),i=_p[n];return-1!==t.indexOf(i)}(e,t)||Ap(e,t)?"h":"v":function(e,t){var n=Tp(e),i=_p[n];return-1!==t.indexOf(i)}(e,t)||Ap(e,t)?"v":"h":Mp(t)||Ap(Tp(e),Tp(t))&&Pp(t)?"h":"v"}(p,h,u),[i+":"+r])}function jp(e,t,n,i){var r=bp;return!(Np(e,i,n,r)||Np(e,i,{x:n.x+n.width,y:n.y+n.height},r)||Np(e,i,(0,Rt.wS)(t),r))}function Np(e,t,n,i){return Math.abs(t[e]-n[e])!(0,a.kK)(e)))})},zp.prototype.cleanUp=function(){this._complexPreview.cleanUp()},zp.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];const Fp={__depends__:[Zt,ki,Ip],__init__:["appendPreview"],appendPreview:["type",zp]};var Hp=Math.min,Zp=Math.max;function Wp(e){e.preventDefault()}function Up(e){e.stopPropagation()}function Vp(e){this.container=e.container,this.parent=(0,s.H6)('
      '),this.content=(0,s.IO)("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=(0,a.ak)(this.autoResize,this),this.handlePaste=(0,a.ak)(this.handlePaste,this)}function Gp(e,t){this._eventBus=e,this._providers=[],this._textbox=new Vp({container:t.getContainer(),keyHandler:(0,a.ak)(this._handleKey,this),resizeHandler:(0,a.ak)(this._handleResize,this)})}Vp.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,c=this.container;i=this.options=i||{},t=this.style=t||{};var p=(0,a.ei)(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);(0,a.f0)(r.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},p);var l=(0,a.ei)(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return(0,a.f0)(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&(0,a.f0)(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),o.innerText=n,s.B.bind(o,"keydown",this.keyHandler),s.B.bind(o,"mousedown",Up),s.B.bind(o,"paste",this.handlePaste),i.autoResize&&s.B.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),c.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},Vp.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},Vp.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,"\n"),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},Vp.prototype._insertTextIE=function(e){var t,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,c=r.startOffset,p=r.endOffset,l=r.commonAncestorContainer,u=(t=l.childNodes,[].slice.call(t));if(l.nodeType===Node.TEXT_NODE){var h=o.textContent;o.textContent=h.substring(0,c)+e+h.substring(p),n=o,i=c+e.length}else if(o===this.content&&a===this.content){var d=document.createTextNode(e);this.content.insertBefore(d,u[c]),n=d,i=d.textContent.length}else{var f=u.indexOf(o),m=u.indexOf(a);u.forEach((function(t,n){n===f?t.textContent=o.textContent.substring(0,c)+e+a.textContent.substring(p):n>f&&n<=m&&(0,s.Od)(t)})),n=o,i=c+e.length}n&&void 0!==i&&setTimeout((function(){self.setSelection(n,i)}))},Vp.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight
      ');var d=function(n){Wp(n),Up(n);var a=Hp(Zp(u+n.clientX-p,i),o),s=Hp(Zp(h+n.clientY-l,r),c);t.style.width=a+"px",t.style.height=s+"px",e.resizeHandler({width:u,height:h,dx:n.clientX-p,dy:n.clientY-l})},f=function(e){Wp(e),Up(e),s.B.unbind(document,"mousemove",d,!1),s.B.unbind(document,"mouseup",f,!1)};s.B.bind(n,"mousedown",(function(e){Wp(e),Up(e),p=e.clientX,l=e.clientY;var n=t.getBoundingClientRect();u=n.width,h=n.height,s.B.bind(document,"mousemove",d),s.B.bind(document,"mouseup",f)}))}(0,a.f0)(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},Vp.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),s.B.unbind(t,"keydown",this.keyHandler),s.B.unbind(t,"mousedown",Up),s.B.unbind(t,"input",this.autoResize),s.B.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),(0,s.Od)(n)),(0,s.Od)(e)},Vp.prototype.getValue=function(){return this.content.innerText.trim()},Vp.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},Vp.prototype.setSelection=function(e,t){var n=document.createRange();null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},Gp.$inject=["eventBus","canvas"],Gp.prototype.registerProvider=function(e){this._providers.push(e)},Gp.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},Gp.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Gp.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},Gp.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},Gp.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===e.context.text&&i.height===n.height&&i.width===n.width||(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},Gp.prototype.getValue=function(){return this._textbox.getValue()},Gp.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return 27===t?(e.preventDefault(),this.cancel()):13!==t||e.shiftKey?void 0:(e.preventDefault(),this.complete())},Gp.prototype._handleResize=function(e){this._fire("resize",e)},Gp.prototype.activate=function(e){var t;this.isActive()&&this.cancel();var n=(0,a.sE)(this._providers,(function(n){return(t=n.activate(e))?n:null}));return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};const Kp={__depends__:[R.Z],__init__:["directEditing"],directEditing:["type",Gp]};function Jp(e){return function(t){var n=t.target,i=(0,$t.SS)(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=!!n.triggeredByEvent==!!i.triggeredByEvent,c=void 0===n.isExpanded||n.isExpanded===(0,Ni.ul)(e);return!(o&&a&&s&&c)}}var qp=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Xp=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Yp=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Qp=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],el=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],tl=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],nl=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],il=nl,rl=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}}],ol=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],al=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],sl=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],cl=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],pl=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],ll=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];const ul='\n \n \n \n \n ',hl='\n \n \n \n \n \n ';function dl(e,t,n,i,r,o,a,s){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this._moddleCopy=s,this._register()}dl.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"],dl.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},dl.prototype.getPopupMenuEntries=function(e){var t=e.businessObject,n=this._rules,i=[];if((0,a.kJ)(e)||!n.allowed("shape.replace",{element:e}))return{};var r=Jp(e);return(0,$t.is)(t,"bpmn:DataObjectReference")?this._createEntries(e,ol):(0,$t.is)(t,"bpmn:DataStoreReference")&&!(0,$t.is)(e.parent,"bpmn:Collaboration")?this._createEntries(e,al):(0,$t.is)(t,"bpmn:StartEvent")&&!(0,$t.is)(t.$parent,"bpmn:SubProcess")?(i=(0,a.hX)(qp,r),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:Participant")?(i=(0,a.hX)(ll,(function(t){return(0,Ni.ul)(e)!==t.target.isExpanded})),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:StartEvent")&&(0,Ni.J5)(t.$parent)?(i=(0,a.hX)(cl,(function(e){var n=!1!==e.target.isInterrupting,i=t.isInterrupting===n;return r(e)||!r(e)&&!i})),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:StartEvent")&&!(0,Ni.J5)(t.$parent)&&(0,$t.is)(t.$parent,"bpmn:SubProcess")?(i=(0,a.hX)(Xp,r),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:EndEvent")?(i=(0,a.hX)(Qp,(function(e){return!("bpmn:CancelEventDefinition"==e.target.eventDefinitionType&&!(0,$t.is)(t.$parent,"bpmn:Transaction"))&&r(e)})),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:BoundaryEvent")?(i=(0,a.hX)(sl,(function(e){var n=e.target;if("bpmn:CancelEventDefinition"==n.eventDefinitionType&&!(0,$t.is)(t.attachedToRef,"bpmn:Transaction"))return!1;var i=!1!==n.cancelActivity,o=t.cancelActivity==i;return r(e)||!r(e)&&!o})),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:IntermediateCatchEvent")||(0,$t.is)(t,"bpmn:IntermediateThrowEvent")?(i=(0,a.hX)(Yp,r),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:Gateway")?(i=(0,a.hX)(el,r),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:Transaction")?(i=(0,a.hX)(nl,r),this._createEntries(e,i)):(0,Ni.J5)(t)&&(0,Ni.ul)(e)?(i=(0,a.hX)(il,r),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:SubProcess")&&(0,Ni.ul)(e)?(i=(0,a.hX)(tl,r),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:AdHocSubProcess")&&!(0,Ni.ul)(e)?(i=(0,a.hX)(rl,(function(e){var t=e.target,n="bpmn:SubProcess"===t.type,i=!0===t.isExpanded;return Jp(t)&&(!n||i)})),this._createEntries(e,i)):(0,$t.is)(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,pl):(0,$t.is)(t,"bpmn:FlowNode")?(i=(0,a.hX)(rl,r),(0,$t.is)(t,"bpmn:SubProcess")&&!(0,Ni.ul)(e)&&(i=(0,a.hX)(i,(function(e){return"Sub-process (collapsed)"!==e.label}))),this._createEntries(e,i)):{}},dl.prototype.getPopupMenuHeaderEntries=function(e){var t={};return(0,$t.is)(e,"bpmn:Activity")&&!(0,Ni.J5)(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),(0,$t.is)(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),(0,$t.is)(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),!(0,$t.is)(e,"bpmn:SubProcess")||(0,$t.is)(e,"bpmn:Transaction")||(0,Ni.J5)(e)||(t={...t,...this._getAdHocHeaderEntries(e)}),no(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t},dl.prototype._createEntries=function(e,t){var n={},i=this;return(0,a.Ed)(t,(function(t){n[t.actionName]=i._createEntry(t,e)})),n},dl.prototype._createSequenceFlowEntries=function(e,t){var n=(0,$t.SS)(e),i={},r=this._modeling,o=this._moddle,s=this;return(0,a.Ed)(t,(function(t){switch(t.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&((0,$t.is)(n.sourceRef,"bpmn:ExclusiveGateway")||(0,$t.is)(n.sourceRef,"bpmn:InclusiveGateway")||(0,$t.is)(n.sourceRef,"bpmn:ComplexGateway")||(0,$t.is)(n.sourceRef,"bpmn:Activity"))&&(i={...i,[t.actionName]:s._createEntry(t,e,(function(){r.updateProperties(e.source,{default:n})}))});break;case"replace-with-conditional-flow":!n.conditionExpression&&(0,$t.is)(n.sourceRef,"bpmn:Activity")&&(i={...i,[t.actionName]:s._createEntry(t,e,(function(){var t=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:t})}))});break;default:(0,$t.is)(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(i={...i,[t.actionName]:s._createEntry(t,e,(function(){r.updateProperties(e,{conditionExpression:void 0})}))}),((0,$t.is)(n.sourceRef,"bpmn:ExclusiveGateway")||(0,$t.is)(n.sourceRef,"bpmn:InclusiveGateway")||(0,$t.is)(n.sourceRef,"bpmn:ComplexGateway")||(0,$t.is)(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(i={...i,[t.actionName]:s._createEntry(t,e,(function(){r.updateProperties(e.source,{default:void 0})}))})}})),i},dl.prototype._createEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=e.label;return o&&"function"==typeof o&&(o=o(t)),n=n||function(){return r(t,e.target)},{label:i(o),className:e.className,action:n}},dl.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function i(n,i){if(i.active)return void t._modeling.updateProperties(e,{loopCharacteristics:void 0});const r=e.businessObject.get("loopCharacteristics"),o=t._moddle.create(i.options.loopCharacteristics);r&&t._moddleCopy.copyElement(r,o),o.set("isSequential",i.options.isSequential),t._modeling.updateProperties(e,{loopCharacteristics:o})}var r,o,a,s=(0,$t.SS)(e).loopCharacteristics;return s&&(r=s.isSequential,o=void 0===s.isSequential,a=void 0!==s.isSequential&&!s.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:r,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:o,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},dl.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,i=e.businessObject.dataObjectRef;if(!i)return{};var r=i.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:r,action:function(n,r){t._modeling.updateModdleProperties(e,i,{isCollection:!r.active})}}}},dl.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,i=this._translate,r=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:i("Participant multiplicity"),active:!!r,action:function(i,r){var o;r.active||(o=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:o})}}}},dl.prototype._getAdHocHeaderEntries=function(e){var t=this._translate,n=(0,$t.SS)(e),i=(0,$t.is)(n,"bpmn:AdHocSubProcess"),r=this._bpmnReplace.replaceElement;return{"toggle-adhoc":{className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:i,action:function(t,n){return r(e,i?{type:"bpmn:SubProcess"}:{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}}}},dl.prototype._getNonInterruptingHeaderEntries=function(e){const t=this._translate,n=(0,$t.SS)(e),i=this,r=io(e),o=(0,$t.is)(e,"bpmn:BoundaryEvent")?hl:ul,a=!n[r];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:a,action:function(){i._modeling.updateProperties(e,{[r]:!!a})}}}};const fl={__depends__:[yt,ps,Zt],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",dl]};function ml(e,t,n,i,r,o,a,s,c,p,l,u,h){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=p,this._rules=l,this._translate=u,this._eventBus=n,this._appendPreview=h,!1!==e.autoPlace&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,(function(e){var t=e.context.shape;if((0,Pn.RJ)(e)&&i.isOpen(t)){var n=i.getEntries(t);n.replace&&n.replace.action.click(e,t)}}))}function vl(e,t,n){var i=e.$instanceOf(t),r=!1,o=e.eventDefinitions||[];return(0,a.Ed)(o,(function(e){e.$type===n&&(r=!0)})),i&&r}ml.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"],ml.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&(0,a.f0)(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(e,n){t.removeElements(n.slice())}}}}),n},ml.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return(0,a.kJ)(t)?(0,a.yW)(t,(function(e){return n=e,-1!==t.indexOf(n);var n})):t},ml.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,s=this._popupMenu,c=this._rules,p=this._autoPlace,l=this._translate,u=this._appendPreview,h={};if("label"===e.type)return h;var d=e.businessObject;function f(e,t){r.start(e,t)}function m(e,t,n,r){function s(t,n){var s=i.createShape((0,a.f0)({type:e},r));o.start(t,s,{source:n}),u.cleanUp()}var c=p?function(t,n){var o=i.createShape((0,a.f0)({type:e},r));p.append(n,o),u.cleanUp()}:s,l=p?function(t,n){return u.create(n,e,r),()=>{u.cleanUp()}}:null;return{group:"model",className:t,title:n,action:{dragstart:s,click:c,hover:l}}}function v(e){return function(i,r){n.splitLane(r,e),t.open(r,!0)}}if((0,$t.JZ)(d,["bpmn:Lane","bpmn:Participant"])&&(0,Ni.ul)(e)){var g=lr(e);(0,a.f0)(h,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:l("Add lane above"),action:{click:function(e,t){n.addLane(t,"top")}}}}),g.length<2&&(e.height>=120&&(0,a.f0)(h,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:l("Divide into two lanes"),action:{click:v(2)}}}),e.height>=180&&(0,a.f0)(h,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:l("Divide into three lanes"),action:{click:v(3)}}})),(0,a.f0)(h,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:l("Add lane below"),action:{click:function(e,t){n.addLane(t,"bottom")}}}})}(0,$t.is)(d,"bpmn:FlowNode")&&((0,$t.is)(d,"bpmn:EventBasedGateway")?(0,a.f0)(h,{"append.receive-task":m("bpmn:ReceiveTask","bpmn-icon-receive-task",l("Append receive task")),"append.message-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",l("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",l("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",l("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",l("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):vl(d,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?(0,a.f0)(h,{"append.compensation-activity":m("bpmn:Task","bpmn-icon-task",l("Append compensation activity"),{isForCompensation:!0})}):(0,$t.is)(d,"bpmn:EndEvent")||d.isForCompensation||vl(d,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||(0,Ni.J5)(d)||(0,a.f0)(h,{"append.end-event":m("bpmn:EndEvent","bpmn-icon-end-event-none",l("Append end event")),"append.gateway":m("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",l("Append gateway"),{isMarkerVisible:!0}),"append.append-task":m("bpmn:Task","bpmn-icon-task",l("Append task")),"append.intermediate-event":m("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",l("Append intermediate/boundary event"))})),s.isEmpty(e,"bpmn-replace")||(0,a.f0)(h,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:l("Change element"),action:{click:function(e,n){var i=(0,a.f0)(function(e){var n=t.getPad(e).html.getBoundingClientRect();return{x:n.left,y:n.bottom+5}}(n),{cursor:{x:e.x,y:e.y}});s.open(n,"bpmn-replace",i,{title:l("Change element"),width:300,search:!0})}}}}),(0,$t.is)(d,"bpmn:SequenceFlow")&&(0,a.f0)(h,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",l("Add text annotation"))}),(0,$t.JZ)(d,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&(0,a.f0)(h,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",l("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:l("Connect to other element"),action:{click:f,dragstart:f}}}),(0,$t.is)(d,"bpmn:TextAnnotation")&&(0,a.f0)(h,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:l("Connect using association"),action:{click:f,dragstart:f}}}),(0,$t.JZ)(d,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&(0,a.f0)(h,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:l("Connect using data input association"),action:{click:f,dragstart:f}}}),(0,$t.is)(d,"bpmn:Group")&&(0,a.f0)(h,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",l("Add text annotation"))});var y=c.allowed("elements.delete",{elements:[e]});return(0,a.kJ)(y)&&(y=y[0]===e),y&&(0,a.f0)(h,{delete:{group:"edit",className:"bpmn-icon-trash",title:l("Delete"),action:{click:function(e,t){n.removeElements([t])}}}}),h};const gl={__depends__:[Fp,Kp,Y,Xt.Z,fi,Ha,fl],__init__:["contextPadProvider"],contextPadProvider:["type",ml]};var yl={horizontal:["x","width"],vertical:["y","height"]};function bl(e,t){this._modeling=e,this._filters=[],this.registerFilter((function(e){var n=t.allowed("elements.distribute",{elements:e});return(0,a.kJ)(n)?n:n?e:[]}))}bl.$inject=["modeling","rules"],bl.prototype.registerFilter=function(e){if("function"!=typeof e)throw new Error("the filter has to be a function");this._filters.push(e)},bl.prototype.trigger=function(e,t){var n,i,r=this._modeling;if(!(e.length<3||(this._setOrientation(t),i=this._filterElements(e),(n=this._createGroups(i)).length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},bl.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?((0,a.Ed)(t,(function(e){r=e(r,n,i)})),r):e},bl.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');var o=(0,a.MR)(e,i);return(0,a.Ed)(o,(function(e,o){var a,s=n._findRange(e,i,r),c=t[t.length-1];c&&n._hasIntersection(c.range,s)?t[t.length-1].elements.push(e):(a={range:s,elements:[e]},t.push(a))})),t},bl.prototype._setOrientation=function(e){var t=yl[e];this._axis=t[0],this._dimension=t[1]},bl.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},bl.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};const _l={__init__:["distributeElements"],distributeElements:["type",bl]};function xl(e){St.call(this,e)}xl.$inject=["eventBus"],(0,e.Z)(xl,St),xl.prototype.init=function(){this.addRule("elements.distribute",(function(e){var t=e.elements;return t=(0,a.hX)(t,(function(e){var t=(0,$t.JZ)(e,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(e.labelTarget||t)})),!((t=(0,V.cd)(t)).length<3)&&t}))};const El='\n \n \n \n ',wl='\n \n \n \n ';function Sl(e,t,n,i){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",900,this)}Sl.$inject=["popupMenu","distributeElements","translate","rules"],Sl.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&(0,a.f0)(t,this._getEntries(e)),t},Sl.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},Sl.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,i=this._popupMenu;return{"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:El,action:function(n,r){t.trigger(e,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:wl,action:function(n,r){t.trigger(e,"vertical"),i.close()}}}};const kl={__depends__:[yt,_l],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",xl],distributeElementsMenuProvider:["type",Sl]};var Cl="is not a registered action";function Rl(e,t){this._actions={};var n=this;e.on("diagram.init",(function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})}))}function Al(e,t){return new Error(e+" "+t)}Rl.$inject=["eventBus","injector"],Rl.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),s=e.get("canvas",!1),c=e.get("rules",!1),p=e.get("keyboardMove",!1),l=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",(function(){t.undo()})),this.register("redo",(function(){t.redo()}))),o&&i&&this.register("copy",(function(){var e=i.get();if(e.length)return o.copy(e)})),o&&this.register("paste",(function(){o.paste()})),r&&this.register("stepZoom",(function(e){r.stepZoom(e.value)})),s&&this.register("zoom",(function(e){s.zoom(e.value)})),n&&i&&c&&this.register("removeSelection",(function(){var e=i.get();if(e.length){var t,r=c.allowed("elements.delete",{elements:e});!1!==r&&(t=(0,a.kJ)(r)?r:e).length&&n.removeElements(t.slice())}})),p&&this.register("moveCanvas",(function(e){p.moveCanvas(e)})),l&&this.register("moveSelection",(function(e){l.moveSelection(e.direction,e.accelerated)}))},Rl.prototype.trigger=function(e,t){if(!this._actions[e])throw Al(e,Cl);return this._actions[e](t)},Rl.prototype.register=function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);(0,a.Ed)(e,(function(e,t){n._registerAction(t,e)}))},Rl.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw Al(e,"is already registered");this._actions[e]=t},Rl.prototype.unregister=function(e){if(!this.isRegistered(e))throw Al(e,Cl);this._actions[e]=void 0},Rl.prototype.getActions=function(){return Object.keys(this._actions)},Rl.prototype.isRegistered=function(e){return!!this._actions[e]};const Pl={__init__:["editorActions"],editorActions:["type",Rl]};function Tl(e){e.invoke(Rl,this)}(0,e.Z)(Tl,Rl),Tl.$inject=["injector"],Tl.prototype._registerDefaultActions=function(e){Rl.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),s=e.get("handTool",!1),c=e.get("globalConnect",!1),p=e.get("distributeElements",!1),l=e.get("alignElements",!1),u=e.get("directEditing",!1),h=e.get("searchPad",!1),d=e.get("modeling",!1),f=e.get("contextPad",!1);t&&n&&i&&this._registerAction("selectElements",(function(){var e=t.getRootElement(),r=n.filter((function(t){return t!==e}));return i.select(r),r})),r&&this._registerAction("spaceTool",(function(){r.toggle()})),o&&this._registerAction("lassoTool",(function(){o.toggle()})),s&&this._registerAction("handTool",(function(){s.toggle()})),c&&this._registerAction("globalConnectTool",(function(){c.toggle()})),i&&p&&this._registerAction("distributeElements",(function(e){var t=i.get(),n=e.type;t.length&&p.trigger(t,n)})),i&&l&&this._registerAction("alignElements",(function(e){var t=i.get(),n=[],r=e.type;t.length&&(n=(0,a.hX)(t,(function(e){return!(0,$t.is)(e,"bpmn:Lane")})),l.trigger(n,r))})),i&&d&&this._registerAction("setColor",(function(e){var t=i.get();t.length&&d.setColor(t,e)})),i&&u&&this._registerAction("directEditing",(function(){var e=i.get();e.length&&u.activate(e[0])})),h&&this._registerAction("find",(function(){h.toggle()})),t&&d&&this._registerAction("moveToOrigin",(function(){var e,i,r=t.getRootElement();i=(0,$t.is)(r,"bpmn:Collaboration")?n.filter((function(e){return(0,$t.is)(e.parent,"bpmn:Collaboration")})):n.filter((function(e){return e!==r&&!(0,$t.is)(e.parent,"bpmn:SubProcess")})),e=(0,V.jY)(i),d.moveElements(i,{x:-e.x,y:-e.y},r)})),i&&f&&this._registerAction("replaceElement",(function(e){f.triggerEntry("replace","click",e)}))};const Ml={__depends__:[Pl],editorActions:["type",Tl]};function Dl(e){e.on(["create.init","shape.move.init"],(function(e){var t=e.context,n=e.shape;(0,$t.JZ)(n,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(t.gridSnappingContext||(t.gridSnappingContext={}),t.gridSnappingContext.snapLocation="top-left")}))}function Bl(e,t,n){return n||(n="round"),Math[n](e/t)*t}function jl(e,t,n){var i=!n||!1!==n.active;this._eventBus=t;var r=this;t.on("diagram.init",800,(function(){r.setActive(i)})),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,(function(t){var n=t.originalEvent;if(!(!r.active||n&&h(n))){var i=t.context,o=i.gridSnappingContext;o||(o=i.gridSnappingContext={}),["x","y"].forEach((function(n){var i={},o=function(e,t,n){var i=e.context,r=e.shape,o=i.gridSnappingContext,s=o.snapLocation,c=o.snapOffset;return c&&(0,a.hj)(c[t])?c[t]:(c||(c=o.snapOffset={}),(0,a.hj)(c[t])||(c[t]=0),r?(n.get(r.id)||(Nl(t)?c[t]+=r[t]+r.width/2:c[t]+=r[t]+r.height/2),s?("x"===t?/left/.test(s)?c[t]-=r.width/2:/right/.test(s)&&(c[t]+=r.width/2):/top/.test(s)?c[t]-=r.height/2:/bottom/.test(s)&&(c[t]+=r.height/2),c[t]):c[t]):c[t])}(t,n,e);o&&(i.offset=o);var s=function(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;i&&(Nl(t)?(a.x.min=i.left,a.x.max=i.right):(a.y.min=i.top,a.y.max=i.bottom));var c=r.min,p=r.max;return c&&(Nl(t)?Ll(s)?a.x.max=c.left:a.x.min=c.right:Ol(s)?a.y.max=c.top:a.y.min=c.bottom),p&&(Nl(t)?Ll(s)?a.x.min=p.left:a.x.max=p.right:Ol(s)?a.y.min=p.top:a.y.max=p.bottom),a[t]}(t,n);s&&(0,a.f0)(i,s),ni(t,n)||r.snapEvent(t,n,i)}))}}))}function Nl(e){return"x"===e}function Ol(e){return-1!==e.indexOf("n")}function Ll(e){return-1!==e.indexOf("w")}function Il(e,t){wt.Z.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",(function(e){var t=e.context,i=(t.hints||{}).autoResize;if(i){var r=t.shape,o=t.newBounds;(0,a.HD)(i)?t.newBounds=n.snapComplex(o,i):t.newBounds=n.snapSimple(r,o)}}))}function $l(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,(function(e){var n,i=e.context;i.initialized&&("x"===i.axis?(n=t.snapValue(e.dx),e.x=e.x+n-e.dx,e.dx=n):(n=t.snapValue(e.dy),e.y=e.y+n-e.dy,e.dy=n))}))}Dl.$inject=["eventBus"],jl.prototype.snapEvent=function(e,t,n){ii(e,t,this.snapValue(e[t],n))},jl.prototype.getGridSpacing=function(){return 10},jl.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e=Bl(e+=r,10),t&&t.min&&(n=t.min,(0,a.hj)(n)&&(n=Bl(n+r,10,"ceil"),e=Math.max(e,n))),t&&t.max&&(i=t.max,(0,a.hj)(i)&&(i=Bl(i+r,10,"floor"),e=Math.min(e,i))),e-r},jl.prototype.isActive=function(){return this.active},jl.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},jl.prototype.toggleActive=function(){this.setActive(!this.active)},jl.$inject=["elementRegistry","eventBus","config.gridSnapping"],Il.$inject=["eventBus","gridSnapping","modeling"],(0,e.Z)(Il,wt.Z),Il.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},Il.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},Il.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),(0,a.f0)(e,o),e},Il.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),(0,a.f0)(e,o),e},$l.$inject=["eventBus","gridSnapping"];const zl={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Il],gridSnappingSpaceToolBehavior:["type",$l]}],__init__:["gridSnapping"],gridSnapping:["type",jl]};function Fl(e,t){e.on("autoPlace",2e3,(function(e){var n=e.source,i=(0,Rt.wS)(n),r=e.shape,o=zt(n,r);return["x","y"].forEach((function(e){var n={};o[e]!==i[e]&&(o[e]>i[e]?n.min=o[e]:n.max=o[e],(0,$t.is)(r,"bpmn:TextAnnotation")&&(function(e){return"x"===e}(e)?n.offset=-r.width/2:n.offset=-r.height/2),o[e]=t.snapValue(o[e],n))})),o}))}function Hl(e,t,n){t.on(["create.start","shape.move.start"],1750,(function(t){var i=t.context,r=i.shape,o=e.getRootElement();(0,$t.is)(r,"bpmn:Participant")&&(0,$t.is)(o,"bpmn:Process")&&o.children.length&&i.createConstraints&&(r.width=n.snapValue(r.width,{min:r.width}),r.height=n.snapValue(r.height,{min:r.height}))}))}function Zl(e,t,n){wt.Z.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,(function(e){var t=e.context,r=t.connection,o=t.hints||{},a=r.waypoints;o.connectionStart||o.connectionEnd||!1===o.createElementsBehavior||function(e){return e.length>3}(a)&&n.updateWaypoints(r,i.snapMiddleSegments(a))}))}function Wl(e,t,n){var i=(0,un.Or)(t,n),r={};return function(e){return"h"===e}(i)&&(r.y=e.snapValue(t.y)),function(e){return"v"===e}(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=(0,a.f0)({},t,r),n=(0,a.f0)({},n,r)),[t,n]}Fl.$inject=["eventBus","gridSnapping"],Hl.$inject=["canvas","eventBus","gridSnapping"],Zl.$inject=["eventBus","gridSnapping","modeling"],(0,e.Z)(Zl,wt.Z),Zl.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i5&&(0,O.Lj)(a,{x:o.x,width:o.width}),o.height>5&&(0,O.Lj)(a,{y:o.y,height:o.height}),i.canExecute?(0,O.Sh)(a).remove(cu):(0,O.Sh)(a).add(cu)})),e.on("resize.cleanup",(function(e){var n,i;i=(n=e.context).shape,n.frame&&(0,O.Od)(n.frame),t.removeMarker(i,su)}))}pu.$inject=["eventBus","canvas","previewSupport"];var lu="djs-resizer",uu=["n","w","s","e","nw","ne","se","sw"];function hu(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",(function(e){var t=e.newSelection;r.removeResizers(),1===t.length&&(0,a.Ed)(t,(0,a.ak)(r.addResizer,r))})),e.on("shape.changed",(function(e){var t=e.element;n.isSelected(t)&&(r.removeResizers(),r.addResizer(t))}))}hu.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(t){(0,Pn.Id)(t)&&i.activate(t,e,n)}s.B.bind(t,"mousedown",r),s.B.bind(t,"touchstart",r)},hu.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=function(e){var t={x:0,y:0};return-1!==e.indexOf("e")?t.x=6:-1!==e.indexOf("w")&&(t.x=-6),-1!==e.indexOf("s")?t.y=6:-1!==e.indexOf("n")&&(t.y=-6),t}(i),a=(0,O.Ue)("g");(0,O.Sh)(a).add(lu),(0,O.Sh)(a).add(lu+"-"+e.id),(0,O.Sh)(a).add(lu+"-"+i),(0,O.R3)(r,a);var s=(0,O.Ue)("rect");(0,O.Lj)(s,{x:-4+o.x,y:-4+o.y,width:8,height:8}),(0,O.Sh)(s).add(lu+"-visual"),(0,O.R3)(a,s);var c=(0,O.Ue)("rect");return(0,O.Lj)(c,{x:-10+o.x,y:-10+o.y,width:20,height:20}),(0,O.Sh)(c).add(lu+"-hit"),(0,O.R3)(a,c),(0,hn.vs)(a,t,n),a},hu.prototype.createResizer=function(e,t){var n=ou(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},hu.prototype.addResizer=function(e){var t=this;!(0,K.Ho)(e)&&this._resize.canResize({shape:e})&&(0,a.Ed)(uu,(function(n){t.createResizer(e,n)}))},hu.prototype.removeResizers=function(){var e=this._getResizersParent();(0,O.ZH)(e)},hu.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},hu.$inject=["eventBus","canvas","selection","resize"];const du={__depends__:[ln,an,Ei],__init__:["resize","resizePreview","resizeHandles"],resize:["type",ru],resizePreview:["type",pu],resizeHandles:["type",hu]};function fu(e,t,n,i,r,o,a){function s(e,t){(t||(0,$t.JZ)(e,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||mu(e))&&i.activate(e)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",(function(e){s(e.element,!0)})),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],(function(){i.isActive()&&i.complete()})),e.on(["shape.remove","connection.remove"],2e3,(function(e){i.isActive(e.element)&&i.cancel()})),e.on(["commandStack.changed"],(function(e){i.isActive()&&i.cancel()})),e.on("directEditing.activate",(function(e){o.removeResizers()})),e.on("create.end",500,(function(e){var t=e.context,n=t.shape,i=e.context.canExecute;e.isTouch||i&&(t.hints&&!1===t.hints.createElementsBehavior||s(n))})),e.on("autoPlace.end",500,(function(e){s(e.shape)}))}function mu(e){return(0,$t.is)(e,"bpmn:SubProcess")&&!(0,Ni.ul)(e)}fu.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],fu.prototype.activate=function(e){var t=(0,Ci.id)(e);if(void 0!==t){var n={text:t},i=this.getEditingBBox(e);(0,a.f0)(n,i);var r={};return((0,$t.JZ)(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||mu(e))&&(0,a.f0)(r,{centerVertically:!0}),(0,Ci.ly)(e)&&(0,a.f0)(r,{autoResize:!0}),(0,$t.is)(e,"bpmn:TextAnnotation")&&(0,a.f0)(r,{resizable:!0,autoResize:!0}),(0,a.f0)(n,{options:r}),n}},fu.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,s={x:i.x,y:i.y},c=t.zoom(),p=this._textRenderer.getDefaultStyle(),l=this._textRenderer.getExternalStyle(),u=l.fontSize*c,h=l.lineHeight,d=p.fontSize*c,f=p.lineHeight,m={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if((0,$t.is)(e,"bpmn:Lane")||function(e){return(0,$t.is)(e,"bpmn:Participant")&&(0,Ni.ul)(e)}(e)){var v=(0,Ni.wE)(e),g=v?{width:i.height,height:30*c,x:i.x-i.height/2+15*c,y:o-30*c/2}:{width:i.width,height:30*c};(0,a.f0)(s,g),(0,a.f0)(m,{fontSize:d+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px",transform:v?"rotate(-90deg)":null})}if(function(e){return(0,$t.is)(e,"bpmn:Participant")&&!(0,Ni.ul)(e)}(e)){var y=(0,Ni.wE)(e),b=y?{width:i.width,height:i.height}:{width:i.height,height:i.width,x:r-i.height/2,y:o-i.width/2};(0,a.f0)(s,b),(0,a.f0)(m,{fontSize:d+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px",transform:y?null:"rotate(-90deg)"})}((0,$t.JZ)(e,["bpmn:Task","bpmn:CallActivity"])||mu(e))&&((0,a.f0)(s,{width:i.width,height:i.height}),(0,a.f0)(m,{fontSize:d+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"})),function(e){return(0,$t.is)(e,"bpmn:SubProcess")&&(0,Ni.ul)(e)}(e)&&((0,a.f0)(s,{width:i.width,x:i.x}),(0,a.f0)(m,{fontSize:d+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"}));var _=90*c,x=7*c,E=4*c;if(n.labelTarget&&((0,a.f0)(s,{width:_,height:i.height+x+E,x:r-_/2,y:i.y-x}),(0,a.f0)(m,{fontSize:u+"px",lineHeight:h,paddingTop:x+"px",paddingBottom:E+"px"})),(0,Ci.ly)(n)&&!(0,Ci.fF)(n)&&!(0,K.j_)(n)){var w=(0,Ci.qe)(e),S=t.getAbsoluteBBox({x:w.x,y:w.y,width:0,height:0}),k=u+x+E;(0,a.f0)(s,{width:_,height:k,x:S.x-_/2,y:S.y-k/2}),(0,a.f0)(m,{fontSize:u+"px",lineHeight:h,paddingTop:x+"px",paddingBottom:E+"px"})}return(0,$t.is)(e,"bpmn:TextAnnotation")&&((0,a.f0)(s,{width:i.width,height:i.height,minWidth:30*c,minHeight:10*c}),(0,a.f0)(m,{textAlign:"left",paddingTop:5*c+"px",paddingBottom:7*c+"px",paddingLeft:7*c+"px",paddingRight:5*c+"px",fontSize:d+"px",lineHeight:f})),{bounds:s,style:m}},fu.prototype.update=function(e,t,n,i){var r,o,a;(0,$t.is)(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),(a=t)&&a.trim()||(t=null),this._modeling.updateLabel(e,t,r)};var vu="djs-element-hidden",gu="djs-label-hidden";function yu(e,t,n){var i,r,o,a=this,s=t.getDefaultLayer();e.on("directEditing.activate",(function(e){var c=e.active;if(i=c.element.label||c.element,(0,$t.is)(i,"bpmn:TextAnnotation")){r=t.getAbsoluteBBox(i),o=(0,O.Ue)("g");var p=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i.width,containerHeight:i.height,position:{mx:0,my:0}}),l=a.path=(0,O.Ue)("path");(0,O.Lj)(l,{d:p,strokeWidth:2,stroke:bu(i)}),(0,O.R3)(o,l),(0,O.R3)(s,o),(0,hn.Iu)(o,i.x,i.y)}(0,$t.is)(i,"bpmn:TextAnnotation")||i.labelTarget?t.addMarker(i,vu):((0,$t.is)(i,"bpmn:Task")||(0,$t.is)(i,"bpmn:CallActivity")||(0,$t.is)(i,"bpmn:SubProcess")||(0,$t.is)(i,"bpmn:Participant"))&&t.addMarker(i,gu)})),e.on("directEditing.resize",(function(e){if((0,$t.is)(i,"bpmn:TextAnnotation")){var t=e.height,o=e.dy,s=Math.max(i.height/r.height*(t+o),0),c=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i.width,containerHeight:s,position:{mx:0,my:0}});(0,O.Lj)(a.path,{d:c})}})),e.on(["directEditing.complete","directEditing.cancel"],(function(e){var n=e.active;n&&(t.removeMarker(n.element.label||n.element,vu),t.removeMarker(i,gu)),i=void 0,r=void 0,o&&((0,O.Od)(o),o=void 0)}))}function bu(e,t){return(0,$t.DN)(e).get("stroke")||t||"black"}yu.$inject=["eventBus","canvas","pathMap"];const _u={__depends__:[Fs.Z,du,Kp],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",fu],labelEditingPreview:["type",yu]};var xu=new(n(237).Z)("tt");function Eu(e,t){e.style.display=!1===t?"none":""}var wu="djs-tooltip",Su="."+wu;function ku(e,t){var n,i;this._eventBus=e,this._canvas=t,this._ids=xu,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=t.getContainer(),i=(0,s.H6)('
      '),(0,s.i5)(i,{position:"absolute",width:"0",height:"0"}),n.insertBefore(i,n.firstChild),i);var r=this;s.cl.bind(this._tooltipRoot,Su,"mousedown",(function(e){e.stopPropagation()})),s.cl.bind(this._tooltipRoot,Su,"mouseover",(function(e){r.trigger("mouseover",e)})),s.cl.bind(this._tooltipRoot,Su,"mouseout",(function(e){r.trigger("mouseout",e)})),this._init()}ku.$inject=["eventBus","canvas"],ku.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=(0,a.f0)({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},ku.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get((0,s.Lj)(n,"data-tooltip-id"));i&&("mouseover"===e&&i.timeout&&this.clearTimeout(i),"mouseout"===e&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},ku.prototype.get=function(e){return"string"!=typeof e&&(e=e.id),this._tooltips[e]},ku.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},ku.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout((function(){t.remove(e)}),e.timeout)}},ku.prototype.remove=function(e){var t=this.get(e);t&&((0,s.Od)(t.html),(0,s.Od)(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},ku.prototype.show=function(){Eu(this._tooltipRoot)},ku.prototype.hide=function(){Eu(this._tooltipRoot,!1)},ku.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},ku.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),(0,a.HD)(i)&&(i=(0,s.H6)(i)),t=(0,s.H6)('
      '),(0,s.i5)(t,{position:"absolute"}),t.appendChild(i),e.type&&(0,s.Sh)(t).add("djs-tooltip-"+e.type),e.className&&(0,s.Sh)(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},ku.prototype._updateTooltip=function(e){var t=e.position;!function(e,t,n){(0,s.i5)(e,{left:t+"px",top:n+"px"})}(e.htmlContainer,t.x,t.y)},ku.prototype._updateTooltipVisibilty=function(e){(0,a.Ed)(this._tooltips,(function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom"+r+"
      "}))}))}Ru.$inject=["eventBus","tooltips","translate"];const Au={__depends__:[Cu],__init__:["modelingFeedback"],modelingFeedback:["type",Ru]};var Pu=n(797),Tu=Math.round;function Mu(e,t,n,i,r){function o(e,t,n,i){return r.allowed("elements.move",{shapes:e,delta:t,position:n,target:i})}function s(e,n,i,r){if((0,a.Kn)(i)&&(r=i,i=!1),!n.waypoints&&n.parent&&!(0,O.Sh)(e.target).has("djs-hit-no-move")){var o=function(e){return{x:e.x+Tu(e.width/2),y:e.y+Tu(e.height/2)}}(n);return t.init(e,o,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:r||{}}}),!0}}e.on("shape.move.start",1500,(function(e){var t=e.context,n=e.shape,r=i.get().slice();-1===r.indexOf(n)&&(r=[n]),r=function(e){var t=(0,a.vM)(e,"id");return(0,a.hX)(e,(function(e){for(;e=e.parent;)if(t[e.id])return!1;return!0}))}(r),(0,a.f0)(t,{shapes:r,validatedShapes:r,shape:n})})),e.on("shape.move.start",1250,(function(e){var t=e.context,n=t.validatedShapes;if(!(t.canExecute=o(n)))return!1})),e.on("shape.move.move",500,(function(e){var t,n=e.context,i=n.validatedShapes,r=e.hover,a={x:e.dx,y:e.dy};t=o(i,a,{x:e.x,y:e.y},r),n.delta=a,n.canExecute=t,n.target=null!==t?r:null})),e.on("shape.move.end",(function(e){var t=e.context,i=t.delta,r=t.canExecute,o="attach"===r,a=t.shapes;if(!1===r)return!1;i.x=Tu(i.x),i.y=Tu(i.y),0===i.x&&0===i.y||n.moveElements(a,i,t.target,{primaryShape:t.shape,attach:o})})),e.on("element.mousedown",(function(e){if((0,Pn.Id)(e)){var t=(0,T.Ku)(e);if(!t)throw new Error("must supply DOM mousedown event");return s(t,e.element)}})),this.start=s}Mu.$inject=["eventBus","dragging","modeling","selection","rules"];var Du="djs-dragging",Bu="drop-ok",ju="drop-not-ok",Nu="new-parent",Ou="attach-ok";function Lu(e,t,n,i){function r(e){var t=(0,V.PB)(e,!0),n=(0,a.UI)(t,(function(e){return(e.incoming||[]).concat(e.outgoing||[])}));return(0,a.xH)(t.concat(n))}function o(e,n){[Ou,Bu,ju,Nu].forEach((function(i){i===n?t.addMarker(e,i):t.removeMarker(e,i)}))}e.on("shape.move.start",499,(function(e){var o,s=e.context,c=s.shapes,p=s.allDraggedElements,l=function(e){var t;return t=r(e),(0,a.hX)(t,(function(e){return!(0,K.Ho)(e)||(0,a.sE)(t,(0,a.KQ)({id:e.source.id}))&&(0,a.sE)(t,(0,a.KQ)({id:e.target.id}))}))}(c);if(!s.dragGroup){var u=(0,O.Ue)("g");(0,O.Lj)(u,n.cls("djs-drag-group",["no-events"]));var h=t.getActiveLayer();(0,O.R3)(h,u),s.dragGroup=u}l.forEach((function(e){i.addDragger(e,s.dragGroup)})),p=p?(0,a.xH)([p,r(c)]):r(c),(0,a.Ed)(p,(function(e){t.addMarker(e,Du)})),s.allDraggedElements=p,s.differentParents=(o=c,1!==(0,a.dp)((0,a.vM)(o,(function(e){return e.parent&&e.parent.id}))))})),e.on("shape.move.move",499,(function(e){var t=e.context,n=t.dragGroup,i=t.target,r=t.shape.parent,a=t.canExecute;i&&("attach"===a?o(i,Ou):t.canExecute&&i&&i.id!==r.id?o(i,Nu):o(i,t.canExecute?Bu:ju)),(0,hn.Iu)(n,e.dx,e.dy)})),e.on(["shape.move.out","shape.move.cleanup"],(function(e){var t=e.context.target;t&&o(t,null)})),e.on("shape.move.cleanup",(function(e){var n=e.context,i=n.allDraggedElements,r=n.dragGroup;(0,a.Ed)(i,(function(e){t.removeMarker(e,Du)})),r&&(0,O.Od)(r)})),this.makeDraggable=function(e,n,r){i.addDragger(n,e.dragGroup),r&&t.addMarker(n,Du),e.allDraggedElements?e.allDraggedElements.push(n):e.allDraggedElements=[n]}}Lu.$inject=["eventBus","canvas","styles","previewSupport"];const Iu={__depends__:[R.Z,Xt.Z,Pu.Z,ln,an,Ei],__init__:["move","movePreview"],move:["type",Mu],movePreview:["type",Lu]},$u={width:36,height:50},zu={width:50,height:50};function Fu(e,t,n){return(0,O.Ue)("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}function Hu(e,t){this._styles=t,e.registerProvider(this)}function Zu(e,t){var n;return"bpmn:DataObjectReference"===t?n=$u:"bpmn:DataStoreReference"===t&&(n=zu),e.width===n.width&&e.height===n.height}Hu.$inject=["outline","styles"],Hu.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!(0,K.j_)(e))return(0,$t.is)(e,"bpmn:Gateway")?(n=(0,O.Ue)("rect"),(0,a.f0)(n.style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),(0,O.Lj)(n,(0,a.f0)({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):(0,$t.JZ)(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group"])?(n=(0,O.Ue)("rect"),(0,O.Lj)(n,(0,a.f0)({x:-5,y:-5,rx:14,width:e.width+10,height:e.height+10},t))):(0,$t.is)(e,"bpmn:EndEvent")?(n=(0,O.Ue)("circle"),(0,O.Lj)(n,(0,a.f0)({cx:e.width/2,cy:e.height/2,r:e.width/2+5+1},t))):(0,$t.is)(e,"bpmn:Event")?(n=(0,O.Ue)("circle"),(0,O.Lj)(n,(0,a.f0)({cx:e.width/2,cy:e.height/2,r:e.width/2+5},t))):(0,$t.is)(e,"bpmn:DataObjectReference")&&Zu(e,"bpmn:DataObjectReference")?n=Fu("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):(0,$t.is)(e,"bpmn:DataStoreReference")&&Zu(e,"bpmn:DataStoreReference")&&(n=Fu("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},Hu.prototype.updateOutline=function(e,t){if(!(0,K.j_)(e))return(0,$t.JZ)(e,["bpmn:SubProcess","bpmn:Group"])?((0,O.Lj)(t,{width:e.width+10,height:e.height+10}),!0):!!(0,$t.JZ)(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};const Wu={__depends__:[Pu.Z],__init__:["outlineProvider"],outlineProvider:["type",Hu]};var Uu=".djs-palette-toggle",Vu=".entry",Gu=Uu+", "+Vu,Ku="djs-palette-",Ju="open",qu="two-column";function Xu(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",(function(e){var t=e.tool;n.updateToolHighlight(t)})),e.on("i18n.changed",(function(){n._update()})),e.on("diagram.init",(function(){n._diagramInitialized=!0,n._rebuild()}))}function Yu(e,t){var n=t.getPaletteEntries();return(0,a.mf)(n)?n(e):((0,a.Ed)(n,(function(t,n){e[n]=t})),e)}Xu.$inject=["eventBus","canvas"],Xu.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,(function(e){e.providers.push(t)})),this._rebuild()},Xu.prototype.getEntries=function(){return this._getProviders().reduce(Yu,{})},Xu.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},Xu.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=(0,s.H6)(Xu.HTML_MARKUP);n.appendChild(i),(0,s.Sh)(n).add(Ku+"shown"),s.cl.bind(i,Gu,"click",(function(t){var n=t.delegateTarget;if((0,s.wB)(n,Uu))return e.toggle();e.trigger("click",t)})),s.B.bind(i,"mousedown",(function(e){e.stopPropagation()})),s.cl.bind(i,Vu,"dragstart",(function(t){e.trigger("dragstart",t)})),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},Xu.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},Xu.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=(0,s.Sh)(i),a=(0,s.Sh)(n);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle(qu,t),a.toggle(Ku+qu,t),"open"in e&&(o.toggle(Ju,e.open),a.toggle(Ku+Ju,e.open)),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},Xu.prototype._update=function(){var e=(0,s.IO)(".djs-palette-entries",this._container),t=this._entries=this.getEntries();(0,s.ZH)(e),(0,a.Ed)(t,(function(t,n){var i=t.group||"default",r=(0,s.IO)("[data-group="+(0,G.D)(i)+"]",e);r||(r=(0,s.H6)('
      '),(0,s.Lj)(r,"data-group",i),e.appendChild(r));var o,c,p,l=t.html||(t.separator?'
      ':'
      '),u=(0,s.H6)(l);if(r.appendChild(u),!t.separator&&((0,s.Lj)(u,"data-action",n),t.title&&(0,s.Lj)(u,"title",t.title),t.className&&(o=u,c=t.className,p=(0,s.Sh)(o),((0,a.kJ)(c)?c:c.split(/\s+/g)).forEach((function(e){p.add(e)}))),t.imageUrl)){var h=(0,s.H6)("");(0,s.Lj)(h,"src",t.imageUrl),u.appendChild(h)}})),this.open()},Xu.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=(0,s.Lj)(o,"data-action"),r=t.originalEvent||t,this.triggerEntry(i,e,r,n)):t.preventDefault()},Xu.prototype.triggerEntry=function(e,t,n,i){var r,o;if((r=this._entries[e])&&(o=r.action,!1!==this._eventBus.fire("palette.trigger",{entry:r,event:n}))){if((0,a.mf)(o)){if("click"===t)return o(n,i)}else if(o[t])return o[t](n,i);n.preventDefault()}},Xu.prototype._layoutChanged=function(){this._toggleState({})},Xu.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},Xu.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},Xu.prototype.open=function(){this._toggleState({open:!0})},Xu.prototype.toggle=function(){this.isOpen()?this.close():this.open()},Xu.prototype.isActiveTool=function(e){return e&&this._activeTool===e},Xu.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=(0,s.IO)(".djs-palette-entries",this._container),this._toolsContainer=(0,s.IO)("[data-group=tools]",t)),n=this._toolsContainer,(0,a.Ed)(n.children,(function(t){var n=t.getAttribute("data-action");if(n){var i=(0,s.Sh)(t);n=n.replace("-tool",""),i.contains("entry")&&n===e?i.add("highlighted-entry"):i.remove("highlighted-entry")}}))},Xu.prototype.isOpen=function(){return(0,s.Sh)(this._container).has(Ju)},Xu.prototype._getParentContainer=function(){return this._canvas.getContainer()},Xu.HTML_MARKUP='
      ';const Qu={__init__:["palette"],palette:["type",Xu]};var eh="crosshair";function th(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this;o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",(function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("lasso.selection.ended",(function(){s.activateLasso(t.originalEvent,!0)}))})),e.on("lasso.end",(function(e){var t=nh(e),n=i.filter((function(e){return e}));s.select(n,t)})),e.on("lasso.start",(function(e){var n=e.context;n.bbox=nh(e),function(e){var n,i=t.getActiveLayer();n=e.frame=(0,O.Ue)("rect"),(0,O.Lj)(n,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),(0,O.R3)(i,n)}(n)})),e.on("lasso.move",(function(e){var t=e.context;t.bbox=nh(e),function(e){var t=e.frame,n=e.bbox;(0,O.Lj)(t,{x:n.x,y:n.y,width:n.width,height:n.height})}(t)})),e.on("lasso.cleanup",(function(e){!function(e){e.frame&&(0,O.Od)(e.frame)}(e.context)})),e.on("element.mousedown",1500,(function(e){if((0,Pn.Dw)(e))return s.activateLasso(e.originalEvent),!0}))}function nh(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y=n.x&&t.yn.x&&t.y<=n.y?{x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x=n.y?{x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}th.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],th.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:eh,data:{context:{}}})},th.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:eh,data:{context:{}}})},th.prototype.select=function(e,t){var n=(0,V.RH)(e,t);this._selection.select((0,a.VO)(n))},th.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},th.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};const ih={__depends__:[us,Wa],__init__:["lassoTool"],lassoTool:["type",th]};var rh=1500,oh="grab";function ah(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,s=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",rh,(function(e){if((0,Pn.RJ)(e))return a.activateMove(e.originalEvent,!0),!1})),s&&s.addListener(rh,(function(e){if(sh(e.keyEvent)&&!a.isActive()){var t=a._mouse.getLastMoveEvent();a.activateMove(t,!!t)}}),"keyboard.keydown"),s&&s.addListener(rh,(function(e){sh(e.keyEvent)&&a.isActive()&&a.toggle()}),"keyboard.keyup"),e.on("hand.end",(function(t){var n=t.originalEvent.target;if(!(t.hover||n instanceof SVGElement))return!1;e.once("hand.ended",(function(){a.activateMove(t.originalEvent,{reactivate:!0})}))})),e.on("hand.move.move",(function(e){var n=t.viewbox().scale;t.scroll({dx:e.dx*n,dy:e.dy*n})})),e.on("hand.move.end",(function(t){var n=t.context.reactivate;return!(0,Pn.RJ)(t)&&n&&e.once("hand.move.ended",(function(e){a.activateHand(e.originalEvent,!0,!0)})),!1}))}function sh(e){return d("Space",e)}ah.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],ah.prototype.activateMove=function(e,t,n){"object"==typeof t&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:oh,data:{context:n||{}}})},ah.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:oh,data:{context:{reactivate:n}}})},ah.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},ah.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};const ch={__depends__:[us,Wa],__init__:["handTool"],handTool:["type",ah]};var ph="connect-ok",lh="connect-not-ok";function uh(e,t,n,i,r,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",(function(e){var t=e.context,n=e.hover,r=t.canStartConnect=s.canStartConnect(n);null!==r&&(t.startTarget=n,i.addMarker(n,r?ph:lh))})),e.on(["global-connect.out","global-connect.cleanup"],(function(e){var t=e.context.startTarget,n=e.context.canStartConnect;t&&i.removeMarker(t,n?ph:lh)})),e.on(["global-connect.ended"],(function(t){var i=t.context.startTarget,r={x:t.x,y:t.y};if(s.canStartConnect(i))return e.once("element.out",(function(){e.once(["connect.ended","connect.canceled"],(function(){e.fire("global-connect.drag.ended")})),n.start(null,i,r)})),!1}))}uh.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],uh.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},uh.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},uh.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},uh.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};const hh={__depends__:[fi,ln,an,us,Wa],globalConnect:["type",uh]};function dh(e,t,n,i,r,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}dh.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],dh.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,i=this._spaceTool,r=this._lassoTool,o=this._handTool,s=this._globalConnect,c=this._translate;function p(e,i,r,o,s){function c(i){var r=n.createShape((0,a.f0)({type:e},s));t.start(i,r)}return{group:i,className:r,title:o,action:{dragstart:c,click:c}}}function l(e){var i=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),r=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:i});t.start(e,[i,r],{hints:{autoSelect:[i]}})}function u(e){t.start(e,n.createParticipantShape())}return(0,a.f0)(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:c("Activate hand tool"),action:{click:function(e){o.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:c("Activate lasso tool"),action:{click:function(e){r.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:c("Activate create/remove space tool"),action:{click:function(e){i.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:c("Activate global connect tool"),action:{click:function(e){s.start(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":p("bpmn:StartEvent","event","bpmn-icon-start-event-none",c("Create start event")),"create.intermediate-event":p("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",c("Create intermediate/boundary event")),"create.end-event":p("bpmn:EndEvent","event","bpmn-icon-end-event-none",c("Create end event")),"create.exclusive-gateway":p("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",c("Create gateway"),{isMarkerVisible:!0}),"create.task":p("bpmn:Task","activity","bpmn-icon-task",c("Create task")),"create.data-object":p("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",c("Create data object reference")),"create.data-store":p("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",c("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:c("Create expanded sub-process"),action:{dragstart:l,click:l}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:c("Create pool/participant"),action:{dragstart:u,click:u}},"create.group":p("bpmn:Group","artifact","bpmn-icon-group",c("Create group"))}),e};const fh={__depends__:[Qu,Ha,Ts,ih,ch,hh,Ra.Z],__init__:["paletteProvider"],paletteProvider:["type",dh]};function mh(e,t,n,i,r){wt.Z.call(this,e),e.on("shape.move.move",250,(function(e){var o=e.context,c=o.canExecute;o.visualReplacements||(o.visualReplacements={}),c&&c.replacements?function(e){var o=e.canExecute.replacements;(0,a.Ed)(o,(function(o){var c=o.oldElementId,p={type:o.newElementType};if(!e.visualReplacements[c]){var l=t.get(c);(0,a.f0)(p,{x:l.x,y:l.y});var u=n.createShape(p);i.addShape(u,l.parent);var h=(0,s.IO)('[data-element-id="'+(0,G.D)(l.id)+'"]',e.dragGroup);h&&(0,O.Lj)(h,{display:"none"});var d=r.addDragger(u,e.dragGroup);e.visualReplacements[c]=d,i.removeShape(u)}}))}(o):function(e){var t=e.visualReplacements;(0,a.Ed)(t,(function(n,i){var r=(0,s.IO)('[data-element-id="'+(0,G.D)(i)+'"]',e.dragGroup);r&&(0,O.Lj)(r,{display:"inline"}),n.remove(),t[i]&&delete t[i]}))}(o)}))}mh.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],(0,e.Z)(mh,wt.Z);const vh={__depends__:[Ei],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",mh]};var gh=["x","y"],yh=Math.abs;function bh(e){e.on(["connect.hover","connect.move","connect.end"],1250,(function(e){var t,n,i=e.context,r=i.canExecute,o=i.start,s=i.hover,c=i.source,p=i.target;e.originalEvent&&h(e.originalEvent)||(i.initialConnectionStart||(i.initialConnectionStart=i.connectionStart),r&&s&&function(e,t,n){gh.forEach((function(i){var r=Eh(i,t);e[i]t[i]+r-n&&ii(e,i,t[i]+r-n)}))}(e,s,function(e){return(0,$t.is)(e,"bpmn:Task")?10:20}(s)),s&&(t=r,n=["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"],(0,a.G)(n,(function(e){return xh(t,e)})))?(i.connectionStart=ti(o),(0,$t.JZ)(s,["bpmn:Event","bpmn:Gateway"])&&_h(e,ti(s)),(0,$t.JZ)(s,["bpmn:Task","bpmn:SubProcess"])&&function(e,t){var n=ti(t);gh.forEach((function(i){(function(e,t,n){return e[n]>t[n]+20&&e[n]r[t]?r[t]+40:r[t]-40,ii(e,t,n))}))}}(e)):xh(r,"bpmn:MessageFlow")?((0,$t.is)(o,"bpmn:Event")&&(i.connectionStart=ti(o)),(0,$t.is)(s,"bpmn:Event")&&_h(e,ti(s))):i.connectionStart=i.initialConnectionStart)}))}function _h(e,t){ii(e,"x",t.x),ii(e,"y",t.y)}function xh(e,t){return e&&e.type===t}function Eh(e,t){return"x"===e?t.width:t.height}function wh(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function Sh(){this._snapValues={}}bh.$inject=["eventBus"],wh.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},wh.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,-1===this._snapLocations.indexOf(e)&&this._snapLocations.push(e)},wh.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},wh.prototype.getSnapLocations=function(){return this._snapLocations},wh.prototype.setSnapLocations=function(e){this._snapLocations=e},wh.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new Sh).initDefaults(this._defaultSnaps),n},Sh.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),-1===n.x.indexOf(t.x)&&n.x.push(t.x),-1===n.y.indexOf(t.y)&&n.y.push(t.y)},Sh.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&function(e,t,n){var i,r;for(n=void 0===n?10:n,i=0;i=e.x||i&&i<=e.x)&&ii(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&ii(e,"y",e.y)}}function Ph(e,t){return-1!==e.indexOf(t)}function Th(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}function Mh(e,t){var n=this;e.on(["resize.start"],(function(e){n.initSnap(e)})),e.on(["resize.move","resize.end"],1250,(function(e){var i=e.context,r=i.shape,o=r.parent,a=i.direction,s=i.snapContext;if(!(e.originalEvent&&h(e.originalEvent)||ni(e))){var c=s.pointsForTarget(o);c.initialized||((c=n.addSnapTargetPoints(c,r,o,a)).initialized=!0),function(e){return"n"===e||"s"===e}(a)&&ii(e,"x",e.x),function(e){return"e"===e||"w"===e}(a)&&ii(e,"y",e.y),t.snap(e,c)}})),e.on(["resize.cleanup"],(function(){t.hide()}))}function Dh(e,t){var n=(0,Rt.wS)(e),i=(0,Rt.JA)(e),r={x:n.x,y:n.y};return-1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}function Bh(e){this._canvas=e,this._asyncHide=(0,a.Ds)((0,a.ak)(this.hide,this),1e3)}Ch.$inject=["elementRegistry","eventBus","snapping"],Ch.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new wh);var a=(t=n.get(r.id)?ti(r,e):{x:e.x+ti(r).x,y:e.y+ti(r).y}).x-r.width/2,s=t.y-r.height/2,c=t.x+r.width/2,p=t.y+r.height/2;return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),(0,K.j_)(r)||(o.setSnapOrigin("top-left",{x:a-e.x,y:s-e.y}),o.setSnapOrigin("bottom-right",{x:c-e.x,y:p-e.y})),o},Ch.prototype.addSnapTargetPoints=function(e,t,n){var i=this.getSnapTargets(t,n);return(0,a.Ed)(i,(function(n){if((0,K.j_)(n))(0,K.j_)(t)&&e.add("mid",ti(n));else if((0,K.Ho)(n)){if(n.waypoints.length<3)return;var i=n.waypoints.slice(1,-1);(0,a.Ed)(i,(function(t){e.add("mid",t)}))}else e.add("mid",ti(n))})),(0,a.hj)(t.x)&&(0,a.hj)(t.y)?(this._elementRegistry.get(t.id)&&e.add("mid",ti(t)),e):e},Ch.prototype.getSnapTargets=function(e,t){return ri(t).filter((function(e){return!e.hidden}))},(0,e.Z)(Rh,Ch),Rh.$inject=["eventBus","injector"],Rh.prototype.initSnap=function(e){var t=Ch.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return(0,a.Ed)(n.outgoing,(function(n){var r=n.waypoints[0];r=r.original||r,t.setSnapOrigin(n.id+"-docking",Th(r,i,e))})),(0,a.Ed)(n.incoming,(function(n){var r=n.waypoints[n.waypoints.length-1];r=r.original||r,t.setSnapOrigin(n.id+"-docking",Th(r,i,e))})),(0,$t.is)(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},Rh.prototype.addSnapTargetPoints=function(e,t,n){Ch.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);(0,a.Ed)(i,(function(n){var i;i=n,((0,$t.is)(i,"bpmn:SubProcess")&&(0,Ni.ul)(i)||(0,$t.is)(i,"bpmn:Participant")||("bpmn:TextAnnotation",[t,n].every((function(e){return(0,$t.is)(e,"bpmn:TextAnnotation")}))))&&(e.add("top-left",Qn(n)),e.add("bottom-right",ei(n)))}));var r=this._elementRegistry;return(0,a.Ed)(t.incoming,(function(n){if(r.get(t.id)){Ph(i,n.source)||e.add("mid",(0,Rt.wS)(n.source));var o=n.waypoints[0];e.add(n.id+"-docking",o.original||o)}})),(0,a.Ed)(t.outgoing,(function(n){if(r.get(t.id)){Ph(i,n.target)||e.add("mid",(0,Rt.wS)(n.target));var o=n.waypoints[n.waypoints.length-1];e.add(n.id+"-docking",o.original||o)}})),(0,$t.is)(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},Rh.prototype.getSnapTargets=function(e,t){return Ch.prototype.getSnapTargets.call(this,e,t).filter((function(e){return!(0,$t.is)(e,"bpmn:Lane")}))},Mh.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new wh);var o=Dh(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},Mh.prototype.addSnapTargetPoints=function(e,t,n,i){var r=this.getSnapTargets(t,n);return(0,a.Ed)(r,(function(t){e.add("corner",ei(t)),e.add("corner",Qn(t))})),e.add("corner",Dh(t,i)),e},Mh.$inject=["eventBus","snapping"],Mh.prototype.getSnapTargets=function(e,t){return ri(t).filter((function(t){return n=e,!(t.host===n||(0,K.Ho)(t)||function(e){return!!e.hidden}(t)||(0,K.j_)(t));var n}))},Bh.$inject=["canvas"],Bh.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:ni(e,"x"),y:ni(e,"y")};(0,a.Ed)(i,(function(i){var o=n.getSnapOrigin(i),s={x:e.x+o.x,y:e.y+o.y};if((0,a.Ed)(["x","y"],(function(e){var n;r[e]||void 0!==(n=t.snap(s,i,e,7))&&(r[e]={value:n,originValue:n-o[e]})})),r.x&&r.y)return!1})),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),(0,a.Ed)(["x","y"],(function(t){var n=r[t];(0,a.Kn)(n)&&ii(e,t,n.originValue)}))},Bh.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=(0,O.Ue)("path");return(0,O.Lj)(n,{d:"M0,0 L0,0"}),(0,O.Sh)(n).add("djs-snap-line"),(0,O.R3)(t,n),{update:function(t){(0,a.hj)(t)?"horizontal"===e?(0,O.Lj)(n,{d:"M-100000,"+t+" L+100000,"+t,display:""}):(0,O.Lj)(n,{d:"M "+t+",-100000 L "+t+", +100000",display:""}):(0,O.Lj)(n,{display:"none"})}}},Bh.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Bh.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},Bh.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},Bh.prototype.hide=function(){(0,a.Ed)(this._snapLines,(function(e){e.update()}))};const jh={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Ch],resizeSnapping:["type",Mh],snapping:["type",Bh]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",bh],createMoveSnapping:["type",Rh]};function Nh(e,t,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=e,this._eventBus=t,this._overlays=n,this._selection=i,this._container=(0,s.H6)(Nh.BOX_HTML),this._searchInput=(0,s.IO)(Nh.INPUT_SELECTOR,this._container),this._resultsContainer=(0,s.IO)(Nh.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}function Oh(e,t,n){var i=function(e){var t="";return e.forEach((function(e){e.matched?t+=''+(0,G.r)(e.matched)+"":t+=(0,G.r)(e.normal)})),""!==t?t:null}(t),r=(0,s.H6)(n);r.innerHTML=i,e.appendChild(r)}Nh.$inject=["canvas","eventBus","overlays","selection"],Nh.prototype._bindEvents=function(){var e=this;function t(t,n,i,r){e._eventMaps.push({el:t,type:i,listener:s.cl.bind(t,n,i,r)})}t(document,"html","click",(function(t){e.close()})),t(this._container,Nh.INPUT_SELECTOR,"click",(function(e){e.stopPropagation(),e.delegateTarget.focus()})),t(this._container,Nh.RESULT_SELECTOR,"mouseover",(function(t){t.stopPropagation(),e._scrollToNode(t.delegateTarget),e._preselect(t.delegateTarget)})),t(this._container,Nh.RESULT_SELECTOR,"click",(function(t){t.stopPropagation(),e._select(t.delegateTarget)})),t(this._container,Nh.INPUT_SELECTOR,"keydown",(function(e){d("ArrowUp",e)&&e.preventDefault(),d("ArrowDown",e)&&e.preventDefault()})),t(this._container,Nh.INPUT_SELECTOR,"keyup",(function(t){if(d("Escape",t))return e.close();if(d("Enter",t)){var n=e._getCurrentResult();return n?e._select(n):e.close()}return d("ArrowUp",t)?e._scrollToDirection(!0):d("ArrowDown",t)?e._scrollToDirection():void(d(["ArrowLeft","ArrowRight"],t)||e._search(t.delegateTarget.value))}))},Nh.prototype._unbindEvents=function(){this._eventMaps.forEach((function(e){s.cl.unbind(e.el,e.type,e.listener)}))},Nh.prototype._search=function(e){var t=this;if(this._clearResults(),e&&""!==e){var n=this._searchProvider.find(e);if(n.length){n.forEach((function(e){var n=e.element.id,i=t._createResultNode(e,n);t._results[n]={element:e.element,node:i}}));var i=(0,s.IO)(Nh.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},Nh.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},Nh.prototype._scrollToNode=function(e){if(e&&e!==this._getCurrentResult()){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t0&&Oh(n,e.primaryTokens,Nh.RESULT_PRIMARY_HTML),Oh(n,e.secondaryTokens,Nh.RESULT_SECONDARY_HTML),(0,s.Lj)(n,Nh.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},Nh.prototype.registerProvider=function(e){this._searchProvider=e},Nh.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,(0,s.Sh)(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},Nh.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,(0,s.Sh)(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},Nh.prototype.toggle=function(){this.isOpen()?this.close():this.open()},Nh.prototype.isOpen=function(){return this._open},Nh.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&(0,s.Sh)(t).remove(Nh.RESULT_SELECTED_CLASS);var n=(0,s.Lj)(e,Nh.RESULT_ID_ATTRIBUTE),i=this._results[n].element;(0,s.Sh)(e).add(Nh.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},Nh.prototype._select=function(e){var t=(0,s.Lj)(e,Nh.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},Nh.prototype._resetOverlay=function(e){if(this._overlayId&&this._overlays.remove(this._overlayId),e){var t=function(e){var t=e.width+12,n=e.height+12,i={width:t+"px",height:n+"px"},r=(0,s.H6)('
      ');return(0,s.i5)(r,i),{position:{bottom:n-6,right:t-6},show:!0,html:r}}((0,V.jY)(e));this._overlayId=this._overlays.add(e,t)}},Nh.CONTAINER_SELECTOR=".djs-search-container",Nh.INPUT_SELECTOR=".djs-search-input input",Nh.RESULTS_CONTAINER_SELECTOR=".djs-search-results",Nh.RESULT_SELECTOR=".djs-search-result",Nh.RESULT_SELECTED_CLASS="djs-search-result-selected",Nh.RESULT_SELECTED_SELECTOR="."+Nh.RESULT_SELECTED_CLASS,Nh.RESULT_ID_ATTRIBUTE="data-result-id",Nh.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",Nh.OVERLAY_CLASS="djs-search-overlay",Nh.BOX_HTML='
      ',Nh.RESULT_HTML='
      ',Nh.RESULT_PRIMARY_HTML='
      ',Nh.RESULT_SECONDARY_HTML='

      ';const Lh={__depends__:[U.Z,Xt.Z],searchPad:["type",Nh]};function Ih(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function $h(e){return(0,a.hX)(e,(function(e){return!!e.matched})).length>0}function zh(e,t){var n=[],i=e;if(!e)return n;e=e.toLowerCase(),t=t.toLowerCase();var r=e.indexOf(t);return r>-1?(0!==r&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,t.length)}),t.length+r')},Hh.prototype._interactionModules=[w,S.Z,I,k.Z],Hh.prototype._modelingModules=[Ct,Zt,cn,Kt,ci,fi,gi,gl,es,Ha,kl,Ml,Ul,Gl,Jl,iu,_u,Ip,Au,Iu,Wu,fh,vh,du,jh,Fh],Hh.prototype._modules=[].concat(o.Z.prototype._modules,Hh.prototype._interactionModules,Hh.prototype._modelingModules);var Zh=n(472);class Wh extends Gs{constructor(e,t,n,i){super(e,t,n);const r=i.getDefaultSize;i.getDefaultSize=(e,t)=>(0,$t.is)(e,"bpmn:Participant")?{width:350,height:450}:r(e,t)}}Wh.$inject=["bpmnFactory","moddle","translate","elementFactory"];dh.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,i=this._spaceTool,r=this._lassoTool,o=this._handTool,s=this._globalConnect,c=this._translate;let p=this._palette;function l(e,i,r,o,s){function p(i){var r=n.createShape((0,a.f0)({type:e},s));s&&((0,$t.DN)(r).isExpanded=s.isExpanded),t.start(i,r)}var l=e.replace(/^bpmn:/,"");return{group:i,className:r,title:o||c("Create {type}",{type:l}),action:{dragstart:p,click:p}}}function u(e){let i=p._eventBus.createEvent({type:"commandStack.elements.create.canExecute",context:{shape:{type:"bpmn:Participant"},elements:[e]}});p._eventBus.fire(i)&&t.start(e,n.createParticipantShape())}return(0,a.f0)(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:c("Activate the hand tool"),action:{click:function(e){o.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:c("Activate the lasso tool"),action:{click:function(e){r.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:c("Activate the create/remove space tool"),action:{click:function(e){i.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:c("Activate the global connect tool"),action:{click:function(e){s.start(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":l("bpmn:StartEvent","event","bpmn-icon-start-event-none",c("Create Start Point")),"create.end-event":l("bpmn:EndEvent","event","bpmn-icon-end-event-none",c("Create End Point")),"create.exclusive-gateway":l("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",c("Create Desicion Point")),"create.task":l("bpmn:Task","activity","bpmn-icon-task",c("Create Step")),"create.data-object":l("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",c("Create Artifact")),"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:c("add Actor/Integration"),action:{dragstart:u,click:u}}}),e},fu.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=(i.y,i.height,{x:i.x,y:i.y}),s=t.zoom(),c=this._textRenderer.getDefaultStyle(),p=this._textRenderer.getExternalStyle(),l=p.fontSize*s,u=p.lineHeight,h=c.fontSize*s,d=c.lineHeight,f={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};((0,$t.is)(e,"bpmn:Lane")||function(e){return(0,$t.is)(e,"bpmn:Participant")&&(0,Ni.ul)(e)}(e))&&((0,a.f0)(o,{width:i.width,height:30*s}),(0,a.f0)(f,{fontSize:h+"px",lineHeight:d,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"})),((0,$t.JZ)(e,["bpmn:Task","bpmn:CallActivity"])||function(e){return(0,$t.is)(e,"bpmn:Participant")&&!(0,Ni.ul)(e)}(e)||function(e){return(0,$t.is)(e,"bpmn:SubProcess")&&!(0,Ni.ul)(e)}(e))&&((0,a.f0)(o,{width:i.width,height:i.height}),(0,a.f0)(f,{fontSize:h+"px",lineHeight:d,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"})),function(e){return(0,$t.is)(e,"bpmn:SubProcess")&&(0,Ni.ul)(e)}(e)&&((0,a.f0)(o,{width:i.width,x:i.x}),(0,a.f0)(f,{fontSize:h+"px",lineHeight:d,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"}));var m=90*s,v=7*s,g=4*s;if(n.labelTarget&&((0,a.f0)(o,{width:m,height:i.height+v+g,x:r-m/2,y:i.y-v}),(0,a.f0)(f,{fontSize:l+"px",lineHeight:u,paddingTop:v+"px",paddingBottom:g+"px"})),(0,Ci.ly)(n)&&!(0,Ci.fF)(n)&&!isLabel(n)){var y=(0,Ci.qe)(e),b=t.getAbsoluteBBox({x:y.x,y:y.y,width:0,height:0}),_=l+v+g;(0,a.f0)(o,{width:m,height:_,x:b.x-m/2,y:b.y-_/2}),(0,a.f0)(f,{fontSize:l+"px",lineHeight:u,paddingTop:v+"px",paddingBottom:g+"px"})}return(0,$t.is)(e,"bpmn:TextAnnotation")&&((0,a.f0)(o,{width:i.width,height:i.height,minWidth:30*s,minHeight:10*s}),(0,a.f0)(f,{textAlign:"left",paddingTop:5*s+"px",paddingBottom:7*s+"px",paddingLeft:7*s+"px",paddingRight:5*s+"px",fontSize:h+"px",lineHeight:d})),{bounds:o,style:f}},Vl.prototype._createParticipantHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.height,height:30}),!0};var Uh=n(717),Vh=n.n(Uh);function Gh(e,t){St.call(this,e),this.taskResizingEnabled=t||!1}function Kh(e,t){St.call(this,e),this.eventResizingEnabled=t||!1}Vh()(Gh,St),Gh.$inject=["eventBus","config.taskResizingEnabled"],Gh.prototype.init=function(){var e=this;e.addRule("shape.resize",1500,(function(t){if(e.taskResizingEnabled&&t.shape.businessObject&&(t.shape.businessObject.$instanceOf("bpmn:Task")||t.shape.businessObject.$instanceOf("bpmn:CallActivity")||t.shape.businessObject.$instanceOf("bpmn:SubProcess")))return t.newBounds&&(t.newBounds.width=Math.max(100,t.newBounds.width),t.newBounds.height=Math.max(80,t.newBounds.height)),!0}))},Vh()(Kh,St),Kh.$inject=["eventBus","config.eventResizingEnabled"],Kh.prototype.init=function(){var e=this;e.addRule("shape.resize",1500,(function(t){if(e.eventResizingEnabled&&t.shape.businessObject&&t.shape.businessObject.$instanceOf("bpmn:Event"))return t.newBounds&&(t.newBounds.width=Math.max(36,t.newBounds.width),t.newBounds.height=Math.max(36,t.newBounds.height)),!0}))},Zh.Z,n(310)})(),(()=>{"use strict";n.r(i),n.d(i,{default:()=>s});const e={__init__:["verticalParticipantRenderer"],verticalParticipantRenderer:["type",n(472).Z]};var t=n(310),r=n(133),o=n(728),a=n(892);class s{constructor(n,i,s){this.viewer=new r.Z({container:"#"+n,additionalModules:[[].concat(o.Z,e,a.Z)]}),this.zoomModule=new t.Z(this.viewer,this.viewer.get("eventBus"),document.getElementById(n),null,i,s),this.zoomModule.Render()}loadXml=async function(e){const t=this;if(this._isFirstTime=!1,!e)throw new Error("xmlData cannot be null");return this.viewer.importXML(e).catch((e=>{e&&console.error(e)})).then((()=>t.zoomModule.SetDefaultZoom()))}}})(),i})())); \ No newline at end of file + `,this._current.container)},Vc.prototype.open=function(e,t,n,i){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{entries:r,headerEntries:o}=this._getContext(e,t);this._current={position:n,className:t,target:e,entries:r,headerEntries:o,container:this._createContainer({provider:t}),options:i},this._emit("open"),this._bindAutoClose(),this._render()},Vc.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const i=this._getEntries(e,n),r=this._getHeaderEntries(e,n);return{entries:i,headerEntries:r,empty:!(Object.keys(i).length||Object.keys(r).length)}},Vc.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._current=null)},Vc.prototype.reset=function(){const e=this._current.container;ac(null,e),ye(e)},Vc.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},Vc.prototype._onOpened=function(){this._emit("opened")},Vc.prototype._onClosed=function(){this._emit("closed")},Vc.prototype._createContainer=function(e){var t=this._canvas.getContainer();const n=me(`
      `);return t.appendChild(n),n},Vc.prototype._bindAutoClose=function(){this._eventBus.once(Hc,this.close,this)},Vc.prototype._unbindAutoClose=function(){this._eventBus.off(Hc,this.close,this)},Vc.prototype._updateScale=function(){var e,t,n=this._canvas.zoom(),i=this._config.scale,r=n;return!0!==i&&(!1===i?(e=1,t=1):(e=i.min,t=i.max),l(e)&&nt&&(r=t)),r},Vc.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect(),r={},o=t.x,a=t.y;return t.x+i.width>n.width&&(r.x=!0),t.y+i.height>n.height&&(r.y=!0),r.x&&r.y?(o=t.x-i.width,a=t.y-i.height):r.x?(o=t.x-i.width,a=t.y):r.y&&t.y\n \n \n \n ',bottom:'\n \n \n \n ',center:'\n \n \n \n ',left:'\n \n \n \n ',right:'\n \n \n \n ',top:'\n \n \n \n ',middle:'\n \n \n \n '};function Uc(e,t,n,i){e.registerProvider(900,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}Uc.$inject=["contextPad","popupMenu","translate","canvas"],Uc.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&z(t,this._getEntries(e)),t},Uc.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},Uc.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`
      ${Gc.align}
      `,action:{click:function(t,n){var i=e._getMenuPosition(n);z(i,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",i)}}}}},Uc.prototype._getMenuPosition=function(e){var t=this._contextPad.getPad(e).html.getBoundingClientRect();return{x:t.left,y:t.bottom+5}};var qc=["left","center","right","top","middle","bottom"];function Kc(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}function Yc(e){aa.call(this,e),this.init()}function Xc(e){Yc.call(this,e)}Kc.$inject=["popupMenu","alignElements","translate","rules"],Kc.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&z(t,this._getEntries(e)),t},Kc.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},Kc.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return x(qc,(function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:Gc[o],action:function(){t.trigger(e,o),i.close()}}})),r},Yc.$inject=["eventBus"],e(Yc,aa),Yc.prototype.addRule=function(e,t,n){var i=this;"string"==typeof e&&(e=[e]),e.forEach((function(e){i.canExecute(e,t,(function(e,t,i){return n(e)}),!0)}))},Yc.prototype.init=function(){},Xc.$inject=["eventBus"],e(Xc,Yc),Xc.prototype.init=function(){this.addRule("elements.align",(function(e){var t=_(e.elements,(function(e){return!(e.waypoints||e.host||e.labelTarget)}));return!((t=ht(t)).length<2)&&t}))};const Zc={__depends__:[_s,Ss,Wc],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",Uc],alignElementsMenuProvider:["type",Kc],bpmnAlignElements:["type",Xc]};var Qc=10,Jc=50,ep=250;function tp(e,t,n,i){for(var r;r=ip(e,n,t);)n=i(t,n,r);return n}function np(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach((function(o){var a=e[o];if(a){var s="x"===o?"width":"height",c=a.margin,p=a.minDistance;r[o]=c<0?Math.min(i[o]+c-t[s]/2,n[o]-p+c):Math.max(i[o]+i[s]+c+t[s]/2,n[o]+p+c)}})),r}}function ip(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=function(e){var t=rp(e);return e.host&&(t=t.concat(rp(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce((function(e,t){return e.concat(rp(t))}),[]))),t}(e);return y(r,(function(e){return e!==n&&"intersect"===bn(e,i,Qc)}))}function rp(e){return(t=e,t.outgoing.map((function(e){return e.target}))).concat(function(e){return e.incoming.map((function(e){return e.source}))}(e));var t}function op(){return!0}function ap(e,t,n){e.on("autoPlace",100,(function(e){var t=e.shape;return function(e,t,n){n||(n={});var i=n.defaultDistance||Jc,r=yn(e);return{x:gn(e).right+i+t.width/2,y:r.y}}(e.source,t)})),e.on("autoPlace.end",(function(e){n.scrollToElement(e.shape)})),this.append=function(n,i,r){e.fire("autoPlace.start",{source:n,shape:i});var o=e.fire("autoPlace",{source:n,shape:i}),a=t.appendShape(n,i,o,n.parent,r);return e.fire("autoPlace.end",{source:n,shape:a}),a}}function sp(e,t){e.on("autoPlace.end",500,(function(e){t.select(e.shape)}))}ap.$inject=["eventBus","modeling","canvas"],sp.$inject=["eventBus","selection"];const cp={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",ap],autoPlaceSelectionBehavior:["type",sp]};function pp(e,t){return xr(t,"bpmn:TextAnnotation")?function(e,t){var n=gn(e),i={x:n.right+t.width/2,y:n.top-50-t.height/2};return hn(e)&&((i=yn(e)).x+=100,i.y-=50),tp(e,t,i,np({y:{margin:-30,minDistance:20}}))}(e,t):wr(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(e,t){var n=gn(e);return tp(e,t,{x:n.right-10+t.width/2,y:n.bottom+40+t.width/2},np({x:{margin:30,minDistance:30}}))}(e,t):xr(t,"bpmn:FlowNode")?function(e,t){var n=gn(e),i=yn(e),r=function(e,t){t||(t={});var n=t.defaultDistance||Jc,i=t.direction||"e",r=t.filter,o=t.getWeight||function(t){return t.source===e?1:-1},a=t.maxDistance||ep,s=t.reference||"start";function c(e,t){return"n"===i?"start"===s?gn(e).top-gn(t).bottom:"center"===s?gn(e).top-yn(t).y:gn(e).top-gn(t).top:"w"===i?"start"===s?gn(e).left-gn(t).right:"center"===s?gn(e).left-yn(t).x:gn(e).left-gn(t).left:"s"===i?"start"===s?gn(t).top-gn(e).bottom:"center"===s?yn(t).y-gn(e).bottom:gn(t).bottom-gn(e).bottom:"start"===s?gn(t).left-gn(e).right:"center"===s?yn(t).x-gn(e).right:gn(t).right-gn(e).right}r||(r=op);var p=e.incoming.filter(r).map((function(t){var n=o(t),i=n<0?c(t.source,e):c(e,t.source);return{id:t.source.id,distance:i,weight:n}})),l=e.outgoing.filter(r).map((function(t){var n=o(t),i=n>0?c(e,t.target):c(t.target,e);return{id:t.target.id,distance:i,weight:n}}));return w(p.concat(l).reduce((function(e,t){return e[t.id+"__weight_"+t.weight]=t,e}),{}),(function(e,t){var n=t.distance,i=t.weight;return n<0||n>a||(e[String(n)]||(e[String(n)]=0),e[String(n)]+=1*i,(!e.distance||e[e.distance]t.top&&(n=n.concat("n")),e.rightt.left&&(n=n.concat("e")),n}(F(t,["x","y","width","height"]),n);this.resize(t,n,{autoResize:i});var r=t.parent;r&&this._expand([t],r)}}},dp.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},dp.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},dp.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},fp.$inject=["injector"],e(fp,dp),fp.prototype.resize=function(e,t,n){xr(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},mp.$inject=["eventBus"],e(mp,Yc),mp.prototype.canResize=function(e,t){return!1},e(gp,mp),gp.$inject=["eventBus","modeling"],gp.prototype.canResize=function(e,t){if(xr(t.di,"bpmndi:BPMNPlane"))return!1;if(!xr(t,"bpmn:Participant")&&!xr(t,"bpmn:Lane")&&!xr(t,"bpmn:SubProcess"))return!1;var n=!0;return x(e,(function(e){(xr(e,"bpmn:Lane")||dn(e))&&(n=!1)})),n};const vp={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",fp],bpmnAutoResizeProvider:["type",gp]};function yp(e,t,n){var i,r,o=this,a=n.get("dragging",!1);a&&t.on("drag.start",(function(n){t.once("drag.move",1500,(function(t){!function(t){if(!t.hover){var n=t.originalEvent,i=o._findTargetGfx(n),r=i&&e.get(i);i&&r&&(t.stopPropagation(),a.hover({element:r,gfx:i}),a.move(n))}}(t)}))})),t.on("element.hover",(function(e){i=e.gfx,r=e.element})),t.on("element.hover",1500,(function(e){r&&t.fire("element.out",{element:r,gfx:i})})),t.on("element.out",(function(){i=null,r=null})),this._findTargetGfx=function(e){var t;if(e instanceof MouseEvent)return t=Do(e),ie(document.elementFromPoint(t.x,t.y),"svg, .djs-element",!0)}}yp.$inject=["elementRegistry","eventBus","injector"];const bp={__init__:["hoverFix"],hoverFix:["type",yp]};var _p=Math.round,xp="djs-drag-active";function wp(e){e.preventDefault()}function Ep(e,t,n,i){var r,o={threshold:5,trapClick:!0};function a(e){var n=t.viewbox(),i=t._container.getBoundingClientRect();return{x:n.x+(e.x-i.left)/n.scale,y:n.y+(e.y-i.top)/n.scale}}function s(t,n){n=n||r;var i=e.createEvent(z({},n.payload,n.data,{isTouch:n.isTouch}));return!1!==e.fire("drag."+t,i)&&e.fire(n.prefix+"."+t,i)}function c(e,i){var o,c=r.payload,p=r.displacement,l=r.globalStart,u=Do(e),h=Xa(u,l),d=r.localStart,f=a(u),g=Xa(f,d);if(!r.active&&(i||(o=h,Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2))>r.threshold))){if(z(c,{x:_p(d.x+p.x),y:_p(d.y+p.y),dx:0,dy:0},{originalEvent:e}),!1===s("start"))return m();r.active=!0,r.keepSelection||(c.previousSelection=n.get(),n.select(null)),r.cursor&&Ga(r.cursor),t.addMarker(t.getRootElement(),xp)}Mo(e),r.active&&(z(c,{x:_p(f.x+p.x),y:_p(f.y+p.y),dx:_p(g.x),dy:_p(g.y)},{originalEvent:e}),s("move"))}function p(e){var t=!0;r.active&&(e&&(r.payload.originalEvent=e,Mo(e)),t=s("end")),!1===t&&s("rejected"),s("ended",g(!0!==t))}function l(e){Ba("Escape",e)&&(wp(e),m())}function u(t){var n;r.active&&(n=Ka(e),setTimeout(n,400),wp(t)),p(t)}function h(e){c(e)}function d(e){var t=r.payload;t.hoverGfx=e.gfx,t.hover=e.element,s("hover")}function f(e){s("out");var t=r.payload;t.hoverGfx=null,t.hover=null}function m(e){var t;if(r){var n=r.active;n&&s("cancel"),t=g(e),n&&s("canceled",t)}}function g(o){var a,g;s("cleanup"),Ua(),g=r.trapClick?u:p,le.unbind(document,"mousemove",c),le.unbind(document,"dragstart",wp),le.unbind(document,"selectstart",wp),le.unbind(document,"mousedown",g,!0),le.unbind(document,"mouseup",g,!0),le.unbind(document,"keyup",l),le.unbind(document,"touchstart",h,!0),le.unbind(document,"touchcancel",m,!0),le.unbind(document,"touchmove",c,!0),le.unbind(document,"touchend",p,!0),e.off("element.hover",d),e.off("element.out",f),t.removeMarker(t.getRootElement(),xp);var v=r.payload.previousSelection;return!1!==o&&v&&!n.get().length&&function(e){var t=e.filter((function(e){return i.get(e.id)}));t.length&&n.select(t)}(v),a=r,r=null,a}e.on("diagram.destroy",m),this.init=function(t,n,i,g){r&&m(!1),"string"==typeof n&&(g=i,i=n,n=null);var v,y,b,_,x,w=(g=z({},o,g||{})).data||{};_=g.trapClick?u:p,t?(v=Ao(t)||t,y=Do(t),Mo(t),"dragstart"===v.type&&wp(v)):(v=null,y={x:0,y:0}),b=a(y),n||(n=b),x=function(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}(v),r=z({prefix:i,data:w,payload:{},globalStart:y,displacement:Xa(n,b),localStart:b,isTouch:x},g),g.manual||(x?(le.bind(document,"touchstart",h,!0),le.bind(document,"touchcancel",m,!0),le.bind(document,"touchmove",c,!0),le.bind(document,"touchend",p,!0)):(le.bind(document,"mousemove",c),le.bind(document,"dragstart",wp),le.bind(document,"selectstart",wp),le.bind(document,"mousedown",_,!0),le.bind(document,"mouseup",_,!0)),le.bind(document,"keyup",l),e.on("element.hover",d),e.on("element.out",f)),s("init"),g.autoActivate&&c(t,!0)},this.move=c,this.hover=d,this.out=f,this.end=p,this.cancel=m,this.context=function(){return r},this.setOptions=function(e){z(o,e)}}Ep.$inject=["eventBus","canvas","selection","elementRegistry"];const Sp={__depends__:[bp,Xo],dragging:["type",Ep]};function Cp(e,t,n){this._canvas=n,this._opts=z({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",(function(e){var t=i._toBorderPoint(e);i.startScroll(t)})),t.on(["drag.cleanup"],(function(){i.stopScroll()}))}Cp.$inject=["config.autoScroll","eventBus","canvas"],Cp.prototype.startScroll=function(e){var t,n,i,r=this._canvas,o=this._opts,a=this,s=r.getContainer().getBoundingClientRect(),c=[e.x,e.y,s.width-e.x,s.height-e.y];this.stopScroll();for(var p=0,l=0,u=0;u<4;u++)t=c[u],n=o.scrollThresholdOut[u],i=o.scrollThresholdIn[u],nm-3&&(n=bn(r.target,f),a===m-2?"intersect"===n&&(h.pop(),h[h.length-1]=f):"intersect"!==n&&h.push(l)),i.newWaypoints=r.waypoints=s(r,h),function(e,t,n){var i,r,o,a,s,c,p=e.newWaypoints,l=(i=n,r=p[e.segmentStartIndex+t],o=p[e.segmentEndIndex+t],a=cl(e.axis),s=Math.max(r[a],o[a]),c=Math.min(r[a],o[a]),sl(r,a,Math.min(Math.max(c+20,i[a]),s-20)));Yn(e.draggerGfx,l.x,l.y)}(i,g,e),i.newSegmentStartIndex=o+g,c(e)})),t.on("connectionSegment.move.hover",(function(e){e.context.hover=e.hover,n.addMarker(e.hover,rl)})),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],(function(e){var t=e.context.hover;t&&n.removeMarker(t,rl)})),t.on("connectionSegment.move.cleanup",(function(e){var t=e.context,i=t.connection;t.draggerGfx&&Pe(t.draggerGfx),n.removeMarker(i,ol)})),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],(function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,c(e)})),t.on("connectionSegment.move.end",(function(e){var t=e.context,n=t.connection,i=t.newWaypoints,r=t.newSegmentStartIndex;i=i.map((function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}}));var a=function(e,t){var n=0,i=e.filter((function(i,r){return!Rt(e[r-1],e[r+1],i)||(n=r<=t?n-1:n,!1)}));return{waypoints:i,segmentOffset:n}}(i,r),c=s(n,a.waypoints),p=a.segmentOffset,l={segmentMove:{segmentStartIndex:t.segmentStartIndex,newSegmentStartIndex:r+p}};o.updateWaypoints(n,c,l)}))}ll.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var ul=Math.abs,hl=Math.round;function dl(e){return{x:e.x,y:e.y}}function fl(e){return{x:e.x+e.width,y:e.y+e.height}}function ml(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:hl(e.x+e.width/2),y:hl(e.y+e.height/2)}}function gl(e,t){var n=e.snapped;return!!n&&("string"==typeof t?n[t]:n.x&&n.y)}function vl(e,t,n){if("string"!=typeof t)throw new Error("axis must be in [x, y]");if("number"!=typeof n&&!1!==n)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return!1===n?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function yl(e){return e.children||[]}var bl=Math.abs,_l=Math.round;function xl(e){function t(e,t){if(h(e)){for(var n=e.length;n--;)if(bl(e[n]-t)<=10)return e[n]}else{var i=t%(e=+e);if(i<10)return t-i;if(i>e-10)return t-i+e}return t}function n(e,t){return e.waypoints?(i=function(e,t){for(var n,i=t.waypoints,r=1/0,o=0;oo.length-3&&u.unshift(n(r.target,e)),t.snapPoints=i={horizontal:[],vertical:[]},x(u,(function(e){e&&(e=e.original||e,"y"===l&&i.horizontal.push(e.y),"x"===l&&i.vertical.push(e.x))})),i}(e),a=e.x,s=e.y;if(o){var c=a-(i=t(o.vertical,a)),p=s-(r=t(o.horizontal,s));z(e,{dx:e.dx-c,dy:e.dy-p,x:i,y:r}),(c||-1!==o.vertical.indexOf(a))&&vl(e,"x",i),(p||-1!==o.horizontal.indexOf(s))&&vl(e,"y",r)}})),e.on(["connect.hover","connect.move","connect.end"],1500,(function(e){var t=e.context.hover,i=t&&n(t,e);hn(t)&&i&&i.x&&i.y&&(vl(e,"x",i.x),vl(e,"y",i.y))})),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,(function(e){var i,r,o=e.context,a=function(e){var t=e.snapPoints,n=e.connection.waypoints,i=e.bendpointIndex;if(t)return t;var r=[n[i-1],n[i+1]];return e.snapPoints=t={horizontal:[],vertical:[]},x(r,(function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))})),t}(o),s=o.hover,c=s&&n(s,e),p=e.x,l=e.y;if(a){var u=p-(i=t(c?a.vertical.concat([c.x]):a.vertical,p)),h=l-(r=t(c?a.horizontal.concat([c.y]):a.horizontal,l));z(e,{dx:e.dx-u,dy:e.dy-h,x:e.x-u,y:e.y-h}),(u||-1!==a.vertical.indexOf(p))&&vl(e,"x",i),(h||-1!==a.horizontal.indexOf(l))&&vl(e,"y",r)}}))}xl.$inject=["eventBus"];const wl={__depends__:[Sp,Pp],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Wp],bendpointMove:["type",Yp],bendpointMovePreview:["type",il],connectionSegmentMove:["type",ll],bendpointSnapping:["type",xl]};function El(e,t,n,i){function r(e,t){return i.allowed("connection.create",{source:e,target:t})}e.on("connect.hover",(function(e){var t,n=e.context,i=n.start,o=e.hover;if(n.hover=o,!u(t=n.canExecute=r(i,o))){if(!1!==t)return n.source=i,void(n.target=o);u(t=n.canExecute=r(o,i))||!1!==t&&(n.source=o,n.target=i)}})),e.on(["connect.out","connect.cleanup"],(function(e){var t=e.context;t.hover=null,t.source=null,t.target=null,t.canExecute=!1})),e.on("connect.end",(function(e){var t=e.context,i=t.canExecute,r=t.connectionStart,o={x:e.x,y:e.y},a=t.source,s=t.target;if(!i)return!1;var c=null,p={connectionStart:Sl(t)?o:r,connectionEnd:Sl(t)?r:o};d(i)&&(c=i),t.connection=n.connect(a,s,c,p)})),this.start=function(e,n,i,r){d(i)||(r=i,i=yn(n)),t.init(e,"connect",{autoActivate:r,data:{shape:n,context:{start:n,connectionStart:i}}})}}function Sl(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}El.$inject=["eventBus","dragging","modeling","rules"];var Cl="connect-ok",kl="connect-not-ok";function Rl(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",(function(e){var t=e.context,n=t.canExecute,r=t.hover,o=t.source,a=t.start,s=t.startPosition,c=t.target,p=t.connectionStart||s,l=t.connectionEnd||{x:e.x,y:e.y},u=p,h=l;Sl(t)&&(u=l,h=p),i.drawPreview(t,n,{source:o||a,target:c||r,connectionStart:u,connectionEnd:h})})),t.on("connect.hover",900,(function(e){var t=e.context,i=e.hover,r=t.canExecute;null!==r&&n.addMarker(i,r?Cl:kl)})),t.on(["connect.out","connect.cleanup"],1100,(function(e){var t=e.hover;t&&(n.removeMarker(t,Cl),n.removeMarker(t,kl))})),i&&t.on("connect.cleanup",(function(e){i.cleanUp(e.context)}))}Rl.$inject=["injector","eventBus","canvas"];const Pl={__depends__:[Xo,Pp,Sp],__init__:["connectPreview"],connect:["type",El],connectPreview:["type",Rl]};function Tl(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Tl.$inject=["injector","canvas","graphicsFactory","elementFactory"],Tl.prototype.drawPreview=function(e,t,n){n=n||{};var i,r,o,a=e.connectionPreviewGfx,s=e.getConnection,c=n.source,p=n.target,l=n.waypoints,u=n.connectionStart,h=n.connectionEnd,d=n.noLayout,f=n.noCropping,m=n.noNoop,g=this;a||(a=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),Te(a),s||(s=e.getConnection=(r=function(e,t,n){return g.getConnection(e,t,n)},o={},function(e){var t=JSON.stringify(e),n=o[t];return n||(n=o[t]=r.apply(null,arguments)),n})),t&&(i=s(t,c,p)),i?(i.waypoints=l||[],this._layouter&&!d&&(i.waypoints=this._layouter.layoutConnection(i,{source:c,target:p,connectionStart:u,connectionEnd:h,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[c?yn(c):u,p?yn(p):h]),this._connectionDocking&&(c||p)&&!f&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,c,p)),this._graphicsFactory.drawConnection(a,i,{stroke:"var(--element-dragger-color)"})):!m&&this.drawNoopPreview(a,n)},Tl.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||yn(n),o=t.connectionEnd||yn(i),a=this.cropWaypoints(r,o,n,i);_e(e,this.createNoopConnection(a[0],a[1]))},Tl.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return[e=n&&_n(o,s,!0)||e,t=i&&_n(a,s,!1)||t]},Tl.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&Pe(e.connectionPreviewGfx)},Tl.prototype.getConnection=function(e){var t=function(e){return d(e)?e:{}}(e);return this._elementFactory.createConnection(t)},Tl.prototype.createConnectionPreviewGfx=function(){var e=Ne("g");return Se(e,{pointerEvents:"none"}),ke(e).add("djs-dragger"),_e(this._canvas.getActiveLayer(),e),e},Tl.prototype.createNoopConnection=function(e,t){return lt([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};const Al={__init__:["connectionPreview"],connectionPreview:["type",Tl]};var Ml=["marker-start","marker-mid","marker-end"],Dl=["circle","ellipse","line","path","polygon","polyline","path","rect"];function Bl(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;t.on("drag.cleanup",(function(){r.cleanUp()}))}Bl.$inject=["elementRegistry","eventBus","canvas","styles"],Bl.prototype.cleanUp=function(){x(this._clonedMarkers,(function(e){Pe(e)})),this._clonedMarkers={}},Bl.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},Bl.prototype.addDragger=function(e,t,n,i="djs-dragger"){var r=Ae(n=n||this.getGfx(e)),o=n.getBoundingClientRect();return this._cloneMarkers(qn(r),i),Se(r,this._styles.cls(i,[],{x:o.top,y:o.left})),_e(t,r),Se(r,"data-preview-support-element-id",e.id),r},Bl.prototype.addFrame=function(e,t){var n=Ne("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return _e(t,n),Se(n,"data-preview-support-element-id",e.id),n},Bl.prototype._cloneMarkers=function(e,t="djs-dragger"){var n=this;if(e.childNodes)for(var i=0;i!function(e){return e.hidden}(e))).forEach((e=>{let t;hn(e)?(t=this._graphicsFactory._createContainer("connection",Ne("g")),this._graphicsFactory.drawConnection(qn(t),e)):(t=this._graphicsFactory._createContainer("shape",Ne("g")),this._graphicsFactory.drawShape(qn(t),e),Yn(t,e.x,e.y)),this._previewSupport.addDragger(e,o,t)})),n.forEach((({element:e,delta:t})=>{this._previewSupport.addDragger(e,o,void 0,"djs-dragging"),this._canvas.addMarker(e,"djs-element-hidden"),this._markers.push([e,"djs-element-hidden"]);const n=this._previewSupport.addDragger(e,o);hn(e)?Yn(n,t.x,t.y):Yn(n,e.x+t.x,e.y+t.y)})),i.forEach((e=>{this._previewSupport.addDragger(e,o,void 0,"djs-dragging"),this._canvas.addMarker(e,"djs-element-hidden"),this._markers.push([e,"djs-element-hidden"])})),r.forEach((({shape:e,bounds:t})=>{this._canvas.addMarker(e,"djs-hidden"),this._markers.push([e,"djs-hidden"]),this._previewSupport.addDragger(e,o,void 0,"djs-dragging");const n=this._graphicsFactory._createContainer("shape",Ne("g"));this._graphicsFactory.drawShape(qn(n),e,{width:t.width,height:t.height}),Yn(n,t.x,t.y),this._previewSupport.addDragger(e,o,n)}))}cleanUp(){Te(this._canvas.getLayer(Ol)),this._markers.forEach((([e,t])=>this._canvas.removeMarker(e,t))),this._markers=[],this._previewSupport.cleanUp()}show(){this._canvas.showLayer(Ol)}hide(){this._canvas.hideLayer(Ol)}}jl.$inject=["canvas","graphicsFactory","previewSupport"];const Ll={__depends__:[Nl],__init__:["complexPreview"],complexPreview:["type",jl]};var Il=["top","bottom","left","right"];function $l(e,t){function n(e){if(qr(e)){var n=function(e){var t=yn(e.label),n=zl(yn(e),t);if(i=n,-1!==Il.indexOf(i)){var i,r=function(e){var t=yn(e),n=[].concat(e.incoming.map((function(e){return e.waypoints[e.waypoints.length-2]})),e.outgoing.map((function(e){return e.waypoints[1]}))).map((function(e){return zl(t,e)}));return n}(e);if(e.host){var o=function(e){var t,n=e.host,i=bn(yn(e),n);return t=i.indexOf("-")>=0?i.split("-"):[i],Il.filter((function(e){return-1===t.indexOf(e)}))}(e);r=r.concat(o)}var a=Il.filter((function(e){return-1===r.indexOf(e)}));if(-1===a.indexOf(n))return a[0]}}(e);n&&function(e,n){var i=yn(e),r=e.label,o=yn(r);if(r.parent){var a,s=gn(e);switch(n){case"top":a={x:i.x,y:s.top-10-r.height/2};break;case"left":a={x:s.left-10-r.width/2,y:i.y};break;case"bottom":a={x:i.x,y:s.bottom+10+r.height/2};break;case"right":a={x:s.right+10+r.width/2,y:i.y}}var c=Xa(a,o);t.moveShape(r,c)}}(e,n)}}aa.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],(function(e){var t=e.context,i=t.connection,r=i.source,o=i.target;!1!==(t.hints||{}).createElementsBehavior&&(n(r),n(o))})),this.postExecuted(["label.create"],(function(e){var t=e.context,i=t.shape;!1!==(t.hints||{}).createElementsBehavior&&n(i.labelTarget)})),this.postExecuted(["elements.create"],(function(e){var t=e.context,i=t.elements;!1!==(t.hints||{}).createElementsBehavior&&i.forEach((function(e){n(e)}))}))}function zl(e,t){return bn(t,e,5)}function Fl(e){aa.call(this,e),this.preExecute("shape.append",(function(e){var t=e.source,n=e.shape;e.position||(xr(n,"bpmn:TextAnnotation")?e.position={x:t.x+t.width/2+75,y:t.y-50-n.height/2}:e.position={x:t.x+t.width+80+n.width/2,y:t.y+t.height/2})}),!0)}function Hl(e,t){e.invoke(aa,this),this.postExecute("shape.move",(function(e){var n=e.newParent,i=e.shape;x(_(i.incoming.concat(i.outgoing),(function(e){return xr(e,"bpmn:Association")})),(function(e){t.moveConnection(e,{x:0,y:0},n)}))}),!0)}function Vl(e,t){t.invoke(aa,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;1===(t=t.filter((function(e){return Wl(e,e.host)}))).length&&t.map((function(e){return t.indexOf(e)})).forEach((function(i){var r=t[i];e.elements[i]=n._replaceShape(t[i],r)}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;if(1===t.length){var r=t[0];Wl(r,i)&&(e.shapes=[n._replaceShape(r,i)])}}),!0)}function Wl(e,t){return!dn(e)&&wr(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function Gl(e,t){function n(e){return _(e.attachers,(function(e){return xr(e,"bpmn:BoundaryEvent")}))}aa.call(this,e),this.postExecute("connection.create",(function(e){var i=e.context.source,r=e.context.target,o=n(r);xr(i,"bpmn:EventBasedGateway")&&xr(r,"bpmn:ReceiveTask")&&o.length>0&&t.removeElements(o)})),this.postExecute("connection.reconnect",(function(e){var i=e.context.oldSource,r=e.context.newSource;xr(i,"bpmn:Gateway")&&xr(r,"bpmn:EventBasedGateway")&&x(r.outgoing,(function(e){var i=e.target,r=n(i);xr(i,"bpmn:ReceiveTask")&&r.length>0&&t.removeElements(r)}))}))}function Ul(e,t,n){function i(e){t.updateProperties(e,{isForCompensation:!0})}function r(e){t.updateProperties(e,{isForCompensation:void 0})}aa.call(this,e),this.preExecute("shape.replace",(function(e){const{newData:n,oldShape:i}=e;if(Kl(e.oldShape)&&"bpmn:CompensateEventDefinition"!==n.eventDefinitionType||"bpmn:BoundaryEvent"!==n.type){const t=i.outgoing.find((({target:e})=>ql(e)));t&&t.target&&(e._connectionTarget=t.target)}else if(!Kl(e.oldShape)&&"bpmn:CompensateEventDefinition"===n.eventDefinitionType&&"bpmn:BoundaryEvent"===n.type){const n=i.outgoing.find((({target:e})=>Yl(e)));n&&n.target&&(e._connectionTarget=n.target),function(e){const n=e.outgoing.filter((e=>xr(e,"bpmn:SequenceFlow")));t.removeElements(n)}(i)}}),!0),this.postExecuted("shape.replace",(function(e){const{_connectionTarget:n,newShape:i}=e;n&&t.connect(i,n)}),!0),this.preExecute("connection.create",(function(e){const n=e.connection,r=e.source,o=e.target;Kl(r)&&Yl(o)&&(i(o),function(e,n){const i=e.outgoing.filter((e=>xr(e,"bpmn:Association")));i.filter((e=>ql(e.target)&&!n.includes(e))).forEach((e=>t.removeConnection(e)))}(r,[n]))}),!0),this.postExecuted("connection.delete",(function(e){const t=e.source,n=e.target;Kl(t)&&ql(n)&&r(n)}),!0),this.postExecuted("connection.reconnect",(function(e){const t=e.newTarget,n=e.oldSource,o=e.oldTarget;if(o!==t){const e=n;ql(o)&&r(o),Kl(e)&&Yl(t)&&i(t)}}),!0),this.postExecuted("element.updateProperties",(function(e){const{element:i}=e;ql(i)?(function(e){for(const i of e.incoming)n.canConnect(i.source,e)||t.removeConnection(i);for(const i of e.outgoing)n.canConnect(e,i.target)||t.removeConnection(i)}(i),function(e){const n=e.attachers.slice();n.length&&t.removeElements(n)}(i)):Yl(i)&&function(e){const n=e.incoming.filter((e=>Kl(e.source)));t.removeElements(n)}(i)}),!0)}function ql(e){const t=Er(e);return t&&t.get("isForCompensation")}function Kl(e){return e&&xr(e,"bpmn:BoundaryEvent")&&Vr(e,"bpmn:CompensateEventDefinition")}function Yl(e){return e&&xr(e,"bpmn:Activity")&&!Hr(e)}function Xl(e,t){for(g(t)&&(t=[t]);e=e.parent;)if(wr(e,t))return e;return null}function Zl(e){e.invoke(aa,this),this.preExecute("shape.create",1500,(function(e){var t=e.context,n=t.parent,i=t.shape;xr(n,"bpmn:Lane")&&!xr(i,"bpmn:Lane")&&(t.parent=Xl(n,"bpmn:Participant"))}))}function Ql(e,t){aa.call(this,e),this.preExecute("shape.create",(function(e){var n=e.context.shape;if(xr(n,"bpmn:DataObjectReference")&&"label"!==n.type){var i=t.create("bpmn:DataObject");n.businessObject.dataObjectRef=i}}))}e($l,aa),$l.$inject=["eventBus","modeling"],e(Fl,aa),Fl.$inject=["eventBus"],e(Hl,aa),Hl.$inject=["injector","modeling"],Vl.$inject=["bpmnReplace","injector"],e(Vl,aa),Vl.prototype._replaceShape=function(e,t){var n,i=(n=Er(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})},Gl.$inject=["eventBus","modeling"],e(Gl,aa),e(Ul,aa),Ul.$inject=["eventBus","modeling","bpmnRules"],Zl.$inject=["injector"],e(Zl,aa),Ql.$inject=["eventBus","bpmnFactory"],e(Ql,aa);var Jl=2e3;function eu(e,t,n){function i(){var t=e.getRootElement();return xr(t,"bpmn:Collaboration")?t:n.makeCollaboration()}aa.call(this,t),t.on(["create.start","shape.move.start"],Jl,(function(t){var n=t.context,i=n.shape,r=e.getRootElement();if(xr(i,"bpmn:Participant")&&xr(r,"bpmn:Process")&&r.children.length){var o=r.children.filter((function(e){return!xr(e,"bpmn:Group")&&!dn(e)&&!hn(e)}));if(o.length){var a=vt(o),s=function(e,t){t={width:t.width+40+30,height:t.height+40};var n=Math.max(e.width,t.width),i=Math.max(e.height,t.height);return{x:-n/2,y:-i/2,width:n,height:i}}(i,a);z(i,s),n.createConstraints=function(e,t){return{bottom:(t=gn(t)).top+e.height/2-20,left:t.right-e.width/2+20,top:t.bottom-e.height/2+20,right:t.left+e.width/2-20-30}}(i,a)}}})),t.on("create.start",Jl,(function(n){var i=n.context.shape,r=e.getRootElement(),o=e.getGraphics(r);function a(e){e.element=r,e.gfx=o}xr(i,"bpmn:Participant")&&xr(r,"bpmn:Process")&&(t.on("element.hover",Jl,a),t.once("create.cleanup",(function(){t.off("element.hover",a)})))})),this.preExecute("elements.create",Jl,(function(e){var t,n=e.elements,r=e.parent,o=function(e){return y(e,(function(e){return xr(e,"bpmn:Participant")}))}(n);o&&xr(r,"bpmn:Process")&&(e.parent=i(),(t=e.hints=e.hints||{}).participant=o,t.process=r,t.processRef=Er(o).get("processRef"))}),!0),this.preExecute("shape.create",(function(e){var t=e.parent,n=e.shape;xr(n,"bpmn:Participant")&&xr(t,"bpmn:Process")&&(e.parent=i(),e.process=t,e.processRef=Er(n).get("processRef"))}),!0),this.execute("shape.create",(function(e){var t=e.hints||{},n=e.process||t.process,i=e.shape,r=t.participant;!n||r&&i!==r||Er(i).set("processRef",Er(n))}),!0),this.revert("shape.create",(function(e){var t=e.hints||{},n=e.process||t.process,i=e.processRef||t.processRef,r=e.shape,o=t.participant;!n||o&&r!==o||Er(r).set("processRef",i)}),!0),this.postExecute("shape.create",(function(e){var t=e.hints||{},i=e.process||e.hints.process,r=e.shape,o=t.participant;if(i){var a=i.children.slice();o?r===o&&n.moveElements(a,{x:0,y:0},o):n.moveElements(a,{x:0,y:0},r)}}),!0)}eu.$inject=["canvas","eventBus","modeling"],e(eu,aa);var tu="__targetRef_placeholder";function nu(e,t){function n(e,n){var i=e.get("properties"),r=y(i,(function(e){return e.name===tu}));return!r&&n&&St(i,r=t.create("bpmn:Property",{name:tu})),r}function i(e,t){var i=n(e);i&&(function(e,t,n){return y(e.get("dataInputAssociations"),(function(e){return e!==n&&e.targetRef===t}))}(e,i,t)||Et(e.get("properties"),i))}function r(e){var t,r=e.context,o=r.connection,a=o.businessObject,s=o.target,c=s&&s.businessObject,p=r.newTarget,l=p&&p.businessObject,u=r.oldTarget||r.target,h=u&&u.businessObject,d=o.businessObject;h&&h!==c&&i(h,a),l&&l!==c&&i(l,a),c?(t=n(c,!0),d.targetRef=t):d.targetRef=null}aa.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],iu(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],iu(r))}function iu(e){return function(t){if(xr(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function ru(e){this._bpmnUpdater=e}function ou(e,t,n,i){function r(e){return e.children.filter((function(e){return xr(e,"bpmn:DataStoreReference")&&!e.labelTarget}))}function o(e,i){var r=e.businessObject||e;if(i=i||n.filter((function(e){return xr(e,"bpmn:Participant")&&Er(e).processRef}))[0]){var o=i.businessObject||i;t.execute("dataStore.updateContainment",{dataStoreBo:r,dataStoreDi:Sr(e),newSemanticParent:o.processRef||o,newDiParent:Sr(i)})}}aa.call(this,i),t.registerHandler("dataStore.updateContainment",ru),this.preExecute("shape.create",(function(e){var t=e.context,n=t.shape;xr(n,"bpmn:DataStoreReference")&&"label"!==n.type&&(t.hints||(t.hints={}),t.hints.autoResize=!1)})),this.preExecute("elements.move",(function(e){var t=e.context,n=t.shapes;n.filter((function(e){return xr(e,"bpmn:DataStoreReference")})).length&&(t.hints||(t.hints={}),t.hints.autoResize=n.filter((function(e){return!xr(e,"bpmn:DataStoreReference")})))})),this.postExecute("shape.create",(function(e){var t=e.context.shape,n=t.parent;xr(t,"bpmn:DataStoreReference")&&"label"!==t.type&&xr(n,"bpmn:Collaboration")&&o(t)})),this.postExecute("shape.move",(function(e){var t=e.context,n=t.shape,i=t.oldParent,r=n.parent;xr(i,"bpmn:Collaboration")||xr(n,"bpmn:DataStoreReference")&&"label"!==n.type&&xr(r,"bpmn:Collaboration")&&o(n,xr(i,"bpmn:Participant")?i:function(e,t){for(;e.parent;){if(xr(e.parent,"bpmn:Participant"))return e.parent;e=e.parent}}(i))})),this.postExecute("shape.delete",(function(t){var n=t.context.shape,i=e.getRootElement();wr(n,["bpmn:Participant","bpmn:SubProcess"])&&xr(i,"bpmn:Collaboration")&&r(i).filter((function(e){return function(e,t){for(var n=e.businessObject||e,i=t.businessObject||t;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}(e,n)})).forEach((function(e){o(e)}))})),this.postExecute("canvas.updateRoot",(function(e){var t=e.context,n=t.oldRoot,i=t.newRoot;r(n).forEach((function(e){xr(i,"bpmn:Process")&&o(e,i)}))}))}nu.$inject=["eventBus","bpmnFactory"],e(nu,aa),ru.$inject=["bpmnUpdater"],ru.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.newSemanticParent,r=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},ru.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.oldSemanticParent,r=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},ou.$inject=["canvas","commandStack","elementRegistry","eventBus"],e(ou,aa);var au=Math.max,su=Math.min,cu=20;function pu(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function lu(e,t){return{x:e.x+(t.left||0),y:e.y+(t.top||0),width:e.width-(t.left||0)+(t.right||0),height:e.height-(t.top||0)+(t.bottom||0)}}function uu(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return f(r)&&(i=(/top|left/.test(e)?su:au)(i,r)),f(o)&&(i=(/top|left/.test(e)?au:su)(i,o)),i}function hu(e,t){return void 0!==e?e:cu}function du(e){return!e.waypoints&&"label"!==e.type}function fu(e,t){var n;if((n=void 0===e.length?_(e.children,du):e).length)return function(e,t){var n,i,r,o;return"object"==typeof t?(n=hu(t.left),i=hu(t.right),r=hu(t.top),o=hu(t.bottom)):n=i=r=o=hu(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}(vt(n),t)}var mu=Math.abs,gu=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],vu=30;function yu(e,t){return t=t||[],e.children.filter((function(e){xr(e,"bpmn:Lane")&&(yu(e,t),t.push(e))})),t}function bu(e){return e.children.filter((function(e){return xr(e,"bpmn:Lane")}))}function _u(e){return Xl(e,gu)||e}function xu(e,t){aa.call(this,e),this.postExecuted("shape.delete",500,(function(e){var n=e.context,i=n.hints,r=n.shape,o=n.oldParent;xr(r,"bpmn:Lane")&&(i&&i.nested||function(e,n){var i,r,o,a,s,c=Fr(e),p=bu(n),l=[],u=[],h=[],d=[];mt(p,(function(t){return c?t.y>e.y?u.push(t):l.push(t):t.x>e.x?d.push(t):h.push(t),t.children})),p.length&&(i=c?u.length&&l.length?e.height/2:e.height:d.length&&h.length?e.width/2:e.width,l.length&&(r=t.calculateAdjustments(l,"y",i,e.y-10),t.makeSpace(r.movingShapes,r.resizingShapes,{x:0,y:i},"s")),u.length&&(o=t.calculateAdjustments(u,"y",-i,e.y+e.height+10),t.makeSpace(o.movingShapes,o.resizingShapes,{x:0,y:-i},"n")),h.length&&(a=t.calculateAdjustments(h,"x",i,e.x-10),t.makeSpace(a.movingShapes,a.resizingShapes,{x:i,y:0},"e")),d.length&&(s=t.calculateAdjustments(d,"x",-i,e.x+e.width+10),t.makeSpace(s.movingShapes,s.resizingShapes,{x:-i,y:0},"w")))}(r,o))}))}function wu(e,t){t.invoke(aa,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;t.filter((function(e){return Eu(e,e.host)})).map((function(e){return t.indexOf(e)})).forEach((function(i){e.elements[i]=n._replaceShape(t[i])}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;t.forEach((function(e,r){var o,a=e.host;Eu(e,(o=a,-1!==t.indexOf(o)?a:i))&&(t[r]=n._replaceShape(e))}))}),!0)}function Eu(e,t){return!dn(e)&&xr(e,"bpmn:BoundaryEvent")&&!t}function Su(e,t,n){function i(e,i,r){var o,a,s,c,p,l,u,h,d=i.waypoints,m=e.outgoing.slice(),g=e.incoming.slice(),v=Dp(d,h=f(r.width)?yn(r):r);if(v){if(o=d.slice(0,v.index),a=d.slice(v.index+(v.bendpoint?1:0)),!o.length||!a.length)return;s=v.bendpoint?d[v.index]:h,1!==o.length&&Cu(e,o[o.length-1])||o.push(ku(s)),1!==a.length&&Cu(e,a[0])||a.unshift(ku(s))}c=i.source,p=i.target,t.canConnect(c,e,i)&&(n.reconnectEnd(i,e,o||h),l=i),t.canConnect(e,p,i)&&(l?u=n.connect(e,p,{type:i.type,waypoints:a}):(n.reconnectStart(i,e,a||h),u=i));var y=[].concat(l&&_(g,(function(e){return e.source===l.source}))||[],u&&_(m,(function(e){return e.target===u.target}))||[]);y.length&&n.removeElements(y)}aa.call(this,e),this.preExecute("elements.move",(function(e){var n=e.newParent,i=e.shapes,r=e.delta,o=i[0];if(o&&n){n&&n.waypoints&&(e.newParent=n=n.parent);var a=yn(o),s={x:a.x+r.x,y:a.y+r.y},c=y(n.children,(function(e){return t.canInsert(i,e)&&Dp(e.waypoints,s)}));c&&(e.targetFlow=c,e.position=s)}}),!0),this.postExecuted("elements.move",(function(e){var t=e.shapes,n=e.targetFlow,r=e.position;n&&i(t[0],n,r)}),!0),this.preExecute("shape.create",(function(e){var n=e.parent,i=e.shape;t.canInsert(i,n)&&(e.targetFlow=n,e.parent=n.parent)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.targetFlow,r=e.position;n&&i(t,n,r)}),!0)}function Cu(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function ku(e){return z({},e)}function Ru(e,t){aa.call(this,e),this.preExecuted("connection.create",(function(e){var n=e.context,i=n.connection,r=n.source,o=n.target,a=n.hints;a&&!1===a.createElementsBehavior||!Pu(i)||(xr(r,"bpmn:EventBasedGateway")?o.incoming.filter((e=>e!==i&&Pu(e))):o.incoming.filter((e=>e!==i&&Pu(e)&&xr(e.source,"bpmn:EventBasedGateway")))).forEach((function(e){t.removeConnection(e)}))})),this.preExecuted("shape.replace",(function(e){var n=e.context.newShape;xr(n,"bpmn:EventBasedGateway")&&n.outgoing.filter(Pu).reduce((function(e,t){return e.includes(t.target)?e:e.concat(t.target)}),[]).forEach((function(e){e.incoming.filter(Pu).forEach((function(i){const r=e.incoming.filter(Pu).filter((function(e){return e.source===n}));(i.source!==n||r.length>1)&&t.removeConnection(i)}))}))}))}function Pu(e){return xr(e,"bpmn:SequenceFlow")}xu.$inject=["eventBus","spaceTool"],e(xu,aa),wu.$inject=["bpmnReplace","injector"],e(wu,aa),wu.prototype._replaceShape=function(e){var t,n,i=(n=Er(e).eventDefinitions)&&n[0];return t=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},e(Su,aa),Su.$inject=["eventBus","bpmnRules","modeling"],Ru.$inject=["eventBus","modeling"],e(Ru,aa);var Tu=1500;function Au(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],Tu,(function(t){var i=t.context.shape||t.shape,r=t.hover;xr(r,"bpmn:Lane")&&!wr(i,["bpmn:Lane","bpmn:Participant"])&&(t.hover=_u(r),t.hoverGfx=e.getGraphics(t.hover));var o=n.getRootElement();r!==o&&(i.labelTarget||wr(i,["bpmn:Group","bpmn:TextAnnotation"]))&&(t.hover=o,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],Tu,(function(t){var n=t.hover;xr(n,"bpmn:Lane")&&(t.hover=_u(n)||n,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["bendpoint.move.hover"],Tu,(function(t){var n=t.context,i=t.hover,r=n.type;xr(i,"bpmn:Lane")&&/reconnect/.test(r)&&(t.hover=_u(i)||i,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.start"],Tu,(function(e){var t=e.context,n=t.start;xr(n,"bpmn:Lane")&&(t.start=_u(n)||n)})),t.on("shape.move.start",2e3,(function(e){var t=e.shape;xr(t,"bpmn:Lane")&&(e.shape=_u(t)||t)})),t.on("spaceTool.move",2e3,(function(e){var t=e.hover;t&&xr(t,"bpmn:Lane")&&(e.hover=_u(t))}))}function Mu(e,t,n,i,r,o){function a(e,t,i){var r=n.filter((function(e){return xr(e,"bpmn:Group")})).filter((function(e){return e.businessObject!==i}));t&&!function(e,t){return e.some((function(e){var n=Er(e);return(n.categoryValueRef&&n.categoryValueRef.$parent)===t}))}(r,t)&&function(e){var t=e.$parent;t&&(Et(t.get("rootElements"),e),e.$parent=null)}(t),e&&!function(e,t){return e.some((function(e){return Er(e).categoryValueRef===t}))}(r,e)&&function(e){var t=e.$parent;t&&(Et(t.get("categoryValue"),e),e.$parent=null)}(e)}function s(e,n){return function(e,t,n){return St(t.get("categoryValue"),e),e.$parent=t,St(n.get("rootElements"),t),t.$parent=n,e}(e,n,t.getDefinitions())}function c(n,i){var r=Er(n),o=r.categoryValueRef;o||(o=r.categoryValueRef=i.categoryValue=i.categoryValue||function(e){return e.create("bpmn:CategoryValue")}(e));var a=o.$parent;a||(a=o.$parent=i.category=i.category||function(e){return e.create("bpmn:Category")}(e)),s(o,a,t.getDefinitions())}function p(e,t){var n=t.category,i=t.categoryValue,r=Er(e);i?(r.categoryValueRef=null,a(i,n,r)):a(null,r.categoryValueRef.$parent,r)}function l(t,n){var i=e.create(t.$type);return o.copyElement(t,i,null,n)}r.invoke(aa,this),this.execute("label.create",(function(e){var t=e.context,n=t.labelTarget;xr(n,"bpmn:Group")&&c(n,t)})),this.revert("label.create",(function(e){var t=e.context,n=t.labelTarget;xr(n,"bpmn:Group")&&p(n,t)})),this.execute("shape.delete",(function(e){var t=e.context,n=t.shape,i=Er(n);if(xr(n,"bpmn:Group")&&!n.labelTarget){var r=t.categoryValue=i.categoryValueRef;r&&(a(r,t.category=r.$parent,i),i.categoryValueRef=null)}})),this.reverted("shape.delete",(function(e){var t=e.context,n=t.shape;if(xr(n,"bpmn:Group")&&!n.labelTarget){var i=t.category,r=t.categoryValue,o=Er(n);r&&(o.categoryValueRef=r,s(r,i))}})),this.execute("shape.create",(function(e){var t=e.context,n=t.shape;xr(n,"bpmn:Group")&&!n.labelTarget&&Er(n).categoryValueRef&&c(n,t)})),this.reverted("shape.create",(function(e){var t=e.context,n=t.shape;xr(n,"bpmn:Group")&&!n.labelTarget&&Er(n).categoryValueRef&&p(n,t)})),i.on("copyPaste.copyElement",770,(function(e){var t=e.descriptor,n=e.element;if(xr(n,"bpmn:Group")&&!n.labelTarget){var i=Er(n);if(i.categoryValueRef){var r=i.categoryValueRef;t.categoryValue=l(r,!0),r.$parent&&(t.category=l(r.$parent,!0))}}})),i.on("copyPaste.pasteElement",770,(function(e){var t=e.descriptor,n=t.businessObject,i=t.categoryValue,r=t.category;i&&(i=n.categoryValueRef=l(i)),r&&(i.$parent=l(r)),delete t.category,delete t.categoryValue}))}function Du(e,t,n,i){var r,o,a,s;return 0==(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))?null:(o=e.y-n.y,a=e.x-n.x,s=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function Bu(e){function t(e,t,n){var i,r={x:n.x,y:n.y-50},o={x:n.x-50,y:n.y},a=Du(e,t,n,r),s=Du(e,t,n,o);i=a&&s?Nu(a,n)>Nu(s,n)?s:a:a||s,e.original=i}e.on("bpmnElement.added",(function(e){var n,i,r=e.element;r.waypoints&&(t((i=(n=r).waypoints)[0],i[1],yn(n.source)),t(i[i.length-1],i[i.length-2],yn(n.target)))}))}function Nu(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ou(e){aa.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],(function(e){var n=e.context.shape,i=Er(n),r=Sr(n);if(wr(i,t)){var o=r.get("isHorizontal");void 0===o&&(o=!0),r.set("isHorizontal",o)}}))}Au.$inject=["elementRegistry","eventBus","canvas"],Mu.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],e(Mu,aa),Bu.$inject=["eventBus"],Ou.$inject=["eventBus"],e(Ou,aa);var ju=Math.sqrt,Lu=Math.min,Iu=Math.max,$u=Math.abs;function zu(e){return Math.pow(e,2)}function Fu(e,t){return ju(zu(e.x-t.x)+zu(e.y-t.y))}function Hu(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,p=(r*a+o*s)/c,l=p*p-(a*a+s*s-i*i)/c;if(l<0&&l>-1e-6&&(l=0),l<0)return[];var u=ju(l),h=-p+u,d=-p-u,f={x:e.x-r*h,y:e.y-o*h};return 0===l?[f]:[f,{x:e.x-r*d,y:e.y-o*d}].filter((function(n){return function(e,t,n){return Vu(e.x,t.x,n.x)&&Vu(e.y,t.y,n.y)}(n,e,t)}))}function Vu(e,t,n){return e>=Lu(t,n)-Wu&&e<=Iu(t,n)+Wu}var Wu=.1;function Gu(e,t){return $u(e.x-t.x)<=Wu&&$u(e.y-t.y)<=Wu}function Uu(e,t,n,i){var r=0,o=0,a={point:e,delta:{x:0,y:0}},s=function(e,t){var n,i,r,o,a,s,c,p,l,u,h,d,f=0;for(f=0;f line intersections");1===s.length&&(c={type:"bendpoint",position:s[0],segmentIndex:f,bendpointIndex:Gu(n,s[0])?f:f+1}),2===s.length&&(h=s[0],d=s[1],c={type:"segment",position:a={x:(h.x+d.x)/2,y:(h.y+d.y)/2},segmentIndex:f,relativeLocation:Fu(n,a)/Fu(n,i)}),p=Fu(c.position,e),(!u||l>p)&&(u=c,l=p)}return u}(e,n),c=s.segmentIndex,p=function(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o=l&&(c=p?r+1:r-1),rt.length-2||null===p)return a;var l,u,h,d,f,m,g=Ku(n,c),v=Ku(t,p),y=s.position,b=(d=y,f=Lp((h=g)[0],h[1]),m=Lp(h[0],d),0===f?0:m/f),_=(l=v,u=Np(g),Np(l)-u);if("bendpoint"===s.type){var x=t.length-n.length,w=s.bendpointIndex,E=n[w];if(-1!==t.indexOf(E))return a;if(0===x){var S=t[w];return{delta:{x:r=S.x-s.position.x,y:o=S.y-s.position.y},point:{x:e.x+r,y:e.y+o}}}x<0&&0!==w&&w{Er(e.context.element)===e.context.moddleElement&&r(e)})),this.postExecute(["shape.create","connection.create"],(function(e){var n=e.context;if(!1!==(n.hints||{}).createElementsBehavior){var i=n.shape||n.connection;!dn(i)&&Ur(i)&&Xr(i)&&t.updateLabel(i,Xr(i))}})),this.postExecute("shape.delete",(function(e){var n=e.context,i=n.labelTarget,r=n.hints||{};i&&!1!==r.unsetLabel&&t.updateLabel(i,null,null,{removeShape:!1})})),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var n=e.context;if(!1!==(n.hints||{}).labelBehavior){var i,r=n.connection.label;r&&r.parent&&(i=function(e){var t=e.context,n=t.connection,i=n.label,r=z({},t.hints),o=t.newWaypoints||n.waypoints,a=t.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),function(e,t,n,i){return Uu(yn(e),t,n,i).delta}(i,o,a,r)}(e),t.moveShape(r,i))}})),this.postExecute(["shape.replace"],(function(e){var t=e.context,n=t.newShape,i=t.oldShape,r=Er(n);r&&Ur(r)&&i.label&&n.label&&(n.label.x=i.label.x,n.label.y=i.label.y)})),this.postExecute("shape.resize",(function(e){var n,i=e.context,r=i.shape,o=i.newBounds,a=i.oldBounds;if(qr(r)){var s=r.label,c=function(e,t){if(t.length){var n=function(e,t){var n=t.map((function(t){return{line:t,distance:jp(e,t)}}));return M(n,"distance")[0].line}(e,t);return Op(e,n)}}(yn(s),[[{x:(n=a).x,y:n.y},{x:n.x+(n.width||0),y:n.y}],[{x:n.x+(n.width||0),y:n.y},{x:n.x+(n.width||0),y:n.y+(n.height||0)}],[{x:n.x,y:n.y+(n.height||0)},{x:n.x+(n.width||0),y:n.y+(n.height||0)}],[{x:n.x,y:n.y},{x:n.x,y:n.y+(n.height||0)}]]),p=function(e,t,n){return mn(Xa(Yu(e,t,n),e))}(c,a,o);t.moveShape(s,p)}}))}function eh(e,t){function n(e,t){var n=e.context,i=n.connection,r=z({},n.hints),o=n.newWaypoints||i.waypoints,a=n.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),function(e,t,n,i){return Uu(e,t,n,i).point}(t,o,a,r)}aa.call(this,e),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var i=e.context.connection,r=i.outgoing;i.incoming.forEach((function(i){var r=i.waypoints[i.waypoints.length-1],o=n(e,r),a=[].concat(i.waypoints.slice(0,-1),[o]);t.updateWaypoints(i,a)})),r.forEach((function(i){var r=i.waypoints[0],o=n(e,r),a=[].concat([o],i.waypoints.slice(1));t.updateWaypoints(i,a)}))})),this.postExecute(["connection.move"],(function(e){var n=e.context,i=n.connection,r=i.outgoing,o=i.incoming,a=n.delta;o.forEach((function(e){var n=e.waypoints[e.waypoints.length-1],i={x:n.x+a.x,y:n.y+a.y},r=[].concat(e.waypoints.slice(0,-1),[i]);t.updateWaypoints(e,r)})),r.forEach((function(e){var n=e.waypoints[0],i={x:n.x+a.x,y:n.y+a.y},r=[].concat([i],e.waypoints.slice(1));t.updateWaypoints(e,r)}))}))}function th(e,t,n){var i=ah(e),r=sh(i,t),o=i[0];return r.length?r[r.length-1]:Yu(o.original||o,n,t)}function nh(e,t,n){var i=ah(e),r=sh(i,t),o=i[i.length-1];return r.length?r[0]:Yu(o.original||o,n,t)}function ih(e,t,n){var i=ah(e),r=oh(t,n),o=i[0];return Yu(o.original||o,r,t)}function rh(e,t,n){var i=ah(e),r=oh(t,n),o=i[i.length-1];return Yu(o.original||o,r,t)}function oh(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function ah(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function sh(e,t){return _(C(e,ch),(function(e){return function(e,t){return"intersect"===bn(t,e,1)}(e,t)}))}function ch(e){return e.original||e}function ph(e,t){aa.call(this,e),this.postExecute("shape.replace",(function(e){var n=e.oldShape,i=e.newShape;if(function(e,t){return xr(e,"bpmn:Participant")&&zr(e)&&xr(t,"bpmn:Participant")&&!zr(t)}(n,i)){var r,o,a,s,c=(o=gt([r=n],!1),a=[],s=[],o.forEach((function(e){e!==r&&(e.incoming.forEach((function(e){xr(e,"bpmn:MessageFlow")&&a.push(e)})),e.outgoing.forEach((function(e){xr(e,"bpmn:MessageFlow")&&s.push(e)})))}),[]),{incoming:a,outgoing:s});c.incoming.forEach((function(e){var r=nh(e,i,n);t.reconnectEnd(e,i,r)})),c.outgoing.forEach((function(e){var r=th(e,i,n);t.reconnectStart(e,i,r)}))}}),!0)}e(Ju,aa),Ju.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],e(eh,aa),eh.$inject=["eventBus","modeling"],ph.$inject=["eventBus","modeling"],e(ph,aa);const lh=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function uh(e){const t=Er(e);if(!(xr(t,"bpmn:BoundaryEvent")||xr(t,"bpmn:StartEvent")&&Hr(t.$parent)))return!1;const n=t.get("eventDefinitions");return!(!n||!n.length)&&lh.some((e=>xr(n[0],e)))}function hh(e){return xr(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function dh(e,t){e.invoke(aa,this),this.postExecuted("shape.replace",(function(e){const n=e.context.oldShape,i=e.context.newShape,r=e.context.hints;if(!uh(i))return;const o=hh(i);if(r.targetElement&&void 0!==r.targetElement[o])return;const a=Er(n).get(o);a!==Er(i).get(o)&&t.updateProperties(i,{[o]:a})}))}function fh(e,t){aa.call(this,e),this.preExecute("shape.resize",(function(e){var n=e.shape,i=Sr(n),r=i&&i.get("label");r&&r.get("bounds")&&t.updateModdleProperties(n,r,{bounds:void 0})}),!0)}function mh(e,t,n){aa.call(this,e),this.preExecute("shape.delete",(function(e){var i,r,o,a=e.context.shape;if(1===a.incoming.length&&1===a.outgoing.length){var s=a.incoming[0],c=a.outgoing[0];if(xr(s,"bpmn:SequenceFlow")&&xr(c,"bpmn:SequenceFlow")&&t.canConnect(s.source,c.target,s)){var p=(i=s.waypoints,r=c.waypoints,(o=Du(gh(i[i.length-2]),gh(i[i.length-1]),gh(r[1]),gh(r[0])))?[].concat(i.slice(0,i.length-1),[o],r.slice(1)):[gh(i[0]),gh(r[r.length-1])]);n.reconnectEnd(s,c.target,p)}}}))}function gh(e){return e.original||e}function vh(e,t){aa.call(this,e),this.preExecute("shape.delete",(function(e){var t=e.shape,n=t.parent;xr(t,"bpmn:Participant")&&(e.collaborationRoot=n)}),!0),this.postExecute("shape.delete",(function(e){var n=e.collaborationRoot;n&&!n.businessObject.participants.length&&t.makeProcess()}),!0)}function yh(e,t,n,i){aa.call(this,e);var r=i.get("dragging",!1);function o(e){var i,r,o=e.source,a=e.target;e.parent&&(xr(e,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(o,a)||(r=!0),n.canConnectMessageFlow(o,a)&&(i="bpmn:MessageFlow")),xr(e,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(o,a)||(r=!0),n.canConnectSequenceFlow(o,a)&&(i="bpmn:SequenceFlow")),r&&t.removeConnection(e),i&&t.connect(o,a,{type:i,waypoints:e.waypoints.slice()}))}this.postExecuted("elements.move",(function(e){x(e.closure.allConnections,o)}),!0),this.preExecute("connection.reconnect",(function(e){var i,o,a=e.context,s=a.connection,c=a.newSource||s.source,p=a.newTarget||s.target;(i=n.canConnect(c,p))&&i.type!==s.type&&(o=t.connect(c,p,{type:i.type,associationDirection:i.associationDirection,waypoints:s.waypoints.slice()}),s.parent&&t.removeConnection(s),a.connection=o,r&&function(e,t){var n,i=r.context(),o=i&&i.payload.previousSelection;o&&o.length&&-1!==(n=o.indexOf(e))&&o.splice(n,1,t)}(s,o))})),this.postExecuted("element.updateProperties",(function(e){var n,i=e.context,r=i.properties,o=i.element,a=o.businessObject;r.default&&(n=y(o.outgoing,D({id:o.businessObject.default.id})))&&t.updateProperties(n,{conditionExpression:void 0}),r.conditionExpression&&a.sourceRef.default===a&&t.updateProperties(o.source,{default:void 0})}))}function bh(e,t,n,i,r,o){i.invoke(aa,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,(function(e){var n=e.context,i=n.parent,r=n.elements,o=w(r,(function(e,n){var r=t.canReplace([n],n.host||n.parent||i);return r?e.concat(r.replacements):e}),[]);o.length&&this._replaceElements(r,o)}),this),this.postExecuted(["elements.move"],500,(function(e){var n=e.context,i=n.newParent,r=n.newHost,o=[];x(n.closure.topLevel,(function(e){o=Hr(e)?o.concat(e.children):o.concat(e)})),1===o.length&&r&&(i=r);var a=t.canReplace(o,i);a&&this._replaceElements(o,a.replacements,r)}),this),this.postExecute(["shape.replace"],1500,(function(e){var n,i=e.context,r=i.oldShape,o=i.newShape,a=r.attachers;a&&a.length&&(n=t.canReplace(a,o),this._replaceElements(a,n.replacements))}),this),this.postExecuted(["shape.replace"],1500,(function(e){var t=e.context,n=t.oldShape,i=t.newShape;r.unclaimId(n.businessObject.id,n.businessObject),r.updateProperties(i,{id:n.id})}))}dh.$inject=["injector","modeling"],e(dh,aa),e(fh,aa),fh.$inject=["eventBus","modeling"],e(mh,aa),mh.$inject=["eventBus","bpmnRules","modeling"],vh.$inject=["eventBus","modeling"],e(vh,aa),e(yh,aa),yh.$inject=["eventBus","modeling","bpmnRules","injector"],e(bh,aa),bh.prototype._replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;x(t,(function(t){var r={type:t.newElementType},o=n.get(t.oldElementId),a=e.indexOf(o);e[a]=i.replaceElement(o,r,{select:!1})})),t&&r.select(e)},bh.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var _h={width:140,height:120},xh={width:300,height:60},wh={width:60,height:300},Eh={width:300,height:150},Sh={width:150,height:300},Ch={width:140,height:120},kh={width:50,height:30};function Rh(e){e.on("resize.start",1500,(function(e){var t=e.context,n=t.shape,i=t.direction,r=t.balanced;(xr(n,"bpmn:Lane")||xr(n,"bpmn:Participant"))&&(t.resizeConstraints=function(e,t,n){var i=_u(e),r=!0,o=!0,a=yu(i,[i]),s=gn(e),c={},p={},l=Fr(e),u=l?xh:wh;/n/.test(t)?p.top=s.bottom-u.height:/e/.test(t)?p.right=s.left+u.width:/s/.test(t)?p.bottom=s.top+u.height:/w/.test(t)&&(p.left=s.right-u.width),a.forEach((function(e){var i=gn(e);/n/.test(t)&&(l&&i.tops.right+10&&(o=!1),n&&Ph(s.right-i.left)<10&&Dh(c,"right",i.right-u.width),Ph(s.right-i.right)<5&&Bh(p,"right",i.left+u.width)),/s/.test(t)&&(l&&i.bottom>s.bottom+10&&(o=!1),n&&Ph(s.bottom-i.top)<10&&Dh(c,"bottom",i.bottom-u.height),Ph(s.bottom-i.bottom)<5&&Bh(p,"bottom",i.top+u.height)),/w/.test(t)&&(!l&&i.left=r.y&&t<=r.y+r.height||n&&t>=r.x&&t<=r.x+r.width)return(o=bu(r)).length?Hh(o,t,n):r}$h.$inject=["eventBus"];function Vh(e,t,n,i,r,o,a){aa.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(e){return xr(e,"bpmn:SubProcess")&&!zr(e)}function p(t){var n=t.shape,i=t.newRootElement,r=Er(n);i=s._addDiagram(i||r),t.newRootElement=e.addRootElement(i)}function l(t){var n=Er(t.shape);s._removeDiagram(n);var i=t.newRootElement=a.get(ma(n));e.removeRootElement(i)}this.executed("shape.create",(function(e){c(e.shape)&&p(e)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.newRootElement;n&&t.children&&(s._showRecursively(t.children),s._moveChildrenToShape(t,n))}),!0),this.reverted("shape.create",(function(e){c(e.shape)&&l(e)}),!0),this.preExecuted("shape.delete",(function(e){var t=e.shape;if(c(t)){var i=a.get(ma(t));i&&n.removeElements(i.children.slice())}}),!0),this.executed("shape.delete",(function(e){c(e.shape)&&l(e)}),!0),this.reverted("shape.delete",(function(e){c(e.shape)&&p(e)}),!0),this.preExecuted("shape.replace",(function(t){var n=t.oldShape,i=t.newShape;c(n)&&c(i)&&(t.oldRoot=e.removeRootElement(ma(n)))}),!0),this.postExecuted("shape.replace",(function(t){var i=t.newShape,r=t.oldRoot,o=e.findRoot(ma(i));if(r&&o){var a=r.children;n.moveElements(a,{x:0,y:0},o)}}),!0),this.executed("element.updateProperties",(function(e){var t=e.element;if(xr(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties.id,r=n.id;if(i!==r){if(va(t))return a.updateId(t,ga(r)),void a.updateId(i,r);a.get(ga(i))&&a.updateId(ga(i),ga(r))}}}),!0),this.reverted("element.updateProperties",(function(e){var t=e.element;if(xr(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties.id,r=n.id;if(i!==r){if(va(t))return a.updateId(t,ga(i)),void a.updateId(r,i);var o=a.get(ga(r));o&&a.updateId(o,ga(i))}}}),!0),t.on("element.changed",(function(e){var n=e.element;if(va(n)){var i=n,r=a.get(fa(i));r&&r!==i&&t.fire("element.changed",{element:r})}})),this.executed("shape.toggleCollapse",400,(function(e){var t=e.shape;xr(t,"bpmn:SubProcess")&&(zr(t)?l(e):(p(e),s._showRecursively(t.children)))}),!0),this.reverted("shape.toggleCollapse",400,(function(e){var t=e.shape;xr(t,"bpmn:SubProcess")&&(zr(t)?l(e):(p(e),s._showRecursively(t.children)))}),!0),this.postExecuted("shape.toggleCollapse",600,(function(e){var t=e.shape;if(xr(t,"bpmn:SubProcess")){var n=e.newRootElement;n&&(zr(t)?s._moveChildrenToShape(n,t):s._moveChildrenToShape(t,n))}}),!0),t.on("copyPaste.createTree",(function(e){var t=e.element,n=e.children;if(c(t)){var i=ma(t),r=a.get(i);r&&n.push.apply(n,r.children)}})),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element,i=e.elements,r=n.parent;if(xr(Sr(r),"bpmndi:BPMNPlane")){var o=fa(r),a=y(i,(function(e){return e.id===o}));a&&(t.parent=a.id)}})),t.on("copyPaste.pasteElement",(function(e){var t=e.descriptor;t.parent&&(c(t.parent)||t.parent.hidden)&&(t.hidden=!0)}))}function Wh(e,t){e.invoke(aa,this),this.postExecuted("shape.replace",(function(e){var n=e.context.oldShape,i=e.context.newShape;if(xr(i,"bpmn:SubProcess")&&(xr(n,"bpmn:Task")||xr(n,"bpmn:CallActivity"))&&zr(i)){var r,o={x:(r=i).x+r.width/6,y:r.y+r.height/2};t.createShape({type:"bpmn:StartEvent"},o,i)}}))}function Gh(e){aa.call(this,e),this.preExecute("connection.create",(function(e){const{target:t}=e;xr(t,"bpmn:TextAnnotation")&&(e.parent=t.parent)}),!0),this.preExecute(["shape.create","shape.resize","elements.move"],(function(e){const t=e.shapes||[e.shape];1===t.length&&xr(t[0],"bpmn:TextAnnotation")&&(e.hints=e.hints||{},e.hints.autoResize=!1)}),!0)}function Uh(e,t){aa.call(this,e),this.postExecuted("shape.toggleCollapse",1500,(function(e){var n=e.shape;if(!zr(n)){var i=gt(n);i.forEach((function(e){var t=e.incoming.slice(),n=e.outgoing.slice();x(t,(function(e){r(e,!0)})),x(n,(function(e){r(e,!1)}))}))}function r(e,r){-1!==i.indexOf(e.source)&&-1!==i.indexOf(e.target)||(r?t.reconnectEnd(e,n,yn(n)):t.reconnectStart(e,n,yn(n)))}}),!0)}function qh(e,t,n){aa.call(this,e),this.executed(["shape.toggleCollapse"],500,(function(e){var t,n=e.context.shape;xr(n,"bpmn:SubProcess")&&(n.collapsed?Sr(n).isExpanded=!1:((t=n.children).length&&t.forEach((function(e){"label"!==e.type||e.businessObject.name||(e.hidden=!0)})),Sr(n).isExpanded=!0))})),this.reverted(["shape.toggleCollapse"],500,(function(e){var t=e.context.shape;t.collapsed?Sr(t).isExpanded=!1:Sr(t).isExpanded=!0})),this.postExecuted(["shape.toggleCollapse"],500,(function(e){var i,r=e.context.shape,o=t.getDefaultSize(r);i=r.collapsed?function(e,t){return{x:e.x+(e.width-t.width)/2,y:e.y+(e.height-t.height)/2,width:t.width,height:t.height}}(r,o):function(e,t){var n,i,r,o=t;return n=(r=e.children,r.filter((function(e){return!e.hidden}))).concat([e]),(i=fu(n))?(o.width=Math.max(i.width,o.width),o.height=Math.max(i.height,o.height),o.x=i.x+(i.width-o.width)/2,o.y=i.y+(i.height-o.height)/2):(o.x=e.x+(e.width-o.width)/2,o.y=e.y+(e.height-o.height)/2),o}(r,o),n.resizeShape(r,i,null,{autoResize:!r.collapsed&&"nwse"})}))}function Kh(e,t,n,i){t.invoke(aa,this),this.preExecute("shape.delete",(function(e){var t=e.context.shape,r=t.businessObject;dn(t)||(xr(t,"bpmn:Participant")&&zr(t)&&n.ids.unclaim(r.processRef.id),i.unclaimId(r.id,r))})),this.preExecute("connection.delete",(function(e){var t=e.context.connection.businessObject;i.unclaimId(t.id,t)})),this.preExecute("canvas.updateRoot",(function(){var t=e.getRootElement(),i=t.businessObject;xr(t,"bpmn:Collaboration")&&n.ids.unclaim(i.id)}))}function Yh(e,t){aa.call(this,e),this.preExecute("connection.delete",(function(e){var n=e.context.connection,i=n.source;(function(e,t){if(!xr(e,"bpmn:SequenceFlow"))return!1;var n=Er(t),i=Er(e);return n.get("default")===i})(n,i)&&t.updateProperties(i,{default:null})}))}function Xh(e,t,n){var i;aa.call(this,e);var r=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(r,5e3,(function(e){(i=i||new Zh).enter()})),this.postExecuted(r,500,(function(e){!function(){if(!i)throw new Error(n("out of bounds release"));i.leave()&&(t.updateLaneRefs(i.flowNodes,i.lanes),i=null)}()})),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],(function(e){var t=e.context.shape,r=function(){if(!i)throw new Error(n("out of bounds release"));return i}();t.labelTarget||(xr(t,"bpmn:Lane")&&r.addLane(t),xr(t,"bpmn:FlowNode")&&r.addFlowNode(t))}))}function Zh(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}e(Vh,aa),Vh.prototype._moveChildrenToShape=function(e,t){var n,i=this._modeling,r=e.children;if(r){var o=(r=r.concat(r.reduce((function(t,n){return n.label&&n.label.parent!==e?t.concat(n.label):t}),[]))).filter((function(e){return!e.hidden}));if(o.length){var a=vt(o);if(t.x){var s=yn(t),c=yn(a);n={x:s.x-c.x,y:s.y-c.y}}else n={x:180-a.x,y:160-a.y};i.moveElements(r,n,t,{autoResize:!1})}else i.moveElements(r,{x:0,y:0},t,{autoResize:!1})}},Vh.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach((function(e){e.hidden=!!t,i=i.concat(e),e.children&&(i=i.concat(n._showRecursively(e.children,e.collapsed||t)))})),i},Vh.prototype._addDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),t.push(e.di.$parent),e},Vh.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,i=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),r=t.create("bpmndi:BPMNDiagram",{plane:i});return i.$parent=r,n.createRoot({id:ma(e),type:e.$type,di:i,businessObject:e,collapsed:!0})},Vh.prototype._removeDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams,n=y(t,(function(t){return t.plane.bpmnElement.id===e.id}));return t.splice(t.indexOf(n),1),n},Vh.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"],Wh.$inject=["injector","modeling"],e(Wh,aa),e(Gh,aa),Gh.$inject=["eventBus"],e(Uh,aa),Uh.$inject=["eventBus","modeling"],e(qh,aa),qh.$inject=["eventBus","elementFactory","modeling"],e(Kh,aa),Kh.$inject=["canvas","injector","moddle","modeling"],e(Yh,aa),Yh.$inject=["eventBus","modeling"],Xh.$inject=["eventBus","modeling","translate"],e(Xh,aa);const Qh={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","compensateBoundaryEventBehaviour","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","nonInterruptingBehavior","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","textAnnotationBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior"],adaptiveLabelPositioningBehavior:["type",$l],appendBehavior:["type",Fl],associationBehavior:["type",Hl],attachEventBehavior:["type",Vl],boundaryEventBehavior:["type",Gl],compensateBoundaryEventBehaviour:["type",Ul],createBehavior:["type",Zl],createDataObjectBehavior:["type",Ql],createParticipantBehavior:["type",eu],dataInputAssociationBehavior:["type",nu],dataStoreBehavior:["type",ou],deleteLaneBehavior:["type",xu],detachEventBehavior:["type",wu],dropOnFlowBehavior:["type",Su],eventBasedGatewayBehavior:["type",Ru],fixHoverBehavior:["type",Au],groupBehavior:["type",Mu],importDockingFix:["type",Bu],isHorizontalFix:["type",Ou],labelBehavior:["type",Ju],layoutConnectionBehavior:["type",eh],messageFlowBehavior:["type",ph],nonInterruptingBehavior:["type",dh],removeElementBehavior:["type",mh],removeEmbeddedLabelBoundsBehavior:["type",fh],removeParticipantBehavior:["type",vh],replaceConnectionBehavior:["type",yh],replaceElementBehaviour:["type",bh],resizeBehavior:["type",Rh],resizeLaneBehavior:["type",jh],rootElementReferenceBehavior:["type",Lh],spaceToolBehavior:["type",$h],subProcessPlaneBehavior:["type",Vh],subProcessStartEventBehavior:["type",Wh],textAnnotationBehavior:["type",Gh],toggleCollapseConnectionBehaviour:["type",Uh],toggleElementCollapseBehaviour:["type",qh],unclaimIdBehavior:["type",Kh],unsetDefaultFlowBehavior:["type",Yh],updateFlowNodeRefsBehavior:["type",Xh]};function Jh(e,t){var n=bn(e,t,-15);return"intersect"!==n?n:null}function ed(e){Yc.call(this,e)}function td(e){return!e||dn(e)}function nd(e){do{if(xr(e,"bpmn:Process"))return Er(e);if(xr(e,"bpmn:Participant"))return Er(e).processRef||Er(e)}while(e=e.parent)}function id(e){return xr(e,"bpmn:TextAnnotation")}function rd(e){return xr(e,"bpmn:Group")&&!e.labelTarget}function od(e){return xr(e,"bpmn:BoundaryEvent")&&pd(e,"bpmn:CompensateEventDefinition")}function ad(e){return Er(e).isForCompensation}function sd(e){for(var t=e;t=t.parent;){if(xr(t,"bpmn:FlowElementsContainer"))return Er(t);if(xr(t,"bpmn:Participant"))return Er(t).processRef}return null}function cd(e,t){return sd(e)===sd(t)}function pd(e,t){return!!y(Er(e).eventDefinitions||[],(function(e){return xr(e,t)}))}function ld(e,t){return(Er(e).eventDefinitions||[]).every((function(e){return xr(e,t)}))}function ud(e,t){var n=function(e){for(var t=[];e;)(e=e.parent)&&t.push(e);return t}(t);return-1!==n.indexOf(e)}function hd(e,t,n){if(td(e)||td(t))return null;if(!xr(n,"bpmn:DataAssociation")){if(Cd(e,t))return{type:"bpmn:MessageFlow"};if(kd(e,t))return{type:"bpmn:SequenceFlow"}}return Rd(e,t)||(Sd(e,t)?{type:"bpmn:Association",associationDirection:"One"}:!!Ed(e,t)&&{type:"bpmn:Association",associationDirection:"None"})}function dd(e,t){return!(!dn(e)&&!rd(e))||!(xr(t,"bpmn:Participant")&&!zr(t))&&(xr(e,"bpmn:Participant")?xr(t,"bpmn:Process")||xr(t,"bpmn:Collaboration"):wr(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:xr(e,"bpmn:Lane")?xr(t,"bpmn:Participant")||xr(t,"bpmn:Lane"):!(xr(e,"bpmn:BoundaryEvent")&&(n=e,!Er(n).cancelActivity||!md(n)&&!gd(n)))&&(xr(e,"bpmn:FlowElement")&&!xr(e,"bpmn:DataStoreReference")?xr(t,"bpmn:FlowElementsContainer")?zr(t):wr(t,["bpmn:Participant","bpmn:Lane"]):xr(e,"bpmn:DataStoreReference")&&xr(t,"bpmn:Collaboration")?S(Er(t).get("participants"),(function(e){return!!e.get("processRef")})):wr(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?wr(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!xr(e,"bpmn:MessageFlow")&&(xr(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)));var n}function fd(e){return xr(e,"bpmn:Lane")}function md(e){var t=Er(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function gd(e){return vd(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function vd(e,t){return t.some((function(t){return pd(e,t)}))}function yd(e,t,n,i){if(Array.isArray(e)||(e=[e]),1!==e.length)return!1;var r=e[0];return!dn(r)&&!!function(e){return!!function(e){return!dn(e)&&xr(e,"bpmn:BoundaryEvent")}(e)||!(!xr(e,"bpmn:IntermediateThrowEvent")||!md(e))||xr(e,"bpmn:IntermediateCatchEvent")&&gd(e)}(r)&&!Hr(t)&&!(!xr(t,"bpmn:Activity")||ad(t))&&!(i&&!Jh(i,t))&&!function(e){return xr(e,"bpmn:ReceiveTask")&&y(e.incoming,(function(e){return xr(e.source,"bpmn:EventBasedGateway")}))}(t)&&"attach"}function bd(e,t,n){if(!t)return!1;var i={replacements:[]};return x(e,(function(e){Hr(t)||xr(e,"bpmn:StartEvent")&&"label"!==e.type&&dd(e,t)&&(function(e){return e&&!1!==Er(e).isInterrupting}(e)||i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),(function(e){return Vr(e,"bpmn:ErrorEventDefinition")}(e)||function(e){return Vr(e,"bpmn:EscalationEventDefinition")}(e)||function(e){return Vr(e,"bpmn:CompensateEventDefinition")}(e))&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),vd(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&xr(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"})),xr(t,"bpmn:Transaction")||pd(e,"bpmn:CancelEventDefinition")&&"label"!==e.type&&(xr(e,"bpmn:EndEvent")&&dd(e,t)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:EndEvent"}),xr(e,"bpmn:BoundaryEvent")&&yd(e,t,0,n)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:BoundaryEvent"}))})),!!i.replacements.length&&i}function _d(e,t){return!S(e,fd)&&(!t||e.every((function(e){return dd(e,t)})))}function xd(e,t,n,i){return!!t&&(!(!dn(e)&&!rd(e))||!function(e,t){return e===t}(n,t)&&(!n||!ud(n,t))&&(dd(e,t)||Pd(e,t)))}function wd(e,t){return xr(e,"bpmn:SubProcess")?zr(e)&&(!t||t.width>=100&&t.height>=80):!!(xr(e,"bpmn:Lane")||xr(e,"bpmn:Participant")||id(e)||rd(e))}function Ed(e,t){return!(ud(t,e)||ud(e,t)||!function(e,t){var n=id(e),i=id(t);return(n||i)&&n!==i}(e,t)&&!Rd(e,t))}function Sd(e,t){return cd(e,t)&&od(e)&&xr(t,"bpmn:Activity")&&(n=e,!t.attachers.includes(n))&&!Hr(t);var n}function Cd(e,t){return!(Ad(e)&&!Ad(t))&&xr(n=e,"bpmn:InteractionNode")&&!xr(n,"bpmn:BoundaryEvent")&&(!xr(n,"bpmn:Event")||xr(n,"bpmn:ThrowEvent")&&ld(n,"bpmn:MessageEventDefinition"))&&function(e){return xr(e,"bpmn:InteractionNode")&&!ad(e)&&(!xr(e,"bpmn:Event")||xr(e,"bpmn:CatchEvent")&&ld(e,"bpmn:MessageEventDefinition"))&&!(xr(e,"bpmn:BoundaryEvent")&&!pd(e,"bpmn:MessageEventDefinition"))}(t)&&!function(e,t){return nd(e)===nd(t)}(e,t);var n}function kd(e,t){return xr(n=e,"bpmn:FlowNode")&&!xr(n,"bpmn:EndEvent")&&!Hr(n)&&!(xr(n,"bpmn:IntermediateThrowEvent")&&pd(n,"bpmn:LinkEventDefinition"))&&!od(n)&&!ad(n)&&function(e){return xr(e,"bpmn:FlowNode")&&!xr(e,"bpmn:StartEvent")&&!xr(e,"bpmn:BoundaryEvent")&&!Hr(e)&&!(xr(e,"bpmn:IntermediateCatchEvent")&&pd(e,"bpmn:LinkEventDefinition"))&&!ad(e)}(t)&&cd(e,t)&&!(xr(e,"bpmn:EventBasedGateway")&&!function(e){return xr(e,"bpmn:ReceiveTask")||xr(e,"bpmn:IntermediateCatchEvent")&&(pd(e,"bpmn:MessageEventDefinition")||pd(e,"bpmn:TimerEventDefinition")||pd(e,"bpmn:ConditionalEventDefinition")||pd(e,"bpmn:SignalEventDefinition"))}(t));var n}function Rd(e,t){return wr(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&wr(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!wr(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!wr(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Pd(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(1!==e.length)return!1;e=e[0]}return t.source!==e&&t.target!==e&&wr(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!dn(t)&&xr(e,"bpmn:FlowNode")&&!xr(e,"bpmn:BoundaryEvent")&&dd(e,t.parent)}function Td(e,t){return!!dn(t)||!(xr(t,"bpmn:Lane")&&!function(e,t){return e&&t&&-1!==e.indexOf(t)}(e,t.parent))}function Ad(e){return Xl(e,"bpmn:Process")||Xl(e,"bpmn:Collaboration")}e(ed,Yc),ed.$inject=["eventBus"],ed.prototype.init=function(){this.addRule("connection.start",(function(e){return td(t=e.source)?null:wr(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"]);var t})),this.addRule("connection.create",(function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return hd(t,n)}finally{r&&(n.parent=null)}})),this.addRule("connection.reconnect",(function(e){var t=e.connection;return hd(e.source,e.target,t)})),this.addRule("connection.updateWaypoints",(function(e){return{type:e.connection.type}})),this.addRule("shape.resize",(function(e){return wd(e.shape,e.newBounds)})),this.addRule("elements.create",(function(e){var t=e.elements,n=e.position,i=e.target;return!(hn(i)&&!Pd(t,i))&&E(t,(function(e){return hn(e)?hd(e.source,e.target,e):e.host?yd(e,e.host,0,n):xd(e,i,null)}))})),this.addRule("elements.move",(function(e){var t=e.target,n=e.shapes,i=e.position;return yd(n,t,0,i)||bd(n,t,i)||_d(n,t)||Pd(n,t)})),this.addRule("shape.create",(function(e){return xd(e.shape,e.target,e.source,e.position)})),this.addRule("shape.attach",(function(e){return yd(e.shape,e.target,0,e.position)})),this.addRule("element.copy",(function(e){var t=e.element;return Td(e.elements,t)}))},ed.prototype.canConnectMessageFlow=Cd,ed.prototype.canConnectSequenceFlow=kd,ed.prototype.canConnectDataAssociation=Rd,ed.prototype.canConnectAssociation=Ed,ed.prototype.canConnectCompensationAssociation=Sd,ed.prototype.canMove=_d,ed.prototype.canAttach=yd,ed.prototype.canReplace=bd,ed.prototype.canDrop=dd,ed.prototype.canInsert=Pd,ed.prototype.canCreate=xd,ed.prototype.canConnect=hd,ed.prototype.canResize=wd,ed.prototype.canCopy=Td;const Md={__depends__:[Pp],__init__:["bpmnRules"],bpmnRules:["type",ed]};function Dd(e,t){e.on("saveXML.start",2e3,(function(){x(t.getRootElements(),(function(e){var t,n=Sr(e);t=C(_(gt([e],!1),(function(t){return t!==e&&!t.labelTarget})),Sr),n.set("planeElement",t)}))}))}Dd.$inject=["eventBus","canvas"];const Bd={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Dd]};function Nd(e){aa.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.parent=o.parent),n.parentIndex=o.index)})),this.preExecute(["shape.move","connection.move"],(function(e){var n=e.context,i=n.shape||n.connection,r=n.newParent||i.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.newParent=o.parent),n.newParentIndex=o.index)}))}function Od(e,t,n){Nd.call(this,e);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:TextAnnotation",order:{level:9}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(e){var t=e.order;if(t||(e.order=t=function(e){if(e.labelTarget)return{level:10};var t=y(i,(function(t){return wr(e,[t.type])}));return t&&t.order||{level:1}}(e)),!t)throw new Error("no order for <"+e.id+">");return t}this.getOrdering=function(e,n){if(e.labelTarget||xr(e,"bpmn:TextAnnotation"))return{parent:t.findRoot(n)||t.getRootElement(),index:-1};var i=r(e);i.containers&&(n=function(e,t,n){for(var i=t;i&&!wr(i,n);)i=i.parent;if(!i)throw new Error("no parent for <"+e.id+"> in <"+(t&&t.id)+">");return i}(e,n,i.containers));var o=n.children.indexOf(e),a=b(n.children,(function(t){return!(!e.labelTarget&&t.labelTarget)&&i.level_f(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(_f(i)<5)return!1;i<0&&(i*=-1),jo(e)&&(i*=-1);var o=function(e,t){if("x"===e){if(t>0)return"e";if(t<0)return"w"}if("y"===e){if(t>0)return"s";if(t<0)return"n"}return null}(n,i),a=this._canvas.getRootElement();!Lo(e)&&e.hover&&(a=e.hover);var s=[...gt(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,i,r),p=function(e,t,n,i,r){var o=e.movingShapes,a=e.resizingShapes;if(a.length){var s,c,p={};return x(a,(function(e){var l,u,h,d,m,g,v=e.attachers,y=e.children,b=gn(e),x=_(y,(function(e){return!(hn(e)||dn(e)||Af(o,e)||Af(a,e))})),w=_(y,(function(e){return!hn(e)&&!dn(e)&&Af(o,e)})),E=[],S=[];x.length&&(u=Pf(gn(vt(x))),l=i-b[Sf[n]]+u[Sf[n]],"n"===n?p.bottom=c=f(c)?Math.min(c,l):l:"w"===n?p.right=c=f(c)?Math.min(c,l):l:"s"===n?p.top=s=f(s)?Math.max(s,l):l:"e"===n&&(p.left=s=f(s)?Math.max(s,l):l)),w.length&&(h=Pf(gn(vt(w))),l=i-h[Sf[kf[n]]]+b[Sf[kf[n]]],"n"===n?p.bottom=c=f(c)?Math.min(c,l):l:"w"===n?p.right=c=f(c)?Math.min(c,l):l:"s"===n?p.top=s=f(s)?Math.max(s,l):l:"e"===n&&(p.left=s=f(s)?Math.max(s,l):l)),v&&v.length&&(v.forEach((function(e){Af(o,e)?E.push(e):S.push(e)})),E.length&&(d=gn(vt(E.map(yn))),m=b[Sf[kf[n]]]-(d[Sf[kf[n]]]-i)),S.length&&(g=gn(vt(S.map(yn)))[Sf[n]]-(b[Sf[n]]-i)),"n"===n?(l=Math.min(m||1/0,g||1/0),p.bottom=c=f(c)?Math.min(c,l):l):"w"===n?(l=Math.min(m||1/0,g||1/0),p.right=c=f(c)?Math.min(c,l):l):"s"===n?(l=Math.max(m||-1/0,g||-1/0),p.top=s=f(s)?Math.max(s,l):l):"e"===n&&(l=Math.max(m||-1/0,g||-1/0),p.left=s=f(s)?Math.max(s,l):l));var C=r&&r[e.id];C&&("n"===n?(l=i+e[wf[t]]-C[wf[t]],p.bottom=c=f(c)?Math.min(c,l):l):"w"===n?(l=i+e[wf[t]]-C[wf[t]],p.right=c=f(c)?Math.min(c,l):l):"s"===n?(l=i-e[wf[t]]+C[wf[t]],p.top=s=f(s)?Math.max(s,l):l):"e"===n&&(l=i-e[wf[t]]+C[wf[t]],p.left=s=f(s)?Math.max(s,l):l))})),p}}(c,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}));return z(t,c,{axis:n,direction:o,spaceToolConstraints:p,start:r}),Ga("resize-"+("x"===n?"ew":"ns")),!0},Rf.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[],s=[],c=[];function p(e){o.includes(e)||o.push(e);var t=e.label;t&&!o.includes(t)&&o.push(t)}x(e,(function(e){if(e.parent&&!dn(e))if(hn(e))c.push(e);else{var o=e[t],l=o+e[wf[t]];if(function(e){return!!e.host}(e)&&(n>0&&yn(e)[t]>i||n<0&&yn(e)[t]0&&o>i||n<0&&li&&r.allowed("shape.resize",{shape:e})?(u=e,void(a.includes(u)||a.push(u))):void 0;p(e)}}})),x(o,(function(e){var t=e.attachers;t&&x(t,(function(e){p(e)}))}));var l=o.concat(a);return x(s,(function(e){var t=e.host;Af(l,t)&&p(e)})),l=o.concat(a),x(c,(function(e){var t=e.source,n=e.target,i=e.label;Af(l,t)&&Af(l,n)&&i&&p(i)})),{movingShapes:o,resizingShapes:a}},Rf.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Rf.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^spaceTool/.test(e.prefix)};var Mf="djs-dragging",Df="djs-resizing",Bf=Math.max;function Nf(e,t,n,i,r){function o(e,t){x(e,(function(e){r.addDragger(e,t),n.addMarker(e,Mf)}))}e.on("spaceTool.selection.start",(function(e){var t=n.getLayer("space"),r=e.context,o=Ne("g");Se(o,i.cls("djs-crosshair-group",["no-events"])),_e(t,o);var a=Ne("path");Se(a,"d","M 0,-10000 L 0,10000"),ke(a).add("djs-crosshair"),_e(o,a);var s=Ne("path");Se(s,"d","M -10000,0 L 10000,0"),ke(s).add("djs-crosshair"),_e(o,s),r.crosshairGroup=o})),e.on("spaceTool.selection.move",(function(e){Yn(e.context.crosshairGroup,e.x,e.y)})),e.on("spaceTool.selection.cleanup",(function(e){var t=e.context.crosshairGroup;t&&Pe(t)})),e.on("spaceTool.move",250,(function(e){var a=e.context,s=a.line,c=a.axis,p=a.movingShapes,l=a.resizingShapes;if(a.initialized){if(!a.dragGroup){var u=n.getLayer("space");Se(s=Ne("path"),"d","M0,0 L0,0"),ke(s).add("djs-crosshair"),_e(u,s),a.line=s;var h=Ne("g");Se(h,i.cls("djs-drag-group",["no-events"])),_e(n.getActiveLayer(),h),o(p,h),o(a.movingConnections=t.filter((function(e){var t=!1;x(p,(function(n){x(n.outgoing,(function(n){e===n&&(t=!0)}))}));var n=!1;x(p,(function(t){x(t.incoming,(function(t){e===t&&(n=!0)}))}));var i=!1;x(l,(function(t){x(t.outgoing,(function(t){e===t&&(i=!0)}))}));var r=!1;return x(l,(function(t){x(t.incoming,(function(t){e===t&&(r=!0)}))})),hn(e)&&(t||i)&&(n||r)})),h),a.dragGroup=h}if(!a.frameGroup){var d=Ne("g");Se(d,i.cls("djs-frame-group",["no-events"])),_e(n.getActiveLayer(),d);var f=[];x(l,(function(e){var t=r.addFrame(e,d),i=t.getBBox();f.push({element:t,initialBounds:i}),n.addMarker(e,Df)})),a.frameGroup=d,a.frames=f}Se(s,{d:{x:"M"+e.x+", -10000 L"+e.x+", 10000",y:"M -10000, "+e.y+" L 10000, "+e.y}[c]});var m={x:e.dx,y:e.dy};m[{x:"y",y:"x"}[a.axis]]=0,Yn(a.dragGroup,m.x,m.y),x(a.frames,(function(e){var t,n,i=e.element,r=e.initialBounds;"e"===a.direction?Se(i,{width:Bf(r.width+m.x,5)}):Se(i,{width:t=Bf(r.width-m.x,5),x:r.x+r.width-t}),"s"===a.direction?Se(i,{height:Bf(r.height+m.y,5)}):Se(i,{height:n=Bf(r.height-m.y,5),y:r.y+r.height-n})}))}})),e.on("spaceTool.cleanup",(function(e){var t=e.context,i=t.movingShapes,r=t.movingConnections,o=t.resizingShapes,a=t.line,s=t.dragGroup,c=t.frameGroup;x(i,(function(e){n.removeMarker(e,Mf)})),x(r,(function(e){n.removeMarker(e,Mf)})),s&&(Pe(a),Pe(s)),x(o,(function(e){n.removeMarker(e,Df)})),c&&Pe(c)}))}Nf.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const Of={__init__:["spaceToolPreview"],__depends__:[Sp,Pp,yf,Nl,Xd],spaceTool:["type",Rf],spaceToolPreview:["type",Nf]};function jf(e){e.invoke(Rf,this)}jf.$inject=["injector"],e(jf,Rf),jf.prototype.calculateAdjustments=function(e,t,n,i){var r=Rf.prototype.calculateAdjustments.call(this,e,t,n,i);return r.resizingShapes=r.resizingShapes.filter((function(e){return!(xr(e,"bpmn:TextAnnotation")||function(e){return xr(e,"bpmn:Participant")&&!Er(e).processRef}(e)&&("y"===t&&Fr(e)||"x"===t&&!Fr(e)))})),r};const Lf={__depends__:[Of],spaceTool:["type",jf]};function If(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],(function(){this.clear(!1)}),this)}If.$inject=["eventBus","injector"],If.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},If.prototype.canExecute=function(e,t){const n={command:e,context:t},i=this._getHandler(e);let r=this._fire(e,"canExecute",n);if(void 0===r){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},If.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,!1!==e&&this._fire("changed",{trigger:"clear"})},If.prototype.undo=function(){let e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),e=this._getUndoAction(),e&&e.id===t.id);)t=e;this._popAction()}},If.prototype.redo=function(){let e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),e=this._getRedoAction(),e&&e.id===t.id);)t=e;this._popAction()}},If.prototype.register=function(e,t){this._setHandler(e,t)},If.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},If.prototype.canUndo=function(){return!!this._getUndoAction()},If.prototype.canRedo=function(){return!!this._getRedoAction()},If.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},If.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},If.prototype._internalUndo=function(e){const t=e.command,n=e.context,i=this._getHandler(t);this._atomicDo((()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)}))},If.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const i=t?[e+"."+t,t]:[e];let r;n=this._eventBus.createEvent(n);for(const e of i)if(r=this._eventBus.fire("commandStack."+e,n),n.cancelBubble)break;return r},If.prototype._createId=function(){return this._uid++},If.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},If.prototype._internalExecute=function(e,t){const n=e.command,i=e.context,r=this._getHandler(n);if(!r)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),r.preExecute&&r.preExecute(i),this._fire(n,"preExecuted",e)),this._atomicDo((()=>{this._fire(n,"execute",e),r.execute&&this._markDirty(r.execute(i)),this._executedAction(e,t),this._fire(n,"executed",e)})),t||(this._fire(n,"postExecute",e),r.postExecute&&r.postExecute(i),this._fire(n,"postExecuted",e)),this._popAction()},If.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in or phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},If.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:T("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},If.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=h(e)?e:[e],t.dirty=t.dirty.concat(e))},If.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},If.prototype._revertedAction=function(e){this._stackIdx--},If.prototype._getHandler=function(e){return this._handlerMap[e]},If.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const $f={commandStack:["type",If]};function zf(e,t){if("function"!=typeof t)throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}function Ff(e,t,n){aa.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,(function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=Hf(n),t.validatedShapes=Hf(i)})),i&&t.on("shape.move.start",250,(function(e){var t=e.context,n=t.shapes,r=[];x(n,(function(e){x(e.labels,(function(n){n.hidden||-1!==t.shapes.indexOf(n)||r.push(n),e.labelTarget&&r.push(e)}))})),x(r,(function(e){i.makeDraggable(t,e,!0)}))})),this.preExecuted("elements.move",1400,(function(e){var t=e.context.closure,n=t.enclosedElements,i=[];x(n,(function(e){x(e.labels,(function(e){n[e.id]||i.push(e)}))})),t.addAll(i)})),this.preExecute(["connection.delete","shape.delete"],(function(e){var t=e.context;zf((t.connection||t.shape).labels,(function(e){n.removeShape(e,{nested:!0})}))})),this.execute("shape.delete",(function(e){var t=e.context,n=t.shape,i=n.labelTarget;i&&(t.labelTargetIndex=Ct(i.labels,n),t.labelTarget=i,n.labelTarget=null)})),this.revert("shape.delete",(function(e){var t=e.context,n=t.shape,i=t.labelTarget,r=t.labelTargetIndex;i&&(St(i.labels,n,r),n.labelTarget=i)}))}function Hf(e){return _(e,(function(t){return-1===e.indexOf(t.labelTarget)}))}e(Ff,aa),Ff.$inject=["injector","eventBus","modeling"];const Vf={__init__:["labelSupport"],labelSupport:["type",Ff]};var Wf="attach-ok";function Gf(e,t,n,i,r){aa.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",1401,(function(e){var t,n,i=e.context,r=i.shapes,o=i.validatedShapes;i.shapes=(n=Uf(t=r),A("id",t,n)),i.validatedShapes=function(e){var t=P(e,"id");return _(e,(function(e){for(;e;){if(e.host&&t[e.host.id])return!1;e=e.parent}return!0}))}(o)})),o&&t.on("shape.move.start",251,(function(e){var t=e.context;x(Uf(t.shapes),(function(e){o.makeDraggable(t,e,!0),x(e.labels,(function(e){o.makeDraggable(t,e,!0)}))}))})),o&&t.on("shape.move.start",(function(e){var i=e.context.shapes;if(1===i.length){var r=i[0].host;r&&(n.addMarker(r,Wf),t.once(["shape.move.out","shape.move.cleanup"],(function(){n.removeMarker(r,Wf)})))}})),this.preExecuted("elements.move",1401,(function(e){var t=e.context,n=t.closure;x(Uf(t.shapes),(function(e){n.add(e,n.topLevel[e.host.id])}))})),this.postExecuted("elements.move",(function(e){var t=e.context,n=t.shapes,i=t.newHost;i&&1!==n.length||x(i?n:_(n,(function(e){var t,i=e.host;return function(e){return!!e.host}(e)&&(t=i,!(-1!==n.indexOf(t)))})),(function(e){r.updateAttachment(e,i)}))})),this.postExecuted("elements.move",(function(e){x(e.context.shapes,(function(e){x(e.attachers,(function(e){x(e.outgoing.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)})),x(e.incoming.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)}))}))}))})),this.postExecute("shape.create",(function(e){var t=e.context,n=t.shape,i=t.host;i&&r.updateAttachment(n,i)})),this.postExecute("shape.replace",(function(e){var t=e.context,n=t.oldShape,o=t.newShape;zf(n.attachers,(function(e){"attach"===i.allowed("elements.move",{target:o,shapes:[e]})?r.updateAttachment(e,o):r.removeShape(e)})),o.attachers.length&&x(o.attachers,(function(e){var t=Xu(e,n,o);r.moveShape(e,t,e.parent)}))})),this.postExecute("shape.resize",(function(e){var t=e.context,n=t.shape,i=t.oldBounds,o=t.newBounds,a=n.attachers;!1!==(t.hints||{}).attachSupport&&x(a,(function(e){var t=Xu(e,i,o);r.moveShape(e,t,e.parent),x(e.labels,(function(e){r.moveShape(e,t,e.parent)}))}))})),this.preExecute("shape.delete",(function(e){var t=e.context.shape;zf(t.attachers,(function(e){r.removeShape(e)})),t.host&&r.updateAttachment(t,null)}))}function Uf(e){return a(C(e,(function(e){return e.attachers||[]})))}e(Gf,aa),Gf.$inject=["injector","eventBus","canvas","rules","modeling"];const qf={__depends__:[Pp],__init__:["attachSupport"],attachSupport:["type",Gf]};function Kf(e){this._model=e}function Yf(e,t,n,i){aa.call(this,e),this._bpmnFactory=t,this._translate=i;var r=this;function o(e){x(e.context.oldRoot.children,(function(e){xr(e,"bpmn:BaseElement")&&r.updateParent(e)}))}function a(e){var t=e.context.shape;xr(t,"bpmn:BaseElement")&&r.updateBounds(t)}function s(e){r.updateConnection(e.context)}function c(e){r.updateConnectionWaypoints(e.context.connection)}function p(e){r.updateAttachment(e.context)}function l(e){const{element:n}=e.context,i=Xr(n),r=Sr(n),o=r&&r.get("label");Ur(n)||va(n)||(i&&!o?r.set("label",t.create("bpmndi:BPMNLabel")):!i&&o&&r.set("label",void 0))}this.executed(["connection.layout","connection.create"],(function(e){var t,i=e.context,r=i.hints||{};i.cropped||!1===r.createElementsBehavior||((t=i.connection).waypoints=n.getCroppedWaypoints(t),i.cropped=!0)})),this.reverted(["connection.layout"],(function(e){delete e.context.cropped})),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Xf((function(e){var t=e.context;r.updateParent(t.shape||t.connection,t.oldParent)}))),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Xf((function(e){var t=e.context,n=t.shape||t.connection,i=t.parent||t.newParent;r.updateParent(n,i)}))),this.executed(["canvas.updateRoot"],o),this.reverted(["canvas.updateRoot"],o),this.executed(["shape.move","shape.create","shape.resize"],Xf((function(e){"label"!==e.context.shape.type&&a(e)}))),this.reverted(["shape.move","shape.create","shape.resize"],Xf((function(e){"label"!==e.context.shape.type&&a(e)}))),e.on("shape.changed",(function(e){"label"===e.element.type&&a({context:{shape:e.element}})})),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Xf(s)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Xf(s)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Xf(c)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Xf(c)),this.executed("connection.reconnect",Xf((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=Er(n),a=Er(i),s=Er(r);o.conditionExpression&&!wr(s,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(t.oldConditionExpression=o.conditionExpression,delete o.conditionExpression),i!==r&&a.default===o&&(t.oldDefault=a.default,delete a.default)}))),this.reverted("connection.reconnect",Xf((function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=Er(n),a=Er(i),s=Er(r);t.oldConditionExpression&&(o.conditionExpression=t.oldConditionExpression),t.oldDefault&&(a.default=t.oldDefault,delete s.default)}))),this.executed(["element.updateAttachment"],Xf(p)),this.reverted(["element.updateAttachment"],Xf(p)),this.executed("element.updateLabel",Xf(l)),this.reverted("element.updateLabel",Xf(l))}function Xf(e){return function(t){var n=t.context;xr(n.shape||n.connection||n.element,"bpmn:BaseElement")&&e(t)}}function Zf(e,t,n){Hn.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function Qf(e,t,n){return void 0===t[n]?t:(e[n]=t[n],H(t,[n]))}function Jf(e,t){this._modeling=e,this._canvas=t}function em(e){this._modeling=e}function tm(e,t){this._canvas=e,this._layouter=t}Kf.$inject=["moddle"],Kf.prototype._needsId=function(e){return wr(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},Kf.prototype._ensureId=function(e){var t;e.id?this._model.ids.claim(e.id,e):(t=xr(e,"bpmn:Activity")?"Activity":xr(e,"bpmn:Event")?"Event":xr(e,"bpmn:Gateway")?"Gateway":wr(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e)))},Kf.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Kf.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Kf.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",z({bpmnElement:e,bounds:this.createDiBounds()},t))},Kf.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Kf.prototype.createDiWaypoints=function(e){var t=this;return C(e,(function(e){return t.createDiWaypoint(e)}))},Kf.prototype.createDiWaypoint=function(e){return this.create("dc:Point",F(e,["x","y"]))},Kf.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",z({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},Kf.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",z({bpmnElement:e},t))},e(Yf,aa),Yf.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Yf.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Yf.prototype.updateParent=function(e,t){if(!(dn(e)||xr(e,"bpmn:DataStoreReference")&&e.parent&&xr(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=Sr(e),o=n&&n.businessObject,a=Sr(n);xr(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,t&&t.businessObject),xr(e,"bpmn:DataOutputAssociation")&&(o=e.source?e.source.businessObject:null),xr(e,"bpmn:DataInputAssociation")&&(o=e.target?e.target.businessObject:null),this.updateSemanticParent(i,o),xr(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,a)}},Yf.prototype.updateBounds=function(e){var t=Sr(e),n=function(e){if(xr(e,"bpmn:Activity")){var t=Sr(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}(e);if(n){var i=Xa(n,t.get("bounds"));z(n,{x:e.x+i.x,y:e.y+i.y})}var r=dn(e)?this._getLabel(t):t,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),z(o,{x:e.x,y:e.y,width:e.width,height:e.height})},Yf.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(xr(n,"bpmn:Lane")&&Et(n.get("flowNodeRef"),e),xr(t,"bpmn:Lane")&&St(t.get("flowNodeRef"),e))},Yf.prototype.updateDiConnection=function(e,t,n){var i=Sr(e),r=Sr(t),o=Sr(n);i.sourceElement&&i.sourceElement.bpmnElement!==Er(t)&&(i.sourceElement=t&&r),i.targetElement&&i.targetElement.bpmnElement!==Er(n)&&(i.targetElement=n&&o)},Yf.prototype.updateDiParent=function(e,t){if(t&&!xr(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(Et(n,e),e.$parent=null)}},Yf.prototype.getLaneSet=function(e){var t,n;return xr(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(xr(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},Yf.prototype.updateSemanticParent=function(e,t,n){var i,r=this._translate;if(e.$parent!==t&&(!xr(e,"bpmn:DataInput")&&!xr(e,"bpmn:DataOutput")||(xr(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(xr(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(xr(e,"bpmn:FlowElement")){if(t)if(xr(t,"bpmn:Participant"))t=t.processRef;else if(xr(t,"bpmn:Lane"))do{t=t.$parent.$parent}while(xr(t,"bpmn:Lane"));i="flowElements"}else if(xr(e,"bpmn:Artifact")){for(;t&&!xr(t,"bpmn:Process")&&!xr(t,"bpmn:SubProcess")&&!xr(t,"bpmn:Collaboration");){if(xr(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(xr(e,"bpmn:MessageFlow"))i="messageFlows";else if(xr(e,"bpmn:Participant")){i="participants";var o,a=e.processRef;a&&(o=function(e){for(;e&&!xr(e,"bpmn:Definitions");)e=e.$parent;return e}(e.$parent||t),e.$parent&&(Et(o.get("rootElements"),a),a.$parent=null),t&&(St(o.get("rootElements"),a),a.$parent=o))}else xr(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":xr(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:e.id,parent:t.id}));var s;if(e.$parent&&Et(s=e.$parent.get(i),e),t?((s=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var c=n.get(i);Et(s,e),t&&(c||(c=[],t.set(i,c)),c.push(e))}}},Yf.prototype.updateConnectionWaypoints=function(e){Sr(e).set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Yf.prototype.updateConnection=function(e){var t,n=e.connection,i=Er(n),r=n.source,o=Er(r),a=n.target,s=Er(n.target);if(xr(i,"bpmn:DataAssociation"))xr(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=o,t=e.parent||e.newParent||s,this.updateSemanticParent(i,s,t)):xr(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t),i.targetRef=s);else{var c=xr(i,"bpmn:SequenceFlow");i.sourceRef!==o&&(c&&(Et(i.sourceRef&&i.sourceRef.get("outgoing"),i),o&&o.get("outgoing")&&o.get("outgoing").push(i)),i.sourceRef=o),i.targetRef!==s&&(c&&(Et(i.targetRef&&i.targetRef.get("incoming"),i),s&&s.get("incoming")&&s.get("incoming").push(i)),i.targetRef=s)}this.updateConnectionWaypoints(n),this.updateDiConnection(n,r,a)},Yf.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},e(Zf,Hn),Zf.$inject=["bpmnFactory","moddle","translate"],Zf.prototype._baseCreate=Hn.prototype.create,Zf.prototype.create=function(e,t){if("label"===e){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,z({type:"label",di:n},Wr,t))}return this.createElement(e,t)},Zf.prototype.createElement=function(e,t){var n,i,r,o=this._translate,a=(t=z({},t||{})).businessObject,s=t.di;if(!a){if(!t.type)throw new Error(o("no shape type specified"));yr(a=this._bpmnFactory.create(t.type))}if(!wr(s,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])){var c=z({},s||{},{id:a.id+"_di"});s="root"===e?this._bpmnFactory.createDiPlane(a,c):"connection"===e?this._bpmnFactory.createDiEdge(a,c):this._bpmnFactory.createDiShape(a,c)}return xr(a,"bpmn:Group")&&(t=z({isFrame:!0},t)),(t=function(e,t,n){return x(["processRef","isInterrupting","associationDirection","isForCompensation"],(function(n){t=Qf(e,t,n)})),t}(a,t)).isExpanded&&(t=Qf(s,t,"isExpanded")),xr(a,"bpmn:SubProcess")&&(t.collapsed=!zr(a,s)),xr(a,"bpmn:ExclusiveGateway")&&(v(t,"isMarkerVisible")?void 0===t.isMarkerVisible?s.isMarkerVisible=!1:t=Qf(s,t,"isMarkerVisible"):s.isMarkerVisible=!0),l(t.triggeredByEvent)&&(a.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),l(t.cancelActivity)&&(a.cancelActivity=t.cancelActivity,delete t.cancelActivity),t.eventDefinitionType&&(i=a.get("eventDefinitions")||[],r=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),"bpmn:ConditionalEventDefinition"===t.eventDefinitionType&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=a,a.eventDefinitions=i,delete t.eventDefinitionType),n=this.getDefaultSize(a,s),t=z({id:a.id},n,t,{businessObject:a,di:s}),this._baseCreate(e,t)},Zf.prototype.getDefaultSize=function(e,t){var n=Er(e);return t=t||Sr(e),xr(n,"bpmn:SubProcess")?zr(n,t)?{width:350,height:200}:{width:100,height:80}:xr(n,"bpmn:Task")?{width:100,height:80}:xr(n,"bpmn:Gateway")?{width:50,height:50}:xr(n,"bpmn:Event")?{width:36,height:36}:xr(n,"bpmn:Participant")?zr(n,t)?{width:600,height:250}:{width:400,height:60}:xr(n,"bpmn:Lane")?{width:400,height:100}:xr(n,"bpmn:DataObjectReference")?{width:36,height:50}:xr(n,"bpmn:DataStoreReference")?{width:50,height:50}:xr(n,"bpmn:TextAnnotation")?{width:100,height:30}:xr(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},Zf.prototype.createParticipantShape=function(e){return d(e)||(e={isExpanded:e}),!1!==(e=z({type:"bpmn:Participant"},e||{})).isExpanded&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},Jf.$inject=["modeling","canvas"],Jf.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;x(n,(function(e){var n={x:0,y:0};l(i.left)?n.x=i.left-e.x:l(i.right)?n.x=i.right-e.width-e.x:l(i.center)?n.x=i.center-Math.round(e.width/2)-e.x:l(i.top)?n.y=i.top-e.y:l(i.bottom)?n.y=i.bottom-e.height-e.y:l(i.middle)&&(n.y=i.middle-Math.round(e.height/2)-e.y),t.moveElements([e],n,e.parent)}))},Jf.prototype.postExecute=function(e){},em.$inject=["modeling"],em.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},em.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,S(t.outgoing,(function(e){return e.target===n}))||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},tm.$inject=["canvas","layouter"],tm.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},tm.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var nm=Math.round;function im(e){this._modeling=e}im.$inject=["modeling"],im.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;x(t,(function(e){f(e.x)||(e.x=0),f(e.y)||(e.y=0)}));var s=vt(_(t,(function(e){return!e.hidden})));x(t,(function(e){hn(e)&&(e.waypoints=C(e.waypoints,(function(e){return{x:nm(e.x-s.x-s.width/2+r.x),y:nm(e.y-s.y-s.height/2+r.y)}}))),z(e,{x:nm(e.x-s.x-s.width/2+r.x),y:nm(e.y-s.y-s.height/2+r.y)})}));var c=ht(t),p={};x(t,(function(e){if(hn(e))p[e.id]=f(i)?a.createConnection(p[e.source.id],p[e.target.id],i,e,e.parent||n,o):a.createConnection(p[e.source.id],p[e.target.id],e,e.parent||n,o);else{var t=z({},o);-1===c.indexOf(e)&&(t.autoResize=!1),dn(e)&&(t=H(t,["attach"])),p[e.id]=f(i)?a.createShape(e,F(e,["x","y","width","height"]),e.parent||n,i,t):a.createShape(e,F(e,["x","y","width","height"]),e.parent||n,t)}})),e.elements=R(p)};var rm=Math.round;function om(e){this._canvas=e}function am(e){om.call(this,e)}om.$inject=["canvas"],om.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return void 0!==n.width?z(t,n):z(t,{x:n.x-rm(t.width/2),y:n.y-rm(t.height/2)}),this._canvas.addShape(t,i,r),t},om.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},e(am,om),am.$inject=["canvas"];var sm=om.prototype.execute;am.prototype.execute=function(e){var t=e.shape;return function(e){["width","height"].forEach((function(t){void 0===e[t]&&(e[t]=0)}))}(t),t.labelTarget=e.labelTarget,sm.call(this,e)};var cm=om.prototype.revert;function pm(e,t){this._canvas=e,this._modeling=t}function lm(e,t){this._modeling=e,this._elementRegistry=t}function um(e,t){this._canvas=e,this._modeling=t}function hm(e){this._modeling=e}am.prototype.revert=function(e){return e.shape.labelTarget=null,cm.call(this,e)},pm.$inject=["canvas","modeling"],pm.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;zf(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),zf(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})}))},pm.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Ct(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},pm.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,St(n.children,t,i),this._canvas.addConnection(t,n),t},lm.$inject=["modeling","elementRegistry"],lm.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;x(e.elements,(function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))}))},um.$inject=["canvas","modeling"],um.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;zf(n.incoming,(function(e){t.removeConnection(e,{nested:!0})})),zf(n.outgoing,(function(e){t.removeConnection(e,{nested:!0})})),zf(n.children,(function(e){hn(e)?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})}))},um.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=Ct(i.children,n),t.removeShape(n),n},um.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return St(i.children,n,r),t.addShape(n,i),n},hm.$inject=["modeling"];var dm={x:"y",y:"x"};function fm(e,t){this._layouter=e,this._canvas=t}function mm(){}function gm(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function vm(e){this._modeling=e}function ym(e){this._helper=new vm(e)}function bm(e){this._modeling=e,this._helper=new vm(e)}function _m(e){this._modeling=e}function xm(e){return e.original||e}function wm(e,t){this._modeling=e,this._rules=t}function Em(e){this._modeling=e}function Sm(e){this._modeling=e}function Cm(e){return z({},e)}function km(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function Rm(e,t,n){var i=km(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i] required");var r=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||function(e,t){return w(t,(function(t,n){return t[n]=e.get(n),t}),{})}(n,k(i));return $m(n,i),e.oldProperties=o,e.changed=r,r},Im.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return $m(n,t),i},Im.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return xr(e,"bpmn:DataObject")?function(e,t){return t.filter((function(t){return xr(t,"bpmn:DataObjectReference")&&Er(t).dataObjectRef===e}))}(e,t):[]};var zm="default",Fm="id",Hm={width:0,height:0};function Vm(e,t,n,i,r){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=r}function Wm(e,t){return Fm in e&&e[Fm]!==t[Fm]}function Gm(e,t){var n=e.businessObject,i=Sr(e);x(t,(function(e,t){"di"!==t?n.set(t,e):i&&function(e,t){x(t,(function(t,n){e.set(n,t)}))}(i,e)}))}Vm.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],Vm.prototype.execute=function(e){var t=e.element,n=[t],i=this._translate;if(!t)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=t.businessObject,s=function(e){var t=z({},e);return Um.forEach((function(n){n in e&&(t[n]=Er(t[n]))})),t}(e.properties),c=e.oldProperties||function(e,t){var n=k(t),i=e.businessObject,r=Sr(e);return w(n,(function(e,n){return e[n]="di"!==n?i.get(n):function(e,t){return w(t,(function(t,n){return t[n]=e&&e.get(n),t}),{})}(r,k(t.di)),e}),{})}(t,s);return Wm(s,a)&&(o.unclaim(a[Fm]),r.updateId(t,s[Fm]),o.claim(s[Fm],a)),zm in s&&(s[zm]&&n.push(r.get(s[zm].id)),a[zm]&&n.push(r.get(a[zm].id))),Gm(t,s),e.oldProperties=c,e.changed=n,n},Vm.prototype.postExecute=function(e){var t=e.element.label,n=t&&Er(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,Hm)}},Vm.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Gm(t,i),Wm(n,r)&&(a.unclaim(n[Fm]),o.updateId(t,i[Fm]),a.claim(i[Fm],r)),e.changed};var Um=["default"];function qm(e,t){this._canvas=e,this._modeling=t}function Km(e,t){this._modeling=e,this._spaceTool=t}function Ym(e,t){this._modeling=e,this._translate=t}function Xm(e,t){this._modeling=e,this._spaceTool=t}qm.$inject=["canvas","modeling"],qm.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=Sr(r);return t.setRootElement(n),t.removeRootElement(r),St(a.rootElements,i),i.$parent=a,Et(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,e.oldRoot=r,[]},qm.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,a=i.$parent,s=Sr(n);return t.setRootElement(r),t.removeRootElement(n),Et(a.rootElements,i),i.$parent=null,St(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s,[]},Km.$inject=["modeling","spaceTool"],Km.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=_u(i),a=o===i,s=a?i:i.parent;bu(s).length||n.createShape({type:"bpmn:Lane"},{x:i.x+vu,y:i.y,width:i.width-vu,height:i.height},s);var c=[];mt(o,(function(e){return c.push(e),e.label&&c.push(e.label),e===i?[]:_(e.children,(function(e){return e!==i}))}));var p="top"===r?-120:120,l="top"===r?i.y:i.y+i.height,u=l+("top"===r?10:-10),h="top"===r?"n":"s",d=t.calculateAdjustments(c,"y",p,u);t.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},h,u),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?vu:0),y:l-("top"===r?120:0),width:i.width-(a?vu:0),height:120},s)},Ym.$inject=["modeling","translate"],Ym.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=bu(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var s,c,p,l,u,h=Math.round(i.height/r);for(u=0;u0||p.bottom<0?-n:n,a=s.calculateAdjustments(u,"y",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(p.left||p.right)&&(n=p.right||p.left,i=e.x+(p.right?e.width:0)+(p.right?-10:100),r=p.right?"e":"w",o=p.left>0||p.right<0?-n:n,a=s.calculateAdjustments(h,"x",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var Zm="flowNodeRef",Qm="lanes";function Jm(e){this._elementRegistry=e}function eg(e){this._moddle=e}Jm.$inject=["elementRegistry"],Jm.prototype._computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(e){-1===n.indexOf(e)&&(o.push(e),n.push(e))}return t.forEach((function(e){var t=_u(e);if(t&&-1===n.indexOf(t)){var i=t.children.filter((function(e){return xr(e,"bpmn:FlowNode")}));i.forEach(a),n.push(t)}})),e.forEach(a),o.forEach((function(e){var t=e.businessObject,n=t.get(Qm).slice(),o=function(e){if(!e.parent)return[];var t=function(e){var t=_u(e);return r[t.id]||(r[t.id]=yu(t)),r[t.id]}(e);return t.filter((function(t){return n=e,i=gn(t),r=n.x+n.width/2,o=n.y+n.height/2,r>i.left&&ri.top&&o: must be specified as : with start/end in { h,v,t,r,b,l }");if(bg(n)){var i=function(e,t,n){return dg(e,t,n)}(e,t,n),r=function(e,t,n){var i=dg(t,e,fg(n));return{waypoints:i.waypoints.slice().reverse(),directions:fg(i.directions),turnNextDirections:i.turnNextDirections}}(e,t,n),o=function(e,t){var n=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(n="h"==n?"v":"h"),t.turnNextDirections&&(i="h"==i?"v":"h");var r=n+":"+i;return{waypoints:mg(e.waypoints[e.waypoints.length-1],t.waypoints[0],r),directions:r}}(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return function(e,t,n){var i=lg((t.x-e.x)/2+e.x),r=lg((t.y-e.y)/2+e.y);if("h:v"===n)return[{x:t.x,y:e.y}];if("v:h"===n)return[{x:e.x,y:t.y}];if("h:h"===n)return[{x:i,y:e.y},{x:i,y:t.y}];if("v:v"===n)return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(e,t,n)}function gg(e,t,n,i,r){var o=function(e,t){if(p(e))return[];!function(e){if(!h(e))throw new Error("must supply array")}(e);const n=N(t);return e.filter((function(e,t){return!n(e,t)}))}(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=bn(e,t,hg[o]||0),s=function(e,t){if(bg(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}(a,o);n=n||yn(e),i=i||yn(t);var c=s.split(":"),l=_g(n,e,c[0],function(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}(a));return function(e,t,n){var i=mg(e,t,n);return i.unshift(e),i.push(t),xg(i)}(l,_g(i,t,c[1],a),s)}function vg(e,t,n){return function(e,t,n){return e>=t&&e<=n}(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function yg(e,t,n,i){if(function(e){return e.length<3||!(e.length>4)&&!!y(e,(function(t,n){var i=e[n-1];return i&&kt(t,i)<3}))}(i))return null;var r,o=i[0],a=i.slice();return a[0]=n,a[1]=function(e,t,n){switch(Tt(t,e)){case"v":return{x:n.x,y:e.y};case"h":return{x:e.x,y:n.y}}return{x:e.x,y:e.y}}(a[1],o,n),r=function(e,t,n){var i;for(i=e.length-2;0!==i;i--)if(Mt(e[i],t,ug)||Mt(e[i],n,ug))return e.slice(i);return e}(a,e,t),r!==a&&(a=yg(e,t,n,r)),a&&Tt(a)?null:a}function bg(e){return e&&/t|r|b|l/.test(e)}function _g(e,t,n,i){if("h"===n&&(n=/left/.test(i)?"l":"r"),"v"===n&&(n=/top/.test(i)?"t":"b"),"t"===n)return{original:e,x:e.x,y:t.y};if("r"===n)return{original:e,x:t.x+t.width,y:e.y};if("b"===n)return{original:e,x:e.x,y:t.y+t.height};if("l"===n)return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function xg(e){return e.reduce((function(t,n,i){return Rt(t[t.length-1],e[i+1],n,0)||t.push(n),t}),[])}var wg=40,Eg={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},Sg={top:"t",right:"r",bottom:"b",left:"l"};function Cg(){}function kg(e,t){return xr(t,"bpmn:Participant")?"source":xr(e,"bpmn:Participant")?"target":Ag(t)?"source":Ag(e)||xr(t,"bpmn:Event")?"target":xr(e,"bpmn:Event")?"source":null}function Rg(e){return Ag(e)?"target":"source"}function Pg(e,t){return e?e.original||e:yn(t)}function Tg(e,t){return xr(t,"bpmn:Activity")&&xr(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Ag(e){return xr(e,"bpmn:SubProcess")&&zr(e)}function Mg(e,t){return e===t}function Dg(e){var t=/right|left/.exec(e);return t&&t[0]}function Bg(e){var t=/top|bottom/.exec(e);return t&&t[0]}function Ng(e){return"right"===e||"left"===e}function Og(e,t){var n=t.waypoints,i=n&&n.length&&bn(n[0],e);return"top"===i?["t:r"]:"right"===i?["r:b"]:"left"===i?["l:t"]:["b:l"]}function jg(e,t,n){var i,r,o,a,s=yn(e),c=yn(t),p=(a=(o=e).host,bn(yn(o),a,-10)),l=Mg(e.host,t),u=-1!==["top","right","bottom","left"].indexOf(p),h=bn(c,s,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return l?function(e,t,n,i,r){var o=t?e:Bg(e);return[Sg[o]+":"+(t?Ng(e)?Lg("y",n,i,r)?"h":"b":Lg("x",n,i,r)?"v":"l":"v")]}(p,u,e,t,n):(i=function(e,t,n){return n?Sg[e]:Mg(Bg(e),Bg(t))||function(e,t){return Eg[e]===t}(Dg(e),Dg(t))?Sg[Bg(e)]:Sg[Dg(e)]}(p,h,u),r=function(e,t,n){return n?Ng(e)?function(e,t){var n=Dg(e),i=Eg[n];return-1!==t.indexOf(i)}(e,t)||Mg(e,t)?"h":"v":function(e,t){var n=Bg(e),i=Eg[n];return-1!==t.indexOf(i)}(e,t)||Mg(e,t)?"v":"h":Ng(t)||Mg(Bg(e),Bg(t))&&Dg(t)?"h":"v"}(p,h,u),[i+":"+r])}function Lg(e,t,n,i){var r=wg;return!(Ig(e,i,n,r)||Ig(e,i,{x:n.x+n.width,y:n.y+n.height},r)||Ig(e,i,yn(t),r))}function Ig(e,t,n,i){return Math.abs(t[e]-n[e])!u(e)))})},Vg.prototype.cleanUp=function(){this._complexPreview.cleanUp()},Vg.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];const Wg={__depends__:[hp,Ll,Fg],__init__:["appendPreview"],appendPreview:["type",Vg]};var Gg=Math.min,Ug=Math.max;function qg(e){e.preventDefault()}function Kg(e){e.stopPropagation()}function Yg(e){this.container=e.container,this.parent=me('
      '),this.content=ge("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=I(this.autoResize,this),this.handlePaste=I(this.handlePaste,this)}function Xg(e,t){this._eventBus=e,this._providers=[],this._textbox=new Yg({container:t.getContainer(),keyHandler:I(this._handleKey,this),resizeHandler:I(this._handleResize,this)})}Yg.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var s=F(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);z(r.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},s);var c=F(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return z(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},c),i.centerVertically&&z(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},c),o.innerText=n,le.bind(o,"keydown",this.keyHandler),le.bind(o,"mousedown",Kg),le.bind(o,"paste",this.handlePaste),i.autoResize&&le.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},Yg.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},Yg.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,"\n"),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},Yg.prototype._insertTextIE=function(e){var t,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,s=r.startOffset,c=r.endOffset,p=r.commonAncestorContainer,l=(t=p.childNodes,[].slice.call(t));if(function(e){return e.nodeType===Node.TEXT_NODE}(p)){var u=o.textContent;o.textContent=u.substring(0,s)+e+u.substring(c),n=o,i=s+e.length}else if(o===this.content&&a===this.content){var h=document.createTextNode(e);this.content.insertBefore(h,l[s]),n=h,i=h.textContent.length}else{var d=l.indexOf(o),f=l.indexOf(a);l.forEach((function(t,n){n===d?t.textContent=o.textContent.substring(0,s)+e+a.textContent.substring(c):n>d&&n<=f&&ye(t)})),n=o,i=s+e.length}n&&void 0!==i&&setTimeout((function(){self.setSelection(n,i)}))},Yg.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight
      ');var u=function(n){qg(n),Kg(n);var u=Gg(Ug(p+n.clientX-s,i),o),h=Gg(Ug(l+n.clientY-c,r),a);t.style.width=u+"px",t.style.height=h+"px",e.resizeHandler({width:p,height:l,dx:n.clientX-s,dy:n.clientY-c})},h=function(e){qg(e),Kg(e),le.unbind(document,"mousemove",u,!1),le.unbind(document,"mouseup",h,!1)};le.bind(n,"mousedown",(function(e){qg(e),Kg(e),s=e.clientX,c=e.clientY;var n=t.getBoundingClientRect();p=n.width,l=n.height,le.bind(document,"mousemove",u),le.bind(document,"mouseup",h)}))}z(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},Yg.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),le.unbind(t,"keydown",this.keyHandler),le.unbind(t,"mousedown",Kg),le.unbind(t,"input",this.autoResize),le.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),ye(n)),ye(e)},Yg.prototype.getValue=function(){return this.content.innerText.trim()},Yg.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},Yg.prototype.setSelection=function(e,t){var n=document.createRange();null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},Xg.$inject=["eventBus","canvas"],Xg.prototype.registerProvider=function(e){this._providers.push(e)},Xg.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},Xg.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Xg.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},Xg.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},Xg.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===e.context.text&&i.height===n.height&&i.width===n.width||(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},Xg.prototype.getValue=function(){return this._textbox.getValue()},Xg.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return 27===t?(e.preventDefault(),this.cancel()):13!==t||e.shiftKey?void 0:(e.preventDefault(),this.complete())},Xg.prototype._handleResize=function(e){this._fire("resize",e)},Xg.prototype.activate=function(e){var t;this.isActive()&&this.cancel();var n=y(this._providers,(function(n){return(t=n.activate(e))?n:null}));return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};const Zg={__depends__:[Fo],__init__:["directEditing"],directEditing:["type",Xg]};function Qg(e){return function(t){var n=t.target,i=Er(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=!!n.triggeredByEvent==!!i.triggeredByEvent,c=void 0===n.isExpanded||n.isExpanded===zr(e);return!(o&&a&&s&&c)}}var Jg=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],ev=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],tv=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],nv=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],iv=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],rv=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],ov=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],av=ov,sv=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}}],cv=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],pv=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],lv=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],uv=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],hv=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],dv=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];const fv='\n \n \n \n \n ',mv='\n \n \n \n \n \n ';function gv(e,t,n,i,r,o,a,s){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this._moddleCopy=s,this._register()}gv.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"],gv.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},gv.prototype.getPopupMenuEntries=function(e){var t=e.businessObject,n=this._rules,i=[];if(h(e)||!n.allowed("shape.replace",{element:e}))return{};var r=Qg(e);return xr(t,"bpmn:DataObjectReference")?this._createEntries(e,cv):xr(t,"bpmn:DataStoreReference")&&!xr(e.parent,"bpmn:Collaboration")?this._createEntries(e,pv):xr(t,"bpmn:StartEvent")&&!xr(t.$parent,"bpmn:SubProcess")?(i=_(Jg,r),this._createEntries(e,i)):xr(t,"bpmn:Participant")?(i=_(dv,(function(t){return zr(e)!==t.target.isExpanded})),this._createEntries(e,i)):xr(t,"bpmn:StartEvent")&&Hr(t.$parent)?(i=_(uv,(function(e){var n=!1!==e.target.isInterrupting,i=t.isInterrupting===n;return r(e)||!r(e)&&!i})),this._createEntries(e,i)):xr(t,"bpmn:StartEvent")&&!Hr(t.$parent)&&xr(t.$parent,"bpmn:SubProcess")?(i=_(ev,r),this._createEntries(e,i)):xr(t,"bpmn:EndEvent")?(i=_(nv,(function(e){return!("bpmn:CancelEventDefinition"==e.target.eventDefinitionType&&!xr(t.$parent,"bpmn:Transaction"))&&r(e)})),this._createEntries(e,i)):xr(t,"bpmn:BoundaryEvent")?(i=_(lv,(function(e){var n=e.target;if("bpmn:CancelEventDefinition"==n.eventDefinitionType&&!xr(t.attachedToRef,"bpmn:Transaction"))return!1;var i=!1!==n.cancelActivity,o=t.cancelActivity==i;return r(e)||!r(e)&&!o})),this._createEntries(e,i)):xr(t,"bpmn:IntermediateCatchEvent")||xr(t,"bpmn:IntermediateThrowEvent")?(i=_(tv,r),this._createEntries(e,i)):xr(t,"bpmn:Gateway")?(i=_(iv,r),this._createEntries(e,i)):xr(t,"bpmn:Transaction")?(i=_(ov,r),this._createEntries(e,i)):Hr(t)&&zr(e)?(i=_(av,r),this._createEntries(e,i)):xr(t,"bpmn:SubProcess")&&zr(e)?(i=_(rv,r),this._createEntries(e,i)):xr(t,"bpmn:AdHocSubProcess")&&!zr(e)?(i=_(sv,(function(e){var t=e.target,n="bpmn:SubProcess"===t.type,i=!0===t.isExpanded;return Qg(t)&&(!n||i)})),this._createEntries(e,i)):xr(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,hv):xr(t,"bpmn:FlowNode")?(i=_(sv,r),xr(t,"bpmn:SubProcess")&&!zr(e)&&(i=_(i,(function(e){return"Sub-process (collapsed)"!==e.label}))),this._createEntries(e,i)):{}},gv.prototype.getPopupMenuHeaderEntries=function(e){var t={};return xr(e,"bpmn:Activity")&&!Hr(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),xr(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),xr(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),!xr(e,"bpmn:SubProcess")||xr(e,"bpmn:Transaction")||Hr(e)||(t={...t,...this._getAdHocHeaderEntries(e)}),uh(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t},gv.prototype._createEntries=function(e,t){var n={},i=this;return x(t,(function(t){n[t.actionName]=i._createEntry(t,e)})),n},gv.prototype._createSequenceFlowEntries=function(e,t){var n=Er(e),i={},r=this._modeling,o=this._moddle,a=this;return x(t,(function(t){switch(t.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(xr(n.sourceRef,"bpmn:ExclusiveGateway")||xr(n.sourceRef,"bpmn:InclusiveGateway")||xr(n.sourceRef,"bpmn:ComplexGateway")||xr(n.sourceRef,"bpmn:Activity"))&&(i={...i,[t.actionName]:a._createEntry(t,e,(function(){r.updateProperties(e.source,{default:n})}))});break;case"replace-with-conditional-flow":!n.conditionExpression&&xr(n.sourceRef,"bpmn:Activity")&&(i={...i,[t.actionName]:a._createEntry(t,e,(function(){var t=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:t})}))});break;default:xr(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(i={...i,[t.actionName]:a._createEntry(t,e,(function(){r.updateProperties(e,{conditionExpression:void 0})}))}),(xr(n.sourceRef,"bpmn:ExclusiveGateway")||xr(n.sourceRef,"bpmn:InclusiveGateway")||xr(n.sourceRef,"bpmn:ComplexGateway")||xr(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(i={...i,[t.actionName]:a._createEntry(t,e,(function(){r.updateProperties(e.source,{default:void 0})}))})}})),i},gv.prototype._createEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=e.label;return o&&"function"==typeof o&&(o=o(t)),n=n||function(){return r(t,e.target)},{label:i(o),className:e.className,action:n}},gv.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function i(n,i){if(i.active)return void t._modeling.updateProperties(e,{loopCharacteristics:void 0});const r=e.businessObject.get("loopCharacteristics"),o=t._moddle.create(i.options.loopCharacteristics);r&&t._moddleCopy.copyElement(r,o),o.set("isSequential",i.options.isSequential),t._modeling.updateProperties(e,{loopCharacteristics:o})}var r,o,a,s=Er(e).loopCharacteristics;return s&&(r=s.isSequential,o=void 0===s.isSequential,a=void 0!==s.isSequential&&!s.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:r,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:o,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},gv.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,i=e.businessObject.dataObjectRef;if(!i)return{};var r=i.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:r,action:function(n,r){t._modeling.updateModdleProperties(e,i,{isCollection:!r.active})}}}},gv.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,i=this._translate,r=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:i("Participant multiplicity"),active:!!r,action:function(i,r){var o;r.active||(o=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:o})}}}},gv.prototype._getAdHocHeaderEntries=function(e){var t=this._translate,n=xr(Er(e),"bpmn:AdHocSubProcess"),i=this._bpmnReplace.replaceElement;return{"toggle-adhoc":{className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:n,action:function(t,r){return i(e,n?{type:"bpmn:SubProcess"}:{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}}}},gv.prototype._getNonInterruptingHeaderEntries=function(e){const t=this._translate,n=Er(e),i=this,r=hh(e),o=xr(e,"bpmn:BoundaryEvent")?mv:fv,a=!n[r];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:a,action:function(){i._modeling.updateProperties(e,{[r]:!!a})}}}};const vv={__depends__:[Wc,gf,hp],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",gv]};function yv(e,t,n,i,r,o,a,s,c,p,l,u,h){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=p,this._rules=l,this._translate=u,this._eventBus=n,this._appendPreview=h,!1!==e.autoPlace&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,(function(e){var t=e.context.shape;if(jo(e)&&i.isOpen(t)){var n=i.getEntries(t);n.replace&&n.replace.action.click(e,t)}}))}function bv(e,t,n){var i=e.$instanceOf(t),r=!1;return x(e.eventDefinitions||[],(function(e){e.$type===n&&(r=!0)})),i&&r}yv.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"],yv.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&z(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(e,n){t.removeElements(n.slice())}}}}),n},yv.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return h(t)?E(t,(function(e){return n=e,-1!==t.indexOf(n);var n})):t},yv.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._popupMenu,s=this._rules,c=this._autoPlace,p=this._translate,l=this._appendPreview,u={};if("label"===e.type)return u;var d=e.businessObject;function f(e,t){r.start(e,t)}function m(e,t,n,r){function a(t,n){var a=i.createShape(z({type:e},r));o.start(t,a,{source:n}),l.cleanUp()}var s=c?function(t,n){var o=i.createShape(z({type:e},r));c.append(n,o),l.cleanUp()}:a,p=c?function(t,n){return l.create(n,e,r),()=>{l.cleanUp()}}:null;return{group:"model",className:t,title:n,action:{dragstart:a,click:s,hover:p}}}function g(e){return function(i,r){n.splitLane(r,e),t.open(r,!0)}}if(wr(d,["bpmn:Lane","bpmn:Participant"])&&zr(e)){var v=bu(e);z(u,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:p("Add lane above"),action:{click:function(e,t){n.addLane(t,"top")}}}}),v.length<2&&(e.height>=120&&z(u,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:p("Divide into two lanes"),action:{click:g(2)}}}),e.height>=180&&z(u,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:p("Divide into three lanes"),action:{click:g(3)}}})),z(u,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:p("Add lane below"),action:{click:function(e,t){n.addLane(t,"bottom")}}}})}xr(d,"bpmn:FlowNode")&&(xr(d,"bpmn:EventBasedGateway")?z(u,{"append.receive-task":m("bpmn:ReceiveTask","bpmn-icon-receive-task",p("Append receive task")),"append.message-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",p("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",p("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",p("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",p("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):bv(d,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?z(u,{"append.compensation-activity":m("bpmn:Task","bpmn-icon-task",p("Append compensation activity"),{isForCompensation:!0})}):xr(d,"bpmn:EndEvent")||d.isForCompensation||bv(d,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Hr(d)||z(u,{"append.end-event":m("bpmn:EndEvent","bpmn-icon-end-event-none",p("Append end event")),"append.gateway":m("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",p("Append gateway"),{isMarkerVisible:!0}),"append.append-task":m("bpmn:Task","bpmn-icon-task",p("Append task")),"append.intermediate-event":m("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",p("Append intermediate/boundary event"))})),a.isEmpty(e,"bpmn-replace")||z(u,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:p("Change element"),action:{click:function(e,n){var i=z(function(e){var n=t.getPad(e).html.getBoundingClientRect();return{x:n.left,y:n.bottom+5}}(n),{cursor:{x:e.x,y:e.y}});a.open(n,"bpmn-replace",i,{title:p("Change element"),width:300,search:!0})}}}}),xr(d,"bpmn:SequenceFlow")&&z(u,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",p("Add text annotation"))}),wr(d,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(u,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",p("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect to other element"),action:{click:f,dragstart:f}}}),xr(d,"bpmn:TextAnnotation")&&z(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using association"),action:{click:f,dragstart:f}}}),wr(d,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using data input association"),action:{click:f,dragstart:f}}}),xr(d,"bpmn:Group")&&z(u,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",p("Add text annotation"))});var y=s.allowed("elements.delete",{elements:[e]});return h(y)&&(y=y[0]===e),y&&z(u,{delete:{group:"edit",className:"bpmn-icon-trash",title:p("Delete"),action:{click:function(e,t){n.removeElements([t])}}}}),u};const _v={__depends__:[Wg,Zg,Ss,Xo,Pl,Kd,vv],__init__:["contextPadProvider"],contextPadProvider:["type",yv]};var xv={horizontal:["x","width"],vertical:["y","height"]};function wv(e,t){this._modeling=e,this._filters=[],this.registerFilter((function(e){var n=t.allowed("elements.distribute",{elements:e});return h(n)?n:n?e:[]}))}wv.$inject=["modeling","rules"],wv.prototype.registerFilter=function(e){if("function"!=typeof e)throw new Error("the filter has to be a function");this._filters.push(e)},wv.prototype.trigger=function(e,t){var n,i,r=this._modeling;if(!(e.length<3||(this._setOrientation(t),i=this._filterElements(e),(n=this._createGroups(i)).length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},wv.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(x(t,(function(e){r=e(r,n,i)})),r):e},wv.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');return x(M(e,i),(function(e,o){var a,s=n._findRange(e,i,r),c=t[t.length-1];c&&n._hasIntersection(c.range,s)?t[t.length-1].elements.push(e):(a={range:s,elements:[e]},t.push(a))})),t},wv.prototype._setOrientation=function(e){var t=xv[e];this._axis=t[0],this._dimension=t[1]},wv.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},wv.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};const Ev={__init__:["distributeElements"],distributeElements:["type",wv]};function Sv(e){Yc.call(this,e)}Sv.$inject=["eventBus"],e(Sv,Yc),Sv.prototype.init=function(){this.addRule("elements.distribute",(function(e){var t=e.elements;return!((t=ht(t=_(t,(function(e){var t=wr(e,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(e.labelTarget||t)})))).length<3)&&t}))};const Cv='\n \n \n \n ',kv='\n \n \n \n ';function Rv(e,t,n,i){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",900,this)}Rv.$inject=["popupMenu","distributeElements","translate","rules"],Rv.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&z(t,this._getEntries(e)),t},Rv.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},Rv.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,i=this._popupMenu;return{"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:Cv,action:function(n,r){t.trigger(e,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:kv,action:function(n,r){t.trigger(e,"vertical"),i.close()}}}};const Pv={__depends__:[Wc,Ev],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",Sv],distributeElementsMenuProvider:["type",Rv]};var Tv="is not a registered action";function Av(e,t){this._actions={};var n=this;e.on("diagram.init",(function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})}))}function Mv(e,t){return new Error(e+" "+t)}Av.$inject=["eventBus","injector"],Av.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),p=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",(function(){t.undo()})),this.register("redo",(function(){t.redo()}))),o&&i&&this.register("copy",(function(){var e=i.get();if(e.length)return o.copy(e)})),o&&this.register("paste",(function(){o.paste()})),r&&this.register("stepZoom",(function(e){r.stepZoom(e.value)})),a&&this.register("zoom",(function(e){a.zoom(e.value)})),n&&i&&s&&this.register("removeSelection",(function(){var e=i.get();if(e.length){var t,r=s.allowed("elements.delete",{elements:e});!1!==r&&(t=h(r)?r:e).length&&n.removeElements(t.slice())}})),c&&this.register("moveCanvas",(function(e){c.moveCanvas(e)})),p&&this.register("moveSelection",(function(e){p.moveSelection(e.direction,e.accelerated)}))},Av.prototype.trigger=function(e,t){if(!this._actions[e])throw Mv(e,Tv);return this._actions[e](t)},Av.prototype.register=function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);x(e,(function(e,t){n._registerAction(t,e)}))},Av.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw Mv(e,"is already registered");this._actions[e]=t},Av.prototype.unregister=function(e){if(!this.isRegistered(e))throw Mv(e,Tv);this._actions[e]=void 0},Av.prototype.getActions=function(){return Object.keys(this._actions)},Av.prototype.isRegistered=function(e){return!!this._actions[e]};const Dv={__init__:["editorActions"],editorActions:["type",Av]};function Bv(e){e.invoke(Av,this)}e(Bv,Av),Bv.$inject=["injector"],Bv.prototype._registerDefaultActions=function(e){Av.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),p=e.get("alignElements",!1),l=e.get("directEditing",!1),u=e.get("searchPad",!1),h=e.get("modeling",!1),d=e.get("contextPad",!1);t&&n&&i&&this._registerAction("selectElements",(function(){var e=t.getRootElement(),r=n.filter((function(t){return t!==e}));return i.select(r),r})),r&&this._registerAction("spaceTool",(function(){r.toggle()})),o&&this._registerAction("lassoTool",(function(){o.toggle()})),a&&this._registerAction("handTool",(function(){a.toggle()})),s&&this._registerAction("globalConnectTool",(function(){s.toggle()})),i&&c&&this._registerAction("distributeElements",(function(e){var t=i.get(),n=e.type;t.length&&c.trigger(t,n)})),i&&p&&this._registerAction("alignElements",(function(e){var t=i.get(),n=[],r=e.type;t.length&&(n=_(t,(function(e){return!xr(e,"bpmn:Lane")})),p.trigger(n,r))})),i&&h&&this._registerAction("setColor",(function(e){var t=i.get();t.length&&h.setColor(t,e)})),i&&l&&this._registerAction("directEditing",(function(){var e=i.get();e.length&&l.activate(e[0])})),u&&this._registerAction("find",(function(){u.toggle()})),t&&h&&this._registerAction("moveToOrigin",(function(){var e,i,r=t.getRootElement();e=vt(i=xr(r,"bpmn:Collaboration")?n.filter((function(e){return xr(e.parent,"bpmn:Collaboration")})):n.filter((function(e){return e!==r&&!xr(e.parent,"bpmn:SubProcess")}))),h.moveElements(i,{x:-e.x,y:-e.y},r)})),i&&d&&this._registerAction("replaceElement",(function(e){d.triggerEntry("replace","click",e)}))};const Nv={__depends__:[Dv],editorActions:["type",Bv]};function Ov(e){e.on(["create.init","shape.move.init"],(function(e){var t=e.context;wr(e.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(t.gridSnappingContext||(t.gridSnappingContext={}),t.gridSnappingContext.snapLocation="top-left")}))}function jv(e,t,n){return n||(n="round"),Math[n](e/t)*t}function Lv(e,t,n){var i=!n||!1!==n.active;this._eventBus=t;var r=this;t.on("diagram.init",800,(function(){r.setActive(i)})),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,(function(t){var n=t.originalEvent;if(!(!r.active||n&&Da(n))){var i=t.context,o=i.gridSnappingContext;o||(o=i.gridSnappingContext={}),["x","y"].forEach((function(n){var i={},o=function(e,t,n){var i=e.context,r=e.shape,o=i.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&f(s[t])?s[t]:(s||(s=o.snapOffset={}),f(s[t])||(s[t]=0),r?(n.get(r.id)||(Iv(t)?s[t]+=r[t]+r.width/2:s[t]+=r[t]+r.height/2),a?("x"===t?/left/.test(a)?s[t]-=r.width/2:/right/.test(a)&&(s[t]+=r.width/2):/top/.test(a)?s[t]-=r.height/2:/bottom/.test(a)&&(s[t]+=r.height/2),s[t]):s[t]):s[t])}(t,n,e);o&&(i.offset=o);var a=function(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;i&&(Iv(t)?(a.x.min=i.left,a.x.max=i.right):(a.y.min=i.top,a.y.max=i.bottom));var c=r.min,p=r.max;return c&&(Iv(t)?zv(s)?a.x.max=c.left:a.x.min=c.right:$v(s)?a.y.max=c.top:a.y.min=c.bottom),p&&(Iv(t)?zv(s)?a.x.min=p.left:a.x.max=p.right:$v(s)?a.y.min=p.top:a.y.max=p.bottom),a[t]}(t,n);a&&z(i,a),gl(t,n)||r.snapEvent(t,n,i)}))}}))}function Iv(e){return"x"===e}function $v(e){return-1!==e.indexOf("n")}function zv(e){return-1!==e.indexOf("w")}function Fv(e,t){aa.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",(function(e){var t=e.context,i=(t.hints||{}).autoResize;if(i){var r=t.shape,o=t.newBounds;g(i)?t.newBounds=n.snapComplex(o,i):t.newBounds=n.snapSimple(r,o)}}))}function Hv(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,(function(e){var n,i=e.context;i.initialized&&("x"===i.axis?(n=t.snapValue(e.dx),e.x=e.x+n-e.dx,e.dx=n):(n=t.snapValue(e.dy),e.y=e.y+n-e.dy,e.dy=n))}))}Ov.$inject=["eventBus"],Lv.prototype.snapEvent=function(e,t,n){vl(e,t,this.snapValue(e[t],n))},Lv.prototype.getGridSpacing=function(){return 10},Lv.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e=jv(e+=r,10),t&&t.min&&f(n=t.min)&&(n=jv(n+r,10,"ceil"),e=Math.max(e,n)),t&&t.max&&f(i=t.max)&&(i=jv(i+r,10,"floor"),e=Math.min(e,i)),e-r},Lv.prototype.isActive=function(){return this.active},Lv.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},Lv.prototype.toggleActive=function(){this.setActive(!this.active)},Lv.$inject=["elementRegistry","eventBus","config.gridSnapping"],Fv.$inject=["eventBus","gridSnapping","modeling"],e(Fv,aa),Fv.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},Fv.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},Fv.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),z(e,o),e},Fv.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),z(e,o),e},Hv.$inject=["eventBus","gridSnapping"];const Vv={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Fv],gridSnappingSpaceToolBehavior:["type",Hv]}],__init__:["gridSnapping"],gridSnapping:["type",Lv]};function Wv(e,t){e.on("autoPlace",2e3,(function(e){var n=e.source,i=yn(n),r=e.shape,o=pp(n,r);return["x","y"].forEach((function(e){var n={};o[e]!==i[e]&&(o[e]>i[e]?n.min=o[e]:n.max=o[e],xr(r,"bpmn:TextAnnotation")&&(function(e){return"x"===e}(e)?n.offset=-r.width/2:n.offset=-r.height/2),o[e]=t.snapValue(o[e],n))})),o}))}function Gv(e,t,n){t.on(["create.start","shape.move.start"],1750,(function(t){var i=t.context,r=i.shape,o=e.getRootElement();xr(r,"bpmn:Participant")&&xr(o,"bpmn:Process")&&o.children.length&&i.createConstraints&&(r.width=n.snapValue(r.width,{min:r.width}),r.height=n.snapValue(r.height,{min:r.height}))}))}function Uv(e,t,n){aa.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,(function(e){var t=e.context,r=t.connection,o=t.hints||{},a=r.waypoints;o.connectionStart||o.connectionEnd||!1===o.createElementsBehavior||function(e){return e.length>3}(a)&&n.updateWaypoints(r,i.snapMiddleSegments(a))}))}function qv(e,t,n){var i=Tt(t,n),r={};return function(e){return"h"===e}(i)&&(r.y=e.snapValue(t.y)),function(e){return"v"===e}(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=z({},t,r),n=z({},n,r)),[t,n]}Wv.$inject=["eventBus","gridSnapping"],Gv.$inject=["canvas","eventBus","gridSnapping"],Uv.$inject=["eventBus","gridSnapping","modeling"],e(Uv,aa),Uv.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i5&&Se(a,{x:o.x,width:o.width}),o.height>5&&Se(a,{y:o.y,height:o.height}),i.canExecute?ke(a).remove(uy):ke(a).add(uy)})),e.on("resize.cleanup",(function(e){var n,i;i=(n=e.context).shape,n.frame&&Pe(n.frame),t.removeMarker(i,ly)}))}hy.$inject=["eventBus","canvas","previewSupport"];var dy="djs-resizer",fy=["n","w","s","e","nw","ne","se","sw"];function my(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",(function(e){var t=e.newSelection;r.removeResizers(),1===t.length&&x(t,I(r.addResizer,r))})),e.on("shape.changed",(function(e){var t=e.element;n.isSelected(t)&&(r.removeResizers(),r.addResizer(t))}))}my.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(t){Oo(t)&&i.activate(t,e,n)}le.bind(t,"mousedown",r),le.bind(t,"touchstart",r)},my.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=function(e){var t={x:0,y:0};return-1!==e.indexOf("e")?t.x=6:-1!==e.indexOf("w")&&(t.x=-6),-1!==e.indexOf("s")?t.y=6:-1!==e.indexOf("n")&&(t.y=-6),t}(i),a=Ne("g");ke(a).add(dy),ke(a).add(dy+"-"+e.id),ke(a).add(dy+"-"+i),_e(r,a);var s=Ne("rect");Se(s,{x:-4+o.x,y:-4+o.y,width:8,height:8}),ke(s).add(dy+"-visual"),_e(a,s);var c=Ne("rect");return Se(c,{x:-10+o.x,y:-10+o.y,width:20,height:20}),ke(c).add(dy+"-hit"),_e(a,c),Kn(a,t,n),a},my.prototype.createResizer=function(e,t){var n=cy(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},my.prototype.addResizer=function(e){var t=this;!hn(e)&&this._resize.canResize({shape:e})&&x(fy,(function(n){t.createResizer(e,n)}))},my.prototype.removeResizers=function(){Te(this._getResizersParent())},my.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},my.$inject=["eventBus","canvas","selection","resize"];const gy={__depends__:[Pp,Sp,Nl],__init__:["resize","resizePreview","resizeHandles"],resize:["type",sy],resizePreview:["type",hy],resizeHandles:["type",my]};function vy(e,t,n,i,r,o,a){function s(e,t){(t||wr(e,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||yy(e))&&i.activate(e)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",(function(e){s(e.element,!0)})),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],(function(){i.isActive()&&i.complete()})),e.on(["shape.remove","connection.remove"],2e3,(function(e){i.isActive(e.element)&&i.cancel()})),e.on(["commandStack.changed"],(function(e){i.isActive()&&i.cancel()})),e.on("directEditing.activate",(function(e){o.removeResizers()})),e.on("create.end",500,(function(e){var t=e.context,n=t.shape,i=e.context.canExecute;e.isTouch||i&&(t.hints&&!1===t.hints.createElementsBehavior||s(n))})),e.on("autoPlace.end",500,(function(e){s(e.shape)}))}function yy(e){return xr(e,"bpmn:SubProcess")&&!zr(e)}vy.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],vy.prototype.activate=function(e){var t=Xr(e);if(void 0!==t){var n={text:t};z(n,this.getEditingBBox(e));var i={};return(wr(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||yy(e))&&z(i,{centerVertically:!0}),Ur(e)&&z(i,{autoResize:!0}),xr(e,"bpmn:TextAnnotation")&&z(i,{resizable:!0,autoResize:!0}),z(n,{options:i}),n}},vy.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,a={x:i.x,y:i.y},s=t.zoom(),c=this._textRenderer.getDefaultStyle(),p=this._textRenderer.getExternalStyle(),l=p.fontSize*s,u=p.lineHeight,h=c.fontSize*s,d=c.lineHeight,f={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(xr(e,"bpmn:Lane")||function(e){return xr(e,"bpmn:Participant")&&zr(e)}(e)){var m=Fr(e);z(a,m?{width:i.height,height:30*s,x:i.x-i.height/2+15*s,y:o-30*s/2}:{width:i.width,height:30*s}),z(f,{fontSize:h+"px",lineHeight:d,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px",transform:m?"rotate(-90deg)":null})}if(function(e){return xr(e,"bpmn:Participant")&&!zr(e)}(e)){var g=Fr(e);z(a,g?{width:i.width,height:i.height}:{width:i.height,height:i.width,x:r-i.height/2,y:o-i.width/2}),z(f,{fontSize:h+"px",lineHeight:d,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px",transform:g?null:"rotate(-90deg)"})}(wr(e,["bpmn:Task","bpmn:CallActivity"])||yy(e))&&(z(a,{width:i.width,height:i.height}),z(f,{fontSize:h+"px",lineHeight:d,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"})),function(e){return xr(e,"bpmn:SubProcess")&&zr(e)}(e)&&(z(a,{width:i.width,x:i.x}),z(f,{fontSize:h+"px",lineHeight:d,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"}));var v=90*s,y=7*s,b=4*s;if(n.labelTarget&&(z(a,{width:v,height:i.height+y+b,x:r-v/2,y:i.y-y}),z(f,{fontSize:l+"px",lineHeight:u,paddingTop:y+"px",paddingBottom:b+"px"})),Ur(n)&&!qr(n)&&!dn(n)){var _=Kr(e),x=t.getAbsoluteBBox({x:_.x,y:_.y,width:0,height:0}),w=l+y+b;z(a,{width:v,height:w,x:x.x-v/2,y:x.y-w/2}),z(f,{fontSize:l+"px",lineHeight:u,paddingTop:y+"px",paddingBottom:b+"px"})}return xr(e,"bpmn:TextAnnotation")&&(z(a,{width:i.width,height:i.height,minWidth:30*s,minHeight:10*s}),z(f,{textAlign:"left",paddingTop:5*s+"px",paddingBottom:7*s+"px",paddingLeft:7*s+"px",paddingRight:5*s+"px",fontSize:h+"px",lineHeight:d})),{bounds:a,style:f}},vy.prototype.update=function(e,t,n,i){var r,o,a;xr(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),(a=t)&&a.trim()||(t=null),this._modeling.updateLabel(e,t,r)};var by="djs-element-hidden",_y="djs-label-hidden";function xy(e,t,n){var i,r,o,a=this,s=t.getDefaultLayer();e.on("directEditing.activate",(function(e){var c=e.active;if(xr(i=c.element.label||c.element,"bpmn:TextAnnotation")){r=t.getAbsoluteBBox(i),o=Ne("g");var p=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i.width,containerHeight:i.height,position:{mx:0,my:0}}),l=a.path=Ne("path");Se(l,{d:p,strokeWidth:2,stroke:wy(i)}),_e(o,l),_e(s,o),Yn(o,i.x,i.y)}xr(i,"bpmn:TextAnnotation")||i.labelTarget?t.addMarker(i,by):(xr(i,"bpmn:Task")||xr(i,"bpmn:CallActivity")||xr(i,"bpmn:SubProcess")||xr(i,"bpmn:Participant"))&&t.addMarker(i,_y)})),e.on("directEditing.resize",(function(e){if(xr(i,"bpmn:TextAnnotation")){var t=e.height,o=e.dy,s=Math.max(i.height/r.height*(t+o),0),c=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i.width,containerHeight:s,position:{mx:0,my:0}});Se(a.path,{d:c})}})),e.on(["directEditing.complete","directEditing.cancel"],(function(e){var n=e.active;n&&(t.removeMarker(n.element.label||n.element,by),t.removeMarker(i,_y)),i=void 0,r=void 0,o&&(Pe(o),o=void 0)}))}function wy(e,t){return Sr(e).get("stroke")||t||"black"}xy.$inject=["eventBus","canvas","pathMap"];const Ey={__depends__:[oa,gy,Zg],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",vy],labelEditingPreview:["type",xy]};var Sy=new Zo("tt");function Cy(e,t){e.style.display=!1===t?"none":""}var ky="djs-tooltip",Ry="."+ky;function Py(e,t){var n,i;this._eventBus=e,this._canvas=t,this._ids=Sy,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=t.getContainer(),X(i=me('
      '),{position:"absolute",width:"0",height:"0"}),n.insertBefore(i,n.firstChild),i);var r=this;he.bind(this._tooltipRoot,Ry,"mousedown",(function(e){e.stopPropagation()})),he.bind(this._tooltipRoot,Ry,"mouseover",(function(e){r.trigger("mouseover",e)})),he.bind(this._tooltipRoot,Ry,"mouseout",(function(e){r.trigger("mouseout",e)})),this._init()}Py.$inject=["eventBus","canvas"],Py.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=z({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},Py.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(Z(n,"data-tooltip-id"));i&&("mouseover"===e&&i.timeout&&this.clearTimeout(i),"mouseout"===e&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},Py.prototype.get=function(e){return"string"!=typeof e&&(e=e.id),this._tooltips[e]},Py.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},Py.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout((function(){t.remove(e)}),e.timeout)}},Py.prototype.remove=function(e){var t=this.get(e);t&&(ye(t.html),ye(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},Py.prototype.show=function(){Cy(this._tooltipRoot)},Py.prototype.hide=function(){Cy(this._tooltipRoot,!1)},Py.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},Py.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),g(i)&&(i=me(i)),X(t=me('
      '),{position:"absolute"}),t.appendChild(i),e.type&&J(t).add("djs-tooltip-"+e.type),e.className&&J(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},Py.prototype._updateTooltip=function(e){var t=e.position;!function(e,t,n){X(e,{left:t+"px",top:n+"px"})}(e.htmlContainer,t.x,t.y)},Py.prototype._updateTooltipVisibilty=function(e){x(this._tooltips,(function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom"+r+"
      "}))}))}Ay.$inject=["eventBus","tooltips","translate"];const My={__depends__:[Ty],__init__:["modelingFeedback"],modelingFeedback:["type",Ay]};var Dy=Math.round;function By(e,t,n,i,r){function o(e,t,n,i){return r.allowed("elements.move",{shapes:e,delta:t,position:n,target:i})}function a(e,n,i,r){if(d(i)&&(r=i,i=!1),!n.waypoints&&n.parent&&!ke(e.target).has("djs-hit-no-move")){var o=function(e){return{x:e.x+Dy(e.width/2),y:e.y+Dy(e.height/2)}}(n);return t.init(e,o,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:r||{}}}),!0}}e.on("shape.move.start",1500,(function(e){var t=e.context,n=e.shape,r=i.get().slice();-1===r.indexOf(n)&&(r=[n]),r=function(e){var t=P(e,"id");return _(e,(function(e){for(;e=e.parent;)if(t[e.id])return!1;return!0}))}(r),z(t,{shapes:r,validatedShapes:r,shape:n})})),e.on("shape.move.start",1250,(function(e){var t=e.context,n=t.validatedShapes;if(!(t.canExecute=o(n)))return!1})),e.on("shape.move.move",500,(function(e){var t,n=e.context,i=n.validatedShapes,r=e.hover,a={x:e.dx,y:e.dy};t=o(i,a,{x:e.x,y:e.y},r),n.delta=a,n.canExecute=t,n.target=null!==t?r:null})),e.on("shape.move.end",(function(e){var t=e.context,i=t.delta,r=t.canExecute,o="attach"===r,a=t.shapes;if(!1===r)return!1;i.x=Dy(i.x),i.y=Dy(i.y),0===i.x&&0===i.y||n.moveElements(a,i,t.target,{primaryShape:t.shape,attach:o})})),e.on("element.mousedown",(function(e){if(Oo(e)){var t=Ao(e);if(!t)throw new Error("must supply DOM mousedown event");return a(t,e.element)}})),this.start=a}By.$inject=["eventBus","dragging","modeling","selection","rules"];var Ny="djs-dragging",Oy="drop-ok",jy="drop-not-ok",Ly="new-parent",Iy="attach-ok";function $y(e,t,n,i){function r(e){var t=gt(e,!0),n=C(t,(function(e){return(e.incoming||[]).concat(e.outgoing||[])}));return a(t.concat(n))}function o(e,n){[Iy,Oy,jy,Ly].forEach((function(i){i===n?t.addMarker(e,i):t.removeMarker(e,i)}))}e.on("shape.move.start",499,(function(e){var o,s,c=e.context,p=c.shapes,l=c.allDraggedElements,u=_(o=r(p),(function(e){return!hn(e)||y(o,D({id:e.source.id}))&&y(o,D({id:e.target.id}))}));if(!c.dragGroup){var h=Ne("g");Se(h,n.cls("djs-drag-group",["no-events"])),_e(t.getActiveLayer(),h),c.dragGroup=h}u.forEach((function(e){i.addDragger(e,c.dragGroup)})),x(l=l?a([l,r(p)]):r(p),(function(e){t.addMarker(e,Ny)})),c.allDraggedElements=l,c.differentParents=1!==(s=P(p,(function(e){return e.parent&&e.parent.id})),k(s).length)})),e.on("shape.move.move",499,(function(e){var t=e.context,n=t.dragGroup,i=t.target,r=t.shape.parent,a=t.canExecute;i&&("attach"===a?o(i,Iy):t.canExecute&&i&&i.id!==r.id?o(i,Ly):o(i,t.canExecute?Oy:jy)),Yn(n,e.dx,e.dy)})),e.on(["shape.move.out","shape.move.cleanup"],(function(e){var t=e.context.target;t&&o(t,null)})),e.on("shape.move.cleanup",(function(e){var n=e.context,i=n.allDraggedElements,r=n.dragGroup;x(i,(function(e){t.removeMarker(e,Ny)})),r&&Pe(r)})),this.makeDraggable=function(e,n,r){i.addDragger(n,e.dragGroup),r&&t.addMarker(n,Ny),e.allDraggedElements?e.allDraggedElements.push(n):e.allDraggedElements=[n]}}$y.$inject=["eventBus","canvas","styles","previewSupport"];const zy={__depends__:[Fo,Xo,Vo,Pp,Sp,Nl],__init__:["move","movePreview"],move:["type",By],movePreview:["type",$y]},Fy={width:36,height:50},Hy={width:50,height:50};function Vy(e,t,n){return Ne("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}function Wy(e,t){this._styles=t,e.registerProvider(this)}function Gy(e,t){var n;return"bpmn:DataObjectReference"===t?n=Fy:"bpmn:DataStoreReference"===t&&(n=Hy),e.width===n.width&&e.height===n.height}Wy.$inject=["outline","styles"],Wy.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!dn(e))return xr(e,"bpmn:Gateway")?(z((n=Ne("rect")).style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),Se(n,z({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):wr(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group"])?Se(n=Ne("rect"),z({x:-5,y:-5,rx:14,width:e.width+10,height:e.height+10},t)):xr(e,"bpmn:EndEvent")?Se(n=Ne("circle"),z({cx:e.width/2,cy:e.height/2,r:e.width/2+5+1},t)):xr(e,"bpmn:Event")?Se(n=Ne("circle"),z({cx:e.width/2,cy:e.height/2,r:e.width/2+5},t)):xr(e,"bpmn:DataObjectReference")&&Gy(e,"bpmn:DataObjectReference")?n=Vy("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):xr(e,"bpmn:DataStoreReference")&&Gy(e,"bpmn:DataStoreReference")&&(n=Vy("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},Wy.prototype.updateOutline=function(e,t){if(!dn(e))return wr(e,["bpmn:SubProcess","bpmn:Group"])?(Se(t,{width:e.width+10,height:e.height+10}),!0):!!wr(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};const Uy={__depends__:[Vo],__init__:["outlineProvider"],outlineProvider:["type",Wy]};var qy=".djs-palette-toggle",Ky=".entry",Yy=qy+", "+Ky,Xy="djs-palette-",Zy="open",Qy="two-column";function Jy(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",(function(e){var t=e.tool;n.updateToolHighlight(t)})),e.on("i18n.changed",(function(){n._update()})),e.on("diagram.init",(function(){n._diagramInitialized=!0,n._rebuild()}))}function eb(e,t){var n=t.getPaletteEntries();return m(n)?n(e):(x(n,(function(t,n){e[n]=t})),e)}Jy.$inject=["eventBus","canvas"],Jy.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,(function(e){e.providers.push(t)})),this._rebuild()},Jy.prototype.getEntries=function(){return this._getProviders().reduce(eb,{})},Jy.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},Jy.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=me(Jy.HTML_MARKUP);n.appendChild(i),J(n).add(Xy+"shown"),he.bind(i,Yy,"click",(function(t){if(ne(t.delegateTarget,qy))return e.toggle();e.trigger("click",t)})),le.bind(i,"mousedown",(function(e){e.stopPropagation()})),he.bind(i,Ky,"dragstart",(function(t){e.trigger("dragstart",t)})),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},Jy.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},Jy.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=J(i),a=J(n);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle(Qy,t),a.toggle(Xy+Qy,t),"open"in e&&(o.toggle(Zy,e.open),a.toggle(Xy+Zy,e.open)),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},Jy.prototype._update=function(){var e=ge(".djs-palette-entries",this._container),t=this._entries=this.getEntries();te(e),x(t,(function(t,n){var i=t.group||"default",r=ge("[data-group="+la(i)+"]",e);r||(Z(r=me('
      '),"data-group",i),e.appendChild(r));var o=t.html||(t.separator?'
      ':'
      '),a=me(o);if(r.appendChild(a),!t.separator&&(Z(a,"data-action",n),t.title&&Z(a,"title",t.title),t.className&&function(e,t){var n=J(e);(h(t)?t:t.split(/\s+/g)).forEach((function(e){n.add(e)}))}(a,t.className),t.imageUrl)){var s=me("");Z(s,"src",t.imageUrl),a.appendChild(s)}})),this.open()},Jy.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=Z(o,"data-action"),r=t.originalEvent||t,this.triggerEntry(i,e,r,n)):t.preventDefault()},Jy.prototype.triggerEntry=function(e,t,n,i){var r,o;if((r=this._entries[e])&&(o=r.action,!1!==this._eventBus.fire("palette.trigger",{entry:r,event:n}))){if(m(o)){if("click"===t)return o(n,i)}else if(o[t])return o[t](n,i);n.preventDefault()}},Jy.prototype._layoutChanged=function(){this._toggleState({})},Jy.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},Jy.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},Jy.prototype.open=function(){this._toggleState({open:!0})},Jy.prototype.toggle=function(){this.isOpen()?this.close():this.open()},Jy.prototype.isActiveTool=function(e){return e&&this._activeTool===e},Jy.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=ge(".djs-palette-entries",this._container),this._toolsContainer=ge("[data-group=tools]",t)),x(this._toolsContainer.children,(function(t){var n=t.getAttribute("data-action");if(n){var i=J(t);n=n.replace("-tool",""),i.contains("entry")&&n===e?i.add("highlighted-entry"):i.remove("highlighted-entry")}}))},Jy.prototype.isOpen=function(){return J(this._container).has(Zy)},Jy.prototype._getParentContainer=function(){return this._canvas.getContainer()},Jy.HTML_MARKUP='
      ';const tb={__init__:["palette"],palette:["type",Jy]};var nb="crosshair";function ib(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this;o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",(function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("lasso.selection.ended",(function(){s.activateLasso(t.originalEvent,!0)}))})),e.on("lasso.end",(function(e){var t=rb(e),n=i.filter((function(e){return e}));s.select(n,t)})),e.on("lasso.start",(function(e){var n=e.context;n.bbox=rb(e),function(e){var n,i=t.getActiveLayer();Se(n=e.frame=Ne("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),_e(i,n)}(n)})),e.on("lasso.move",(function(e){var t=e.context;t.bbox=rb(e),function(e){var t=e.frame,n=e.bbox;Se(t,{x:n.x,y:n.y,width:n.width,height:n.height})}(t)})),e.on("lasso.cleanup",(function(e){!function(e){e.frame&&Pe(e.frame)}(e.context)})),e.on("element.mousedown",1500,(function(e){if(Lo(e))return s.activateLasso(e.originalEvent),!0}))}function rb(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y=n.x&&t.yn.x&&t.y<=n.y?{x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x=n.y?{x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}ib.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],ib.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:nb,data:{context:{}}})},ib.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:nb,data:{context:{}}})},ib.prototype.select=function(e,t){var n=function(e,t){var n={};return x(e,(function(e){var i=e;i.waypoints&&(i=vt(i)),!f(t.y)&&i.x>t.x&&(n[e.id]=e),!f(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(f(t.width)&&f(t.height)&&i.width+i.xt[i]+r-n&&vl(e,i,t[i]+r-n)}))}(e,o,function(e){return xr(e,"bpmn:Task")?10:20}(o)),o&&(t=i,S(["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"],(function(e){return Eb(t,e)})))?(n.connectionStart=ml(r),wr(o,["bpmn:Event","bpmn:Gateway"])&&wb(e,ml(o)),wr(o,["bpmn:Task","bpmn:SubProcess"])&&function(e,t){var n=ml(t);bb.forEach((function(i){(function(e,t,n){return e[n]>t[n]+20&&e[n]r[t]?r[t]+40:r[t]-40,vl(e,t,n))}))}}(e)):Eb(i,"bpmn:MessageFlow")?(xr(r,"bpmn:Event")&&(n.connectionStart=ml(r)),xr(o,"bpmn:Event")&&wb(e,ml(o))):n.connectionStart=n.initialConnectionStart)}))}function wb(e,t){vl(e,"x",t.x),vl(e,"y",t.y)}function Eb(e,t){return e&&e.type===t}function Sb(e,t){return"x"===e?t.width:t.height}function Cb(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function kb(){this._snapValues={}}xb.$inject=["eventBus"],Cb.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},Cb.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,-1===this._snapLocations.indexOf(e)&&this._snapLocations.push(e)},Cb.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},Cb.prototype.getSnapLocations=function(){return this._snapLocations},Cb.prototype.setSnapLocations=function(e){this._snapLocations=e},Cb.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new kb).initDefaults(this._defaultSnaps),n},kb.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),-1===n.x.indexOf(t.x)&&n.x.push(t.x),-1===n.y.indexOf(t.y)&&n.y.push(t.y)},kb.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&function(e,t,n){var i,r;for(n=void 0===n?10:n,i=0;i=e.x||i&&i<=e.x)&&vl(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&vl(e,"y",e.y)}}function Mb(e,t){return-1!==e.indexOf(t)}function Db(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}function Bb(e,t){var n=this;e.on(["resize.start"],(function(e){n.initSnap(e)})),e.on(["resize.move","resize.end"],1250,(function(e){var i=e.context,r=i.shape,o=r.parent,a=i.direction,s=i.snapContext;if(!(e.originalEvent&&Da(e.originalEvent)||gl(e))){var c=s.pointsForTarget(o);c.initialized||((c=n.addSnapTargetPoints(c,r,o,a)).initialized=!0),function(e){return"n"===e||"s"===e}(a)&&vl(e,"x",e.x),function(e){return"e"===e||"w"===e}(a)&&vl(e,"y",e.y),t.snap(e,c)}})),e.on(["resize.cleanup"],(function(){t.hide()}))}function Nb(e,t){var n=yn(e),i=gn(e),r={x:n.x,y:n.y};return-1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}function Ob(e){this._canvas=e,this._asyncHide=L(I(this.hide,this),1e3)}Pb.$inject=["elementRegistry","eventBus","snapping"],Pb.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new Cb);var a=(t=n.get(r.id)?ml(r,e):{x:e.x+ml(r).x,y:e.y+ml(r).y}).x-r.width/2,s=t.y-r.height/2,c=t.x+r.width/2,p=t.y+r.height/2;return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),dn(r)||(o.setSnapOrigin("top-left",{x:a-e.x,y:s-e.y}),o.setSnapOrigin("bottom-right",{x:c-e.x,y:p-e.y})),o},Pb.prototype.addSnapTargetPoints=function(e,t,n){return x(this.getSnapTargets(t,n),(function(n){if(dn(n))dn(t)&&e.add("mid",ml(n));else if(hn(n)){if(n.waypoints.length<3)return;x(n.waypoints.slice(1,-1),(function(t){e.add("mid",t)}))}else e.add("mid",ml(n))})),f(t.x)&&f(t.y)?(this._elementRegistry.get(t.id)&&e.add("mid",ml(t)),e):e},Pb.prototype.getSnapTargets=function(e,t){return yl(t).filter((function(e){return!e.hidden}))},e(Tb,Pb),Tb.$inject=["eventBus","injector"],Tb.prototype.initSnap=function(e){var t=Pb.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return x(n.outgoing,(function(n){var r=n.waypoints[0];r=r.original||r,t.setSnapOrigin(n.id+"-docking",Db(r,i,e))})),x(n.incoming,(function(n){var r=n.waypoints[n.waypoints.length-1];r=r.original||r,t.setSnapOrigin(n.id+"-docking",Db(r,i,e))})),xr(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},Tb.prototype.addSnapTargetPoints=function(e,t,n){Pb.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);x(i,(function(n){var i;(xr(i=n,"bpmn:SubProcess")&&zr(i)||xr(i,"bpmn:Participant")||("bpmn:TextAnnotation",[t,n].every((function(e){return xr(e,"bpmn:TextAnnotation")}))))&&(e.add("top-left",dl(n)),e.add("bottom-right",fl(n)))}));var r=this._elementRegistry;return x(t.incoming,(function(n){if(r.get(t.id)){Mb(i,n.source)||e.add("mid",yn(n.source));var o=n.waypoints[0];e.add(n.id+"-docking",o.original||o)}})),x(t.outgoing,(function(n){if(r.get(t.id)){Mb(i,n.target)||e.add("mid",yn(n.target));var o=n.waypoints[n.waypoints.length-1];e.add(n.id+"-docking",o.original||o)}})),xr(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},Tb.prototype.getSnapTargets=function(e,t){return Pb.prototype.getSnapTargets.call(this,e,t).filter((function(e){return!xr(e,"bpmn:Lane")}))},Bb.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new Cb);var o=Nb(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},Bb.prototype.addSnapTargetPoints=function(e,t,n,i){return x(this.getSnapTargets(t,n),(function(t){e.add("corner",fl(t)),e.add("corner",dl(t))})),e.add("corner",Nb(t,i)),e},Bb.$inject=["eventBus","snapping"],Bb.prototype.getSnapTargets=function(e,t){return yl(t).filter((function(t){return n=e,!(t.host===n||hn(t)||function(e){return!!e.hidden}(t)||dn(t));var n}))},Ob.$inject=["canvas"],Ob.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:gl(e,"x"),y:gl(e,"y")};x(i,(function(i){var o=n.getSnapOrigin(i),a={x:e.x+o.x,y:e.y+o.y};if(x(["x","y"],(function(e){var n;r[e]||void 0!==(n=t.snap(a,i,e,7))&&(r[e]={value:n,originValue:n-o[e]})})),r.x&&r.y)return!1})),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),x(["x","y"],(function(t){var n=r[t];d(n)&&vl(e,t,n.originValue)}))},Ob.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=Ne("path");return Se(n,{d:"M0,0 L0,0"}),ke(n).add("djs-snap-line"),_e(t,n),{update:function(t){f(t)?Se(n,"horizontal"===e?{d:"M-100000,"+t+" L+100000,"+t,display:""}:{d:"M "+t+",-100000 L "+t+", +100000",display:""}):Se(n,{display:"none"})}}},Ob.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Ob.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},Ob.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},Ob.prototype.hide=function(){x(this._snapLines,(function(e){e.update()}))};const jb={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Pb],resizeSnapping:["type",Bb],snapping:["type",Ob]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",xb],createMoveSnapping:["type",Tb]};function Lb(e,t,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=e,this._eventBus=t,this._overlays=n,this._selection=i,this._container=me(Lb.BOX_HTML),this._searchInput=ge(Lb.INPUT_SELECTOR,this._container),this._resultsContainer=ge(Lb.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}function Ib(e,t,n){var i=function(e){var t="";return e.forEach((function(e){e.matched?t+=''+ha(e.matched)+"":t+=ha(e.normal)})),""!==t?t:null}(t),r=me(n);r.innerHTML=i,e.appendChild(r)}Lb.$inject=["canvas","eventBus","overlays","selection"],Lb.prototype._bindEvents=function(){var e=this;function t(t,n,i,r){e._eventMaps.push({el:t,type:i,listener:he.bind(t,n,i,r)})}t(document,"html","click",(function(t){e.close()})),t(this._container,Lb.INPUT_SELECTOR,"click",(function(e){e.stopPropagation(),e.delegateTarget.focus()})),t(this._container,Lb.RESULT_SELECTOR,"mouseover",(function(t){t.stopPropagation(),e._scrollToNode(t.delegateTarget),e._preselect(t.delegateTarget)})),t(this._container,Lb.RESULT_SELECTOR,"click",(function(t){t.stopPropagation(),e._select(t.delegateTarget)})),t(this._container,Lb.INPUT_SELECTOR,"keydown",(function(e){Ba("ArrowUp",e)&&e.preventDefault(),Ba("ArrowDown",e)&&e.preventDefault()})),t(this._container,Lb.INPUT_SELECTOR,"keyup",(function(t){if(Ba("Escape",t))return e.close();if(Ba("Enter",t)){var n=e._getCurrentResult();return n?e._select(n):e.close()}return Ba("ArrowUp",t)?e._scrollToDirection(!0):Ba("ArrowDown",t)?e._scrollToDirection():void(Ba(["ArrowLeft","ArrowRight"],t)||e._search(t.delegateTarget.value))}))},Lb.prototype._unbindEvents=function(){this._eventMaps.forEach((function(e){he.unbind(e.el,e.type,e.listener)}))},Lb.prototype._search=function(e){var t=this;if(this._clearResults(),e&&""!==e){var n=this._searchProvider.find(e);if(n.length){n.forEach((function(e){var n=e.element.id,i=t._createResultNode(e,n);t._results[n]={element:e.element,node:i}}));var i=ge(Lb.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},Lb.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},Lb.prototype._scrollToNode=function(e){if(e&&e!==this._getCurrentResult()){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t0&&Ib(n,e.primaryTokens,Lb.RESULT_PRIMARY_HTML),Ib(n,e.secondaryTokens,Lb.RESULT_SECONDARY_HTML),Z(n,Lb.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},Lb.prototype.registerProvider=function(e){this._searchProvider=e},Lb.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,J(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},Lb.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,J(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},Lb.prototype.toggle=function(){this.isOpen()?this.close():this.open()},Lb.prototype.isOpen=function(){return this._open},Lb.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&J(t).remove(Lb.RESULT_SELECTED_CLASS);var n=Z(e,Lb.RESULT_ID_ATTRIBUTE),i=this._results[n].element;J(e).add(Lb.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},Lb.prototype._select=function(e){var t=Z(e,Lb.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},Lb.prototype._resetOverlay=function(e){if(this._overlayId&&this._overlays.remove(this._overlayId),e){var t=function(e){var t=e.width+12,n=e.height+12,i={width:t+"px",height:n+"px"},r=me('
      ');return X(r,i),{position:{bottom:n-6,right:t-6},show:!0,html:r}}(vt(e));this._overlayId=this._overlays.add(e,t)}},Lb.CONTAINER_SELECTOR=".djs-search-container",Lb.INPUT_SELECTOR=".djs-search-input input",Lb.RESULTS_CONTAINER_SELECTOR=".djs-search-results",Lb.RESULT_SELECTOR=".djs-search-result",Lb.RESULT_SELECTED_CLASS="djs-search-result-selected",Lb.RESULT_SELECTED_SELECTOR="."+Lb.RESULT_SELECTED_CLASS,Lb.RESULT_ID_ATTRIBUTE="data-result-id",Lb.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",Lb.OVERLAY_CLASS="djs-search-overlay",Lb.BOX_HTML='
      ',Lb.RESULT_HTML='
      ',Lb.RESULT_PRIMARY_HTML='
      ',Lb.RESULT_SECONDARY_HTML='

      ';const $b={__depends__:[ia,Xo],searchPad:["type",Lb]};function zb(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function Fb(e){return _(e,(function(e){return!!e.matched})).length>0}function Hb(e,t){var n=[],i=e;if(!e)return n;e=e.toLowerCase(),t=t.toLowerCase();var r=e.indexOf(t);return r>-1?(0!==r&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,t.length)}),t.length+r')},Wb.prototype._interactionModules=[Va,Qa,fs,rs],Wb.prototype._modelingModules=[Zc,hp,kp,vp,wl,Pl,Al,_v,sf,Kd,Pv,Nv,Kv,Xv,Qv,ay,Ey,Fg,My,zy,Uy,gb,yb,gy,jb,Vb],Wb.prototype._modules=[].concat(Ra.prototype._modules,Wb.prototype._interactionModules,Wb.prototype._modelingModules);class Ub extends rt{constructor(e,t,n,i){super(e,1500),this.bpmnRenderer=t,Gb=n.computeStyle,this.textRenderer=i}canRender(e){return wr(e,["bpmn:Participant"])&&!e.labelTarget}drawShape(e,t){var n={fillOpacity:.95,fill:eo(t,this.bpmnRenderer.defaultFillColor),stroke:to(t,this.bpmnRenderer.defaultStrokeColor)},i=this.renderer("bpmn:Lane")(e,t,n);if(zr(t)){this.drawLine(e,[{x:0,y:30},{x:t.width,y:30}],{stroke:to(t,this.bpmnRenderer.defaultStrokeColor)});var r=Er(t).name;this.renderLaneLabel(e,r,t)}else{var o=Er(t).name;this.bpmnRenderer.renderLabel(e,o,{box:t,align:"center-middle",style:{fill:no(t,this.bpmnRenderer.defaultLabelColor,this.bpmnRenderer.defaultStrokeColor)}})}return!!Er(t).participantMultiplicity&&this.renderer("ParticipantMultiplicityMarker")(e,t),i}renderer(e){return this.bpmnRenderer.handlers[e]}drawLine(e,t,n){var i=lt(t,n=Gb(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return _e(e,i),i}renderLaneLabel(e,t,n){this.renderLabel(e,t,{box:{height:30,width:n.width},align:"center-middle",style:{fill:no(n,this.bpmnRenderer.defaultLabelColor,this.bpmnRenderer.defaultStrokeColor)}})}renderLabel(e,t,n){n=z({size:{width:e.width}},n);var i=this.textRenderer.createText(t||"Actor/Integration",n);return ke(i).add("djs-label"),_e(e,i),i}}Ub.$inject=["eventBus","bpmnRenderer","styles","textRenderer"];class qb extends Zf{constructor(e,t,n,i){super(e,t,n);const r=i.getDefaultSize;i.getDefaultSize=(e,t)=>xr(e,"bpmn:Participant")?{width:350,height:450}:r(e,t)}}qb.$inject=["bpmnFactory","moddle","translate","elementFactory"];const Kb=qb;mb.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,i=this._spaceTool,r=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;let c=this._palette;function p(e,i,r,o,a){function c(i){var r=n.createShape(z({type:e},a));a&&(Sr(r).isExpanded=a.isExpanded),t.start(i,r)}var p=e.replace(/^bpmn:/,"");return{group:i,className:r,title:o||s("Create {type}",{type:p}),action:{dragstart:c,click:c}}}function l(e){let i=c._eventBus.createEvent({type:"commandStack.elements.create.canExecute",context:{shape:{type:"bpmn:Participant"},elements:[e]}});c._eventBus.fire(i)&&t.start(e,n.createParticipantShape())}return z(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate the hand tool"),action:{click:function(e){o.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate the lasso tool"),action:{click:function(e){r.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate the create/remove space tool"),action:{click:function(e){i.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate the global connect tool"),action:{click:function(e){a.start(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":p("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create Start Point")),"create.end-event":p("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create End Point")),"create.exclusive-gateway":p("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create Desicion Point")),"create.task":p("bpmn:Task","activity","bpmn-icon-task",s("Create Step")),"create.data-object":p("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create Artifact")),"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("add Actor/Integration"),action:{dragstart:l,click:l}}}),e},vy.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=(i.y,i.height,{x:i.x,y:i.y}),a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),p=c.fontSize*a,l=c.lineHeight,u=s.fontSize*a,h=s.lineHeight,d={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(xr(e,"bpmn:Lane")||function(e){return xr(e,"bpmn:Participant")&&zr(e)}(e))&&(z(o,{width:i.width,height:30*a}),z(d,{fontSize:u+"px",lineHeight:h,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),(wr(e,["bpmn:Task","bpmn:CallActivity"])||function(e){return xr(e,"bpmn:Participant")&&!zr(e)}(e)||function(e){return xr(e,"bpmn:SubProcess")&&!zr(e)}(e))&&(z(o,{width:i.width,height:i.height}),z(d,{fontSize:u+"px",lineHeight:h,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),function(e){return xr(e,"bpmn:SubProcess")&&zr(e)}(e)&&(z(o,{width:i.width,x:i.x}),z(d,{fontSize:u+"px",lineHeight:h,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var f=90*a,m=7*a,g=4*a;if(n.labelTarget&&(z(o,{width:f,height:i.height+m+g,x:r-f/2,y:i.y-m}),z(d,{fontSize:p+"px",lineHeight:l,paddingTop:m+"px",paddingBottom:g+"px"})),Ur(n)&&!qr(n)&&!isLabel(n)){var v=Kr(e),y=t.getAbsoluteBBox({x:v.x,y:v.y,width:0,height:0}),b=p+m+g;z(o,{width:f,height:b,x:y.x-f/2,y:y.y-b/2}),z(d,{fontSize:p+"px",lineHeight:l,paddingTop:m+"px",paddingBottom:g+"px"})}return xr(e,"bpmn:TextAnnotation")&&(z(o,{width:i.width,height:i.height,minWidth:30*a,minHeight:10*a}),z(d,{textAlign:"left",paddingTop:5*a+"px",paddingBottom:7*a+"px",paddingLeft:7*a+"px",paddingRight:5*a+"px",fontSize:u+"px",lineHeight:h})),{bounds:o,style:d}},Yv.prototype._createParticipantHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.height,height:30}),!0};class Yb{constructor(e){e.registerProvider(this)}getContextPadEntries(e){return function(t){return t["append.end-event"]&&(t["append.end-event"].title="Append End Point"),t["append.start-event"]&&(t["append.start-event"].title="Append Start Point"),t["append.gateway"]&&(t["append.gateway"].title="Append Desicion Point"),t["append.append-task"]&&(t["append.append-task"].title="Append Step"),delete t["append.intermediate-event"],delete t.replace,"bpmn:Participant"==e.type&&(delete t["lane-divide-three"],delete t["lane-divide-two"],delete t["lane-insert-above"],delete t["lane-insert-below"]),t}}}function Xb(e,t,n){n.pathMap.TEXT_ANNOTATION.d=""}Yb.$inject=["contextPad"],Xb.$inject=["eventBus","canvas","pathMap"];var Zb=n(717),Qb=n.n(Zb);function Jb(e,t){Yc.call(this,e),this.taskResizingEnabled=t||!1}function e_(e,t){Yc.call(this,e),this.eventResizingEnabled=t||!1}Qb()(Jb,Yc),Jb.$inject=["eventBus","config.taskResizingEnabled"],Jb.prototype.init=function(){var e=this;e.addRule("shape.resize",1500,(function(t){if(e.taskResizingEnabled&&t.shape.businessObject&&(t.shape.businessObject.$instanceOf("bpmn:Task")||t.shape.businessObject.$instanceOf("bpmn:CallActivity")||t.shape.businessObject.$instanceOf("bpmn:SubProcess")))return t.newBounds&&(t.newBounds.width=Math.max(100,t.newBounds.width),t.newBounds.height=Math.max(80,t.newBounds.height)),!0}))},Qb()(e_,Yc),e_.$inject=["eventBus","config.eventResizingEnabled"],e_.prototype.init=function(){var e=this;e.addRule("shape.resize",1500,(function(t){if(e.eventResizingEnabled&&t.shape.businessObject&&t.shape.businessObject.$instanceOf("bpmn:Event"))return t.newBounds&&(t.newBounds.width=Math.max(36,t.newBounds.width),t.newBounds.height=Math.max(36,t.newBounds.height)),!0}))};const t_={__init__:["verticalParticipantRenderer","ExElementFactory","ExContextPadProvider","LabelEditingPreview","ResizeStep","ResizeEvent"],verticalParticipantRenderer:["type",Ub],ExElementFactory:["type",Kb],ExContextPadProvider:["type",Yb],LabelEditingPreview:["type",Xb],ResizeStep:["type",Jb],ResizeEvent:["type",e_]};class n_{constructor(e,t,n,i,r,o){this.modeler=e,this.zoomScroll=this.modeler.get("zoomScroll"),this.container=n,this.callBack=i,this.bypassfullscreenChanged=!1,this.persistStateName=r,this.stepZoom=1,this.eventBus=t,this.fullScreenElementSelector=o,this.currentDim=new i_(0,0),this.observer=new MutationObserver(((e,t)=>{var n;for(const t of e)if("childList"===t.type){var i=t.addedNodes[0];i&&(i.id.includes("alertify")||i.classList.contains("wait-screen"))&&(null===(n=$(this.fullScreenElementSelector))||void 0===n||n.append(i))}}))}Render(){window.bpmnZoom=this,this.canvas=this.modeler.get("canvas"),this.persistStateName&&this.eventBus.on("canvas.viewbox.changed",(e=>{const t=window.bpmnZoom,n=t.canvas.zoom();n!=t.stepZoom?(t.stepZoom=n,localStorage.setItem(t.persistStateName+"_zoom",t.stepZoom)):e.viewbox.x==t.currentDim.X&&e.viewbox.x==t.currentDim.Y||(t.currentDim.X=e.viewbox.x,t.currentDim.Y=e.viewbox.y,t.currentDim.Width=e.viewbox.width,t.currentDim.Height=e.viewbox.height,localStorage.setItem(t.persistStateName+"_dim",t.currentDim.ToString()))}));let e=document.createElement("div");e.classList.add("zoom-part-container"),screen.height<712?e.style.marginTop="-2.5rem":e.style.marginTop="-2.75rem",this.generateSetCentral(e),this.generateZoomIn(e),this.generateZoomOut(e),this.generateReset(e),e.style.zIndex=9998,e.style.position="relative",this.container.appendChild(e)}generateZoomIn(e){const t=this;let n=this.generateBtn("zoom-in-btn");n.setAttribute("title","zoom in"),n.addEventListener("click",(e=>t.changeZoomStep(1))),e.appendChild(n)}generateZoomOut(e){const t=this;let n=this.generateBtn("zoom-out-btn");n.setAttribute("title","zoom out"),n.addEventListener("click",(e=>t.changeZoomStep(-1))),e.appendChild(n)}generateSetCentral(e){const t=this;let n=this.generateBtn("zoom-central-btn");n.setAttribute("title","full screen"),n.addEventListener("click",(e=>t.fullScreenZoom(e,t))),e.appendChild(n)}generateReset(e){const t=this;let n=this.generateBtn("zoom-reset-btn");n.setAttribute("title","reset"),n.addEventListener("click",(e=>t.changeZoomStep(0))),e.appendChild(n)}generateBtn(e){var t=document.createElement("button");t.classList.add(e);var n=document.createElement("i");return t.appendChild(n),t}fullScreenZoom(e,t){e.preventDefault(),t.container&&t.reverseFullScreen(t.container,t)}reverseFullScreen(e,t){t.IsFullScreen?t.IsFullScreen&&document.exitFullscreen&&t.exitFullScreen(null):null===document.fullscreenElement&&t.gotoFullScreen(t.container,t)}gotoFullScreen(e,t){e.requestFullscreen&&e.requestFullscreen().catch((e=>{console.log(`Error attempting to enable fullscreen mode: ${e.message} (${e.name})`)})).then((()=>{t.IsFullScreen=!0,t.InvokeCallback(t,!0),t.container.parentElement.setAttribute(t.isFullScreenAttrName,"true"),t.sideMenu&&(t.sideMenu.style.opacity="0"),t.leftPanel&&(t.leftPanel.style.opacity="0"),t.bypassfullscreenChanged=!0,document.documentElement.addEventListener("fullscreenchange",t.exitFullScreen);var e=document.querySelector("body");this.observer.observe(e,{childList:!0,subtree:!1})}))}exitFullScreen(e){var t;let n=window.bpmnZoom;n.bypassfullscreenChanged?n.bypassfullscreenChanged=!1:(document.documentElement.removeEventListener("fullscreenchange",n.exitFullScreen),n.IsFullScreen=!1,n.sideMenu&&(n.sideMenu.style.opacity="1"),n.leftPanel&&(n.leftPanel.style.opacity="1"),n.container.parentElement.removeAttribute(n.isFullScreenAttrName),n.InvokeCallback(n,!0),document.exitFullscreen().catch((e=>console.log(`Error attempting to exit fullscreen mode: ${e.message} (${e.name})`))),null===(t=this.observer)||void 0===t||t.disconnect())}InvokeCallback(e,t=!1){e.CallBack&&e.CallBack(e.currentState.ZoomLevel,t)}changeZoomStep(e){0==e?(this.zoomScroll.reset(),localStorage.removeItem(this.persistStateName+"_zoom")):(this.zoomScroll.stepZoom(e),this.stepZoom=this.canvas.zoom(),localStorage.setItem(this.persistStateName+"_zoom",this.stepZoom))}SetDefaultZoom(){this.stepZoom=localStorage.getItem(this.persistStateName+"_zoom"),this.stepZoom?this.canvas.zoom(this.stepZoom):this.stepZoom=1;var e=localStorage.getItem(this.persistStateName+"_dim");e&&(this.currentDim.Parse(e),this.canvas.viewbox({x:this.currentDim.X,y:this.currentDim.Y,width:this.currentDim.Width,height:this.currentDim.Height}))}InvestigateDialog(){var e,t;if(!this.IsFullScreen)return;let n=$(".modal.show");if(n){let i=$(this.fullScreenElementSelector);null==i||i.append(n),null==i||i.append($(".modal-backdrop.show")),null===(t=null===(e=n[0])||void 0===e?void 0:e.querySelector(".modal-dialog"))||void 0===t||t.classList.add("modal-dialog-centered");let r=$("#alertify");r.length>0&&(null==i||i.append(r))}}}class i_{constructor(e,t,n,i){this.X=e,this.Y=t,this.Width=n,this.height=i}Parse(e){var t=e.split(":");if(4!=t.length)throw new Error("dimenssions is not correct");this.X=Number(t[0]),this.Y=Number(t[1]),this.Width=Number(t[2]),this.Height=Number(t[3])}ToString(){return`${this.X}:${this.Y}:${this.Width}:${this.Height}`}}class r_{constructor(e,t,n){if(this.modeler=new Wb({container:"#"+e,keyboard:{bindTo:document},taskResizingEnabled:!0,additionalModules:[t_]}),this.eventBus=this.modeler.get("eventBus"),this.elementFactory=this.modeler.get("elementFactory"),this.modeling=this.modeler.get("modeling"),this.zoomModule=new n_(this.modeler,this.eventBus,document.getElementById(e),null,t,n),this.zoomModule.Render(),this.elementRegistry=this.modeler.get("elementRegistry"),!this._isFirstTime){this.commandStack=this.modeler.get("commandStack");let e=this;document.addEventListener("keydown",(t=>{t.ctrlKey&&("z"==t.key||"Z"==t.key?e.commandStack.undo():"y"!=t.key&&"Y"!=t.key||e.commandStack.redo())}))}}loadXml=async function(e){if(this._isFirstTime=!1,!e)throw new Error("xmlData cannot be null");return this.modeler.importXML(e).catch((e=>{e&&console.error(e)}))};createWorkflowModelParticipant=function(e,t,n){let i,r=this.elementRegistry.get("Process_1");if(r||(i=this.elementRegistry.filter((function(e){return xr(e,"bpmn:Collaboration")}))),!i||0==i.length){var o=this.elementRegistry.filter((function(e){return xr(e,"bpmn:Process")}));if(!o||1!=o.length)throw new Error("diagram is not valid");r=o[0]}let a=this.getBounds();const s=this.elementFactory.createParticipantShape({type:"bpmn:Participant"});this.modeling.createShape(s,{x:a[0],y:a[1]},r||i[0]),this.modeling.updateProperties(s,{name:e}),t&&this.modeling.updateProperties(s,{actorID:t}),n&&this.modeling.updateProperties(s,{integrationID:n})};getBounds(){let e=this.elementRegistry.filter((function(e){return xr(e,"bpmn:Participant")}));if(e&&0!=e.length){let t=e.pop();return[t.x+t.width/2+350,t.y+t.height/2]}return[350,250]}}r_._isFirstTime=!0;const o_={__init__:["verticalParticipantRenderer"],verticalParticipantRenderer:["type",Ub]};class a_{constructor(e,t,n){this.viewer=new Ra({container:"#"+e,additionalModules:[[].concat(rs,o_,Qa)]}),this.zoomModule=new n_(this.viewer,this.viewer.get("eventBus"),document.getElementById(e),null,t,n),this.zoomModule.Render()}loadXml=async function(e){const t=this;if(this._isFirstTime=!1,!e)throw new Error("xmlData cannot be null");return this.viewer.importXML(e).catch((e=>{e&&console.error(e)})).then((()=>t.zoomModule.SetDefaultZoom()))}}})(),i})())); \ No newline at end of file diff --git a/package.json b/package.json index 73c95bc3..8ff97fde 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@Geeksltd/visualspec.shared.bpmn-js", - "version": "2.0.0", + "version": "2.1.0", "description": "bpmn-js module to create bpmn 2 diagram", "private": false, "scripts": { diff --git a/sample/app.js b/sample/app.js index bcfad35a..a155cd54 100644 --- a/sample/app.js +++ b/sample/app.js @@ -1,7 +1,8 @@ import diagramXML from './resources/testDiagram.bpmn'; import diagramXML2 from './resources/diagram.bpmn'; -import vsbpmn from '../src/bpmn'; -import vsbpmnViewer from '../src/bpmnViewer'; +// import vsbpmn from '../src/vsbpmn'; +// import vsbpmnViewer from '../src/vsbpmnViewer'; +import {vsbpmn,vsbpmnViewer} from '../src/index'; //var container = document.getElementById('js-canvas'); var bpmn = new vsbpmn('js-canvas',"testPersist"); diff --git a/src/index.js b/src/index.js new file mode 100644 index 00000000..32128c9c --- /dev/null +++ b/src/index.js @@ -0,0 +1,6 @@ +import vsbpmn from "./vsbpmn"; +import vsbpmnViewer from "./vsbpmnViewer"; +export { + vsbpmn + ,vsbpmnViewer +} \ No newline at end of file diff --git a/src/bpmn.js b/src/vsbpmn.js similarity index 100% rename from src/bpmn.js rename to src/vsbpmn.js diff --git a/src/bpmnViewer.js b/src/vsbpmnViewer.js similarity index 96% rename from src/bpmnViewer.js rename to src/vsbpmnViewer.js index 9e8a7291..2565c5d0 100644 --- a/src/bpmnViewer.js +++ b/src/vsbpmnViewer.js @@ -4,7 +4,7 @@ import BpmnViewer from 'bpmn-js'; import zoomScroll from 'diagram-js/lib/navigation/zoomscroll'; import MoveCanvas from 'diagram-js/lib/navigation/movecanvas'; -export default class vsbpmn{ +export default class vsbpmnViewer{ constructor(element,persistStateName,fullScreenElementSelector){ //if (!vsbpmn.modeler) diff --git a/webpack.config.js b/webpack.config.js index 599937b4..6056f55a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,7 +7,9 @@ module.exports = { }, output: { path: __dirname + '/public', - filename: 'app.js', + filename:'app.js', + // library: "bpmn", + // libraryTarget: "umd" }, module: { rules: [{ @@ -21,7 +23,7 @@ module.exports = { { from: '**/*.{html,css}', context: 'sample/' } ]) ], - mode: 'development', + mode: 'production', devtool: 'inline-source-map', devServer: { }, diff --git a/webpack.production.config.js b/webpack.production.config.js index 51cdce24..e657c95f 100644 --- a/webpack.production.config.js +++ b/webpack.production.config.js @@ -3,7 +3,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { entry: { - bundle: [ './src/bpmn.js','./src/bpmnViewer.js' ] + bundle: [ './src/index.js' ] }, output: { path: path.join(__dirname, 'dist'),