123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- var K2=Object.defineProperty,Y2=Object.defineProperties;var X2=Object.getOwnPropertyDescriptors;var Us=Object.getOwnPropertySymbols;var Xy=Object.prototype.hasOwnProperty,Zy=Object.prototype.propertyIsEnumerable;var nu=(Bt,zt,Lt)=>zt in Bt?K2(Bt,zt,{enumerable:!0,configurable:!0,writable:!0,value:Lt}):Bt[zt]=Lt,Ct=(Bt,zt)=>{for(var Lt in zt||(zt={}))Xy.call(zt,Lt)&&nu(Bt,Lt,zt[Lt]);if(Us)for(var Lt of Us(zt))Zy.call(zt,Lt)&&nu(Bt,Lt,zt[Lt]);return Bt},Pn=(Bt,zt)=>Y2(Bt,X2(zt));var Qy=(Bt,zt)=>{var Lt={};for(var q in Bt)Xy.call(Bt,q)&&zt.indexOf(q)<0&&(Lt[q]=Bt[q]);if(Bt!=null&&Us)for(var q of Us(Bt))zt.indexOf(q)<0&&Zy.call(Bt,q)&&(Lt[q]=Bt[q]);return Lt};var Jy=(Bt,zt,Lt)=>(nu(Bt,typeof zt!="symbol"?zt+"":zt,Lt),Lt);var Ui=(Bt,zt,Lt)=>new Promise((q,jo)=>{var Xs=An=>{try{Er(Lt.next(An))}catch(wr){jo(wr)}},Ve=An=>{try{Er(Lt.throw(An))}catch(wr){jo(wr)}},Er=An=>An.done?q(An.value):Promise.resolve(An.value).then(Xs,Ve);Er((Lt=Lt.apply(Bt,zt)).next())});import{bX as qs,a4 as tg,__tla as Z2}from"./index-fd0fd824.js";import{i as it,a as lt,f as k,b as ct,c as yt,d as oe,g as Bo,e as N,h as Ks,r as Ge,j as No,k as pn,s as ln,l as eg,m as Ce,n as pe,o as Me,p as Q2,q as un,t as ng,u as kn,v as be,w as Tn,x as hn,y as ae,z as Ys,A as iu,B as ig,C as J2,D as tk,E as ru,F as ek,G as nk}from"./index.esm-5037906b.js";import{_ as ik,l as rk,B as rg}from"./preact.module-c336cfe0.js";let Oo,ok=Promise.all([(()=>{try{return Z2}catch(Bt){}})()]).then(()=>Ui(void 0,null,function*(){var Bt={exports:{}};typeof Object.create=="function"?Bt.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Bt.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}};var zt=Bt.exports;const Lt=qs(zt);function q(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}function jo(t,e){return e={exports:{}},t(e,e.exports),e.exports}var Xs=jo(function(t){var e=t.exports=function(n,i){if(i||(i=16),n===void 0&&(n=128),n<=0)return"0";for(var r=Math.log(Math.pow(2,n))/Math.log(i),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,n/o))/Math.log(i)*o;for(var a=r-Math.floor(r),s="",o=0;o<Math.floor(r);o++){var c=Math.floor(Math.random()*i).toString(i);s=c+s}if(a){var p=Math.pow(i,a),c=Math.floor(Math.random()*p).toString(i);s=c+s}var l=parseInt(s,i);return l!==1/0&&l>=Math.pow(2,n)?e(n,i):s};e.rack=function(n,i,r){var o=function(s){var c=0;do{if(c++>10)if(r)n+=r;else throw new Error("too many ID collisions, use more bits");var p=e(n,i)}while(Object.hasOwnProperty.call(a,p));return a[p]=s,p},a=o.hats={};return o.get=function(s){return o.hats[s]},o.set=function(s,c){return o.hats[s]=c,o},o.bits=n||128,o.base=i||16,o}});function Ve(t){if(!(this instanceof Ve))return new Ve(t);t=t||[128,36,1],this._seed=t.length?Xs.rack(t[0],t[1],t[2]):t}Ve.prototype.next=function(t){return this._seed(t||!0)},Ve.prototype.nextPrefixed=function(t,e){var n;do n=t+this.next(!0);while(this.assigned(n));return this.claim(n,e),n},Ve.prototype.claim=function(t,e){this._seed.set(t,e||!0)},Ve.prototype.assigned=function(t){return this._seed.get(t)||!1},Ve.prototype.unclaim=function(t){delete this._seed.hats[t]},Ve.prototype.clear=function(){var t=this._seed.hats,e;for(e in t)this.unclaim(e)};function Er(t,e){return e.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(i){if(i!=="default"&&!(i in t)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}})}),Object.freeze(t)}const An=Object.prototype.toString,wr=Object.prototype.hasOwnProperty;function og(t){return t===void 0}function ag(t){return An.call(t)==="[object Array]"}function sg(t,e){return wr.call(t,e)}function ou(t,e){let n,i;if(og(t))return;const r=ag(t)?pg:cg;for(let o in t)if(sg(t,o)&&(n=t[o],i=e(n,r(o)),i===!1))return n}function cg(t){return t}function pg(t){return Number(t)}function se(t,...e){const n=t.style;return ou(e,function(i){i&&ou(i,function(r,o){n[o]=r})}),t}function fe(t,e,n){return arguments.length==2?t.getAttribute(e):n===null?t.removeAttribute(e):(t.setAttribute(e,n),t)}const lg=Object.prototype.toString;function te(t){return new Yn(t)}function Yn(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}Yn.prototype.add=function(t){return this.list.add(t),this},Yn.prototype.remove=function(t){return lg.call(t)=="[object RegExp]"?this.removeMatching(t):(this.list.remove(t),this)},Yn.prototype.removeMatching=function(t){const e=this.array();for(let n=0;n<e.length;n++)t.test(e[n])&&this.remove(e[n]);return this},Yn.prototype.toggle=function(t,e){return typeof e<"u"?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this},Yn.prototype.array=function(){return Array.from(this.list)},Yn.prototype.has=Yn.prototype.contains=function(t){return this.list.contains(t)};function Lo(t){for(var e;e=t.firstChild;)t.removeChild(e);return t}function Mn(t,e,n){var i=n?t:t.parentNode;return i&&typeof i.closest=="function"&&i.closest(e)||null}var Io={},$o,Zs,Qs;function au(){$o=window.addEventListener?"addEventListener":"attachEvent",Zs=window.removeEventListener?"removeEventListener":"detachEvent",Qs=$o!=="addEventListener"?"on":""}var ug=Io.bind=function(t,e,n,i){return $o||au(),t[$o](Qs+e,n,i||!1),n},hg=Io.unbind=function(t,e,n,i){return Zs||au(),t[Zs](Qs+e,n,i||!1),n},J=Er({__proto__:null,bind:ug,unbind:hg,default:Io},[Io]),su=["focus","blur"];function dg(t,e,n,i,r){return su.indexOf(n)!==-1&&(r=!0),J.bind(t,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Mn(a,e,!0),o.delegateTarget&&i.call(t,o)},r)}function fg(t,e,n,i){return su.indexOf(e)!==-1&&(i=!0),J.unbind(t,e,n,i)}var Re={bind:dg,unbind:fg},mg=vg,cu=!1,zo;typeof document<"u"&&(zo=document.createElement("div"),zo.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',cu=!zo.getElementsByTagName("link").length,zo=void 0);var Xt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:cu?[1,"X<div>","</div>"]:[0,"",""]};Xt.td=Xt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Xt.option=Xt.optgroup=[1,'<select multiple="multiple">',"</select>"],Xt.thead=Xt.tbody=Xt.colgroup=Xt.caption=Xt.tfoot=[1,"<table>","</table>"],Xt.polyline=Xt.ellipse=Xt.polygon=Xt.circle=Xt.text=Xt.line=Xt.path=Xt.rect=Xt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function vg(t,e){if(typeof t!="string")throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body"){var c=e.createElement("html");return c.innerHTML=t,c.removeChild(c.lastChild)}var r=Object.prototype.hasOwnProperty.call(Xt,i)?Xt[i]:Xt._default,o=r[0],a=r[1],s=r[2],c=e.createElement("div");for(c.innerHTML=a+t+s;o--;)c=c.lastChild;if(c.firstChild==c.lastChild)return c.removeChild(c.firstChild);for(var p=e.createDocumentFragment();c.firstChild;)p.appendChild(c.removeChild(c.firstChild));return p}var Mt=mg;function Js(t,e){return t&&typeof t.matches=="function"&&t.matches(e)||!1}function At(t,e){return e=e||document,e.querySelector(t)}function tc(t,e){return e=e||document,e.querySelectorAll(t)}function dn(t){t.parentNode&&t.parentNode.removeChild(t)}function yg(t,e){if(t.ownerDocument!==e.ownerDocument)try{return e.ownerDocument.importNode(t,!0)}catch(n){}return t}function pu(t,e){return e.appendChild(yg(t,e))}function tt(t,e){return pu(e,t),t}var ec=2,lu={"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":ec,"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":ec,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function gg(t,e){return lu[e]?t.style[e]:t.getAttributeNS(null,e)}function uu(t,e,n){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=lu[i];r?(r===ec&&typeof n=="number"&&(n=String(n)+"px"),t.style[i]=n):t.setAttributeNS(null,e,n)}function bg(t,e){var n=Object.keys(e),i,r;for(i=0,r;r=n[i];i++)uu(t,r,e[r])}function Y(t,e,n){if(typeof e=="string")if(n!==void 0)uu(t,e,n);else return gg(t,e);else bg(t,e);return t}const xg=Object.prototype.toString;function ht(t){return new Xn(t)}function Xn(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}Xn.prototype.add=function(t){return this.list.add(t),this},Xn.prototype.remove=function(t){return xg.call(t)=="[object RegExp]"?this.removeMatching(t):(this.list.remove(t),this)},Xn.prototype.removeMatching=function(t){const e=this.array();for(let n=0;n<e.length;n++)t.test(e[n])&&this.remove(e[n]);return this},Xn.prototype.toggle=function(t,e){return typeof e<"u"?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this},Xn.prototype.array=function(){return Array.from(this.list)},Xn.prototype.has=Xn.prototype.contains=function(t){return this.list.contains(t)};function Fo(t){for(var e;e=t.firstChild;)t.removeChild(e);return t}function hu(t){return t.cloneNode(!0)}var nc={svg:"http://www.w3.org/2000/svg"},du='<svg xmlns="'+nc.svg+'"';function fu(t){var e=!1;t.substring(0,4)==="<svg"?t.indexOf(nc.svg)===-1&&(t=du+t.substring(4)):(t=du+">"+t+"</svg>",e=!0);var n=_g(t);if(!e)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function _g(t){var e;return e=new DOMParser,e.async=!1,e.parseFromString(t,"text/xml")}function Z(t,e){var n;return t=t.trim(),t.charAt(0)==="<"?(n=fu(t).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(nc.svg,t),e&&Y(n,e),n}var ic=null;function rc(){return ic===null&&(ic=Z("svg")),ic}function mu(t,e){var n,i,r=Object.keys(e);for(n=0;i=r[n];n++)t[i]=e[i];return t}function Eg(t,e,n,i,r,o){var a=rc().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return mu(a,t);case 6:return mu(a,{a:t,b:e,c:n,d:i,e:r,f:o})}}function Sr(t){return t?rc().createSVGTransformFromMatrix(t):rc().createSVGTransform()}var vu=/([&<>]{1})/g,wg=/([\n\r"]{1})/g,Sg={"&":"&","<":"<",">":">",'"':"'"};function oc(t,e){function n(i,r){return Sg[r]||r}return t.replace(e,n)}function yu(t,e){var n,i,r,o,a;switch(t.nodeType){case 3:e.push(oc(t.textContent,vu));break;case 1:if(e.push("<",t.tagName),t.hasAttributes())for(r=t.attributes,n=0,i=r.length;n<i;++n)o=r.item(n),e.push(" ",o.name,'="',oc(o.value,wg),'"');if(t.hasChildNodes()){for(e.push(">"),a=t.childNodes,n=0,i=a.length;n<i;++n)yu(a.item(n),e);e.push("</",t.tagName,">")}else e.push("/>");break;case 8:e.push("<!--",oc(t.nodeValue,vu),"-->");break;case 4:e.push("<![CDATA[",t.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+t.nodeType)}return e}function Cg(t,e){var n=fu(e);if(Fo(t),!!e){Pg(n)||(n=n.documentElement);for(var i=kg(n.childNodes),r=0;r<i.length;r++)pu(i[r],t)}}function Rg(t){for(var e=t.firstChild,n=[];e;)yu(e,n),e=e.nextSibling;return n.join("")}function Pg(t){return t.nodeName==="#document-fragment"}function gu(t,e){if(e!==void 0){try{Cg(t,e)}catch(n){throw new Error("error parsing SVG: "+n.message)}return t}else return Rg(t)}function kg(t){return Array.prototype.slice.call(t)}function Gt(t){var e=t.parentNode;return e&&e.removeChild(t),t}function Tg(t,e){return e instanceof SVGMatrix?t.createSVGTransformFromMatrix(e):e}function Ag(t,e){var n,i;for(t.clear(),n=0;i=e[n];n++)t.appendItem(Tg(t,i))}function Cr(t,e){var n=t.transform.baseVal;return e&&(Array.isArray(e)||(e=[e]),Ag(n,e)),n.consolidate()}const Mg=/^class[ {]/;function Dg(t){return Mg.test(t.toString())}function ac(t){return Array.isArray(t)}function sc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Ho(...t){t.length===1&&ac(t[0])&&(t=t[0]),t=[...t];const e=t.pop();return e.$inject=t,e}const Bg=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Ng=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Og=/\/\*([^*]*)\*\//m;function jg(t){if(typeof t!="function")throw new Error(`Cannot annotate "${t}". Expected a function!`);const e=t.toString().match(Dg(t)?Bg:Ng);if(!e)return[];const n=e[1]||e[2];return n&&n.split(",").map(i=>{const r=i.match(Og);return(r&&r[1]||i).trim()})||[]}function bu(t,e){e=e||{get:function(E,_){if(n.push(E),_===!1)return null;throw a(`No provider for "${E}"!`)}};const n=[],i=this._providers=Object.create(e._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(E){const _=n.join(" -> ");return n.length=0,new Error(_?`${E} (Resolving: ${_})`:E)};function s(E,_){if(!i[E]&&E.indexOf(".")!==-1){const x=E.split(".");let S=s(x.shift());for(;x.length;)S=S[x.shift()];return S}if(sc(r,E))return r[E];if(sc(i,E)){if(n.indexOf(E)!==-1)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 e.get(E,_)}function c(E,_){if(typeof _>"u"&&(_={}),typeof E!="function")if(ac(E))E=Ho(E.slice());else throw a(`Cannot invoke "${E}". Expected a function!`);const x=(E.$inject||jg(E)).map(S=>sc(_,S)?_[S]:s(S));return{fn:E,dependencies:x}}function p(E){const{fn:_,dependencies:x}=c(E),S=Function.prototype.bind.apply(_,[null].concat(x));return new S}function l(E,_,x){const{fn:S,dependencies:M}=c(E,x);return S.apply(_,M)}function u(E){return Ho(_=>E.get(_))}function h(E,_){if(_&&_.length){const x=Object.create(null),S=Object.create(null),M=[],j=[],B=[];let D,$,z,F;for(let U in i)D=i[U],_.indexOf(U)!==-1&&(D[2]==="private"?($=M.indexOf(D[3]),$===-1?(z=D[3].createChild([],_),F=u(z),M.push(D[3]),j.push(z),B.push(F),x[U]=[F,U,"private",z]):x[U]=[B[$],U,"private",j[$]]):x[U]=[D[2],D[1]],S[U]=!0),(D[2]==="factory"||D[2]==="type")&&D[1].$scope&&_.forEach(ut=>{D[1].$scope.indexOf(ut)!==-1&&(x[U]=[D[2],D[1]],S[ut]=!0)});_.forEach(U=>{if(!S[U])throw new Error('No provider for "'+U+'". Cannot use provider from the parent!')}),E.unshift(x)}return new bu(E,o)}const d={factory:l,type:p,value:function(E){return E}};function f(E,_){const x=E.__init__||[];return function(){x.forEach(S=>{typeof S=="string"?_.get(S):_.invoke(S)})}}function v(E){const _=E.__exports__;if(_){const x=E.__modules__,S=Object.keys(E).reduce(($,z)=>(z!=="__exports__"&&z!=="__modules__"&&z!=="__init__"&&z!=="__depends__"&&($[z]=E[z]),$),Object.create(null)),M=(x||[]).concat(S),j=h(M),B=Ho(function($){return j.get($)});_.forEach(function($){i[$]=[B,$,"private",j]});const D=(E.__init__||[]).slice();return D.unshift(function(){j.init()}),E=Object.assign({},E,{__init__:D}),f(E,j)}return Object.keys(E).forEach(function(x){if(x==="__init__"||x==="__depends__")return;if(E[x][2]==="private"){i[x]=E[x];return}const S=E[x][0],M=E[x][1];i[x]=[d[S],Lg(S,M),S]}),f(E,o)}function g(E,_){return E.indexOf(_)!==-1||(E=(_.__depends__||[]).reduce(g,E),E.indexOf(_)!==-1)?E:E.concat(_)}function R(E){const _=E.reduce(g,[]).map(v);let x=!1;return function(){x||(x=!0,_.forEach(S=>S()))}}this.get=s,this.invoke=l,this.instantiate=p,this.createChild=h,this.init=R(t)}function Lg(t,e){return t!=="value"&&ac(e)&&(e=Ho(e.slice())),e}var Ig=1e3;function fn(t,e){var n=this;e=e||Ig,t.on(["render.shape","render.connection"],e,function(i,r){var o=i.type,a=r.element,s=r.gfx,c=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),t.on(["render.getShapePath","render.getConnectionPath"],e,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}fn.prototype.canRender=function(t){},fn.prototype.drawShape=function(t,e){},fn.prototype.drawConnection=function(t,e){},fn.prototype.getShapePath=function(t){},fn.prototype.getConnectionPath=function(t){};function wi(t){return t.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function $g(t){return["M",t.x,t.y]}function cc(t){return["L",t.x,t.y]}function zg(t,e,n){return["C",t.x,t.y,e.x,e.y,n.x,n.y]}function Fg(t,e){const n=t.length,i=[$g(t[0])];for(let r=1;r<n;r++){const o=t[r-1],a=t[r],s=t[r+1];if(!s||!e){i.push(cc(a));continue}const c=Math.min(e,pc(a.x-o.x,a.y-o.y),pc(s.x-a.x,s.y-a.y));if(!c){i.push(cc(a));continue}const p=Go(a,o,c),l=Go(a,o,c*.5),u=Go(a,s,c),h=Go(a,s,c*.5);i.push(cc(p)),i.push(zg(l,h,u))}return i}function Go(t,e,n){const i=e.x-t.x,r=e.y-t.y,o=pc(i,r),a=n/o;return{x:t.x+i*a,y:t.y+r*a}}function pc(t,e){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2))}function Vo(t,e,n){it(e)&&(n=e,e=null),e||(e={});const i=Z("path",e);return it(n)&&(i.dataset.cornerRadius=String(n)),xu(i,t)}function xu(t,e){const n=parseInt(t.dataset.cornerRadius,10)||0;return Y(t,{d:wi(Fg(e,n))}),t}function Wo(t){return ct(t,function(e){return!yt(t,function(n){return n!==e&&_u(e,n)})})}function _u(t,e){if(e){if(t===e)return e;if(t.parent)return _u(t.parent,e)}}function Eu(t,e,n){var i=!n||t.indexOf(e)===-1;return i&&t.push(e),i}function Si(t,e,n){n=n||0,lt(t)||(t=[t]),k(t,function(i,r){var o=e(i,r,n);lt(o)&&o.length&&Si(o,e,n+1)})}function Hg(t,e,n){var i=[],r=[];return Si(t,function(o,a,s){Eu(i,o,e);var c=o.children;if((n===-1||s<n)&&c&&Eu(r,c,e))return c}),i}function Rr(t,e){return Hg(t,!e,-1)}function Gg(t,e,n){Ks(e)&&(e=!0),oe(e)&&(n=e,e=!0),n=n||{};var i=Pr(n.allShapes),r=Pr(n.allConnections),o=Pr(n.enclosedElements),a=Pr(n.enclosedConnections),s=Pr(n.topLevel,e&&Bo(t,function(l){return l.id}));function c(l){s[l.source.id]&&s[l.target.id]&&(s[l.id]=[l]),i[l.source.id]&&i[l.target.id]&&(a[l.id]=o[l.id]=l),r[l.id]=l}function p(l){if(o[l.id]=l,l.waypoints)a[l.id]=r[l.id]=l;else return i[l.id]=l,k(l.incoming,c),k(l.outgoing,c),l.children}return Si(t,p),{allShapes:i,allConnections:r,topLevel:s,enclosedConnections:a,enclosedElements:o}}function Vt(t,e){e=!!e,lt(t)||(t=[t]);var n,i,r,o;return k(t,function(a){var s=a;a.waypoints&&!e&&(s=Vt(a.waypoints,!0));var c=s.x,p=s.y,l=s.height||0,u=s.width||0;(c<n||n===void 0)&&(n=c),(p<i||i===void 0)&&(i=p),(c+u>r||r===void 0)&&(r=c+u),(p+l>o||o===void 0)&&(o=p+l)}),{x:n,y:i,height:o-i,width:r-n}}function Vg(t,e){var n={};return k(t,function(i){var r=i;r.waypoints&&(r=Vt(r)),!it(e.y)&&r.x>e.x&&(n[i.id]=i),!it(e.x)&&r.y>e.y&&(n[i.id]=i),r.x>e.x&&r.y>e.y&&(it(e.width)&&it(e.height)&&r.width+r.x<e.width+e.x&&r.height+r.y<e.height+e.y||!it(e.width)||!it(e.height))&&(n[i.id]=i)}),n}function wu(t){return"waypoints"in t?"connection":"x"in t?"shape":"root"}function Su(t){return!!(t&&t.isFrame)}function Pr(t,e){return N({},t||{},e||{})}var Wg=1;function Zn(t,e){fn.call(this,t,Wg),this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=e.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}q(Zn,fn),Zn.prototype.canRender=function(){return!0},Zn.prototype.drawShape=function(t,e,n){var i=Z("rect");return Y(i,{x:0,y:0,width:e.width||0,height:e.height||0}),Su(e)?Y(i,N({},this.FRAME_STYLE,n||{})):Y(i,N({},this.SHAPE_STYLE,n||{})),tt(t,i),i},Zn.prototype.drawConnection=function(t,e,n){var i=Vo(e.waypoints,N({},this.CONNECTION_STYLE,n||{}));return tt(t,i),i},Zn.prototype.getShapePath=function(t){var e=t.x,n=t.y,i=t.width,r=t.height,o=[["M",e,n],["l",i,0],["l",0,r],["l",-i,0],["z"]];return wi(o)},Zn.prototype.getConnectionPath=function(t){var e=t.waypoints,n,i,r=[];for(n=0;i=e[n];n++)i=i.original||i,r.push([n===0?"M":"L",i.x,i.y]);return wi(r)},Zn.$inject=["eventBus","styles"];function Ug(){var t={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},e=this;this.cls=function(n,i,r){var o=this.style(i,r);return N(o,{class:n})},this.style=function(n,i){!lt(n)&&!i&&(i=n,n=[]);var r=Ge(n,function(o,a){return N(o,t[a]||{})},{});return i?N(r,i):r},this.computeStyle=function(n,i,r){return lt(i)||(r=i,i=[]),e.style(i||[],N({},r,n||{}))}}const qg={__init__:["defaultRenderer"],defaultRenderer:["type",Zn],styles:["type",Ug]};function Wt(t,e){if(!t||!e)return-1;var n=t.indexOf(e);return n!==-1&&t.splice(n,1),n}function Zt(t,e,n){if(!(!t||!e)){typeof n!="number"&&(n=-1);var i=t.indexOf(e);if(i!==-1){if(i===n)return;if(n!==-1)t.splice(i,1);else return}n!==-1?t.splice(n,0,e):t.push(e)}}function lc(t,e){return!t||!e?-1:t.indexOf(e)}function kr(t,e){return!t||!e?-1:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function uc(t,e,n,i){if(typeof i>"u"&&(i=5),!t||!e||!n)return!1;var r=(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x),o=kr(t,e);return Math.abs(r/o)<=i}var Kg=2;function Dn(t,e){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[r,o]of Object.entries(i))if(Yg(r,n))return o;return!1}function Yg(t,e){const n=e[0];return No(e,function(i){return Math.abs(n[t]-i[t])<=Kg})}function Cu(t,e,n){return n=n||0,t.x>e.x-n&&t.y>e.y-n&&t.x<e.x+e.width+n&&t.y<e.y+e.height+n}function hc(t,e){return{x:Math.round(t.x+(e.x-t.x)/2),y:Math.round(t.y+(e.y-t.y)/2)}}var Xg=/,?([a-z]),?/gi,Ru=parseFloat,Ut=Math,Qn=Ut.PI,mn=Ut.min,vn=Ut.max,Pu=Ut.pow,Jn=Ut.abs,Zg=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,Qg=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,Uo=Array.isArray||function(t){return t instanceof Array};function dc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Tr(t){if(typeof t=="function"||Object(t)!==t)return t;var e=new t.constructor;for(var n in t)dc(t,n)&&(e[n]=Tr(t[n]));return e}function Jg(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return t.push(t.splice(n,1)[0])}function t0(t){function e(){var n=Array.prototype.slice.call(arguments,0),i=n.join("\u2400"),r=e.cache=e.cache||{},o=e.count=e.count||[];return dc(r,i)?(Jg(o,i),r[i]):(o.length>=1e3&&delete r[o.shift()],o.push(i),r[i]=t.apply(0,n),r[i])}return e}function e0(t){if(!t)return null;var e=qi(t);if(e.arr)return Tr(e.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return Uo(t)&&Uo(t[0])&&(i=Tr(t)),i.length||String(t).replace(Zg,function(r,o,a){var s=[],c=o.toLowerCase();for(a.replace(Qg,function(p,l){l&&s.push(+l)}),c=="m"&&s.length>2&&(i.push([o].concat(s.splice(0,2))),c="l",o=o=="m"?"l":"L");s.length>=n[c]&&(i.push([o].concat(s.splice(0,n[c]))),!!n[c]););}),i.toString=qi.toString,e.arr=Tr(i),i}function qi(t){var e=qi.ps=qi.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var n in e)dc(e,n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])}),e[t]}function fc(t,e,n,i){return arguments.length===1&&(e=t.y,n=t.width,i=t.height,t=t.x),{x:t,y:e,width:n,height:i,x2:t+n,y2:e+i}}function ku(){return this.join(",").replace(Xg,"$1")}function qo(t){var e=Tr(t);return e.toString=ku,e}function Tu(t,e,n,i,r,o,a,s,c){var p=1-c,l=Pu(p,3),u=Pu(p,2),h=c*c,d=h*c,f=l*t+u*3*c*n+p*3*c*c*r+d*a,v=l*e+u*3*c*i+p*3*c*c*o+d*s;return{x:Ko(f),y:Ko(v)}}function Au(t){var e=s0.apply(null,t);return fc(e.x0,e.y0,e.x1-e.x0,e.y1-e.y0)}function ti(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height}function n0(t,e){return t=fc(t),e=fc(e),ti(e,t.x,t.y)||ti(e,t.x2,t.y)||ti(e,t.x,t.y2)||ti(e,t.x2,t.y2)||ti(t,e.x,e.y)||ti(t,e.x2,e.y)||ti(t,e.x,e.y2)||ti(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)}function Mu(t,e,n,i,r){var o=-3*e+9*n-9*i+3*r,a=t*o+6*e-12*n+6*i;return t*a-3*e+3*n}function Du(t,e,n,i,r,o,a,s,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var p=c/2,l=12,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<l;f++){var v=p*u[f]+p,g=Mu(v,t,n,r,a),R=Mu(v,e,i,o,s),E=g*g+R*R;d+=h[f]*Ut.sqrt(E)}return p*d}function i0(t,e,n,i,r,o,a,s){if(!(vn(t,n)<mn(r,a)||mn(t,n)>vn(r,a)||vn(e,i)<mn(o,s)||mn(e,i)>vn(o,s))){var c=(t*i-e*n)*(r-a)-(t-n)*(r*s-o*a),p=(t*i-e*n)*(o-s)-(e-i)*(r*s-o*a),l=(t-n)*(o-s)-(e-i)*(r-a);if(l){var u=Ko(c/l),h=Ko(p/l),d=+u.toFixed(2),f=+h.toFixed(2);if(!(d<+mn(t,n).toFixed(2)||d>+vn(t,n).toFixed(2)||d<+mn(r,a).toFixed(2)||d>+vn(r,a).toFixed(2)||f<+mn(e,i).toFixed(2)||f>+vn(e,i).toFixed(2)||f<+mn(o,s).toFixed(2)||f>+vn(o,s).toFixed(2)))return{x:u,y:h}}}}function Ko(t){return Math.round(t*1e11)/1e11}function r0(t,e,n){var i=Au(t),r=Au(e);if(!n0(i,r))return n?0:[];for(var o=Du.apply(0,t),a=Du.apply(0,e),s=Bu(t)?1:~~(o/5)||1,c=Bu(e)?1:~~(a/5)||1,p=[],l=[],u={},h=n?0:[],d=0;d<s+1;d++){var f=Tu.apply(0,t.concat(d/s));p.push({x:f.x,y:f.y,t:d/s})}for(d=0;d<c+1;d++)f=Tu.apply(0,e.concat(d/c)),l.push({x:f.x,y:f.y,t:d/c});for(d=0;d<s;d++)for(var v=0;v<c;v++){var g=p[d],R=p[d+1],E=l[v],_=l[v+1],x=Jn(R.x-g.x)<.01?"y":"x",S=Jn(_.x-E.x)<.01?"y":"x",M=i0(g.x,g.y,R.x,R.y,E.x,E.y,_.x,_.y),j;if(M){if(j=M.x.toFixed(9)+"#"+M.y.toFixed(9),u[j])continue;u[j]=!0;var B=g.t+Jn((M[x]-g[x])/(R[x]-g[x]))*(R.t-g.t),D=E.t+Jn((M[S]-E[S])/(_[S]-E[S]))*(_.t-E.t);B>=0&&B<=1&&D>=0&&D<=1&&(n?h++:h.push({x:M.x,y:M.y,t1:B,t2:D}))}}return h}function o0(t,e,n){t=ju(t),e=ju(e);for(var i,r,o,a,s,c,p,l,u,h,d=n?0:[],f=0,v=t.length;f<v;f++){var g=t[f];if(g[0]=="M")i=s=g[1],r=c=g[2];else{g[0]=="C"?(u=[i,r].concat(g.slice(1)),i=u[6],r=u[7]):(u=[i,r,i,r,s,c,s,c],i=s,r=c);for(var R=0,E=e.length;R<E;R++){var _=e[R];if(_[0]=="M")o=p=_[1],a=l=_[2];else{_[0]=="C"?(h=[o,a].concat(_.slice(1)),o=h[6],a=h[7]):(h=[o,a,o,a,p,l,p,l],o=p,a=l);var x=r0(u,h,n);if(n)d+=x;else{for(var S=0,M=x.length;S<M;S++)x[S].segment1=f,x[S].segment2=R,x[S].bez1=u,x[S].bez2=h;d=d.concat(x)}}}}}return d}function a0(t){var e=qi(t);if(e.abs)return qo(e.abs);if((!Uo(t)||!Uo(t&&t[0]))&&(t=e0(t)),!t||!t.length)return[["M",0,0]];var n=[],i=0,r=0,o=0,a=0,s=0,c;t[0][0]=="M"&&(i=+t[0][1],r=+t[0][2],o=i,a=r,s++,n[0]=["M",i,r]);for(var p,l,u=s,h=t.length;u<h;u++){if(n.push(p=[]),l=t[u],c=l[0],c!=c.toUpperCase())switch(p[0]=c.toUpperCase(),p[0]){case"A":p[1]=l[1],p[2]=l[2],p[3]=l[3],p[4]=l[4],p[5]=l[5],p[6]=+l[6]+i,p[7]=+l[7]+r;break;case"V":p[1]=+l[1]+r;break;case"H":p[1]=+l[1]+i;break;case"M":o=+l[1]+i,a=+l[2]+r;default:for(var d=1,f=l.length;d<f;d++)p[d]=+l[d]+(d%2?i:r)}else for(var v=0,g=l.length;v<g;v++)p[v]=l[v];switch(c=c.toUpperCase(),p[0]){case"Z":i=+o,r=+a;break;case"H":i=p[1];break;case"V":r=p[1];break;case"M":o=p[p.length-2],a=p[p.length-1];default:i=p[p.length-2],r=p[p.length-1]}}return n.toString=ku,e.abs=qo(n),n}function Bu(t){return t[0]===t[2]&&t[1]===t[3]&&t[4]===t[6]&&t[5]===t[7]}function Yo(t,e,n,i){return[t,e,n,i,n,i]}function Nu(t,e,n,i,r,o){var a=.3333333333333333,s=2/3;return[a*t+s*n,a*e+s*i,a*r+s*n,a*o+s*i,r,o]}function Ou(t,e,n,i,r,o,a,s,c,p){var l=Qn*120/180,u=Qn/180*(+r||0),h=[],d,f=t0(function(st,St,bt){var mt=st*Ut.cos(bt)-St*Ut.sin(bt),ie=st*Ut.sin(bt)+St*Ut.cos(bt);return{x:mt,y:ie}});if(p)j=p[0],B=p[1],S=p[2],M=p[3];else{d=f(t,e,-u),t=d.x,e=d.y,d=f(s,c,-u),s=d.x,c=d.y;var v=(t-s)/2,g=(e-c)/2,R=v*v/(n*n)+g*g/(i*i);R>1&&(R=Ut.sqrt(R),n=R*n,i=R*i);var E=n*n,_=i*i,x=(o==a?-1:1)*Ut.sqrt(Jn((E*_-E*g*g-_*v*v)/(E*g*g+_*v*v))),S=x*n*g/i+(t+s)/2,M=x*-i*v/n+(e+c)/2,j=Ut.asin(((e-M)/i).toFixed(9)),B=Ut.asin(((c-M)/i).toFixed(9));j=t<S?Qn-j:j,B=s<S?Qn-B:B,j<0&&(j=Qn*2+j),B<0&&(B=Qn*2+B),a&&j>B&&(j=j-Qn*2),!a&&B>j&&(B=B-Qn*2)}var D=B-j;if(Jn(D)>l){var $=B,z=s,F=c;B=j+l*(a&&B>j?1:-1),s=S+n*Ut.cos(B),c=M+i*Ut.sin(B),h=Ou(s,c,n,i,r,0,a,z,F,[B,$,S,M])}D=B-j;var U=Ut.cos(j),ut=Ut.sin(j),Ie=Ut.cos(B),Rt=Ut.sin(B),pt=Ut.tan(D/4),we=4/3*n*pt,C=4/3*i*pt,m=[t,e],A=[t+we*ut,e-C*U],O=[s+we*Rt,c-C*Ie],T=[s,c];if(A[0]=2*m[0]-A[0],A[1]=2*m[1]-A[1],p)return[A,O,T].concat(h);h=[A,O,T].concat(h).join().split(",");for(var L=[],G=0,ot=h.length;G<ot;G++)L[G]=G%2?f(h[G-1],h[G],u).y:f(h[G],h[G+1],u).x;return L}function s0(t,e,n,i,r,o,a,s){for(var c=[],p=[[],[]],l,u,h,d,f,v,g,R,E=0;E<2;++E){if(E==0?(u=6*t-12*n+6*r,l=-3*t+9*n-9*r+3*a,h=3*n-3*t):(u=6*e-12*i+6*o,l=-3*e+9*i-9*o+3*s,h=3*i-3*e),Jn(l)<1e-12){if(Jn(u)<1e-12)continue;d=-h/u,0<d&&d<1&&c.push(d);continue}g=u*u-4*h*l,R=Ut.sqrt(g),!(g<0)&&(f=(-u+R)/(2*l),0<f&&f<1&&c.push(f),v=(-u-R)/(2*l),0<v&&v<1&&c.push(v))}for(var _=c.length,x=_,S;_--;)d=c[_],S=1-d,p[0][_]=S*S*S*t+3*S*S*d*n+3*S*d*d*r+d*d*d*a,p[1][_]=S*S*S*e+3*S*S*d*i+3*S*d*d*o+d*d*d*s;return p[0][x]=t,p[1][x]=e,p[0][x+1]=a,p[1][x+1]=s,p[0].length=p[1].length=x+2,{x0:mn.apply(0,p[0]),y0:mn.apply(0,p[1]),x1:vn.apply(0,p[0]),y1:vn.apply(0,p[1])}}function ju(t){var e=qi(t);if(e.curve)return qo(e.curve);for(var n=a0(t),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(d,f,v){var g,R;if(!d)return["C",f.x,f.y,f.x,f.y,f.x,f.y];switch(!(d[0]in{T:1,Q:1})&&(f.qx=f.qy=null),d[0]){case"M":f.X=d[1],f.Y=d[2];break;case"A":d=["C"].concat(Ou.apply(0,[f.x,f.y].concat(d.slice(1))));break;case"S":v=="C"||v=="S"?(g=f.x*2-f.bx,R=f.y*2-f.by):(g=f.x,R=f.y),d=["C",g,R].concat(d.slice(1));break;case"T":v=="Q"||v=="T"?(f.qx=f.x*2-f.qx,f.qy=f.y*2-f.qy):(f.qx=f.x,f.qy=f.y),d=["C"].concat(Nu(f.x,f.y,f.qx,f.qy,d[1],d[2]));break;case"Q":f.qx=d[1],f.qy=d[2],d=["C"].concat(Nu(f.x,f.y,d[1],d[2],d[3],d[4]));break;case"L":d=["C"].concat(Yo(f.x,f.y,d[1],d[2]));break;case"H":d=["C"].concat(Yo(f.x,f.y,d[1],f.y));break;case"V":d=["C"].concat(Yo(f.x,f.y,f.x,d[1]));break;case"Z":d=["C"].concat(Yo(f.x,f.y,f.X,f.Y));break}return d},o=function(d,f){if(d[f].length>7){d[f].shift();for(var v=d[f];v.length;)a[f]="A",d.splice(f++,0,["C"].concat(v.splice(0,6)));d.splice(f,1),l=n.length}},a=[],s="",c="",p=0,l=n.length;p<l;p++){n[p]&&(s=n[p][0]),s!="C"&&(a[p]=s,p&&(c=a[p-1])),n[p]=r(n[p],i,c),a[p]!="A"&&s=="C"&&(a[p]="C"),o(n,p);var u=n[p],h=u.length;i.x=u[h-2],i.y=u[h-1],i.bx=Ru(u[h-4])||i.x,i.by=Ru(u[h-3])||i.y}return e.curve=qo(n),n}var c0=o0;const Lu=qs(c0);function Dt(t){return oe(t)&&pn(t,"waypoints")}function xt(t){return oe(t)&&pn(t,"labelTarget")}function Iu(t){return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function ei(t){return{x:Math.round(t.x),y:Math.round(t.y)}}function X(t){return{top:t.y,right:t.x+(t.width||0),bottom:t.y+(t.height||0),left:t.x}}function Xo(t){return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}function p0(t){return ei({x:t.x+(t.width||0)/2,y:t.y+(t.height||0)/2})}function l0(t){for(var e=t.waypoints,n=e.reduce(function(p,l,u){var h=e[u-1];if(h){var d=p[p.length-1],f=d&&d.endLength||0,v=d0(h,l);p.push({start:h,end:l,startLength:f,endLength:f+v,length:v})}return p},[]),i=n.reduce(function(p,l){return p+l.length},0),r=i/2,o=0,a=n[o];a.endLength<r;)a=n[++o];var s=(r-a.startLength)/a.length,c={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return c}function nt(t){return Dt(t)?l0(t):p0(t)}function le(t,e,n){n=n||0,oe(n)||(n={x:n,y:n});var i=X(t),r=X(e),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,s=i.top-n.y>=r.bottom,c=i.right+n.x<=r.left,p=o?"top":s?"bottom":null,l=c?"left":a?"right":null;return l&&p?p+"-"+l:l||p||"intersect"}function mc(t,e,n){var i=u0(t,e);return i.length===1||i.length===2&&kr(i[0],i[1])<1?ei(i[0]):i.length>1?(i=ln(i,function(r){var o=Math.floor(r.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,r.segment2+"#"+o}),ei(i[n?0:i.length-1])):null}function u0(t,e){return Lu(t,e)}function h0(t){t=t.slice();for(var e=0,n,i,r;t[e];)n=t[e],i=t[e-1],r=t[e+1],kr(n,r)===0||uc(i,r,n)?t.splice(e,1):e++;return t}function d0(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Zo(t,e){return Math.round(t*e)/e}function $u(t){return it(t)?t+"px":t}function f0(t){for(;t.parent;)t=t.parent;return t}function m0(t){t=N({},{width:"100%",height:"100%"},t);const e=t.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),se(n,{position:"relative",overflow:"hidden",width:$u(t.width),height:$u(t.height)}),e.appendChild(n),n}function zu(t,e,n){const i=Z("g");ht(i).add(e);const r=n!==void 0?n:t.childNodes.length-1;return t.insertBefore(i,t.childNodes[r]||null),i}const v0="base",Fu=0,y0=1,g0={shape:["x","y","width","height"],connection:["waypoints"]};function at(t,e,n,i){this._eventBus=e,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(t||{})}at.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],at.prototype._init=function(t){const e=this._eventBus,n=this._container=m0(t),i=this._svg=Z("svg");Y(i,{width:"100%",height:"100%"}),tt(n,i);const r=this._viewport=zu(i,"viewport");t.deferUpdate&&(this._viewboxChanged=eg(Ce(this._viewboxChanged,this),300)),e.on("diagram.init",()=>{e.fire("canvas.init",{svg:i,viewport:r})}),e.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),e.on("diagram.destroy",500,this._destroy,this),e.on("diagram.clear",500,this._clear,this)},at.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},at.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{const e=wu(t);e==="root"?this.removeRootElement(t):this._removeElement(t,e)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},at.prototype.getDefaultLayer=function(){return this.getLayer(v0,Fu)},at.prototype.getLayer=function(t,e){if(!t)throw new Error("must specify a name");let n=this._layers[t];if(n||(n=this._layers[t]=this._createLayer(t,e)),typeof e<"u"&&n.index!==e)throw new Error("layer <"+t+"> already created at index <"+e+">");return n.group},at.prototype._getChildIndex=function(t){return Ge(this._layers,function(e,n){return n.visible&&t>=n.index&&e++,e},0)},at.prototype._createLayer=function(t,e){typeof e>"u"&&(e=y0);const n=this._getChildIndex(e);return{group:zu(this._viewport,"layer-"+t,n),index:e,visible:!0}},at.prototype.showLayer=function(t){if(!t)throw new Error("must specify a name");const e=this._layers[t];if(!e)throw new Error("layer <"+t+"> does not exist");const n=this._viewport,i=e.group,r=e.index;if(e.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),e.visible=!0,i},at.prototype.hideLayer=function(t){if(!t)throw new Error("must specify a name");const e=this._layers[t];if(!e)throw new Error("layer <"+t+"> does not exist");const n=e.group;return e.visible&&(Gt(n),e.visible=!1),n},at.prototype._removeLayer=function(t){const e=this._layers[t];e&&(delete this._layers[t],Gt(e.group))},at.prototype.getActiveLayer=function(){const t=this._findPlaneForRoot(this.getRootElement());return t?t.layer:null},at.prototype.findRoot=function(t){return typeof t=="string"&&(t=this._elementRegistry.get(t)),t?(this._findPlaneForRoot(f0(t))||{}).rootElement:void 0},at.prototype.getRootElements=function(){return this._planes.map(function(t){return t.rootElement})},at.prototype._findPlaneForRoot=function(t){return yt(this._planes,function(e){return e.rootElement===t})},at.prototype.getContainer=function(){return this._container},at.prototype._updateMarker=function(t,e,n){let i;t.id||(t=this._elementRegistry.get(t)),i=this._elementRegistry._elements[t.id],i&&(k([i.gfx,i.secondaryGfx],function(r){r&&(n?ht(r).add(e):ht(r).remove(e))}),this._eventBus.fire("element.marker.update",{element:t,gfx:i.gfx,marker:e,add:!!n}))},at.prototype.addMarker=function(t,e){this._updateMarker(t,e,!0)},at.prototype.removeMarker=function(t,e){this._updateMarker(t,e,!1)},at.prototype.hasMarker=function(t,e){t.id||(t=this._elementRegistry.get(t));const n=this.getGraphics(t);return ht(n).has(e)},at.prototype.toggleMarker=function(t,e){this.hasMarker(t,e)?this.removeMarker(t,e):this.addMarker(t,e)},at.prototype.getRootElement=function(){const t=this._rootElement;return t||this._planes.length?t:this.setRootElement(this.addRootElement(null))},at.prototype.addRootElement=function(t){const e=this._rootsIdx++;t||(t={id:"__implicitroot_"+e,children:[],isImplicit:!0});const n=t.layer="root-"+e;this._ensureValid("root",t);const i=this.getLayer(n,Fu);return this.hideLayer(n),this._addRoot(t,i),this._planes.push({rootElement:t,layer:i}),t},at.prototype.removeRootElement=function(t){if(typeof t=="string"&&(t=this._elementRegistry.get(t)),!!this._findPlaneForRoot(t))return this._removeRoot(t),this._removeLayer(t.layer),this._planes=this._planes.filter(function(e){return e.rootElement!==t}),this._rootElement===t&&(this._rootElement=null),t},at.prototype.setRootElement=function(t){if(t===this._rootElement)return;let e;if(!t)throw new Error("rootElement required");return e=this._findPlaneForRoot(t),e||(t=this.addRootElement(t)),this._setRoot(t),t},at.prototype._removeRoot=function(t){const e=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:t}),n.fire("root.removed",{element:t}),e.remove(t)},at.prototype._addRoot=function(t,e){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:t}),n.add(t,e),i.fire("root.added",{element:t,gfx:e})},at.prototype._setRoot=function(t,e){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),t&&(e||(e=this._findPlaneForRoot(t).layer),this._elementRegistry.updateGraphics(t,this._svg,!0),this.showLayer(t.layer)),this._rootElement=t,this._eventBus.fire("root.set",{element:t})},at.prototype._ensureValid=function(t,e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element <"+e.id+"> already exists");const n=g0[t];if(!No(n,function(i){return typeof e[i]<"u"}))throw new Error("must supply { "+n.join(", ")+" } with "+t)},at.prototype._setParent=function(t,e,n){Zt(e.children,t,n),t.parent=e},at.prototype._addElement=function(t,e,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(t,e),r.fire(t+".add",{element:e,parent:n}),this._setParent(e,n,i);const a=o.create(t,e,i);return this._elementRegistry.add(e,a),o.update(t,e,a),r.fire(t+".added",{element:e,gfx:a}),e},at.prototype.addShape=function(t,e,n){return this._addElement("shape",t,e,n)},at.prototype.addConnection=function(t,e,n){return this._addElement("connection",t,e,n)},at.prototype._removeElement=function(t,e){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(t=n.get(t.id||t),!!t)return r.fire(e+".remove",{element:t}),i.remove(t),Wt(t.parent&&t.parent.children,t),t.parent=null,r.fire(e+".removed",{element:t}),n.remove(t),t},at.prototype.removeShape=function(t){return this._removeElement(t,"shape")},at.prototype.removeConnection=function(t){return this._removeElement(t,"connection")},at.prototype.getGraphics=function(t,e){return this._elementRegistry.getGraphics(t,e)},at.prototype._changeViewbox=function(t){this._eventBus.fire("canvas.viewbox.changing"),t.apply(this),this._cachedViewbox=null,this._viewboxChanged()},at.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},at.prototype.viewbox=function(t){if(t===void 0&&this._cachedViewbox)return this._cachedViewbox;const e=this._viewport,n=this.getSize();let i,r,o,a,s,c,p;if(t)this._changeViewbox(function(){s=Math.min(n.width/t.width,n.height/t.height);const l=this._svg.createSVGMatrix().scale(s).translate(-t.x,-t.y);Cr(e,l)});else return o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=Cr(e),r=a?a.matrix:Eg(),s=Zo(r.a,1e3),c=Zo(-r.e||0,1e3),p=Zo(-r.f||0,1e3),t=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},t;return t},at.prototype.scroll=function(t){const e=this._viewport;let n=e.getCTM();return t&&this._changeViewbox(function(){t=N({dx:0,dy:0},t||{}),n=this._svg.createSVGMatrix().translate(t.dx,t.dy).multiply(n),Hu(e,n)}),{x:n.e,y:n.f}},at.prototype.scrollToElement=function(t,e){let n=100;typeof t=="string"&&(t=this._elementRegistry.get(t));const i=this.findRoot(t);if(i!==this.getRootElement()&&this.setRootElement(i),i===t)return;e||(e={}),typeof e=="number"&&(n=e),e={top:e.top||n,right:e.right||n,bottom:e.bottom||n,left:e.left||n};const r=Vt(t),o=X(r),a=this.viewbox(),s=this.zoom();let c,p;a.y+=e.top/s,a.x+=e.left/s,a.width-=(e.right+e.left)/s,a.height-=(e.bottom+e.top)/s;const l=X(a);if(!(r.width<a.width&&r.height<a.height))c=r.x-a.x,p=r.y-a.y;else{const u=Math.max(0,o.right-l.right),h=Math.min(0,o.left-l.left),d=Math.max(0,o.bottom-l.bottom),f=Math.min(0,o.top-l.top);c=u||h,p=d||f}this.scroll({dx:-c*s,dy:-p*s})},at.prototype.zoom=function(t,e){if(!t)return this.viewbox(t).scale;if(t==="fit-viewport")return this._fitViewport(e);let n,i;return this._changeViewbox(function(){typeof e!="object"&&(n=this.viewbox().outer,e={x:n.width/2,y:n.height/2}),i=this._setZoom(t,e)}),Zo(i.a,1e3)};function Hu(t,e){const n="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")";t.setAttribute("transform",n)}at.prototype._fitViewport=function(t){const e=this.viewbox(),n=e.outer,i=e.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!t?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+(t?i.width/2-n.width/r/2:0),y:i.y+(t?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},at.prototype._setZoom=function(t,e){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 e?(a=N(o,e),s=a.matrixTransform(c.inverse()),p=r.translate(s.x,s.y).scale(1/u*t).translate(-s.x,-s.y),l=c.multiply(p)):l=r.scale(t),Hu(this._viewport,l),l},at.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},at.prototype.getAbsoluteBBox=function(t){const e=this.viewbox();let n;t.waypoints?n=this.getGraphics(t).getBBox():n=t;const i=n.x*e.scale-e.x*e.scale,r=n.y*e.scale-e.y*e.scale,o=n.width*e.scale,a=n.height*e.scale;return{x:i,y:r,width:o,height:a}},at.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Ki="data-element-id";function De(t){this._elements={},this._eventBus=t}De.$inject=["eventBus"],De.prototype.add=function(t,e,n){var i=t.id;this._validateId(i),Y(e,Ki,i),n&&Y(n,Ki,i),this._elements[i]={element:t,gfx:e,secondaryGfx:n}},De.prototype.remove=function(t){var e=this._elements,n=t.id||t,i=n&&e[n];i&&(Y(i.gfx,Ki,""),i.secondaryGfx&&Y(i.secondaryGfx,Ki,""),delete e[n])},De.prototype.updateId=function(t,e){this._validateId(e),typeof t=="string"&&(t=this.get(t)),this._eventBus.fire("element.updateId",{element:t,newId:e});var n=this.getGraphics(t),i=this.getGraphics(t,!0);this.remove(t),t.id=e,this.add(t,n,i)},De.prototype.updateGraphics=function(t,e,n){var i=t.id||t,r=this._elements[i];return n?r.secondaryGfx=e:r.gfx=e,e&&Y(e,Ki,i),e},De.prototype.get=function(t){var e;typeof t=="string"?e=t:e=t&&Y(t,Ki);var n=this._elements[e];return n&&n.element},De.prototype.filter=function(t){var e=[];return this.forEach(function(n,i){t(n,i)&&e.push(n)}),e},De.prototype.find=function(t){for(var e=this._elements,n=Object.keys(e),i=0;i<n.length;i++){var r=n[i],o=e[r],a=o.element,s=o.gfx;if(t(a,s))return a}},De.prototype.getAll=function(){return this.filter(function(t){return t})},De.prototype.forEach=function(t){var e=this._elements;Object.keys(e).forEach(function(n){var i=e[n],r=i.element,o=i.gfx;return t(r,o)})},De.prototype.getGraphics=function(t,e){var n=t.id||t,i=this._elements[n];return i&&(e?i.secondaryGfx:i.gfx)},De.prototype._validateId=function(t){if(!t)throw new Error("element must have an id");if(this._elements[t])throw new Error("element with id "+t+" already added")};var vc={exports:{}},Qo={};function b0(t,e,n,i){var r=n.inverse;return Object.defineProperty(t,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),e.unset(o,r,i)),o}}),Object.defineProperty(t,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(t,"add",{value:function(o,a){var s=this.indexOf(o);if(typeof a>"u"){if(s!==-1)return;a=this.length}s!==-1&&this.splice(s,1),this.splice(a,0,o),s===-1&&e.set(o,r,i)}}),Object.defineProperty(t,"__refs_collection",{value:!0}),t}function x0(t){return t.__refs_collection===!0}Qo.extend=b0,Qo.isExtended=x0;var Gu=Qo;function _0(t,e){return Object.prototype.hasOwnProperty.call(t,e.name||e)}function Vu(t,e,n){var i=Gu.extend(n[e.name]||[],t,e,n);Object.defineProperty(n,e.name,{enumerable:e.enumerable,value:i}),i.length&&i.forEach(function(r){t.set(r,e.inverse,n)})}function E0(t,e,n){var i=e.inverse,r=n[e.name];Object.defineProperty(n,e.name,{configurable:e.configurable,enumerable:e.enumerable,get:function(){return r},set:function(o){if(o!==r){var a=r;r=null,a&&t.unset(a,i,n),r=o,t.set(r,i,n)}}})}function ni(t,e){if(!(this instanceof ni))return new ni(t,e);t.inverse=e,e.inverse=t,this.props={},this.props[t.name]=t,this.props[e.name]=e}ni.prototype.bind=function(t,e){if(typeof e=="string"){if(!this.props[e])throw new Error("no property <"+e+"> in ref");e=this.props[e]}e.collection?Vu(this,e,t):E0(this,e,t)},ni.prototype.ensureRefsCollection=function(t,e){var n=t[e.name];return Gu.isExtended(n)||Vu(this,e,t),n},ni.prototype.ensureBound=function(t,e){_0(t,e)||this.bind(t,e)},ni.prototype.unset=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).remove(n):t[e.name]=void 0)},ni.prototype.set=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).add(n):t[e.name]=n)};var w0=ni;vc.exports=w0,vc.exports.Collection=Qo;var S0=vc.exports;const Ar=qs(S0);var yc=new Ar({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Wu=new Ar({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Uu=new Ar({name:"attachers",collection:!0},{name:"host"}),qu=new Ar({name:"outgoing",collection:!0},{name:"source"}),Ku=new Ar({name:"incoming",collection:!0},{name:"target"});function Yi(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(t){var e=this.label,n=this.labels;!t&&e?n.remove(e):n.add(t,0)}}),yc.bind(this,"parent"),Wu.bind(this,"labels"),qu.bind(this,"outgoing"),Ku.bind(this,"incoming")}function Mr(){Yi.call(this),yc.bind(this,"children"),Uu.bind(this,"host"),Uu.bind(this,"attachers")}q(Mr,Yi);function Yu(){Yi.call(this),yc.bind(this,"children")}q(Yu,Mr);function Xu(){Mr.call(this),Wu.bind(this,"labelTarget")}q(Xu,Mr);function Zu(){Yi.call(this),qu.bind(this,"source"),Ku.bind(this,"target")}q(Zu,Yi);var C0={connection:Zu,shape:Mr,label:Xu,root:Yu};function R0(t,e){var n=C0[t];if(!n)throw new Error("unknown type: <"+t+">");return N(new n,e)}function P0(t){return t instanceof Yi}function Bn(){this._uid=12}Bn.prototype.createRoot=function(t){return this.create("root",t)},Bn.prototype.createLabel=function(t){return this.create("label",t)},Bn.prototype.createShape=function(t){return this.create("shape",t)},Bn.prototype.createConnection=function(t){return this.create("connection",t)},Bn.prototype.create=function(t,e){return e=N({},e||{}),e.id||(e.id=t+"_"+this._uid++),R0(t,e)};var Jo="__fn",Qu=1e3,k0=Array.prototype.slice;function Pe(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}Pe.prototype.on=function(t,e,n,i){if(t=lt(t)?t:[t],pe(e)&&(i=n,n=e,e=Qu),!it(e))throw new Error("priority must be a number");var r=n;i&&(r=Ce(n,i),r[Jo]=n[Jo]||n);var o=this;t.forEach(function(a){o._addListener(a,{priority:e,callback:r,next:null})})},Pe.prototype.once=function(t,e,n,i){var r=this;if(pe(e)&&(i=n,n=e,e=Qu),!it(e))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(t,o),a}o[Jo]=n,this.on(t,e,o)},Pe.prototype.off=function(t,e){t=lt(t)?t:[t];var n=this;t.forEach(function(i){n._removeListener(i,e)})},Pe.prototype.createEvent=function(t){var e=new Dr;return e.init(t),e},Pe.prototype.fire=function(t,e){var n,i,r,o;if(o=k0.call(arguments),typeof t=="object"&&(e=t,t=e.type),!t)throw new Error("no event type specified");if(i=this._listeners[t],!!i){e instanceof Dr?n=e:n=this.createEvent(e),o[0]=n;var a=n.type;t!==a&&(n.type=t);try{r=this._invokeListeners(n,o,i)}finally{t!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},Pe.prototype.handleError=function(t){return this.fire("error",{error:t})===!1},Pe.prototype._destroy=function(){this._listeners={}},Pe.prototype._invokeListeners=function(t,e,n){for(var i;n&&!t.cancelBubble;)i=this._invokeListener(t,e,n),n=n.next;return i},Pe.prototype._invokeListener=function(t,e,n){var i;if(n.callback.__isTomb)return i;try{i=T0(n.callback,e),i!==void 0&&(t.returnValue=i,t.stopPropagation()),i===!1&&t.preventDefault()}catch(r){if(!this.handleError(r))throw r}return i},Pe.prototype._addListener=function(t,e){var n=this._getListeners(t),i;if(!n){this._setListeners(t,e);return}for(;n;){if(n.priority<e.priority){e.next=n,i?i.next=e:this._setListeners(t,e);return}i=n,n=n.next}i.next=e},Pe.prototype._getListeners=function(t){return this._listeners[t]},Pe.prototype._setListeners=function(t,e){this._listeners[t]=e},Pe.prototype._removeListener=function(t,e){var n=this._getListeners(t),i,r,o;if(!e){this._setListeners(t,null);return}for(;n;)i=n.next,o=n.callback,(o===e||o[Jo]===e)&&(r?r.next=i:this._setListeners(t,i)),r=n,n=i};function Dr(){}Dr.prototype.stopPropagation=function(){this.cancelBubble=!0},Dr.prototype.preventDefault=function(){this.defaultPrevented=!0},Dr.prototype.init=function(t){N(this,t||{})};function T0(t,e){return t.apply(null,e)}function ta(t){return t.childNodes[0]}function A0(t){return t.parentNode.childNodes[1]}function gc(t,e,n,i,r){var o=Sr();o.setTranslate(e,n);var a=Sr();a.setRotate(i||0,0,0);var s=Sr();s.setScale(r||1,r||1),Cr(t,[o,a,s])}function ke(t,e,n){var i=Sr();i.setTranslate(e,n),Cr(t,i)}function Ju(t,e){var n=Sr();n.setRotate(e,0,0),Cr(t,n)}function Be(t,e){this._eventBus=t,this._elementRegistry=e}Be.$inject=["eventBus","elementRegistry"],Be.prototype._getChildrenContainer=function(t){var e=this._elementRegistry.getGraphics(t),n;return t.parent?(n=A0(e),n||(n=Z("g"),ht(n).add("djs-children"),tt(e.parentNode,n))):n=e,n},Be.prototype._clear=function(t){var e=ta(t);return Lo(e),e},Be.prototype._createContainer=function(t,e,n,i){var r=Z("g");ht(r).add("djs-group"),typeof n<"u"?th(r,e,e.childNodes[n]):tt(e,r);var o=Z("g");ht(o).add("djs-element"),ht(o).add("djs-"+t),i&&ht(o).add("djs-frame"),tt(r,o);var a=Z("g");return ht(a).add("djs-visual"),tt(o,a),o},Be.prototype.create=function(t,e,n){var i=this._getChildrenContainer(e.parent);return this._createContainer(t,i,n,Su(e))},Be.prototype.updateContainments=function(t){var e=this,n=this._elementRegistry,i;i=Ge(t,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),k(i,function(r){var o=r.children;if(o){var a=e._getChildrenContainer(r);k(o.slice().reverse(),function(s){var c=n.getGraphics(s);th(c.parentNode,a)})}})},Be.prototype.drawShape=function(t,e,n={}){var i=this._eventBus;return i.fire("render.shape",{gfx:t,element:e,attrs:n})},Be.prototype.getShapePath=function(t){var e=this._eventBus;return e.fire("render.getShapePath",t)},Be.prototype.drawConnection=function(t,e,n={}){var i=this._eventBus;return i.fire("render.connection",{gfx:t,element:e,attrs:n})},Be.prototype.getConnectionPath=function(t){var e=this._eventBus;return e.fire("render.getConnectionPath",t)},Be.prototype.update=function(t,e,n){if(e.parent){var i=this._clear(n);if(t==="shape")this.drawShape(i,e),ke(n,e.x,e.y);else if(t==="connection")this.drawConnection(i,e);else throw new Error("unknown type: "+t);e.hidden?Y(n,"display","none"):Y(n,"display","block")}},Be.prototype.remove=function(t){var e=this._elementRegistry.getGraphics(t);Gt(e.parentNode)};function th(t,e,n){var i=n||e.firstChild;t!==i&&e.insertBefore(t,i)}const M0={__depends__:[qg],__init__:["canvas"],canvas:["type",at],elementRegistry:["type",De],elementFactory:["type",Bn],eventBus:["type",Pe],graphicsFactory:["type",Be]};function D0(t){var e=new bu(t);return e.init(),e}function B0(t){t=t||{};var e={config:["value",t]},n=[e,M0].concat(t.modules||[]);return D0(n)}function Xi(t,e){this._injector=e=e||B0(t),this.get=e.get,this.invoke=e.invoke,this.get("eventBus").fire("diagram.init")}Xi.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Xi.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function bc(){}bc.prototype.get=function(t){return this.$model.properties.get(this,t)},bc.prototype.set=function(t,e){this.$model.properties.set(this,t,e)};function eh(t,e){this.model=t,this.properties=e}eh.prototype.createType=function(t){var e=this.model,n=this.properties,i=Object.create(bc.prototype);k(t.properties,function(a){!a.isMany&&a.default!==void 0&&(i[a.name]=a.default)}),n.defineModel(i,e),n.defineDescriptor(i,t);var r=t.ns.name;function o(a){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),k(a,Ce(function(s,c){this.set(c,s)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,e),n.defineDescriptor(o,t),o};var N0={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},nh={String:function(t){return t},Boolean:function(t){return t==="true"},Integer:function(t){return parseInt(t,10)},Real:function(t){return parseFloat(t)}};function xc(t,e){var n=nh[t];return n?n(e):e}function _c(t){return!!N0[t]}function ih(t){return!!nh[t]}function me(t,e){var n=t.split(/:/),i,r;if(n.length===1)i=t,r=e;else if(n.length===2)i=n[1],r=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+t);return t=(r?r+":":"")+i,{name:t,prefix:r,localName:i}}function Ne(t){this.ns=t,this.name=t.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Ne.prototype.build=function(){return un(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Ne.prototype.addProperty=function(t,e,n){typeof e=="boolean"&&(n=e,e=void 0),this.addNamedProperty(t,n!==!1);var i=this.properties;e!==void 0?i.splice(e,0,t):i.push(t)},Ne.prototype.replaceProperty=function(t,e,n){var i=t.ns,r=this.properties,o=this.propertiesByName,a=t.name!==e.name;if(t.isId){if(!e.isId)throw new Error("property <"+e.ns.name+"> must be id property to refine <"+t.ns.name+">");this.setIdProperty(e,!1)}if(t.isBody){if(!e.isBody)throw new Error("property <"+e.ns.name+"> must be body property to refine <"+t.ns.name+">");this.setBodyProperty(e,!1)}var s=r.indexOf(t);if(s===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(e,n?void 0:s,a),o[i.name]=o[i.localName]=e},Ne.prototype.redefineProperty=function(t,e,n){var i=t.ns.prefix,r=e.split("#"),o=me(r[0],i),a=me(r[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,t,n);else throw new Error("refined property <"+a+"> not found");delete t.redefines},Ne.prototype.addNamedProperty=function(t,e){var n=t.ns,i=this.propertiesByName;e&&(this.assertNotDefined(t,n.name),this.assertNotDefined(t,n.localName)),i[n.name]=i[n.localName]=t},Ne.prototype.removeNamedProperty=function(t){var e=t.ns,n=this.propertiesByName;delete n[e.name],delete n[e.localName]},Ne.prototype.setBodyProperty=function(t,e){if(e&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+t.ns.name+">)");this.bodyProperty=t},Ne.prototype.setIdProperty=function(t,e){if(e&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+t.ns.name+">)");this.idProperty=t},Ne.prototype.assertNotTrait=function(t){if((t.extends||[]).length)throw new Error(`cannot create <${t.name}> extending <${t.extends}>`)},Ne.prototype.assertNotDefined=function(t,e){var n=t.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+t.definedBy.ns.name+"#"+t.ns.name+"> not allowed without redefines")},Ne.prototype.hasProperty=function(t){return this.propertiesByName[t]},Ne.prototype.addTrait=function(t,e){e&&this.assertNotTrait(t);var n=this.allTypesByName,i=this.allTypes,r=t.name;r in n||(k(t.properties,Ce(function(o){o=N({},o,{name:o.ns.localName,inherited:e}),Object.defineProperty(o,"definedBy",{value:t});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(t),n[r]=t)};function ii(t,e){this.packageMap={},this.typeMap={},this.packages=[],this.properties=e,k(t,Ce(this.registerPackage,this))}ii.prototype.getPackage=function(t){return this.packageMap[t]},ii.prototype.getPackages=function(){return this.packages},ii.prototype.registerPackage=function(t){t=N({},t);var e=this.packageMap;rh(e,t,"prefix"),rh(e,t,"uri"),k(t.types,Ce(function(n){this.registerType(n,t)},this)),e[t.uri]=e[t.prefix]=t,this.packages.push(t)},ii.prototype.registerType=function(t,e){t=N({},t,{superClass:(t.superClass||[]).slice(),extends:(t.extends||[]).slice(),properties:(t.properties||[]).slice(),meta:N(t.meta||{})});var n=me(t.name,e.prefix),i=n.name,r={};k(t.properties,Ce(function(o){var a=me(o.name,n.prefix),s=a.name;_c(o.type)||(o.type=me(o.type,a.prefix).name),N(o,{ns:a,name:s}),r[s]=o},this)),N(t,{ns:n,name:i,propertiesByName:r}),k(t.extends,Ce(function(o){var a=me(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(i)},this)),this.definePackage(t,e),this.typeMap[i]=t},ii.prototype.mapTypes=function(t,e,n){var i=_c(t.name)?{name:t.name}:this.typeMap[t.name],r=this;function o(c,p){var l=me(c,_c(c)?"":t.prefix);r.mapTypes(l,e,p)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!i)throw new Error("unknown type <"+t.name+">");k(i.superClass,n?a:s),e(i,!n),k(i.traits,a)},ii.prototype.getEffectiveDescriptor=function(t){var e=me(t),n=new Ne(e);this.mapTypes(e,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},ii.prototype.definePackage=function(t,e){this.properties.define(t,"$pkg",{value:e})};function rh(t,e,n){var i=e[n];if(i in t)throw new Error("package with "+n+" <"+i+"> already defined")}function Ci(t){this.model=t}Ci.prototype.set=function(t,e,n){if(!Me(e)||!e.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(t,e),r=i&&i.name;O0(n)?i?delete t[r]:delete t.$attrs[Ec(e)]:i?r in t?t[r]=n:oh(t,i,n):t.$attrs[Ec(e)]=n},Ci.prototype.get=function(t,e){var n=this.getProperty(t,e);if(!n)return t.$attrs[Ec(e)];var i=n.name;return!t[i]&&n.isMany&&oh(t,n,[]),t[i]},Ci.prototype.define=function(t,e,n){if(!n.writable){var i=n.value;n=N({},n,{get:function(){return i}}),delete n.value}Object.defineProperty(t,e,n)},Ci.prototype.defineDescriptor=function(t,e){this.define(t,"$descriptor",{value:e})},Ci.prototype.defineModel=function(t,e){this.define(t,"$model",{value:e})},Ci.prototype.getProperty=function(t,e){var n=this.model,i=n.getPropertyDescriptor(t,e);if(i)return i;if(e.includes(":"))return null;const r=n.config.strict;if(typeof r<"u"){const o=new TypeError(`unknown property <${e}> on <${t.$type}>`);if(r)throw o;typeof console<"u"}return null};function O0(t){return typeof t>"u"}function oh(t,e,n){Object.defineProperty(t,e.name,{enumerable:!e.isReference,writable:!0,value:n,configurable:!0})}function Ec(t){return t.replace(/^:/,"")}function We(t,e={}){this.properties=new Ci(this),this.factory=new eh(this,this.properties),this.registry=new ii(t,this.properties),this.typeCache={},this.config=e}We.prototype.create=function(t,e){var n=this.getType(t);if(!n)throw new Error("unknown type <"+t+">");return new n(e)},We.prototype.getType=function(t){var e=this.typeCache,n=Me(t)?t:t.ns.name,i=e[n];return i||(t=this.registry.getEffectiveDescriptor(n),i=e[n]=this.factory.createType(t)),i},We.prototype.createAny=function(t,e,n){var i=me(t),r={$type:t,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){Q2(this,[a],s)}},o={name:t,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:e}};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}),k(n,function(a,s){oe(a)&&a.value!==void 0?r[a.name]=a.value:r[s]=a}),r},We.prototype.getPackage=function(t){return this.registry.getPackage(t)},We.prototype.getPackages=function(){return this.registry.getPackages()},We.prototype.getElementDescriptor=function(t){return t.$descriptor},We.prototype.hasType=function(t,e){e===void 0&&(e=t,t=this);var n=t.$model.getElementDescriptor(t);return e in n.allTypesByName},We.prototype.getPropertyDescriptor=function(t,e){return this.getElementDescriptor(t).propertiesByName[e]},We.prototype.getTypeDescriptor=function(t){return this.registry.typeMap[t]};var j0=String.fromCharCode,L0=Object.prototype.hasOwnProperty,I0=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Br={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Br).forEach(function(t){Br[t.toUpperCase()]=Br[t]});function $0(t,e,n,i){return i?L0.call(Br,i)?Br[i]:"&"+i+";":j0(e||parseInt(n,16))}function Ri(t){return t.length>3&&t.indexOf("&")!==-1?t.replace(I0,$0):t}var z0="http://www.w3.org/2001/XMLSchema-instance",F0="xsi",ah="xsi:type",sh="non-whitespace outside of root node";function Zi(t){return new Error(t)}function ch(t){return"missing namespace for prefix <"+t+">"}function ea(t){return{get:t,enumerable:!0}}function H0(t){var e={},n;for(n in t)e[n]=t[n];return e}function wc(t){return t+"$uri"}function G0(t){var e={},n,i;for(n in t)i=t[n],e[i]=i,e[wc(i)]=n;return e}function ph(){return{line:0,column:0}}function V0(t){throw t}function lh(t){if(!this)return new lh(t);var e=t&&t.proxy,n,i,r,o,a=V0,s,c,p,l,u=ph,h=!1,d=!1,f=null,v=!1,g;function R(x){x instanceof Error||(x=Zi(x)),f=x,a(x,u)}function E(x){s&&(x instanceof Error||(x=Zi(x)),s(x,u))}this.on=function(x,S){if(typeof S!="function")throw Zi("required args <name, cb>");switch(x){case"openTag":i=S;break;case"text":n=S;break;case"closeTag":r=S;break;case"error":a=S;break;case"warn":s=S;break;case"cdata":o=S;break;case"attention":l=S;break;case"question":p=S;break;case"comment":c=S;break;default:throw Zi("unsupported event: "+x)}return this},this.ns=function(x){if(typeof x>"u"&&(x={}),typeof x!="object")throw Zi("required args <nsMap={}>");var S={},M;for(M in x)S[M]=x[M];return S[z0]=F0,d=!0,g=S,this},this.parse=function(x){if(typeof x!="string")throw Zi("required args <xml=string>");return f=null,_(x),u=ph,v=!1,f},this.stop=function(){v=!0};function _(x){var S=d?[]:null,M=d?G0(g):null,j,B=[],D=0,$=!1,z=!1,F=0,U=0,ut,Ie,Rt,pt,we,C,m,A,O,T="",L=0,G;function ot(){if(G!==null)return G;var St,bt,mt,ie=d&&M.xmlns,de=d&&h?[]:null,kt=L,jt=T,Se=jt.length,$e,ge,$t,ze,wt,re={},Ls={},Fe,Q,Pt;t:for(;kt<Se;kt++)if(Fe=!1,Q=jt.charCodeAt(kt),!(Q===32||Q<14&&Q>8)){for((Q<65||Q>122||Q>90&&Q<97)&&Q!==95&&Q!==58&&(E("illegal first char attribute name"),Fe=!0),Pt=kt+1;Pt<Se;Pt++)if(Q=jt.charCodeAt(Pt),!(Q>96&&Q<123||Q>64&&Q<91||Q>47&&Q<59||Q===46||Q===45||Q===95)){if(Q===32||Q<14&&Q>8){E("missing attribute value"),kt=Pt;continue t}if(Q===61)break;E("illegal attribute name char"),Fe=!0}if(wt=jt.substring(kt,Pt),wt==="xmlns:xmlns"&&(E("illegal declaration of xmlns"),Fe=!0),Q=jt.charCodeAt(Pt+1),Q===34)Pt=jt.indexOf('"',kt=Pt+2),Pt===-1&&(Pt=jt.indexOf("'",kt),Pt!==-1&&(E("attribute value quote missmatch"),Fe=!0));else if(Q===39)Pt=jt.indexOf("'",kt=Pt+2),Pt===-1&&(Pt=jt.indexOf('"',kt),Pt!==-1&&(E("attribute value quote missmatch"),Fe=!0));else for(E("missing attribute value quotes"),Fe=!0,Pt=Pt+1;Pt<Se&&(Q=jt.charCodeAt(Pt+1),!(Q===32||Q<14&&Q>8));Pt++);for(Pt===-1&&(E("missing closing quotes"),Pt=Se,Fe=!0),Fe||($t=jt.substring(kt,Pt)),kt=Pt;Pt+1<Se&&(Q=jt.charCodeAt(Pt+1),!(Q===32||Q<14&&Q>8));Pt++)kt===Pt&&(E("illegal character after attribute end"),Fe=!0);if(kt=Pt+1,Fe)continue t;if(wt in Ls){E("attribute <"+wt+"> already defined");continue}if(Ls[wt]=!0,!d){re[wt]=$t;continue}if(h){if(ge=wt==="xmlns"?"xmlns":wt.charCodeAt(0)===120&&wt.substr(0,6)==="xmlns:"?wt.substr(6):null,ge!==null){if(St=Ri($t),bt=wc(ge),ze=g[St],!ze){if(ge==="xmlns"||bt in M&&M[bt]!==St)do ze="ns"+D++;while(typeof M[ze]<"u");else ze=ge;g[St]=ze}M[ge]!==ze&&($e||(M=H0(M),$e=!0),M[ge]=ze,ge==="xmlns"&&(M[wc(ze)]=St,ie=ze),M[bt]=St),re[wt]=$t;continue}de.push(wt,$t);continue}if(Q=wt.indexOf(":"),Q===-1){re[wt]=$t;continue}if(!(mt=M[wt.substring(0,Q)])){E(ch(wt.substring(0,Q)));continue}wt=ie===mt?wt.substr(Q+1):mt+wt.substr(Q),wt===ah&&(Q=$t.indexOf(":"),Q!==-1?(mt=$t.substring(0,Q),mt=M[mt]||mt,$t=mt+$t.substring(Q)):$t=ie+":"+$t),re[wt]=$t}if(h)for(kt=0,Se=de.length;kt<Se;kt++){if(wt=de[kt++],$t=de[kt],Q=wt.indexOf(":"),Q!==-1){if(!(mt=M[wt.substring(0,Q)])){E(ch(wt.substring(0,Q)));continue}wt=ie===mt?wt.substr(Q+1):mt+wt.substr(Q),wt===ah&&(Q=$t.indexOf(":"),Q!==-1?(mt=$t.substring(0,Q),mt=M[mt]||mt,$t=mt+$t.substring(Q)):$t=ie+":"+$t)}re[wt]=$t}return G=re}function st(){for(var St=/(\r\n|\r|\n)/g,bt=0,mt=0,ie=0,de=U,kt,jt;F>=ie&&(kt=St.exec(x),!(!kt||(de=kt[0].length+kt.index,de>F)));)bt+=1,ie=de;return F==-1?(mt=de,jt=x.substring(U)):U===0?jt=x.substring(U,F):(mt=F-ie,jt=U==-1?x.substring(F):x.substring(F,U+1)),{data:jt,line:bt,column:mt}}for(u=st,e&&(O=Object.create({},{name:ea(function(){return m}),originalName:ea(function(){return A}),attrs:ea(ot),ns:ea(function(){return M})}));U!==-1;){if(x.charCodeAt(U)===60?F=U:F=x.indexOf("<",U),F===-1){if(B.length)return R("unexpected end of file");if(U===0)return R("missing start tag");U<x.length&&x.substring(U).trim()&&E(sh);return}if(U!==F){if(B.length){if(n&&(n(x.substring(U,F),Ri,u),v))return}else if(x.substring(U,F).trim()&&(E(sh),v))return}if(pt=x.charCodeAt(F+1),pt===33){if(Rt=x.charCodeAt(F+2),Rt===91&&x.substr(F+3,6)==="CDATA["){if(U=x.indexOf("]]>",F),U===-1)return R("unclosed cdata");if(o&&(o(x.substring(F+9,U),u),v))return;U+=3;continue}if(Rt===45&&x.charCodeAt(F+3)===45){if(U=x.indexOf("-->",F),U===-1)return R("unclosed comment");if(c&&(c(x.substring(F+4,U),Ri,u),v))return;U+=3;continue}}if(pt===63){if(U=x.indexOf("?>",F),U===-1)return R("unclosed question");if(p&&(p(x.substring(F,U+2),u),v))return;U+=2;continue}for(ut=F+1;;ut++){if(we=x.charCodeAt(ut),isNaN(we))return U=-1,R("unclosed tag");if(we===34)Rt=x.indexOf('"',ut+1),ut=Rt!==-1?Rt:ut;else if(we===39)Rt=x.indexOf("'",ut+1),ut=Rt!==-1?Rt:ut;else if(we===62){U=ut;break}}if(pt===33){if(l&&(l(x.substring(F,U+1),Ri,u),v))return;U+=1;continue}if(G={},pt===47){if($=!1,z=!0,!B.length)return R("missing open tag");if(ut=m=B.pop(),Rt=F+2+ut.length,x.substring(F+2,Rt)!==ut)return R("closing tag mismatch");for(;Rt<U;Rt++)if(pt=x.charCodeAt(Rt),!(pt===32||pt>8&&pt<14))return R("close tag")}else{if(x.charCodeAt(U-1)===47?(ut=m=x.substring(F+1,U-1),$=!0,z=!0):(ut=m=x.substring(F+1,U),$=!0,z=!1),!(pt>96&&pt<123||pt>64&&pt<91||pt===95||pt===58))return R("illegal first char nodeName");for(Rt=1,Ie=ut.length;Rt<Ie;Rt++)if(pt=ut.charCodeAt(Rt),!(pt>96&&pt<123||pt>64&&pt<91||pt>47&&pt<59||pt===45||pt===95||pt==46)){if(pt===32||pt<14&&pt>8){m=ut.substring(0,Rt),G=null;break}return R("invalid nodeName")}z||B.push(m)}if(d){if(j=M,$&&(z||S.push(j),G===null&&(h=ut.indexOf("xmlns",Rt)!==-1)&&(L=Rt,T=ut,ot(),h=!1)),A=m,pt=m.indexOf(":"),pt!==-1){if(C=M[m.substring(0,pt)],!C)return R("missing namespace on <"+A+">");m=m.substr(pt+1)}else C=M.xmlns;C&&(m=C+":"+m)}if($&&(L=Rt,T=ut,i&&(e?i(O,Ri,z,u):i(m,ot,Ri,z,u),v)))return;if(z){if(r&&(r(e?O:m,Ri,$,u),v))return;d&&($?M=j:M=S.pop())}U+=1}}}function uh(t){return t.xml&&t.xml.tagAlias==="lowerCase"}var W0={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},na="xsi:type";function hh(t){return t.xml&&t.xml.serialize}function dh(t){return hh(t)===na}function U0(t){return hh(t)==="property"}function q0(t){return t.charAt(0).toUpperCase()+t.slice(1)}function fh(t,e){return uh(e)?t.prefix+":"+q0(t.localName):t.name}function K0(t,e){var n=t.name,i=t.localName,r=e.xml&&e.xml.typePrefix;return r&&i.indexOf(r)===0?t.prefix+":"+i.slice(r.length):n}function Y0(t,e){var n=me(t),i=e.getPackage(n.prefix);return K0(n,i)}function ri(t){return new Error(t)}function Nn(t){return t.$descriptor}function X0(t){N(this,t),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw ri("expected element");var n=this.elementsById,i=Nn(e),r=i.idProperty,o;if(r&&(o=e.get(r.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw ri("duplicate ID <"+o+">");n[o]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Nr(){}Nr.prototype.handleEnd=function(){},Nr.prototype.handleText=function(){},Nr.prototype.handleNode=function(){};function Sc(){}Sc.prototype=Object.create(Nr.prototype),Sc.prototype.handleNode=function(){return this};function Qi(){}Qi.prototype=Object.create(Nr.prototype),Qi.prototype.handleText=function(t){this.body=(this.body||"")+t};function Or(t,e){this.property=t,this.context=e}Or.prototype=Object.create(Qi.prototype),Or.prototype.handleNode=function(t){if(this.element)throw ri("expected no sub nodes");return this.element=this.createReference(t),this},Or.prototype.handleEnd=function(){this.element.id=this.body},Or.prototype.createReference=function(t){return{property:this.property.ns.name,id:""}};function Cc(t,e){this.element=e,this.propertyDesc=t}Cc.prototype=Object.create(Qi.prototype),Cc.prototype.handleEnd=function(){var t=this.body||"",e=this.element,n=this.propertyDesc;t=xc(n.type,t),n.isMany?e.get(n.name).push(t):e.set(n.name,t)};function ia(){}ia.prototype=Object.create(Qi.prototype),ia.prototype.handleNode=function(t){var e=this,n=this.element;return n?e=this.handleChild(t):(n=this.element=this.createElement(t),this.context.addElement(n)),e};function ve(t,e,n){this.model=t,this.type=t.getType(e),this.context=n}ve.prototype=Object.create(ia.prototype),ve.prototype.addReference=function(t){this.context.addReference(t)},ve.prototype.handleText=function(t){var e=this.element,n=Nn(e),i=n.bodyProperty;if(!i)throw ri("unexpected body text <"+t+">");Qi.prototype.handleText.call(this,t)},ve.prototype.handleEnd=function(){var t=this.body,e=this.element,n=Nn(e),i=n.bodyProperty;i&&t!==void 0&&(t=xc(i.type,t),e.set(i.name,t))},ve.prototype.createElement=function(t){var e=t.attributes,n=this.type,i=Nn(n),r=this.context,o=new n({}),a=this.model,s;return k(e,function(c,p){var l=i.propertiesByName[p],u;l&&l.isReference?l.isMany?(u=c.split(" "),k(u,function(h){r.addReference({element:o,property:l.ns.name,id:h})})):r.addReference({element:o,property:l.ns.name,id:c}):(l?c=xc(l.type,c):p!=="xmlns"&&(s=me(p,i.ns.prefix),a.getPackage(s.prefix)&&r.addWarning({message:"unknown attribute <"+p+">",element:o,property:p,value:c})),o.set(p,c))}),o},ve.prototype.getPropertyForNode=function(t){var e=t.name,n=me(e),i=this.type,r=this.model,o=Nn(i),a=n.name,s=o.propertiesByName[a],c,p;if(s&&!s.isAttr)return dh(s)&&(c=t.attributes[na],c)?(c=Y0(c,r),p=r.getType(c),N({},s,{effectiveType:Nn(p).name})):s;var l=r.getPackage(n.prefix);if(l){if(c=fh(n,l),p=r.getType(c),s=yt(o.properties,function(u){return!u.isVirtual&&!u.isReference&&!u.isAttribute&&p.hasType(u.type)}),s)return N({},s,{effectiveType:Nn(p).name})}else if(s=yt(o.properties,function(u){return!u.isReference&&!u.isAttribute&&u.type==="Element"}),s)return s;throw ri("unrecognized element <"+n.name+">")},ve.prototype.toString=function(){return"ElementDescriptor["+Nn(this.type).name+"]"},ve.prototype.valueHandler=function(t,e){return new Cc(t,e)},ve.prototype.referenceHandler=function(t){return new Or(t,this.context)},ve.prototype.handler=function(t){return t==="Element"?new Ji(this.model,t,this.context):new ve(this.model,t,this.context)},ve.prototype.handleChild=function(t){var e,n,i,r;if(e=this.getPropertyForNode(t),i=this.element,n=e.effectiveType||e.type,ih(n))return this.valueHandler(e,i);e.isReference?r=this.referenceHandler(e).handleNode(t):r=this.handler(n).handleNode(t);var o=r.element;return o!==void 0&&(e.isMany?i.get(e.name).push(o):i.set(e.name,o),e.isReference?(N(o,{element:i}),this.context.addReference(o)):o.$parent=i),r};function Rc(t,e,n){ve.call(this,t,e,n)}Rc.prototype=Object.create(ve.prototype),Rc.prototype.createElement=function(t){var e=t.name,n=me(e),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&fh(n,o)||e;if(!r.hasType(a))throw ri("unexpected element <"+t.originalName+">");return ve.prototype.createElement.call(this,t)};function Ji(t,e,n){this.model=t,this.context=n}Ji.prototype=Object.create(ia.prototype),Ji.prototype.createElement=function(t){var e=t.name,n=me(e),i=n.prefix,r=t.ns[i+"$uri"],o=t.attributes;return this.model.createAny(e,r,o)},Ji.prototype.handleChild=function(t){var e=new Ji(this.model,"Element",this.context).handleNode(t),n=this.element,i=e.element,r;return i!==void 0&&(r=n.$children=n.$children||[],r.push(i),i.$parent=n),e},Ji.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Pc(t){t instanceof We&&(t={model:t}),N(this,{lax:!1},t)}Pc.prototype.fromXML=function(t,e,n){var i=e.rootHandler;e instanceof ve?(i=e,e={}):typeof e=="string"?(i=this.handler(e),e={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new X0(N({},e,{rootHandler:i})),s=new lh({proxy:!0}),c=Z0();i.context=a,c.push(i);function p(S,M,j){var B=M(),D=B.line,$=B.column,z=B.data;z.charAt(0)==="<"&&z.indexOf(" ")!==-1&&(z=z.slice(0,z.indexOf(" "))+">");var F="unparsable content "+(z?z+" ":"")+`detected
- line: `+D+`
- column: `+$+`
- nested error: `+S.message;if(j)return a.addWarning({message:F,error:S}),!0;throw ri(F)}function l(S,M){return p(S,M,!0)}function u(){var S=a.elementsById,M=a.references,j,B;for(j=0;B=M[j];j++){var D=B.element,$=S[B.id],z=Nn(D).propertiesByName[B.property];if($||a.addWarning({message:"unresolved reference <"+B.id+">",element:B.element,property:B.property,value:B.id}),z.isMany){var F=D.get(z.name),U=F.indexOf(B);U===-1&&(U=F.length),$?F[U]=$:F.splice(U,1)}else D.set(z.name,$)}}function h(){c.pop().handleEnd()}var d=/^<\?xml /i,f=/ encoding="([^"]+)"/i,v=/^utf-8$/i;function g(S){if(d.test(S)){var M=f.exec(S),j=M&&M[1];!j||v.test(j)||a.addWarning({message:"unsupported document encoding <"+j+">, falling back to UTF-8"})}}function R(S,M){var j=c.peek();try{c.push(j.handleNode(S))}catch(B){p(B,M,o)&&c.push(new Sc)}}function E(S,M){try{c.peek().handleText(S)}catch(j){l(j,M)}}function _(S,M){S.trim()&&E(S,M)}var x=r.getPackages().reduce(function(S,M){return S[M.uri]=M.prefix,S},{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(x).on("openTag",function(S,M,j,B){var D=S.attrs||{},$=Object.keys(D).reduce(function(F,U){var ut=M(D[U]);return F[U]=ut,F},{}),z={name:S.name,originalName:S.originalName,attributes:$,ns:S.ns};R(z,B)}).on("question",g).on("closeTag",h).on("cdata",E).on("text",function(S,M,j){_(M(S),j)}).on("error",p).on("warn",l),new Promise(function(S,M){var j;try{s.parse(t),u()}catch(F){j=F}var B=i.element;!j&&!B&&(j=ri("failed to parse document as <"+i.type.$descriptor.name+">"));var D=a.warnings,$=a.references,z=a.elementsById;return j?(j.warnings=D,M(j)):S({rootElement:B,elementsById:z,references:$,warnings:D})})},Pc.prototype.handler=function(t){return new Rc(this.model,t)};function Z0(){var t=[];return Object.defineProperty(t,"peek",{value:function(){return this[this.length-1]}}),t}var Q0=`<?xml version="1.0" encoding="UTF-8"?>
- `,J0=/<|>|'|"|&|\n\r|\n/g,mh=/<|>|&/g;function tb(t){var e={},n={},i={},r=[],o=[];this.byUri=function(a){return n[a]||t&&t.byUri(a)},this.add=function(a,s){n[a.uri]=a,s?r.push(a):o.push(a),this.mapPrefix(a.prefix,a.uri)},this.uriByPrefix=function(a){return e[a||"xmlns"]},this.mapPrefix=function(a,s){e[a||"xmlns"]=s},this.getNSKey=function(a){return a.prefix!==void 0?a.uri+"|"+a.prefix:a.uri},this.logUsed=function(a){var s=a.uri,c=this.getNSKey(a);i[c]=this.byUri(s),t&&t.logUsed(a)},this.getUsed=function(a){function s(l){var u=c.getNSKey(l);return i[u]}var c=this,p=[].concat(r,o);return p.filter(s)}}function eb(t){return t.charAt(0).toLowerCase()+t.slice(1)}function nb(t,e){return uh(e)?eb(t):t}function vh(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}function yh(t){return Me(t)?t:(t.prefix?t.prefix+":":"")+t.localName}function ib(t){return t.getUsed().filter(function(e){return e.prefix!=="xml"}).map(function(e){var n="xmlns"+(e.prefix?":"+e.prefix:"");return{name:n,value:e.uri}})}function rb(t,e){return e.isGeneric?N({localName:e.ns.localName},t):N({localName:nb(e.ns.localName,e.$pkg)},t)}function ob(t,e){return N({localName:e.ns.localName},t)}function ab(t){var e=t.$descriptor;return ct(e.properties,function(n){var i=n.name;if(n.isVirtual||!pn(t,i))return!1;var r=t[i];return r===n.default||r===null?!1:n.isMany?r.length:!0})}var sb={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},cb={"<":"lt",">":"gt","&":"amp"};function gh(t,e,n){return t=Me(t)?t:""+t,t.replace(e,function(i){return"&"+n[i]+";"})}function pb(t){return gh(t,J0,sb)}function lb(t){return gh(t,mh,cb)}function ub(t){return ct(t,function(e){return e.isAttr})}function hb(t){return ct(t,function(e){return!e.isAttr})}function kc(t){this.tagName=t}kc.prototype.build=function(t){return this.element=t,this},kc.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()};function Pi(){}Pi.prototype.serializeValue=Pi.prototype.serializeTo=function(t){t.append(this.escape?lb(this.value):this.value)},Pi.prototype.build=function(t,e){return this.value=e,t.type==="String"&&e.search(mh)!==-1&&(this.escape=!0),this};function Tc(t){this.tagName=t}vh(Tc,Pi),Tc.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"),this.serializeValue(t),t.append("</"+this.tagName+">").appendNewLine()};function Nt(t,e){this.body=[],this.attrs=[],this.parent=t,this.propertyDescriptor=e}Nt.prototype.build=function(t){this.element=t;var e=t.$descriptor,n=this.propertyDescriptor,i,r,o=e.isGeneric;return o?i=this.parseGeneric(t):i=this.parseNsAttributes(t),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(e),this.tagName=this.addTagName(this.ns),o||(r=ab(t),this.parseAttributes(ub(r)),this.parseContainments(hb(r))),this.parseGenericAttributes(t,i),this},Nt.prototype.nsTagName=function(t){var e=this.logNamespaceUsed(t.ns);return rb(e,t)},Nt.prototype.nsPropertyTagName=function(t){var e=this.logNamespaceUsed(t.ns);return ob(e,t)},Nt.prototype.isLocalNs=function(t){return t.uri===this.ns.uri},Nt.prototype.nsAttributeName=function(t){var e;if(Me(t)?e=me(t):e=t.ns,t.inherited)return{localName:e.localName};var n=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:e.localName}:N({localName:e.localName},n)},Nt.prototype.parseGeneric=function(t){var e=this,n=this.body,i=[];return k(t,function(r,o){var a;o==="$body"?n.push(new Pi().build({type:"String"},r)):o==="$children"?k(r,function(s){n.push(new Nt(e).build(s))}):o.indexOf("$")!==0&&(a=e.parseNsAttribute(t,o,r),a&&i.push({name:o,value:r}))}),i},Nt.prototype.parseNsAttribute=function(t,e,n){var i=t.$model,r=me(e),o;if(r.prefix==="xmlns"&&(o={prefix:r.localName,uri:n}),!r.prefix&&r.localName==="xmlns"&&(o={uri:n}),!o)return{name:e,value:n};if(i&&i.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}},Nt.prototype.parseNsAttributes=function(t,e){var n=this,i=t.$attrs,r=[];return k(i,function(o,a){var s=n.parseNsAttribute(t,a,o);s&&r.push(s)}),r},Nt.prototype.parseGenericAttributes=function(t,e){var n=this;k(e,function(i){if(i.name!==na)try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch(r){}})},Nt.prototype.parseContainments=function(t){var e=this,n=this.body,i=this.element;k(t,function(r){var o=i.get(r.name),a=r.isReference,s=r.isMany;if(s||(o=[o]),r.isBody)n.push(new Pi().build(r,o[0]));else if(ih(r.type))k(o,function(l){n.push(new Tc(e.addTagName(e.nsPropertyTagName(r))).build(r,l))});else if(a)k(o,function(l){n.push(new kc(e.addTagName(e.nsPropertyTagName(r))).build(l))});else{var c=dh(r),p=U0(r);k(o,function(l){var u;c?u=new ra(e,r):p?u=new Nt(e,r):u=new Nt(e),n.push(u.build(l))})}})},Nt.prototype.getNamespaces=function(t){var e=this.namespaces,n=this.parent,i;return e||(i=n&&n.getNamespaces(),t||!i?this.namespaces=e=new tb(i):e=i),e},Nt.prototype.logNamespace=function(t,e,n){var i=this.getNamespaces(n),r=t.uri,o=t.prefix,a=i.byUri(r);return(!a||n)&&i.add(t,e),i.mapPrefix(o,r),t},Nt.prototype.logNamespaceUsed=function(t,e){var n=this.element,i=n.$model,r=this.getNamespaces(e),o=t.prefix,a=t.uri,s,c,p;if(!o&&!a)return{localName:t.localName};if(p=W0[o]||i&&(i.getPackage(o)||{}).uri,a=a||p||r.uriByPrefix(o),!a)throw new Error("no namespace uri given for prefix <"+o+">");if(t=r.byUri(a),!t){for(s=o,c=1;r.uriByPrefix(s);)s=o+"_"+c++;t=this.logNamespace({prefix:s,uri:a},p===a)}return o&&r.mapPrefix(o,a),t},Nt.prototype.parseAttributes=function(t){var e=this,n=this.element;k(t,function(i){var r=n.get(i.name);if(i.isReference)if(!i.isMany)r=r.id;else{var o=[];k(r,function(a){o.push(a.id)}),r=o.join(" ")}e.addAttribute(e.nsAttributeName(i),r)})},Nt.prototype.addTagName=function(t){var e=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(e),yh(t)},Nt.prototype.addAttribute=function(t,e){var n=this.attrs;Me(e)&&(e=pb(e));var i=ng(n,function(o){return o.name.localName===t.localName&&o.name.uri===t.uri&&o.name.prefix===t.prefix}),r={name:t,value:e};i!==-1?n.splice(i,1,r):n.push(r)},Nt.prototype.serializeAttributes=function(t){var e=this.attrs,n=this.namespaces;n&&(e=ib(n).concat(e)),k(e,function(i){t.append(" ").append(yh(i.name)).append('="').append(i.value).append('"')})},Nt.prototype.serializeTo=function(t){var e=this.body[0],n=e&&e.constructor!==Pi;t.appendIndent().append("<"+this.tagName),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),k(this.body,function(i){i.serializeTo(t)}),n&&t.unindent().appendIndent(),t.append("</"+this.tagName+">")),t.appendNewLine()};function ra(t,e){Nt.call(this,t,e)}vh(ra,Nt),ra.prototype.parseNsAttributes=function(t){var e=Nt.prototype.parseNsAttributes.call(this,t),n=t.$descriptor;if(n.name===this.propertyDescriptor.type)return e;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=t.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(na),(i.prefix?i.prefix+":":"")+o+n.ns.localName),e},ra.prototype.isLocalNs=function(t){return t.uri===(this.typeNs||this.ns).uri};function db(){this.value="",this.write=function(t){this.value+=t}}function fb(t,e){var n=[""];this.append=function(i){return t.write(i),this},this.appendNewLine=function(){return e&&t.write(`
- `),this},this.appendIndent=function(){return e&&t.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function mb(t){t=N({format:!1,preamble:!0},t||{});function e(n,i){var r=i||new db,o=new fb(r,t.format);if(t.preamble&&o.append(Q0),new Nt().build(n).serializeTo(o),!i)return r.value}return{toXML:e}}function oa(t,e){We.call(this,t,e)}oa.prototype=Object.create(We.prototype),oa.prototype.fromXML=function(t,e,n){Me(e)||(n=e,e="bpmn:Definitions");var i=new Pc(N({model:this,lax:!0},n)),r=i.handler(e);return i.fromXML(t,r)},oa.prototype.toXML=function(t,e){var n=new mb(e);return new Promise(function(i,r){try{var o=n.toXML(t);return i({xml:o})}catch(a){return r(a)}})};var vb="BPMN20",yb="http://www.omg.org/spec/BPMN/20100524/MODEL",gb="bpmn",bb=[],xb=[{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"}]}],_b=[{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"}]}],Eb={tagAlias:"lowerCase",typePrefix:"t"},wb={name:vb,uri:yb,prefix:gb,associations:bb,types:xb,enumerations:_b,xml:Eb},Sb="BPMNDI",Cb="http://www.omg.org/spec/BPMN/20100524/DI",Rb="bpmndi",Pb=[{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"]}],kb=[{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"}]}],Tb=[],Ab={name:Sb,uri:Cb,prefix:Rb,types:Pb,enumerations:kb,associations:Tb},Mb="DC",Db="http://www.omg.org/spec/DD/20100524/DC",Bb="dc",Nb=[{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}]}],Ob=[],jb={name:Mb,uri:Db,prefix:Bb,types:Nb,associations:Ob},Lb="DI",Ib="http://www.omg.org/spec/DD/20100524/DI",$b="di",zb=[{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"}]}],Fb=[],Hb={tagAlias:"lowerCase"},Gb={name:Lb,uri:Ib,prefix:$b,types:zb,associations:Fb,xml:Hb},Vb="bpmn.io colors for BPMN",Wb="http://bpmn.io/schema/bpmn/biocolor/1.0",Ub="bioc",qb=[{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"}]}],Kb=[],Yb=[],Xb={name:Vb,uri:Wb,prefix:Ub,types:qb,enumerations:Kb,associations:Yb},Zb="BPMN in Color",Qb="http://www.omg.org/spec/BPMN/non-normative/color/1.0",Jb="color",tx=[{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"}]}],ex=[],nx=[],ix={name:Zb,uri:Qb,prefix:Jb,types:tx,enumerations:ex,associations:nx},rx={bpmn:wb,bpmndi:Ab,dc:jb,di:Gb,bioc:Xb,color:ix};function ox(t,e){var n=N({},rx,t);return new oa(n,e)}function ye(t){return t?"<"+t.$type+(t.id?' id="'+t.id:"")+'" />':"<null>"}function tr(t){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var e=arguments.length;if(e>=1&&pe(arguments[e-1])){var n=arguments[e-1],i=Array.prototype.slice.call(arguments,0,-1);t.apply(this,i).then(function(r){var o=Object.keys(r)[0];return n(null,r[o])},function(r){return n(r,r.warnings)})}else return t.apply(this,arguments)}}var ax="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 bh(t){pn(t,"di")||Object.defineProperty(t,"di",{enumerable:!1,get:function(){throw new Error(ax)}})}function xe(t,e){return t.$instanceOf(e)}function sx(t){return yt(t.rootElements,function(e){return xe(e,"bpmn:Process")||xe(e,"bpmn:Collaboration")})}function cx(t,e){var n={},i=[],r={};function o(T,L){return function(G){T(G,L)}}function a(T){n[T.id]=T}function s(T){return n[T.id]}function c(T,L){var G=T.gfx;if(G)throw new Error(e("already rendered {element}",{element:ye(T)}));return t.element(T,r[T.id],L)}function p(T,L){return t.root(T,r[T.id],L)}function l(T,L){try{var G=r[T.id]&&c(T,L);return a(T),G}catch(ot){u(ot.message,{element:T,error:ot})}}function u(T,L){t.error(T,L)}var h=this.registerDi=function(T){var L=T.bpmnElement;L?r[L.id]?u(e("multiple DI elements defined for {element}",{element:ye(L)}),{element:L}):(r[L.id]=T,bh(L)):u(e("no bpmnElement referenced in {element}",{element:ye(T)}),{element:T})};function d(T){f(T.plane)}function f(T){h(T),k(T.planeElement,v)}function v(T){h(T)}this.handleDefinitions=function(T,L){var G=T.diagrams;if(L&&G.indexOf(L)===-1)throw new Error(e("diagram not part of bpmn:Definitions"));if(!L&&G&&G.length&&(L=G[0]),!L)throw new Error(e("no diagram to display"));r={},d(L);var ot=L.plane;if(!ot)throw new Error(e("no plane for {element}",{element:ye(L)}));var st=ot.bpmnElement;if(!st)if(st=sx(T),st)u(e("correcting missing bpmnElement on {plane} to {rootElement}",{plane:ye(ot),rootElement:ye(st)})),ot.bpmnElement=st,h(ot);else throw new Error(e("no process or collaboration to display"));var St=p(st,ot);if(xe(st,"bpmn:Process")||xe(st,"bpmn:SubProcess"))R(st,St);else if(xe(st,"bpmn:Collaboration"))A(st,St),E(T.rootElements,St);else throw new Error(e("unsupported bpmnElement for {plane}: {rootElement}",{plane:ye(ot),rootElement:ye(st)}));g(i)};var g=this.handleDeferred=function(){for(var T;i.length;)T=i.shift(),T()};function R(T,L){we(T,L),$(T.ioSpecification,L),D(T.artifacts,L),a(T)}function E(T,L){var G=ct(T,function(ot){return!s(ot)&&xe(ot,"bpmn:Process")&&ot.laneSets});G.forEach(o(R,L))}function _(T,L){l(T,L)}function x(T,L){k(T,o(_,L))}function S(T,L){l(T,L)}function M(T,L){l(T,L)}function j(T,L){l(T,L)}function B(T,L){l(T,L)}function D(T,L){k(T,function(G){xe(G,"bpmn:Association")?i.push(function(){B(G,L)}):B(G,L)})}function $(T,L){T&&(k(T.dataInputs,o(M,L)),k(T.dataOutputs,o(j,L)))}var z=this.handleSubProcess=function(T,L){we(T,L),D(T.artifacts,L)};function F(T,L){var G=l(T,L);xe(T,"bpmn:SubProcess")&&z(T,G||L),xe(T,"bpmn:Activity")&&$(T.ioSpecification,L),i.push(function(){k(T.dataInputAssociations,o(S,L)),k(T.dataOutputAssociations,o(S,L))})}function U(T,L){l(T,L)}function ut(T,L){l(T,L)}function Ie(T,L){i.push(function(){var G=l(T,L);T.childLaneSet&&Rt(T.childLaneSet,G||L),O(T)})}function Rt(T,L){k(T.lanes,o(Ie,L))}function pt(T,L){k(T,o(Rt,L))}function we(T,L){C(T.flowElements,L),T.laneSets&&pt(T.laneSets,L)}function C(T,L){k(T,function(G){xe(G,"bpmn:SequenceFlow")?i.push(function(){U(G,L)}):xe(G,"bpmn:BoundaryEvent")?i.unshift(function(){F(G,L)}):xe(G,"bpmn:FlowNode")?F(G,L):xe(G,"bpmn:DataObject")||(xe(G,"bpmn:DataStoreReference")||xe(G,"bpmn:DataObjectReference")?ut(G,L):u(e("unrecognized flowElement {element} in context {context}",{element:ye(G),context:L?ye(L.businessObject):"null"}),{element:G,context:L}))})}function m(T,L){var G=l(T,L),ot=T.processRef;ot&&R(ot,G||L)}function A(T,L){k(T.participants,o(m,L)),D(T.artifacts,L),i.push(function(){x(T.messageFlows,L)})}function O(T){k(T.flowNodeRef,function(L){var G=L.get("lanes");G&&G.push(T)})}}function y(t,e){var n=W(t);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(e)}function dt(t,e){return kn(e,function(n){return y(t,n)})}function W(t){return t&&t.businessObject||t}function gt(t){return t&&t.di}function px(t,e,n){var i,r,o,a,s,c=[];function p(l,u){var h={root:function(g,R){return i.add(g,R)},element:function(g,R,E){return i.add(g,R,E)},error:function(g,R){c.push({message:g,context:R})}},d=new cx(h,o);u=u||l.diagrams&&l.diagrams[0];var f=lx(l,u);if(!f)throw new Error(o("no diagram to display"));k(f,function(g){d.handleDefinitions(l,g)});var v=u.plane.bpmnElement.id;a.setRootElement(a.findRoot(v+"_plane")||a.findRoot(v))}return new Promise(function(l,u){try{return i=t.get("bpmnImporter"),r=t.get("eventBus"),o=t.get("translate"),a=t.get("canvas"),r.fire("import.render.start",{definitions:e}),p(e,n),r.fire("import.render.complete",{error:s,warnings:c}),l({warnings:c})}catch(h){return h.warnings=c,u(h)}})}function lx(t,e){if(e){var n=e.plane.bpmnElement,i=n;!y(n,"bpmn:Process")&&!y(n,"bpmn:Collaboration")&&(i=ux(n));var r;y(i,"bpmn:Collaboration")?r=i:r=yt(t.rootElements,function(p){if(y(p,"bpmn:Collaboration"))return yt(p.participants,function(l){return l.processRef===i})});var o=[i];r&&(o=be(r.participants,function(p){return p.processRef}),o.push(r));var a=xh(o),s=[e],c=[n];return k(t.diagrams,function(p){var l=p.plane.bpmnElement;a.indexOf(l)!==-1&&c.indexOf(l)===-1&&(s.push(p),c.push(l))}),s}}function xh(t){var e=[];return k(t,function(n){n&&(e.push(n),e=e.concat(xh(n.flowElements)))}),e}function ux(t){for(var e=t;e;){if(y(e,"bpmn:Process"))return e;e=e.$parent}}var hx='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',_h=hx,Eh={verticalAlign:"middle"},wh={color:"#404040"},dx={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},fx={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},mx={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"},vx='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+_h+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>',yn;function yx(){yn=Mt(vx),se(yn,dx),se(At("svg",yn),Eh),se(At(".backdrop",yn),fx),se(At(".notice",yn),mx),se(At(".link",yn),wh,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function gx(){yn||(yx(),Re.bind(yn,".backdrop","click",function(t){document.body.removeChild(yn)})),document.body.appendChild(yn)}function Et(t){t=N({},xx,t),this._moddle=this._createModdle(t),this._container=this._createContainer(t),Ex(this._container),this._init(this._container,this._moddle,t)}q(Et,Xi),Et.prototype.importXML=function(t,e){return Ui(this,null,function*(){const n=this;function i(o){const a=n.get("eventBus").createEvent(o);return Object.defineProperty(a,"context",{enumerable:!0,get:function(){return{warnings:o.warnings,references:o.references,elementsById:o.elementsById}}}),a}let r=[];try{t=this._emit("import.parse.start",{xml:t})||t;let o;try{o=yield this._moddle.fromXML(t,"bpmn:Definitions")}catch(u){throw this._emit("import.parse.complete",{error:u}),u}let a=o.rootElement;const s=o.references,c=o.warnings,p=o.elementsById;r=r.concat(c),a=this._emit("import.parse.complete",i({error:null,definitions:a,elementsById:p,references:s,warnings:r}))||a;const l=yield this.importDefinitions(a,e);return r=r.concat(l.warnings),this._emit("import.done",{error:null,warnings:r}),{warnings:r}}catch(o){let a=o;throw r=r.concat(a.warnings||[]),aa(a,r),a=bx(a),this._emit("import.done",{error:a,warnings:a.warnings}),a}})},Et.prototype.importXML=tr(Et.prototype.importXML),Et.prototype.importDefinitions=function(t,e){return Ui(this,null,function*(){return this._setDefinitions(t),{warnings:(yield this.open(e)).warnings}})},Et.prototype.importDefinitions=tr(Et.prototype.importDefinitions),Et.prototype.open=function(t){return Ui(this,null,function*(){const e=this._definitions;let n=t;if(!e){const r=new Error("no XML imported");throw aa(r,[]),r}if(typeof t=="string"&&(n=_x(e,t),!n)){const r=new Error("BPMNDiagram <"+t+"> not found");throw aa(r,[]),r}try{this.clear()}catch(r){throw aa(r,[]),r}const{warnings:i}=yield px(this,e,n);return{warnings:i}})},Et.prototype.open=tr(Et.prototype.open),Et.prototype.saveXML=function(t){return Ui(this,null,function*(){t=t||{};let e=this._definitions,n,i;try{if(!e)throw new Error("no definitions loaded");e=this._emit("saveXML.start",{definitions:e})||e,i=(yield this._moddle.toXML(e,t)).xml,i=this._emit("saveXML.serialized",{xml:i})||i}catch(o){n=o}const r=n?{error:n}:{xml:i};if(this._emit("saveXML.done",r),n)throw n;return r})},Et.prototype.saveXML=tr(Et.prototype.saveXML),Et.prototype.saveSVG=function(){return Ui(this,null,function*(){this._emit("saveSVG.start");let t,e;try{const n=this.get("canvas"),i=n.getActiveLayer(),r=At("defs",n._svg),o=gu(i),a=r?"<defs>"+gu(r)+"</defs>":"",s=i.getBBox();t=`<?xml version="1.0" encoding="utf-8"?>
- <!-- created with bpmn-js / http://bpmn.io -->
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+a+o+"</svg>"}catch(n){e=n}if(this._emit("saveSVG.done",{error:e,svg:t}),e)throw e;return{svg:t}})},Et.prototype.saveSVG=tr(Et.prototype.saveSVG),Et.prototype._setDefinitions=function(t){this._definitions=t},Et.prototype.getModules=function(){return this._modules},Et.prototype.clear=function(){this.getDefinitions()&&Xi.prototype.clear.call(this)},Et.prototype.destroy=function(){Xi.prototype.destroy.call(this),dn(this._container)},Et.prototype.on=function(t,e,n,i){return this.get("eventBus").on(t,e,n,i)},Et.prototype.off=function(t,e){this.get("eventBus").off(t,e)},Et.prototype.attachTo=function(t){if(!t)throw new Error("parentNode required");this.detach(),t.get&&t.constructor.prototype.jquery&&(t=t.get(0)),typeof t=="string"&&(t=At(t)),t.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Et.prototype.getDefinitions=function(){return this._definitions},Et.prototype.detach=function(){const t=this._container,e=t.parentNode;e&&(this._emit("detach",{}),e.removeChild(t))},Et.prototype._init=function(t,e,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",e]}],a=[].concat(o,i,r),s=N(Tn(n,["additionalModules"]),{canvas:N({},n.canvas,{container:t}),modules:a});Xi.call(this,s),n&&n.container&&this.attachTo(n.container)},Et.prototype._emit=function(t,e){return this.get("eventBus").fire(t,e)},Et.prototype._createContainer=function(t){const e=Mt('<div class="bjs-container"></div>');return se(e,{width:Sh(t.width),height:Sh(t.height),position:t.position}),e},Et.prototype._createModdle=function(t){const e=N({},this._moddleExtensions,t.moddleExtensions);return new ox(e)},Et.prototype._modules=[];function aa(t,e){return t.warnings=e,t}function bx(t){const e=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(t.message);return e&&(t.message="unparsable content <"+e[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+e[2]),t}const xx={width:"100%",height:"100%",position:"relative"};function Sh(t){return t+(it(t)?"px":"")}function _x(t,e){return e&&yt(t.diagrams,function(n){return n.id===e})||null}function Ex(t){const e='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+_h+"</a>",n=Mt(e);se(At("svg",n),Eh),se(n,wh,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),t.appendChild(n),J.bind(n,"click",function(i){gx(),i.preventDefault()})}function jr(t){Et.call(this,t),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)}q(jr,Et),jr.prototype._createModdle=function(t){var e=Et.prototype._createModdle.call(this,t);return e.ids=new Ve([32,36,1]),e},jr.prototype._collectIds=function(t,e){var n=t.$model,i=n.ids,r;i.clear();for(r in e)i.claim(r,e[r])};function vt(t,e){return y(t,"bpmn:CallActivity")?!1:y(t,"bpmn:SubProcess")?(e=e||gt(t),e&&y(e,"bpmndi:BPMNPlane")?!0:e&&!!e.isExpanded):y(t,"bpmn:Participant")?!!W(t).processRef:!0}function wx(t){return t&&W(t).isInterrupting!==!1}function Oe(t){return t&&!!W(t).triggeredByEvent}function sa(t,e){var n=W(t).eventDefinitions;return kn(n,function(i){return y(i,e)})}function Sx(t){return sa(t,"bpmn:ErrorEventDefinition")}function Cx(t){return sa(t,"bpmn:EscalationEventDefinition")}function Rx(t){return sa(t,"bpmn:CompensateEventDefinition")}var Lr={width:90,height:20},Ch=15;function ki(t){return y(t,"bpmn:Event")||y(t,"bpmn:Gateway")||y(t,"bpmn:DataStoreReference")||y(t,"bpmn:DataObjectReference")||y(t,"bpmn:DataInput")||y(t,"bpmn:DataOutput")||y(t,"bpmn:SequenceFlow")||y(t,"bpmn:MessageFlow")||y(t,"bpmn:Group")}function ca(t){return xt(t.label)}function Px(t){var e=t.length/2-1,n=t[Math.floor(e)],i=t[Math.ceil(e+.01)],r=kx(t),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=Ch:a+=Ch,{x:a,y:s}}function kx(t){var e=t.length/2-1,n=t[Math.floor(e)],i=t[Math.ceil(e+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}function Ac(t){return t.waypoints?Px(t.waypoints):y(t,"bpmn:Group")?{x:t.x+t.width/2,y:t.y+Lr.height/2}:{x:t.x+t.width/2,y:t.y+t.height+Lr.height/2}}function Tx(t,e){var n,i,r,o=t.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Lr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Ac(e),i=Lr),N({x:n.x-i.width/2,y:n.y-i.height/2},i)}function Rh(t){if(y(t,"bpmn:FlowElement")||y(t,"bpmn:Participant")||y(t,"bpmn:Lane")||y(t,"bpmn:SequenceFlow")||y(t,"bpmn:MessageFlow")||y(t,"bpmn:DataInput")||y(t,"bpmn:DataOutput"))return"name";if(y(t,"bpmn:TextAnnotation"))return"text";if(y(t,"bpmn:Group"))return"categoryValueRef"}function Ax(t){var e=t.categoryValueRef;return e&&e.value||""}function Ue(t){var e=t.businessObject,n=Rh(e);if(n)return n==="categoryValueRef"?Ax(e):e[n]||""}function Mx(t,e){var n=t.businessObject,i=Rh(n);return i&&(i==="categoryValueRef"?n.categoryValueRef.value=e:n[i]=e),t}var Ir="hsl(225, 10%, 15%)";function gn(t,e){return kn(t.eventDefinitions,function(n){return n.$type===e})}function Dx(t){return t.$type==="bpmn:IntermediateThrowEvent"||t.$type==="bpmn:EndEvent"}function Bx(t){var e=t.dataObjectRef;return t.isCollection||e&&e.isCollection}function ft(t,e){var n=gt(t);return n.get("color:background-color")||n.get("bioc:fill")||e||"white"}function K(t,e){var n=gt(t);return n.get("color:border-color")||n.get("bioc:stroke")||e||Ir}function $r(t,e,n){var i=gt(t),r=i.get("label");return r&&r.get("color:color")||e||K(t,n)}function Nx(t){var e=t.x+t.width/2,n=t.y+t.height/2,i=t.width/2,r=[["M",e,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]];return wi(r)}function Ph(t,e){var n=t.x,i=t.y,r=t.width,o=t.height,a=[["M",n+e,i],["l",r-e*2,0],["a",e,e,0,0,1,e,e],["l",0,o-e*2],["a",e,e,0,0,1,-e,e],["l",e*2-r,0],["a",e,e,0,0,1,-e,-e],["l",0,e*2-o],["a",e,e,0,0,1,e,-e],["z"]];return wi(a)}function Ox(t){var e=t.width,n=t.height,i=t.x,r=t.y,o=e/2,a=n/2,s=[["M",i+o,r],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return wi(s)}function jx(t){var e=t.x,n=t.y,i=t.width,r=t.height,o=[["M",e,n],["l",i,0],["l",0,r],["l",-i,0],["z"]];return wi(o)}var Lx=new Ve,pa=10,Mc=3,er=.95,Ix=.35,$x=10;function Ti(t,e,n,i,r,o,a){fn.call(this,e,a);var s=t&&t.defaultFillColor,c=t&&t.defaultStrokeColor,p=t&&t.defaultLabelColor,l=Lx.next(),u={};function h(C){return n.computeStyle(C,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Ir,strokeWidth:2,fill:"white"})}function d(C){return n.computeStyle(C,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Ir,strokeWidth:2})}function f(C,m){var{ref:A={x:0,y:0},scale:O=1,element:T}=m,L=Z("marker",{id:C,viewBox:"0 0 20 20",refX:A.x,refY:A.y,markerWidth:20*O,markerHeight:20*O,orient:"auto"});tt(L,T);var G=At("defs",r._svg);G||(G=Z("defs"),tt(r._svg,G)),tt(G,L),u[C]=L}function v(C){return C.replace(/[^0-9a-zA-Z]+/g,"_")}function g(C,m,A){var O=C+"-"+v(m)+"-"+v(A)+"-"+l;return u[O]||R(O,C,m,A),"url(#"+O+")"}function R(C,m,A,O){if(m==="sequenceflow-end"){var T=Z("path",Ct({d:"M 1 5 L 11 10 L 1 15 Z"},h({fill:O,stroke:O,strokeWidth:1})));f(C,{element:T,ref:{x:11,y:10},scale:.5})}if(m==="messageflow-start"){var L=Z("circle",Ct({cx:6,cy:6,r:3.5},h({fill:A,stroke:O,strokeWidth:1,strokeDasharray:[1e4,1]})));f(C,{element:L,ref:{x:6,y:6}})}if(m==="messageflow-end"){var G=Z("path",Ct({d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"},h({fill:A,stroke:O,strokeWidth:1,strokeDasharray:[1e4,1]})));f(C,{element:G,ref:{x:8.5,y:5}})}if(m==="association-start"){var ot=Z("path",Ct({d:"M 11 5 L 1 10 L 11 15"},d({fill:"none",stroke:O,strokeWidth:1.5,strokeDasharray:[1e4,1]})));f(C,{element:ot,ref:{x:1,y:10},scale:.5})}if(m==="association-end"){var st=Z("path",Ct({d:"M 1 5 L 11 10 L 1 15"},d({fill:"none",stroke:O,strokeWidth:1.5,strokeDasharray:[1e4,1]})));f(C,{element:st,ref:{x:11,y:10},scale:.5})}if(m==="conditional-flow-marker"){var St=Z("path",Ct({d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"},h({fill:A,stroke:O})));f(C,{element:St,ref:{x:-1,y:10},scale:.5})}if(m==="conditional-default-flow-marker"){var bt=Z("path",Ct({d:"M 6 4 L 10 16"},h({stroke:O})));f(C,{element:bt,ref:{x:0,y:10},scale:.5})}}function E(C,m,A,O,T){oe(O)&&(T=O,O=0),O=O||0,T=h(T),T.fill==="none"&&delete T.fillOpacity;var L=m/2,G=A/2,ot=Z("circle",Ct({cx:L,cy:G,r:Math.round((m+A)/4-O)},T));return tt(C,ot),ot}function _(C,m,A,O,T,L){oe(T)&&(L=T,T=0),T=T||0,L=h(L);var G=Z("rect",Ct({x:T,y:T,width:m-T*2,height:A-T*2,rx:O,ry:O},L));return tt(C,G),G}function x(C,m,A,O){var T=m/2,L=A/2,G=[{x:T,y:0},{x:m,y:L},{x:T,y:A},{x:0,y:L}],ot=G.map(function(St){return St.x+","+St.y}).join(" ");O=h(O);var st=Z("polygon",Pn(Ct({},O),{points:ot}));return tt(C,st),st}function S(C,m,A,O){A=d(A);var T=Vo(m,A,O);return tt(C,T),T}function M(C,m,A){return S(C,m,A,5)}function j(C,m,A){A=d(A);var O=Z("path",Pn(Ct({},A),{d:m}));return tt(C,O),O}function B(C,m,A,O){return j(m,A,N({"data-marker":C},O))}function D(C){return Rt[C]}function $(C){return function(m,A,O){return D(C)(m,A,O)}}function z(C,m){var A=W(C),O=Dx(A);return A.eventDefinitions&&A.eventDefinitions.length>1?A.parallelMultiple?D("bpmn:ParallelMultipleEventDefinition")(m,C,O):D("bpmn:MultipleEventDefinition")(m,C,O):gn(A,"bpmn:MessageEventDefinition")?D("bpmn:MessageEventDefinition")(m,C,O):gn(A,"bpmn:TimerEventDefinition")?D("bpmn:TimerEventDefinition")(m,C,O):gn(A,"bpmn:ConditionalEventDefinition")?D("bpmn:ConditionalEventDefinition")(m,C):gn(A,"bpmn:SignalEventDefinition")?D("bpmn:SignalEventDefinition")(m,C,O):gn(A,"bpmn:EscalationEventDefinition")?D("bpmn:EscalationEventDefinition")(m,C,O):gn(A,"bpmn:LinkEventDefinition")?D("bpmn:LinkEventDefinition")(m,C,O):gn(A,"bpmn:ErrorEventDefinition")?D("bpmn:ErrorEventDefinition")(m,C,O):gn(A,"bpmn:CancelEventDefinition")?D("bpmn:CancelEventDefinition")(m,C,O):gn(A,"bpmn:CompensateEventDefinition")?D("bpmn:CompensateEventDefinition")(m,C,O):gn(A,"bpmn:TerminateEventDefinition")?D("bpmn:TerminateEventDefinition")(m,C,O):null}function F(C,m,A){A=N({size:{width:100}},A);var O=o.createText(m||"",A);return ht(O).add("djs-label"),tt(C,O),O}function U(C,m,A){var O=W(m);return F(C,O.name,{box:m,align:A,padding:7,style:{fill:$r(m,p,c)}})}function ut(C,m){var A={width:90,height:30,x:m.width/2+m.x,y:m.height/2+m.y};return F(C,Ue(m),{box:A,fitBox:!0,style:N({},o.getExternalStyle(),{fill:$r(m,p,c)})})}function Ie(C,m,A){var O=F(C,m,{box:{height:30,width:A.height},align:"center-middle",style:{fill:$r(A,p,c)}}),T=-1*A.height;gc(O,0,-T,270)}var Rt=this.handlers={"bpmn:Event":function(C,m,A){return"fillOpacity"in A||(A.fillOpacity=er),E(C,m.width,m.height,A)},"bpmn:StartEvent":function(C,m,A){var O={fill:ft(m,s),stroke:K(m,c)},T=W(m);T.isInterrupting||(O={strokeDasharray:"6",fill:ft(m,s),stroke:K(m,c)});var L=D("bpmn:Event")(C,m,O);return(!A||A.renderIcon!==!1)&&z(m,C),L},"bpmn:MessageEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:m.width,containerHeight:m.height,position:{mx:.235,my:.315}}),T=A?K(m,c):ft(m,s),L=A?ft(m,s):K(m,c),G=j(C,O,{strokeWidth:1,fill:T,stroke:L});return G},"bpmn:TimerEventDefinition":function(C,m){var A=E(C,m.width,m.height,.2*m.height,{strokeWidth:2,fill:ft(m,s),stroke:K(m,c)}),O=i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:m.width,containerHeight:m.height,position:{mx:.5,my:.5}});j(C,O,{strokeWidth:2,stroke:K(m,c)});for(var T=0;T<12;T++){var L=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:m.width,containerHeight:m.height,position:{mx:.5,my:.5}}),G=m.width/2,ot=m.height/2;j(C,L,{strokeWidth:1,transform:"rotate("+T*30+","+ot+","+G+")",stroke:K(m,c)})}return A},"bpmn:EscalationEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.5,my:.2}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)})},"bpmn:ConditionalEventDefinition":function(C,m){var A=i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.5,my:.222}});return j(C,A,{strokeWidth:1,stroke:K(m,c)})},"bpmn:LinkEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.57,my:.263}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)})},"bpmn:ErrorEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:m.width,containerHeight:m.height,position:{mx:.2,my:.722}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)})},"bpmn:CancelEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.638,my:-.055}}),T=A?K(m,c):"none",L=j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)});return Ju(L,45),L},"bpmn:CompensateEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.22,my:.5}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)})},"bpmn:SignalEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:m.width,containerHeight:m.height,position:{mx:.5,my:.2}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T,stroke:K(m,c)})},"bpmn:MultipleEventDefinition":function(C,m,A){var O=i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:m.width,containerHeight:m.height,position:{mx:.222,my:.36}}),T=A?K(m,c):"none";return j(C,O,{strokeWidth:1,fill:T})},"bpmn:ParallelMultipleEventDefinition":function(C,m){var A=i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:m.width,containerHeight:m.height,position:{mx:.458,my:.194}});return j(C,A,{strokeWidth:1,fill:K(m,c),stroke:K(m,c)})},"bpmn:EndEvent":function(C,m,A){var O=D("bpmn:Event")(C,m,{strokeWidth:4,fill:ft(m,s),stroke:K(m,c)});return(!A||A.renderIcon!==!1)&&z(m,C),O},"bpmn:TerminateEventDefinition":function(C,m){var A=E(C,m.width,m.height,8,{strokeWidth:4,fill:K(m,c),stroke:K(m,c)});return A},"bpmn:IntermediateEvent":function(C,m,A){var O=D("bpmn:Event")(C,m,{strokeWidth:1.5,fill:ft(m,s),stroke:K(m,c)});return E(C,m.width,m.height,Mc,{strokeWidth:1.5,fill:ft(m,"none"),stroke:K(m,c)}),(!A||A.renderIcon!==!1)&&z(m,C),O},"bpmn:IntermediateCatchEvent":$("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":$("bpmn:IntermediateEvent"),"bpmn:Activity":function(C,m,A){return A=A||{},"fillOpacity"in A||(A.fillOpacity=er),_(C,m.width,m.height,pa,A)},"bpmn:Task":function(C,m){var A={fill:ft(m,s),stroke:K(m,c)},O=D("bpmn:Activity")(C,m,A);return U(C,m,"center-middle"),pt(C,m),O},"bpmn:ServiceTask":function(C,m){var A=D("bpmn:Task")(C,m),O=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});j(C,O,{strokeWidth:1,fill:ft(m,s),stroke:K(m,c)});var T=i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}});j(C,T,{strokeWidth:0,fill:ft(m,s)});var L=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return j(C,L,{strokeWidth:1,fill:ft(m,s),stroke:K(m,c)}),A},"bpmn:UserTask":function(C,m){var A=D("bpmn:Task")(C,m),O=15,T=12,L=i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:O,y:T}});j(C,L,{strokeWidth:.5,fill:ft(m,s),stroke:K(m,c)});var G=i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:O,y:T}});j(C,G,{strokeWidth:.5,fill:ft(m,s),stroke:K(m,c)});var ot=i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:O,y:T}});return j(C,ot,{strokeWidth:.5,fill:K(m,c),stroke:K(m,c)}),A},"bpmn:ManualTask":function(C,m){var A=D("bpmn:Task")(C,m),O=i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return j(C,O,{strokeWidth:.5,fill:ft(m,s),stroke:K(m,c)}),A},"bpmn:SendTask":function(C,m){var A=D("bpmn:Task")(C,m),O=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return j(C,O,{strokeWidth:1,fill:K(m,c),stroke:ft(m,s)}),A},"bpmn:ReceiveTask":function(C,m){var A=W(m),O=D("bpmn:Task")(C,m),T;return A.instantiate?(E(C,28,28,20*.22,{strokeWidth:1}),T=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):T=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),j(C,T,{strokeWidth:1,fill:ft(m,s),stroke:K(m,c)}),O},"bpmn:ScriptTask":function(C,m){var A=D("bpmn:Task")(C,m),O=i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return j(C,O,{strokeWidth:1,stroke:K(m,c)}),A},"bpmn:BusinessRuleTask":function(C,m){var A=D("bpmn:Task")(C,m),O=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),T=j(C,O);Y(T,{strokeWidth:1,fill:ft(m,"#aaaaaa"),stroke:K(m,c)});var L=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),G=j(C,L);return Y(G,{strokeWidth:1,stroke:K(m,c)}),A},"bpmn:SubProcess":function(C,m,A){A=Ct({fill:ft(m,s),stroke:K(m,c)},A);var O=D("bpmn:Activity")(C,m,A),T=vt(m);return Oe(m)&&Y(O,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),U(C,m,T?"center-top":"center-middle"),T?pt(C,m):pt(C,m,["SubProcessMarker"]),O},"bpmn:AdHocSubProcess":function(C,m){return D("bpmn:SubProcess")(C,m)},"bpmn:Transaction":function(C,m){var A=D("bpmn:SubProcess")(C,m,{strokeWidth:1.5}),O=n.style(["no-fill","no-events"],{stroke:K(m,c),strokeWidth:1.5});return _(C,m.width,m.height,pa-3,Mc,O),A},"bpmn:CallActivity":function(C,m){return D("bpmn:SubProcess")(C,m,{strokeWidth:5})},"bpmn:Participant":function(C,m){var A=1.5,O={fillOpacity:er,fill:ft(m,s),stroke:K(m,c),strokeWidth:A},T=D("bpmn:Lane")(C,m,O),L=vt(m);if(L){S(C,[{x:30,y:0},{x:30,y:m.height}],{stroke:K(m,c),strokeWidth:A});var G=W(m).name;Ie(C,G,m)}else{var ot=W(m).name;F(C,ot,{box:m,align:"center-middle",style:{fill:$r(m,p,c)}})}var st=!!W(m).participantMultiplicity;return st&&D("ParticipantMultiplicityMarker")(C,m),T},"bpmn:Lane":function(C,m,A){var O=_(C,m.width,m.height,0,Ct({fill:ft(m,s),fillOpacity:Ix,stroke:K(m,c),strokeWidth:1.5},A)),T=W(m);if(T.$type==="bpmn:Lane"){var L=T.name;Ie(C,L,m)}return O},"bpmn:InclusiveGateway":function(C,m){var A=D("bpmn:Gateway")(C,m);return E(C,m.width,m.height,m.height*.24,{strokeWidth:2.5,fill:ft(m,s),stroke:K(m,c)}),A},"bpmn:ExclusiveGateway":function(C,m){var A=D("bpmn:Gateway")(C,m),O=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:m.width,containerHeight:m.height,position:{mx:.32,my:.3}});return gt(m).isMarkerVisible&&j(C,O,{strokeWidth:1,fill:K(m,c),stroke:K(m,c)}),A},"bpmn:ComplexGateway":function(C,m){var A=D("bpmn:Gateway")(C,m),O=i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:m.width,containerHeight:m.height,position:{mx:.46,my:.26}});return j(C,O,{strokeWidth:1,fill:K(m,c),stroke:K(m,c)}),A},"bpmn:ParallelGateway":function(C,m){var A=D("bpmn:Gateway")(C,m),O=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:m.width,containerHeight:m.height,position:{mx:.46,my:.2}});return j(C,O,{strokeWidth:1,fill:K(m,c),stroke:K(m,c)}),A},"bpmn:EventBasedGateway":function(C,m){var A=W(m),O=D("bpmn:Gateway")(C,m);E(C,m.width,m.height,m.height*.2,{strokeWidth:1,fill:"none",stroke:K(m,c)});var T=A.eventGatewayType,L=!!A.instantiate;function G(){var st=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:m.width,containerHeight:m.height,position:{mx:.36,my:.44}});j(C,st,{strokeWidth:2,fill:ft(m,"none"),stroke:K(m,c)})}if(T==="Parallel"){var ot=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:m.width,containerHeight:m.height,position:{mx:.474,my:.296}});j(C,ot,{strokeWidth:1,fill:"none"})}else T==="Exclusive"&&(L||E(C,m.width,m.height,m.height*.26,{strokeWidth:1,fill:"none",stroke:K(m,c)}),G());return O},"bpmn:Gateway":function(C,m){return x(C,m.width,m.height,{fill:ft(m,s),fillOpacity:er,stroke:K(m,c)})},"bpmn:SequenceFlow":function(C,m){var A=ft(m,s),O=K(m,c),T=M(C,m.waypoints,{markerEnd:g("sequenceflow-end",A,O),stroke:K(m,c)}),L=W(m),G;return m.source&&(G=m.source.businessObject,L.conditionExpression&&G.$instanceOf("bpmn:Activity")&&Y(T,{markerStart:g("conditional-flow-marker",A,O)}),G.default&&(G.$instanceOf("bpmn:Gateway")||G.$instanceOf("bpmn:Activity"))&&G.default===L&&Y(T,{markerStart:g("conditional-default-flow-marker",A,O)})),T},"bpmn:Association":function(C,m,A){var O=W(m),T=ft(m,s),L=K(m,c);return A=Ct({strokeDasharray:"0, 5",stroke:K(m,c)},A),(O.associationDirection==="One"||O.associationDirection==="Both")&&(A.markerEnd=g("association-end",T,L)),O.associationDirection==="Both"&&(A.markerStart=g("association-start",T,L)),M(C,m.waypoints,A)},"bpmn:DataInputAssociation":function(C,m){var A=ft(m,s),O=K(m,c);return D("bpmn:Association")(C,m,{markerEnd:g("association-end",A,O)})},"bpmn:DataOutputAssociation":function(C,m){var A=ft(m,s),O=K(m,c);return D("bpmn:Association")(C,m,{markerEnd:g("association-end",A,O)})},"bpmn:MessageFlow":function(C,m){var A=W(m),O=gt(m),T=ft(m,s),L=K(m,c),G=M(C,m.waypoints,{markerEnd:g("messageflow-end",T,L),markerStart:g("messageflow-start",T,L),strokeDasharray:"10, 11",strokeWidth:1.5,stroke:K(m,c)});if(A.messageRef){var ot=G.getPointAtLength(G.getTotalLength()/2),st=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:ot.x,y:ot.y}}),St={strokeWidth:1};O.messageVisibleKind==="initiating"?(St.fill="white",St.stroke=Ir):(St.fill="#888",St.stroke="white");var bt=j(C,st,St),mt=A.messageRef.name,ie=F(C,mt,{align:"center-top",fitBox:!0,style:{fill:K(m,p)}}),de=bt.getBBox(),kt=ie.getBBox(),jt=ot.x-kt.width/2,Se=ot.y+de.height/2+$x;gc(ie,jt,Se,0)}return G},"bpmn:DataObject":function(C,m){var A=i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.474,my:.296}}),O=j(C,A,{fill:ft(m,s),fillOpacity:er,stroke:K(m,c)}),T=W(m);return Bx(T)&&we(C,m),O},"bpmn:DataObjectReference":$("bpmn:DataObject"),"bpmn:DataInput":function(C,m){var A=i.getRawPath("DATA_ARROW"),O=D("bpmn:DataObject")(C,m);return j(C,A,{strokeWidth:1}),O},"bpmn:DataOutput":function(C,m){var A=i.getRawPath("DATA_ARROW"),O=D("bpmn:DataObject")(C,m);return j(C,A,{strokeWidth:1,fill:Ir}),O},"bpmn:DataStoreReference":function(C,m){var A=i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:0,my:.133}}),O=j(C,A,{strokeWidth:2,fill:ft(m,s),fillOpacity:er,stroke:K(m,c)});return O},"bpmn:BoundaryEvent":function(C,m,A){var O=W(m),T=O.cancelActivity,L={strokeWidth:1.5,fill:ft(m,s),stroke:K(m,c)};T||(L.strokeDasharray="6");var G=Pn(Ct({},L),{fillOpacity:1}),ot=Pn(Ct({},L),{fill:"none"}),st=D("bpmn:Event")(C,m,G);return E(C,m.width,m.height,Mc,ot),(!A||A.renderIcon!==!1)&&z(m,C),st},"bpmn:Group":function(C,m){return _(C,m.width,m.height,pa,{stroke:K(m,c),strokeWidth:1.5,strokeDasharray:"10,6,0,6",fill:"none",pointerEvents:"none"})},label:function(C,m){return ut(C,m)},"bpmn:TextAnnotation":function(C,m){var A=_(C,m.width,m.height,0,0,{fill:"none",stroke:"none"}),O=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:0,my:0}});j(C,O,{stroke:K(m,c)});var T=W(m).text||"";return F(C,T,{box:m,align:"left-top",padding:7,style:{fill:$r(m,p,c)}}),A},ParticipantMultiplicityMarker:function(C,m){var A=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:m.width/2/m.width,my:(m.height-15)/m.height}});B("participant-multiplicity",C,A,{strokeWidth:2,fill:ft(m,s),stroke:K(m,c)})},SubProcessMarker:function(C,m){var A=_(C,14,14,0,{strokeWidth:1,fill:ft(m,s),stroke:K(m,c)});ke(A,m.width/2-7.5,m.height-20);var O=i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2-7.5)/m.width,my:(m.height-20)/m.height}});B("sub-process",C,O,{fill:ft(m,s),stroke:K(m,c)})},ParallelMarker:function(C,m,A){var O=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2+A.parallel)/m.width,my:(m.height-20)/m.height}});B("parallel",C,O,{fill:ft(m,s),stroke:K(m,c)})},SequentialMarker:function(C,m,A){var O=i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2+A.seq)/m.width,my:(m.height-19)/m.height}});B("sequential",C,O,{fill:ft(m,s),stroke:K(m,c)})},CompensationMarker:function(C,m,A){var O=i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2+A.compensation)/m.width,my:(m.height-13)/m.height}});B("compensation",C,O,{strokeWidth:1,fill:ft(m,s),stroke:K(m,c)})},LoopMarker:function(C,m,A){var O=i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2+A.loop)/m.width,my:(m.height-7)/m.height}});B("loop",C,O,{strokeWidth:1.5,fill:ft(m,s),stroke:K(m,c),strokeMiterlimit:.5})},AdhocMarker:function(C,m,A){var O=i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:(m.width/2+A.adhoc)/m.width,my:(m.height-15)/m.height}});B("adhoc",C,O,{strokeWidth:1,fill:K(m,c),stroke:K(m,c)})}};function pt(C,m,A){var O=W(m),T=A&&A.indexOf("SubProcessMarker")!==-1,L;T?L={seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:L={seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},k(A,function(st){D(st)(C,m,L)}),O.isForCompensation&&D("CompensationMarker")(C,m,L),O.$type==="bpmn:AdHocSubProcess"&&D("AdhocMarker")(C,m,L);var G=O.loopCharacteristics,ot=G&&G.isSequential;G&&(ot===void 0&&D("LoopMarker")(C,m,L),ot===!1&&D("ParallelMarker")(C,m,L),ot===!0&&D("SequentialMarker")(C,m,L))}function we(C,m){var A=(m.height-18)/m.height,O=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:m.width,containerHeight:m.height,position:{mx:.33,my:A}});j(C,O,{strokeWidth:2})}this._drawPath=j,this._renderer=D}q(Ti,fn),Ti.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Ti.prototype.canRender=function(t){return y(t,"bpmn:BaseElement")},Ti.prototype.drawShape=function(t,e){var n=e.type,i=this._renderer(n);return i(t,e)},Ti.prototype.drawConnection=function(t,e){var n=e.type,i=this._renderer(n);return i(t,e)},Ti.prototype.getShapePath=function(t){return y(t,"bpmn:Event")?Nx(t):y(t,"bpmn:Activity")?Ph(t,pa):y(t,"bpmn:Gateway")?Ox(t):jx(t)};var zx=0,Fx={width:150,height:50};function Hx(t){var e=t.split("-");return{horizontal:e[0]||"center",vertical:e[1]||"top"}}function Gx(t){return oe(t)?N({top:0,left:0,right:0,bottom:0},t):{top:t,left:t,right:t,bottom:t}}function Vx(t,e){e.textContent=t;var n;try{var i,r=t==="";return e.textContent=r?"dummy":t,n=e.getBBox(),i={width:n.width+n.x*2,height:n.height},r&&(i.width=0),i}catch(o){return{width:0,height:0}}}function Wx(t,e,n){for(var i=t.shift(),r=i,o;;){if(o=Vx(r,n),o.width=r?o.width:0,r===" "||r===""||o.width<Math.round(e)||r.length<2)return Ux(t,r,i,o);r=Kx(r,o.width,e)}}function Ux(t,e,n,i){if(e.length<n.length){var r=n.slice(e.length).trim();t.unshift(r)}return{width:i.width,height:i.height,text:e}}var kh="\xAD";function qx(t,e){var n=t.split(/(\s|-|\u00AD)/g),i,r=[],o=0;if(n.length>1)for(;i=n.shift();)if(i.length+o<e)r.push(i),o+=i.length;else{(i==="-"||i===kh)&&r.pop();break}var a=r[r.length-1];return a&&a===kh&&(r[r.length-1]="-"),r.join("")}function Kx(t,e,n){var i=Math.max(t.length*(n/e),1),r=qx(t,i);return r||(r=t.slice(0,Math.max(Math.round(i-1),1))),r}function Yx(){var t=document.getElementById("helper-svg");return t||(t=Z("svg"),Y(t,{id:"helper-svg"}),se(t,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(t)),t}function la(t){this._config=N({},{size:Fx,padding:zx,style:{},align:"center-top"},t||{})}la.prototype.createText=function(t,e){return this.layoutText(t,e).element},la.prototype.getDimensions=function(t,e){return this.layoutText(t,e).dimensions},la.prototype.layoutText=function(t,e){var n=N({},this._config.size,e.box),i=N({},this._config.style,e.style),r=Hx(e.align||this._config.align),o=Gx(e.padding!==void 0?e.padding:this._config.padding),a=e.fitBox||!1,s=Xx(i),c=t.split(/\u00AD?\r?\n/),p=[],l=n.width-o.left-o.right,u=Z("text");Y(u,{x:0,y:0}),Y(u,i);var h=Yx();for(tt(h,u);c.length;)p.push(Wx(c,l,u));r.vertical==="middle"&&(o.top=o.bottom=0);var d=Ge(p,function(E,_,x){return E+(s||_.height)},0)+o.top+o.bottom,f=Ge(p,function(E,_,x){return _.width>E?_.width:E},0),v=o.top;r.vertical==="middle"&&(v+=(n.height-d)/2),v-=(s||p[0].height)/4;var g=Z("text");Y(g,i),k(p,function(E){var _;switch(v+=s||E.height,r.horizontal){case"left":_=o.left;break;case"right":_=(a?f:l)-o.right-E.width;break;default:_=Math.max(((a?f:l)-E.width)/2+o.left,0)}var x=Z("tspan");Y(x,{x:_,y:v}),x.textContent=E.text,tt(g,x)}),Gt(u);var R={width:f,height:d};return{dimensions:R,element:g}};function Xx(t){if("fontSize"in t&&"lineHeight"in t)return t.lineHeight*parseInt(t.fontSize,10)}var Zx=12,Qx=1.2,Jx=30;function Th(t){var e=N({fontFamily:"Arial, sans-serif",fontSize:Zx,fontWeight:"normal",lineHeight:Qx},t&&t.defaultStyle||{}),n=parseInt(e.fontSize,10)-1,i=N({},e,{fontSize:n},t&&t.externalStyle||{}),r=new la({style:e});this.getExternalLabelBounds=function(o,a){var s=r.getDimensions(a,{box:{width:90,height:30},style:i});return{x:Math.round(o.x+o.width/2-s.width/2),y:Math.round(o.y),width:Math.ceil(s.width),height:Math.ceil(s.height)}},this.getTextAnnotationBounds=function(o,a){var s=r.getDimensions(a,{box:o,style:e,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(Jx,Math.round(s.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return e},this.getExternalStyle=function(){return i}}Th.$inject=["config.textRenderer"];function t_(){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(t){return this.pathMap[t].d},this.getScaledPath=function(t,e){var n=this.pathMap[t],i,r;e.abspos?(i=e.abspos.x,r=e.abspos.y):(i=e.containerWidth*e.position.mx,r=e.containerHeight*e.position.my);var o={};if(e.position){for(var a=e.containerHeight/n.height*e.yScaleFactor,s=e.containerWidth/n.width*e.xScaleFactor,c=0;c<n.heightElements.length;c++)o["y"+c]=n.heightElements[c]*a;for(var p=0;p<n.widthElements.length;p++)o["x"+p]=n.widthElements[p]*s}var l=r_(n.d,{mx:i,my:r,e:o});return l}}var e_=/\{([^{}]+)\}/g,n_=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function i_(t,e,n){var i=n;return e.replace(n_,function(r,o,a,s,c){o=o||s,i&&(o in i&&(i=i[o]),typeof i=="function"&&c&&(i=i()))}),i=(i==null||i==n?t:i)+"",i}function r_(t,e){return String(t).replace(e_,function(n,i){return i_(n,i,e)})}const o_={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ti],textRenderer:["type",Th],pathMap:["type",t_]};function a_(t,e){return e=e||{},t.replace(/{([^}]+)}/g,function(n,i){return e[i]||"{"+i+"}"})}const ua={translate:["value",a_]};function ha(t,e,n){return N({id:t.id,type:t.$type,businessObject:t,di:e},n)}function s_(t,e,n){var i=t.waypoint;return!i||i.length<2?[nt(e),nt(n)]:i.map(function(r){return{x:r.x,y:r.y}})}function Ah(t,e,n,i){return new Error(t("element {element} referenced by {referenced}#{property} not yet drawn",{element:ye(n),referenced:ye(e),property:i}))}function On(t,e,n,i,r,o){this._eventBus=t,this._canvas=e,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}On.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],On.prototype.add=function(t,e,n){var i,r=this._translate,o,a;if(y(e,"bpmndi:BPMNPlane")){var s=y(t,"bpmn:SubProcess")?{id:t.id+"_plane"}:{};i=this._elementFactory.createRoot(ha(t,e,s)),this._canvas.addRootElement(i)}else if(y(e,"bpmndi:BPMNShape")){var c=!vt(t,e),p=p_(t);o=n&&(n.hidden||n.collapsed);var l=e.bounds;i=this._elementFactory.createShape(ha(t,e,{collapsed:c,hidden:o,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:p})),y(t,"bpmn:BoundaryEvent")&&this._attachBoundary(t,i),y(t,"bpmn:Lane")&&(a=0),y(t,"bpmn:DataStoreReference")&&(c_(n,nt(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,a)}else if(y(e,"bpmndi:BPMNEdge")){var u=this._getSource(t),h=this._getTarget(t);o=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(ha(t,e,{hidden:o,source:u,target:h,waypoints:s_(e,u,h)})),y(t,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,a)}else throw new Error(r("unknown di {di} for element {semantic}",{di:ye(e),semantic:ye(t)}));return ki(t)&&Ue(i)&&this.addLabel(t,e,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},On.prototype._attachBoundary=function(t,e){var n=this._translate,i=t.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:ye(t)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Ah(n,t,i,"attachedToRef");e.host=r,o||(r.attachers=o=[]),o.indexOf(e)===-1&&o.push(e)},On.prototype.addLabel=function(t,e,n){var i,r,o;return i=Tx(e,n),r=Ue(n),r&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(ha(t,e,{id:t.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!Ue(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)},On.prototype._getConnectedElement=function(t,e){var n,i,r=t.$type,o=this._translate;if(i=t[e+"Ref"],e==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(e==="source"&&r==="bpmn:DataOutputAssociation"||e==="target"&&r==="bpmn:DataInputAssociation")&&(i=t.$parent),n=i&&this._getElement(i),n)return n;throw i?Ah(o,t,i,e+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:ye(t),side:e}))},On.prototype._getSource=function(t){return this._getConnectedElement(t,"source")},On.prototype._getTarget=function(t){return this._getConnectedElement(t,"target")},On.prototype._getElement=function(t){return this._elementRegistry.get(t.id)};function c_(t,e){var n=e.x,i=e.y;return n>=t.x&&n<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function p_(t){return y(t,"bpmn:Group")}const l_={__depends__:[ua],bpmnImporter:["type",On]},u_={__depends__:[o_,l_]};function Mh(t){!t||typeof t.stopPropagation!="function"||t.stopPropagation()}function nr(t){return t.originalEvent||t.srcEvent}function Dc(t){Mh(t),Mh(nr(t))}function oi(t){return t.pointers&&t.pointers.length&&(t=t.pointers[0]),t.touches&&t.touches.length&&(t=t.touches[0]),t?{x:t.clientX,y:t.clientY}:null}function Dh(){return/mac/i.test(navigator.platform)}function Bh(t,e){return(nr(t)||t).button===e}function ai(t){return Bh(t,0)}function h_(t){return Bh(t,1)}function ir(t){var e=nr(t)||t;return ai(t)?Dh()?e.metaKey:e.ctrlKey:!1}function Bc(t){var e=nr(t)||t;return ai(t)&&e.shiftKey}function d_(t){return!0}function da(t){return ai(t)||h_(t)}var Nh=500;function Oh(t,e,n){var i=this;function r(B,D,$){if(!s(B,D)){var z,F,U;$?F=e.getGraphics($):(z=D.delegateTarget||D.target,z&&(F=z,$=e.get(F))),!(!F||!$)&&(U=t.fire(B,{element:$,gfx:F,originalEvent:D}),U===!1&&(D.stopPropagation(),D.preventDefault()))}}var o={};function a(B){return o[B]}function s(B,D){var $=p[B]||ai;return!$(D)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},p={"element.contextmenu":d_,"element.mousedown":da,"element.mouseup":da,"element.click":da,"element.dblclick":da};function l(B,D,$){var z=c[B];if(!z)throw new Error("unmapped DOM event name <"+B+">");return r(z,D,$)}var u="svg, .djs-element";function h(B,D,$,z){var F=o[$]=function(U){r($,U)};z&&(p[$]=z),F.$delegate=Re.bind(B,u,D,F)}function d(B,D,$){var z=a($);z&&Re.unbind(B,D,z.$delegate)}function f(B){k(c,function(D,$){h(B,$,D)})}function v(B){k(c,function(D,$){d(B,$,D)})}t.on("canvas.destroy",function(B){v(B.svg)}),t.on("canvas.init",function(B){f(B.svg)}),t.on(["shape.added","connection.added"],function(B){var D=B.element,$=B.gfx;t.fire("interactionEvents.createHit",{element:D,gfx:$})}),t.on(["shape.changed","connection.changed"],Nh,function(B){var D=B.element,$=B.gfx;t.fire("interactionEvents.updateHit",{element:D,gfx:$})}),t.on("interactionEvents.createHit",Nh,function(B){var D=B.element,$=B.gfx;i.createDefaultHit(D,$)}),t.on("interactionEvents.updateHit",function(B){var D=B.element,$=B.gfx;i.updateDefaultHit(D,$)});var g=S("djs-hit djs-hit-stroke"),R=S("djs-hit djs-hit-click-stroke"),E=S("djs-hit djs-hit-all"),_=S("djs-hit djs-hit-no-move"),x={all:E,"click-stroke":R,stroke:g,"no-move":_};function S(B,D){return D=N({stroke:"white",strokeWidth:15},D||{}),n.cls(B,["no-fill","no-border"],D)}function M(B,D){var $=x[D];if(!$)throw new Error("invalid hit type <"+D+">");return Y(B,$),B}function j(B,D){tt(B,D)}this.removeHits=function(B){var D=tc(".djs-hit",B);k(D,Gt)},this.createDefaultHit=function(B,D){var $=B.waypoints,z=B.isFrame,F;return $?this.createWaypointsHit(D,$):(F=z?"stroke":"all",this.createBoxHit(D,F,{width:B.width,height:B.height}))},this.createWaypointsHit=function(B,D){var $=Vo(D);return M($,"stroke"),j(B,$),$},this.createBoxHit=function(B,D,$){$=N({x:0,y:0},$);var z=Z("rect");return M(z,D),Y(z,$),j(B,z),z},this.updateDefaultHit=function(B,D){var $=At(".djs-hit",D);if($)return B.waypoints?xu($,B.waypoints):Y($,{width:B.width,height:B.height}),$},this.fire=r,this.triggerMouseEvent=l,this.mouseHandler=a,this.registerEvent=h,this.unregisterEvent=d}Oh.$inject=["eventBus","elementRegistry","styles"];const zr={__init__:["interactionEvents"],interactionEvents:["type",Oh]};var f_=500,m_=1e3;function Ai(t,e){this._eventBus=t,this.offset=5;var n=e.cls("djs-outline",["no-fill"]),i=this;function r(o){var a=Z("rect");return Y(a,N({x:0,y:0,rx:4,width:100,height:100},n)),a}t.on(["shape.added","shape.changed"],f_,function(o){var a=o.element,s=o.gfx,c=At(".djs-outline",s);c||(c=i.getOutline(a)||r(),tt(s,c)),i.updateShapeOutline(c,a)}),t.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=At(".djs-outline",s);c||(c=r(),tt(s,c)),i.updateConnectionOutline(c,a)})}Ai.prototype.updateShapeOutline=function(t,e){var n=!1,i=this._getProviders();i.length&&k(i,function(r){n=n||r.updateOutline(e,t)}),n||Y(t,{x:-this.offset,y:-this.offset,width:e.width+this.offset*2,height:e.height+this.offset*2})},Ai.prototype.updateConnectionOutline=function(t,e){var n=Vt(e);Y(t,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})},Ai.prototype.registerProvider=function(t,e){e||(e=t,t=m_),this._eventBus.on("outline.getProviders",t,function(n){n.providers.push(e)})},Ai.prototype._getProviders=function(){var t=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},Ai.prototype.getOutline=function(t){var e,n=this._getProviders();return k(n,function(i){pe(i.getOutline)&&(e=e||i.getOutline(t))}),e},Ai.$inject=["eventBus","styles","elementRegistry"];const jh={__init__:["outline"],outline:["type",Ai]};function rr(t,e){this._eventBus=t,this._canvas=e,this._selectedElements=[];var n=this;t.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),t.on(["diagram.clear","root.set"],function(i){n.select(null)})}rr.$inject=["eventBus","canvas"],rr.prototype.deselect=function(t){var e=this._selectedElements,n=e.indexOf(t);if(n!==-1){var i=e.slice();e.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:e})}},rr.prototype.get=function(){return this._selectedElements},rr.prototype.isSelected=function(t){return this._selectedElements.indexOf(t)!==-1},rr.prototype.select=function(t,e){var n=this._selectedElements,i=n.slice();lt(t)||(t=t?[t]:[]);var r=this._canvas,o=r.getRootElement();t=t.filter(function(a){var s=r.findRoot(a);return o===s}),e?k(t,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=t.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Lh="hover",Ih="selected",fa=6;function Nc(t,e,n){this._canvas=t;var i=this;this._multiSelectionBox=null;function r(a,s){t.addMarker(a,s)}function o(a,s){t.removeMarker(a,s)}e.on("element.hover",function(a){r(a.element,Lh)}),e.on("element.out",function(a){o(a.element,Lh)}),e.on("selection.changed",function(a){function s(u){o(u,Ih)}function c(u){r(u,Ih)}var p=a.oldSelection,l=a.newSelection;k(p,function(u){l.indexOf(u)===-1&&s(u)}),k(l,function(u){p.indexOf(u)===-1&&c(u)}),i._updateSelectionOutline(l)}),e.on("element.changed",function(a){n.isSelected(a.element)&&i._updateSelectionOutline(n.get())})}Nc.$inject=["canvas","eventBus","selection"],Nc.prototype._updateSelectionOutline=function(t){var e=this._canvas.getLayer("selectionOutline");Fo(e);var n=t.length>1,i=this._canvas.getContainer();if(ht(i)[n?"add":"remove"]("djs-multi-select"),!!n){var r=v_(Vt(t)),o=Z("rect");Y(o,N({rx:3},r)),ht(o).add("djs-selection-outline"),tt(e,o)}};function v_(t){return{x:t.x-fa,y:t.y-fa,width:t.width+fa*2,height:t.height+fa*2}}function $h(t,e,n,i){t.on("create.end",500,function(r){var o=r.context,a=o.canExecute,s=o.elements,c=o.hints||{},p=c.autoSelect;if(a){if(p===!1)return;lt(p)?e.select(p):e.select(s.filter(y_))}}),t.on("connect.end",500,function(r){var o=r.context,a=o.connection;a&&e.select(a)}),t.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id),s=yt(o,function(c){return a.id===c.id});s||e.select(a)}),t.on("element.click",function(r){if(ai(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=e.isSelected(o),s=e.get().length>1,c=ir(r)||Bc(r);if(a&&s)return c?e.deselect(o):e.select(o);a?e.deselect(o):e.select(o,c)}})}$h.$inject=["eventBus","selection","canvas","elementRegistry"];function y_(t){return!t.hidden}const bn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[zr,jh],selection:["type",rr],selectionVisuals:["type",Nc],selectionBehavior:["type",$h]};function Oc(t){this._counter=0,this._prefix=(t?t+"-":"")+Math.floor(Math.random()*1e9)+"-"}Oc.prototype.next=function(){return this._prefix+ ++this._counter};var g_=new Oc("ov"),b_=500;function ee(t,e,n,i){this._eventBus=e,this._canvas=n,this._elementRegistry=i,this._ids=g_,this._overlayDefaults=N({show:null,scale:!0},t&&t.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=x_(n.getContainer()),this._init()}ee.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ee.prototype.get=function(t){if(Me(t)&&(t={id:t}),Me(t.element)&&(t.element=this._elementRegistry.get(t.element)),t.element){var e=this._getOverlayContainer(t.element,!0);return e?t.type?ct(e.overlays,hn({type:t.type})):e.overlays.slice():[]}else return t.type?ct(this._overlays,hn({type:t.type})):t.id?this._overlays[t.id]:null},ee.prototype.add=function(t,e,n){if(oe(e)&&(n=e,e=null),t.id||(t=this._elementRegistry.get(t)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!t)throw new Error("invalid element specified");var i=this._ids.next();return n=N({},this._overlayDefaults,n,{id:i,type:e,element:t,html:n.html}),this._addOverlay(n),i},ee.prototype.remove=function(t){var e=this.get(t)||[];lt(e)||(e=[e]);var n=this;k(e,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(dn(i.html),dn(i.htmlContainer),delete i.htmlContainer,delete i.element,delete n._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})},ee.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},ee.prototype.show=function(){ma(this._overlayRoot)},ee.prototype.hide=function(){ma(this._overlayRoot,!1)},ee.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Lo(this._overlayRoot)},ee.prototype._updateOverlayContainer=function(t){var e=t.element,n=t.html,i=e.x,r=e.y;if(e.waypoints){var o=Vt(e);i=o.x,r=o.y}zh(n,i,r),fe(t.html,"data-container-id",e.id)},ee.prototype._updateOverlay=function(t){var e=t.position,n=t.htmlContainer,i=t.element,r=e.left,o=e.top;if(e.right!==void 0){var a;i.waypoints?a=Vt(i).width:a=i.width,r=e.right*-1+a}if(e.bottom!==void 0){var s;i.waypoints?s=Vt(i).height:s=i.height,o=e.bottom*-1+s}zh(n,r||0,o||0),this._updateOverlayVisibilty(t,this._canvas.viewbox())},ee.prototype._createOverlayContainer=function(t){var e=Mt('<div class="djs-overlays" />');se(e,{position:"absolute"}),this._overlayRoot.appendChild(e);var n={html:e,element:t,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ee.prototype._updateRoot=function(t){var e=t.scale||1,n="matrix("+[e,0,0,e,-1*t.x*e,-1*t.y*e].join(",")+")";Fh(this._overlayRoot,n)},ee.prototype._getOverlayContainer=function(t,e){var n=yt(this._overlayContainers,function(i){return i.element===t});return!n&&!e?this._createOverlayContainer(t):n},ee.prototype._addOverlay=function(t){var e=t.id,n=t.element,i=t.html,r,o;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Me(i)&&(i=Mt(i)),o=this._getOverlayContainer(n),r=Mt('<div class="djs-overlay" data-overlay-id="'+e+'">'),se(r,{position:"absolute"}),r.appendChild(i),t.type&&te(r).add("djs-overlay-"+t.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();ma(r,a===s),t.htmlContainer=r,o.overlays.push(t),o.html.appendChild(r),this._overlays[e]=t,this._updateOverlay(t),this._updateOverlayVisibilty(t,this._canvas.viewbox())},ee.prototype._updateOverlayVisibilty=function(t,e){var n=t.show,i=this._canvas.findRoot(t.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=t.htmlContainer,s=this._canvas.getRootElement(),c=!0;(i!==s||n&&(ae(r)&&r>e.scale||ae(o)&&o<e.scale))&&(c=!1),ma(a,c),this._updateOverlayScale(t,e)},ee.prototype._updateOverlayScale=function(t,e){var n=t.scale,i,r,o=t.htmlContainer,a,s="";n!==!0&&(n===!1?(i=1,r=1):(i=n.min,r=n.max),ae(i)&&e.scale<i&&(a=(1/e.scale||1)*i),ae(r)&&e.scale>r&&(a=(1/e.scale||1)*r)),ae(a)&&(s="scale("+a+","+a+")"),Fh(o,s)},ee.prototype._updateOverlaysVisibilty=function(t){var e=this;k(this._overlays,function(n){e._updateOverlayVisibilty(n,t)})},ee.prototype._init=function(){var t=this._eventBus,e=this;function n(i){e._updateRoot(i),e._updateOverlaysVisibilty(i),e.show()}t.on("canvas.viewbox.changing",function(i){e.hide()}),t.on("canvas.viewbox.changed",function(i){n(i.viewbox)}),t.on(["shape.remove","connection.remove"],function(i){var r=i.element,o=e.get({element:r});k(o,function(c){e.remove(c.id)});var a=e._getOverlayContainer(r);if(a){dn(a.html);var s=e._overlayContainers.indexOf(a);s!==-1&&e._overlayContainers.splice(s,1)}}),t.on("element.changed",b_,function(i){var r=i.element,o=e._getOverlayContainer(r,!0);o&&(k(o.overlays,function(a){e._updateOverlay(a)}),e._updateOverlayContainer(o))}),t.on("element.marker.update",function(i){var r=e._getOverlayContainer(i.element,!0);r&&te(r.html)[i.add?"add":"remove"](i.marker)}),t.on("root.set",function(){e._updateOverlaysVisibilty(e._canvas.viewbox())}),t.on("diagram.clear",this.clear,this)};function x_(t){var e=Mt('<div class="djs-overlay-container" />');return se(e,{position:"absolute",width:0,height:0}),t.insertBefore(e,t.firstChild),e}function zh(t,e,n){se(t,{left:e+"px",top:n+"px"})}function ma(t,e){t.style.display=e===!1?"none":""}function Fh(t,e){t.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){t.style[n+"transform"]=e})}const va={__init__:["overlays"],overlays:["type",ee]};function Hh(t,e,n,i){t.on("element.changed",function(r){var o=r.element;(o.parent||o===e.getRootElement())&&(r.gfx=n.getGraphics(o)),r.gfx&&t.fire(wu(o)+".changed",r)}),t.on("elements.changed",function(r){var o=r.elements;o.forEach(function(a){t.fire("element.changed",{element:a})}),i.updateContainments(o)}),t.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),t.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}Hh.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const jc={__init__:["changeSupport"],changeSupport:["type",Hh]};var __=1e3;function V(t){this._eventBus=t}V.$inject=["eventBus"];function E_(t,e){return function(n){return t.call(e||null,n.context,n.command,n)}}V.prototype.on=function(t,e,n,i,r,o){if((pe(e)||it(e))&&(o=r,r=i,i=n,n=e,e=null),pe(n)&&(o=r,r=i,i=n,n=__),oe(r)&&(o=r,r=!1),!pe(i))throw new Error("handlerFn must be a function");lt(t)||(t=[t]);var a=this._eventBus;k(t,function(s){var c=["commandStack",s,e].filter(function(p){return p}).join(".");a.on(c,n,r?E_(i,o):i,o)})},V.prototype.canExecute=jn("canExecute"),V.prototype.preExecute=jn("preExecute"),V.prototype.preExecuted=jn("preExecuted"),V.prototype.execute=jn("execute"),V.prototype.executed=jn("executed"),V.prototype.postExecute=jn("postExecute"),V.prototype.postExecuted=jn("postExecuted"),V.prototype.revert=jn("revert"),V.prototype.reverted=jn("reverted");function jn(t){return function(e,n,i,r,o){(pe(e)||it(e))&&(o=r,r=i,i=n,n=e,e=null),this.on(e,t,n,i,r,o)}}function Lc(t,e){e.invoke(V,this),this.executed(function(n){var i=n.context;i.rootElement?t.setRootElement(i.rootElement):i.rootElement=t.getRootElement()}),this.revert(function(n){var i=n.context;i.rootElement&&t.setRootElement(i.rootElement)})}q(Lc,V),Lc.$inject=["canvas","injector"];const w_={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Lc]};function Fr(t){return CSS.escape(t)}var S_={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ic(t){return t=""+t,t&&t.replace(/[&<>"']/g,function(e){return S_[e]})}var Gh="_plane";function Vh(t){var e=t.id;return C_(e)}function Ln(t){var e=t.id;return y(t,"bpmn:SubProcess")?Wh(e):e}function Mi(t){return Wh(t)}function $c(t){var e=gt(t);return y(e,"bpmndi:BPMNPlane")}function Wh(t){return t+Gh}function C_(t){return t.replace(new RegExp(Gh+"$"),"")}var R_="bjs-breadcrumbs-shown";function Uh(t,e,n){var i=Mt('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=te(r);r.appendChild(i);var a=[];t.on("element.changed",function(c){var p=c.element,l=W(p),u=yt(a,function(h){return h===l});u&&s()});function s(c){c&&(a=P_(c));var p=a.map(function(u){var h=Ic(u.name||u.id),d=Mt('<li><span class="bjs-crumb"><a title="'+h+'">'+h+"</a></span></li>"),f=n.findRoot(Ln(u))||n.findRoot(u.id);if(!f&&y(u,"bpmn:Process")){var v=e.find(function(g){var R=W(g);return R&&R.get("processRef")&&R.get("processRef")===u});f=n.findRoot(v.id)}return d.addEventListener("click",function(){n.setRootElement(f)}),d});i.innerHTML="";var l=p.length>1;o.toggle(R_,l),p.forEach(function(u){i.appendChild(u)})}t.on("root.set",function(c){s(c.element)})}Uh.$inject=["eventBus","elementRegistry","canvas"];function P_(t){for(var e=W(t),n=[],i=e;i;i=i.$parent)(y(i,"bpmn:SubProcess")||y(i,"bpmn:Process"))&&n.push(i);return n.reverse()}function qh(t,e){var n=null,i=new k_;t.on("root.set",function(r){var o=r.element,a=e.viewbox(),s=i.get(o);if(i.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(y(o,"bpmn:Collaboration")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,p=(a.y-s.y)*a.scale;(c!==0||p!==0)&&e.scroll({dx:c,dy:p}),s.zoom!==a.scale&&e.zoom(s.zoom,{x:0,y:0})}}),t.on("diagram.clear",function(){i.clear(),n=null})}qh.$inject=["eventBus","canvas"];function k_(){this._entries=[],this.set=function(t,e){var n=!1;for(var i in this._entries)if(this._entries[i][0]===t){this._entries[i][1]=e,n=!0;break}n||this._entries.push([t,e])},this.get=function(t){for(var e in this._entries)if(this._entries[e][0]===t)return this._entries[e][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(t){var e=-1;for(var n in this._entries)if(this._entries[n][0]===t){e=n;break}e!==-1&&this._entries.splice(e,1)}}var Kh={x:180,y:160};function Di(t,e){this._eventBus=t,this._moddle=e;var n=this;t.on("import.render.start",1500,function(i,r){n._handleImport(r.definitions)})}Di.prototype._handleImport=function(t){if(t.diagrams){var e=this;this._definitions=t,this._processToDiagramMap={},t.diagrams.forEach(function(i){!i.plane||!i.plane.bpmnElement||(e._processToDiagramMap[i.plane.bpmnElement.id]=i)});var n=[];t.diagrams.forEach(function(i){var r=e._createNewDiagrams(i.plane);Array.prototype.push.apply(n,r)}),n.forEach(function(i){e._movePlaneElementsToOrigin(i.plane)})}},Di.prototype._createNewDiagrams=function(t){var e=this,n=[],i=[];t.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;y(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),A_(a,t)&&i.push({diElement:o,parent:s})}});var r=[];return n.forEach(function(o){if(!e._processToDiagramMap[o.id]){var a=e._createDiagram(o);e._processToDiagramMap[o.id]=a,r.push(a)}}),i.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=e._processToDiagramMap[s.id];e._moveToDiPlane(a,c.plane)}}),r},Di.prototype._movePlaneElementsToOrigin=function(t){var e=t.get("planeElement"),n=T_(t),i={x:n.x-Kh.x,y:n.y-Kh.y};e.forEach(function(r){r.waypoint?r.waypoint.forEach(function(o){o.x=o.x-i.x,o.y=o.y-i.y}):r.bounds&&(r.bounds.x=r.bounds.x-i.x,r.bounds.y=r.bounds.y-i.y)})},Di.prototype._moveToDiPlane=function(t,e){var n=Yh(t),i=n.plane.get("planeElement");i.splice(i.indexOf(t),1),e.get("planeElement").push(t)},Di.prototype._createDiagram=function(t){var e=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:t}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:e});return e.$parent=n,e.bpmnElement=t,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Di.$inject=["eventBus","moddle"];function Yh(t){return y(t,"bpmndi:BPMNDiagram")?t:Yh(t.$parent)}function T_(t){var e={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return t.planeElement.forEach(function(n){if(n.bounds){var i=X(n.bounds);e.top=Math.min(i.top,e.top),e.left=Math.min(i.left,e.left)}}),Xo(e)}function A_(t,e){var n=t.$parent;return!(!y(n,"bpmn:SubProcess")||n===e.bpmnElement||dt(t,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var ya=250,M_='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>',D_="bjs-drilldown-empty";function si(t,e,n,i){V.call(this,e),this._canvas=t,this._eventBus=e,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",ya,function(o){var a=o.shape;r._canDrillDown(a)?r._addOverlay(a):r._removeOverlay(a)},!0),this.reverted("shape.toggleCollapse",ya,function(o){var a=o.shape;r._canDrillDown(a)?r._addOverlay(a):r._removeOverlay(a)},!0),this.executed(["shape.create","shape.move","shape.delete"],ya,function(o){var a=o.oldParent,s=o.newParent||o.parent,c=o.shape;r._canDrillDown(c)&&r._addOverlay(c),r._updateDrilldownOverlay(a),r._updateDrilldownOverlay(s),r._updateDrilldownOverlay(c)},!0),this.reverted(["shape.create","shape.move","shape.delete"],ya,function(o){var a=o.oldParent,s=o.newParent||o.parent,c=o.shape;r._canDrillDown(c)&&r._addOverlay(c),r._updateDrilldownOverlay(a),r._updateDrilldownOverlay(s),r._updateDrilldownOverlay(c)},!0),e.on("import.render.complete",function(){n.filter(function(o){return r._canDrillDown(o)}).map(function(o){r._addOverlay(o)})})}q(si,V),si.prototype._updateDrilldownOverlay=function(t){var e=this._canvas;if(t){var n=e.findRoot(t);n&&this._updateOverlayVisibility(n)}},si.prototype._canDrillDown=function(t){var e=this._canvas;return y(t,"bpmn:SubProcess")&&e.findRoot(Ln(t))},si.prototype._updateOverlayVisibility=function(t){var e=this._overlays,n=W(t),i=e.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;te(i.html).toggle(D_,!r)}},si.prototype._addOverlay=function(t){var e=this._canvas,n=this._overlays,i=n.get({element:t,type:"drilldown"});i.length&&this._removeOverlay(t);var r=Mt('<button class="bjs-drilldown">'+M_+"</button>");r.addEventListener("click",function(){e.setRootElement(e.findRoot(Ln(t)))}),n.add(t,"drilldown",{position:{bottom:-7,right:-8},html:r}),this._updateOverlayVisibility(t)},si.prototype._removeOverlay=function(t){var e=this._overlays;e.remove({element:t,type:"drilldown"})},si.$inject=["canvas","eventBus","elementRegistry","overlays"];const B_={__depends__:[va,jc,w_],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Uh],drilldownCentering:["type",qh],drilldownOverlayBehavior:["type",si],subprocessCompatibility:["type",Di]};function ci(t){Et.call(this,t)}q(ci,Et),ci.prototype._modules=[u_,ua,bn,va,B_],ci.prototype._moddleExtensions={};var N_=["c","C"],O_=["v","V"],j_=["y","Y"],Xh=["z","Z"];function L_(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey}function je(t){return t.altKey?!1:t.ctrlKey||t.metaKey}function ne(t,e){return t=lt(t)?t:[t],t.indexOf(e.key)!==-1||t.indexOf(e.code)!==-1}function zc(t){return t.shiftKey}function I_(t){return je(t)&&ne(N_,t)}function $_(t){return je(t)&&ne(O_,t)}function z_(t){return je(t)&&!zc(t)&&ne(Xh,t)}function F_(t){return je(t)&&(ne(j_,t)||ne(Xh,t)&&zc(t))}var ga="keyboard.keydown",H_="keyboard.keyup",Zh="input-handle-modified-keys",G_=1e3;function ce(t,e){var n=this;this._config=t||{},this._eventBus=e,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),e.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.on("diagram.init",function(){n._fire("init")}),e.on("attach",function(){t&&t.bindTo&&n.bind(t.bindTo)}),e.on("detach",function(){n.unbind()})}ce.$inject=["config.keyboard","eventBus"],ce.prototype._keydownHandler=function(t){this._keyHandler(t,ga)},ce.prototype._keyupHandler=function(t){this._keyHandler(t,H_)},ce.prototype._keyHandler=function(t,e){var n;if(!this._isEventIgnored(t)){var i={keyEvent:t};n=this._eventBus.fire(e||ga,i),n&&t.preventDefault()}},ce.prototype._isEventIgnored=function(t){return t.defaultPrevented?!0:V_(t.target)&&this._isModifiedKeyIgnored(t)},ce.prototype._isModifiedKeyIgnored=function(t){if(!je(t))return!0;var e=this._getAllowedModifiers(t.target);return e.indexOf(t.key)===-1},ce.prototype._getAllowedModifiers=function(t){var e=Mn(t,"["+Zh+"]",!0);return!e||this._node&&!this._node.contains(e)?[]:e.getAttribute(Zh).split(",")},ce.prototype.bind=function(t){this.unbind(),this._node=t,J.bind(t,"keydown",this._keydownHandler),J.bind(t,"keyup",this._keyupHandler),this._fire("bind")},ce.prototype.getBinding=function(){return this._node},ce.prototype.unbind=function(){var t=this._node;t&&(this._fire("unbind"),J.unbind(t,"keydown",this._keydownHandler),J.unbind(t,"keyup",this._keyupHandler)),this._node=null},ce.prototype._fire=function(t){this._eventBus.fire("keyboard."+t,{node:this._node})},ce.prototype.addListener=function(t,e,n){pe(t)&&(n=e,e=t,t=G_),this._eventBus.on(n||ga,t,e)},ce.prototype.removeListener=function(t,e){this._eventBus.off(e||ga,t)},ce.prototype.hasModifier=L_,ce.prototype.isCmd=je,ce.prototype.isShift=zc,ce.prototype.isKey=ne;function V_(t){return t&&(Js(t,"input, textarea")||t.contentEditable==="true")}var W_=500;function or(t,e){var n=this;t.on("editorActions.init",W_,function(i){var r=i.editorActions;n.registerBindings(e,r)})}or.$inject=["eventBus","keyboard"],or.prototype.registerBindings=function(t,e){function n(i,r){e.isRegistered(i)&&t.addListener(r)}n("undo",function(i){var r=i.keyEvent;if(z_(r))return e.trigger("undo"),!0}),n("redo",function(i){var r=i.keyEvent;if(F_(r))return e.trigger("redo"),!0}),n("copy",function(i){var r=i.keyEvent;if(I_(r))return e.trigger("copy"),!0}),n("paste",function(i){var r=i.keyEvent;if($_(r))return e.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(ne(["+","Add","="],r)&&je(r))return e.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(ne(["-","Subtract"],r)&&je(r))return e.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(ne("0",r)&&je(r))return e.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){var r=i.keyEvent;if(ne(["Backspace","Delete","Del"],r))return e.trigger("removeSelection"),!0})};const Fc={__init__:["keyboard","keyboardBindings"],keyboard:["type",ce],keyboardBindings:["type",or]};var U_={moveSpeed:50,moveSpeedAccelerated:200};function Qh(t,e,n){var i=this;this._config=N({},U_,t||{}),e.addListener(r);function r(o){var a=o.keyEvent,s=i._config;if(e.isCmd(a)&&e.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],a)){var c=e.isShift(a)?s.moveSpeedAccelerated:s.moveSpeed,p;switch(a.key){case"ArrowLeft":case"Left":p="left";break;case"ArrowUp":case"Up":p="up";break;case"ArrowRight":case"Right":p="right";break;case"ArrowDown":case"Down":p="down";break}return i.moveCanvas({speed:c,direction:p}),!0}}this.moveCanvas=function(o){var a=0,s=0,c=o.speed,p=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":a=p;break;case"up":s=p;break;case"right":a=-p;break;case"down":s=-p;break}n.scroll({dx:a,dy:s})}}Qh.$inject=["config.keyboardMove","keyboard","canvas"];const Jh={__depends__:[Fc],__init__:["keyboardMove"],keyboardMove:["type",Qh]};var q_=/^djs-cursor-.*$/;function ba(t){var e=te(document.body);e.removeMatching(q_),t&&e.add("djs-cursor-"+t)}function td(){ba(null)}var K_=5e3;function ed(t,e){e=e||"element.click";function n(){return!1}return t.once(e,K_,n),function(){t.off(e,n)}}function Hr(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function en(t,e){return{x:t.x-e.x,y:t.y-e.y}}var Y_=15;function nd(t,e){var n;t.on("element.mousedown",500,function(a){return o(a.originalEvent)});function i(a){var s=n.start,c=n.button,p=oi(a),l=en(p,s);if(!n.dragging&&X_(l)>Y_&&(n.dragging=!0,c===0&&ed(t),ba("grab")),n.dragging){var u=n.last||n.start;l=en(p,u),e.scroll({dx:l.x,dy:l.y}),n.last=p}a.preventDefault()}function r(a){J.unbind(document,"mousemove",i),J.unbind(document,"mouseup",r),n=null,td()}function o(a){if(!Mn(a.target,".djs-draggable")){var s=a.button;if(!(s>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:s,start:oi(a)},J.bind(document,"mousemove",i),J.bind(document,"mouseup",r),!0}}this.isActive=function(){return!!n}}nd.$inject=["eventBus","canvas"];function X_(t){return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}const id={__init__:["moveCanvas"],moveCanvas:["type",nd]};function Hc(t){return Math.log(t)/Math.log(10)}function rd(t,e){var n=Hc(t.min),i=Hc(t.max),r=Math.abs(n)+Math.abs(i);return r/e}function Z_(t,e){return Math.max(t.min,Math.min(t.max,e))}var Q_=Math.sign||function(t){return t>=0?1:-1},Gc={min:.2,max:4},od=10,J_=.1,t1=.75;function xn(t,e,n){t=t||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=Ce(this._handleWheel,this),this._totalDelta=0,this._scale=t.scale||t1;var i=this;e.on("canvas.init",function(r){i._init(t.enabled!==!1)})}xn.$inject=["config.zoomScroll","eventBus","canvas"],xn.prototype.scroll=function(t){this._canvas.scroll(t)},xn.prototype.reset=function(){this._canvas.zoom("fit-viewport")},xn.prototype.zoom=function(t,e){var n=rd(Gc,od*2);this._totalDelta+=t,Math.abs(this._totalDelta)>J_&&(this._zoom(t,e,n),this._totalDelta=0)},xn.prototype._handleWheel=function(t){if(!Mn(t.target,".djs-scrollable",!0)){var e=this._container;t.preventDefault();var n=t.ctrlKey||Dh()&&t.metaKey,i=t.shiftKey,r=-1*this._scale,o;if(n?r*=t.deltaMode===0?.02:.32:r*=t.deltaMode===0?1:16,n){var a=e.getBoundingClientRect(),s={x:t.clientX-a.left,y:t.clientY-a.top};o=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*Q_(t.deltaY)*r,this.zoom(o,s)}else i?o={dx:r*t.deltaY,dy:0}:o={dx:r*t.deltaX,dy:r*t.deltaY},this.scroll(o)}},xn.prototype.stepZoom=function(t,e){var n=rd(Gc,od);this._zoom(t,e,n)},xn.prototype._zoom=function(t,e,n){var i=this._canvas,r=t>0?1:-1,o=Hc(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s=Math.pow(10,a);i.zoom(Z_(Gc,s),e)},xn.prototype.toggle=function(t){var e=this._container,n=this._handleWheel,i=this._enabled;return typeof t>"u"&&(t=!i),i!==t&&J[t?"bind":"unbind"](e,"wheel",n,!1),this._enabled=t,t},xn.prototype._init=function(t){this.toggle(t)};const ad={__init__:["zoomScroll"],zoomScroll:["type",xn]};function Gr(t){ci.call(this,t)}q(Gr,ci),Gr.prototype._navigationModules=[Jh,id,ad],Gr.prototype._modules=[].concat(ci.prototype._modules,Gr.prototype._navigationModules);var sd={exports:{}};(function(t){(function(e,n,i,r){var o=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),s="function",c=Math.round,p=Math.abs,l=Date.now;function u(b,w,P){return setTimeout(_(b,P),w)}function h(b,w,P){return Array.isArray(b)?(d(b,P[w],P),!0):!1}function d(b,w,P){var I;if(b)if(b.forEach)b.forEach(w,P);else if(b.length!==r)for(I=0;I<b.length;)w.call(P,b[I],I,b),I++;else for(I in b)b.hasOwnProperty(I)&&w.call(P,b[I],I,b)}function f(b,w,P){var I="DEPRECATED METHOD: "+w+`
- `+P+` AT
- `;return function(){var H=new Error("get-stack-trace"),et=H&&H.stack?H.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",_t=e.console&&(e.console.warn||e.console.log);return _t&&_t.call(e.console,I,et),b.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(b){if(b===r||b===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(b),P=1;P<arguments.length;P++){var I=arguments[P];if(I!==r&&I!==null)for(var H in I)I.hasOwnProperty(H)&&(w[H]=I[H])}return w}:v=Object.assign;var g=f(function(b,w,P){for(var I=Object.keys(w),H=0;H<I.length;)(!P||P&&b[I[H]]===r)&&(b[I[H]]=w[I[H]]),H++;return b},"extend","Use `assign`."),R=f(function(b,w){return g(b,w,!0)},"merge","Use `assign`.");function E(b,w,P){var I=w.prototype,H;H=b.prototype=Object.create(I),H.constructor=b,H._super=I,P&&v(H,P)}function _(b,w){return function(){return b.apply(w,arguments)}}function x(b,w){return typeof b==s?b.apply(w&&w[0]||r,w):b}function S(b,w){return b===r?w:b}function M(b,w,P){d($(w),function(I){b.addEventListener(I,P,!1)})}function j(b,w,P){d($(w),function(I){b.removeEventListener(I,P,!1)})}function B(b,w){for(;b;){if(b==w)return!0;b=b.parentNode}return!1}function D(b,w){return b.indexOf(w)>-1}function $(b){return b.trim().split(/\s+/g)}function z(b,w,P){if(b.indexOf&&!P)return b.indexOf(w);for(var I=0;I<b.length;){if(P&&b[I][P]==w||!P&&b[I]===w)return I;I++}return-1}function F(b){return Array.prototype.slice.call(b,0)}function U(b,w,P){for(var I=[],H=[],et=0;et<b.length;){var _t=w?b[et][w]:b[et];z(H,_t)<0&&I.push(b[et]),H[et]=_t,et++}return P&&(w?I=I.sort(function(Ht,cn){return Ht[w]>cn[w]}):I=I.sort()),I}function ut(b,w){for(var P,I,H=w[0].toUpperCase()+w.slice(1),et=0;et<o.length;){if(P=o[et],I=P?P+H:w,I in b)return I;et++}return r}var Ie=1;function Rt(){return Ie++}function pt(b){var w=b.ownerDocument||b;return w.defaultView||w.parentWindow||e}var we=/mobile|tablet|ip(ad|hone|od)|android/i,C="ontouchstart"in e,m=ut(e,"PointerEvent")!==r,A=C&&we.test(navigator.userAgent),O="touch",T="pen",L="mouse",G="kinect",ot=25,st=1,St=2,bt=4,mt=8,ie=1,de=2,kt=4,jt=8,Se=16,$e=de|kt,ge=jt|Se,$t=$e|ge,ze=["x","y"],wt=["clientX","clientY"];function re(b,w){var P=this;this.manager=b,this.callback=w,this.element=b.element,this.target=b.options.inputTarget,this.domHandler=function(I){x(b.options.enable,[b])&&P.handler(I)},this.init()}re.prototype={handler:function(){},init:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(pt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(pt(this.element),this.evWin,this.domHandler)}};function Ls(b){var w,P=b.options.inputClass;return P?w=P:m?w=ql:A?w=zs:C?w=Kl:w=$s,new w(b,Fe)}function Fe(b,w,P){var I=P.pointers.length,H=P.changedPointers.length,et=w&st&&I-H===0,_t=w&(bt|mt)&&I-H===0;P.isFirst=!!et,P.isFinal=!!_t,et&&(b.session={}),P.eventType=w,Q(b,P),b.emit("hammer.input",P),b.recognize(P),b.session.prevInput=P}function Q(b,w){var P=b.session,I=w.pointers,H=I.length;P.firstInput||(P.firstInput=By(w)),H>1&&!P.firstMultiple?P.firstMultiple=By(w):H===1&&(P.firstMultiple=!1);var et=P.firstInput,_t=P.firstMultiple,Ht=_t?_t.center:et.center,cn=w.center=Ny(I);w.timeStamp=l(),w.deltaTime=w.timeStamp-et.timeStamp,w.angle=Ul(Ht,cn),w.distance=Is(Ht,cn),Pt(P,w),w.offsetDirection=jy(w.deltaX,w.deltaY);var He=Oy(w.deltaTime,w.deltaX,w.deltaY);w.overallVelocityX=He.x,w.overallVelocityY=He.y,w.overallVelocity=p(He.x)>p(He.y)?He.x:He.y,w.scale=_t?P2(_t.pointers,I):1,w.rotation=_t?R2(_t.pointers,I):0,w.maxPointers=P.prevInput?w.pointers.length>P.prevInput.maxPointers?w.pointers.length:P.prevInput.maxPointers:w.pointers.length,C2(P,w);var Rn=b.element;B(w.srcEvent.target,Rn)&&(Rn=w.srcEvent.target),w.target=Rn}function Pt(b,w){var P=w.center,I=b.offsetDelta||{},H=b.prevDelta||{},et=b.prevInput||{};(w.eventType===st||et.eventType===bt)&&(H=b.prevDelta={x:et.deltaX||0,y:et.deltaY||0},I=b.offsetDelta={x:P.x,y:P.y}),w.deltaX=H.x+(P.x-I.x),w.deltaY=H.y+(P.y-I.y)}function C2(b,w){var P=b.lastInterval||w,I=w.timeStamp-P.timeStamp,H,et,_t,Ht;if(w.eventType!=mt&&(I>ot||P.velocity===r)){var cn=w.deltaX-P.deltaX,He=w.deltaY-P.deltaY,Rn=Oy(I,cn,He);et=Rn.x,_t=Rn.y,H=p(Rn.x)>p(Rn.y)?Rn.x:Rn.y,Ht=jy(cn,He),b.lastInterval=w}else H=P.velocity,et=P.velocityX,_t=P.velocityY,Ht=P.direction;w.velocity=H,w.velocityX=et,w.velocityY=_t,w.direction=Ht}function By(b){for(var w=[],P=0;P<b.pointers.length;)w[P]={clientX:c(b.pointers[P].clientX),clientY:c(b.pointers[P].clientY)},P++;return{timeStamp:l(),pointers:w,center:Ny(w),deltaX:b.deltaX,deltaY:b.deltaY}}function Ny(b){var w=b.length;if(w===1)return{x:c(b[0].clientX),y:c(b[0].clientY)};for(var P=0,I=0,H=0;H<w;)P+=b[H].clientX,I+=b[H].clientY,H++;return{x:c(P/w),y:c(I/w)}}function Oy(b,w,P){return{x:w/b||0,y:P/b||0}}function jy(b,w){return b===w?ie:p(b)>=p(w)?b<0?de:kt:w<0?jt:Se}function Is(b,w,P){P||(P=ze);var I=w[P[0]]-b[P[0]],H=w[P[1]]-b[P[1]];return Math.sqrt(I*I+H*H)}function Ul(b,w,P){P||(P=ze);var I=w[P[0]]-b[P[0]],H=w[P[1]]-b[P[1]];return Math.atan2(H,I)*180/Math.PI}function R2(b,w){return Ul(w[1],w[0],wt)+Ul(b[1],b[0],wt)}function P2(b,w){return Is(w[0],w[1],wt)/Is(b[0],b[1],wt)}var k2={mousedown:st,mousemove:St,mouseup:bt},T2="mousedown",A2="mousemove mouseup";function $s(){this.evEl=T2,this.evWin=A2,this.pressed=!1,re.apply(this,arguments)}E($s,re,{handler:function(b){var w=k2[b.type];w&st&&b.button===0&&(this.pressed=!0),w&St&&b.which!==1&&(w=bt),this.pressed&&(w&bt&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[b],changedPointers:[b],pointerType:L,srcEvent:b}))}});var M2={pointerdown:st,pointermove:St,pointerup:bt,pointercancel:mt,pointerout:mt},D2={2:O,3:T,4:L,5:G},Ly="pointerdown",Iy="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Ly="MSPointerDown",Iy="MSPointerMove MSPointerUp MSPointerCancel");function ql(){this.evEl=Ly,this.evWin=Iy,re.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}E(ql,re,{handler:function(b){var w=this.store,P=!1,I=b.type.toLowerCase().replace("ms",""),H=M2[I],et=D2[b.pointerType]||b.pointerType,_t=et==O,Ht=z(w,b.pointerId,"pointerId");H&st&&(b.button===0||_t)?Ht<0&&(w.push(b),Ht=w.length-1):H&(bt|mt)&&(P=!0),!(Ht<0)&&(w[Ht]=b,this.callback(this.manager,H,{pointers:w,changedPointers:[b],pointerType:et,srcEvent:b}),P&&w.splice(Ht,1))}});var B2={touchstart:st,touchmove:St,touchend:bt,touchcancel:mt},N2="touchstart",O2="touchstart touchmove touchend touchcancel";function $y(){this.evTarget=N2,this.evWin=O2,this.started=!1,re.apply(this,arguments)}E($y,re,{handler:function(b){var w=B2[b.type];if(w===st&&(this.started=!0),!!this.started){var P=j2.call(this,b,w);w&(bt|mt)&&P[0].length-P[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:P[0],changedPointers:P[1],pointerType:O,srcEvent:b})}}});function j2(b,w){var P=F(b.touches),I=F(b.changedTouches);return w&(bt|mt)&&(P=U(P.concat(I),"identifier",!0)),[P,I]}var L2={touchstart:st,touchmove:St,touchend:bt,touchcancel:mt},I2="touchstart touchmove touchend touchcancel";function zs(){this.evTarget=I2,this.targetIds={},re.apply(this,arguments)}E(zs,re,{handler:function(b){var w=L2[b.type],P=$2.call(this,b,w);P&&this.callback(this.manager,w,{pointers:P[0],changedPointers:P[1],pointerType:O,srcEvent:b})}});function $2(b,w){var P=F(b.touches),I=this.targetIds;if(w&(st|St)&&P.length===1)return I[P[0].identifier]=!0,[P,P];var H,et,_t=F(b.changedTouches),Ht=[],cn=this.target;if(et=P.filter(function(He){return B(He.target,cn)}),w===st)for(H=0;H<et.length;)I[et[H].identifier]=!0,H++;for(H=0;H<_t.length;)I[_t[H].identifier]&&Ht.push(_t[H]),w&(bt|mt)&&delete I[_t[H].identifier],H++;if(Ht.length)return[U(et.concat(Ht),"identifier",!0),Ht]}var z2=2500,zy=25;function Kl(){re.apply(this,arguments);var b=_(this.handler,this);this.touch=new zs(this.manager,b),this.mouse=new $s(this.manager,b),this.primaryTouch=null,this.lastTouches=[]}E(Kl,re,{handler:function(b,w,P){var I=P.pointerType==O,H=P.pointerType==L;if(!(H&&P.sourceCapabilities&&P.sourceCapabilities.firesTouchEvents)){if(I)F2.call(this,w,P);else if(H&&H2.call(this,P))return;this.callback(b,w,P)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function F2(b,w){b&st?(this.primaryTouch=w.changedPointers[0].identifier,Fy.call(this,w)):b&(bt|mt)&&Fy.call(this,w)}function Fy(b){var w=b.changedPointers[0];if(w.identifier===this.primaryTouch){var P={x:w.clientX,y:w.clientY};this.lastTouches.push(P);var I=this.lastTouches,H=function(){var et=I.indexOf(P);et>-1&&I.splice(et,1)};setTimeout(H,z2)}}function H2(b){for(var w=b.srcEvent.clientX,P=b.srcEvent.clientY,I=0;I<this.lastTouches.length;I++){var H=this.lastTouches[I],et=Math.abs(w-H.x),_t=Math.abs(P-H.y);if(et<=zy&&_t<=zy)return!0}return!1}var Hy=ut(a.style,"touchAction"),Gy=Hy!==r,Vy="compute",Wy="auto",Yl="manipulation",Wi="none",Ao="pan-x",Mo="pan-y",Fs=V2();function Xl(b,w){this.manager=b,this.set(w)}Xl.prototype={set:function(b){b==Vy&&(b=this.compute()),Gy&&this.manager.element.style&&Fs[b]&&(this.manager.element.style[Hy]=b),this.actions=b.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var b=[];return d(this.manager.recognizers,function(w){x(w.options.enable,[w])&&(b=b.concat(w.getTouchAction()))}),G2(b.join(" "))},preventDefaults:function(b){var w=b.srcEvent,P=b.offsetDirection;if(this.manager.session.prevented){w.preventDefault();return}var I=this.actions,H=D(I,Wi)&&!Fs[Wi],et=D(I,Mo)&&!Fs[Mo],_t=D(I,Ao)&&!Fs[Ao];if(H){var Ht=b.pointers.length===1,cn=b.distance<2,He=b.deltaTime<250;if(Ht&&cn&&He)return}if(!(_t&&et)&&(H||et&&P&$e||_t&&P&ge))return this.preventSrc(w)},preventSrc:function(b){this.manager.session.prevented=!0,b.preventDefault()}};function G2(b){if(D(b,Wi))return Wi;var w=D(b,Ao),P=D(b,Mo);return w&&P?Wi:w||P?w?Ao:Mo:D(b,Yl)?Yl:Wy}function V2(){if(!Gy)return!1;var b={},w=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(P){b[P]=w?e.CSS.supports("touch-action",P):!0}),b}var Hs=1,tn=2,_r=4,Ei=8,Un=Ei,Do=16,Cn=32;function qn(b){this.options=v({},this.defaults,b||{}),this.id=Rt(),this.manager=null,this.options.enable=S(this.options.enable,!0),this.state=Hs,this.simultaneous={},this.requireFail=[]}qn.prototype={defaults:{},set:function(b){return v(this.options,b),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(b){if(h(b,"recognizeWith",this))return this;var w=this.simultaneous;return b=Gs(b,this),w[b.id]||(w[b.id]=b,b.recognizeWith(this)),this},dropRecognizeWith:function(b){return h(b,"dropRecognizeWith",this)?this:(b=Gs(b,this),delete this.simultaneous[b.id],this)},requireFailure:function(b){if(h(b,"requireFailure",this))return this;var w=this.requireFail;return b=Gs(b,this),z(w,b)===-1&&(w.push(b),b.requireFailure(this)),this},dropRequireFailure:function(b){if(h(b,"dropRequireFailure",this))return this;b=Gs(b,this);var w=z(this.requireFail,b);return w>-1&&this.requireFail.splice(w,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(b){return!!this.simultaneous[b.id]},emit:function(b){var w=this,P=this.state;function I(H){w.manager.emit(H,b)}P<Ei&&I(w.options.event+Uy(P)),I(w.options.event),b.additionalEvent&&I(b.additionalEvent),P>=Ei&&I(w.options.event+Uy(P))},tryEmit:function(b){if(this.canEmit())return this.emit(b);this.state=Cn},canEmit:function(){for(var b=0;b<this.requireFail.length;){if(!(this.requireFail[b].state&(Cn|Hs)))return!1;b++}return!0},recognize:function(b){var w=v({},b);if(!x(this.options.enable,[this,w])){this.reset(),this.state=Cn;return}this.state&(Un|Do|Cn)&&(this.state=Hs),this.state=this.process(w),this.state&(tn|_r|Ei|Do)&&this.tryEmit(w)},process:function(b){},getTouchAction:function(){},reset:function(){}};function Uy(b){return b&Do?"cancel":b&Ei?"end":b&_r?"move":b&tn?"start":""}function qy(b){return b==Se?"down":b==jt?"up":b==de?"left":b==kt?"right":""}function Gs(b,w){var P=w.manager;return P?P.get(b):b}function sn(){qn.apply(this,arguments)}E(sn,qn,{defaults:{pointers:1},attrTest:function(b){var w=this.options.pointers;return w===0||b.pointers.length===w},process:function(b){var w=this.state,P=b.eventType,I=w&(tn|_r),H=this.attrTest(b);return I&&(P&mt||!H)?w|Do:I||H?P&bt?w|Ei:w&tn?w|_r:tn:Cn}});function Vs(){sn.apply(this,arguments),this.pX=null,this.pY=null}E(Vs,sn,{defaults:{event:"pan",threshold:10,pointers:1,direction:$t},getTouchAction:function(){var b=this.options.direction,w=[];return b&$e&&w.push(Mo),b&ge&&w.push(Ao),w},directionTest:function(b){var w=this.options,P=!0,I=b.distance,H=b.direction,et=b.deltaX,_t=b.deltaY;return H&w.direction||(w.direction&$e?(H=et===0?ie:et<0?de:kt,P=et!=this.pX,I=Math.abs(b.deltaX)):(H=_t===0?ie:_t<0?jt:Se,P=_t!=this.pY,I=Math.abs(b.deltaY))),b.direction=H,P&&I>w.threshold&&H&w.direction},attrTest:function(b){return sn.prototype.attrTest.call(this,b)&&(this.state&tn||!(this.state&tn)&&this.directionTest(b))},emit:function(b){this.pX=b.deltaX,this.pY=b.deltaY;var w=qy(b.direction);w&&(b.additionalEvent=this.options.event+w),this._super.emit.call(this,b)}});function Zl(){sn.apply(this,arguments)}E(Zl,sn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Wi]},attrTest:function(b){return this._super.attrTest.call(this,b)&&(Math.abs(b.scale-1)>this.options.threshold||this.state&tn)},emit:function(b){if(b.scale!==1){var w=b.scale<1?"in":"out";b.additionalEvent=this.options.event+w}this._super.emit.call(this,b)}});function Ql(){qn.apply(this,arguments),this._timer=null,this._input=null}E(Ql,qn,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Wy]},process:function(b){var w=this.options,P=b.pointers.length===w.pointers,I=b.distance<w.threshold,H=b.deltaTime>w.time;if(this._input=b,!I||!P||b.eventType&(bt|mt)&&!H)this.reset();else if(b.eventType&st)this.reset(),this._timer=u(function(){this.state=Un,this.tryEmit()},w.time,this);else if(b.eventType&bt)return Un;return Cn},reset:function(){clearTimeout(this._timer)},emit:function(b){this.state===Un&&(b&&b.eventType&bt?this.manager.emit(this.options.event+"up",b):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Jl(){sn.apply(this,arguments)}E(Jl,sn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Wi]},attrTest:function(b){return this._super.attrTest.call(this,b)&&(Math.abs(b.rotation)>this.options.threshold||this.state&tn)}});function tu(){sn.apply(this,arguments)}E(tu,sn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:$e|ge,pointers:1},getTouchAction:function(){return Vs.prototype.getTouchAction.call(this)},attrTest:function(b){var w=this.options.direction,P;return w&($e|ge)?P=b.overallVelocity:w&$e?P=b.overallVelocityX:w&ge&&(P=b.overallVelocityY),this._super.attrTest.call(this,b)&&w&b.offsetDirection&&b.distance>this.options.threshold&&b.maxPointers==this.options.pointers&&p(P)>this.options.velocity&&b.eventType&bt},emit:function(b){var w=qy(b.offsetDirection);w&&this.manager.emit(this.options.event+w,b),this.manager.emit(this.options.event,b)}});function Ws(){qn.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}E(Ws,qn,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Yl]},process:function(b){var w=this.options,P=b.pointers.length===w.pointers,I=b.distance<w.threshold,H=b.deltaTime<w.time;if(this.reset(),b.eventType&st&&this.count===0)return this.failTimeout();if(I&&H&&P){if(b.eventType!=bt)return this.failTimeout();var et=this.pTime?b.timeStamp-this.pTime<w.interval:!0,_t=!this.pCenter||Is(this.pCenter,b.center)<w.posThreshold;this.pTime=b.timeStamp,this.pCenter=b.center,!_t||!et?this.count=1:this.count+=1,this._input=b;var Ht=this.count%w.taps;if(Ht===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=Un,this.tryEmit()},w.interval,this),tn):Un}return Cn},failTimeout:function(){return this._timer=u(function(){this.state=Cn},this.options.interval,this),Cn},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Un&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Kn(b,w){return w=w||{},w.recognizers=S(w.recognizers,Kn.defaults.preset),new eu(b,w)}Kn.VERSION="2.0.7",Kn.defaults={domEvents:!1,touchAction:Vy,enable:!0,inputTarget:null,inputClass:null,preset:[[Jl,{enable:!1}],[Zl,{enable:!1},["rotate"]],[tu,{direction:$e}],[Vs,{direction:$e},["swipe"]],[Ws],[Ws,{event:"doubletap",taps:2},["tap"]],[Ql]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var W2=1,Ky=2;function eu(b,w){this.options=v({},Kn.defaults,w||{}),this.options.inputTarget=this.options.inputTarget||b,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=b,this.input=Ls(this),this.touchAction=new Xl(this,this.options.touchAction),Yy(this,!0),d(this.options.recognizers,function(P){var I=this.add(new P[0](P[1]));P[2]&&I.recognizeWith(P[2]),P[3]&&I.requireFailure(P[3])},this)}eu.prototype={set:function(b){return v(this.options,b),b.touchAction&&this.touchAction.update(),b.inputTarget&&(this.input.destroy(),this.input.target=b.inputTarget,this.input.init()),this},stop:function(b){this.session.stopped=b?Ky:W2},recognize:function(b){var w=this.session;if(!w.stopped){this.touchAction.preventDefaults(b);var P,I=this.recognizers,H=w.curRecognizer;(!H||H&&H.state&Un)&&(H=w.curRecognizer=null);for(var et=0;et<I.length;)P=I[et],w.stopped!==Ky&&(!H||P==H||P.canRecognizeWith(H))?P.recognize(b):P.reset(),!H&&P.state&(tn|_r|Ei)&&(H=w.curRecognizer=P),et++}},get:function(b){if(b instanceof qn)return b;for(var w=this.recognizers,P=0;P<w.length;P++)if(w[P].options.event==b)return w[P];return null},add:function(b){if(h(b,"add",this))return this;var w=this.get(b.options.event);return w&&this.remove(w),this.recognizers.push(b),b.manager=this,this.touchAction.update(),b},remove:function(b){if(h(b,"remove",this))return this;if(b=this.get(b),b){var w=this.recognizers,P=z(w,b);P!==-1&&(w.splice(P,1),this.touchAction.update())}return this},on:function(b,w){if(b!==r&&w!==r){var P=this.handlers;return d($(b),function(I){P[I]=P[I]||[],P[I].push(w)}),this}},off:function(b,w){if(b!==r){var P=this.handlers;return d($(b),function(I){w?P[I]&&P[I].splice(z(P[I],w),1):delete P[I]}),this}},emit:function(b,w){this.options.domEvents&&U2(b,w);var P=this.handlers[b]&&this.handlers[b].slice();if(!(!P||!P.length)){w.type=b,w.preventDefault=function(){w.srcEvent.preventDefault()};for(var I=0;I<P.length;)P[I](w),I++}},destroy:function(){this.element&&Yy(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Yy(b,w){var P=b.element;if(P.style){var I;d(b.options.cssProps,function(H,et){I=ut(P.style,et),w?(b.oldCssProps[I]=P.style[I],P.style[I]=H):P.style[I]=b.oldCssProps[I]||""}),w||(b.oldCssProps={})}}function U2(b,w){var P=n.createEvent("Event");P.initEvent(b,!0,!0),P.gesture=w,w.target.dispatchEvent(P)}v(Kn,{INPUT_START:st,INPUT_MOVE:St,INPUT_END:bt,INPUT_CANCEL:mt,STATE_POSSIBLE:Hs,STATE_BEGAN:tn,STATE_CHANGED:_r,STATE_ENDED:Ei,STATE_RECOGNIZED:Un,STATE_CANCELLED:Do,STATE_FAILED:Cn,DIRECTION_NONE:ie,DIRECTION_LEFT:de,DIRECTION_RIGHT:kt,DIRECTION_UP:jt,DIRECTION_DOWN:Se,DIRECTION_HORIZONTAL:$e,DIRECTION_VERTICAL:ge,DIRECTION_ALL:$t,Manager:eu,Input:re,TouchAction:Xl,TouchInput:zs,MouseInput:$s,PointerEventInput:ql,TouchMouseInput:Kl,SingleTouchInput:$y,Recognizer:qn,AttrRecognizer:sn,Tap:Ws,Pan:Vs,Swipe:tu,Pinch:Zl,Rotate:Jl,Press:Ql,on:M,off:j,each:d,merge:R,extend:g,assign:v,inherit:E,bindFn:_,prefixed:ut});var q2=typeof e<"u"?e:typeof self<"u"?self:{};q2.Hammer=Kn,typeof r=="function"&&r.amd?r(function(){return Kn}):t.exports?t.exports=Kn:e[i]=Kn})(window,document,"Hammer")})(sd);var e1=sd.exports;const Bi=qs(e1);var n1=.2,i1=4,cd=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function xa(t,e){return e.get(t,!1)}function Vc(t){t.preventDefault(),typeof t.stopPropagation=="function"?t.stopPropagation():t.srcEvent&&typeof t.srcEvent.stopPropagation=="function"&&t.srcEvent.stopPropagation(),typeof t.stopImmediatePropagation=="function"&&t.stopImmediatePropagation()}function Wc(t){function e(p){k(cd,function(l){J.bind(t,l,Vc,!0)})}function n(p){setTimeout(function(){k(cd,function(l){J.unbind(t,l,Vc,!0)})},500)}J.bind(t,"touchstart",e,!0),J.bind(t,"touchend",n,!0),J.bind(t,"touchcancel",n,!0);var i=new Bi.Manager(t,{inputClass:Bi.TouchInput,recognizers:[],domEvents:!0}),r=new Bi.Tap,o=new Bi.Pan({threshold:10}),a=new Bi.Press,s=new Bi.Pinch,c=new Bi.Tap({event:"doubletap",taps:2});return s.requireFailure(o),s.requireFailure(a),i.add([o,a,s,c,r]),i.reset=function(p){var l=this.recognizers,u=this.session;u.stopped||(i.stop(p),setTimeout(function(){var h,d;for(h=0;d=l[h];h++)d.reset(),d.state=8;u.curRecognizer=null},0))},i.on("hammer.input",function(p){p.srcEvent.defaultPrevented&&i.reset(!0)}),i}function pd(t,e,n,i,r){var o=xa("dragging",t),a=xa("move",t),s=xa("contextPad",t),c=xa("palette",t),p;function l(d,f){return function(v){var g=u(v.target),R=g&&i.get(g);return f&&(v.srcEvent.button=f),r.fire(d,v,R)}}function u(d){var f=Mn(d,"svg, .djs-element",!0);return f}function h(d){p=Wc(d);function f(R){var E=0,_=0;function x(M){var j=M.deltaX-E,B=M.deltaY-_;e.scroll({dx:j,dy:B}),E=M.deltaX,_=M.deltaY}function S(M){p.off("panmove",x),p.off("panend",S),p.off("pancancel",S)}p.on("panmove",x),p.on("panend",S),p.on("pancancel",S)}function v(R){var E=u(R.target),_=E&&i.get(E);if(a&&e.getRootElement()!==_)return a.start(R,_,!0);f()}function g(R){var E=e.zoom(),_=R.center;function x(M){var j=1-(1-M.scale)/1.5,B=Math.max(n1,Math.min(i1,j*E));e.zoom(B,_),Vc(M)}function S(M){p.off("pinchmove",x),p.off("pinchend",S),p.off("pinchcancel",S),p.reset(!0)}p.on("pinchmove",x),p.on("pinchend",S),p.on("pinchcancel",S)}p.on("tap",l("element.click")),p.on("doubletap",l("element.dblclick",1)),p.on("panstart",v),p.on("press",v),p.on("pinchstart",g)}o&&n.on("drag.move",function(d){var f=d.originalEvent;if(!(!f||f instanceof MouseEvent)){var v=oi(f),g=document.elementFromPoint(v.x,v.y),R=u(g),E=R&&i.get(R);E!==d.hover&&(d.hover&&o.out(d),E&&(o.hover({element:E,gfx:R}),d.hover=E,d.hoverGfx=R))}}),s&&n.on("contextPad.create",function(d){var f=d.pad.html,v=Wc(f);v.on("panstart",function(g){s.trigger("dragstart",g,!0)}),v.on("press",function(g){s.trigger("dragstart",g,!0)}),v.on("tap",function(g){s.trigger("click",g)})}),c&&n.on("palette.create",function(d){var f=d.container,v=Wc(f);v.on("panstart",function(g){c.trigger("dragstart",g,!0)}),v.on("press",function(g){c.trigger("dragstart",g,!0)}),v.on("tap",function(g){c.trigger("click",g)})}),n.on("canvas.init",function(d){h(d.svg)})}pd.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"];function Uc(t){var e=this;t.on("canvas.init",function(n){e.addBBoxMarker(n.svg)})}Uc.$inject=["eventBus"],Uc.prototype.addBBoxMarker=function(t){var e={fill:"none",class:"outer-bound-marker"},n=Z("rect");Y(n,{x:-1e4,y:1e4,width:10,height:10}),Y(n,e),tt(t,n);var i=Z("rect");Y(i,{x:1e4,y:1e4,width:10,height:10}),Y(i,e),tt(t,i)};const r1={__depends__:[zr],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",pd],touchFix:["type",Uc]},o1={__depends__:[r1]};function qc(t){return t&&t[t.length-1]}function ld(t){return t.y}function ud(t){return t.x}var a1={left:ud,center:ud,right:function(t){return t.x+t.width},top:ld,middle:ld,bottom:function(t){return t.y+t.height}};function ar(t,e){this._modeling=t,this._rules=e}ar.$inject=["modeling","rules"],ar.prototype._getOrientationDetails=function(t){var e=["top","bottom","middle"],n="x",i="width";return e.indexOf(t)!==-1&&(n="y",i="height"),{axis:n,dimension:i}},ar.prototype._isType=function(t,e){return e.indexOf(t)!==-1},ar.prototype._alignmentPosition=function(t,e){var n=this._getOrientationDetails(t),i=n.axis,r=n.dimension,o={},a={},s=!1,c,p,l;function u(h,d){return Math.round((h[i]+d[i]+d[r])/2)}if(this._isType(t,["left","top"]))o[t]=e[0][i];else if(this._isType(t,["right","bottom"]))l=qc(e),o[t]=l[i]+l[r];else if(this._isType(t,["center","middle"])){if(k(e,function(h){var d=h[i]+Math.round(h[r]/2);a[d]?a[d].elements.push(h):a[d]={elements:[h],center:d}}),c=ln(a,function(h){return h.elements.length>1&&(s=!0),h.elements.length}),s)return o[t]=qc(c).center,o;p=e[0],e=ln(e,function(h){return h[i]+h[r]}),l=qc(e),o[t]=u(p,l)}return o},ar.prototype.trigger=function(t,e){var n=this._modeling,i,r=ct(t,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(i=this._rules.allowed("elements.align",{elements:r}),lt(i)&&(r=i),!(r.length<2||!i)){var o=a1[e],a=ln(r,o),s=this._alignmentPosition(e,a);n.alignElements(a,s)}};const s1={__init__:["alignElements"],alignElements:["type",ar]};var _a=".entry",c1=1e3,hd=12,p1=300;function _e(t,e,n,i){this._canvas=t,this._eventBus=n,this._overlays=i;var r=ae(e&&e.scale)?e.scale:{min:1,max:1.5};this._overlaysConfig={scale:r},this._current=null,this._init()}_e.$inject=["canvas","config.contextPad","eventBus","overlays"],_e.prototype._init=function(){var t=this;this._eventBus.on("selection.changed",function(e){var n=e.newSelection,i=n.length?n.length===1?n[0]:n:null;i?t.open(i,!0):t.close()}),this._eventBus.on("elements.changed",function(e){var n=e.elements,i=t._current;if(i){var r=i.target,o=kn(lt(r)?r:[r],function(a){return dd(n,a)});o&&t.open(r,!0)}})},_e.prototype.registerProvider=function(t,e){e||(e=t,t=c1),this._eventBus.on("contextPad.getProviders",t,function(n){n.providers.push(e)})},_e.prototype.getEntries=function(t){var e=this._getProviders(),n=lt(t)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return k(e,function(r){if(pe(r[n])){var o=r[n](t);pe(o)?i=o(i):k(o,function(a,s){i[s]=a})}}),i},_e.prototype.trigger=function(t,e,n){var i,r,o=e.delegateTarget||e.target;return o?(i=fe(o,"data-action"),r=e.originalEvent||e,t==="mouseover"?this._timeout=setTimeout(()=>{this._mouseout=this.triggerEntry(i,"hover",r,n)},p1):t==="mouseout"&&(clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null)),this.triggerEntry(i,t,r,n)):e.preventDefault()},_e.prototype.triggerEntry=function(t,e,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries,a=o[t];if(a){var s=a.action;if(this._eventBus.fire("contextPad.trigger",{entry:a,event:n})!==!1){if(pe(s)){if(e==="click")return s(n,r,i)}else if(s[e])return s[e](n,r,i);n.preventDefault()}}}},_e.prototype.open=function(t,e){!e&&this.isOpen(t)||(this.close(),this._updateAndOpen(t))},_e.prototype._getProviders=function(){var t=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},_e.prototype._updateAndOpen=function(t){var e=this.getEntries(t),n=this.getPad(t),i=n.html,r;k(e,function(o,a){var s=o.group||"default",c=Mt(o.html||'<div class="entry" draggable="true"></div>'),p;fe(c,"data-action",a),p=At("[data-group="+Fr(s)+"]",i),p||(p=Mt('<div class="group"></div>'),fe(p,"data-group",s),i.appendChild(p)),p.appendChild(c),o.className&&l1(c,o.className),o.title&&fe(c,"title",o.title),o.imageUrl&&(r=Mt("<img>"),fe(r,"src",o.imageUrl),r.style.width="100%",r.style.height="100%",c.appendChild(r))}),te(i).add("open"),this._current={target:t,entries:e,pad:n},this._eventBus.fire("contextPad.open",{current:this._current})},_e.prototype.getPad=function(t){if(this.isOpen())return this._current.pad;var e=this,n=this._overlays,i=Mt('<div class="djs-context-pad"></div>'),r=this._getPosition(t),o=N({html:i},this._overlaysConfig,r);Re.bind(i,_a,"click",function(c){e.trigger("click",c)}),Re.bind(i,_a,"dragstart",function(c){e.trigger("dragstart",c)}),Re.bind(i,_a,"mouseover",function(c){e.trigger("mouseover",c)}),Re.bind(i,_a,"mouseout",function(c){e.trigger("mouseout",c)}),J.bind(i,"mousedown",function(c){c.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:t,pad:s}),s},_e.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)},_e.prototype.isOpen=function(t){var e=this._current;if(!e)return!1;if(!t)return!0;var n=e.target;return lt(t)!==lt(n)?!1:lt(t)?t.length===n.length&&No(t,function(i){return dd(n,i)}):n===t},_e.prototype.isShown=function(){return this.isOpen()&&this._overlays.isShown()},_e.prototype._getPosition=function(t){t=Dt(t)?u1(t):t;var e=lt(t)?t:[t],n=Vt(e);return{position:{left:n.x+n.width+hd,top:n.y-hd/2}}};function l1(t,e){var n=te(t);e=lt(e)?e:e.split(/\s+/g),e.forEach(function(i){n.add(i)})}function dd(t,e){return t.indexOf(e)!==-1}function u1(t){return t.waypoints[t.waypoints.length-1]}const fd={__depends__:[zr,va],contextPad:["type",_e]};var md=function(t,e,n,i){var r;e[0]=0;for(var o=1;o<e.length;o++){var a=e[o++],s=e[o]?(e[0]|=a?1:2,n[e[o++]]):e[++o];a===3?i[0]=s:a===4?i[1]=Object.assign(i[1]||{},s):a===5?(i[1]=i[1]||{})[e[++o]]=s:a===6?i[1][e[++o]]+=s+"":a?(r=t.apply(s,md(t,s,n,["",null])),i.push(r),s[0]?e[0]|=2:(e[o-2]=0,e[o]=r)):i.push(s)}return i},vd=new Map;function h1(t){var e=vd.get(this);return e||(e=new Map,vd.set(this,e)),(e=md(this,e.get(t)||(e.set(t,e=function(n){for(var i,r,o=1,a="",s="",c=[0],p=function(h){o===1&&(h||(a=a.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?c.push(0,h,a):o===3&&(h||a)?(c.push(3,h,a),o=2):o===2&&a==="..."&&h?c.push(4,h,0):o===2&&a&&!h?c.push(5,0,!0,a):o>=5&&((a||!h&&o===5)&&(c.push(o,0,a,r),o=6),h&&(c.push(o,h,0,r),o=6)),a=""},l=0;l<n.length;l++){l&&(o===1&&p(),p(l));for(var u=0;u<n[l].length;u++)i=n[l][u],o===1?i==="<"?(p(),c=[c],o=3):a+=i:o===4?a==="--"&&i===">"?(o=1,a=""):a=i+a[0]:s?i===s?s="":a+=i:i==='"'||i==="'"?s=i:i===">"?(p(),o=1):o&&(i==="="?(o=5,r=a,a=""):i==="/"&&(o<5||n[l][u+1]===">")?(p(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):i===" "||i===" "||i===`
- `||i==="\r"?(p(),o=2):a+=i),o===3&&a==="!--"&&(o=4,c=c[0])}return p(),c}(t)),e),arguments,[])).length>1?e:e[0]}var Qt=h1.bind(ik),sr,qt,Kc,yd,Vr=0,gd=[],Ea=[],Jt=rk,bd=Jt.__b,xd=Jt.__r,_d=Jt.diffed,Ed=Jt.__c,wd=Jt.unmount,Sd=Jt.__;function wa(t,e){Jt.__h&&Jt.__h(qt,t,Vr||e),Vr=0;var n=qt.__H||(qt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:Ea}),n.__[t]}function Yc(t){return Vr=1,d1(Rd,t)}function d1(t,e,n){var i=wa(sr++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):Rd(void 0,e),function(s){var c=i.__N?i.__N[0]:i.__[0],p=i.t(c,s);c!==p&&(i.__N=[p,i.__[1]],i.__c.setState({}))}],i.__c=qt,!qt.u)){var r=function(s,c,p){if(!i.__c.__H)return!0;var l=i.__c.__H.__.filter(function(h){return!!h.__c});if(l.every(function(h){return!h.__N}))return!o||o.call(this,s,c,p);var u=!1;return l.forEach(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(u=!0)}}),!(!u&&i.__c.props===s)&&(!o||o.call(this,s,c,p))};qt.u=!0;var o=qt.shouldComponentUpdate,a=qt.componentWillUpdate;qt.componentWillUpdate=function(s,c,p){if(this.__e){var l=o;o=void 0,r(s,c,p),o=l}a&&a.call(this,s,c,p)},qt.shouldComponentUpdate=r}return i.__N||i.__}function Xc(t,e){var n=wa(sr++,3);!Jt.__s&&Jc(n.__H,e)&&(n.__=t,n.i=e,qt.__H.__h.push(n))}function Sa(t,e){var n=wa(sr++,4);!Jt.__s&&Jc(n.__H,e)&&(n.__=t,n.i=e,qt.__h.push(n))}function Zc(t){return Vr=5,Wr(function(){return{current:t}},[])}function Wr(t,e){var n=wa(sr++,7);return Jc(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function cr(t,e){return Vr=8,Wr(function(){return t},e)}function f1(){for(var t;t=gd.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ca),t.__H.__h.forEach(Qc),t.__H.__h=[]}catch(e){t.__H.__h=[],Jt.__e(e,t.__v)}}Jt.__b=function(t){qt=null,bd&&bd(t)},Jt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Sd&&Sd(t,e)},Jt.__r=function(t){xd&&xd(t),sr=0;var e=(qt=t.__c).__H;e&&(Kc===qt?(e.__h=[],qt.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Ea,n.__N=n.i=void 0})):(e.__h.forEach(Ca),e.__h.forEach(Qc),e.__h=[],sr=0)),Kc=qt},Jt.diffed=function(t){_d&&_d(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(gd.push(e)!==1&&yd===Jt.requestAnimationFrame||((yd=Jt.requestAnimationFrame)||m1)(f1)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Ea&&(n.__=n.__V),n.i=void 0,n.__V=Ea})),Kc=qt=null},Jt.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Ca),n.__h=n.__h.filter(function(i){return!i.__||Qc(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Jt.__e(i,n.__v)}}),Ed&&Ed(t,e)},Jt.unmount=function(t){wd&&wd(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{Ca(i)}catch(r){e=r}}),n.__H=void 0,e&&Jt.__e(e,n.__v))};var Cd=typeof requestAnimationFrame=="function";function m1(t){var e,n=function(){clearTimeout(i),Cd&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);Cd&&(e=requestAnimationFrame(n))}function Ca(t){var e=qt,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),qt=e}function Qc(t){var e=qt;t.__c=t.__(),qt=e}function Jc(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function Rd(t,e){return typeof e=="function"?e(t):e}function Pd(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=Pd(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function Ra(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=Pd(t))&&(i&&(i+=" "),i+=e);return i}function v1(t){const{entry:e,selected:n,onMouseEnter:i,onMouseLeave:r,onAction:o}=t;return Qt`
- <li
- class=${Ra("entry",{selected:n})}
- data-id=${e.id}
- title=${e.title||e.label}
- onClick=${o}
- onMouseEnter=${i}
- onMouseLeave=${r}
- onDragStart=${a=>o(a,e,"dragstart")}
- draggable=${!0}
- >
- <div class="djs-popup-entry-content">
- <span
- class=${Ra("djs-popup-entry-name",e.className)}
- >
- ${e.imageUrl&&Qt`<img class="djs-popup-entry-icon" src=${e.imageUrl} alt="" />`||e.imageHtml&&Qt`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:e.imageHtml}} />`}
- ${e.label?Qt`
- <span class="djs-popup-label">
- ${e.label}
- </span>
- `:null}
- </span>
- ${e.description&&Qt`
- <span
- class="djs-popup-entry-description"
- title=${e.description}
- >
- ${e.description}
- </span>
- `}
- </div>
- ${e.documentationRef&&Qt`
- <div class="djs-popup-entry-docs">
- <a
- href="${e.documentationRef}"
- onClick=${a=>a.stopPropagation()}
- title="Open element documentation"
- target="_blank"
- rel="noopener"
- >
- <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path fill-rule="evenodd" clip-rule="evenodd" d="M10.6368 10.6375V5.91761H11.9995V10.6382C11.9995 10.9973 11.8623 11.3141 11.5878 11.5885C11.3134 11.863 10.9966 12.0002 10.6375 12.0002H1.36266C0.982345 12.0002 0.660159 11.8681 0.396102 11.6041C0.132044 11.34 1.52588e-05 11.0178 1.52588e-05 10.6375V1.36267C1.52588e-05 0.98236 0.132044 0.660173 0.396102 0.396116C0.660159 0.132058 0.982345 2.95639e-05 1.36266 2.95639e-05H5.91624V1.36267H1.36266V10.6375H10.6368ZM12 0H7.2794L7.27873 1.36197H9.68701L3.06507 7.98391L4.01541 8.93425L10.6373 2.31231V4.72059H12V0Z" fill="#818798"/>
- </svg>
- </a>
- </div>
- `}
- </li>
- `}function y1(t){const s=t,{selectedEntry:e,setSelectedEntry:n,entries:i}=s,r=Qy(s,["selectedEntry","setSelectedEntry","entries"]),o=Zc(),a=Wr(()=>g1(i),[i]);return Sa(()=>{const c=o.current;if(!c)return;const p=c.querySelector(".selected");p&&b1(p)},[e]),Qt`
- <div class="djs-popup-results" ref=${o}>
- ${a.map(c=>Qt`
- ${c.name&&Qt`
- <div key=${c.id} class="entry-header" title=${c.name}>
- ${c.name}
- </div>
- `}
- <ul class="djs-popup-group" data-group=${c.id}>
- ${c.entries.map(p=>Qt`
- <${v1}
- key=${p.id}
- entry=${p}
- selected=${p===e}
- onMouseEnter=${()=>n(p)}
- onMouseLeave=${()=>n(null)}
- ...${r}
- />
- `)}
- </ul>
- `)}
- </div>
- `}function g1(t){const e=[],n=o=>e.find(a=>o.id===a.id),i=o=>!!n(o),r=o=>typeof o=="string"?{id:o}:o;return t.forEach(o=>{const a=o.group?r(o.group):{id:"default"};i(a)?n(a).entries.push(o):e.push(Pn(Ct({},a),{entries:[o]}))}),e}function b1(t){typeof t.scrollIntoViewIfNeeded=="function"?t.scrollIntoViewIfNeeded():t.scrollIntoView({scrollMode:"if-needed",block:"nearest"})}function x1(t){const{onClose:e,onSelect:n,className:i,headerEntries:r,position:o,title:a,width:s,scale:c,search:p,entries:l,onOpened:u,onClosed:h}=t,d=Wr(()=>ae(p)?l.length>5:!1,[p,l]),f=Zc(),[v,g]=Yc(""),R=cr((z,F)=>{if(!d)return z;const U=ut=>{if(!F)return(ut.rank||0)>=0;const Ie=[ut.description||"",ut.label||"",ut.search||""].join("---").toLowerCase();return F.toLowerCase().split(/\s/g).every(Rt=>Ie.includes(Rt))};return z.filter(U)},[d]),[E,_]=Yc(R(l,v)),[x,S]=Yc(E[0]),M=cr(z=>{(!x||!z.includes(x))&&S(z[0]),_(z)},[x,_,S]);Xc(()=>{M(R(l,v))},[v,l]),Xc(()=>{const z=F=>{if(F.key==="Escape")return F.preventDefault(),e()};return document.documentElement.addEventListener("keydown",z),()=>{document.documentElement.removeEventListener("keydown",z)}},[]),Sa(()=>{f.current&&f.current.focus()},[]);const j=cr(z=>{let F=E.indexOf(x)+z;F<0&&(F=E.length-1),F>=E.length&&(F=0),S(E[F])},[E,x,S]),B=cr(z=>{if(z.key==="Enter"&&x)return n(z,x);if(z.key==="ArrowUp"||z.key==="Tab"&&z.shiftKey)return j(-1),z.preventDefault();if(z.key==="ArrowDown"||z.key==="Tab")return j(1),z.preventDefault()},[n,e,x,j]),D=cr(z=>{Js(z.target,"input")&&g(()=>z.target.value)},[g]);Xc(()=>(u(),()=>{h()}),[]);const $=Wr(()=>a||r.length>0,[a,r]);return Qt`
- <${kd}
- onClose=${e}
- onKeyup=${D}
- onKeydown=${B}
- className=${i}
- position=${o}
- width=${s}
- scale=${c}
- >
- ${$&&Qt`
- <div class="djs-popup-header">
- <h3 class="djs-popup-title" title=${a}>${a}</h3>
- ${r.map(z=>Qt`
- <span
- class=${E1(z,z===x)}
- onClick=${F=>n(F,z)}
- title=${z.title||z.label}
- data-id=${z.id}
- onMouseEnter=${()=>S(z)}
- onMouseLeave=${()=>S(null)}
- >
- ${z.imageUrl&&Qt`<img class="djs-popup-entry-icon" src=${z.imageUrl} alt="" />`||z.imageHtml&&Qt`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:z.imageHtml}} />`}
- ${z.label?Qt`
- <span class="djs-popup-label">${z.label}</span>
- `:null}
- </span>
- `)}
- </div>
- `}
- ${l.length>0&&Qt`
- <div class="djs-popup-body">
- ${d&&Qt`
- <div class="djs-popup-search">
- <svg class="djs-popup-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path fill-rule="evenodd" clip-rule="evenodd" d="M9.0325 8.5H9.625L13.3675 12.25L12.25 13.3675L8.5 9.625V9.0325L8.2975 8.8225C7.4425 9.5575 6.3325 10 5.125 10C2.4325 10 0.25 7.8175 0.25 5.125C0.25 2.4325 2.4325 0.25 5.125 0.25C7.8175 0.25 10 2.4325 10 5.125C10 6.3325 9.5575 7.4425 8.8225 8.2975L9.0325 8.5ZM1.75 5.125C1.75 6.9925 3.2575 8.5 5.125 8.5C6.9925 8.5 8.5 6.9925 8.5 5.125C8.5 3.2575 6.9925 1.75 5.125 1.75C3.2575 1.75 1.75 3.2575 1.75 5.125Z" fill="#22242A"/>
- </svg>
- <input
- ref=${f}
- type="text"
- />
- </div>
- `}
- <${y1}
- entries=${E}
- selectedEntry=${x}
- setSelectedEntry=${S}
- onAction=${n}
- />
- </div>
- ${E.length===0&&Qt`
- <div class="djs-popup-no-results">No matching entries found.</div>
- `}
- `}
- </${kd}>
- `}function kd(t){const{onClose:e,onKeydown:n,onKeyup:i,className:r,children:o,position:a}=t,s=Zc(),c=cr(p=>{Mn(p.target,".djs-popup",!0)||e()},[e]);return Sa(()=>{if(typeof a!="function")return;const p=s.current,l=a(p);p.style.left=`${l.x}px`,p.style.top=`${l.y}px`},[s.current,a]),Sa(()=>{s.current&&s.current.focus()},[]),Qt`
- <div
- class="djs-popup-backdrop"
- onClick=${c}
- >
- <div
- class=${Ra("djs-popup",r)}
- style=${_1(t)}
- onKeydown=${n}
- onKeyup=${i}
- ref=${s}
- tabIndex="-1"
- >
- ${o}
- </div>
- </div>
- `}function _1(t){return{transform:`scale(${t.scale})`,width:`${t.width}px`}}function E1(t,e){return Ra("entry",t.className,t.active?"active":"",t.disabled?"disabled":"",e?"selected":"")}var w1="data-id",Td=["contextPad.close","canvas.viewbox.changing","commandStack.changed"],S1=1e3;function Ft(t,e,n){this._eventBus=e,this._canvas=n,this._current=null;var i=ae(t&&t.scale)?t.scale:{min:1,max:1.5};this._config={scale:i},e.on("diagram.destroy",()=>{this.close()}),e.on("element.changed",r=>{const o=this.isOpen()&&this._current.target;r.element===o&&this._render()})}Ft.$inject=["config.popupMenu","eventBus","canvas"],Ft.prototype._render=function(){const{position:t,className:e,entries:n,headerEntries:i,options:r}=this._current,o=Object.entries(n).map(([p,l])=>Ct({id:p},l)),a=Object.entries(i).map(([p,l])=>Ct({id:p},l)),s=t&&(p=>this._ensureVisible(p,t)),c=this._updateScale(this._current.container);rg(Qt`
- <${x1}
- onClose=${p=>this.close(p)}
- onSelect=${(p,l,u)=>this.trigger(p,l,u)}
- position=${s}
- className=${e}
- entries=${o}
- headerEntries=${a}
- scale=${c}
- onOpened=${this._onOpened.bind(this)}
- onClosed=${this._onClosed.bind(this)}
- ...${Ct({},r)}
- />
- `,this._current.container)},Ft.prototype.open=function(t,e,n,i){if(!t)throw new Error("target is missing");if(!e)throw new Error("providers for <"+e+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{entries:r,headerEntries:o}=this._getContext(t,e);this._current={position:n,className:e,target:t,entries:r,headerEntries:o,container:this._createContainer({provider:e}),options:i},this._emit("open"),this._bindAutoClose(),this._render()},Ft.prototype._getContext=function(t,e){const n=this._getProviders(e);if(!n||!n.length)throw new Error("provider for <"+e+"> not found");const i=this._getEntries(t,n),r=this._getHeaderEntries(t,n);return{entries:i,headerEntries:r,empty:!(Object.keys(i).length||Object.keys(r).length)}},Ft.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._current=null)},Ft.prototype.reset=function(){const t=this._current.container;rg(null,t),dn(t)},Ft.prototype._emit=function(t,e){this._eventBus.fire(`popupMenu.${t}`,e)},Ft.prototype._onOpened=function(){this._emit("opened")},Ft.prototype._onClosed=function(){this._emit("closed")},Ft.prototype._createContainer=function(t){var e=this._canvas,n=e.getContainer();const i=Mt(`<div class="djs-popup-parent djs-scrollable" data-popup=${t.provider}></div>`);return n.appendChild(i),i},Ft.prototype._bindAutoClose=function(){this._eventBus.once(Td,this.close,this)},Ft.prototype._unbindAutoClose=function(){this._eventBus.off(Td,this.close,this)},Ft.prototype._updateScale=function(){var t=this._canvas.zoom(),e=this._config.scale,n,i,r=t;return e!==!0&&(e===!1?(n=1,i=1):(n=e.min,i=e.max),ae(n)&&t<n&&(r=n),ae(i)&&t>i&&(r=i)),r},Ft.prototype._ensureVisible=function(t,e){var n=document.documentElement.getBoundingClientRect(),i=t.getBoundingClientRect(),r={},o=e.x,a=e.y;return e.x+i.width>n.width&&(r.x=!0),e.y+i.height>n.height&&(r.y=!0),r.x&&r.y?(o=e.x-i.width,a=e.y-i.height):r.x?(o=e.x-i.width,a=e.y):r.y&&e.y<i.height?(o=e.x,a=10):r.y&&(o=e.x,a=e.y-i.height),e.y<n.top&&(a=e.y+i.height),{x:o,y:a}},Ft.prototype.isEmpty=function(t,e){if(!t)throw new Error("target is missing");if(!e)throw new Error("provider ID is missing");const n=this._getProviders(e);return!n||!n.length?!0:this._getContext(t,e).empty},Ft.prototype.registerProvider=function(t,e,n){n||(n=e,e=S1),this._eventBus.on("popupMenu.getProviders."+t,e,function(i){i.providers.push(n)})},Ft.prototype._getProviders=function(t){var e=this._eventBus.createEvent({type:"popupMenu.getProviders."+t,providers:[]});return this._eventBus.fire(e),e.providers},Ft.prototype._getEntries=function(t,e){var n={};return k(e,function(i){if(!i.getPopupMenuEntries){k(i.getEntries(t),function(o){var a=o.id;if(!a)throw new Error("entry ID is missing");n[a]=Tn(o,["id"])});return}var r=i.getPopupMenuEntries(t);pe(r)?n=r(n):k(r,function(o,a){n[a]=o})}),n},Ft.prototype._getHeaderEntries=function(t,e){var n={};return k(e,function(i){if(!i.getPopupMenuHeaderEntries){if(!i.getHeaderEntries)return;k(i.getHeaderEntries(t),function(o){var a=o.id;if(!a)throw new Error("entry ID is missing");n[a]=Tn(o,["id"])});return}var r=i.getPopupMenuHeaderEntries(t);pe(r)?n=r(n):k(r,function(o,a){n[a]=o})}),n},Ft.prototype.isOpen=function(){return!!this._current},Ft.prototype.trigger=function(t,e,n="click"){if(t.preventDefault(),!e){let r=Mn(t.delegateTarget||t.target,".entry",!0),o=fe(r,w1);e=Ct({id:o},this._getEntry(o))}const i=e.action;if(this._emit("trigger",{entry:e,event:t})!==!1){if(pe(i)){if(n==="click")return i(t,e)}else if(i[n])return i[n](t,e)}},Ft.prototype._getEntry=function(t){var e=this._current.entries[t]||this._current.headerEntries[t];if(!e)throw new Error("entry not found");return e};const tp={__init__:["popupMenu"],popupMenu:["type",Ft]};var C1={align:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
- <line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,bottom:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="150" y1="1650" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="150" y="350" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="1050" y="850" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,center:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="900" y1="150" x2="900" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="250" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="500" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,left:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="100" y1="150" x2="100" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="100" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="100" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,right:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="1650" y1="150" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="350" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="850" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,top:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="150" y1="150" x2="1650" y2="150" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="150" y="150" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="1050" y="150" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,middle:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
- <rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`};const Ad=C1;var R1=900;function pr(t,e,n,i){t.registerProvider(R1,this),this._contextPad=t,this._popupMenu=e,this._translate=n,this._canvas=i}pr.$inject=["contextPad","popupMenu","translate","canvas"],pr.prototype.getMultiElementContextPadEntries=function(t){var e={};return this._isAllowed(t)&&N(e,this._getEntries(t)),e},pr.prototype._isAllowed=function(t){return!this._popupMenu.isEmpty(t,"align-elements")},pr.prototype._getEntries=function(){var t=this;return{"align-elements":{group:"align-elements",title:t._translate("Align elements"),html:`<div class="entry">${Ad.align}</div>`,action:{click:function(e,n){var i=t._getMenuPosition(n);N(i,{cursor:{x:e.x,y:e.y}}),t._popupMenu.open(n,"align-elements",i)}}}}},pr.prototype._getMenuPosition=function(t){var e=5,n=this._contextPad.getPad(t).html,i=n.getBoundingClientRect(),r={x:i.left,y:i.bottom+e};return r};var P1=["left","center","right","top","middle","bottom"];function Ur(t,e,n,i){this._alignElements=e,this._translate=n,this._popupMenu=t,this._rules=i,t.registerProvider("align-elements",this)}Ur.$inject=["popupMenu","alignElements","translate","rules"],Ur.prototype.getPopupMenuEntries=function(t){var e={};return this._isAllowed(t)&&N(e,this._getEntries(t)),e},Ur.prototype._isAllowed=function(t){return this._rules.allowed("elements.align",{elements:t})},Ur.prototype._getEntries=function(t){var e=this._alignElements,n=this._translate,i=this._popupMenu,r={};return k(P1,function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:Ad[o],action:function(){e.trigger(t,o),i.close()}}}),r};function qe(t){V.call(this,t),this.init()}qe.$inject=["eventBus"],q(qe,V),qe.prototype.addRule=function(t,e,n){var i=this;typeof t=="string"&&(t=[t]),t.forEach(function(r){i.canExecute(r,e,function(o,a,s){return n(o)},!0)})},qe.prototype.init=function(){};function Pa(t){qe.call(this,t)}Pa.$inject=["eventBus"],q(Pa,qe),Pa.prototype.init=function(){this.addRule("elements.align",function(t){var e=t.elements,n=ct(e,function(i){return!(i.waypoints||i.host||i.labelTarget)});return n=Wo(n),n.length<2?!1:n})};const k1={__depends__:[s1,fd,tp],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",pr],alignElementsMenuProvider:["type",Ur],bpmnAlignElements:["type",Pa]};var T1=10,Md=50,A1=250;function ep(t,e,n,i){for(var r;r=M1(t,n,e);)n=i(e,n,r);return n}function np(t){return function(e,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=t[o];if(a){var s=o==="x"?"width":"height",c=a.margin,p=a.minDistance;c<0?r[o]=Math.min(i[o]+c-e[s]/2,n[o]-p+c):r[o]=Math.max(i[o]+i[s]+c+e[s]/2,n[o]+p+c)}}),r}}function M1(t,e,n){var i={x:e.x-n.width/2,y:e.y-n.height/2,width:n.width,height:n.height},r=B1(t);return yt(r,function(o){if(o===n)return!1;var a=le(o,i,T1);return a==="intersect"})}function D1(t,e){e||(e={});function n(f){return f.source===t?1:-1}var i=e.defaultDistance||Md,r=e.direction||"e",o=e.filter,a=e.getWeight||n,s=e.maxDistance||A1,c=e.reference||"start";o||(o=j1);function p(f,v){return r==="n"?c==="start"?X(f).top-X(v).bottom:c==="center"?X(f).top-nt(v).y:X(f).top-X(v).top:r==="w"?c==="start"?X(f).left-X(v).right:c==="center"?X(f).left-nt(v).x:X(f).left-X(v).left:r==="s"?c==="start"?X(v).top-X(f).bottom:c==="center"?nt(v).y-X(f).bottom:X(v).bottom-X(f).bottom:c==="start"?X(v).left-X(f).right:c==="center"?nt(v).x-X(f).right:X(v).right-X(f).right}var l=t.incoming.filter(o).map(function(f){var v=a(f),g=v<0?p(f.source,t):p(t,f.source);return{id:f.source.id,distance:g,weight:v}}),u=t.outgoing.filter(o).map(function(f){var v=a(f),g=v>0?p(t,f.target):p(f.target,t);return{id:f.target.id,distance:g,weight:v}}),h=l.concat(u).reduce(function(f,v){return f[v.id+"__weight_"+v.weight]=v,f},{}),d=Ge(h,function(f,v){var g=v.distance,R=v.weight;return g<0||g>s||(f[String(g)]||(f[String(g)]=0),f[String(g)]+=1*R,(!f.distance||f[f.distance]<f[String(g)])&&(f.distance=g)),f},{});return d.distance||i}function B1(t){var e=ip(t);return t.host&&(e=e.concat(ip(t.host))),t.attachers&&(e=e.concat(t.attachers.reduce(function(n,i){return n.concat(ip(i))},[]))),e}function ip(t){return O1(t).concat(N1(t))}function N1(t){return t.incoming.map(function(e){return e.source})}function O1(t){return t.outgoing.map(function(e){return e.target})}function j1(){return!0}var L1=100;function Dd(t,e,n){t.on("autoPlace",L1,function(i){var r=i.shape,o=i.source;return I1(o,r)}),t.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){t.fire("autoPlace.start",{source:i,shape:r});var a=t.fire("autoPlace",{source:i,shape:r}),s=e.appendShape(i,r,a,i.parent,o);return t.fire("autoPlace.end",{source:i,shape:s}),s}}Dd.$inject=["eventBus","modeling","canvas"];function I1(t,e,n){n||(n={});var i=n.defaultDistance||Md,r=nt(t),o=X(t);return{x:o.right+i+e.width/2,y:r.y}}function Bd(t,e){t.on("autoPlace.end",500,function(n){e.select(n.shape)})}Bd.$inject=["eventBus","selection"];const $1={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Dd],autoPlaceSelectionBehavior:["type",Bd]};function ka(t,e){for(Me(e)&&(e=[e]);t=t.parent;)if(dt(t,e))return t;return null}function Nd(t,e){if(y(e,"bpmn:TextAnnotation"))return H1(t,e);if(dt(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"]))return G1(t,e);if(y(e,"bpmn:FlowNode"))return z1(t,e)}function z1(t,e){var n=X(t),i=nt(t),r=D1(t,{filter:function(l){return y(l,"bpmn:SequenceFlow")}}),o=30,a=80,s="left";y(t,"bpmn:BoundaryEvent")&&(s=le(t,t.host,-25),s.indexOf("top")!==-1&&(o*=-1));var c={x:n.right+r+e.width/2,y:i.y+F1(s,a)},p={y:{margin:o,minDistance:a}};return ep(t,e,c,np(p))}function F1(t,e){return t.includes("top")?-1*e:t.includes("bottom")?e:0}function H1(t,e){var n=X(t),i={x:n.right+e.width/2,y:n.top-50-e.height/2};Dt(t)&&(i=nt(t),i.x+=100,i.y-=50);var r={y:{margin:-30,minDistance:20}};return ep(t,e,i,np(r))}function G1(t,e){var n=X(t),i={x:n.right-10+e.width/2,y:n.bottom+40+e.width/2},r={x:{margin:30,minDistance:30}};return ep(t,e,i,np(r))}function Od(t){t.on("autoPlace",function(e){var n=e.shape,i=e.source;return Nd(i,n)})}Od.$inject=["eventBus"];const jd={__depends__:[$1],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",Od]};function In(t,e,n,i){V.call(this,t),this._elementRegistry=e,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],function(o){var a=o.context,s=a.hints||{},c=a.shape,p=a.parent||a.newParent;s.autoResize!==!1&&r._expand([c],p)}),this.postExecuted(["elements.move"],function(o){var a=o.context,s=Ys(iu(a.closure.topLevel)),c=a.hints,p=c?c.autoResize:!0;if(p!==!1){var l=Bo(s,function(u){return u.parent.id});k(l,function(u,h){lt(p)&&(u=u.filter(function(d){return yt(p,hn({id:d.id}))})),r._expand(u,h)})}}),this.postExecuted(["shape.toggleCollapse"],function(o){var a=o.context,s=a.hints,c=a.shape;s&&s.autoResize===!1||c.collapsed||r._expand(c.children||[],c)}),this.postExecuted(["shape.resize"],function(o){var a=o.context,s=a.hints,c=a.shape,p=c.parent;s&&s.autoResize===!1||p&&r._expand([c],p)})}In.$inject=["eventBus","elementRegistry","modeling","rules"],q(In,V),In.prototype._getOptimalBounds=function(t,e){var n=this.getOffset(e),i=this.getPadding(e),r=X(Vt(t)),o=X(e),a={};return r.top-o.top<i.top&&(a.top=r.top-n.top),r.left-o.left<i.left&&(a.left=r.left-n.left),o.right-r.right<i.right&&(a.right=r.right+n.right),o.bottom-r.bottom<i.bottom&&(a.bottom=r.bottom+n.bottom),Xo(N({},o,a))},In.prototype._expand=function(t,e){typeof e=="string"&&(e=this._elementRegistry.get(e));var n=this._rules.allowed("element.autoResize",{elements:t,target:e});if(n){var i=this._getOptimalBounds(t,e);if(V1(i,e)){var r=W1(un(e,["x","y","width","height"]),i);this.resize(e,i,{autoResize:r});var o=e.parent;o&&this._expand([e],o)}}},In.prototype.getOffset=function(t){return{top:60,bottom:60,left:100,right:100}},In.prototype.getPadding=function(t){return{top:2,bottom:2,left:15,right:15}},In.prototype.resize=function(t,e,n){this._modeling.resizeShape(t,e,null,n)};function V1(t,e){return t.x!==e.x||t.y!==e.y||t.width!==e.width||t.height!==e.height}function W1(t,e){var n="";return t=X(t),e=X(e),t.top>e.top&&(n=n.concat("n")),t.right<e.right&&(n=n.concat("w")),t.bottom<e.bottom&&(n=n.concat("s")),t.left>e.left&&(n=n.concat("e")),n}function Ta(t){t.invoke(In,this)}Ta.$inject=["injector"],q(Ta,In),Ta.prototype.resize=function(t,e,n){y(t,"bpmn:Participant")?this._modeling.resizeLane(t,e,null,n):this._modeling.resizeShape(t,e,null,n)};function qr(t){qe.call(this,t);var e=this;this.addRule("element.autoResize",function(n){return e.canResize(n.elements,n.target)})}qr.$inject=["eventBus"],q(qr,qe),qr.prototype.canResize=function(t,e){return!1};function Aa(t,e){qr.call(this,t),this._modeling=e}q(Aa,qr),Aa.$inject=["eventBus","modeling"],Aa.prototype.canResize=function(t,e){if(y(e.di,"bpmndi:BPMNPlane")||!y(e,"bpmn:Participant")&&!y(e,"bpmn:Lane")&&!y(e,"bpmn:SubProcess"))return!1;var n=!0;return k(t,function(i){if(y(i,"bpmn:Lane")||xt(i)){n=!1;return}}),n};const U1={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Ta],bpmnAutoResizeProvider:["type",Aa]};var Ld=1500;function Id(t,e,n){var i=this,r=n.get("dragging",!1);function o(a){if(!a.hover){var s=a.originalEvent,c=i._findTargetGfx(s),p=c&&t.get(c);c&&p&&(a.stopPropagation(),r.hover({element:p,gfx:c}),r.move(s))}}r&&e.on("drag.start",function(a){e.once("drag.move",Ld,function(s){o(s)})}),function(){var a,s;e.on("element.hover",function(c){a=c.gfx,s=c.element}),e.on("element.hover",Ld,function(c){s&&e.fire("element.out",{element:s,gfx:a})}),e.on("element.out",function(){a=null,s=null})}(),this._findTargetGfx=function(a){var s,c;if(a instanceof MouseEvent)return s=oi(a),c=document.elementFromPoint(s.x,s.y),q1(c)}}Id.$inject=["elementRegistry","eventBus","injector"];function q1(t){return Mn(t,"svg, .djs-element",!0)}const K1={__init__:["hoverFix"],hoverFix:["type",Id]};var lr=Math.round,$d="djs-drag-active";function Ni(t){t.preventDefault()}function Y1(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent}function X1(t){return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}function zd(t,e,n,i){var r={threshold:5,trapClick:!0},o;function a(_){var x=e.viewbox(),S=e._container.getBoundingClientRect();return{x:x.x+(_.x-S.left)/x.scale,y:x.y+(_.y-S.top)/x.scale}}function s(_,x){x=x||o;var S=t.createEvent(N({},x.payload,x.data,{isTouch:x.isTouch}));return t.fire("drag."+_,S)===!1?!1:t.fire(x.prefix+"."+_,S)}function c(_){var x=_.filter(function(S){return i.get(S.id)});x.length&&n.select(x)}function p(_,x){var S=o.payload,M=o.displacement,j=o.globalStart,B=oi(_),D=en(B,j),$=o.localStart,z=a(B),F=en(z,$);if(!o.active&&(x||X1(D)>o.threshold)){if(N(S,{x:lr($.x+M.x),y:lr($.y+M.y),dx:0,dy:0},{originalEvent:_}),s("start")===!1)return g();o.active=!0,o.keepSelection||(S.previousSelection=n.get(),n.select(null)),o.cursor&&ba(o.cursor),e.addMarker(e.getRootElement(),$d)}Dc(_),o.active&&(N(S,{x:lr(z.x+M.x),y:lr(z.y+M.y),dx:lr(F.x),dy:lr(F.y)},{originalEvent:_}),s("move"))}function l(_){var x,S=!0;o.active&&(_&&(o.payload.originalEvent=_,Dc(_)),S=s("end")),S===!1&&s("rejected"),x=R(S!==!0),s("ended",x)}function u(_){ne("Escape",_)&&(Ni(_),g())}function h(_){var x;o.active&&(x=ed(t),setTimeout(x,400),Ni(_)),l(_)}function d(_){p(_)}function f(_){var x=o.payload;x.hoverGfx=_.gfx,x.hover=_.element,s("hover")}function v(_){s("out");var x=o.payload;x.hoverGfx=null,x.hover=null}function g(_){var x;if(o){var S=o.active;S&&s("cancel"),x=R(_),S&&s("canceled",x)}}function R(_){var x,S;s("cleanup"),td(),o.trapClick?S=h:S=l,J.unbind(document,"mousemove",p),J.unbind(document,"dragstart",Ni),J.unbind(document,"selectstart",Ni),J.unbind(document,"mousedown",S,!0),J.unbind(document,"mouseup",S,!0),J.unbind(document,"keyup",u),J.unbind(document,"touchstart",d,!0),J.unbind(document,"touchcancel",g,!0),J.unbind(document,"touchmove",p,!0),J.unbind(document,"touchend",l,!0),t.off("element.hover",f),t.off("element.out",v),e.removeMarker(e.getRootElement(),$d);var M=o.payload.previousSelection;return _!==!1&&M&&!n.get().length&&c(M),x=o,o=null,x}function E(_,x,S,M){o&&g(!1),typeof x=="string"&&(M=S,S=x,x=null),M=N({},r,M||{});var j=M.data||{},B,D,$,z,F;M.trapClick?z=h:z=l,_?(B=nr(_)||_,D=oi(_),Dc(_),B.type==="dragstart"&&Ni(B)):(B=null,D={x:0,y:0}),$=a(D),x||(x=$),F=Y1(B),o=N({prefix:S,data:j,payload:{},globalStart:D,displacement:en(x,$),localStart:$,isTouch:F},M),M.manual||(F?(J.bind(document,"touchstart",d,!0),J.bind(document,"touchcancel",g,!0),J.bind(document,"touchmove",p,!0),J.bind(document,"touchend",l,!0)):(J.bind(document,"mousemove",p),J.bind(document,"dragstart",Ni),J.bind(document,"selectstart",Ni),J.bind(document,"mousedown",z,!0),J.bind(document,"mouseup",z,!0)),J.bind(document,"keyup",u),t.on("element.hover",f),t.on("element.out",v)),s("init"),M.autoActivate&&p(_,!0)}t.on("diagram.destroy",g),this.init=E,this.move=p,this.hover=f,this.out=v,this.end=l,this.cancel=g,this.context=function(){return o},this.setOptions=function(_){N(r,_)}}zd.$inject=["eventBus","canvas","selection","elementRegistry"];const $n={__depends__:[K1,bn],dragging:["type",zd]};function ur(t,e,n){this._canvas=n,this._opts=N({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},t);var i=this;e.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),e.on(["drag.cleanup"],function(){i.stopScroll()})}ur.$inject=["config.autoScroll","eventBus","canvas"],ur.prototype.startScroll=function(t){var e=this._canvas,n=this._opts,i=this,r=e.getContainer().getBoundingClientRect(),o=[t.x,t.y,r.width-t.x,r.height-t.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)Z1(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(c===0?a=n.scrollStep:c==1?s=n.scrollStep:c==2?a=-n.scrollStep:c==3&&(s=-n.scrollStep));(a!==0||s!==0)&&(e.scroll({dx:a,dy:s}),this._scrolling=setTimeout(function(){i.startScroll(t)},n.scrollRepeatTimeout))};function Z1(t,e,n){return e<t&&t<n}ur.prototype.stopScroll=function(){clearTimeout(this._scrolling)},ur.prototype.setOptions=function(t){this._opts=N({},this._opts,t)},ur.prototype._toBorderPoint=function(t){var e=this._canvas._container.getBoundingClientRect(),n=oi(t.originalEvent);return{x:n.x-e.left,y:n.y-e.top}};const Q1={__depends__:[$n],__init__:["autoScroll"],autoScroll:["type",ur]};function rp(t){this._commandStack=t.get("commandStack",!1)}rp.$inject=["injector"],rp.prototype.allowed=function(t,e){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(t,e)),n===void 0?!0:n};const _n={__init__:["rules"],rules:["type",rp]};var Ma=Math.round,J1=Math.max;function tE(t,e){var n=t.x,i=t.y;return[["M",n,i],["m",0,-e],["a",e,e,0,1,1,0,2*e],["a",e,e,0,1,1,0,-2*e],["z"]]}function eE(t){var e=[];return t.forEach(function(n,i){e.push([i===0?"M":"L",n.x,n.y])}),e}var Fd=10;function nE(t,e){var n,i;for(n=0;i=t[n];n++)if(kr(i,e)<=Fd)return{point:t[n],bendpoint:!0,index:n};return null}function iE(t,e){var n=Lu(tE(e,Fd),eE(t)),i=n[0],r=n[n.length-1],o;return i?i!==r?i.segment2!==r.segment2?(o=J1(i.segment2,r.segment2)-1,{point:t[o],bendpoint:!0,index:o}):{point:{x:Ma(i.x+r.x)/2,y:Ma(i.y+r.y)/2},index:i.segment2}:{point:{x:Ma(i.x),y:Ma(i.y)},index:i.segment2}:null}function op(t,e){return nE(t,e)||iE(t,e)}function Hd(t){return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}function Gd(t){return Math.atan((t[1].y-t[0].y)/(t[1].x-t[0].x))}function rE(t,e){return e?{x:Math.cos(e)*t.x-Math.sin(e)*t.y,y:Math.sin(e)*t.x+Math.cos(e)*t.y}:t}function oE(t,e,n){var i=[{n:t[0]-n[0],lambda:e[0]},{n:t[1]-n[1],lambda:e[1]}],r=i[0].n*e[0]+i[1].n*e[1],o=i[0].lambda*e[0]+i[1].lambda*e[1];return-r/o}function ap(t,e){var n=e[0],i=e[1],r={x:i.x-n.x,y:i.y-n.y},o=oE([n.x,n.y],[r.x,r.y],[t.x,t.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function Vd(t,e){var n=ap(t,e),i={x:n.x-t.x,y:n.y-t.y};return Hd(i)}function Da(t,e){return Hd({x:t.x-e.x,y:t.y-e.y})}var Wd="djs-bendpoint",Ud="djs-segment-dragger";function aE(t,e){var n=oi(e),i=t._container.getBoundingClientRect(),r;r={x:i.left,y:i.top};var o=t.viewbox();return{x:o.x+(n.x-r.x)/o.scale,y:o.y+(n.y-r.y)/o.scale}}function sp(t,e,n){var i=aE(t,n),r=op(e,i);return r}function cp(t,e){var n=Z("g");ht(n).add(Wd),tt(t,n);var i=Z("circle");Y(i,{cx:0,cy:0,r:4}),ht(i).add("djs-visual"),tt(n,i);var r=Z("circle");return Y(r,{cx:0,cy:0,r:10}),ht(r).add("djs-hit"),tt(n,r),e&&ht(n).add(e),n}function sE(t,e,n,i){var r=Z("g");tt(t,r);var o=18,a=6,s=11,c=pE(e,n,i),p=a+s,l=Z("rect");Y(l,{x:-o/2,y:-a/2,width:o,height:a}),ht(l).add("djs-visual"),tt(r,l);var u=Z("rect");return Y(u,{x:-c/2,y:-p/2,width:c,height:p}),ht(u).add("djs-hit"),tt(r,u),Ju(r,i==="v"?90:0),r}function qd(t,e,n){var i=Z("g"),r=hc(e,n),o=Dn(e,n);return tt(t,i),sE(i,e,n,o),ht(i).add(Ud),ht(i).add(o==="h"?"horizontal":"vertical"),ke(i,r.x,r.y),i}function Kd(t){return Math.abs(Math.round(t*2/3))}function cE(t,e){var n=lE(t,e);return ap(t,n)}function pE(t,e,n){var i=e.x-t.x,r=e.y-t.y;return Kd(n==="h"?i:r)}function lE(t,e){for(var n=e.waypoints,i=1/0,r,o=0;o<n.length-1;o++){var a=n[o],s=n[o+1],c=Vd(t,[a,s]);c<i&&(i=c,r=o)}return[n[r],n[r+1]]}function Yd(t,e,n,i,r){function o(_,x,S){var M=_.index,j=_.point,B,D,$,z,F,U;return M<=0||_.bendpoint?!1:(B=x[M-1],D=x[M],$=hc(B,D),z=Dn(B,D),F=Math.abs(j.x-$.x),U=Math.abs(j.y-$.y),z&&F<=S&&U<=S)}function a(_,x){var S=_.waypoints,M,j,B,D;return x.index<=0||x.bendpoint||(M={start:S[x.index-1],end:S[x.index]},j=Dn(M.start,M.end),!j)?null:(j==="h"?B=M.end.x-M.start.x:B=M.end.y-M.start.y,D=Kd(B)/2,D)}function s(_,x){var S=x.waypoints,M=sp(e,S,_),j;if(M)return j=a(x,M),o(M,S,j)?r.start(_,x,M.index):i.start(_,x,M.index,!M.bendpoint),!0}function c(_,x,S){J.bind(_,x,function(M){n.triggerMouseEvent(x,M,S),M.stopPropagation()})}function p(_,x){var S=e.getLayer("overlays"),M=At('.djs-bendpoints[data-element-id="'+Fr(_.id)+'"]',S);return!M&&x&&(M=Z("g"),Y(M,{"data-element-id":_.id}),ht(M).add("djs-bendpoints"),tt(S,M),c(M,"mousedown",_),c(M,"click",_),c(M,"dblclick",_)),M}function l(_,x){return At('.djs-segment-dragger[data-segment-idx="'+_+'"]',x)}function u(_,x){x.waypoints.forEach(function(S,M){var j=cp(_);tt(_,j),ke(j,S.x,S.y)}),cp(_,"floating")}function h(_,x){for(var S=x.waypoints,M,j,B,D=1;D<S.length;D++)M=S[D-1],j=S[D],Dn(M,j)&&(B=qd(_,M,j),Y(B,{"data-segment-idx":D}),c(B,"mousemove",x))}function d(_){k(tc("."+Wd,_),function(x){Gt(x)})}function f(_){k(tc("."+Ud,_),function(x){Gt(x)})}function v(_){var x=p(_);return x||(x=p(_,!0),u(x,_),h(x,_)),x}function g(_){var x=p(_);x&&(f(x),d(x),h(x,_),u(x,_))}function R(_,x){var S=At(".floating",_),M=x.point;S&&ke(S,M.x,M.y)}function E(_,x,S){var M=l(x.index,_),j=S[x.index-1],B=S[x.index],D=x.point,$=hc(j,B),z=Dn(j,B),F,U;M&&(F=uE(M),U={x:D.x-$.x,y:D.y-$.y},z==="v"&&(U={x:U.y,y:U.x}),ke(F,U.x,U.y))}t.on("connection.changed",function(_){g(_.element)}),t.on("connection.remove",function(_){var x=p(_.element);x&&Gt(x)}),t.on("element.marker.update",function(_){var x=_.element,S;x.waypoints&&(S=v(x),_.add?ht(S).add(_.marker):ht(S).remove(_.marker))}),t.on("element.mousemove",function(_){var x=_.element,S=x.waypoints,M,j;if(S){if(M=p(x,!0),j=sp(e,S,_.originalEvent),!j)return;R(M,j),j.bendpoint||E(M,j,S)}}),t.on("element.mousedown",function(_){if(ai(_)){var x=_.originalEvent,S=_.element;if(S.waypoints)return s(x,S)}}),t.on("selection.changed",function(_){var x=_.newSelection,S=x[0];S&&S.waypoints&&v(S)}),t.on("element.hover",function(_){var x=_.element;x.waypoints&&(v(x),n.registerEvent(_.gfx,"mousemove","element.mousemove"))}),t.on("element.out",function(_){n.unregisterEvent(_.gfx,"mousemove","element.mousemove")}),t.on("element.updateId",function(_){var x=_.element,S=_.newId;if(x.waypoints){var M=p(x);M&&Y(M,{"data-element-id":S})}}),this.addHandles=v,this.updateHandles=g,this.getBendpointsContainer=p,this.getSegmentDragger=l}Yd.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];function uE(t){return At(".djs-visual",t)}var Xd=Math.round,Oi="reconnectStart",ji="reconnectEnd",Kr="updateWaypoints";function pp(t,e,n,i,r,o){this._injector=t,this.start=function(a,s,c,p){var l=n.getGraphics(s),u=s.source,h=s.target,d=s.waypoints,f;!p&&c===0?f=Oi:!p&&c===d.length-1?f=ji:f=Kr;var v=f===Kr?"connection.updateWaypoints":"connection.reconnect",g=r.allowed(v,{connection:s,source:u,target:h});g===!1&&(g=r.allowed(v,{connection:s,source:h,target:u})),g!==!1&&i.init(a,"bendpoint.move",{data:{connection:s,connectionGfx:l,context:{allowed:g,bendpointIndex:c,connection:s,source:u,target:h,insert:p,type:f}}})},e.on("bendpoint.move.hover",function(a){var s=a.context,c=s.connection,p=c.source,l=c.target,u=a.hover,h=s.type;s.hover=u;var d;if(u){var f=h===Kr?"connection.updateWaypoints":"connection.reconnect";if(d=s.allowed=r.allowed(f,{connection:c,source:h===Oi?u:p,target:h===ji?u:l}),d){s.source=h===Oi?u:p,s.target=h===ji?u:l;return}d===!1&&(d=s.allowed=r.allowed(f,{connection:c,source:h===ji?u:l,target:h===Oi?u:p})),d&&(s.source=h===ji?u:l,s.target=h===Oi?u:p)}}),e.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(a){var s=a.context,c=s.type;s.hover=null,s.source=null,s.target=null,c!==Kr&&(s.allowed=!1)}),e.on("bendpoint.move.end",function(a){var s=a.context,c=s.allowed,p=s.bendpointIndex,l=s.connection,u=s.insert,h=l.waypoints.slice(),d=s.source,f=s.target,v=s.type,g=s.hints||{},R={x:Xd(a.x),y:Xd(a.y)};if(!c)return!1;v===Kr?(u?h.splice(p,0,R):h[p]=R,g.bendpointMove={insert:u,bendpointIndex:p},h=this.cropWaypoints(l,h),o.updateWaypoints(l,h0(h),g)):(v===Oi?(g.docking="source",Ba(s)&&(g.docking="target",g.newWaypoints=h.reverse())):v===ji&&(g.docking="target",Ba(s)&&(g.docking="source",g.newWaypoints=h.reverse())),o.reconnect(l,d,f,R,g))},this)}pp.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],pp.prototype.cropWaypoints=function(t,e){var n=this._injector.get("connectionDocking",!1);if(!n)return e;var i=t.waypoints;return t.waypoints=e,t.waypoints=n.getCroppedWaypoints(t),e=t.waypoints,t.waypoints=i,e};function Ba(t){var e=t.hover,n=t.source,i=t.target,r=t.type;if(r===Oi)return e&&i&&e===i&&n!==i;if(r===ji)return e&&n&&e===n&&n!==i}var hE="reconnectStart",dE="reconnectEnd",Zd="updateWaypoints",Yr="connect-ok",Na="connect-not-ok",Qd="connect-hover",Jd="djs-updating",tf="djs-dragging",ef=1100;function nf(t,e,n,i){this._injector=e;var r=e.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var a=o.context,s=a.bendpointIndex,c=a.connection,p=a.insert,l=c.waypoints,u=l.slice();a.waypoints=l,p&&u.splice(s,0,{x:o.x,y:o.y}),c.waypoints=u;var h=a.draggerGfx=cp(i.getLayer("overlays"));ht(h).add("djs-dragging"),i.addMarker(c,tf),i.addMarker(c,Jd)}),n.on("bendpoint.move.hover",function(o){var a=o.context,s=a.allowed,c=a.hover,p=a.type;if(c){if(i.addMarker(c,Qd),p===Zd)return;s?(i.removeMarker(c,Na),i.addMarker(c,Yr)):s===!1&&(i.removeMarker(c,Yr),i.addMarker(c,Na))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],ef,function(o){var a=o.context,s=a.hover,c=a.target;s&&(i.removeMarker(s,Qd),i.removeMarker(s,c?Yr:Na))}),n.on("bendpoint.move.move",function(o){var a=o.context,s=a.allowed,c=a.bendpointIndex,p=a.draggerGfx,l=a.hover,u=a.type,h=a.connection,d=h.source,f=h.target,v=h.waypoints.slice(),g={x:o.x,y:o.y},R=a.hints||{},E={};r&&(R.connectionStart&&(E.connectionStart=R.connectionStart),R.connectionEnd&&(E.connectionEnd=R.connectionEnd),u===hE?Ba(a)?(E.connectionEnd=E.connectionEnd||g,E.source=f,E.target=l||d,v=v.reverse()):(E.connectionStart=E.connectionStart||g,E.source=l||d,E.target=f):u===dE?Ba(a)?(E.connectionStart=E.connectionStart||g,E.source=l||f,E.target=d,v=v.reverse()):(E.connectionEnd=E.connectionEnd||g,E.source=d,E.target=l||f):(E.noCropping=!0,E.noLayout=!0,v[c]=g),u===Zd&&(v=t.cropWaypoints(h,v)),E.waypoints=v,r.drawPreview(a,s,E)),ke(p,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],ef,function(o){var a=o.context,s=a.connection,c=a.draggerGfx,p=a.hover,l=a.target,u=a.waypoints;s.waypoints=u,Gt(c),i.removeMarker(s,Jd),i.removeMarker(s,tf),p&&(i.removeMarker(p,Yr),i.removeMarker(p,l?Yr:Na)),r&&r.cleanUp(a)})}nf.$inject=["bendpointMove","injector","eventBus","canvas"];var rf="connect-hover",of="djs-updating";function af(t,e,n){return lp(t,e,t[e]+n)}function lp(t,e,n){return{x:e==="x"?n:t.x,y:e==="y"?n:t.y}}function fE(t,e,n,i){var r=Math.max(e[i],n[i]),o=Math.min(e[i],n[i]),a=20,s=Math.min(Math.max(o+a,t[i]),r-a);return lp(e,i,s)}function sf(t){return t==="x"?"y":"x"}function cf(t,e,n){var i,r;return t.original?t.original:(i=nt(e),r=sf(n),lp(t,r,i[r]))}function pf(t,e,n,i,r,o){var a=t.get("connectionDocking",!1);this.start=function(u,h,d){var f,v=n.getGraphics(h),g=d-1,R=d,E=h.waypoints,_=E[g],x=E[R],S=sp(n,E,u),M,j,B;M=Dn(_,x),M&&(j=M==="v"?"x":"y",g===0&&(_=cf(_,h.source,j)),R===E.length-1&&(x=cf(x,h.target,j)),S?B=S.point:B={x:(_.x+x.x)/2,y:(_.y+x.y)/2},f={connection:h,segmentStartIndex:g,segmentEndIndex:R,segmentStart:_,segmentEnd:x,axis:j,dragPosition:B},i.init(u,B,"connectionSegment.move",{cursor:j==="x"?"resize-ew":"resize-ns",data:{connection:h,connectionGfx:v,context:f}}))};function s(u,h){if(!a)return h;var d=u.waypoints,f;return u.waypoints=h,f=a.getCroppedWaypoints(u),u.waypoints=d,f}function c(u){r.update("connection",u.connection,u.connectionGfx)}function p(u,h,d){var f=u.newWaypoints,v=u.segmentStartIndex+h,g=f[v],R=u.segmentEndIndex+h,E=f[R],_=sf(u.axis),x=fE(d,g,E,_);ke(u.draggerGfx,x.x,x.y)}function l(u,h){var d=0,f=u.filter(function(v,g){return uc(u[g-1],u[g+1],v)?(d=g<=h?d-1:d,!1):!0});return{waypoints:f,segmentOffset:d}}e.on("connectionSegment.move.start",function(u){var h=u.context,d=u.connection,f=n.getLayer("overlays");h.originalWaypoints=d.waypoints.slice(),h.draggerGfx=qd(f,h.segmentStart,h.segmentEnd),ht(h.draggerGfx).add("djs-dragging"),n.addMarker(d,of)}),e.on("connectionSegment.move.move",function(u){var h=u.context,d=h.connection,f=h.segmentStartIndex,v=h.segmentEndIndex,g=h.segmentStart,R=h.segmentEnd,E=h.axis,_=h.originalWaypoints.slice(),x=af(g,E,u["d"+E]),S=af(R,E,u["d"+E]),M=_.length,j=0;_[f]=x,_[v]=S;var B,D;f<2&&(B=le(d.source,x),f===1?B==="intersect"&&(_.shift(),_[0]=x,j--):B!=="intersect"&&(_.unshift(g),j++)),v>M-3&&(D=le(d.target,S),v===M-2?D==="intersect"&&(_.pop(),_[_.length-1]=S):D!=="intersect"&&_.push(R)),h.newWaypoints=d.waypoints=s(d,_),p(h,j,u),h.newSegmentStartIndex=f+j,c(u)}),e.on("connectionSegment.move.hover",function(u){u.context.hover=u.hover,n.addMarker(u.hover,rf)}),e.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(u){var h=u.context.hover;h&&n.removeMarker(h,rf)}),e.on("connectionSegment.move.cleanup",function(u){var h=u.context,d=h.connection;h.draggerGfx&&Gt(h.draggerGfx),n.removeMarker(d,of)}),e.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(u){var h=u.context,d=h.connection;d.waypoints=h.originalWaypoints,c(u)}),e.on("connectionSegment.move.end",function(u){var h=u.context,d=h.connection,f=h.newWaypoints,v=h.newSegmentStartIndex;f=f.map(function(S){return{original:S.original,x:Math.round(S.x),y:Math.round(S.y)}});var g=l(f,v),R=g.waypoints,E=s(d,R),_=g.segmentOffset,x={segmentMove:{segmentStartIndex:h.segmentStartIndex,newSegmentStartIndex:v+_}};o.updateWaypoints(d,E,x)})}pf.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var mE=Math.abs,lf=Math.round;function vE(t,e,n){n=n===void 0?10:n;var i,r;for(i=0;i<e.length;i++)if(r=e[i],mE(r-t)<=n)return r}function uf(t){return{x:t.x,y:t.y}}function hf(t){return{x:t.x+t.width,y:t.y+t.height}}function Ke(t,e){return!t||isNaN(t.x)||isNaN(t.y)?e:{x:lf(t.x+t.width/2),y:lf(t.y+t.height/2)}}function hr(t,e){var n=t.snapped;return n?typeof e=="string"?n[e]:n.x&&n.y:!1}function Kt(t,e,n){if(typeof e!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var i,r=t[e],o=t.snapped=t.snapped||{};return n===!1?o[e]=!1:(o[e]=!0,i=n-r,t[e]+=i,t["d"+e]+=i),r}function df(t){return t.children||[]}var yE=Math.abs,ff=Math.round,up=10;function mf(t){function e(o,a){if(lt(o)){for(var s=o.length;s--;)if(yE(o[s]-a)<=up)return o[s]}else{o=+o;var c=a%o;if(c<up)return a-c;if(c>o-up)return a-c+o}return a}function n(o,a){if(o.waypoints)return cE(a,o);if(o.width)return{x:ff(o.width/2+o.x),y:ff(o.height/2+o.y)}}function i(o){var a=o.context,s=a.snapPoints,c=a.connection,p=c.waypoints,l=a.segmentStart,u=a.segmentStartIndex,h=a.segmentEnd,d=a.segmentEndIndex,f=a.axis;if(s)return s;var v=[p[u-1],l,h,p[d+1]];return u<2&&v.unshift(n(c.source,o)),d>p.length-3&&v.unshift(n(c.target,o)),a.snapPoints=s={horizontal:[],vertical:[]},k(v,function(g){g&&(g=g.original||g,f==="y"&&s.horizontal.push(g.y),f==="x"&&s.vertical.push(g.x))}),s}t.on("connectionSegment.move.move",1500,function(o){var a=i(o),s=o.x,c=o.y,p,l;if(a){p=e(a.vertical,s),l=e(a.horizontal,c);var u=s-p,h=c-l;N(o,{dx:o.dx-u,dy:o.dy-h,x:p,y:l}),(u||a.vertical.indexOf(s)!==-1)&&Kt(o,"x",p),(h||a.horizontal.indexOf(c)!==-1)&&Kt(o,"y",l)}});function r(o){var a=o.snapPoints,s=o.connection.waypoints,c=o.bendpointIndex;if(a)return a;var p=[s[c-1],s[c+1]];return o.snapPoints=a={horizontal:[],vertical:[]},k(p,function(l){l&&(l=l.original||l,a.horizontal.push(l.y),a.vertical.push(l.x))}),a}t.on(["connect.hover","connect.move","connect.end"],1500,function(o){var a=o.context,s=a.hover,c=s&&n(s,o);!Dt(s)||!c||!c.x||!c.y||(Kt(o,"x",c.x),Kt(o,"y",c.y))}),t.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var a=o.context,s=r(a),c=a.hover,p=c&&n(c,o),l=o.x,u=o.y,h,d;if(s){h=e(p?s.vertical.concat([p.x]):s.vertical,l),d=e(p?s.horizontal.concat([p.y]):s.horizontal,u);var f=l-h,v=u-d;N(o,{dx:o.dx-f,dy:o.dy-v,x:o.x-f,y:o.y-v}),(f||s.vertical.indexOf(l)!==-1)&&Kt(o,"x",h),(v||s.horizontal.indexOf(u)!==-1)&&Kt(o,"y",d)}})}mf.$inject=["eventBus"];const gE={__depends__:[$n,_n],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Yd],bendpointMove:["type",pp],bendpointMovePreview:["type",nf],connectionSegmentMove:["type",pf],bendpointSnapping:["type",mf]};function vf(t,e,n,i){function r(a,s){return i.allowed("connection.create",{source:a,target:s})}function o(a,s){return r(s,a)}t.on("connect.hover",function(a){var s=a.context,c=s.start,p=a.hover,l;if(s.hover=p,l=s.canExecute=r(c,p),!ig(l)){if(l!==!1){s.source=c,s.target=p;return}l=s.canExecute=o(c,p),!ig(l)&&l!==!1&&(s.source=p,s.target=c)}}),t.on(["connect.out","connect.cleanup"],function(a){var s=a.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),t.on("connect.end",function(a){var s=a.context,c=s.canExecute,p=s.connectionStart,l={x:a.x,y:a.y},u=s.source,h=s.target;if(!c)return!1;var d=null,f={connectionStart:hp(s)?l:p,connectionEnd:hp(s)?p:l};oe(c)&&(d=c),s.connection=n.connect(u,h,d,f)}),this.start=function(a,s,c,p){oe(c)||(p=c,c=nt(s)),e.init(a,"connect",{autoActivate:p,data:{shape:s,context:{start:s,connectionStart:c}}})}}vf.$inject=["eventBus","dragging","modeling","rules"];function hp(t){var e=t.hover,n=t.source,i=t.target;return e&&n&&e===n&&n!==i}var bE=1100,xE=900,yf="connect-ok",gf="connect-not-ok";function bf(t,e,n){var i=t.get("connectionPreview",!1);i&&e.on("connect.move",function(r){var o=r.context,a=o.canExecute,s=o.hover,c=o.source,p=o.start,l=o.startPosition,u=o.target,h=o.connectionStart||l,d=o.connectionEnd||{x:r.x,y:r.y},f=h,v=d;hp(o)&&(f=d,v=h),i.drawPreview(o,a,{source:c||p,target:u||s,connectionStart:f,connectionEnd:v})}),e.on("connect.hover",xE,function(r){var o=r.context,a=r.hover,s=o.canExecute;s!==null&&n.addMarker(a,s?yf:gf)}),e.on(["connect.out","connect.cleanup"],bE,function(r){var o=r.hover;o&&(n.removeMarker(o,yf),n.removeMarker(o,gf))}),i&&e.on("connect.cleanup",function(r){i.cleanUp(r.context)})}bf.$inject=["injector","eventBus","canvas"];const dp={__depends__:[bn,_n,$n],__init__:["connectPreview"],connect:["type",vf],connectPreview:["type",bf]};var _E="djs-dragger";function zn(t,e,n,i){this._canvas=e,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=t.get("connectionDocking",!1),this._layouter=t.get("layouter",!1)}zn.$inject=["injector","canvas","graphicsFactory","elementFactory"],zn.prototype.drawPreview=function(t,e,n){n=n||{};var i=t.connectionPreviewGfx,r=t.getConnection,o=n.source,a=n.target,s=n.waypoints,c=n.connectionStart,p=n.connectionEnd,l=n.noLayout,u=n.noCropping,h=n.noNoop,d,f=this;if(i||(i=t.connectionPreviewGfx=this.createConnectionPreviewGfx()),Fo(i),r||(r=t.getConnection=EE(function(v,g,R){return f.getConnection(v,g,R)})),e&&(d=r(e,o,a)),!d){!h&&this.drawNoopPreview(i,n);return}d.waypoints=s||[],this._layouter&&!l&&(d.waypoints=this._layouter.layoutConnection(d,{source:o,target:a,connectionStart:c,connectionEnd:p,waypoints:n.waypoints||d.waypoints})),(!d.waypoints||!d.waypoints.length)&&(d.waypoints=[o?nt(o):c,a?nt(a):p]),this._connectionDocking&&(o||a)&&!u&&(d.waypoints=this._connectionDocking.getCroppedWaypoints(d,o,a)),this._graphicsFactory.drawConnection(i,d,{stroke:"var(--element-dragger-color)"})},zn.prototype.drawNoopPreview=function(t,e){var n=e.source,i=e.target,r=e.connectionStart||nt(n),o=e.connectionEnd||nt(i),a=this.cropWaypoints(r,o,n,i),s=this.createNoopConnection(a[0],a[1]);tt(t,s)},zn.prototype.cropWaypoints=function(t,e,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[t,e]});return t=n&&mc(o,s,!0)||t,e=i&&mc(a,s,!1)||e,[t,e]},zn.prototype.cleanUp=function(t){t&&t.connectionPreviewGfx&&Gt(t.connectionPreviewGfx)},zn.prototype.getConnection=function(t){var e=wE(t);return this._elementFactory.createConnection(e)},zn.prototype.createConnectionPreviewGfx=function(){var t=Z("g");return Y(t,{pointerEvents:"none"}),ht(t).add(_E),tt(this._canvas.getActiveLayer(),t),t},zn.prototype.createNoopConnection=function(t,e){return Vo([t,e],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function EE(t){var e={};return function(n){var i=JSON.stringify(n),r=e[i];return r||(r=e[i]=t.apply(null,arguments)),r}}function wE(t){return oe(t)?t:{}}const SE={__init__:["connectionPreview"],connectionPreview:["type",zn]};var xf=Math.min,_f=Math.max;function fp(t){t.preventDefault()}function Xr(t){t.stopPropagation()}function CE(t){return t.nodeType===Node.TEXT_NODE}function RE(t){return[].slice.call(t)}function nn(t){this.container=t.container,this.parent=Mt('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=At("[contenteditable]",this.parent),this.keyHandler=t.keyHandler||function(){},this.resizeHandler=t.resizeHandler||function(){},this.autoResize=Ce(this.autoResize,this),this.handlePaste=Ce(this.handlePaste,this)}nn.prototype.create=function(t,e,n,i){var r=this,o=this.parent,a=this.content,s=this.container;i=this.options=i||{},e=this.style=e||{};var c=un(e,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);N(o.style,{width:t.width+"px",height:t.height+"px",maxWidth:t.maxWidth+"px",maxHeight:t.maxHeight+"px",minWidth:t.minWidth+"px",minHeight:t.minHeight+"px",left:t.x+"px",top:t.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var p=un(e,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return N(a.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},p),i.centerVertically&&N(a.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},p),a.innerText=n,J.bind(a,"keydown",this.keyHandler),J.bind(a,"mousedown",Xr),J.bind(a,"paste",r.handlePaste),i.autoResize&&J.bind(a,"input",this.autoResize),i.resizable&&this.resizable(e),s.appendChild(o),this.setSelection(a.lastChild,a.lastChild&&a.lastChild.length),o},nn.prototype.handlePaste=function(t){var e=this.options,n=this.style;t.preventDefault();var i;if(t.clipboardData?i=t.clipboardData.getData("text/plain"):i=window.clipboardData.getData("Text"),this.insertText(i),e.autoResize){var r=this.autoResize(n);r&&this.resizeHandler(r)}},nn.prototype.insertText=function(t){t=PE(t);var e=document.execCommand("insertText",!1,t);e||this._insertTextIE(t)},nn.prototype._insertTextIE=function(t){var e=this.getSelection(),n=e.startContainer,i=e.endContainer,r=e.startOffset,o=e.endOffset,a=e.commonAncestorContainer,s=RE(a.childNodes),c,p;if(CE(a)){var l=n.textContent;n.textContent=l.substring(0,r)+t+l.substring(o),c=n,p=r+t.length}else if(n===this.content&&i===this.content){var u=document.createTextNode(t);this.content.insertBefore(u,s[r]),c=u,p=u.textContent.length}else{var h=s.indexOf(n),d=s.indexOf(i);s.forEach(function(f,v){v===h?f.textContent=n.textContent.substring(0,r)+t+i.textContent.substring(o):v>h&&v<=d&&dn(f)}),c=n,p=r+t.length}c&&p!==void 0&&setTimeout(function(){self.setSelection(c,p)})},nn.prototype.autoResize=function(){var t=this.parent,e=this.content,n=parseInt(this.style.fontSize)||12;if(e.scrollHeight>t.offsetHeight||e.scrollHeight<t.offsetHeight-n){var i=t.getBoundingClientRect(),r=e.scrollHeight;t.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},nn.prototype.resizable=function(){var t=this,e=this.parent,n=this.resizeHandle,i=parseInt(this.style.minWidth)||0,r=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,a=parseInt(this.style.maxHeight)||1/0;if(!n){n=this.resizeHandle=Mt('<div class="djs-direct-editing-resize-handle"></div>');var s,c,p,l,u=function(f){fp(f),Xr(f),s=f.clientX,c=f.clientY;var v=e.getBoundingClientRect();p=v.width,l=v.height,J.bind(document,"mousemove",h),J.bind(document,"mouseup",d)},h=function(f){fp(f),Xr(f);var v=xf(_f(p+f.clientX-s,i),o),g=xf(_f(l+f.clientY-c,r),a);e.style.width=v+"px",e.style.height=g+"px",t.resizeHandler({width:p,height:l,dx:f.clientX-s,dy:f.clientY-c})},d=function(f){fp(f),Xr(f),J.unbind(document,"mousemove",h,!1),J.unbind(document,"mouseup",d,!1)};J.bind(n,"mousedown",u)}N(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"}),e.appendChild(n)},nn.prototype.destroy=function(){var t=this.parent,e=this.content,n=this.resizeHandle;e.innerText="",t.removeAttribute("style"),e.removeAttribute("style"),J.unbind(e,"keydown",this.keyHandler),J.unbind(e,"mousedown",Xr),J.unbind(e,"input",this.autoResize),J.unbind(e,"paste",this.handlePaste),n&&(n.removeAttribute("style"),dn(n)),dn(t)},nn.prototype.getValue=function(){return this.content.innerText.trim()},nn.prototype.getSelection=function(){var t=window.getSelection(),e=t.getRangeAt(0);return e},nn.prototype.setSelection=function(t,e){var n=document.createRange();t===null?n.selectNodeContents(this.content):(n.setStart(t,e),n.setEnd(t,e));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)};function PE(t){return t.replace(/\r\n|\r|\n/g,`
- `)}function Ye(t,e){this._eventBus=t,this._providers=[],this._textbox=new nn({container:e.getContainer(),keyHandler:Ce(this._handleKey,this),resizeHandler:Ce(this._handleResize,this)})}Ye.$inject=["eventBus","canvas"],Ye.prototype.registerProvider=function(t){this._providers.push(t)},Ye.prototype.isActive=function(t){return!!(this._active&&(!t||this._active.element===t))},Ye.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Ye.prototype._fire=function(t,e){this._eventBus.fire("directEditing."+t,e||{active:this._active})},Ye.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},Ye.prototype.complete=function(){var t=this._active;if(t){var e,n=t.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue(),o=t.context.text;(r!==o||i.height!==n.height||i.width!==n.width)&&(e=this._textbox.container.getBoundingClientRect(),t.provider.update(t.element,r,t.context.text,{x:i.left-e.left,y:i.top-e.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},Ye.prototype.getValue=function(){return this._textbox.getValue()},Ye.prototype._handleKey=function(t){t.stopPropagation();var e=t.keyCode||t.charCode;if(e===27)return t.preventDefault(),this.cancel();if(e===13&&!t.shiftKey)return t.preventDefault(),this.complete()},Ye.prototype._handleResize=function(t){this._fire("resize",t)},Ye.prototype.activate=function(t){this.isActive()&&this.cancel();var e,n=yt(this._providers,function(i){return(e=i.activate(t))?i:null});return e&&(this.$textbox=this._textbox.create(e.bounds,e.style,e.text,e.options),this._active={element:t,context:e,provider:n},e.options&&e.options.resizable&&(this.resizable=!0),this._fire("activate")),!!e};const Ef={__depends__:[zr],__init__:["directEditing"],directEditing:["type",Ye]};var kE=["marker-start","marker-mid","marker-end"],TE=["circle","ellipse","line","path","polygon","polyline","path","rect"];function pi(t,e,n,i){this._elementRegistry=t,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;e.on("drag.cleanup",function(){r.cleanUp()})}pi.$inject=["elementRegistry","eventBus","canvas","styles"],pi.prototype.cleanUp=function(){var t=this;k(t._clonedMarkers,function(e){Gt(e)}),t._clonedMarkers={}},pi.prototype.getGfx=function(t){return this._elementRegistry.getGraphics(t)},pi.prototype.addDragger=function(t,e,n,i="djs-dragger"){n=n||this.getGfx(t);var r=hu(n),o=n.getBoundingClientRect();return this._cloneMarkers(ta(r),i),Y(r,this._styles.cls(i,[],{x:o.top,y:o.left})),tt(e,r),Y(r,"data-preview-support-element-id",t.id),r},pi.prototype.addFrame=function(t,e){var n=Z("rect",{class:"djs-resize-overlay",width:t.width,height:t.height,x:t.x,y:t.y});return tt(e,n),Y(n,"data-preview-support-element-id",t.id),n},pi.prototype._cloneMarkers=function(t,e="djs-dragger"){var n=this;if(t.childNodes)for(var i=0;i<t.childNodes.length;i++)n._cloneMarkers(t.childNodes[i],e);BE(t)&&kE.forEach(function(r){if(Y(t,r)){var o=AE(t,r,n._canvas.getContainer());n._cloneMarker(t,o,r,e)}})},pi.prototype._cloneMarker=function(t,e,n,i="djs-dragger"){var r=e.id+"-"+i,o=this._clonedMarkers[r];if(!o){o=hu(e);var a=r+"-clone";o.id=a,ht(o).add(i),this._clonedMarkers[r]=o;var s=At("defs",this._canvas._svg);s||(s=Z("defs"),tt(this._canvas._svg,s)),tt(s,o)}var c=DE(this._clonedMarkers[r].id);Y(t,n,c)};function AE(t,e,n){var i=ME(Y(t,e));return At("marker#"+i,n||document)}function ME(t){return t.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function DE(t){return"url(#"+t+")"}function BE(t){return TE.indexOf(t.nodeName)!==-1}const Zr={__init__:["previewSupport"],previewSupport:["type",pi]};var NE="drop-ok",wf="drop-not-ok",Sf="attach-ok",Cf="new-parent",Rf="create",OE=2e3;function Pf(t,e,n,i,r){function o(c,p,l,u,h){if(!p)return!1;c=ct(c,function(E){var _=E.labelTarget;return!E.parent&&!(xt(E)&&c.indexOf(_)!==-1)});var d=yt(c,function(E){return!Dt(E)}),f=!1,v=!1,g=!1;Tf(c)&&(f=r.allowed("shape.attach",{position:l,shape:d,target:p})),f||(Tf(c)?g=r.allowed("shape.create",{position:l,shape:d,source:u,target:p}):g=r.allowed("elements.create",{elements:c,position:l,target:p}));var R=h.connectionTarget;return g||f?(d&&u&&(v=r.allowed("connection.create",{source:R===u?d:u,target:R===u?u:d,hints:{targetParent:p,targetAttach:f}})),{attach:f,connect:v}):g===null||f===null?null:!1}function a(c,p){[Sf,NE,wf,Cf].forEach(function(l){l===p?t.addMarker(c,l):t.removeMarker(c,l)})}n.on(["create.move","create.hover"],function(c){var p=c.context,l=p.elements,u=c.hover,h=p.source,d=p.hints||{};if(!u){p.canExecute=!1,p.target=null;return}kf(c);var f={x:c.x,y:c.y},v=p.canExecute=u&&o(l,u,f,h,d);u&&v!==null&&(p.target=u,v&&v.attach?a(u,Sf):a(u,v?Cf:wf))}),n.on(["create.end","create.out","create.cleanup"],function(c){var p=c.hover;p&&a(p,null)}),n.on("create.end",function(c){var p=c.context,l=p.source,u=p.shape,h=p.elements,d=p.target,f=p.canExecute,v=f&&f.attach,g=f&&f.connect,R=p.hints||{};if(f===!1||!d)return!1;kf(c);var E={x:c.x,y:c.y};g?u=i.appendShape(l,u,E,d,{attach:v,connection:g===!0?{}:g,connectionTarget:R.connectionTarget}):(h=i.createElements(h,E,d,N({},R,{attach:v})),u=yt(h,function(_){return!Dt(_)})),N(p,{elements:h,shape:u}),N(c,{elements:h,shape:u})});function s(){var c=e.context();c&&c.prefix===Rf&&e.cancel()}n.on("create.init",function(){n.on("elements.changed",s),n.once(["create.cancel","create.end"],OE,function(){n.off("elements.changed",s)})}),this.start=function(c,p,l){lt(p)||(p=[p]);var u=yt(p,function(f){return!Dt(f)});if(u){l=N({elements:p,hints:{},shape:u},l||{}),k(p,function(f){it(f.x)||(f.x=0),it(f.y)||(f.y=0)});var h=ct(p,function(f){return!f.hidden}),d=Vt(h);k(p,function(f){Dt(f)&&(f.waypoints=be(f.waypoints,function(v){return{x:v.x-d.x-d.width/2,y:v.y-d.y-d.height/2}})),N(f,{x:f.x-d.x-d.width/2,y:f.y-d.y-d.height/2})}),e.init(c,Rf,{cursor:"grabbing",autoActivate:!0,data:{shape:u,elements:p,context:l}})}}}Pf.$inject=["canvas","dragging","eventBus","modeling","rules"];function kf(t){var e=t.context,n=e.createConstraints;n&&(n.left&&(t.x=Math.max(t.x,n.left)),n.right&&(t.x=Math.min(t.x,n.right)),n.top&&(t.y=Math.max(t.y,n.top)),n.bottom&&(t.y=Math.min(t.y,n.bottom)))}function Tf(t){return t&&t.length===1&&!Dt(t[0])}var jE=750;function Af(t,e,n,i,r){function o(a){var s=Z("g");Y(s,r.cls("djs-drag-group",["no-events"]));var c=Z("g");return a.forEach(function(p){var l;p.hidden||(p.waypoints?(l=n._createContainer("connection",c),n.drawConnection(ta(l),p)):(l=n._createContainer("shape",c),n.drawShape(ta(l),p),ke(l,p.x,p.y)),i.addDragger(p,s,l))}),s}e.on("create.move",jE,function(a){var s=a.hover,c=a.context,p=c.elements,l=c.dragGroup;l||(l=c.dragGroup=o(p));var u;s?(l.parentNode||(u=t.getActiveLayer(),tt(u,l)),ke(l,a.x,a.y)):Gt(l)}),e.on("create.cleanup",function(a){var s=a.context,c=s.dragGroup;c&&Gt(c)})}Af.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const Oa={__depends__:[$n,Zr,_n,bn],__init__:["create","createPreview"],create:["type",Pf],createPreview:["type",Af]};function Qr(){}Qr.prototype.get=function(){return this._data},Qr.prototype.set=function(t){this._data=t},Qr.prototype.clear=function(){var t=this._data;return delete this._data,t},Qr.prototype.isEmpty=function(){return!this._data};const LE={clipboard:["type",Qr]};function mp(t){var e=this;this._lastMoveEvent=null;function n(i){e._lastMoveEvent=i}t.on("canvas.init",function(i){var r=e._svg=i.svg;r.addEventListener("mousemove",n)}),t.on("canvas.destroy",function(){e._lastMouseEvent=null,e._svg.removeEventListener("mousemove",n)})}mp.$inject=["eventBus"],mp.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||IE(0,0)};function IE(t,e){var n=document.createEvent("MouseEvent"),i=t,r=e,o=t,a=e;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}const Jr={__init__:["mouse"],mouse:["type",mp]};function rn(t,e,n,i,r,o,a,s){this._canvas=t,this._create=e,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=s,r.on("copyPaste.copyElement",function(c){var p=c.descriptor,l=c.element,u=c.elements;p.priority=1,p.id=l.id;var h=yt(u,function(d){return d===l.parent});h&&(p.parent=l.parent.id),$E(l)&&(p.priority=2,p.host=l.host.id),Dt(l)&&(p.priority=3,p.source=l.source.id,p.target=l.target.id,p.waypoints=zE(l)),xt(l)&&(p.priority=4,p.labelTarget=l.labelTarget.id),k(["x","y","width","height"],function(d){it(l[d])&&(p[d]=l[d])}),p.hidden=l.hidden,p.collapsed=l.collapsed}),r.on("copyPaste.pasteElements",function(c){var p=c.hints;N(p,{createElementsBehavior:!1})})}rn.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],rn.prototype.copy=function(t){var e,n;return lt(t)||(t=t?[t]:[]),e=this._eventBus.fire("copyPaste.canCopyElements",{elements:t}),e===!1?n={}:n=this.createTree(lt(e)?e:t),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:t,tree:n}),n},rn.prototype.paste=function(t){var e=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=t&&t.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(e);if(t&&t.element&&t.point)return this._paste(i,t.element,t.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},rn.prototype._paste=function(t,e,n,i){k(t,function(o){it(o.x)||(o.x=0),it(o.y)||(o.y=0)});var r=Vt(t);return k(t,function(o){Dt(o)&&(o.waypoints=be(o.waypoints,function(a){return{x:a.x-r.x-r.width/2,y:a.y-r.y-r.height/2}})),N(o,{x:o.x-r.x-r.width/2,y:o.y-r.y-r.height/2})}),this._modeling.createElements(t,n,e,N({},i))},rn.prototype._createElements=function(t){var e=this,n=this._eventBus,i={},r=[];return k(t,function(o,a){o=ln(o,"priority"),k(o,function(s){var c=N({},Tn(s,["priority"]));i[s.parent]?c.parent=i[s.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:c});var p;if(Dt(c)){c.source=i[s.source],c.target=i[s.target],p=i[s.id]=e.createConnection(c),r.push(p);return}if(xt(c)){c.labelTarget=i[c.labelTarget],p=i[s.id]=e.createLabel(c),r.push(p);return}c.host&&(c.host=i[c.host]),p=i[s.id]=e.createShape(c),r.push(p)})}),r},rn.prototype.createConnection=function(t){var e=this._elementFactory.createConnection(Tn(t,["id"]));return e},rn.prototype.createLabel=function(t){var e=this._elementFactory.createLabel(Tn(t,["id"]));return e},rn.prototype.createShape=function(t){var e=this._elementFactory.createShape(Tn(t,["id"]));return e},rn.prototype.hasRelations=function(t,e){var n,i,r;return!(Dt(t)&&(i=yt(e,hn({id:t.source.id})),r=yt(e,hn({id:t.target.id})),!i||!r)||xt(t)&&(n=yt(e,hn({id:t.labelTarget.id})),!n))},rn.prototype.createTree=function(t){var e=this._rules,n=this,i={},r=[],o=Wo(t);function a(p,l){return e.allowed("element.copy",{element:p,elements:l})}function s(p,l){var u=yt(r,function(h){return p===h.element});if(!u){r.push({element:p,depth:l});return}u.depth<l&&(r=c(u,r),r.push({element:u.element,depth:l}))}function c(p,l){var u=l.indexOf(p);return u!==-1&&l.splice(u,1),l}return Si(o,function(p,l,u){if(xt(p))return;k(p.labels,function(f){s(f,u)});function h(f){f&&f.length&&k(f,function(v){k(v.labels,function(g){s(g,u)}),s(v,u)})}k([p.attachers,p.incoming,p.outgoing],h),s(p,u);var d=[];return p.children&&(d=p.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:p,children:d}),d}),t=be(r,function(p){return p.element}),r=be(r,function(p){return p.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:p.descriptor,element:p.element,elements:t}),p}),r=ln(r,function(p){return p.descriptor.priority}),t=be(r,function(p){return p.element}),k(r,function(p){var l=p.depth;if(!n.hasRelations(p.element,t)){Df(p.element,t);return}if(!a(p.element,t)){Df(p.element,t);return}i[l]||(i[l]=[]),i[l].push(p.descriptor)}),i};function $E(t){return!!t.host}function zE(t){return be(t.waypoints,function(e){return e=Mf(e),e.original&&(e.original=Mf(e.original)),e})}function Mf(t){return N({},t)}function Df(t,e){var n=e.indexOf(t);return n===-1?e:e.splice(n,1)}const FE={__depends__:[LE,Oa,Jr,_n],__init__:["copyPaste"],copyPaste:["type",rn]};function vp(t,e,n){lt(n)||(n=[n]),k(n,function(i){Ks(t[i])||(e[i]=t[i])})}var yp=750;function Bf(t,e,n){function i(c,p){var l=t.create(c.$type);return n.copyElement(c,l,null,p)}e.on("copyPaste.copyElement",yp,function(c){var p=c.descriptor,l=c.element,u=W(l);if(xt(l))return p;var h=p.businessObject=i(u,!0),d=p.di=i(gt(l),!0);d.bpmnElement=h,vp(h,p,"name"),vp(d,p,"isExpanded"),u.default&&(p.default=u.default.id)});var r="-bpmn-js-refs";function o(c){return c[r]=c[r]||{}}function a(c,p){c[r]=p}function s(c,p,l){var u=W(c);return c.default&&(l[c.default]={element:u,property:"default"}),c.host&&(W(c).attachedToRef=W(p[c.host])),Tn(l,Ge(l,function(h,d,f){var v=d.element,g=d.property;return f===c.id&&(v[g]=u,h.push(c.id)),h},[]))}e.on("copyPaste.pasteElement",function(c){var p=c.cache,l=c.descriptor,u=l.businessObject,h=l.di;if(xt(l)){l.businessObject=W(p[l.labelTarget]),l.di=gt(p[l.labelTarget]);return}u=l.businessObject=i(u),h=l.di=i(h),h.bpmnElement=u,vp(l,u,["isExpanded","name"]),l.type=u.$type}),e.on("copyPaste.copyElement",yp,function(c){var p=c.descriptor,l=c.element;if(y(l,"bpmn:Participant")){var u=W(l);u.processRef&&(p.processRef=i(u.processRef,!0))}}),e.on("copyPaste.pasteElement",function(c){var p=c.descriptor,l=p.processRef;l&&(p.processRef=i(l))}),e.on("copyPaste.pasteElement",yp,function(c){var p=c.cache,l=c.descriptor;a(p,s(l,p,o(p)))})}Bf.$inject=["bpmnFactory","eventBus","moddleCopy"];var HE=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"];function to(t,e,n){this._bpmnFactory=e,this._eventBus=t,this._moddle=n,t.on("moddleCopy.canCopyProperties",function(i){var r=i.propertyNames;if(!(!r||!r.length))return ln(r,function(o){return o==="extensionElements"})}),t.on("moddleCopy.canCopyProperty",function(i){var r=i.parent,o=oe(r)&&r.$descriptor,a=i.propertyName;if(a&&HE.indexOf(a)!==-1||a&&o&&!yt(o.properties,hn({name:a})))return!1}),t.on("moddleCopy.canSetCopiedProperty",function(i){var r=i.property;if(GE(r,"bpmn:ExtensionElements")&&(!r.values||!r.values.length))return!1})}to.$inject=["eventBus","bpmnFactory","moddle"],to.prototype.copyElement=function(t,e,n,i=!1){var r=this;n&&!lt(n)&&(n=[n]),n=n||gp(t.$descriptor);var o=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:t,targetElement:e,clone:i});return o===!1||(lt(o)&&(n=o),k(n,function(a){var s;pn(t,a)&&(s=t.get(a));var c=r.copyProperty(s,e,a,i);if(ae(c)){var p=r._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:e,property:c,propertyName:a});p!==!1&&e.set(a,c)}})),e},to.prototype.copyProperty=function(t,e,n,i=!1){var r=this,o=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:e,property:t,propertyName:n,clone:i});if(o!==!1){if(o)return oe(o)&&o.$type&&!o.$parent&&(o.$parent=e),o;var a=this._moddle.getPropertyDescriptor(e,n);if(!a.isReference)return a.isId?t&&this._copyId(t,e,i):lt(t)?Ge(t,function(s,c){return o=r.copyProperty(c,e,n,i),o?s.concat(o):s},[]):oe(t)&&t.$type?this._moddle.getElementDescriptor(t).isGeneric?void 0:(o=r._bpmnFactory.create(t.$type),o.$parent=e,o=r.copyElement(t,o,null,i),o):t}},to.prototype._copyId=function(t,e,n=!1){if(n)return t;if(!this._moddle.ids.assigned(t))return this._moddle.ids.claim(t,e),t};function gp(t,e){return Ge(t.properties,function(n,i){return e&&i.default?n:n.concat(i.name)},[])}function GE(t,e){return t&&pe(t.$instanceOf)&&t.$instanceOf(e)}const Nf={__depends__:[FE],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",Bf],moddleCopy:["type",to]};var Of=Math.round;function bp(t,e){this._modeling=t,this._eventBus=e}bp.$inject=["modeling","eventBus"],bp.prototype.replaceElement=function(t,e,n){if(t.waypoints)return null;var i=this._modeling,r=this._eventBus;r.fire("replace.start",{element:t,attrs:e,hints:n});var o=e.width||t.width,a=e.height||t.height,s=e.x||t.x,c=e.y||t.y,p=Of(s+o/2),l=Of(c+a/2),u=i.replaceShape(t,N({},e,{x:p,y:l,width:o,height:a}),n);return r.fire("replace.end",{element:t,newElement:u,hints:n}),u};function jf(t,e){e.on("replace.end",500,function(n){const{newElement:i,hints:r={}}=n;r.select!==!1&&t.select(i)})}jf.$inject=["selection","eventBus"];const VE={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",jf],replace:["type",bp]};function WE(t,e,n){lt(n)||(n=[n]),k(n,function(i){Ks(t[i])||(e[i]=t[i])})}var UE=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function qE(t,e){var n=t&&pn(t,"collapsed")?t.collapsed:!vt(t),i;return e&&(pn(e,"collapsed")||pn(e,"isExpanded"))?i=pn(e,"collapsed")?e.collapsed:!e.isExpanded:i=n,n!==i}function Lf(t,e,n,i,r,o){function a(s,c,p){p=p||{};var l=c.type,u=s.businessObject;if(ja(u)&&l==="bpmn:SubProcess"&&qE(s,c))return i.toggleCollapse(s),s;var h=t.create(l),d={type:l,businessObject:h};d.di={},WE(s.di,d.di,["fill","stroke","background-color","border-color","color"]);var f=gp(u.$descriptor),v=gp(h.$descriptor,!0),g=KE(f,v);N(h,un(c,UE));var R=ct(g,function(_){return _==="eventDefinitions"?If(s,c.eventDefinitionType):_==="loopCharacteristics"?!Oe(h):!(pn(h,_)||_==="processRef"&&c.isExpanded===!1||_==="triggeredByEvent")});if(h=n.copyElement(u,h,R),c.eventDefinitionType&&(If(h,c.eventDefinitionType)||(d.eventDefinitionType=c.eventDefinitionType,d.eventDefinitionAttrs=c.eventDefinitionAttrs)),y(u,"bpmn:Activity")){if(ja(u))d.isExpanded=vt(s);else if(c&&pn(c,"isExpanded")){d.isExpanded=c.isExpanded;var E=e.getDefaultSize(h,{isExpanded:d.isExpanded});d.width=E.width,d.height=E.height,d.x=s.x-(d.width-s.width)/2,d.y=s.y-(d.height-s.height)/2}vt(s)&&!y(u,"bpmn:Task")&&d.isExpanded&&(d.width=s.width,d.height=s.height)}return ja(u)&&!ja(h)&&(p.moveChildren=!1),y(u,"bpmn:Participant")&&(c.isExpanded===!0?h.processRef=t.create("bpmn:Process"):p.moveChildren=!1,d.width=s.width,d.height=e.getDefaultSize(d).height),o.allowed("shape.resize",{shape:h})||(d.height=e.getDefaultSize(d).height,d.width=e.getDefaultSize(d).width),h.name=u.name,dt(u,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&dt(h,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(h.default=u.default),c.host&&!y(u,"bpmn:BoundaryEvent")&&y(h,"bpmn:BoundaryEvent")&&(d.host=c.host),(d.type==="bpmn:DataStoreReference"||d.type==="bpmn:DataObjectReference")&&(d.x=s.x+(s.width-d.width)/2),r.replaceElement(s,d,p)}this.replaceElement=a}Lf.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function ja(t){return y(t,"bpmn:SubProcess")}function If(t,e){var n=W(t);return e&&n.get("eventDefinitions").some(function(i){return y(i,e)})}function KE(t,e){return t.filter(function(n){return e.includes(n)})}const $f={__depends__:[Nf,VE,bn],bpmnReplace:["type",Lf]};function zf(t){return function(e){var n=e.target,i=W(t),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=!!n.triggeredByEvent==!!i.triggeredByEvent,c=n.isExpanded===void 0||n.isExpanded===vt(t);return!o||!a||!s||!c}}var YE=[{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"}}],XE=[{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"}}],ZE=[{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"}}],QE=[{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"}}],JE=[{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"}}],tw=[{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}}],Ff=[{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}}],ew=Ff,Hf=[{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}}],nw=[{label:"Data Store Reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],iw=[{label:"Data Object Reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],rw=[{label:"Message Boundary Event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Boundary Event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Boundary Event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Boundary Event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Error Boundary Event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel Boundary Event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Signal Boundary Event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Compensation Boundary Event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{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}}],ow=[{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"}},{label:"Error Start Event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Escalation Start Event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Compensation Start Event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{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}}],aw=[{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"}],sw=[{label:"Expanded Pool",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(t){var e="Empty Pool";return t.children&&t.children.length&&(e+=" (removes content)"),e},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];function Xe(t,e,n,i,r,o,a){this._bpmnFactory=t,this._popupMenu=e,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this._register()}Xe.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate"],Xe.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},Xe.prototype.getPopupMenuEntries=function(t){var e=t.businessObject,n=this._rules,i=[];if(lt(t)||!n.allowed("shape.replace",{element:t}))return{};var r=zf(t);return y(e,"bpmn:DataObjectReference")?this._createEntries(t,nw):y(e,"bpmn:DataStoreReference")&&!y(t.parent,"bpmn:Collaboration")?this._createEntries(t,iw):y(e,"bpmn:StartEvent")&&!y(e.$parent,"bpmn:SubProcess")?(i=ct(YE,r),this._createEntries(t,i)):y(e,"bpmn:Participant")?(i=ct(sw,function(o){return vt(t)!==o.target.isExpanded}),this._createEntries(t,i)):y(e,"bpmn:StartEvent")&&Oe(e.$parent)?(i=ct(ow,function(o){var a=o.target,s=a.isInterrupting!==!1,c=e.isInterrupting===s;return r(o)||!r(o)&&!c}),this._createEntries(t,i)):y(e,"bpmn:StartEvent")&&!Oe(e.$parent)&&y(e.$parent,"bpmn:SubProcess")?(i=ct(XE,r),this._createEntries(t,i)):y(e,"bpmn:EndEvent")?(i=ct(QE,function(o){var a=o.target;return a.eventDefinitionType=="bpmn:CancelEventDefinition"&&!y(e.$parent,"bpmn:Transaction")?!1:r(o)}),this._createEntries(t,i)):y(e,"bpmn:BoundaryEvent")?(i=ct(rw,function(o){var a=o.target;if(a.eventDefinitionType=="bpmn:CancelEventDefinition"&&!y(e.attachedToRef,"bpmn:Transaction"))return!1;var s=a.cancelActivity!==!1,c=e.cancelActivity==s;return r(o)||!r(o)&&!c}),this._createEntries(t,i)):y(e,"bpmn:IntermediateCatchEvent")||y(e,"bpmn:IntermediateThrowEvent")?(i=ct(ZE,r),this._createEntries(t,i)):y(e,"bpmn:Gateway")?(i=ct(JE,r),this._createEntries(t,i)):y(e,"bpmn:Transaction")?(i=ct(Ff,r),this._createEntries(t,i)):Oe(e)&&vt(t)?(i=ct(ew,r),this._createEntries(t,i)):y(e,"bpmn:SubProcess")&&vt(t)?(i=ct(tw,r),this._createEntries(t,i)):y(e,"bpmn:AdHocSubProcess")&&!vt(t)?(i=ct(Hf,function(o){var a=o.target,s=a.type==="bpmn:SubProcess",c=a.isExpanded===!0;return zf(a)&&(!s||c)}),this._createEntries(t,i)):y(e,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(t,aw):y(e,"bpmn:FlowNode")?(i=ct(Hf,r),y(e,"bpmn:SubProcess")&&!vt(t)&&(i=ct(i,function(o){return o.label!=="Sub Process (collapsed)"})),this._createEntries(t,i)):{}},Xe.prototype.getPopupMenuHeaderEntries=function(t){var e={};return y(t,"bpmn:Activity")&&!Oe(t)&&(e=Ct(Ct({},e),this._getLoopCharacteristicsHeaderEntries(t))),y(t,"bpmn:DataObjectReference")&&(e=Ct(Ct({},e),this._getCollectionHeaderEntries(t))),y(t,"bpmn:Participant")&&(e=Ct(Ct({},e),this._getParticipantMultiplicityHeaderEntries(t))),y(t,"bpmn:SubProcess")&&!y(t,"bpmn:Transaction")&&!Oe(t)&&(e=Ct(Ct({},e),this._getAdHocHeaderEntries(t))),e},Xe.prototype._createEntries=function(t,e){var n={},i=this;return k(e,function(r){n[r.actionName]=i._createEntry(r,t)}),n},Xe.prototype._createSequenceFlowEntries=function(t,e){var n=W(t),i={},r=this._modeling,o=this._moddle,a=this;return k(e,function(s){switch(s.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(y(n.sourceRef,"bpmn:ExclusiveGateway")||y(n.sourceRef,"bpmn:InclusiveGateway")||y(n.sourceRef,"bpmn:ComplexGateway")||y(n.sourceRef,"bpmn:Activity"))&&(i=Pn(Ct({},i),{[s.actionName]:a._createEntry(s,t,function(){r.updateProperties(t.source,{default:n})})}));break;case"replace-with-conditional-flow":!n.conditionExpression&&y(n.sourceRef,"bpmn:Activity")&&(i=Pn(Ct({},i),{[s.actionName]:a._createEntry(s,t,function(){var c=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(t,{conditionExpression:c})})}));break;default:y(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(i=Pn(Ct({},i),{[s.actionName]:a._createEntry(s,t,function(){r.updateProperties(t,{conditionExpression:void 0})})})),(y(n.sourceRef,"bpmn:ExclusiveGateway")||y(n.sourceRef,"bpmn:InclusiveGateway")||y(n.sourceRef,"bpmn:ComplexGateway")||y(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(i=Pn(Ct({},i),{[s.actionName]:a._createEntry(s,t,function(){r.updateProperties(t.source,{default:void 0})})}))}}),i},Xe.prototype._createEntry=function(t,e,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=function(){return r(e,t.target)},a=t.label;return a&&typeof a=="function"&&(a=a(e)),n=n||o,{label:i(a),className:t.className,action:n}},Xe.prototype._getLoopCharacteristicsHeaderEntries=function(t){var e=this,n=this._translate;function i(p,l){var u=W(t).loopCharacteristics;l.active?u=void 0:((Ks(l.options.isSequential)||!u||!y(u,l.options.loopCharacteristics))&&(u=e._moddle.create(l.options.loopCharacteristics)),u.isSequential=l.options.isSequential),e._modeling.updateProperties(t,{loopCharacteristics:u})}var r=W(t),o=r.loopCharacteristics,a,s,c;return o&&(a=o.isSequential,s=o.isSequential===void 0,c=o.isSequential!==void 0&&!o.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel Multi Instance"),active:c,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential Multi Instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:s,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},Xe.prototype._getCollectionHeaderEntries=function(t){var e=this,n=this._translate,i=t.businessObject.dataObjectRef;if(!i)return{};function r(a,s){e._modeling.updateModdleProperties(t,i,{isCollection:!s.active})}var o=i.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:r}}},Xe.prototype._getParticipantMultiplicityHeaderEntries=function(t){var e=this,n=this._bpmnFactory,i=this._translate;function r(a,s){var c=s.active,p;c||(p=n.create("bpmn:ParticipantMultiplicity")),e._modeling.updateProperties(t,{participantMultiplicity:p})}var o=t.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:i("Participant Multiplicity"),active:!!o,action:r}}},Xe.prototype._getAdHocHeaderEntries=function(t){var e=this._translate,n=W(t),i=y(n,"bpmn:AdHocSubProcess"),r=this._bpmnReplace.replaceElement;return{"toggle-adhoc":{className:"bpmn-icon-ad-hoc-marker",title:e("Ad-hoc"),active:i,action:function(o,a){return i?r(t,{type:"bpmn:SubProcess"},{autoResize:!1,layoutConnection:!1}):r(t,{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}}}};const cw={__depends__:[tp,$f,jd],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",Xe]};var La=Math.max,Ia=Math.min,pw=20;function Gf(t,e){return{top:t.top-e.top,right:t.right-e.right,bottom:t.bottom-e.bottom,left:t.left-e.left}}function lw(t,e,n){var i=n.x,r=n.y,o={x:t.x,y:t.y,width:t.width,height:t.height};return e.indexOf("n")!==-1?(o.y=t.y+r,o.height=t.height-r):e.indexOf("s")!==-1&&(o.height=t.height+r),e.indexOf("e")!==-1?o.width=t.width+i:e.indexOf("w")!==-1&&(o.x=t.x+i,o.width=t.width-i),o}function uw(t,e){return{x:t.x+(e.left||0),y:t.y+(e.top||0),width:t.width-(e.left||0)+(e.right||0),height:t.height-(e.top||0)+(e.bottom||0)}}function $a(t,e,n){var i=e[t],r=n.min&&n.min[t],o=n.max&&n.max[t];return it(r)&&(i=(/top|left/.test(t)?Ia:La)(i,r)),it(o)&&(i=(/top|left/.test(t)?La:Ia)(i,o)),i}function hw(t,e){if(!e)return t;var n=X(t);return Xo({top:$a("top",n,e),right:$a("right",n,e),bottom:$a("bottom",n,e),left:$a("left",n,e)})}function dw(t,e,n,i){var r=X(e),o={top:/n/.test(t)?r.bottom-n.height:r.top,left:/w/.test(t)?r.right-n.width:r.left,bottom:/s/.test(t)?r.top+n.height:r.bottom,right:/e/.test(t)?r.left+n.width:r.right},a=i?X(i):o,s={top:Ia(o.top,a.top),left:Ia(o.left,a.left),bottom:La(o.bottom,a.bottom),right:La(o.right,a.right)};return Xo(s)}function eo(t,e){return typeof t<"u"?t:pw}function fw(t,e){var n,i,r,o;return typeof e=="object"?(n=eo(e.left),i=eo(e.right),r=eo(e.top),o=eo(e.bottom)):n=i=r=o=eo(e),{x:t.x-n,y:t.y-r,width:t.width+n+i,height:t.height+r+o}}function mw(t){return!(t.waypoints||t.type==="label")}function Vf(t,e){var n;if(t.length===void 0?n=ct(t.children,mw):n=t,n.length)return fw(Vt(n),e)}var za=Math.abs;function vw(t,e){return Gf(X(e),X(t))}var yw=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],dr=30;function Fa(t,e){return e=e||[],t.children.filter(function(n){y(n,"bpmn:Lane")&&(Fa(n,e),e.push(n))}),e}function Li(t){return t.children.filter(function(e){return y(e,"bpmn:Lane")})}function on(t){return ka(t,yw)||t}function gw(t,e){var n=on(t),i=y(n,"bpmn:Process")?[]:[n],r=Fa(n,i),o=X(t),a=X(e),s=vw(t,e),c=[];return r.forEach(function(p){if(p!==t){var l=0,u=s.right,h=0,d=s.left,f=X(p);s.top&&(za(f.bottom-o.top)<10&&(h=a.top-f.bottom),za(f.top-o.top)<5&&(l=a.top-f.top)),s.bottom&&(za(f.top-o.bottom)<10&&(l=a.bottom-f.top),za(f.bottom-o.bottom)<5&&(h=a.bottom-f.bottom)),(l||u||h||d)&&c.push({shape:p,newBounds:uw(p,{top:l,right:u,bottom:h,left:d})})}}),c}function no(t,e,n,i,r,o,a,s,c,p,l,u){t=t||{},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,t.autoPlace!==!1&&(this._autoPlace=e.get("autoPlace",!1)),n.on("create.end",250,function(h){var d=h.context,f=d.shape;if(!(!ir(h)||!i.isOpen(f))){var v=i.getEntries(f);v.replace&&v.replace.action.click(h,f)}})}no.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],no.prototype.getMultiElementContextPadEntries=function(t){var e=this._modeling,n={};return this._isDeleteAllowed(t)&&N(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Remove"),action:{click:function(i,r){e.removeElements(r.slice())}}}}),n},no.prototype._isDeleteAllowed=function(t){var e=this._rules.allowed("elements.delete",{elements:t});return lt(e)?No(e,function(n){return bw(e,n)}):e},no.prototype.getContextPadEntries=function(t){var e=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={};if(t.type==="label")return l;var u=t.businessObject;function h(_,x){r.start(_,x)}function d(_,x){n.removeElements([x])}function f(_){var x=5,S=e.getPad(_).html,M=S.getBoundingClientRect(),j={x:M.left,y:M.bottom+x};return j}function v(_,x,S,M){typeof S!="string"&&(M=S,S=p("Append {type}",{type:_.replace(/^bpmn:/,"")}));function j(D,$){var z=i.createShape(N({type:_},M));o.start(D,z,{source:$})}var B=c?function(D,$){var z=i.createShape(N({type:_},M));c.append($,z)}:j;return{group:"model",className:x,title:S,action:{dragstart:j,click:B}}}function g(_){return function(x,S){n.splitLane(S,_),e.open(S,!0)}}if(dt(u,["bpmn:Lane","bpmn:Participant"])&&vt(t)){var R=Li(t);N(l,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:p("Add Lane above"),action:{click:function(_,x){n.addLane(x,"top")}}}}),R.length<2&&(t.height>=120&&N(l,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:p("Divide into two Lanes"),action:{click:g(2)}}}),t.height>=180&&N(l,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:p("Divide into three Lanes"),action:{click:g(3)}}})),N(l,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:p("Add Lane below"),action:{click:function(_,x){n.addLane(x,"bottom")}}}})}y(u,"bpmn:FlowNode")&&(y(u,"bpmn:EventBasedGateway")?N(l,{"append.receive-task":v("bpmn:ReceiveTask","bpmn-icon-receive-task",p("Append ReceiveTask")),"append.message-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",p("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",p("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",p("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",p("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):Wf(u,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?N(l,{"append.compensation-activity":v("bpmn:Task","bpmn-icon-task",p("Append compensation activity"),{isForCompensation:!0})}):!y(u,"bpmn:EndEvent")&&!u.isForCompensation&&!Wf(u,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!Oe(u)&&N(l,{"append.end-event":v("bpmn:EndEvent","bpmn-icon-end-event-none",p("Append EndEvent")),"append.gateway":v("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",p("Append Gateway")),"append.append-task":v("bpmn:Task","bpmn-icon-task",p("Append Task")),"append.intermediate-event":v("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",p("Append Intermediate/Boundary Event"))})),a.isEmpty(t,"bpmn-replace")||N(l,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:p("Change type"),action:{click:function(_,x){var S=N(f(x),{cursor:{x:_.x,y:_.y}});a.open(x,"bpmn-replace",S,{title:p("Change element"),width:300,search:!0})}}}}),y(u,"bpmn:SequenceFlow")&&N(l,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation")}),dt(u,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(l,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using "+(u.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:h,dragstart:h}}}),y(u,"bpmn:TextAnnotation")&&N(l,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using Association"),action:{click:h,dragstart:h}}}),dt(u,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&N(l,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using DataInputAssociation"),action:{click:h,dragstart:h}}}),y(u,"bpmn:Group")&&N(l,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var E=s.allowed("elements.delete",{elements:[t]});return lt(E)&&(E=E[0]===t),E&&N(l,{delete:{group:"edit",className:"bpmn-icon-trash",title:p("Remove"),action:{click:d}}}),l};function Wf(t,e,n){var i=t.$instanceOf(e),r=!1,o=t.eventDefinitions||[];return k(o,function(a){a.$type===n&&(r=!0)}),i&&r}function bw(t,e){return t.indexOf(e)!==-1}const xw={__depends__:[Ef,fd,bn,dp,Oa,cw],__init__:["contextPadProvider"],contextPadProvider:["type",no]};var _w={horizontal:["x","width"],vertical:["y","height"]},Uf=5;function Fn(t,e){this._modeling=t,this._filters=[],this.registerFilter(function(n){var i=e.allowed("elements.distribute",{elements:n});return lt(i)?i:i?n:[]})}Fn.$inject=["modeling","rules"],Fn.prototype.registerFilter=function(t){if(typeof t!="function")throw new Error("the filter has to be a function");this._filters.push(t)},Fn.prototype.trigger=function(t,e){var n=this._modeling,i,r;if(!(t.length<3)&&(this._setOrientation(e),r=this._filterElements(t),i=this._createGroups(r),!(i.length<=2)))return n.distributeElements(i,this._axis,this._dimension),i},Fn.prototype._filterElements=function(t){var e=this._filters,n=this._axis,i=this._dimension,r=[].concat(t);return e.length?(k(e,function(o){r=o(r,n,i)}),r):t},Fn.prototype._createGroups=function(t){var e=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');var o=ln(t,i);return k(o,function(a,s){var c=n._findRange(a,i,r),p,l=e[e.length-1];l&&n._hasIntersection(l.range,c)?e[e.length-1].elements.push(a):(p={range:c,elements:[a]},e.push(p))}),e},Fn.prototype._setOrientation=function(t){var e=_w[t];this._axis=e[0],this._dimension=e[1]},Fn.prototype._hasIntersection=function(t,e){return Math.max(t.min,t.max)>=Math.min(e.min,e.max)&&Math.min(t.min,t.max)<=Math.max(e.min,e.max)},Fn.prototype._findRange=function(t){var e=t[this._axis],n=t[this._dimension];return{min:e+Uf,max:e+n-Uf}};const Ew={__init__:["distributeElements"],distributeElements:["type",Fn]};function Ha(t){qe.call(this,t)}Ha.$inject=["eventBus"],q(Ha,qe),Ha.prototype.init=function(){this.addRule("elements.distribute",function(t){var e=t.elements;return e=ct(e,function(n){var i=dt(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)}),e=Wo(e),e.length<3?!1:e})};var ww={horizontal:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <polyline points="450 400 450 150 1350 150 1350 400" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
- <rect x="150" y="450" width="600" height="1200" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="1050" y="450" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`,vertical:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
- <polyline points="400 1350 150 1350 150 450 400 450" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
- <rect x="450" y="150" width="1200" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
- <rect x="450" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
- </svg>`};const qf=ww;var Sw=900;function io(t,e,n,i){this._distributeElements=e,this._translate=n,this._popupMenu=t,this._rules=i,t.registerProvider("align-elements",Sw,this)}io.$inject=["popupMenu","distributeElements","translate","rules"],io.prototype.getPopupMenuEntries=function(t){var e={};return this._isAllowed(t)&&N(e,this._getEntries(t)),e},io.prototype._isAllowed=function(t){return this._rules.allowed("elements.distribute",{elements:t})},io.prototype._getEntries=function(t){var e=this._distributeElements,n=this._translate,i=this._popupMenu,r={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:qf.horizontal,action:function(o,a){e.trigger(t,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:qf.vertical,action:function(o,a){e.trigger(t,"vertical"),i.close()}}};return r};const Cw={__depends__:[tp,Ew],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",Ha],distributeElementsMenuProvider:["type",io]};var Kf="is not a registered action",Rw="is already registered";function Ze(t,e){this._actions={};var n=this;t.on("diagram.init",function(){n._registerDefaultActions(e),t.fire("editorActions.init",{editorActions:n})})}Ze.$inject=["eventBus","injector"],Ze.prototype._registerDefaultActions=function(t){var e=t.get("commandStack",!1),n=t.get("modeling",!1),i=t.get("selection",!1),r=t.get("zoomScroll",!1),o=t.get("copyPaste",!1),a=t.get("canvas",!1),s=t.get("rules",!1),c=t.get("keyboardMove",!1),p=t.get("keyboardMoveSelection",!1);e&&(this.register("undo",function(){e.undo()}),this.register("redo",function(){e.redo()})),o&&i&&this.register("copy",function(){var l=i.get();if(l.length)return o.copy(l)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(l){r.stepZoom(l.value)}),a&&this.register("zoom",function(l){a.zoom(l.value)}),n&&i&&s&&this.register("removeSelection",function(){var l=i.get();if(l.length){var u=s.allowed("elements.delete",{elements:l}),h;u!==!1&&(lt(u)?h=u:h=l,h.length&&n.removeElements(h.slice()))}}),c&&this.register("moveCanvas",function(l){c.moveCanvas(l)}),p&&this.register("moveSelection",function(l){p.moveSelection(l.direction,l.accelerated)})},Ze.prototype.trigger=function(t,e){if(!this._actions[t])throw xp(t,Kf);return this._actions[t](e)},Ze.prototype.register=function(t,e){var n=this;if(typeof t=="string")return this._registerAction(t,e);k(t,function(i,r){n._registerAction(r,i)})},Ze.prototype._registerAction=function(t,e){if(this.isRegistered(t))throw xp(t,Rw);this._actions[t]=e},Ze.prototype.unregister=function(t){if(!this.isRegistered(t))throw xp(t,Kf);this._actions[t]=void 0},Ze.prototype.getActions=function(){return Object.keys(this._actions)},Ze.prototype.isRegistered=function(t){return!!this._actions[t]};function xp(t,e){return new Error(t+" "+e)}const Pw={__init__:["editorActions"],editorActions:["type",Ze]};function Ga(t){t.invoke(Ze,this)}q(Ga,Ze),Ga.$inject=["injector"],Ga.prototype._registerDefaultActions=function(t){Ze.prototype._registerDefaultActions.call(this,t);var e=t.get("canvas",!1),n=t.get("elementRegistry",!1),i=t.get("selection",!1),r=t.get("spaceTool",!1),o=t.get("lassoTool",!1),a=t.get("handTool",!1),s=t.get("globalConnect",!1),c=t.get("distributeElements",!1),p=t.get("alignElements",!1),l=t.get("directEditing",!1),u=t.get("searchPad",!1),h=t.get("modeling",!1),d=t.get("contextPad",!1);e&&n&&i&&this._registerAction("selectElements",function(){var f=e.getRootElement(),v=n.filter(function(g){return g!==f});return i.select(v),v}),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(f){var v=i.get(),g=f.type;v.length&&c.trigger(v,g)}),i&&p&&this._registerAction("alignElements",function(f){var v=i.get(),g=[],R=f.type;v.length&&(g=ct(v,function(E){return!y(E,"bpmn:Lane")}),p.trigger(g,R))}),i&&h&&this._registerAction("setColor",function(f){var v=i.get();v.length&&h.setColor(v,f)}),i&&l&&this._registerAction("directEditing",function(){var f=i.get();f.length&&l.activate(f[0])}),u&&this._registerAction("find",function(){u.toggle()}),e&&h&&this._registerAction("moveToOrigin",function(){var f=e.getRootElement(),v,g;y(f,"bpmn:Collaboration")?g=n.filter(function(R){return y(R.parent,"bpmn:Collaboration")}):g=n.filter(function(R){return R!==f&&!y(R.parent,"bpmn:SubProcess")}),v=Vt(g),h.moveElements(g,{x:-v.x,y:-v.y},f)}),i&&d&&this._registerAction("replaceElement",function(f){d.triggerEntry("replace","click",f)})};const kw={__depends__:[Pw],editorActions:["type",Ga]};function Yf(t){t.on(["create.init","shape.move.init"],function(e){var n=e.context,i=e.shape;dt(i,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}Yf.$inject=["eventBus"];var Va=10;function _p(t,e,n){return n||(n="round"),Math[n](t/e)*e}var Tw=1200,Aw=800;function li(t,e,n){var i=!n||n.active!==!1;this._eventBus=e;var r=this;e.on("diagram.init",Aw,function(){r.setActive(i)}),e.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"],Tw,function(o){var a=o.originalEvent;if(!(!r.active||a&&je(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(p){var l={},u=Dw(o,p,t);u&&(l.offset=u);var h=Mw(o,p);h&&N(l,h),hr(o,p)||r.snapEvent(o,p,l)})}})}li.prototype.snapEvent=function(t,e,n){var i=this.snapValue(t[e],n);Kt(t,e,i)},li.prototype.getGridSpacing=function(){return Va},li.prototype.snapValue=function(t,e){var n=0;e&&e.offset&&(n=e.offset),t+=n,t=_p(t,Va);var i,r;return e&&e.min&&(i=e.min,it(i)&&(i=_p(i+n,Va,"ceil"),t=Math.max(t,i))),e&&e.max&&(r=e.max,it(r)&&(r=_p(r+n,Va,"floor"),t=Math.min(t,r))),t-=n,t},li.prototype.isActive=function(){return this.active},li.prototype.setActive=function(t){this.active=t,this._eventBus.fire("gridSnapping.toggle",{active:t})},li.prototype.toggleActive=function(){this.setActive(!this.active)},li.$inject=["elementRegistry","eventBus","config.gridSnapping"];function Mw(t,e){var n=t.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[e])return a[e];a||(a=o.snapConstraints={}),a[e]||(a[e]={});var s=n.direction;i&&(Wa(e)?(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&&(Wa(e)?Zf(s)?a.x.max=c.left:a.x.min=c.right:Xf(s)?a.y.max=c.top:a.y.min=c.bottom),p&&(Wa(e)?Zf(s)?a.x.min=p.left:a.x.max=p.right:Xf(s)?a.y.min=p.top:a.y.max=p.bottom),a[e]}function Dw(t,e,n){var i=t.context,r=t.shape,o=i.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&it(s[e])||(s||(s=o.snapOffset={}),it(s[e])||(s[e]=0),!r)||(n.get(r.id)||(Wa(e)?s[e]+=r[e]+r.width/2:s[e]+=r[e]+r.height/2),!a)||(e==="x"?/left/.test(a)?s[e]-=r.width/2:/right/.test(a)&&(s[e]+=r.width/2):/top/.test(a)?s[e]-=r.height/2:/bottom/.test(a)&&(s[e]+=r.height/2)),s[e]}function Wa(t){return t==="x"}function Xf(t){return t.indexOf("n")!==-1}function Zf(t){return t.indexOf("w")!==-1}function Ii(t,e){V.call(this,t),this._gridSnapping=e;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=r.hints||{},a=o.autoResize;if(a){var s=r.shape,c=r.newBounds;Me(a)?r.newBounds=n.snapComplex(c,a):r.newBounds=n.snapSimple(s,c)}})}Ii.$inject=["eventBus","gridSnapping","modeling"],q(Ii,V),Ii.prototype.snapSimple=function(t,e){var n=this._gridSnapping;return e.width=n.snapValue(e.width,{min:e.width}),e.height=n.snapValue(e.height,{min:e.height}),e.x=t.x+t.width/2-e.width/2,e.y=t.y+t.height/2-e.height/2,e},Ii.prototype.snapComplex=function(t,e){return/w|e/.test(e)&&(t=this.snapHorizontally(t,e)),/n|s/.test(e)&&(t=this.snapVertically(t,e)),t},Ii.prototype.snapHorizontally=function(t,e){var n=this._gridSnapping,i=/w/.test(e),r=/e/.test(e),o={};return o.width=n.snapValue(t.width,{min:t.width}),r&&(i?(o.x=n.snapValue(t.x,{max:t.x}),o.width+=n.snapValue(t.x-o.x,{min:t.x-o.x})):t.x=t.x+t.width-o.width),N(t,o),t},Ii.prototype.snapVertically=function(t,e){var n=this._gridSnapping,i=/n/.test(e),r=/s/.test(e),o={};return o.height=n.snapValue(t.height,{min:t.height}),i&&(r?(o.y=n.snapValue(t.y,{max:t.y}),o.height+=n.snapValue(t.y-o.y,{min:t.y-o.y})):t.y=t.y+t.height-o.height),N(t,o),t};var Bw=2e3;function Qf(t,e){t.on(["spaceTool.move","spaceTool.end"],Bw,function(n){var i=n.context;if(i.initialized){var r=i.axis,o;r==="x"?(o=e.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=e.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}Qf.$inject=["eventBus","gridSnapping"];const Nw={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Ii],gridSnappingSpaceToolBehavior:["type",Qf]},Ow={__depends__:[Nw],__init__:["gridSnapping"],gridSnapping:["type",li]};var jw=2e3;function Jf(t,e){t.on("autoPlace",jw,function(n){var i=n.source,r=nt(i),o=n.shape,a=Nd(i,o);return["x","y"].forEach(function(s){var c={};a[s]!==r[s]&&(a[s]>r[s]?c.min=a[s]:c.max=a[s],y(o,"bpmn:TextAnnotation")&&(Lw(s)?c.offset=-o.width/2:c.offset=-o.height/2),a[s]=e.snapValue(a[s],c))}),a})}Jf.$inject=["eventBus","gridSnapping"];function Lw(t){return t==="x"}var Iw=1750;function tm(t,e,n){e.on(["create.start","shape.move.start"],Iw,function(i){var r=i.context,o=r.shape,a=t.getRootElement();if(!(!y(o,"bpmn:Participant")||!y(a,"bpmn:Process")||!a.children.length)){var s=r.createConstraints;s&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}tm.$inject=["canvas","eventBus","gridSnapping"];var $w=3e3;function Ua(t,e,n){V.call(this,t),this._gridSnapping=e;var i=this;this.postExecuted(["connection.create","connection.layout"],$w,function(r){var o=r.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||zw(c)&&n.updateWaypoints(a,i.snapMiddleSegments(c))})}Ua.$inject=["eventBus","gridSnapping","modeling"],q(Ua,V),Ua.prototype.snapMiddleSegments=function(t){var e=this._gridSnapping,n;t=t.slice();for(var i=1;i<t.length-2;i++)n=Gw(e,t[i],t[i+1]),t[i]=n[0],t[i+1]=n[1];return t};function zw(t){return t.length>3}function Fw(t){return t==="h"}function Hw(t){return t==="v"}function Gw(t,e,n){var i=Dn(e,n),r={};return Fw(i)&&(r.y=t.snapValue(e.y)),Hw(i)&&(r.x=t.snapValue(e.x)),("x"in r||"y"in r)&&(e=N({},e,r),n=N({},n,r)),[e,n]}const Vw={__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Jf],gridSnappingParticipantBehavior:["type",tm],gridSnappingLayoutConnectionBehavior:["type",Ua]},Ww={__depends__:[Ow,Vw],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",Yf]};var Uw=30,qw=30;function ro(t,e){this._interactionEvents=e;var n=this;t.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(i){var r=i.element,o=i.gfx;if(y(r,"bpmn:Lane"))return n._createParticipantHit(r,o);if(y(r,"bpmn:Participant"))return vt(r)?n._createParticipantHit(r,o):n._createDefaultHit(r,o);if(y(r,"bpmn:SubProcess"))return vt(r)?n._createSubProcessHit(r,o):n._createDefaultHit(r,o)})}ro.$inject=["eventBus","interactionEvents"],ro.prototype._createDefaultHit=function(t,e){return this._interactionEvents.removeHits(e),this._interactionEvents.createDefaultHit(t,e),!0},ro.prototype._createParticipantHit=function(t,e){return this._interactionEvents.removeHits(e),this._interactionEvents.createBoxHit(e,"no-move",{width:t.width,height:t.height}),this._interactionEvents.createBoxHit(e,"click-stroke",{width:t.width,height:t.height}),this._interactionEvents.createBoxHit(e,"all",{width:Uw,height:t.height}),!0},ro.prototype._createSubProcessHit=function(t,e){return this._interactionEvents.removeHits(e),this._interactionEvents.createBoxHit(e,"no-move",{width:t.width,height:t.height}),this._interactionEvents.createBoxHit(e,"click-stroke",{width:t.width,height:t.height}),this._interactionEvents.createBoxHit(e,"all",{width:t.width,height:qw}),!0};const Kw={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",ro]};function qa(t){t.invoke(or,this)}q(qa,or),qa.$inject=["injector"],qa.prototype.registerBindings=function(t,e){or.prototype.registerBindings.call(this,t,e);function n(i,r){e.isRegistered(i)&&t.addListener(r)}n("selectElements",function(i){var r=i.keyEvent;if(t.isKey(["a","A"],r)&&t.isCmd(r))return e.trigger("selectElements"),!0}),n("find",function(i){var r=i.keyEvent;if(t.isKey(["f","F"],r)&&t.isCmd(r))return e.trigger("find"),!0}),n("spaceTool",function(i){var r=i.keyEvent;if(!t.hasModifier(r)&&t.isKey(["s","S"],r))return e.trigger("spaceTool"),!0}),n("lassoTool",function(i){var r=i.keyEvent;if(!t.hasModifier(r)&&t.isKey(["l","L"],r))return e.trigger("lassoTool"),!0}),n("handTool",function(i){var r=i.keyEvent;if(!t.hasModifier(r)&&t.isKey(["h","H"],r))return e.trigger("handTool"),!0}),n("globalConnectTool",function(i){var r=i.keyEvent;if(!t.hasModifier(r)&&t.isKey(["c","C"],r))return e.trigger("globalConnectTool"),!0}),n("directEditing",function(i){var r=i.keyEvent;if(!t.hasModifier(r)&&t.isKey(["e","E"],r))return e.trigger("directEditing"),!0}),n("replaceElement",function(i){var r=i.keyEvent;if(!t.hasModifier(r)&&t.isKey(["r","R"],r))return e.trigger("replaceElement",r),!0})};const Yw={__depends__:[Fc],__init__:["keyboardBindings"],keyboardBindings:["type",qa]};var Xw={moveSpeed:1,moveSpeedAccelerated:10},Zw=1500,em="left",nm="up",im="right",rm="down",Qw={ArrowLeft:em,Left:em,ArrowUp:nm,Up:nm,ArrowRight:im,Right:im,ArrowDown:rm,Down:rm},Jw={left:function(t){return{x:-t,y:0}},up:function(t){return{x:0,y:-t}},right:function(t){return{x:t,y:0}},down:function(t){return{x:0,y:t}}};function om(t,e,n,i,r){var o=this;this._config=N({},Xw,t||{}),e.addListener(Zw,function(a){var s=a.keyEvent,c=Qw[s.key];if(c&&!e.isCmd(s)){var p=e.isShift(s);return o.moveSelection(c,p),!0}}),this.moveSelection=function(a,s){var c=r.get();if(c.length){var p=this._config[s?"moveSpeedAccelerated":"moveSpeed"],l=Jw[a](p),u=i.allowed("elements.move",{shapes:c});u&&n.moveElements(c,l)}}}om.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const tS={__depends__:[Fc,bn],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",om]};var am=10;function oo(t,e,n,i){this._dragging=i,this._rules=e;var r=this;function o(c,p){var l=c.shape,u=c.direction,h=c.resizeConstraints,d;c.delta=p,d=lw(l,u,p),c.newBounds=hw(d,h),c.canExecute=r.canResize(c)}function a(c){var p=c.resizeConstraints,l=c.minBounds;p===void 0&&(l===void 0&&(l=r.computeMinResizeBox(c)),c.resizeConstraints={min:X(l)})}function s(c){var p=c.shape,l=c.canExecute,u=c.newBounds;if(l){if(u=Iu(u),!eS(p,u))return;n.resizeShape(p,u)}}t.on("resize.start",function(c){a(c.context)}),t.on("resize.move",function(c){var p={x:c.dx,y:c.dy};o(c.context,p)}),t.on("resize.end",function(c){s(c.context)})}oo.prototype.canResize=function(t){var e=this._rules,n=un(t,["newBounds","shape","delta","direction"]);return e.allowed("shape.resize",n)},oo.prototype.activate=function(t,e,n){var i=this._dragging,r,o;if(typeof n=="string"&&(n={direction:n}),r=N({shape:e},n),o=r.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");i.init(t,sm(e,o),"resize",{autoActivate:!0,cursor:nS(o),data:{shape:e,context:r}})},oo.prototype.computeMinResizeBox=function(t){var e=t.shape,n=t.direction,i,r;return i=t.minDimensions||{width:am,height:am},r=Vf(e,t.childrenBoxPadding),dw(n,e,i,r)},oo.$inject=["eventBus","rules","modeling","dragging"];function eS(t,e){return t.x!==e.x||t.y!==e.y||t.width!==e.width||t.height!==e.height}function sm(t,e){var n=nt(t),i=X(t),r={x:n.x,y:n.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}function nS(t){var e="resize-";return t==="n"||t==="s"?e+"ns":t==="e"||t==="w"?e+"ew":t==="nw"||t==="se"?e+"nwse":e+"nesw"}var cm="djs-resizing",pm="resize-not-ok",iS=500;function lm(t,e,n){function i(o){var a=o.shape,s=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(a,e.getActiveLayer()),e.addMarker(a,cm)),s.width>5&&Y(c,{x:s.x,width:s.width}),s.height>5&&Y(c,{y:s.y,height:s.height}),o.canExecute?ht(c).remove(pm):ht(c).add(pm)}function r(o){var a=o.shape,s=o.frame;s&&Gt(o.frame),e.removeMarker(a,cm)}t.on("resize.move",iS,function(o){i(o.context)}),t.on("resize.cleanup",function(o){r(o.context)})}lm.$inject=["eventBus","canvas","previewSupport"];var Ka=-6,Ya=8,Xa=20,ao="djs-resizer",rS=["n","w","s","e","nw","ne","se","sw"];function ui(t,e,n,i){this._resize=i,this._canvas=e;var r=this;t.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&k(a,Ce(r.addResizer,r))}),t.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}ui.prototype.makeDraggable=function(t,e,n){var i=this._resize;function r(o){ai(o)&&i.activate(o,t,n)}J.bind(e,"mousedown",r),J.bind(e,"touchstart",r)},ui.prototype._createResizer=function(t,e,n,i){var r=this._getResizersParent(),o=oS(i),a=Z("g");ht(a).add(ao),ht(a).add(ao+"-"+t.id),ht(a).add(ao+"-"+i),tt(r,a);var s=Z("rect");Y(s,{x:-Ya/2+o.x,y:-Ya/2+o.y,width:Ya,height:Ya}),ht(s).add(ao+"-visual"),tt(a,s);var c=Z("rect");return Y(c,{x:-Xa/2+o.x,y:-Xa/2+o.y,width:Xa,height:Xa}),ht(c).add(ao+"-hit"),tt(a,c),gc(a,e,n),a},ui.prototype.createResizer=function(t,e){var n=sm(t,e),i=this._createResizer(t,n.x,n.y,e);this.makeDraggable(t,i,e)},ui.prototype.addResizer=function(t){var e=this;Dt(t)||!this._resize.canResize({shape:t})||k(rS,function(n){e.createResizer(t,n)})},ui.prototype.removeResizers=function(){var t=this._getResizersParent();Fo(t)},ui.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},ui.$inject=["eventBus","canvas","selection","resize"];function oS(t){var e={x:0,y:0};return t.indexOf("e")!==-1?e.x=-Ka:t.indexOf("w")!==-1&&(e.x=Ka),t.indexOf("s")!==-1?e.y=-Ka:t.indexOf("n")!==-1&&(e.y=Ka),e}const um={__depends__:[_n,$n,Zr],__init__:["resize","resizePreview","resizeHandles"],resize:["type",oo],resizePreview:["type",lm],resizeHandles:["type",ui]};var aS=2e3;function so(t,e,n,i,r,o,a){this._bpmnFactory=e,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),t.on("element.dblclick",function(c){s(c.element,!0)}),t.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){i.isActive()&&i.complete()}),t.on(["shape.remove","connection.remove"],aS,function(c){i.isActive(c.element)&&i.cancel()}),t.on(["commandStack.changed"],function(c){i.isActive()&&i.cancel()}),t.on("directEditing.activate",function(c){o.removeResizers()}),t.on("create.end",500,function(c){var p=c.context,l=p.shape,u=c.context.canExecute,h=c.isTouch;h||u&&(p.hints&&p.hints.createElementsBehavior===!1||s(l))}),t.on("autoPlace.end",500,function(c){s(c.shape)});function s(c,p){(p||dt(c,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||Ep(c))&&i.activate(c)}}so.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],so.prototype.activate=function(t){var e=Ue(t);if(e!==void 0){var n={text:e},i=this.getEditingBBox(t);N(n,i);var r={};return(dt(t,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||Ep(t))&&N(r,{centerVertically:!0}),ki(t)&&N(r,{autoResize:!0}),y(t,"bpmn:TextAnnotation")&&N(r,{resizable:!0,autoResize:!0}),N(n,{options:r}),n}},so.prototype.getEditingBBox=function(t){var e=this._canvas,n=t.label||t,i=e.getAbsoluteBBox(n),r={x:i.x+i.width/2,y:i.y+i.height/2},o={x:i.x,y:i.y},a=e.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};(y(t,"bpmn:Lane")||pS(t))&&(N(o,{width:i.height,height:30*a,x:i.x-i.height/2+15*a,y:r.y-30*a/2}),N(d,{fontSize:u+"px",lineHeight:h,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:"rotate(-90deg)"})),(dt(t,["bpmn:Task","bpmn:CallActivity"])||cS(t)||Ep(t))&&(N(o,{width:i.width,height:i.height}),N(d,{fontSize:u+"px",lineHeight:h,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),sS(t)&&(N(o,{width:i.width,x:i.x}),N(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,v=7*a,g=4*a;if(n.labelTarget&&(N(o,{width:f,height:i.height+v+g,x:r.x-f/2,y:i.y-v}),N(d,{fontSize:p+"px",lineHeight:l,paddingTop:v+"px",paddingBottom:g+"px"})),ki(n)&&!ca(n)&&!xt(n)){var R=Ac(t),E=e.getAbsoluteBBox({x:R.x,y:R.y,width:0,height:0}),_=p+v+g;N(o,{width:f,height:_,x:E.x-f/2,y:E.y-_/2}),N(d,{fontSize:p+"px",lineHeight:l,paddingTop:v+"px",paddingBottom:g+"px"})}return y(t,"bpmn:TextAnnotation")&&(N(o,{width:i.width,height:i.height,minWidth:30*a,minHeight:10*a}),N(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}},so.prototype.update=function(t,e,n,i){var r,o;y(t,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(t),r={x:t.x,y:t.y,width:t.width/o.width*i.width,height:t.height/o.height*i.height}),lS(e)&&(e=null),this._modeling.updateLabel(t,e,r)};function Ep(t){return y(t,"bpmn:SubProcess")&&!vt(t)}function sS(t){return y(t,"bpmn:SubProcess")&&vt(t)}function cS(t){return y(t,"bpmn:Participant")&&!vt(t)}function pS(t){return y(t,"bpmn:Participant")&&vt(t)}function lS(t){return!t||!t.trim()}var hm="djs-element-hidden",dm="djs-label-hidden";function fm(t,e,n){var i=this,r=e.getDefaultLayer(),o,a,s;t.on("directEditing.activate",function(c){var p=c.active;if(o=p.element.label||p.element,y(o,"bpmn:TextAnnotation")){a=e.getAbsoluteBBox(o),s=Z("g");var l=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),u=i.path=Z("path");Y(u,{d:l,strokeWidth:2,stroke:uS(o)}),tt(s,u),tt(r,s),ke(s,o.x,o.y)}y(o,"bpmn:TextAnnotation")||o.labelTarget?e.addMarker(o,hm):(y(o,"bpmn:Task")||y(o,"bpmn:CallActivity")||y(o,"bpmn:SubProcess")||y(o,"bpmn:Participant"))&&e.addMarker(o,dm)}),t.on("directEditing.resize",function(c){if(y(o,"bpmn:TextAnnotation")){var p=c.height,l=c.dy,u=Math.max(o.height/a.height*(p+l),0),h=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:u,position:{mx:0,my:0}});Y(i.path,{d:h})}}),t.on(["directEditing.complete","directEditing.cancel"],function(c){var p=c.active;p&&(e.removeMarker(p.element.label||p.element,hm),e.removeMarker(o,dm)),o=void 0,a=void 0,s&&(Gt(s),s=void 0)})}fm.$inject=["eventBus","canvas","pathMap"];function uS(t,e){var n=gt(t);return n.get("stroke")||e||"black"}const hS={__depends__:[jc,um,Ef],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",so],labelEditingPreview:["type",fm]};var wp=["top","bottom","left","right"],Za=10;function Sp(t,e){V.call(this,t),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(r){var o=r.context,a=o.connection,s=a.source,c=a.target,p=o.hints||{};p.createElementsBehavior!==!1&&(n(s),n(c))}),this.postExecuted(["label.create"],function(r){var o=r.context,a=o.shape,s=o.hints||{};s.createElementsBehavior!==!1&&n(a.labelTarget)}),this.postExecuted(["elements.create"],function(r){var o=r.context,a=o.elements,s=o.hints||{};s.createElementsBehavior!==!1&&a.forEach(function(c){n(c)})});function n(r){if(ca(r)){var o=mS(r);o&&i(r,o)}}function i(r,o){var a=nt(r),s=r.label,c=nt(s);if(s.parent){var p=X(r),l;switch(o){case"top":l={x:a.x,y:p.top-Za-s.height/2};break;case"left":l={x:p.left-Za-s.width/2,y:a.y};break;case"bottom":l={x:a.x,y:p.bottom+Za+s.height/2};break;case"right":l={x:p.right+Za+s.width/2,y:a.y};break}var u=en(l,c);e.moveShape(s,u)}}}q(Sp,V),Sp.$inject=["eventBus","modeling"];function dS(t){var e=t.host,n=nt(t),i=le(n,e),r;i.indexOf("-")>=0?r=i.split("-"):r=[i];var o=wp.filter(function(a){return r.indexOf(a)===-1});return o}function fS(t){var e=nt(t),n=[].concat(t.incoming.map(function(i){return i.waypoints[i.waypoints.length-2]}),t.outgoing.map(function(i){return i.waypoints[1]})).map(function(i){return mm(e,i)});return n}function mS(t){var e=nt(t.label),n=nt(t),i=mm(n,e);if(vS(i)){var r=fS(t);if(t.host){var o=dS(t);r=r.concat(o)}var a=wp.filter(function(s){return r.indexOf(s)===-1});if(a.indexOf(i)===-1)return a[0]}}function mm(t,e){return le(e,t,5)}function vS(t){return wp.indexOf(t)!==-1}function Cp(t){V.call(this,t),this.preExecute("shape.append",function(e){var n=e.source,i=e.shape;e.position||(y(i,"bpmn:TextAnnotation")?e.position={x:n.x+n.width/2+75,y:n.y-50-i.height/2}:e.position={x:n.x+n.width+80+i.width/2,y:n.y+n.height/2})},!0)}q(Cp,V),Cp.$inject=["eventBus"];function Rp(t,e){t.invoke(V,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape,o=ct(r.incoming.concat(r.outgoing),function(a){return y(a,"bpmn:Association")});k(o,function(a){e.moveConnection(a,{x:0,y:0},i)})},!0)}q(Rp,V),Rp.$inject=["injector","modeling"];var vm=500;function Qa(t,e){e.invoke(V,this),this._bpmnReplace=t;var n=this;this.postExecuted("elements.create",vm,function(i){var r=i.elements;r=r.filter(function(o){var a=o.host;return ym(o,a)}),r.length===1&&r.map(function(o){return r.indexOf(o)}).forEach(function(o){var a=r[o];i.elements[o]=n._replaceShape(r[o],a)})},!0),this.preExecute("elements.move",vm,function(i){var r=i.shapes,o=i.newHost;if(r.length===1){var a=r[0];ym(a,o)&&(i.shapes=[n._replaceShape(a,o)])}},!0)}Qa.$inject=["bpmnReplace","injector"],q(Qa,V),Qa.prototype._replaceShape=function(t,e){var n=yS(t),i={type:"bpmn:BoundaryEvent",host:e};return n&&(i.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(t,i,{layoutConnection:!1})};function yS(t){var e=W(t),n=e.eventDefinitions;return n&&n[0]}function ym(t,e){return!xt(t)&&dt(t,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!e}function Pp(t,e){V.call(this,t);function n(i){return ct(i.attachers,function(r){return y(r,"bpmn:BoundaryEvent")})}this.postExecute("connection.create",function(i){var r=i.context.source,o=i.context.target,a=n(o);y(r,"bpmn:EventBasedGateway")&&y(o,"bpmn:ReceiveTask")&&a.length>0&&e.removeElements(a)}),this.postExecute("connection.reconnect",function(i){var r=i.context.oldSource,o=i.context.newSource;y(r,"bpmn:Gateway")&&y(o,"bpmn:EventBasedGateway")&&k(o.outgoing,function(a){var s=a.target,c=n(s);y(s,"bpmn:ReceiveTask")&&c.length>0&&e.removeElements(c)})})}Pp.$inject=["eventBus","modeling"],q(Pp,V);function kp(t){t.invoke(V,this),this.preExecute("shape.create",1500,function(e){var n=e.context,i=n.parent,r=n.shape;y(i,"bpmn:Lane")&&!y(r,"bpmn:Lane")&&(n.parent=ka(i,"bpmn:Participant"))})}kp.$inject=["injector"],q(kp,V);function Tp(t,e){V.call(this,t),this.preExecute("shape.create",function(n){var i=n.context,r=i.shape;if(y(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=e.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}Tp.$inject=["eventBus","bpmnFactory"],q(Tp,V);var Ap=20,Mp=20,gm=30,Ja=2e3;function Dp(t,e,n){V.call(this,e),e.on(["create.start","shape.move.start"],Ja,function(r){var o=r.context,a=o.shape,s=t.getRootElement();if(!(!y(a,"bpmn:Participant")||!y(s,"bpmn:Process")||!s.children.length)){var c=s.children.filter(function(u){return!y(u,"bpmn:Group")&&!xt(u)&&!Dt(u)});if(c.length){var p=Vt(c),l=gS(a,p);N(a,l),o.createConstraints=bS(a,p)}}}),e.on("create.start",Ja,function(r){var o=r.context,a=o.shape,s=t.getRootElement(),c=t.getGraphics(s);function p(l){l.element=s,l.gfx=c}y(a,"bpmn:Participant")&&y(s,"bpmn:Process")&&(e.on("element.hover",Ja,p),e.once("create.cleanup",function(){e.off("element.hover",p)}))});function i(){var r=t.getRootElement();return y(r,"bpmn:Collaboration")?r:n.makeCollaboration()}this.preExecute("elements.create",Ja,function(r){var o=r.elements,a=r.parent,s=xS(o),c;s&&y(a,"bpmn:Process")&&(r.parent=i(),c=r.hints=r.hints||{},c.participant=s,c.process=a,c.processRef=W(s).get("processRef"))},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;y(a,"bpmn:Participant")&&y(o,"bpmn:Process")&&(r.parent=i(),r.process=o,r.processRef=W(a).get("processRef"))},!0),this.execute("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.shape,c=o.participant;a&&(!c||s===c)&&W(s).set("processRef",W(a))},!0),this.revert("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.processRef||o.processRef,c=r.shape,p=o.participant;a&&(!p||c===p)&&W(c).set("processRef",s)},!0),this.postExecute("shape.create",function(r){var o=r.hints||{},a=r.process||r.hints.process,s=r.shape,c=o.participant;if(a){var p=a.children.slice();c?s===c&&n.moveElements(p,{x:0,y:0},c):n.moveElements(p,{x:0,y:0},s)}},!0)}Dp.$inject=["canvas","eventBus","modeling"],q(Dp,V);function gS(t,e){e={width:e.width+Ap*2+gm,height:e.height+Mp*2};var n=Math.max(t.width,e.width),i=Math.max(t.height,e.height);return{x:-n/2,y:-i/2,width:n,height:i}}function bS(t,e){return e=X(e),{bottom:e.top+t.height/2-Mp,left:e.right-t.width/2+Ap,top:e.bottom-t.height/2+Mp,right:e.left+t.width/2-Ap-gm}}function xS(t){return yt(t,function(e){return y(e,"bpmn:Participant")})}var bm="__targetRef_placeholder";function Bp(t,e){V.call(this,t),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],xm(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],xm(o));function n(a,s,c){var p=a.get("dataInputAssociations");return yt(p,function(l){return l!==c&&l.targetRef===s})}function i(a,s){var c=a.get("properties"),p=yt(c,function(l){return l.name===bm});return!p&&s&&(p=e.create("bpmn:Property",{name:bm}),Zt(c,p)),p}function r(a,s){var c=i(a);c&&(n(a,c,s)||Wt(a.get("properties"),c))}function o(a){var s=a.context,c=s.connection,p=c.businessObject,l=c.target,u=l&&l.businessObject,h=s.newTarget,d=h&&h.businessObject,f=s.oldTarget||s.target,v=f&&f.businessObject,g=c.businessObject,R;v&&v!==u&&r(v,p),d&&d!==u&&r(d,p),u?(R=i(u,!0),g.targetRef=R):g.targetRef=null}}Bp.$inject=["eventBus","bpmnFactory"],q(Bp,V);function xm(t){return function(e){var n=e.context,i=n.connection;if(y(i,"bpmn:DataInputAssociation"))return t(e)}}function ts(t){this._bpmnUpdater=t}ts.$inject=["bpmnUpdater"],ts.prototype.execute=function(t){var e=t.dataStoreBo,n=t.dataStoreDi,i=t.newSemanticParent,r=t.newDiParent;return t.oldSemanticParent=e.$parent,t.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(e,i),this._bpmnUpdater.updateDiParent(n,r),[]},ts.prototype.revert=function(t){var e=t.dataStoreBo,n=t.dataStoreDi,i=t.oldSemanticParent,r=t.oldDiParent;return this._bpmnUpdater.updateSemanticParent(e,i),this._bpmnUpdater.updateDiParent(n,r),[]};function Np(t,e,n,i){V.call(this,i),e.registerHandler("dataStore.updateContainment",ts);function r(){return n.filter(function(s){return y(s,"bpmn:Participant")&&W(s).processRef})[0]}function o(s){return s.children.filter(function(c){return y(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function a(s,c){var p=s.businessObject||s;if(c=c||r(),c){var l=c.businessObject||c;e.execute("dataStore.updateContainment",{dataStoreBo:p,dataStoreDi:gt(s),newSemanticParent:l.processRef||l,newDiParent:gt(c)})}}this.preExecute("shape.create",function(s){var c=s.context,p=c.shape;y(p,"bpmn:DataStoreReference")&&p.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(s){var c=s.context,p=c.shapes,l=p.filter(function(u){return y(u,"bpmn:DataStoreReference")});l.length&&(c.hints||(c.hints={}),c.hints.autoResize=p.filter(function(u){return!y(u,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(s){var c=s.context,p=c.shape,l=p.parent;y(p,"bpmn:DataStoreReference")&&p.type!=="label"&&y(l,"bpmn:Collaboration")&&a(p)}),this.postExecute("shape.move",function(s){var c=s.context,p=c.shape,l=c.oldParent,u=p.parent;if(!y(l,"bpmn:Collaboration")&&y(p,"bpmn:DataStoreReference")&&p.type!=="label"&&y(u,"bpmn:Collaboration")){var h=y(l,"bpmn:Participant")?l:ES(l,"bpmn:Participant");a(p,h)}}),this.postExecute("shape.delete",function(s){var c=s.context,p=c.shape,l=t.getRootElement();dt(p,["bpmn:Participant","bpmn:SubProcess"])&&y(l,"bpmn:Collaboration")&&o(l).filter(function(u){return _S(u,p)}).forEach(function(u){a(u)})}),this.postExecute("canvas.updateRoot",function(s){var c=s.context,p=c.oldRoot,l=c.newRoot,u=o(p);u.forEach(function(h){y(l,"bpmn:Process")&&a(h,l)})})}Np.$inject=["canvas","commandStack","elementRegistry","eventBus"],q(Np,V);function _S(t,e){for(var n=t.businessObject||t,i=e.businessObject||e;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}function ES(t,e){for(;t.parent;){if(y(t.parent,e))return t.parent;t=t.parent}}var wS=500;function Op(t,e){V.call(this,t);function n(i,r){var o=Li(r),a=[],s=[];if(Si(o,function(u){return u.y>i.y?s.push(u):a.push(u),u.children}),!!o.length){var c;s.length&&a.length?c=i.height/2:c=i.height;var p,l;a.length&&(p=e.calculateAdjustments(a,"y",c,i.y-10),e.makeSpace(p.movingShapes,p.resizingShapes,{x:0,y:c},"s")),s.length&&(l=e.calculateAdjustments(s,"y",-c,i.y+i.height+10),e.makeSpace(l.movingShapes,l.resizingShapes,{x:0,y:-c},"n"))}}this.postExecuted("shape.delete",wS,function(i){var r=i.context,o=r.hints,a=r.shape,s=r.oldParent;y(a,"bpmn:Lane")&&(o&&o.nested||n(a,s))})}Op.$inject=["eventBus","spaceTool"],q(Op,V);var _m=500;function es(t,e){e.invoke(V,this),this._bpmnReplace=t;var n=this;this.postExecuted("elements.create",_m,function(i){var r=i.elements;r.filter(function(o){var a=o.host;return Em(o,a)}).map(function(o){return r.indexOf(o)}).forEach(function(o){i.elements[o]=n._replaceShape(r[o])})},!0),this.preExecute("elements.move",_m,function(i){var r=i.shapes,o=i.newHost;r.forEach(function(a,s){var c=a.host;Em(a,CS(r,c)?c:o)&&(r[s]=n._replaceShape(a))})},!0)}es.$inject=["bpmnReplace","injector"],q(es,V),es.prototype._replaceShape=function(t){var e=SS(t),n;return e?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:e.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(t,n,{layoutConnection:!1})};function SS(t){var e=W(t),n=e.eventDefinitions;return n&&n[0]}function Em(t,e){return!xt(t)&&y(t,"bpmn:BoundaryEvent")&&!e}function CS(t,e){return t.indexOf(e)!==-1}function jp(t,e,n){V.call(this,t);function i(r,o,a){var s=o.waypoints,c,p,l,u,h,d,f,v=r.outgoing.slice(),g=r.incoming.slice(),R;it(a.width)?R=nt(a):R=a;var E=op(s,R);if(E){if(c=s.slice(0,E.index),p=s.slice(E.index+(E.bendpoint?1:0)),!c.length||!p.length)return;l=E.bendpoint?s[E.index]:R,(c.length===1||!wm(r,c[c.length-1]))&&c.push(Sm(l)),(p.length===1||!wm(r,p[0]))&&p.unshift(Sm(l))}u=o.source,h=o.target,e.canConnect(u,r,o)&&(n.reconnectEnd(o,r,c||R),d=o),e.canConnect(r,h,o)&&(d?f=n.connect(r,h,{type:o.type,waypoints:p}):(n.reconnectStart(o,r,p||R),f=o));var _=[].concat(d&&ct(g,function(x){return x.source===d.source})||[],f&&ct(v,function(x){return x.target===f.target})||[]);_.length&&n.removeElements(_)}this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,s=r.delta,c=a[0];if(!(!c||!o)){o&&o.waypoints&&(r.newParent=o=o.parent);var p=nt(c),l={x:p.x+s.x,y:p.y+s.y},u=yt(o.children,function(h){var d=e.canInsert(a,h);return d&&op(h.waypoints,l)});u&&(r.targetFlow=u,r.position=l)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,s=r.position;a&&i(o[0],a,s)},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;e.canInsert(a,o)&&(r.targetFlow=o,r.parent=o.parent)},!0),this.postExecuted("shape.create",function(r){var o=r.shape,a=r.targetFlow,s=r.position;a&&i(o,a,s)},!0)}q(jp,V),jp.$inject=["eventBus","bpmnRules","modeling"];function wm(t,e){var n=e.x,i=e.y;return n>=t.x&&n<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function Sm(t){return N({},t)}function Lp(t,e){V.call(this,t),this.preExecuted("connection.create",function(n){var i=n.context,r=i.connection,o=i.source,a=i.target,s=i.hints;if(!(s&&s.createElementsBehavior===!1)&&fr(r)){var c=[];y(o,"bpmn:EventBasedGateway")?c=a.incoming.filter(fr):c=a.incoming.filter(function(p){return fr(p)&&y(p.source,"bpmn:EventBasedGateway")}),c.forEach(function(p){e.removeConnection(p)})}}),this.preExecuted("shape.replace",function(n){var i=n.context,r=i.newShape;if(y(r,"bpmn:EventBasedGateway")){var o=r.outgoing.filter(fr).reduce(function(a,s){return a.includes(s.target)?a:a.concat(s.target)},[]);o.forEach(function(a){a.incoming.filter(fr).forEach(function(s){const c=a.incoming.filter(fr).filter(function(p){return p.source===r});(s.source!==r||c.length>1)&&e.removeConnection(s)})})}})}Lp.$inject=["eventBus","modeling"],q(Lp,V);function fr(t){return y(t,"bpmn:SequenceFlow")}var ns=1500,RS=2e3;function Cm(t,e,n){e.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],ns,function(i){var r=i.context,o=r.shape||i.shape,a=i.hover;y(a,"bpmn:Lane")&&!dt(o,["bpmn:Lane","bpmn:Participant"])&&(i.hover=on(a),i.hoverGfx=t.getGraphics(i.hover));var s=n.getRootElement();a!==s&&(o.labelTarget||y(o,"bpmn:Group"))&&(i.hover=s,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],ns,function(i){var r=i.hover;y(r,"bpmn:Lane")&&(i.hover=on(r)||r,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["bendpoint.move.hover"],ns,function(i){var r=i.context,o=i.hover,a=r.type;y(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=on(o)||o,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["connect.start"],ns,function(i){var r=i.context,o=r.start;y(o,"bpmn:Lane")&&(r.start=on(o)||o)}),e.on("shape.move.start",RS,function(i){var r=i.shape;y(r,"bpmn:Lane")&&(i.shape=on(r)||r)})}Cm.$inject=["elementRegistry","eventBus","canvas"];function PS(t){return t.create("bpmn:Category")}function kS(t){return t.create("bpmn:CategoryValue")}function TS(t,e,n){return Zt(e.get("categoryValue"),t),t.$parent=e,Zt(n.get("rootElements"),e),e.$parent=n,t}function AS(t){var e=t.$parent;return e&&(Wt(e.get("categoryValue"),t),t.$parent=null),t}function MS(t){var e=t.$parent;return e&&(Wt(e.get("rootElements"),t),t.$parent=null),t}var Rm=770;function Ip(t,e,n,i,r,o){r.invoke(V,this);function a(){return n.filter(function(f){return y(f,"bpmn:Group")})}function s(f,v){return f.some(function(g){var R=W(g),E=R.categoryValueRef&&R.categoryValueRef.$parent;return E===v})}function c(f,v){return f.some(function(g){var R=W(g);return R.categoryValueRef===v})}function p(f,v,g){var R=a().filter(function(E){return E.businessObject!==g});v&&!s(R,v)&&MS(v),f&&!c(R,f)&&AS(f)}function l(f,v){return TS(f,v,e.getDefinitions())}function u(f,v){var g=W(f),R=g.categoryValueRef;R||(R=g.categoryValueRef=v.categoryValue=v.categoryValue||kS(t));var E=R.$parent;E||(E=R.$parent=v.category=v.category||PS(t)),l(R,E,e.getDefinitions())}function h(f,v){var g=v.category,R=v.categoryValue,E=W(f);R?(E.categoryValueRef=null,p(R,g,E)):p(null,E.categoryValueRef.$parent,E)}this.execute("label.create",function(f){var v=f.context,g=v.labelTarget;y(g,"bpmn:Group")&&u(g,v)}),this.revert("label.create",function(f){var v=f.context,g=v.labelTarget;y(g,"bpmn:Group")&&h(g,v)}),this.execute("shape.delete",function(f){var v=f.context,g=v.shape,R=W(g);if(!(!y(g,"bpmn:Group")||g.labelTarget)){var E=v.categoryValue=R.categoryValueRef,_;E&&(_=v.category=E.$parent,p(E,_,R),R.categoryValueRef=null)}}),this.reverted("shape.delete",function(f){var v=f.context,g=v.shape;if(!(!y(g,"bpmn:Group")||g.labelTarget)){var R=v.category,E=v.categoryValue,_=W(g);E&&(_.categoryValueRef=E,l(E,R))}}),this.execute("shape.create",function(f){var v=f.context,g=v.shape;!y(g,"bpmn:Group")||g.labelTarget||W(g).categoryValueRef&&u(g,v)}),this.reverted("shape.create",function(f){var v=f.context,g=v.shape;!y(g,"bpmn:Group")||g.labelTarget||W(g).categoryValueRef&&h(g,v)});function d(f,v){var g=t.create(f.$type);return o.copyElement(f,g,null,v)}i.on("copyPaste.copyElement",Rm,function(f){var v=f.descriptor,g=f.element;if(!(!y(g,"bpmn:Group")||g.labelTarget)){var R=W(g);if(R.categoryValueRef){var E=R.categoryValueRef;v.categoryValue=d(E,!0),E.$parent&&(v.category=d(E.$parent,!0))}}}),i.on("copyPaste.pasteElement",Rm,function(f){var v=f.descriptor,g=v.businessObject,R=v.categoryValue,E=v.category;R&&(R=g.categoryValueRef=d(R)),E&&(R.$parent=d(E)),delete v.category,delete v.categoryValue})}Ip.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],q(Ip,V);function $p(t,e,n,i){var r,o,a,s,c;return r=(i.y-n.y)*(e.x-t.x)-(i.x-n.x)*(e.y-t.y),r==0?null:(o=t.y-n.y,a=t.x-n.x,c=(i.x-n.x)*o-(i.y-n.y)*a,s=c/r,{x:Math.round(t.x+s*(e.x-t.x)),y:Math.round(t.y+s*(e.y-t.y))})}function Pm(t){function e(i,r,o){var a={x:o.x,y:o.y-50},s={x:o.x-50,y:o.y},c=$p(i,r,o,a),p=$p(i,r,o,s),l;c&&p?km(c,o)>km(p,o)?l=p:l=c:l=c||p,i.original=l}function n(i){var r=i.waypoints;e(r[0],r[1],nt(i.source)),e(r[r.length-1],r[r.length-2],nt(i.target))}t.on("bpmnElement.added",function(i){var r=i.element;r.waypoints&&n(r)})}Pm.$inject=["eventBus"];function km(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function zp(t){V.call(this,t);var e=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=n.context.shape,r=W(i),o=gt(i);dt(r,e)&&!o.get("isHorizontal")&&o.set("isHorizontal",!0)})}zp.$inject=["eventBus"],q(zp,V);var Tm=Math.sqrt,Am=Math.min,DS=Math.max,Mm=Math.abs;function Dm(t){return Math.pow(t,2)}function co(t,e){return Tm(Dm(t.x-e.x)+Dm(t.y-e.y))}function BS(t,e){var n=0,i,r,o,a,s,c,p,l,u,h,d;for(n=0;n<e.length-1;n++){if(i=e[n],r=e[n+1],Nm(i,r)?p=[i]:(o=co(t,i),a=co(t,r),c=Am(o,a),p=NS(i,r,t,c)),p.length<1)throw new Error("expected between [1, 2] circle -> line intersections");p.length===1&&(l={type:"bendpoint",position:p[0],segmentIndex:n,bendpointIndex:Nm(i,p[0])?n:n+1}),p.length===2&&(s=jS(p[0],p[1]),l={type:"segment",position:s,segmentIndex:n,relativeLocation:co(i,s)/co(i,r)}),u=co(l.position,t),(!d||h>u)&&(d=l,h=u)}return d}function NS(t,e,n,i){var r=e.x-t.x,o=e.y-t.y,a=n.x-t.x,s=n.y-t.y,c=r*r+o*o,p=r*a+o*s,l=a*a+s*s-i*i,u=p/c,h=l/c,d=u*u-h;if(d<0&&d>-1e-6&&(d=0),d<0)return[];var f=Tm(d),v=-u+f,g=-u-f,R={x:t.x-r*v,y:t.y-o*v};if(d===0)return[R];var E={x:t.x-r*g,y:t.y-o*g};return[R,E].filter(function(_){return OS(_,t,e)})}function OS(t,e,n){return Bm(t.x,e.x,n.x)&&Bm(t.y,e.y,n.y)}function Bm(t,e,n){return t>=Am(e,n)-is&&t<=DS(e,n)+is}function jS(t,e){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}var is=.1;function Nm(t,e){return Mm(t.x-e.x)<=is&&Mm(t.y-e.y)<=is}function LS(t,e,n,i){var r=n.segmentIndex,o=e.length-t.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o<s?s:r+o:r}if(i.bendpointMove){var c=i.bendpointMove.insert,p=i.bendpointMove.bendpointIndex,l;if(o===0)return r;if(r>=p&&(l=c?r+1:r-1),r<p&&(l=r,c&&n.type!=="bendpoint"&&p-1===r)){var u=jm(e,p);u<n.relativeLocation&&l++}return l}return o===0?r:i.connectionStart&&r===0?0:i.connectionEnd&&r===t.length-2?e.length-2:Math.floor((e.length-2)/2)}function Om(t,e,n,i){var r=0,o=0,a={point:t,delta:{x:0,y:0}},s=BS(t,n),c=s.segmentIndex,p=LS(n,e,s,i);if(p<0||p>e.length-2||p===null)return a;var l=Lm(n,c),u=Lm(e,p),h=s.position,d=$S(l,h),f=IS(l,u);if(s.type==="bendpoint"){var v=e.length-n.length,g=s.bendpointIndex,R=n[g];if(e.indexOf(R)!==-1)return a;if(v===0){var E=e[g];return r=E.x-s.position.x,o=E.y-s.position.y,{delta:{x:r,y:o},point:{x:t.x+r,y:t.y+o}}}v<0&&g!==0&&g<n.length-1&&(d=jm(n,g))}var _={x:(u[1].x-u[0].x)*d+u[0].x,y:(u[1].y-u[0].y)*d+u[0].y},x=rE({x:t.x-h.x,y:t.y-h.y},f);return r=_.x+x.x-t.x,o=_.y+x.y-t.y,{point:ei(_),delta:ei({x:r,y:o})}}function jm(t,e){var n=Da(t[e-1],t[e]),i=Da(t[e],t[e+1]),r=n/(n+i);return r}function IS(t,e){var n=Gd(t),i=Gd(e);return i-n}function Lm(t,e){return[t[e],t[e+1]]}function $S(t,e){var n=Da(t[0],t[1]),i=Da(t[0],e);return n===0?0:i/n}function zS(t,e,n,i){var r=nt(t);return Om(r,e,n,i).delta}function po(t,e,n){var i=Hr(e),r=Hr(n),o=en(t,i),a={x:o.x*(n.width/e.width),y:o.y*(n.height/e.height)};return ei({x:r.x+a.x,y:r.y+a.y})}function Im(t,e,n){var i=Hr(t),r=Hr(e),o=Hr(n),a=en(t,i),s=en(i,r),c=FS(i,e,n);if(c)return c;var p={x:s.x*(n.width/e.width),y:s.y*(n.height/e.height)},l={x:o.x+p.x,y:o.y+p.y};return ei({x:l.x+a.x-t.x,y:l.y+a.y-t.y})}function FS(t,e,n){var i=X(e),r=X(n);if(HS(i,r))return null;var o=le(e,t),a,s,c;if(o==="top")a={x:0,y:r.bottom-i.bottom};else if(o==="bottom")a={x:0,y:r.top-i.top};else if(o==="right")a={x:r.left-i.left,y:0};else if(o==="left")a={x:r.right-i.right,y:0};else return null;return s={x:t.x+a.x,y:t.y+a.y},c=le(n,s),c!==o?null:a}function HS(t,e){return GS(t,e)||VS(t,e)}function GS(t,e){return t.right!==e.right&&t.left!==e.left}function VS(t,e){return t.top!==e.top&&t.bottom!==e.bottom}var $m="name",zm="text";function Fp(t,e,n,i){V.call(this,t),this.postExecute("element.updateProperties",r),this.postExecute("element.updateModdleProperties",a=>{W(a.context.element)===a.context.moddleElement&&r(a)});function r(a){var s=a.context,c=s.element,p=s.properties;if($m in p&&e.updateLabel(c,p[$m]),zm in p&&y(c,"bpmn:TextAnnotation")){var l=i.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},p[zm]||"");e.updateLabel(c,p.text,l)}}this.postExecute(["shape.create","connection.create"],function(a){var s=a.context,c=s.hints||{};if(c.createElementsBehavior!==!1){var p=s.shape||s.connection;xt(p)||!ki(p)||Ue(p)&&e.updateLabel(p,Ue(p))}}),this.postExecute("shape.delete",function(a){var s=a.context,c=s.labelTarget,p=s.hints||{};c&&p.unsetLabel!==!1&&e.updateLabel(c,null,null,{removeShape:!1})});function o(a){var s=a.context,c=s.connection,p=c.label,l=N({},s.hints),u=s.newWaypoints||c.waypoints,h=s.oldWaypoints;return typeof l.startChanged>"u"&&(l.startChanged=!!l.connectionStart),typeof l.endChanged>"u"&&(l.endChanged=!!l.connectionEnd),zS(p,u,h,l)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(a){var s=a.context,c=s.hints||{};if(c.labelBehavior!==!1){var p=s.connection,l=p.label,u;!l||!l.parent||(u=o(a),e.moveShape(l,u))}}),this.postExecute(["shape.replace"],function(a){var s=a.context,c=s.newShape,p=s.oldShape,l=W(c);l&&ki(l)&&p.label&&c.label&&(c.label.x=p.label.x,c.label.y=p.label.y)}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,p=s.newBounds,l=s.oldBounds;if(ca(c)){var u=c.label,h=nt(u),d=qS(l),f=US(h,d),v=WS(f,l,p);e.moveShape(u,v)}})}q(Fp,V),Fp.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function WS(t,e,n){var i=po(t,e,n);return ei(en(i,t))}function US(t,e){if(e.length){var n=KS(t,e);return ap(t,n)}}function qS(t){return[[{x:t.x,y:t.y},{x:t.x+(t.width||0),y:t.y}],[{x:t.x+(t.width||0),y:t.y},{x:t.x+(t.width||0),y:t.y+(t.height||0)}],[{x:t.x,y:t.y+(t.height||0)},{x:t.x+(t.width||0),y:t.y+(t.height||0)}],[{x:t.x,y:t.y},{x:t.x,y:t.y+(t.height||0)}]]}function KS(t,e){var n=e.map(function(r){return{line:r,distance:Vd(t,r)}}),i=ln(n,"distance");return i[0].line}function YS(t,e,n,i){return Om(t,e,n,i).point}function Hp(t,e){V.call(this,t);function n(i,r){var o=i.context,a=o.connection,s=N({},o.hints),c=o.newWaypoints||a.waypoints,p=o.oldWaypoints;return typeof s.startChanged>"u"&&(s.startChanged=!!s.connectionStart),typeof s.endChanged>"u"&&(s.endChanged=!!s.connectionEnd),YS(r,c,p,s)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming;s.forEach(function(c){var p=c.waypoints[c.waypoints.length-1],l=n(i,p),u=[].concat(c.waypoints.slice(0,-1),[l]);e.updateWaypoints(c,u)}),a.forEach(function(c){var p=c.waypoints[0],l=n(i,p),u=[].concat([l],c.waypoints.slice(1));e.updateWaypoints(c,u)})}),this.postExecute(["connection.move"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming,c=r.delta;s.forEach(function(p){var l=p.waypoints[p.waypoints.length-1],u={x:l.x+c.x,y:l.y+c.y},h=[].concat(p.waypoints.slice(0,-1),[u]);e.updateWaypoints(p,h)}),a.forEach(function(p){var l=p.waypoints[0],u={x:l.x+c.x,y:l.y+c.y},h=[].concat([u],p.waypoints.slice(1));e.updateWaypoints(p,h)})})}q(Hp,V),Hp.$inject=["eventBus","modeling"];function rs(t,e,n){var i=as(t),r=Hm(i,e),o=i[0];return r.length?r[r.length-1]:po(o.original||o,n,e)}function os(t,e,n){var i=as(t),r=Hm(i,e),o=i[i.length-1];return r.length?r[0]:po(o.original||o,n,e)}function Gp(t,e,n){var i=as(t),r=Fm(e,n),o=i[0];return po(o.original||o,r,e)}function Vp(t,e,n){var i=as(t),r=Fm(e,n),o=i[i.length-1];return po(o.original||o,r,e)}function Fm(t,e){return{x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height}}function as(t){var e=t.waypoints;if(!e.length)throw new Error("connection#"+t.id+": no waypoints");return e}function Hm(t,e){var n=be(t,ZS);return ct(n,function(i){return XS(i,e)})}function XS(t,e){return le(e,t,1)==="intersect"}function ZS(t){return t.original||t}function Wp(t,e){V.call(this,t),this.postExecute("shape.replace",function(n){var i=n.oldShape,r=n.newShape;if(QS(i,r)){var o=JS(i);o.incoming.forEach(function(a){var s=os(a,r,i);e.reconnectEnd(a,r,s)}),o.outgoing.forEach(function(a){var s=rs(a,r,i);e.reconnectStart(a,r,s)})}},!0)}Wp.$inject=["eventBus","modeling"],q(Wp,V);function QS(t,e){return y(t,"bpmn:Participant")&&vt(t)&&y(e,"bpmn:Participant")&&!vt(e)}function JS(t){var e=Rr([t],!1),n=[],i=[];return e.forEach(function(r){r!==t&&(r.incoming.forEach(function(o){y(o,"bpmn:MessageFlow")&&n.push(o)}),r.outgoing.forEach(function(o){y(o,"bpmn:MessageFlow")&&i.push(o)}))},[]),{incoming:n,outgoing:i}}var tC="flow elements must be children of pools/participants";function Gm(t,e,n){function i(r,o,a){e.add({position:{x:r.x+5,y:r.y+5},type:"error",timeout:a||2e3,html:"<div>"+o+"</div>"})}t.on(["shape.move.rejected","create.rejected"],function(r){var o=r.context,a=o.shape,s=o.target;y(s,"bpmn:Collaboration")&&y(a,"bpmn:FlowNode")&&i(r,n(tC))})}Gm.$inject=["eventBus","tooltips","translate"];function Up(t,e){V.call(this,t),this.preExecute("shape.resize",function(n){var i=n.shape,r=gt(i),o=r&&r.get("label"),a=o&&o.get("bounds");a&&e.updateModdleProperties(i,o,{bounds:void 0})},!0)}q(Up,V),Up.$inject=["eventBus","modeling"];function qp(t,e,n){V.call(this,t),this.preExecute("shape.delete",function(i){var r=i.context.shape;if(!(r.incoming.length!==1||r.outgoing.length!==1)){var o=r.incoming[0],a=r.outgoing[0];if(!(!y(o,"bpmn:SequenceFlow")||!y(a,"bpmn:SequenceFlow"))&&e.canConnect(o.source,a.target,o)){var s=eC(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,s)}}})}q(qp,V),qp.$inject=["eventBus","bpmnRules","modeling"];function mr(t){return t.original||t}function eC(t,e){var n=$p(mr(t[t.length-2]),mr(t[t.length-1]),mr(e[1]),mr(e[0]));return n?[].concat(t.slice(0,t.length-1),[n],e.slice(1)):[mr(t[0]),mr(e[e.length-1])]}function Kp(t,e){V.call(this,t),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;y(i,"bpmn:Participant")&&(n.collaborationRoot=r)},!0),this.postExecute("shape.delete",function(n){var i=n.collaborationRoot;i&&!i.businessObject.participants.length&&e.makeProcess()},!0)}Kp.$inject=["eventBus","modeling"],q(Kp,V);function Yp(t,e,n,i){V.call(this,t);var r=i.get("dragging",!1);function o(c){var p=c.source,l=c.target,u=c.parent;if(u){var h,d;y(c,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(p,l)||(d=!0),n.canConnectMessageFlow(p,l)&&(h="bpmn:MessageFlow")),y(c,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(p,l)||(d=!0),n.canConnectSequenceFlow(p,l)&&(h="bpmn:SequenceFlow")),y(c,"bpmn:Association")&&!n.canConnectAssociation(p,l)&&(d=!0),d&&e.removeConnection(c),h&&e.connect(p,l,{type:h,waypoints:c.waypoints.slice()})}}function a(c){var p=c.context,l=p.connection,u=p.newSource||l.source,h=p.newTarget||l.target,d,f;d=n.canConnect(u,h),!(!d||d.type===l.type)&&(f=e.connect(u,h,{type:d.type,waypoints:l.waypoints.slice()}),e.removeConnection(l),p.connection=f,r&&s(l,f))}function s(c,p){var l=r.context(),u=l&&l.payload.previousSelection,h;!u||!u.length||(h=u.indexOf(c),h!==-1&&u.splice(h,1,p))}this.postExecuted("elements.move",function(c){var p=c.closure,l=p.allConnections;k(l,o)},!0),this.preExecute("connection.reconnect",a),this.postExecuted("element.updateProperties",function(c){var p=c.context,l=p.properties,u=p.element,h=u.businessObject,d;l.default&&(d=yt(u.outgoing,hn({id:u.businessObject.default.id})),d&&e.updateProperties(d,{conditionExpression:void 0})),l.conditionExpression&&h.sourceRef.default===h&&e.updateProperties(u.source,{default:void 0})})}q(Yp,V),Yp.$inject=["eventBus","modeling","bpmnRules","injector"];function ss(t,e,n,i,r,o){i.invoke(V,this),this._bpmnReplace=t,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var s=a.context,c=s.parent,p=s.elements,l=Ge(p,function(u,h){var d=e.canReplace([h],h.host||h.parent||c);return d?u.concat(d.replacements):u},[]);l.length&&this._replaceElements(p,l)},this),this.postExecuted(["elements.move"],500,function(a){var s=a.context,c=s.newParent,p=s.newHost,l=[];k(s.closure.topLevel,function(h){Oe(h)?l=l.concat(h.children):l=l.concat(h)}),l.length===1&&p&&(c=p);var u=e.canReplace(l,c);u&&this._replaceElements(l,u.replacements,p)},this),this.postExecute(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,p=s.newShape,l=c.attachers,u;l&&l.length&&(u=e.canReplace(l,p),this._replaceElements(l,u.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,p=s.newShape;r.unclaimId(c.businessObject.id,c.businessObject),r.updateProperties(p,{id:c.id})})}q(ss,V),ss.prototype._replaceElements=function(t,e){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;k(e,function(o){var a={type:o.newElementType},s=n.get(o.oldElementId),c=t.indexOf(s);t[c]=i.replaceElement(s,a,{select:!1})}),e&&r.select(t)},ss.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var nC=1500,iC={width:140,height:120},$i={width:300,height:60},lo={width:300,height:150},Vm={width:140,height:120},Wm={width:50,height:30};function Um(t){t.on("resize.start",nC,function(e){var n=e.context,i=n.shape,r=n.direction,o=n.balanced;(y(i,"bpmn:Lane")||y(i,"bpmn:Participant"))&&(n.resizeConstraints=lC(i,r,o)),y(i,"bpmn:Participant")&&(n.minDimensions=lo),y(i,"bpmn:SubProcess")&&vt(i)&&(n.minDimensions=Vm),y(i,"bpmn:TextAnnotation")&&(n.minDimensions=Wm)})}Um.$inject=["eventBus"];var cs=Math.abs,rC=Math.min,oC=Math.max;function qm(t,e,n,i){var r=t[e];t[e]=r===void 0?n:i(n,r)}function ps(t,e,n){return qm(t,e,n,rC)}function ls(t,e,n){return qm(t,e,n,oC)}var aC=20,sC=50,cC=20,pC=20;function lC(t,e,n){var i=on(t),r=!0,o=!0,a=Fa(i,[i]),s=X(t),c={},p={};/e/.test(e)?p.right=s.left+$i.width:/w/.test(e)&&(p.left=s.right-$i.width),a.forEach(function(u){var h=X(u);/n/.test(e)&&(h.top<s.top-10&&(r=!1),n&&cs(s.top-h.bottom)<10&&ls(c,"top",h.top+$i.height),cs(s.top-h.top)<5&&ps(p,"top",h.bottom-$i.height)),/s/.test(e)&&(h.bottom>s.bottom+10&&(o=!1),n&&cs(s.bottom-h.top)<10&&ps(c,"bottom",h.bottom-$i.height),cs(s.bottom-h.bottom)<5&&ls(p,"bottom",h.top+$i.height))});var l=i.children.filter(function(u){return!u.hidden&&!u.waypoints&&(y(u,"bpmn:FlowElement")||y(u,"bpmn:Artifact"))});return l.forEach(function(u){var h=X(u);r&&/n/.test(e)&&ps(p,"top",h.top-cC),/e/.test(e)&&ls(p,"right",h.right+aC),o&&/s/.test(e)&&ls(p,"bottom",h.bottom+pC),/w/.test(e)&&ps(p,"left",h.left-sC)}),{min:p,max:c}}var Km=1001;function Ym(t,e){t.on("resize.start",Km+500,function(n){var i=n.context,r=i.shape;(y(r,"bpmn:Lane")||y(r,"bpmn:Participant"))&&(i.balanced=!ir(n))}),t.on("resize.end",Km,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(y(r,"bpmn:Lane")||y(r,"bpmn:Participant"))return o&&(a=Iu(a),e.resizeLane(r,a,i.balanced)),!1})}Ym.$inject=["eventBus","modeling"];var uC=500;function Xp(t,e,n,i,r){n.invoke(V,this);function o(l){return dt(l,["bpmn:ReceiveTask","bpmn:SendTask"])||hC(l,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(l){var u=t.getDefinitions(),h=u.get("rootElements");return!!yt(h,hn({id:l.id}))}function s(l){if(y(l,"bpmn:ErrorEventDefinition"))return"errorRef";if(y(l,"bpmn:EscalationEventDefinition"))return"escalationRef";if(y(l,"bpmn:MessageEventDefinition"))return"messageRef";if(y(l,"bpmn:SignalEventDefinition"))return"signalRef"}function c(l){if(dt(l,["bpmn:ReceiveTask","bpmn:SendTask"]))return l.get("messageRef");var u=l.get("eventDefinitions"),h=u[0];return h.get(s(h))}function p(l,u){if(dt(l,["bpmn:ReceiveTask","bpmn:SendTask"]))return l.set("messageRef",u);var h=l.get("eventDefinitions"),d=h[0];return d.set(s(d),u)}this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(l){var u=l.shape||l.element;if(o(u)){var h=W(u),d=c(h),f;d&&!a(d)&&(f=t.getDefinitions().get("rootElements"),Zt(f,d),l.addedRootElement=d)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(l){var u=l.addedRootElement;if(u){var h=t.getDefinitions().get("rootElements");Wt(h,u)}},!0),e.on("copyPaste.copyElement",function(l){var u=l.descriptor,h=l.element;if(!(h.labelTarget||!o(h))){var d=W(h),f=c(d);f&&(u.referencedRootElement=f)}}),e.on("copyPaste.pasteElement",uC,function(l){var u=l.descriptor,h=u.businessObject,d=u.referencedRootElement;d&&(a(d)||(d=i.copyElement(d,r.create(d.$type))),p(h,d),delete u.referencedRootElement)})}Xp.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],q(Xp,V);function hC(t,e){return lt(e)||(e=[e]),kn(e,function(n){return sa(t,n)})}var dC=Math.max;function Xm(t){t.on("spaceTool.getMinDimensions",function(e){var n=e.shapes,i=e.axis,r=e.start,o={};return k(n,function(a){var s=a.id;y(a,"bpmn:Participant")&&(fC(i)?o[s]=lo:o[s]={width:lo.width,height:mC(a,r)}),y(a,"bpmn:SubProcess")&&vt(a)&&(o[s]=Vm),y(a,"bpmn:TextAnnotation")&&(o[s]=Wm),y(a,"bpmn:Group")&&(o[s]=iC)}),o})}Xm.$inject=["eventBus"];function fC(t){return t==="x"}function mC(t,e){var n;return vC(t)?(n=yC(t,e),dC(lo.height,n)):lo.height}function vC(t){return!!Li(t).length}function yC(t,e){var n=Li(t),i;return i=Zm(n,e),t.height-i.height+$i.height}function Zm(t,e){var n,i,r;for(n=0;n<t.length;n++)if(i=t[n],e>=i.y&&e<=i.y+i.height)return r=Li(i),r.length?Zm(r,e):i}var Qm=400,gC=600,Jm={x:180,y:160};function hi(t,e,n,i,r,o,a){V.call(this,e),this._canvas=t,this._eventBus=e,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(u){return y(u,"bpmn:SubProcess")&&!vt(u)}function p(u){var h=u.shape,d=u.newRootElement,f=W(h);d=s._addDiagram(d||f),u.newRootElement=t.addRootElement(d)}function l(u){var h=u.shape,d=W(h);s._removeDiagram(d);var f=u.newRootElement=a.get(Ln(d));t.removeRootElement(f)}this.executed("shape.create",function(u){var h=u.shape;c(h)&&p(u)},!0),this.postExecuted("shape.create",function(u){var h=u.shape,d=u.newRootElement;!d||!h.children||(s._showRecursively(h.children),s._moveChildrenToShape(h,d))},!0),this.reverted("shape.create",function(u){var h=u.shape;c(h)&&l(u)},!0),this.preExecuted("shape.delete",function(u){var h=u.shape;if(c(h)){var d=a.get(Ln(h));d&&n.removeElements(d.children.slice())}},!0),this.executed("shape.delete",function(u){var h=u.shape;c(h)&&l(u)},!0),this.reverted("shape.delete",function(u){var h=u.shape;c(h)&&p(u)},!0),this.preExecuted("shape.replace",function(u){var h=u.oldShape,d=u.newShape;!c(h)||!c(d)||(u.oldRoot=t.removeRootElement(Ln(h)))},!0),this.postExecuted("shape.replace",function(u){var h=u.newShape,d=u.oldRoot,f=t.findRoot(Ln(h));if(!(!d||!f)){var v=d.children;n.moveElements(v,{x:0,y:0},f)}},!0),this.executed("element.updateProperties",function(u){var h=u.element;if(y(h,"bpmn:SubProcess")){var d=u.properties,f=u.oldProperties,v=f.id,g=d.id;if(v!==g){if($c(h)){a.updateId(h,Mi(g)),a.updateId(v,g);return}var R=a.get(Mi(v));R&&a.updateId(Mi(v),Mi(g))}}},!0),this.reverted("element.updateProperties",function(u){var h=u.element;if(y(h,"bpmn:SubProcess")){var d=u.properties,f=u.oldProperties,v=f.id,g=d.id;if(v!==g){if($c(h)){a.updateId(h,Mi(v)),a.updateId(g,v);return}var R=a.get(Mi(g));R&&a.updateId(R,Mi(v))}}},!0),e.on("element.changed",function(u){var h=u.element;if($c(h)){var d=h,f=a.get(Vh(d));!f||f===d||e.fire("element.changed",{element:f})}}),this.executed("shape.toggleCollapse",Qm,function(u){var h=u.shape;y(h,"bpmn:SubProcess")&&(vt(h)?l(u):(p(u),s._showRecursively(h.children)))},!0),this.reverted("shape.toggleCollapse",Qm,function(u){var h=u.shape;y(h,"bpmn:SubProcess")&&(vt(h)?l(u):(p(u),s._showRecursively(h.children)))},!0),this.postExecuted("shape.toggleCollapse",gC,function(u){var h=u.shape;if(y(h,"bpmn:SubProcess")){var d=u.newRootElement;d&&(vt(h)?s._moveChildrenToShape(d,h):s._moveChildrenToShape(h,d))}},!0),e.on("copyPaste.createTree",function(u){var h=u.element,d=u.children;if(c(h)){var f=Ln(h),v=a.get(f);v&&d.push.apply(d,v.children)}}),e.on("copyPaste.copyElement",function(u){var h=u.descriptor,d=u.element,f=u.elements,v=d.parent,g=y(gt(v),"bpmndi:BPMNPlane");if(g){var R=Vh(v),E=yt(f,function(_){return _.id===R});E&&(h.parent=E.id)}}),e.on("copyPaste.pasteElement",function(u){var h=u.descriptor;h.parent&&(c(h.parent)||h.parent.hidden)&&(h.hidden=!0)})}q(hi,V),hi.prototype._moveChildrenToShape=function(t,e){var n=this._modeling,i=t.children,r;if(i){i=i.concat(i.reduce(function(p,l){return l.label&&l.label.parent!==t?p.concat(l.label):p},[]));var o=i.filter(function(p){return!p.hidden});if(!o.length){n.moveElements(i,{x:0,y:0},e,{autoResize:!1});return}var a=Vt(o);if(!e.x)r={x:Jm.x-a.x,y:Jm.y-a.y};else{var s=nt(e),c=nt(a);r={x:s.x-c.x,y:s.y-c.y}}n.moveElements(i,r,e,{autoResize:!1})}},hi.prototype._showRecursively=function(t,e){var n=this,i=[];return t.forEach(function(r){r.hidden=!!e,i=i.concat(r),r.children&&(i=i.concat(n._showRecursively(r.children,r.collapsed||e)))}),i},hi.prototype._addDiagram=function(t){var e=this._bpmnjs,n=e.getDefinitions().diagrams;return t.businessObject||(t=this._createNewDiagram(t)),n.push(t.di.$parent),t},hi.prototype._createNewDiagram=function(t){var e=this._bpmnFactory,n=this._elementFactory,i=e.create("bpmndi:BPMNPlane",{bpmnElement:t}),r=e.create("bpmndi:BPMNDiagram",{plane:i});i.$parent=r;var o=n.createRoot({id:Ln(t),type:t.$type,di:i,businessObject:t,collapsed:!0});return o},hi.prototype._removeDiagram=function(t){var e=this._bpmnjs,n=e.getDefinitions().diagrams,i=yt(n,function(r){return r.plane.bpmnElement.id===t.id});return n.splice(n.indexOf(i),1),i},hi.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function Zp(t,e){t.invoke(V,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(!(!y(r,"bpmn:SubProcess")||!(y(i,"bpmn:Task")||y(i,"bpmn:CallActivity"))||!vt(r))){var o=bC(r);e.createShape({type:"bpmn:StartEvent"},o,r)}})}Zp.$inject=["injector","modeling"],q(Zp,V);function bC(t){return{x:t.x+t.width/6,y:t.y+t.height/2}}function Qp(t,e){V.call(this,t),this.postExecuted("shape.toggleCollapse",1500,function(n){var i=n.shape;if(vt(i))return;var r=Rr(i);r.forEach(function(a){var s=a.incoming.slice(),c=a.outgoing.slice();k(s,function(p){o(p,!0)}),k(c,function(p){o(p,!1)})});function o(a,s){r.indexOf(a.source)!==-1&&r.indexOf(a.target)!==-1||(s?e.reconnectEnd(a,i,nt(i)):e.reconnectStart(a,i,nt(i)))}},!0)}q(Qp,V),Qp.$inject=["eventBus","modeling"];var Jp=500;function tl(t,e,n){V.call(this,t);function i(a){a.length&&a.forEach(function(s){s.type==="label"&&!s.businessObject.name&&(s.hidden=!0)})}function r(a,s){var c=a.children,p=s,l,u;return l=xC(c).concat([a]),u=Vf(l),u?(p.width=Math.max(u.width,p.width),p.height=Math.max(u.height,p.height),p.x=u.x+(u.width-p.width)/2,p.y=u.y+(u.height-p.height)/2):(p.x=a.x+(a.width-p.width)/2,p.y=a.y+(a.height-p.height)/2),p}function o(a,s){return{x:a.x+(a.width-s.width)/2,y:a.y+(a.height-s.height)/2,width:s.width,height:s.height}}this.executed(["shape.toggleCollapse"],Jp,function(a){var s=a.context,c=s.shape;y(c,"bpmn:SubProcess")&&(c.collapsed?gt(c).isExpanded=!1:(i(c.children),gt(c).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],Jp,function(a){var s=a.context,c=s.shape;c.collapsed?gt(c).isExpanded=!1:gt(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],Jp,function(a){var s=a.context.shape,c=e.getDefaultSize(s),p;s.collapsed?p=o(s,c):p=r(s,c),n.resizeShape(s,p,null,{autoResize:s.collapsed?!1:"nwse"})})}q(tl,V),tl.$inject=["eventBus","elementFactory","modeling"];function xC(t){return t.filter(function(e){return!e.hidden})}function el(t,e,n,i){e.invoke(V,this),this.preExecute("shape.delete",function(r){var o=r.context,a=o.shape,s=a.businessObject;xt(a)||(y(a,"bpmn:Participant")&&vt(a)&&n.ids.unclaim(s.processRef.id),i.unclaimId(s.id,s))}),this.preExecute("connection.delete",function(r){var o=r.context,a=o.connection,s=a.businessObject;i.unclaimId(s.id,s)}),this.preExecute("canvas.updateRoot",function(){var r=t.getRootElement(),o=r.businessObject;y(r,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}q(el,V),el.$inject=["canvas","injector","moddle","modeling"];function nl(t,e){V.call(this,t),this.preExecute("connection.delete",function(n){var i=n.context,r=i.connection,o=r.source;_C(r,o)&&e.updateProperties(o,{default:null})})}q(nl,V),nl.$inject=["eventBus","modeling"];function _C(t,e){if(!y(t,"bpmn:SequenceFlow"))return!1;var n=W(e),i=W(t);return n.get("default")===i}var EC=500,wC=5e3;function il(t,e,n){V.call(this,t);var i;function r(){return i=i||new SC,i.enter(),i}function o(){if(!i)throw new Error(n("out of bounds release"));return i}function a(){if(!i)throw new Error(n("out of bounds release"));var c=i.leave();return c&&(e.updateLaneRefs(i.flowNodes,i.lanes),i=null),c}var s=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(s,wC,function(c){r()}),this.postExecuted(s,EC,function(c){a()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(c){var p=c.context,l=p.shape,u=o();l.labelTarget||(y(l,"bpmn:Lane")&&u.addLane(l),y(l,"bpmn:FlowNode")&&u.addFlowNode(l))})}il.$inject=["eventBus","modeling","translate"],q(il,V);function SC(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(t){this.lanes.push(t)},this.addFlowNode=function(t){this.flowNodes.push(t)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}const CC={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","modelingFeedback","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior"],adaptiveLabelPositioningBehavior:["type",Sp],appendBehavior:["type",Cp],associationBehavior:["type",Rp],attachEventBehavior:["type",Qa],boundaryEventBehavior:["type",Pp],createBehavior:["type",kp],createDataObjectBehavior:["type",Tp],createParticipantBehavior:["type",Dp],dataInputAssociationBehavior:["type",Bp],dataStoreBehavior:["type",Np],deleteLaneBehavior:["type",Op],detachEventBehavior:["type",es],dropOnFlowBehavior:["type",jp],eventBasedGatewayBehavior:["type",Lp],fixHoverBehavior:["type",Cm],groupBehavior:["type",Ip],importDockingFix:["type",Pm],isHorizontalFix:["type",zp],labelBehavior:["type",Fp],layoutConnectionBehavior:["type",Hp],messageFlowBehavior:["type",Wp],modelingFeedback:["type",Gm],removeElementBehavior:["type",qp],removeEmbeddedLabelBoundsBehavior:["type",Up],removeParticipantBehavior:["type",Kp],replaceConnectionBehavior:["type",Yp],replaceElementBehaviour:["type",ss],resizeBehavior:["type",Um],resizeLaneBehavior:["type",Ym],rootElementReferenceBehavior:["type",Xp],spaceToolBehavior:["type",Xm],subProcessPlaneBehavior:["type",hi],subProcessStartEventBehavior:["type",Zp],toggleCollapseConnectionBehaviour:["type",Qp],toggleElementCollapseBehaviour:["type",tl],unclaimIdBehavior:["type",el],unsetDefaultFlowBehavior:["type",nl],updateFlowNodeRefsBehavior:["type",il]};function tv(t,e){var n=le(t,e,-15);return n!=="intersect"?n:null}function ue(t){qe.call(this,t)}q(ue,qe),ue.$inject=["eventBus"],ue.prototype.init=function(){this.addRule("connection.start",function(t){var e=t.source;return RC(e)}),this.addRule("connection.create",function(t){var e=t.source,n=t.target,i=t.hints||{},r=i.targetParent,o=i.targetAttach;if(o)return!1;r&&(n.parent=r);try{return us(e,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(t){var e=t.connection,n=t.source,i=t.target;return us(n,i,e)}),this.addRule("connection.updateWaypoints",function(t){return{type:t.connection.type}}),this.addRule("shape.resize",function(t){var e=t.shape,n=t.newBounds;return pv(e,n)}),this.addRule("elements.create",function(t){var e=t.elements,n=t.position,i=t.target;return Dt(i)&&!hs(e,i)?!1:No(e,function(r){return Dt(r)?us(r.source,r.target,r):r.host?uo(r,r.host,null,n):pl(r,i,null)})}),this.addRule("elements.move",function(t){var e=t.target,n=t.shapes,i=t.position;return uo(n,e,null,i)||sv(n,e,i)||cv(n,e)||hs(n,e)}),this.addRule("shape.create",function(t){return pl(t.shape,t.target,t.source,t.position)}),this.addRule("shape.attach",function(t){return uo(t.shape,t.target,null,t.position)}),this.addRule("element.copy",function(t){var e=t.element,n=t.elements;return dv(n,e)})},ue.prototype.canConnectMessageFlow=uv,ue.prototype.canConnectSequenceFlow=hv,ue.prototype.canConnectDataAssociation=ll,ue.prototype.canConnectAssociation=lv,ue.prototype.canMove=cv,ue.prototype.canAttach=uo,ue.prototype.canReplace=sv,ue.prototype.canDrop=yr,ue.prototype.canInsert=hs,ue.prototype.canCreate=pl,ue.prototype.canConnect=us,ue.prototype.canResize=pv,ue.prototype.canCopy=dv;function RC(t){return rl(t)?null:dt(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function rl(t){return!t||xt(t)}function PC(t,e){return t===e}function ev(t){do{if(y(t,"bpmn:Process"))return W(t);if(y(t,"bpmn:Participant"))return W(t).processRef||W(t)}while(t=t.parent)}function ol(t){return y(t,"bpmn:TextAnnotation")}function al(t){return y(t,"bpmn:Group")&&!t.labelTarget}function sl(t){return y(t,"bpmn:BoundaryEvent")&&En(t,"bpmn:CompensateEventDefinition")}function vr(t){return W(t).isForCompensation}function kC(t,e){var n=ev(t),i=ev(e);return n===i}function TC(t){return y(t,"bpmn:InteractionNode")&&!y(t,"bpmn:BoundaryEvent")&&(!y(t,"bpmn:Event")||y(t,"bpmn:ThrowEvent")&&iv(t,"bpmn:MessageEventDefinition"))}function AC(t){return y(t,"bpmn:InteractionNode")&&!vr(t)&&(!y(t,"bpmn:Event")||y(t,"bpmn:CatchEvent")&&iv(t,"bpmn:MessageEventDefinition"))&&!(y(t,"bpmn:BoundaryEvent")&&!En(t,"bpmn:MessageEventDefinition"))}function nv(t){for(var e=t;e=e.parent;){if(y(e,"bpmn:FlowElementsContainer"))return W(e);if(y(e,"bpmn:Participant"))return W(e).processRef}return null}function MC(t,e){var n=nv(t),i=nv(e);return n===i}function En(t,e){var n=W(t);return!!yt(n.eventDefinitions||[],function(i){return y(i,e)})}function iv(t,e){var n=W(t);return(n.eventDefinitions||[]).every(function(i){return y(i,e)})}function DC(t){return y(t,"bpmn:FlowNode")&&!y(t,"bpmn:EndEvent")&&!Oe(t)&&!(y(t,"bpmn:IntermediateThrowEvent")&&En(t,"bpmn:LinkEventDefinition"))&&!sl(t)&&!vr(t)}function BC(t){return y(t,"bpmn:FlowNode")&&!y(t,"bpmn:StartEvent")&&!y(t,"bpmn:BoundaryEvent")&&!Oe(t)&&!(y(t,"bpmn:IntermediateCatchEvent")&&En(t,"bpmn:LinkEventDefinition"))&&!vr(t)}function NC(t){return y(t,"bpmn:ReceiveTask")||y(t,"bpmn:IntermediateCatchEvent")&&(En(t,"bpmn:MessageEventDefinition")||En(t,"bpmn:TimerEventDefinition")||En(t,"bpmn:ConditionalEventDefinition")||En(t,"bpmn:SignalEventDefinition"))}function OC(t){for(var e=[];t;)t=t.parent,t&&e.push(t);return e}function cl(t,e){var n=OC(e);return n.indexOf(t)!==-1}function us(t,e,n){if(rl(t)||rl(e))return null;if(!y(n,"bpmn:DataAssociation")){if(uv(t,e))return{type:"bpmn:MessageFlow"};if(hv(t,e))return{type:"bpmn:SequenceFlow"}}var i=ll(t,e);return i||(sl(t)&&vr(e)?{type:"bpmn:Association",associationDirection:"One"}:lv(t,e)?{type:"bpmn:Association"}:!1)}function yr(t,e){return xt(t)||al(t)?!0:y(e,"bpmn:Participant")&&!vt(e)?!1:y(t,"bpmn:Participant")?y(e,"bpmn:Process")||y(e,"bpmn:Collaboration"):dt(t,["bpmn:DataInput","bpmn:DataOutput"])&&t.parent?e===t.parent:y(t,"bpmn:Lane")?y(e,"bpmn:Participant")||y(e,"bpmn:Lane"):y(t,"bpmn:BoundaryEvent")&&!jC(t)?!1:y(t,"bpmn:FlowElement")&&!y(t,"bpmn:DataStoreReference")?y(e,"bpmn:FlowElementsContainer")?vt(e):dt(e,["bpmn:Participant","bpmn:Lane"]):y(t,"bpmn:DataStoreReference")&&y(e,"bpmn:Collaboration")?kn(W(e).get("participants"),function(n){return!!n.get("processRef")}):dt(t,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?dt(e,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):y(t,"bpmn:MessageFlow")?y(e,"bpmn:Collaboration")||t.source.parent==e||t.target.parent==e:!1}function jC(t){return W(t).cancelActivity&&(rv(t)||ov(t))}function LC(t){return!xt(t)&&y(t,"bpmn:BoundaryEvent")}function IC(t){return y(t,"bpmn:Lane")}function $C(t){return LC(t)||y(t,"bpmn:IntermediateThrowEvent")&&rv(t)?!0:y(t,"bpmn:IntermediateCatchEvent")&&ov(t)}function rv(t){var e=W(t);return e&&!(e.eventDefinitions&&e.eventDefinitions.length)}function ov(t){return av(t,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function av(t,e){return e.some(function(n){return En(t,n)})}function zC(t){return y(t,"bpmn:ReceiveTask")&&yt(t.incoming,function(e){return y(e.source,"bpmn:EventBasedGateway")})}function uo(t,e,n,i){if(Array.isArray(t)||(t=[t]),t.length!==1)return!1;var r=t[0];return xt(r)||!$C(r)||Oe(e)||!y(e,"bpmn:Activity")||vr(e)||i&&!tv(i,e)||zC(e)?!1:"attach"}function sv(t,e,n){if(!e)return!1;var i={replacements:[]};return k(t,function(r){Oe(e)||y(r,"bpmn:StartEvent")&&r.type!=="label"&&yr(r,e)&&(wx(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(Sx(r)||Cx(r)||Rx(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),av(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&y(e,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),y(e,"bpmn:Transaction")||En(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(y(r,"bpmn:EndEvent")&&yr(r,e)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),y(r,"bpmn:BoundaryEvent")&&uo(r,e,null,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),i.replacements.length?i:!1}function cv(t,e){return kn(t,IC)?!1:e?t.every(function(n){return yr(n,e)}):!0}function pl(t,e,n,i){return e?xt(t)||al(t)?!0:PC(n,e)||n&&cl(n,e)?!1:yr(t,e)||hs(t,e):!1}function pv(t,e){return y(t,"bpmn:SubProcess")?vt(t)&&(!e||e.width>=100&&e.height>=80):y(t,"bpmn:Lane")?!e||e.width>=130&&e.height>=60:y(t,"bpmn:Participant")?!e||e.width>=250&&e.height>=50:!!(ol(t)||al(t))}function FC(t,e){var n=ol(t),i=ol(e);return(n||i)&&n!==i}function lv(t,e){return sl(t)&&vr(e)?!0:cl(e,t)||cl(t,e)?!1:FC(t,e)?!0:!!ll(t,e)}function uv(t,e){return fv(t)&&!fv(e)?!1:TC(t)&&AC(e)&&!kC(t,e)}function hv(t,e){return DC(t)&&BC(e)&&MC(t,e)&&!(y(t,"bpmn:EventBasedGateway")&&!NC(e))}function ll(t,e){return dt(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&dt(e,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:dt(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&dt(t,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function hs(t,e,n){if(!e)return!1;if(Array.isArray(t)){if(t.length!==1)return!1;t=t[0]}return e.source===t||e.target===t?!1:dt(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!xt(e)&&y(t,"bpmn:FlowNode")&&!y(t,"bpmn:BoundaryEvent")&&yr(t,e.parent)}function HC(t,e){return t&&e&&t.indexOf(e)!==-1}function dv(t,e){return xt(e)?!0:!(y(e,"bpmn:Lane")&&!HC(t,e.parent))}function fv(t){return ka(t,"bpmn:Process")||ka(t,"bpmn:Collaboration")}const GC={__depends__:[_n],__init__:["bpmnRules"],bpmnRules:["type",ue]};var VC=2e3;function mv(t,e){t.on("saveXML.start",VC,n);function n(){var i=e.getRootElements();k(i,function(r){var o=gt(r),a,s;a=Rr([r],!1),a=ct(a,function(c){return c!==r&&!c.labelTarget}),s=be(a,gt),o.set("planeElement",s)})}}mv.$inject=["eventBus","canvas"];const WC={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",mv]};function ds(t){V.call(this,t);var e=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=e.getOrdering(r,o);a&&(a.parent!==void 0&&(i.parent=a.parent),i.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var i=n.context,r=i.shape||i.connection,o=i.newParent||r.parent,a=e.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}ds.prototype.getOrdering=function(t,e){return null},q(ds,V);function ul(t,e,n){ds.call(this,t);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: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(s){if(s.labelTarget)return{level:10};var c=yt(i,function(p){return dt(s,[p.type])});return c&&c.order||{level:1}}function o(s){var c=s.order;if(c||(s.order=c=r(s)),!c)throw new Error("no order for <"+s.id+">");return c}function a(s,c,p){for(var l=c;l&&!dt(l,p);)l=l.parent;if(!l)throw new Error("no parent for <"+s.id+"> in <"+(c&&c.id)+">");return l}this.getOrdering=function(s,c){if(s.labelTarget)return{parent:e.findRoot(c)||e.getRootElement(),index:-1};var p=o(s);p.containers&&(c=a(s,c,p.containers));var l=c.children.indexOf(s),u=ng(c.children,function(h){return!s.labelTarget&&h.labelTarget?!1:p.level<o(h).level});return u!==-1&&l!==-1&&l<u&&(u-=1),{index:u,parent:c}}}ul.$inject=["eventBus","canvas","translate"],q(ul,ds);const UC={__depends__:[ua],__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",ul]};var qC=250;function zi(t,e){this._eventBus=t,this._dragging=e,this._tools=[],this._active=null}zi.$inject=["eventBus","dragging"],zi.prototype.registerTool=function(t,e){var n=this._tools;if(!e)throw new Error(`A tool has to be registered with it's "events"`);n.push(t),this.bindEvents(t,e)},zi.prototype.isActive=function(t){return t&&this._active===t},zi.prototype.length=function(t){return this._tools.length},zi.prototype.setActive=function(t){var e=this._eventBus;this._active!==t&&(this._active=t,e.fire("tool-manager.update",{tool:t}))},zi.prototype.bindEvents=function(t,e){var n=this._eventBus,i=this._dragging,r=[];n.on(e.tool+".init",function(o){var a=o.context;if(!a.reactivate&&this.isActive(t)){this.setActive(null),i.cancel();return}this.setActive(t)},this),k(e,function(o){r.push(o+".ended"),r.push(o+".canceled")}),n.on(r,qC,function(o){this._active&&(KC(o)||this.setActive(null))},this)};function KC(t){var e=t.originalEvent&&t.originalEvent.target;return e&&Mn(e,'.group[data-group="tools"]')}const fs={__depends__:[$n],__init__:["toolManager"],toolManager:["type",zi]};function YC(t,e){if(t==="x"){if(e>0)return"e";if(e<0)return"w"}if(t==="y"){if(e>0)return"s";if(e<0)return"n"}return null}function XC(t,e){var n=[];return k(t.concat(e),function(i){var r=i.incoming,o=i.outgoing;k(r.concat(o),function(a){var s=a.source,c=a.target;(ho(t,s)||ho(t,c)||ho(e,s)||ho(e,c))&&(ho(n,a)||n.push(a))})}),n}function ho(t,e){return t.indexOf(e)!==-1}function ZC(t,e,n){var i=t.x,r=t.y,o=t.width,a=t.height,s=n.x,c=n.y;switch(e){case"n":return{x:i,y:r+c,width:o,height:a-c};case"s":return{x:i,y:r,width:o,height:a+c};case"w":return{x:i+s,y:r,width:o-s,height:a};case"e":return{x:i,y:r,width:o+s,height:a};default:throw new Error("unknown direction: "+e)}}var hl=Math.abs,QC=Math.round,Hn={x:"width",y:"height"},vv="crosshair",di={n:"top",w:"left",s:"bottom",e:"right"},JC=1500,ms={n:"s",w:"e",s:"n",e:"w"},vs=20;function Qe(t,e,n,i,r,o,a){this._canvas=t,this._dragging=e,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(c){n.once("spaceTool.selection.ended",function(){s.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",JC,function(c){var p=c.context,l=p.initialized;l||(l=p.initialized=s.init(c,p)),l&&gv(c)}),n.on("spaceTool.end",function(c){var p=c.context,l=p.axis,u=p.direction,h=p.movingShapes,d=p.resizingShapes,f=p.start;if(p.initialized){gv(c);var v={x:0,y:0};v[l]=QC(c["d"+l]),s.makeSpace(h,d,v,u,f),n.once("spaceTool.ended",function(g){s.activateSelection(g.originalEvent,!0,!0)})}})}Qe.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Qe.prototype.activateSelection=function(t,e,n){this._dragging.init(t,"spaceTool.selection",{autoActivate:e,cursor:vv,data:{context:{reactivate:n}},trapClick:!1})},Qe.prototype.activateMakeSpace=function(t){this._dragging.init(t,"spaceTool",{autoActivate:!0,cursor:vv,data:{context:{}}})},Qe.prototype.makeSpace=function(t,e,n,i,r){return this._modeling.createSpace(t,e,n,i,r)},Qe.prototype.init=function(t,e){var n=hl(t.dx)>hl(t.dy)?"x":"y",i=t["d"+n],r=t[n]-i;if(hl(i)<5)return!1;i<0&&(i*=-1),ir(t)&&(i*=-1);var o=YC(n,i),a=this._canvas.getRootElement();!Bc(t)&&t.hover&&(a=t.hover);var s=[...Rr(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,i,r),p=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}),l=tR(c,n,o,r,p);return N(e,c,{axis:n,direction:o,spaceToolConstraints:l,start:r}),ba("resize-"+(n==="x"?"ew":"ns")),!0},Qe.prototype.calculateAdjustments=function(t,e,n,i){var r=this._rules,o=[],a=[],s=[],c=[];function p(h){o.includes(h)||o.push(h);var d=h.label;d&&!o.includes(d)&&o.push(d)}function l(h){a.includes(h)||a.push(h)}k(t,function(h){if(!(!h.parent||xt(h))){if(Dt(h)){c.push(h);return}var d=h[e],f=d+h[Hn[e]];if(eR(h)&&(n>0&&nt(h)[e]>i||n<0&&nt(h)[e]<i)){s.push(h);return}if(n>0&&d>i||n<0&&f<i){p(h);return}if(d<i&&f>i&&r.allowed("shape.resize",{shape:h})){l(h);return}}}),k(o,function(h){var d=h.attachers;d&&k(d,function(f){p(f)})});var u=o.concat(a);return k(s,function(h){var d=h.host;Fi(u,d)&&p(h)}),u=o.concat(a),k(c,function(h){var d=h.source,f=h.target,v=h.label;Fi(u,d)&&Fi(u,f)&&v&&p(v)}),{movingShapes:o,resizingShapes:a}},Qe.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();this.activateSelection(t,!!t)},Qe.prototype.isActive=function(){var t=this._dragging.context();return t?/^spaceTool/.test(t.prefix):!1};function yv(t){return{top:t.top-vs,right:t.right+vs,bottom:t.bottom+vs,left:t.left-vs}}function gv(t){var e=t.context,n=e.spaceToolConstraints;if(n){var i,r;it(n.left)&&(i=Math.max(t.x,n.left),t.dx=t.dx+i-t.x,t.x=i),it(n.right)&&(i=Math.min(t.x,n.right),t.dx=t.dx+i-t.x,t.x=i),it(n.top)&&(r=Math.max(t.y,n.top),t.dy=t.dy+r-t.y,t.y=r),it(n.bottom)&&(r=Math.min(t.y,n.bottom),t.dy=t.dy+r-t.y,t.y=r)}}function tR(t,e,n,i,r){var o=t.movingShapes,a=t.resizingShapes;if(a.length){var s={},c,p;return k(a,function(l){var u=l.attachers,h=l.children,d=X(l),f=ct(h,function($){return!Dt($)&&!xt($)&&!Fi(o,$)&&!Fi(a,$)}),v=ct(h,function($){return!Dt($)&&!xt($)&&Fi(o,$)}),g,R,E,_=[],x=[],S,M,j,B;f.length&&(R=yv(X(Vt(f))),g=i-d[di[n]]+R[di[n]],n==="n"?s.bottom=p=it(p)?Math.min(p,g):g:n==="w"?s.right=p=it(p)?Math.min(p,g):g:n==="s"?s.top=c=it(c)?Math.max(c,g):g:n==="e"&&(s.left=c=it(c)?Math.max(c,g):g)),v.length&&(E=yv(X(Vt(v))),g=i-E[di[ms[n]]]+d[di[ms[n]]],n==="n"?s.bottom=p=it(p)?Math.min(p,g):g:n==="w"?s.right=p=it(p)?Math.min(p,g):g:n==="s"?s.top=c=it(c)?Math.max(c,g):g:n==="e"&&(s.left=c=it(c)?Math.max(c,g):g)),u&&u.length&&(u.forEach(function($){Fi(o,$)?_.push($):x.push($)}),_.length&&(S=X(Vt(_.map(nt))),M=d[di[ms[n]]]-(S[di[ms[n]]]-i)),x.length&&(j=X(Vt(x.map(nt))),B=j[di[n]]-(d[di[n]]-i)),n==="n"?(g=Math.min(M||1/0,B||1/0),s.bottom=p=it(p)?Math.min(p,g):g):n==="w"?(g=Math.min(M||1/0,B||1/0),s.right=p=it(p)?Math.min(p,g):g):n==="s"?(g=Math.max(M||-1/0,B||-1/0),s.top=c=it(c)?Math.max(c,g):g):n==="e"&&(g=Math.max(M||-1/0,B||-1/0),s.left=c=it(c)?Math.max(c,g):g));var D=r&&r[l.id];D&&(n==="n"?(g=i+l[Hn[e]]-D[Hn[e]],s.bottom=p=it(p)?Math.min(p,g):g):n==="w"?(g=i+l[Hn[e]]-D[Hn[e]],s.right=p=it(p)?Math.min(p,g):g):n==="s"?(g=i-l[Hn[e]]+D[Hn[e]],s.top=c=it(c)?Math.max(c,g):g):n==="e"&&(g=i-l[Hn[e]]+D[Hn[e]],s.left=c=it(c)?Math.max(c,g):g))}),s}}function Fi(t,e){return t.indexOf(e)!==-1}function eR(t){return!!t.host}var dl="djs-dragging",bv="djs-resizing",nR=250,ys=Math.max;function xv(t,e,n,i,r){function o(a,s){k(a,function(c){r.addDragger(c,s),n.addMarker(c,dl)})}t.on("spaceTool.selection.start",function(a){var s=n.getLayer("space"),c=a.context,p={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},l=Z("g");Y(l,i.cls("djs-crosshair-group",["no-events"])),tt(s,l);var u=Z("path");Y(u,"d",p.x),ht(u).add("djs-crosshair"),tt(l,u);var h=Z("path");Y(h,"d",p.y),ht(h).add("djs-crosshair"),tt(l,h),c.crosshairGroup=l}),t.on("spaceTool.selection.move",function(a){var s=a.context.crosshairGroup;ke(s,a.x,a.y)}),t.on("spaceTool.selection.cleanup",function(a){var s=a.context,c=s.crosshairGroup;c&&Gt(c)}),t.on("spaceTool.move",nR,function(a){var s=a.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=Z("path"),Y(c,"d","M0,0 L0,0"),ht(c).add("djs-crosshair"),tt(h,c),s.line=c;var d=Z("g");Y(d,i.cls("djs-drag-group",["no-events"])),tt(n.getActiveLayer(),d),o(l,d);var f=s.movingConnections=e.filter(function(x){var S=!1;k(l,function(D){k(D.outgoing,function($){x===$&&(S=!0)})});var M=!1;k(l,function(D){k(D.incoming,function($){x===$&&(M=!0)})});var j=!1;k(u,function(D){k(D.outgoing,function($){x===$&&(j=!0)})});var B=!1;return k(u,function(D){k(D.incoming,function($){x===$&&(B=!0)})}),Dt(x)&&(S||j)&&(M||B)});o(f,d),s.dragGroup=d}if(!s.frameGroup){var v=Z("g");Y(v,i.cls("djs-frame-group",["no-events"])),tt(n.getActiveLayer(),v);var g=[];k(u,function(x){var S=r.addFrame(x,v),M=S.getBBox();g.push({element:S,initialBounds:M}),n.addMarker(x,bv)}),s.frameGroup=v,s.frames=g}var R={x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y};Y(c,{d:R[p]});var E={x:"y",y:"x"},_={x:a.dx,y:a.dy};_[E[s.axis]]=0,ke(s.dragGroup,_.x,_.y),k(s.frames,function(x){var S=x.element,M=x.initialBounds,j,B;s.direction==="e"?Y(S,{width:ys(M.width+_.x,5)}):(j=ys(M.width-_.x,5),Y(S,{width:j,x:M.x+M.width-j})),s.direction==="s"?Y(S,{height:ys(M.height+_.y,5)}):(B=ys(M.height-_.y,5),Y(S,{height:B,y:M.y+M.height-B}))})}}),t.on("spaceTool.cleanup",function(a){var s=a.context,c=s.movingShapes,p=s.movingConnections,l=s.resizingShapes,u=s.line,h=s.dragGroup,d=s.frameGroup;k(c,function(f){n.removeMarker(f,dl)}),k(p,function(f){n.removeMarker(f,dl)}),h&&(Gt(u),Gt(h)),k(l,function(f){n.removeMarker(f,bv)}),d&&Gt(d)})}xv.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const iR={__init__:["spaceToolPreview"],__depends__:[$n,_n,fs,Zr,Jr],spaceTool:["type",Qe],spaceToolPreview:["type",xv]};function gs(t){t.invoke(Qe,this)}gs.$inject=["injector"],q(gs,Qe),gs.prototype.calculateAdjustments=function(t,e,n,i){var r=Qe.prototype.calculateAdjustments.call(this,t,e,n,i);return r.resizingShapes=r.resizingShapes.filter(function(o){return!(y(o,"bpmn:TextAnnotation")||e==="y"&&rR(o))}),r};function rR(t){return y(t,"bpmn:Participant")&&!W(t).processRef}const _v={__depends__:[iR],spaceTool:["type",gs]};function Ot(t,e){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=e,this._eventBus=t,this._uid=1,t.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Ot.$inject=["eventBus","injector"],Ot.prototype.execute=function(t,e){if(!t)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:t,context:e};this._pushAction(n),this._internalExecute(n),this._popAction()},Ot.prototype.canExecute=function(t,e){const n={command:t,context:e},i=this._getHandler(t);let r=this._fire(t,"canExecute",n);if(r===void 0){if(!i)return!1;i.canExecute&&(r=i.canExecute(e))}return r},Ot.prototype.clear=function(t){this._stack.length=0,this._stackIdx=-1,t!==!1&&this._fire("changed",{trigger:"clear"})},Ot.prototype.undo=function(){let t=this._getUndoAction(),e;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()}},Ot.prototype.redo=function(){let t=this._getRedoAction(),e;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()}},Ot.prototype.register=function(t,e){this._setHandler(t,e)},Ot.prototype.registerHandler=function(t,e){if(!t||!e)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(e);this.register(t,n)},Ot.prototype.canUndo=function(){return!!this._getUndoAction()},Ot.prototype.canRedo=function(){return!!this._getRedoAction()},Ot.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Ot.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Ot.prototype._internalUndo=function(t){const e=t.command,n=t.context,i=this._getHandler(e);this._atomicDo(()=>{this._fire(e,"revert",t),i.revert&&this._markDirty(i.revert(n)),this._revertedAction(t),this._fire(e,"reverted",t)})},Ot.prototype._fire=function(t,e,n){arguments.length<3&&(n=e,e=null);const i=e?[t+"."+e,e]:[t];let r;n=this._eventBus.createEvent(n);for(const o of i)if(r=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return r},Ot.prototype._createId=function(){return this._uid++},Ot.prototype._atomicDo=function(t){const e=this._currentExecution;e.atomic=!0;try{t()}finally{e.atomic=!1}},Ot.prototype._internalExecute=function(t,e){const n=t.command,i=t.context,r=this._getHandler(n);if(!r)throw new Error("no command handler registered for <"+n+">");this._pushAction(t),e||(this._fire(n,"preExecute",t),r.preExecute&&r.preExecute(i),this._fire(n,"preExecuted",t)),this._atomicDo(()=>{this._fire(n,"execute",t),r.execute&&this._markDirty(r.execute(i)),this._executedAction(t,e),this._fire(n,"executed",t)}),e||(this._fire(n,"postExecute",t),r.postExecute&&r.postExecute(i),this._fire(n,"postExecuted",t)),this._popAction()},Ot.prototype._pushAction=function(t){const e=this._currentExecution,n=e.actions,i=n[0];if(e.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+t.command+")");t.id||(t.id=i&&i.id||this._createId()),n.push(t)},Ot.prototype._popAction=function(){const t=this._currentExecution,e=t.trigger,n=t.actions,i=t.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:J2("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:e}),t.trigger=null)},Ot.prototype._markDirty=function(t){const e=this._currentExecution;t&&(t=lt(t)?t:[t],e.dirty=e.dirty.concat(t))},Ot.prototype._executedAction=function(t,e){const n=++this._stackIdx;e||this._stack.splice(n,this._stack.length,t)},Ot.prototype._revertedAction=function(t){this._stackIdx--},Ot.prototype._getHandler=function(t){return this._handlerMap[t]},Ot.prototype._setHandler=function(t,e){if(!t||!e)throw new Error("command and handler required");if(this._handlerMap[t])throw new Error("overriding handler for command <"+t+">");this._handlerMap[t]=e};const oR={commandStack:["type",Ot]};var aR=new Oc("tt");function sR(t){var e=Mt('<div class="djs-tooltip-container" />');return se(e,{position:"absolute",width:"0",height:"0"}),t.insertBefore(e,t.firstChild),e}function cR(t,e,n){se(t,{left:e+"px",top:n+"px"})}function fl(t,e){t.style.display=e===!1?"none":""}var Ev="djs-tooltip",ml="."+Ev;function Ee(t,e){this._eventBus=t,this._canvas=e,this._ids=aR,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=sR(e.getContainer());var n=this;Re.bind(this._tooltipRoot,ml,"mousedown",function(i){i.stopPropagation()}),Re.bind(this._tooltipRoot,ml,"mouseover",function(i){n.trigger("mouseover",i)}),Re.bind(this._tooltipRoot,ml,"mouseout",function(i){n.trigger("mouseout",i)}),this._init()}Ee.$inject=["eventBus","canvas"],Ee.prototype.add=function(t){if(!t.position)throw new Error("must specifiy tooltip position");if(!t.html)throw new Error("must specifiy tooltip html");var e=this._ids.next();return t=N({},this._tooltipDefaults,t,{id:e}),this._addTooltip(t),t.timeout&&this.setTimeout(t),e},Ee.prototype.trigger=function(t,e){var n=e.delegateTarget||e.target,i=this.get(fe(n,"data-tooltip-id"));i&&(t==="mouseover"&&i.timeout&&this.clearTimeout(i),t==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},Ee.prototype.get=function(t){return typeof t!="string"&&(t=t.id),this._tooltips[t]},Ee.prototype.clearTimeout=function(t){if(t=this.get(t),!!t){var e=t.removeTimer;e&&(clearTimeout(e),t.removeTimer=null)}},Ee.prototype.setTimeout=function(t){if(t=this.get(t),!!t){this.clearTimeout(t);var e=this;t.removeTimer=setTimeout(function(){e.remove(t)},t.timeout)}},Ee.prototype.remove=function(t){var e=this.get(t);e&&(dn(e.html),dn(e.htmlContainer),delete e.htmlContainer,delete this._tooltips[e.id])},Ee.prototype.show=function(){fl(this._tooltipRoot)},Ee.prototype.hide=function(){fl(this._tooltipRoot,!1)},Ee.prototype._updateRoot=function(t){var e=t.scale||1,n=t.scale||1,i="matrix("+e+",0,0,"+n+","+-1*t.x*e+","+-1*t.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},Ee.prototype._addTooltip=function(t){var e=t.id,n=t.html,i,r=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),Me(n)&&(n=Mt(n)),i=Mt('<div data-tooltip-id="'+e+'" class="'+Ev+'">'),se(i,{position:"absolute"}),i.appendChild(n),t.type&&te(i).add("djs-tooltip-"+t.type),t.className&&te(i).add(t.className),t.htmlContainer=i,r.appendChild(i),this._tooltips[e]=t,this._updateTooltip(t)},Ee.prototype._updateTooltip=function(t){var e=t.position,n=t.htmlContainer;cR(n,e.x,e.y)},Ee.prototype._updateTooltipVisibilty=function(t){k(this._tooltips,function(e){var n=e.show,i=e.htmlContainer,r=!0;n&&((n.minZoom>t.scale||n.maxZoom<t.scale)&&(r=!1),fl(i,r))})},Ee.prototype._init=function(){var t=this;function e(n){t._updateRoot(n),t._updateTooltipVisibilty(n),t.show()}this._eventBus.on("canvas.viewbox.changing",function(n){t.hide()}),this._eventBus.on("canvas.viewbox.changed",function(n){e(n.viewbox)})};const pR={__init__:["tooltips"],tooltips:["type",Ee]};function fi(t,e){if(typeof e!="function")throw new Error("removeFn iterator must be a function");if(t){for(var n;n=t[0];)e(n);return t}}var lR=250,wv=1400;function vl(t,e,n){V.call(this,e);var i=t.get("movePreview",!1);e.on("shape.move.start",wv,function(r){var o=r.context,a=o.shapes,s=o.validatedShapes;o.shapes=Sv(a),o.validatedShapes=Sv(s)}),i&&e.on("shape.move.start",lR,function(r){var o=r.context,a=o.shapes,s=[];k(a,function(c){k(c.labels,function(p){!p.hidden&&o.shapes.indexOf(p)===-1&&s.push(p),c.labelTarget&&s.push(c)})}),k(s,function(c){i.makeDraggable(o,c,!0)})}),this.preExecuted("elements.move",wv,function(r){var o=r.context,a=o.closure,s=a.enclosedElements,c=[];k(s,function(p){k(p.labels,function(l){s[l.id]||c.push(l)})}),a.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(r){var o=r.context,a=o.connection||o.shape;fi(a.labels,function(s){n.removeShape(s,{nested:!0})})}),this.execute("shape.delete",function(r){var o=r.context,a=o.shape,s=a.labelTarget;s&&(o.labelTargetIndex=lc(s.labels,a),o.labelTarget=s,a.labelTarget=null)}),this.revert("shape.delete",function(r){var o=r.context,a=o.shape,s=o.labelTarget,c=o.labelTargetIndex;s&&(Zt(s.labels,a,c),a.labelTarget=s)})}q(vl,V),vl.$inject=["injector","eventBus","modeling"];function Sv(t){return ct(t,function(e){return t.indexOf(e.labelTarget)===-1})}const uR={__init__:["labelSupport"],labelSupport:["type",vl]};var hR=251,Cv=1401,Rv="attach-ok";function yl(t,e,n,i,r){V.call(this,e);var o=t.get("movePreview",!1);e.on("shape.move.start",Cv,function(a){var s=a.context,c=s.shapes,p=s.validatedShapes;s.shapes=dR(c),s.validatedShapes=fR(p)}),o&&e.on("shape.move.start",hR,function(a){var s=a.context,c=s.shapes,p=gl(c);k(p,function(l){o.makeDraggable(s,l,!0),k(l.labels,function(u){o.makeDraggable(s,u,!0)})})}),o&&e.on("shape.move.start",function(a){var s=a.context,c=s.shapes;if(c.length===1){var p=c[0],l=p.host;l&&(n.addMarker(l,Rv),e.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(l,Rv)}))}}),this.preExecuted("elements.move",Cv,function(a){var s=a.context,c=s.closure,p=s.shapes,l=gl(p);k(l,function(u){c.add(u,c.topLevel[u.host.id])})}),this.postExecuted("elements.move",function(a){var s=a.context,c=s.shapes,p=s.newHost,l;p&&c.length!==1||(p?l=c:l=ct(c,function(u){var h=u.host;return mR(u)&&!vR(c,h)}),k(l,function(u){r.updateAttachment(u,p)}))}),this.postExecuted("elements.move",function(a){var s=a.context.shapes;k(s,function(c){k(c.attachers,function(p){k(p.outgoing.slice(),function(l){var u=i.allowed("connection.reconnect",{connection:l,source:l.source,target:l.target});u||r.removeConnection(l)}),k(p.incoming.slice(),function(l){var u=i.allowed("connection.reconnect",{connection:l,source:l.source,target:l.target});u||r.removeConnection(l)})})})}),this.postExecute("shape.create",function(a){var s=a.context,c=s.shape,p=s.host;p&&r.updateAttachment(c,p)}),this.postExecute("shape.replace",function(a){var s=a.context,c=s.oldShape,p=s.newShape;fi(c.attachers,function(l){var u=i.allowed("elements.move",{target:p,shapes:[l]});u==="attach"?r.updateAttachment(l,p):r.removeShape(l)}),p.attachers.length&&k(p.attachers,function(l){var u=Im(l,c,p);r.moveShape(l,u,l.parent)})}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,p=s.oldBounds,l=s.newBounds,u=c.attachers,h=s.hints||{};h.attachSupport!==!1&&k(u,function(d){var f=Im(d,p,l);r.moveShape(d,f,d.parent),k(d.labels,function(v){r.moveShape(v,f,v.parent)})})}),this.preExecute("shape.delete",function(a){var s=a.context.shape;fi(s.attachers,function(c){r.removeShape(c)}),s.host&&r.updateAttachment(s,null)})}q(yl,V),yl.$inject=["injector","eventBus","canvas","rules","modeling"];function gl(t){return Ys(be(t,function(e){return e.attachers||[]}))}function dR(t){var e=gl(t);return tk("id",t,e)}function fR(t){var e=Bo(t,"id");return ct(t,function(n){for(;n;){if(n.host&&e[n.host.id])return!1;n=n.parent}return!0})}function mR(t){return!!t.host}function vR(t,e){return t.indexOf(e)!==-1}const yR={__depends__:[_n],__init__:["attachSupport"],attachSupport:["type",yl]};function Je(t){this._model=t}Je.$inject=["moddle"],Je.prototype._needsId=function(t){return dt(t,["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"])},Je.prototype._ensureId=function(t){if(t.id){this._model.ids.claim(t.id,t);return}var e;y(t,"bpmn:Activity")?e="Activity":y(t,"bpmn:Event")?e="Event":y(t,"bpmn:Gateway")?e="Gateway":dt(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])?e="Flow":e=(t.$type||"").replace(/^[^:]*:/g,""),e+="_",!t.id&&this._needsId(t)&&(t.id=this._model.ids.nextPrefixed(e,t))},Je.prototype.create=function(t,e){var n=this._model.create(t,e||{});return this._ensureId(n),n},Je.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Je.prototype.createDiShape=function(t,e){return this.create("bpmndi:BPMNShape",N({bpmnElement:t,bounds:this.createDiBounds()},e))},Je.prototype.createDiBounds=function(t){return this.create("dc:Bounds",t)},Je.prototype.createDiWaypoints=function(t){var e=this;return be(t,function(n){return e.createDiWaypoint(n)})},Je.prototype.createDiWaypoint=function(t){return this.create("dc:Point",un(t,["x","y"]))},Je.prototype.createDiEdge=function(t,e){return this.create("bpmndi:BPMNEdge",N({bpmnElement:t,waypoint:this.createDiWaypoints([])},e))},Je.prototype.createDiPlane=function(t,e){return this.create("bpmndi:BPMNPlane",N({bpmnElement:t},e))};function Te(t,e,n,i){V.call(this,t),this._bpmnFactory=e,this._translate=i;var r=this;function o(f){var v=f.context,g=v.hints||{},R;!v.cropped&&g.createElementsBehavior!==!1&&(R=v.connection,R.waypoints=n.getCroppedWaypoints(R),v.cropped=!0)}this.executed(["connection.layout","connection.create"],o),this.reverted(["connection.layout"],function(f){delete f.context.cropped});function a(f){var v=f.context;r.updateParent(v.shape||v.connection,v.oldParent)}function s(f){var v=f.context,g=v.shape||v.connection,R=v.parent||v.newParent;r.updateParent(g,R)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Ae(a)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Ae(s));function c(f){var v=f.context,g=v.oldRoot,R=g.children;k(R,function(E){y(E,"bpmn:BaseElement")&&r.updateParent(E)})}this.executed(["canvas.updateRoot"],c),this.reverted(["canvas.updateRoot"],c);function p(f){var v=f.context.shape;y(v,"bpmn:BaseElement")&&r.updateBounds(v)}this.executed(["shape.move","shape.create","shape.resize"],Ae(function(f){f.context.shape.type!=="label"&&p(f)})),this.reverted(["shape.move","shape.create","shape.resize"],Ae(function(f){f.context.shape.type!=="label"&&p(f)})),t.on("shape.changed",function(f){f.element.type==="label"&&p({context:{shape:f.element}})});function l(f){r.updateConnection(f.context)}this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Ae(l)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Ae(l));function u(f){r.updateConnectionWaypoints(f.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Ae(u)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Ae(u)),this.executed("connection.reconnect",Ae(function(f){var v=f.context,g=v.connection,R=v.oldSource,E=v.newSource,_=W(g),x=W(R),S=W(E);_.conditionExpression&&!dt(S,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(v.oldConditionExpression=_.conditionExpression,delete _.conditionExpression),R!==E&&x.default===_&&(v.oldDefault=x.default,delete x.default)})),this.reverted("connection.reconnect",Ae(function(f){var v=f.context,g=v.connection,R=v.oldSource,E=v.newSource,_=W(g),x=W(R),S=W(E);v.oldConditionExpression&&(_.conditionExpression=v.oldConditionExpression),v.oldDefault&&(x.default=v.oldDefault,delete S.default)}));function h(f){r.updateAttachment(f.context)}this.executed(["element.updateAttachment"],Ae(h)),this.reverted(["element.updateAttachment"],Ae(h)),this.executed("element.updateLabel",Ae(d)),this.reverted("element.updateLabel",Ae(d));function d(f){const{element:v}=f.context,g=Ue(v),R=gt(v),E=R&&R.get("label");ki(v)||(g&&!E?R.set("label",e.create("bpmndi:BPMNLabel")):!g&&E&&R.set("label",void 0))}}q(Te,V),Te.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Te.prototype.updateAttachment=function(t){var e=t.shape,n=e.businessObject,i=e.host;n.attachedToRef=i&&i.businessObject},Te.prototype.updateParent=function(t,e){if(!xt(t)&&!(y(t,"bpmn:DataStoreReference")&&t.parent&&y(t.parent,"bpmn:Collaboration"))){var n=t.parent,i=t.businessObject,r=gt(t),o=n&&n.businessObject,a=gt(n);y(t,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,e&&e.businessObject),y(t,"bpmn:DataOutputAssociation")&&(t.source?o=t.source.businessObject:o=null),y(t,"bpmn:DataInputAssociation")&&(t.target?o=t.target.businessObject:o=null),this.updateSemanticParent(i,o),y(t,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,a)}},Te.prototype.updateBounds=function(t){var e=gt(t),n=bR(t);if(n){var i=en(n,e.get("bounds"));N(n,{x:t.x+i.x,y:t.y+i.y})}var r=xt(t)?this._getLabel(e):e,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),N(o,{x:t.x,y:t.y,width:t.width,height:t.height})},Te.prototype.updateFlowNodeRefs=function(t,e,n){if(n!==e){var i,r;y(n,"bpmn:Lane")&&(i=n.get("flowNodeRef"),Wt(i,t)),y(e,"bpmn:Lane")&&(r=e.get("flowNodeRef"),Zt(r,t))}},Te.prototype.updateDiConnection=function(t,e,n){var i=gt(t),r=gt(e),o=gt(n);i.sourceElement&&i.sourceElement.bpmnElement!==W(e)&&(i.sourceElement=e&&r),i.targetElement&&i.targetElement.bpmnElement!==W(n)&&(i.targetElement=n&&o)},Te.prototype.updateDiParent=function(t,e){if(e&&!y(e,"bpmndi:BPMNPlane")&&(e=e.$parent),t.$parent!==e){var n=(e||t.$parent).get("planeElement");e?(n.push(t),t.$parent=e):(Wt(n,t),t.$parent=null)}};function gR(t){for(;t&&!y(t,"bpmn:Definitions");)t=t.$parent;return t}Te.prototype.getLaneSet=function(t){var e,n;return y(t,"bpmn:Lane")?(e=t.childLaneSet,e||(e=this._bpmnFactory.create("bpmn:LaneSet"),t.childLaneSet=e,e.$parent=t),e):(y(t,"bpmn:Participant")&&(t=t.processRef),n=t.get("laneSets"),e=n[0],e||(e=this._bpmnFactory.create("bpmn:LaneSet"),e.$parent=t,n.push(e)),e)},Te.prototype.updateSemanticParent=function(t,e,n){var i,r=this._translate;if(t.$parent!==e&&!((y(t,"bpmn:DataInput")||y(t,"bpmn:DataOutput"))&&(y(e,"bpmn:Participant")&&"processRef"in e&&(e=e.processRef),"ioSpecification"in e&&e.ioSpecification===t.$parent))){if(y(t,"bpmn:Lane"))e&&(e=this.getLaneSet(e)),i="lanes";else if(y(t,"bpmn:FlowElement")){if(e){if(y(e,"bpmn:Participant"))e=e.processRef;else if(y(e,"bpmn:Lane"))do e=e.$parent.$parent;while(y(e,"bpmn:Lane"))}i="flowElements"}else if(y(t,"bpmn:Artifact")){for(;e&&!y(e,"bpmn:Process")&&!y(e,"bpmn:SubProcess")&&!y(e,"bpmn:Collaboration");)if(y(e,"bpmn:Participant")){e=e.processRef;break}else e=e.$parent;i="artifacts"}else if(y(t,"bpmn:MessageFlow"))i="messageFlows";else if(y(t,"bpmn:Participant")){i="participants";var o=t.processRef,a;o&&(a=gR(t.$parent||e),t.$parent&&(Wt(a.get("rootElements"),o),o.$parent=null),e&&(Zt(a.get("rootElements"),o),o.$parent=a))}else y(t,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":y(t,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:t.id,parent:e.id}));var s;if(t.$parent&&(s=t.$parent.get(i),Wt(s,t)),e?(s=e.get(i),s.push(t),t.$parent=e):t.$parent=null,n){var c=n.get(i);Wt(s,t),e&&(c||(c=[],e.set(i,c)),c.push(t))}}},Te.prototype.updateConnectionWaypoints=function(t){var e=gt(t);e.set("waypoint",this._bpmnFactory.createDiWaypoints(t.waypoints))},Te.prototype.updateConnection=function(t){var e=t.connection,n=W(e),i=e.source,r=W(i),o=e.target,a=W(e.target),s;if(y(n,"bpmn:DataAssociation"))y(n,"bpmn:DataInputAssociation")?(n.get("sourceRef")[0]=r,s=t.parent||t.newParent||a,this.updateSemanticParent(n,a,s)):y(n,"bpmn:DataOutputAssociation")&&(s=t.parent||t.newParent||r,this.updateSemanticParent(n,r,s),n.targetRef=a);else{var c=y(n,"bpmn:SequenceFlow");n.sourceRef!==r&&(c&&(Wt(n.sourceRef&&n.sourceRef.get("outgoing"),n),r&&r.get("outgoing")&&r.get("outgoing").push(n)),n.sourceRef=r),n.targetRef!==a&&(c&&(Wt(n.targetRef&&n.targetRef.get("incoming"),n),a&&a.get("incoming")&&a.get("incoming").push(n)),n.targetRef=a)}this.updateConnectionWaypoints(e),this.updateDiConnection(e,i,o)},Te.prototype._getLabel=function(t){return t.label||(t.label=this._bpmnFactory.createDiLabel()),t.label};function Ae(t){return function(e){var n=e.context,i=n.shape||n.connection||n.element;y(i,"bpmn:BaseElement")&&t(e)}}function bR(t){if(y(t,"bpmn:Activity")){var e=gt(t);if(e){var n=e.get("label");if(n)return n.get("bounds")}}}function mi(t,e,n){Bn.call(this),this._bpmnFactory=t,this._moddle=e,this._translate=n}q(mi,Bn),mi.$inject=["bpmnFactory","moddle","translate"],mi.prototype._baseCreate=Bn.prototype.create,mi.prototype.create=function(t,e){if(t==="label"){var n=e.di||this._bpmnFactory.createDiLabel();return this._baseCreate(t,N({type:"label",di:n},Lr,e))}return this.createElement(t,e)},mi.prototype.createElement=function(t,e){var n,i=this._translate;e=N({},e||{});var r=e.businessObject,o=e.di;if(!r){if(!e.type)throw new Error(i("no shape type specified"));r=this._bpmnFactory.create(e.type),bh(r)}if(!_R(o)){var a=N({},o||{},{id:r.id+"_di"});t==="root"?o=this._bpmnFactory.createDiPlane(r,a):t==="connection"?o=this._bpmnFactory.createDiEdge(r,a):o=this._bpmnFactory.createDiShape(r,a)}y(r,"bpmn:Group")&&(e=N({isFrame:!0},e)),e=xR(r,e,["processRef","isInterrupting","associationDirection","isForCompensation"]),e.isExpanded&&(e=Pv(o,e,"isExpanded")),y(r,"bpmn:SubProcess")&&(e.collapsed=!vt(r,o)),y(r,"bpmn:ExclusiveGateway")&&(o.isMarkerVisible=!0),ae(e.triggeredByEvent)&&(r.triggeredByEvent=e.triggeredByEvent,delete e.triggeredByEvent),ae(e.cancelActivity)&&(r.cancelActivity=e.cancelActivity,delete e.cancelActivity);var s,c;return e.eventDefinitionType&&(s=r.get("eventDefinitions")||[],c=this._bpmnFactory.create(e.eventDefinitionType,e.eventDefinitionAttrs),e.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(c.condition=this._bpmnFactory.create("bpmn:FormalExpression")),s.push(c),c.$parent=r,r.eventDefinitions=s,delete e.eventDefinitionType),n=this.getDefaultSize(r,o),e=N({id:r.id},n,e,{businessObject:r,di:o}),this._baseCreate(t,e)},mi.prototype.getDefaultSize=function(t,e){var n=W(t);return e=e||gt(t),y(n,"bpmn:SubProcess")?vt(n,e)?{width:350,height:200}:{width:100,height:80}:y(n,"bpmn:Task")?{width:100,height:80}:y(n,"bpmn:Gateway")?{width:50,height:50}:y(n,"bpmn:Event")?{width:36,height:36}:y(n,"bpmn:Participant")?vt(n,e)?{width:600,height:250}:{width:400,height:60}:y(n,"bpmn:Lane")?{width:400,height:100}:y(n,"bpmn:DataObjectReference")?{width:36,height:50}:y(n,"bpmn:DataStoreReference")?{width:50,height:50}:y(n,"bpmn:TextAnnotation")?{width:100,height:30}:y(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},mi.prototype.createParticipantShape=function(t){return oe(t)||(t={isExpanded:t}),t=N({type:"bpmn:Participant"},t||{}),t.isExpanded!==!1&&(t.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(t)};function xR(t,e,n){return k(n,function(i){e=Pv(t,e,i)}),e}function Pv(t,e,n){return e[n]===void 0?e:(t[n]=e[n],Tn(e,[n]))}function _R(t){return dt(t,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}function bs(t,e){this._modeling=t,this._canvas=e}bs.$inject=["modeling","canvas"],bs.prototype.preExecute=function(t){var e=this._modeling,n=t.elements,i=t.alignment;k(n,function(r){var o={x:0,y:0};ae(i.left)?o.x=i.left-r.x:ae(i.right)?o.x=i.right-r.width-r.x:ae(i.center)?o.x=i.center-Math.round(r.width/2)-r.x:ae(i.top)?o.y=i.top-r.y:ae(i.bottom)?o.y=i.bottom-r.height-r.y:ae(i.middle)&&(o.y=i.middle-Math.round(r.height/2)-r.y),e.moveElements([r],o,r.parent)})},bs.prototype.postExecute=function(t){};function xs(t){this._modeling=t}xs.$inject=["modeling"],xs.prototype.preExecute=function(t){var e=t.source;if(!e)throw new Error("source required");var n=t.target||e.parent,i=t.shape,r=t.hints||{};i=t.shape=this._modeling.createShape(i,t.position,n,{attach:r.attach}),t.shape=i},xs.prototype.postExecute=function(t){var e=t.hints||{};ER(t.source,t.shape)||(e.connectionTarget===t.source?this._modeling.connect(t.shape,t.source,t.connection):this._modeling.connect(t.source,t.shape,t.connection))};function ER(t,e){return kn(t.outgoing,function(n){return n.target===e})}function _s(t,e){this._canvas=t,this._layouter=e}_s.$inject=["canvas","layouter"],_s.prototype.execute=function(t){var e=t.connection,n=t.source,i=t.target,r=t.parent,o=t.parentIndex,a=t.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return e.source=n,e.target=i,e.waypoints||(e.waypoints=this._layouter.layoutConnection(e,a)),this._canvas.addConnection(e,r,o),e},_s.prototype.revert=function(t){var e=t.connection;return this._canvas.removeConnection(e),e.source=null,e.target=null,e};var Es=Math.round;function bl(t){this._modeling=t}bl.$inject=["modeling"],bl.prototype.preExecute=function(t){var e=t.elements,n=t.parent,i=t.parentIndex,r=t.position,o=t.hints,a=this._modeling;k(e,function(u){it(u.x)||(u.x=0),it(u.y)||(u.y=0)});var s=ct(e,function(u){return!u.hidden}),c=Vt(s);k(e,function(u){Dt(u)&&(u.waypoints=be(u.waypoints,function(h){return{x:Es(h.x-c.x-c.width/2+r.x),y:Es(h.y-c.y-c.height/2+r.y)}})),N(u,{x:Es(u.x-c.x-c.width/2+r.x),y:Es(u.y-c.y-c.height/2+r.y)})});var p=Wo(e),l={};k(e,function(u){if(Dt(u)){l[u.id]=it(i)?a.createConnection(l[u.source.id],l[u.target.id],i,u,u.parent||n,o):a.createConnection(l[u.source.id],l[u.target.id],u,u.parent||n,o);return}var h=N({},o);p.indexOf(u)===-1&&(h.autoResize=!1),xt(u)&&(h=Tn(h,["attach"])),l[u.id]=it(i)?a.createShape(u,un(u,["x","y","width","height"]),u.parent||n,i,h):a.createShape(u,un(u,["x","y","width","height"]),u.parent||n,h)}),t.elements=iu(l)};var kv=Math.round;function vi(t){this._canvas=t}vi.$inject=["canvas"],vi.prototype.execute=function(t){var e=t.shape,n=t.position,i=t.parent,r=t.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?N(e,n):N(e,{x:n.x-kv(e.width/2),y:n.y-kv(e.height/2)}),this._canvas.addShape(e,i,r),e},vi.prototype.revert=function(t){var e=t.shape;return this._canvas.removeShape(e),e};function fo(t){vi.call(this,t)}q(fo,vi),fo.$inject=["canvas"];var wR=vi.prototype.execute;fo.prototype.execute=function(t){var e=t.shape;return CR(e),e.labelTarget=t.labelTarget,wR.call(this,t)};var SR=vi.prototype.revert;fo.prototype.revert=function(t){return t.shape.labelTarget=null,SR.call(this,t)};function CR(t){["width","height"].forEach(function(e){typeof t[e]>"u"&&(t[e]=0)})}function mo(t,e){this._canvas=t,this._modeling=e}mo.$inject=["canvas","modeling"],mo.prototype.preExecute=function(t){var e=this._modeling,n=t.connection;fi(n.incoming,function(i){e.removeConnection(i,{nested:!0})}),fi(n.outgoing,function(i){e.removeConnection(i,{nested:!0})})},mo.prototype.execute=function(t){var e=t.connection,n=e.parent;return t.parent=n,t.parentIndex=lc(n.children,e),t.source=e.source,t.target=e.target,this._canvas.removeConnection(e),e.source=null,e.target=null,e},mo.prototype.revert=function(t){var e=t.connection,n=t.parent,i=t.parentIndex;return e.source=t.source,e.target=t.target,Zt(n.children,e,i),this._canvas.addConnection(e,n),e};function xl(t,e){this._modeling=t,this._elementRegistry=e}xl.$inject=["modeling","elementRegistry"],xl.prototype.postExecute=function(t){var e=this._modeling,n=this._elementRegistry,i=t.elements;k(i,function(r){n.get(r.id)&&(r.waypoints?e.removeConnection(r):e.removeShape(r))})};function vo(t,e){this._canvas=t,this._modeling=e}vo.$inject=["canvas","modeling"],vo.prototype.preExecute=function(t){var e=this._modeling,n=t.shape;fi(n.incoming,function(i){e.removeConnection(i,{nested:!0})}),fi(n.outgoing,function(i){e.removeConnection(i,{nested:!0})}),fi(n.children,function(i){Dt(i)?e.removeConnection(i,{nested:!0}):e.removeShape(i,{nested:!0})})},vo.prototype.execute=function(t){var e=this._canvas,n=t.shape,i=n.parent;return t.oldParent=i,t.oldParentIndex=lc(i.children,n),e.removeShape(n),n},vo.prototype.revert=function(t){var e=this._canvas,n=t.shape,i=t.oldParent,r=t.oldParentIndex;return Zt(i.children,n,r),e.addShape(n,i),n};function ws(t){this._modeling=t}ws.$inject=["modeling"];var Tv={x:"y",y:"x"};ws.prototype.preExecute=function(t){var e=this._modeling,n=t.groups,i=t.axis,r=t.dimension;function o(g,R){g.range.min=Math.min(R[i],g.range.min),g.range.max=Math.max(R[i]+R[r],g.range.max)}function a(g){return g[i]+g[r]/2}function s(g){return g.length-1}function c(g){return g.max-g.min}function p(g,R){var E={y:0};E[i]=g-a(R),E[i]&&(E[Tv[i]]=0,e.moveElements([R],E,R.parent))}var l=n[0],u=s(n),h=n[u],d,f,v=0;k(n,function(g,R){var E,_,x;if(g.elements.length<2){R&&R!==n.length-1&&(o(g,g.elements[0]),v+=c(g.range));return}E=ln(g.elements,i),_=E[0],R===u&&(_=E[s(E)]),x=a(_),g.range=null,k(E,function(S){if(p(x,S),g.range===null){g.range={min:S[i],max:S[i]+S[r]};return}o(g,S)}),R&&R!==n.length-1&&(v+=c(g.range))}),f=Math.abs(h.range.min-l.range.max),d=Math.round((f-v)/(n.length-1)),!(d<n.length-1)&&k(n,function(g,R){var E={},_;g===l||g===h||(_=n[R-1],g.range.max=0,k(g.elements,function(x,S){E[Tv[i]]=0,E[i]=_.range.max-x[i]+d,g.range.min!==x[i]&&(E[i]+=x[i]-g.range.min),E[i]&&e.moveElements([x],E,x.parent),g.range.max=Math.max(x[i]+x[r],S?g.range.max:0)}))})},ws.prototype.postExecute=function(t){};function Ss(t,e){this._layouter=t,this._canvas=e}Ss.$inject=["layouter","canvas"],Ss.prototype.execute=function(t){var e=t.connection,n=e.waypoints;return N(t,{oldWaypoints:n}),e.waypoints=this._layouter.layoutConnection(e,t.hints),e},Ss.prototype.revert=function(t){var e=t.connection;return e.waypoints=t.oldWaypoints,e};function _l(){}_l.prototype.execute=function(t){var e=t.connection,n=t.delta,i=t.newParent||e.parent,r=t.newParentIndex,o=e.parent;return t.oldParent=o,t.oldParentIndex=Wt(o.children,e),Zt(i.children,e,r),e.parent=i,k(e.waypoints,function(a){a.x+=n.x,a.y+=n.y,a.original&&(a.original.x+=n.x,a.original.y+=n.y)}),e},_l.prototype.revert=function(t){var e=t.connection,n=e.parent,i=t.oldParent,r=t.oldParentIndex,o=t.delta;return Wt(n.children,e),Zt(i.children,e,r),e.parent=i,k(e.waypoints,function(a){a.x-=o.x,a.y-=o.y,a.original&&(a.original.x-=o.x,a.original.y-=o.y)}),e};function El(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}El.prototype.add=function(t,e){return this.addAll([t],e)},El.prototype.addAll=function(t,e){var n=Gg(t,!!e,this);return N(this,n),this};function yo(t){this._modeling=t}yo.prototype.moveRecursive=function(t,e,n){return t?this.moveClosure(this.getClosure(t),e,n):[]},yo.prototype.moveClosure=function(t,e,n,i,r){var o=this._modeling,a=t.allShapes,s=t.allConnections,c=t.enclosedConnections,p=t.topLevel,l=!1;r&&r.parent===n&&(l=!0),k(a,function(u){o.moveShape(u,e,p[u.id]&&!l&&n,{recurse:!1,layout:!1})}),k(s,function(u){var h=!!a[u.source.id],d=!!a[u.target.id];c[u.id]&&h&&d?o.moveConnection(u,e,p[u.id]&&!l&&n):o.layoutConnection(u,{connectionStart:h&&Gp(u,u.source,e),connectionEnd:d&&Vp(u,u.target,e)})})},yo.prototype.getClosure=function(t){return new El().addAll(t,!0)};function Cs(t){this._helper=new yo(t)}Cs.$inject=["modeling"],Cs.prototype.preExecute=function(t){t.closure=this._helper.getClosure(t.shapes)},Cs.prototype.postExecute=function(t){var e=t.hints,n;e&&e.primaryShape&&(n=e.primaryShape,e.oldParent=n.parent),this._helper.moveClosure(t.closure,t.delta,t.newParent,t.newHost,n)};function Hi(t){this._modeling=t,this._helper=new yo(t)}Hi.$inject=["modeling"],Hi.prototype.execute=function(t){var e=t.shape,n=t.delta,i=t.newParent||e.parent,r=t.newParentIndex,o=e.parent;return t.oldBounds=un(e,["x","y","width","height"]),t.oldParent=o,t.oldParentIndex=Wt(o.children,e),Zt(i.children,e,r),N(e,{parent:i,x:e.x+n.x,y:e.y+n.y}),e},Hi.prototype.postExecute=function(t){var e=t.shape,n=t.delta,i=t.hints,r=this._modeling;i.layout!==!1&&(k(e.incoming,function(o){r.layoutConnection(o,{connectionEnd:Vp(o,e,n)})}),k(e.outgoing,function(o){r.layoutConnection(o,{connectionStart:Gp(o,e,n)})})),i.recurse!==!1&&this.moveChildren(t)},Hi.prototype.revert=function(t){var e=t.shape,n=t.oldParent,i=t.oldParentIndex,r=t.delta;return Zt(n.children,e,i),N(e,{parent:n,x:e.x-r.x,y:e.y-r.y}),e},Hi.prototype.moveChildren=function(t){var e=t.delta,n=t.shape;this._helper.moveRecursive(n.children,e,null)},Hi.prototype.getNewParent=function(t){return t.newParent||t.shape.parent};function go(t){this._modeling=t}go.$inject=["modeling"],go.prototype.execute=function(t){var e=t.newSource,n=t.newTarget,i=t.connection,r=t.dockingOrPoints;if(!e&&!n)throw new Error("newSource or newTarget required");return lt(r)&&(t.oldWaypoints=i.waypoints,i.waypoints=r),e&&(t.oldSource=i.source,i.source=e),n&&(t.oldTarget=i.target,i.target=n),i},go.prototype.postExecute=function(t){var e=t.connection,n=t.newSource,i=t.newTarget,r=t.dockingOrPoints,o=t.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),o.layoutConnection!==!1&&(n&&(!i||o.docking==="source")&&(a.connectionStart=a.connectionStart||Av(lt(r)?r[0]:r)),i&&(!n||o.docking==="target")&&(a.connectionEnd=a.connectionEnd||Av(lt(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(e,a))},go.prototype.revert=function(t){var e=t.oldSource,n=t.oldTarget,i=t.oldWaypoints,r=t.connection;return e&&(r.source=e),n&&(r.target=n),i&&(r.waypoints=i),r};function Av(t){return t.original||t}function Gn(t,e){this._modeling=t,this._rules=e}Gn.$inject=["modeling","rules"],Gn.prototype.preExecute=function(t){var e=this,n=this._modeling,i=this._rules,r=t.oldShape,o=t.newData,a=t.hints||{},s;function c(f,v,g){return i.allowed("connection.reconnect",{connection:g,source:f,target:v})}var p={x:o.x,y:o.y},l={x:r.x,y:r.y,width:r.width,height:r.height};s=t.newShape=t.newShape||e.createShape(o,p,r.parent,a),r.host&&n.updateAttachment(s,r.host);var u;a.moveChildren!==!1&&(u=r.children.slice(),n.moveElements(u,{x:0,y:0},s,a));var h=r.incoming.slice(),d=r.outgoing.slice();k(h,function(f){var v=f.source,g=c(v,s,f);g&&e.reconnectEnd(f,s,os(f,s,l),a)}),k(d,function(f){var v=f.target,g=c(s,v,f);g&&e.reconnectStart(f,s,rs(f,s,l),a)})},Gn.prototype.postExecute=function(t){var e=t.oldShape;this._modeling.removeShape(e)},Gn.prototype.execute=function(t){},Gn.prototype.revert=function(t){},Gn.prototype.createShape=function(t,e,n,i){return this._modeling.createShape(t,e,n,i)},Gn.prototype.reconnectStart=function(t,e,n,i){this._modeling.reconnectStart(t,e,n,i)},Gn.prototype.reconnectEnd=function(t,e,n,i){this._modeling.reconnectEnd(t,e,n,i)};function bo(t){this._modeling=t}bo.$inject=["modeling"],bo.prototype.execute=function(t){var e=t.shape,n=t.newBounds,i=t.minBounds;if(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return t.oldBounds={width:e.width,height:e.height,x:e.x,y:e.y},N(e,{width:n.width,height:n.height,x:n.x,y:n.y}),e},bo.prototype.postExecute=function(t){var e=this._modeling,n=t.shape,i=t.oldBounds,r=t.hints||{};r.layout!==!1&&(k(n.incoming,function(o){e.layoutConnection(o,{connectionEnd:os(o,n,i)})}),k(n.outgoing,function(o){e.layoutConnection(o,{connectionStart:rs(o,n,i)})}))},bo.prototype.revert=function(t){var e=t.shape,n=t.oldBounds;return N(e,{width:n.width,height:n.height,x:n.x,y:n.y}),e};function yi(t){this._modeling=t}yi.$inject=["modeling"],yi.prototype.preExecute=function(t){var e=t.delta,n=t.direction,i=t.movingShapes,r=t.resizingShapes,o=t.start,a={};this.moveShapes(i,e),k(r,function(s){a[s.id]=PR(s)}),this.resizeShapes(r,e,n),this.updateConnectionWaypoints(XC(i,r),e,n,o,i,r,a)},yi.prototype.execute=function(){},yi.prototype.revert=function(){},yi.prototype.moveShapes=function(t,e){var n=this;k(t,function(i){n._modeling.moveShape(i,e,null,{autoResize:!1,layout:!1,recurse:!1})})},yi.prototype.resizeShapes=function(t,e,n){var i=this;k(t,function(r){var o=ZC(r,n,e);i._modeling.resizeShape(r,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})},yi.prototype.updateConnectionWaypoints=function(t,e,n,i,r,o,a){var s=this,c=r.concat(o);k(t,function(p){var l=p.source,u=p.target,h=RR(p),d=Dv(n),f={};gi(c,l)&&gi(c,u)?(h=be(h,function(v){return Bv(v,i,n)&&(v[d]=v[d]+e[d]),v.original&&Bv(v.original,i,n)&&(v.original[d]=v.original[d]+e[d]),v}),s._modeling.updateWaypoints(p,h,{labelBehavior:!1})):(gi(c,l)||gi(c,u))&&(gi(r,l)?f.connectionStart=Gp(p,l,e):gi(r,u)?f.connectionEnd=Vp(p,u,e):gi(o,l)?f.connectionStart=rs(p,l,a[l.id]):gi(o,u)&&(f.connectionEnd=os(p,u,a[u.id])),s._modeling.layoutConnection(p,f))})};function Mv(t){return N({},t)}function RR(t){return be(t.waypoints,function(e){return e=Mv(e),e.original&&(e.original=Mv(e.original)),e})}function Dv(t){switch(t){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function Bv(t,e,n){var i=Dv(n);if(/e|s/.test(n))return t[i]>e;if(/n|w/.test(n))return t[i]<e}function gi(t,e){return t.indexOf(e)!==-1}function PR(t){return{x:t.x,y:t.y,height:t.height,width:t.width}}function Rs(t){this._modeling=t}Rs.$inject=["modeling"],Rs.prototype.execute=function(t){var e=t.shape,n=e.children;t.oldChildrenVisibility=Nv(n),e.collapsed=!e.collapsed;var i=Ov(n,e.collapsed);return[e].concat(i)},Rs.prototype.revert=function(t){var e=t.shape,n=t.oldChildrenVisibility,i=e.children,r=jv(i,n);return e.collapsed=!e.collapsed,[e].concat(r)};function Nv(t){var e={};return k(t,function(n){e[n.id]=n.hidden,n.children&&(e=N({},e,Nv(n.children)))}),e}function Ov(t,e){var n=[];return k(t,function(i){i.hidden=e,n=n.concat(i),i.children&&(n=n.concat(Ov(i.children,i.collapsed||e)))}),n}function jv(t,e){var n=[];return k(t,function(i){i.hidden=e[i.id],n=n.concat(i),i.children&&(n=n.concat(jv(i.children,e)))}),n}function Ps(t){this._modeling=t}Ps.$inject=["modeling"],Ps.prototype.execute=function(t){var e=t.shape,n=t.newHost,i=e.host;return t.oldHost=i,t.attacherIdx=Lv(i,e),Iv(n,e),e.host=n,e},Ps.prototype.revert=function(t){var e=t.shape,n=t.newHost,i=t.oldHost,r=t.attacherIdx;return e.host=i,Lv(n,e),Iv(i,e,r),e};function Lv(t,e){return Wt(t&&t.attachers,e)}function Iv(t,e,n){if(t){var i=t.attachers;i||(t.attachers=i=[]),Zt(i,e,n)}}function wl(){}wl.prototype.execute=function(t){var e=t.connection,n=t.newWaypoints;return t.oldWaypoints=e.waypoints,e.waypoints=n,e},wl.prototype.revert=function(t){var e=t.connection,n=t.oldWaypoints;return e.waypoints=n,e};function Tt(t,e,n){this._eventBus=t,this._elementFactory=e,this._commandStack=n;var i=this;t.on("diagram.init",function(){i.registerHandlers(n)})}Tt.$inject=["eventBus","elementFactory","commandStack"],Tt.prototype.getHandlers=function(){return{"shape.append":xs,"shape.create":vi,"shape.delete":vo,"shape.move":Hi,"shape.resize":bo,"shape.replace":Gn,"shape.toggleCollapse":Rs,spaceTool:yi,"label.create":fo,"connection.create":_s,"connection.delete":mo,"connection.move":_l,"connection.layout":Ss,"connection.updateWaypoints":wl,"connection.reconnect":go,"elements.create":bl,"elements.move":Cs,"elements.delete":xl,"elements.distribute":ws,"elements.align":bs,"element.updateAttachment":Ps}},Tt.prototype.registerHandlers=function(t){k(this.getHandlers(),function(e,n){t.registerHandler(n,e)})},Tt.prototype.moveShape=function(t,e,n,i,r){typeof i=="object"&&(r=i,i=null);var o={shape:t,delta:e,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},Tt.prototype.updateAttachment=function(t,e){var n={shape:t,newHost:e};this._commandStack.execute("element.updateAttachment",n)},Tt.prototype.moveElements=function(t,e,n,i){i=i||{};var r=i.attach,o=n,a;r===!0?(a=n,o=n.parent):r===!1&&(a=null);var s={shapes:t,delta:e,newParent:o,newHost:a,hints:i};this._commandStack.execute("elements.move",s)},Tt.prototype.moveConnection=function(t,e,n,i,r){typeof i=="object"&&(r=i,i=void 0);var o={connection:t,delta:e,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},Tt.prototype.layoutConnection=function(t,e){var n={connection:t,hints:e||{}};this._commandStack.execute("connection.layout",n)},Tt.prototype.createConnection=function(t,e,n,i,r,o){typeof n=="object"&&(o=r,r=i,i=n,n=void 0),i=this._create("connection",i);var a={source:t,target:e,parent:r,parentIndex:n,connection:i,hints:o};return this._commandStack.execute("connection.create",a),a.connection},Tt.prototype.createShape=function(t,e,n,i,r){typeof i!="number"&&(r=i,i=void 0),r=r||{};var o=r.attach,a,s;t=this._create("shape",t),o?(a=n.parent,s=n):a=n;var c={position:e,shape:t,parent:a,parentIndex:i,host:s,hints:r};return this._commandStack.execute("shape.create",c),c.shape},Tt.prototype.createElements=function(t,e,n,i,r){lt(t)||(t=[t]),typeof i!="number"&&(r=i,i=void 0),r=r||{};var o={position:e,elements:t,parent:n,parentIndex:i,hints:r};return this._commandStack.execute("elements.create",o),o.elements},Tt.prototype.createLabel=function(t,e,n,i){n=this._create("label",n);var r={labelTarget:t,position:e,parent:i||t.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},Tt.prototype.appendShape=function(t,e,n,i,r){r=r||{},e=this._create("shape",e);var o={source:t,position:n,target:i,shape:e,connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},Tt.prototype.removeElements=function(t){var e={elements:t};this._commandStack.execute("elements.delete",e)},Tt.prototype.distributeElements=function(t,e,n){var i={groups:t,axis:e,dimension:n};this._commandStack.execute("elements.distribute",i)},Tt.prototype.removeShape=function(t,e){var n={shape:t,hints:e||{}};this._commandStack.execute("shape.delete",n)},Tt.prototype.removeConnection=function(t,e){var n={connection:t,hints:e||{}};this._commandStack.execute("connection.delete",n)},Tt.prototype.replaceShape=function(t,e,n){var i={oldShape:t,newData:e,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Tt.prototype.alignElements=function(t,e){var n={elements:t,alignment:e};this._commandStack.execute("elements.align",n)},Tt.prototype.resizeShape=function(t,e,n,i){var r={shape:t,newBounds:e,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Tt.prototype.createSpace=function(t,e,n,i,r){var o={delta:n,direction:i,movingShapes:t,resizingShapes:e,start:r};this._commandStack.execute("spaceTool",o)},Tt.prototype.updateWaypoints=function(t,e,n){var i={connection:t,newWaypoints:e,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Tt.prototype.reconnect=function(t,e,n,i,r){var o={connection:t,newSource:e,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},Tt.prototype.reconnectStart=function(t,e,n,i){i||(i={}),this.reconnect(t,e,t.target,n,N(i,{docking:"source"}))},Tt.prototype.reconnectEnd=function(t,e,n,i){i||(i={}),this.reconnect(t,t.source,e,n,N(i,{docking:"target"}))},Tt.prototype.connect=function(t,e,n,i){return this.createConnection(t,e,n||{},t.parent,i)},Tt.prototype._create=function(t,e){return P0(e)?e:this._elementFactory.create(t,e)},Tt.prototype.toggleCollapse=function(t,e){var n={shape:t,hints:e||{}};this._commandStack.execute("shape.toggleCollapse",n)};function xo(t){this._elementRegistry=t}xo.$inject=["elementRegistry"],xo.prototype.execute=function(t){var e=t.element,n=t.moddleElement,i=t.properties;if(!n)throw new Error("<moddleElement> required");var r=t.changed||this._getVisualReferences(n).concat(e),o=t.oldProperties||kR(n,ru(i));return $v(n,i),t.oldProperties=o,t.changed=r,r},xo.prototype.revert=function(t){var e=t.oldProperties,n=t.moddleElement,i=t.changed;return $v(n,e),i},xo.prototype._getVisualReferences=function(t){var e=this._elementRegistry;return y(t,"bpmn:DataObject")?TR(t,e):[]};function kR(t,e){return Ge(e,function(n,i){return n[i]=t.get(i),n},{})}function $v(t,e){k(e,function(n,i){t.set(i,n)})}function TR(t,e){return e.filter(function(n){return y(n,"bpmn:DataObjectReference")&&W(n).dataObjectRef===t})}var _o="default",Vn="id",zv="di",AR={width:0,height:0};function Eo(t,e,n,i,r){this._elementRegistry=t,this._moddle=e,this._translate=n,this._modeling=i,this._textRenderer=r}Eo.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],Eo.prototype.execute=function(t){var e=t.element,n=[e],i=this._translate;if(!e)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=e.businessObject,s=OR(t.properties),c=t.oldProperties||MR(e,s);return Fv(s,a)&&(o.unclaim(a[Vn]),r.updateId(e,s[Vn]),o.claim(s[Vn],a)),_o in s&&(s[_o]&&n.push(r.get(s[_o].id)),a[_o]&&n.push(r.get(a[_o].id))),Hv(e,s),t.oldProperties=c,t.changed=n,n},Eo.prototype.postExecute=function(t){var e=t.element,n=e.label,i=n&&W(n).name;if(i){var r=this._textRenderer.getExternalLabelBounds(n,i);this._modeling.resizeShape(n,r,AR)}},Eo.prototype.revert=function(t){var e=t.element,n=t.properties,i=t.oldProperties,r=e.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Hv(e,i),Fv(n,r)&&(a.unclaim(n[Vn]),o.updateId(e,i[Vn]),a.claim(i[Vn],r)),t.changed};function Fv(t,e){return Vn in t&&t[Vn]!==e[Vn]}function MR(t,e){var n=ru(e),i=t.businessObject,r=gt(t);return Ge(n,function(o,a){return a!==zv?o[a]=i.get(a):o[a]=DR(r,ru(e.di)),o},{})}function DR(t,e){return Ge(e,function(n,i){return n[i]=t&&t.get(i),n},{})}function Hv(t,e){var n=t.businessObject,i=gt(t);k(e,function(r,o){o!==zv?n.set(o,r):i&&BR(i,r)})}function BR(t,e){k(e,function(n,i){t.set(i,n)})}var NR=["default"];function OR(t){var e=N({},t);return NR.forEach(function(n){n in t&&(e[n]=W(e[n]))}),e}function ks(t,e){this._canvas=t,this._modeling=e}ks.$inject=["canvas","modeling"],ks.prototype.execute=function(t){var e=this._canvas,n=t.newRoot,i=n.businessObject,r=e.getRootElement(),o=r.businessObject,a=o.$parent,s=gt(r);return e.setRootElement(n),e.removeRootElement(r),Zt(a.rootElements,i),i.$parent=a,Wt(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,t.oldRoot=r,[]},ks.prototype.revert=function(t){var e=this._canvas,n=t.newRoot,i=n.businessObject,r=t.oldRoot,o=r.businessObject,a=i.$parent,s=gt(n);return e.setRootElement(r),e.removeRootElement(n),Wt(a.rootElements,i),i.$parent=null,Zt(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s,[]};function Sl(t,e){this._modeling=t,this._spaceTool=e}Sl.$inject=["modeling","spaceTool"],Sl.prototype.preExecute=function(t){var e=this._spaceTool,n=this._modeling,i=t.shape,r=t.location,o=on(i),a=o===i,s=a?i:i.parent,c=Li(s);c.length||n.createShape({type:"bpmn:Lane"},{x:i.x+dr,y:i.y,width:i.width-dr,height:i.height},s);var p=[];Si(o,function(v){return p.push(v),v.label&&p.push(v.label),v===i?[]:ct(v.children,function(g){return g!==i})});var l=r==="top"?-120:120,u=r==="top"?i.y:i.y+i.height,h=u+(r==="top"?10:-10),d=r==="top"?"n":"s",f=e.calculateAdjustments(p,"y",l,h);e.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:l},d,h),t.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?dr:0),y:u-(r==="top"?120:0),width:i.width-(a?dr:0),height:120},s)};function Cl(t,e){this._modeling=t,this._translate=e}Cl.$inject=["modeling","translate"],Cl.prototype.preExecute=function(t){var e=this._modeling,n=this._translate,i=t.shape,r=t.count,o=Li(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var s=Math.round(i.height/r),c,p,l,u,h;for(h=0;h<r;h++)c=i.y+h*s,h===r-1?p=i.height-s*h:p=s,l={x:i.x+dr,y:c,width:i.width-dr,height:p},h<a?e.resizeShape(o[h],l):(u={type:"bpmn:Lane"},e.createShape(u,l,i))};function wo(t,e){this._modeling=t,this._spaceTool=e}wo.$inject=["modeling","spaceTool"],wo.prototype.preExecute=function(t){var e=t.shape,n=t.newBounds,i=t.balanced;i!==!1?this.resizeBalanced(e,n):this.resizeSpace(e,n)},wo.prototype.resizeBalanced=function(t,e){var n=this._modeling,i=gw(t,e);n.resizeShape(t,e),i.forEach(function(r){n.resizeShape(r.shape,r.newBounds)})},wo.prototype.resizeSpace=function(t,e){var n=this._spaceTool,i=X(t),r=X(e),o=Gf(r,i),a=on(t),s=[],c=[];Si(a,function(f){return s.push(f),(y(f,"bpmn:Lane")||y(f,"bpmn:Participant"))&&c.push(f),f.children});var p,l,u,h,d;(o.bottom||o.top)&&(p=o.bottom||o.top,l=t.y+(o.bottom?t.height:0)+(o.bottom?-10:10),u=o.bottom?"s":"n",h=o.top>0||o.bottom<0?-p:p,d=n.calculateAdjustments(s,"y",h,l),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},u)),(o.left||o.right)&&(p=o.right||o.left,l=t.x+(o.right?t.width:0)+(o.right?-10:100),u=o.right?"e":"w",h=o.left>0||o.right<0?-p:p,d=n.calculateAdjustments(c,"x",h,l),n.makeSpace(d.movingShapes,d.resizingShapes,{x:p,y:0},u))};var So="flowNodeRef",Rl="lanes";function Co(t){this._elementRegistry=t}Co.$inject=["elementRegistry"],Co.prototype._computeUpdates=function(t,e){var n=[],i=[],r={},o=[];function a(l,u){var h=X(u),d={x:l.x+l.width/2,y:l.y+l.height/2};return d.x>h.left&&d.x<h.right&&d.y>h.top&&d.y<h.bottom}function s(l){n.indexOf(l)===-1&&(o.push(l),n.push(l))}function c(l){var u=on(l);return r[u.id]||(r[u.id]=Fa(u)),r[u.id]}function p(l){if(!l.parent)return[];var u=c(l);return u.filter(function(h){return a(l,h)}).map(function(h){return h.businessObject})}return e.forEach(function(l){var u=on(l);if(!(!u||n.indexOf(u)!==-1)){var h=u.children.filter(function(d){return y(d,"bpmn:FlowNode")});h.forEach(s),n.push(u)}}),t.forEach(s),o.forEach(function(l){var u=l.businessObject,h=u.get(Rl),d=h.slice(),f=p(l);i.push({flowNode:u,remove:d,add:f})}),e.forEach(function(l){var u=l.businessObject;l.parent||u.get(So).forEach(function(h){i.push({flowNode:h,remove:[u],add:[]})})}),i},Co.prototype.execute=function(t){var e=t.updates;return e||(e=t.updates=this._computeUpdates(t.flowNodeShapes,t.laneShapes)),e.forEach(function(n){var i=n.flowNode,r=i.get(Rl);n.remove.forEach(function(o){Wt(r,o),Wt(o.get(So),i)}),n.add.forEach(function(o){Zt(r,o),Zt(o.get(So),i)})}),[]},Co.prototype.revert=function(t){var e=t.updates;return e.forEach(function(n){var i=n.flowNode,r=i.get(Rl);n.add.forEach(function(o){Wt(r,o),Wt(o.get(So),i)}),n.remove.forEach(function(o){Zt(r,o),Zt(o.get(So),i)})}),[]};function Ts(t){this._moddle=t}Ts.$inject=["moddle"],Ts.prototype.execute=function(t){var e=this._moddle.ids,n=t.id,i=t.element,r=t.claiming;return r?e.claim(n,i):e.unclaim(n),[]},Ts.prototype.revert=function(t){var e=this._moddle.ids,n=t.id,i=t.element,r=t.claiming;return r?e.unclaim(n):e.claim(n,i),[]};var jR={fill:void 0,stroke:void 0};function Pl(t){this._commandStack=t,this._normalizeColor=function(e){if(e){if(Me(e)){var n=LR(e);if(n)return n}throw new Error("invalid color value: "+e)}}}Pl.$inject=["commandStack"],Pl.prototype.postExecute=function(t){var e=t.elements,n=t.colors||jR,i=this,r={};"fill"in n&&N(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&N(r,{"border-color":this._normalizeColor(n.stroke)}),k(e,function(o){var a=Dt(o)?un(r,["border-color"]):r,s=gt(o);if(IR(a),xt(o))i._commandStack.execute("element.updateModdleProperties",{element:o,moddleElement:s.label,properties:{color:r["border-color"]}});else{if(!dt(s,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;i._commandStack.execute("element.updateProperties",{element:o,properties:{di:a}})}})};function LR(t){var e=document.createElement("canvas").getContext("2d");return e.fillStyle="transparent",e.fillStyle=t,/^#[0-9a-fA-F]{6}$/.test(e.fillStyle)?e.fillStyle:null}function IR(t){"border-color"in t&&(t.stroke=t["border-color"]),"background-color"in t&&(t.fill=t["background-color"])}var $R={width:0,height:0};function Gv(t,e,n){function i(c,p){var l=c.label||c,u=c.labelTarget||c;return Mx(l,p),[l,u]}function r(c){var p=c.element,l=p.businessObject,u=c.newLabel;if(!xt(p)&&ki(p)&&!ca(p)&&!Vv(u)){var h=7,d=Ac(p);d={x:d.x,y:d.y+h},t.createLabel(p,d,{id:l.id+"_label",businessObject:l,di:p.di})}}function o(c){return c.oldLabel=Ue(c.element),i(c.element,c.newLabel)}function a(c){return i(c.element,c.oldLabel)}function s(c){var p=c.element,l=p.label||p,u=c.newLabel,h=c.newBounds,d=c.hints||{};if(!(!xt(l)&&!y(l,"bpmn:TextAnnotation"))){if(xt(l)&&Vv(u)){d.removeShape!==!1&&t.removeShape(l,{unsetLabel:!1});return}var f=Ue(p);typeof h>"u"&&(h=e.getExternalLabelBounds(l,f)),h&&t.resizeShape(l,h,$R)}}this.preExecute=r,this.execute=o,this.revert=a,this.postExecute=s}Gv.$inject=["modeling","textRenderer","bpmnFactory"];function Vv(t){return!t||!t.trim()}function he(t,e,n,i){Tt.call(this,t,e,n),this._bpmnRules=i}q(he,Tt),he.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],he.prototype.getHandlers=function(){var t=Tt.prototype.getHandlers.call(this);return t["element.updateModdleProperties"]=xo,t["element.updateProperties"]=Eo,t["canvas.updateRoot"]=ks,t["lane.add"]=Sl,t["lane.resize"]=wo,t["lane.split"]=Cl,t["lane.updateRefs"]=Co,t["id.updateClaim"]=Ts,t["element.setColor"]=Pl,t["element.updateLabel"]=Gv,t},he.prototype.updateLabel=function(t,e,n,i){this._commandStack.execute("element.updateLabel",{element:t,newLabel:e,newBounds:n,hints:i||{}})},he.prototype.connect=function(t,e,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(t,e)),!!n)return this.createConnection(t,e,n,t.parent,i)},he.prototype.updateModdleProperties=function(t,e,n){this._commandStack.execute("element.updateModdleProperties",{element:t,moddleElement:e,properties:n})},he.prototype.updateProperties=function(t,e){this._commandStack.execute("element.updateProperties",{element:t,properties:e})},he.prototype.resizeLane=function(t,e,n){this._commandStack.execute("lane.resize",{shape:t,newBounds:e,balanced:n})},he.prototype.addLane=function(t,e){var n={shape:t,location:e};return this._commandStack.execute("lane.add",n),n.newLane},he.prototype.splitLane=function(t,e){this._commandStack.execute("lane.split",{shape:t,count:e})},he.prototype.makeCollaboration=function(){var t=this._create("root",{type:"bpmn:Collaboration"}),e={newRoot:t};return this._commandStack.execute("canvas.updateRoot",e),t},he.prototype.makeProcess=function(){var t=this._create("root",{type:"bpmn:Process"}),e={newRoot:t};this._commandStack.execute("canvas.updateRoot",e)},he.prototype.updateLaneRefs=function(t,e){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:t,laneShapes:e})},he.prototype.claimId=function(t,e){this._commandStack.execute("id.updateClaim",{id:t,element:e,claiming:!0})},he.prototype.unclaimId=function(t,e){this._commandStack.execute("id.updateClaim",{id:t,element:e})},he.prototype.setColor=function(t,e){t.length||(t=[t]),this._commandStack.execute("element.setColor",{elements:t,colors:e})};function Wv(){}Wv.prototype.layoutConnection=function(t,e){return e=e||{},[e.connectionStart||nt(e.source||t.source),e.connectionEnd||nt(e.target||t.target)]};var As=20,zR=5,Ms=Math.round,Uv=20,FR={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function HR(t,e){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[e].test(t)}function GR(t,e){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[t].test(e)}function qv(t,e,n){var i=le(e,t,zR),r=n.split(":")[0],o=Ms((e.x-t.x)/2+t.x),a=Ms((e.y-t.y)/2+t.y),s,c,p=GR(r,i),l=/h|r|l/.test(r),u=!1,h=!1;return p?(s=l?{x:o,y:t.y}:{x:t.x,y:a},c=l?"h:h":"v:v"):(u=HR(i,r),c=l?"h:v":"v:h",u?l?(h=a===t.y,s={x:t.x+As*(/l/.test(r)?-1:1),y:h?a+As:a}):(h=o===t.x,s={x:h?o+As:o,y:t.y+As*(/t/.test(r)?-1:1)}):s={x:o,y:a}),{waypoints:kl(t,s,c).concat(s),directions:c,turnNextDirections:h}}function VR(t,e,n){return qv(t,e,n)}function WR(t,e,n){var i=qv(e,t,Kv(n));return{waypoints:i.waypoints.slice().reverse(),directions:Kv(i.directions),turnNextDirections:i.turnNextDirections}}function UR(t,e){var n=t.directions.split(":")[1],i=e.directions.split(":")[0];t.turnNextDirections&&(n=n=="h"?"v":"h"),e.turnNextDirections&&(i=i=="h"?"v":"h");var r=n+":"+i,o=kl(t.waypoints[t.waypoints.length-1],e.waypoints[0],r);return{waypoints:o,directions:r}}function Kv(t){return t.split(":").reverse().join(":")}function qR(t,e,n){var i=Ms((e.x-t.x)/2+t.x),r=Ms((e.y-t.y)/2+t.y);if(n==="h:v")return[{x:e.x,y:t.y}];if(n==="v:h")return[{x:t.x,y:e.y}];if(n==="h:h")return[{x:i,y:t.y},{x:i,y:e.y}];if(n==="v:v")return[{x:t.x,y:r},{x:e.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function kl(t,e,n){if(n=n||"h:h",!nP(n))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(Xv(n)){var i=VR(t,e,n),r=WR(t,e,n),o=UR(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return qR(t,e,n)}function KR(t,e,n){var i=kl(t,e,n);return i.unshift(t),i.push(e),Qv(i)}function YR(t,e,n,i,r){var o=r&&r.preferredLayouts||[],a=ek(o,"straight")[0]||"h:h",s=FR[a]||0,c=le(t,e,s),p=eP(c,a);n=n||nt(t),i=i||nt(e);var l=p.split(":"),u=Zv(n,t,l[0],iP(c)),h=Zv(i,e,l[1],c);return KR(u,h,p)}function XR(t,e,n,i,r,o){lt(n)&&(r=n,o=i,n=nt(t),i=nt(e)),o=N({preferredLayouts:[]},o),r=r||[];var a=o.preferredLayouts,s=a.indexOf("straight")!==-1,c;return c=s&&QR(t,e,n,i,o),c||(c=o.connectionEnd&&tP(e,t,i,r),c)||(c=o.connectionStart&&JR(t,e,n,r),c)?c:!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:YR(t,e,n,i,o)}function ZR(t,e,n){return t>=e&&t<=n}function Yv(t,e,n){var i={x:"width",y:"height"};return ZR(e[t],n[t],n[t]+n[i[t]])}function QR(t,e,n,i,r){var o={},a,s;return s=le(t,e),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(a="x"),/left|right/.test(s)&&(a="y"),r.preserveDocking==="target"?Yv(a,i,t)?(o[a]=i[a],[{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y,original:{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y}},{x:i.x,y:i.y}]):null:Yv(a,n,e)?(o[a]=n[a],[{x:n.x,y:n.y},{x:o.x!==void 0?o.x:i.x,y:o.y!==void 0?o.y:i.y,original:{x:o.x!==void 0?o.x:i.x,y:o.y!==void 0?o.y:i.y}}]):null):null}function JR(t,e,n,i){return Tl(t,e,n,i)}function tP(t,e,n,i){var r=i.slice().reverse();return r=Tl(t,e,n,r),r?r.reverse():null}function Tl(t,e,n,i){function r(l){return l.length<3?!0:l.length>4?!1:!!yt(l,function(u,h){var d=l[h-1];return d&&kr(u,d)<3})}function o(l,u,h){var d=Dn(u,l);switch(d){case"v":return{x:h.x,y:l.y};case"h":return{x:l.x,y:h.y}}return{x:l.x,y:l.y}}function a(l,u,h){var d;for(d=l.length-2;d!==0;d--)if(Cu(l[d],u,Uv)||Cu(l[d],h,Uv))return l.slice(d);return l}if(r(i))return null;var s=i[0],c=i.slice(),p;return c[0]=n,c[1]=o(c[1],s,n),p=a(c,t,e),p!==c&&(c=Tl(t,e,n,p)),c&&Dn(c)?null:c}function eP(t,e){if(Xv(e))return e;switch(t){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return e}}function nP(t){return t&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(t)}function Xv(t){return t&&/t|r|b|l/.test(t)}function iP(t){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"}[t]}function Zv(t,e,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:t,x:t.x,y:e.y};if(n==="r")return{original:t,x:e.x+e.width,y:t.y};if(n==="b")return{original:t,x:t.x,y:e.y+e.height};if(n==="l")return{original:t,x:e.x,y:t.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Qv(t){return t.reduce(function(e,n,i){var r=e[e.length-1],o=t[i+1];return uc(r,o,n,0)||e.push(n),e},[])}var rP=-10,oP=40,Al={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},Ds={top:"t",right:"r",bottom:"b",left:"l"};function Ml(){}q(Ml,Wv),Ml.prototype.layoutConnection=function(t,e){e||(e={});var n=e.source||t.source,i=e.target||t.target,r=e.waypoints||t.waypoints,o=e.connectionStart,a=e.connectionEnd,s,c;return o||(o=Jv(r&&r[0],n)),a||(a=Jv(r&&r[r.length-1],i)),(y(t,"bpmn:Association")||y(t,"bpmn:DataAssociation"))&&r&&!ty(n,i)?[].concat([o],r.slice(1,-1),[a]):(y(t,"bpmn:MessageFlow")?s=sP(n,i):(y(t,"bpmn:SequenceFlow")||ty(n,i))&&(n===i?s={preferredLayouts:mP(n,t)}:y(n,"bpmn:BoundaryEvent")?s={preferredLayouts:vP(n,i,a)}:Ro(n)||Ro(i)?s=pP(n):y(n,"bpmn:Gateway")?s={preferredLayouts:["v:h"]}:y(i,"bpmn:Gateway")?s={preferredLayouts:["h:v"]}:s={preferredLayouts:["h:h"]}),s&&(s=N(s,e),c=Qv(XR(n,i,o,a,r,s))),c||[o,a])};function aP(t){var e=t.host;return le(nt(t),e,rP)}function sP(t,e){return{preferredLayouts:["straight","v:v"],preserveDocking:cP(t,e)}}function cP(t,e){return y(e,"bpmn:Participant")?"source":y(t,"bpmn:Participant")?"target":Ro(e)?"source":Ro(t)||y(e,"bpmn:Event")?"target":y(t,"bpmn:Event")?"source":null}function pP(t){return{preferredLayouts:["straight","h:h"],preserveDocking:lP(t)}}function lP(t){return Ro(t)?"target":"source"}function Jv(t,e){return t?t.original||t:nt(e)}function ty(t,e){return y(e,"bpmn:Activity")&&y(t,"bpmn:BoundaryEvent")&&e.businessObject.isForCompensation}function Ro(t){return y(t,"bpmn:SubProcess")&&vt(t)}function Po(t,e){return t===e}function uP(t,e){return e.indexOf(t)!==-1}function ko(t){var e=/right|left/.exec(t);return e&&e[0]}function Gi(t){var e=/top|bottom/.exec(t);return e&&e[0]}function hP(t,e){return Al[t]===e}function dP(t,e){var n=ko(t),i=Al[n];return e.indexOf(i)!==-1}function fP(t,e){var n=Gi(t),i=Al[n];return e.indexOf(i)!==-1}function Dl(t){return t==="right"||t==="left"}function mP(t,e){var n=e.waypoints,i=n&&n.length&&le(n[0],t);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function vP(t,e,n){var i=nt(t),r=nt(e),o=aP(t),a,s,c=Po(t.host,e),p=uP(o,["top","right","bottom","left"]),l=le(r,i,{x:t.width/2+e.width/2,y:t.height/2+e.height/2});return c?yP(o,p,t,e,n):(a=gP(o,l,p),s=bP(o,l,p),[a+":"+s])}function yP(t,e,n,i,r){var o=e?t:Gi(t),a=Ds[o],s;return e?Dl(t)?s=ey("y",n,i,r)?"h":"b":s=ey("x",n,i,r)?"v":"l":s="v",[a+":"+s]}function ey(t,e,n,i){var r=oP;return!(Bl(t,i,n,r)||Bl(t,i,{x:n.x+n.width,y:n.y+n.height},r)||Bl(t,i,nt(e),r))}function Bl(t,e,n,i){return Math.abs(e[t]-n[t])<i}function gP(t,e,n){return n?Ds[t]:Po(Gi(t),Gi(e))||hP(ko(t),ko(e))?Ds[Gi(t)]:Ds[ko(t)]}function bP(t,e,n){return n?Dl(t)?dP(t,e)||Po(t,e)?"h":"v":fP(t,e)||Po(t,e)?"v":"h":Dl(e)||Po(Gi(t),Gi(e))&&ko(e)?"h":"v"}function ny(t){return N({original:t.point.original||t.point},t.actual)}function bi(t,e){this._elementRegistry=t,this._graphicsFactory=e}bi.$inject=["elementRegistry","graphicsFactory"],bi.prototype.getCroppedWaypoints=function(t,e,n){e=e||t.source,n=n||t.target;var i=this.getDockingPoint(t,e,!0),r=this.getDockingPoint(t,n),o=t.waypoints.slice(i.idx+1,r.idx);return o.unshift(ny(i)),o.push(ny(r)),o},bi.prototype.getDockingPoint=function(t,e,n){var i=t.waypoints,r,o,a;return r=n?0:i.length-1,o=i[r],a=this._getIntersection(e,t,n),{point:o,actual:a||o,idx:r}},bi.prototype._getIntersection=function(t,e,n){var i=this._getShapePath(t),r=this._getConnectionPath(e);return mc(i,r,n)},bi.prototype._getConnectionPath=function(t){return this._graphicsFactory.getConnectionPath(t)},bi.prototype._getShapePath=function(t){return this._graphicsFactory.getShapePath(t)},bi.prototype._getGfx=function(t){return this._elementRegistry.getGraphics(t)};const xP={__init__:["modeling","bpmnUpdater"],__depends__:[CC,GC,WC,UC,$f,oR,pR,uR,yR,bn,jc,_v],bpmnFactory:["type",Je],bpmnUpdater:["type",Te],elementFactory:["type",mi],modeling:["type",he],layouter:["type",Ml],connectionDocking:["type",bi]};var _P=500,EP=1250,wP=1500,Bs=Math.round;function SP(t){return{x:t.x+Bs(t.width/2),y:t.y+Bs(t.height/2)}}function iy(t,e,n,i,r){function o(s,c,p,l){return r.allowed("elements.move",{shapes:s,delta:c,position:p,target:l})}t.on("shape.move.start",wP,function(s){var c=s.context,p=s.shape,l=i.get().slice();l.indexOf(p)===-1&&(l=[p]),l=CP(l),N(c,{shapes:l,validatedShapes:l,shape:p})}),t.on("shape.move.start",EP,function(s){var c=s.context,p=c.validatedShapes,l;if(l=c.canExecute=o(p),!l)return!1}),t.on("shape.move.move",_P,function(s){var c=s.context,p=c.validatedShapes,l=s.hover,u={x:s.dx,y:s.dy},h={x:s.x,y:s.y},d;if(d=o(p,u,h,l),c.delta=u,c.canExecute=d,d===null){c.target=null;return}c.target=l}),t.on("shape.move.end",function(s){var c=s.context,p=c.delta,l=c.canExecute,u=l==="attach",h=c.shapes;if(l===!1)return!1;p.x=Bs(p.x),p.y=Bs(p.y),!(p.x===0&&p.y===0)&&n.moveElements(h,p,c.target,{primaryShape:c.shape,attach:u})}),t.on("element.mousedown",function(s){if(ai(s)){var c=nr(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,p,l){if(oe(p)&&(l=p,p=!1),!(c.waypoints||!c.parent)&&!ht(s.target).has("djs-hit-no-move")){var u=SP(c);return e.init(s,u,"shape.move",{cursor:"grabbing",autoActivate:p,data:{shape:c,context:l||{}}}),!0}}this.start=a}iy.$inject=["eventBus","dragging","modeling","selection","rules"];function CP(t){var e=Bo(t,"id");return ct(t,function(n){for(;n=n.parent;)if(e[n.id])return!1;return!0})}var ry=499,Nl="djs-dragging",oy="drop-ok",ay="drop-not-ok",sy="new-parent",cy="attach-ok";function py(t,e,n,i){function r(c){var p=o(c),l=RP(p);return l}function o(c){var p=Rr(c,!0),l=be(p,function(u){return(u.incoming||[]).concat(u.outgoing||[])});return Ys(p.concat(l))}function a(c,p){[cy,oy,ay,sy].forEach(function(l){l===p?e.addMarker(c,l):e.removeMarker(c,l)})}function s(c,p,l){i.addDragger(p,c.dragGroup),l&&e.addMarker(p,Nl),c.allDraggedElements?c.allDraggedElements.push(p):c.allDraggedElements=[p]}t.on("shape.move.start",ry,function(c){var p=c.context,l=p.shapes,u=p.allDraggedElements,h=r(l);if(!p.dragGroup){var d=Z("g");Y(d,n.cls("djs-drag-group",["no-events"]));var f=e.getActiveLayer();tt(f,d),p.dragGroup=d}h.forEach(function(v){i.addDragger(v,p.dragGroup)}),u?u=Ys([u,o(l)]):u=o(l),k(u,function(v){e.addMarker(v,Nl)}),p.allDraggedElements=u,p.differentParents=PP(l)}),t.on("shape.move.move",ry,function(c){var p=c.context,l=p.dragGroup,u=p.target,h=p.shape.parent,d=p.canExecute;u&&(d==="attach"?a(u,cy):p.canExecute&&u&&u.id!==h.id?a(u,sy):a(u,p.canExecute?oy:ay)),ke(l,c.dx,c.dy)}),t.on(["shape.move.out","shape.move.cleanup"],function(c){var p=c.context,l=p.target;l&&a(l,null)}),t.on("shape.move.cleanup",function(c){var p=c.context,l=p.allDraggedElements,u=p.dragGroup;k(l,function(h){e.removeMarker(h,Nl)}),u&&Gt(u)}),this.makeDraggable=s}py.$inject=["eventBus","canvas","styles","previewSupport"];function RP(t){var e=ct(t,function(n){return Dt(n)?yt(t,hn({id:n.source.id}))&&yt(t,hn({id:n.target.id})):!0});return e}function PP(t){return nk(Bo(t,function(e){return e.parent&&e.parent.id}))!==1}const kP={__depends__:[zr,bn,jh,_n,$n,Zr],__init__:["move","movePreview"],move:["type",iy],movePreview:["type",py]};var ly=".djs-palette-toggle",uy=".entry",TP=ly+", "+uy,Ol="djs-palette-",AP="shown",jl="open",hy="two-column",MP=1e3;function Yt(t,e){this._eventBus=t,this._canvas=e;var n=this;t.on("tool-manager.update",function(i){var r=i.tool;n.updateToolHighlight(r)}),t.on("i18n.changed",function(){n._update()}),t.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}Yt.$inject=["eventBus","canvas"],Yt.prototype.registerProvider=function(t,e){e||(e=t,t=MP),this._eventBus.on("palette.getProviders",t,function(n){n.providers.push(e)}),this._rebuild()},Yt.prototype.getEntries=function(){var t=this._getProviders();return t.reduce(BP,{})},Yt.prototype._rebuild=function(){if(this._diagramInitialized){var t=this._getProviders();t.length&&(this._container||this._init(),this._update())}},Yt.prototype._init=function(){var t=this,e=this._eventBus,n=this._getParentContainer(),i=this._container=Mt(Yt.HTML_MARKUP);n.appendChild(i),te(n).add(Ol+AP),Re.bind(i,TP,"click",function(r){var o=r.delegateTarget;if(Js(o,ly))return t.toggle();t.trigger("click",r)}),J.bind(i,"mousedown",function(r){r.stopPropagation()}),Re.bind(i,uy,"dragstart",function(r){t.trigger("dragstart",r)}),e.on("canvas.resized",this._layoutChanged,this),e.fire("palette.create",{container:i})},Yt.prototype._getProviders=function(t){var e=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Yt.prototype._toggleState=function(t){t=t||{};var e=this._getParentContainer(),n=this._container,i=this._eventBus,r,o=te(n),a=te(e);"twoColumn"in t?r=t.twoColumn:r=this._needsCollapse(e.clientHeight,this._entries||{}),o.toggle(hy,r),a.toggle(Ol+hy,r),"open"in t&&(o.toggle(jl,t.open),a.toggle(Ol+jl,t.open)),i.fire("palette.changed",{twoColumn:r,open:this.isOpen()})},Yt.prototype._update=function(){var t=At(".djs-palette-entries",this._container),e=this._entries=this.getEntries();Lo(t),k(e,function(n,i){var r=n.group||"default",o=At("[data-group="+Fr(r)+"]",t);o||(o=Mt('<div class="group"></div>'),fe(o,"data-group",r),t.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),s=Mt(a);if(o.appendChild(s),!n.separator&&(fe(s,"data-action",i),n.title&&fe(s,"title",n.title),n.className&&DP(s,n.className),n.imageUrl)){var c=Mt("<img>");fe(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()},Yt.prototype.trigger=function(t,e,n){var i,r,o=e.delegateTarget||e.target;return o?(i=fe(o,"data-action"),r=e.originalEvent||e,this.triggerEntry(i,t,r,n)):e.preventDefault()},Yt.prototype.triggerEntry=function(t,e,n,i){var r=this._entries,o,a;if(o=r[t],!!o&&(a=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(pe(a)){if(e==="click")return a(n,i)}else if(a[e])return a[e](n,i);n.preventDefault()}},Yt.prototype._layoutChanged=function(){this._toggleState({})},Yt.prototype._needsCollapse=function(t,e){var n=50,i=Object.keys(e).length*46;return t<i+n},Yt.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},Yt.prototype.open=function(){this._toggleState({open:!0})},Yt.prototype.toggle=function(){this.isOpen()?this.close():this.open()},Yt.prototype.isActiveTool=function(t){return t&&this._activeTool===t},Yt.prototype.updateToolHighlight=function(t){var e,n;this._toolsContainer||(e=At(".djs-palette-entries",this._container),this._toolsContainer=At("[data-group=tools]",e)),n=this._toolsContainer,k(n.children,function(i){var r=i.getAttribute("data-action");if(r){var o=te(i);r=r.replace("-tool",""),o.contains("entry")&&r===t?o.add("highlighted-entry"):o.remove("highlighted-entry")}})},Yt.prototype.isOpen=function(){return te(this._container).has(jl)},Yt.prototype._getParentContainer=function(){return this._canvas.getContainer()},Yt.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function DP(t,e){var n=te(t),i=lt(e)?e:e.split(/\s+/g);i.forEach(function(r){n.add(r)})}function BP(t,e){var n=e.getPaletteEntries();return pe(n)?n(t):(k(n,function(i,r){t[r]=i}),t)}const NP={__init__:["palette"],palette:["type",Yt]};var dy="crosshair";function Vi(t,e,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this,c={create:function(p){var l=e.getActiveLayer(),u;u=p.frame=Z("rect"),Y(u,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),tt(l,u)},update:function(p){var l=p.frame,u=p.bbox;Y(l,{x:u.x,y:u.y,width:u.width,height:u.height})},remove:function(p){p.frame&&Gt(p.frame)}};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),t.on("lasso.selection.end",function(p){var l=p.originalEvent.target;!p.hover&&!(l instanceof SVGElement)||t.once("lasso.selection.ended",function(){s.activateLasso(p.originalEvent,!0)})}),t.on("lasso.end",function(p){var l=Ll(p),u=i.filter(function(h){return h});s.select(u,l)}),t.on("lasso.start",function(p){var l=p.context;l.bbox=Ll(p),c.create(l)}),t.on("lasso.move",function(p){var l=p.context;l.bbox=Ll(p),c.update(l)}),t.on("lasso.cleanup",function(p){var l=p.context;c.remove(l)}),t.on("element.mousedown",1500,function(p){if(Bc(p))return s.activateLasso(p.originalEvent),!0})}Vi.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Vi.prototype.activateLasso=function(t,e){this._dragging.init(t,"lasso",{autoActivate:e,cursor:dy,data:{context:{}}})},Vi.prototype.activateSelection=function(t,e){this._dragging.init(t,"lasso.selection",{trapClick:!1,autoActivate:e,cursor:dy,data:{context:{}}})},Vi.prototype.select=function(t,e){var n=Vg(t,e);this._selection.select(iu(n))},Vi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();this.activateSelection(t,!!t)},Vi.prototype.isActive=function(){var t=this._dragging.context();return t&&/^lasso/.test(t.prefix)};function Ll(t){var e={x:t.x-t.dx,y:t.y-t.dy},n={x:t.x,y:t.y},i;return e.x<=n.x&&e.y<n.y||e.x<n.x&&e.y<=n.y?i={x:e.x,y:e.y,width:n.x-e.x,height:n.y-e.y}:e.x>=n.x&&e.y<n.y||e.x>n.x&&e.y<=n.y?i={x:n.x,y:e.y,width:e.x-n.x,height:n.y-e.y}:e.x<=n.x&&e.y>n.y||e.x<n.x&&e.y>=n.y?i={x:e.x,y:n.y,width:n.x-e.x,height:e.y-n.y}:e.x>=n.x&&e.y>n.y||e.x>n.x&&e.y>=n.y?i={x:n.x,y:n.y,width:e.x-n.x,height:e.y-n.y}:i={x:n.x,y:n.y,width:0,height:0},i}const OP={__depends__:[fs,Jr],__init__:["lassoTool"],lassoTool:["type",Vi]};var Il=1500,fy="grab";function gr(t,e,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"}),t.on("element.mousedown",Il,function(c){if(ir(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(Il,function(c){if(!(!my(c.keyEvent)||a.isActive())){var p=a._mouse.getLastMoveEvent();a.activateMove(p,!!p)}},"keyboard.keydown"),s&&s.addListener(Il,function(c){!my(c.keyEvent)||!a.isActive()||a.toggle()},"keyboard.keyup"),t.on("hand.end",function(c){var p=c.originalEvent.target;if(!c.hover&&!(p instanceof SVGElement))return!1;t.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),t.on("hand.move.move",function(c){var p=e.viewbox().scale;e.scroll({dx:c.dx*p,dy:c.dy*p})}),t.on("hand.move.end",function(c){var p=c.context,l=p.reactivate;return!ir(c)&&l&&t.once("hand.move.ended",function(u){a.activateHand(u.originalEvent,!0,!0)}),!1})}gr.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],gr.prototype.activateMove=function(t,e,n){typeof e=="object"&&(n=e,e=!1),this._dragging.init(t,"hand.move",{autoActivate:e,cursor:fy,data:{context:n||{}}})},gr.prototype.activateHand=function(t,e,n){this._dragging.init(t,"hand",{trapClick:!1,autoActivate:e,cursor:fy,data:{context:{reactivate:n}}})},gr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();this.activateHand(t,!!t)},gr.prototype.isActive=function(){var t=this._dragging.context();return t?/^(hand|hand\.move)$/.test(t.prefix):!1};function my(t){return ne("Space",t)}const jP={__depends__:[fs,Jr],__init__:["handTool"],handTool:["type",gr]};var vy="connect-ok",yy="connect-not-ok";function br(t,e,n,i,r,o,a){var s=this;this._dragging=e,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),t.on("global-connect.hover",function(c){var p=c.context,l=c.hover,u=p.canStartConnect=s.canStartConnect(l);u!==null&&(p.startTarget=l,i.addMarker(l,u?vy:yy))}),t.on(["global-connect.out","global-connect.cleanup"],function(c){var p=c.context.startTarget,l=c.context.canStartConnect;p&&i.removeMarker(p,l?vy:yy)}),t.on(["global-connect.ended"],function(c){var p=c.context,l=p.startTarget,u={x:c.x,y:c.y},h=s.canStartConnect(l);if(h)return t.once("element.out",function(){t.once(["connect.ended","connect.canceled"],function(){t.fire("global-connect.drag.ended")}),n.start(null,l,u)}),!1})}br.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],br.prototype.start=function(t,e){this._dragging.init(t,"global-connect",{autoActivate:e,trapClick:!1,data:{context:{}}})},br.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();return this.start(t,!!t)},br.prototype.isActive=function(){var t=this._dragging.context();return t&&/^global-connect/.test(t.prefix)},br.prototype.canStartConnect=function(t){return this._rules.allowed("connection.start",{source:t})};const LP={__depends__:[dp,_n,$n,fs,Jr],globalConnect:["type",br]};function $l(t,e,n,i,r,o,a,s){this._palette=t,this._create=e,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,t.registerProvider(this)}$l.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],$l.prototype.getPaletteEntries=function(){var t={},e=this._create,n=this._elementFactory,i=this._spaceTool,r=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(u,h,d,f,v){function g(E){var _=n.createShape(N({type:u},v));if(v){var x=gt(_);x.isExpanded=v.isExpanded}e.start(E,_)}var R=u.replace(/^bpmn:/,"");return{group:h,className:d,title:f||s("Create {type}",{type:R}),action:{dragstart:g,click:g}}}function p(u){var h=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),d=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:h});e.start(u,[h,d],{hints:{autoSelect:[h]}})}function l(u){e.start(u,n.createParticipantShape())}return N(t,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate the hand tool"),action:{click:function(u){o.activateHand(u)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate the lasso tool"),action:{click:function(u){r.activateSelection(u)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate the create/remove space tool"),action:{click:function(u){i.activateSelection(u)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate the global connect tool"),action:{click:function(u){a.start(u)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create StartEvent")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create Intermediate/Boundary Event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create EndEvent")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create Gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create Task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create DataObjectReference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create DataStoreReference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded SubProcess"),action:{dragstart:p,click:p}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create Pool/Participant"),action:{dragstart:l,click:l}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create Group"))}),t};const IP={__depends__:[NP,Oa,_v,OP,jP,LP,ua],__init__:["paletteProvider"],paletteProvider:["type",$l]};var $P=250;function zl(t,e,n,i,r){V.call(this,t);function o(s){var c=s.canExecute.replacements;k(c,function(p){var l=p.oldElementId,u={type:p.newElementType};if(!s.visualReplacements[l]){var h=e.get(l);N(u,{x:h.x,y:h.y});var d=n.createShape(u);i.addShape(d,h.parent);var f=At('[data-element-id="'+Fr(h.id)+'"]',s.dragGroup);f&&Y(f,{display:"none"});var v=r.addDragger(d,s.dragGroup);s.visualReplacements[l]=v,i.removeShape(d)}})}function a(s){var c=s.visualReplacements;k(c,function(p,l){var u=At('[data-element-id="'+Fr(l)+'"]',s.dragGroup);u&&Y(u,{display:"inline"}),p.remove(),c[l]&&delete c[l]})}t.on("shape.move.move",$P,function(s){var c=s.context,p=c.canExecute;c.visualReplacements||(c.visualReplacements={}),p&&p.replacements?o(c):a(c)})}zl.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],q(zl,V);const zP={__depends__:[Zr],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",zl]};var FP=1250,Fl=40,HP=20,GP=10,gy=20,by=["x","y"],VP=Math.abs;function xy(t){t.on(["connect.hover","connect.move","connect.end"],FP,function(e){var n=e.context,i=n.canExecute,r=n.start,o=n.hover,a=n.source,s=n.target;e.originalEvent&&je(e.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),i&&o&&WP(e,o,YP(o)),o&&KP(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Ke(r),dt(o,["bpmn:Event","bpmn:Gateway"])&&_y(e,Ke(o)),dt(o,["bpmn:Task","bpmn:SubProcess"])&&UP(e,o),y(a,"bpmn:BoundaryEvent")&&s===a.host&&qP(e)):Ey(i,"bpmn:MessageFlow")?(y(r,"bpmn:Event")&&(n.connectionStart=Ke(r)),y(o,"bpmn:Event")&&_y(e,Ke(o))):n.connectionStart=n.initialConnectionStart)})}xy.$inject=["eventBus"];function WP(t,e,n){by.forEach(function(i){var r=wy(i,e);t[i]<e[i]+n?Kt(t,i,e[i]+n):t[i]>e[i]+r-n&&Kt(t,i,e[i]+r-n)})}function UP(t,e){var n=Ke(e);by.forEach(function(i){XP(t,e,i)&&Kt(t,i,n[i])})}function qP(t){var e=t.context,n=e.source,i=e.target;if(!ZP(e)){var r=Ke(n),o=le(r,i,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach(function(s){var c=t[s],p;VP(c-r[s])<Fl&&(c>r[s]?p=r[s]+Fl:p=r[s]-Fl,Kt(t,s,p))})}}function _y(t,e){Kt(t,"x",e.x),Kt(t,"y",e.y)}function Ey(t,e){return t&&t.type===e}function KP(t,e){return kn(e,function(n){return Ey(t,n)})}function wy(t,e){return t==="x"?e.width:e.height}function YP(t){return y(t,"bpmn:Task")?GP:HP}function XP(t,e,n){return t[n]>e[n]+gy&&t[n]<e[n]+wy(n,e)-gy}function ZP(t){var e=t.hover,n=t.source;return e&&n&&e===n}function xi(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}xi.prototype.getSnapOrigin=function(t){return this._snapOrigins[t]},xi.prototype.setSnapOrigin=function(t,e){this._snapOrigins[t]=e,this._snapLocations.indexOf(t)===-1&&this._snapLocations.push(t)},xi.prototype.addDefaultSnap=function(t,e){var n=this._defaultSnaps[t];n||(n=this._defaultSnaps[t]=[]),n.push(e)},xi.prototype.getSnapLocations=function(){return this._snapLocations},xi.prototype.setSnapLocations=function(t){this._snapLocations=t},xi.prototype.pointsForTarget=function(t){var e=t.id||t,n=this._targets[e];return n||(n=this._targets[e]=new Ns,n.initDefaults(this._defaultSnaps)),n};function Ns(){this._snapValues={}}Ns.prototype.add=function(t,e){var n=this._snapValues[t];n||(n=this._snapValues[t]={x:[],y:[]}),n.x.indexOf(e.x)===-1&&n.x.push(e.x),n.y.indexOf(e.y)===-1&&n.y.push(e.y)},Ns.prototype.snap=function(t,e,n,i){var r=this._snapValues[e];return r&&vE(t[n],r[n],i)},Ns.prototype.initDefaults=function(t){var e=this;k(t||{},function(n,i){k(n,function(r){e.add(i,r)})})};var QP=1250;function wn(t,e,n){var i=this;this._elementRegistry=t,e.on(["create.start","shape.move.start"],function(r){i.initSnap(r)}),e.on(["create.move","create.end","shape.move.move","shape.move.end"],QP,function(r){var o=r.context,a=o.shape,s=o.snapContext,c=o.target;if(!(r.originalEvent&&je(r.originalEvent))&&!(hr(r)||!c)){var p=s.pointsForTarget(c);p.initialized||(p=i.addSnapTargetPoints(p,a,c),p.initialized=!0),n.snap(r,p)}}),e.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}wn.$inject=["elementRegistry","eventBus","snapping"],wn.prototype.initSnap=function(t){var e=this._elementRegistry,n=t.context,i=n.shape,r=n.snapContext;r||(r=n.snapContext=new xi);var o;e.get(i.id)?o=Ke(i,t):o={x:t.x+Ke(i).x,y:t.y+Ke(i).y};var a={x:o.x-i.width/2,y:o.y-i.height/2},s={x:o.x+i.width/2,y:o.y+i.height/2};return r.setSnapOrigin("mid",{x:o.x-t.x,y:o.y-t.y}),xt(i)||(r.setSnapOrigin("top-left",{x:a.x-t.x,y:a.y-t.y}),r.setSnapOrigin("bottom-right",{x:s.x-t.x,y:s.y-t.y})),r},wn.prototype.addSnapTargetPoints=function(t,e,n){var i=this.getSnapTargets(e,n);return k(i,function(r){if(xt(r)){xt(e)&&t.add("mid",Ke(r));return}if(Dt(r)){if(r.waypoints.length<3)return;var o=r.waypoints.slice(1,-1);k(o,function(a){t.add("mid",a)});return}t.add("mid",Ke(r))}),!it(e.x)||!it(e.y)||this._elementRegistry.get(e.id)&&t.add("mid",Ke(e)),t},wn.prototype.getSnapTargets=function(t,e){return df(e).filter(function(n){return!JP(n)})};function JP(t){return!!t.hidden}var Sy=1500;function xr(t,e){e.invoke(wn,this),t.on(["create.move","create.end"],Sy,i2),t.on(["create.move","create.end","shape.move.move","shape.move.end"],Sy,function(n){var i=n.context,r=i.canExecute,o=i.target,a=r&&(r==="attach"||r.attach);a&&!hr(n)&&t2(n,o)})}q(xr,wn),xr.$inject=["eventBus","injector"],xr.prototype.initSnap=function(t){var e=wn.prototype.initSnap.call(this,t),n=t.shape,i=!!this._elementRegistry.get(n.id);return k(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,e.setSnapOrigin(r.id+"-docking",Ry(o,i,t))}),k(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,e.setSnapOrigin(r.id+"-docking",Ry(o,i,t))}),y(n,"bpmn:Participant")&&e.setSnapLocations(["top-left","bottom-right","mid"]),e},xr.prototype.addSnapTargetPoints=function(t,e,n){wn.prototype.addSnapTargetPoints.call(this,t,e,n);var i=this.getSnapTargets(e,n);k(i,function(o){(n2(o)||e2([e,o],"bpmn:TextAnnotation"))&&(t.add("top-left",uf(o)),t.add("bottom-right",hf(o)))});var r=this._elementRegistry;return k(e.incoming,function(o){if(r.get(e.id)){Cy(i,o.source)||t.add("mid",nt(o.source));var a=o.waypoints[0];t.add(o.id+"-docking",a.original||a)}}),k(e.outgoing,function(o){if(r.get(e.id)){Cy(i,o.target)||t.add("mid",nt(o.target));var a=o.waypoints[o.waypoints.length-1];t.add(o.id+"-docking",a.original||a)}}),y(n,"bpmn:SequenceFlow")&&(t=this.addSnapTargetPoints(t,e,n.parent)),t},xr.prototype.getSnapTargets=function(t,e){return wn.prototype.getSnapTargets.call(this,t,e).filter(function(n){return!y(n,"bpmn:Lane")})};function t2(t,e){var n=X(e),i=tv(t,e),r=t.context,o=r.shape,a;o.parent?a={x:0,y:0}:a=nt(o),/top/.test(i)?Kt(t,"y",n.top-a.y):/bottom/.test(i)&&Kt(t,"y",n.bottom-a.y),/left/.test(i)?Kt(t,"x",n.left-a.x):/right/.test(i)&&Kt(t,"x",n.right-a.x)}function e2(t,e){return t.every(function(n){return y(n,e)})}function n2(t){return y(t,"bpmn:SubProcess")&&vt(t)?!0:y(t,"bpmn:Participant")}function i2(t){var e=t.context,n=e.createConstraints;if(n){var i=n.top,r=n.right,o=n.bottom,a=n.left;(a&&a>=t.x||r&&r<=t.x)&&Kt(t,"x",t.x),(i&&i>=t.y||o&&o<=t.y)&&Kt(t,"y",t.y)}}function Cy(t,e){return t.indexOf(e)!==-1}function Ry(t,e,n){return e?{x:t.x-n.x,y:t.y-n.y}:{x:t.x,y:t.y}}var r2=1250;function To(t,e){var n=this;t.on(["resize.start"],function(i){n.initSnap(i)}),t.on(["resize.move","resize.end"],r2,function(i){var r=i.context,o=r.shape,a=o.parent,s=r.direction,c=r.snapContext;if(!(i.originalEvent&&je(i.originalEvent))&&!hr(i)){var p=c.pointsForTarget(a);p.initialized||(p=n.addSnapTargetPoints(p,o,a,s),p.initialized=!0),s2(s)&&Kt(i,"x",i.x),c2(s)&&Kt(i,"y",i.y),e.snap(i,p)}}),t.on(["resize.cleanup"],function(){e.hide()})}To.prototype.initSnap=function(t){var e=t.context,n=e.shape,i=e.direction,r=e.snapContext;r||(r=e.snapContext=new xi);var o=Py(n,i);return r.setSnapOrigin("corner",{x:o.x-t.x,y:o.y-t.y}),r},To.prototype.addSnapTargetPoints=function(t,e,n,i){var r=this.getSnapTargets(e,n);return k(r,function(o){t.add("corner",hf(o)),t.add("corner",uf(o))}),t.add("corner",Py(e,i)),t},To.$inject=["eventBus","snapping"],To.prototype.getSnapTargets=function(t,e){return df(e).filter(function(n){return!o2(n,t)&&!Dt(n)&&!a2(n)&&!xt(n)})};function Py(t,e){var n=nt(t),i=X(t),r={x:n.x,y:n.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}function o2(t,e){return t.host===e}function a2(t){return!!t.hidden}function s2(t){return t==="n"||t==="s"}function c2(t){return t==="e"||t==="w"}var p2=7,l2=1e3;function _i(t){this._canvas=t,this._asyncHide=eg(Ce(this.hide,this),l2)}_i.$inject=["canvas"],_i.prototype.snap=function(t,e){var n=t.context,i=n.snapContext,r=i.getSnapLocations(),o={x:hr(t,"x"),y:hr(t,"y")};k(r,function(a){var s=i.getSnapOrigin(a),c={x:t.x+s.x,y:t.y+s.y};if(k(["x","y"],function(p){var l;o[p]||(l=e.snap(c,a,p,p2),l!==void 0&&(o[p]={value:l,originValue:l-s[p]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),k(["x","y"],function(a){var s=o[a];oe(s)&&Kt(t,a,s.originValue)})},_i.prototype._createLine=function(t){var e=this._canvas.getLayer("snap"),n=Z("path");return Y(n,{d:"M0,0 L0,0"}),ht(n).add("djs-snap-line"),tt(e,n),{update:function(i){it(i)?t==="horizontal"?Y(n,{d:"M-100000,"+i+" L+100000,"+i,display:""}):Y(n,{d:"M "+i+",-100000 L "+i+", +100000",display:""}):Y(n,{display:"none"})}}},_i.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},_i.prototype.showSnapLine=function(t,e){var n=this.getSnapLine(t);n&&n.update(e),this._asyncHide()},_i.prototype.getSnapLine=function(t){return this._snapLines||this._createSnapLines(),this._snapLines[t]},_i.prototype.hide=function(){k(this._snapLines,function(t){t.update()})};const u2={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",wn],resizeSnapping:["type",To],snapping:["type",_i]},h2={__depends__:[u2],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",xy],createMoveSnapping:["type",xr]};function rt(t,e,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=t,this._eventBus=e,this._overlays=n,this._selection=i,this._container=Mt(rt.BOX_HTML),this._searchInput=At(rt.INPUT_SELECTOR,this._container),this._resultsContainer=At(rt.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),e.on(["canvas.destroy","diagram.destroy"],this.close,this)}rt.$inject=["canvas","eventBus","overlays","selection"],rt.prototype._bindEvents=function(){var t=this;function e(n,i,r,o){t._eventMaps.push({el:n,type:r,listener:Re.bind(n,i,r,o)})}e(document,"html","click",function(n){t.close()}),e(this._container,rt.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),e(this._container,rt.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),t._scrollToNode(n.delegateTarget),t._preselect(n.delegateTarget)}),e(this._container,rt.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),t._select(n.delegateTarget)}),e(this._container,rt.INPUT_SELECTOR,"keydown",function(n){ne("ArrowUp",n)&&n.preventDefault(),ne("ArrowDown",n)&&n.preventDefault()}),e(this._container,rt.INPUT_SELECTOR,"keyup",function(n){if(ne("Escape",n))return t.close();if(ne("Enter",n)){var i=t._getCurrentResult();return i?t._select(i):t.close()}if(ne("ArrowUp",n))return t._scrollToDirection(!0);if(ne("ArrowDown",n))return t._scrollToDirection();ne(["ArrowLeft","ArrowRight"],n)||t._search(n.delegateTarget.value)})},rt.prototype._unbindEvents=function(){this._eventMaps.forEach(function(t){Re.unbind(t.el,t.type,t.listener)})},rt.prototype._search=function(t){var e=this;if(this._clearResults(),!(!t||t==="")){var n=this._searchProvider.find(t);if(n.length){n.forEach(function(r){var o=r.element.id,a=e._createResultNode(r,o);e._results[o]={element:r.element,node:a}});var i=At(rt.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},rt.prototype._scrollToDirection=function(t){var e=this._getCurrentResult();if(e){var n=t?e.previousElementSibling:e.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},rt.prototype._scrollToNode=function(t){if(!(!t||t===this._getCurrentResult())){var e=t.offsetTop,n=this._resultsContainer.scrollTop,i=e-this._resultsContainer.clientHeight+t.clientHeight;e<n?this._resultsContainer.scrollTop=e:n<i&&(this._resultsContainer.scrollTop=i)}},rt.prototype._clearResults=function(){Lo(this._resultsContainer),this._results=[],this._resetOverlay(),this._eventBus.fire("searchPad.cleared")},rt.prototype._getCurrentResult=function(){return At(rt.RESULT_SELECTED_SELECTOR,this._resultsContainer)},rt.prototype._createResultNode=function(t,e){var n=Mt(rt.RESULT_HTML);return t.primaryTokens.length>0&&ky(n,t.primaryTokens,rt.RESULT_PRIMARY_HTML),ky(n,t.secondaryTokens,rt.RESULT_SECONDARY_HTML),fe(n,rt.RESULT_ID_ATTRIBUTE,e),this._resultsContainer.appendChild(n),n},rt.prototype.registerProvider=function(t){this._searchProvider=t},rt.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,te(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},rt.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,te(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},rt.prototype.toggle=function(){this.isOpen()?this.close():this.open()},rt.prototype.isOpen=function(){return this._open},rt.prototype._preselect=function(t){var e=this._getCurrentResult();if(t!==e){e&&te(e).remove(rt.RESULT_SELECTED_CLASS);var n=fe(t,rt.RESULT_ID_ATTRIBUTE),i=this._results[n].element;te(t).add(rt.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},rt.prototype._select=function(t){var e=fe(t,rt.RESULT_ID_ATTRIBUTE),n=this._results[e].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},rt.prototype._resetOverlay=function(t){if(this._overlayId&&this._overlays.remove(this._overlayId),t){var e=Vt(t),n=d2(e);this._overlayId=this._overlays.add(t,n)}};function d2(t){var e=6,n=t.width+e*2,i=t.height+e*2,r={width:n+"px",height:i+"px"},o=Mt('<div class="'+rt.OVERLAY_CLASS+'"></div>');return se(o,r),{position:{bottom:i-e,right:n-e},show:!0,html:o}}function ky(t,e,n){var i=f2(e),r=Mt(n);r.innerHTML=i,t.appendChild(r)}function f2(t){var e="";return t.forEach(function(n){n.matched?e+='<strong class="'+rt.RESULT_HIGHLIGHT_CLASS+'">'+Ic(n.matched)+"</strong>":e+=Ic(n.normal)}),e!==""?e:null}rt.CONTAINER_SELECTOR=".djs-search-container",rt.INPUT_SELECTOR=".djs-search-input input",rt.RESULTS_CONTAINER_SELECTOR=".djs-search-results",rt.RESULT_SELECTOR=".djs-search-result",rt.RESULT_SELECTED_CLASS="djs-search-result-selected",rt.RESULT_SELECTED_SELECTOR="."+rt.RESULT_SELECTED_CLASS,rt.RESULT_ID_ATTRIBUTE="data-result-id",rt.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",rt.OVERLAY_CLASS="djs-search-overlay",rt.BOX_HTML='<div class="djs-search-container djs-draggable djs-scrollable"><div class="djs-search-input"><input type="text"/></div><div class="djs-search-results"></div></div>',rt.RESULT_HTML='<div class="djs-search-result"></div>',rt.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',rt.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';const m2={__depends__:[va,bn],searchPad:["type",rt]};function Hl(t,e,n){this._elementRegistry=t,this._canvas=n,e.registerProvider(this)}Hl.$inject=["elementRegistry","searchPad","canvas"],Hl.prototype.find=function(t){var e=this._canvas.getRootElement(),n=this._elementRegistry.filter(function(i){return!i.labelTarget});return n=ct(n,function(i){return i!==e}),n=be(n,function(i){return{primaryTokens:Ay(Ue(i),t),secondaryTokens:Ay(i.id,t),element:i}}),n=ct(n,function(i){return Ty(i.primaryTokens)||Ty(i.secondaryTokens)}),n=ln(n,function(i){return Ue(i.element)+i.element.id}),n};function Ty(t){var e=ct(t,function(n){return!!n.matched});return e.length>0}function Ay(t,e){var n=[],i=t;if(!t)return n;t=t.toLowerCase(),e=e.toLowerCase();var r=t.indexOf(e);return r>-1?(r!==0&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,e.length)}),e.length+r<t.length&&n.push({normal:i.substr(e.length+r,t.length)})):n.push({normal:i}),n}const v2={__depends__:[m2],__init__:["bpmnSearch"],bpmnSearch:["type",Hl]};var y2='<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>';function Le(t){jr.call(this,t)}q(Le,jr),Le.Viewer=ci,Le.NavigatedViewer=Gr,Le.prototype.createDiagram=function(){return this.importXML(y2)},Le.prototype.createDiagram=tr(Le.prototype.createDiagram),Le.prototype._interactionModules=[Jh,id,o1,ad],Le.prototype._modelingModules=[k1,jd,Q1,U1,gE,dp,SE,xw,Nf,Oa,Cw,kw,Ww,Kw,Yw,tS,hS,xP,kP,IP,zP,um,h2,v2],Le.prototype._modules=[].concat(ci.prototype._modules,Le.prototype._interactionModules,Le.prototype._modelingModules);function It(t,e){if(e){const n=t.replace(e.type,t);return t+n}return t}const{t:Sn}=tg();function Gl(t,e,n,i,r,o,a,s){this._palette=t,this._create=e,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,t.registerProvider(this)}Gl.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],Gl.prototype.getPaletteEntries=function(){const t={},e=this._create,n=this._elementFactory,i=this._handTool,r=this._globalConnect;function o(s,c,p,l,u){function h(f){const v=n.createShape(N({type:s},u));u&&(v.businessObject.di.isExpanded=u.isExpanded),e.start(f,v)}const d=s.replace(/^bpmn:/,"");return{group:c,className:p,title:l||It("Create {type}",{type:d}),action:{dragstart:h,click:h}}}function a(s){const c=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),p=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:c});e.start(s,[c,p],{hints:{autoSelect:[p]}})}return N(t,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:It(Sn("\u6FC0\u6D3B\u624B\u52A8\u5DE5\u5177")),action:{click:function(s){i.activateHand(s)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:It(Sn("\u6FC0\u6D3B\u5168\u5C40\u8FDE\u63A5\u5DE5\u5177")),action:{click:function(s){r.toggle(s)}}},"create.end-event":o("bpmn:EndEvent","event","bpmn-icon-end-event-none",It(Sn("\u521B\u5EFA\u7ED3\u675F\u8282\u70B9"))),"create.exclusive-gateway":o("bpmn:ExclusiveGateway","event","bpmn-icon-gateway-xor",It(Sn("\u521B\u5EFA\u4E92\u65A5\u7F51\u5173"))),"create.inclusive-gateway":o("bpmn:InclusiveGateway","event","bpmn-icon-gateway-or",It(Sn("\u521B\u5EFA\u76F8\u5BB9\u7F51\u5173"))),"create.parallel-gateway":o("bpmn:ParallelGateway","event","bpmn-icon-gateway-parallel",It(Sn("\u521B\u5EFA\u5E76\u884C\u7F51\u5173"))),"create.user-task":o("bpmn:UserTask","event","bpmn-icon-user",It(Sn("\u521B\u5EFA\u7528\u6237\u8282\u70B9"))),"create.script-task":o("bpmn:ScriptTask","event","bpmn-icon-script",It(Sn("\u521B\u5EFA\u811A\u672C\u8282\u70B9"))),"create.CallActivity":o("bpmn:CallActivity","event","bpmn-icon-call-activity",It(Sn("\u521B\u5EFA\u5916\u90E8\u6D41\u7A0B"))),"create.subprocess-expanded":{group:"event",className:"bpmn-icon-subprocess-expanded",title:It(Sn("\u521B\u5EFA\u5B50\u6D41\u7A0B")),action:{dragstart:a,click:a}}}),t};const g2=1500,b2=2;class Vl extends fn{constructor(e,n,i){super(e,g2),this.bpmnRenderer=n,this.paletteEntries=i}canRender(e){return dt(e,["bpmn:Task","bpmn:Event"])&&!e.labelTarget}drawShape(e,n){const i=this.paletteEntries,r=yt(i,o=>y(n,o.type));return r&&r.drawShape instanceof Function?r.drawShape(e,n,this.bpmnRenderer):this.bpmnRenderer.drawShape(e,n)}getShapePath(e){return y(e,"bpmn:Task")?Ph(e,b2):this.bpmnRenderer.getShapePath(e)}}Jy(Vl,"$inject"),Vl.$inject=["eventBus","bpmnRenderer","config.paletteEntries"];function an(t,e){const n=Os(t);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(e)}function Os(t){return t&&t.businessObject||t}function x2(t){return an(t,"bpmn:CallActivity")?!1:an(t,"bpmn:SubProcess")?!!Os(t).di.isExpanded:an(t,"bpmn:Participant")?!!Os(t).processRef:!0}function _2(t){return t&&!!Os(t).triggeredByEvent}function js(t,e){return kn(e,function(n){return an(t,n)})}function E2(t){return t.children.filter(function(e){return an(e,"bpmn:Lane")})}const{t:Wn}=tg();function Wl(t,e,n,i,r,o,a,s,c,p,l){t=t||{},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,t.autoPlace!==!1&&(this._autoPlace=e.get("autoPlace",!1))}Wl.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","rules"],Wl.prototype.getContextPadEntries=function(t){const e=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._autoPlace,s={};if(t.type==="label")return s;if(an(t,"bpmn:EndEvent")||an(t,"bpmn:SequenceFlow"))return{delete:{group:"event2",className:"bpmn-icon-trash",title:It(Wn("\u5220\u9664")),action:{click:l}},connect:{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}},replace:{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}},"append.gateway":{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}},"append.append-task":{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}},"append.intermediate-event":{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}},"append.text-annotation":{group:"none",className:"bpmn-icon-text-annotation",title:"a",action:{}}};const c=t.businessObject;function p(d,f){r.start(d,f)}function l(){n.removeElements([t])}function u(d,f,v,g){typeof v!="string"&&(g=v,v=It("Append {type}",{type:d.replace(/^bpmn:/,"")}));function R(E,_){const x=i.createShape(N({type:d},g));o.start(E,x,{source:_})}return{group:"event1",className:f,title:v,action:{dragstart:R,click:a?function(E,_){const x=i.createShape(N({type:d},g));a.append(_,x)}:R}}}function h(d){return function(f,v){n.splitLane(v,d),e.open(v,!0)}}if(js(c,["bpmn:Lane","bpmn:Participant"])&&x2(c)&&(E2(t).length<2&&(t.height>=120&&N(s,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:It("Divide into two Lanes"),action:{click:h(2)}}}),t.height>=180&&N(s,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:It("Divide into three Lanes"),action:{click:h(3)}}})),N(s,{})),js(c,["bpmn:Lane","bpmn:Participant"]),an(c,"bpmn:FlowNode")&&(an(c,"bpmn:EventBasedGateway")||My(c,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")||!an(c,"bpmn:EndEvent")&&!c.isForCompensation&&!My(c,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!_2(c)&&N(s,{"append.end-event":u("bpmn:EndEvent","bpmn-icon-end-event-none",It(Wn("\u521B\u5EFA\u7ED3\u675F\u8282\u70B9"))),"append.script-task":u("bpmn:ScriptTask","bpmn-icon-script",It(Wn("\u521B\u5EFA\u811A\u672C\u8282\u70B9"))),"append.user-task":u("bpmn:UserTask","bpmn-icon-user",It(Wn("\u521B\u5EFA\u7528\u6237\u8282\u70B9"))),"append.exclusive-gateway":u("bpmn:ExclusiveGateway","bpmn-icon-gateway-xor",It(Wn("\u4E92\u65A5\u7F51\u5173"))),"append.inclusive-gateway":u("bpmn:InclusiveGateway","bpmn-icon-gateway-or",It(Wn("\u76F8\u5BB9\u7F51\u5173"))),"append.parallel-gateway":u("bpmn:ParallelGateway","bpmn-icon-gateway-parallel",It(Wn("\u5E76\u884C\u7F51\u5173"))),connect:{group:"event2",className:"bpmn-icon-connection-multi",title:It(Wn("\u8FDE\u63A5\u7EBF")),action:{click:p,dragstart:p}},delete:{group:an(t,"bpmn:StartEvent")?"none":"event2",className:"bpmn-icon-trash",title:It(Wn("\u5220\u9664")),action:{click:l}}})),js(c,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])){const d={group:"none",className:"",title:It(""),action:{}};N(s,{"append.text-annotation":d,"append.gateway":d,"append.append-task":d,"append.intermediate-event":d,replace:d})}return s};function My(t,e,n){const i=t.$instanceOf(e);let r=!1;const o=t.eventDefinitions||[];return k(o,function(a){a.$type===n&&(r=!0)}),i&&r}function Dy(t){t.on(["create.init"],function(e){}),t.on(["create.init","shape.move.init"],function(e){const n=e.context,i=e.shape;js(i,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}Dy.$inject=["eventBus"];const w2={__init__:["paletteProvider","customRenderer","customContextPad","bpmnGridSnapping"],paletteProvider:["type",Gl],customRenderer:["type",Vl],customContextPad:["type",Wl],bpmnGridSnapping:["type",Dy]};Oo=function(t){Le.call(this,t),this._customElements=[]},Lt(Oo,Le);const S2=[w2];Oo.prototype._modules=[].concat(Oo.prototype._modules,S2)}));export{Oo as C,ok as __tla};
|