bpmn-embedded-8f5aa63e.js 796 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <<<<<<<< HEAD:dist/assets/bpmn-embedded-8f5aa63e.js
  2. import{_ as AA,__tla as kA}from"./Dialog-386bf3a6.js";import{cU as oo,cS as P0,ds as PA,d as Rt,r as W,aV as ol,K as $h,dt as MA,l as Ma,ax as jn,Q as RA,o as ne,c as De,g as Ve,aD as NA,F as ln,f as R,w as V,a as D,v as Ce,P as ke,n as me,t as M0,x as al,O as un,be as IA,bf as ao,bh as DA,du as BA,C as so,_ as Nt,e as OA,L as mt,bz as Be,V as wn,A as Sn,D as oi,an as zt,ak as R0,a4 as Gh,y as co,z as lo,q as uo,b0 as Ra,aI as LA,cx as jA,M as VA,ad as N0,aP as po,G as sl,H as cl,j as ll,bB as Uh,au as FA,ap as zA,__tla as $A}from"./index-d75b4e4d.js";import{_ as GA,__tla as UA}from"./XTextButton-86a5787a.js";import{_ as ho,__tla as HA}from"./XButton-ba917669.js";import{E as qA,a as WA,__tla as XA}from"./el-collapse-item-a2f15736.js";import{E as Hh,__tla as KA}from"./el-link-84cc8539.js";import{u as I0,__tla as YA}from"./useMessage-ba892ac2.js";import{E as D0,__tla as JA}from"./el-drawer-b4686f56.js";import{a as B0,D as O0,__tla as ZA}from"./dict-f4d7ebb6.js";import{f as mo,__tla as QA}from"./formatTime-35abe1bb.js";let Na,Ia,A,L0,It,qh,Me,Wh,ai,Da,we,Ba,ek=Promise.all([(()=>{try{return kA}catch{}})(),(()=>{try{return $A}catch{}})(),(()=>{try{return UA}catch{}})(),(()=>{try{return HA}catch{}})(),(()=>{try{return XA}catch{}})(),(()=>{try{return KA}catch{}})(),(()=>{try{return YA}catch{}})(),(()=>{try{return JA}catch{}})(),(()=>{try{return ZA}catch{}})(),(()=>{try{return QA}catch{}})()]).then(async()=>{var ul={exports:{}};typeof Object.create=="function"?ul.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ul.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};const ie=oo(ul.exports);var Xh,pl,j0=(Xh=function(e){var t=e.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;var a=r-Math.floor(r),c="";for(o=0;o<Math.floor(r);o++)c=Math.floor(Math.random()*i).toString(i)+c;if(a){var l=Math.pow(i,a);c=Math.floor(Math.random()*l).toString(i)+c}var u=parseInt(c,i);return u!==1/0&&u>=Math.pow(2,n)?t(n,i):c};t.rack=function(n,i,r){var o=function(c){var l=0;do{if(l++>10){if(!r)throw new Error("too many ID collisions, use more bits");n+=r}var u=t(n,i)}while(Object.hasOwnProperty.call(a,u));return a[u]=c,u},a=o.hats={};return o.get=function(c){return o.hats[c]},o.set=function(c,l){return o.hats[c]=l,o},o.bits=n||128,o.base=i||16,o}},Xh(pl={exports:{}},pl.exports),pl.exports);function Cn(e){if(!(this instanceof Cn))return new Cn(e);e=e||[128,36,1],this._seed=e.length?j0.rack(e[0],e[1],e[2]):e}function fo(e){return Array.prototype.concat.apply([],e)}Cn.prototype.next=function(e){return this._seed(e||!0)},Cn.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},Cn.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Cn.prototype.assigned=function(e){return this._seed.get(e)||!1},Cn.prototype.unclaim=function(e){delete this._seed.hats[e]},Cn.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var vo=Object.prototype.toString,V0=Object.prototype.hasOwnProperty;function Vn(e){return e===void 0}function Wt(e){return e!==void 0}function yo(e){return e==null}function ge(e){return vo.call(e)==="[object Array]"}function et(e){return vo.call(e)==="[object Object]"}function pe(e){return vo.call(e)==="[object Number]"}function ft(e){var t=vo.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Dt(e){return vo.call(e)==="[object String]"}function Kh(e){if(!ge(e))throw new Error("must supply array")}function Tn(e,t){return V0.call(e,t)}function Pe(e,t){var n;return t=fl(t),L(e,function(i,r){if(t(i,r))return n=i,!1}),n}function hl(e,t){t=fl(t);var n=ge(e)?-1:void 0;return L(e,function(i,r){if(t(i,r))return n=r,!1}),n}function de(e,t){var n=[];return L(e,function(i,r){t(i,r)&&n.push(i)}),n}function L(e,t){var n;if(!Vn(e)){var i=ge(e)?z0:F0;for(var r in e)if(Tn(e,r)&&t(n=e[r],i(r))===!1)return n}}function Yh(e,t){return Vn(e)?[]:(Kh(e),t=fl(t),e.filter(function(n,i){return!t(n,i)}))}function Bt(e,t,n){return L(e,function(i,r){n=t(n,i,r)}),n}function ji(e,t){return!!Bt(e,function(n,i,r){return n&&t(i,r)},!0)}function si(e,t){return!!Pe(e,t)}function lt(e,t){var n=[];return L(e,function(i,r){n.push(t(i,r))}),n}function go(e){return e&&Object.keys(e)||[]}function yr(e){return go(e).length}function Oa(e){return lt(e,function(t){return t})}function Vi(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=ml(t),L(e,function(i){var r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function dl(e){e=ml(e);for(var t={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return L(i,function(o){return Vi(o,e,t)}),lt(t,function(o,a){return o[0]})}var Jh=dl;function Xt(e,t){t=ml(t);var n=[];return L(e,function(i,r){for(var o=t(i,r),a={d:o,v:i},c=0;c<n.length;c++)if(o<n[c].d)return void n.splice(c,0,a);n.push(a)}),lt(n,function(i){return i.v})}function Kt(e){return function(t){return ji(e,function(n,i){return t[i]===n})}}function ml(e){return ft(e)?e:function(t){return t[e]}}function fl(e){return ft(e)?e:function(t){return t===e}}function F0(e){return e}function z0(e){return Number(e)}function vl(e,t){var n,i,r,o;function a(p){var d=Date.now(),y=p?0:o+t-d;if(y>0)return c(y);e.apply(r,i),l()}function c(p){n=setTimeout(a,p)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function u(){o=Date.now();for(var p=arguments.length,d=new Array(p),y=0;y<p;y++)d[y]=arguments[y];i=d,r=this,n||c(t)}return u.flush=function(){n&&a(!0),l()},u.cancel=l,u}function St(e,t){return e.bind(t)}function yl(e){return yl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yl(e)}function gl(){return gl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},gl.apply(this,arguments)}function z(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return gl.apply(void 0,[e].concat(n))}function Yt(e,t){var n={},i=Object(e);return L(t,function(r){r in i&&(n[r]=e[r])}),n}function Fn(e,t){var n={};return L(Object(e),function(i,r){t.indexOf(r)===-1&&(n[r]=i)}),n}const $0=Object.freeze(Object.defineProperty({__proto__:null,assign:z,bind:St,debounce:vl,ensureArray:Kh,every:ji,filter:de,find:Pe,findIndex:hl,flatten:fo,forEach:L,get:function(e,t,n){var i=e;return L(t,function(r){if(yo(i))return i=void 0,!1;i=i[r]}),Vn(i)?n:i},groupBy:Vi,has:Tn,isArray:ge,isDefined:Wt,isFunction:ft,isNil:yo,isNumber:pe,isObject:et,isString:Dt,isUndefined:Vn,keys:go,map:lt,matchPattern:Kt,merge:function e(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return i.length&&L(i,function(o){o&&et(o)&&L(o,function(a,c){if(c!=="__proto__"){var l=t[c];et(a)?(et(l)||(l={}),t[c]=e(l,a)):t[c]=a}})}),t},omit:Fn,pick:Yt,reduce:Bt,set:function(e,t,n){var i=e;return L(t,function(r,o){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+yl(r)+". Key should be of type number or string.");if(r==="constructor")throw new Error("illegal key: constructor");if(r==="__proto__")throw new Error("illegal key: __proto__");var a=t[o+1],c=i[r];Wt(a)&&yo(c)&&(c=i[r]=isNaN(+a)?{}:[]),Vn(a)?Vn(n)?delete i[r]:i[r]=n:i=c}),e},size:yr,some:si,sortBy:Xt,throttle:function(e,t){var n=!1;return function(){n||(e.apply(void 0,arguments),n=!0,setTimeout(function(){n=!1},t))}},unionBy:Jh,uniqueBy:dl,values:Oa,without:Yh},Symbol.toStringTag,{value:"Module"}));function $t(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var G0=[].indexOf,bl=function(e,t){if(G0)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},U0=/\s+/,H0=Object.prototype.toString;function ot(e){return new ci(e)}function ci(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function La(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}ci.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~bl(t,e)||t.push(e),this.el.className=t.join(" "),this},ci.prototype.remove=function(e){if(H0.call(e)=="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=bl(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},ci.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},ci.prototype.toggle=function(e,t){return this.list?(t!==void 0?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(t!==void 0?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},ci.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(U0);return e[0]===""&&e.shift(),e},ci.prototype.has=ci.prototype.contains=function(e){return this.list?this.list.contains(e):!!~bl(this.array(),e)};var gr=typeof Element<"u"?Element.prototype:{},Zh=gr.matches||gr.matchesSelector||gr.webkitMatchesSelector||gr.mozMatchesSelector||gr.msMatchesSelector||gr.oMatchesSelector,ja=function(e,t){if(!e||e.nodeType!==1)return!1;if(Zh)return Zh.call(e,t);for(var n=e.parentNode.querySelectorAll(t),i=0;i<n.length;i++)if(n[i]==e)return!0;return!1};function Fi(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(ja(i,t))return i;i=i.parentNode}return ja(i,t)?i:null}var Qh=window.addEventListener?"addEventListener":"attachEvent",q0=window.removeEventListener?"removeEventListener":"detachEvent",ed=Qh!=="addEventListener"?"on":"",ce={bind:function(e,t,n,i){return e[Qh](ed+t,n,i||!1),n},unbind:function(e,t,n,i){return e[q0](ed+t,n,i||!1),n}},td=["focus","blur"],xl,Gt={bind:function(e,t,n,i,r){return td.indexOf(n)!==-1&&(r=!0),ce.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Fi(a,t,!0),o.delegateTarget&&i.call(e,o)},r)},unbind:function(e,t,n,i){return td.indexOf(t)!==-1&&(i=!0),ce.unbind(e,t,n,i)}},je=function(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body")return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild);var r,o=at[i]||at._default,a=o[0],c=o[1],l=o[2];for((r=t.createElement("div")).innerHTML=c+e+l;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=t.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},nd=!1;typeof document<"u"&&((xl=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',nd=!xl.getElementsByTagName("link").length,xl=void 0);var at={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:nd?[1,"X<div>","</div>"]:[0,"",""]};function Xe(e,t){return(t=t||document).querySelector(e)}function El(e,t){return(t=t||document).querySelectorAll(e)}function An(e){e.parentNode&&e.parentNode.removeChild(e)}function id(e,t){return t.appendChild(function(n,i){if(n.ownerDocument!==i.ownerDocument)try{return i.ownerDocument.importNode(n,!0)}catch{}return n}(e,t))}function le(e,t){return id(t,e),e}at.td=at.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],at.option=at.optgroup=[1,'<select multiple="multiple">',"</select>"],at.thead=at.tbody=at.colgroup=at.caption=at.tfoot=[1,"<table>","</table>"],at.polyline=at.ellipse=at.polygon=at.circle=at.text=at.line=at.path=at.rect=at.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var _l=2,rd={"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":_l,"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":_l,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function od(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=rd[i];r?(r===_l&&typeof n=="number"&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function K(e,t,n){if(typeof t=="string"){if(n===void 0)return function(i,r){return rd[r]?i.style[r]:i.getAttributeNS(null,r)}(e,t);od(e,t,n)}else(function(i,r){var o,a,c=Object.keys(r);for(o=0;a=c[o];o++)od(i,a,r[a])})(e,t);return e}function wl(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var W0=/\s+/,X0=Object.prototype.toString;function Sl(e){return e!==void 0}function be(e){return new li(e)}function li(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function tt(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Cl(e){for(var t;t=e.firstChild;)tt(t);return e}function ad(e){return e.cloneNode(!0)}li.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~wl(t,e)||t.push(e),Sl(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},li.prototype.remove=function(e){if(X0.call(e)==="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=wl(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},li.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},li.prototype.toggle=function(e,t){return this.list?(Sl(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(Sl(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},li.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(W0);return e[0]===""&&e.shift(),e},li.prototype.has=li.prototype.contains=function(e){return this.list?this.list.contains(e):!!~wl(this.array(),e)};var Tl={svg:"http://www.w3.org/2000/svg"},sd='<svg xmlns="'+Tl.svg+'"';function cd(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Tl.svg)===-1&&(e=sd+e.substring(4)):(e=sd+">"+e+"</svg>",t=!0);var n=function(o){var a;return(a=new DOMParser).async=!1,a.parseFromString(o,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function oe(e,t){var n;return e.charAt(0)==="<"?(n=cd(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Tl.svg,e),t&&K(n,t),n}var Al=null;function kl(){return Al===null&&(Al=oe("svg")),Al}function ld(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function bo(e){return e?kl().createSVGTransformFromMatrix(e):kl().createSVGTransform()}var ud=/([&<>]{1})/g,K0=/([\n\r"]{1})/g,Y0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Pl(e,t){return e.replace(t,function(n,i){return Y0[i]||i})}function pd(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(Pl(e.textContent,ud));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',Pl(o.value,K0),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)pd(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",Pl(e.nodeValue,ud),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function J0(e,t){var n=cd(t);if(Cl(e),t){(function(a){return a.nodeName==="#document-fragment"})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)id(r[o],e)}}function hd(e,t){if(t!==void 0){try{J0(e,t)}catch(n){throw new Error("error parsing SVG: "+n.message)}return e}return function(n){for(var i=n.firstChild,r=[];i;)pd(i,r),i=i.nextSibling;return r.join("")}(e)}function Z0(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function xo(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(i,r){var o,a;for(i.clear(),o=0;a=r[o];o++)i.appendItem(Z0(i,a))}(n,t)),n.consolidate()}var Q0=/^class /;function Ml(e){return Object.prototype.toString.call(e)==="[object Array]"}function Rl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Va(){var e=Array.prototype.slice.call(arguments);e.length===1&&Ml(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var ex=/constructor\s*[^(]*\(\s*([^)]*)\)/m,tx=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,nx=/\/\*([^*]*)\*\//m;function ix(e){if(typeof e!="function")throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(n){return Q0.test(n.toString())}(e)?ex:tx);return t&&t[1]&&t[1].split(",").map(function(n){return(t=n.match(nx))?t[1].trim():n.trim()})||[]}function rx(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}}function Nl(e,t){t=t||{get:function(f,v){if(n.push(f),v===!1)return null;throw a('No provider for "'+f+'"!')}};var n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(f){var v=n.join(" -> ");return n.length=0,new Error(v?f+" (Resolving: "+v+")":f)},c=function(f,v){if(!i[f]&&f.indexOf(".")!==-1){for(var g=f.split("."),b=c(g.shift());g.length;)b=b[g.shift()];return b}if(Rl(r,f))return r[f];if(Rl(i,f)){if(n.indexOf(f)!==-1)throw n.push(f),a("Cannot resolve circular dependency!");return n.push(f),r[f]=i[f][0](i[f][1]),n.pop(),r[f]}return t.get(f,v)},l=function(f,v){if(v===void 0&&(v={}),typeof f!="function"){if(!Ml(f))throw new Error('Cannot invoke "'+f+'". Expected a function!');f=Va(f.slice())}return{fn:f,dependencies:(f.$inject||ix(f)).map(function(g){return Rl(v,g)?v[g]:c(g)})}},u=function(f){var v=l(f),g=v.fn,b=v.dependencies;return new(Function.prototype.bind.apply(g,[null].concat(b)))},p=function(f,v,g){var b=l(f,g),S=b.fn,w=b.dependencies;return S.apply(v,w)},d=function(f){return Va(function(v){return f.get(v)})},y={factory:p,type:u,value:function(f){return f}};e.forEach(function(f){function v(w,_){return w!=="value"&&Ml(_)&&(_=Va(_.slice())),_}if(f instanceof rx)f.forEach(function(w){var _=w[0],C=w[1],B=w[2];i[_]=[y[C],v(C,B),C]});else if(typeof f=="object")if(f.__exports__){var g=Object.keys(f).reduce(function(w,_){return _.substring(0,2)!=="__"&&(w[_]=f[_]),w},Object.create(null)),b=new Nl((f.__modules__||[]).concat([g]),o),S=Va(function(w){return b.get(w)});f.__exports__.forEach(function(w){i[w]=[S,w,"private",b]})}else Object.keys(f).forEach(function(w){if(f[w][2]!=="private"){var _=f[w][0],C=f[w][1];i[w]=[y[_],v(_,C),_]}else i[w]=f[w]})}),this.get=c,this.invoke=p,this.instantiate=u,this.createChild=function(f,v){if(v&&v.length){var g,b,S,w,_=Object.create(null),C=Object.create(null),B=[],s=[],h=[];for(var m in i)g=i[m],v.indexOf(m)!==-1&&(g[2]==="private"?(b=B.indexOf(g[3]))===-1?(S=g[3].createChild([],v),w=d(S),B.push(g[3]),s.push(S),h.push(w),_[m]=[w,m,"private",S]):_[m]=[h[b],m,"private",s[b]]:_[m]=[g[2],g[1]],C[m]=!0),g[2]!=="factory"&&g[2]!=="type"||!g[1].$scope||v.forEach(function(E){g[1].$scope.indexOf(E)!==-1&&(_[m]=[g[2],g[1]],C[E]=!0)});v.forEach(function(E){if(!C[E])throw new Error('No provider for "'+E+'". Cannot use provider from the parent!')}),f.unshift(_)}return new Nl(f,o)}}var ox=1e3;function zn(e,t){var n=this;t=t||ox,e.on(["render.shape","render.connection"],t,function(i,r){var o=i.type,a=r.element,c=r.gfx,l=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(c,a,l):n.drawConnection(c,a,l)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}function br(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function dd(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function Il(e,t){var n=oe("polyline");return K(n,{points:dd(e)}),t&&K(n,t),n}function md(e){return de(e,function(t){return!Pe(e,function(n){return n!==t&&fd(t,n)})})}function fd(e,t){if(t){if(e===t)return t;if(e.parent)return fd(e.parent,t)}}function vd(e,t,n){var i=!n||e.indexOf(t)===-1;return i&&e.push(t),i}function zi(e,t,n){n=n||0,ge(e)||(e=[e]),L(e,function(i,r){var o=t(i,r,n);ge(o)&&o.length&&zi(o,t,n+1)})}function Fa(e,t){return function(n,i,r){var o=[],a=[];return zi(n,function(c,l,u){vd(o,c,i);var p=c.children;if((r===-1||u<r)&&p&&vd(a,p,i))return p}),o}(e,!t,-1)}function vt(e,t){var n,i,r,o;return t=!!t,ge(e)||(e=[e]),L(e,function(a){var c=a;a.waypoints&&!t&&(c=vt(a.waypoints,!0));var l=c.x,u=c.y,p=c.height||0,d=c.width||0;(l<n||n===void 0)&&(n=l),(u<i||i===void 0)&&(i=u),(l+d>r||r===void 0)&&(r=l+d),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:i,height:o-i,width:r-n}}function yd(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function gd(e){return!(!e||!e.isFrame)}function Eo(e,t){return z({},e||{},t||{})}zn.prototype.canRender=function(){},zn.prototype.drawShape=function(){},zn.prototype.drawConnection=function(){},zn.prototype.getShapePath=function(){},zn.prototype.getConnectionPath=function(){};function ui(e,t){zn.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}ie(ui,zn),ui.prototype.canRender=function(){return!0},ui.prototype.drawShape=function(e,t,n){var i=oe("rect");return K(i,{x:0,y:0,width:t.width||0,height:t.height||0}),gd(t)?K(i,z({},this.FRAME_STYLE,n||{})):K(i,z({},this.SHAPE_STYLE,n||{})),le(e,i),i},ui.prototype.drawConnection=function(e,t,n){var i=Il(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return le(e,i),i},ui.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return br([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},ui.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([t===0?"M":"L",n.x,n.y]);return br(r)},ui.$inject=["eventBus","styles"];const ax={__init__:["defaultRenderer"],defaultRenderer:["type",ui],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,i,r){return z(this.style(i,r),{class:n})},this.style=function(n,i){ge(n)||i||(i=n,n=[]);var r=Bt(n,function(o,a){return z(o,e[a]||{})},{});return i?z(r,i):r},this.computeStyle=function(n,i,r){return ge(i)||(r=i,i=[]),t.style(i||[],z({},r,n||{}))}}]};function Ye(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Je(e,t,n){if(e&&t){typeof n!="number"&&(n=-1);var i=e.indexOf(t);if(i!==-1){if(i===n||n===-1)return;e.splice(i,1)}n!==-1?e.splice(n,0,t):e.push(t)}}function Dl(e,t){return e&&t?e.indexOf(t):-1}function _o(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function Bl(e,t,n,i){if(i===void 0&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=_o(e,t);return Math.abs(r/o)<=i}var bd=2;function $n(e,t){var n;return function(i,r){var o;o=ge(i)?i:[i,r];var a=o.slice().shift();return ji(o,function(c){return Math.abs(a.y-c.y)<=bd})}(n=ge(e)?e:[e,t])?"h":!!function(i,r){var o;o=ge(i)?i:[i,r];var a=o.slice().shift();return ji(o,function(c){return Math.abs(a.x-c.x)<=bd})}(n)&&"v"}function xd(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function Ol(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var sx=/,?([a-z]),?/gi,Ed=parseFloat,Ze=Math,pi=Ze.PI,kn=Ze.min,Pn=Ze.max,_d=Ze.pow,hi=Ze.abs,cx=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,lx=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,za=Array.isArray||function(e){return e instanceof Array};function Ll(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wo(e){if(typeof e=="function"||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)Ll(e,n)&&(t[n]=wo(e[n]));return t}function xr(e){var t=xr.ps=xr.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)Ll(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function jl(e,t,n,i){return arguments.length===1&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function wd(){return this.join(",").replace(sx,"$1")}function $a(e){var t=wo(e);return t.toString=wd,t}function Sd(e,t,n,i,r,o,a,c,l){var u=1-l,p=_d(u,3),d=_d(u,2),y=l*l*l,f=p*t+3*d*l*i+3*u*l*l*o+y*c;return{x:Ga(p*e+3*d*l*n+3*u*l*l*r+y*a),y:Ga(f)}}function Cd(e){var t=dx.apply(null,e);return jl(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function di(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Td(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function Ad(e,t,n,i,r,o,a,c,l){l==null&&(l=1);for(var u=(l=l>1?1:l<0?0:l)/2,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],y=0,f=0;f<12;f++){var v=u*p[f]+u,g=Td(v,e,n,r,a),b=Td(v,t,i,o,c),S=g*g+b*b;y+=d[f]*Ze.sqrt(S)}return u*y}function ux(e,t,n,i,r,o,a,c){if(!(Pn(e,n)<kn(r,a)||kn(e,n)>Pn(r,a)||Pn(t,i)<kn(o,c)||kn(t,i)>Pn(o,c))){var l=(e*i-t*n)*(o-c)-(t-i)*(r*c-o*a),u=(e-n)*(o-c)-(t-i)*(r-a);if(u){var p=Ga(((e*i-t*n)*(r-a)-(e-n)*(r*c-o*a))/u),d=Ga(l/u),y=+p.toFixed(2),f=+d.toFixed(2);if(!(y<+kn(e,n).toFixed(2)||y>+Pn(e,n).toFixed(2)||y<+kn(r,a).toFixed(2)||y>+Pn(r,a).toFixed(2)||f<+kn(t,i).toFixed(2)||f>+Pn(t,i).toFixed(2)||f<+kn(o,c).toFixed(2)||f>+Pn(o,c).toFixed(2)))return{x:p,y:d}}}}function Ga(e){return Math.round(1e11*e)/1e11}function px(e,t,n){if(!function(m,E){return m=jl(m),di(E=jl(E),m.x,m.y)||di(E,m.x2,m.y)||di(E,m.x,m.y2)||di(E,m.x2,m.y2)||di(m,E.x,E.y)||di(m,E.x2,E.y)||di(m,E.x,E.y2)||di(m,E.x2,E.y2)||(m.x<E.x2&&m.x>E.x||E.x<m.x2&&E.x>m.x)&&(m.y<E.y2&&m.y>E.y||E.y<m.y2&&E.y>m.y)}(Cd(e),Cd(t)))return n?0:[];for(var i=Ad.apply(0,e),r=Ad.apply(0,t),o=kd(e)?1:~~(i/5)||1,a=kd(t)?1:~~(r/5)||1,c=[],l=[],u={},p=n?0:[],d=0;d<o+1;d++){var y=Sd.apply(0,e.concat(d/o));c.push({x:y.x,y:y.y,t:d/o})}for(d=0;d<a+1;d++)y=Sd.apply(0,t.concat(d/a)),l.push({x:y.x,y:y.y,t:d/a});for(d=0;d<o;d++)for(var f=0;f<a;f++){var v,g=c[d],b=c[d+1],S=l[f],w=l[f+1],_=hi(b.x-g.x)<.01?"y":"x",C=hi(w.x-S.x)<.01?"y":"x",B=ux(g.x,g.y,b.x,b.y,S.x,S.y,w.x,w.y);if(B){if(u[v=B.x.toFixed(9)+"#"+B.y.toFixed(9)])continue;u[v]=!0;var s=g.t+hi((B[_]-g[_])/(b[_]-g[_]))*(b.t-g.t),h=S.t+hi((B[C]-S[C])/(w[C]-S[C]))*(w.t-S.t);s>=0&&s<=1&&h>=0&&h<=1&&(n?p++:p.push({x:B.x,y:B.y,t1:s,t2:h}))}}return p}function hx(e){var t=xr(e);if(t.abs)return $a(t.abs);if(za(e)&&za(e&&e[0])||(e=function(S){if(!S)return null;var w=xr(S);if(w.arr)return wo(w.arr);var _={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},C=[];return za(S)&&za(S[0])&&(C=wo(S)),C.length||String(S).replace(cx,function(B,s,h){var m=[],E=s.toLowerCase();for(h.replace(lx,function(T,M){M&&m.push(+M)}),E=="m"&&m.length>2&&(C.push([s].concat(m.splice(0,2))),E="l",s=s=="m"?"l":"L");m.length>=_[E]&&(C.push([s].concat(m.splice(0,_[E]))),_[E]););}),C.toString=xr.toString,w.arr=wo(C),C}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,c=0,l=0;e[0][0]=="M"&&(a=r=+e[0][1],c=o=+e[0][2],l++,i[0]=["M",r,o]);for(var u,p,d=l,y=e.length;d<y;d++){if(i.push(u=[]),(n=(p=e[d])[0])!=n.toUpperCase())switch(u[0]=n.toUpperCase(),u[0]){case"A":u[1]=p[1],u[2]=p[2],u[3]=p[3],u[4]=p[4],u[5]=p[5],u[6]=+p[6]+r,u[7]=+p[7]+o;break;case"V":u[1]=+p[1]+o;break;case"H":u[1]=+p[1]+r;break;case"M":a=+p[1]+r,c=+p[2]+o;default:for(var f=1,v=p.length;f<v;f++)u[f]=+p[f]+(f%2?r:o)}else for(var g=0,b=p.length;g<b;g++)u[g]=p[g];switch(n=n.toUpperCase(),u[0]){case"Z":r=+a,o=+c;break;case"H":r=u[1];break;case"V":o=u[1];break;case"M":a=u[u.length-2],c=u[u.length-1];default:r=u[u.length-2],o=u[u.length-1]}}return i.toString=wd,t.abs=$a(i),i}function kd(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function Ua(e,t,n,i){return[e,t,n,i,n,i]}function Pd(e,t,n,i,r,o){var a=.3333333333333333,c=2/3;return[a*e+c*n,a*t+c*i,a*r+c*n,a*o+c*i,r,o]}function Md(e,t,n,i,r,o,a,c,l,u){var p,d,y=120*pi/180,f=pi/180*(+r||0),v=[],g=(d=function(Ie,We,_e){return{x:Ie*Ze.cos(_e)-We*Ze.sin(_e),y:Ie*Ze.sin(_e)+We*Ze.cos(_e)}},function Ie(){var We=Array.prototype.slice.call(arguments,0),_e=We.join("\u2400"),$e=Ie.cache=Ie.cache||{},Ke=Ie.count=Ie.count||[];return Ll($e,_e)?(function(Re,ht){for(var Se=0,Ge=Re.length;Se<Ge;Se++)if(Re[Se]===ht)return Re.push(Re.splice(Se,1)[0])}(Ke,_e),$e[_e]):(Ke.length>=1e3&&delete $e[Ke.shift()],Ke.push(_e),$e[_e]=d.apply(0,We),$e[_e])});if(u)m=u[0],E=u[1],s=u[2],h=u[3];else{e=(p=g(e,t,-f)).x,t=p.y;var b=(e-(c=(p=g(c,l,-f)).x))/2,S=(t-(l=p.y))/2,w=b*b/(n*n)+S*S/(i*i);w>1&&(n*=w=Ze.sqrt(w),i*=w);var _=n*n,C=i*i,B=(o==a?-1:1)*Ze.sqrt(hi((_*C-_*S*S-C*b*b)/(_*S*S+C*b*b))),s=B*n*S/i+(e+c)/2,h=B*-i*b/n+(t+l)/2,m=Ze.asin(((t-h)/i).toFixed(9)),E=Ze.asin(((l-h)/i).toFixed(9));(m=e<s?pi-m:m)<0&&(m=2*pi+m),(E=c<s?pi-E:E)<0&&(E=2*pi+E),a&&m>E&&(m-=2*pi),!a&&E>m&&(E-=2*pi)}var T=E-m;if(hi(T)>y){var M=E,N=c,$=l;E=m+y*(a&&E>m?1:-1),v=Md(c=s+n*Ze.cos(E),l=h+i*Ze.sin(E),n,i,r,0,a,N,$,[E,M,s,h])}T=E-m;var P=Ze.cos(m),x=Ze.sin(m),I=Ze.cos(E),j=Ze.sin(E),G=Ze.tan(T/4),X=4/3*n*G,ee=4/3*i*G,re=[e,t],se=[e+X*x,t-ee*P],H=[c+X*j,l-ee*I],q=[c,l];if(se[0]=2*re[0]-se[0],se[1]=2*re[1]-se[1],u)return[se,H,q].concat(v);for(var xe=[],ze=0,ct=(v=[se,H,q].concat(v).join().split(",")).length;ze<ct;ze++)xe[ze]=ze%2?g(v[ze-1],v[ze],f).y:g(v[ze],v[ze+1],f).x;return xe}function dx(e,t,n,i,r,o,a,c){for(var l,u,p,d,y,f,v,g,b=[],S=[[],[]],w=0;w<2;++w)if(w==0?(u=6*e-12*n+6*r,l=-3*e+9*n-9*r+3*a,p=3*n-3*e):(u=6*t-12*i+6*o,l=-3*t+9*i-9*o+3*c,p=3*i-3*t),hi(l)<1e-12){if(hi(u)<1e-12)continue;0<(d=-p/u)&&d<1&&b.push(d)}else v=u*u-4*p*l,g=Ze.sqrt(v),v<0||(0<(y=(-u+g)/(2*l))&&y<1&&b.push(y),0<(f=(-u-g)/(2*l))&&f<1&&b.push(f));for(var _,C=b.length,B=C;C--;)_=1-(d=b[C]),S[0][C]=_*_*_*e+3*_*_*d*n+3*_*d*d*r+d*d*d*a,S[1][C]=_*_*_*t+3*_*_*d*i+3*_*d*d*o+d*d*d*c;return S[0][B]=e,S[1][B]=t,S[0][B+1]=a,S[1][B+1]=c,S[0].length=S[1].length=B+2,{x0:kn.apply(0,S[0]),y0:kn.apply(0,S[1]),x1:Pn.apply(0,S[0]),y1:Pn.apply(0,S[1])}}function Rd(e){var t=xr(e);if(t.curve)return $a(t.curve);for(var n=hx(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(f,v,g){var b,S;if(!f)return["C",v.x,v.y,v.x,v.y,v.x,v.y];switch(!(f[0]in{T:1,Q:1})&&(v.qx=v.qy=null),f[0]){case"M":v.X=f[1],v.Y=f[2];break;case"A":f=["C"].concat(Md.apply(0,[v.x,v.y].concat(f.slice(1))));break;case"S":g=="C"||g=="S"?(b=2*v.x-v.bx,S=2*v.y-v.by):(b=v.x,S=v.y),f=["C",b,S].concat(f.slice(1));break;case"T":g=="Q"||g=="T"?(v.qx=2*v.x-v.qx,v.qy=2*v.y-v.qy):(v.qx=v.x,v.qy=v.y),f=["C"].concat(Pd(v.x,v.y,v.qx,v.qy,f[1],f[2]));break;case"Q":v.qx=f[1],v.qy=f[2],f=["C"].concat(Pd(v.x,v.y,f[1],f[2],f[3],f[4]));break;case"L":f=["C"].concat(Ua(v.x,v.y,f[1],f[2]));break;case"H":f=["C"].concat(Ua(v.x,v.y,f[1],v.y));break;case"V":f=["C"].concat(Ua(v.x,v.y,v.x,f[1]));break;case"Z":f=["C"].concat(Ua(v.x,v.y,v.X,v.Y))}return f},o=function(f,v){if(f[v].length>7){f[v].shift();for(var g=f[v];g.length;)a[v]="A",f.splice(v++,0,["C"].concat(g.splice(0,6)));f.splice(v,1),p=n.length}},a=[],c="",l="",u=0,p=n.length;u<p;u++){n[u]&&(c=n[u][0]),c!="C"&&(a[u]=c,u&&(l=a[u-1])),n[u]=r(n[u],i,l),a[u]!="A"&&c=="C"&&(a[u]="C"),o(n,u);var d=n[u],y=d.length;i.x=d[y-2],i.y=d[y-1],i.bx=Ed(d[y-4])||i.x,i.by=Ed(d[y-3])||i.y}return t.curve=$a(n),n}const Nd=oo(function(e,t,n){e=Rd(e),t=Rd(t);for(var i,r,o,a,c,l,u,p,d,y,f=n?0:[],v=0,g=e.length;v<g;v++){var b=e[v];if(b[0]=="M")i=c=b[1],r=l=b[2];else{b[0]=="C"?(d=[i,r].concat(b.slice(1)),i=d[6],r=d[7]):(d=[i,r,i,r,c,l,c,l],i=c,r=l);for(var S=0,w=t.length;S<w;S++){var _=t[S];if(_[0]=="M")o=u=_[1],a=p=_[2];else{_[0]=="C"?(y=[o,a].concat(_.slice(1)),o=y[6],a=y[7]):(y=[o,a,o,a,u,p,u,p],o=u,a=p);var C=px(d,y,n);if(n)f+=C;else{for(var B=0,s=C.length;B<s;B++)C[B].segment1=v,C[B].segment2=S,C[B].bez1=d,C[B].bez2=y;f=f.concat(C)}}}}}return f});function Id(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function $i(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function ae(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Vl(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function fe(e){return $i({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function yt(e,t,n){et(n=n||0)||(n={x:n,y:n});var i=ae(e),r=ae(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,c=i.top-n.y>=r.bottom,l=o?"top":c?"bottom":null,u=i.right+n.x<=r.left?"left":a?"right":null;return u&&l?l+"-"+u:u||l||"intersect"}function Fl(e,t,n){var i=Nd(e,t);return i.length===1||i.length===2&&_o(i[0],i[1])<1?$i(i[0]):i.length>1?(i=Xt(i,function(r){var o=Math.floor(100*r.t2)||1;return o=((o=100-o)<10?"0":"")+o,r.segment2+"#"+o}),$i(i[n?0:i.length-1])):null}function Ha(e,t){return Math.round(e*t)/t}function Dd(e){return pe(e)?e+"px":e}function Bd(e,t,n){var i=oe("g");be(i).add(t);var r=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var qa="base",zl="djs-element-hidden",mx={shape:["x","y","width","height"],connection:["waypoints"]};function ve(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}function Od(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}ve.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ve.prototype._init=function(e){var t=this._eventBus,n=this._container=function(o){var a=(o=z({},{width:"100%",height:"100%"},o)).container||document.body,c=document.createElement("div");return c.setAttribute("class","djs-container"),z(c.style,{position:"relative",overflow:"hidden",width:Dd(o.width),height:Dd(o.height)}),a.appendChild(c),c}(e),i=this._svg=oe("svg");K(i,{width:"100%",height:"100%"}),le(n,i);var r=this._viewport=Bd(i,"viewport");this._layers={},this._planes={},e.deferUpdate!==!1&&(this._viewboxChanged=vl(St(this._viewboxChanged,this),300)),t.on("diagram.init",function(){t.fire("canvas.init",{svg:i,viewport:r})},this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","plane.set"],function(){delete this._cachedViewbox},this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},ve.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._activePlane,delete this._viewport},ve.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=yd(t);n==="root"?e.setRootElementForPlane(null,e.findPlane(t),!0):e._removeElement(t,n)}),this._activePlane=null,this._planes={},delete this._cachedViewbox},ve.prototype.getDefaultLayer=function(){return this.getLayer(qa,0)},ve.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),t!==void 0&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},ve.prototype._createLayer=function(e,t){t===void 0&&(t=1);var n=Bt(this._layers,function(i,r){return t>=r.index&&i++,i},0);return{group:Bd(this._viewport,"layer-"+e,n),index:t}},ve.prototype.getPlane=function(e){if(!e)throw new Error("must specify a name");return this._planes[e]},ve.prototype.createPlane=function(e,t){if(!e)throw new Error("must specify a name");if(this._planes[e])throw new Error("plane "+e+" already exists");t||(t={id:"__implicitroot"+e,children:[],isImplicit:!0});var n=this.getLayer(e,0);be(n).add(zl);var i=this._planes[e]={layer:n,name:e,rootElement:null};return this.setRootElementForPlane(t,i),i},ve.prototype.setActivePlane=function(e){if(!e)throw new Error("must specify a plane");return typeof e=="string"&&(e=this.getPlane(e)),this._activePlane&&be(this._activePlane.layer).add(zl),this._activePlane=e,be(e.layer).remove(zl),e.rootElement&&this._elementRegistry.updateGraphics(e.rootElement,this._svg,!0),this._eventBus.fire("plane.set",{plane:e}),e},ve.prototype.getActiveLayer=function(){return this.getActivePlane().layer},ve.prototype.getActivePlane=function(){var e=this._activePlane;return e||(e=this.createPlane(qa),this.setActivePlane(qa)),e},ve.prototype.findPlane=function(e){typeof e=="string"&&(e=this._elementRegistry.get(e));var t=function(n){for(;n.parent;)n=n.parent;return n}(e);return Pe(this._planes,function(n){return n.rootElement===t})},ve.prototype.getContainer=function(){return this._container},ve.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(L([i.gfx,i.secondaryGfx],function(r){r&&(n?be(r).add(t):be(r).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},ve.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ve.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ve.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),be(this.getGraphics(e)).has(t)},ve.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ve.prototype.getRootElement=function(){return this.getActivePlane().rootElement},ve.prototype.setRootElement=function(e,t){var n=this._activePlane;if(n)return this.setRootElementForPlane(e,n,t);var i=this.createPlane(qa,e);return this.setActivePlane(i),i.rootElement},ve.prototype.setRootElementForPlane=function(e,t,n){typeof t=="string"&&(t=this.getPlane(t)),e&&this._ensureValid("root",e);var i=t.rootElement,r=this._elementRegistry,o=this._eventBus;if(i){if(!n)throw new Error("rootElement already set, need to specify override");o.fire("root.remove",{element:i}),o.fire("root.removed",{element:i}),r.remove(i)}if(e){var a=t.layer;o.fire("root.add",{element:e}),r.add(e,a),o.fire("root.added",{element:e,gfx:a}),t===this._activePlane&&this._elementRegistry.updateGraphics(e,this._svg,!0)}return t.rootElement=e,e},ve.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element with id "+t.id+" already exists");var n=mx[e],i=ji(n,function(r){return t[r]!==void 0});if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},ve.prototype._setParent=function(e,t,n){Je(t.children,e,n),e.parent=t},ve.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},ve.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},ve.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},ve.prototype._removeElement=function(e,t){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),Ye(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},ve.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ve.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ve.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ve.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ve.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ve.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,o,a,c=this._viewport,l=this.getSize();return e?(this._changeViewbox(function(){r=Math.min(l.width/e.width,l.height/e.height);var u=this._svg.createSVGMatrix().scale(r).translate(-e.x,-e.y);xo(c,u)}),e):(t=this._activePlane&&this._activePlane.layer.getBBox()||{},n=(i=xo(c))?i.matrix:function(u,p,d,y,f,v){var g=kl().createSVGMatrix();switch(arguments.length){case 0:return g;case 1:return ld(g,u);case 6:return ld(g,{a:u,b:p,c:d,d:y,e:f,f:v})}}(),r=Ha(n.a,1e3),o=Ha(-n.e||0,1e3),a=Ha(-n.f||0,1e3),e=this._cachedViewbox={x:o?o/r:0,y:a?a/r:0,width:l.width/r,height:l.height/r,scale:r,inner:{width:t.width||0,height:t.height||0,x:t.x||0,y:t.y||0},outer:l})},ve.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Od(t,n)}),{x:n.e,y:n.f}},ve.prototype.scrollToElement=function(e,t){var n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));var i=this.findPlane(e);i!==this._activePlane&&this.setActivePlane(i),t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var r,o,a=vt(e),c=ae(a),l=this.viewbox(),u=this.zoom();l.y+=t.top/u,l.x+=t.left/u,l.width-=(t.right+t.left)/u,l.height-=(t.bottom+t.top)/u;var p=ae(l);if(a.width<l.width&&a.height<l.height){var d=Math.max(0,c.right-p.right),y=Math.min(0,c.left-p.left),f=Math.max(0,c.bottom-p.bottom),v=Math.min(0,c.top-p.top);r=d||y,o=f||v}else r=a.x-l.x,o=a.y-l.y;this.scroll({dx:-r*u,dy:-o*u})},ve.prototype.zoom=function(e,t){return e?e==="fit-viewport"?this._fitViewport(t):(this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),Ha(i.a,1e3)):this.viewbox(e).scale;var n,i},ve.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,o=i.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(t=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(e?o.width/2-r.width/t/2:0),y:o.y+(e?o.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},ve.prototype._setZoom=function(e,t){var n,i,r,o,a=this._svg,c=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),p=(i=c.getCTM()).a;return t?(n=z(u,t).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/p*e).translate(-n.x,-n.y),o=i.multiply(r)):o=l.scale(e),Od(this._viewport,o),o},ve.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ve.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();return e.waypoints?t=this.getGraphics(e).getBBox():t=e,{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},ve.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Er="data-element-id";function Ut(e){this._elements={},this._eventBus=e}Ut.$inject=["eventBus"],Ut.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),K(t,Er,i),n&&K(n,Er,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Ut.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(K(i.gfx,Er,""),i.secondaryGfx&&K(i.secondaryGfx,Er,""),delete t[n])},Ut.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Ut.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,K(t,Er,i),t},Ut.prototype.get=function(e){var t;t=typeof e=="string"?e:e&&K(e,Er);var n=this._elements[t];return n&&n.element},Ut.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Ut.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},Ut.prototype.getAll=function(){return this.filter(function(e){return e})},Ut.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)})},Ut.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Ut.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var $l={exports:{}},Wa={};Wa.extend=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,r,i)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var c=this.indexOf(o);if(a===void 0){if(c!==-1)return;a=this.length}c!==-1&&this.splice(c,1),this.splice(a,0,o),c===-1&&t.set(o,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},Wa.isExtended=function(e){return e.__refs_collection===!0};var Ld=Wa;function jd(e,t,n){var i=Ld.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(r){e.set(r,t.inverse,n)})}function mi(e,t){if(!(this instanceof mi))return new mi(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}mi.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?jd(this,t,e):function(n,i,r){var o=i.inverse,a=r[i.name];Object.defineProperty(r,i.name,{configurable:i.configurable,enumerable:i.enumerable,get:function(){return a},set:function(c){if(c!==a){var l=a;a=null,l&&n.unset(l,o,r),a=c,n.set(a,o,r)}}})}(this,t,e)},mi.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Ld.isExtended(n)||jd(this,t,e),n},mi.prototype.ensureBound=function(e,t){(function(n,i){return Object.prototype.hasOwnProperty.call(n,i.name||i)})(e,t)||this.bind(e,t)},mi.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},mi.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var fx=mi;$l.exports=fx,$l.exports.Collection=Wa;const _r=oo($l.exports);var Vd=new _r({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Fd=new _r({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),zd=new _r({name:"attachers",collection:!0},{name:"host"}),$d=new _r({name:"outgoing",collection:!0},{name:"source"}),Gd=new _r({name:"incoming",collection:!0},{name:"target"});function So(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Vd.bind(this,"parent"),Fd.bind(this,"labels"),$d.bind(this,"outgoing"),Gd.bind(this,"incoming")}function wr(){So.call(this),Vd.bind(this,"children"),zd.bind(this,"host"),zd.bind(this,"attachers")}function Ud(){wr.call(this)}function Xa(){wr.call(this),Fd.bind(this,"labelTarget")}function Hd(){So.call(this),$d.bind(this,"source"),Gd.bind(this,"target")}ie(wr,So),ie(Ud,wr),ie(Xa,wr),ie(Hd,So);var vx={connection:Hd,shape:wr,label:Xa,root:Ud};function Gn(){this._uid=12}Gn.prototype.createRoot=function(e){return this.create("root",e)},Gn.prototype.createLabel=function(e){return this.create("label",e)},Gn.prototype.createShape=function(e){return this.create("shape",e)},Gn.prototype.createConnection=function(e){return this.create("connection",e)},Gn.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(n,i){var r=vx[n];if(!r)throw new Error("unknown type: <"+n+">");return z(new r,i)}(e,t)};var Ka="__fn",yx=Array.prototype.slice;function Ot(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Co(){}function Ya(e){return e.childNodes[0]}function Gl(e,t,n,i,r){var o=bo();o.setTranslate(t,n);var a=bo();a.setRotate(i||0,0,0);var c=bo();c.setScale(r||1,r||1),xo(e,[o,a,c])}function Lt(e,t,n){var i=bo();i.setTranslate(t,n),xo(e,i)}function qd(e,t){var n=bo();n.setRotate(t,0,0),xo(e,n)}function Ht(e,t){this._eventBus=e,this._elementRegistry=t}function Wd(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}Ot.prototype.on=function(e,t,n,i){if(e=ge(e)?e:[e],ft(t)&&(i=n,n=t,t=1e3),!pe(t))throw new Error("priority must be a number");var r=n;i&&((r=St(n,i))[Ka]=n[Ka]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:r,next:null})})},Ot.prototype.once=function(e,t,n,i){var r=this;if(ft(t)&&(i=n,n=t,t=1e3),!pe(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(e,o),a}o[Ka]=n,this.on(e,t,o)},Ot.prototype.off=function(e,t){e=ge(e)?e:[e];var n=this;e.forEach(function(i){n._removeListener(i,t)})},Ot.prototype.createEvent=function(e){var t=new Co;return t.init(e),t},Ot.prototype.fire=function(e,t){var n,i,r,o;if(o=yx.call(arguments),typeof e=="object"&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof Co?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},Ot.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},Ot.prototype._destroy=function(){this._listeners={}},Ot.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Ot.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(r,o){return r.apply(null,o)}(n.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i},Ot.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},Ot.prototype._getListeners=function(e){return this._listeners[e]},Ot.prototype._setListeners=function(e,t){this._listeners[e]=t},Ot.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[Ka]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},Co.prototype.stopPropagation=function(){this.cancelBubble=!0},Co.prototype.preventDefault=function(){this.defaultPrevented=!0},Co.prototype.init=function(e){z(this,e||{})},Ht.$inject=["eventBus","elementRegistry"],Ht.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(i){return i.parentNode.childNodes[1]}(n),t||(be(t=oe("g")).add("djs-children"),le(n.parentNode,t))):t=n,t},Ht.prototype._clear=function(e){var t=Ya(e);return La(t),t},Ht.prototype._createContainer=function(e,t,n,i){var r=oe("g");be(r).add("djs-group"),n!==void 0?Wd(r,t,t.childNodes[n]):le(t,r);var o=oe("g");be(o).add("djs-element"),be(o).add("djs-"+e),i&&be(o).add("djs-frame"),le(r,o);var a=oe("g");return be(a).add("djs-visual"),le(o,a),o},Ht.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,gd(t))},Ht.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=Bt(e,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),L(t,function(r){var o=r.children;if(o){var a=n._getChildrenContainer(r);L(o.slice().reverse(),function(c){Wd(i.getGraphics(c).parentNode,a)})}})},Ht.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Ht.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Ht.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Ht.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Ht.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if(e==="shape")this.drawShape(i,t),Lt(n,t.x,t.y);else{if(e!=="connection")throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?K(n,"display","none"):K(n,"display","block")}},Ht.prototype.remove=function(e){tt(this._elementRegistry.getGraphics(e).parentNode)};const gx={__depends__:[ax],__init__:["canvas"],canvas:["type",ve],elementRegistry:["type",Ut],elementFactory:["type",Gn],eventBus:["type",Ot],graphicsFactory:["type",Ht]};function bx(e){var t=[],n=[];function i(o){return t.indexOf(o)>=0}e.forEach(function o(a){i(a)||((a.__depends__||[]).forEach(o),i(a)||(function(c){t.push(c)}(a),(a.__init__||[]).forEach(function(c){n.push(c)})))});var r=new Nl(t);return n.forEach(function(o){try{r[typeof o=="string"?"get":"invoke"](o)}catch(a){throw console.error("Failed to instantiate component"),console.error(a.stack),a}}),r}function Sr(e,t){this.injector=t=t||function(n){return bx([{config:["value",n=n||{}]},gx].concat(n.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function Ul(){}function Xd(e,t){this.model=e,this.properties=t}Sr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Sr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Ul.prototype.get=function(e){return this.$model.properties.get(this,e)},Ul.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Xd.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Ul.prototype);L(e.properties,function(a){a.isMany||a.default===void 0||(i[a.name]=a.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(a){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),L(a,St(function(c,l){this.set(l,c)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var xx={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Kd={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Hl(e,t){var n=Kd[e];return n?n(t):t}function ql(e){return!!xx[e]}function Yd(e){return!!Kd[e]}function kt(e,t){var n,i,r=e.split(/:/);if(r.length===1)n=e,i=t;else{if(r.length!==2)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Jt(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function fi(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,L(e,St(this.registerPackage,this))}function Jd(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Cr(e){this.model=e}function Zd(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Zt(e){this.properties=new Cr(this),this.factory=new Xd(this,this.properties),this.registry=new fi(e,this.properties),this.typeCache={}}Jt.prototype.build=function(){return Yt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Jt.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var i=this.properties;t!==void 0?i.splice(t,0,e):i.push(e)},Jt.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var c=r.indexOf(e);if(c===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(c,1),this.addProperty(t,n?void 0:c,a),o[i.name]=o[i.localName]=t},Jt.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=kt(r[0],i),a=kt(r[1],o.prefix).name,c=this.propertiesByName[a];if(!c)throw new Error("refined property <"+a+"> not found");this.replaceProperty(c,e,n),delete e.redefines},Jt.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Jt.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Jt.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Jt.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Jt.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Jt.prototype.hasProperty=function(e){return this.propertiesByName[e]},Jt.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(L(e.properties,St(function(o){o=z({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,c=o.redefines;a||c?this.redefineProperty(o,a||c,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(e),n[r]=e)},fi.prototype.getPackage=function(e){return this.packageMap[e]},fi.prototype.getPackages=function(){return this.packages},fi.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;Jd(t,e,"prefix"),Jd(t,e,"uri"),L(e.types,St(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},fi.prototype.registerType=function(e,t){var n=kt((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z(e.meta||{})})).name,t.prefix),i=n.name,r={};L(e.properties,St(function(o){var a=kt(o.name,n.prefix),c=a.name;ql(o.type)||(o.type=kt(o.type,a.prefix).name),z(o,{ns:a,name:c}),r[c]=o},this)),z(e,{ns:n,name:i,propertiesByName:r}),L(e.extends,St(function(o){var a=this.typeMap[o];a.traits=a.traits||[],a.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},fi.prototype.mapTypes=function(e,t,n){var i=ql(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(c){return a(c,!0)}function a(c,l){var u=kt(c,ql(c)?"":e.prefix);r.mapTypes(u,t,l)}if(!i)throw new Error("unknown type <"+e.name+">");L(i.superClass,n?o:a),t(i,!n),L(i.traits,o)},fi.prototype.getEffectiveDescriptor=function(e){var t=kt(e),n=new Jt(t);this.mapTypes(t,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},fi.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Cr.prototype.set=function(e,t,n){if(!Dt(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;n===void 0?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:Zd(e,i,n):e.$attrs[t]=n},Cr.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&Zd(e,n,[]),e[i]},Cr.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Cr.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Cr.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Zt.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Zt.prototype.getType=function(e){var t=this.typeCache,n=Dt(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Zt.prototype.createAny=function(e,t,n){var i=kt(e),r={$type:e,$instanceOf:function(a){return a===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),L(n,function(a,c){et(a)&&a.value!==void 0?r[a.name]=a.value:r[c]=a}),r},Zt.prototype.getPackage=function(e){return this.registry.getPackage(e)},Zt.prototype.getPackages=function(){return this.registry.getPackages()},Zt.prototype.getElementDescriptor=function(e){return e.$descriptor},Zt.prototype.hasType=function(e,t){return t===void 0&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Zt.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Zt.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Ex=String.fromCharCode,_x=Object.prototype.hasOwnProperty,wx=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,To={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Sx(e,t,n,i){return i?_x.call(To,i)?To[i]:"&"+i+";":Ex(t||parseInt(n,16))}function Gi(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(wx,Sx):e}Object.keys(To).forEach(function(e){To[e.toUpperCase()]=To[e]});var Qd="xsi:type",em="non-whitespace outside of root node";function Tr(e){return new Error(e)}function tm(e){return"missing namespace for prefix <"+e+">"}function Ja(e){return{get:e,enumerable:!0}}function Cx(e){var t,n={};for(t in e)n[t]=e[t];return n}function Wl(e){return e+"$uri"}function nm(){return{line:0,column:0}}function Tx(e){throw e}function im(e){if(!this)return new im(e);var t,n,i,r,o,a,c,l,u,p=e&&e.proxy,d=Tx,y=nm,f=!1,v=!1,g=null,b=!1;function S(_){_ instanceof Error||(_=Tr(_)),g=_,d(_,y)}function w(_){o&&(_ instanceof Error||(_=Tr(_)),o(_,y))}this.on=function(_,C){if(typeof C!="function")throw Tr("required args <name, cb>");switch(_){case"openTag":n=C;break;case"text":t=C;break;case"closeTag":i=C;break;case"error":d=C;break;case"warn":o=C;break;case"cdata":r=C;break;case"attention":l=C;break;case"question":c=C;break;case"comment":a=C;break;default:throw Tr("unsupported event: "+_)}return this},this.ns=function(_){if(_===void 0&&(_={}),typeof _!="object")throw Tr("required args <nsMap={}>");var C,B={};for(C in _)B[C]=_[C];return B["http://www.w3.org/2001/XMLSchema-instance"]="xsi",v=!0,u=B,this},this.parse=function(_){if(typeof _!="string")throw Tr("required args <xml=string>");return g=null,function(C){var B,s,h,m,E,T,M,N,$,P,x,I=v?[]:null,j=v?function(Ie){var We,_e,$e={};for(We in Ie)$e[_e=Ie[We]]=_e,$e[Wl(_e)]=We;return $e}(u):null,G=[],X=0,ee=!1,re=!1,se=0,H=0,q="",xe=0;function ze(){if(x!==null)return x;var Ie,We,_e,$e,Ke,Re,ht,Se,Ge,he,Oe,Di=v&&j.xmlns,hr=v&&f?[]:null,Qe=xe,_t=q,xn=_t.length,Bi={},Yc={};e:for(;Qe<xn;Qe++)if(Ge=!1,!((he=_t.charCodeAt(Qe))===32||he<14&&he>8)){for((he<65||he>122||he>90&&he<97)&&he!==95&&he!==58&&(w("illegal first char attribute name"),Ge=!0),Oe=Qe+1;Oe<xn;Oe++)if(!((he=_t.charCodeAt(Oe))>96&&he<123||he>64&&he<91||he>47&&he<59||he===46||he===45||he===95)){if(he===32||he<14&&he>8){w("missing attribute value"),Qe=Oe;continue e}if(he===61)break;w("illegal attribute name char"),Ge=!0}if((Se=_t.substring(Qe,Oe))==="xmlns:xmlns"&&(w("illegal declaration of xmlns"),Ge=!0),(he=_t.charCodeAt(Oe+1))===34)(Oe=_t.indexOf('"',Qe=Oe+2))===-1&&(Oe=_t.indexOf("'",Qe))!==-1&&(w("attribute value quote missmatch"),Ge=!0);else if(he===39)(Oe=_t.indexOf("'",Qe=Oe+2))===-1&&(Oe=_t.indexOf('"',Qe))!==-1&&(w("attribute value quote missmatch"),Ge=!0);else for(w("missing attribute value quotes"),Ge=!0,Oe+=1;Oe<xn&&!((he=_t.charCodeAt(Oe+1))===32||he<14&&he>8);Oe++);for(Oe===-1&&(w("missing closing quotes"),Oe=xn,Ge=!0),Ge||(Re=_t.substring(Qe,Oe)),Qe=Oe;Oe+1<xn&&!((he=_t.charCodeAt(Oe+1))===32||he<14&&he>8);Oe++)Qe===Oe&&(w("illegal character after attribute end"),Ge=!0);if(Qe=Oe+1,!Ge)if(Se in Yc)w("attribute <"+Se+"> already defined");else if(Yc[Se]=!0,v)if(f){if((Ke=Se==="xmlns"?"xmlns":Se.charCodeAt(0)===120&&Se.substr(0,6)==="xmlns:"?Se.substr(6):null)!==null){if(Ie=Gi(Re),We=Wl(Ke),!(ht=u[Ie])){if(Ke==="xmlns"||We in j&&j[We]!==Ie)do ht="ns"+X++;while(j[ht]!==void 0);else ht=Ke;u[Ie]=ht}j[Ke]!==ht&&($e||(j=Cx(j),$e=!0),j[Ke]=ht,Ke==="xmlns"&&(j[Wl(ht)]=Ie,Di=ht),j[We]=Ie),Bi[Se]=Re;continue}hr.push(Se,Re)}else(he=Se.indexOf(":"))!==-1?(_e=j[Se.substring(0,he)])?((Se=Di===_e?Se.substr(he+1):_e+Se.substr(he))===Qd&&((he=Re.indexOf(":"))!==-1?(_e=Re.substring(0,he),Re=(_e=j[_e]||_e)+Re.substring(he)):Re=Di+":"+Re),Bi[Se]=Re):w(tm(Se.substring(0,he))):Bi[Se]=Re;else Bi[Se]=Re}if(f)for(Qe=0,xn=hr.length;Qe<xn;Qe++){if(Se=hr[Qe++],Re=hr[Qe],(he=Se.indexOf(":"))!==-1){if(!(_e=j[Se.substring(0,he)])){w(tm(Se.substring(0,he)));continue}(Se=Di===_e?Se.substr(he+1):_e+Se.substr(he))===Qd&&((he=Re.indexOf(":"))!==-1?(_e=Re.substring(0,he),Re=(_e=j[_e]||_e)+Re.substring(he)):Re=Di+":"+Re)}Bi[Se]=Re}return x=Bi}function ct(){for(var Ie,We,_e=/(\r\n|\r|\n)/g,$e=0,Ke=0,Re=0,ht=H;se>=Re&&(Ie=_e.exec(C))&&!((ht=Ie[0].length+Ie.index)>se);)$e+=1,Re=ht;return se==-1?(Ke=ht,We=C.substring(H)):H===0?We=C.substring(H,se):(Ke=se-Re,We=H==-1?C.substring(se):C.substring(se,H+1)),{data:We,line:$e,column:Ke}}for(y=ct,p&&(P=Object.create({},{name:Ja(function(){return N}),originalName:Ja(function(){return $}),attrs:Ja(ze),ns:Ja(function(){return j})}));H!==-1;){if((se=C.charCodeAt(H)===60?H:C.indexOf("<",H))===-1)return G.length?S("unexpected end of file"):H===0?S("missing start tag"):void(H<C.length&&C.substring(H).trim()&&w(em));if(H!==se){if(G.length){if(t&&(t(C.substring(H,se),Gi,y),b))return}else if(C.substring(H,se).trim()&&(w(em),b))return}if((E=C.charCodeAt(se+1))===33){if((m=C.charCodeAt(se+2))===91&&C.substr(se+3,6)==="CDATA["){if((H=C.indexOf("]]>",se))===-1)return S("unclosed cdata");if(r&&(r(C.substring(se+9,H),y),b))return;H+=3;continue}if(m===45&&C.charCodeAt(se+3)===45){if((H=C.indexOf("-->",se))===-1)return S("unclosed comment");if(a&&(a(C.substring(se+4,H),Gi,y),b))return;H+=3;continue}}if(E!==63){for(s=se+1;;s++){if(T=C.charCodeAt(s),isNaN(T))return H=-1,S("unclosed tag");if(T===34)s=(m=C.indexOf('"',s+1))!==-1?m:s;else if(T===39)s=(m=C.indexOf("'",s+1))!==-1?m:s;else if(T===62){H=s;break}}if(E!==33){if(x={},E===47){if(ee=!1,re=!0,!G.length)return S("missing open tag");if(s=N=G.pop(),m=se+2+s.length,C.substring(se+2,m)!==s)return S("closing tag mismatch");for(;m<H;m++)if(!((E=C.charCodeAt(m))===32||E>8&&E<14))return S("close tag")}else{if(C.charCodeAt(H-1)===47?(s=N=C.substring(se+1,H-1),ee=!0,re=!0):(s=N=C.substring(se+1,H),ee=!0,re=!1),!(E>96&&E<123||E>64&&E<91||E===95||E===58))return S("illegal first char nodeName");for(m=1,h=s.length;m<h;m++)if(!((E=s.charCodeAt(m))>96&&E<123||E>64&&E<91||E>47&&E<59||E===45||E===95||E==46)){if(E===32||E<14&&E>8){N=s.substring(0,m),x=null;break}return S("invalid nodeName")}re||G.push(N)}if(v){if(B=j,ee&&(re||I.push(B),x===null&&(f=s.indexOf("xmlns",m)!==-1)&&(xe=m,q=s,ze(),f=!1)),$=N,(E=N.indexOf(":"))!==-1){if(!(M=j[N.substring(0,E)]))return S("missing namespace on <"+$+">");N=N.substr(E+1)}else M=j.xmlns;M&&(N=M+":"+N)}if(ee&&(xe=m,q=s,n&&(p?n(P,Gi,re,y):n(N,ze,Gi,re,y),b)))return;if(re){if(i&&(i(p?P:N,Gi,ee,y),b))return;v&&(j=ee?B:I.pop())}H+=1}else{if(l&&(l(C.substring(se,H+1),Gi,y),b))return;H+=1}}else{if((H=C.indexOf("?>",se))===-1)return S("unclosed question");if(c&&(c(C.substring(se,H+2),y),b))return;H+=2}}}(_),y=nm,b=!1,g},this.stop=function(){b=!0}}function rm(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Ax={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Za="xsi:type";function om(e){return e.xml&&e.xml.serialize}function am(e){return om(e)===Za}function sm(e,t){return rm(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function vi(e){return new Error(e)}function Un(e){return e.$descriptor}function kx(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw vi("expected element");var n,i=this.elementsById,r=Un(t).idProperty;if(r&&(n=t.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(n))throw new Error("illegal ID <"+n+">");if(i[n])throw vi("duplicate ID <"+n+">");i[n]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Ao(){}function Xl(){}function Ar(){}function ko(e,t){this.property=e,this.context=t}function Kl(e,t){this.element=t,this.propertyDesc=e}function Qa(){}function Ct(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Yl(e,t,n){Ct.call(this,e,t,n)}function kr(e,t,n){this.model=e,this.context=n}function Jl(e){e instanceof Zt&&(e={model:e}),z(this,{lax:!1},e)}Ao.prototype.handleEnd=function(){},Ao.prototype.handleText=function(){},Ao.prototype.handleNode=function(){},Xl.prototype=Object.create(Ao.prototype),Xl.prototype.handleNode=function(){return this},Ar.prototype=Object.create(Ao.prototype),Ar.prototype.handleText=function(e){this.body=(this.body||"")+e},ko.prototype=Object.create(Ar.prototype),ko.prototype.handleNode=function(e){if(this.element)throw vi("expected no sub nodes");return this.element=this.createReference(e),this},ko.prototype.handleEnd=function(){this.element.id=this.body},ko.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Kl.prototype=Object.create(Ar.prototype),Kl.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Hl(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Qa.prototype=Object.create(Ar.prototype),Qa.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},Ct.prototype=Object.create(Qa.prototype),Ct.prototype.addReference=function(e){this.context.addReference(e)},Ct.prototype.handleText=function(e){if(!Un(this.element).bodyProperty)throw vi("unexpected body text <"+e+">");Ar.prototype.handleText.call(this,e)},Ct.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Un(t).bodyProperty;n&&e!==void 0&&(e=Hl(n.type,e),t.set(n.name,e))},Ct.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Un(i),o=this.context,a=new i({}),c=this.model;return L(n,function(l,u){var p=r.propertiesByName[u];p&&p.isReference?p.isMany?L(l.split(" "),function(d){o.addReference({element:a,property:p.ns.name,id:d})}):o.addReference({element:a,property:p.ns.name,id:l}):(p?l=Hl(p.type,l):u!=="xmlns"&&(t=kt(u,r.ns.prefix),c.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+u+">",element:a,property:u,value:l})),a.set(u,l))}),a},Ct.prototype.getPropertyForNode=function(e){var t,n,i=kt(e.name),r=this.type,o=this.model,a=Un(r),c=i.name,l=a.propertiesByName[c];if(l&&!l.isAttr)return am(l)&&(t=e.attributes[Za])?(t=function(p,d){var y=kt(p);return function(f,v){var g=f.name,b=f.localName,S=v.xml&&v.xml.typePrefix;return S&&b.indexOf(S)===0?f.prefix+":"+b.slice(S.length):g}(y,d.getPackage(y.prefix))}(t,o),z({},l,{effectiveType:Un(n=o.getType(t)).name})):l;var u=o.getPackage(i.prefix);if(u){if(t=sm(i,u),n=o.getType(t),l=Pe(a.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&n.hasType(p.type)}))return z({},l,{effectiveType:Un(n).name})}else if(l=Pe(a.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}))return l;throw vi("unrecognized element <"+i.name+">")},Ct.prototype.toString=function(){return"ElementDescriptor["+Un(this.type).name+"]"},Ct.prototype.valueHandler=function(e,t){return new Kl(e,t)},Ct.prototype.referenceHandler=function(e){return new ko(e,this.context)},Ct.prototype.handler=function(e){return e==="Element"?new kr(this.model,e,this.context):new Ct(this.model,e,this.context)},Ct.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Yd(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return o!==void 0&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Yl.prototype=Object.create(Ct.prototype),Yl.prototype.createElement=function(e){var t=e.name,n=kt(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&sm(n,o)||t;if(!r.hasType(a))throw vi("unexpected element <"+e.originalName+">");return Ct.prototype.createElement.call(this,e)},kr.prototype=Object.create(Qa.prototype),kr.prototype.createElement=function(e){var t=e.name,n=kt(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},kr.prototype.handleChild=function(e){var t=new kr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return i!==void 0&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},kr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Jl.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Ct?(i=t,t={}):typeof t=="string"?(i=this.handler(t),t={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new kx(z({},t,{rootHandler:i})),c=new im({proxy:!0}),l=function(){var b=[];return Object.defineProperty(b,"peek",{value:function(){return this[this.length-1]}}),b}();function u(b,S,w){var _=S(),C=_.line,B=_.column,s=_.data;s.charAt(0)==="<"&&s.indexOf(" ")!==-1&&(s=s.slice(0,s.indexOf(" "))+">");var h="unparsable content "+(s?s+" ":"")+`detected
  3. ========
  4. import{_ as AA,__tla as kA}from"./Dialog-f1f78bbe.js";import{cU as oo,cS as P0,ds as PA,d as Rt,r as W,aV as ol,K as $h,dt as MA,l as Ma,ax as jn,Q as RA,o as ne,c as De,g as Ve,aD as NA,F as ln,f as R,w as V,a as D,v as Ce,P as ke,n as me,t as M0,x as al,O as un,be as IA,bf as ao,bh as DA,du as BA,C as so,_ as Nt,e as OA,L as mt,bz as Be,V as wn,A as Sn,D as oi,an as zt,ak as R0,a4 as Gh,y as co,z as lo,q as uo,b0 as Ra,aI as LA,cx as jA,M as VA,ad as N0,aP as po,G as sl,H as cl,j as ll,bB as Uh,au as FA,ap as zA,__tla as $A}from"./index-c9fff140.js";import{_ as GA,__tla as UA}from"./XTextButton-8696a966.js";import{_ as ho,__tla as HA}from"./XButton-1399ce75.js";import{E as qA,a as WA,__tla as XA}from"./el-collapse-item-184db02e.js";import{E as Hh,__tla as KA}from"./el-link-5adae073.js";import{u as I0,__tla as YA}from"./useMessage-5d45d53a.js";import{E as D0,__tla as JA}from"./el-drawer-fbfa6eab.js";import{a as B0,D as O0,__tla as ZA}from"./dict-d4a12fea.js";import{f as mo,__tla as QA}from"./formatTime-928d70c3.js";let Na,Ia,A,L0,It,qh,Me,Wh,ai,Da,we,Ba,ek=Promise.all([(()=>{try{return kA}catch{}})(),(()=>{try{return $A}catch{}})(),(()=>{try{return UA}catch{}})(),(()=>{try{return HA}catch{}})(),(()=>{try{return XA}catch{}})(),(()=>{try{return KA}catch{}})(),(()=>{try{return YA}catch{}})(),(()=>{try{return JA}catch{}})(),(()=>{try{return ZA}catch{}})(),(()=>{try{return QA}catch{}})()]).then(async()=>{var ul={exports:{}};typeof Object.create=="function"?ul.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ul.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};const ie=oo(ul.exports);var Xh,pl,j0=(Xh=function(e){var t=e.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;var a=r-Math.floor(r),c="";for(o=0;o<Math.floor(r);o++)c=Math.floor(Math.random()*i).toString(i)+c;if(a){var l=Math.pow(i,a);c=Math.floor(Math.random()*l).toString(i)+c}var u=parseInt(c,i);return u!==1/0&&u>=Math.pow(2,n)?t(n,i):c};t.rack=function(n,i,r){var o=function(c){var l=0;do{if(l++>10){if(!r)throw new Error("too many ID collisions, use more bits");n+=r}var u=t(n,i)}while(Object.hasOwnProperty.call(a,u));return a[u]=c,u},a=o.hats={};return o.get=function(c){return o.hats[c]},o.set=function(c,l){return o.hats[c]=l,o},o.bits=n||128,o.base=i||16,o}},Xh(pl={exports:{}},pl.exports),pl.exports);function Cn(e){if(!(this instanceof Cn))return new Cn(e);e=e||[128,36,1],this._seed=e.length?j0.rack(e[0],e[1],e[2]):e}function fo(e){return Array.prototype.concat.apply([],e)}Cn.prototype.next=function(e){return this._seed(e||!0)},Cn.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},Cn.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Cn.prototype.assigned=function(e){return this._seed.get(e)||!1},Cn.prototype.unclaim=function(e){delete this._seed.hats[e]},Cn.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var vo=Object.prototype.toString,V0=Object.prototype.hasOwnProperty;function Vn(e){return e===void 0}function Wt(e){return e!==void 0}function yo(e){return e==null}function ge(e){return vo.call(e)==="[object Array]"}function et(e){return vo.call(e)==="[object Object]"}function pe(e){return vo.call(e)==="[object Number]"}function ft(e){var t=vo.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Dt(e){return vo.call(e)==="[object String]"}function Kh(e){if(!ge(e))throw new Error("must supply array")}function Tn(e,t){return V0.call(e,t)}function Pe(e,t){var n;return t=fl(t),L(e,function(i,r){if(t(i,r))return n=i,!1}),n}function hl(e,t){t=fl(t);var n=ge(e)?-1:void 0;return L(e,function(i,r){if(t(i,r))return n=r,!1}),n}function de(e,t){var n=[];return L(e,function(i,r){t(i,r)&&n.push(i)}),n}function L(e,t){var n;if(!Vn(e)){var i=ge(e)?z0:F0;for(var r in e)if(Tn(e,r)&&t(n=e[r],i(r))===!1)return n}}function Yh(e,t){return Vn(e)?[]:(Kh(e),t=fl(t),e.filter(function(n,i){return!t(n,i)}))}function Bt(e,t,n){return L(e,function(i,r){n=t(n,i,r)}),n}function ji(e,t){return!!Bt(e,function(n,i,r){return n&&t(i,r)},!0)}function si(e,t){return!!Pe(e,t)}function lt(e,t){var n=[];return L(e,function(i,r){n.push(t(i,r))}),n}function go(e){return e&&Object.keys(e)||[]}function yr(e){return go(e).length}function Oa(e){return lt(e,function(t){return t})}function Vi(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=ml(t),L(e,function(i){var r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function dl(e){e=ml(e);for(var t={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return L(i,function(o){return Vi(o,e,t)}),lt(t,function(o,a){return o[0]})}var Jh=dl;function Xt(e,t){t=ml(t);var n=[];return L(e,function(i,r){for(var o=t(i,r),a={d:o,v:i},c=0;c<n.length;c++)if(o<n[c].d)return void n.splice(c,0,a);n.push(a)}),lt(n,function(i){return i.v})}function Kt(e){return function(t){return ji(e,function(n,i){return t[i]===n})}}function ml(e){return ft(e)?e:function(t){return t[e]}}function fl(e){return ft(e)?e:function(t){return t===e}}function F0(e){return e}function z0(e){return Number(e)}function vl(e,t){var n,i,r,o;function a(p){var d=Date.now(),y=p?0:o+t-d;if(y>0)return c(y);e.apply(r,i),l()}function c(p){n=setTimeout(a,p)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function u(){o=Date.now();for(var p=arguments.length,d=new Array(p),y=0;y<p;y++)d[y]=arguments[y];i=d,r=this,n||c(t)}return u.flush=function(){n&&a(!0),l()},u.cancel=l,u}function St(e,t){return e.bind(t)}function yl(e){return yl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yl(e)}function gl(){return gl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},gl.apply(this,arguments)}function z(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return gl.apply(void 0,[e].concat(n))}function Yt(e,t){var n={},i=Object(e);return L(t,function(r){r in i&&(n[r]=e[r])}),n}function Fn(e,t){var n={};return L(Object(e),function(i,r){t.indexOf(r)===-1&&(n[r]=i)}),n}const $0=Object.freeze(Object.defineProperty({__proto__:null,assign:z,bind:St,debounce:vl,ensureArray:Kh,every:ji,filter:de,find:Pe,findIndex:hl,flatten:fo,forEach:L,get:function(e,t,n){var i=e;return L(t,function(r){if(yo(i))return i=void 0,!1;i=i[r]}),Vn(i)?n:i},groupBy:Vi,has:Tn,isArray:ge,isDefined:Wt,isFunction:ft,isNil:yo,isNumber:pe,isObject:et,isString:Dt,isUndefined:Vn,keys:go,map:lt,matchPattern:Kt,merge:function e(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return i.length&&L(i,function(o){o&&et(o)&&L(o,function(a,c){if(c!=="__proto__"){var l=t[c];et(a)?(et(l)||(l={}),t[c]=e(l,a)):t[c]=a}})}),t},omit:Fn,pick:Yt,reduce:Bt,set:function(e,t,n){var i=e;return L(t,function(r,o){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+yl(r)+". Key should be of type number or string.");if(r==="constructor")throw new Error("illegal key: constructor");if(r==="__proto__")throw new Error("illegal key: __proto__");var a=t[o+1],c=i[r];Wt(a)&&yo(c)&&(c=i[r]=isNaN(+a)?{}:[]),Vn(a)?Vn(n)?delete i[r]:i[r]=n:i=c}),e},size:yr,some:si,sortBy:Xt,throttle:function(e,t){var n=!1;return function(){n||(e.apply(void 0,arguments),n=!0,setTimeout(function(){n=!1},t))}},unionBy:Jh,uniqueBy:dl,values:Oa,without:Yh},Symbol.toStringTag,{value:"Module"}));function $t(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var G0=[].indexOf,bl=function(e,t){if(G0)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},U0=/\s+/,H0=Object.prototype.toString;function ot(e){return new ci(e)}function ci(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function La(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}ci.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~bl(t,e)||t.push(e),this.el.className=t.join(" "),this},ci.prototype.remove=function(e){if(H0.call(e)=="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=bl(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},ci.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},ci.prototype.toggle=function(e,t){return this.list?(t!==void 0?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(t!==void 0?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},ci.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(U0);return e[0]===""&&e.shift(),e},ci.prototype.has=ci.prototype.contains=function(e){return this.list?this.list.contains(e):!!~bl(this.array(),e)};var gr=typeof Element<"u"?Element.prototype:{},Zh=gr.matches||gr.matchesSelector||gr.webkitMatchesSelector||gr.mozMatchesSelector||gr.msMatchesSelector||gr.oMatchesSelector,ja=function(e,t){if(!e||e.nodeType!==1)return!1;if(Zh)return Zh.call(e,t);for(var n=e.parentNode.querySelectorAll(t),i=0;i<n.length;i++)if(n[i]==e)return!0;return!1};function Fi(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(ja(i,t))return i;i=i.parentNode}return ja(i,t)?i:null}var Qh=window.addEventListener?"addEventListener":"attachEvent",q0=window.removeEventListener?"removeEventListener":"detachEvent",ed=Qh!=="addEventListener"?"on":"",ce={bind:function(e,t,n,i){return e[Qh](ed+t,n,i||!1),n},unbind:function(e,t,n,i){return e[q0](ed+t,n,i||!1),n}},td=["focus","blur"],xl,Gt={bind:function(e,t,n,i,r){return td.indexOf(n)!==-1&&(r=!0),ce.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Fi(a,t,!0),o.delegateTarget&&i.call(e,o)},r)},unbind:function(e,t,n,i){return td.indexOf(t)!==-1&&(i=!0),ce.unbind(e,t,n,i)}},je=function(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body")return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild);var r,o=at[i]||at._default,a=o[0],c=o[1],l=o[2];for((r=t.createElement("div")).innerHTML=c+e+l;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=t.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},nd=!1;typeof document<"u"&&((xl=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',nd=!xl.getElementsByTagName("link").length,xl=void 0);var at={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:nd?[1,"X<div>","</div>"]:[0,"",""]};function Xe(e,t){return(t=t||document).querySelector(e)}function El(e,t){return(t=t||document).querySelectorAll(e)}function An(e){e.parentNode&&e.parentNode.removeChild(e)}function id(e,t){return t.appendChild(function(n,i){if(n.ownerDocument!==i.ownerDocument)try{return i.ownerDocument.importNode(n,!0)}catch{}return n}(e,t))}function le(e,t){return id(t,e),e}at.td=at.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],at.option=at.optgroup=[1,'<select multiple="multiple">',"</select>"],at.thead=at.tbody=at.colgroup=at.caption=at.tfoot=[1,"<table>","</table>"],at.polyline=at.ellipse=at.polygon=at.circle=at.text=at.line=at.path=at.rect=at.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var _l=2,rd={"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":_l,"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":_l,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function od(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=rd[i];r?(r===_l&&typeof n=="number"&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function K(e,t,n){if(typeof t=="string"){if(n===void 0)return function(i,r){return rd[r]?i.style[r]:i.getAttributeNS(null,r)}(e,t);od(e,t,n)}else(function(i,r){var o,a,c=Object.keys(r);for(o=0;a=c[o];o++)od(i,a,r[a])})(e,t);return e}function wl(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var W0=/\s+/,X0=Object.prototype.toString;function Sl(e){return e!==void 0}function be(e){return new li(e)}function li(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function tt(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Cl(e){for(var t;t=e.firstChild;)tt(t);return e}function ad(e){return e.cloneNode(!0)}li.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~wl(t,e)||t.push(e),Sl(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},li.prototype.remove=function(e){if(X0.call(e)==="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=wl(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},li.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},li.prototype.toggle=function(e,t){return this.list?(Sl(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(Sl(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},li.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(W0);return e[0]===""&&e.shift(),e},li.prototype.has=li.prototype.contains=function(e){return this.list?this.list.contains(e):!!~wl(this.array(),e)};var Tl={svg:"http://www.w3.org/2000/svg"},sd='<svg xmlns="'+Tl.svg+'"';function cd(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Tl.svg)===-1&&(e=sd+e.substring(4)):(e=sd+">"+e+"</svg>",t=!0);var n=function(o){var a;return(a=new DOMParser).async=!1,a.parseFromString(o,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function oe(e,t){var n;return e.charAt(0)==="<"?(n=cd(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Tl.svg,e),t&&K(n,t),n}var Al=null;function kl(){return Al===null&&(Al=oe("svg")),Al}function ld(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function bo(e){return e?kl().createSVGTransformFromMatrix(e):kl().createSVGTransform()}var ud=/([&<>]{1})/g,K0=/([\n\r"]{1})/g,Y0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Pl(e,t){return e.replace(t,function(n,i){return Y0[i]||i})}function pd(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(Pl(e.textContent,ud));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',Pl(o.value,K0),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)pd(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",Pl(e.nodeValue,ud),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function J0(e,t){var n=cd(t);if(Cl(e),t){(function(a){return a.nodeName==="#document-fragment"})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)id(r[o],e)}}function hd(e,t){if(t!==void 0){try{J0(e,t)}catch(n){throw new Error("error parsing SVG: "+n.message)}return e}return function(n){for(var i=n.firstChild,r=[];i;)pd(i,r),i=i.nextSibling;return r.join("")}(e)}function Z0(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function xo(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(i,r){var o,a;for(i.clear(),o=0;a=r[o];o++)i.appendItem(Z0(i,a))}(n,t)),n.consolidate()}var Q0=/^class /;function Ml(e){return Object.prototype.toString.call(e)==="[object Array]"}function Rl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Va(){var e=Array.prototype.slice.call(arguments);e.length===1&&Ml(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var ex=/constructor\s*[^(]*\(\s*([^)]*)\)/m,tx=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,nx=/\/\*([^*]*)\*\//m;function ix(e){if(typeof e!="function")throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(n){return Q0.test(n.toString())}(e)?ex:tx);return t&&t[1]&&t[1].split(",").map(function(n){return(t=n.match(nx))?t[1].trim():n.trim()})||[]}function rx(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}}function Nl(e,t){t=t||{get:function(f,v){if(n.push(f),v===!1)return null;throw a('No provider for "'+f+'"!')}};var n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(f){var v=n.join(" -> ");return n.length=0,new Error(v?f+" (Resolving: "+v+")":f)},c=function(f,v){if(!i[f]&&f.indexOf(".")!==-1){for(var g=f.split("."),b=c(g.shift());g.length;)b=b[g.shift()];return b}if(Rl(r,f))return r[f];if(Rl(i,f)){if(n.indexOf(f)!==-1)throw n.push(f),a("Cannot resolve circular dependency!");return n.push(f),r[f]=i[f][0](i[f][1]),n.pop(),r[f]}return t.get(f,v)},l=function(f,v){if(v===void 0&&(v={}),typeof f!="function"){if(!Ml(f))throw new Error('Cannot invoke "'+f+'". Expected a function!');f=Va(f.slice())}return{fn:f,dependencies:(f.$inject||ix(f)).map(function(g){return Rl(v,g)?v[g]:c(g)})}},u=function(f){var v=l(f),g=v.fn,b=v.dependencies;return new(Function.prototype.bind.apply(g,[null].concat(b)))},p=function(f,v,g){var b=l(f,g),S=b.fn,w=b.dependencies;return S.apply(v,w)},d=function(f){return Va(function(v){return f.get(v)})},y={factory:p,type:u,value:function(f){return f}};e.forEach(function(f){function v(w,_){return w!=="value"&&Ml(_)&&(_=Va(_.slice())),_}if(f instanceof rx)f.forEach(function(w){var _=w[0],C=w[1],B=w[2];i[_]=[y[C],v(C,B),C]});else if(typeof f=="object")if(f.__exports__){var g=Object.keys(f).reduce(function(w,_){return _.substring(0,2)!=="__"&&(w[_]=f[_]),w},Object.create(null)),b=new Nl((f.__modules__||[]).concat([g]),o),S=Va(function(w){return b.get(w)});f.__exports__.forEach(function(w){i[w]=[S,w,"private",b]})}else Object.keys(f).forEach(function(w){if(f[w][2]!=="private"){var _=f[w][0],C=f[w][1];i[w]=[y[_],v(_,C),_]}else i[w]=f[w]})}),this.get=c,this.invoke=p,this.instantiate=u,this.createChild=function(f,v){if(v&&v.length){var g,b,S,w,_=Object.create(null),C=Object.create(null),B=[],s=[],h=[];for(var m in i)g=i[m],v.indexOf(m)!==-1&&(g[2]==="private"?(b=B.indexOf(g[3]))===-1?(S=g[3].createChild([],v),w=d(S),B.push(g[3]),s.push(S),h.push(w),_[m]=[w,m,"private",S]):_[m]=[h[b],m,"private",s[b]]:_[m]=[g[2],g[1]],C[m]=!0),g[2]!=="factory"&&g[2]!=="type"||!g[1].$scope||v.forEach(function(E){g[1].$scope.indexOf(E)!==-1&&(_[m]=[g[2],g[1]],C[E]=!0)});v.forEach(function(E){if(!C[E])throw new Error('No provider for "'+E+'". Cannot use provider from the parent!')}),f.unshift(_)}return new Nl(f,o)}}var ox=1e3;function zn(e,t){var n=this;t=t||ox,e.on(["render.shape","render.connection"],t,function(i,r){var o=i.type,a=r.element,c=r.gfx,l=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(c,a,l):n.drawConnection(c,a,l)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}function br(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function dd(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function Il(e,t){var n=oe("polyline");return K(n,{points:dd(e)}),t&&K(n,t),n}function md(e){return de(e,function(t){return!Pe(e,function(n){return n!==t&&fd(t,n)})})}function fd(e,t){if(t){if(e===t)return t;if(e.parent)return fd(e.parent,t)}}function vd(e,t,n){var i=!n||e.indexOf(t)===-1;return i&&e.push(t),i}function zi(e,t,n){n=n||0,ge(e)||(e=[e]),L(e,function(i,r){var o=t(i,r,n);ge(o)&&o.length&&zi(o,t,n+1)})}function Fa(e,t){return function(n,i,r){var o=[],a=[];return zi(n,function(c,l,u){vd(o,c,i);var p=c.children;if((r===-1||u<r)&&p&&vd(a,p,i))return p}),o}(e,!t,-1)}function vt(e,t){var n,i,r,o;return t=!!t,ge(e)||(e=[e]),L(e,function(a){var c=a;a.waypoints&&!t&&(c=vt(a.waypoints,!0));var l=c.x,u=c.y,p=c.height||0,d=c.width||0;(l<n||n===void 0)&&(n=l),(u<i||i===void 0)&&(i=u),(l+d>r||r===void 0)&&(r=l+d),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:i,height:o-i,width:r-n}}function yd(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function gd(e){return!(!e||!e.isFrame)}function Eo(e,t){return z({},e||{},t||{})}zn.prototype.canRender=function(){},zn.prototype.drawShape=function(){},zn.prototype.drawConnection=function(){},zn.prototype.getShapePath=function(){},zn.prototype.getConnectionPath=function(){};function ui(e,t){zn.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}ie(ui,zn),ui.prototype.canRender=function(){return!0},ui.prototype.drawShape=function(e,t,n){var i=oe("rect");return K(i,{x:0,y:0,width:t.width||0,height:t.height||0}),gd(t)?K(i,z({},this.FRAME_STYLE,n||{})):K(i,z({},this.SHAPE_STYLE,n||{})),le(e,i),i},ui.prototype.drawConnection=function(e,t,n){var i=Il(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return le(e,i),i},ui.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return br([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},ui.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([t===0?"M":"L",n.x,n.y]);return br(r)},ui.$inject=["eventBus","styles"];const ax={__init__:["defaultRenderer"],defaultRenderer:["type",ui],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,i,r){return z(this.style(i,r),{class:n})},this.style=function(n,i){ge(n)||i||(i=n,n=[]);var r=Bt(n,function(o,a){return z(o,e[a]||{})},{});return i?z(r,i):r},this.computeStyle=function(n,i,r){return ge(i)||(r=i,i=[]),t.style(i||[],z({},r,n||{}))}}]};function Ye(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Je(e,t,n){if(e&&t){typeof n!="number"&&(n=-1);var i=e.indexOf(t);if(i!==-1){if(i===n||n===-1)return;e.splice(i,1)}n!==-1?e.splice(n,0,t):e.push(t)}}function Dl(e,t){return e&&t?e.indexOf(t):-1}function _o(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function Bl(e,t,n,i){if(i===void 0&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=_o(e,t);return Math.abs(r/o)<=i}var bd=2;function $n(e,t){var n;return function(i,r){var o;o=ge(i)?i:[i,r];var a=o.slice().shift();return ji(o,function(c){return Math.abs(a.y-c.y)<=bd})}(n=ge(e)?e:[e,t])?"h":!!function(i,r){var o;o=ge(i)?i:[i,r];var a=o.slice().shift();return ji(o,function(c){return Math.abs(a.x-c.x)<=bd})}(n)&&"v"}function xd(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function Ol(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var sx=/,?([a-z]),?/gi,Ed=parseFloat,Ze=Math,pi=Ze.PI,kn=Ze.min,Pn=Ze.max,_d=Ze.pow,hi=Ze.abs,cx=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,lx=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,za=Array.isArray||function(e){return e instanceof Array};function Ll(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wo(e){if(typeof e=="function"||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)Ll(e,n)&&(t[n]=wo(e[n]));return t}function xr(e){var t=xr.ps=xr.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)Ll(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function jl(e,t,n,i){return arguments.length===1&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function wd(){return this.join(",").replace(sx,"$1")}function $a(e){var t=wo(e);return t.toString=wd,t}function Sd(e,t,n,i,r,o,a,c,l){var u=1-l,p=_d(u,3),d=_d(u,2),y=l*l*l,f=p*t+3*d*l*i+3*u*l*l*o+y*c;return{x:Ga(p*e+3*d*l*n+3*u*l*l*r+y*a),y:Ga(f)}}function Cd(e){var t=dx.apply(null,e);return jl(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function di(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Td(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function Ad(e,t,n,i,r,o,a,c,l){l==null&&(l=1);for(var u=(l=l>1?1:l<0?0:l)/2,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],y=0,f=0;f<12;f++){var v=u*p[f]+u,g=Td(v,e,n,r,a),b=Td(v,t,i,o,c),S=g*g+b*b;y+=d[f]*Ze.sqrt(S)}return u*y}function ux(e,t,n,i,r,o,a,c){if(!(Pn(e,n)<kn(r,a)||kn(e,n)>Pn(r,a)||Pn(t,i)<kn(o,c)||kn(t,i)>Pn(o,c))){var l=(e*i-t*n)*(o-c)-(t-i)*(r*c-o*a),u=(e-n)*(o-c)-(t-i)*(r-a);if(u){var p=Ga(((e*i-t*n)*(r-a)-(e-n)*(r*c-o*a))/u),d=Ga(l/u),y=+p.toFixed(2),f=+d.toFixed(2);if(!(y<+kn(e,n).toFixed(2)||y>+Pn(e,n).toFixed(2)||y<+kn(r,a).toFixed(2)||y>+Pn(r,a).toFixed(2)||f<+kn(t,i).toFixed(2)||f>+Pn(t,i).toFixed(2)||f<+kn(o,c).toFixed(2)||f>+Pn(o,c).toFixed(2)))return{x:p,y:d}}}}function Ga(e){return Math.round(1e11*e)/1e11}function px(e,t,n){if(!function(m,E){return m=jl(m),di(E=jl(E),m.x,m.y)||di(E,m.x2,m.y)||di(E,m.x,m.y2)||di(E,m.x2,m.y2)||di(m,E.x,E.y)||di(m,E.x2,E.y)||di(m,E.x,E.y2)||di(m,E.x2,E.y2)||(m.x<E.x2&&m.x>E.x||E.x<m.x2&&E.x>m.x)&&(m.y<E.y2&&m.y>E.y||E.y<m.y2&&E.y>m.y)}(Cd(e),Cd(t)))return n?0:[];for(var i=Ad.apply(0,e),r=Ad.apply(0,t),o=kd(e)?1:~~(i/5)||1,a=kd(t)?1:~~(r/5)||1,c=[],l=[],u={},p=n?0:[],d=0;d<o+1;d++){var y=Sd.apply(0,e.concat(d/o));c.push({x:y.x,y:y.y,t:d/o})}for(d=0;d<a+1;d++)y=Sd.apply(0,t.concat(d/a)),l.push({x:y.x,y:y.y,t:d/a});for(d=0;d<o;d++)for(var f=0;f<a;f++){var v,g=c[d],b=c[d+1],S=l[f],w=l[f+1],_=hi(b.x-g.x)<.01?"y":"x",C=hi(w.x-S.x)<.01?"y":"x",B=ux(g.x,g.y,b.x,b.y,S.x,S.y,w.x,w.y);if(B){if(u[v=B.x.toFixed(9)+"#"+B.y.toFixed(9)])continue;u[v]=!0;var s=g.t+hi((B[_]-g[_])/(b[_]-g[_]))*(b.t-g.t),h=S.t+hi((B[C]-S[C])/(w[C]-S[C]))*(w.t-S.t);s>=0&&s<=1&&h>=0&&h<=1&&(n?p++:p.push({x:B.x,y:B.y,t1:s,t2:h}))}}return p}function hx(e){var t=xr(e);if(t.abs)return $a(t.abs);if(za(e)&&za(e&&e[0])||(e=function(S){if(!S)return null;var w=xr(S);if(w.arr)return wo(w.arr);var _={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},C=[];return za(S)&&za(S[0])&&(C=wo(S)),C.length||String(S).replace(cx,function(B,s,h){var m=[],E=s.toLowerCase();for(h.replace(lx,function(T,M){M&&m.push(+M)}),E=="m"&&m.length>2&&(C.push([s].concat(m.splice(0,2))),E="l",s=s=="m"?"l":"L");m.length>=_[E]&&(C.push([s].concat(m.splice(0,_[E]))),_[E]););}),C.toString=xr.toString,w.arr=wo(C),C}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,c=0,l=0;e[0][0]=="M"&&(a=r=+e[0][1],c=o=+e[0][2],l++,i[0]=["M",r,o]);for(var u,p,d=l,y=e.length;d<y;d++){if(i.push(u=[]),(n=(p=e[d])[0])!=n.toUpperCase())switch(u[0]=n.toUpperCase(),u[0]){case"A":u[1]=p[1],u[2]=p[2],u[3]=p[3],u[4]=p[4],u[5]=p[5],u[6]=+p[6]+r,u[7]=+p[7]+o;break;case"V":u[1]=+p[1]+o;break;case"H":u[1]=+p[1]+r;break;case"M":a=+p[1]+r,c=+p[2]+o;default:for(var f=1,v=p.length;f<v;f++)u[f]=+p[f]+(f%2?r:o)}else for(var g=0,b=p.length;g<b;g++)u[g]=p[g];switch(n=n.toUpperCase(),u[0]){case"Z":r=+a,o=+c;break;case"H":r=u[1];break;case"V":o=u[1];break;case"M":a=u[u.length-2],c=u[u.length-1];default:r=u[u.length-2],o=u[u.length-1]}}return i.toString=wd,t.abs=$a(i),i}function kd(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function Ua(e,t,n,i){return[e,t,n,i,n,i]}function Pd(e,t,n,i,r,o){var a=.3333333333333333,c=2/3;return[a*e+c*n,a*t+c*i,a*r+c*n,a*o+c*i,r,o]}function Md(e,t,n,i,r,o,a,c,l,u){var p,d,y=120*pi/180,f=pi/180*(+r||0),v=[],g=(d=function(Ie,We,_e){return{x:Ie*Ze.cos(_e)-We*Ze.sin(_e),y:Ie*Ze.sin(_e)+We*Ze.cos(_e)}},function Ie(){var We=Array.prototype.slice.call(arguments,0),_e=We.join("\u2400"),$e=Ie.cache=Ie.cache||{},Ke=Ie.count=Ie.count||[];return Ll($e,_e)?(function(Re,ht){for(var Se=0,Ge=Re.length;Se<Ge;Se++)if(Re[Se]===ht)return Re.push(Re.splice(Se,1)[0])}(Ke,_e),$e[_e]):(Ke.length>=1e3&&delete $e[Ke.shift()],Ke.push(_e),$e[_e]=d.apply(0,We),$e[_e])});if(u)m=u[0],E=u[1],s=u[2],h=u[3];else{e=(p=g(e,t,-f)).x,t=p.y;var b=(e-(c=(p=g(c,l,-f)).x))/2,S=(t-(l=p.y))/2,w=b*b/(n*n)+S*S/(i*i);w>1&&(n*=w=Ze.sqrt(w),i*=w);var _=n*n,C=i*i,B=(o==a?-1:1)*Ze.sqrt(hi((_*C-_*S*S-C*b*b)/(_*S*S+C*b*b))),s=B*n*S/i+(e+c)/2,h=B*-i*b/n+(t+l)/2,m=Ze.asin(((t-h)/i).toFixed(9)),E=Ze.asin(((l-h)/i).toFixed(9));(m=e<s?pi-m:m)<0&&(m=2*pi+m),(E=c<s?pi-E:E)<0&&(E=2*pi+E),a&&m>E&&(m-=2*pi),!a&&E>m&&(E-=2*pi)}var T=E-m;if(hi(T)>y){var M=E,N=c,$=l;E=m+y*(a&&E>m?1:-1),v=Md(c=s+n*Ze.cos(E),l=h+i*Ze.sin(E),n,i,r,0,a,N,$,[E,M,s,h])}T=E-m;var P=Ze.cos(m),x=Ze.sin(m),I=Ze.cos(E),j=Ze.sin(E),G=Ze.tan(T/4),X=4/3*n*G,ee=4/3*i*G,re=[e,t],se=[e+X*x,t-ee*P],H=[c+X*j,l-ee*I],q=[c,l];if(se[0]=2*re[0]-se[0],se[1]=2*re[1]-se[1],u)return[se,H,q].concat(v);for(var xe=[],ze=0,ct=(v=[se,H,q].concat(v).join().split(",")).length;ze<ct;ze++)xe[ze]=ze%2?g(v[ze-1],v[ze],f).y:g(v[ze],v[ze+1],f).x;return xe}function dx(e,t,n,i,r,o,a,c){for(var l,u,p,d,y,f,v,g,b=[],S=[[],[]],w=0;w<2;++w)if(w==0?(u=6*e-12*n+6*r,l=-3*e+9*n-9*r+3*a,p=3*n-3*e):(u=6*t-12*i+6*o,l=-3*t+9*i-9*o+3*c,p=3*i-3*t),hi(l)<1e-12){if(hi(u)<1e-12)continue;0<(d=-p/u)&&d<1&&b.push(d)}else v=u*u-4*p*l,g=Ze.sqrt(v),v<0||(0<(y=(-u+g)/(2*l))&&y<1&&b.push(y),0<(f=(-u-g)/(2*l))&&f<1&&b.push(f));for(var _,C=b.length,B=C;C--;)_=1-(d=b[C]),S[0][C]=_*_*_*e+3*_*_*d*n+3*_*d*d*r+d*d*d*a,S[1][C]=_*_*_*t+3*_*_*d*i+3*_*d*d*o+d*d*d*c;return S[0][B]=e,S[1][B]=t,S[0][B+1]=a,S[1][B+1]=c,S[0].length=S[1].length=B+2,{x0:kn.apply(0,S[0]),y0:kn.apply(0,S[1]),x1:Pn.apply(0,S[0]),y1:Pn.apply(0,S[1])}}function Rd(e){var t=xr(e);if(t.curve)return $a(t.curve);for(var n=hx(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(f,v,g){var b,S;if(!f)return["C",v.x,v.y,v.x,v.y,v.x,v.y];switch(!(f[0]in{T:1,Q:1})&&(v.qx=v.qy=null),f[0]){case"M":v.X=f[1],v.Y=f[2];break;case"A":f=["C"].concat(Md.apply(0,[v.x,v.y].concat(f.slice(1))));break;case"S":g=="C"||g=="S"?(b=2*v.x-v.bx,S=2*v.y-v.by):(b=v.x,S=v.y),f=["C",b,S].concat(f.slice(1));break;case"T":g=="Q"||g=="T"?(v.qx=2*v.x-v.qx,v.qy=2*v.y-v.qy):(v.qx=v.x,v.qy=v.y),f=["C"].concat(Pd(v.x,v.y,v.qx,v.qy,f[1],f[2]));break;case"Q":v.qx=f[1],v.qy=f[2],f=["C"].concat(Pd(v.x,v.y,f[1],f[2],f[3],f[4]));break;case"L":f=["C"].concat(Ua(v.x,v.y,f[1],f[2]));break;case"H":f=["C"].concat(Ua(v.x,v.y,f[1],v.y));break;case"V":f=["C"].concat(Ua(v.x,v.y,v.x,f[1]));break;case"Z":f=["C"].concat(Ua(v.x,v.y,v.X,v.Y))}return f},o=function(f,v){if(f[v].length>7){f[v].shift();for(var g=f[v];g.length;)a[v]="A",f.splice(v++,0,["C"].concat(g.splice(0,6)));f.splice(v,1),p=n.length}},a=[],c="",l="",u=0,p=n.length;u<p;u++){n[u]&&(c=n[u][0]),c!="C"&&(a[u]=c,u&&(l=a[u-1])),n[u]=r(n[u],i,l),a[u]!="A"&&c=="C"&&(a[u]="C"),o(n,u);var d=n[u],y=d.length;i.x=d[y-2],i.y=d[y-1],i.bx=Ed(d[y-4])||i.x,i.by=Ed(d[y-3])||i.y}return t.curve=$a(n),n}const Nd=oo(function(e,t,n){e=Rd(e),t=Rd(t);for(var i,r,o,a,c,l,u,p,d,y,f=n?0:[],v=0,g=e.length;v<g;v++){var b=e[v];if(b[0]=="M")i=c=b[1],r=l=b[2];else{b[0]=="C"?(d=[i,r].concat(b.slice(1)),i=d[6],r=d[7]):(d=[i,r,i,r,c,l,c,l],i=c,r=l);for(var S=0,w=t.length;S<w;S++){var _=t[S];if(_[0]=="M")o=u=_[1],a=p=_[2];else{_[0]=="C"?(y=[o,a].concat(_.slice(1)),o=y[6],a=y[7]):(y=[o,a,o,a,u,p,u,p],o=u,a=p);var C=px(d,y,n);if(n)f+=C;else{for(var B=0,s=C.length;B<s;B++)C[B].segment1=v,C[B].segment2=S,C[B].bez1=d,C[B].bez2=y;f=f.concat(C)}}}}}return f});function Id(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function $i(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function ae(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Vl(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function fe(e){return $i({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function yt(e,t,n){et(n=n||0)||(n={x:n,y:n});var i=ae(e),r=ae(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,c=i.top-n.y>=r.bottom,l=o?"top":c?"bottom":null,u=i.right+n.x<=r.left?"left":a?"right":null;return u&&l?l+"-"+u:u||l||"intersect"}function Fl(e,t,n){var i=Nd(e,t);return i.length===1||i.length===2&&_o(i[0],i[1])<1?$i(i[0]):i.length>1?(i=Xt(i,function(r){var o=Math.floor(100*r.t2)||1;return o=((o=100-o)<10?"0":"")+o,r.segment2+"#"+o}),$i(i[n?0:i.length-1])):null}function Ha(e,t){return Math.round(e*t)/t}function Dd(e){return pe(e)?e+"px":e}function Bd(e,t,n){var i=oe("g");be(i).add(t);var r=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var qa="base",zl="djs-element-hidden",mx={shape:["x","y","width","height"],connection:["waypoints"]};function ve(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}function Od(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}ve.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ve.prototype._init=function(e){var t=this._eventBus,n=this._container=function(o){var a=(o=z({},{width:"100%",height:"100%"},o)).container||document.body,c=document.createElement("div");return c.setAttribute("class","djs-container"),z(c.style,{position:"relative",overflow:"hidden",width:Dd(o.width),height:Dd(o.height)}),a.appendChild(c),c}(e),i=this._svg=oe("svg");K(i,{width:"100%",height:"100%"}),le(n,i);var r=this._viewport=Bd(i,"viewport");this._layers={},this._planes={},e.deferUpdate!==!1&&(this._viewboxChanged=vl(St(this._viewboxChanged,this),300)),t.on("diagram.init",function(){t.fire("canvas.init",{svg:i,viewport:r})},this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","plane.set"],function(){delete this._cachedViewbox},this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},ve.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._activePlane,delete this._viewport},ve.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=yd(t);n==="root"?e.setRootElementForPlane(null,e.findPlane(t),!0):e._removeElement(t,n)}),this._activePlane=null,this._planes={},delete this._cachedViewbox},ve.prototype.getDefaultLayer=function(){return this.getLayer(qa,0)},ve.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),t!==void 0&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},ve.prototype._createLayer=function(e,t){t===void 0&&(t=1);var n=Bt(this._layers,function(i,r){return t>=r.index&&i++,i},0);return{group:Bd(this._viewport,"layer-"+e,n),index:t}},ve.prototype.getPlane=function(e){if(!e)throw new Error("must specify a name");return this._planes[e]},ve.prototype.createPlane=function(e,t){if(!e)throw new Error("must specify a name");if(this._planes[e])throw new Error("plane "+e+" already exists");t||(t={id:"__implicitroot"+e,children:[],isImplicit:!0});var n=this.getLayer(e,0);be(n).add(zl);var i=this._planes[e]={layer:n,name:e,rootElement:null};return this.setRootElementForPlane(t,i),i},ve.prototype.setActivePlane=function(e){if(!e)throw new Error("must specify a plane");return typeof e=="string"&&(e=this.getPlane(e)),this._activePlane&&be(this._activePlane.layer).add(zl),this._activePlane=e,be(e.layer).remove(zl),e.rootElement&&this._elementRegistry.updateGraphics(e.rootElement,this._svg,!0),this._eventBus.fire("plane.set",{plane:e}),e},ve.prototype.getActiveLayer=function(){return this.getActivePlane().layer},ve.prototype.getActivePlane=function(){var e=this._activePlane;return e||(e=this.createPlane(qa),this.setActivePlane(qa)),e},ve.prototype.findPlane=function(e){typeof e=="string"&&(e=this._elementRegistry.get(e));var t=function(n){for(;n.parent;)n=n.parent;return n}(e);return Pe(this._planes,function(n){return n.rootElement===t})},ve.prototype.getContainer=function(){return this._container},ve.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(L([i.gfx,i.secondaryGfx],function(r){r&&(n?be(r).add(t):be(r).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},ve.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ve.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ve.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),be(this.getGraphics(e)).has(t)},ve.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ve.prototype.getRootElement=function(){return this.getActivePlane().rootElement},ve.prototype.setRootElement=function(e,t){var n=this._activePlane;if(n)return this.setRootElementForPlane(e,n,t);var i=this.createPlane(qa,e);return this.setActivePlane(i),i.rootElement},ve.prototype.setRootElementForPlane=function(e,t,n){typeof t=="string"&&(t=this.getPlane(t)),e&&this._ensureValid("root",e);var i=t.rootElement,r=this._elementRegistry,o=this._eventBus;if(i){if(!n)throw new Error("rootElement already set, need to specify override");o.fire("root.remove",{element:i}),o.fire("root.removed",{element:i}),r.remove(i)}if(e){var a=t.layer;o.fire("root.add",{element:e}),r.add(e,a),o.fire("root.added",{element:e,gfx:a}),t===this._activePlane&&this._elementRegistry.updateGraphics(e,this._svg,!0)}return t.rootElement=e,e},ve.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element with id "+t.id+" already exists");var n=mx[e],i=ji(n,function(r){return t[r]!==void 0});if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},ve.prototype._setParent=function(e,t,n){Je(t.children,e,n),e.parent=t},ve.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},ve.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},ve.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},ve.prototype._removeElement=function(e,t){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),Ye(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},ve.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ve.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ve.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ve.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ve.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ve.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,o,a,c=this._viewport,l=this.getSize();return e?(this._changeViewbox(function(){r=Math.min(l.width/e.width,l.height/e.height);var u=this._svg.createSVGMatrix().scale(r).translate(-e.x,-e.y);xo(c,u)}),e):(t=this._activePlane&&this._activePlane.layer.getBBox()||{},n=(i=xo(c))?i.matrix:function(u,p,d,y,f,v){var g=kl().createSVGMatrix();switch(arguments.length){case 0:return g;case 1:return ld(g,u);case 6:return ld(g,{a:u,b:p,c:d,d:y,e:f,f:v})}}(),r=Ha(n.a,1e3),o=Ha(-n.e||0,1e3),a=Ha(-n.f||0,1e3),e=this._cachedViewbox={x:o?o/r:0,y:a?a/r:0,width:l.width/r,height:l.height/r,scale:r,inner:{width:t.width||0,height:t.height||0,x:t.x||0,y:t.y||0},outer:l})},ve.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Od(t,n)}),{x:n.e,y:n.f}},ve.prototype.scrollToElement=function(e,t){var n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));var i=this.findPlane(e);i!==this._activePlane&&this.setActivePlane(i),t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var r,o,a=vt(e),c=ae(a),l=this.viewbox(),u=this.zoom();l.y+=t.top/u,l.x+=t.left/u,l.width-=(t.right+t.left)/u,l.height-=(t.bottom+t.top)/u;var p=ae(l);if(a.width<l.width&&a.height<l.height){var d=Math.max(0,c.right-p.right),y=Math.min(0,c.left-p.left),f=Math.max(0,c.bottom-p.bottom),v=Math.min(0,c.top-p.top);r=d||y,o=f||v}else r=a.x-l.x,o=a.y-l.y;this.scroll({dx:-r*u,dy:-o*u})},ve.prototype.zoom=function(e,t){return e?e==="fit-viewport"?this._fitViewport(t):(this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),Ha(i.a,1e3)):this.viewbox(e).scale;var n,i},ve.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,o=i.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(t=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(e?o.width/2-r.width/t/2:0),y:o.y+(e?o.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},ve.prototype._setZoom=function(e,t){var n,i,r,o,a=this._svg,c=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),p=(i=c.getCTM()).a;return t?(n=z(u,t).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/p*e).translate(-n.x,-n.y),o=i.multiply(r)):o=l.scale(e),Od(this._viewport,o),o},ve.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ve.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();return e.waypoints?t=this.getGraphics(e).getBBox():t=e,{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},ve.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Er="data-element-id";function Ut(e){this._elements={},this._eventBus=e}Ut.$inject=["eventBus"],Ut.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),K(t,Er,i),n&&K(n,Er,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Ut.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(K(i.gfx,Er,""),i.secondaryGfx&&K(i.secondaryGfx,Er,""),delete t[n])},Ut.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Ut.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,K(t,Er,i),t},Ut.prototype.get=function(e){var t;t=typeof e=="string"?e:e&&K(e,Er);var n=this._elements[t];return n&&n.element},Ut.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Ut.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},Ut.prototype.getAll=function(){return this.filter(function(e){return e})},Ut.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)})},Ut.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Ut.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var $l={exports:{}},Wa={};Wa.extend=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,r,i)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var c=this.indexOf(o);if(a===void 0){if(c!==-1)return;a=this.length}c!==-1&&this.splice(c,1),this.splice(a,0,o),c===-1&&t.set(o,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},Wa.isExtended=function(e){return e.__refs_collection===!0};var Ld=Wa;function jd(e,t,n){var i=Ld.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(r){e.set(r,t.inverse,n)})}function mi(e,t){if(!(this instanceof mi))return new mi(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}mi.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?jd(this,t,e):function(n,i,r){var o=i.inverse,a=r[i.name];Object.defineProperty(r,i.name,{configurable:i.configurable,enumerable:i.enumerable,get:function(){return a},set:function(c){if(c!==a){var l=a;a=null,l&&n.unset(l,o,r),a=c,n.set(a,o,r)}}})}(this,t,e)},mi.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Ld.isExtended(n)||jd(this,t,e),n},mi.prototype.ensureBound=function(e,t){(function(n,i){return Object.prototype.hasOwnProperty.call(n,i.name||i)})(e,t)||this.bind(e,t)},mi.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},mi.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var fx=mi;$l.exports=fx,$l.exports.Collection=Wa;const _r=oo($l.exports);var Vd=new _r({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Fd=new _r({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),zd=new _r({name:"attachers",collection:!0},{name:"host"}),$d=new _r({name:"outgoing",collection:!0},{name:"source"}),Gd=new _r({name:"incoming",collection:!0},{name:"target"});function So(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Vd.bind(this,"parent"),Fd.bind(this,"labels"),$d.bind(this,"outgoing"),Gd.bind(this,"incoming")}function wr(){So.call(this),Vd.bind(this,"children"),zd.bind(this,"host"),zd.bind(this,"attachers")}function Ud(){wr.call(this)}function Xa(){wr.call(this),Fd.bind(this,"labelTarget")}function Hd(){So.call(this),$d.bind(this,"source"),Gd.bind(this,"target")}ie(wr,So),ie(Ud,wr),ie(Xa,wr),ie(Hd,So);var vx={connection:Hd,shape:wr,label:Xa,root:Ud};function Gn(){this._uid=12}Gn.prototype.createRoot=function(e){return this.create("root",e)},Gn.prototype.createLabel=function(e){return this.create("label",e)},Gn.prototype.createShape=function(e){return this.create("shape",e)},Gn.prototype.createConnection=function(e){return this.create("connection",e)},Gn.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(n,i){var r=vx[n];if(!r)throw new Error("unknown type: <"+n+">");return z(new r,i)}(e,t)};var Ka="__fn",yx=Array.prototype.slice;function Ot(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Co(){}function Ya(e){return e.childNodes[0]}function Gl(e,t,n,i,r){var o=bo();o.setTranslate(t,n);var a=bo();a.setRotate(i||0,0,0);var c=bo();c.setScale(r||1,r||1),xo(e,[o,a,c])}function Lt(e,t,n){var i=bo();i.setTranslate(t,n),xo(e,i)}function qd(e,t){var n=bo();n.setRotate(t,0,0),xo(e,n)}function Ht(e,t){this._eventBus=e,this._elementRegistry=t}function Wd(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}Ot.prototype.on=function(e,t,n,i){if(e=ge(e)?e:[e],ft(t)&&(i=n,n=t,t=1e3),!pe(t))throw new Error("priority must be a number");var r=n;i&&((r=St(n,i))[Ka]=n[Ka]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:r,next:null})})},Ot.prototype.once=function(e,t,n,i){var r=this;if(ft(t)&&(i=n,n=t,t=1e3),!pe(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(e,o),a}o[Ka]=n,this.on(e,t,o)},Ot.prototype.off=function(e,t){e=ge(e)?e:[e];var n=this;e.forEach(function(i){n._removeListener(i,t)})},Ot.prototype.createEvent=function(e){var t=new Co;return t.init(e),t},Ot.prototype.fire=function(e,t){var n,i,r,o;if(o=yx.call(arguments),typeof e=="object"&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof Co?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},Ot.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},Ot.prototype._destroy=function(){this._listeners={}},Ot.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Ot.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(r,o){return r.apply(null,o)}(n.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i},Ot.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},Ot.prototype._getListeners=function(e){return this._listeners[e]},Ot.prototype._setListeners=function(e,t){this._listeners[e]=t},Ot.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[Ka]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},Co.prototype.stopPropagation=function(){this.cancelBubble=!0},Co.prototype.preventDefault=function(){this.defaultPrevented=!0},Co.prototype.init=function(e){z(this,e||{})},Ht.$inject=["eventBus","elementRegistry"],Ht.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(i){return i.parentNode.childNodes[1]}(n),t||(be(t=oe("g")).add("djs-children"),le(n.parentNode,t))):t=n,t},Ht.prototype._clear=function(e){var t=Ya(e);return La(t),t},Ht.prototype._createContainer=function(e,t,n,i){var r=oe("g");be(r).add("djs-group"),n!==void 0?Wd(r,t,t.childNodes[n]):le(t,r);var o=oe("g");be(o).add("djs-element"),be(o).add("djs-"+e),i&&be(o).add("djs-frame"),le(r,o);var a=oe("g");return be(a).add("djs-visual"),le(o,a),o},Ht.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,gd(t))},Ht.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=Bt(e,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),L(t,function(r){var o=r.children;if(o){var a=n._getChildrenContainer(r);L(o.slice().reverse(),function(c){Wd(i.getGraphics(c).parentNode,a)})}})},Ht.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Ht.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Ht.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Ht.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Ht.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if(e==="shape")this.drawShape(i,t),Lt(n,t.x,t.y);else{if(e!=="connection")throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?K(n,"display","none"):K(n,"display","block")}},Ht.prototype.remove=function(e){tt(this._elementRegistry.getGraphics(e).parentNode)};const gx={__depends__:[ax],__init__:["canvas"],canvas:["type",ve],elementRegistry:["type",Ut],elementFactory:["type",Gn],eventBus:["type",Ot],graphicsFactory:["type",Ht]};function bx(e){var t=[],n=[];function i(o){return t.indexOf(o)>=0}e.forEach(function o(a){i(a)||((a.__depends__||[]).forEach(o),i(a)||(function(c){t.push(c)}(a),(a.__init__||[]).forEach(function(c){n.push(c)})))});var r=new Nl(t);return n.forEach(function(o){try{r[typeof o=="string"?"get":"invoke"](o)}catch(a){throw console.error("Failed to instantiate component"),console.error(a.stack),a}}),r}function Sr(e,t){this.injector=t=t||function(n){return bx([{config:["value",n=n||{}]},gx].concat(n.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function Ul(){}function Xd(e,t){this.model=e,this.properties=t}Sr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Sr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Ul.prototype.get=function(e){return this.$model.properties.get(this,e)},Ul.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Xd.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Ul.prototype);L(e.properties,function(a){a.isMany||a.default===void 0||(i[a.name]=a.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(a){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),L(a,St(function(c,l){this.set(l,c)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var xx={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Kd={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Hl(e,t){var n=Kd[e];return n?n(t):t}function ql(e){return!!xx[e]}function Yd(e){return!!Kd[e]}function kt(e,t){var n,i,r=e.split(/:/);if(r.length===1)n=e,i=t;else{if(r.length!==2)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Jt(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function fi(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,L(e,St(this.registerPackage,this))}function Jd(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Cr(e){this.model=e}function Zd(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Zt(e){this.properties=new Cr(this),this.factory=new Xd(this,this.properties),this.registry=new fi(e,this.properties),this.typeCache={}}Jt.prototype.build=function(){return Yt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Jt.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var i=this.properties;t!==void 0?i.splice(t,0,e):i.push(e)},Jt.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var c=r.indexOf(e);if(c===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(c,1),this.addProperty(t,n?void 0:c,a),o[i.name]=o[i.localName]=t},Jt.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=kt(r[0],i),a=kt(r[1],o.prefix).name,c=this.propertiesByName[a];if(!c)throw new Error("refined property <"+a+"> not found");this.replaceProperty(c,e,n),delete e.redefines},Jt.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Jt.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Jt.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Jt.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Jt.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Jt.prototype.hasProperty=function(e){return this.propertiesByName[e]},Jt.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(L(e.properties,St(function(o){o=z({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,c=o.redefines;a||c?this.redefineProperty(o,a||c,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(e),n[r]=e)},fi.prototype.getPackage=function(e){return this.packageMap[e]},fi.prototype.getPackages=function(){return this.packages},fi.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;Jd(t,e,"prefix"),Jd(t,e,"uri"),L(e.types,St(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},fi.prototype.registerType=function(e,t){var n=kt((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z(e.meta||{})})).name,t.prefix),i=n.name,r={};L(e.properties,St(function(o){var a=kt(o.name,n.prefix),c=a.name;ql(o.type)||(o.type=kt(o.type,a.prefix).name),z(o,{ns:a,name:c}),r[c]=o},this)),z(e,{ns:n,name:i,propertiesByName:r}),L(e.extends,St(function(o){var a=this.typeMap[o];a.traits=a.traits||[],a.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},fi.prototype.mapTypes=function(e,t,n){var i=ql(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(c){return a(c,!0)}function a(c,l){var u=kt(c,ql(c)?"":e.prefix);r.mapTypes(u,t,l)}if(!i)throw new Error("unknown type <"+e.name+">");L(i.superClass,n?o:a),t(i,!n),L(i.traits,o)},fi.prototype.getEffectiveDescriptor=function(e){var t=kt(e),n=new Jt(t);this.mapTypes(t,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},fi.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Cr.prototype.set=function(e,t,n){if(!Dt(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;n===void 0?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:Zd(e,i,n):e.$attrs[t]=n},Cr.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&Zd(e,n,[]),e[i]},Cr.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Cr.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Cr.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Zt.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Zt.prototype.getType=function(e){var t=this.typeCache,n=Dt(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Zt.prototype.createAny=function(e,t,n){var i=kt(e),r={$type:e,$instanceOf:function(a){return a===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),L(n,function(a,c){et(a)&&a.value!==void 0?r[a.name]=a.value:r[c]=a}),r},Zt.prototype.getPackage=function(e){return this.registry.getPackage(e)},Zt.prototype.getPackages=function(){return this.registry.getPackages()},Zt.prototype.getElementDescriptor=function(e){return e.$descriptor},Zt.prototype.hasType=function(e,t){return t===void 0&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Zt.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Zt.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Ex=String.fromCharCode,_x=Object.prototype.hasOwnProperty,wx=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,To={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Sx(e,t,n,i){return i?_x.call(To,i)?To[i]:"&"+i+";":Ex(t||parseInt(n,16))}function Gi(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(wx,Sx):e}Object.keys(To).forEach(function(e){To[e.toUpperCase()]=To[e]});var Qd="xsi:type",em="non-whitespace outside of root node";function Tr(e){return new Error(e)}function tm(e){return"missing namespace for prefix <"+e+">"}function Ja(e){return{get:e,enumerable:!0}}function Cx(e){var t,n={};for(t in e)n[t]=e[t];return n}function Wl(e){return e+"$uri"}function nm(){return{line:0,column:0}}function Tx(e){throw e}function im(e){if(!this)return new im(e);var t,n,i,r,o,a,c,l,u,p=e&&e.proxy,d=Tx,y=nm,f=!1,v=!1,g=null,b=!1;function S(_){_ instanceof Error||(_=Tr(_)),g=_,d(_,y)}function w(_){o&&(_ instanceof Error||(_=Tr(_)),o(_,y))}this.on=function(_,C){if(typeof C!="function")throw Tr("required args <name, cb>");switch(_){case"openTag":n=C;break;case"text":t=C;break;case"closeTag":i=C;break;case"error":d=C;break;case"warn":o=C;break;case"cdata":r=C;break;case"attention":l=C;break;case"question":c=C;break;case"comment":a=C;break;default:throw Tr("unsupported event: "+_)}return this},this.ns=function(_){if(_===void 0&&(_={}),typeof _!="object")throw Tr("required args <nsMap={}>");var C,B={};for(C in _)B[C]=_[C];return B["http://www.w3.org/2001/XMLSchema-instance"]="xsi",v=!0,u=B,this},this.parse=function(_){if(typeof _!="string")throw Tr("required args <xml=string>");return g=null,function(C){var B,s,h,m,E,T,M,N,$,P,x,I=v?[]:null,j=v?function(Ie){var We,_e,$e={};for(We in Ie)$e[_e=Ie[We]]=_e,$e[Wl(_e)]=We;return $e}(u):null,G=[],X=0,ee=!1,re=!1,se=0,H=0,q="",xe=0;function ze(){if(x!==null)return x;var Ie,We,_e,$e,Ke,Re,ht,Se,Ge,he,Oe,Di=v&&j.xmlns,hr=v&&f?[]:null,Qe=xe,_t=q,xn=_t.length,Bi={},Yc={};e:for(;Qe<xn;Qe++)if(Ge=!1,!((he=_t.charCodeAt(Qe))===32||he<14&&he>8)){for((he<65||he>122||he>90&&he<97)&&he!==95&&he!==58&&(w("illegal first char attribute name"),Ge=!0),Oe=Qe+1;Oe<xn;Oe++)if(!((he=_t.charCodeAt(Oe))>96&&he<123||he>64&&he<91||he>47&&he<59||he===46||he===45||he===95)){if(he===32||he<14&&he>8){w("missing attribute value"),Qe=Oe;continue e}if(he===61)break;w("illegal attribute name char"),Ge=!0}if((Se=_t.substring(Qe,Oe))==="xmlns:xmlns"&&(w("illegal declaration of xmlns"),Ge=!0),(he=_t.charCodeAt(Oe+1))===34)(Oe=_t.indexOf('"',Qe=Oe+2))===-1&&(Oe=_t.indexOf("'",Qe))!==-1&&(w("attribute value quote missmatch"),Ge=!0);else if(he===39)(Oe=_t.indexOf("'",Qe=Oe+2))===-1&&(Oe=_t.indexOf('"',Qe))!==-1&&(w("attribute value quote missmatch"),Ge=!0);else for(w("missing attribute value quotes"),Ge=!0,Oe+=1;Oe<xn&&!((he=_t.charCodeAt(Oe+1))===32||he<14&&he>8);Oe++);for(Oe===-1&&(w("missing closing quotes"),Oe=xn,Ge=!0),Ge||(Re=_t.substring(Qe,Oe)),Qe=Oe;Oe+1<xn&&!((he=_t.charCodeAt(Oe+1))===32||he<14&&he>8);Oe++)Qe===Oe&&(w("illegal character after attribute end"),Ge=!0);if(Qe=Oe+1,!Ge)if(Se in Yc)w("attribute <"+Se+"> already defined");else if(Yc[Se]=!0,v)if(f){if((Ke=Se==="xmlns"?"xmlns":Se.charCodeAt(0)===120&&Se.substr(0,6)==="xmlns:"?Se.substr(6):null)!==null){if(Ie=Gi(Re),We=Wl(Ke),!(ht=u[Ie])){if(Ke==="xmlns"||We in j&&j[We]!==Ie)do ht="ns"+X++;while(j[ht]!==void 0);else ht=Ke;u[Ie]=ht}j[Ke]!==ht&&($e||(j=Cx(j),$e=!0),j[Ke]=ht,Ke==="xmlns"&&(j[Wl(ht)]=Ie,Di=ht),j[We]=Ie),Bi[Se]=Re;continue}hr.push(Se,Re)}else(he=Se.indexOf(":"))!==-1?(_e=j[Se.substring(0,he)])?((Se=Di===_e?Se.substr(he+1):_e+Se.substr(he))===Qd&&((he=Re.indexOf(":"))!==-1?(_e=Re.substring(0,he),Re=(_e=j[_e]||_e)+Re.substring(he)):Re=Di+":"+Re),Bi[Se]=Re):w(tm(Se.substring(0,he))):Bi[Se]=Re;else Bi[Se]=Re}if(f)for(Qe=0,xn=hr.length;Qe<xn;Qe++){if(Se=hr[Qe++],Re=hr[Qe],(he=Se.indexOf(":"))!==-1){if(!(_e=j[Se.substring(0,he)])){w(tm(Se.substring(0,he)));continue}(Se=Di===_e?Se.substr(he+1):_e+Se.substr(he))===Qd&&((he=Re.indexOf(":"))!==-1?(_e=Re.substring(0,he),Re=(_e=j[_e]||_e)+Re.substring(he)):Re=Di+":"+Re)}Bi[Se]=Re}return x=Bi}function ct(){for(var Ie,We,_e=/(\r\n|\r|\n)/g,$e=0,Ke=0,Re=0,ht=H;se>=Re&&(Ie=_e.exec(C))&&!((ht=Ie[0].length+Ie.index)>se);)$e+=1,Re=ht;return se==-1?(Ke=ht,We=C.substring(H)):H===0?We=C.substring(H,se):(Ke=se-Re,We=H==-1?C.substring(se):C.substring(se,H+1)),{data:We,line:$e,column:Ke}}for(y=ct,p&&(P=Object.create({},{name:Ja(function(){return N}),originalName:Ja(function(){return $}),attrs:Ja(ze),ns:Ja(function(){return j})}));H!==-1;){if((se=C.charCodeAt(H)===60?H:C.indexOf("<",H))===-1)return G.length?S("unexpected end of file"):H===0?S("missing start tag"):void(H<C.length&&C.substring(H).trim()&&w(em));if(H!==se){if(G.length){if(t&&(t(C.substring(H,se),Gi,y),b))return}else if(C.substring(H,se).trim()&&(w(em),b))return}if((E=C.charCodeAt(se+1))===33){if((m=C.charCodeAt(se+2))===91&&C.substr(se+3,6)==="CDATA["){if((H=C.indexOf("]]>",se))===-1)return S("unclosed cdata");if(r&&(r(C.substring(se+9,H),y),b))return;H+=3;continue}if(m===45&&C.charCodeAt(se+3)===45){if((H=C.indexOf("-->",se))===-1)return S("unclosed comment");if(a&&(a(C.substring(se+4,H),Gi,y),b))return;H+=3;continue}}if(E!==63){for(s=se+1;;s++){if(T=C.charCodeAt(s),isNaN(T))return H=-1,S("unclosed tag");if(T===34)s=(m=C.indexOf('"',s+1))!==-1?m:s;else if(T===39)s=(m=C.indexOf("'",s+1))!==-1?m:s;else if(T===62){H=s;break}}if(E!==33){if(x={},E===47){if(ee=!1,re=!0,!G.length)return S("missing open tag");if(s=N=G.pop(),m=se+2+s.length,C.substring(se+2,m)!==s)return S("closing tag mismatch");for(;m<H;m++)if(!((E=C.charCodeAt(m))===32||E>8&&E<14))return S("close tag")}else{if(C.charCodeAt(H-1)===47?(s=N=C.substring(se+1,H-1),ee=!0,re=!0):(s=N=C.substring(se+1,H),ee=!0,re=!1),!(E>96&&E<123||E>64&&E<91||E===95||E===58))return S("illegal first char nodeName");for(m=1,h=s.length;m<h;m++)if(!((E=s.charCodeAt(m))>96&&E<123||E>64&&E<91||E>47&&E<59||E===45||E===95||E==46)){if(E===32||E<14&&E>8){N=s.substring(0,m),x=null;break}return S("invalid nodeName")}re||G.push(N)}if(v){if(B=j,ee&&(re||I.push(B),x===null&&(f=s.indexOf("xmlns",m)!==-1)&&(xe=m,q=s,ze(),f=!1)),$=N,(E=N.indexOf(":"))!==-1){if(!(M=j[N.substring(0,E)]))return S("missing namespace on <"+$+">");N=N.substr(E+1)}else M=j.xmlns;M&&(N=M+":"+N)}if(ee&&(xe=m,q=s,n&&(p?n(P,Gi,re,y):n(N,ze,Gi,re,y),b)))return;if(re){if(i&&(i(p?P:N,Gi,ee,y),b))return;v&&(j=ee?B:I.pop())}H+=1}else{if(l&&(l(C.substring(se,H+1),Gi,y),b))return;H+=1}}else{if((H=C.indexOf("?>",se))===-1)return S("unclosed question");if(c&&(c(C.substring(se,H+2),y),b))return;H+=2}}}(_),y=nm,b=!1,g},this.stop=function(){b=!0}}function rm(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Ax={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Za="xsi:type";function om(e){return e.xml&&e.xml.serialize}function am(e){return om(e)===Za}function sm(e,t){return rm(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function vi(e){return new Error(e)}function Un(e){return e.$descriptor}function kx(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw vi("expected element");var n,i=this.elementsById,r=Un(t).idProperty;if(r&&(n=t.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(n))throw new Error("illegal ID <"+n+">");if(i[n])throw vi("duplicate ID <"+n+">");i[n]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Ao(){}function Xl(){}function Ar(){}function ko(e,t){this.property=e,this.context=t}function Kl(e,t){this.element=t,this.propertyDesc=e}function Qa(){}function Ct(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Yl(e,t,n){Ct.call(this,e,t,n)}function kr(e,t,n){this.model=e,this.context=n}function Jl(e){e instanceof Zt&&(e={model:e}),z(this,{lax:!1},e)}Ao.prototype.handleEnd=function(){},Ao.prototype.handleText=function(){},Ao.prototype.handleNode=function(){},Xl.prototype=Object.create(Ao.prototype),Xl.prototype.handleNode=function(){return this},Ar.prototype=Object.create(Ao.prototype),Ar.prototype.handleText=function(e){this.body=(this.body||"")+e},ko.prototype=Object.create(Ar.prototype),ko.prototype.handleNode=function(e){if(this.element)throw vi("expected no sub nodes");return this.element=this.createReference(e),this},ko.prototype.handleEnd=function(){this.element.id=this.body},ko.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Kl.prototype=Object.create(Ar.prototype),Kl.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Hl(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Qa.prototype=Object.create(Ar.prototype),Qa.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},Ct.prototype=Object.create(Qa.prototype),Ct.prototype.addReference=function(e){this.context.addReference(e)},Ct.prototype.handleText=function(e){if(!Un(this.element).bodyProperty)throw vi("unexpected body text <"+e+">");Ar.prototype.handleText.call(this,e)},Ct.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Un(t).bodyProperty;n&&e!==void 0&&(e=Hl(n.type,e),t.set(n.name,e))},Ct.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Un(i),o=this.context,a=new i({}),c=this.model;return L(n,function(l,u){var p=r.propertiesByName[u];p&&p.isReference?p.isMany?L(l.split(" "),function(d){o.addReference({element:a,property:p.ns.name,id:d})}):o.addReference({element:a,property:p.ns.name,id:l}):(p?l=Hl(p.type,l):u!=="xmlns"&&(t=kt(u,r.ns.prefix),c.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+u+">",element:a,property:u,value:l})),a.set(u,l))}),a},Ct.prototype.getPropertyForNode=function(e){var t,n,i=kt(e.name),r=this.type,o=this.model,a=Un(r),c=i.name,l=a.propertiesByName[c];if(l&&!l.isAttr)return am(l)&&(t=e.attributes[Za])?(t=function(p,d){var y=kt(p);return function(f,v){var g=f.name,b=f.localName,S=v.xml&&v.xml.typePrefix;return S&&b.indexOf(S)===0?f.prefix+":"+b.slice(S.length):g}(y,d.getPackage(y.prefix))}(t,o),z({},l,{effectiveType:Un(n=o.getType(t)).name})):l;var u=o.getPackage(i.prefix);if(u){if(t=sm(i,u),n=o.getType(t),l=Pe(a.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&n.hasType(p.type)}))return z({},l,{effectiveType:Un(n).name})}else if(l=Pe(a.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}))return l;throw vi("unrecognized element <"+i.name+">")},Ct.prototype.toString=function(){return"ElementDescriptor["+Un(this.type).name+"]"},Ct.prototype.valueHandler=function(e,t){return new Kl(e,t)},Ct.prototype.referenceHandler=function(e){return new ko(e,this.context)},Ct.prototype.handler=function(e){return e==="Element"?new kr(this.model,e,this.context):new Ct(this.model,e,this.context)},Ct.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Yd(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return o!==void 0&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Yl.prototype=Object.create(Ct.prototype),Yl.prototype.createElement=function(e){var t=e.name,n=kt(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&sm(n,o)||t;if(!r.hasType(a))throw vi("unexpected element <"+e.originalName+">");return Ct.prototype.createElement.call(this,e)},kr.prototype=Object.create(Qa.prototype),kr.prototype.createElement=function(e){var t=e.name,n=kt(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},kr.prototype.handleChild=function(e){var t=new kr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return i!==void 0&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},kr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Jl.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Ct?(i=t,t={}):typeof t=="string"?(i=this.handler(t),t={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new kx(z({},t,{rootHandler:i})),c=new im({proxy:!0}),l=function(){var b=[];return Object.defineProperty(b,"peek",{value:function(){return this[this.length-1]}}),b}();function u(b,S,w){var _=S(),C=_.line,B=_.column,s=_.data;s.charAt(0)==="<"&&s.indexOf(" ")!==-1&&(s=s.slice(0,s.indexOf(" "))+">");var h="unparsable content "+(s?s+" ":"")+`detected
  5. >>>>>>>> 2589804fb89eb98fd6498c1ee41a354dcce32af3:dist/assets/bpmn-embedded-66150375.js
  6. line: `+C+`
  7. column: `+B+`
  8. nested error: `+b.message;if(w)return a.addWarning({message:h,error:b}),!0;throw vi(h)}function p(b,S){return u(b,S,!0)}i.context=a,l.push(i);var d=/^<\?xml /i,y=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function v(b,S){try{l.peek().handleText(b)}catch(w){p(w,S)}}var g=r.getPackages().reduce(function(b,S){return b[S.uri]=S.prefix,b},{"http://www.w3.org/XML/1998/namespace":"xml"});return c.ns(g).on("openTag",function(b,S,w,_){var C=b.attrs||{},B=Object.keys(C).reduce(function(s,h){var m=S(C[h]);return s[h]=m,s},{});(function(s,h){var m=l.peek();try{l.push(m.handleNode(s))}catch(E){u(E,h,o)&&l.push(new Xl)}})({name:b.name,originalName:b.originalName,attributes:B,ns:b.ns},_)}).on("question",function(b){if(d.test(b)){var S=y.exec(b),w=S&&S[1];w&&!f.test(w)&&a.addWarning({message:"unsupported document encoding <"+w+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",v).on("text",function(b,S,w){(function(_,C){_.trim()&&v(_,C)})(S(b),w)}).on("error",u).on("warn",p),new Promise(function(b,S){var w;try{c.parse(e),function(){var h,m,E=a.elementsById,T=a.references;for(h=0;m=T[h];h++){var M=m.element,N=E[m.id],$=Un(M).propertiesByName[m.property];if(N||a.addWarning({message:"unresolved reference <"+m.id+">",element:m.element,property:m.property,value:m.id}),$.isMany){var P=M.get($.name),x=P.indexOf(m);x===-1&&(x=P.length),N?P[x]=N:P.splice(x,1)}else M.set($.name,N)}}()}catch(h){w=h}var _=i.element;w||_||(w=vi("failed to parse document as <"+i.type.$descriptor.name+">"));var C=a.warnings,B=a.references,s=a.elementsById;return w?(w.warnings=C,S(w)):b({rootElement:_,elementsById:s,references:B,warnings:C})})},Jl.prototype.handler=function(e){return new Yl(this.model,e)};var Px=/<|>|'|"|&|\n\r|\n/g,cm=/<|>|&/g;function Mx(e){var t={},n={},i={},r=[],o=[];this.byUri=function(a){return n[a]||e&&e.byUri(a)},this.add=function(a,c){n[a.uri]=a,c?r.push(a):o.push(a),this.mapPrefix(a.prefix,a.uri)},this.uriByPrefix=function(a){return t[a||"xmlns"]},this.mapPrefix=function(a,c){t[a||"xmlns"]=c},this.getNSKey=function(a){return a.prefix!==void 0?a.uri+"|"+a.prefix:a.uri},this.logUsed=function(a){var c=a.uri,l=this.getNSKey(a);i[l]=this.byUri(c),e&&e.logUsed(a)},this.getUsed=function(a){var c=this;return[].concat(r,o).filter(function(l){var u=c.getNSKey(l);return i[u]})}}function Rx(e,t){return rm(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function lm(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function um(e){return Dt(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var Nx={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Ix={"<":"lt",">":"gt","&":"amp"};function pm(e,t,n){return(e=Dt(e)?e:""+e).replace(t,function(i){return"&"+n[i]+";"})}function Zl(e){this.tagName=e}function Ui(){}function Ql(e){this.tagName=e}function Ue(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function es(e,t){Ue.call(this,e,t)}function Dx(){this.value="",this.write=function(e){this.value+=e}}function Bx(e,t){var n=[""];this.append=function(i){return e.write(i),this},this.appendNewLine=function(){return t&&e.write(`
  9. `),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Ox(e){return e=z({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Dx,r=new Bx(i,e.format);if(e.preamble&&r.append(`<?xml version="1.0" encoding="UTF-8"?>
  10. `),new Ue().build(t).serializeTo(r),!n)return i.value}}}function ts(e,t){Zt.call(this,e,t)}Zl.prototype.build=function(e){return this.element=e,this},Zl.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Ui.prototype.serializeValue=Ui.prototype.serializeTo=function(e){e.append(this.escape?pm(this.value,cm,Ix):this.value)},Ui.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(cm)!==-1&&(this.escape=!0),this},lm(Ql,Ui),Ql.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Ue.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(a){return de(a.$descriptor.properties,function(c){var l=c.name;if(c.isVirtual||!Tn(a,l))return!1;var u=a[l];return u!==c.default&&u!==null&&(!c.isMany||u.length)})}(e),this.parseAttributes(de(n,function(a){return a.isAttr})),this.parseContainments(function(a){return de(a,function(c){return!c.isAttr})}(n))),this.parseGenericAttributes(e,t),this},Ue.prototype.nsTagName=function(e){return function(t,n){return n.isGeneric?z({localName:n.ns.localName},t):z({localName:Rx(n.ns.localName,n.$pkg)},t)}(this.logNamespaceUsed(e.ns),e)},Ue.prototype.nsPropertyTagName=function(e){return function(t,n){return z({localName:n.ns.localName},t)}(this.logNamespaceUsed(e.ns),e)},Ue.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ue.prototype.nsAttributeName=function(e){var t;if(t=Dt(e)?kt(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:z({localName:t.localName},n)},Ue.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return L(e,function(r,o){o==="$body"?n.push(new Ui().build({type:"String"},r)):o==="$children"?L(r,function(a){n.push(new Ue(t).build(a))}):o.indexOf("$")!==0&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})}),i},Ue.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=kt(t);if(o.prefix==="xmlns"&&(i={prefix:o.localName,uri:n}),o.prefix||o.localName!=="xmlns"||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},Ue.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return L(i,function(o,a){var c=n.parseNsAttribute(e,a,o);c&&r.push(c)}),r},Ue.prototype.parseGenericAttributes=function(e,t){var n=this;L(t,function(i){if(i.name!==Za)try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch(r){console.warn("missing namespace information for ",i.name,"=",i.value,"on",e,r)}})},Ue.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;L(e,function(r){var o=i.get(r.name),a=r.isReference;if(r.isMany||(o=[o]),r.isBody)n.push(new Ui().build(r,o[0]));else if(Yd(r.type))L(o,function(u){n.push(new Ql(t.addTagName(t.nsPropertyTagName(r))).build(r,u))});else if(a)L(o,function(u){n.push(new Zl(t.addTagName(t.nsPropertyTagName(r))).build(u))});else{var c=am(r),l=function(u){return om(u)==="property"}(r);L(o,function(u){var p;p=c?new es(t,r):l?new Ue(t,r):new Ue(t),n.push(p.build(u))})}})},Ue.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Mx(t):n=t),n},Ue.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Ue.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),c=e.prefix,l=e.uri;if(!c&&!l)return{localName:e.localName};if(r=Ax[c]||o&&(o.getPackage(c)||{}).uri,!(l=l||r||a.uriByPrefix(c)))throw new Error("no namespace uri given for prefix <"+c+">");if(!(e=a.byUri(l))){for(n=c,i=1;a.uriByPrefix(n);)n=c+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return c&&a.mapPrefix(c,l),e},Ue.prototype.parseAttributes=function(e){var t=this,n=this.element;L(e,function(i){var r=n.get(i.name);if(i.isReference)if(i.isMany){var o=[];L(r,function(a){o.push(a.id)}),r=o.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(i),r)})},Ue.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),um(e)},Ue.prototype.addAttribute=function(e,t){var n=this.attrs;Dt(t)&&(t=pm(t,Px,Nx));var i=hl(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),r={name:e,value:t};i!==-1?n.splice(i,1,r):n.push(r)},Ue.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(i){return i.getUsed().filter(function(r){return r.prefix!=="xml"}).map(function(r){return{name:"xmlns"+(r.prefix?":"+r.prefix:""),value:r.uri}})}(n).concat(t)),L(t,function(i){e.append(" ").append(um(i.name)).append('="').append(i.value).append('"')})},Ue.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Ui;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),L(this.body,function(i){i.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},lm(es,Ue),es.prototype.parseNsAttributes=function(e){var t=Ue.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Za),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},es.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},ts.prototype=Object.create(Zt.prototype),ts.prototype.fromXML=function(e,t,n){Dt(t)||(n=t,t="bpmn:Definitions");var i=new Jl(z({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},ts.prototype.toXML=function(e,t){var n=new Ox(t);return new Promise(function(i,r){try{return i({xml:n.toXML(e)})}catch(o){return r(o)}})};var Lx={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function jx(e,t){return new ts(z({},Lx,e),t)}function gt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var Vx=new _r({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function jt(e,t){return e.$instanceOf(t)}function Fx(e,t){var n={},i=[];function r(M,N){return function($){M($,N)}}function o(M){n[M.id]=M}function a(M,N){try{var $=M.di&&function(P,x){if(P.gfx)throw new Error(t("already rendered {element}",{element:gt(P)}));return e.element(P,x)}(M,N);return o(M),$}catch(P){c(P.message,{element:M,error:P}),console.error(t("failed to import {element}",{element:gt(M)})),console.error(P)}}function c(M,N){e.error(M,N)}function l(M){var N=M.bpmnElement;N?N.di?c(t("multiple DI elements defined for {element}",{element:gt(N)}),{element:N}):(Vx.bind(N,"di"),N.di=M):c(t("no bpmnElement referenced in {element}",{element:gt(M)}),{element:M})}function u(M){var N;l(N=M.plane),L(N.planeElement,p)}function p(M){l(M)}function d(){for(;i.length;)i.shift()()}function y(M,N){E(M,N),_(M.ioSpecification,N),w(M.artifacts,N),o(M)}function f(M,N){a(M,N)}function v(M,N){a(M,N)}function g(M,N){a(M,N)}function b(M,N){a(M,N)}function S(M,N){a(M,N)}function w(M,N){L(M,function($){jt($,"bpmn:Association")?i.push(function(){S($,N)}):S($,N)})}function _(M,N){M&&(L(M.dataInputs,r(g,N)),L(M.dataOutputs,r(b,N)))}function C(M,N){E(M,N),w(M.artifacts,N)}function B(M,N){var $=a(M,N);jt(M,"bpmn:SubProcess")&&C(M,$||N),jt(M,"bpmn:Activity")&&_(M.ioSpecification,N),i.push(function(){L(M.dataInputAssociations,r(v,N)),L(M.dataOutputAssociations,r(v,N))})}function s(M,N){a(M,N)}function h(M,N){i.push(function(){var $=a(M,N);M.childLaneSet&&m(M.childLaneSet,$||N),function(P){L(P.flowNodeRef,function(x){var I=x.get("lanes");I&&I.push(P)})}(M)})}function m(M,N){L(M.lanes,r(h,N))}function E(M,N){(function($,P){L($,function(x){jt(x,"bpmn:SequenceFlow")?i.push(function(){(function(I,j){a(I,j)})(x,P)}):jt(x,"bpmn:BoundaryEvent")?i.unshift(function(){B(x,P)}):jt(x,"bpmn:FlowNode")?B(x,P):jt(x,"bpmn:DataObject")||(jt(x,"bpmn:DataStoreReference")||jt(x,"bpmn:DataObjectReference")?s(x,P):c(t("unrecognized flowElement {element} in context {context}",{element:gt(x),context:P?gt(P.businessObject):"null"}),{element:x,context:P}))})})(M.flowElements,N),M.laneSets&&function($,P){L($,r(m,P))}(M.laneSets,N)}function T(M,N){var $=a(M,N),P=M.processRef;P&&y(P,$||N)}return{handleDeferred:d,handleDefinitions:function(M,N){var $=M.diagrams;if(N&&$.indexOf(N)===-1)throw new Error(t("diagram not part of bpmn:Definitions"));if(!N&&$&&$.length&&(N=$[0]),!N)throw new Error(t("no diagram to display"));u(N);var P=N.plane;if(!P)throw new Error(t("no plane for {element}",{element:gt(N)}));var x=P.bpmnElement;if(!x){if(x=function(G){return Pe(G.rootElements,function(X){return jt(X,"bpmn:Process")||jt(X,"bpmn:Collaboration")})}(M),!x)throw new Error(t("no process or collaboration to display"));c(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:gt(P),rootElement:gt(x)})),P.bpmnElement=x,l(P)}var I,j=function(G,X){return e.root(G,X)}(x,P);if(jt(x,"bpmn:Process"))y(x,j);else{if(!jt(x,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:gt(P),rootElement:gt(x)}));L((I=x).participants,r(T)),w(I.artifacts),i.push(function(){var G;L(I.messageFlows,r(f,G))}),function(G,X){de(G,function(ee){return!n[ee.id]&&jt(ee,"bpmn:Process")&&ee.laneSets}).forEach(r(y,X))}(M.rootElements,j)}d()},handleSubProcess:C,registerDi:l}}function zx(e,t,n){var i,r,o,a=[];return new Promise(function(c,l){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),r.fire("import.render.start",{definitions:t}),function(u,p){new Fx({root:function(d){return i.add(d)},element:function(d,y){return i.add(d,y)},error:function(d,y){a.push({message:d,context:y})}},o).handleDefinitions(u,p)}(t,n),r.fire("import.render.complete",{error:void 0,warnings:a}),c({warnings:a})}catch(u){return u.warnings=a,l(u)}})}function Pr(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(!(t>=1&&ft(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+e.name+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var i=Array.prototype.slice.call(arguments,0,-1);e.apply(this,i).then(function(r){var o=Object.keys(r)[0];return n(null,r[o])},function(r){return n(r,r.warnings)})}}var hm='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><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>';function ns(e){return e.join(";")}var Po,dm=ns(["color: #404040"]),$x='<div class="bjs-powered-by-lightbox" style="'+ns(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+ns(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+ns(["position: absolute","left: 50%","top: 40%","transform: translate(-50%)","width: 260px","padding: 10px","background: white","box-shadow: 0 1px 4px rgba(0,0,0,0.3)","font-family: Helvetica, Arial, sans-serif","font-size: 14px","display: flex","line-height: 1.3"])+'"><a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;'+dm+'">'+hm+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';function He(e){var t,n;e=z({},Gx,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=je('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100; '+dm+'">'+hm+"</a>"),t.appendChild(n),ce.bind(n,"click",function(i){Po||(Po=je($x),Gt.bind(Po,".backdrop","click",function(r){document.body.removeChild(Po)})),document.body.appendChild(Po),i.preventDefault()}),this._init(this._container,this._moddle,e)}function is(e,t){return e.warnings=t,e}ie(He,Sr),He.prototype.importXML=Pr(function(e,t){var n=this;return new Promise(function(i,r){e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"bpmn:Definitions").then(function(o){var a=o.rootElement,c=o.references,l=o.warnings,u=o.elementsById;a=n._emit("import.parse.complete",function(p){var d=n.get("eventBus").createEvent(p);return Object.defineProperty(d,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:p.warnings,references:p.references,elementsById:p.elementsById}}}),d}({error:null,definitions:a,elementsById:u,references:c,warnings:l}))||a,n.importDefinitions(a,t).then(function(p){var d=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:null,warnings:d}),i({warnings:d})}).catch(function(p){var d=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:p,warnings:d}),r(is(p,d))})}).catch(function(o){return n._emit("import.parse.complete",{error:o}),o=function(a){var c=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(a.message);return c&&(a.message="unparsable content <"+c[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+c[2]),a}(o),n._emit("import.done",{error:o,warnings:o.warnings}),r(o)})})}),He.prototype.importDefinitions=Pr(function(e,t){var n=this;return new Promise(function(i,r){n._setDefinitions(e),n.open(t).then(function(o){var a=o.warnings;return i({warnings:a})}).catch(function(o){return r(o)})})}),He.prototype.open=Pr(function(e){var t=this._definitions,n=e,i=this;return new Promise(function(r,o){if(!t){var a=new Error("no XML imported");return o(is(a,[]))}if(typeof e=="string"&&(n=function(l,u){return u&&Pe(l.diagrams,function(p){return p.id===u})||null}(t,e),!n)){var c=new Error("BPMNDiagram <"+e+"> not found");return o(is(c,[]))}try{i.clear()}catch(l){return o(is(l,[]))}zx(i,t,n).then(function(l){var u=l.warnings;return r({warnings:u})}).catch(function(l){return o(l)})})}),He.prototype.saveXML=Pr(function(e){e=e||{};var t=this,n=this._definitions;return new Promise(function(i){if(!n)return i({error:new Error("no definitions loaded")});n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then(function(r){var o=r.xml;return o=t._emit("saveXML.serialized",{xml:o})||o,i({xml:o})})}).catch(function(i){return{error:i}}).then(function(i){t._emit("saveXML.done",i);var r=i.error;return r?Promise.reject(r):i})}),He.prototype.saveSVG=Pr(function(e){var t=this;return new Promise(function(n,i){var r,o;t._emit("saveSVG.start");try{var a=t.get("canvas"),c=a.getDefaultLayer(),l=Xe("defs",a._svg),u=hd(c),p=l?"<defs>"+hd(l)+"</defs>":"",d=c.getBBox();r=`<?xml version="1.0" encoding="utf-8"?>
  11. <!-- created with bpmn-js / http://bpmn.io -->
  12. <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  13. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+d.width+'" height="'+d.height+'" viewBox="'+d.x+" "+d.y+" "+d.width+" "+d.height+'" version="1.1">'+p+u+"</svg>"}catch(y){o=y}return t._emit("saveSVG.done",{error:o,svg:r}),o?i(o):n({svg:r})})}),He.prototype._setDefinitions=function(e){this._definitions=e},He.prototype.getModules=function(){return this._modules},He.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach(function(e){var t=e.businessObject;t&&t.di&&delete t.di}),Sr.prototype.clear.call(this))},He.prototype.destroy=function(){Sr.prototype.destroy.call(this),An(this._container)},He.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},He.prototype.off=function(e,t){this.get("eventBus").off(e,t)},He.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=Xe(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},He.prototype.getDefinitions=function(){return this._definitions},He.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},He.prototype._init=function(e,t,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=z(Fn(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});Sr.call(this,a),n&&n.container&&this.attachTo(n.container)},He.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},He.prototype._createContainer=function(e){var t=je('<div class="bjs-container"></div>');return z(t.style,{width:mm(e.width),height:mm(e.height),position:e.position}),t},He.prototype._createModdle=function(e){return new jx(z({},this._moddleExtensions,e.moddleExtensions))},He.prototype._modules=[];var Gx={width:"100%",height:"100%",position:"relative"};function mm(e){return e+(pe(e)?"px":"")}function Mo(e){He.call(this,e),this.on("import.parse.complete",function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}A=function(e,t){var n=te(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)};function te(e){return e&&e.businessObject||e}Me=function(e){return!A(e,"bpmn:CallActivity")&&(A(e,"bpmn:SubProcess")?te(e).di&&!!te(e).di.isExpanded:!A(e,"bpmn:Participant")||!!te(e).processRef)},It=function(e){return e&&!!te(e).triggeredByEvent};function rs(e,t){var n=te(e),i=!1;return n.eventDefinitions&&L(n.eventDefinitions,function(r){A(r,t)&&(i=!0)}),i}function fm(e){return A(e,"bpmn:FlowElement")||A(e,"bpmn:Participant")||A(e,"bpmn:Lane")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")?"name":A(e,"bpmn:TextAnnotation")?"text":A(e,"bpmn:Group")?"categoryValueRef":void 0}function pn(e){var t=e.businessObject,n=fm(t);if(n)return n==="categoryValueRef"?function(i){var r=i.categoryValueRef;return r&&r.value||""}(t):t[n]||""}function Mn(e,t,n){return si(e.eventDefinitions,function(i){return i.$type===t&&function(r,o){return ji(o,function(a,c){return r[c]==a})}(e,n)})}function Mr(e){return e.businessObject.di}function Tt(e){return e.businessObject}function Ee(e,t){var n=Mr(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function Z(e,t){var n=Mr(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||"black"}function Ro(e,t,n){var i=Mr(e).get("label");return i&&i.get("color:color")||t||Z(e,n)}ie(Mo,He),Mo.prototype._createModdle=function(e){var t=He.prototype._createModdle.call(this,e);return t.ids=new Cn([32,36,1]),t},Mo.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Ux=new Cn,Rr=.95;function Hi(e,t,n,i,r,o,a){zn.call(this,t,a);var c=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,u=e&&e.defaultLabelColor,p=Ux.next(),d={},y=n.computeStyle;function f(P,x){var I=z({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},x.attrs),j=x.ref||{x:0,y:0},G=x.scale||1;I.strokeDasharray==="none"&&(I.strokeDasharray=[1e4,1]);var X=oe("marker");K(x.element,I),le(X,x.element),K(X,{id:P,viewBox:"0 0 20 20",refX:j.x,refY:j.y,markerWidth:20*G,markerHeight:20*G,orient:"auto"});var ee=Xe("defs",r._svg);ee||(ee=oe("defs"),le(r._svg,ee)),le(ee,X),d[P]=X}function v(P){return P.replace(/[^0-9a-zA-z]+/g,"_")}function g(P,x,I){var j=P+"-"+v(x)+"-"+v(I)+"-"+p;return d[j]||function(G,X,ee,re){if(X==="sequenceflow-end"){var se=oe("path");K(se,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(G,{element:se,ref:{x:11,y:10},scale:.5,attrs:{fill:re,stroke:re}})}if(X==="messageflow-start"){var H=oe("circle");K(H,{cx:6,cy:6,r:3.5}),f(G,{element:H,attrs:{fill:ee,stroke:re},ref:{x:6,y:6}})}if(X==="messageflow-end"){var q=oe("path");K(q,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(G,{element:q,attrs:{fill:ee,stroke:re,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if(X==="association-start"){var xe=oe("path");K(xe,{d:"M 11 5 L 1 10 L 11 15"}),f(G,{element:xe,attrs:{fill:"none",stroke:re,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if(X==="association-end"){var ze=oe("path");K(ze,{d:"M 1 5 L 11 10 L 1 15"}),f(G,{element:ze,attrs:{fill:"none",stroke:re,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if(X==="conditional-flow-marker"){var ct=oe("path");K(ct,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(G,{element:ct,attrs:{fill:ee,stroke:re},ref:{x:-1,y:10},scale:.5})}if(X==="conditional-default-flow-marker"){var Ie=oe("path");K(Ie,{d:"M 6 4 L 10 16"}),f(G,{element:Ie,attrs:{stroke:re},ref:{x:0,y:10},scale:.5})}}(j,P,x,I),"url(#"+j+")"}function b(P,x,I,j,G){et(j)&&(G=j,j=0),j=j||0,(G=y(G,{stroke:"black",strokeWidth:2,fill:"white"})).fill==="none"&&delete G.fillOpacity;var X=x/2,ee=I/2,re=oe("circle");return K(re,{cx:X,cy:ee,r:Math.round((x+I)/4-j)}),K(re,G),le(P,re),re}function S(P,x,I,j,G,X){et(G)&&(X=G,G=0),G=G||0,X=y(X,{stroke:"black",strokeWidth:2,fill:"white"});var ee=oe("rect");return K(ee,{x:G,y:G,width:x-2*G,height:I-2*G,rx:j,ry:j}),K(ee,X),le(P,ee),ee}function w(P,x,I){var j=Il(x,I=y(I,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return le(P,j),j}function _(P,x,I){I=y(I,["no-fill"],{strokeWidth:2,stroke:"black"});var j=oe("path");return K(j,{d:x}),K(j,I),le(P,j),j}function C(P,x,I,j){return _(x,I,z({"data-marker":P},j))}function B(P){return function(x,I){return N[P](x,I)}}function s(P){return N[P]}function h(P,x){var I=Tt(P),j=function(G){return G.$type==="bpmn:IntermediateThrowEvent"||G.$type==="bpmn:EndEvent"}(I);return I.eventDefinitions&&I.eventDefinitions.length>1?I.parallelMultiple?s("bpmn:ParallelMultipleEventDefinition")(x,P,j):s("bpmn:MultipleEventDefinition")(x,P,j):Mn(I,"bpmn:MessageEventDefinition")?s("bpmn:MessageEventDefinition")(x,P,j):Mn(I,"bpmn:TimerEventDefinition")?s("bpmn:TimerEventDefinition")(x,P,j):Mn(I,"bpmn:ConditionalEventDefinition")?s("bpmn:ConditionalEventDefinition")(x,P):Mn(I,"bpmn:SignalEventDefinition")?s("bpmn:SignalEventDefinition")(x,P,j):Mn(I,"bpmn:EscalationEventDefinition")?s("bpmn:EscalationEventDefinition")(x,P,j):Mn(I,"bpmn:LinkEventDefinition")?s("bpmn:LinkEventDefinition")(x,P,j):Mn(I,"bpmn:ErrorEventDefinition")?s("bpmn:ErrorEventDefinition")(x,P,j):Mn(I,"bpmn:CancelEventDefinition")?s("bpmn:CancelEventDefinition")(x,P,j):Mn(I,"bpmn:CompensateEventDefinition")?s("bpmn:CompensateEventDefinition")(x,P,j):Mn(I,"bpmn:TerminateEventDefinition")?s("bpmn:TerminateEventDefinition")(x,P,j):null}function m(P,x,I){I=z({size:{width:100}},I);var j=o.createText(x||"",I);return be(j).add("djs-label"),le(P,j),j}function E(P,x,I){return m(P,Tt(x).name,{box:x,align:I,padding:5,style:{fill:Ro(x,u,l)}})}function T(P,x,I){Gl(m(P,x,{box:{height:30,width:I.height},align:"center-middle",style:{fill:Ro(I,u,l)}}),0,-(-1*I.height),270)}function M(P){for(var x=P.waypoints,I="m "+x[0].x+","+x[0].y,j=1;j<x.length;j++)I+="L"+x[j].x+","+x[j].y+" ";return I}var N=this.handlers={"bpmn:Event":function(P,x,I){return"fillOpacity"in I||(I.fillOpacity=Rr),b(P,x.width,x.height,I)},"bpmn:StartEvent":function(P,x){var I={fill:Ee(x,c),stroke:Z(x,l)};Tt(x).isInterrupting||(I={strokeDasharray:"6",strokeLinecap:"round",fill:Ee(x,c),stroke:Z(x,l)});var j=s("bpmn:Event")(P,x,I);return h(x,P),j},"bpmn:MessageEventDefinition":function(P,x,I){return _(P,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:x.width,containerHeight:x.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:I?Z(x,l):Ee(x,c),stroke:I?Ee(x,c):Z(x,l)})},"bpmn:TimerEventDefinition":function(P,x){var I=b(P,x.width,x.height,.2*x.height,{strokeWidth:2,fill:Ee(x,c),stroke:Z(x,l)});_(P,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:x.width,containerHeight:x.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:Z(x,l)});for(var j=0;j<12;j++){var G=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:x.width,containerHeight:x.height,position:{mx:.5,my:.5}}),X=x.width/2;_(P,G,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*j+","+x.height/2+","+X+")",stroke:Z(x,l)})}return I},"bpmn:EscalationEventDefinition":function(P,x,I){return _(P,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:I?Z(x,l):"none",stroke:Z(x,l)})},"bpmn:ConditionalEventDefinition":function(P,x){return _(P,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:Z(x,l)})},"bpmn:LinkEventDefinition":function(P,x,I){return _(P,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:I?Z(x,l):"none",stroke:Z(x,l)})},"bpmn:ErrorEventDefinition":function(P,x,I){return _(P,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:x.width,containerHeight:x.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:I?Z(x,l):"none",stroke:Z(x,l)})},"bpmn:CancelEventDefinition":function(P,x,I){var j=_(P,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:I?Z(x,l):"none",stroke:Z(x,l)});return qd(j,45),j},"bpmn:CompensateEventDefinition":function(P,x,I){return _(P,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:I?Z(x,l):"none",stroke:Z(x,l)})},"bpmn:SignalEventDefinition":function(P,x,I){return _(P,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:x.width,containerHeight:x.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:I?Z(x,l):"none",stroke:Z(x,l)})},"bpmn:MultipleEventDefinition":function(P,x,I){return _(P,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:x.width,containerHeight:x.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:I?Z(x,l):"none"})},"bpmn:ParallelMultipleEventDefinition":function(P,x){return _(P,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:x.width,containerHeight:x.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:Z(x,l),stroke:Z(x,l)})},"bpmn:EndEvent":function(P,x){var I=s("bpmn:Event")(P,x,{strokeWidth:4,fill:Ee(x,c),stroke:Z(x,l)});return h(x,P),I},"bpmn:TerminateEventDefinition":function(P,x){return b(P,x.width,x.height,8,{strokeWidth:4,fill:Z(x,l),stroke:Z(x,l)})},"bpmn:IntermediateEvent":function(P,x){var I=s("bpmn:Event")(P,x,{strokeWidth:1,fill:Ee(x,c),stroke:Z(x,l)});return b(P,x.width,x.height,3,{strokeWidth:1,fill:Ee(x,"none"),stroke:Z(x,l)}),h(x,P),I},"bpmn:IntermediateCatchEvent":B("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":B("bpmn:IntermediateEvent"),"bpmn:Activity":function(P,x,I){return"fillOpacity"in(I=I||{})||(I.fillOpacity=Rr),S(P,x.width,x.height,10,I)},"bpmn:Task":function(P,x){var I={fill:Ee(x,c),stroke:Z(x,l)},j=s("bpmn:Activity")(P,x,I);return E(P,x,"center-middle"),$(P,x),j},"bpmn:ServiceTask":function(P,x){var I=s("bpmn:Task")(P,x);return _(P,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:Ee(x,c),stroke:Z(x,l)}),_(P,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:Ee(x,c)}),_(P,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:Ee(x,c),stroke:Z(x,l)}),I},"bpmn:UserTask":function(P,x){var I=s("bpmn:Task")(P,x);return _(P,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Ee(x,c),stroke:Z(x,l)}),_(P,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Ee(x,c),stroke:Z(x,l)}),_(P,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Z(x,l),stroke:Z(x,l)}),I},"bpmn:ManualTask":function(P,x){var I=s("bpmn:Task")(P,x);return _(P,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:Ee(x,c),stroke:Z(x,l)}),I},"bpmn:SendTask":function(P,x){var I=s("bpmn:Task")(P,x);return _(P,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:Z(x,l),stroke:Ee(x,c)}),I},"bpmn:ReceiveTask":function(P,x){var I,j=Tt(x),G=s("bpmn:Task")(P,x);return j.instantiate?(b(P,28,28,4.4,{strokeWidth:1}),I=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):I=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),_(P,I,{strokeWidth:1,fill:Ee(x,c),stroke:Z(x,l)}),G},"bpmn:ScriptTask":function(P,x){var I=s("bpmn:Task")(P,x);return _(P,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:Z(x,l)}),I},"bpmn:BusinessRuleTask":function(P,x){var I=s("bpmn:Task")(P,x);return K(_(P,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:Ee(x,"#aaaaaa"),stroke:Z(x,l)}),K(_(P,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:Z(x,l)}),I},"bpmn:SubProcess":function(P,x,I){I=z({fill:Ee(x,c),stroke:Z(x,l)},I);var j=s("bpmn:Activity")(P,x,I),G=Me(x);return It(x)&&K(j,{strokeDasharray:"1,2"}),E(P,x,G?"center-top":"center-middle"),G?$(P,x):$(P,x,["SubProcessMarker"]),j},"bpmn:AdHocSubProcess":function(P,x){return s("bpmn:SubProcess")(P,x)},"bpmn:Transaction":function(P,x){var I=s("bpmn:SubProcess")(P,x),j=n.style(["no-fill","no-events"],{stroke:Z(x,l)});return S(P,x.width,x.height,8,3,j),I},"bpmn:CallActivity":function(P,x){return s("bpmn:SubProcess")(P,x,{strokeWidth:5})},"bpmn:Participant":function(P,x){var I={fillOpacity:Rr,fill:Ee(x,c),stroke:Z(x,l)},j=s("bpmn:Lane")(P,x,I);return Me(x)?(w(P,[{x:30,y:0},{x:30,y:x.height}],{stroke:Z(x,l)}),T(P,Tt(x).name,x)):m(P,Tt(x).name,{box:x,align:"center-middle",style:{fill:Ro(x,u,l)}}),Tt(x).participantMultiplicity&&s("ParticipantMultiplicityMarker")(P,x),j},"bpmn:Lane":function(P,x,I){var j=S(P,x.width,x.height,0,z({fill:Ee(x,c),fillOpacity:.35,stroke:Z(x,l)},I)),G=Tt(x);return G.$type==="bpmn:Lane"&&T(P,G.name,x),j},"bpmn:InclusiveGateway":function(P,x){var I=s("bpmn:Gateway")(P,x);return b(P,x.width,x.height,.24*x.height,{strokeWidth:2.5,fill:Ee(x,c),stroke:Z(x,l)}),I},"bpmn:ExclusiveGateway":function(P,x){var I=s("bpmn:Gateway")(P,x),j=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:x.width,containerHeight:x.height,position:{mx:.32,my:.3}});return Mr(x).isMarkerVisible&&_(P,j,{strokeWidth:1,fill:Z(x,l),stroke:Z(x,l)}),I},"bpmn:ComplexGateway":function(P,x){var I=s("bpmn:Gateway")(P,x);return _(P,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:x.width,containerHeight:x.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:Z(x,l),stroke:Z(x,l)}),I},"bpmn:ParallelGateway":function(P,x){var I=s("bpmn:Gateway")(P,x);return _(P,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:x.width,containerHeight:x.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:Z(x,l),stroke:Z(x,l)}),I},"bpmn:EventBasedGateway":function(P,x){var I=Tt(x),j=s("bpmn:Gateway")(P,x);b(P,x.width,x.height,.2*x.height,{strokeWidth:1,fill:"none",stroke:Z(x,l)});var G=I.eventGatewayType,X=!!I.instantiate;if(G==="Parallel"){var ee=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:x.width,containerHeight:x.height,position:{mx:.474,my:.296}});K(_(P,ee),{strokeWidth:1,fill:"none"})}else G==="Exclusive"&&(X||K(b(P,x.width,x.height,.26*x.height),{strokeWidth:1,fill:"none",stroke:Z(x,l)}),function(){var re=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:x.width,containerHeight:x.height,position:{mx:.36,my:.44}}),se={strokeWidth:2,fill:Ee(x,"none"),stroke:Z(x,l)};_(P,re,se)}());return j},"bpmn:Gateway":function(P,x){var I={fill:Ee(x,c),fillOpacity:Rr,stroke:Z(x,l)};return function(j,G,X,ee){var re=G/2,se=X/2,H=[{x:re,y:0},{x:G,y:se},{x:re,y:X},{x:0,y:se}].map(function(xe){return xe.x+","+xe.y}).join(" ");ee=y(ee,{stroke:"black",strokeWidth:2,fill:"white"});var q=oe("polygon");return K(q,{points:H}),K(q,ee),le(j,q),q}(P,x.width,x.height,I)},"bpmn:SequenceFlow":function(P,x){var I,j=M(x),G=Ee(x,c),X=Z(x,l),ee=_(P,j,{strokeLinejoin:"round",markerEnd:g("sequenceflow-end",G,X),stroke:Z(x,l)}),re=Tt(x);return x.source&&(I=x.source.businessObject,re.conditionExpression&&I.$instanceOf("bpmn:Activity")&&K(ee,{markerStart:g("conditional-flow-marker",G,X)}),I.default&&(I.$instanceOf("bpmn:Gateway")||I.$instanceOf("bpmn:Activity"))&&I.default===re&&K(ee,{markerStart:g("conditional-default-flow-marker",G,X)})),ee},"bpmn:Association":function(P,x,I){var j=Tt(x),G=Ee(x,c),X=Z(x,l);return I=z({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:Z(x,l)},I||{}),j.associationDirection!=="One"&&j.associationDirection!=="Both"||(I.markerEnd=g("association-end",G,X)),j.associationDirection==="Both"&&(I.markerStart=g("association-start",G,X)),w(P,x.waypoints,I)},"bpmn:DataInputAssociation":function(P,x){var I=Ee(x,c),j=Z(x,l);return s("bpmn:Association")(P,x,{markerEnd:g("association-end",I,j)})},"bpmn:DataOutputAssociation":function(P,x){var I=Ee(x,c),j=Z(x,l);return s("bpmn:Association")(P,x,{markerEnd:g("association-end",I,j)})},"bpmn:MessageFlow":function(P,x){var I=Tt(x),j=Mr(x),G=Ee(x,c),X=Z(x,l),ee=_(P,M(x),{markerEnd:g("messageflow-end",G,X),markerStart:g("messageflow-start",G,X),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:Z(x,l)});if(I.messageRef){var re=ee.getPointAtLength(ee.getTotalLength()/2),se=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:re.x,y:re.y}}),H={strokeWidth:1};j.messageVisibleKind==="initiating"?(H.fill="white",H.stroke="black"):(H.fill="#888",H.stroke="white");var q=_(P,se,H),xe=m(P,I.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:Z(x,u)}}),ze=q.getBBox(),ct=xe.getBBox();Gl(xe,re.x-ct.width/2,re.y+ze.height/2+10,0)}return ee},"bpmn:DataObject":function(P,x){var I=_(P,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.474,my:.296}}),{fill:Ee(x,c),fillOpacity:Rr,stroke:Z(x,l)});return function(j){var G=j.dataObjectRef;return j.isCollection||G&&G.isCollection}(Tt(x))&&function(j,G){var X=(G.height-18)/G.height,ee=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:G.width,containerHeight:G.height,position:{mx:.33,my:X}});_(j,ee,{strokeWidth:2})}(P,x),I},"bpmn:DataObjectReference":B("bpmn:DataObject"),"bpmn:DataInput":function(P,x){var I=i.getRawPath("DATA_ARROW"),j=s("bpmn:DataObject")(P,x);return _(P,I,{strokeWidth:1}),j},"bpmn:DataOutput":function(P,x){var I=i.getRawPath("DATA_ARROW"),j=s("bpmn:DataObject")(P,x);return _(P,I,{strokeWidth:1,fill:"black"}),j},"bpmn:DataStoreReference":function(P,x){return _(P,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:Ee(x,c),fillOpacity:Rr,stroke:Z(x,l)})},"bpmn:BoundaryEvent":function(P,x){var I=Tt(x).cancelActivity,j={strokeWidth:1,fill:Ee(x,c),stroke:Z(x,l)};I||(j.strokeDasharray="6",j.strokeLinecap="round");var G=z({},j,{fillOpacity:1}),X=z({},j,{fill:"none"}),ee=s("bpmn:Event")(P,x,G);return b(P,x.width,x.height,3,X),h(x,P),ee},"bpmn:Group":function(P,x){return S(P,x.width,x.height,10,{stroke:Z(x,l),strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(P,x){return function(I,j){var G={width:90,height:30,x:j.width/2+j.x,y:j.height/2+j.y};return m(I,pn(j),{box:G,fitBox:!0,style:z({},o.getExternalStyle(),{fill:Ro(j,u,l)})})}(P,x)},"bpmn:TextAnnotation":function(P,x){var I=S(P,x.width,x.height,0,0,{fill:"none",stroke:"none"});return _(P,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:0,my:0}}),{stroke:Z(x,l)}),m(P,Tt(x).text||"",{box:x,align:"left-top",padding:5,style:{fill:Ro(x,u,l)}}),I},ParticipantMultiplicityMarker:function(P,x){C("participant-multiplicity",P,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:x.width/2/x.width,my:(x.height-15)/x.height}}),{strokeWidth:2,fill:Ee(x,c),stroke:Z(x,l)})},SubProcessMarker:function(P,x){Lt(S(P,14,14,0,{strokeWidth:1,fill:Ee(x,c),stroke:Z(x,l)}),x.width/2-7.5,x.height-20),C("sub-process",P,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2-7.5)/x.width,my:(x.height-20)/x.height}}),{fill:Ee(x,c),stroke:Z(x,l)})},ParallelMarker:function(P,x,I){C("parallel",P,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2+I.parallel)/x.width,my:(x.height-20)/x.height}}),{fill:Ee(x,c),stroke:Z(x,l)})},SequentialMarker:function(P,x,I){C("sequential",P,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2+I.seq)/x.width,my:(x.height-19)/x.height}}),{fill:Ee(x,c),stroke:Z(x,l)})},CompensationMarker:function(P,x,I){C("compensation",P,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2+I.compensation)/x.width,my:(x.height-13)/x.height}}),{strokeWidth:1,fill:Ee(x,c),stroke:Z(x,l)})},LoopMarker:function(P,x,I){C("loop",P,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2+I.loop)/x.width,my:(x.height-7)/x.height}}),{strokeWidth:1,fill:Ee(x,c),stroke:Z(x,l),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(P,x,I){C("adhoc",P,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2+I.adhoc)/x.width,my:(x.height-15)/x.height}}),{strokeWidth:1,fill:Z(x,l),stroke:Z(x,l)})}};function $(P,x,I){var j,G=Tt(x),X=I&&I.indexOf("SubProcessMarker")!==-1;j=X?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},L(I,function(se){s(se)(P,x,j)}),G.isForCompensation&&s("CompensationMarker")(P,x,j),G.$type==="bpmn:AdHocSubProcess"&&s("AdhocMarker")(P,x,j);var ee=G.loopCharacteristics,re=ee&&ee.isSequential;ee&&(re===void 0&&s("LoopMarker")(P,x,j),re===!1&&s("ParallelMarker")(P,x,j),re===!0&&s("SequentialMarker")(P,x,j))}this._drawPath=_}ie(Hi,zn),Hi.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Hi.prototype.canRender=function(e){return A(e,"bpmn:BaseElement")},Hi.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},Hi.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},Hi.prototype.getShapePath=function(e){return A(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,br([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):A(e,"bpmn:Activity")?function(o,a){var c=o.x,l=o.y,u=o.width,p=o.height;return br([["M",c+a,l],["l",u-2*a,0],["a",a,a,0,0,1,a,a],["l",0,p-2*a],["a",a,a,0,0,1,-a,a],["l",2*a-u,0],["a",a,a,0,0,1,-a,-a],["l",0,2*a-p],["a",a,a,0,0,1,a,-a],["z"]])}(e,10):A(e,"bpmn:Gateway")?function(o){var a=o.width/2,c=o.height/2;return br([["M",o.x+a,o.y],["l",a,c],["l",-a,c],["l",-a,-c],["z"]])}(e):function(o){var a=o.x,c=o.y,l=o.width;return br([["M",a,c],["l",l,0],["l",0,o.height],["l",-l,0],["z"]])}(e);var t,n,i,r};var Hx=0,qx={width:150,height:50};function Wx(e,t){var n;t.textContent=e;try{var i,r=e==="";return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch{return{width:0,height:0}}}function Xx(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=Wx(o,n)).width=o?i.width:0,o===" "||o===""||i.width<Math.round(t)||o.length<2)return Kx(e,o,r,i);o=Yx(o,i.width,t)}}function Kx(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}var vm="\xAD";function Yx(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(o,a){var c,l=o.split(/(\s|-|\u00AD)/g),u=[],p=0;if(l.length>1)for(;c=l.shift();){if(!(c.length+p<a)){c!=="-"&&c!==vm||u.pop();break}u.push(c),p+=c.length}var d=u[u.length-1];return d&&d===vm&&(u[u.length-1]="-"),u.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function os(e){this._config=z({},{size:qx,padding:Hx,style:{},align:"center-top"},e||{})}os.prototype.createText=function(e,t){return this.layoutText(e,t).element},os.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},os.prototype.layoutText=function(e,t){var n=z({},this._config.size,t.box),i=z({},this._config.style,t.style),r=function(b){var S=b.split("-");return{horizontal:S[0]||"center",vertical:S[1]||"top"}}(t.align||this._config.align),o=function(b){return et(b)?z({top:0,left:0,right:0,bottom:0},b):{top:b,left:b,right:b,bottom:b}}(t.padding!==void 0?t.padding:this._config.padding),a=t.fitBox||!1,c=function(b){if("fontSize"in b&&"lineHeight"in b)return b.lineHeight*parseInt(b.fontSize,10)}(i),l=e.split(/\u00AD?\r?\n/),u=[],p=n.width-o.left-o.right,d=oe("text");for(K(d,{x:0,y:0}),K(d,i),le(function(){var b=document.getElementById("helper-svg");return b||(K(b=oe("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(b)),b}(),d);l.length;)u.push(Xx(l,p,d));r.vertical==="middle"&&(o.top=o.bottom=0);var y=Bt(u,function(b,S,w){return b+(c||S.height)},0)+o.top+o.bottom,f=Bt(u,function(b,S,w){return S.width>b?S.width:b},0),v=o.top;r.vertical==="middle"&&(v+=(n.height-y)/2),v-=(c||u[0].height)/4;var g=oe("text");return K(g,i),L(u,function(b){var S;switch(v+=c||b.height,r.horizontal){case"left":S=o.left;break;case"right":S=(a?f:p)-o.right-b.width;break;default:S=Math.max(((a?f:p)-b.width)/2+o.left,0)}var w=oe("tspan");K(w,{x:S,y:v}),w.textContent=b.text,le(g,w)}),tt(d),{dimensions:{width:f,height:y},element:g}};function ym(e){var t=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=z({},t,{fontSize:n},e&&e.externalStyle||{}),r=new os({style:t});this.getExternalLabelBounds=function(o,a){var c=r.getDimensions(a,{box:{width:90,height:30,x:o.width/2+o.x,y:o.height/2+o.y},style:i});return{x:Math.round(o.x+o.width/2-c.width/2),y:Math.round(o.y),width:Math.ceil(c.width),height:Math.ceil(c.height)}},this.getTextAnnotationBounds=function(o,a){var c=r.getDimensions(a,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(30,Math.round(c.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}ym.$inject=["config.textRenderer"];var Jx=/\{([^{}]+)\}/g,Zx=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const Qx={__init__:["bpmnRenderer"],bpmnRenderer:["type",Hi],textRenderer:["type",ym],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,c=t.containerWidth/r.width*t.xScaleFactor,l=0;l<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*a;for(var u=0;u<r.widthElements.length;u++)o["x"+u]=r.widthElements[u]*c}var p,d,y=(p=r.d,d={mx:n,my:i,e:o},String(p).replace(Jx,function(f,v){return function(g,b,S){var w=S;return b.replace(Zx,function(_,C,B,s,h){C=C||s,w&&(C in w&&(w=w[C]),typeof w=="function"&&h&&(w=w()))}),w=(w==null||w==S?g:w)+""}(f,v,d)}));return y}}]},as={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,i){return t[i]||"{"+i+"}"})}]};var No={width:90,height:20},gm=15;function Nr(e){return A(e,"bpmn:Event")||A(e,"bpmn:Gateway")||A(e,"bpmn:DataStoreReference")||A(e,"bpmn:DataObjectReference")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:Group")}function ss(e){return bt(e.label)}function eE(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(l){var u=l.length/2-1,p=l[Math.floor(u)],d=l[Math.ceil(u+.01)];return{x:p.x+(d.x-p.x)/2,y:p.y+(d.y-p.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,c=r.y;return Math.abs(o)<Math.PI/2?c-=gm:a+=gm,{x:a,y:c}}function cs(e){return e.waypoints?eE(e.waypoints):A(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+No.height/2}:{x:e.x+e.width/2,y:e.y+e.height+No.height/2}}function bt(e){return e&&!!e.labelTarget}function ls(e,t){return z({id:e.id,type:e.$type,businessObject:e},t)}function tE(e,t,n){var i=e.di.waypoint;return!i||i.length<2?[fe(t),fe(n)]:i.map(function(r){return{x:r.x,y:r.y}})}function bm(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:gt(n),referenced:gt(t),property:i}))}function Hn(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}Hn.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Hn.prototype.add=function(e,t){var n,i,r,o,a,c,l,u=e.di,p=this._translate;if(A(u,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(ls(e)),this._canvas.setRootElement(n);else if(A(u,"bpmndi:BPMNShape")){var d=!Me(e),y=function(b){return A(b,"bpmn:Group")}(e);i=t&&(t.hidden||t.collapsed);var f=e.di.bounds;n=this._elementFactory.createShape(ls(e,{collapsed:d,hidden:i,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:y})),A(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,n),A(e,"bpmn:Lane")&&(r=0),A(e,"bpmn:DataStoreReference")&&(o=t,a=fe(f),c=a.x,l=a.y,c>=o.x&&c<=o.x+o.width&&l>=o.y&&l<=o.y+o.height||(t=this._canvas.getRootElement())),this._canvas.addShape(n,t,r)}else{if(!A(u,"bpmndi:BPMNEdge"))throw new Error(p("unknown di {di} for element {semantic}",{di:gt(u),semantic:gt(e)}));var v=this._getSource(e),g=this._getTarget(e);i=t&&(t.hidden||t.collapsed),n=this._elementFactory.createConnection(ls(e,{hidden:i,source:v,target:g,waypoints:tE(e,v,g)})),A(e,"bpmn:DataAssociation")&&(t=null),A(e,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,t,r)}return Nr(e)&&pn(n)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},Hn.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:gt(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw bm(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),o.indexOf(t)===-1&&o.push(t)},Hn.prototype.addLabel=function(e,t){var n,i,r;return n=function(o,a){var c,l,u,p=o.di.label;return p&&p.bounds?(u=p.bounds,l={width:Math.max(No.width,u.width),height:u.height},c={x:u.x+u.width/2,y:u.y+u.height/2}):(c=cs(a),l=No),z({x:c.x-l.width/2,y:c.y-l.height/2},l)}(e,t),(i=pn(t))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(ls(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!pn(t),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,t.parent)},Hn.prototype._getEnd=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],t==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(t==="source"&&r==="bpmn:DataOutputAssociation"||t==="target"&&r==="bpmn:DataInputAssociation")&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?bm(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:gt(e),side:t}))},Hn.prototype._getSource=function(e){return this._getEnd(e,"source")},Hn.prototype._getTarget=function(e){return this._getEnd(e,"target")},Hn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};const nE={__depends__:[Qx,{__depends__:[as],bpmnImporter:["type",Hn]}]};function xm(e){e&&typeof e.stopPropagation=="function"&&e.stopPropagation()}function Ir(e){return e.originalEvent||e.srcEvent}function eu(e,t){xm(e),xm(Ir(e))}function yi(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Em(e,t){return(Ir(e)||e).button===t}function gi(e){return Em(e,0)}function Dr(e){var t=Ir(e)||e;return!!gi(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function _m(e){var t=Ir(e)||e;return gi(e)&&t.shiftKey}function iE(e){return!0}function us(e){return gi(e)||function(t){return Em(t,1)}(e)}function wm(e,t,n){var i=this;function r(w,_,C){var B,s;(function(h,m){var E=l[h]||gi;return!E(m)})(w,_)||(C?s=t.getGraphics(C):(B=_.delegateTarget||_.target)&&(s=B,C=t.get(s)),s&&C&&e.fire(w,{element:C,gfx:s,originalEvent:_})===!1&&(_.stopPropagation(),_.preventDefault()))}var o={};function a(w){return o[w]}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"},l={"element.contextmenu":iE,"element.mousedown":us,"element.mouseup":us,"element.click":us,"element.dblclick":us},u="svg, .djs-element";function p(w,_,C,B){var s=o[C]=function(h){r(C,h)};B&&(l[C]=B),s.$delegate=Gt.bind(w,u,_,s)}function d(w,_,C){var B=a(C);B&&Gt.unbind(w,_,B.$delegate)}e.on("canvas.destroy",function(w){(function(_){L(c,function(C,B){d(_,B,C)})})(w.svg)}),e.on("canvas.init",function(w){(function(_){L(c,function(C,B){p(_,B,C)})})(w.svg)}),e.on(["shape.added","connection.added"],function(w){var _=w.element,C=w.gfx;e.fire("interactionEvents.createHit",{element:_,gfx:C})}),e.on(["shape.changed","connection.changed"],500,function(w){var _=w.element,C=w.gfx;e.fire("interactionEvents.updateHit",{element:_,gfx:C})}),e.on("interactionEvents.createHit",500,function(w){var _=w.element,C=w.gfx;i.createDefaultHit(_,C)}),e.on("interactionEvents.updateHit",function(w){var _=w.element,C=w.gfx;i.updateDefaultHit(_,C)});var y=g("djs-hit djs-hit-stroke"),f=g("djs-hit djs-hit-click-stroke"),v={all:g("djs-hit djs-hit-all"),"click-stroke":f,stroke:y};function g(w,_){return _=z({stroke:"white",strokeWidth:15},_||{}),n.cls(w,["no-fill","no-border"],_)}function b(w,_){var C=v[_];if(!C)throw new Error("invalid hit type <"+_+">");return K(w,C),w}function S(w,_){le(w,_)}this.removeHits=function(w){L(El(".djs-hit",w),tt)},this.createDefaultHit=function(w,_){var C,B=w.waypoints,s=w.isFrame;return B?this.createWaypointsHit(_,B):(C=s?"stroke":"all",this.createBoxHit(_,C,{width:w.width,height:w.height}))},this.createWaypointsHit=function(w,_){var C=Il(_);return b(C,"stroke"),S(w,C),C},this.createBoxHit=function(w,_,C){C=z({x:0,y:0},C);var B=oe("rect");return b(B,_),K(B,C),S(w,B),B},this.updateDefaultHit=function(w,_){var C=Xe(".djs-hit",_);if(C)return w.waypoints?function(B,s){K(B,{points:dd(s)})}(C,w.waypoints):K(C,{width:w.width,height:w.height}),C},this.fire=r,this.triggerMouseEvent=function(w,_,C){var B=c[w];if(!B)throw new Error("unmapped DOM event name <"+w+">");return r(B,_,C)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=d}wm.$inject=["eventBus","elementRegistry","styles"];const Io={__init__:["interactionEvents"],interactionEvents:["type",wm]};function ps(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function o(a,c){var l=oe("rect");return K(l,z({x:10,y:10,width:100,height:100},i)),le(a,l),l}e.on(["shape.added","shape.changed"],500,function(a){var c=a.element,l=a.gfx,u=Xe(".djs-outline",l);u||(u=o(l)),r.updateShapeOutline(u,c)}),e.on(["connection.added","connection.changed"],function(a){var c=a.element,l=a.gfx,u=Xe(".djs-outline",l);u||(u=o(l)),r.updateConnectionOutline(u,c)})}ps.prototype.updateShapeOutline=function(e,t){K(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},ps.prototype.updateConnectionOutline=function(e,t){var n=vt(t);K(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},ps.$inject=["eventBus","styles","elementRegistry"];const Sm={__init__:["outline"],outline:["type",ps]};function Br(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),e.on(["diagram.clear","plane.set"],function(i){n.select(null)})}Br.$inject=["eventBus","canvas"],Br.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},Br.prototype.get=function(){return this._selectedElements},Br.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},Br.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();ge(e)||(e=e?[e]:[]);var r=this._canvas;e=e.filter(function(o){return r.findPlane(o)===r.getActivePlane()}),t?L(e,function(o){n.indexOf(o)===-1&&n.push(o)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Cm="hover",Tm="selected";function Am(e,t,n,i){function r(a,c){t.addMarker(a,c)}function o(a,c){t.removeMarker(a,c)}this._multiSelectionBox=null,e.on("element.hover",function(a){r(a.element,Cm)}),e.on("element.out",function(a){o(a.element,Cm)}),e.on("selection.changed",function(a){var c=a.oldSelection,l=a.newSelection;L(c,function(u){l.indexOf(u)===-1&&o(u,Tm)}),L(l,function(u){c.indexOf(u)===-1&&r(u,Tm)})})}function km(e,t,n,i){e.on("create.end",500,function(r){var o=r.context,a=o.canExecute,c=o.elements,l=(o.hints||{}).autoSelect;if(a){if(l===!1)return;ge(l)?t.select(l):t.select(c.filter(rE))}}),e.on("connect.end",500,function(r){var o=r.context,a=o.canExecute,c=o.hover;a&&c&&t.select(c)}),e.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id);Pe(o,function(c){return a.id===c.id})||t.select(a)}),e.on("element.click",function(r){if(gi(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),c=t.get().length>1,l=Dr(r)||_m(r);if(a&&c)return l?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,l)}})}function rE(e){return!e.hidden}Am.$inject=["eventBus","canvas","selection","styles"],km.$inject=["eventBus","selection","canvas","elementRegistry"];const Rn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Io,Sm],selection:["type",Br],selectionVisuals:["type",Am],selectionBehavior:["type",km]};function tu(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}tu.prototype.next=function(){return this._prefix+ ++this._counter};var oE=new tu("ov");function ut(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=oE,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),o=je('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(o,r.firstChild),o),this._init()}function Pm(e,t,n){z(e.style,{left:t+"px",top:n+"px"})}function Do(e,t){e.style.display=t===!1?"none":""}function Mm(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}ut.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ut.prototype.get=function(e){if(Dt(e)&&(e={id:e}),Dt(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?de(t.overlays,Kt({type:e.type})):t.overlays.slice():[]}return e.type?de(this._overlays,Kt({type:e.type})):e.id?this._overlays[e.id]:null},ut.prototype.add=function(e,t,n){if(et(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},ut.prototype.remove=function(e){var t=this.get(e)||[];ge(t)||(t=[t]);var n=this;L(t,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(An(i.html),An(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)}})},ut.prototype.show=function(){Do(this._overlayRoot)},ut.prototype.hide=function(){Do(this._overlayRoot,!1)},ut.prototype.clear=function(){this._overlays={},this._overlayContainers=[],La(this._overlayRoot)},ut.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=vt(t);i=o.x,r=o.y}Pm(n,i,r),$t(e.html,"data-container-id",t.id)},ut.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,c=i.top;i.right!==void 0&&(t=o.waypoints?vt(o).width:o.width,a=-1*i.right+t),i.bottom!==void 0&&(n=o.waypoints?vt(o).height:o.height,c=-1*i.bottom+n),Pm(r,a||0,c||0)},ut.prototype._createOverlayContainer=function(e){var t=je('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ut.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Mm(this._overlayRoot,n)},ut.prototype._getOverlayContainer=function(e,t){var n=Pe(this._overlayContainers,function(i){return i.element===e});return n||t?n:this._createOverlayContainer(e)},ut.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),Dt(o)&&(o=je(o)),n=this._getOverlayContainer(r),(t=je('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(o),e.type&&ot(t).add("djs-overlay-"+e.type);var a=this._canvas.findPlane(r),c=this._canvas.getActivePlane();e.plane=a,a!==c&&Do(t,!1),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ut.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=e.plane,r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,c=!0;(i!==this._canvas.getActivePlane()||n&&(Wt(r)&&r>t.scale||Wt(o)&&o<t.scale))&&(c=!1),Do(a,c),this._updateOverlayScale(e,t)},ut.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,a=e.htmlContainer,c="";o!==!0&&(o===!1?(n=1,i=1):(n=o.min,i=o.max),Wt(n)&&t.scale<n&&(r=(1/t.scale||1)*n),Wt(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),Wt(r)&&(c="scale("+r+","+r+")"),Mm(a,c)},ut.prototype._updateOverlaysVisibilty=function(e){var t=this;L(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},ut.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(n){t.hide()}),e.on("canvas.viewbox.changed",function(n){var i;i=n.viewbox,t._updateRoot(i),t._updateOverlaysVisibilty(i),t.show()}),e.on(["shape.remove","connection.remove"],function(n){var i=n.element;L(t.get({element:i}),function(a){t.remove(a.id)});var r=t._getOverlayContainer(i);if(r){An(r.html);var o=t._overlayContainers.indexOf(r);o!==-1&&t._overlayContainers.splice(o,1)}}),e.on("element.changed",500,function(n){var i=n.element,r=t._getOverlayContainer(i,!0);r&&(L(r.overlays,function(o){t._updateOverlay(o)}),t._updateOverlayContainer(r))}),e.on("element.marker.update",function(n){var i=t._getOverlayContainer(n.element,!0);i&&ot(i.html)[n.add?"add":"remove"](n.marker)}),e.on("plane.set",function(n){L(t._overlays,function(i){Do(i.htmlContainer,i.plane===n.plane)})}),e.on("diagram.clear",this.clear,this)};const nu={__init__:["overlays"],overlays:["type",ut]};function qn(e){He.call(this,e)}ie(qn,He),qn.prototype._modules=[nE,as,Rn,nu],qn.prototype._moddleExtensions={};var aE=["c","C",67],sE=["v","V",86],cE=["y","Y",89],Rm=["z","Z",90];function qt(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function hn(e,t){return(e=ge(e)?e:[e]).indexOf(t.key)!==-1||e.indexOf(t.keyCode)!==-1}function iu(e){return e.shiftKey}var hs="keyboard.keydown",Nm="input-handle-modified-keys";function pt(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),t.on("diagram.init",function(){n._fire("init")}),t.on("attach",function(){e&&e.bindTo&&n.bind(e.bindTo)}),t.on("detach",function(){n.unbind()})}pt.$inject=["config.keyboard","eventBus"],pt.prototype._keydownHandler=function(e){this._keyHandler(e,hs)},pt.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},pt.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||hs,n)&&e.preventDefault()}},pt.prototype._isEventIgnored=function(e){return(t=e.target)&&(ja(t,"input, textarea")||t.contentEditable==="true")&&this._isModifiedKeyIgnored(e);var t},pt.prototype._isModifiedKeyIgnored=function(e){return!qt(e)||!this._getAllowedModifiers(e.target).includes(e.key)},pt.prototype._getAllowedModifiers=function(e){var t=Fi(e,"["+Nm+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Nm).split(",")},pt.prototype.bind=function(e){this.unbind(),this._node=e,ce.bind(e,"keydown",this._keydownHandler,!0),ce.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},pt.prototype.getBinding=function(){return this._node},pt.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ce.unbind(e,"keydown",this._keydownHandler,!0),ce.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},pt.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},pt.prototype.addListener=function(e,t,n){ft(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||hs,e,t)},pt.prototype.removeListener=function(e,t){this._eventBus.off(t||hs,e)},pt.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},pt.prototype.isCmd=qt,pt.prototype.isShift=iu,pt.prototype.isKey=hn;var lE=500;function Or(e,t){var n=this;e.on("editorActions.init",lE,function(i){var r=i.editorActions;n.registerBindings(t,r)})}Or.$inject=["eventBus","keyboard"],Or.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("undo",function(i){if(function(r){return qt(r)&&!iu(r)&&hn(Rm,r)}(i.keyEvent))return t.trigger("undo"),!0}),n("redo",function(i){if(function(r){return qt(r)&&(hn(cE,r)||hn(Rm,r)&&iu(r))}(i.keyEvent))return t.trigger("redo"),!0}),n("copy",function(i){if(function(r){return qt(r)&&hn(aE,r)}(i.keyEvent))return t.trigger("copy"),!0}),n("paste",function(i){if(function(r){return qt(r)&&hn(sE,r)}(i.keyEvent))return t.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(hn(["+","Add","="],r)&&qt(r))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(hn(["-","Subtract"],r)&&qt(r))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(hn("0",r)&&qt(r))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){if(hn(["Backspace","Delete","Del"],i.keyEvent))return t.trigger("removeSelection"),!0})};const ru={__init__:["keyboard","keyboardBindings"],keyboard:["type",pt],keyboardBindings:["type",Or]};var uE={moveSpeed:50,moveSpeedAccelerated:200};function Im(e,t,n){var i=this;this._config=z({},uE,e||{}),t.addListener(function(r){var o=r.keyEvent,a=i._config;if(t.isCmd(o)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],o)){var c,l=t.isShift(o)?a.moveSpeedAccelerated:a.moveSpeed;switch(o.key){case"ArrowLeft":case"Left":c="left";break;case"ArrowUp":case"Up":c="up";break;case"ArrowRight":case"Right":c="right";break;case"ArrowDown":case"Down":c="down"}return i.moveCanvas({speed:l,direction:c}),!0}}),this.moveCanvas=function(r){var o=0,a=0,c=r.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(r.direction){case"left":o=c;break;case"up":a=c;break;case"right":o=-c;break;case"down":a=-c}n.scroll({dx:o,dy:a})}}Im.$inject=["config.keyboardMove","keyboard","canvas"];const Dm={__depends__:[ru],__init__:["keyboardMove"],keyboardMove:["type",Im]};var pE=/^djs-cursor-.*$/;function ds(e){var t=ot(document.body);t.removeMatching(pE),e&&t.add("djs-cursor-"+e)}function Bm(){ds(null)}var hE=5e3;function Om(e,t){function n(){return!1}return t=t||"element.click",e.once(t,hE,n),function(){e.off(t,n)}}function Bo(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Nn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Lm(e,t){var n;function i(o){var a,c=n.start,l=n.button,u=yi(o),p=Nn(u,c);!n.dragging&&(a=p,Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2))>15)&&(n.dragging=!0,l===0&&Om(e),ds("grab")),n.dragging&&(p=Nn(u,n.last||n.start),t.scroll({dx:p.x,dy:p.y}),n.last=u),o.preventDefault()}function r(o){ce.unbind(document,"mousemove",i),ce.unbind(document,"mouseup",r),n=null,Bm()}e.on("element.mousedown",500,function(o){return function(a){if(!Fi(a.target,".djs-draggable")){var c=a.button;if(!(c>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:c,start:yi(a)},ce.bind(document,"mousemove",i),ce.bind(document,"mouseup",r),!0}}(o.originalEvent)}),this.isActive=function(){return!!n}}Lm.$inject=["eventBus","canvas"];const jm={__init__:["moveCanvas"],moveCanvas:["type",Lm]};function ou(e){return Math.log(e)/Math.log(10)}function Vm(e,t){var n=ou(e.min),i=ou(e.max);return(Math.abs(n)+Math.abs(i))/t}var dE=Math.sign||function(e){return e>=0?1:-1},au={min:.2,max:4};function In(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=St(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",function(r){i._init(e.enabled!==!1)})}In.$inject=["config.zoomScroll","eventBus","canvas"],In.prototype.scroll=function(e){this._canvas.scroll(e)},In.prototype.reset=function(){this._canvas.zoom("fit-viewport")},In.prototype.zoom=function(e,t){var n=Vm(au,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},In.prototype._handleWheel=function(e){if(!Fi(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?e.deltaMode===0?.02:.32:e.deltaMode===0?1:16,i){var a=t.getBoundingClientRect(),c={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*dE(e.deltaY)*o,this.zoom(n,c)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},In.prototype.stepZoom=function(e,t){var n=Vm(au,10);this._zoom(e,t,n)},In.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=ou(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var c,l,u=Math.pow(10,a);i.zoom((c=au,l=u,Math.max(c.min,Math.min(c.max,l))),t)},In.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return e===void 0&&(e=!i),i!==e&&ce[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},In.prototype._init=function(e){this.toggle(e)};const Fm={__init__:["zoomScroll"],zoomScroll:["type",In]};function Oo(e){qn.call(this,e)}ie(Oo,qn),Oo.prototype._navigationModules=[Dm,jm,Fm],Oo.prototype._modules=[].concat(qn.prototype._modules,Oo.prototype._navigationModules);var zm={exports:{}};(function(e){(function(t,n,i,r){var o,a=["","webkit","Moz","MS","ms","o"],c=n.createElement("div"),l="function",u=Math.round,p=Math.abs,d=Date.now;function y(k,O,F){return setTimeout(_(k,F),O)}function f(k,O,F){return!!Array.isArray(k)&&(v(k,F[O],F),!0)}function v(k,O,F){var U;if(k)if(k.forEach)k.forEach(O,F);else if(k.length!==r)for(U=0;U<k.length;)O.call(F,k[U],U,k),U++;else for(U in k)k.hasOwnProperty(U)&&O.call(F,k[U],U,k)}function g(k,O,F){var U="DEPRECATED METHOD: "+O+`
  14. `+F+` AT
  15. `;return function(){var Y=new Error("get-stack-trace"),ye=Y&&Y.stack?Y.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Le=t.console&&(t.console.warn||t.console.log);return Le&&Le.call(t.console,U,ye),k.apply(this,arguments)}}o=typeof Object.assign!="function"?function(k){if(k===r||k===null)throw new TypeError("Cannot convert undefined or null to object");for(var O=Object(k),F=1;F<arguments.length;F++){var U=arguments[F];if(U!==r&&U!==null)for(var Y in U)U.hasOwnProperty(Y)&&(O[Y]=U[Y])}return O}:Object.assign;var b=g(function(k,O,F){for(var U=Object.keys(O),Y=0;Y<U.length;)(!F||F&&k[U[Y]]===r)&&(k[U[Y]]=O[U[Y]]),Y++;return k},"extend","Use `assign`."),S=g(function(k,O){return b(k,O,!0)},"merge","Use `assign`.");function w(k,O,F){var U,Y=O.prototype;(U=k.prototype=Object.create(Y)).constructor=k,U._super=Y,F&&o(U,F)}function _(k,O){return function(){return k.apply(O,arguments)}}function C(k,O){return typeof k==l?k.apply(O&&O[0]||r,O):k}function B(k,O){return k===r?O:k}function s(k,O,F){v(T(O),function(U){k.addEventListener(U,F,!1)})}function h(k,O,F){v(T(O),function(U){k.removeEventListener(U,F,!1)})}function m(k,O){for(;k;){if(k==O)return!0;k=k.parentNode}return!1}function E(k,O){return k.indexOf(O)>-1}function T(k){return k.trim().split(/\s+/g)}function M(k,O,F){if(k.indexOf&&!F)return k.indexOf(O);for(var U=0;U<k.length;){if(F&&k[U][F]==O||!F&&k[U]===O)return U;U++}return-1}function N(k){return Array.prototype.slice.call(k,0)}function $(k,O,F){for(var U=[],Y=[],ye=0;ye<k.length;){var Le=O?k[ye][O]:k[ye];M(Y,Le)<0&&U.push(k[ye]),Y[ye]=Le,ye++}return F&&(U=O?U.sort(function(wt,Ae){return wt[O]>Ae[O]}):U.sort()),U}function P(k,O){for(var F,U,Y=O[0].toUpperCase()+O.slice(1),ye=0;ye<a.length;){if((U=(F=a[ye])?F+Y:O)in k)return U;ye++}return r}var x=1;function I(k){var O=k.ownerDocument||k;return O.defaultView||O.parentWindow||t}var j="ontouchstart"in t,G=P(t,"PointerEvent")!==r,X=j&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),ee="touch",re="mouse",se=25,H=1,q=4,xe=8,ze=1,ct=2,Ie=4,We=8,_e=16,$e=ct|Ie,Ke=We|_e,Re=$e|Ke,ht=["x","y"],Se=["clientX","clientY"];function Ge(k,O){var F=this;this.manager=k,this.callback=O,this.element=k.element,this.target=k.options.inputTarget,this.domHandler=function(U){C(k.options.enable,[k])&&F.handler(U)},this.init()}function he(k,O,F){var U=F.pointers.length,Y=F.changedPointers.length,ye=O&H&&U-Y==0,Le=O&(q|xe)&&U-Y==0;F.isFirst=!!ye,F.isFinal=!!Le,ye&&(k.session={}),F.eventType=O,function(wt,Ae){var At=wt.session,rl=Ae.pointers,_0=rl.length;At.firstInput||(At.firstInput=Oe(Ae)),_0>1&&!At.firstMultiple?At.firstMultiple=Oe(Ae):_0===1&&(At.firstMultiple=!1);var w0=At.firstInput,no=At.firstMultiple,S0=no?no.center:w0.center,C0=Ae.center=Di(rl);Ae.timeStamp=d(),Ae.deltaTime=Ae.timeStamp-w0.timeStamp,Ae.angle=xn(S0,C0),Ae.distance=_t(S0,C0),function(_n,dt){var Oi=dt.center,mr=_n.offsetDelta||{},fr=_n.prevDelta||{},vr=_n.prevInput||{};dt.eventType!==H&&vr.eventType!==q||(fr=_n.prevDelta={x:vr.deltaX||0,y:vr.deltaY||0},mr=_n.offsetDelta={x:Oi.x,y:Oi.y}),dt.deltaX=fr.x+(Oi.x-mr.x),dt.deltaY=fr.y+(Oi.y-mr.y)}(At,Ae),Ae.offsetDirection=Qe(Ae.deltaX,Ae.deltaY);var io=hr(Ae.deltaTime,Ae.deltaX,Ae.deltaY);Ae.overallVelocityX=io.x,Ae.overallVelocityY=io.y,Ae.overallVelocity=p(io.x)>p(io.y)?io.x:io.y,Ae.scale=no?(Vh=no.pointers,Fh=rl,_t(Fh[0],Fh[1],Se)/_t(Vh[0],Vh[1],Se)):1,Ae.rotation=no?function(_n,dt){return xn(dt[1],dt[0],Se)+xn(_n[1],_n[0],Se)}(no.pointers,rl):0,Ae.maxPointers=At.prevInput?Ae.pointers.length>At.prevInput.maxPointers?Ae.pointers.length:At.prevInput.maxPointers:Ae.pointers.length,function(_n,dt){var Oi,mr,fr,vr,Li=_n.lastInterval||dt,T0=dt.timeStamp-Li.timeStamp;if(dt.eventType!=xe&&(T0>se||Li.velocity===r)){var A0=dt.deltaX-Li.deltaX,k0=dt.deltaY-Li.deltaY,ro=hr(T0,A0,k0);mr=ro.x,fr=ro.y,Oi=p(ro.x)>p(ro.y)?ro.x:ro.y,vr=Qe(A0,k0),_n.lastInterval=dt}else Oi=Li.velocity,mr=Li.velocityX,fr=Li.velocityY,vr=Li.direction;dt.velocity=Oi,dt.velocityX=mr,dt.velocityY=fr,dt.direction=vr}(At,Ae);var Vh,Fh,zh=wt.element;m(Ae.srcEvent.target,zh)&&(zh=Ae.srcEvent.target),Ae.target=zh}(k,F),k.emit("hammer.input",F),k.recognize(F),k.session.prevInput=F}function Oe(k){for(var O=[],F=0;F<k.pointers.length;)O[F]={clientX:u(k.pointers[F].clientX),clientY:u(k.pointers[F].clientY)},F++;return{timeStamp:d(),pointers:O,center:Di(O),deltaX:k.deltaX,deltaY:k.deltaY}}function Di(k){var O=k.length;if(O===1)return{x:u(k[0].clientX),y:u(k[0].clientY)};for(var F=0,U=0,Y=0;Y<O;)F+=k[Y].clientX,U+=k[Y].clientY,Y++;return{x:u(F/O),y:u(U/O)}}function hr(k,O,F){return{x:O/k||0,y:F/k||0}}function Qe(k,O){return k===O?ze:p(k)>=p(O)?k<0?ct:Ie:O<0?We:_e}function _t(k,O,F){F||(F=ht);var U=O[F[0]]-k[F[0]],Y=O[F[1]]-k[F[1]];return Math.sqrt(U*U+Y*Y)}function xn(k,O,F){F||(F=ht);var U=O[F[0]]-k[F[0]],Y=O[F[1]]-k[F[1]];return 180*Math.atan2(Y,U)/Math.PI}Ge.prototype={handler:function(){},init:function(){this.evEl&&s(this.element,this.evEl,this.domHandler),this.evTarget&&s(this.target,this.evTarget,this.domHandler),this.evWin&&s(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&h(this.element,this.evEl,this.domHandler),this.evTarget&&h(this.target,this.evTarget,this.domHandler),this.evWin&&h(I(this.element),this.evWin,this.domHandler)}};var Bi={mousedown:H,mousemove:2,mouseup:q},Yc="mousedown",vA="mousemove mouseup";function Jc(){this.evEl=Yc,this.evWin=vA,this.pressed=!1,Ge.apply(this,arguments)}w(Jc,Ge,{handler:function(k){var O=Bi[k.type];O&H&&k.button===0&&(this.pressed=!0),2&O&&k.which!==1&&(O=q),this.pressed&&(O&q&&(this.pressed=!1),this.callback(this.manager,O,{pointers:[k],changedPointers:[k],pointerType:re,srcEvent:k}))}});var yA={pointerdown:H,pointermove:2,pointerup:q,pointercancel:xe,pointerout:xe},gA={2:ee,3:"pen",4:re,5:"kinect"},p0="pointerdown",h0="pointermove pointerup pointercancel";function Mh(){this.evEl=p0,this.evWin=h0,Ge.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(p0="MSPointerDown",h0="MSPointerMove MSPointerUp MSPointerCancel"),w(Mh,Ge,{handler:function(k){var O=this.store,F=!1,U=k.type.toLowerCase().replace("ms",""),Y=yA[U],ye=gA[k.pointerType]||k.pointerType,Le=ye==ee,wt=M(O,k.pointerId,"pointerId");Y&H&&(k.button===0||Le)?wt<0&&(O.push(k),wt=O.length-1):Y&(q|xe)&&(F=!0),wt<0||(O[wt]=k,this.callback(this.manager,Y,{pointers:O,changedPointers:[k],pointerType:ye,srcEvent:k}),F&&O.splice(wt,1))}});var bA={touchstart:H,touchmove:2,touchend:q,touchcancel:xe};function d0(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Ge.apply(this,arguments)}function xA(k,O){var F=N(k.touches),U=N(k.changedTouches);return O&(q|xe)&&(F=$(F.concat(U),"identifier",!0)),[F,U]}w(d0,Ge,{handler:function(k){var O=bA[k.type];if(O===H&&(this.started=!0),this.started){var F=xA.call(this,k,O);O&(q|xe)&&F[0].length-F[1].length==0&&(this.started=!1),this.callback(this.manager,O,{pointers:F[0],changedPointers:F[1],pointerType:ee,srcEvent:k})}}});var EA={touchstart:H,touchmove:2,touchend:q,touchcancel:xe},_A="touchstart touchmove touchend touchcancel";function Zc(){this.evTarget=_A,this.targetIds={},Ge.apply(this,arguments)}function wA(k,O){var F=N(k.touches),U=this.targetIds;if(O&(2|H)&&F.length===1)return U[F[0].identifier]=!0,[F,F];var Y,ye,Le=N(k.changedTouches),wt=[],Ae=this.target;if(ye=F.filter(function(At){return m(At.target,Ae)}),O===H)for(Y=0;Y<ye.length;)U[ye[Y].identifier]=!0,Y++;for(Y=0;Y<Le.length;)U[Le[Y].identifier]&&wt.push(Le[Y]),O&(q|xe)&&delete U[Le[Y].identifier],Y++;return wt.length?[$(ye.concat(wt),"identifier",!0),wt]:void 0}w(Zc,Ge,{handler:function(k){var O=EA[k.type],F=wA.call(this,k,O);F&&this.callback(this.manager,O,{pointers:F[0],changedPointers:F[1],pointerType:ee,srcEvent:k})}});var SA=2500;function Rh(){Ge.apply(this,arguments);var k=_(this.handler,this);this.touch=new Zc(this.manager,k),this.mouse=new Jc(this.manager,k),this.primaryTouch=null,this.lastTouches=[]}function CA(k,O){k&H?(this.primaryTouch=O.changedPointers[0].identifier,m0.call(this,O)):k&(q|xe)&&m0.call(this,O)}function m0(k){var O=k.changedPointers[0];if(O.identifier===this.primaryTouch){var F={x:O.clientX,y:O.clientY};this.lastTouches.push(F);var U=this.lastTouches;setTimeout(function(){var Y=U.indexOf(F);Y>-1&&U.splice(Y,1)},SA)}}function TA(k){for(var O=k.srcEvent.clientX,F=k.srcEvent.clientY,U=0;U<this.lastTouches.length;U++){var Y=this.lastTouches[U],ye=Math.abs(O-Y.x),Le=Math.abs(F-Y.y);if(ye<=25&&Le<=25)return!0}return!1}w(Rh,Ge,{handler:function(k,O,F){var U=F.pointerType==ee,Y=F.pointerType==re;if(!(Y&&F.sourceCapabilities&&F.sourceCapabilities.firesTouchEvents)){if(U)CA.call(this,O,F);else if(Y&&TA.call(this,F))return;this.callback(k,O,F)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var f0=P(c.style,"touchAction"),v0=f0!==r,y0="compute",g0="auto",Nh="manipulation",dr="none",ka="pan-x",Pa="pan-y",Qc=function(){if(!v0)return!1;var k={},O=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(F){k[F]=!O||t.CSS.supports("touch-action",F)}),k}();function Ih(k,O){this.manager=k,this.set(O)}Ih.prototype={set:function(k){k==y0&&(k=this.compute()),v0&&this.manager.element.style&&Qc[k]&&(this.manager.element.style[f0]=k),this.actions=k.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var k=[];return v(this.manager.recognizers,function(O){C(O.options.enable,[O])&&(k=k.concat(O.getTouchAction()))}),function(O){if(E(O,dr))return dr;var F=E(O,ka),U=E(O,Pa);return F&&U?dr:F||U?F?ka:Pa:E(O,Nh)?Nh:g0}(k.join(" "))},preventDefaults:function(k){var O=k.srcEvent,F=k.offsetDirection;if(this.manager.session.prevented)O.preventDefault();else{var U=this.actions,Y=E(U,dr)&&!Qc[dr],ye=E(U,Pa)&&!Qc[Pa],Le=E(U,ka)&&!Qc[ka];if(Y){var wt=k.pointers.length===1,Ae=k.distance<2,At=k.deltaTime<250;if(wt&&Ae&&At)return}if(!Le||!ye)return Y||ye&&F&$e||Le&&F&Ke?this.preventSrc(O):void 0}},preventSrc:function(k){this.manager.session.prevented=!0,k.preventDefault()}};var el=1,ni=32;function ii(k){this.options=o({},this.defaults,k||{}),this.id=x++,this.manager=null,this.options.enable=B(this.options.enable,!0),this.state=el,this.simultaneous={},this.requireFail=[]}function b0(k){return 16&k?"cancel":8&k?"end":4&k?"move":2&k?"start":""}function x0(k){return k==_e?"down":k==We?"up":k==ct?"left":k==Ie?"right":""}function tl(k,O){var F=O.manager;return F?F.get(k):k}function En(){ii.apply(this,arguments)}function nl(){En.apply(this,arguments),this.pX=null,this.pY=null}function Dh(){En.apply(this,arguments)}function Bh(){ii.apply(this,arguments),this._timer=null,this._input=null}function Oh(){En.apply(this,arguments)}function Lh(){En.apply(this,arguments)}function il(){ii.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ri(k,O){return(O=O||{}).recognizers=B(O.recognizers,ri.defaults.preset),new jh(k,O)}ii.prototype={defaults:{},set:function(k){return o(this.options,k),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(k){if(f(k,"recognizeWith",this))return this;var O=this.simultaneous;return O[(k=tl(k,this)).id]||(O[k.id]=k,k.recognizeWith(this)),this},dropRecognizeWith:function(k){return f(k,"dropRecognizeWith",this)||(k=tl(k,this),delete this.simultaneous[k.id]),this},requireFailure:function(k){if(f(k,"requireFailure",this))return this;var O=this.requireFail;return M(O,k=tl(k,this))===-1&&(O.push(k),k.requireFailure(this)),this},dropRequireFailure:function(k){if(f(k,"dropRequireFailure",this))return this;k=tl(k,this);var O=M(this.requireFail,k);return O>-1&&this.requireFail.splice(O,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(k){return!!this.simultaneous[k.id]},emit:function(k){var O=this,F=this.state;function U(Y){O.manager.emit(Y,k)}F<8&&U(O.options.event+b0(F)),U(O.options.event),k.additionalEvent&&U(k.additionalEvent),F>=8&&U(O.options.event+b0(F))},tryEmit:function(k){if(this.canEmit())return this.emit(k);this.state=ni},canEmit:function(){for(var k=0;k<this.requireFail.length;){if(!(this.requireFail[k].state&(ni|el)))return!1;k++}return!0},recognize:function(k){var O=o({},k);if(!C(this.options.enable,[this,O]))return this.reset(),void(this.state=ni);56&this.state&&(this.state=el),this.state=this.process(O),30&this.state&&this.tryEmit(O)},process:function(k){},getTouchAction:function(){},reset:function(){}},w(En,ii,{defaults:{pointers:1},attrTest:function(k){var O=this.options.pointers;return O===0||k.pointers.length===O},process:function(k){var O=this.state,F=k.eventType,U=6&O,Y=this.attrTest(k);return U&&(F&xe||!Y)?16|O:U||Y?F&q?8|O:2&O?4|O:2:ni}}),w(nl,En,{defaults:{event:"pan",threshold:10,pointers:1,direction:Re},getTouchAction:function(){var k=this.options.direction,O=[];return k&$e&&O.push(Pa),k&Ke&&O.push(ka),O},directionTest:function(k){var O=this.options,F=!0,U=k.distance,Y=k.direction,ye=k.deltaX,Le=k.deltaY;return Y&O.direction||(O.direction&$e?(Y=ye===0?ze:ye<0?ct:Ie,F=ye!=this.pX,U=Math.abs(k.deltaX)):(Y=Le===0?ze:Le<0?We:_e,F=Le!=this.pY,U=Math.abs(k.deltaY))),k.direction=Y,F&&U>O.threshold&&Y&O.direction},attrTest:function(k){return En.prototype.attrTest.call(this,k)&&(2&this.state||!(2&this.state)&&this.directionTest(k))},emit:function(k){this.pX=k.deltaX,this.pY=k.deltaY;var O=x0(k.direction);O&&(k.additionalEvent=this.options.event+O),this._super.emit.call(this,k)}}),w(Dh,En,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[dr]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.scale-1)>this.options.threshold||2&this.state)},emit:function(k){if(k.scale!==1){var O=k.scale<1?"in":"out";k.additionalEvent=this.options.event+O}this._super.emit.call(this,k)}}),w(Bh,ii,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[g0]},process:function(k){var O=this.options,F=k.pointers.length===O.pointers,U=k.distance<O.threshold,Y=k.deltaTime>O.time;if(this._input=k,!U||!F||k.eventType&(q|xe)&&!Y)this.reset();else if(k.eventType&H)this.reset(),this._timer=y(function(){this.state=8,this.tryEmit()},O.time,this);else if(k.eventType&q)return 8;return ni},reset:function(){clearTimeout(this._timer)},emit:function(k){this.state===8&&(k&&k.eventType&q?this.manager.emit(this.options.event+"up",k):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),w(Oh,En,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[dr]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.rotation)>this.options.threshold||2&this.state)}}),w(Lh,En,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:$e|Ke,pointers:1},getTouchAction:function(){return nl.prototype.getTouchAction.call(this)},attrTest:function(k){var O,F=this.options.direction;return F&($e|Ke)?O=k.overallVelocity:F&$e?O=k.overallVelocityX:F&Ke&&(O=k.overallVelocityY),this._super.attrTest.call(this,k)&&F&k.offsetDirection&&k.distance>this.options.threshold&&k.maxPointers==this.options.pointers&&p(O)>this.options.velocity&&k.eventType&q},emit:function(k){var O=x0(k.offsetDirection);O&&this.manager.emit(this.options.event+O,k),this.manager.emit(this.options.event,k)}}),w(il,ii,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Nh]},process:function(k){var O=this.options,F=k.pointers.length===O.pointers,U=k.distance<O.threshold,Y=k.deltaTime<O.time;if(this.reset(),k.eventType&H&&this.count===0)return this.failTimeout();if(U&&Y&&F){if(k.eventType!=q)return this.failTimeout();var ye=!this.pTime||k.timeStamp-this.pTime<O.interval,Le=!this.pCenter||_t(this.pCenter,k.center)<O.posThreshold;if(this.pTime=k.timeStamp,this.pCenter=k.center,Le&&ye?this.count+=1:this.count=1,this._input=k,this.count%O.taps===0)return this.hasRequireFailures()?(this._timer=y(function(){this.state=8,this.tryEmit()},O.interval,this),2):8}return ni},failTimeout:function(){return this._timer=y(function(){this.state=ni},this.options.interval,this),ni},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==8&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ri.VERSION="2.0.7",ri.defaults={domEvents:!1,touchAction:y0,enable:!0,inputTarget:null,inputClass:null,preset:[[Oh,{enable:!1}],[Dh,{enable:!1},["rotate"]],[Lh,{direction:$e}],[nl,{direction:$e},["swipe"]],[il],[il,{event:"doubletap",taps:2},["tap"]],[Bh]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function jh(k,O){var F;this.options=o({},ri.defaults,O||{}),this.options.inputTarget=this.options.inputTarget||k,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=k,this.input=new((F=this).options.inputClass||(G?Mh:X?Zc:j?Rh:Jc))(F,he),this.touchAction=new Ih(this,this.options.touchAction),E0(this,!0),v(this.options.recognizers,function(U){var Y=this.add(new U[0](U[1]));U[2]&&Y.recognizeWith(U[2]),U[3]&&Y.requireFailure(U[3])},this)}function E0(k,O){var F,U=k.element;U.style&&(v(k.options.cssProps,function(Y,ye){F=P(U.style,ye),O?(k.oldCssProps[F]=U.style[F],U.style[F]=Y):U.style[F]=k.oldCssProps[F]||""}),O||(k.oldCssProps={}))}jh.prototype={set:function(k){return o(this.options,k),k.touchAction&&this.touchAction.update(),k.inputTarget&&(this.input.destroy(),this.input.target=k.inputTarget,this.input.init()),this},stop:function(k){this.session.stopped=k?2:1},recognize:function(k){var O=this.session;if(!O.stopped){var F;this.touchAction.preventDefaults(k);var U=this.recognizers,Y=O.curRecognizer;(!Y||Y&&8&Y.state)&&(Y=O.curRecognizer=null);for(var ye=0;ye<U.length;)F=U[ye],O.stopped===2||Y&&F!=Y&&!F.canRecognizeWith(Y)?F.reset():F.recognize(k),!Y&&14&F.state&&(Y=O.curRecognizer=F),ye++}},get:function(k){if(k instanceof ii)return k;for(var O=this.recognizers,F=0;F<O.length;F++)if(O[F].options.event==k)return O[F];return null},add:function(k){if(f(k,"add",this))return this;var O=this.get(k.options.event);return O&&this.remove(O),this.recognizers.push(k),k.manager=this,this.touchAction.update(),k},remove:function(k){if(f(k,"remove",this))return this;if(k=this.get(k)){var O=this.recognizers,F=M(O,k);F!==-1&&(O.splice(F,1),this.touchAction.update())}return this},on:function(k,O){if(k!==r&&O!==r){var F=this.handlers;return v(T(k),function(U){F[U]=F[U]||[],F[U].push(O)}),this}},off:function(k,O){if(k!==r){var F=this.handlers;return v(T(k),function(U){O?F[U]&&F[U].splice(M(F[U],O),1):delete F[U]}),this}},emit:function(k,O){this.options.domEvents&&function(Y,ye){var Le=n.createEvent("Event");Le.initEvent(Y,!0,!0),Le.gesture=ye,ye.target.dispatchEvent(Le)}(k,O);var F=this.handlers[k]&&this.handlers[k].slice();if(F&&F.length){O.type=k,O.preventDefault=function(){O.srcEvent.preventDefault()};for(var U=0;U<F.length;)F[U](O),U++}},destroy:function(){this.element&&E0(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(ri,{INPUT_START:H,INPUT_MOVE:2,INPUT_END:q,INPUT_CANCEL:xe,STATE_POSSIBLE:el,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:ni,DIRECTION_NONE:ze,DIRECTION_LEFT:ct,DIRECTION_RIGHT:Ie,DIRECTION_UP:We,DIRECTION_DOWN:_e,DIRECTION_HORIZONTAL:$e,DIRECTION_VERTICAL:Ke,DIRECTION_ALL:Re,Manager:jh,Input:Ge,TouchAction:Ih,TouchInput:Zc,MouseInput:Jc,PointerEventInput:Mh,TouchMouseInput:Rh,SingleTouchInput:d0,Recognizer:ii,AttrRecognizer:En,Tap:il,Pan:nl,Swipe:Lh,Pinch:Dh,Rotate:Oh,Press:Bh,on:s,off:h,each:v,merge:S,extend:b,assign:o,inherit:w,bindFn:_,prefixed:P}),(t!==void 0?t:typeof self<"u"?self:{}).Hammer=ri,typeof r=="function"&&r.amd?r(function(){return ri}):e.exports?e.exports=ri:t.Hammer=ri})(window,document)})(zm);const qi=oo(zm.exports);var $m=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function ms(e,t){return t.get(e,!1)}function su(e){e.preventDefault(),typeof e.stopPropagation=="function"?e.stopPropagation():e.srcEvent&&typeof e.srcEvent.stopPropagation=="function"&&e.srcEvent.stopPropagation(),typeof e.stopImmediatePropagation=="function"&&e.stopImmediatePropagation()}function cu(e){function t(l){setTimeout(function(){L($m,function(u){ce.unbind(e,u,su,!0)})},500)}ce.bind(e,"touchstart",function(l){L($m,function(u){ce.bind(e,u,su,!0)})},!0),ce.bind(e,"touchend",t,!0),ce.bind(e,"touchcancel",t,!0);var n=new qi.Manager(e,{inputClass:qi.TouchInput,recognizers:[],domEvents:!0}),i=new qi.Tap,r=new qi.Pan({threshold:10}),o=new qi.Press,a=new qi.Pinch,c=new qi.Tap({event:"doubletap",taps:2});return a.requireFailure(r),a.requireFailure(o),n.add([r,o,a,c,i]),n.reset=function(l){var u=this.recognizers,p=this.session;p.stopped||(n.stop(l),setTimeout(function(){var d,y;for(d=0;y=u[d];d++)y.reset(),y.state=8;p.curRecognizer=null},0))},n.on("hammer.input",function(l){l.srcEvent.defaultPrevented&&n.reset(!0)}),n}function Gm(e,t,n,i,r){var o,a=ms("dragging",e),c=ms("move",e),l=ms("contextPad",e),u=ms("palette",e);function p(f,v){return function(g){var b=d(g.target),S=b&&i.get(b);return v&&(g.srcEvent.button=v),r.fire(f,g,S)}}function d(f){return Fi(f,"svg, .djs-element",!0)}function y(f){function v(g){var b=d(g.target),S=b&&i.get(b);if(c&&t.getRootElement()!==S)return c.start(g,S,!0);(function(w){var _=0,C=0;function B(h){var m=h.deltaX-_,E=h.deltaY-C;t.scroll({dx:m,dy:E}),_=h.deltaX,C=h.deltaY}function s(h){o.off("panmove",B),o.off("panend",s),o.off("pancancel",s)}o.on("panmove",B),o.on("panend",s),o.on("pancancel",s)})()}(o=cu(f)).on("tap",p("element.click")),o.on("doubletap",p("element.dblclick",1)),o.on("panstart",v),o.on("press",v),o.on("pinchstart",function(g){var b=t.zoom(),S=g.center;function w(C){var B=1-(1-C.scale)/1.5,s=Math.max(.2,Math.min(4,B*b));t.zoom(s,S),su(C)}function _(C){o.off("pinchmove",w),o.off("pinchend",_),o.off("pinchcancel",_),o.reset(!0)}o.on("pinchmove",w),o.on("pinchend",_),o.on("pinchcancel",_)})}a&&n.on("drag.move",function(f){var v=f.originalEvent;if(v&&!(v instanceof MouseEvent)){var g=yi(v),b=d(document.elementFromPoint(g.x,g.y)),S=b&&i.get(b);S!==f.hover&&(f.hover&&a.out(f),S&&(a.hover({element:S,gfx:b}),f.hover=S,f.hoverGfx=b))}}),l&&n.on("contextPad.create",function(f){var v=cu(f.pad.html);v.on("panstart",function(g){l.trigger("dragstart",g,!0)}),v.on("press",function(g){l.trigger("dragstart",g,!0)}),v.on("tap",function(g){l.trigger("click",g)})}),u&&n.on("palette.create",function(f){var v=cu(f.container);v.on("panstart",function(g){u.trigger("dragstart",g,!0)}),v.on("press",function(g){u.trigger("dragstart",g,!0)}),v.on("tap",function(g){u.trigger("click",g)})}),n.on("canvas.init",function(f){y(f.svg)})}function lu(e,t){var n=this;t.on("canvas.init",function(i){n.addBBoxMarker(i.svg)})}Gm.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],lu.$inject=["canvas","eventBus"],lu.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=oe("rect");K(n,{x:-1e4,y:1e4,width:10,height:10}),K(n,t),le(e,n);var i=oe("rect");K(i,{x:1e4,y:1e4,width:10,height:10}),K(i,t),le(e,i)};const mE={__depends__:[{__depends__:[Io],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",Gm],touchFix:["type",lu]}]};function uu(e){return e&&e[e.length-1]}function Um(e){return e.y}function Hm(e){return e.x}var fE={left:Hm,center:Hm,right:function(e){return e.x+e.width},top:Um,middle:Um,bottom:function(e){return e.y+e.height}};function Lr(e){this._modeling=e}Lr.$inject=["modeling"],Lr.prototype._getOrientationDetails=function(e){var t="x",n="width";return["top","bottom","middle"].indexOf(e)!==-1&&(t="y",n="height"),{axis:t,dimension:n}},Lr.prototype._isType=function(e,t){return t.indexOf(e)!==-1},Lr.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),a=o.axis,c=o.dimension,l={},u={},p=!1;if(this._isType(e,["left","top"]))l[e]=t[0][a];else if(this._isType(e,["right","bottom"]))r=uu(t),l[e]=r[a]+r[c];else if(this._isType(e,["center","middle"])){if(L(t,function(d){var y=d[a]+Math.round(d[c]/2);u[y]?u[y].elements.push(d):u[y]={elements:[d],center:y}}),n=Xt(u,function(d){return d.elements.length>1&&(p=!0),d.elements.length}),p)return l[e]=uu(n).center,l;i=t[0],r=uu(t=Xt(t,function(d){return d[a]+d[c]})),l[e]=function(d,y){return Math.round((d[a]+y[a]+y[c])/2)}(i,r)}return l},Lr.prototype.trigger=function(e,t){var n=this._modeling,i=de(e,function(a){return!(a.waypoints||a.host||a.labelTarget)});if(!(i.length<2)){var r=Xt(i,fE[t]),o=this._alignmentPosition(t,r);n.alignElements(r,o)}};const vE={__init__:["alignElements"],alignElements:["type",Lr]};var yE=10,qm=50,gE=250;function pu(e,t,n,i){for(var r;r=bE(e,n,t);)n=i(t,n,r);return n}function hu(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=e[o];if(a){var c=o==="x"?"width":"height",l=a.margin,u=a.minDistance;r[o]=l<0?Math.min(i[o]+l-t[c]/2,n[o]-u+l):Math.max(i[o]+i[c]+l+t[c]/2,n[o]+u+l)}}),r}}function bE(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=function(o){var a=du(o);return o.host&&(a=a.concat(du(o.host))),o.attachers&&(a=a.concat(o.attachers.reduce(function(c,l){return c.concat(du(l))},[]))),a}(e);return Pe(r,function(o){return o!==n&&yt(o,i,yE)==="intersect"})}function du(e){return(t=e,t.outgoing.map(function(n){return n.target})).concat(function(n){return n.incoming.map(function(i){return i.source})}(e));var t}function xE(){return!0}function Wm(e,t,n){e.on("autoPlace",100,function(i){var r=i.shape;return function(o,a,c){c||(c={});var l=c.defaultDistance||qm,u=fe(o),p=ae(o);return{x:p.right+l+a.width/2,y:u.y}}(i.source,r)}),e.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){e.fire("autoPlace.start",{source:i,shape:r});var a=e.fire("autoPlace",{source:i,shape:r}),c=t.appendShape(i,r,a,i.parent,o);return e.fire("autoPlace.end",{source:i,shape:c}),c}}function Xm(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}Wm.$inject=["eventBus","modeling","canvas"],Xm.$inject=["eventBus","selection"];const EE={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Wm],autoPlaceSelectionBehavior:["type",Xm]};we=function(e,t){return si(t,function(n){return A(e,n)})};function fs(e,t){for(typeof t=="string"&&(t=[t]);e=e.parent;)if(we(e,t))return e;return null}function Km(e,t){return A(t,"bpmn:TextAnnotation")?function(n,i){var r=ae(n),o={x:r.right+i.width/2,y:r.top-50-i.height/2};return pu(n,i,o,hu({y:{margin:-30,minDistance:20}}))}(e,t):we(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(n,i){var r=ae(n),o={x:r.right-10+i.width/2,y:r.bottom+40+i.width/2};return pu(n,i,o,hu({x:{margin:30,minDistance:30}}))}(e,t):A(t,"bpmn:FlowNode")?function(n,i){var r=ae(n),o=fe(n),a=function(d,y){y||(y={});var f=y.defaultDistance||qm,v=y.direction||"e",g=y.filter,b=y.getWeight||function(h){return h.source===d?1:-1},S=y.maxDistance||gE,w=y.reference||"start";function _(h,m){return v==="n"?w==="start"?ae(h).top-ae(m).bottom:w==="center"?ae(h).top-fe(m).y:ae(h).top-ae(m).top:v==="w"?w==="start"?ae(h).left-ae(m).right:w==="center"?ae(h).left-fe(m).x:ae(h).left-ae(m).left:v==="s"?w==="start"?ae(m).top-ae(h).bottom:w==="center"?fe(m).y-ae(h).bottom:ae(m).bottom-ae(h).bottom:w==="start"?ae(m).left-ae(h).right:w==="center"?fe(m).x-ae(h).right:ae(m).right-ae(h).right}g||(g=xE);var C=d.incoming.filter(g).map(function(h){var m=b(h),E=m<0?_(h.source,d):_(d,h.source);return{id:h.source.id,distance:E,weight:m}}),B=d.outgoing.filter(g).map(function(h){var m=b(h),E=m>0?_(d,h.target):_(h.target,d);return{id:h.target.id,distance:E,weight:m}}),s=Bt(C.concat(B).reduce(function(h,m){return h[m.id+"__weight_"+m.weight]=m,h},{}),function(h,m){var E=m.distance,T=m.weight;return E<0||E>S||(h[String(E)]||(h[String(E)]=0),h[String(E)]+=1*T,(!h.distance||h[h.distance]<h[String(E)])&&(h.distance=E)),h},{});return s.distance||f}(n,{filter:function(d){return A(d,"bpmn:SequenceFlow")}}),c=30,l=80,u="left";A(n,"bpmn:BoundaryEvent")&&(u=yt(n,n.host,-25)).indexOf("top")!==-1&&(c*=-1);var p={x:r.right+a+i.width/2,y:o.y+_E(u,l)};return pu(n,i,p,hu({y:{margin:c,minDistance:l}}))}(e,t):void 0}function _E(e,t){return e.indexOf("top")!=-1?-1*t:e.indexOf("bottom")!=-1?t:0}function Ym(e){e.on("autoPlace",function(t){var n=t.shape;return Km(t.source,n)})}Ym.$inject=["eventBus"];const wE={__depends__:[EE],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",Ym]};function Q(e){this._eventBus=e}Q.$inject=["eventBus"],Q.prototype.on=function(e,t,n,i,r,o){if((ft(t)||pe(t))&&(o=r,r=i,i=n,n=t,t=null),ft(n)&&(o=r,r=i,i=n,n=1e3),et(r)&&(o=r,r=!1),!ft(i))throw new Error("handlerFn must be a function");ge(e)||(e=[e]);var a=this._eventBus;L(e,function(c){var l=["commandStack",c,t].filter(function(u){return u}).join(".");a.on(l,n,r?function(u,p){return function(d){return u.call(p||null,d.context,d.command,d)}}(i,o):i,o)})};function Wn(e,t,n,i){Q.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],function(o){var a=o.context,c=a.hints||{},l=a.shape,u=a.parent||a.newParent;c.autoResize!==!1&&r._expand([l],u)}),this.postExecuted(["elements.move"],function(o){var a=o.context,c=fo(Oa(a.closure.topLevel)),l=a.hints,u=!l||l.autoResize;u!==!1&&L(Vi(c,function(p){return p.parent.id}),function(p,d){ge(u)&&(p=p.filter(function(y){return Pe(u,Kt({id:y.id}))})),r._expand(p,d)})}),this.postExecuted(["shape.toggleCollapse"],function(o){var a=o.context,c=a.hints,l=a.shape;c&&c.autoResize===!1||l.collapsed||r._expand(l.children||[],l)}),this.postExecuted(["shape.resize"],function(o){var a=o.context,c=a.hints,l=a.shape,u=l.parent;c&&c.autoResize===!1||u&&r._expand([l],u)})}function vs(e){e.invoke(Wn,this)}function bi(e){Q.call(this,e),this.init()}function Lo(e){bi.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}function ys(e,t){Lo.call(this,e),this._modeling=t}L(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],function(e){Q.prototype[e]=function(t,n,i,r,o){(ft(t)||pe(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}),Wn.$inject=["eventBus","elementRegistry","modeling","rules"],ie(Wn,Q),Wn.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=ae(vt(e)),o=ae(t),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),Vl(z({},o,a))},Wn.prototype._expand=function(e,t){if(typeof t=="string"&&(t=this._elementRegistry.get(t)),this._rules.allowed("element.autoResize",{elements:e,target:t})){var n=this._getOptimalBounds(e,t);if(function(o,a){return o.x!==a.x||o.y!==a.y||o.width!==a.width||o.height!==a.height}(n,t)){var i=function(o,a){var c="";return o=ae(o),a=ae(a),o.top>a.top&&(c=c.concat("n")),o.right<a.right&&(c=c.concat("w")),o.bottom<a.bottom&&(c=c.concat("s")),o.left>a.left&&(c=c.concat("e")),c}(Yt(t,["x","y","width","height"]),n);this.resize(t,n,{autoResize:i});var r=t.parent;r&&this._expand([t],r)}}},Wn.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},Wn.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},Wn.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},vs.$inject=["injector"],ie(vs,Wn),vs.prototype.resize=function(e,t,n){A(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},bi.$inject=["eventBus"],ie(bi,Q),bi.prototype.addRule=function(e,t,n){var i=this;typeof e=="string"&&(e=[e]),e.forEach(function(r){i.canExecute(r,t,function(o,a,c){return n(o)},!0)})},bi.prototype.init=function(){},Lo.$inject=["eventBus"],ie(Lo,bi),Lo.prototype.canResize=function(e,t){return!1},ie(ys,Lo),ys.$inject=["eventBus","modeling"],ys.prototype.canResize=function(e,t){if(!A(t,"bpmn:Participant")&&!A(t,"bpmn:Lane")&&!A(t,"bpmn:SubProcess"))return!1;var n=!0;return L(e,function(i){(A(i,"bpmn:Lane")||i.labelTarget)&&(n=!1)}),n};const SE={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",vs],bpmnAutoResizeProvider:["type",ys]};function Jm(e,t,n){var i,r,o=this,a=n.get("dragging",!1);a&&t.on("drag.start",function(c){t.once("drag.move",1500,function(l){(function(u){if(!u.hover){var p=u.originalEvent,d=o._findTargetGfx(p),y=d&&e.get(d);d&&y&&(u.stopPropagation(),a.hover({element:y,gfx:d}),a.move(p))}})(l)})}),t.on("element.hover",function(c){i=c.gfx,r=c.element}),t.on("element.hover",1500,function(c){r&&t.fire("element.out",{element:r,gfx:i})}),t.on("element.out",function(){i=null,r=null}),this._findTargetGfx=function(c){var l;if(c instanceof MouseEvent)return l=yi(c),function(u){return Fi(u,"svg, .djs-element",!0)}(document.elementFromPoint(l.x,l.y))}}Jm.$inject=["elementRegistry","eventBus","injector"];const CE={__init__:["hoverFix"],hoverFix:["type",Jm]};var jr=Math.round,Zm="djs-drag-active";function Wi(e){e.preventDefault()}function Qm(e,t,n,i){var r,o={threshold:5,trapClick:!0};function a(S){var w=t.viewbox(),_=t._container.getBoundingClientRect();return{x:w.x+(S.x-_.left)/w.scale,y:w.y+(S.y-_.top)/w.scale}}function c(S,w){w=w||r;var _=e.createEvent(z({},w.payload,w.data,{isTouch:w.isTouch}));return e.fire("drag."+S,_)!==!1&&e.fire(w.prefix+"."+S,_)}function l(S,w){var _,C=r.payload,B=r.displacement,s=r.globalStart,h=yi(S),m=Nn(h,s),E=r.localStart,T=a(h),M=Nn(T,E);if(!r.active&&(w||(_=m,Math.sqrt(Math.pow(_.x,2)+Math.pow(_.y,2))>r.threshold))){if(z(C,{x:jr(E.x+B.x),y:jr(E.y+B.y),dx:0,dy:0},{originalEvent:S}),c("start")===!1)return g();r.active=!0,r.keepSelection||(C.previousSelection=n.get(),n.select(null)),r.cursor&&ds(r.cursor),t.addMarker(t.getRootElement(),Zm)}eu(S),r.active&&(z(C,{x:jr(T.x+B.x),y:jr(T.y+B.y),dx:jr(M.x),dy:jr(M.y)},{originalEvent:S}),c("move"))}function u(S){var w=!0;r.active&&(S&&(r.payload.originalEvent=S,eu(S)),w=c("end")),w===!1&&c("rejected"),c("ended",b(w!==!0))}function p(S){S.which===27&&(Wi(S),g())}function d(S){var w;r.active&&(w=Om(e),setTimeout(w,400),Wi(S)),u(S)}function y(S){l(S)}function f(S){var w=r.payload;w.hoverGfx=S.gfx,w.hover=S.element,c("hover")}function v(S){c("out");var w=r.payload;w.hoverGfx=null,w.hover=null}function g(S){var w;if(r){var _=r.active;_&&c("cancel"),w=b(S),_&&c("canceled",w)}}function b(S){var w,_;c("cleanup"),Bm(),_=r.trapClick?d:u,ce.unbind(document,"mousemove",l),ce.unbind(document,"dragstart",Wi),ce.unbind(document,"selectstart",Wi),ce.unbind(document,"mousedown",_,!0),ce.unbind(document,"mouseup",_,!0),ce.unbind(document,"keyup",p),ce.unbind(document,"touchstart",y,!0),ce.unbind(document,"touchcancel",g,!0),ce.unbind(document,"touchmove",l,!0),ce.unbind(document,"touchend",u,!0),e.off("element.hover",f),e.off("element.out",v),t.removeMarker(t.getRootElement(),Zm);var C=r.payload.previousSelection;return S!==!1&&C&&!n.get().length&&function(B){var s=B.filter(function(h){return i.get(h.id)});s.length&&n.select(s)}(C),w=r,r=null,w}e.on("diagram.destroy",g),this.init=function(S,w,_,C){r&&g(!1),typeof w=="string"&&(C=_,_=w,w=null);var B,s,h,m,E,T=(C=z({},o,C||{})).data||{};m=C.trapClick?d:u,S?(B=Ir(S)||S,s=yi(S),eu(S),B.type==="dragstart"&&Wi(B)):(B=null,s={x:0,y:0}),h=a(s),w||(w=h),E=function(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}(B),r=z({prefix:_,data:T,payload:{},globalStart:s,displacement:Nn(w,h),localStart:h,isTouch:E},C),C.manual||(E?(ce.bind(document,"touchstart",y,!0),ce.bind(document,"touchcancel",g,!0),ce.bind(document,"touchmove",l,!0),ce.bind(document,"touchend",u,!0)):(ce.bind(document,"mousemove",l),ce.bind(document,"dragstart",Wi),ce.bind(document,"selectstart",Wi),ce.bind(document,"mousedown",m,!0),ce.bind(document,"mouseup",m,!0)),ce.bind(document,"keyup",p),e.on("element.hover",f),e.on("element.out",v)),c("init"),C.autoActivate&&l(S,!0)},this.move=l,this.hover=f,this.out=v,this.end=u,this.cancel=g,this.context=function(){return r},this.setOptions=function(S){z(o,S)}}Qm.$inject=["eventBus","canvas","selection","elementRegistry"];const Xn={__depends__:[CE,Rn],dragging:["type",Qm]};function Vr(e,t,n){this._canvas=n,this._opts=z({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),t.on(["drag.cleanup"],function(){i.stopScroll()})}function TE(e,t,n){return t<e&&e<n}Vr.$inject=["config.autoScroll","eventBus","canvas"],Vr.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,i=this,r=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,r.width-e.x,r.height-e.y];this.stopScroll();for(var a=0,c=0,l=0;l<4;l++)TE(o[l],n.scrollThresholdOut[l],n.scrollThresholdIn[l])&&(l===0?a=n.scrollStep:l==1?c=n.scrollStep:l==2?a=-n.scrollStep:l==3&&(c=-n.scrollStep));a===0&&c===0||(t.scroll({dx:a,dy:c}),this._scrolling=setTimeout(function(){i.startScroll(e)},n.scrollRepeatTimeout))},Vr.prototype.stopScroll=function(){clearTimeout(this._scrolling)},Vr.prototype.setOptions=function(e){this._opts=z({},this._opts,e)},Vr.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=yi(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};const AE={__depends__:[Xn],__init__:["autoScroll"],autoScroll:["type",Vr]};function mu(e){this._commandStack=e.get("commandStack",!1)}mu.$inject=["injector"],mu.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),n===void 0||n};const Dn={__init__:["rules"],rules:["type",mu]};var gs=Math.round,kE=Math.max,ef=10;function fu(e,t){return function(n,i){var r,o;for(r=0;o=n[r];r++)if(_o(o,i)<=ef)return{point:n[r],bendpoint:!0,index:r};return null}(e,t)||function(n,i){var r,o,a=Nd(function(u,p){return[["M",u.x,u.y],["m",0,-p],["a",p,p,0,1,1,0,2*p],["a",p,p,0,1,1,0,-2*p],["z"]]}(i,ef),(r=[],n.forEach(function(u,p){r.push([p===0?"M":"L",u.x,u.y])}),r)),c=a[0],l=a[a.length-1];return c?c!==l?c.segment2!==l.segment2?{point:n[o=kE(c.segment2,l.segment2)-1],bendpoint:!0,index:o}:{point:{x:gs(c.x+l.x)/2,y:gs(c.y+l.y)/2},index:c.segment2}:{point:{x:gs(c.x),y:gs(c.y)},index:c.segment2}:null}(e,t)}var tf="djs-bendpoint",nf="djs-segment-dragger";function vu(e,t,n){var i=function(r,o){var a,c=yi(o),l=r._container.getBoundingClientRect();a={x:l.left,y:l.top};var u=r.viewbox();return{x:u.x+(c.x-a.x)/u.scale,y:u.y+(c.y-a.y)/u.scale}}(e,n);return fu(t,i)}function yu(e,t){var n=oe("g");be(n).add(tf),le(e,n);var i=oe("circle");K(i,{cx:0,cy:0,r:4}),be(i).add("djs-visual"),le(n,i);var r=oe("circle");return K(r,{cx:0,cy:0,r:10}),be(r).add("djs-hit"),le(n,r),t&&be(n).add(t),n}function PE(e,t,n,i){var r=oe("g");le(e,r);var o=function(l,u,p){var d=u.x-l.x,y=u.y-l.y;return of(p==="h"?d:y)}(t,n,i),a=oe("rect");K(a,{x:-7,y:-1.5,width:14,height:3}),be(a).add("djs-visual"),le(r,a);var c=oe("rect");return K(c,{x:-o/2,y:-7,width:o,height:14}),be(c).add("djs-hit"),le(r,c),qd(r,i==="v"?90:0),r}function rf(e,t,n){var i=oe("g"),r=Ol(t,n),o=$n(t,n);return le(e,i),PE(i,t,n,o),be(i).add(nf),be(i).add(o==="h"?"horizontal":"vertical"),Lt(i,r.x,r.y),i}function of(e){return Math.abs(Math.round(2*e/3))}var af={exports:{}};af.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(n){if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");for(var i,r=String(n),o=r.length,a=-1,c="",l=r.charCodeAt(0);++a<o;)(i=r.charCodeAt(a))!=0?c+=i>=1&&i<=31||i==127||a==0&&i>=48&&i<=57||a==1&&i>=48&&i<=57&&l==45?"\\"+i.toString(16)+" ":a==0&&o==1&&i==45||!(i>=128||i==45||i==95||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122)?"\\"+r.charAt(a):r.charAt(a):c+="\uFFFD";return c};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(P0);const gu=oo(af.exports);var ME={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function sf(e){return(e=""+e)&&e.replace(/[&<>"']/g,function(t){return ME[t]})}function cf(e,t,n,i,r){function o(v,g){var b,S=g.waypoints,w=vu(t,S,v);if(w)return b=function(_,C){var B,s,h=_.waypoints;return C.index<=0||C.bendpoint?null:(s=$n((B={start:h[C.index-1],end:h[C.index]}).start,B.end))?of(s==="h"?B.end.x-B.start.x:B.end.y-B.start.y)/2:null}(g,w),function(_,C,B){var s,h,m,E,T,M,N=_.index,$=_.point;return!(N<=0||_.bendpoint)&&(m=Ol(s=C[N-1],h=C[N]),E=$n(s,h),T=Math.abs($.x-m.x),M=Math.abs($.y-m.y),E&&T<=B&&M<=B)}(w,S,b)?r.start(v,g,w.index):i.start(v,g,w.index,!w.bendpoint),!0}function a(v,g,b){ce.bind(v,g,function(S){n.triggerMouseEvent(g,S,b),S.stopPropagation()})}function c(v,g){var b=t.getLayer("overlays"),S=Xe('.djs-bendpoints[data-element-id="'+gu(v.id)+'"]',b);return!S&&g&&(K(S=oe("g"),{"data-element-id":v.id}),be(S).add("djs-bendpoints"),le(b,S),a(S,"mousedown",v),a(S,"click",v),a(S,"dblclick",v)),S}function l(v,g){return Xe('.djs-segment-dragger[data-segment-idx="'+v+'"]',g)}function u(v,g){g.waypoints.forEach(function(b,S){var w=yu(v);le(v,w),Lt(w,b.x,b.y)}),yu(v,"floating")}function p(v,g){for(var b,S,w,_=g.waypoints,C=1;C<_.length;C++)$n(b=_[C-1],S=_[C])&&(K(w=rf(v,b,S),{"data-segment-idx":C}),a(w,"mousemove",g))}function d(v){var g=c(v);return g||(u(g=c(v,!0),v),p(g,v)),g}function y(v){var g=c(v);g&&(function(b){L(El("."+nf,b),function(S){tt(S)})}(g),function(b){L(El("."+tf,b),function(S){tt(S)})}(g),p(g,v),u(g,v))}function f(v,g,b){var S,w,_=l(g.index,v),C=b[g.index-1],B=b[g.index],s=g.point,h=Ol(C,B),m=$n(C,B);_&&(S=function(E){return Xe(".djs-visual",E)}(_),w={x:s.x-h.x,y:s.y-h.y},m==="v"&&(w={x:w.y,y:w.x}),Lt(S,w.x,w.y))}e.on("connection.changed",function(v){y(v.element)}),e.on("connection.remove",function(v){var g=c(v.element);g&&tt(g)}),e.on("element.marker.update",function(v){var g,b=v.element;b.waypoints&&(g=d(b),v.add?be(g).add(v.marker):be(g).remove(v.marker))}),e.on("element.mousemove",function(v){var g,b,S=v.element,w=S.waypoints;if(w){if(g=c(S,!0),!(b=vu(t,w,v.originalEvent)))return;(function(_,C){var B=Xe(".floating",_),s=C.point;B&&Lt(B,s.x,s.y)})(g,b),b.bendpoint||f(g,b,w)}}),e.on("element.mousedown",function(v){if(gi(v)){var g=v.originalEvent,b=v.element;if(b.waypoints)return o(g,b)}}),e.on("selection.changed",function(v){var g=v.newSelection[0];g&&g.waypoints&&d(g)}),e.on("element.hover",function(v){var g=v.element;g.waypoints&&(d(g),n.registerEvent(v.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(v){n.unregisterEvent(v.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(v){var g=v.element,b=v.newId;if(g.waypoints){var S=c(g);S&&K(S,{"data-element-id":b})}}),this.addHandles=d,this.updateHandles=y,this.getBendpointsContainer=c,this.getSegmentDragger=l}cf.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var lf=Math.round,Xi="reconnectStart",Ki="reconnectEnd",jo="updateWaypoints";function bu(e,t,n,i,r,o){this._injector=e,this.start=function(a,c,l,u){var p,d=n.getGraphics(c),y=c.source,f=c.target,v=c.waypoints,g=(p=u||l!==0?u||l!==v.length-1?jo:Ki:Xi)===jo?"connection.updateWaypoints":"connection.reconnect",b=r.allowed(g,{connection:c,source:y,target:f});b===!1&&(b=r.allowed(g,{connection:c,source:f,target:y})),b!==!1&&i.init(a,"bendpoint.move",{data:{connection:c,connectionGfx:d,context:{allowed:b,bendpointIndex:l,connection:c,source:y,target:f,insert:u,type:p}}})},t.on("bendpoint.move.hover",function(a){var c,l=a.context,u=l.connection,p=u.source,d=u.target,y=a.hover,f=l.type;if(l.hover=y,y){var v=f===jo?"connection.updateWaypoints":"connection.reconnect";if(c=l.allowed=r.allowed(v,{connection:u,source:f===Xi?y:p,target:f===Ki?y:d}))return l.source=f===Xi?y:p,void(l.target=f===Ki?y:d);c===!1&&(c=l.allowed=r.allowed(v,{connection:u,source:f===Ki?y:d,target:f===Xi?y:p})),c&&(l.source=f===Ki?y:d,l.target=f===Xi?y:p)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(a){var c=a.context,l=c.type;c.hover=null,c.source=null,c.target=null,l!==jo&&(c.allowed=!1)}),t.on("bendpoint.move.end",function(a){var c=a.context,l=c.allowed,u=c.bendpointIndex,p=c.connection,d=c.insert,y=p.waypoints.slice(),f=c.source,v=c.target,g=c.type,b=c.hints||{},S={x:lf(a.x),y:lf(a.y)};if(!l)return!1;g===jo?(d?y.splice(u,0,S):y[u]=S,b.bendpointMove={insert:d,bendpointIndex:u},y=this.cropWaypoints(p,y),o.updateWaypoints(p,function(w){w=w.slice();for(var _,C,B,s=0;w[s];)_=w[s],C=w[s-1],_o(_,B=w[s+1])===0||Bl(C,B,_)?w.splice(s,1):s++;return w}(y),b)):(g===Xi?(b.docking="source",bs(c)&&(b.docking="target",b.newWaypoints=y.reverse())):g===Ki&&(b.docking="target",bs(c)&&(b.docking="source",b.newWaypoints=y.reverse())),o.reconnect(p,f,v,S,b))},this)}function bs(e){var t=e.hover,n=e.source,i=e.target,r=e.type;return r===Xi?t&&i&&t===i&&n!==i:r===Ki?t&&n&&t===n&&n!==i:void 0}bu.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],bu.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var i=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=i,t};var uf="updateWaypoints",Vo="connect-ok",xs="connect-not-ok",pf="connect-hover",hf="djs-updating",df="djs-element-hidden";function mf(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var a=o.context,c=a.bendpointIndex,l=a.connection,u=a.insert,p=l.waypoints,d=p.slice();a.waypoints=p,u&&d.splice(c,0,{x:o.x,y:o.y}),l.waypoints=d,be(a.draggerGfx=yu(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(l,df),i.addMarker(l,hf)}),n.on("bendpoint.move.hover",function(o){var a=o.context,c=a.allowed,l=a.hover,u=a.type;if(l){if(i.addMarker(l,pf),u===uf)return;c?(i.removeMarker(l,xs),i.addMarker(l,Vo)):c===!1&&(i.removeMarker(l,Vo),i.addMarker(l,xs))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],1100,function(o){var a=o.context,c=a.hover,l=a.target;c&&(i.removeMarker(c,pf),i.removeMarker(c,l?Vo:xs))}),n.on("bendpoint.move.move",function(o){var a=o.context,c=a.allowed,l=a.bendpointIndex,u=a.draggerGfx,p=a.hover,d=a.type,y=a.connection,f=y.source,v=y.target,g=y.waypoints.slice(),b={x:o.x,y:o.y},S=a.hints||{},w={};r&&(S.connectionStart&&(w.connectionStart=S.connectionStart),S.connectionEnd&&(w.connectionEnd=S.connectionEnd),d==="reconnectStart"?bs(a)?(w.connectionEnd=w.connectionEnd||b,w.source=v,w.target=p||f,g=g.reverse()):(w.connectionStart=w.connectionStart||b,w.source=p||f,w.target=v):d==="reconnectEnd"?bs(a)?(w.connectionStart=w.connectionStart||b,w.source=p||v,w.target=f,g=g.reverse()):(w.connectionEnd=w.connectionEnd||b,w.source=f,w.target=p||v):(w.noCropping=!0,w.noLayout=!0,g[l]=b),d===uf&&(g=e.cropWaypoints(y,g)),w.waypoints=g,r.drawPreview(a,c,w)),Lt(u,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,function(o){var a=o.context,c=a.connection,l=a.draggerGfx,u=a.hover,p=a.target,d=a.waypoints;c.waypoints=d,tt(l),i.removeMarker(c,hf),i.removeMarker(c,df),u&&(i.removeMarker(u,Vo),i.removeMarker(u,p?Vo:xs)),r&&r.cleanUp(a)})}mf.$inject=["bendpointMove","injector","eventBus","canvas"];var ff="connect-hover",vf="djs-updating";function yf(e,t,n){return xu(e,t,e[t]+n)}function xu(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function gf(e){return e==="x"?"y":"x"}function bf(e,t,n){var i,r;return e.original?e.original:(i=fe(t),xu(e,r=gf(n),i[r]))}function xf(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);function c(p,d){if(!a)return d;var y,f=p.waypoints;return p.waypoints=d,y=a.getCroppedWaypoints(p),p.waypoints=f,y}function l(p){r.update("connection",p.connection,p.connectionGfx)}function u(p,d,y){var f=p.newWaypoints,v=function(g,b,S,w){var _=Math.max(b[w],S[w]),C=Math.min(b[w],S[w]);return xu(b,w,Math.min(Math.max(C+20,g[w]),_-20))}(y,f[p.segmentStartIndex+d],f[p.segmentEndIndex+d],gf(p.axis));Lt(p.draggerGfx,v.x,v.y)}this.start=function(p,d,y){var f,v,g,b,S=n.getGraphics(d),w=y-1,_=y,C=d.waypoints,B=C[w],s=C[_],h=vu(n,C,p);(v=$n(B,s))&&(g=v==="v"?"x":"y",w===0&&(B=bf(B,d.source,g)),_===C.length-1&&(s=bf(s,d.target,g)),f={connection:d,segmentStartIndex:w,segmentEndIndex:_,segmentStart:B,segmentEnd:s,axis:g,dragPosition:b=h?h.point:{x:(B.x+s.x)/2,y:(B.y+s.y)/2}},i.init(p,b,"connectionSegment.move",{cursor:g==="x"?"resize-ew":"resize-ns",data:{connection:d,connectionGfx:S,context:f}}))},t.on("connectionSegment.move.start",function(p){var d=p.context,y=p.connection,f=n.getLayer("overlays");d.originalWaypoints=y.waypoints.slice(),d.draggerGfx=rf(f,d.segmentStart,d.segmentEnd),be(d.draggerGfx).add("djs-dragging"),n.addMarker(y,vf)}),t.on("connectionSegment.move.move",function(p){var d,y,f=p.context,v=f.connection,g=f.segmentStartIndex,b=f.segmentEndIndex,S=f.segmentStart,w=f.segmentEnd,_=f.axis,C=f.originalWaypoints.slice(),B=yf(S,_,p["d"+_]),s=yf(w,_,p["d"+_]),h=C.length,m=0;C[g]=B,C[b]=s,g<2&&(d=yt(v.source,B),g===1?d==="intersect"&&(C.shift(),C[0]=B,m--):d!=="intersect"&&(C.unshift(S),m++)),b>h-3&&(y=yt(v.target,s),b===h-2?y==="intersect"&&(C.pop(),C[C.length-1]=s):y!=="intersect"&&C.push(w)),f.newWaypoints=v.waypoints=c(v,C),u(f,m,p),f.newSegmentStartIndex=g+m,l(p)}),t.on("connectionSegment.move.hover",function(p){p.context.hover=p.hover,n.addMarker(p.hover,ff)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var d=p.context.hover;d&&n.removeMarker(d,ff)}),t.on("connectionSegment.move.cleanup",function(p){var d=p.context,y=d.connection;d.draggerGfx&&tt(d.draggerGfx),n.removeMarker(y,vf)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var d=p.context;d.connection.waypoints=d.originalWaypoints,l(p)}),t.on("connectionSegment.move.end",function(p){var d=p.context,y=d.connection,f=d.newWaypoints,v=d.newSegmentStartIndex,g=function(_,C){var B=0;return{waypoints:_.filter(function(s,h){return!Bl(_[h-1],_[h+1],s)||(B=h<=C?B-1:B,!1)}),segmentOffset:B}}(f=f.map(function(_){return{original:_.original,x:Math.round(_.x),y:Math.round(_.y)}}),v),b=c(y,g.waypoints),S=g.segmentOffset,w={segmentMove:{segmentStartIndex:d.segmentStartIndex,newSegmentStartIndex:v+S}};o.updateWaypoints(y,b,w)})}xf.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var RE=Math.abs,Ef=Math.round;function _f(e){return{x:e.x,y:e.y}}function wf(e){return{x:e.x+e.width,y:e.y+e.height}}function Qt(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:Ef(e.x+e.width/2),y:Ef(e.y+e.height/2)}}function Fr(e,t){var n=e.snapped;return!!n&&(typeof t=="string"?n[t]:n.x&&n.y)}function st(e,t,n){if(typeof t!="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=e[t],o=e.snapped=e.snapped||{};return n===!1?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function Sf(e){return e.children||[]}var NE=Math.abs,Cf=Math.round;function Tf(e){function t(i,r){if(ge(i)){for(var o=i.length;o--;)if(NE(i[o]-r)<=10)return i[o]}else{var a=r%(i=+i);if(a<10)return r-a;if(a>i-10)return r-a+i}return r}function n(i){if(i.width)return{x:Cf(i.width/2+i.x),y:Cf(i.height/2+i.y)}}e.on("connectionSegment.move.move",1500,function(i){var r,o,a=function(d){var y=d.snapPoints,f=d.connection,v=f.waypoints,g=d.segmentStart,b=d.segmentStartIndex,S=d.segmentEnd,w=d.segmentEndIndex,_=d.axis;if(y)return y;var C=[v[b-1],g,S,v[w+1]];return b<2&&C.unshift(n(f.source)),w>v.length-3&&C.unshift(n(f.target)),d.snapPoints=y={horizontal:[],vertical:[]},L(C,function(B){B&&(B=B.original||B,_==="y"&&y.horizontal.push(B.y),_==="x"&&y.vertical.push(B.x))}),y}(i.context),c=i.x,l=i.y;if(a){var u=c-(r=t(a.vertical,c)),p=l-(o=t(a.horizontal,l));z(i,{dx:i.dx-u,dy:i.dy-p,x:r,y:o}),(u||a.vertical.indexOf(c)!==-1)&&st(i,"x",r),(p||a.horizontal.indexOf(l)!==-1)&&st(i,"y",o)}}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(i){var r,o,a=i.context,c=function(v){var g=v.snapPoints,b=v.connection.waypoints,S=v.bendpointIndex;if(g)return g;var w=[b[S-1],b[S+1]];return v.snapPoints=g={horizontal:[],vertical:[]},L(w,function(_){_&&(_=_.original||_,g.horizontal.push(_.y),g.vertical.push(_.x))}),g}(a),l=a.hover,u=l&&n(l),p=i.x,d=i.y;if(c){var y=p-(r=t(u?c.vertical.concat([u.x]):c.vertical,p)),f=d-(o=t(u?c.horizontal.concat([u.y]):c.horizontal,d));z(i,{dx:i.dx-y,dy:i.dy-f,x:i.x-y,y:i.y-f}),(y||c.vertical.indexOf(p)!==-1)&&st(i,"x",r),(f||c.horizontal.indexOf(d)!==-1)&&st(i,"y",o)}})}Tf.$inject=["eventBus"];const IE={__depends__:[Xn,Dn],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",cf],bendpointMove:["type",bu],bendpointMovePreview:["type",mf],connectionSegmentMove:["type",xf],bendpointSnapping:["type",Tf]};function Af(e,t,n,i){function r(o,a){return i.allowed("connection.create",{source:o,target:a})}e.on("connect.hover",function(o){var a,c=o.context,l=c.start,u=o.hover;if(c.hover=u,!yo(a=c.canExecute=r(l,u))){if(a!==!1)return c.source=l,void(c.target=u);yo(a=c.canExecute=r(u,l))||a!==!1&&(c.source=u,c.target=l)}}),e.on(["connect.out","connect.cleanup"],function(o){var a=o.context;a.hover=null,a.source=null,a.target=null,a.canExecute=!1}),e.on("connect.end",function(o){var a=o.context,c=a.canExecute,l=a.connectionStart,u={x:o.x,y:o.y},p=a.source,d=a.target;if(!c)return!1;var y=null,f={connectionStart:Eu(a)?u:l,connectionEnd:Eu(a)?l:u};et(c)&&(y=c),n.connect(p,d,y,f)}),this.start=function(o,a,c,l){et(c)||(l=c,c=fe(a)),t.init(o,"connect",{autoActivate:l,data:{shape:a,context:{start:a,connectionStart:c}}})}}function Eu(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}Af.$inject=["eventBus","dragging","modeling","rules"];var kf="connect-ok",Pf="connect-not-ok";function Mf(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(r){var o=r.context,a=o.canExecute,c=o.hover,l=o.source,u=o.start,p=o.startPosition,d=o.target,y=o.connectionStart||p,f=o.connectionEnd||{x:r.x,y:r.y},v=y,g=f;Eu(o)&&(v=f,g=y),i.drawPreview(o,a,{source:l||u,target:d||c,connectionStart:v,connectionEnd:g})}),t.on("connect.hover",900,function(r){var o=r.context,a=r.hover,c=o.canExecute;c!==null&&n.addMarker(a,c?kf:Pf)}),t.on(["connect.out","connect.cleanup"],1100,function(r){var o=r.hover;o&&(n.removeMarker(o,kf),n.removeMarker(o,Pf))}),i&&t.on("connect.cleanup",function(r){i.cleanUp(r.context)})}Mf.$inject=["injector","eventBus","canvas"];const _u={__depends__:[Rn,Dn,Xn],__init__:["connectPreview"],connect:["type",Af],connectPreview:["type",Mf]};function Kn(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Kn.$inject=["injector","canvas","graphicsFactory","elementFactory"],Kn.prototype.drawPreview=function(e,t,n){n=n||{};var i,r=e.connectionPreviewGfx,o=e.getConnection,a=n.source,c=n.target,l=n.waypoints,u=n.connectionStart,p=n.connectionEnd,d=n.noLayout,y=n.noCropping,f=n.noNoop,v=this;r||(r=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),Cl(r),o||(o=e.getConnection=function(g){var b={};return function(S){var w=JSON.stringify(S),_=b[w];return _||(_=b[w]=g.apply(null,arguments)),_}}(function(g,b,S){return v.getConnection(g,b,S)})),t&&(i=o(t,a,c)),i?(i.waypoints=l||[],this._layouter&&!d&&(i.waypoints=this._layouter.layoutConnection(i,{source:a,target:c,connectionStart:u,connectionEnd:p,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[a?fe(a):u,c?fe(c):p]),this._connectionDocking&&(a||c)&&!y&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,a,c)),this._graphicsFactory.drawConnection(r,i)):!f&&this.drawNoopPreview(r,n)},Kn.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||fe(n),o=t.connectionEnd||fe(i),a=this.cropWaypoints(r,o,n,i);le(e,this.createNoopConnection(a[0],a[1]))},Kn.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),c=r.getConnectionPath({waypoints:[e,t]});return[e=n&&Fl(o,c,!0)||e,t=i&&Fl(a,c,!1)||t]},Kn.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&tt(e.connectionPreviewGfx)},Kn.prototype.getConnection=function(e){var t=function(n){return et(n)?n:{}}(e);return this._elementFactory.createConnection(t)},Kn.prototype.createConnectionPreviewGfx=function(){var e=oe("g");return K(e,{pointerEvents:"none"}),be(e).add("djs-connection-preview"),le(this._canvas.getActiveLayer(),e),e},Kn.prototype.createNoopConnection=function(e,t){var n=oe("polyline");return K(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),K(n,{points:[e.x,e.y,t.x,t.y]}),n};const DE={__init__:["connectionPreview"],connectionPreview:["type",Kn]};var Rf=Math.min,Nf=Math.max;function wu(e){e.preventDefault()}function Fo(e){e.stopPropagation()}function dn(e){this.container=e.container,this.parent=je('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=Xe("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=St(this.autoResize,this),this.handlePaste=St(this.handlePaste,this)}function en(e,t){this._eventBus=e,this._providers=[],this._textbox=new dn({container:t.getContainer(),keyHandler:St(this._handleKey,this),resizeHandler:St(this._handleResize,this)})}dn.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var c=Yt(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);z(r.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var l=Yt(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return z(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&z(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),o.innerText=n,ce.bind(o,"keydown",this.keyHandler),ce.bind(o,"mousedown",Fo),ce.bind(o,"paste",this.handlePaste),i.autoResize&&ce.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},dn.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},dn.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,`
  16. `),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},dn.prototype._insertTextIE=function(e){var t,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,c=r.startOffset,l=r.endOffset,u=r.commonAncestorContainer,p=(t=u.childNodes,[].slice.call(t));if(function(g){return g.nodeType===Node.TEXT_NODE}(u)){var d=o.textContent;o.textContent=d.substring(0,c)+e+d.substring(l),n=o,i=c+e.length}else if(o===this.content&&a===this.content){var y=document.createTextNode(e);this.content.insertBefore(y,p[c]),n=y,i=y.textContent.length}else{var f=p.indexOf(o),v=p.indexOf(a);p.forEach(function(g,b){b===f?g.textContent=o.textContent.substring(0,c)+e+a.textContent.substring(l):b>f&&b<=v&&An(g)}),n=o,i=c+e.length}n&&i!==void 0&&setTimeout(function(){self.setSelection(n,i)})},dn.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var i=e.getBoundingClientRect(),r=t.scrollHeight;e.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},dn.prototype.resizable=function(){var e=this,t=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){var c,l,u,p;n=this.resizeHandle=je('<div class="djs-direct-editing-resize-handle"></div>');var d=function(f){wu(f),Fo(f);var v=Rf(Nf(u+f.clientX-c,i),o),g=Rf(Nf(p+f.clientY-l,r),a);t.style.width=v+"px",t.style.height=g+"px",e.resizeHandler({width:u,height:p,dx:f.clientX-c,dy:f.clientY-l})},y=function(f){wu(f),Fo(f),ce.unbind(document,"mousemove",d,!1),ce.unbind(document,"mouseup",y,!1)};ce.bind(n,"mousedown",function(f){wu(f),Fo(f),c=f.clientX,l=f.clientY;var v=t.getBoundingClientRect();u=v.width,p=v.height,ce.bind(document,"mousemove",d),ce.bind(document,"mouseup",y)})}z(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},dn.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),ce.unbind(t,"keydown",this.keyHandler),ce.unbind(t,"mousedown",Fo),ce.unbind(t,"input",this.autoResize),ce.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),An(n)),An(e)},dn.prototype.getValue=function(){return this.content.innerText.trim()},dn.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},dn.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},en.$inject=["eventBus","canvas"],en.prototype.registerProvider=function(e){this._providers.push(e)},en.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},en.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},en.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},en.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},en.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===e.context.text&&i.height===n.height&&i.width===n.width||(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},en.prototype.getValue=function(){return this._textbox.getValue()},en.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return t===27?(e.preventDefault(),this.cancel()):t!==13||e.shiftKey?void 0:(e.preventDefault(),this.complete())},en.prototype._handleResize=function(e){this._fire("resize",e)},en.prototype.activate=function(e){var t;this.isActive()&&this.cancel();var n=Pe(this._providers,function(i){return(t=i.activate(e))?i:null});return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};const If={__depends__:[Io],__init__:["directEditing"],directEditing:["type",en]};var Df=".entry";function tn(e,t,n){this._eventBus=t,this._overlays=n;var i=Wt(e&&e.scale)?e.scale:{min:1,max:1.5};this._overlaysConfig={position:{right:-9,top:-6},scale:i},this._current=null,this._init()}tn.$inject=["config.contextPad","eventBus","overlays"],tn.prototype._init=function(){var e=this._eventBus,t=this;e.on("selection.changed",function(n){var i=n.newSelection;i.length===1?t.open(i[0]):t.close()}),e.on("elements.delete",function(n){L(n.elements,function(i){t.isOpen(i)&&t.close()})}),e.on("element.changed",function(n){var i=n.element,r=t._current;r&&r.element===i&&t.open(i,!0)})},tn.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},tn.prototype.getEntries=function(e){var t=this._getProviders(),n={};return L(t,function(i){var r=i.getContextPadEntries(e);ft(r)?n=r(n):L(r,function(o,a){n[a]=o})}),n},tn.prototype.trigger=function(e,t,n){var i,r,o=this._current.element,a=this._current.entries,c=t.delegateTarget||t.target;if(!c)return t.preventDefault();if(i=a[$t(c,"data-action")].action,r=t.originalEvent||t,ft(i)){if(e==="click")return i(r,o,n)}else if(i[e])return i[e](r,o,n);t.preventDefault()},tn.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},tn.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},tn.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this.getPad(e),i=n.html;L(t,function(r,o){var a,c=r.group||"default",l=je(r.html||'<div class="entry" draggable="true"></div>');$t(l,"data-action",o),(a=Xe("[data-group="+c+"]",i))||(a=je('<div class="group" data-group="'+c+'"></div>'),i.appendChild(a)),a.appendChild(l),r.className&&function(u,p){var d=ot(u);(ge(p)?p:p.split(/\s+/g)).forEach(function(y){d.add(y)})}(l,r.className),r.title&&$t(l,"title",r.title),r.imageUrl&&l.appendChild(je('<img src="'+r.imageUrl+'">'))}),ot(i).add("open"),this._current={element:e,pad:n,entries:t},this._eventBus.fire("contextPad.open",{current:this._current})},tn.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=je('<div class="djs-context-pad"></div>'),r=z({html:i},this._overlaysConfig);Gt.bind(i,Df,"click",function(a){t.trigger("click",a)}),Gt.bind(i,Df,"dragstart",function(a){t.trigger("dragstart",a)}),ce.bind(i,"mousedown",function(a){a.stopPropagation()}),this._overlayId=n.add(e,"context-pad",r);var o=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{element:e,pad:o}),o},tn.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},tn.prototype.isOpen=function(e){return!(!this._current||e&&this._current.element!==e)};const BE={__depends__:[Io,nu],contextPad:["type",tn]};var OE=["marker-start","marker-mid","marker-end"],LE=["circle","ellipse","line","path","polygon","polyline","rect"];function Yi(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;t.on("drag.cleanup",function(){L(r._clonedMarkers,function(o){tt(o)}),r._clonedMarkers={}})}Yi.$inject=["elementRegistry","eventBus","canvas","styles"],Yi.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},Yi.prototype.addDragger=function(e,t,n){var i=ad(n=n||this.getGfx(e)),r=n.getBoundingClientRect();return this._cloneMarkers(Ya(i)),K(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),le(t,i),i},Yi.prototype.addFrame=function(e,t){var n=oe("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return le(t,n),n},Yi.prototype._cloneMarkers=function(e){var t=this;if(e.childNodes)for(var n=0;n<e.childNodes.length;n++)t._cloneMarkers(e.childNodes[n]);(function(i){return LE.indexOf(i.nodeName)!==-1})(e)&&OE.forEach(function(i){if(K(e,i)){var r=function(o,a,c){var l=(u=K(o,a),u.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]),u;return Xe("marker#"+l,c||document)}(e,i,t._canvas.getContainer());t._cloneMarker(e,r,i)}})},Yi.prototype._cloneMarker=function(e,t,n){var i=t.id,r=this._clonedMarkers[i];if(!r){var o=i+"-clone";(r=ad(t)).id=o,be(r).add("djs-dragger").add("djs-dragger-marker"),this._clonedMarkers[i]=r;var a=Xe("defs",this._canvas._svg);a||(a=oe("defs"),le(this._canvas._svg,a)),le(a,r)}K(e,n,"url(#"+this._clonedMarkers[i].id+")")};const zo={__init__:["previewSupport"],previewSupport:["type",Yi]};var jE="drop-ok",Bf="drop-not-ok",Of="attach-ok",Lf="new-parent",jf="create";function Vf(e,t,n,i,r){function o(c,l){[Of,jE,Bf,Lf].forEach(function(u){u===l?e.addMarker(c,u):e.removeMarker(c,u)})}function a(){var c=t.context();c&&c.prefix===jf&&t.cancel()}n.on(["create.move","create.hover"],function(c){var l=c.context,u=l.elements,p=c.hover,d=l.source,y=l.hints||{};if(!p)return l.canExecute=!1,void(l.target=null);Ff(c);var f={x:c.x,y:c.y},v=l.canExecute=p&&function(g,b,S,w,_){if(!b)return!1;var C=Pe(g=de(g,function(E){var T=E.labelTarget;return!(E.parent||function(M){return!!M.labelTarget}(E)&&g.indexOf(T)!==-1)}),function(E){return!$o(E)}),B=!1,s=!1,h=!1;zf(g)&&(B=r.allowed("shape.attach",{position:S,shape:C,target:b})),B||(h=zf(g)?r.allowed("shape.create",{position:S,shape:C,source:w,target:b}):r.allowed("elements.create",{elements:g,position:S,target:b}));var m=_.connectionTarget;return h||B?(C&&w&&(s=r.allowed("connection.create",{source:m===w?C:w,target:m===w?w:C,hints:{targetParent:b,targetAttach:B}})),{attach:B,connect:s}):(h===null||B===null)&&null}(u,p,f,d,y);p&&v!==null&&(l.target=p,v&&v.attach?o(p,Of):o(p,v?Lf:Bf))}),n.on(["create.end","create.out","create.cleanup"],function(c){var l=c.hover;l&&o(l,null)}),n.on("create.end",function(c){var l=c.context,u=l.source,p=l.shape,d=l.elements,y=l.target,f=l.canExecute,v=f&&f.attach,g=f&&f.connect,b=l.hints||{};if(f===!1||!y)return!1;Ff(c);var S={x:c.x,y:c.y};p=g?i.appendShape(u,p,S,y,{attach:v,connection:g===!0?{}:g,connectionTarget:b.connectionTarget}):Pe(d=i.createElements(d,S,y,z({},b,{attach:v})),function(w){return!$o(w)}),z(l,{elements:d,shape:p}),z(c,{elements:d,shape:p})}),n.on("create.init",function(){n.on("elements.changed",a),n.once(["create.cancel","create.end"],2e3,function(){n.off("elements.changed",a)})}),this.start=function(c,l,u){ge(l)||(l=[l]);var p=Pe(l,function(y){return!$o(y)});if(p){u=z({elements:l,hints:{},shape:p},u||{}),L(l,function(y){pe(y.x)||(y.x=0),pe(y.y)||(y.y=0)});var d=vt(l);L(l,function(y){$o(y)&&(y.waypoints=lt(y.waypoints,function(f){return{x:f.x-d.x-d.width/2,y:f.y-d.y-d.height/2}})),z(y,{x:y.x-d.x-d.width/2,y:y.y-d.y-d.height/2})}),t.init(c,jf,{cursor:"grabbing",autoActivate:!0,data:{shape:p,elements:l,context:u}})}}}function Ff(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom&&(e.y=Math.min(e.y,t.bottom)))}function $o(e){return!!e.waypoints}function zf(e){return e&&e.length===1&&!$o(e[0])}Vf.$inject=["canvas","dragging","eventBus","modeling","rules"];function $f(e,t,n,i,r){t.on("create.move",750,function(o){var a=o.hover,c=o.context,l=c.elements,u=c.dragGroup;u||(u=c.dragGroup=function(p){var d=oe("g");K(d,r.cls("djs-drag-group",["no-events"]));var y=oe("g");return p.forEach(function(f){var v;f.hidden||(f.waypoints?(v=n._createContainer("connection",y),n.drawConnection(Ya(v),f)):(v=n._createContainer("shape",y),n.drawShape(Ya(v),f),Lt(v,f.x,f.y)),i.addDragger(f,d,v))}),d}(l)),a?(u.parentNode||le(e.getActiveLayer(),u),Lt(u,o.x,o.y)):tt(u)}),t.on("create.cleanup",function(o){var a=o.context.dragGroup;a&&tt(a)})}$f.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const Es={__depends__:[Xn,zo,Dn,Rn],__init__:["create","createPreview"],create:["type",Vf],createPreview:["type",$f]};var Gf="data-id",Uf=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function nt(e,t,n){var i=Wt(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:i},this._eventBus=t,this._canvas=n,this._providers={},this._current={}}nt.$inject=["config.popupMenu","eventBus","canvas"],nt.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,function(i){i.providers.push(n)})},nt.prototype.isEmpty=function(e,t){if(!e)throw new Error("element parameter is missing");if(!t)throw new Error("providerId parameter is missing");var n=this._getProviders(t);if(!n)return!0;var i=this._getEntries(e,n),r=this._getHeaderEntries(e,n),o=yr(i)>0,a=r&&yr(r)>0;return!o&&!a},nt.prototype.open=function(e,t,n){var i=this._getProviders(t);if(!e)throw new Error("Element is missing");if(!i||!i.length)throw new Error("No registered providers for: "+t);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var r=this._current={className:t,element:e,position:n},o=this._getEntries(e,i),a=this._getHeaderEntries(e,i);r.entries=z({},o,a),r.container=this._createContainer(),yr(a)&&r.container.appendChild(this._createEntries(a,"djs-popup-header")),yr(o)&&r.container.appendChild(this._createEntries(o,"djs-popup-body"));var c=this._canvas.getContainer();this._attachContainer(r.container,c,n.cursor),this._bindAutoClose()},nt.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),An(this._current.container),this._current.container=null)},nt.prototype.isOpen=function(){return!!this._current.container},nt.prototype.trigger=function(e){e.preventDefault();var t=$t(e.delegateTarget||e.target,Gf),n=this._getEntry(t);if(n.action)return n.action.call(null,e,n)},nt.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},nt.prototype._getEntries=function(e,t){var n={};return L(t,function(i){if(i.getPopupMenuEntries){var r=i.getPopupMenuEntries(e);ft(r)?n=r(n):L(r,function(o,a){n[a]=o})}else L(i.getEntries(e),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=Fn(o,["id"])})}),n},nt.prototype._getHeaderEntries=function(e,t){var n={};return L(t,function(i){if(i.getPopupMenuHeaderEntries){var r=i.getPopupMenuHeaderEntries(e);ft(r)?n=r(n):L(r,function(o,a){n[a]=o})}else{if(!i.getHeaderEntries)return;L(i.getHeaderEntries(e),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=Fn(o,["id"])})}}),n},nt.prototype._getEntry=function(e){var t=this._current.entries[e];if(!t)throw new Error("entry not found");return t},nt.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)},nt.prototype._createContainer=function(){var e=je('<div class="djs-popup">'),t=this._current.position,n=this._current.className;return z(e.style,{position:"absolute",left:t.x+"px",top:t.y+"px",visibility:"hidden"}),ot(e).add(n),e},nt.prototype._attachContainer=function(e,t,n){var i=this;Gt.bind(e,".entry","click",function(r){i.trigger(r)}),this._updateScale(e),t.appendChild(e),n&&this._assureIsInbounds(e,n)},nt.prototype._updateScale=function(e){var t,n,i=this._canvas.zoom(),r=this._config.scale,o=i;r!==!0&&(r===!1?(t=1,n=1):(t=r.min,n=r.max),Wt(t)&&i<t&&(o=t),Wt(n)&&i>n&&(o=n)),function(a,c){a.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(l){a.style[l+"transform"]=c})}(e,"scale("+o+")")},nt.prototype._assureIsInbounds=function(e,t){var n,i,r=this._canvas._container.getBoundingClientRect(),o=e.offsetLeft,a=e.offsetTop,c=e.scrollWidth,l=e.scrollHeight,u={},p=t.x-r.left,d=t.y-r.top;o+c>r.width&&(u.x=!0),a+l>r.height&&(u.y=!0),u.x&&u.y?(n=p-c+"px",i=d-l+"px"):u.x?(n=p-c+"px",i=d+"px"):u.y&&d<l?(n=p+"px",i="10px"):u.y&&(n=p+"px",i=d-l+"px"),z(e.style,{left:n,top:i},{visibility:"visible","z-index":1e3})},nt.prototype._createEntries=function(e,t){var n=je("<div>"),i=this;return ot(n).add(t),L(e,function(r,o){var a=i._createEntry(r,o);n.appendChild(a)}),n},nt.prototype._createEntry=function(e,t){var n=je("<div>"),i=ot(n);if(i.add("entry"),e.className&&e.className.split(" ").forEach(function(o){i.add(o)}),$t(n,Gf,t),e.label){var r=je("<span>");r.textContent=e.label,n.appendChild(r)}return e.imageUrl&&n.appendChild(je('<img src="'+e.imageUrl+'" />')),e.active===!0&&i.add("active"),e.disabled===!0&&i.add("disabled"),e.title&&(n.title=e.title),n},nt.prototype._bindAutoClose=function(){this._eventBus.once(Uf,this.close,this)},nt.prototype._unbindAutoClose=function(){this._eventBus.off(Uf,this.close,this)};const VE={__init__:["popupMenu"],popupMenu:["type",nt]};function Go(){}Go.prototype.get=function(){return this._data},Go.prototype.set=function(e){this._data=e},Go.prototype.clear=function(){var e=this._data;return delete this._data,e},Go.prototype.isEmpty=function(){return!this._data};const FE={clipboard:["type",Go]};function Su(e){var t=this;function n(i){t._lastMoveEvent=i}this._lastMoveEvent=null,e.on("canvas.init",function(i){(t._svg=i.svg).addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}Su.$inject=["eventBus"],Su.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,a=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}(0,0)};const Uo={__init__:["mouse"],mouse:["type",Su]};function mn(e,t,n,i,r,o,a,c){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=c,r.on("copyPaste.copyElement",function(l){var u=l.descriptor,p=l.element,d=l.elements;u.priority=1,u.id=p.id,Pe(d,function(y){return y===p.parent})&&(u.parent=p.parent.id),function(y){return!!y.host}(p)&&(u.priority=2,u.host=p.host.id),_s(p)&&(u.priority=3,u.source=p.source.id,u.target=p.target.id,u.waypoints=function(y){return lt(y.waypoints,function(f){return(f=Hf(f)).original&&(f.original=Hf(f.original)),f})}(p)),ws(p)&&(u.priority=4,u.labelTarget=p.labelTarget.id),L(["x","y","width","height"],function(y){pe(p[y])&&(u[y]=p[y])}),u.hidden=p.hidden,u.collapsed=p.collapsed}),r.on("copyPaste.pasteElements",function(l){z(l.hints,{createElementsBehavior:!1})})}function _s(e){return!!e.waypoints}function ws(e){return!!e.labelTarget}function Hf(e){return z({},e)}function qf(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}mn.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],mn.prototype.copy=function(e){var t,n;return ge(e)||(e=e?[e]:[]),n=(t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))===!1?{}:this.createTree(ge(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},mn.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},mn.prototype._paste=function(e,t,n,i){L(e,function(o){pe(o.x)||(o.x=0),pe(o.y)||(o.y=0)});var r=vt(e);return L(e,function(o){_s(o)&&(o.waypoints=lt(o.waypoints,function(a){return{x:a.x-r.x-r.width/2,y:a.y-r.y-r.height/2}})),z(o,{x:o.x-r.x-r.width/2,y:o.y-r.y-r.height/2})}),this._modeling.createElements(e,n,t,z({},i))},mn.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return L(e,function(o,a){L(o=Xt(o,"priority"),function(c){var l,u=z({},Fn(c,["priority"]));return i[c.parent]?u.parent=i[c.parent]:delete u.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:u}),_s(u)?(u.source=i[c.source],u.target=i[c.target],l=i[c.id]=t.createConnection(u),void r.push(l)):ws(u)?(u.labelTarget=i[u.labelTarget],l=i[c.id]=t.createLabel(u),void r.push(l)):(u.host&&(u.host=i[u.host]),l=i[c.id]=t.createShape(u),void r.push(l))})}),r},mn.prototype.createConnection=function(e){return this._elementFactory.createConnection(Fn(e,["id"]))},mn.prototype.createLabel=function(e){return this._elementFactory.createLabel(Fn(e,["id"]))},mn.prototype.createShape=function(e){return this._elementFactory.createShape(Fn(e,["id"]))},mn.prototype.hasRelations=function(e,t){var n,i;return!(_s(e)&&(n=Pe(t,Kt({id:e.source.id})),i=Pe(t,Kt({id:e.target.id})),!n||!i))&&!(ws(e)&&!Pe(t,Kt({id:e.labelTarget.id})))},mn.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[];function o(a,c){var l=Pe(r,function(u){return a===u.element});l?l.depth<c&&(r=function(u,p){var d=p.indexOf(u);return d!==-1&&p.splice(d,1),p}(l,r),r.push({element:l.element,depth:c})):r.push({element:a,depth:c})}return zi(md(e),function(a,c,l){if(!ws(a))return L(a.labels,function(u){o(u,l)}),L([a.attachers,a.incoming,a.outgoing],function(u){u&&u.length&&L(u,function(p){L(p.labels,function(d){o(d,l)}),o(p,l)})}),o(a,l),a.children}),e=lt(r,function(a){return a.element}),r=lt(r,function(a){return a.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:a.descriptor,element:a.element,elements:e}),a}),r=Xt(r,function(a){return a.descriptor.priority}),e=lt(r,function(a){return a.element}),L(r,function(a){var c=a.depth;n.hasRelations(a.element,e)&&function(l,u){return t.allowed("element.copy",{element:l,elements:u})}(a.element,e)?(i[c]||(i[c]=[]),i[c].push(a.descriptor)):qf(a.element,e)}),i};const zE={__depends__:[FE,Es,Uo,Dn],__init__:["copyPaste"],copyPaste:["type",mn]};function Ss(e,t,n){ge(n)||(n=[n]),L(n,function(i){Vn(e[i])||(t[i]=e[i])})}function Wf(e,t,n){var i;t.on("copyPaste.copyElement",750,function(r){var o=r.descriptor,a=r.element,c=o.oldBusinessObject=te(a);if(o.type=a.type,Ss(c,o,"name"),o.di={},Ss(c.di,o.di,["fill","stroke","background-color","border-color","color"]),Ss(c.di,o,"isExpanded"),Xf(o))return o;c.default&&(o.default=c.default.id)}),t.on("moddleCopy.canCopyProperty",function(r){var o,a=r.parent,c=r.property;if(r.propertyName==="processRef"&&A(a,"bpmn:Participant")&&A(c,"bpmn:Process"))return o=e.create("bpmn:Process"),n.copyElement(c,o)}),t.on("copyPaste.pasteElements",function(){i={}}),t.on("copyPaste.pasteElement",function(r){var o,a,c,l=r.cache,u=r.descriptor,p=u.oldBusinessObject;Xf(u)?u.businessObject=te(l[u.labelTarget]):(o=e.create(p.$type),u.businessObject=n.copyElement(p,o),function(d,y){var f=te(d);d.default&&(i[d.default]={element:f,property:"default"}),d.host&&(te(d).attachedToRef=te(y[d.host])),i=Fn(i,Bt(i,function(v,g,b){var S=g.element,w=g.property;return b===d.id&&(S[w]=f,v.push(d.id)),v},[]))}(u,l),Ss(u,o,["isExpanded","name"]),a=u,ge(c="oldBusinessObject")||(c=[c]),L(c,function(d){a[d]&&delete a[d]}))})}function Xf(e){return!!e.labelTarget}Wf.$inject=["bpmnFactory","eventBus","moddleCopy"];var $E=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing"];function Ho(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",function(i){var r=i.propertyNames;if(r&&r.length)return Xt(r,function(o){return o==="extensionElements"})}),e.on("moddleCopy.canCopyProperty",function(i){var r=i.parent,o=et(r)&&r.$descriptor,a=i.propertyName;return(!a||$E.indexOf(a)===-1)&&!(a&&o&&!Pe(o.properties,Kt({name:a})))&&void 0}),e.on("moddleCopy.canSetCopiedProperty",function(i){var r,o,a=i.property;if(o="bpmn:ExtensionElements",(r=a)&&typeof r.$instanceOf=="function"&&r.$instanceOf(o)&&(!a.values||!a.values.length))return!1})}function Cu(e,t){return Bt(e.properties,function(n,i){return t&&i.default?n:n.concat(i.name)},[])}Ho.$inject=["eventBus","bpmnFactory","moddle"],Ho.prototype.copyElement=function(e,t,n){var i=this;n&&!ge(n)&&(n=[n]),n=n||Cu(e.$descriptor);var r=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t});return r===!1||(ge(r)&&(n=r),L(n,function(o){var a;Tn(e,o)&&(a=e.get(o));var c=i.copyProperty(a,t,o);i._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:c,propertyName:o})!==!1&&Wt(c)&&t.set(o,c)})),t},Ho.prototype.copyProperty=function(e,t,n){var i=this,r=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n});if(r!==!1){if(r)return et(r)&&r.$type&&!r.$parent&&(r.$parent=t),r;var o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference)return o.isId?this._copyId(e,t):ge(e)?Bt(e,function(a,c){return(r=i.copyProperty(c,t,n))?(r.$parent=t,a.concat(r)):a},[]):et(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:((r=i._bpmnFactory.create(e.$type)).$parent=t,r=i.copyElement(e,r)):e}},Ho.prototype._copyId=function(e,t){return this._moddle.ids.assigned(e)?void 0:(this._moddle.ids.claim(e,t),e)};const Kf={__depends__:[zE],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",Wf],moddleCopy:["type",Ho]};var Yf=Math.round;function Tu(e){this._modeling=e}Tu.$inject=["modeling"],Tu.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,r=t.width||e.width,o=t.height||e.height,a=t.x||e.x,c=t.y||e.y,l=Yf(a+r/2),u=Yf(c+o/2);return i.replaceShape(e,z({},t,{x:l,y:u,width:r,height:o}),n)};const GE={__init__:["replace"],replace:["type",Tu]};var UE=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function Jf(e,t,n,i,r,o,a){this.replaceElement=function(c,l,u){u=u||{};var p=l.type,d=c.businessObject;if(Cs(d)&&p==="bpmn:SubProcess"&&function(_,C){var B=_&&Tn(_,"collapsed")?_.collapsed:!Me(_);return B!==(C&&(Tn(C,"collapsed")||Tn(C,"isExpanded"))?Tn(C,"collapsed")?C.collapsed:!C.isExpanded:B)&&(_.collapsed=B,!0)}(c,l))return i.toggleCollapse(c),c;var y,f=e.create(p),v={type:p,businessObject:f},g=Cu(d.$descriptor),b=Cu(f.$descriptor,!0),S=(y=b,g.filter(function(_){return y.indexOf(_)!==-1}));z(f,Yt(l,UE));var w=de(S,function(_){return _==="eventDefinitions"?Zf(c,l.eventDefinitionType):_==="loopCharacteristics"?!It(f):!Tn(f,_)&&(_!=="processRef"||l.isExpanded!==!1)&&_!=="triggeredByEvent"});return f=n.copyElement(d,f,w),l.eventDefinitionType&&(Zf(f,l.eventDefinitionType)||(v.eventDefinitionType=l.eventDefinitionType,v.eventDefinitionAttrs=l.eventDefinitionAttrs)),A(d,"bpmn:Activity")&&(Cs(d)?v.isExpanded=Me(d):l&&Tn(l,"isExpanded")&&(v.isExpanded=l.isExpanded),Me(d)&&!A(d,"bpmn:Task")&&v.isExpanded&&(v.width=c.width,v.height=c.height)),Cs(d)&&!Cs(f)&&(u.moveChildren=!1),A(d,"bpmn:Participant")&&(l.isExpanded===!0?f.processRef=e.create("bpmn:Process"):u.moveChildren=!1,v.width=c.width,v.height=t._getDefaultSize(f).height),o.allowed("shape.resize",{shape:f})||(v.height=t._getDefaultSize(f).height,v.width=t._getDefaultSize(f).width),f.name=d.name,we(d,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&we(f,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(f.default=d.default),l.host&&!A(d,"bpmn:BoundaryEvent")&&A(f,"bpmn:BoundaryEvent")&&(v.host=l.host),v.type!=="bpmn:DataStoreReference"&&v.type!=="bpmn:DataObjectReference"||(v.x=c.x+(c.width-v.width)/2),v.di={},function(_,C,B){ge(B)||(B=[B]),L(B,function(s){Vn(_[s])||(C[s]=_[s])})}(d.di,v.di,["fill","stroke","background-color","border-color","color"]),v=r.replaceElement(c,v,u),u.select!==!1&&a.select(v),v}}function Cs(e){return A(e,"bpmn:SubProcess")}function Zf(e,t){var n=te(e);return t&&n.get("eventDefinitions").some(function(i){return A(i,t)})}Jf.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules","selection"];const Qf={__depends__:[Kf,GE,Rn],bpmnReplace:["type",Jf]};function ev(e){return function(t){var n=t.target,i=te(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,c=i.triggeredByEvent===n.triggeredByEvent,l=n.isExpanded===void 0||n.isExpanded===Me(i);return!(o&&a&&c&&l)}}var HE=[{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"}}],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-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"}}],WE=[{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"}}],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-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"}}],KE=[{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"}}],YE=[{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}}],JE=[{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}}],ZE=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}}],tv=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{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:"User Task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{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:"Service Task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{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}}],QE=[{label:"Data Store Reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],e_=[{label:"Data Object Reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],t_=[{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}}],n_=[{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}}],i_=[{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"}],r_=[{label:"Expanded Pool",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty Pool";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];function nn(e,t,n,i,r,o,a){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this.register()}nn.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate"],nn.prototype.register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},nn.prototype.getEntries=function(e){var t,n=e.businessObject;if(!this._rules.allowed("shape.replace",{element:e}))return[];var i=ev(e);return A(n,"bpmn:DataObjectReference")?this._createEntries(e,QE):A(n,"bpmn:DataStoreReference")?this._createEntries(e,e_):A(n,"bpmn:StartEvent")&&!A(n.$parent,"bpmn:SubProcess")?(t=de(HE,i),this._createEntries(e,t)):A(n,"bpmn:Participant")?(t=de(r_,function(r){return Me(n)!==r.target.isExpanded}),this._createEntries(e,t)):A(n,"bpmn:StartEvent")&&It(n.$parent)?(t=de(n_,function(r){var o=r.target.isInterrupting!==!1,a=te(e).isInterrupting===o;return i(r)||!i(r)&&!a}),this._createEntries(e,t)):A(n,"bpmn:StartEvent")&&!It(n.$parent)&&A(n.$parent,"bpmn:SubProcess")?(t=de(qE,i),this._createEntries(e,t)):A(n,"bpmn:EndEvent")?(t=de(XE,function(r){return!(r.target.eventDefinitionType=="bpmn:CancelEventDefinition"&&!A(n.$parent,"bpmn:Transaction"))&&i(r)}),this._createEntries(e,t)):A(n,"bpmn:BoundaryEvent")?(t=de(t_,function(r){var o=r.target;if(o.eventDefinitionType=="bpmn:CancelEventDefinition"&&!A(n.attachedToRef,"bpmn:Transaction"))return!1;var a=o.cancelActivity!==!1,c=n.cancelActivity==a;return i(r)||!i(r)&&!c}),this._createEntries(e,t)):A(n,"bpmn:IntermediateCatchEvent")||A(n,"bpmn:IntermediateThrowEvent")?(t=de(WE,i),this._createEntries(e,t)):A(n,"bpmn:Gateway")?(t=de(KE,i),this._createEntries(e,t)):A(n,"bpmn:Transaction")?(t=de(JE,i),this._createEntries(e,t)):It(n)&&Me(n)?(t=de(ZE,i),this._createEntries(e,t)):A(n,"bpmn:SubProcess")&&Me(n)?(t=de(YE,i),this._createEntries(e,t)):A(n,"bpmn:AdHocSubProcess")&&!Me(n)?(t=de(tv,function(r){var o=r.target,a=o.type==="bpmn:SubProcess",c=o.isExpanded===!0;return ev(e)&&(!a||c)}),this._createEntries(e,t)):A(n,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,i_):A(n,"bpmn:FlowNode")?(t=de(tv,i),A(n,"bpmn:SubProcess")&&!Me(n)&&(t=de(t,function(r){return r.label!=="Sub Process (collapsed)"})),this._createEntries(e,t)):[]},nn.prototype.getHeaderEntries=function(e){var t=[];return A(e,"bpmn:Activity")&&!It(e)&&(t=t.concat(this._getLoopEntries(e))),A(e,"bpmn:DataObjectReference")&&(t=t.concat(this._getDataObjectIsCollection(e))),A(e,"bpmn:Participant")&&(t=t.concat(this._getParticipantMultiplicity(e))),!A(e,"bpmn:SubProcess")||A(e,"bpmn:Transaction")||It(e)||t.push(this._getAdHocEntry(e)),t},nn.prototype._createEntries=function(e,t){var n=[],i=this;return L(t,function(r){var o=i._createMenuEntry(r,e);n.push(o)}),n},nn.prototype._createSequenceFlowEntries=function(e,t){var n=te(e),i=[],r=this._modeling,o=this._moddle,a=this;return L(t,function(c){switch(c.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(A(n.sourceRef,"bpmn:ExclusiveGateway")||A(n.sourceRef,"bpmn:InclusiveGateway")||A(n.sourceRef,"bpmn:ComplexGateway")||A(n.sourceRef,"bpmn:Activity"))&&i.push(a._createMenuEntry(c,e,function(){r.updateProperties(e.source,{default:n})}));break;case"replace-with-conditional-flow":!n.conditionExpression&&A(n.sourceRef,"bpmn:Activity")&&i.push(a._createMenuEntry(c,e,function(){var l=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:l})}));break;default:if(A(n.sourceRef,"bpmn:Activity")&&n.conditionExpression)return i.push(a._createMenuEntry(c,e,function(){r.updateProperties(e,{conditionExpression:void 0})}));if((A(n.sourceRef,"bpmn:ExclusiveGateway")||A(n.sourceRef,"bpmn:InclusiveGateway")||A(n.sourceRef,"bpmn:ComplexGateway")||A(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n)return i.push(a._createMenuEntry(c,e,function(){r.updateProperties(e.source,{default:void 0})}))}}),i},nn.prototype._createMenuEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=e.label;return o&&typeof o=="function"&&(o=o(t)),n=n||function(){return r(t,e.target)},{label:i(o),className:e.className,id:e.actionName,action:n}},nn.prototype._getLoopEntries=function(e){var t=this,n=this._translate;function i(l,u){var p;u.active?p=void 0:(p=t._moddle.create(u.options.loopCharacteristics),u.options.isSequential&&(p.isSequential=u.options.isSequential)),t._modeling.updateProperties(e,{loopCharacteristics:p})}var r,o,a,c=te(e).loopCharacteristics;return c&&(r=c.isSequential,o=c.isSequential===void 0,a=c.isSequential!==void 0&&!c.isSequential),[{id:"toggle-parallel-mi",className:"bpmn-icon-parallel-mi-marker",title:n("Parallel Multi Instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},{id:"toggle-sequential-mi",className:"bpmn-icon-sequential-mi-marker",title:n("Sequential Multi Instance"),active:r,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},{id:"toggle-loop",className:"bpmn-icon-loop-marker",title:n("Loop"),active:o,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}]},nn.prototype._getDataObjectIsCollection=function(e){var t=this,n=this._translate,i=e.businessObject.dataObjectRef,r=i.isCollection;return[{id:"toggle-is-collection",className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:r,action:function(o,a){t._modeling.updateModdleProperties(e,i,{isCollection:!a.active})}}]},nn.prototype._getParticipantMultiplicity=function(e){var t=this,n=this._bpmnFactory,i=this._translate,r=e.businessObject.participantMultiplicity,o=[{id:"toggle-participant-multiplicity",className:"bpmn-icon-parallel-mi-marker",title:i("Participant Multiplicity"),active:!!r,action:function(a,c){var l;c.active||(l=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:l})}}];return o},nn.prototype._getAdHocEntry=function(e){var t=this._translate,n=A(te(e),"bpmn:AdHocSubProcess"),i=this._bpmnReplace.replaceElement;return{id:"toggle-adhoc",className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:n,action:function(r,o){return i(e,n?{type:"bpmn:SubProcess"}:{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}}};const o_={__depends__:[VE,Qf],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",nn]};var Ts=Math.max,As=Math.min,a_=20;function nv(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function ks(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return pe(r)&&(i=(/top|left/.test(e)?As:Ts)(i,r)),pe(o)&&(i=(/top|left/.test(e)?Ts:As)(i,o)),i}function qo(e,t){return e!==void 0?e:a_}function s_(e){return!e.waypoints&&e.type!=="label"}function iv(e,t){var n;if((n=e.length===void 0?de(e.children,s_):e).length)return function(i,r){var o,a,c,l;return typeof r=="object"?(o=qo(r.left),a=qo(r.right),c=qo(r.top),l=qo(r.bottom)):o=a=c=l=qo(r),{x:i.x-o,y:i.y-c,width:i.width+o+a,height:i.height+c+l}}(vt(n),t)}var Ps=Math.abs,c_=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],zr=30;function Ms(e,t){return t=t||[],e.children.filter(function(n){A(n,"bpmn:Lane")&&(Ms(n,t),t.push(n))}),t}ai=function(e){return e.children.filter(function(t){return A(t,"bpmn:Lane")})};function fn(e){return fs(e,c_)||e}function l_(e,t){var n=fn(e),i=Ms(n,A(n,"bpmn:Process")?[]:[n]),r=ae(e),o=ae(t),a=function(l,u){return nv(ae(u),ae(l))}(e,t),c=[];return i.forEach(function(l){if(l!==e){var u,p,d=0,y=a.right,f=0,v=a.left,g=ae(l);a.top&&(Ps(g.bottom-r.top)<10&&(f=o.top-g.bottom),Ps(g.top-r.top)<5&&(d=o.top-g.top)),a.bottom&&(Ps(g.top-r.bottom)<10&&(d=o.bottom-g.top),Ps(g.bottom-r.bottom)<5&&(f=o.bottom-g.bottom)),(d||y||f||v)&&c.push({shape:l,newBounds:(u=l,p={top:d,right:y,bottom:f,left:v},{x:u.x+(p.left||0),y:u.y+(p.top||0),width:u.width-(p.left||0)+(p.right||0),height:u.height-(p.top||0)+(p.bottom||0)})})}}),c}function Au(e,t,n,i,r,o,a,c,l,u,p,d){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=c,this._popupMenu=l,this._canvas=u,this._rules=p,this._translate=d,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(y){var f=y.context.shape;if(Dr(y)&&i.isOpen(f)){var v=i.getEntries(f);v.replace&&v.replace.action.click(y,f)}})}function rv(e,t,n){var i=e.$instanceOf(t),r=!1;return L(e.eventDefinitions||[],function(o){o.$type===n&&(r=!0)}),i&&r}Au.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],Au.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._popupMenu,c=this._canvas,l=this._rules,u=this._autoPlace,p=this._translate,d={};if(e.type==="label")return d;var y=e.businessObject;function f(w,_){r.start(w,_)}function v(w,_,C,B){function s(m,E){var T=i.createShape(z({type:w},B));o.start(m,T,{source:E})}typeof C!="string"&&(B=C,C=p("Append {type}",{type:w.replace(/^bpmn:/,"")}));var h=u?function(m,E){var T=i.createShape(z({type:w},B));u.append(E,T)}:s;return{group:"model",className:_,title:C,action:{dragstart:s,click:h}}}function g(w){return function(_,C){n.splitLane(C,w),t.open(C,!0)}}if(we(y,["bpmn:Lane","bpmn:Participant"])&&Me(y)){var b=ai(e);z(d,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:p("Add Lane above"),action:{click:function(w,_){n.addLane(_,"top")}}}}),b.length<2&&(e.height>=120&&z(d,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:p("Divide into two Lanes"),action:{click:g(2)}}}),e.height>=180&&z(d,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:p("Divide into three Lanes"),action:{click:g(3)}}})),z(d,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:p("Add Lane below"),action:{click:function(w,_){n.addLane(_,"bottom")}}}})}A(y,"bpmn:FlowNode")&&(A(y,"bpmn:EventBasedGateway")?z(d,{"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"})}):rv(y,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?z(d,{"append.compensation-activity":v("bpmn:Task","bpmn-icon-task",p("Append compensation activity"),{isForCompensation:!0})}):A(y,"bpmn:EndEvent")||y.isForCompensation||rv(y,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||It(y)||z(d,{"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(e,"bpmn-replace")||z(d,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:p("Change type"),action:{click:function(w,_){var C=z(function(B){var s=c.getContainer(),h=t.getPad(B).html,m=s.getBoundingClientRect(),E=h.getBoundingClientRect(),T=E.top-m.top;return{x:E.left-m.left,y:T+E.height+5}}(_),{cursor:{x:w.x,y:w.y}});a.open(_,"bpmn-replace",C)}}}}),we(y,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(d,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using "+(y.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:f,dragstart:f}}}),A(y,"bpmn:TextAnnotation")&&z(d,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using Association"),action:{click:f,dragstart:f}}}),we(y,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(d,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using DataInputAssociation"),action:{click:f,dragstart:f}}}),A(y,"bpmn:Group")&&z(d,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var S=l.allowed("elements.delete",{elements:[e]});return ge(S)&&(S=S[0]===e),S&&z(d,{delete:{group:"edit",className:"bpmn-icon-trash",title:p("Remove"),action:{click:function(w){n.removeElements([e])}}}}),d};const u_={__depends__:[If,BE,Rn,_u,Es,o_],__init__:["contextPadProvider"],contextPadProvider:["type",Au]};var p_={horizontal:["x","width"],vertical:["y","height"]};function Yn(e){this._modeling=e,this._filters=[],this.registerFilter(function(t,n,i){var r,o=0,a=0;return L(t,function(c){c.waypoints||c.labelTarget||(o+=c[i],a+=1)}),r=Math.round(o/a),de(t,function(c){return c[i]<r+50})})}Yn.$inject=["modeling"],Yn.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)},Yn.prototype.trigger=function(e,t){var n,i,r=this._modeling;if(!(e.length<3||(this._setOrientation(t),i=this._filterElements(e),(n=this._createGroups(i)).length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},Yn.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(L(t,function(o){r=o(r,n,i)}),r):e},Yn.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');return L(Xt(e,i),function(o,a){var c,l=n._findRange(o,i,r),u=t[t.length-1];u&&n._hasIntersection(u.range,l)?t[t.length-1].elements.push(o):(c={range:l,elements:[o]},t.push(c))}),t},Yn.prototype._setOrientation=function(e){var t=p_[e];this._axis=t[0],this._dimension=t[1]},Yn.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},Yn.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};const h_={__init__:["distributeElements"],distributeElements:["type",Yn]};function ov(e){e.registerFilter(function(t){return de(t,function(n){var i=we(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)})})}ov.$inject=["distributeElements"];const d_={__depends__:[h_],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",ov]};var av="is not a registered action";function rn(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}function ku(e,t){return new Error(e+" "+t)}rn.$inject=["eventBus","injector"],rn.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),c=e.get("rules",!1),l=e.get("keyboardMove",!1),u=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&i&&this.register("copy",function(){var p=i.get();o.copy(p)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(p){r.stepZoom(p.value)}),a&&this.register("zoom",function(p){a.zoom(p.value)}),n&&i&&c&&this.register("removeSelection",function(){var p=i.get();if(p.length){var d,y=c.allowed("elements.delete",{elements:p});y!==!1&&(d=ge(y)?y:p).length&&n.removeElements(d.slice())}}),l&&this.register("moveCanvas",function(p){l.moveCanvas(p)}),u&&this.register("moveSelection",function(p){u.moveSelection(p.direction,p.accelerated)})},rn.prototype.trigger=function(e,t){if(!this._actions[e])throw ku(e,av);return this._actions[e](t)},rn.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);L(e,function(i,r){n._registerAction(r,i)})},rn.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw ku(e,"is already registered");this._actions[e]=t},rn.prototype.unregister=function(e){if(!this.isRegistered(e))throw ku(e,av);this._actions[e]=void 0},rn.prototype.getActions=function(){return Object.keys(this._actions)},rn.prototype.isRegistered=function(e){return!!this._actions[e]};const m_={__init__:["editorActions"],editorActions:["type",rn]};function Rs(e){e.invoke(rn,this)}ie(Rs,rn),Rs.$inject=["injector"],Rs.prototype._registerDefaultActions=function(e){rn.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),c=e.get("globalConnect",!1),l=e.get("distributeElements",!1),u=e.get("alignElements",!1),p=e.get("directEditing",!1),d=e.get("searchPad",!1),y=e.get("modeling",!1);t&&n&&i&&this._registerAction("selectElements",function(){var f=t.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()}),c&&this._registerAction("globalConnectTool",function(){c.toggle()}),i&&l&&this._registerAction("distributeElements",function(f){var v=i.get(),g=f.type;v.length&&l.trigger(v,g)}),i&&u&&this._registerAction("alignElements",function(f){var v=i.get(),g=[],b=f.type;v.length&&(g=de(v,function(S){return!A(S,"bpmn:Lane")}),u.trigger(g,b))}),i&&y&&this._registerAction("setColor",function(f){var v=i.get();v.length&&y.setColor(v,f)}),i&&p&&this._registerAction("directEditing",function(){var f=i.get();f.length&&p.activate(f[0])}),d&&this._registerAction("find",function(){d.toggle()}),t&&y&&this._registerAction("moveToOrigin",function(){var f,v,g=t.getRootElement();f=vt(v=A(g,"bpmn:Collaboration")?n.filter(function(b){return A(b.parent,"bpmn:Collaboration")}):n.filter(function(b){return b!==g&&!A(b.parent,"bpmn:SubProcess")})),y.moveElements(v,{x:-f.x,y:-f.y},g)})};const f_={__depends__:[m_],editorActions:["type",Rs]};function sv(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context;we(t.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}sv.$inject=["eventBus"];function Pu(e,t,n){return n||(n="round"),Math[n](e/t)*t}function xi(e,t,n){var i=!n||n.active!==!1;this._eventBus=t;var r=this;t.on("diagram.init",800,function(){r.setActive(i)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,function(o){var a=o.originalEvent;if(!(!r.active||a&&qt(a))){var c=o.context,l=c.gridSnappingContext;l||(l=c.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},d=function(f,v,g){var b=f.context,S=f.shape,w=b.gridSnappingContext,_=w.snapLocation,C=w.snapOffset;return C&&pe(C[v])||(C||(C=w.snapOffset={}),pe(C[v])||(C[v]=0),!S)||(g.get(S.id)||(Ns(v)?C[v]+=S[v]+S.width/2:C[v]+=S[v]+S.height/2),!_)||(v==="x"?/left/.test(_)?C[v]-=S.width/2:/right/.test(_)&&(C[v]+=S.width/2):/top/.test(_)?C[v]-=S.height/2:/bottom/.test(_)&&(C[v]+=S.height/2)),C[v]}(o,u,e);d&&(p.offset=d);var y=function(f,v){var g=f.context,b=g.createConstraints,S=g.resizeConstraints||{},w=g.gridSnappingContext,_=w.snapConstraints;if(_&&_[v])return _[v];_||(_=w.snapConstraints={}),_[v]||(_[v]={});var C=g.direction;b&&(Ns(v)?(_.x.min=b.left,_.x.max=b.right):(_.y.min=b.top,_.y.max=b.bottom));var B=S.min,s=S.max;return B&&(Ns(v)?lv(C)?_.x.max=B.left:_.x.min=B.right:cv(C)?_.y.max=B.top:_.y.min=B.bottom),s&&(Ns(v)?lv(C)?_.x.min=s.left:_.x.max=s.right:cv(C)?_.y.min=s.top:_.y.max=s.bottom),_[v]}(o,u);y&&z(p,y),Fr(o,u)||r.snapEvent(o,u,p)})}})}function Ns(e){return e==="x"}function cv(e){return e.indexOf("n")!==-1}function lv(e){return e.indexOf("w")!==-1}function Ji(e,t){Q.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=(r.hints||{}).autoResize;if(o){var a=r.shape,c=r.newBounds;Dt(o)?r.newBounds=n.snapComplex(c,o):r.newBounds=n.snapSimple(a,c)}})}xi.prototype.snapEvent=function(e,t,n){st(e,t,this.snapValue(e[t],n))},xi.prototype.getGridSpacing=function(){return 10},xi.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e=Pu(e+=r,10),t&&t.min&&pe(n=t.min)&&(n=Pu(n+r,10,"ceil"),e=Math.max(e,n)),t&&t.max&&pe(i=t.max)&&(i=Pu(i+r,10,"floor"),e=Math.min(e,i)),e-=r},xi.prototype.isActive=function(){return this.active},xi.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},xi.prototype.toggleActive=function(){this.setActive(!this.active)},xi.$inject=["elementRegistry","eventBus","config.gridSnapping"],Ji.$inject=["eventBus","gridSnapping","modeling"],ie(Ji,Q),Ji.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},Ji.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},Ji.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),z(e,o),e},Ji.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),z(e,o),e};function uv(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,function(n){var i,r=n.context;r.initialized&&(r.axis==="x"?(i=t.snapValue(n.dx),n.x=n.x+i-n.dx,n.dx=i):(i=t.snapValue(n.dy),n.y=n.y+i-n.dy,n.dy=i))})}uv.$inject=["eventBus","gridSnapping"];const v_={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Ji],gridSnappingSpaceToolBehavior:["type",uv]}],__init__:["gridSnapping"],gridSnapping:["type",xi]};function pv(e,t){e.on("autoPlace",2e3,function(n){var i=n.source,r=fe(i),o=n.shape,a=Km(i,o);return["x","y"].forEach(function(c){var l={};a[c]!==r[c]&&(a[c]>r[c]?l.min=a[c]:l.max=a[c],A(o,"bpmn:TextAnnotation")&&(function(u){return u==="x"}(c)?l.offset=-o.width/2:l.offset=-o.height/2),a[c]=t.snapValue(a[c],l))}),a})}pv.$inject=["eventBus","gridSnapping"];function hv(e,t,n){t.on(["create.start","shape.move.start"],1750,function(i){var r=i.context,o=r.shape,a=e.getRootElement();A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&a.children.length&&r.createConstraints&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))})}hv.$inject=["canvas","eventBus","gridSnapping"];function Is(e,t,n){Q.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,function(r){var o=r.context,a=o.connection,c=o.hints||{},l=a.waypoints;c.connectionStart||c.connectionEnd||c.createElementsBehavior===!1||function(u){return u.length>3}(l)&&n.updateWaypoints(a,i.snapMiddleSegments(l))})}function y_(e,t,n){var i=$n(t,n),r={};return function(o){return o==="h"}(i)&&(r.y=e.snapValue(t.y)),function(o){return o==="v"}(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=z({},t,r),n=z({},n,r)),[t,n]}Is.$inject=["eventBus","gridSnapping","modeling"],ie(Is,Q),Is.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i<e.length-2;i++)t=y_(n,e[i],e[i+1]),e[i]=t[0],e[i+1]=t[1];return e};const g_={__depends__:[v_,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingCreateParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",pv],gridSnappingCreateParticipantBehavior:["type",hv],gridSnappingLayoutConnectionBehavior:["type",Is]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",sv]};function Wo(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(i){var r=i.element,o=i.gfx;return A(r,"bpmn:Lane")?n.createParticipantHit(r,o):A(r,"bpmn:Participant")?Me(r)?n.createParticipantHit(r,o):n.createDefaultHit(r,o):A(r,"bpmn:SubProcess")?Me(r)?n.createSubProcessHit(r,o):n.createDefaultHit(r,o):void 0})}Wo.$inject=["eventBus","interactionEvents"],Wo.prototype.createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},Wo.prototype.createParticipantHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:30,height:e.height}),!0},Wo.prototype.createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:30}),!0};const b_={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",Wo]};function Ds(e){e.invoke(Or,this)}ie(Ds,Or),Ds.$inject=["injector"],Ds.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}Or.prototype.registerBindings.call(this,e,t),n("selectElements",function(i){var r=i.keyEvent;if(e.isKey(["a","A"],r)&&e.isCmd(r))return t.trigger("selectElements"),!0}),n("find",function(i){var r=i.keyEvent;if(e.isKey(["f","F"],r)&&e.isCmd(r))return t.trigger("find"),!0}),n("spaceTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["s","S"],r)?(t.trigger("spaceTool"),!0):void 0}),n("lassoTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["l","L"],r)?(t.trigger("lassoTool"),!0):void 0}),n("handTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["h","H"],r)?(t.trigger("handTool"),!0):void 0}),n("globalConnectTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["c","C"],r)?(t.trigger("globalConnectTool"),!0):void 0}),n("directEditing",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["e","E"],r)?(t.trigger("directEditing"),!0):void 0})};const x_={__depends__:[ru],__init__:["keyboardBindings"],keyboardBindings:["type",Ds]};var E_={moveSpeed:1,moveSpeedAccelerated:10},dv="left",mv="right",fv="down",__={ArrowLeft:dv,Left:dv,ArrowUp:"up",Up:"up",ArrowRight:mv,Right:mv,ArrowDown:fv,Down:fv},w_={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function vv(e,t,n,i,r){var o=this;this._config=z({},E_,e||{}),t.addListener(1500,function(a){var c=a.keyEvent,l=__[c.key];if(l&&!t.isCmd(c)){var u=t.isShift(c);return o.moveSelection(l,u),!0}}),this.moveSelection=function(a,c){var l=r.get();if(l.length){var u=this._config[c?"moveSpeedAccelerated":"moveSpeed"],p=w_[a](u);i.allowed("elements.move",{shapes:l})&&n.moveElements(l,p)}}}vv.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const S_={__depends__:[ru,Rn],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",vv]};function yv(e,t,n,i){e.on("element.changed",function(r){var o=r.element;(o.parent||o===t.getRootElement())&&(r.gfx=n.getGraphics(o)),r.gfx&&e.fire(yd(o)+".changed",r)}),e.on("elements.changed",function(r){var o=r.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),i.updateContainments(o)}),e.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),e.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}yv.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const gv={__init__:["changeSupport"],changeSupport:["type",yv]};function Xo(e,t,n,i){this._dragging=i,this._rules=t;var r=this;function o(a,c){var l,u=a.shape,p=a.direction,d=a.resizeConstraints;a.delta=c,l=function(y,f,v){var g=v.x,b=v.y,S={x:y.x,y:y.y,width:y.width,height:y.height};return f.indexOf("n")!==-1?(S.y=y.y+b,S.height=y.height-b):f.indexOf("s")!==-1&&(S.height=y.height+b),f.indexOf("e")!==-1?S.width=y.width+g:f.indexOf("w")!==-1&&(S.x=y.x+g,S.width=y.width-g),S}(u,p,c),a.newBounds=function(y,f){if(!f)return y;var v=ae(y);return Vl({top:ks("top",v,f),right:ks("right",v,f),bottom:ks("bottom",v,f),left:ks("left",v,f)})}(l,d),a.canExecute=r.canResize(a)}e.on("resize.start",function(a){var c,l,u;c=a.context,l=c.resizeConstraints,u=c.minBounds,l===void 0&&(u===void 0&&(u=r.computeMinResizeBox(c)),c.resizeConstraints={min:ae(u)})}),e.on("resize.move",function(a){var c={x:a.dx,y:a.dy};o(a.context,c)}),e.on("resize.end",function(a){(function(c){var l=c.shape,u=c.canExecute,p=c.newBounds;if(u){if(!function(d,y){return d.x!==y.x||d.y!==y.y||d.width!==y.width||d.height!==y.height}(l,p=Id(p)))return;n.resizeShape(l,p)}})(a.context)})}function bv(e,t){var n=fe(e),i=ae(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function C_(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}Xo.prototype.canResize=function(e){var t=this._rules,n=Yt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},Xo.prototype.activate=function(e,t,n){var i,r,o=this._dragging;if(typeof n=="string"&&(n={direction:n}),!(r=(i=z({shape:t},n)).direction))throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");o.init(e,bv(t,r),"resize",{autoActivate:!0,cursor:C_(r),data:{shape:t,context:i}})},Xo.prototype.computeMinResizeBox=function(e){var t=e.shape;return function(n,i,r,o){var a=ae(i),c={top:/n/.test(n)?a.bottom-r.height:a.top,left:/w/.test(n)?a.right-r.width:a.left,bottom:/s/.test(n)?a.top+r.height:a.bottom,right:/e/.test(n)?a.left+r.width:a.right},l=o?ae(o):c;return Vl({top:As(c.top,l.top),left:As(c.left,l.left),bottom:Ts(c.bottom,l.bottom),right:Ts(c.right,l.right)})}(e.direction,t,e.minDimensions||{width:10,height:10},iv(t,e.childrenBoxPadding))},Xo.$inject=["eventBus","rules","modeling","dragging"];var xv="djs-resizing",Ev="resize-not-ok";function _v(e,t,n){e.on("resize.move",500,function(i){var r,o,a,c;r=i.context,o=r.shape,a=r.newBounds,(c=r.frame)||(c=r.frame=n.addFrame(o,t.getActiveLayer()),t.addMarker(o,xv)),a.width>5&&K(c,{x:a.x,width:a.width}),a.height>5&&K(c,{y:a.y,height:a.height}),r.canExecute?be(c).remove(Ev):be(c).add(Ev)}),e.on("resize.cleanup",function(i){var r,o;r=i.context,o=r.shape,r.frame&&tt(r.frame),t.removeMarker(o,xv)})}_v.$inject=["eventBus","canvas","previewSupport"];var wv=-6,Ko="djs-resizer",T_=["n","w","s","e","nw","ne","se","sw"];function Ei(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&L(a,St(r.addResizer,r))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}Ei.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(o){gi(o)&&i.activate(o,e,n)}ce.bind(t,"mousedown",r),ce.bind(t,"touchstart",r)},Ei.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=function(u){var p={x:0,y:0};return u.indexOf("e")!==-1?p.x=6:u.indexOf("w")!==-1&&(p.x=wv),u.indexOf("s")!==-1?p.y=6:u.indexOf("n")!==-1&&(p.y=wv),p}(i),a=oe("g");be(a).add(Ko),be(a).add(Ko+"-"+e.id),be(a).add(Ko+"-"+i),le(r,a);var c=oe("rect");K(c,{x:-2+o.x,y:-2+o.y,width:4,height:4}),be(c).add(Ko+"-visual"),le(a,c);var l=oe("rect");return K(l,{x:-10+o.x,y:-10+o.y,width:20,height:20}),be(l).add(Ko+"-hit"),le(a,l),Gl(a,t,n),a},Ei.prototype.createResizer=function(e,t){var n=bv(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},Ei.prototype.addResizer=function(e){var t=this;this._resize.canResize({shape:e})&&L(T_,function(n){t.createResizer(e,n)})},Ei.prototype.removeResizers=function(){Cl(this._getResizersParent())},Ei.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Ei.$inject=["eventBus","canvas","selection","resize"];const Sv={__depends__:[Dn,Xn,zo],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Xo],resizePreview:["type",_v],resizeHandles:["type",Ei]};function Mu(e,t){var n=t.create("bpmn:CategoryValue"),i=t.create("bpmn:Category",{categoryValue:[n]});return Je(e.get("rootElements"),i),te(i).$parent=e,te(n).$parent=i,n}function Yo(e,t,n,i,r,o,a){function c(l,u){(u||we(l,["bpmn:Task","bpmn:TextAnnotation"])||Ru(l))&&i.activate(l)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",function(l){c(l.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],function(l){i.isActive()&&i.complete()}),e.on(["commandStack.changed"],function(l){i.isActive()&&i.cancel()}),e.on("directEditing.activate",function(l){o.removeResizers()}),e.on("create.end",500,function(l){var u=l.context,p=u.shape,d=l.context.canExecute;l.isTouch||d&&(u.hints&&u.hints.createElementsBehavior===!1||c(p))}),e.on("autoPlace.end",500,function(l){c(l.shape)})}function Ru(e){return A(e,"bpmn:SubProcess")&&!Me(e)}Yo.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Yo.prototype.activate=function(e){var t=pn(e);if(t!==void 0){var n={text:t};z(n,this.getEditingBBox(e));var i={};return(we(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||Ru(e))&&z(i,{centerVertically:!0}),Nr(e)&&z(i,{autoResize:!0}),A(e,"bpmn:TextAnnotation")&&z(i,{resizable:!0,autoResize:!0}),z(n,{options:i}),n}},Yo.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,a={x:i.x,y:i.y},c=t.zoom(),l=this._textRenderer.getDefaultStyle(),u=this._textRenderer.getExternalStyle(),p=u.fontSize*c,d=u.lineHeight,y=l.fontSize*c,f=l.lineHeight,v={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(A(e,"bpmn:Lane")||function(B){return A(B,"bpmn:Participant")&&Me(B)}(e))&&(z(a,{width:i.height,height:30*c,x:i.x-i.height/2+15*c,y:o-30*c/2}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px",transform:"rotate(-90deg)"})),(we(e,["bpmn:Task","bpmn:CallActivity"])||function(B){return A(B,"bpmn:Participant")&&!Me(B)}(e)||Ru(e))&&(z(a,{width:i.width,height:i.height}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"})),function(B){return A(B,"bpmn:SubProcess")&&Me(B)}(e)&&(z(a,{width:i.width,x:i.x}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"}));var g=90*c,b=7*c,S=4*c;if(n.labelTarget&&(z(a,{width:g,height:i.height+b+S,x:r-g/2,y:i.y-b}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:S+"px"})),Nr(n)&&!ss(n)&&!bt(n)){var w=cs(e),_=t.getAbsoluteBBox({x:w.x,y:w.y,width:0,height:0}),C=p+b+S;z(a,{width:g,height:C,x:_.x-g/2,y:_.y-C/2}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:S+"px"})}return A(e,"bpmn:TextAnnotation")&&(z(a,{width:i.width,height:i.height,minWidth:30*c,minHeight:10*c}),z(v,{textAlign:"left",paddingTop:5*c+"px",paddingBottom:7*c+"px",paddingLeft:7*c+"px",paddingRight:5*c+"px",fontSize:y+"px",lineHeight:f})),{bounds:a,style:v}},Yo.prototype.update=function(e,t,n,i){var r,o,a;if(A(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),A(e,"bpmn:Group")&&!te(e).categoryValueRef){var c=Mu(te(this._canvas.getRootElement()).$parent,this._bpmnFactory);te(e).categoryValueRef=c}(a=t)&&a.trim()||(t=null),this._modeling.updateLabel(e,t,r)};var Cv="djs-element-hidden",Tv="djs-label-hidden";function Av(e,t,n,i){var r,o,a,c=this,l=t.getDefaultLayer();e.on("directEditing.activate",function(u){var p=u.active;if(A(r=p.element.label||p.element,"bpmn:TextAnnotation")){o=t.getAbsoluteBBox(r),a=oe("g");var d=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:r.height,position:{mx:0,my:0}}),y=c.path=oe("path");K(y,{d,strokeWidth:2,stroke:A_(r)}),le(a,y),le(l,a),Lt(a,r.x,r.y)}A(r,"bpmn:TextAnnotation")||r.labelTarget?t.addMarker(r,Cv):(A(r,"bpmn:Task")||A(r,"bpmn:CallActivity")||A(r,"bpmn:SubProcess")||A(r,"bpmn:Participant"))&&t.addMarker(r,Tv)}),e.on("directEditing.resize",function(u){if(A(r,"bpmn:TextAnnotation")){var p=u.height,d=u.dy,y=Math.max(r.height/o.height*(p+d),0),f=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:y,position:{mx:0,my:0}});K(c.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(u){var p=u.active;p&&(t.removeMarker(p.element.label||p.element,Cv),t.removeMarker(r,Tv)),r=void 0,o=void 0,a&&(tt(a),a=void 0)})}function A_(e,t){return te(e).di.get("stroke")||t||"black"}Av.$inject=["eventBus","canvas","elementRegistry","pathMap"];const k_={__depends__:[gv,Sv,If],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Yo],labelEditingPreview:["type",Av]};var Nu=["top","bottom","left","right"],Bs=10;function Iu(e,t){function n(i){if(ss(i)){var r=function(o){var a=fe(o.label),c=fe(o),l=kv(c,a);if(u=l,Nu.indexOf(u)!==-1){var u,p=function(f){var v=fe(f),g=[].concat(f.incoming.map(function(b){return b.waypoints[b.waypoints.length-2]}),f.outgoing.map(function(b){return b.waypoints[1]})).map(function(b){return kv(v,b)});return g}(o);if(o.host){var d=function(f){var v,g=f.host,b=fe(f),S=yt(b,g);v=S.indexOf("-")>=0?S.split("-"):[S];var w=Nu.filter(function(_){return v.indexOf(_)===-1});return w}(o);p=p.concat(d)}var y=Nu.filter(function(f){return p.indexOf(f)===-1});if(y.indexOf(l)===-1)return y[0]}}(i);r&&function(o,a){var c=fe(o),l=o.label,u=fe(l);if(l.parent){var p,d=ae(o);switch(a){case"top":p={x:c.x,y:d.top-Bs-l.height/2};break;case"left":p={x:d.left-Bs-l.width/2,y:c.y};break;case"bottom":p={x:c.x,y:d.bottom+Bs+l.height/2};break;case"right":p={x:d.right+Bs+l.width/2,y:c.y}}var y=Nn(p,u);t.moveShape(l,y)}}(i,r)}}Q.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.source,c=o.target;(r.hints||{}).createElementsBehavior!==!1&&(n(a),n(c))}),this.postExecuted(["label.create"],function(i){var r=i.context,o=r.shape;(r.hints||{}).createElementsBehavior!==!1&&n(o.labelTarget)}),this.postExecuted(["elements.create"],function(i){var r=i.context,o=r.elements;(r.hints||{}).createElementsBehavior!==!1&&o.forEach(function(a){n(a)})})}function kv(e,t){return yt(t,e,5)}function Du(e,t,n){Q.call(this,e),this.preExecute("shape.append",function(i){var r=i.source,o=i.shape;i.position||(A(o,"bpmn:TextAnnotation")?i.position={x:r.x+r.width/2+75,y:r.y-50-o.height/2}:i.position={x:r.x+r.width+80+o.width/2,y:r.y+r.height/2})},!0)}function Bu(e,t){e.invoke(Q,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape;L(de(r.incoming.concat(r.outgoing),function(o){return A(o,"bpmn:Association")}),function(o){t.moveConnection(o,{x:0,y:0},i)})},!0)}ie(Iu,Q),Iu.$inject=["eventBus","modeling"],ie(Du,Q),Du.$inject=["eventBus","elementFactory","bpmnRules"],ie(Bu,Q),Bu.$inject=["injector","modeling"];function Os(e,t){t.invoke(Q,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;(r=r.filter(function(o){return Pv(o,o.host)})).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",500,function(i){var r=i.shapes,o=i.newHost;if(r.length===1){var a=r[0];Pv(a,o)&&(i.shapes=[n.replaceShape(a,o)])}},!0)}function Pv(e,t){return!bt(e)&&we(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}Os.$inject=["bpmnReplace","injector"],ie(Os,Q),Os.prototype.replaceShape=function(e,t){var n,i=(n=te(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function Ou(e,t,n){function i(r){return de(r.attachers,function(o){return A(o,"bpmn:BoundaryEvent")})}Q.call(this,e),this.postExecute("connection.create",function(r){var o=r.context.source,a=r.context.target,c=i(a);A(o,"bpmn:EventBasedGateway")&&A(a,"bpmn:ReceiveTask")&&c.length>0&&n.removeElements(c)}),this.postExecute("connection.reconnect",function(r){var o=r.context.oldSource,a=r.context.newSource;A(o,"bpmn:Gateway")&&A(a,"bpmn:EventBasedGateway")&&L(a.outgoing,function(c){var l=c.target,u=i(l);A(l,"bpmn:ReceiveTask")&&u.length>0&&n.removeElements(u)})}),e.on("moddleCopy.canCopyProperty",2e3,function(r){var o=r.parent,a=r.property,c=r.propertyName,l=t.getPropertyDescriptor(o,c);l&&l.isReference&&A(a,"bpmn:RootElement")&&o.set(c,a)})}Ou.$inject=["eventBus","moddle","modeling"],ie(Ou,Q);function Lu(e,t,n,i,r){function o(u){return we(u,["bpmn:ReceiveTask","bpmn:SendTask"])||function(p,d){return ge(d)||(d=[d]),si(d,function(y){return rs(p,y)})}(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){return!!Pe(e.getDefinitions().get("rootElements"),Kt({id:u.id}))}function c(u){return A(u,"bpmn:ErrorEventDefinition")?"errorRef":A(u,"bpmn:EscalationEventDefinition")?"escalationRef":A(u,"bpmn:MessageEventDefinition")?"messageRef":A(u,"bpmn:SignalEventDefinition")?"signalRef":void 0}function l(u){if(we(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var p=u.get("eventDefinitions")[0];return p.get(c(p))}n.invoke(Q,this),this.executed("shape.create",function(u){var p=u.shape;if(o(p)){var d=l(te(p));d&&!a(d)&&(Je(e.getDefinitions().get("rootElements"),d),u.addedRootElement=d)}},!0),this.reverted("shape.create",function(u){var p=u.addedRootElement;p&&Ye(e.getDefinitions().get("rootElements"),p)},!0),t.on("copyPaste.copyElement",function(u){var p=u.descriptor,d=u.element;if(o(d)){var y=l(te(d));y&&(p.referencedRootElement=y)}}),t.on("copyPaste.pasteElement",500,function(u){var p=u.descriptor,d=p.businessObject;if(o(d)){var y=p.referencedRootElement;y&&(a(y)||(y=i.copyElement(y,r.create(y.$type))),function(f,v){if(we(f,["bpmn:ReceiveTask","bpmn:SendTask"]))return f.set("messageRef",v);var g=f.get("eventDefinitions")[0];g.set(c(g),v)}(d,y))}})}function ju(e){e.invoke(Q,this),this.preExecute("shape.create",1500,function(t){var n=t.context,i=n.parent,r=n.shape;A(i,"bpmn:Lane")&&!A(r,"bpmn:Lane")&&(n.parent=fs(i,"bpmn:Participant"))})}Lu.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],ie(Lu,Q),ju.$inject=["injector"],ie(ju,Q);var Ls=1500;function Mv(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],Ls,function(i){var r=i.context.shape||i.shape,o=i.hover;A(o,"bpmn:Lane")&&!we(r,["bpmn:Lane","bpmn:Participant"])&&(i.hover=fn(o),i.hoverGfx=e.getGraphics(i.hover));var a=n.getRootElement();o!==a&&(r.labelTarget||A(r,"bpmn:Group"))&&(i.hover=a,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],Ls,function(i){var r=i.hover;A(r,"bpmn:Lane")&&(i.hover=fn(r)||r,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["bendpoint.move.hover"],Ls,function(i){var r=i.context,o=i.hover,a=r.type;A(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=fn(o)||o,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.start"],Ls,function(i){var r=i.context,o=r.start;A(o,"bpmn:Lane")&&(r.start=fn(o)||o)}),t.on("shape.move.start",2e3,function(i){var r=i.shape;A(r,"bpmn:Lane")&&(i.shape=fn(r)||r)})}function Vu(e,t,n){Q.call(this,e),this.preExecute("shape.create",function(i){var r=i.context.shape;if(A(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=t.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}Mv.$inject=["elementRegistry","eventBus","canvas"],Vu.$inject=["eventBus","bpmnFactory","moddle"],ie(Vu,Q);var Fu=20,zu=20,Rv=30,js=2e3;function $u(e,t,n){function i(r){var o,a=r.parent,c=e.getRootElement();A(c,"bpmn:Collaboration")?o=c:(o=n.makeCollaboration(),r.process=a),r.parent=o}Q.call(this,t),t.on(["create.start","shape.move.start"],js,function(r){var o=r.context,a=o.shape,c=e.getRootElement();if(A(a,"bpmn:Participant")&&A(c,"bpmn:Process")&&c.children.length){var l=c.children.filter(function(d){return!A(d,"bpmn:Group")&&!bt(d)&&!function(y){return!!y.waypoints}(d)});if(l.length){var u=vt(l),p=function(d,y){y={width:y.width+2*Fu+Rv,height:y.height+2*zu};var f=Math.max(d.width,y.width),v=Math.max(d.height,y.height);return{x:-f/2,y:-v/2,width:f,height:v}}(a,u);z(a,p),o.createConstraints=function(d,y){return y=ae(y),{bottom:y.top+d.height/2-zu,left:y.right-d.width/2+Fu,top:y.bottom-d.height/2+zu,right:y.left+d.width/2-Fu-Rv}}(a,u)}}}),t.on("create.start",js,function(r){var o=r.context.shape,a=e.getRootElement(),c=e.getGraphics(a);function l(u){u.element=a,u.gfx=c}A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&(t.on("element.hover",js,l),t.once("create.cleanup",function(){t.off("element.hover",l)}))}),this.preExecute("shape.create",function(r){var o=r.parent;A(r.shape,"bpmn:Participant")&&A(o,"bpmn:Process")&&i(r)},!0),this.execute("shape.create",function(r){var o=r.process,a=r.shape;o&&(r.oldProcessRef=a.businessObject.processRef,a.businessObject.processRef=o.businessObject)},!0),this.revert("shape.create",function(r){var o=r.process,a=r.shape;o&&(a.businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("shape.create",function(r){var o=r.process,a=r.shape;if(o){var c=o.children.slice();n.moveElements(c,{x:0,y:0},a)}},!0),this.preExecute("elements.create",js,function(r){var o,a=r.elements,c=r.parent;Vs(a)&&A(c,"bpmn:Process")&&(i(r),o=Vs(a),r.oldProcessRef=o.businessObject.processRef,o.businessObject.processRef=c.businessObject)},!0),this.revert("elements.create",function(r){var o=r.elements;r.process&&(Vs(o).businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("elements.create",function(r){var o,a=r.elements,c=r.process;if(c){o=Vs(a);var l=c.children.slice();n.moveElements(l,{x:0,y:0},o)}},!0)}function Vs(e){return Pe(e,function(t){return A(t,"bpmn:Participant")})}$u.$inject=["canvas","eventBus","modeling"],ie($u,Q);var Nv="__targetRef_placeholder";function Gu(e,t){function n(o,a){var c=o.get("properties"),l=Pe(c,function(u){return u.name===Nv});return!l&&a&&Je(c,l=t.create("bpmn:Property",{name:Nv})),l}function i(o,a){var c=n(o);c&&(function(l,u,p){return Pe(l.get("dataInputAssociations"),function(d){return d!==p&&d.targetRef===u})}(o,c,a)||Ye(o.get("properties"),c))}function r(o){var a,c=o.context,l=c.connection,u=l.businessObject,p=l.target,d=p&&p.businessObject,y=c.newTarget,f=y&&y.businessObject,v=c.oldTarget||c.target,g=v&&v.businessObject,b=l.businessObject;g&&g!==d&&i(g,u),f&&f!==d&&i(f,u),d?(a=n(d,!0),b.targetRef=a):b.targetRef=null}Q.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Iv(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Iv(r))}function Iv(e){return function(t){if(A(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function Fs(e){this._bpmnUpdater=e}function Uu(e,t,n,i){function r(a){return a.children.filter(function(c){return A(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function o(a,c){var l=a.businessObject||a;if(c=c||n.filter(function(p){return A(p,"bpmn:Participant")&&te(p).processRef})[0]){var u=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:l,newSemanticParent:u.processRef||u,newDiParent:u.di})}}Q.call(this,i),t.registerHandler("dataStore.updateContainment",Fs),this.preExecute("shape.create",function(a){var c=a.context,l=c.shape;A(l,"bpmn:DataStoreReference")&&l.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(a){var c=a.context,l=c.shapes;l.filter(function(u){return A(u,"bpmn:DataStoreReference")}).length&&(c.hints||(c.hints={}),c.hints.autoResize=l.filter(function(u){return!A(u,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(a){var c=a.context.shape,l=c.parent;A(c,"bpmn:DataStoreReference")&&c.type!=="label"&&A(l,"bpmn:Collaboration")&&o(c)}),this.postExecute("shape.move",function(a){var c=a.context,l=c.shape,u=c.oldParent,p=l.parent;A(u,"bpmn:Collaboration")||A(l,"bpmn:DataStoreReference")&&l.type!=="label"&&A(p,"bpmn:Collaboration")&&o(l,A(u,"bpmn:Participant")?u:function(d,y){for(;d.parent;){if(A(d.parent,y))return d.parent;d=d.parent}}(u,"bpmn:Participant"))}),this.postExecute("shape.delete",function(a){var c=a.context.shape,l=e.getRootElement();we(c,["bpmn:Participant","bpmn:SubProcess"])&&A(l,"bpmn:Collaboration")&&r(l).filter(function(u){return function(p,d){for(var y=p.businessObject||p,f=d.businessObject||d;y.$parent;){if(y.$parent===f.processRef||f)return!0;y=y.$parent}return!1}(u,c)}).forEach(function(u){o(u)})}),this.postExecute("canvas.updateRoot",function(a){var c=a.context,l=c.oldRoot,u=c.newRoot;r(l).forEach(function(p){A(u,"bpmn:Process")&&o(p,u)})})}Gu.$inject=["eventBus","bpmnFactory"],ie(Gu,Q),Fs.$inject=["bpmnUpdater"],Fs.prototype.execute=function(e){var t=e.dataStoreBo,n=e.newSemanticParent,i=e.newDiParent;e.oldSemanticParent=t.$parent,e.oldDiParent=t.di.$parent,this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},Fs.prototype.revert=function(e){var t=e.dataStoreBo,n=e.oldSemanticParent,i=e.oldDiParent;this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},Uu.$inject=["canvas","commandStack","elementRegistry","eventBus"],ie(Uu,Q);function Hu(e,t,n){Q.call(this,e),this.postExecuted("shape.delete",500,function(i){var r=i.context,o=r.hints,a=r.shape,c=r.oldParent;A(a,"bpmn:Lane")&&(o&&o.nested||function(l,u){var p,d,y,f=ai(u),v=[],g=[];zi(f,function(b){return b.y>l.y?g.push(b):v.push(b),b.children}),f.length&&(p=g.length&&v.length?l.height/2:l.height,v.length&&(d=n.calculateAdjustments(v,"y",p,l.y-10),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},"s")),g.length&&(y=n.calculateAdjustments(g,"y",-p,l.y+l.height+10),n.makeSpace(y.movingShapes,y.resizingShapes,{x:0,y:-p},"n")))}(a,c))})}Hu.$inject=["eventBus","modeling","spaceTool"],ie(Hu,Q);function zs(e,t){t.invoke(Q,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;r.filter(function(o){return Dv(o,o.host)}).map(function(o){return r.indexOf(o)}).forEach(function(o){i.elements[o]=n.replaceShape(r[o])})},!0),this.preExecute("elements.move",500,function(i){var r=i.shapes,o=i.newHost;r.forEach(function(a,c){var l,u=a.host;Dv(a,(l=u,r.indexOf(l)!==-1?u:o))&&(r[c]=n.replaceShape(a))})},!0)}function Dv(e,t){return!bt(e)&&A(e,"bpmn:BoundaryEvent")&&!t}function qu(e,t,n){function i(r,o,a){var c,l,u,p,d,y,f,v,g=o.waypoints,b=r.outgoing.slice(),S=r.incoming.slice(),w=fu(g,v=pe(a.width)?fe(a):a);if(w){if(c=g.slice(0,w.index),l=g.slice(w.index+(w.bendpoint?1:0)),!c.length||!l.length)return;u=w.bendpoint?g[w.index]:v,c.length!==1&&Bv(r,c[c.length-1])||c.push(Ov(u)),l.length!==1&&Bv(r,l[0])||l.unshift(Ov(u))}p=o.source,d=o.target,t.canConnect(p,r,o)&&(n.reconnectEnd(o,r,c||v),y=o),t.canConnect(r,d,o)&&(y?f=n.connect(r,d,{type:o.type,waypoints:l}):(n.reconnectStart(o,r,l||v),f=o));var _=[].concat(y&&de(S,function(C){return C.source===y.source})||[],f&&de(b,function(C){return C.target===f.target})||[]);_.length&&n.removeElements(_)}Q.call(this,e),this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,c=r.delta,l=a[0];if(l&&o){o&&o.waypoints&&(r.newParent=o=o.parent);var u=fe(l),p={x:u.x+c.x,y:u.y+c.y},d=Pe(o.children,function(y){return t.canInsert(a,y)&&fu(y.waypoints,p)});d&&(r.targetFlow=d,r.position=p)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,c=r.position;a&&i(o[0],a,c)},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;t.canInsert(a,o)&&(r.targetFlow=o,r.parent=o.parent)},!0),this.postExecuted("shape.create",function(r){var o=r.shape,a=r.targetFlow,c=r.position;a&&i(o,a,c)},!0)}function Bv(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function Ov(e){return z({},e)}function Wu(e,t){Q.call(this,e),this.preExecuted("connection.create",function(n){var i=n.context,r=i.source,o=i.target,a=o.incoming.slice();i.hints&&i.hints.createElementsBehavior===!1||A(r,"bpmn:EventBasedGateway")&&o.incoming.length&&a.filter(Xu).forEach(function(c){t.removeConnection(c)})}),this.preExecuted("shape.replace",function(n){var i=n.context.newShape;A(i,"bpmn:EventBasedGateway")&&i.outgoing.filter(Xu).map(function(r){return r.target}).reduce(function(r,o){var a=o.incoming.filter(Xu);return r.concat(a)},[]).forEach(function(r){r.source!==i&&t.removeConnection(r)})})}function Xu(e){return A(e,"bpmn:SequenceFlow")}zs.$inject=["bpmnReplace","injector"],ie(zs,Q),zs.prototype.replaceShape=function(e){var t,n,i=(n=te(e).eventDefinitions)&&n[0];return t=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},ie(qu,Q),qu.$inject=["eventBus","bpmnRules","modeling"],Wu.$inject=["eventBus","modeling"],ie(Wu,Q);function Ku(e,t,n,i,r,o){function a(){return te(t.getRootElement()).$parent}function c(l){var u=te(l).categoryValueRef;if(u){var p=u.$parent;u&&(Ye(p.categoryValue,u),p&&!p.categoryValue.length&&function(d){Ye(a().get("rootElements"),d)}(p))}}r.invoke(Q,this),this.executed("shape.delete",function(l){var u,p=l.context.shape;if(A(p,"bpmn:Group")){var d=te(p).categoryValueRef,y=n.filter(function(f){return A(f,"bpmn:Group")});u=d,y.some(function(f){var v=te(f);return v.categoryValueRef&&v.categoryValueRef===u})||c(p)}}),this.reverted("shape.delete",function(l){var u=l.context.shape;if(A(u,"bpmn:Group")){var p=te(u).categoryValueRef,d=a(),y=p?p.$parent:null;Je(y.get("categoryValue"),p),Je(d.get("rootElements"),y)}}),this.execute("shape.create",function(l){var u=te(l.context.shape);if(A(u,"bpmn:Group")&&!u.categoryValueRef){var p=Mu(a(),e);u.categoryValueRef=p}}),this.revert("shape.create",function(l){var u=l.context.shape;A(u,"bpmn:Group")&&(c(u),delete te(u).categoryValueRef)}),i.on("moddleCopy.canCopyProperty",2e3,function(l){var u,p=l.property;if(A(p,"bpmn:CategoryValue"))return u=Mu(a(),e),o.copyElement(p,u)})}function Yu(e,t,n,i){var r,o,a,c;return(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))==0?null:(o=e.y-n.y,a=e.x-n.x,c=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(e.x+c*(t.x-e.x)),y:Math.round(e.y+c*(t.y-e.y))})}function Lv(e){function t(n,i,r){var o,a={x:r.x,y:r.y-50},c={x:r.x-50,y:r.y},l=Yu(n,i,r,a),u=Yu(n,i,r,c);o=l&&u?jv(l,r)>jv(u,r)?u:l:l||u,n.original=o}e.on("bpmnElement.added",function(n){var i,r,o=n.element;o.waypoints&&(t((r=(i=o).waypoints)[0],r[1],fe(i.source)),t(r[r.length-1],r[r.length-2],fe(i.target)))})}function jv(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ju(e){Q.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=te(n.context.shape);we(i,t)&&!i.di.get("isHorizontal")&&i.di.set("isHorizontal",!0)})}function Vv(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Fv(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function zv(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=function(a,c,l){var u=[{n:a[0]-l[0],lambda:c[0]},{n:a[1]-l[1],lambda:c[1]}];return-(u[0].n*c[0]+u[1].n*c[1])/(u[0].lambda*c[0]+u[1].lambda*c[1])}([n.x,n.y],[r.x,r.y],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function P_(e,t){var n=zv(e,t);return Vv({x:n.x-e.x,y:n.y-e.y})}function $s(e,t){return Vv({x:e.x-t.x,y:e.y-t.y})}Ku.$inject=["bpmnFactory","canvas","elementRegistry","eventBus","injector","moddleCopy"],ie(Ku,Q),Lv.$inject=["eventBus"],Ju.$inject=["eventBus"],ie(Ju,Q);var $v=Math.sqrt,Gv=Math.min,M_=Math.max,Uv=Math.abs;function Hv(e){return Math.pow(e,2)}function Jo(e,t){return $v(Hv(e.x-t.x)+Hv(e.y-t.y))}function R_(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,c=n.y-e.y,l=r*r+o*o,u=(r*a+o*c)/l,p=u*u-(a*a+c*c-i*i)/l;if(p<0&&p>-1e-6&&(p=0),p<0)return[];var d=$v(p),y=-u+d,f=-u-d,v={x:e.x-r*y,y:e.y-o*y};return p===0?[v]:[v,{x:e.x-r*f,y:e.y-o*f}].filter(function(g){return function(b,S,w){return qv(b.x,S.x,w.x)&&qv(b.y,S.y,w.y)}(g,e,t)})}function qv(e,t,n){return e>=Gv(t,n)-Gs&&e<=M_(t,n)+Gs}var Gs=.1;function Wv(e,t){return Uv(e.x-t.x)<=Gs&&Uv(e.y-t.y)<=Gs}function N_(e,t,n,i){var r=0,o=0,a=function(T){return{x:T.x+T.width/2,y:T.y+T.height/2}}(e),c=function(T,M){var N,$,P,x,I,j,G,X,ee,re,se,H,q=0;for(q=0;q<M.length-1;q++){if(Wv(N=M[q],$=M[q+1])?j=[N]:(P=Jo(T,N),x=Jo(T,$),j=R_(N,$,T,Gv(P,x))),j.length<1)throw new Error("expected between [1, 2] circle -> line intersections");j.length===1&&(G={type:"bendpoint",position:j[0],segmentIndex:q,bendpointIndex:Wv(N,j[0])?q:q+1}),j.length===2&&(se=j[0],H=j[1],G={type:"segment",position:I={x:(se.x+H.x)/2,y:(se.y+H.y)/2},segmentIndex:q,relativeLocation:Jo(N,I)/Jo(N,$)}),X=Jo(G.position,T),(!re||ee>X)&&(re=G,ee=X)}return re}(a,n),l=c.segmentIndex,u=function(T,M,N,$){var P=N.segmentIndex,x=M.length-T.length;if($.segmentMove){var I=$.segmentMove.segmentStartIndex,j=$.segmentMove.newSegmentStartIndex;return P===I?j:P>=j?P+x<j?j:P+x:P}if($.bendpointMove){var G,X=$.bendpointMove.insert,ee=$.bendpointMove.bendpointIndex;return x===0?P:(P>=ee&&(G=X?P+1:P-1),P<ee&&(G=P,X&&N.type!=="bendpoint"&&ee-1===P&&Xv(M,ee)<N.relativeLocation&&G++),G)}return x===0?P:$.connectionStart?P===0?0:null:$.connectionEnd&&P===T.length-2?M.length-2:null}(n,t,c,i);if(u===null)return{x:r,y:o};if(u<0||u>t.length-2)return{x:r,y:o};var p,d,y=Kv(n,l),f=Kv(t,u),v=c.position,g=function(T,M){var N=$s(T[0],T[1]),$=$s(T[0],M);return N===0?0:$/N}(y,v),b=(p=f,d=Fv(y),Fv(p)-d);if(c.type==="bendpoint"){var S=t.length-n.length,w=c.bendpointIndex,_=n[w];if(t.indexOf(_)!==-1)return{x:r,y:o};if(S===0){var C=t[w];return{x:C.x-c.position.x,y:C.y-c.position.y}}S<0&&w!==0&&w<n.length-1&&(g=Xv(n,w))}var B,s,h=(f[1].x-f[0].x)*g+f[0].x,m=(f[1].y-f[0].y)*g+f[0].y,E=(B={x:a.x-v.x,y:a.y-v.y},(s=b)?{x:Math.cos(s)*B.x-Math.sin(s)*B.y,y:Math.sin(s)*B.x+Math.cos(s)*B.y}:B);return $i({x:r=h+E.x-a.x,y:o=m+E.y-a.y})}function Xv(e,t){var n=$s(e[t-1],e[t]);return n/(n+$s(e[t],e[t+1]))}function Kv(e,t){return[e[t],e[t+1]]}function Zo(e,t,n){var i=Bo(t),r=Bo(n),o=Nn(e,i),a=o.x*(n.width/t.width),c=o.y*(n.height/t.height);return $i({x:r.x+a,y:r.y+c})}function Yv(e,t,n){var i=Bo(e),r=Bo(t),o=Bo(n),a=Nn(e,i),c=Nn(i,r),l=function(f,v,g){var b=ae(v),S=ae(g);if(function(s,h){return function(m,E){return m.right!==E.right&&m.left!==E.left}(s,h)||function(m,E){return m.top!==E.top&&m.bottom!==E.bottom}(s,h)}(b,S))return null;var w,_,C,B=yt(v,f);if(B==="top")w={x:0,y:S.bottom-b.bottom};else if(B==="bottom")w={x:0,y:S.top-b.top};else if(B==="right")w={x:S.left-b.left,y:0};else{if(B!=="left")return null;w={x:S.right-b.right,y:0}}return _={x:f.x+w.x,y:f.y+w.y},C=yt(g,_),C!==B?null:w}(i,t,n);if(l)return l;var u=c.x*(n.width/t.width),p=c.y*(n.height/t.height),d=o.x+u,y=o.y+p;return $i({x:d+a.x-e.x,y:y+a.y-e.y})}var I_={width:90,height:20},Jv="name",Zv="text";function Zu(e,t,n,i){Q.call(this,e),this.postExecute("element.updateProperties",function(r){var o=r.context,a=o.element,c=o.properties;if(Jv in c&&t.updateLabel(a,c[Jv]),Zv in c&&A(a,"bpmn:TextAnnotation")){var l=i.getTextAnnotationBounds({x:a.x,y:a.y,width:a.width,height:a.height},c[Zv]||"");t.updateLabel(a,c.text,l)}}),this.postExecute(["shape.create","connection.create"],function(r){var o=r.context;if((o.hints||{}).createElementsBehavior!==!1){var a=o.shape||o.connection,c=a.businessObject;if(!bt(a)&&Nr(a)&&pn(a)){var l=cs(a),u=i.getExternalLabelBounds(I_,pn(a));t.createLabel(a,l,{id:c.id+"_label",businessObject:c,width:u.width,height:u.height})}}}),this.postExecute("shape.delete",function(r){var o=r.context,a=o.labelTarget,c=o.hints||{};a&&c.unsetLabel!==!1&&t.updateLabel(a,null,null,{removeShape:!1})}),this.postExecute(["label.create"],function(r){var o,a=r.context.shape;a.labelTarget&&A(a.labelTarget||a,"bpmn:BaseElement")&&((o=a.businessObject.di).label||(o.label=n.create("bpmndi:BPMNLabel",{bounds:n.create("dc:Bounds")})),z(o.label.bounds,{x:a.x,y:a.y,width:a.width,height:a.height}))}),this.postExecute(["connection.layout","connection.updateWaypoints"],function(r){var o=r.context;if((o.hints||{}).labelBehavior!==!1){var a,c=o.connection.label;c&&c.parent&&(a=function(l){var u=l.context,p=u.connection,d=p.label,y=z({},u.hints),f=u.newWaypoints||p.waypoints,v=u.oldWaypoints;return y.startChanged===void 0&&(y.startChanged=!!y.connectionStart),y.endChanged===void 0&&(y.endChanged=!!y.connectionEnd),N_(d,f,v,y)}(r),t.moveShape(c,a))}}),this.postExecute(["shape.replace"],function(r){var o=r.context,a=o.newShape,c=o.oldShape,l=te(a);l&&Nr(l)&&c.label&&a.label&&(a.label.x=c.label.x,a.label.y=c.label.y)}),this.postExecute("shape.resize",function(r){var o,a=r.context,c=a.shape,l=a.newBounds,u=a.oldBounds;if(ss(c)){var p=c.label,d=D_(function(y,f){if(f.length){var v=function(g,b){var S=b.map(function(w){return{line:w,distance:P_(g,w)}});return Xt(S,"distance")[0].line}(y,f);return zv(y,v)}}(fe(p),[[{x:(o=u).x,y:o.y},{x:o.x+(o.width||0),y:o.y}],[{x:o.x+(o.width||0),y:o.y},{x:o.x+(o.width||0),y:o.y+(o.height||0)}],[{x:o.x,y:o.y+(o.height||0)},{x:o.x+(o.width||0),y:o.y+(o.height||0)}],[{x:o.x,y:o.y},{x:o.x,y:o.y+(o.height||0)}]]),u,l);t.moveShape(p,d)}})}function D_(e,t,n){return $i(Nn(Zo(e,t,n),e))}function Us(e,t,n){var i=qs(e),r=ey(i,t),o=i[0];return r.length?r[r.length-1]:Zo(o.original||o,n,t)}function Hs(e,t,n){var i=qs(e),r=ey(i,t),o=i[i.length-1];return r.length?r[0]:Zo(o.original||o,n,t)}function Qu(e,t,n){var i=qs(e),r=Qv(t,n),o=i[0];return Zo(o.original||o,r,t)}function ep(e,t,n){var i=qs(e),r=Qv(t,n),o=i[i.length-1];return Zo(o.original||o,r,t)}function Qv(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function qs(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function ey(e,t){return de(lt(e,B_),function(n){return function(i,r){return yt(r,i,1)==="intersect"}(n,t)})}function B_(e){return e.original||e}function tp(e,t){Q.call(this,e),this.postExecute("shape.replace",function(n){var i=n.oldShape,r=n.newShape;if(function(p,d){return A(p,"bpmn:Participant")&&Me(p)&&A(d,"bpmn:Participant")&&!Me(d)}(i,r)){var o,a,c,l,u=(a=Fa([o=i],!1),c=[],l=[],a.forEach(function(p){p!==o&&(p.incoming.forEach(function(d){A(d,"bpmn:MessageFlow")&&c.push(d)}),p.outgoing.forEach(function(d){A(d,"bpmn:MessageFlow")&&l.push(d)}))},[]),{incoming:c,outgoing:l});u.incoming.forEach(function(p){var d=Hs(p,r,i);t.reconnectEnd(p,r,d)}),u.outgoing.forEach(function(p){var d=Us(p,r,i);t.reconnectStart(p,r,d)})}},!0)}ie(Zu,Q),Zu.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],tp.$inject=["eventBus","modeling"],ie(tp,Q);function ty(e,t,n){e.on(["shape.move.rejected","create.rejected"],function(i){var r,o,a,c=i.context,l=c.shape;A(c.target,"bpmn:Collaboration")&&A(l,"bpmn:FlowNode")&&(r=i,o=n("flow elements must be children of pools/participants"),t.add({position:{x:r.x+5,y:r.y+5},type:"error",timeout:a||2e3,html:"<div>"+o+"</div>"}))})}function np(e,t,n,i){Q.call(this,e);var r=i.get("dragging",!1);function o(a){var c,l,u=a.source,p=a.target;a.parent&&(A(a,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(u,p)||(l=!0),n.canConnectMessageFlow(u,p)&&(c="bpmn:MessageFlow")),A(a,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(u,p)||(l=!0),n.canConnectSequenceFlow(u,p)&&(c="bpmn:SequenceFlow")),A(a,"bpmn:Association")&&!n.canConnectAssociation(u,p)&&(l=!0),l&&t.removeConnection(a),c&&t.connect(u,p,{type:c,waypoints:a.waypoints.slice()}))}this.postExecuted("elements.move",function(a){L(a.closure.allConnections,o)},!0),this.preExecute("connection.reconnect",function(a){var c,l,u=a.context,p=u.connection,d=u.newSource||p.source,y=u.newTarget||p.target;(c=n.canConnect(d,y))&&c.type!==p.type&&(l=t.connect(d,y,{type:c.type,waypoints:p.waypoints.slice()}),t.removeConnection(p),u.connection=l,r&&function(f,v){var g,b=r.context(),S=b&&b.payload.previousSelection;!S||!S.length||(g=S.indexOf(f),g!==-1&&S.splice(g,1,v))}(p,l))}),this.postExecuted("element.updateProperties",function(a){var c,l=a.context,u=l.properties,p=l.element,d=p.businessObject;u.default&&(c=Pe(p.outgoing,Kt({id:p.businessObject.default.id})))&&t.updateProperties(c,{conditionExpression:void 0}),u.conditionExpression&&d.sourceRef.default===d&&t.updateProperties(p.source,{default:void 0})})}function ip(e,t){Q.call(this,e),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;A(i,"bpmn:Participant")&&(n.collaborationRoot=r)},!0),this.postExecute("shape.delete",function(n){var i=n.collaborationRoot;i&&!i.businessObject.participants.length&&t.makeProcess()},!0)}function Ws(e,t,n,i,r,o){i.invoke(Q,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var c=a.context,l=c.parent,u=c.elements,p=t.canReplace(u,l);p&&this.replaceElements(u,p.replacements)},this),this.postExecuted(["elements.move"],500,function(a){var c=a.context,l=c.newParent,u=c.newHost,p=[];L(c.closure.topLevel,function(y){p=It(y)?p.concat(y.children):p.concat(y)}),p.length===1&&u&&(l=u);var d=t.canReplace(p,l);d&&this.replaceElements(p,d.replacements,u)},this),this.postExecute(["shape.replace"],1500,function(a){var c,l=a.context,u=l.oldShape,p=l.newShape,d=u.attachers;d&&d.length&&(c=t.canReplace(d,p),this.replaceElements(d,c.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var c=a.context,l=c.oldShape,u=c.newShape;r.unclaimId(l.businessObject.id,l.businessObject),r.updateProperties(u,{id:l.id})})}ty.$inject=["eventBus","tooltips","translate"],ie(np,Q),np.$inject=["eventBus","modeling","bpmnRules","injector"],ip.$inject=["eventBus","modeling"],ie(ip,Q),ie(Ws,Q),Ws.prototype.replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;L(t,function(o){var a={type:o.newElementType},c=n.get(o.oldElementId),l=e.indexOf(c);e[l]=i.replaceElement(c,a,{select:!1})}),t&&r.select(e)},Ws.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var Zi={width:300,height:60},Qo={width:300,height:150},ny={width:140,height:120},iy={width:50,height:30};function ry(e){e.on("resize.start",1500,function(t){var n=t.context,i=n.shape,r=n.direction,o=n.balanced;(A(i,"bpmn:Lane")||A(i,"bpmn:Participant"))&&(n.resizeConstraints=function(a,c,l){var u=fn(a),p=!0,d=!0,y=Ms(u,[u]),f=ae(a),v={},g={};return/e/.test(c)?g.right=f.left+Zi.width:/w/.test(c)&&(g.left=f.right-Zi.width),y.forEach(function(b){var S=ae(b);/n/.test(c)&&(S.top<f.top-10&&(p=!1),l&&Xs(f.top-S.bottom)<10&&Ys(v,"top",S.top+Zi.height),Xs(f.top-S.top)<5&&Ks(g,"top",S.bottom-Zi.height)),/s/.test(c)&&(S.bottom>f.bottom+10&&(d=!1),l&&Xs(f.bottom-S.top)<10&&Ks(v,"bottom",S.bottom-Zi.height),Xs(f.bottom-S.bottom)<5&&Ys(g,"bottom",S.top+Zi.height))}),u.children.filter(function(b){return!b.hidden&&!b.waypoints&&(A(b,"bpmn:FlowElement")||A(b,"bpmn:Artifact"))}).forEach(function(b){var S=ae(b);p&&/n/.test(c)&&Ks(g,"top",S.top-F_),/e/.test(c)&&Ys(g,"right",S.right+j_),d&&/s/.test(c)&&Ys(g,"bottom",S.bottom+z_),/w/.test(c)&&Ks(g,"left",S.left-V_)}),{min:g,max:v}}(i,r,o)),A(i,"bpmn:Participant")&&(n.minDimensions=Qo),A(i,"bpmn:SubProcess")&&Me(i)&&(n.minDimensions=ny),A(i,"bpmn:TextAnnotation")&&(n.minDimensions=iy)})}ry.$inject=["eventBus"];var Xs=Math.abs,O_=Math.min,L_=Math.max;function oy(e,t,n,i){var r=e[t];e[t]=r===void 0?n:i(n,r)}function Ks(e,t,n){return oy(e,t,n,O_)}function Ys(e,t,n){return oy(e,t,n,L_)}var j_=20,V_=50,F_=20,z_=20;function ay(e,t){e.on("resize.start",1501,function(n){var i=n.context,r=i.shape;(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))&&(i.balanced=!Dr(n))}),e.on("resize.end",1001,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))return o&&(a=Id(a),t.resizeLane(r,a,i.balanced)),!1})}function rp(e,t,n){Q.call(this,e),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(A(o,"bpmn:SequenceFlow")&&A(a,"bpmn:SequenceFlow")&&t.canConnect(o.source,a.target,o)){var c=function(l,u){var p=Yu($r(l[l.length-2]),$r(l[l.length-1]),$r(u[1]),$r(u[0]));return p?[].concat(l.slice(0,l.length-1),[p],u.slice(1)):[$r(l[0]),$r(u[u.length-1])]}(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,c)}}})}function $r(e){return e.original||e}ay.$inject=["eventBus","modeling"],ie(rp,Q),rp.$inject=["eventBus","bpmnRules","modeling"];var $_=Math.max;function sy(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,i=t.axis,r=t.start,o={};return L(n,function(a){var c=a.id;A(a,"bpmn:Participant")&&(function(l){return l==="x"}(i)?o[c]=Qo:o[c]={width:Qo.width,height:G_(a,r)}),A(a,"bpmn:SubProcess")&&Me(a)&&(o[c]=ny),A(a,"bpmn:TextAnnotation")&&(o[c]=iy)}),o})}function G_(e,t){var n;return ai(e).length?(n=function(i,r){var o,a=ai(i);return o=cy(a,r),i.height-o.height+Zi.height}(e,t),$_(Qo.height,n)):Qo.height}function cy(e,t){var n,i,r;for(n=0;n<e.length;n++)if(t>=(i=e[n]).y&&t<=i.y+i.height)return(r=ai(i)).length?cy(r,t):i}function op(e,t){e.invoke(Q,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(A(r,"bpmn:SubProcess")&&A(i,"bpmn:Task")&&Me(r)){var o,a={x:(o=r).x+o.width/6,y:o.y+o.height/2};t.createShape({type:"bpmn:StartEvent"},a,r)}})}sy.$inject=["eventBus"],op.$inject=["injector","modeling"],ie(op,Q);function ap(e,t,n,i){Q.call(this,e),this.executed(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape;A(a,"bpmn:SubProcess")&&(a.collapsed?te(a).di.isExpanded=!1:((o=a.children).length&&o.forEach(function(c){c.type!=="label"||c.businessObject.name||(c.hidden=!0)}),te(a).di.isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],500,function(r){var o=r.context.shape;o.collapsed?te(o).di.isExpanded=!1:te(o).di.isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape,c=t._getDefaultSize(a);o=a.collapsed?function(l,u){return{x:l.x+(l.width-u.width)/2,y:l.y+(l.height-u.height)/2,width:u.width,height:u.height}}(a,c):function(l,u){var p,d,y=l.children,f=u;return(p=iv((d=y,d.filter(function(v){return!v.hidden})).concat([l])))?(f.width=Math.max(p.width,f.width),f.height=Math.max(p.height,f.height),f.x=p.x+(p.width-f.width)/2,f.y=p.y+(p.height-f.height)/2):(f.x=l.x+(l.width-f.width)/2,f.y=l.y+(l.height-f.height)/2),f}(a,c),n.resizeShape(a,o,null,{autoResize:!a.collapsed&&"nwse"})})}function sp(e,t,n,i){t.invoke(Q,this),this.preExecute("shape.delete",function(r){var o=r.context.shape,a=o.businessObject;bt(o)||(A(o,"bpmn:Participant")&&Me(o)&&n.ids.unclaim(a.processRef.id),i.unclaimId(a.id,a))}),this.preExecute("connection.delete",function(r){var o=r.context.connection.businessObject;i.unclaimId(o.id,o)}),this.preExecute("canvas.updateRoot",function(){var r=e.getRootElement().businessObject;n.ids.unclaim(r.id)})}ie(ap,Q),ap.$inject=["eventBus","elementFactory","modeling"],ie(sp,Q),sp.$inject=["canvas","injector","moddle","modeling"];function cp(e,t,n){var i;function r(){if(!i)throw new Error(n("out of bounds release"));return i}Q.call(this,e);var o=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(o,5e3,function(a){(i=i||new U_).enter()}),this.postExecuted(o,500,function(a){(function(){if(!i)throw new Error(n("out of bounds release"));var c=i.leave();c&&(t.updateLaneRefs(i.flowNodes,i.lanes),i=null)})()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(a){var c=a.context.shape,l=r();c.labelTarget||(A(c,"bpmn:Lane")&&l.addLane(c),A(c,"bpmn:FlowNode")&&l.addFlowNode(c))})}function U_(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function lp(e,t){Q.call(this,e),this.preExecute("connection.delete",function(n){var i=n.context.connection,r=i.source;(function(o,a){if(!A(o,"bpmn:SequenceFlow"))return!1;var c=te(a),l=te(o);return c.get("default")===l})(i,r)&&t.updateProperties(r,{default:null})})}cp.$inject=["eventBus","modeling","translate"],ie(cp,Q),ie(lp,Q),lp.$inject=["eventBus","modeling"];const H_={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","rootElementReferenceBehavior","createBehavior","fixHoverBehavior","createDataObjectBehavior","createParticipantBehavior","dataStoreBehavior","dataInputAssociationBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","messageFlowBehavior","modelingFeedback","removeElementBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","toggleElementCollapseBehaviour","spaceToolBehavior","subProcessStartEventBehavior","unclaimIdBehavior","unsetDefaultFlowBehavior","updateFlowNodeRefsBehavior"],adaptiveLabelPositioningBehavior:["type",Iu],appendBehavior:["type",Du],associationBehavior:["type",Bu],attachEventBehavior:["type",Os],boundaryEventBehavior:["type",Ou],rootElementReferenceBehavior:["type",Lu],createBehavior:["type",ju],fixHoverBehavior:["type",Mv],createDataObjectBehavior:["type",Vu],createParticipantBehavior:["type",$u],dataInputAssociationBehavior:["type",Gu],dataStoreBehavior:["type",Uu],deleteLaneBehavior:["type",Hu],detachEventBehavior:["type",zs],dropOnFlowBehavior:["type",qu],eventBasedGatewayBehavior:["type",Wu],groupBehavior:["type",Ku],importDockingFix:["type",Lv],isHorizontalFix:["type",Ju],labelBehavior:["type",Zu],messageFlowBehavior:["type",tp],modelingFeedback:["type",ty],replaceConnectionBehavior:["type",np],removeParticipantBehavior:["type",ip],replaceElementBehaviour:["type",Ws],resizeBehavior:["type",ry],resizeLaneBehavior:["type",ay],removeElementBehavior:["type",rp],toggleElementCollapseBehaviour:["type",ap],spaceToolBehavior:["type",sy],subProcessStartEventBehavior:["type",op],unclaimIdBehavior:["type",sp],updateFlowNodeRefsBehavior:["type",cp],unsetDefaultFlowBehavior:["type",lp]};function ly(e,t){var n=yt(e,t,-15);return n!=="intersect"?n:null}function xt(e){bi.call(this,e)}function up(e){return!e||bt(e)}function uy(e){do{if(A(e,"bpmn:Process"))return te(e);if(A(e,"bpmn:Participant"))return te(e).processRef||te(e)}while(e=e.parent)}function pp(e){return A(e,"bpmn:TextAnnotation")}function hp(e){return A(e,"bpmn:Group")&&!e.labelTarget}function dp(e){return A(e,"bpmn:BoundaryEvent")&&Bn(e,"bpmn:CompensateEventDefinition")}function Gr(e){return te(e).isForCompensation}function py(e){for(var t=e;t=t.parent;){if(A(t,"bpmn:FlowElementsContainer"))return te(t);if(A(t,"bpmn:Participant"))return te(t).processRef}return null}function Bn(e,t){return!!Pe(te(e).eventDefinitions||[],function(n){return A(n,t)})}function hy(e,t){return(te(e).eventDefinitions||[]).every(function(n){return A(n,t)})}function dy(e){return A(e,"bpmn:ReceiveTask")||A(e,"bpmn:IntermediateCatchEvent")&&(Bn(e,"bpmn:MessageEventDefinition")||Bn(e,"bpmn:TimerEventDefinition")||Bn(e,"bpmn:ConditionalEventDefinition")||Bn(e,"bpmn:SignalEventDefinition"))}function Js(e){return e.waypoints}function mp(e,t){var n=function(i){for(var r=[];i;)(i=i.parent)&&r.push(i);return r}(t);return n.indexOf(e)!==-1}function Zs(e,t,n){if(up(e)||up(t))return null;if(!A(n,"bpmn:DataAssociation")){if(Ey(e,t))return{type:"bpmn:MessageFlow"};if(_y(e,t))return{type:"bpmn:SequenceFlow"}}var i=vp(e,t);return i||(dp(e)&&Gr(t)?{type:"bpmn:Association",associationDirection:"One"}:!!xy(e,t)&&{type:"bpmn:Association"})}function Ur(e,t,n){return!(!bt(e)&&!hp(e))||!(A(t,"bpmn:Participant")&&!Me(t))&&(A(e,"bpmn:Participant")?A(t,"bpmn:Process")||A(t,"bpmn:Collaboration"):we(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:A(e,"bpmn:Lane")?A(t,"bpmn:Participant")||A(t,"bpmn:Lane"):!(A(e,"bpmn:BoundaryEvent")&&!function(i){return te(i).cancelActivity&&(my(i)||fy(i))}(e))&&(A(e,"bpmn:FlowElement")&&!A(e,"bpmn:DataStoreReference")?A(t,"bpmn:FlowElementsContainer")?Me(t):we(t,["bpmn:Participant","bpmn:Lane"]):A(e,"bpmn:DataStoreReference")&&A(t,"bpmn:Collaboration")?si(te(t).get("participants"),function(i){return!!i.get("processRef")}):we(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?we(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!A(e,"bpmn:MessageFlow")&&(A(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)))}function q_(e){return A(e,"bpmn:Lane")}function W_(e){return!!function(t){return!bt(t)&&A(t,"bpmn:BoundaryEvent")}(e)||!(!A(e,"bpmn:IntermediateThrowEvent")||!my(e))||A(e,"bpmn:IntermediateCatchEvent")&&fy(e)}function my(e){var t=te(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function fy(e){return vy(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function vy(e,t){return t.some(function(n){return Bn(e,n)})}function ea(e,t,n,i){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var r=e[0];return!bt(r)&&!!W_(r)&&!It(t)&&!(!A(t,"bpmn:Activity")||Gr(t))&&!(i&&!ly(i,t))&&!function(o){return A(o,"bpmn:ReceiveTask")&&Pe(o.incoming,function(a){return A(a.source,"bpmn:EventBasedGateway")})}(t)&&"attach"}function yy(e,t,n){if(!t)return!1;var i={replacements:[]};return L(e,function(r){It(t)||A(r,"bpmn:StartEvent")&&r.type!=="label"&&Ur(r,t)&&(function(o){return o&&te(o).isInterrupting!==!1}(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(function(o){return rs(o,"bpmn:ErrorEventDefinition")}(r)||function(o){return rs(o,"bpmn:EscalationEventDefinition")}(r)||function(o){return rs(o,"bpmn:CompensateEventDefinition")}(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),vy(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&A(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),A(t,"bpmn:Transaction")||Bn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(A(r,"bpmn:EndEvent")&&Ur(r,t)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),A(r,"bpmn:BoundaryEvent")&&ea(r,t,0,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),!!i.replacements.length&&i}function gy(e,t){return!si(e,q_)&&(!t||e.every(function(n){return Ur(n,t)}))}function fp(e,t,n,i){return!!t&&(!(!bt(e)&&!hp(e))||n!==t&&(!n||!mp(n,t))&&(Ur(e,t)||Qs(e,t)))}function by(e,t){return A(e,"bpmn:SubProcess")?Me(e)&&(!t||t.width>=100&&t.height>=80):A(e,"bpmn:Lane")?!t||t.width>=130&&t.height>=60:A(e,"bpmn:Participant")?!t||t.width>=250&&t.height>=50:!!pp(e)||!!hp(e)}function xy(e,t){return!Js(e)&&!Js(t)&&(!(!dp(e)||!Gr(t))||!mp(t,e)&&!mp(e,t)&&(!!function(n,i){var r=pp(n),o=pp(i);return(r||o)&&r!==o}(e,t)||!!vp(e,t)))}function Ey(e,t){return!(Sy(e)&&!Sy(t))&&A(i=e,"bpmn:InteractionNode")&&!A(i,"bpmn:BoundaryEvent")&&(!A(i,"bpmn:Event")||A(i,"bpmn:ThrowEvent")&&hy(i,"bpmn:MessageEventDefinition"))&&function(r){return A(r,"bpmn:InteractionNode")&&!Gr(r)&&(!A(r,"bpmn:Event")||A(r,"bpmn:CatchEvent")&&hy(r,"bpmn:MessageEventDefinition"))&&!(A(r,"bpmn:BoundaryEvent")&&!Bn(r,"bpmn:MessageEventDefinition"))}(t)&&(n=t,uy(e)!==uy(n));var n,i}function _y(e,t){return!(dy(t)&&t.incoming.length>0&&(n=t.incoming,(n=n||[]).some(X_))&&!A(e,"bpmn:EventBasedGateway"))&&A(r=e,"bpmn:FlowNode")&&!A(r,"bpmn:EndEvent")&&!It(r)&&!(A(r,"bpmn:IntermediateThrowEvent")&&Bn(r,"bpmn:LinkEventDefinition"))&&!dp(r)&&!Gr(r)&&function(o){return A(o,"bpmn:FlowNode")&&!A(o,"bpmn:StartEvent")&&!A(o,"bpmn:BoundaryEvent")&&!It(o)&&!(A(o,"bpmn:IntermediateCatchEvent")&&Bn(o,"bpmn:LinkEventDefinition"))&&!Gr(o)}(t)&&(i=t,py(e)===py(i))&&!(A(e,"bpmn:EventBasedGateway")&&!dy(t));var n,i,r}function vp(e,t){return we(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&we(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!we(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!we(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Qs(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(e.length!==1)return!1;e=e[0]}return t.source!==e&&t.target!==e&&we(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!bt(t)&&A(e,"bpmn:FlowNode")&&!A(e,"bpmn:BoundaryEvent")&&Ur(e,t.parent)}function wy(e,t){return!!bt(t)||!(A(t,"bpmn:Lane")&&!function(n,i){return n&&i&&n.indexOf(i)!==-1}(e,t.parent))}function X_(e){if(e&&e.source)return A(e.source,"bpmn:EventBasedGateway")}function Sy(e){return fs(e,"bpmn:Process")||fs(e,"bpmn:Collaboration")}ie(xt,bi),xt.$inject=["eventBus"],xt.prototype.init=function(){this.addRule("connection.start",function(e){return function(t){return up(t)?null:we(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}(e.source)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return Zs(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection;return Zs(e.source,e.target,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){return by(e.shape,e.newBounds)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return!(Js(i)&&!Qs(t,i))&&ji(t,function(r){return Js(r)?Zs(r.source,r.target,r):r.host?ea(r,r.host,null,n):fp(r,i,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position;return ea(n,t,null,i)||yy(n,t,i)||gy(n,t)||Qs(n,t)}),this.addRule("shape.create",function(e){return fp(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return ea(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element;return wy(e.elements,t)})},xt.prototype.canConnectMessageFlow=Ey,xt.prototype.canConnectSequenceFlow=_y,xt.prototype.canConnectDataAssociation=vp,xt.prototype.canConnectAssociation=xy,xt.prototype.canMove=gy,xt.prototype.canAttach=ea,xt.prototype.canReplace=yy,xt.prototype.canDrop=Ur,xt.prototype.canInsert=Qs,xt.prototype.canCreate=fp,xt.prototype.canConnect=Zs,xt.prototype.canResize=by,xt.prototype.canCopy=wy;const K_={__depends__:[Dn],__init__:["bpmnRules"],bpmnRules:["type",xt]};function Cy(e,t){e.on("saveXML.start",2e3,function(){var n,i,r=t.getRootElement(),o=te(r).di;n=de(n=Fa([r],!1),function(a){return a!==r&&!a.labelTarget}),i=lt(n,Mr),o.set("planeElement",i)})}Cy.$inject=["eventBus","canvas"];const Y_={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Cy]};function ec(e){Q.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=t.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=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}function yp(e,t,n){ec.call(this,e);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:3,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:Process"]}},{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:Process"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(o){var a=o.order;if(a||(o.order=a=function(c){if(c.labelTarget)return{level:10};var l=Pe(i,function(u){return we(c,[u.type])});return l&&l.order||{level:1}}(o)),!a)throw new Error("no order for <"+o.id+">");return a}this.getOrdering=function(o,a){if(o.labelTarget)return{parent:t.getRootElement(),index:-1};var c=r(o);c.containers&&(a=function(p,d,y){for(var f=d;f&&!we(f,y);)f=f.parent;if(!f)throw new Error("no parent for <"+p.id+"> in <"+(d&&d.id)+">");return f}(o,a,c.containers));var l=a.children.indexOf(o),u=hl(a.children,function(p){return!(!o.labelTarget&&p.labelTarget)&&c.level<r(p).level});return u!==-1&&l!==-1&&l<u&&(u-=1),{index:u,parent:a}}}ec.prototype.getOrdering=function(e,t){return null},ie(ec,Q),yp.$inject=["eventBus","canvas","translate"],ie(yp,ec);const J_={__depends__:[as],__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",yp]};function qe(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}qe.$inject=["eventBus","injector"],qe.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";var n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction(n)},qe.prototype.canExecute=function(e,t){var n={command:e,context:t},i=this._getHandler(e),r=this._fire(e,"canExecute",n);if(r===void 0){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},qe.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},qe.prototype.undo=function(){var e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),(e=this._getUndoAction())&&e.id===t.id);)t=e;this._popAction()}},qe.prototype.redo=function(){var e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),(e=this._getRedoAction())&&e.id===t.id);)t=e;this._popAction()}},qe.prototype.register=function(e,t){this._setHandler(e,t)},qe.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");var n=this._injector.instantiate(t);this.register(e,n)},qe.prototype.canUndo=function(){return!!this._getUndoAction()},qe.prototype.canRedo=function(){return!!this._getRedoAction()},qe.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},qe.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},qe.prototype._internalUndo=function(e){var t=this,n=e.command,i=e.context,r=this._getHandler(n);this._atomicDo(function(){t._fire(n,"revert",e),r.revert&&t._markDirty(r.revert(i)),t._revertedAction(e),t._fire(n,"reverted",e)})},qe.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);var i,r,o,a=t?[e+"."+t,t]:[e];for(n=this._eventBus.createEvent(n),i=0;(r=a[i])&&(o=this._eventBus.fire("commandStack."+r,n),!n.cancelBubble);i++);return o},qe.prototype._createId=function(){return this._uid++},qe.prototype._atomicDo=function(e){var t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},qe.prototype._internalExecute=function(e,t){var n=this,i=e.command,r=e.context,o=this._getHandler(i);if(!o)throw new Error("no command handler registered for <"+i+">");this._pushAction(e),t||(this._fire(i,"preExecute",e),o.preExecute&&o.preExecute(r),this._fire(i,"preExecuted",e)),this._atomicDo(function(){n._fire(i,"execute",e),o.execute&&n._markDirty(o.execute(r)),n._executedAction(e,t),n._fire(i,"executed",e)}),t||(this._fire(i,"postExecute",e),o.postExecute&&o.postExecute(r),this._fire(i,"postExecuted",e)),this._popAction(e)},qe.prototype._pushAction=function(e){var t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},qe.prototype._popAction=function(){var e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:dl("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},qe.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=ge(e)?e:[e],t.dirty=t.dirty.concat(e))},qe.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},qe.prototype._revertedAction=function(e){this._stackIdx--},qe.prototype._getHandler=function(e){return this._handlerMap[e]},qe.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const Z_={commandStack:["type",qe]};var Q_=new tu("tt");function gp(e,t){e.style.display=t===!1?"none":""}var Ty="djs-tooltip",bp="."+Ty;function Pt(e,t){var n,i;this._eventBus=e,this._canvas=t,this._ids=Q_,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=t.getContainer(),i=je('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />'),n.insertBefore(i,n.firstChild),i);var r=this;Gt.bind(this._tooltipRoot,bp,"mousedown",function(o){o.stopPropagation()}),Gt.bind(this._tooltipRoot,bp,"mouseover",function(o){r.trigger("mouseover",o)}),Gt.bind(this._tooltipRoot,bp,"mouseout",function(o){r.trigger("mouseout",o)}),this._init()}Pt.$inject=["eventBus","canvas"],Pt.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=z({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},Pt.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get($t(n,"data-tooltip-id"));i&&(e==="mouseover"&&i.timeout&&this.clearTimeout(i),e==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},Pt.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},Pt.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},Pt.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},Pt.prototype.remove=function(e){var t=this.get(e);t&&(An(t.html),An(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},Pt.prototype.show=function(){gp(this._tooltipRoot)},Pt.prototype.hide=function(){gp(this._tooltipRoot,!1)},Pt.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},Pt.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Dt(i)&&(i=je(i)),(t=je('<div data-tooltip-id="'+n+'" class="'+Ty+'" style="position: absolute">')).appendChild(i),e.type&&ot(t).add("djs-tooltip-"+e.type),e.className&&ot(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},Pt.prototype._updateTooltip=function(e){var t,n,i,r=e.position,o=e.htmlContainer;t=o,n=r.x,i=r.y,z(t.style,{left:n+"px",top:i+"px"})},Pt.prototype._updateTooltipVisibilty=function(e){L(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),gp(i,r))})},Pt.prototype._init=function(){var e=this;this._eventBus.on("canvas.viewbox.changing",function(t){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(t){var n;n=t.viewbox,e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()})};const ew={__init__:["tooltips"],tooltips:["type",Pt]};function Hr(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}function xp(e,t,n){Q.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,function(r){var o=r.context,a=o.shapes,c=o.validatedShapes;o.shapes=Ay(a),o.validatedShapes=Ay(c)}),i&&t.on("shape.move.start",250,function(r){var o=r.context,a=o.shapes,c=[];L(a,function(l){L(l.labels,function(u){u.hidden||o.shapes.indexOf(u)!==-1||c.push(u),l.labelTarget&&c.push(l)})}),L(c,function(l){i.makeDraggable(o,l,!0)})}),this.preExecuted("elements.move",1400,function(r){var o=r.context.closure,a=o.enclosedElements,c=[];L(a,function(l){L(l.labels,function(u){a[u.id]||c.push(u)})}),o.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(r){var o=r.context;Hr((o.connection||o.shape).labels,function(a){n.removeShape(a,{nested:!0})})}),this.execute("shape.delete",function(r){var o=r.context,a=o.shape,c=a.labelTarget;c&&(o.labelTargetIndex=Dl(c.labels,a),o.labelTarget=c,a.labelTarget=null)}),this.revert("shape.delete",function(r){var o=r.context,a=o.shape,c=o.labelTarget,l=o.labelTargetIndex;c&&(Je(c.labels,a,l),a.labelTarget=c)})}function Ay(e){return de(e,function(t){return e.indexOf(t.labelTarget)===-1})}ie(xp,Q),xp.$inject=["injector","eventBus","modeling"];const tw={__init__:["labelSupport"],labelSupport:["type",xp]};var ky="attach-ok";function Ep(e,t,n,i,r){Q.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",1401,function(a){var c,l,u=a.context,p=u.shapes,d=u.validatedShapes;u.shapes=(l=_p(c=p),Jh("id",c,l)),u.validatedShapes=function(y){var f=Vi(y,"id");return de(y,function(v){for(;v;){if(v.host&&f[v.host.id])return!1;v=v.parent}return!0})}(d)}),o&&t.on("shape.move.start",251,function(a){var c=a.context;L(_p(c.shapes),function(l){o.makeDraggable(c,l,!0),L(l.labels,function(u){o.makeDraggable(c,u,!0)})})}),o&&t.on("shape.move.start",function(a){var c=a.context.shapes;if(c.length===1){var l=c[0].host;l&&(n.addMarker(l,ky),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(l,ky)}))}}),this.preExecuted("elements.move",1401,function(a){var c=a.context,l=c.closure;L(_p(c.shapes),function(u){l.add(u,l.topLevel[u.host.id])})}),this.postExecuted("elements.move",function(a){var c=a.context,l=c.shapes,u=c.newHost;u&&l.length!==1||L(u?l:de(l,function(p){var d,y=p.host;return function(f){return!!f.host}(p)&&(d=y,l.indexOf(d)===-1)}),function(p){r.updateAttachment(p,u)})}),this.postExecuted("elements.move",function(a){L(a.context.shapes,function(c){L(c.attachers,function(l){L(l.outgoing.slice(),function(u){i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target})||r.removeConnection(u)}),L(l.incoming.slice(),function(u){i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target})||r.removeConnection(u)})})})}),this.postExecute("shape.create",function(a){var c=a.context,l=c.shape,u=c.host;u&&r.updateAttachment(l,u)}),this.postExecute("shape.replace",function(a){var c=a.context,l=c.oldShape,u=c.newShape;Hr(l.attachers,function(p){i.allowed("elements.move",{target:u,shapes:[p]})==="attach"?r.updateAttachment(p,u):r.removeShape(p)}),u.attachers.length&&L(u.attachers,function(p){var d=Yv(p,l,u);r.moveShape(p,d,p.parent)})}),this.postExecute("shape.resize",function(a){var c=a.context,l=c.shape,u=c.oldBounds,p=c.newBounds,d=l.attachers;(c.hints||{}).attachSupport!==!1&&L(d,function(y){var f=Yv(y,u,p);r.moveShape(y,f,y.parent),L(y.labels,function(v){r.moveShape(v,f,v.parent)})})}),this.preExecute("shape.delete",function(a){var c=a.context.shape;Hr(c.attachers,function(l){r.removeShape(l)}),c.host&&r.updateAttachment(c,null)})}function _p(e){return fo(lt(e,function(t){return t.attachers||[]}))}ie(Ep,Q),Ep.$inject=["injector","eventBus","canvas","rules","modeling"];const nw={__depends__:[Dn],__init__:["attachSupport"],attachSupport:["type",Ep]};function Qi(e,t){this._eventBus=e,this._dragging=t,this._tools=[],this._active=null}Qi.$inject=["eventBus","dragging"],Qi.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);n.push(e),this.bindEvents(e,t)},Qi.prototype.isActive=function(e){return e&&this._active===e},Qi.prototype.length=function(e){return this._tools.length},Qi.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},Qi.prototype.bindEvents=function(e,t){var n=this._eventBus,i=this._dragging,r=[];n.on(t.tool+".init",function(o){if(!o.context.reactivate&&this.isActive(e))return this.setActive(null),void i.cancel();this.setActive(e)},this),L(t,function(o){r.push(o+".ended"),r.push(o+".canceled")}),n.on(r,250,function(o){this._active&&(function(a){var c=a.originalEvent&&a.originalEvent.target;return c&&Fi(c,'.group[data-group="tools"]')}(o)||this.setActive(null))},this)};const tc={__depends__:[Xn],__init__:["toolManager"],toolManager:["type",Qi]};function ta(e,t){return e.indexOf(t)!==-1}var wp=Math.abs,iw=Math.round,Jn={x:"width",y:"height"},Py="crosshair",nc={n:"top",w:"left",s:"bottom",e:"right"},My={n:"s",w:"e",s:"n",e:"w"},ic=20;function Zn(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var c=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(l){n.once("spaceTool.selection.ended",function(){c.activateMakeSpace(l.originalEvent)})}),n.on("spaceTool.move",1500,function(l){var u=l.context,p=u.initialized;p||(p=u.initialized=c.init(l,u)),p&&Ny(l)}),n.on("spaceTool.end",function(l){var u=l.context,p=u.axis,d=u.direction,y=u.movingShapes,f=u.resizingShapes,v=u.start;if(u.initialized){Ny(l);var g={x:0,y:0};g[p]=iw(l["d"+p]),c.makeSpace(y,f,g,d,v),n.once("spaceTool.ended",function(b){c.activateSelection(b.originalEvent,!0,!0)})}})}function Ry(e){return{top:e.top-ic,right:e.right+ic,bottom:e.bottom+ic,left:e.left-ic}}function Ny(e){var t,n,i=e.context.spaceToolConstraints;i&&(pe(i.left)&&(t=Math.max(e.x,i.left),e.dx=e.dx+t-e.x,e.x=t),pe(i.right)&&(t=Math.min(e.x,i.right),e.dx=e.dx+t-e.x,e.x=t),pe(i.top)&&(n=Math.max(e.y,i.top),e.dy=e.dy+n-e.y,e.y=n),pe(i.bottom)&&(n=Math.min(e.y,i.bottom),e.dy=e.dy+n-e.y,e.y=n))}function Sp(e,t){return e.indexOf(t)!==-1}function Cp(e){return!!e.waypoints}function Iy(e){return!!e.labelTarget}Zn.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Zn.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:Py,data:{context:{reactivate:n}},trapClick:!1})},Zn.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:Py,data:{context:{}}})},Zn.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},Zn.prototype.init=function(e,t){var n=wp(e.dx)>wp(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(wp(i)<5)return!1;i<0&&(i*=-1),Dr(e)&&(i*=-1);var o=function(u,p){if(u==="x"){if(p>0)return"e";if(p<0)return"w"}if(u==="y"){if(p>0)return"s";if(p<0)return"n"}return null}(n,i),a=Fa(this._canvas.getRootElement(),!0),c=this.calculateAdjustments(a,n,i,r),l=function(u,p,d,y,f){var v=u.movingShapes,g=u.resizingShapes;if(g.length){var b,S,w={};return L(g,function(_){var C,B,s,h=ae(_),m=de(_.children,function(M){return!(Cp(M)||Iy(M)||Sp(v,M)||Sp(g,M))}),E=de(_.children,function(M){return!Cp(M)&&!Iy(M)&&Sp(v,M)});m.length&&(B=Ry(ae(vt(m))),C=y-h[nc[d]]+B[nc[d]],d==="n"?w.bottom=S=pe(S)?Math.min(S,C):C:d==="w"?w.right=S=pe(S)?Math.min(S,C):C:d==="s"?w.top=b=pe(b)?Math.max(b,C):C:d==="e"&&(w.left=b=pe(b)?Math.max(b,C):C)),E.length&&(s=Ry(ae(vt(E))),C=y-s[nc[My[d]]]+h[nc[My[d]]],d==="n"?w.bottom=S=pe(S)?Math.min(S,C):C:d==="w"?w.right=S=pe(S)?Math.min(S,C):C:d==="s"?w.top=b=pe(b)?Math.max(b,C):C:d==="e"&&(w.left=b=pe(b)?Math.max(b,C):C));var T=f&&f[_.id];T&&(d==="n"?(C=y+_[Jn[p]]-T[Jn[p]],w.bottom=S=pe(S)?Math.min(S,C):C):d==="w"?(C=y+_[Jn[p]]-T[Jn[p]],w.right=S=pe(S)?Math.min(S,C):C):d==="s"?(C=y-_[Jn[p]]+T[Jn[p]],w.top=b=pe(b)?Math.max(b,C):C):d==="e"&&(C=y-_[Jn[p]]+T[Jn[p]],w.left=b=pe(b)?Math.max(b,C):C))}),w}}(c,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}));return z(t,c,{axis:n,direction:o,spaceToolConstraints:l,start:r}),ds("resize-"+(n==="x"?"ew":"ns")),!0},Zn.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[];return L(e,function(c){if(c.parent&&!Cp(c)){var l=c[t],u=l+c[Jn[t]];return n>0&&l>i||n<0&&u<i?o.push(c):l<i&&u>i&&r.allowed("shape.resize",{shape:c})?a.push(c):void 0}}),{movingShapes:o,resizingShapes:a}},Zn.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Zn.prototype.isActive=function(){var e=this._dragging.context();return e&&/^spaceTool/.test(e.prefix)};var Tp="djs-dragging",Dy="djs-resizing",rc=Math.max;function By(e,t,n,i,r){function o(a,c){L(a,function(l){r.addDragger(l,c),n.addMarker(l,Tp)})}e.on("spaceTool.selection.start",function(a){var c=n.getLayer("space"),l=a.context,u="M 0,-10000 L 0,10000",p="M -10000,0 L 10000,0",d=oe("g");K(d,i.cls("djs-crosshair-group",["no-events"])),le(c,d);var y=oe("path");K(y,"d",u),be(y).add("djs-crosshair"),le(d,y);var f=oe("path");K(f,"d",p),be(f).add("djs-crosshair"),le(d,f),l.crosshairGroup=d}),e.on("spaceTool.selection.move",function(a){Lt(a.context.crosshairGroup,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var c=a.context.crosshairGroup;c&&tt(c)}),e.on("spaceTool.move",250,function(a){var c=a.context,l=c.line,u=c.axis,p=c.movingShapes,d=c.resizingShapes;if(c.initialized){if(!c.dragGroup){var y=n.getLayer("space");K(l=oe("path"),"d","M0,0 L0,0"),be(l).add("djs-crosshair"),le(y,l),c.line=l;var f=oe("g");K(f,i.cls("djs-drag-group",["no-events"])),le(n.getActiveLayer(),f),o(p,f),o(c.movingConnections=t.filter(function(S){var w=!1;L(p,function(s){L(s.outgoing,function(h){S===h&&(w=!0)})});var _=!1;L(p,function(s){L(s.incoming,function(h){S===h&&(_=!0)})});var C=!1;L(d,function(s){L(s.outgoing,function(h){S===h&&(C=!0)})});var B=!1;return L(d,function(s){L(s.incoming,function(h){S===h&&(B=!0)})}),function(s){return s.waypoints}(S)&&(w||C)&&(_||B)}),f),c.dragGroup=f}if(!c.frameGroup){var v=oe("g");K(v,i.cls("djs-frame-group",["no-events"])),le(n.getActiveLayer(),v);var g=[];L(d,function(S){var w=r.addFrame(S,v),_=w.getBBox();g.push({element:w,initialBounds:_}),n.addMarker(S,Dy)}),c.frameGroup=v,c.frames=g}K(l,{d:{x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y}[u]});var b={x:a.dx,y:a.dy};b[{x:"y",y:"x"}[c.axis]]=0,Lt(c.dragGroup,b.x,b.y),L(c.frames,function(S){var w,_,C=S.element,B=S.initialBounds;c.direction==="e"?K(C,{width:rc(B.width+b.x,5)}):K(C,{width:w=rc(B.width-b.x,5),x:B.x+B.width-w}),c.direction==="s"?K(C,{height:rc(B.height+b.y,5)}):K(C,{height:_=rc(B.height-b.y,5),y:B.y+B.height-_})})}}),e.on("spaceTool.cleanup",function(a){var c=a.context,l=c.movingShapes,u=c.movingConnections,p=c.resizingShapes,d=c.line,y=c.dragGroup,f=c.frameGroup;L(l,function(v){n.removeMarker(v,Tp)}),L(u,function(v){n.removeMarker(v,Tp)}),y&&(tt(d),tt(y)),L(p,function(v){n.removeMarker(v,Dy)}),f&&tt(f)})}By.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const Oy={__init__:["spaceToolPreview"],__depends__:[Xn,Dn,tc,zo,Uo],spaceTool:["type",Zn],spaceToolPreview:["type",By]};function on(e){this._model=e}function Vt(e,t,n,i){Q.call(this,e),this._bpmnFactory=t,this._translate=i;var r=this;function o(p){L(p.context.oldRoot.children,function(d){A(d,"bpmn:BaseElement")&&r.updateParent(d)})}function a(p){var d=p.context.shape;A(d,"bpmn:BaseElement")&&r.updateBounds(d)}function c(p){r.updateConnection(p.context)}function l(p){r.updateConnectionWaypoints(p.context.connection)}function u(p){r.updateAttachment(p.context)}this.executed(["connection.layout","connection.create"],function(p){var d,y=p.context,f=y.hints||{};y.cropped||f.createElementsBehavior===!1||((d=y.connection).waypoints=n.getCroppedWaypoints(d),y.cropped=!0)}),this.reverted(["connection.layout"],function(p){delete p.context.cropped}),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],an(function(p){var d=p.context;r.updateParent(d.shape||d.connection,d.oldParent)})),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],an(function(p){var d=p.context,y=d.shape||d.connection,f=d.parent||d.newParent;r.updateParent(y,f)})),this.executed(["canvas.updateRoot"],o),this.reverted(["canvas.updateRoot"],o),this.executed(["shape.move","shape.create","shape.resize"],an(function(p){p.context.shape.type!=="label"&&a(p)})),this.reverted(["shape.move","shape.create","shape.resize"],an(function(p){p.context.shape.type!=="label"&&a(p)})),e.on("shape.changed",function(p){p.element.type==="label"&&a({context:{shape:p.element}})}),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],an(c)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],an(c)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],an(l)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],an(l)),this.executed("connection.reconnect",an(function(p){var d=p.context,y=d.connection,f=d.oldSource,v=d.newSource,g=te(y),b=te(f),S=te(v);g.conditionExpression&&!we(S,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(d.oldConditionExpression=g.conditionExpression,delete g.conditionExpression),f!==v&&b.default===g&&(d.oldDefault=b.default,delete b.default)})),this.reverted("connection.reconnect",an(function(p){var d=p.context,y=d.connection,f=d.oldSource,v=d.newSource,g=te(y),b=te(f),S=te(v);d.oldConditionExpression&&(g.conditionExpression=d.oldConditionExpression),d.oldDefault&&(b.default=d.oldDefault,delete S.default)})),this.executed(["element.updateAttachment"],an(u)),this.reverted(["element.updateAttachment"],an(u))}function an(e){return function(t){var n=t.context;A(n.shape||n.connection,"bpmn:BaseElement")&&e(t)}}function _i(e,t,n){Gn.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function Ly(e,t,n){e[n]=t[n],delete t[n]}function oc(e,t){this._modeling=e,this._canvas=t}function ac(e){this._modeling=e}function sc(e,t){this._canvas=e,this._layouter=t}on.$inject=["moddle"],on.prototype._needsId=function(e){return we(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},on.prototype._ensureId=function(e){var t;t=A(e,"bpmn:Activity")?"Activity":A(e,"bpmn:Event")?"Event":A(e,"bpmn:Gateway")?"Gateway":we(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},on.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},on.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},on.prototype.createDiShape=function(e,t,n){return this.create("bpmndi:BPMNShape",z({bpmnElement:e,bounds:this.createDiBounds(t)},n))},on.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},on.prototype.createDiWaypoints=function(e){var t=this;return lt(e,function(n){return t.createDiWaypoint(n)})},on.prototype.createDiWaypoint=function(e){return this.create("dc:Point",Yt(e,["x","y"]))},on.prototype.createDiEdge=function(e,t,n){return this.create("bpmndi:BPMNEdge",z({bpmnElement:e,waypoint:this.createDiWaypoints(t)},n))},on.prototype.createDiPlane=function(e){return this.create("bpmndi:BPMNPlane",{bpmnElement:e})},ie(Vt,Q),Vt.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Vt.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Vt.prototype.updateParent=function(e,t){if(!(e instanceof Xa||A(e,"bpmn:DataStoreReference")&&e.parent&&A(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=n&&n.businessObject,o=r&&r.di;A(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,r,t&&t.businessObject),A(e,"bpmn:DataOutputAssociation")&&(r=e.source?e.source.businessObject:null),A(e,"bpmn:DataInputAssociation")&&(r=e.target?e.target.businessObject:null),this.updateSemanticParent(i,r),A(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,r),this.updateDiParent(i.di,o)}},Vt.prototype.updateBounds=function(e){var t=e.businessObject.di,n=e instanceof Xa?this._getLabel(t):t,i=n.bounds;i||(i=this._bpmnFactory.createDiBounds(),n.set("bounds",i)),z(i,{x:e.x,y:e.y,width:e.width,height:e.height})},Vt.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(A(n,"bpmn:Lane")&&Ye(n.get("flowNodeRef"),e),A(t,"bpmn:Lane")&&Je(t.get("flowNodeRef"),e))},Vt.prototype.updateDiConnection=function(e,t,n){e.sourceElement&&e.sourceElement.bpmnElement!==t&&(e.sourceElement=t&&t.di),e.targetElement&&e.targetElement.bpmnElement!==n&&(e.targetElement=n&&n.di)},Vt.prototype.updateDiParent=function(e,t){if(t&&!A(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(Ye(n,e),e.$parent=null)}},Vt.prototype.getLaneSet=function(e){var t,n;return A(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(A(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},Vt.prototype.updateSemanticParent=function(e,t,n){var i,r=this._translate;if(e.$parent!==t&&(!A(e,"bpmn:DataInput")&&!A(e,"bpmn:DataOutput")||(A(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(A(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(A(e,"bpmn:FlowElement")){if(t){if(A(t,"bpmn:Participant"))t=t.processRef;else if(A(t,"bpmn:Lane"))do t=t.$parent.$parent;while(A(t,"bpmn:Lane"))}i="flowElements"}else if(A(e,"bpmn:Artifact")){for(;t&&!A(t,"bpmn:Process")&&!A(t,"bpmn:SubProcess")&&!A(t,"bpmn:Collaboration");){if(A(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(A(e,"bpmn:MessageFlow"))i="messageFlows";else if(A(e,"bpmn:Participant")){i="participants";var o,a=e.processRef;a&&(o=function(u){for(;u&&!A(u,"bpmn:Definitions");)u=u.$parent;return u}(e.$parent||t),e.$parent&&(Ye(o.get("rootElements"),a),a.$parent=null),t&&(Je(o.get("rootElements"),a),a.$parent=o))}else A(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":A(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:e.id,parent:t.id}));var c;if(e.$parent&&Ye(c=e.$parent.get(i),e),t?((c=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var l=n.get(i);Ye(c,e),t&&(l||(l=[],t.set(i,l)),l.push(e))}}},Vt.prototype.updateConnectionWaypoints=function(e){e.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Vt.prototype.updateConnection=function(e){var t,n=e.connection,i=te(n),r=te(n.source),o=te(n.target);if(A(i,"bpmn:DataAssociation"))A(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=r,t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t)):A(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||r,this.updateSemanticParent(i,r,t),i.targetRef=o);else{var a=A(i,"bpmn:SequenceFlow");i.sourceRef!==r&&(a&&(Ye(i.sourceRef&&i.sourceRef.get("outgoing"),i),r&&r.get("outgoing")&&r.get("outgoing").push(i)),i.sourceRef=r),i.targetRef!==o&&(a&&(Ye(i.targetRef&&i.targetRef.get("incoming"),i),o&&o.get("incoming")&&o.get("incoming").push(i)),i.targetRef=o)}this.updateConnectionWaypoints(n),this.updateDiConnection(i.di,r,o)},Vt.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},ie(_i,Gn),_i.$inject=["bpmnFactory","moddle","translate"],_i.prototype.baseCreate=Gn.prototype.create,_i.prototype.create=function(e,t){return e==="label"?this.baseCreate(e,z({type:"label"},No,t)):this.createBpmnElement(e,t)},_i.prototype.createBpmnElement=function(e,t){var n,i,r,o=this._translate,a=(t=t||{}).businessObject;if(!a){if(!t.type)throw new Error(o("no shape type specified"));a=this._bpmnFactory.create(t.type)}return a.di||(a.di=e==="root"?this._bpmnFactory.createDiPlane(a,[],{id:a.id+"_di"}):e==="connection"?this._bpmnFactory.createDiEdge(a,[],{id:a.id+"_di"}):this._bpmnFactory.createDiShape(a,{},{id:a.id+"_di"})),A(a,"bpmn:Group")&&(t=z({isFrame:!0},t)),t.di&&(z(a.di,t.di),delete t.di),function(c,l,u){L(u,function(p){l[p]!==void 0&&Ly(c,l,p)})}(a,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&Ly(a.di,t,"isExpanded"),A(a,"bpmn:ExclusiveGateway")&&(a.di.isMarkerVisible=!0),t.eventDefinitionType&&(i=a.get("eventDefinitions")||[],r=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=a,a.eventDefinitions=i,delete t.eventDefinitionType),n=this._getDefaultSize(a),t=z({businessObject:a,id:a.id},n,t),this.baseCreate(e,t)},_i.prototype._getDefaultSize=function(e){return A(e,"bpmn:SubProcess")?Me(e)?{width:350,height:200}:{width:100,height:80}:A(e,"bpmn:Task")?{width:100,height:80}:A(e,"bpmn:Gateway")?{width:50,height:50}:A(e,"bpmn:Event")?{width:36,height:36}:A(e,"bpmn:Participant")?Me(e)?{width:600,height:250}:{width:400,height:60}:A(e,"bpmn:Lane")?{width:400,height:100}:A(e,"bpmn:DataObjectReference")?{width:36,height:50}:A(e,"bpmn:DataStoreReference")?{width:50,height:50}:A(e,"bpmn:TextAnnotation")?{width:100,height:30}:A(e,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},_i.prototype.createParticipantShape=function(e){return et(e)||(e={isExpanded:e}),(e=z({type:"bpmn:Participant"},e||{})).isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},oc.$inject=["modeling","canvas"],oc.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;L(n,function(r){var o={x:0,y:0};i.left?o.x=i.left-r.x:i.right?o.x=i.right-r.width-r.x:i.center?o.x=i.center-Math.round(r.width/2)-r.x:i.top?o.y=i.top-r.y:i.bottom?o.y=i.bottom-r.height-r.y:i.middle&&(o.y=i.middle-Math.round(r.height/2)-r.y),t.moveElements([r],o,r.parent)})},oc.prototype.postExecute=function(e){},ac.$inject=["modeling"],ac.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},ac.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,si(t.outgoing,function(r){return r.target===n})||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},sc.$inject=["canvas","layouter"],sc.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},sc.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var cc=Math.round;function Ap(e){this._modeling=e}function jy(e){return!!e.waypoints}Ap.$inject=["modeling"],Ap.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;L(t,function(p){pe(p.x)||(p.x=0),pe(p.y)||(p.y=0)});var c=vt(t);L(t,function(p){jy(p)&&(p.waypoints=lt(p.waypoints,function(d){return{x:cc(d.x-c.x-c.width/2+r.x),y:cc(d.y-c.y-c.height/2+r.y)}})),z(p,{x:cc(p.x-c.x-c.width/2+r.x),y:cc(p.y-c.y-c.height/2+r.y)})});var l=md(t),u={};L(t,function(p){if(jy(p))u[p.id]=pe(i)?a.createConnection(u[p.source.id],u[p.target.id],i,p,p.parent||n,o):a.createConnection(u[p.source.id],u[p.target.id],p,p.parent||n,o);else{var d=z({},o);l.indexOf(p)===-1&&(d.autoResize=!1),u[p.id]=pe(i)?a.createShape(p,Yt(p,["x","y","width","height"]),p.parent||n,i,d):a.createShape(p,Yt(p,["x","y","width","height"]),p.parent||n,d)}}),e.elements=Oa(u)};var Vy=Math.round;function wi(e){this._canvas=e}function na(e){wi.call(this,e)}wi.$inject=["canvas"],wi.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?z(t,n):z(t,{x:n.x-Vy(t.width/2),y:n.y-Vy(t.height/2)}),this._canvas.addShape(t,i,r),t},wi.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},ie(na,wi),na.$inject=["canvas"];var rw=wi.prototype.execute;na.prototype.execute=function(e){var t=e.shape;return function(n){["width","height"].forEach(function(i){n[i]===void 0&&(n[i]=0)})}(t),t.labelTarget=e.labelTarget,rw.call(this,e)};var ow=wi.prototype.revert;function lc(e,t){this._canvas=e,this._modeling=t}function kp(e,t){this._modeling=e,this._elementRegistry=t}function ia(e,t){this._canvas=e,this._modeling=t}function uc(e){this._modeling=e}na.prototype.revert=function(e){return e.shape.labelTarget=null,ow.call(this,e)},lc.$inject=["canvas","modeling"],lc.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Dl(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},lc.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,Je(n.children,t,i),this._canvas.addConnection(t,n),t},kp.$inject=["modeling","elementRegistry"],kp.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;L(e.elements,function(i){n.get(i.id)&&(i.waypoints?t.removeConnection(i):t.removeShape(i))})},ia.$inject=["canvas","modeling"],ia.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;Hr(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),Hr(n.outgoing,function(i){t.removeConnection(i,{nested:!0})}),Hr(n.children,function(i){i.waypoints?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},ia.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=Dl(i.children,n),t.removeShape(n),n},ia.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return Je(i.children,n,r),t.addShape(n,i),n},uc.$inject=["modeling"];var Fy={x:"y",y:"x"};function pc(e,t){this._layouter=e,this._canvas=t}function Pp(){}function Mp(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function ra(e){this._modeling=e}function hc(e){this._helper=new ra(e)}function er(e){this._modeling=e,this._helper=new ra(e)}function oa(e){this._modeling=e}function zy(e){return e.original||e}function Qn(e,t){this._modeling=e,this._rules=t}function aa(e){this._modeling=e}function Si(e){this._modeling=e}function $y(e){return z({},e)}function Gy(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function Uy(e,t,n){var i=Gy(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i]<t:void 0}function Ci(e,t){return e.indexOf(t)!==-1}function dc(e){this._modeling=e}function Hy(e){var t={};return L(e,function(n){t[n.id]=n.hidden,n.children&&(t=z({},t,Hy(n.children)))}),t}function qy(e,t){var n=[];return L(e,function(i){i.hidden=t,n=n.concat(i),i.children&&(n=n.concat(qy(i.children,i.collapsed||t)))}),n}function Wy(e,t){var n=[];return L(e,function(i){i.hidden=t[i.id],n=n.concat(i),i.children&&(n=n.concat(Wy(i.children,t)))}),n}function mc(e){this._modeling=e}function Xy(e,t){return Ye(e&&e.attachers,t)}function Ky(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),Je(i,t,n)}}function Rp(){}function Ne(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",function(){i.registerHandlers(n)})}function sa(e){this._elementRegistry=e}function Yy(e,t){L(t,function(n,i){e.set(i,n)})}uc.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(g,b){g.range.min=Math.min(b[i],g.range.min),g.range.max=Math.max(b[i]+b[r],g.range.max)}function a(g){return g[i]+g[r]/2}function c(g){return g.length-1}function l(g){return g.max-g.min}var u,p,d=n[0],y=c(n),f=n[y],v=0;L(n,function(g,b){var S,w,_;g.elements.length<2?b&&b!==n.length-1&&(o(g,g.elements[0]),v+=l(g.range)):(w=(S=Xt(g.elements,i))[0],b===y&&(w=S[c(S)]),_=a(w),g.range=null,L(S,function(C){(function(B,s){var h={y:0};h[i]=B-a(s),h[i]&&(h[Fy[i]]=0,t.moveElements([s],h,s.parent))})(_,C),g.range!==null?o(g,C):g.range={min:C[i],max:C[i]+C[r]}}),b&&b!==n.length-1&&(v+=l(g.range)))}),p=Math.abs(f.range.min-d.range.max),(u=Math.round((p-v)/(n.length-1)))<n.length-1||L(n,function(g,b){var S,w={};g!==d&&g!==f&&(S=n[b-1],g.range.max=0,L(g.elements,function(_,C){w[Fy[i]]=0,w[i]=S.range.max-_[i]+u,g.range.min!==_[i]&&(w[i]+=_[i]-g.range.min),w[i]&&t.moveElements([_],w,_.parent),g.range.max=Math.max(_[i]+_[r],C?g.range.max:0)}))})},uc.prototype.postExecute=function(e){},pc.$inject=["layouter","canvas"],pc.prototype.execute=function(e){var t=e.connection;return z(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},pc.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},Pp.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=Ye(o.children,t),Je(i.children,t,r),t.parent=i,L(t.waypoints,function(a){a.x+=n.x,a.y+=n.y,a.original&&(a.original.x+=n.x,a.original.y+=n.y)}),t},Pp.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return Ye(n.children,t),Je(i.children,t,r),t.parent=i,L(t.waypoints,function(a){a.x-=o.x,a.y-=o.y,a.original&&(a.original.x-=o.x,a.original.y-=o.y)}),t},Mp.prototype.add=function(e,t){return this.addAll([e],t)},Mp.prototype.addAll=function(e,t){var n=function(i,r,o){Vn(r)&&(r=!0),et(r)&&(o=r,r=!0);var a=Eo((o=o||{}).allShapes),c=Eo(o.allConnections),l=Eo(o.enclosedElements),u=Eo(o.enclosedConnections),p=Eo(o.topLevel,r&&Vi(i,function(y){return y.id}));function d(y){p[y.source.id]&&p[y.target.id]&&(p[y.id]=[y]),a[y.source.id]&&a[y.target.id]&&(u[y.id]=l[y.id]=y),c[y.id]=y}return zi(i,function(y){if(l[y.id]=y,!y.waypoints)return a[y.id]=y,L(y.incoming,d),L(y.outgoing,d),y.children;u[y.id]=c[y.id]=y}),{allShapes:a,allConnections:c,topLevel:p,enclosedConnections:u,enclosedElements:l}}(e,!!t,this);return z(this,n),this},ra.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},ra.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,c=e.allConnections,l=e.enclosedConnections,u=e.topLevel,p=!1;r&&r.parent===n&&(p=!0),L(a,function(d){o.moveShape(d,t,u[d.id]&&!p&&n,{recurse:!1,layout:!1})}),L(c,function(d){var y=!!a[d.source.id],f=!!a[d.target.id];l[d.id]&&y&&f?o.moveConnection(d,t,u[d.id]&&!p&&n):o.layoutConnection(d,{connectionStart:y&&Qu(d,d.source,t),connectionEnd:f&&ep(d,d.target,t)})})},ra.prototype.getClosure=function(e){return new Mp().addAll(e,!0)},hc.$inject=["modeling"],hc.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},hc.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},er.$inject=["modeling"],er.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldBounds=Yt(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=Ye(o.children,t),Je(i.children,t,r),z(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},er.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;i.layout!==!1&&(L(t.incoming,function(o){r.layoutConnection(o,{connectionEnd:ep(o,t,n)})}),L(t.outgoing,function(o){r.layoutConnection(o,{connectionStart:Qu(o,t,n)})})),i.recurse!==!1&&this.moveChildren(e)},er.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return Je(n.children,t,i),z(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},er.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},er.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},oa.$inject=["modeling"],oa.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return ge(r)&&(e.oldWaypoints=i.waypoints,i.waypoints=r),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},oa.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.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||zy(ge(r)?r[0]:r)),!i||n&&o.docking!=="target"||(a.connectionEnd=a.connectionEnd||zy(ge(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},oa.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,r=e.connection;return t&&(r.source=t),n&&(r.target=n),i&&(r.waypoints=i),r},Qn.$inject=["modeling","rules"],Qn.prototype.preExecute=function(e){var t,n=this,i=this._modeling,r=this._rules,o=e.oldShape,a=e.newData,c=e.hints||{};function l(v,g,b){return r.allowed("connection.reconnect",{connection:b,source:v,target:g})}var u,p={x:a.x,y:a.y},d={x:o.x,y:o.y,width:o.width,height:o.height};t=e.newShape=e.newShape||n.createShape(a,p,o.parent,c),o.host&&i.updateAttachment(t,o.host),c.moveChildren!==!1&&(u=o.children.slice(),i.moveElements(u,{x:0,y:0},t,c));var y=o.incoming.slice(),f=o.outgoing.slice();L(y,function(v){l(v.source,t,v)&&n.reconnectEnd(v,t,Hs(v,t,d),c)}),L(f,function(v){var g=v.target;l(t,g,v)&&n.reconnectStart(v,t,Us(v,t,d),c)})},Qn.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},Qn.prototype.execute=function(e){},Qn.prototype.revert=function(e){},Qn.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},Qn.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},Qn.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},aa.$inject=["modeling"],aa.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.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 e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},z(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},aa.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds;(e.hints||{}).layout!==!1&&(L(n.incoming,function(r){t.layoutConnection(r,{connectionEnd:Hs(r,n,i)})}),L(n.outgoing,function(r){t.layoutConnection(r,{connectionStart:Us(r,n,i)})}))},aa.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return z(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Si.$inject=["modeling"],Si.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,a={};this.moveShapes(i,t),L(r,function(c){a[c.id]=function(l){return{x:l.x,y:l.y,height:l.height,width:l.width}}(c)}),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(function(c,l){var u=[];return L(c.concat(l),function(p){var d=p.incoming,y=p.outgoing;L(d.concat(y),function(f){var v=f.source,g=f.target;(ta(c,v)||ta(c,g)||ta(l,v)||ta(l,g))&&(ta(u,f)||u.push(f))})}),u}(i,r),t,n,o,i,r,a)},Si.prototype.execute=function(){},Si.prototype.revert=function(){},Si.prototype.moveShapes=function(e,t){var n=this;L(e,function(i){n._modeling.moveShape(i,t,null,{autoResize:!1,layout:!1,recurse:!1})})},Si.prototype.resizeShapes=function(e,t,n){var i=this;L(e,function(r){var o=function(a,c,l){var u=a.x,p=a.y,d=a.width,y=a.height,f=l.x,v=l.y;switch(c){case"n":return{x:u,y:p+v,width:d,height:y-v};case"s":return{x:u,y:p,width:d,height:y+v};case"w":return{x:u+f,y:p,width:d-f,height:y};case"e":return{x:u,y:p,width:d+f,height:y};default:throw new Error("unknown direction: "+c)}}(r,n,t);i._modeling.resizeShape(r,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})},Si.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var c=this,l=r.concat(o);L(e,function(u){var p=u.source,d=u.target,y=function(g){return lt(g.waypoints,function(b){return(b=$y(b)).original&&(b.original=$y(b.original)),b})}(u),f=Gy(n),v={labelBehavior:!1};Ci(l,p)&&Ci(l,d)?(y=lt(y,function(g){return Uy(g,i,n)&&(g[f]=g[f]+t[f]),g.original&&Uy(g.original,i,n)&&(g.original[f]=g.original[f]+t[f]),g}),c._modeling.updateWaypoints(u,y,{labelBehavior:!1})):(Ci(l,p)||Ci(l,d))&&(Ci(r,p)?v.connectionStart=Qu(u,p,t):Ci(r,d)?v.connectionEnd=ep(u,d,t):Ci(o,p)?v.connectionStart=Us(u,p,a[p.id]):Ci(o,d)&&(v.connectionEnd=Hs(u,d,a[d.id])),c._modeling.layoutConnection(u,v))})},dc.$inject=["modeling"],dc.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=Hy(n),t.collapsed=!t.collapsed;var i=qy(n,t.collapsed);return[t].concat(i)},dc.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=Wy(t.children,n);return t.collapsed=!t.collapsed,[t].concat(i)},mc.$inject=["modeling"],mc.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=Xy(i,t),Ky(n,t),t.host=n,t},mc.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,Xy(n,t),Ky(i,t,r),t},Rp.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},Rp.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},Ne.$inject=["eventBus","elementFactory","commandStack"],Ne.prototype.getHandlers=function(){return{"shape.append":ac,"shape.create":wi,"shape.delete":ia,"shape.move":er,"shape.resize":aa,"shape.replace":Qn,"shape.toggleCollapse":dc,spaceTool:Si,"label.create":na,"connection.create":sc,"connection.delete":lc,"connection.move":Pp,"connection.layout":pc,"connection.updateWaypoints":Rp,"connection.reconnect":oa,"elements.create":Ap,"elements.move":hc,"elements.delete":kp,"elements.distribute":uc,"elements.align":oc,"element.updateAttachment":mc}},Ne.prototype.registerHandlers=function(e){L(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},Ne.prototype.moveShape=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},Ne.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},Ne.prototype.moveElements=function(e,t,n,i){var r,o=(i=i||{}).attach,a=n;o===!0?(r=n,a=n.parent):o===!1&&(r=null);var c={shapes:e,delta:t,newParent:a,newHost:r,hints:i};this._commandStack.execute("elements.move",c)},Ne.prototype.moveConnection=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},Ne.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},Ne.prototype.createConnection=function(e,t,n,i,r,o){typeof n=="object"&&(o=r,r=i,i=n,n=void 0);var a={source:e,target:t,parent:r,parentIndex:n,connection:i=this._create("connection",i),hints:o};return this._commandStack.execute("connection.create",a),a.connection},Ne.prototype.createShape=function(e,t,n,i,r){typeof i!="number"&&(r=i,i=void 0);var o,a,c=(r=r||{}).attach;e=this._create("shape",e),c?(o=n.parent,a=n):o=n;var l={position:t,shape:e,parent:o,parentIndex:i,host:a,hints:r};return this._commandStack.execute("shape.create",l),l.shape},Ne.prototype.createElements=function(e,t,n,i,r){ge(e)||(e=[e]),typeof i!="number"&&(r=i,i=void 0);var o={position:t,elements:e,parent:n,parentIndex:i,hints:r=r||{}};return this._commandStack.execute("elements.create",o),o.elements},Ne.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},Ne.prototype.appendShape=function(e,t,n,i,r){r=r||{};var o={source:e,position:n,target:i,shape:t=this._create("shape",t),connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},Ne.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},Ne.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},Ne.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},Ne.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},Ne.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Ne.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},Ne.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Ne.prototype.createSpace=function(e,t,n,i,r){var o={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",o)},Ne.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Ne.prototype.reconnect=function(e,t,n,i,r){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},Ne.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,z(i,{docking:"source"}))},Ne.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,z(i,{docking:"target"}))},Ne.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},Ne.prototype._create=function(e,t){return t instanceof So?t:this._elementFactory.create(e,t)},Ne.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)},sa.$inject=["elementRegistry"],sa.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var r=e.changed||this.getVisualReferences(n).concat(t),o=e.oldProperties||function(a,c){return Bt(c,function(l,u){return l[u]=a.get(u),l},{})}(n,go(i));return Yy(n,i),e.oldProperties=o,e.changed=r,r},sa.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return Yy(n,t),i},sa.prototype.getVisualReferences=function(e){var t=this._elementRegistry;return A(e,"bpmn:DataObject")?function(n,i){return i.filter(function(r){return A(r,"bpmn:DataObjectReference")&&te(r).dataObjectRef===n})}(e,t):[]};var ca="default",ei="id",Jy="di",aw={width:0,height:0};function la(e,t,n,i,r){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=r}function Zy(e,t){return ei in e&&e[ei]!==t[ei]}function Qy(e,t){L(t,function(n,i){i!==Jy?e.set(i,n):e.di&&function(r,o){L(o,function(a,c){r.set(c,a)})}(e.di,n)})}la.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],la.prototype.execute=function(e){var t=e.element,n=[t],i=this._translate;if(!t)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=t.businessObject,c=function(u){var p=z({},u);return sw.forEach(function(d){d in u&&(p[d]=te(p[d]))}),p}(e.properties),l=e.oldProperties||function(u,p){var d=go(p);return Bt(d,function(y,f){return y[f]=f!==Jy?u.get(f):function(v,g){return Bt(g,function(b,S){return b[S]=v.get(S),b},{})}(u.di,go(p.di)),y},{})}(a,c);return Zy(c,a)&&(o.unclaim(a[ei]),r.updateId(t,c[ei]),o.claim(c[ei],a)),ca in c&&(c[ca]&&n.push(r.get(c[ca].id)),a[ca]&&n.push(r.get(a[ca].id))),Qy(a,c),e.oldProperties=l,e.changed=n,n},la.prototype.postExecute=function(e){var t=e.element.label,n=t&&te(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,aw)}},la.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Qy(r,i),Zy(n,r)&&(a.unclaim(n[ei]),o.updateId(t,i[ei]),a.claim(i[ei],r)),e.changed};var sw=["default"];function fc(e,t){this._canvas=e,this._modeling=t}function Np(e,t){this._modeling=e,this._spaceTool=t}function Ip(e,t){this._modeling=e,this._translate=t}function ua(e,t){this._modeling=e,this._spaceTool=t}fc.$inject=["canvas","modeling"],fc.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,c=o.di;t.setRootElement(n,!0),Je(a.rootElements,i),i.$parent=a,Ye(a.rootElements,o),o.$parent=null,o.di=null,c.bpmnElement=i,i.di=c,e.oldRoot=r},fc.prototype.revert=function(e){var t=this._canvas,n=e.newRoot.businessObject,i=e.oldRoot,r=i.businessObject,o=n.$parent,a=n.di;t.setRootElement(i,!0),Ye(o.rootElements,n),n.$parent=null,Je(o.rootElements,r),r.$parent=o,n.di=null,a.bpmnElement=r,r.di=a},Np.$inject=["modeling","spaceTool"],Np.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=fn(i),a=o===i,c=a?i:i.parent;ai(c).length||n.createShape({type:"bpmn:Lane"},{x:i.x+zr,y:i.y,width:i.width-zr,height:i.height},c);var l=[];zi(o,function(v){return l.push(v),v.label&&l.push(v.label),v===i?[]:de(v.children,function(g){return g!==i})});var u=r==="top"?-120:120,p=r==="top"?i.y:i.y+i.height,d=p+(r==="top"?10:-10),y=r==="top"?"n":"s",f=t.calculateAdjustments(l,"y",u,d);t.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:u},y,d),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?zr:0),y:p-(r==="top"?120:0),width:i.width-(a?zr:0),height:120},c)},Ip.$inject=["modeling","translate"],Ip.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=ai(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var c,l,u,p,d,y=Math.round(i.height/r);for(d=0;d<r;d++)c=i.y+d*y,l=d===r-1?i.height-y*d:y,u={x:i.x+zr,y:c,width:i.width-zr,height:l},d<a?t.resizeShape(o[d],u):(p={type:"bpmn:Lane"},t.createShape(p,u,i))},ua.$inject=["modeling","spaceTool"],ua.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds;e.balanced!==!1?this.resizeBalanced(t,n):this.resizeSpace(t,n)},ua.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=l_(e,t);n.resizeShape(e,t),i.forEach(function(r){n.resizeShape(r.shape,r.newBounds)})},ua.prototype.resizeSpace=function(e,t){var n,i,r,o,a,c=this._spaceTool,l=ae(e),u=nv(ae(t),l),p=fn(e),d=[],y=[];zi(p,function(f){return d.push(f),(A(f,"bpmn:Lane")||A(f,"bpmn:Participant"))&&y.push(f),f.children}),(u.bottom||u.top)&&(n=u.bottom||u.top,i=e.y+(u.bottom?e.height:0)+(u.bottom?-10:10),r=u.bottom?"s":"n",o=u.top>0||u.bottom<0?-n:n,a=c.calculateAdjustments(d,"y",o,i),c.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(u.left||u.right)&&(n=u.right||u.left,i=e.x+(u.right?e.width:0)+(u.right?-10:100),r=u.right?"e":"w",o=u.left>0||u.right<0?-n:n,a=c.calculateAdjustments(y,"x",o,i),c.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var pa="flowNodeRef",Dp="lanes";function ha(e){this._elementRegistry=e}function vc(e){this._moddle=e}ha.$inject=["elementRegistry"],ha.prototype.computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(l){n.indexOf(l)===-1&&(o.push(l),n.push(l))}function c(l){if(!l.parent)return[];var u=function(p){var d=fn(p);return r[d.id]||(r[d.id]=Ms(d)),r[d.id]}(l);return u.filter(function(p){return d=l,y=ae(p),f=d.x+d.width/2,v=d.y+d.height/2,f>y.left&&f<y.right&&v>y.top&&v<y.bottom;var d,y,f,v}).map(function(p){return p.businessObject})}return t.forEach(function(l){var u=fn(l);u&&n.indexOf(u)===-1&&(u.children.filter(function(p){return A(p,"bpmn:FlowNode")}).forEach(a),n.push(u))}),e.forEach(a),o.forEach(function(l){var u=l.businessObject,p=u.get(Dp).slice(),d=c(l);i.push({flowNode:u,remove:p,add:d})}),t.forEach(function(l){var u=l.businessObject;l.parent||u.get(pa).forEach(function(p){i.push({flowNode:p,remove:[u],add:[]})})}),i},ha.prototype.execute=function(e){var t=e.updates;t||(t=e.updates=this.computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(n){var i=n.flowNode,r=i.get(Dp);n.remove.forEach(function(o){Ye(r,o),Ye(o.get(pa),i)}),n.add.forEach(function(o){Je(r,o),Je(o.get(pa),i)})})},ha.prototype.revert=function(e){e.updates.forEach(function(t){var n=t.flowNode,i=n.get(Dp);t.add.forEach(function(r){Ye(i,r),Ye(r.get(pa),n)}),t.remove.forEach(function(r){Je(i,r),Je(r.get(pa),n)})})},vc.$inject=["moddle"],vc.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.claim(n,i):t.unclaim(n)},vc.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.unclaim(n):t.claim(n,i)};var cw={fill:void 0,stroke:void 0};function Bp(e){this._commandStack=e,this._normalizeColor=function(t){if(t){if(Dt(t)){var n=function(i){var r=document.createElement("canvas").getContext("2d");return r.fillStyle="transparent",r.fillStyle=i,/^#[0-9a-fA-F]{6}$/.test(r.fillStyle)?r.fillStyle:null}(t);if(n)return n}throw new Error("invalid color value: "+t)}}}Bp.$inject=["commandStack"],Bp.prototype.postExecute=function(e){var t=e.elements,n=e.colors||cw,i=this,r={};"fill"in n&&z(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&z(r,{"border-color":this._normalizeColor(n.stroke)}),L(t,function(o){var a=function(c){return!!c.waypoints}(o)?Yt(r,["border-color"]):r;(function(c){"border-color"in c&&(c.stroke=c["border-color"]),"background-color"in c&&(c.fill=c["background-color"])})(a),o.labelTarget?i._commandStack.execute("element.updateModdleProperties",{element:o,moddleElement:o.businessObject.di.label,properties:{color:r["background-color"]}}):i._commandStack.execute("element.updateProperties",{element:o,properties:{di:a}})})};var lw={width:0,height:0};function eg(e,t){function n(i,r){var o=i.label||i,a=i.labelTarget||i;return function(c,l,u){var p=c.businessObject,d=fm(p);d&&(d==="categoryValueRef"?p.categoryValueRef.value=l:p[d]=l)}(o,r),[o,a]}this.preExecute=function(i){var r=i.element,o=r.businessObject,a=i.newLabel;if(!bt(r)&&Nr(r)&&!ss(r)&&!tg(a)){var c=cs(r);c={x:c.x,y:c.y+7},e.createLabel(r,c,{id:o.id+"_label",businessObject:o})}},this.execute=function(i){return i.oldLabel=pn(i.element),n(i.element,i.newLabel)},this.revert=function(i){return n(i.element,i.oldLabel)},this.postExecute=function(i){var r=i.element,o=r.label||r,a=i.newLabel,c=i.newBounds,l=i.hints||{};if(bt(o)||A(o,"bpmn:TextAnnotation"))if(bt(o)&&tg(a))l.removeShape!==!1&&e.removeShape(o,{unsetLabel:!1});else{var u=pn(o);c===void 0&&(c=t.getExternalLabelBounds(o,u)),c&&e.resizeShape(o,c,lw)}}}function tg(e){return!e||!e.trim()}function Et(e,t,n,i){Ne.call(this,e,t,n),this._bpmnRules=i}function ng(){}eg.$inject=["modeling","textRenderer"],ie(Et,Ne),Et.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],Et.prototype.getHandlers=function(){var e=Ne.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=sa,e["element.updateProperties"]=la,e["canvas.updateRoot"]=fc,e["lane.add"]=Np,e["lane.resize"]=ua,e["lane.split"]=Ip,e["lane.updateRefs"]=ha,e["id.updateClaim"]=vc,e["element.setColor"]=Bp,e["element.updateLabel"]=eg,e},Et.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},Et.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),n)return this.createConnection(e,t,n,e.parent,i)},Et.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},Et.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},Et.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},Et.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},Et.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},Et.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},Et.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},Et.prototype.makeProcess=function(){var e={newRoot:this._create("root",{type:"bpmn:Process"})};this._commandStack.execute("canvas.updateRoot",e)},Et.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},Et.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},Et.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})},ng.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||fe(t.source||e.source),t.connectionEnd||fe(t.target||e.target)]};var yc=20,uw=5,gc=Math.round,ig=20,pw={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function rg(e,t,n){var i,r,o,a=yt(t,e,uw),c=n.split(":")[0],l=gc((t.x-e.x)/2+e.x),u=gc((t.y-e.y)/2+e.y),p=(o=a,{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[c].test(o)),d=/h|r|l/.test(c),y=!1,f=!1;return p?(i=d?{x:l,y:e.y}:{x:e.x,y:u},r=d?"h:h":"v:v"):(y=function(v,g){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[g].test(v)}(a,c),r=d?"h:v":"v:h",y?d?(f=u===e.y,i={x:e.x+yc*(/l/.test(c)?-1:1),y:f?u+yc:u}):i={x:(f=l===e.x)?l+yc:l,y:e.y+yc*(/t/.test(c)?-1:1)}:i={x:l,y:u}),{waypoints:Op(e,i,r).concat(i),directions:r,turnNextDirections:f}}function og(e){return e.split(":").reverse().join(":")}function Op(e,t,n){if(!function(a){return a&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(a)}(n=n||"h:h"))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(sg(n)){var i=function(a,c,l){return rg(a,c,l)}(e,t,n),r=function(a,c,l){var u=rg(c,a,og(l));return{waypoints:u.waypoints.slice().reverse(),directions:og(u.directions),turnNextDirections:u.turnNextDirections}}(e,t,n),o=function(a,c){var l=a.directions.split(":")[1],u=c.directions.split(":")[0];a.turnNextDirections&&(l=l=="h"?"v":"h"),c.turnNextDirections&&(u=u=="h"?"v":"h");var p=l+":"+u;return{waypoints:Op(a.waypoints[a.waypoints.length-1],c.waypoints[0],p),directions:p}}(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return function(a,c,l){var u=gc((c.x-a.x)/2+a.x),p=gc((c.y-a.y)/2+a.y);if(l==="h:v")return[{x:c.x,y:a.y}];if(l==="v:h")return[{x:a.x,y:c.y}];if(l==="h:h")return[{x:u,y:a.y},{x:u,y:c.y}];if(l==="v:v")return[{x:a.x,y:p},{x:c.x,y:p}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(e,t,n)}function hw(e,t,n,i,r){var o=Yh(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=yt(e,t,pw[o]||0),c=function(p,d){if(sg(d))return d;switch(p){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return d}}(a,o);n=n||fe(e),i=i||fe(t);var l=c.split(":"),u=cg(n,e,l[0],function(p){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"}[p]}(a));return function(p,d,y){var f=Op(p,d,y);return f.unshift(p),f.push(d),lg(f)}(u,cg(i,t,l[1],a),c)}function dw(e,t,n,i,r,o){var a;return ge(n)&&(r=n,o=i,n=fe(e),i=fe(t)),r=r||[],a=(o=z({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")!==-1&&function(c,l,u,p,d){var y,f,v={};return f=yt(c,l),/^(top|bottom|left|right)$/.test(f)?(/top|bottom/.test(f)&&(y="x"),/left|right/.test(f)&&(y="y"),d.preserveDocking==="target"?ag(y,p,c)?(v[y]=p[y],[{x:v.x!==void 0?v.x:u.x,y:v.y!==void 0?v.y:u.y,original:{x:v.x!==void 0?v.x:u.x,y:v.y!==void 0?v.y:u.y}},{x:p.x,y:p.y}]):null:ag(y,u,l)?(v[y]=u[y],[{x:u.x,y:u.y},{x:v.x!==void 0?v.x:p.x,y:v.y!==void 0?v.y:p.y,original:{x:v.x!==void 0?v.x:p.x,y:v.y!==void 0?v.y:p.y}}]):null):null}(e,t,n,i,o),a||(a=o.connectionEnd&&function(c,l,u,p){var d=p.slice().reverse();return d=Lp(c,l,u,d),d?d.reverse():null}(t,e,i,r),a||(a=o.connectionStart&&Lp(e,t,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:hw(e,t,n,i,o)))}function ag(e,t,n){return function(i,r,o){return i>=r&&i<=o}(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function Lp(e,t,n,i){if(function(c){return c.length<3||!(c.length>4)&&!!Pe(c,function(l,u){var p=c[u-1];return p&&_o(l,p)<3})}(i))return null;var r,o=i[0],a=i.slice();return a[0]=n,a[1]=function(c,l,u){switch($n(l,c)){case"v":return{x:u.x,y:c.y};case"h":return{x:c.x,y:u.y}}return{x:c.x,y:c.y}}(a[1],o,n),r=function(c,l,u){var p;for(p=c.length-2;p!==0;p--)if(xd(c[p],l,ig)||xd(c[p],u,ig))return c.slice(p);return c}(a,e,t),r!==a&&(a=Lp(e,t,n,r)),a&&$n(a)?null:a}function sg(e){return e&&/t|r|b|l/.test(e)}function cg(e,t,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function lg(e){return e.reduce(function(t,n,i){return Bl(t[t.length-1],e[i+1],n,0)||t.push(n),t},[])}var mw=-10,fw=40,jp={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},bc={top:"t",right:"r",bottom:"b",left:"l"};function Vp(){}function vw(e,t){return A(t,"bpmn:Participant")?"source":A(e,"bpmn:Participant")?"target":da(t)?"source":da(e)||A(t,"bpmn:Event")?"target":A(e,"bpmn:Event")?"source":null}function yw(e){return da(e)?"target":"source"}function ug(e,t){return e?e.original||e:fe(t)}function pg(e,t){return A(t,"bpmn:Activity")&&A(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function da(e){return A(e,"bpmn:SubProcess")&&Me(e)}function ma(e,t){return e===t}function fa(e){var t=/right|left/.exec(e);return t&&t[0]}function tr(e){var t=/top|bottom/.exec(e);return t&&t[0]}function Fp(e){return e==="right"||e==="left"}function gw(e,t){var n=t.waypoints,i=n&&n.length&&yt(n[0],e);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function bw(e,t,n){var i,r,o,a,c=fe(e),l=fe(t),u=(a=(o=e).host,yt(fe(o),a,mw)),p=ma(e.host,t),d=["top","right","bottom","left"].indexOf(u)!==-1,y=yt(l,c,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return p?function(f,v,g,b,S){var w,_=v?f:tr(f),C=bc[_];return w=v?Fp(f)?hg("y",g,b,S)?"h":"b":hg("x",g,b,S)?"v":"l":"v",[C+":"+w]}(u,d,e,t,n):(i=function(f,v,g){if(g)return bc[f];if(ma(tr(f),tr(v))||(b=fa(f),S=fa(v),jp[b]===S))return bc[tr(f)];var b,S;return bc[fa(f)]}(u,y,d),r=function(f,v,g){if(g)return Fp(f)?(b=v,S=fa(f),w=jp[S],b.indexOf(w)!==-1||ma(f,v)?"h":"v"):function(_,C){var B=tr(_),s=jp[B];return C.indexOf(s)!==-1}(f,v)||ma(f,v)?"v":"h";var b,S,w;return Fp(v)||ma(tr(f),tr(v))&&fa(v)?"h":"v"}(u,y,d),[i+":"+r])}function hg(e,t,n,i){var r=fw;return!(zp(e,i,n,r)||zp(e,i,{x:n.x+n.width,y:n.y+n.height},r)||zp(e,i,fe(t),r))}function zp(e,t,n,i){return Math.abs(t[e]-n[e])<i}function dg(e){return z({original:e.point.original||e.point},e.actual)}function Ti(e,t){this._elementRegistry=e,this._graphicsFactory=t}ie(Vp,ng),Vp.prototype.layoutConnection=function(e,t){t||(t={});var n,i,r=t.source||e.source,o=t.target||e.target,a=t.waypoints||e.waypoints,c=t.connectionStart,l=t.connectionEnd;return c||(c=ug(a&&a[0],r)),l||(l=ug(a&&a[a.length-1],o)),(A(e,"bpmn:Association")||A(e,"bpmn:DataAssociation"))&&a&&!pg(r,o)?[].concat([c],a.slice(1,-1),[l]):(A(e,"bpmn:MessageFlow")?n=function(u,p){return{preferredLayouts:["straight","v:v"],preserveDocking:vw(u,p)}}(r,o):(A(e,"bpmn:SequenceFlow")||pg(r,o))&&(n=r===o?{preferredLayouts:gw(r,e)}:A(r,"bpmn:BoundaryEvent")?{preferredLayouts:bw(r,o,l)}:da(r)||da(o)?function(u){return{preferredLayouts:["straight","h:h"],preserveDocking:yw(u)}}(r):A(r,"bpmn:Gateway")?{preferredLayouts:["v:h"]}:A(o,"bpmn:Gateway")?{preferredLayouts:["h:v"]}:{preferredLayouts:["h:h"]}),n&&(i=lg(dw(r,o,c,l,a,n=z(n,t)))),i||[c,l])},Ti.$inject=["elementRegistry","graphicsFactory"],Ti.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var i=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,n),o=e.waypoints.slice(i.idx+1,r.idx);return o.unshift(dg(i)),o.push(dg(r)),o},Ti.prototype.getDockingPoint=function(e,t,n){var i,r,o=e.waypoints;return{point:r=o[i=n?0:o.length-1],actual:this._getIntersection(t,e,n)||r,idx:i}},Ti.prototype._getIntersection=function(e,t,n){return Fl(this._getShapePath(e),this._getConnectionPath(t),n)},Ti.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},Ti.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},Ti.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};const xw={__init__:["modeling","bpmnUpdater"],__depends__:[H_,K_,Y_,J_,Qf,Z_,ew,tw,nw,Rn,gv,Oy],bpmnFactory:["type",on],bpmnUpdater:["type",Vt],elementFactory:["type",_i],modeling:["type",Et],layouter:["type",Vp],connectionDocking:["type",Ti]};var xc=Math.round;function mg(e,t,n,i,r){function o(c,l,u,p){return r.allowed("elements.move",{shapes:c,delta:l,position:u,target:p})}function a(c,l,u,p){if(et(u)&&(p=u,u=!1),!l.waypoints&&l.parent){var d=function(y){return{x:y.x+xc(y.width/2),y:y.y+xc(y.height/2)}}(l);return t.init(c,d,"shape.move",{cursor:"grabbing",autoActivate:u,data:{shape:l,context:p||{}}}),!0}}e.on("shape.move.start",1500,function(c){var l=c.context,u=c.shape,p=i.get().slice();p.indexOf(u)===-1&&(p=[u]),p=function(d){var y=Vi(d,"id");return de(d,function(f){for(;f=f.parent;)if(y[f.id])return!1;return!0})}(p),z(l,{shapes:p,validatedShapes:p,shape:u})}),e.on("shape.move.start",1250,function(c){var l=c.context,u=l.validatedShapes;if(!(l.canExecute=o(u)))return!1}),e.on("shape.move.move",500,function(c){var l,u=c.context,p=u.validatedShapes,d=c.hover,y={x:c.dx,y:c.dy};l=o(p,y,{x:c.x,y:c.y},d),u.delta=y,u.canExecute=l,u.target=l!==null?d:null}),e.on("shape.move.end",function(c){var l=c.context,u=l.delta,p=l.canExecute,d=p==="attach",y=l.shapes;if(p===!1)return!1;u.x=xc(u.x),u.y=xc(u.y),u.x===0&&u.y===0||n.moveElements(y,u,l.target,{primaryShape:l.shape,attach:d})}),e.on("element.mousedown",function(c){if(gi(c)){var l=Ir(c);if(!l)throw new Error("must supply DOM mousedown event");return a(l,c.element)}}),this.start=a}mg.$inject=["eventBus","dragging","modeling","selection","rules"];var $p="djs-dragging",fg="drop-ok",vg="drop-not-ok",yg="new-parent",gg="attach-ok";function bg(e,t,n,i){function r(c){var l=function(u){var p=de(u,function(d){return!function(y){return y.waypoints}(d)||Pe(u,Kt({id:d.source.id}))&&Pe(u,Kt({id:d.target.id}))});return p}(o(c));return l}function o(c){var l=Fa(c,!0),u=lt(l,function(p){return(p.incoming||[]).concat(p.outgoing||[])});return fo(l.concat(u))}function a(c,l){[gg,fg,vg,yg].forEach(function(u){u===l?t.addMarker(c,u):t.removeMarker(c,u)})}e.on("shape.move.start",499,function(c){var l=c.context,u=l.shapes,p=l.allDraggedElements,d=r(u);if(!l.dragGroup){var y=oe("g");K(y,n.cls("djs-drag-group",["no-events"])),le(t.getActiveLayer(),y),l.dragGroup=y}d.forEach(function(f){i.addDragger(f,l.dragGroup)}),L(p=p?fo([p,o(u)]):o(u),function(f){t.addMarker(f,$p)}),l.allDraggedElements=p,l.differentParents=yr(Vi(u,function(f){return f.parent&&f.parent.id}))!==1}),e.on("shape.move.move",499,function(c){var l=c.context,u=l.dragGroup,p=l.target,d=l.shape.parent,y=l.canExecute;p&&(y==="attach"?a(p,gg):l.canExecute&&p&&p.id!==d.id?a(p,yg):a(p,l.canExecute?fg:vg)),Lt(u,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var l=c.context.target;l&&a(l,null)}),e.on("shape.move.cleanup",function(c){var l=c.context,u=l.allDraggedElements,p=l.dragGroup;L(u,function(d){t.removeMarker(d,$p)}),p&&tt(p)}),this.makeDraggable=function(c,l,u){i.addDragger(l,c.dragGroup),u&&t.addMarker(l,$p),c.allDraggedElements?c.allDraggedElements.push(l):c.allDraggedElements=[l]}}bg.$inject=["eventBus","canvas","styles","previewSupport"];const Ew={__depends__:[Io,Rn,Sm,Dn,Xn,zo],__init__:["move","movePreview"],move:["type",mg],movePreview:["type",bg]};var xg=".djs-palette-toggle",Eg=".entry",_w=xg+", "+Eg,Gp="djs-palette-",Up="open",_g="two-column";function it(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(i){var r=i.tool;n.updateToolHighlight(r)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}function ww(e,t){var n=t.getPaletteEntries();return ft(n)?n(e):(L(n,function(i,r){e[r]=i}),e)}it.$inject=["eventBus","canvas"],it.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()},it.prototype.getEntries=function(){return this._getProviders().reduce(ww,{})},it.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},it.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=je(it.HTML_MARKUP);n.appendChild(i),ot(n).add(Gp+"shown"),Gt.bind(i,_w,"click",function(r){var o=r.delegateTarget;if(ja(o,xg))return e.toggle();e.trigger("click",r)}),ce.bind(i,"mousedown",function(r){r.stopPropagation()}),Gt.bind(i,Eg,"dragstart",function(r){e.trigger("dragstart",r)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},it.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},it.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=ot(i),a=ot(n);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle(_g,t),a.toggle(Gp+_g,t),"open"in e&&(o.toggle(Up,e.open),a.toggle(Gp+Up,e.open)),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},it.prototype._update=function(){var e=Xe(".djs-palette-entries",this._container),t=this._entries=this.getEntries();La(e),L(t,function(n,i){var r=n.group||"default",o=Xe("[data-group="+r+"]",e);o||(o=je('<div class="group" data-group="'+r+'"></div>'),e.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),c=je(a);o.appendChild(c),n.separator||($t(c,"data-action",i),n.title&&$t(c,"title",n.title),n.className&&function(l,u){var p=ot(l);(ge(u)?u:u.split(/\s+/g)).forEach(function(d){p.add(d)})}(c,n.className),n.imageUrl&&c.appendChild(je('<img src="'+n.imageUrl+'">')))}),this.open()},it.prototype.trigger=function(e,t,n){var i,r,o,a=this._entries,c=t.delegateTarget||t.target;if(!c)return t.preventDefault();(i=a[$t(c,"data-action")])&&(r=i.action,o=t.originalEvent||t,ft(r)?e==="click"&&r(o,n):r[e]&&r[e](o,n),t.preventDefault())},it.prototype._layoutChanged=function(){this._toggleState({})},it.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},it.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},it.prototype.open=function(){this._toggleState({open:!0})},it.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},it.prototype.isActiveTool=function(e){return e&&this._activeTool===e},it.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=Xe(".djs-palette-entries",this._container),this._toolsContainer=Xe("[data-group=tools]",t)),L(this._toolsContainer.children,function(n){var i=n.getAttribute("data-action");if(i){var r=ot(n);i=i.replace("-tool",""),r.contains("entry")&&i===e?r.add("highlighted-entry"):r.remove("highlighted-entry")}})},it.prototype.isOpen=function(){return ot(this._container).has(Up)},it.prototype._getParentContainer=function(){return this._canvas.getContainer()},it.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';const Sw={__init__:["palette"],palette:["type",it]};var wg="crosshair";function nr(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var c=this,l=function(d){var y,f=t.getActiveLayer();K(y=d.frame=oe("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),le(f,y)},u=function(d){var y=d.frame,f=d.bbox;K(y,{x:f.x,y:f.y,width:f.width,height:f.height})},p=function(d){d.frame&&tt(d.frame)};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(d){var y=d.originalEvent.target;(d.hover||y instanceof SVGElement)&&e.once("lasso.selection.ended",function(){c.activateLasso(d.originalEvent,!0)})}),e.on("lasso.end",function(d){var y=Hp(d),f=i.filter(function(v){return v});c.select(f,y)}),e.on("lasso.start",function(d){var y=d.context;y.bbox=Hp(d),l(y)}),e.on("lasso.move",function(d){var y=d.context;y.bbox=Hp(d),u(y)}),e.on("lasso.cleanup",function(d){var y=d.context;p(y)}),e.on("element.mousedown",1500,function(d){if(_m(d))return c.activateLasso(d.originalEvent),!0})}function Hp(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?{x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?{x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?{x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}nr.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],nr.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:wg,data:{context:{}}})},nr.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:wg,data:{context:{}}})},nr.prototype.select=function(e,t){var n=function(i,r){var o={};return L(i,function(a){var c=a;c.waypoints&&(c=vt(c)),!pe(r.y)&&c.x>r.x&&(o[a.id]=a),!pe(r.x)&&c.y>r.y&&(o[a.id]=a),c.x>r.x&&c.y>r.y&&(pe(r.width)&&pe(r.height)&&c.width+c.x<r.width+r.x&&c.height+c.y<r.height+r.y?o[a.id]=a:pe(r.width)&&pe(r.height)||(o[a.id]=a))}),o}(e,t);this._selection.select(Oa(n))},nr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},nr.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};const Cw={__depends__:[tc,Uo],__init__:["lassoTool"],lassoTool:["type",nr]};var qp=1500,Sg="grab";function qr(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,c=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",qp,function(l){if(Dr(l))return a.activateMove(l.originalEvent,!0),!1}),c&&c.addListener(qp,function(l){if(Cg(l.keyEvent)&&!a.isActive()){var u=a._mouse.getLastMoveEvent();a.activateMove(u,!!u)}},"keyboard.keydown"),c&&c.addListener(qp,function(l){Cg(l.keyEvent)&&a.isActive()&&a.toggle()},"keyboard.keyup"),e.on("hand.end",function(l){var u=l.originalEvent.target;if(!(l.hover||u instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(l.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(l){var u=t.viewbox().scale;t.scroll({dx:l.dx*u,dy:l.dy*u})}),e.on("hand.move.end",function(l){var u=l.context.reactivate;return!Dr(l)&&u&&e.once("hand.move.ended",function(p){a.activateHand(p.originalEvent,!0,!0)}),!1})}function Cg(e){return hn(" ",e)}qr.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],qr.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Sg,data:{context:n||{}}})},qr.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Sg,data:{context:{reactivate:n}}})},qr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},qr.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};const Tw={__depends__:[tc,Uo],__init__:["handTool"],handTool:["type",qr]};var Tg="connect-ok",Ag="connect-not-ok";function Wr(e,t,n,i,r,o,a){var c=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(l){var u=l.context,p=l.hover,d=u.canStartConnect=c.canStartConnect(p);d!==null&&(u.startTarget=p,i.addMarker(p,d?Tg:Ag))}),e.on(["global-connect.out","global-connect.cleanup"],function(l){var u=l.context.startTarget,p=l.context.canStartConnect;u&&i.removeMarker(u,p?Tg:Ag)}),e.on(["global-connect.ended"],function(l){var u=l.context.startTarget,p={x:l.x,y:l.y};if(c.canStartConnect(u))return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,u,p)}),!1})}Wr.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],Wr.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},Wr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},Wr.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},Wr.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};const Aw={__depends__:[_u,Dn,Xn,tc,Uo],globalConnect:["type",Wr]};Ia=function(e,t,n,i,r,o,a,c){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=c,e.registerProvider(this)},Ia.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],Ia.prototype.getPaletteEntries=function(e){var t={},n=this._create,i=this._elementFactory,r=this._spaceTool,o=this._lassoTool,a=this._handTool,c=this._globalConnect,l=this._translate;function u(y,f,v,g,b){function S(_){var C=i.createShape(z({type:y},b));b&&(C.businessObject.di.isExpanded=b.isExpanded),n.start(_,C)}var w=y.replace(/^bpmn:/,"");return{group:f,className:v,title:g||l("Create {type}",{type:w}),action:{dragstart:S,click:S}}}function p(y){var f=i.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),v=i.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:f});n.start(y,[f,v],{hints:{autoSelect:[f]}})}function d(y){n.start(y,i.createParticipantShape())}return z(t,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:l("Activate the hand tool"),action:{click:function(y){a.activateHand(y)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:l("Activate the lasso tool"),action:{click:function(y){o.activateSelection(y)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:l("Activate the create/remove space tool"),action:{click:function(y){r.activateSelection(y)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:l("Activate the global connect tool"),action:{click:function(y){c.start(y)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":u("bpmn:StartEvent","event","bpmn-icon-start-event-none",l("Create StartEvent")),"create.intermediate-event":u("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",l("Create Intermediate/Boundary Event")),"create.end-event":u("bpmn:EndEvent","event","bpmn-icon-end-event-none",l("Create EndEvent")),"create.exclusive-gateway":u("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",l("Create Gateway")),"create.task":u("bpmn:Task","activity","bpmn-icon-task",l("Create Task")),"create.data-object":u("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",l("Create DataObjectReference")),"create.data-store":u("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",l("Create DataStoreReference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:l("Create expanded SubProcess"),action:{dragstart:p,click:p}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:l("Create Pool/Participant"),action:{dragstart:d,click:d}},"create.group":u("bpmn:Group","artifact","bpmn-icon-group",l("Create Group"))}),t};const kw={__depends__:[Sw,Es,Oy,Cw,Tw,Aw,as],__init__:["paletteProvider"],paletteProvider:["type",Ia]};function Wp(e,t,n,i,r){Q.call(this,e),e.on("shape.move.move",250,function(o){var a=o.context,c=a.canExecute;a.visualReplacements||(a.visualReplacements={}),c&&c.replacements?function(l){L(l.canExecute.replacements,function(u){var p=u.oldElementId,d={type:u.newElementType};if(!l.visualReplacements[p]){var y=t.get(p);z(d,{x:y.x,y:y.y});var f=n.createShape(d);i.addShape(f,y.parent);var v=Xe('[data-element-id="'+gu(y.id)+'"]',l.dragGroup);v&&K(v,{display:"none"});var g=r.addDragger(f,l.dragGroup);l.visualReplacements[p]=g,i.removeShape(f)}})}(a):function(l){var u=l.visualReplacements;L(u,function(p,d){var y=Xe('[data-element-id="'+gu(d)+'"]',l.dragGroup);y&&K(y,{display:"inline"}),p.remove(),u[d]&&delete u[d]})}(a)})}Wp.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],ie(Wp,Q);const Pw={__depends__:[zo],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",Wp]};var Xp=40,Mw=20,Rw=10,kg=20,Pg=["x","y"],Nw=Math.abs;function Mg(e){e.on(["connect.hover","connect.move","connect.end"],1250,function(t){var n=t.context,i=n.canExecute,r=n.start,o=n.hover,a=n.source,c=n.target;t.originalEvent&&qt(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),i&&o&&function(l,u,p){Pg.forEach(function(d){var y=Ig(d,u);l[d]<u[d]+p?st(l,d,u[d]+p):l[d]>u[d]+y-p&&st(l,d,u[d]+y-p)})}(t,o,function(l){return A(l,"bpmn:Task")?Rw:Mw}(o)),o&&function(l,u){return si(u,function(p){return Ng(l,p)})}(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Qt(r),we(o,["bpmn:Event","bpmn:Gateway"])&&Rg(t,Qt(o)),we(o,["bpmn:Task","bpmn:SubProcess"])&&function(l,u){var p=Qt(u);Pg.forEach(function(d){(function(y,f,v){return y[v]>f[v]+kg&&y[v]<f[v]+Ig(v,f)-kg})(l,u,d)&&st(l,d,p[d])})}(t,o),A(a,"bpmn:BoundaryEvent")&&c===a.host&&function(l){var u=l.context,p=u.source,d=u.target;if(!function(g){var b=g.hover,S=g.source;return b&&S&&b===S}(u)){var y=Qt(p),f=yt(y,d,-10),v=[];/top|bottom/.test(f)&&v.push("x"),/left|right/.test(f)&&v.push("y"),v.forEach(function(g){var b,S=l[g];Nw(S-y[g])<Xp&&(b=S>y[g]?y[g]+Xp:y[g]-Xp,st(l,g,b))})}}(t)):Ng(i,"bpmn:MessageFlow")?(A(r,"bpmn:Event")&&(n.connectionStart=Qt(r)),A(o,"bpmn:Event")&&Rg(t,Qt(o))):n.connectionStart=n.initialConnectionStart)})}function Rg(e,t){st(e,"x",t.x),st(e,"y",t.y)}function Ng(e,t){return e&&e.type===t}function Ig(e,t){return e==="x"?t.width:t.height}function Ai(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function Ec(e){this._snapValues={}}Mg.$inject=["eventBus"],Ai.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},Ai.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},Ai.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},Ai.prototype.getSnapLocations=function(){return this._snapLocations},Ai.prototype.setSnapLocations=function(e){this._snapLocations=e},Ai.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new Ec).initDefaults(this._defaultSnaps),n},Ec.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)},Ec.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&function(o,a,c){var l,u;for(c=c===void 0?10:c,l=0;l<a.length;l++)if(u=a[l],RE(u-o)<=c)return u}(e[n],r[n],i)},Ec.prototype.initDefaults=function(e){var t=this;L(e||{},function(n,i){L(n,function(r){t.add(i,r)})})};var Iw=1250;function On(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(r){i.initSnap(r)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],Iw,function(r){var o=r.context,a=o.shape,c=o.snapContext,l=o.target;if((!r.originalEvent||!qt(r.originalEvent))&&!Fr(r)&&l){var u=c.pointsForTarget(l);u.initialized||((u=i.addSnapTargetPoints(u,a,l)).initialized=!0),n.snap(r,u)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}function Kp(e){return!!e.labelTarget}On.$inject=["elementRegistry","eventBus","snapping"],On.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new Ai);var a=(t=n.get(r.id)?Qt(r,e):{x:e.x+Qt(r).x,y:e.y+Qt(r).y}).x-r.width/2,c=t.y-r.height/2,l=t.x+r.width/2,u=t.y+r.height/2;return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),Kp(r)||(o.setSnapOrigin("top-left",{x:a-e.x,y:c-e.y}),o.setSnapOrigin("bottom-right",{x:l-e.x,y:u-e.y})),o},On.prototype.addSnapTargetPoints=function(e,t,n){return L(this.getSnapTargets(t,n),function(i){if(Kp(i))Kp(t)&&e.add("mid",Qt(i));else if(i.waypoints){if(i.waypoints.length<3)return;L(i.waypoints.slice(1,-1),function(r){e.add("mid",r)})}else e.add("mid",Qt(i))}),pe(t.x)&&pe(t.y)&&this._elementRegistry.get(t.id)&&e.add("mid",Qt(t)),e},On.prototype.getSnapTargets=function(e,t){return Sf(t).filter(function(n){return!n.hidden})};function Xr(e,t){t.invoke(On,this),e.on(["create.move","create.end"],1500,Dw),e.on(["create.move","create.end","shape.move.move","shape.move.end"],1500,function(n){var i=n.context,r=i.canExecute,o=i.target;r&&(r==="attach"||r.attach)&&!Fr(n)&&function(a,c){var l,u=ae(c),p=ly(a,c),d=a.context,y=d.shape;l=y.parent?{x:0,y:0}:fe(y),/top/.test(p)?st(a,"y",u.top-l.y):/bottom/.test(p)&&st(a,"y",u.bottom-l.y),/left/.test(p)?st(a,"x",u.left-l.x):/right/.test(p)&&st(a,"x",u.right-l.x)}(n,o)})}function Dw(e){var t=e.context.createConstraints;if(t){var n=t.top,i=t.right,r=t.bottom,o=t.left;(o&&o>=e.x||i&&i<=e.x)&&st(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&st(e,"y",e.y)}}function Dg(e,t){return e.indexOf(t)!==-1}function Bg(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}ie(Xr,On),Xr.$inject=["eventBus","injector"],Xr.prototype.initSnap=function(e){var t=On.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return L(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,t.setSnapOrigin(r.id+"-docking",Bg(o,i,e))}),L(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,t.setSnapOrigin(r.id+"-docking",Bg(o,i,e))}),A(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},Xr.prototype.addSnapTargetPoints=function(e,t,n){On.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);L(i,function(o){var a;(function(c){return A(c,"bpmn:SubProcess")&&Me(c)?!0:A(c,"bpmn:Participant")}(o)||(a="bpmn:TextAnnotation",[t,o].every(function(c){return A(c,a)})))&&(e.add("top-left",_f(o)),e.add("bottom-right",wf(o)))});var r=this._elementRegistry;return L(t.incoming,function(o){if(r.get(t.id)){Dg(i,o.source)||e.add("mid",fe(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),L(t.outgoing,function(o){if(r.get(t.id)){Dg(i,o.target)||e.add("mid",fe(o.target));var a=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",a.original||a)}}),A(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},Xr.prototype.getSnapTargets=function(e,t){return On.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!A(n,"bpmn:Lane")})};function va(e,t){var n=this;e.on(["resize.start"],function(i){n.initSnap(i)}),e.on(["resize.move","resize.end"],1250,function(i){var r=i.context,o=r.shape,a=o.parent,c=r.direction,l=r.snapContext;if(!(i.originalEvent&&qt(i.originalEvent)||Fr(i))){var u=l.pointsForTarget(a);u.initialized||((u=n.addSnapTargetPoints(u,o,a,c)).initialized=!0),function(p){return p==="n"||p==="s"}(c)&&st(i,"x",i.x),function(p){return p==="e"||p==="w"}(c)&&st(i,"y",i.y),t.snap(i,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}function Og(e,t){var n=fe(e),i=ae(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}va.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new Ai);var o=Og(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},va.prototype.addSnapTargetPoints=function(e,t,n,i){return L(this.getSnapTargets(t,n),function(r){e.add("corner",wf(r)),e.add("corner",_f(r))}),e.add("corner",Og(t,i)),e},va.$inject=["eventBus","snapping"],va.prototype.getSnapTargets=function(e,t){return Sf(t).filter(function(n){return i=n,r=e,!(i.host===r||function(o){return!!o.waypoints}(n)||function(o){return!!o.hidden}(n)||function(o){return!!o.labelTarget}(n));var i,r})};function ki(e){this._canvas=e,this._asyncHide=vl(St(this.hide,this),1e3)}ki.$inject=["canvas"],ki.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:Fr(e,"x"),y:Fr(e,"y")};L(i,function(o){var a=n.getSnapOrigin(o),c={x:e.x+a.x,y:e.y+a.y};if(L(["x","y"],function(l){var u;r[l]||(u=t.snap(c,o,l,7))!==void 0&&(r[l]={value:u,originValue:u-a[l]})}),r.x&&r.y)return!1}),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),L(["x","y"],function(o){var a=r[o];et(a)&&st(e,o,a.originValue)})},ki.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=oe("path");return K(n,{d:"M0,0 L0,0"}),be(n).add("djs-snap-line"),le(t,n),{update:function(i){pe(i)?K(n,e==="horizontal"?{d:"M-100000,"+i+" L+100000,"+i,display:""}:{d:"M "+i+",-100000 L "+i+", +100000",display:""}):K(n,{display:"none"})}}},ki.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},ki.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},ki.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},ki.prototype.hide=function(){L(this._snapLines,function(e){e.update()})};const Bw={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",On],resizeSnapping:["type",va],snapping:["type",ki]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Mg],createMoveSnapping:["type",Xr]};function ue(e,t,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=e,this._eventBus=t,this._overlays=n,this._selection=i,this._container=je(ue.BOX_HTML),this._searchInput=Xe(ue.INPUT_SELECTOR,this._container),this._resultsContainer=Xe(ue.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}function Lg(e,t,n){var i=function(o){var a="";return o.forEach(function(c){c.matched?a+='<strong class="'+ue.RESULT_HIGHLIGHT_CLASS+'">'+sf(c.matched)+"</strong>":a+=sf(c.normal)}),a!==""?a:null}(t),r=je(n);r.innerHTML=i,e.appendChild(r)}ue.$inject=["canvas","eventBus","overlays","selection"],ue.prototype._bindEvents=function(){var e=this;function t(n,i,r,o){e._eventMaps.push({el:n,type:r,listener:Gt.bind(n,i,r,o)})}t(document,"html","click",function(n){e.close()}),t(this._container,ue.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,ue.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,ue.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,ue.INPUT_SELECTOR,"keydown",function(n){n.keyCode===38&&n.preventDefault(),n.keyCode===40&&n.preventDefault()}),t(this._container,ue.INPUT_SELECTOR,"keyup",function(n){if(n.keyCode===27)return e.close();if(n.keyCode===13){var i=e._getCurrentResult();return i?e._select(i):e.close()}return n.keyCode===38?e._scrollToDirection(!0):n.keyCode===40?e._scrollToDirection():void(n.keyCode!==37&&n.keyCode!==39&&e._search(n.delegateTarget.value))})},ue.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){Gt.unbind(e.el,e.type,e.listener)})},ue.prototype._search=function(e){var t=this;if(this._clearResults(),e&&e!==""){var n=this._searchProvider.find(e);if(n.length){n.forEach(function(r){var o=r.element.id,a=t._createResultNode(r,o);t._results[o]={element:r.element,node:a}});var i=Xe(ue.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},ue.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},ue.prototype._scrollToNode=function(e){if(e&&e!==this._getCurrentResult()){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<i&&(this._resultsContainer.scrollTop=i)}},ue.prototype._clearResults=function(){La(this._resultsContainer),this._results=[],this._resetOverlay(),this._eventBus.fire("searchPad.cleared")},ue.prototype._getCurrentResult=function(){return Xe(ue.RESULT_SELECTED_SELECTOR,this._resultsContainer)},ue.prototype._createResultNode=function(e,t){var n=je(ue.RESULT_HTML);return e.primaryTokens.length>0&&Lg(n,e.primaryTokens,ue.RESULT_PRIMARY_HTML),Lg(n,e.secondaryTokens,ue.RESULT_SECONDARY_HTML),$t(n,ue.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},ue.prototype.registerProvider=function(e){this._searchProvider=e},ue.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,ot(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},ue.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,ot(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},ue.prototype.toggle=function(){this.isOpen()?this.close():this.open()},ue.prototype.isOpen=function(){return this._open},ue.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&ot(t).remove(ue.RESULT_SELECTED_CLASS);var n=$t(e,ue.RESULT_ID_ATTRIBUTE),i=this._results[n].element;ot(e).add(ue.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},ue.prototype._select=function(e){var t=$t(e,ue.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},ue.prototype._resetOverlay=function(e){if(this._overlayId&&this._overlays.remove(this._overlayId),e){var t=function(n){var i=6,r=n.width+2*i,o=n.height+2*i,a=["width: "+r+"px","height: "+o+"px"].join("; ");return{position:{bottom:o-i,right:r-i},show:!0,html:'<div style="'+a+'" class="'+ue.OVERLAY_CLASS+'"></div>'}}(vt(e));this._overlayId=this._overlays.add(e,t)}},ue.CONTAINER_SELECTOR=".djs-search-container",ue.INPUT_SELECTOR=".djs-search-input input",ue.RESULTS_CONTAINER_SELECTOR=".djs-search-results",ue.RESULT_SELECTOR=".djs-search-result",ue.RESULT_SELECTED_CLASS="djs-search-result-selected",ue.RESULT_SELECTED_SELECTOR="."+ue.RESULT_SELECTED_CLASS,ue.RESULT_ID_ATTRIBUTE="data-result-id",ue.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",ue.OVERLAY_CLASS="djs-search-overlay",ue.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>',ue.RESULT_HTML='<div class="djs-search-result"></div>',ue.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',ue.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';const Ow={__depends__:[nu,Rn],searchPad:["type",ue]};function Yp(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function jg(e){return de(e,function(t){return!!t.matched}).length>0}function Vg(e,t){var n=[],i=e;if(!e)return n;e=e.toLowerCase(),t=t.toLowerCase();var r=e.indexOf(t);return r>-1?(r!==0&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,t.length)}),t.length+r<e.length&&n.push({normal:i.substr(t.length+r,e.length)})):n.push({normal:i}),n}Yp.$inject=["elementRegistry","searchPad","canvas"],Yp.prototype.find=function(e){var t=this._canvas.getRootElement(),n=this._elementRegistry.filter(function(i){return!i.labelTarget});return n=de(n,function(i){return i!==t}),n=Xt(n=de(n=lt(n,function(i){return{primaryTokens:Vg(pn(i),e),secondaryTokens:Vg(i.id,e),element:i}}),function(i){return jg(i.primaryTokens)||jg(i.secondaryTokens)}),function(i){return pn(i.element)+i.element.id})};const Lw={__depends__:[Ow],__init__:["bpmnSearch"],bpmnSearch:["type",Yp]};function Ln(e){Mo.call(this,e)}ie(Ln,Mo),Ln.Viewer=qn,Ln.NavigatedViewer=Oo,Ln.prototype.createDiagram=Pr(function(){return this.importXML('<?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>')}),Ln.prototype._interactionModules=[Dm,jm,mE,Fm],Ln.prototype._modelingModules=[vE,wE,AE,SE,IE,_u,DE,u_,Kf,Es,d_,f_,g_,b_,x_,S_,k_,xw,Ew,kw,Pw,Sv,Bw,Lw],Ln.prototype._modules=[].concat(qn.prototype._modules,Ln.prototype._interactionModules,Ln.prototype._modelingModules);const Fg=(e,t,n)=>(n||(n="camunda"),`<?xml version="1.0" encoding="UTF-8"?>
  17. <bpmn2:definitions
  18. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  19. xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
  20. xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
  21. xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
  22. xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
  23. id="diagram_${e}"
  24. targetNamespace="${{activiti:"http://activiti.org/bpmn",camunda:"http://bpmn.io/schema/bpmn",flowable:"http://flowable.org/bpmn"}[n]}">
  25. <bpmn2:process id="${e}" name="${t}" isExecutable="true">
  26. </bpmn2:process>
  27. <bpmndi:BPMNDiagram id="BPMNDiagram_1">
  28. <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${e}">
  29. </bpmndi:BPMNPlane>
  30. </bpmndi:BPMNDiagram>
  31. </bpmn2:definitions>`),jw={"Append EndEvent":"\u8FFD\u52A0\u7ED3\u675F\u4E8B\u4EF6","Append Gateway":"\u8FFD\u52A0\u7F51\u5173","Append Task":"\u8FFD\u52A0\u4EFB\u52A1","Append Intermediate/Boundary Event":"\u8FFD\u52A0\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6/\u8FB9\u754C\u4E8B\u4EF6","Activate the global connect tool":"\u6FC0\u6D3B\u5168\u5C40\u8FDE\u63A5\u5DE5\u5177","Append {type}":"\u6DFB\u52A0 {type}","Add Lane above":"\u5728\u4E0A\u9762\u6DFB\u52A0\u9053","Divide into two Lanes":"\u5206\u5272\u6210\u4E24\u4E2A\u9053","Divide into three Lanes":"\u5206\u5272\u6210\u4E09\u4E2A\u9053","Add Lane below":"\u5728\u4E0B\u9762\u6DFB\u52A0\u9053","Append compensation activity":"\u8FFD\u52A0\u8865\u507F\u6D3B\u52A8","Change type":"\u4FEE\u6539\u7C7B\u578B","Connect using Association":"\u4F7F\u7528\u5173\u8054\u8FDE\u63A5","Connect using Sequence/MessageFlow or Association":"\u4F7F\u7528\u987A\u5E8F/\u6D88\u606F\u6D41\u6216\u8005\u5173\u8054\u8FDE\u63A5","Connect using DataInputAssociation":"\u4F7F\u7528\u6570\u636E\u8F93\u5165\u5173\u8054\u8FDE\u63A5",Remove:"\u79FB\u9664","Activate the hand tool":"\u6FC0\u6D3B\u6293\u624B\u5DE5\u5177","Activate the lasso tool":"\u6FC0\u6D3B\u5957\u7D22\u5DE5\u5177","Activate the create/remove space tool":"\u6FC0\u6D3B\u521B\u5EFA/\u5220\u9664\u7A7A\u95F4\u5DE5\u5177","Create expanded SubProcess":"\u521B\u5EFA\u6269\u5C55\u5B50\u8FC7\u7A0B","Create IntermediateThrowEvent/BoundaryEvent":"\u521B\u5EFA\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6/\u8FB9\u754C\u4E8B\u4EF6","Create Pool/Participant":"\u521B\u5EFA\u6C60/\u53C2\u4E0E\u8005","Parallel Multi Instance":"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6","Sequential Multi Instance":"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",DataObjectReference:"\u6570\u636E\u5BF9\u8C61\u53C2\u8003",DataStoreReference:"\u6570\u636E\u5B58\u50A8\u53C2\u8003",Loop:"\u5FAA\u73AF","Ad-hoc":"\u5373\u5E2D","Create {type}":"\u521B\u5EFA {type}",Task:"\u4EFB\u52A1","Send Task":"\u53D1\u9001\u4EFB\u52A1","Receive Task":"\u63A5\u6536\u4EFB\u52A1","User Task":"\u7528\u6237\u4EFB\u52A1","Manual Task":"\u624B\u5DE5\u4EFB\u52A1","Business Rule Task":"\u4E1A\u52A1\u89C4\u5219\u4EFB\u52A1","Service Task":"\u670D\u52A1\u4EFB\u52A1","Script Task":"\u811A\u672C\u4EFB\u52A1","Call Activity":"\u8C03\u7528\u6D3B\u52A8","Sub Process (collapsed)":"\u5B50\u6D41\u7A0B\uFF08\u6298\u53E0\u7684\uFF09","Sub Process (expanded)":"\u5B50\u6D41\u7A0B\uFF08\u5C55\u5F00\u7684\uFF09","Start Event":"\u5F00\u59CB\u4E8B\u4EF6",StartEvent:"\u5F00\u59CB\u4E8B\u4EF6","Intermediate Throw Event":"\u4E2D\u95F4\u4E8B\u4EF6","End Event":"\u7ED3\u675F\u4E8B\u4EF6",EndEvent:"\u7ED3\u675F\u4E8B\u4EF6","Create StartEvent":"\u521B\u5EFA\u5F00\u59CB\u4E8B\u4EF6","Create EndEvent":"\u521B\u5EFA\u7ED3\u675F\u4E8B\u4EF6","Create Task":"\u521B\u5EFA\u4EFB\u52A1","Create User Task":"\u521B\u5EFA\u7528\u6237\u4EFB\u52A1","Create Gateway":"\u521B\u5EFA\u7F51\u5173","Create DataObjectReference":"\u521B\u5EFA\u6570\u636E\u5BF9\u8C61","Create DataStoreReference":"\u521B\u5EFA\u6570\u636E\u5B58\u50A8","Create Group":"\u521B\u5EFA\u5206\u7EC4","Create Intermediate/Boundary Event":"\u521B\u5EFA\u4E2D\u95F4/\u8FB9\u754C\u4E8B\u4EF6","Message Start Event":"\u6D88\u606F\u5F00\u59CB\u4E8B\u4EF6","Timer Start Event":"\u5B9A\u65F6\u5F00\u59CB\u4E8B\u4EF6","Conditional Start Event":"\u6761\u4EF6\u5F00\u59CB\u4E8B\u4EF6","Signal Start Event":"\u4FE1\u53F7\u5F00\u59CB\u4E8B\u4EF6","Error Start Event":"\u9519\u8BEF\u5F00\u59CB\u4E8B\u4EF6","Escalation Start Event":"\u5347\u7EA7\u5F00\u59CB\u4E8B\u4EF6","Compensation Start Event":"\u8865\u507F\u5F00\u59CB\u4E8B\u4EF6","Message Start Event (non-interrupting)":"\u6D88\u606F\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Timer Start Event (non-interrupting)":"\u5B9A\u65F6\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Conditional Start Event (non-interrupting)":"\u6761\u4EF6\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Signal Start Event (non-interrupting)":"\u4FE1\u53F7\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Escalation Start Event (non-interrupting)":"\u5347\u7EA7\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Message Intermediate Catch Event":"\u6D88\u606F\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Message Intermediate Throw Event":"\u6D88\u606F\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Timer Intermediate Catch Event":"\u5B9A\u65F6\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Escalation Intermediate Throw Event":"\u5347\u7EA7\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Conditional Intermediate Catch Event":"\u6761\u4EF6\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Link Intermediate Catch Event":"\u94FE\u63A5\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Link Intermediate Throw Event":"\u94FE\u63A5\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Compensation Intermediate Throw Event":"\u8865\u507F\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Signal Intermediate Catch Event":"\u4FE1\u53F7\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Signal Intermediate Throw Event":"\u4FE1\u53F7\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Message End Event":"\u6D88\u606F\u7ED3\u675F\u4E8B\u4EF6","Escalation End Event":"\u5B9A\u65F6\u7ED3\u675F\u4E8B\u4EF6","Error End Event":"\u9519\u8BEF\u7ED3\u675F\u4E8B\u4EF6","Cancel End Event":"\u53D6\u6D88\u7ED3\u675F\u4E8B\u4EF6","Compensation End Event":"\u8865\u507F\u7ED3\u675F\u4E8B\u4EF6","Signal End Event":"\u4FE1\u53F7\u7ED3\u675F\u4E8B\u4EF6","Terminate End Event":"\u7EC8\u6B62\u7ED3\u675F\u4E8B\u4EF6","Message Boundary Event":"\u6D88\u606F\u8FB9\u754C\u4E8B\u4EF6","Message Boundary Event (non-interrupting)":"\u6D88\u606F\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Timer Boundary Event":"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6","Timer Boundary Event (non-interrupting)":"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Escalation Boundary Event":"\u5347\u7EA7\u8FB9\u754C\u4E8B\u4EF6","Escalation Boundary Event (non-interrupting)":"\u5347\u7EA7\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Conditional Boundary Event":"\u6761\u4EF6\u8FB9\u754C\u4E8B\u4EF6","Conditional Boundary Event (non-interrupting)":"\u6761\u4EF6\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Error Boundary Event":"\u9519\u8BEF\u8FB9\u754C\u4E8B\u4EF6","Cancel Boundary Event":"\u53D6\u6D88\u8FB9\u754C\u4E8B\u4EF6","Signal Boundary Event":"\u4FE1\u53F7\u8FB9\u754C\u4E8B\u4EF6","Signal Boundary Event (non-interrupting)":"\u4FE1\u53F7\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Compensation Boundary Event":"\u8865\u507F\u8FB9\u754C\u4E8B\u4EF6","Exclusive Gateway":"\u4E92\u65A5\u7F51\u5173","Parallel Gateway":"\u5E76\u884C\u7F51\u5173","Inclusive Gateway":"\u76F8\u5BB9\u7F51\u5173","Complex Gateway":"\u590D\u6742\u7F51\u5173","Event based Gateway":"\u4E8B\u4EF6\u7F51\u5173",Transaction:"\u8F6C\u8FD0","Sub Process":"\u5B50\u6D41\u7A0B","Event Sub Process":"\u4E8B\u4EF6\u5B50\u6D41\u7A0B","Collapsed Pool":"\u6298\u53E0\u6C60","Expanded Pool":"\u5C55\u5F00\u6C60","no parent for {element} in {parent}":"\u5728{parent}\u91CC\uFF0C{element}\u6CA1\u6709\u7236\u7C7B","no shape type specified":"\u6CA1\u6709\u6307\u5B9A\u7684\u5F62\u72B6\u7C7B\u578B","flow elements must be children of pools/participants":"\u6D41\u5143\u7D20\u5FC5\u987B\u662F\u6C60/\u53C2\u4E0E\u8005\u7684\u5B50\u7C7B","out of bounds release":"out of bounds release","more than {count} child lanes":"\u5B50\u9053\u5927\u4E8E{count} ","element required":"\u5143\u7D20\u4E0D\u80FD\u4E3A\u7A7A","diagram not part of bpmn:Definitions":"\u6D41\u7A0B\u56FE\u4E0D\u7B26\u5408bpmn\u89C4\u8303","no diagram to display":"\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6D41\u7A0B\u56FE","no process or collaboration to display":"\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6D41\u7A0B/\u534F\u4F5C","element {element} referenced by {referenced}#{property} not yet drawn":"\u7531{referenced}#{property}\u5F15\u7528\u7684{element}\u5143\u7D20\u4ECD\u672A\u7ED8\u5236","already rendered {element}":"{element} \u5DF2\u88AB\u6E32\u67D3","failed to import {element}":"\u5BFC\u5165{element}\u5931\u8D25",Id:"\u7F16\u53F7",Name:"\u540D\u79F0",General:"\u5E38\u89C4",Details:"\u8BE6\u60C5","Message Name":"\u6D88\u606F\u540D\u79F0",Message:"\u6D88\u606F",Initiator:"\u521B\u5EFA\u8005","Asynchronous Continuations":"\u6301\u7EED\u5F02\u6B65","Asynchronous Before":"\u5F02\u6B65\u524D","Asynchronous After":"\u5F02\u6B65\u540E","Job Configuration":"\u5DE5\u4F5C\u914D\u7F6E",Exclusive:"\u6392\u9664","Job Priority":"\u5DE5\u4F5C\u4F18\u5148\u7EA7","Retry Time Cycle":"\u91CD\u8BD5\u65F6\u95F4\u5468\u671F",Documentation:"\u6587\u6863","Element Documentation":"\u5143\u7D20\u6587\u6863","History Configuration":"\u5386\u53F2\u914D\u7F6E","History Time To Live":"\u5386\u53F2\u7684\u751F\u5B58\u65F6\u95F4",Forms:"\u8868\u5355","Form Key":"\u8868\u5355key","Form Fields":"\u8868\u5355\u5B57\u6BB5","Business Key":"\u4E1A\u52A1key","Form Field":"\u8868\u5355\u5B57\u6BB5",ID:"\u7F16\u53F7",Type:"\u7C7B\u578B",Label:"\u540D\u79F0","Default Value":"\u9ED8\u8BA4\u503C","Default Flow":"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84","Conditional Flow":"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84","Sequence Flow":"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",Validation:"\u6821\u9A8C","Add Constraint":"\u6DFB\u52A0\u7EA6\u675F",Config:"\u914D\u7F6E",Properties:"\u5C5E\u6027","Add Property":"\u6DFB\u52A0\u5C5E\u6027",Value:"\u503C",Listeners:"\u76D1\u542C\u5668","Execution Listener":"\u6267\u884C\u76D1\u542C","Event Type":"\u4E8B\u4EF6\u7C7B\u578B","Listener Type":"\u76D1\u542C\u5668\u7C7B\u578B","Java Class":"Java\u7C7B",Expression:"\u8868\u8FBE\u5F0F","Must provide a value":"\u5FC5\u987B\u63D0\u4F9B\u4E00\u4E2A\u503C","Delegate Expression":"\u4EE3\u7406\u8868\u8FBE\u5F0F",Script:"\u811A\u672C","Script Format":"\u811A\u672C\u683C\u5F0F","Script Type":"\u811A\u672C\u7C7B\u578B","Inline Script":"\u5185\u8054\u811A\u672C","External Script":"\u5916\u90E8\u811A\u672C",Resource:"\u8D44\u6E90","Field Injection":"\u5B57\u6BB5\u6CE8\u5165",Extensions:"\u6269\u5C55","Input/Output":"\u8F93\u5165/\u8F93\u51FA","Input Parameters":"\u8F93\u5165\u53C2\u6570","Output Parameters":"\u8F93\u51FA\u53C2\u6570",Parameters:"\u53C2\u6570","Output Parameter":"\u8F93\u51FA\u53C2\u6570","Timer Definition Type":"\u5B9A\u65F6\u5668\u5B9A\u4E49\u7C7B\u578B","Timer Definition":"\u5B9A\u65F6\u5668\u5B9A\u4E49",Date:"\u65E5\u671F",Duration:"\u6301\u7EED",Cycle:"\u5FAA\u73AF",Signal:"\u4FE1\u53F7","Signal Name":"\u4FE1\u53F7\u540D\u79F0",Escalation:"\u5347\u7EA7",Error:"\u9519\u8BEF","Link Name":"\u94FE\u63A5\u540D\u79F0",Condition:"\u6761\u4EF6\u540D\u79F0","Variable Name":"\u53D8\u91CF\u540D\u79F0","Variable Event":"\u53D8\u91CF\u4E8B\u4EF6","Specify more than one variable change event as a comma separated list.":"\u591A\u4E2A\u53D8\u91CF\u4E8B\u4EF6\u4EE5\u9017\u53F7\u9694\u5F00","Wait for Completion":"\u7B49\u5F85\u5B8C\u6210","Activity Ref":"\u6D3B\u52A8\u53C2\u8003","Version Tag":"\u7248\u672C\u6807\u7B7E",Executable:"\u53EF\u6267\u884C\u6587\u4EF6","External Task Configuration":"\u6269\u5C55\u4EFB\u52A1\u914D\u7F6E","Task Priority":"\u4EFB\u52A1\u4F18\u5148\u7EA7",External:"\u5916\u90E8",Connector:"\u8FDE\u63A5\u5668","Must configure Connector":"\u5FC5\u987B\u914D\u7F6E\u8FDE\u63A5\u5668","Connector Id":"\u8FDE\u63A5\u5668\u7F16\u53F7",Implementation:"\u5B9E\u73B0\u65B9\u5F0F","Field Injections":"\u5B57\u6BB5\u6CE8\u5165",Fields:"\u5B57\u6BB5","Result Variable":"\u7ED3\u679C\u53D8\u91CF",Topic:"\u4E3B\u9898","Configure Connector":"\u914D\u7F6E\u8FDE\u63A5\u5668","Input Parameter":"\u8F93\u5165\u53C2\u6570",Assignee:"\u4EE3\u7406\u4EBA","Candidate Users":"\u5019\u9009\u7528\u6237","Candidate Groups":"\u5019\u9009\u7EC4","Due Date":"\u5230\u671F\u65F6\u95F4","Follow Up Date":"\u8DDF\u8E2A\u65E5\u671F",Priority:"\u4F18\u5148\u7EA7","The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"\u8DDF\u8E2A\u65E5\u671F\u5FC5\u987B\u7B26\u5408EL\u8868\u8FBE\u5F0F\uFF0C\u5982\uFF1A ${someDate} ,\u6216\u8005\u4E00\u4E2AISO\u6807\u51C6\u65E5\u671F\uFF0C\u5982\uFF1A2015-06-26T09:54:00","The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"\u8DDF\u8E2A\u65E5\u671F\u5FC5\u987B\u7B26\u5408EL\u8868\u8FBE\u5F0F\uFF0C\u5982\uFF1A ${someDate} ,\u6216\u8005\u4E00\u4E2AISO\u6807\u51C6\u65E5\u671F\uFF0C\u5982\uFF1A2015-06-26T09:54:00",Variables:"\u53D8\u91CF","Candidate Starter Configuration":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u914D\u7F6E","Candidate Starter Groups":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u7EC4","This maps to the process definition key.":"\u8FD9\u6620\u5C04\u5230\u6D41\u7A0B\u5B9A\u4E49\u952E\u3002","Candidate Starter Users":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u7684\u7528\u6237","Specify more than one user as a comma separated list.":"\u6307\u5B9A\u591A\u4E2A\u7528\u6237\u4F5C\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5217\u8868\u3002","Tasklist Configuration":"Tasklist\u914D\u7F6E",Startable:"\u542F\u52A8","Specify more than one group as a comma separated list.":"\u6307\u5B9A\u591A\u4E2A\u7EC4\u4F5C\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5217\u8868\u3002"};var _c,Jp,Vw={exports:{}};_c=typeof window<"u"?window:P0,Jp=function(e,t){var n=(this!==void 0?this:e).SVG=function(s){if(n.supported)return s=new n.Doc(s),n.parser.draw||n.prepare(),s};if(n.ns="http://www.w3.org/2000/svg",n.xmlns="http://www.w3.org/2000/xmlns/",n.xlink="http://www.w3.org/1999/xlink",n.svgjs="http://svgjs.com/svgjs",n.supported=!!t.createElementNS&&!!t.createElementNS(n.ns,"svg").createSVGRect,!n.supported)return!1;n.did=1e3,n.eid=function(s){return"Svgjs"+d(s)+n.did++},n.create=function(s){var h=t.createElementNS(this.ns,s);return h.setAttribute("id",this.eid(s)),h},n.extend=function(){var s,h,m,E;for(h=(s=[].slice.call(arguments)).pop(),E=s.length-1;E>=0;E--)if(s[E])for(m in h)s[E].prototype[m]=h[m];n.Set&&n.Set.inherit&&n.Set.inherit()},n.invent=function(s){var h=typeof s.create=="function"?s.create:function(){this.constructor.call(this,n.create(s.create))};return s.inherit&&(h.prototype=new s.inherit),s.extend&&n.extend(h,s.extend),s.construct&&n.extend(s.parent||n.Container,s.construct),h},n.adopt=function(s){return s?s.instance?s.instance:((h=s.nodeName=="svg"?s.parentNode instanceof e.SVGElement?new n.Nested:new n.Doc:s.nodeName=="linearGradient"?new n.Gradient("linear"):s.nodeName=="radialGradient"?new n.Gradient("radial"):n[d(s.nodeName)]?new n[d(s.nodeName)]:new n.Element(s)).type=s.nodeName,h.node=s,s.instance=h,h instanceof n.Doc&&h.namespace().defs(),h.setData(JSON.parse(s.getAttribute("svgjs:data"))||{}),h):null;var h},n.prepare=function(){var s=t.getElementsByTagName("body")[0],h=(s?new n.Doc(s):n.adopt(t.documentElement).nested()).size(2,0);n.parser={body:s||t.documentElement,draw:h.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:h.polyline().node,path:h.path().node,native:n.create("svg")}},n.parser={native:n.create("svg")},t.addEventListener("DOMContentLoaded",function(){n.parser.draw||n.prepare()},!1),n.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},n.utils={map:function(s,h){var m,E=s.length,T=[];for(m=0;m<E;m++)T.push(h(s[m]));return T},filter:function(s,h){var m,E=s.length,T=[];for(m=0;m<E;m++)h(s[m])&&T.push(s[m]);return T},radians:function(s){return s%360*Math.PI/180},degrees:function(s){return 180*s/Math.PI%360},filterSVGElements:function(s){return this.filter(s,function(h){return h instanceof e.SVGElement})}},n.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},n.Color=function(s){var h,m;this.r=0,this.g=0,this.b=0,s&&(typeof s=="string"?n.regex.isRgb.test(s)?(h=n.regex.rgb.exec(s.replace(n.regex.whitespace,"")),this.r=parseInt(h[1]),this.g=parseInt(h[2]),this.b=parseInt(h[3])):n.regex.isHex.test(s)&&(h=n.regex.hex.exec((m=s).length==4?["#",m.substring(1,2),m.substring(1,2),m.substring(2,3),m.substring(2,3),m.substring(3,4),m.substring(3,4)].join(""):m),this.r=parseInt(h[1],16),this.g=parseInt(h[2],16),this.b=parseInt(h[3],16)):typeof s=="object"&&(this.r=s.r,this.g=s.g,this.b=s.b))},n.extend(n.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+y(this.r)+y(this.g)+y(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(s){return this.destination=new n.Color(s),this},at:function(s){return this.destination?(s=s<0?0:s>1?1:s,new n.Color({r:~~(this.r+(this.destination.r-this.r)*s),g:~~(this.g+(this.destination.g-this.g)*s),b:~~(this.b+(this.destination.b-this.b)*s)})):this}}),n.Color.test=function(s){return s+="",n.regex.isHex.test(s)||n.regex.isRgb.test(s)},n.Color.isRgb=function(s){return s&&typeof s.r=="number"&&typeof s.g=="number"&&typeof s.b=="number"},n.Color.isColor=function(s){return n.Color.isRgb(s)||n.Color.test(s)},n.Array=function(s,h){(s=(s||[]).valueOf()).length==0&&h&&(s=h.valueOf()),this.value=this.parse(s)},n.extend(n.Array,{morph:function(s){if(this.destination=this.parse(s),this.value.length!=this.destination.length){for(var h=this.value[this.value.length-1],m=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(m);for(;this.value.length<this.destination.length;)this.value.push(h)}return this},settle:function(){for(var s=0,h=this.value.length,m=[];s<h;s++)m.indexOf(this.value[s])==-1&&m.push(this.value[s]);return this.value=m},at:function(s){if(!this.destination)return this;for(var h=0,m=this.value.length,E=[];h<m;h++)E.push(this.value[h]+(this.destination[h]-this.value[h])*s);return new n.Array(E)},toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(s){return s=s.valueOf(),Array.isArray(s)?s:this.split(s)},split:function(s){return s.trim().split(n.regex.delimiter).map(parseFloat)},reverse:function(){return this.value.reverse(),this},clone:function(){var s=new this.constructor;return s.value=u(this.value),s}}),n.PointArray=function(s,h){n.Array.call(this,s,h||[[0,0]])},n.PointArray.prototype=new n.Array,n.PointArray.prototype.constructor=n.PointArray,n.extend(n.PointArray,{toString:function(){for(var s=0,h=this.value.length,m=[];s<h;s++)m.push(this.value[s].join(","));return m.join(" ")},toLine:function(){return{x1:this.value[0][0],y1:this.value[0][1],x2:this.value[1][0],y2:this.value[1][1]}},at:function(s){if(!this.destination)return this;for(var h=0,m=this.value.length,E=[];h<m;h++)E.push([this.value[h][0]+(this.destination[h][0]-this.value[h][0])*s,this.value[h][1]+(this.destination[h][1]-this.value[h][1])*s]);return new n.PointArray(E)},parse:function(s){var h=[];if(s=s.valueOf(),Array.isArray(s)){if(Array.isArray(s[0]))return s.map(function(T){return T.slice()});if(s[0].x!=null)return s.map(function(T){return[T.x,T.y]})}else s=s.trim().split(n.regex.delimiter).map(parseFloat);s.length%2!=0&&s.pop();for(var m=0,E=s.length;m<E;m+=2)h.push([s[m],s[m+1]]);return h},move:function(s,h){var m=this.bbox();if(s-=m.x,h-=m.y,!isNaN(s)&&!isNaN(h))for(var E=this.value.length-1;E>=0;E--)this.value[E]=[this.value[E][0]+s,this.value[E][1]+h];return this},size:function(s,h){var m,E=this.bbox();for(m=this.value.length-1;m>=0;m--)E.width&&(this.value[m][0]=(this.value[m][0]-E.x)*s/E.width+E.x),E.height&&(this.value[m][1]=(this.value[m][1]-E.y)*h/E.height+E.y);return this},bbox:function(){return n.parser.poly.setAttribute("points",this.toString()),n.parser.poly.getBBox()}});for(var i={M:function(s,h,m){return h.x=m.x=s[0],h.y=m.y=s[1],["M",h.x,h.y]},L:function(s,h){return h.x=s[0],h.y=s[1],["L",s[0],s[1]]},H:function(s,h){return h.x=s[0],["H",s[0]]},V:function(s,h){return h.y=s[0],["V",s[0]]},C:function(s,h){return h.x=s[4],h.y=s[5],["C",s[0],s[1],s[2],s[3],s[4],s[5]]},S:function(s,h){return h.x=s[2],h.y=s[3],["S",s[0],s[1],s[2],s[3]]},Q:function(s,h){return h.x=s[2],h.y=s[3],["Q",s[0],s[1],s[2],s[3]]},T:function(s,h){return h.x=s[0],h.y=s[1],["T",s[0],s[1]]},Z:function(s,h,m){return h.x=m.x,h.y=m.y,["Z"]},A:function(s,h){return h.x=s[5],h.y=s[6],["A",s[0],s[1],s[2],s[3],s[4],s[5],s[6]]}},r="mlhvqtcsaz".split(""),o=0,a=r.length;o<a;++o)i[r[o]]=function(s){return function(h,m,E){if(s=="H")h[0]=h[0]+m.x;else if(s=="V")h[0]=h[0]+m.y;else if(s=="A")h[5]=h[5]+m.x,h[6]=h[6]+m.y;else for(var T=0,M=h.length;T<M;++T)h[T]=h[T]+(T%2?m.y:m.x);return i[s](h,m,E)}}(r[o].toUpperCase());n.PathArray=function(s,h){n.Array.call(this,s,h||[["M",0,0]])},n.PathArray.prototype=new n.Array,n.PathArray.prototype.constructor=n.PathArray,n.extend(n.PathArray,{toString:function(){return function(s){for(var h=0,m=s.length,E="";h<m;h++)E+=s[h][0],s[h][1]!=null&&(E+=s[h][1],s[h][2]!=null&&(E+=" ",E+=s[h][2],s[h][3]!=null&&(E+=" ",E+=s[h][3],E+=" ",E+=s[h][4],s[h][5]!=null&&(E+=" ",E+=s[h][5],E+=" ",E+=s[h][6],s[h][7]!=null&&(E+=" ",E+=s[h][7])))));return E+" "}(this.value)},move:function(s,h){var m=this.bbox();if(s-=m.x,h-=m.y,!isNaN(s)&&!isNaN(h))for(var E,T=this.value.length-1;T>=0;T--)(E=this.value[T][0])=="M"||E=="L"||E=="T"?(this.value[T][1]+=s,this.value[T][2]+=h):E=="H"?this.value[T][1]+=s:E=="V"?this.value[T][1]+=h:E=="C"||E=="S"||E=="Q"?(this.value[T][1]+=s,this.value[T][2]+=h,this.value[T][3]+=s,this.value[T][4]+=h,E=="C"&&(this.value[T][5]+=s,this.value[T][6]+=h)):E=="A"&&(this.value[T][6]+=s,this.value[T][7]+=h);return this},size:function(s,h){var m,E,T=this.bbox();for(m=this.value.length-1;m>=0;m--)(E=this.value[m][0])=="M"||E=="L"||E=="T"?(this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x,this.value[m][2]=(this.value[m][2]-T.y)*h/T.height+T.y):E=="H"?this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x:E=="V"?this.value[m][1]=(this.value[m][1]-T.y)*h/T.height+T.y:E=="C"||E=="S"||E=="Q"?(this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x,this.value[m][2]=(this.value[m][2]-T.y)*h/T.height+T.y,this.value[m][3]=(this.value[m][3]-T.x)*s/T.width+T.x,this.value[m][4]=(this.value[m][4]-T.y)*h/T.height+T.y,E=="C"&&(this.value[m][5]=(this.value[m][5]-T.x)*s/T.width+T.x,this.value[m][6]=(this.value[m][6]-T.y)*h/T.height+T.y)):E=="A"&&(this.value[m][1]=this.value[m][1]*s/T.width,this.value[m][2]=this.value[m][2]*h/T.height,this.value[m][6]=(this.value[m][6]-T.x)*s/T.width+T.x,this.value[m][7]=(this.value[m][7]-T.y)*h/T.height+T.y);return this},equalCommands:function(s){var h,m,E;for(s=new n.PathArray(s),E=this.value.length===s.value.length,h=0,m=this.value.length;E&&h<m;h++)E=this.value[h][0]===s.value[h][0];return E},morph:function(s){return s=new n.PathArray(s),this.equalCommands(s)?this.destination=s:this.destination=null,this},at:function(s){if(!this.destination)return this;var h,m,E,T,M=this.value,N=this.destination.value,$=[],P=new n.PathArray;for(h=0,m=M.length;h<m;h++){for($[h]=[M[h][0]],E=1,T=M[h].length;E<T;E++)$[h][E]=M[h][E]+(N[h][E]-M[h][E])*s;$[h][0]==="A"&&($[h][4]=+($[h][4]!=0),$[h][5]=+($[h][5]!=0))}return P.value=$,P},parse:function(s){if(s instanceof n.PathArray)return s.valueOf();var h,m={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};s=typeof s=="string"?s.replace(n.regex.numbersWithDots,l).replace(n.regex.pathLetters," $& ").replace(n.regex.hyphen,"$1 -").trim().split(n.regex.delimiter):s.reduce(function(P,x){return[].concat.call(P,x)},[]);var E=[],T=new n.Point,M=new n.Point,N=0,$=s.length;do n.regex.isPathLetter.test(s[N])?(h=s[N],++N):h=="M"?h="L":h=="m"&&(h="l"),E.push(i[h].call(null,s.slice(N,N+=m[h.toUpperCase()]).map(parseFloat),T,M));while($>N);return E},bbox:function(){return n.parser.path.setAttribute("d",this.toString()),n.parser.path.getBBox()}}),n.Number=n.invent({create:function(s,h){this.value=0,this.unit=h||"",typeof s=="number"?this.value=isNaN(s)?0:isFinite(s)?s:s<0?-34e37:34e37:typeof s=="string"?(h=s.match(n.regex.numberAndUnit))&&(this.value=parseFloat(h[1]),h[5]=="%"?this.value/=100:h[5]=="s"&&(this.value*=1e3),this.unit=h[5]):s instanceof n.Number&&(this.value=s.valueOf(),this.unit=s.unit)},extend:{toString:function(){return(this.unit=="%"?~~(1e8*this.value)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(s){return s=new n.Number(s),new n.Number(this+s,this.unit||s.unit)},minus:function(s){return s=new n.Number(s),new n.Number(this-s,this.unit||s.unit)},times:function(s){return s=new n.Number(s),new n.Number(this*s,this.unit||s.unit)},divide:function(s){return s=new n.Number(s),new n.Number(this/s,this.unit||s.unit)},to:function(s){var h=new n.Number(this);return typeof s=="string"&&(h.unit=s),h},morph:function(s){return this.destination=new n.Number(s),s.relative&&(this.destination.value+=this.value),this},at:function(s){return this.destination?new n.Number(this.destination).minus(this).times(s).plus(this):this}}}),n.Element=n.invent({create:function(s){this._stroke=n.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=s)&&(this.type=s.nodeName,this.node.instance=this,this._events=s._events||{},this._stroke=s.getAttribute("stroke")||this._stroke)},extend:{x:function(s){return this.attr("x",s)},y:function(s){return this.attr("y",s)},cx:function(s){return s==null?this.x()+this.width()/2:this.x(s-this.width()/2)},cy:function(s){return s==null?this.y()+this.height()/2:this.y(s-this.height()/2)},move:function(s,h){return this.x(s).y(h)},center:function(s,h){return this.cx(s).cy(h)},width:function(s){return this.attr("width",s)},height:function(s){return this.attr("height",s)},size:function(s,h){var m=f(this,s,h);return this.width(new n.Number(m.width)).height(new n.Number(m.height))},clone:function(s){this.writeDataToDom();var h=S(this.node.cloneNode(!0));return s?s.add(h):this.after(h),h},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(s){return this.after(s).remove(),s},addTo:function(s){return s.put(this)},putIn:function(s){return s.add(this)},id:function(s){return this.attr("id",s)},inside:function(s,h){var m=this.bbox();return s>m.x&&h>m.y&&s<m.x+m.width&&h<m.y+m.height},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return this.style("display")!="none"},toString:function(){return this.attr("id")},classes:function(){var s=this.attr("class");return s==null?[]:s.trim().split(n.regex.delimiter)},hasClass:function(s){return this.classes().indexOf(s)!=-1},addClass:function(s){if(!this.hasClass(s)){var h=this.classes();h.push(s),this.attr("class",h.join(" "))}return this},removeClass:function(s){return this.hasClass(s)&&this.attr("class",this.classes().filter(function(h){return h!=s}).join(" ")),this},toggleClass:function(s){return this.hasClass(s)?this.removeClass(s):this.addClass(s)},reference:function(s){return n.get(this.attr(s))},parent:function(s){var h=this;if(!h.node.parentNode)return null;if(h=n.adopt(h.node.parentNode),!s)return h;for(;h&&h.node instanceof e.SVGElement;){if(typeof s=="string"?h.matches(s):h instanceof s)return h;if(!h.node.parentNode||h.node.parentNode.nodeName=="#document"||h.node.parentNode.nodeName=="#document-fragment")return null;h=n.adopt(h.node.parentNode)}},doc:function(){return this instanceof n.Doc?this:this.parent(n.Doc)},parents:function(s){var h=[],m=this;do{if(!(m=m.parent(s))||!m.node)break;h.push(m)}while(m.parent);return h},matches:function(s){return function(h,m){return(h.matches||h.matchesSelector||h.msMatchesSelector||h.mozMatchesSelector||h.webkitMatchesSelector||h.oMatchesSelector).call(h,m)}(this.node,s)},native:function(){return this.node},svg:function(s){var h=t.createElement("svg");if(!(s&&this instanceof n.Parent))return h.appendChild(s=t.createElement("svg")),this.writeDataToDom(),s.appendChild(this.node.cloneNode(!0)),h.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");h.innerHTML="<svg>"+s.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var m=0,E=h.firstChild.childNodes.length;m<E;m++)this.node.appendChild(h.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(s){return this.dom=s,this},is:function(s){return function(h,m){return h instanceof m}(this,s)}}}),n.easing={"-":function(s){return s},"<>":function(s){return-Math.cos(s*Math.PI)/2+.5},">":function(s){return Math.sin(s*Math.PI/2)},"<":function(s){return 1-Math.cos(s*Math.PI/2)}},n.morph=function(s){return function(h,m){return new n.MorphObj(h,m).at(s)}},n.Situation=n.invent({create:function(s){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new n.Number(s.duration).valueOf(),this.delay=new n.Number(s.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=s.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),n.FX=n.invent({create:function(s){this._target=s,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(s,h,m){typeof s=="object"&&(h=s.ease,m=s.delay,s=s.duration);var E=new n.Situation({duration:s||1e3,delay:m||0,ease:n.easing[h||"-"]||h});return this.queue(E),this},delay:function(s){var h=new n.Situation({duration:s,delay:0,ease:n.easing["-"]});return this.queue(h)},target:function(s){return s&&s instanceof n.Element?(this._target=s,this):this._target},timeToAbsPos:function(s){return(s-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(s){return this.situation.duration/this._speed*s+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=e.requestAnimationFrame((function(){this.step()}).bind(this))},stopAnimFrame:function(){e.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(s){return(typeof s=="function"||s instanceof n.Situation)&&this.situations.push(s),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof n.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var s,h,m,E=this.situation;if(E.init)return this;for(s in E.animations)for(m=this.target()[s](),Array.isArray(m)||(m=[m]),Array.isArray(E.animations[s])||(E.animations[s]=[E.animations[s]]),h=m.length;h--;)E.animations[s][h]instanceof n.Number&&(m[h]=new n.Number(m[h])),E.animations[s][h]=m[h].morph(E.animations[s][h]);for(s in E.attrs)E.attrs[s]=new n.MorphObj(this.target().attr(s),E.attrs[s]);for(s in E.styles)E.styles[s]=new n.MorphObj(this.target().style(s),E.styles[s]);return E.initialTransformation=this.target().matrixify(),E.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(s,h){var m=this.active;return this.active=!1,h&&this.clearQueue(),s&&this.situation&&(!m&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var s=this.situation;this.stop(),this.situation=s,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return this.situation.loops===!0&&(this.situation.loops=this.situation.loop+1),typeof this.situation.loops=="number"?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(s,h){var m=this.situation.duration/this._speed;return this.absPos=s,h||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*m,this.situation.finish=this.situation.start+m,this.step(!0)},speed:function(s){return s===0?this.pause():s?(this._speed=s,this.at(this.absPos,!0)):this._speed},loop:function(s,h){var m=this.last();return m.loops=s==null||s,m.loop=0,h&&(m.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(s){var h=this.last();return h.reversed=s===void 0?!h.reversed:s,this},progress:function(s){return s?this.situation.ease(this.pos):this.pos},after:function(s){var h=this.last();return this.target().on("finished.fx",function m(E){E.detail.situation==h&&(s.call(this,h),this.off("finished.fx",m))}),this._callStart()},during:function(s){var h=this.last(),m=function(E){E.detail.situation==h&&s.call(this,E.detail.pos,n.morph(E.detail.pos),E.detail.eased,h)};return this.target().off("during.fx",m).on("during.fx",m),this.after(function(){this.off("during.fx",m)}),this._callStart()},afterAll:function(s){var h=function m(E){s.call(this),this.off("allfinished.fx",m)};return this.target().off("allfinished.fx",h).on("allfinished.fx",h),this._callStart()},duringAll:function(s){var h=function(m){s.call(this,m.detail.pos,n.morph(m.detail.pos),m.detail.eased,m.detail.situation)};return this.target().off("during.fx",h).on("during.fx",h),this.afterAll(function(){this.off("during.fx",h)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(s,h,m){return this.last()[m||"animations"][s]=h,this._callStart()},step:function(s){var h,m,E;s||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(h=Math.max(this.absPos,0),m=Math.floor(h),this.situation.loops===!0||m<this.situation.loops?(this.pos=h-m,E=this.situation.loop,this.situation.loop=m):(this.absPos=this.situation.loops,this.pos=1,E=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=!!((this.situation.loop-E)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos),this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var T=this.situation.ease(this.pos);for(var M in this.situation.once)M>this.lastPos&&M<=T&&(this.situation.once[M].call(this.target(),this.pos,T),delete this.situation.once[M]);return this.active&&this.target().fire("during",{pos:this.pos,eased:T,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=T,this):this},eachAt:function(){var s,h,m,E=this,T=this.target(),M=this.situation;for(s in M.animations)m=[].concat(M.animations[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(E.pos),E.pos):$}),T[s].apply(T,m);for(s in M.attrs)m=[s].concat(M.attrs[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(E.pos),E.pos):$}),T.attr.apply(T,m);for(s in M.styles)m=[s].concat(M.styles[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(E.pos),E.pos):$}),T.style.apply(T,m);if(M.transforms.length){for(m=M.initialTransformation,s=0,h=M.transforms.length;s<h;s++){var N=M.transforms[s];N instanceof n.Matrix?m=N.relative?m.multiply(new n.Matrix().morph(N).at(M.ease(this.pos))):m.morph(N).at(M.ease(this.pos)):(N.relative||N.undo(m.extract()),m=m.multiply(N.at(M.ease(this.pos))))}T.matrix(m)}return this},once:function(s,h,m){var E=this.last();return m||(s=E.ease(s)),E.once[s]=h,this},_callStart:function(){return setTimeout((function(){this.start()}).bind(this),0),this}},parent:n.Element,construct:{animate:function(s,h,m){return(this.fx||(this.fx=new n.FX(this))).animate(s,h,m)},delay:function(s){return(this.fx||(this.fx=new n.FX(this))).delay(s)},stop:function(s,h){return this.fx&&this.fx.stop(s,h),this},finish:function(){return this.fx&&this.fx.finish(),this},pause:function(){return this.fx&&this.fx.pause(),this},play:function(){return this.fx&&this.fx.play(),this},speed:function(s){if(this.fx){if(s==null)return this.fx.speed();this.fx.speed(s)}return this}}}),n.MorphObj=n.invent({create:function(s,h){return n.Color.isColor(h)?new n.Color(s).morph(h):n.regex.delimiter.test(s)?n.regex.pathLetters.test(s)?new n.PathArray(s).morph(h):new n.Array(s).morph(h):n.regex.numberAndUnit.test(h)?new n.Number(s).morph(h):(this.value=s,void(this.destination=h))},extend:{at:function(s,h){return h<1?this.value:this.destination},valueOf:function(){return this.value}}}),n.extend(n.FX,{attr:function(s,h,m){if(typeof s=="object")for(var E in s)this.attr(E,s[E]);else this.add(s,h,"attrs");return this},style:function(s,h){if(typeof s=="object")for(var m in s)this.style(m,s[m]);else this.add(s,h,"styles");return this},x:function(s,h){if(this.target()instanceof n.G)return this.transform({x:s},h),this;var m=new n.Number(s);return m.relative=h,this.add("x",m)},y:function(s,h){if(this.target()instanceof n.G)return this.transform({y:s},h),this;var m=new n.Number(s);return m.relative=h,this.add("y",m)},cx:function(s){return this.add("cx",new n.Number(s))},cy:function(s){return this.add("cy",new n.Number(s))},move:function(s,h){return this.x(s).y(h)},center:function(s,h){return this.cx(s).cy(h)},size:function(s,h){var m;return this.target()instanceof n.Text?this.attr("font-size",s):(s&&h||(m=this.target().bbox()),s||(s=m.width/m.height*h),h||(h=m.height/m.width*s),this.add("width",new n.Number(s)).add("height",new n.Number(h))),this},width:function(s){return this.add("width",new n.Number(s))},height:function(s){return this.add("height",new n.Number(s))},plot:function(s,h,m,E){return arguments.length==4?this.plot([s,h,m,E]):this.add("plot",new(this.target()).morphArray(s))},leading:function(s){return this.target().leading?this.add("leading",new n.Number(s)):this},viewbox:function(s,h,m,E){return this.target()instanceof n.Container&&this.add("viewbox",new n.ViewBox(s,h,m,E)),this},update:function(s){if(this.target()instanceof n.Stop){if(typeof s=="number"||s instanceof n.Number)return this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]});s.opacity!=null&&this.attr("stop-opacity",s.opacity),s.color!=null&&this.attr("stop-color",s.color),s.offset!=null&&this.attr("offset",s.offset)}return this}}),n.Box=n.invent({create:function(s,h,m,E){if(!(typeof s!="object"||s instanceof n.Element))return n.Box.call(this,s.left!=null?s.left:s.x,s.top!=null?s.top:s.y,s.width,s.height);arguments.length==4&&(this.x=s,this.y=h,this.width=m,this.height=E),w(this)},extend:{merge:function(s){var h=new this.constructor;return h.x=Math.min(this.x,s.x),h.y=Math.min(this.y,s.y),h.width=Math.max(this.x+this.width,s.x+s.width)-h.x,h.height=Math.max(this.y+this.height,s.y+s.height)-h.y,w(h)},transform:function(s){var h,m=1/0,E=-1/0,T=1/0,M=-1/0;return[new n.Point(this.x,this.y),new n.Point(this.x2,this.y),new n.Point(this.x,this.y2),new n.Point(this.x2,this.y2)].forEach(function(N){N=N.transform(s),m=Math.min(m,N.x),E=Math.max(E,N.x),T=Math.min(T,N.y),M=Math.max(M,N.y)}),(h=new this.constructor).x=m,h.width=E-m,h.y=T,h.height=M-T,w(h),h}}}),n.BBox=n.invent({create:function(s){if(n.Box.apply(this,[].slice.call(arguments)),s instanceof n.Element){var h;try{if(t.documentElement.contains){if(!t.documentElement.contains(s.node))throw new Exception("Element not in the dom")}else{for(var m=s.node;m.parentNode;)m=m.parentNode;if(m!=t)throw new Exception("Element not in the dom")}h=s.node.getBBox()}catch{if(s instanceof n.Shape){var E=s.clone(n.parser.draw.instance).show();h=E.node.getBBox(),E.remove()}else h={x:s.node.clientLeft,y:s.node.clientTop,width:s.node.clientWidth,height:s.node.clientHeight}}n.Box.call(this,h)}},inherit:n.Box,parent:n.Element,construct:{bbox:function(){return new n.BBox(this)}}}),n.BBox.prototype.constructor=n.BBox,n.extend(n.Element,{tbox:function(){return console.warn("Use of TBox is deprecated and mapped to RBox. Use .rbox() instead."),this.rbox(this.doc())}}),n.RBox=n.invent({create:function(s){n.Box.apply(this,[].slice.call(arguments)),s instanceof n.Element&&n.Box.call(this,s.node.getBoundingClientRect())},inherit:n.Box,parent:n.Element,extend:{addOffset:function(){return this.x+=e.pageXOffset,this.y+=e.pageYOffset,this}},construct:{rbox:function(s){return s?new n.RBox(this).transform(s.screenCTM().inverse()):new n.RBox(this).addOffset()}}}),n.RBox.prototype.constructor=n.RBox,n.Matrix=n.invent({create:function(s){var h,m=g([1,0,0,1,0,0]);for(s=s instanceof n.Element?s.matrixify():typeof s=="string"?g(s.split(n.regex.delimiter).map(parseFloat)):arguments.length==6?g([].slice.call(arguments)):Array.isArray(s)?g(s):typeof s=="object"?s:m,h=C.length-1;h>=0;--h)this[C[h]]=s[C[h]]!=null?s[C[h]]:m[C[h]]},extend:{extract:function(){var s=v(this,0,1),h=v(this,1,0),m=180/Math.PI*Math.atan2(s.y,s.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(m*Math.PI/180)+this.f*Math.sin(m*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(m*Math.PI/180)+this.e*Math.sin(-m*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-m,skewY:180/Math.PI*Math.atan2(h.y,h.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:m,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new n.Matrix(this)}},clone:function(){return new n.Matrix(this)},morph:function(s){return this.destination=new n.Matrix(s),this},at:function(s){return this.destination?new n.Matrix({a:this.a+(this.destination.a-this.a)*s,b:this.b+(this.destination.b-this.b)*s,c:this.c+(this.destination.c-this.c)*s,d:this.d+(this.destination.d-this.d)*s,e:this.e+(this.destination.e-this.e)*s,f:this.f+(this.destination.f-this.f)*s}):this},multiply:function(s){return new n.Matrix(this.native().multiply(function(h){return h instanceof n.Matrix||(h=new n.Matrix(h)),h}(s).native()))},inverse:function(){return new n.Matrix(this.native().inverse())},translate:function(s,h){return new n.Matrix(this.native().translate(s||0,h||0))},scale:function(s,h,m,E){return arguments.length==1?h=s:arguments.length==3&&(E=m,m=h,h=s),this.around(m,E,new n.Matrix(s,0,0,h,0,0))},rotate:function(s,h,m){return s=n.utils.radians(s),this.around(h,m,new n.Matrix(Math.cos(s),Math.sin(s),-Math.sin(s),Math.cos(s),0,0))},flip:function(s,h){return s=="x"?this.scale(-1,1,h,0):s=="y"?this.scale(1,-1,0,h):this.scale(-1,-1,s,h??s)},skew:function(s,h,m,E){return arguments.length==1?h=s:arguments.length==3&&(E=m,m=h,h=s),s=n.utils.radians(s),h=n.utils.radians(h),this.around(m,E,new n.Matrix(1,Math.tan(h),Math.tan(s),1,0,0))},skewX:function(s,h,m){return this.skew(s,0,h,m)},skewY:function(s,h,m){return this.skew(0,s,h,m)},around:function(s,h,m){return this.multiply(new n.Matrix(1,0,0,1,s||0,h||0)).multiply(m).multiply(new n.Matrix(1,0,0,1,-s||0,-h||0))},native:function(){for(var s=n.parser.native.createSVGMatrix(),h=C.length-1;h>=0;h--)s[C[h]]=this[C[h]];return s},toString:function(){return"matrix("+_(this.a)+","+_(this.b)+","+_(this.c)+","+_(this.d)+","+_(this.e)+","+_(this.f)+")"}},parent:n.Element,construct:{ctm:function(){return new n.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof n.Nested){var s=this.rect(1,1),h=s.node.getScreenCTM();return s.remove(),new n.Matrix(h)}return new n.Matrix(this.node.getScreenCTM())}}}),n.Point=n.invent({create:function(s,h){var m;m=Array.isArray(s)?{x:s[0],y:s[1]}:typeof s=="object"?{x:s.x,y:s.y}:s!=null?{x:s,y:h??s}:{x:0,y:0},this.x=m.x,this.y=m.y},extend:{clone:function(){return new n.Point(this)},morph:function(s,h){return this.destination=new n.Point(s,h),this},at:function(s){return this.destination?new n.Point({x:this.x+(this.destination.x-this.x)*s,y:this.y+(this.destination.y-this.y)*s}):this},native:function(){var s=n.parser.native.createSVGPoint();return s.x=this.x,s.y=this.y,s},transform:function(s){return new n.Point(this.native().matrixTransform(s.native()))}}}),n.extend(n.Element,{point:function(s,h){return new n.Point(s,h).transform(this.screenCTM().inverse())}}),n.extend(n.Element,{attr:function(s,h,m){if(s==null){for(s={},m=(h=this.node.attributes).length-1;m>=0;m--)s[h[m].nodeName]=n.regex.isNumber.test(h[m].nodeValue)?parseFloat(h[m].nodeValue):h[m].nodeValue;return s}if(typeof s=="object")for(h in s)this.attr(h,s[h]);else if(h===null)this.node.removeAttribute(s);else{if(h==null)return(h=this.node.getAttribute(s))==null?n.defaults.attrs[s]:n.regex.isNumber.test(h)?parseFloat(h):h;s=="stroke-width"?this.attr("stroke",parseFloat(h)>0?this._stroke:null):s=="stroke"&&(this._stroke=h),s!="fill"&&s!="stroke"||(n.regex.isImage.test(h)&&(h=this.doc().defs().image(h,0,0)),h instanceof n.Image&&(h=this.doc().defs().pattern(0,0,function(){this.add(h)}))),typeof h=="number"?h=new n.Number(h):n.Color.isColor(h)?h=new n.Color(h):Array.isArray(h)&&(h=new n.Array(h)),s=="leading"?this.leading&&this.leading(h):typeof m=="string"?this.node.setAttributeNS(m,s,h.toString()):this.node.setAttribute(s,h.toString()),!this.rebuild||s!="font-size"&&s!="x"||this.rebuild(s,h)}return this}}),n.extend(n.Element,{transform:function(s,h){var m,E,T=this;if(typeof s!="object")return m=new n.Matrix(T).extract(),typeof s=="string"?m[s]:m;if(m=new n.Matrix(T),h=!!h||!!s.relative,s.a!=null)m=h?m.multiply(new n.Matrix(s)):new n.Matrix(s);else if(s.rotation!=null)b(s,T),m=h?m.rotate(s.rotation,s.cx,s.cy):m.rotate(s.rotation-m.extract().rotation,s.cx,s.cy);else if(s.scale!=null||s.scaleX!=null||s.scaleY!=null){if(b(s,T),s.scaleX=s.scale!=null?s.scale:s.scaleX!=null?s.scaleX:1,s.scaleY=s.scale!=null?s.scale:s.scaleY!=null?s.scaleY:1,!h){var M=m.extract();s.scaleX=1*s.scaleX/M.scaleX,s.scaleY=1*s.scaleY/M.scaleY}m=m.scale(s.scaleX,s.scaleY,s.cx,s.cy)}else s.skew!=null||s.skewX!=null||s.skewY!=null?(b(s,T),s.skewX=s.skew!=null?s.skew:s.skewX!=null?s.skewX:0,s.skewY=s.skew!=null?s.skew:s.skewY!=null?s.skewY:0,h||(M=m.extract(),m=m.multiply(new n.Matrix().skew(M.skewX,M.skewY,s.cx,s.cy).inverse())),m=m.skew(s.skewX,s.skewY,s.cx,s.cy)):s.flip?(s.flip=="x"||s.flip=="y"?s.offset=s.offset==null?T.bbox()["c"+s.flip]:s.offset:s.offset==null?(E=T.bbox(),s.flip=E.cx,s.offset=E.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(h?m=m.translate(s.x,s.y):(s.x!=null&&(m.e=s.x),s.y!=null&&(m.f=s.y)));return this.attr("transform",m)}}),n.extend(n.FX,{transform:function(s,h){var m,E,T=this.target();return typeof s!="object"?(m=new n.Matrix(T).extract(),typeof s=="string"?m[s]:m):(h=!!h||!!s.relative,s.a!=null?m=new n.Matrix(s):s.rotation!=null?(b(s,T),m=new n.Rotate(s.rotation,s.cx,s.cy)):s.scale!=null||s.scaleX!=null||s.scaleY!=null?(b(s,T),s.scaleX=s.scale!=null?s.scale:s.scaleX!=null?s.scaleX:1,s.scaleY=s.scale!=null?s.scale:s.scaleY!=null?s.scaleY:1,m=new n.Scale(s.scaleX,s.scaleY,s.cx,s.cy)):s.skewX!=null||s.skewY!=null?(b(s,T),s.skewX=s.skewX!=null?s.skewX:0,s.skewY=s.skewY!=null?s.skewY:0,m=new n.Skew(s.skewX,s.skewY,s.cx,s.cy)):s.flip?(s.flip=="x"||s.flip=="y"?s.offset=s.offset==null?T.bbox()["c"+s.flip]:s.offset:s.offset==null?(E=T.bbox(),s.flip=E.cx,s.offset=E.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(m=new n.Translate(s.x,s.y)),m?(m.relative=h,this.last().transforms.push(m),this._callStart()):this)}}),n.extend(n.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var s=(this.attr("transform")||"").split(n.regex.transforms).slice(0,-1).map(function(h){var m=h.trim().split("(");return[m[0],m[1].split(n.regex.delimiter).map(function(E){return parseFloat(E)})]}).reduce(function(h,m){return m[0]=="matrix"?h.multiply(g(m[1])):h[m[0]].apply(h,m[1])},new n.Matrix);return s},toParent:function(s){if(this==s)return this;var h=this.screenCTM(),m=s.screenCTM().inverse();return this.addTo(s).untransform().transform(m.multiply(h)),this},toDoc:function(){return this.toParent(this.doc())}}),n.Transformation=n.invent({create:function(s,h){if(arguments.length>1&&typeof h!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(s))for(var m=0,E=this.arguments.length;m<E;++m)this[this.arguments[m]]=s[m];else if(typeof s=="object")for(m=0,E=this.arguments.length;m<E;++m)this[this.arguments[m]]=s[this.arguments[m]];this.inversed=!1,h===!0&&(this.inversed=!0)},extend:{arguments:[],method:"",at:function(s){for(var h=[],m=0,E=this.arguments.length;m<E;++m)h.push(this[this.arguments[m]]);var T=this._undo||new n.Matrix;return T=new n.Matrix().morph(n.Matrix.prototype[this.method].apply(T,h)).at(s),this.inversed?T.inverse():T},undo:function(s){for(var h=0,m=this.arguments.length;h<m;++h)s[this.arguments[h]]=this[this.arguments[h]]===void 0?0:s[this.arguments[h]];return s.cx=this.cx,s.cy=this.cy,this._undo=new n[d(this.method)](s,!0).at(1),this}}}),n.Translate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(s,h){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),n.Rotate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(s,h){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(s){var h=new n.Matrix().rotate(new n.Number().morph(this.rotation-(this._undo?this._undo.rotation:0)).at(s),this.cx,this.cy);return this.inversed?h.inverse():h},undo:function(s){return this._undo=s,this}}}),n.Scale=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(s,h){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["scaleX","scaleY","cx","cy"],method:"scale"}}),n.Skew=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(s,h){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),n.extend(n.Element,{style:function(s,h){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(typeof s=="object")for(h in s)this.style(h,s[h]);else{if(!n.regex.isCss.test(s))return this.node.style[p(s)];for(s=s.split(/\s*;\s*/).filter(function(m){return!!m}).map(function(m){return m.split(/\s*:\s*/)});h=s.pop();)this.style(h[0],h[1])}else this.node.style[p(s)]=h===null||n.regex.isBlank.test(h)?"":h;return this}}),n.Parent=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Element,extend:{children:function(){return n.utils.map(n.utils.filterSVGElements(this.node.childNodes),function(s){return n.adopt(s)})},add:function(s,h){return h==null?this.node.appendChild(s.node):s.node!=this.node.childNodes[h]&&this.node.insertBefore(s.node,this.node.childNodes[h]),this},put:function(s,h){return this.add(s,h),s},has:function(s){return this.index(s)>=0},index:function(s){return[].slice.call(this.node.childNodes).indexOf(s.node)},get:function(s){return n.adopt(this.node.childNodes[s])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(s,h){var m,E,T=this.children();for(m=0,E=T.length;m<E;m++)T[m]instanceof n.Element&&s.apply(T[m],[m,T]),h&&T[m]instanceof n.Container&&T[m].each(s,h);return this},removeElement:function(s){return this.node.removeChild(s.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),n.extend(n.Parent,{ungroup:function(s,h){return h===0||this instanceof n.Defs||this.node==n.parser.draw||(s=s||(this instanceof n.Doc?this:this.parent(n.Parent)),h=h||1/0,this.each(function(){return this instanceof n.Defs?this:this instanceof n.Parent?this.ungroup(s,h-1):this.toParent(s)}),this.node.firstChild||this.remove()),this},flatten:function(s,h){return this.ungroup(s,h)}}),n.Container=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Parent}),n.ViewBox=n.invent({create:function(s){var h,m,E,T,M,N,$,P=1,x=1,I=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/gi;if(s instanceof n.Element){for(N=s,$=s,M=(s.attr("viewBox")||"").match(I),s.bbox,E=new n.Number(s.width()),T=new n.Number(s.height());E.unit=="%";)P*=E.value,E=new n.Number(N instanceof n.Doc?N.parent().offsetWidth:N.parent().width()),N=N.parent();for(;T.unit=="%";)x*=T.value,T=new n.Number($ instanceof n.Doc?$.parent().offsetHeight:$.parent().height()),$=$.parent();this.x=0,this.y=0,this.width=E*P,this.height=T*x,this.zoom=1,M&&(h=parseFloat(M[0]),m=parseFloat(M[1]),E=parseFloat(M[2]),T=parseFloat(M[3]),this.zoom=this.width/this.height>E/T?this.height/T:this.width/E,this.x=h,this.y=m,this.width=E,this.height=T)}else s=typeof s=="string"?s.match(I).map(function(j){return parseFloat(j)}):Array.isArray(s)?s:typeof s=="object"?[s.x,s.y,s.width,s.height]:arguments.length==4?[].slice.call(arguments):[0,0,0,0],this.x=s[0],this.y=s[1],this.width=s[2],this.height=s[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(s,h,m,E){return this.destination=new n.ViewBox(s,h,m,E),this},at:function(s){return this.destination?new n.ViewBox([this.x+(this.destination.x-this.x)*s,this.y+(this.destination.y-this.y)*s,this.width+(this.destination.width-this.width)*s,this.height+(this.destination.height-this.height)*s]):this}},parent:n.Container,construct:{viewbox:function(s,h,m,E){return arguments.length==0?new n.ViewBox(this):this.attr("viewBox",new n.ViewBox(s,h,m,E))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(s){n.Element.prototype[s]=function(h){return h==null?n.off(this,s):n.on(this,s,h),this}}),n.listenerId=0,n.on=function(s,h,m,E,T){var M=m.bind(E||s),N=s instanceof n.Element?s.node:s;N.instance=N.instance||{_events:{}};var $=N.instance._events;m._svgjsListenerId||(m._svgjsListenerId=++n.listenerId),h.split(n.regex.delimiter).forEach(function(P){var x=P.split(".")[0],I=P.split(".")[1]||"*";$[x]=$[x]||{},$[x][I]=$[x][I]||{},$[x][I][m._svgjsListenerId]=M,N.addEventListener(x,M,T||!1)})},n.off=function(s,h,m,E){var T=s instanceof n.Element?s.node:s;if(T.instance&&(typeof m!="function"||(m=m._svgjsListenerId))){var M=T.instance._events;(h||"").split(n.regex.delimiter).forEach(function(N){var $,P,x=N&&N.split(".")[0],I=N&&N.split(".")[1];if(m)M[x]&&M[x][I||"*"]&&(T.removeEventListener(x,M[x][I||"*"][m],E||!1),delete M[x][I||"*"][m]);else if(x&&I){if(M[x]&&M[x][I]){for(P in M[x][I])n.off(T,[x,I].join("."),P);delete M[x][I]}}else if(I)for(N in M)for($ in M[N])I===$&&n.off(T,[N,I].join("."));else if(x){if(M[x]){for($ in M[x])n.off(T,[x,$].join("."));delete M[x]}}else{for(N in M)n.off(T,N);T.instance._events={}}})}},n.extend(n.Element,{on:function(s,h,m,E){return n.on(this,s,h,m,E),this},off:function(s,h){return n.off(this.node,s,h),this},fire:function(s,h){return s instanceof e.Event?this.node.dispatchEvent(s):this.node.dispatchEvent(s=new n.CustomEvent(s,{detail:h,cancelable:!0})),this._event=s,this},event:function(){return this._event}}),n.Defs=n.invent({create:"defs",inherit:n.Container}),n.G=n.invent({create:"g",inherit:n.Container,extend:{x:function(s){return s==null?this.transform("x"):this.transform({x:s-this.x()},!0)},y:function(s){return s==null?this.transform("y"):this.transform({y:s-this.y()},!0)},cx:function(s){return s==null?this.gbox().cx:this.x(s-this.gbox().width/2)},cy:function(s){return s==null?this.gbox().cy:this.y(s-this.gbox().height/2)},gbox:function(){var s=this.bbox(),h=this.transform();return s.x+=h.x,s.x2+=h.x,s.cx+=h.x,s.y+=h.y,s.y2+=h.y,s.cy+=h.y,s}},construct:{group:function(){return this.put(new n.G)}}}),n.Doc=n.invent({create:function(s){s&&((s=typeof s=="string"?t.getElementById(s):s).nodeName=="svg"?this.constructor.call(this,s):(this.constructor.call(this,n.create("svg")),s.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:n.Container,extend:{namespace:function(){return this.attr({xmlns:n.ns,version:"1.1"}).attr("xmlns:xlink",n.xlink,n.xmlns).attr("xmlns:svgjs",n.svgjs,n.xmlns)},defs:function(){var s;return this._defs||((s=this.node.getElementsByTagName("defs")[0])?this._defs=n.adopt(s):this._defs=new n.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&this.node.parentNode.nodeName!="#document"&&this.node.parentNode.nodeName!="#document-fragment"?this.node.parentNode:null},spof:function(){var s=this.node.getScreenCTM();return s&&this.style("left",-s.e%1+"px").style("top",-s.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,n.parser.draw.parentNode||this.node.appendChild(n.parser.draw),this},clone:function(s){this.writeDataToDom();var h=this.node,m=S(h.cloneNode(!0));return s?(s.node||s).appendChild(m.node):h.parentNode.insertBefore(m.node,h.nextSibling),m}}}),n.extend(n.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var s=this.position()+1,h=this.parent();return h.removeElement(this).add(this,s),h instanceof n.Doc&&h.node.appendChild(h.defs().node),this},backward:function(){var s=this.position();return s>0&&this.parent().removeElement(this).add(this,s-1),this},front:function(){var s=this.parent();return s.node.appendChild(this.node),s instanceof n.Doc&&s.node.appendChild(s.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(s){s.remove();var h=this.position();return this.parent().add(s,h),this},after:function(s){s.remove();var h=this.position();return this.parent().add(s,h+1),this}}),n.Mask=n.invent({create:function(){this.constructor.call(this,n.create("mask")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var s=this.targets.length-1;s>=0;s--)this.targets[s]&&this.targets[s].unmask();return this.targets=[],n.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new n.Mask)}}}),n.extend(n.Element,{maskWith:function(s){return this.masker=s instanceof n.Mask?s:this.parent().mask().add(s),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),n.ClipPath=n.invent({create:function(){this.constructor.call(this,n.create("clipPath")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var s=this.targets.length-1;s>=0;s--)this.targets[s]&&this.targets[s].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new n.ClipPath)}}}),n.extend(n.Element,{clipWith:function(s){return this.clipper=s instanceof n.ClipPath?s:this.parent().clip().add(s),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),n.Gradient=n.invent({create:function(s){this.constructor.call(this,n.create(s+"Gradient")),this.type=s},inherit:n.Container,extend:{at:function(s,h,m){return this.put(new n.Stop).update(s,h,m)},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(s,h,m){return s=="transform"&&(s="gradientTransform"),n.Container.prototype.attr.call(this,s,h,m)}},construct:{gradient:function(s,h){return this.defs().gradient(s,h)}}}),n.extend(n.Gradient,n.FX,{from:function(s,h){return(this._target||this).type=="radial"?this.attr({fx:new n.Number(s),fy:new n.Number(h)}):this.attr({x1:new n.Number(s),y1:new n.Number(h)})},to:function(s,h){return(this._target||this).type=="radial"?this.attr({cx:new n.Number(s),cy:new n.Number(h)}):this.attr({x2:new n.Number(s),y2:new n.Number(h)})}}),n.extend(n.Defs,{gradient:function(s,h){return this.put(new n.Gradient(s)).update(h)}}),n.Stop=n.invent({create:"stop",inherit:n.Element,extend:{update:function(s){return(typeof s=="number"||s instanceof n.Number)&&(s={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),s.opacity!=null&&this.attr("stop-opacity",s.opacity),s.color!=null&&this.attr("stop-color",s.color),s.offset!=null&&this.attr("offset",new n.Number(s.offset)),this}}}),n.Pattern=n.invent({create:"pattern",inherit:n.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},toString:function(){return this.fill()},attr:function(s,h,m){return s=="transform"&&(s="patternTransform"),n.Container.prototype.attr.call(this,s,h,m)}},construct:{pattern:function(s,h,m){return this.defs().pattern(s,h,m)}}}),n.extend(n.Defs,{pattern:function(s,h,m){return this.put(new n.Pattern).update(m).attr({x:0,y:0,width:s,height:h,patternUnits:"userSpaceOnUse"})}}),n.Shape=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Element}),n.Bare=n.invent({create:function(s,h){if(this.constructor.call(this,n.create(s)),h)for(var m in h.prototype)typeof h.prototype[m]=="function"&&(this[m]=h.prototype[m])},inherit:n.Element,extend:{words:function(s){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(t.createTextNode(s)),this}}}),n.extend(n.Parent,{element:function(s,h){return this.put(new n.Bare(s,h))}}),n.Symbol=n.invent({create:"symbol",inherit:n.Container,construct:{symbol:function(){return this.put(new n.Symbol)}}}),n.Use=n.invent({create:"use",inherit:n.Shape,extend:{element:function(s,h){return this.attr("href",(h||"")+"#"+s,n.xlink)}},construct:{use:function(s,h){return this.put(new n.Use).element(s,h)}}}),n.Rect=n.invent({create:"rect",inherit:n.Shape,construct:{rect:function(s,h){return this.put(new n.Rect).size(s,h)}}}),n.Circle=n.invent({create:"circle",inherit:n.Shape,construct:{circle:function(s){return this.put(new n.Circle).rx(new n.Number(s).divide(2)).move(0,0)}}}),n.extend(n.Circle,n.FX,{rx:function(s){return this.attr("r",s)},ry:function(s){return this.rx(s)}}),n.Ellipse=n.invent({create:"ellipse",inherit:n.Shape,construct:{ellipse:function(s,h){return this.put(new n.Ellipse).size(s,h).move(0,0)}}}),n.extend(n.Ellipse,n.Rect,n.FX,{rx:function(s){return this.attr("rx",s)},ry:function(s){return this.attr("ry",s)}}),n.extend(n.Circle,n.Ellipse,{x:function(s){return s==null?this.cx()-this.rx():this.cx(s+this.rx())},y:function(s){return s==null?this.cy()-this.ry():this.cy(s+this.ry())},cx:function(s){return s==null?this.attr("cx"):this.attr("cx",s)},cy:function(s){return s==null?this.attr("cy"):this.attr("cy",s)},width:function(s){return s==null?2*this.rx():this.rx(new n.Number(s).divide(2))},height:function(s){return s==null?2*this.ry():this.ry(new n.Number(s).divide(2))},size:function(s,h){var m=f(this,s,h);return this.rx(new n.Number(m.width).divide(2)).ry(new n.Number(m.height).divide(2))}}),n.Line=n.invent({create:"line",inherit:n.Shape,extend:{array:function(){return new n.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(s,h,m,E){return s==null?this.array():(s=h!==void 0?{x1:s,y1:h,x2:m,y2:E}:new n.PointArray(s).toLine(),this.attr(s))},move:function(s,h){return this.attr(this.array().move(s,h).toLine())},size:function(s,h){var m=f(this,s,h);return this.attr(this.array().size(m.width,m.height).toLine())}},construct:{line:function(s,h,m,E){return n.Line.prototype.plot.apply(this.put(new n.Line),s!=null?[s,h,m,E]:[0,0,0,0])}}}),n.Polyline=n.invent({create:"polyline",inherit:n.Shape,construct:{polyline:function(s){return this.put(new n.Polyline).plot(s||new n.PointArray)}}}),n.Polygon=n.invent({create:"polygon",inherit:n.Shape,construct:{polygon:function(s){return this.put(new n.Polygon).plot(s||new n.PointArray)}}}),n.extend(n.Polyline,n.Polygon,{array:function(){return this._array||(this._array=new n.PointArray(this.attr("points")))},plot:function(s){return s==null?this.array():this.clear().attr("points",typeof s=="string"?s:this._array=new n.PointArray(s))},clear:function(){return delete this._array,this},move:function(s,h){return this.attr("points",this.array().move(s,h))},size:function(s,h){var m=f(this,s,h);return this.attr("points",this.array().size(m.width,m.height))}}),n.extend(n.Line,n.Polyline,n.Polygon,{morphArray:n.PointArray,x:function(s){return s==null?this.bbox().x:this.move(s,this.bbox().y)},y:function(s){return s==null?this.bbox().y:this.move(this.bbox().x,s)},width:function(s){var h=this.bbox();return s==null?h.width:this.size(s,h.height)},height:function(s){var h=this.bbox();return s==null?h.height:this.size(h.width,s)}}),n.Path=n.invent({create:"path",inherit:n.Shape,extend:{morphArray:n.PathArray,array:function(){return this._array||(this._array=new n.PathArray(this.attr("d")))},plot:function(s){return s==null?this.array():this.clear().attr("d",typeof s=="string"?s:this._array=new n.PathArray(s))},clear:function(){return delete this._array,this},move:function(s,h){return this.attr("d",this.array().move(s,h))},x:function(s){return s==null?this.bbox().x:this.move(s,this.bbox().y)},y:function(s){return s==null?this.bbox().y:this.move(this.bbox().x,s)},size:function(s,h){var m=f(this,s,h);return this.attr("d",this.array().size(m.width,m.height))},width:function(s){return s==null?this.bbox().width:this.size(s,this.bbox().height)},height:function(s){return s==null?this.bbox().height:this.size(this.bbox().width,s)}},construct:{path:function(s){return this.put(new n.Path).plot(s||new n.PathArray)}}}),n.Image=n.invent({create:"image",inherit:n.Shape,extend:{load:function(s){if(!s)return this;var h=this,m=new e.Image;return n.on(m,"load",function(){n.off(m);var E=h.parent(n.Pattern);E!==null&&(h.width()==0&&h.height()==0&&h.size(m.width,m.height),E&&E.width()==0&&E.height()==0&&E.size(h.width(),h.height()),typeof h._loaded=="function"&&h._loaded.call(h,{width:m.width,height:m.height,ratio:m.width/m.height,url:s}))}),n.on(m,"error",function(E){n.off(m),typeof h._error=="function"&&h._error.call(h,E)}),this.attr("href",m.src=this.src=s,n.xlink)},loaded:function(s){return this._loaded=s,this},error:function(s){return this._error=s,this}},construct:{image:function(s,h,m){return this.put(new n.Image).load(s).size(h||0,m||h||0)}}}),n.Text=n.invent({create:function(){this.constructor.call(this,n.create("text")),this.dom.leading=new n.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",n.defaults.attrs["font-family"])},inherit:n.Shape,extend:{x:function(s){return s==null?this.attr("x"):this.attr("x",s)},y:function(s){var h=this.attr("y"),m=typeof h=="number"?h-this.bbox().y:0;return s==null?typeof h=="number"?h-m:h:this.attr("y",typeof s.valueOf()=="number"?s+m:s)},cx:function(s){return s==null?this.bbox().cx:this.x(s-this.bbox().width/2)},cy:function(s){return s==null?this.bbox().cy:this.y(s-this.bbox().height/2)},text:function(s){if(s===void 0){s="";for(var h=this.node.childNodes,m=0,E=h.length;m<E;++m)m!=0&&h[m].nodeType!=3&&n.adopt(h[m]).dom.newLined==1&&(s+=`
  32. `),s+=h[m].textContent;return s}if(this.clear().build(!0),typeof s=="function")s.call(this,this);else{m=0;for(var T=(s=s.split(`
  33. `)).length;m<T;m++)this.tspan(s[m]).newLine()}return this.build(!1).rebuild()},size:function(s){return this.attr("font-size",s).rebuild()},leading:function(s){return s==null?this.dom.leading:(this.dom.leading=new n.Number(s),this.rebuild())},lines:function(){var s=(this.textPath&&this.textPath()||this).node,h=n.utils.map(n.utils.filterSVGElements(s.childNodes),function(m){return n.adopt(m)});return new n.Set(h)},rebuild:function(s){if(typeof s=="boolean"&&(this._rebuild=s),this._rebuild){var h=this,m=0,E=this.dom.leading*new n.Number(this.attr("font-size"));this.lines().each(function(){this.dom.newLined&&(h.textPath()||this.attr("x",h.attr("x")),this.text()==`
  34. `?m+=E:(this.attr("dy",E+m),m=0))}),this.fire("rebuild")}return this},build:function(s){return this._build=!!s,this},setData:function(s){return this.dom=s,this.dom.leading=new n.Number(s.leading||1.3),this}},construct:{text:function(s){return this.put(new n.Text).text(s)},plain:function(s){return this.put(new n.Text).plain(s)}}}),n.Tspan=n.invent({create:"tspan",inherit:n.Shape,extend:{text:function(s){return s==null?this.node.textContent+(this.dom.newLined?`
  35. `:""):(typeof s=="function"?s.call(this,this):this.plain(s),this)},dx:function(s){return this.attr("dx",s)},dy:function(s){return this.attr("dy",s)},newLine:function(){var s=this.parent(n.Text);return this.dom.newLined=!0,this.dy(s.dom.leading*s.attr("font-size")).attr("x",s.x())}}}),n.extend(n.Text,n.Tspan,{plain:function(s){return this._build===!1&&this.clear(),this.node.appendChild(t.createTextNode(s)),this},tspan:function(s){var h=(this.textPath&&this.textPath()||this).node,m=new n.Tspan;return this._build===!1&&this.clear(),h.appendChild(m.node),m.text(s)},clear:function(){for(var s=(this.textPath&&this.textPath()||this).node;s.hasChildNodes();)s.removeChild(s.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),n.TextPath=n.invent({create:"textPath",inherit:n.Parent,parent:n.Text,construct:{morphArray:n.PathArray,path:function(s){for(var h=new n.TextPath,m=this.doc().defs().path(s);this.node.hasChildNodes();)h.node.appendChild(this.node.firstChild);return this.node.appendChild(h.node),h.attr("href","#"+m,n.xlink),this},array:function(){var s=this.track();return s?s.array():null},plot:function(s){var h=this.track(),m=null;return h&&(m=h.plot(s)),s==null?m:this},track:function(){var s=this.textPath();if(s)return s.reference("href")},textPath:function(){if(this.node.firstChild&&this.node.firstChild.nodeName=="textPath")return n.adopt(this.node.firstChild)}}}),n.Nested=n.invent({create:function(){this.constructor.call(this,n.create("svg")),this.style("overflow","visible")},inherit:n.Container,construct:{nested:function(){return this.put(new n.Nested)}}}),n.A=n.invent({create:"a",inherit:n.Container,extend:{to:function(s){return this.attr("href",s,n.xlink)},show:function(s){return this.attr("show",s,n.xlink)},target:function(s){return this.attr("target",s)}},construct:{link:function(s){return this.put(new n.A).to(s)}}}),n.extend(n.Element,{linkTo:function(s){var h=new n.A;return typeof s=="function"?s.call(h,h):h.to(s),this.parent().put(h).put(this)}}),n.Marker=n.invent({create:"marker",inherit:n.Container,extend:{width:function(s){return this.attr("markerWidth",s)},height:function(s){return this.attr("markerHeight",s)},ref:function(s,h){return this.attr("refX",s).attr("refY",h)},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},toString:function(){return"url(#"+this.id()+")"}},construct:{marker:function(s,h,m){return this.defs().marker(s,h,m)}}}),n.extend(n.Defs,{marker:function(s,h,m){return this.put(new n.Marker).size(s,h).ref(s/2,h/2).viewbox(0,0,s,h).attr("orient","auto").update(m)}}),n.extend(n.Line,n.Polyline,n.Polygon,n.Path,{marker:function(s,h,m,E){var T=["marker"];return s!="all"&&T.push(s),T=T.join("-"),s=arguments[1]instanceof n.Marker?arguments[1]:this.doc().marker(h,m,E),this.attr(T,s)}});var c={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(s,h){return h=="color"?s:s+"-"+h}};function l(s,h,m,E){return m+E.replace(n.regex.dots," .")}function u(s){for(var h=s.slice(0),m=h.length;m--;)Array.isArray(h[m])&&(h[m]=u(h[m]));return h}function p(s){return s.toLowerCase().replace(/-(.)/g,function(h,m){return m.toUpperCase()})}function d(s){return s.charAt(0).toUpperCase()+s.slice(1)}function y(s){var h=s.toString(16);return h.length==1?"0"+h:h}function f(s,h,m){if(h==null||m==null){var E=s.bbox();h==null?h=E.width/E.height*m:m==null&&(m=E.height/E.width*h)}return{width:h,height:m}}function v(s,h,m){return{x:h*s.a+m*s.c+0,y:h*s.b+m*s.d+0}}function g(s){return{a:s[0],b:s[1],c:s[2],d:s[3],e:s[4],f:s[5]}}function b(s,h){s.cx=s.cx==null?h.bbox().cx:s.cx,s.cy=s.cy==null?h.bbox().cy:s.cy}function S(s){for(var h=s.childNodes.length-1;h>=0;h--)s.childNodes[h]instanceof e.SVGElement&&S(s.childNodes[h]);return n.adopt(s).id(n.eid(s.nodeName))}function w(s){return s.x==null&&(s.x=0,s.y=0,s.width=0,s.height=0),s.w=s.width,s.h=s.height,s.x2=s.x+s.width,s.y2=s.y+s.height,s.cx=s.x+s.width/2,s.cy=s.y+s.height/2,s}function _(s){return Math.abs(s)>1e-37?s:0}["fill","stroke"].forEach(function(s){var h,m={};m[s]=function(E){if(E===void 0)return this;if(typeof E=="string"||n.Color.isRgb(E)||E&&typeof E.fill=="function")this.attr(s,E);else for(h=c[s].length-1;h>=0;h--)E[c[s][h]]!=null&&this.attr(c.prefix(s,c[s][h]),E[c[s][h]]);return this},n.extend(n.Element,n.FX,m)}),n.extend(n.Element,n.FX,{rotate:function(s,h,m){return this.transform({rotation:s,cx:h,cy:m})},skew:function(s,h,m,E){return arguments.length==1||arguments.length==3?this.transform({skew:s,cx:h,cy:m}):this.transform({skewX:s,skewY:h,cx:m,cy:E})},scale:function(s,h,m,E){return arguments.length==1||arguments.length==3?this.transform({scale:s,cx:h,cy:m}):this.transform({scaleX:s,scaleY:h,cx:m,cy:E})},translate:function(s,h){return this.transform({x:s,y:h})},flip:function(s,h){return h=typeof s=="number"?s:h,this.transform({flip:s||"both",offset:h})},matrix:function(s){return this.attr("transform",new n.Matrix(arguments.length==6?[].slice.call(arguments):s))},opacity:function(s){return this.attr("opacity",s)},dx:function(s){return this.x(new n.Number(s).plus(this instanceof n.FX?0:this.x()),!0)},dy:function(s){return this.y(new n.Number(s).plus(this instanceof n.FX?0:this.y()),!0)},dmove:function(s,h){return this.dx(s).dy(h)}}),n.extend(n.Rect,n.Ellipse,n.Circle,n.Gradient,n.FX,{radius:function(s,h){var m=(this._target||this).type;return m=="radial"||m=="circle"?this.attr("r",new n.Number(s)):this.rx(s).ry(h??s)}}),n.extend(n.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(s){return this.node.getPointAtLength(s)}}),n.extend(n.Parent,n.Text,n.Tspan,n.FX,{font:function(s,h){if(typeof s=="object")for(h in s)this.font(h,s[h]);return s=="leading"?this.leading(h):s=="anchor"?this.attr("text-anchor",h):s=="size"||s=="family"||s=="weight"||s=="stretch"||s=="variant"||s=="style"?this.attr("font-"+s,h):this.attr(s,h)}}),n.Set=n.invent({create:function(s){s instanceof n.Set?this.members=s.members.slice():Array.isArray(s)?this.members=s:this.clear()},extend:{add:function(){var s,h,m=[].slice.call(arguments);for(s=0,h=m.length;s<h;s++)this.members.push(m[s]);return this},remove:function(s){var h=this.index(s);return h>-1&&this.members.splice(h,1),this},each:function(s){for(var h=0,m=this.members.length;h<m;h++)s.apply(this.members[h],[h,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(s){return this.index(s)>=0},index:function(s){return this.members.indexOf(s)},get:function(s){return this.members[s]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(this.members.length==0)return new n.RBox;var s=this.members[0].rbox(this.members[0].doc());return this.each(function(){s=s.merge(this.rbox(this.doc()))}),s}},construct:{set:function(s){return new n.Set(s)}}}),n.FX.Set=n.invent({create:function(s){this.set=s}}),n.Set.inherit=function(){var s=[];for(var h in n.Shape.prototype)typeof n.Shape.prototype[h]=="function"&&typeof n.Set.prototype[h]!="function"&&s.push(h);for(var h in s.forEach(function(E){n.Set.prototype[E]=function(){for(var T=0,M=this.members.length;T<M;T++)this.members[T]&&typeof this.members[T][E]=="function"&&this.members[T][E].apply(this.members[T],arguments);return E=="animate"?this.fx||(this.fx=new n.FX.Set(this)):this}}),s=[],n.FX.prototype)typeof n.FX.prototype[h]=="function"&&typeof n.FX.Set.prototype[h]!="function"&&s.push(h);s.forEach(function(m){n.FX.Set.prototype[m]=function(){for(var E=0,T=this.set.members.length;E<T;E++)this.set.members[E].fx[m].apply(this.set.members[E].fx,arguments);return this}})},n.extend(n.Element,{data:function(s,h,m){if(typeof s=="object")for(h in s)this.data(h,s[h]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+s))}catch{return this.attr("data-"+s)}else this.attr("data-"+s,h===null?null:m===!0||typeof h=="string"||typeof h=="number"?h:JSON.stringify(h));return this}}),n.extend(n.Element,{remember:function(s,h){if(typeof arguments[0]=="object")for(var h in s)this.remember(h,s[h]);else{if(arguments.length==1)return this.memory()[s];this.memory()[s]=h}return this},forget:function(){if(arguments.length==0)this._memory={};else for(var s=arguments.length-1;s>=0;s--)delete this.memory()[arguments[s]];return this},memory:function(){return this._memory||(this._memory={})}}),n.get=function(s){var h=t.getElementById(function(m){var E=(m||"").toString().match(n.regex.reference);if(E)return E[1]}(s)||s);return n.adopt(h)},n.select=function(s,h){return new n.Set(n.utils.map((h||t).querySelectorAll(s),function(m){return n.adopt(m)}))},n.extend(n.Parent,{select:function(s){return n.select(s,this.node)}});var C="abcdef".split("");if(typeof e.CustomEvent!="function"){var B=function(s,h){h=h||{bubbles:!1,cancelable:!1,detail:void 0};var m=t.createEvent("CustomEvent");return m.initCustomEvent(s,h.bubbles,h.cancelable,h.detail),m};B.prototype=e.Event.prototype,n.CustomEvent=B}else n.CustomEvent=e.CustomEvent;return function(s){for(var h=0,m=["moz","webkit"],E=0;E<m.length&&!e.requestAnimationFrame;++E)s.requestAnimationFrame=s[m[E]+"RequestAnimationFrame"],s.cancelAnimationFrame=s[m[E]+"CancelAnimationFrame"]||s[m[E]+"CancelRequestAnimationFrame"];s.requestAnimationFrame=s.requestAnimationFrame||function(T){var M=new Date().getTime(),N=Math.max(0,16-(M-h)),$=s.setTimeout(function(){T(M+N)},N);return h=M+N,$},s.cancelAnimationFrame=s.cancelAnimationFrame||s.clearTimeout}(e),n};var Fw=Vw.exports=_c.document?Jp(_c,_c.document):function(e){return Jp(e,e.document)},Zp={exports:{}};(function(e,t){function n(i,r){return r.querySelector(i)}(t=Zp.exports=function(i,r){return n(i,r=r||document)}).all=function(i,r){return(r=r||document).querySelectorAll(i)},t.engine=function(i){if(!i.one)throw new Error(".one callback required");if(!i.all)throw new Error(".all callback required");return n=i.one,t.all=i.all,t}})(0,Zp.exports);var ya=Zp.exports,Ft="tokenSimulation",J={TOGGLE_MODE_EVENT:Ft+".toggleMode",GENERATE_TOKEN_EVENT:Ft+".generateToken",CONSUME_TOKEN_EVENT:Ft+".consumeToken",PLAY_SIMULATION_EVENT:Ft+".playSimulation",PAUSE_SIMULATION_EVENT:Ft+".pauseSimulation",RESET_SIMULATION_EVENT:Ft+".resetSimulation",TERMINATE_EVENT:Ft+".terminateEvent",UPDATE_ELEMENTS_EVENT:Ft+".updateElements",UPDATE_ELEMENT_EVENT:Ft+".updateElement",PROCESS_INSTANCE_CREATED_EVENT:Ft+".processInstanceCreated",PROCESS_INSTANCE_FINISHED_EVENT:Ft+".processInstanceFinished",PROCESS_INSTANCE_SHOWN_EVENT:Ft+".processInstanceShown",PROCESS_INSTANCE_HIDDEN_EVENT:Ft+".processInstanceHidden",ANIMATION_CREATED_EVENT:Ft+".animationCreated"},Fe={};const zg=PA($0);var zw=zg.every,$w=zg.some;function $g(e,t){for(var n=t.parent;n;){if(n===e)return!0;n=n.parent}return!1}Fe.is=function(e,t){if(e.type!=="label"){Array.isArray(t)||(t=[t]);var n=!1;return t.forEach(function(i){i===e.type&&(n=!0)}),n}},Fe.isTypedEvent=function(e,t,n){return $w(e.eventDefinitions,function(i){return i.$type===t&&function(r,o){return zw(o,function(a,c){return r[c]==a})}(e,n)})},Fe.getBusinessObject=function(e){return e&&e.businessObject||e},Fe.isAncestor=$g,Fe.getDescendants=function(e,t){return e.filter(function(n){return $g(t,n)})},Fe.supportedElements=["bpmn:Association","bpmn:BoundaryEvent","bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:DataInputAssociation","bpmn:DataObjectReference","bpmn:DataOutputAssociation","bpmn:DataStoreReference","bpmn:EndEvent","bpmn:EventBasedGateway","bpmn:ExclusiveGateway","bpmn:IntermediateCatchEvent","bpmn:ManualTask","bpmn:ParallelGateway","bpmn:Process","bpmn:ScriptTask","bpmn:SequenceFlow","bpmn:ServiceTask","bpmn:StartEvent","bpmn:SubProcess","bpmn:Task","bpmn:TextAnnotation","bpmn:UserTask"];var Gw={getMid:function(e){var t=e.bbox();return{x:t.x+t.width/2,y:t.y+t.height/2}},distance:function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}},Gg=Fw,Uw=ya,Hw=J.RESET_SIMULATION_EVENT,qw=J.PLAY_SIMULATION_EVENT,Ww=J.PAUSE_SIMULATION_EVENT,Xw=J.TERMINATE_EVENT,Kw=J.PROCESS_INSTANCE_FINISHED_EVENT,Yw=J.ANIMATION_CREATED_EVENT,Ug=Fe.isAncestor,Jw=Gw.distance,Zw=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44"),Hg=20;function ir(e,t){var n=window.animation=this;this._eventBus=t,this.animations=[],this.hiddenAnimations=[],this.animationSpeed=1,t.on("import.done",function(){var i=Gg(e._svg),r=Uw(".viewport",e._svg),o=Gg.adopt(r);n.group=i.group().attr("id","token-simulation"),o.put(n.group)}),t.on(Xw,function(i){var r=i.element.parent;n.animations.forEach(function(o){Ug(r,o.element)&&(o.animation.stop(),n.animations=n.animations.filter(function(a){return a!==o}))})}),t.on(Kw,function(i){var r=i.parent;n.animations.forEach(function(o){(i.processInstanceId===o.processInstanceId||Ug(r,o.element))&&(o.animation.stop(),n.animations=n.animations.filter(function(a){return a!==o}))})}),t.on(Hw,function(){n.animations.forEach(function(i){i.animation.stop()}),n.animations=[],n.hiddenAnimations=[]}),t.on(Ww,function(){n.animations.forEach(function(i){i.animation.pause()})}),t.on(qw,function(){n.animations.forEach(function(i){i.animation.play()})})}ir.prototype.createAnimation=function(e,t,n){var i=this;if(this.group){var r,o=this._createTokenGfx(t);return r=new ga(o,e.waypoints,function(){i.animations=i.animations.filter(function(a){return a.animation!==r}),n&&n()}),this.hiddenAnimations.includes(t)&&o.hide(),o.fx._speed=this.animationSpeed,this.animations.push({tokenGfx:o,animation:r,element:e,processInstanceId:t}),this._eventBus.fire(Yw,{tokenGfx:o,animation:r,element:e,processInstanceId:t}),r}},ir.prototype.setAnimationSpeed=function(e){this.animations.forEach(function(t){t.tokenGfx.fx._speed=e}),this.animationSpeed=e},ir.prototype._createTokenGfx=function(e){var t=this.group.group().attr("class","token").hide();return t.circle(Hg,Hg).attr("fill",Zw).attr("class","circle"),t.text(e.toString()).attr("transform","translate(10, -7)").attr("text-anchor","middle").attr("class","text"),t},ir.prototype.showProcessInstanceAnimations=function(e){this.animations.forEach(function(t){t.processInstanceId===e&&t.tokenGfx.show()}),this.hiddenAnimations=this.hiddenAnimations.filter(function(t){return t!==e})},ir.prototype.hideProcessInstanceAnimations=function(e){this.animations.forEach(function(t){t.processInstanceId===e&&t.tokenGfx.hide()}),this.hiddenAnimations.push(e)},ir.$inject=["canvas","eventBus"];var Qw=ir;function ga(e,t,n){this.gfx=this.fx=e,this.waypoints=t,this.done=n,this.create()}ga.prototype.create=function(){var e=this.gfx,t=this.waypoints,n=this.done,i=this.fx;e.show().move(t[0].x-10,t[0].y-10),t.forEach(function(r,o){if(o>0){var a=r.x-10,c=r.y-10,l=function(p){return p===1}(o)?"<":"-";(function(p){return p.length==2})(t)&&(l="<>");var u=20*Jw(t[o-1],r);i=i.animate(u,l,0).move(a,c)}}),i.after(function(){e.remove(),n()})},ga.prototype.play=function(){this.gfx.play()},ga.prototype.pause=function(){this.gfx.pause()},ga.prototype.stop=function(){this.fx.stop(),this.gfx.remove()};var Qp,e1=function(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body")return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild);var r,o=Object.prototype.hasOwnProperty.call(rt,i)?rt[i]:rt._default,a=o[0],c=o[1],l=o[2];for((r=t.createElement("div")).innerHTML=c+e+l;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=t.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},qg=!1;typeof document<"u"&&((Qp=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',qg=!Qp.getElementsByTagName("link").length,Qp=void 0);var rt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:qg?[1,"X<div>","</div>"]:[0,"",""]};rt.td=rt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],rt.option=rt.optgroup=[1,'<select multiple="multiple">',"</select>"],rt.thead=rt.tbody=rt.colgroup=rt.caption=rt.tfoot=[1,"<table>","</table>"],rt.polyline=rt.ellipse=rt.polygon=rt.circle=rt.text=rt.line=rt.path=rt.rect=rt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Mt=e1,eh={},Wg=window.addEventListener?"addEventListener":"attachEvent",t1=window.removeEventListener?"removeEventListener":"detachEvent",Xg=Wg!=="addEventListener"?"on":"";eh.bind=function(e,t,n,i){return e[Wg](Xg+t,n,i||!1),n},eh.unbind=function(e,t,n,i){return e[t1](Xg+t,n,i||!1),n};var vn=eh,n1=Mt,i1=vn,Kg=Fe.is,r1=J.GENERATE_TOKEN_EVENT,o1=J.UPDATE_ELEMENT_EVENT;function th(e,t,n){this._eventBus=e,this._processInstances=t,this._processInstanceSettings=n}th.prototype.createContextPads=function(e){if(e.attachers.length&&this._processInstances.getProcessInstances(e).length){var t=e.incoming.filter(function(r){return Kg(r,"bpmn:SequenceFlow")}),n=this,i=[];return e.attachers.forEach(function(r){var o=r.outgoing.filter(function(c){return Kg(c,"bpmn:SequenceFlow")});if(t.length&&o.length){var a=n1('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>');i.push({element:r,html:a}),i1.bind(a,"click",function(){n._processInstances.getProcessInstances(e).forEach(function(c){var l=c.parentProcessInstanceId;r.businessObject.cancelActivity&&(e.children.forEach(function(u){u.tokenCount&&u.tokenCount[c.processInstanceId]&&u.tokenCount[c.processInstanceId]--}),n._processInstances.finish(c.processInstanceId),n._eventBus.fire(o1,{element:e})),n._eventBus.fire(r1,{element:r,processInstanceId:l})})})}}),i}},th.$inject=["eventBus","processInstances","processInstanceSettings"];var a1=th,s1=Fe.is,c1=Mt,l1=vn;function nh(e){this._exclusiveGatewaySettings=e}nh.prototype.createContextPads=function(e){var t=this;if(!(e.outgoing.filter(function(i){return s1(i,"bpmn:SequenceFlow")}).length<2)){var n=c1('<div class="context-pad" title="Set Sequence Flow"><i class="fa fa-code-fork"></i></div>');return l1.bind(n,"click",function(){t._exclusiveGatewaySettings.setSequenceFlow(e)}),[{element:e,html:n}]}},nh.$inject=["exclusiveGatewaySettings"];var u1=nh,Yg=Mt,Jg=vn,ih=Fe.is,Zg=J.GENERATE_TOKEN_EVENT;function rh(e){this._eventBus=e}rh.prototype.createContextPads=function(e){var t=e.parent.shownProcessInstance,n=e.incoming.filter(function(c){return ih(c,"bpmn:SequenceFlow")}),i=[];n.forEach(function(c){var l=c.source;ih(l,"bpmn:EventBasedGateway")&&l.tokenCount&&l.tokenCount[t]&&i.push(l)});var r=e.outgoing.filter(function(c){return ih(c,"bpmn:SequenceFlow")});if(n.length&&r.length){var o,a=this;if(e.tokenCount&&e.tokenCount[t])o=Yg('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),Jg.bind(o,"click",function(){e.tokenCount[t]--,a._eventBus.fire(Zg,{element:e,processInstanceId:t})});else{if(!i.length)return;o=Yg('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),Jg.bind(o,"click",function(){i.forEach(function(c){c.tokenCount[t]--}),a._eventBus.fire(Zg,{element:e,processInstanceId:t})})}return[{element:e,html:o}]}},rh.$inject=["eventBus"];var p1=rh,h1=Mt,d1=vn;function oh(e,t){this._processInstances=e,this._processInstanceSettings=t}oh.prototype.createContextPads=function(e){var t=this;if(!(this._processInstances.getProcessInstances(e).filter(function(i){return!i.isFinished}).length<2)){var n=h1('<div class="context-pad" title="View Process Instances"><i class="fa fa-list-ol"></i></div>');return d1.bind(n,"click",function(){t._processInstanceSettings.showNext(e)}),[{element:e,html:n}]}},oh.$inject=["processInstances","processInstanceSettings"];var m1=oh,f1=Mt,v1=vn,y1=Fe.is,g1=J.GENERATE_TOKEN_EVENT;function ah(e,t,n){this._eventBus=e,this._elementRegistry=t,this._animation=n}ah.prototype.createContextPads=function(e){var t=!1;if(this._elementRegistry.forEach(function(r){r.tokenCount&&Object.values(r.tokenCount).forEach(function(o){o&&(t=!0)})}),!(y1(e.parent,"bpmn:SubProcess")||t||this._animation.animations.length)){var n=this,i=f1('<div class="context-pad"><i class="fa fa-play"></i></div>');return v1.bind(i,"click",function(){n._eventBus.fire(g1,{element:e})}),[{element:e,html:i}]}},ah.$inject=["eventBus","elementRegistry","animation"];var b1=ah,Qg=Fe.isAncestor,x1=J.TOGGLE_MODE_EVENT,E1=J.RESET_SIMULATION_EVENT,_1=J.TERMINATE_EVENT,w1=J.UPDATE_ELEMENTS_EVENT,S1=J.UPDATE_ELEMENT_EVENT,C1=J.PROCESS_INSTANCE_SHOWN_EVENT,T1=a1,A1=u1,k1=p1,P1=m1,M1=b1,ba=500;function rr(e,t,n,i,r,o){var a=this;this._elementRegistry=t,this._overlays=n,this._injector=i,this._canvas=r,this._processInstances=o,this.overlayIds={},this.handlers={},this.registerHandler("bpmn:ExclusiveGateway",A1),this.registerHandler("bpmn:IntermediateCatchEvent",k1),this.registerHandler("bpmn:SubProcess",P1),this.registerHandler("bpmn:SubProcess",T1),this.registerHandler("bpmn:StartEvent",M1),e.on(x1,ba,function(c){c.simulationModeActive?a.openContextPads():a.closeContextPads()}),e.on(E1,ba,function(){a.closeContextPads(),a.openContextPads()}),e.on(_1,ba,function(c){var l=c.element.parent;a.closeContextPads(l)}),e.on(w1,ba,function(c){c.elements.forEach(function(l){a.closeElementContextPads(l),a.openElementContextPads(l)})}),e.on(S1,ba,function(c){var l=c.element;a.closeElementContextPads(l),a.openElementContextPads(l)}),e.on(C1,function(c){var l=c.processInstanceId,u=o.getProcessInstance(l).parent;a.closeContextPads(u),a.openContextPads(u)})}rr.prototype.registerHandler=function(e,t){var n=this._injector.instantiate(t);this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(n)},rr.prototype.openContextPads=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){t.handlers[n.type]&&Qg(e,n)&&t.openElementContextPads(n)})},rr.prototype.openElementContextPads=function(e){if(this.handlers[e.type]){var t=[];this.handlers[e.type].forEach(function(i){var r=i.createContextPads(e);r&&r.forEach(function(o){o&&t.push(o)})});var n=this;t.forEach(function(i){var r={top:-15,left:-15},o=n._overlays.add(i.element,"context-menu",{position:r,html:i.html,show:{minZoom:.5}});n.overlayIds[i.element.id]=o})}},rr.prototype.closeContextPads=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){Qg(e,n)&&t.closeElementContextPads(n)})},rr.prototype.closeElementContextPads=function(e){var t=this;e.attachers&&e.attachers.length>0&&e.attachers.forEach(function(i){t.closeElementContextPads(i)}),e.children&&e.children.length>0&&e.children.forEach(function(i){t.closeElementContextPads(i)});var n=this.overlayIds[e.id];n&&(this._overlays.remove(n),delete this.overlayIds[e.id])},rr.$inject=["eventBus","elementRegistry","overlays","injector","canvas","processInstances"];var R1=rr,N1=J.TOGGLE_MODE_EVENT;function eb(e,t,n,i,r,o,a,c){var l=this;function u(y,f,v){var g=y[f];y[f]=function(){return v.call(this,g,arguments)}}function p(y,f){u(y,f,function(v,g){if(!l.modelingDisabled)return v.apply(this,g)})}function d(y,f){u(y,f,function(v,g){if(l.modelingDisabled)throw new Error("model is read-only");return v.apply(this,g)})}this._eventBus=e,this.modelingDisabled=!1,e.on(N1,10001,function(y){var f=y.simulationModeActive;l.modelingDisabled=f,l.modelingDisabled&&(i.cancel(),t.close(),n.cancel()),a._update()}),p(t,"open"),p(n,"init"),p(i,"activate"),p(n,"init"),p(i,"activate"),d(o,"moveShape"),d(o,"updateAttachment"),d(o,"moveElements"),d(o,"moveConnection"),d(o,"layoutConnection"),d(o,"createConnection"),d(o,"createShape"),d(o,"createLabel"),d(o,"appendShape"),d(o,"removeElements"),d(o,"distributeElements"),d(o,"removeShape"),d(o,"removeConnection"),d(o,"replaceShape"),d(o,"pasteElements"),d(o,"alignElements"),d(o,"resizeShape"),d(o,"createSpace"),d(o,"updateWaypoints"),d(o,"reconnectStart"),d(o,"reconnectEnd"),u(r,"trigger",function(y,f){var v=f[0];if(!l.modelingDisabled||!function(g,b){return g.indexOf(b)>-1}(["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"],v))return y.apply(this,f)})}eb.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"];var I1=eb,D1=Mt,B1=J.TOGGLE_MODE_EVENT,O1=J.RESET_SIMULATION_EVENT,L1=J.GENERATE_TOKEN_EVENT;function Kr(e,t){var n=this;this._overlays=e,t.on(B1,function(i){i.simulationModeActive||n.removeElementNotifications()}),t.on([O1,L1],function(){n.removeElementNotifications()})}Kr.prototype.addElementNotifications=function(e,t){var n=this;e.forEach(function(i){n.addElementNotification(i,t)})},Kr.prototype.addElementNotification=function(e,t){var n={top:-15,right:15},i='<div class="element-notification '+(t.type||"")+'">'+(t.icon?'<i class="fa '+t.icon+'"></i>':"")+('<span class="text">'+t.text+"</span>"||"")+"</div>",r=D1(i);this._overlays.add(e,"element-notification",{position:n,html:r,show:{minZoom:.5}})},Kr.prototype.removeElementNotifications=function(e){var t=this;e?e.forEach(function(n){t.removeElementNotification(n)}):this._overlays.remove({type:"element-notification"})},Kr.prototype.removeElementNotification=function(e){this._overlays.remove({element:e})},Kr.$inject=["overlays","eventBus"];var tb,nb,j1=Kr;function ib(){return nb?tb:(nb=1,tb=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1})}try{var wc=ib()}catch{wc=ib()}var V1=/\s+/,F1=Object.prototype.toString;function Pi(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Pi.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~wc(t,e)||t.push(e),this.el.className=t.join(" "),this},Pi.prototype.remove=function(e){if(F1.call(e)=="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=wc(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},Pi.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Pi.prototype.toggle=function(e,t){return this.list?(t!==void 0?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(t!==void 0?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},Pi.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(V1);return e[0]===""&&e.shift(),e},Pi.prototype.has=Pi.prototype.contains=function(e){return this.list?this.list.contains(e):!!~wc(this.array(),e)};var Mi=function(e){return new Pi(e)},rb=Mi,ob=Fe,xa=ob.is,ab=ob.supportedElements,z1=J.TOGGLE_MODE_EVENT,$1=J.GENERATE_TOKEN_EVENT,sb=["bpmn:Process","bpmn:Collaboration","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation"];function cb(e){return e.labelTarget}function Ea(e,t,n,i,r){var o=this;this._eventBus=e,this._elementRegistry=t,this._elementNotifications=r,this._notifications=i,this.canvasParent=n.getContainer().parentNode,e.on($1,2e4,function(a){var c=a.element;if(xa(c,"bpmn:StartEvent"))return o.allElementsSupported()?void 0:(o.showWarnings(),rb(o.canvasParent).add("warning"),!0)}),e.on(z1,function(a){a.simulationModeActive||rb(o.canvasParent).remove("warning")})}Ea.prototype.allElementsSupported=function(){var e=!0;return this._elementRegistry.forEach(function(t){xa(t,sb)||xa(t,ab)||cb(t)||(e=!1)}),e},Ea.prototype.showWarnings=function(e){var t=this,n=[];this._elementRegistry.forEach(function(i){xa(i,sb)||xa(i,ab)||cb(i)||(t.showWarning(i),n.indexOf(i.type)&&(t._notifications.showNotification(i.type+" not supported","warning"),n.push(i.type)))})},Ea.prototype.showWarning=function(e){this._elementNotifications.addElementNotification(e,{type:"warning",icon:"fa-exclamation-triangle",text:"Not supported"})},Ea.$inject=["eventBus","elementRegistry","canvas","notifications","elementNotifications"];var G1=Ea,sh=Fe.is,U1=J.TOGGLE_MODE_EVENT,H1=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-lighten-56"),q1=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-darken-30");function _a(e){return sh(e,"bpmn:SequenceFlow")}function or(e,t,n){var i=this;this._elementRegistry=t,this._graphicsFactory=n,e.on(U1,function(r){r.simulationModeActive?i.setSequenceFlowsDefault():i.resetSequenceFlows()})}or.prototype.setSequenceFlowsDefault=function(){var e=this;this._elementRegistry.filter(function(t){return sh(t,"bpmn:ExclusiveGateway")}).forEach(function(t){t.outgoing.filter(_a).length&&e.setSequenceFlow(t,t.outgoing.filter(_a)[0])})},or.prototype.resetSequenceFlows=function(){var e=this;this._elementRegistry.filter(function(t){return sh(t,"bpmn:ExclusiveGateway")}).forEach(function(t){t.outgoing.filter(_a).length&&e.resetSequenceFlow(t)})},or.prototype.resetSequenceFlow=function(e){e.sequenceFlow&&delete e.sequenceFlow},or.prototype.setSequenceFlow=function(e){var t=this,n=e.outgoing.filter(_a);if(n.length){var i=e.sequenceFlow;e.sequenceFlow=i?function(r){var o=r.outgoing.filter(_a),a=o.indexOf(r.sequenceFlow);return o[a+1]?o[a+1]:o[0]}(e):n[0],e.outgoing.forEach(function(r){r===e.sequenceFlow?t.setColor(r,q1):t.setColor(r,H1)})}},or.prototype.setColor=function(e,t){e.businessObject.di.set("stroke",t);var n=this._elementRegistry.getGraphics(e);this._graphicsFactory.update("connection",e,n)},or.$inject=["eventBus","elementRegistry","graphicsFactory"];var W1=or,Sc=Mt,ti=Mi,wa=vn,Cc=ya,ch=Fe,X1=ch.getBusinessObject,sn=ch.is,K1=ch.isTypedEvent,Y1=J.GENERATE_TOKEN_EVENT,J1=J.CONSUME_TOKEN_EVENT,Z1=J.TOGGLE_MODE_EVENT,Q1=J.RESET_SIMULATION_EVENT,eS=J.PROCESS_INSTANCE_CREATED_EVENT;function lh(e){return e&&e.businessObject.name}function Yr(e,t,n,i){var r=this;this._notifications=t,this._tokenSimulationPalette=n,this._canvas=i,this._init(),e.on(Y1,function(o){var a=o.element,c=lh(a);if(sn(a,"bpmn:BusinessRuleTask"))r.log(c||"Business Rule Task","info","bpmn-icon-business-rule");else if(sn(a,"bpmn:CallActivity"))r.log(c||"Call Activity","info","bpmn-icon-call-activity");else if(sn(a,["bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent"]))r.log(c||"Intermediate Event","info","bpmn-icon-intermediate-event-none");else if(sn(a,"bpmn:ManualTask"))r.log(c||"Manual Task","info","bpmn-icon-manual");else if(sn(a,"bpmn:ScriptTask"))r.log(c||"Script Task","info","bpmn-icon-script");else if(sn(a,"bpmn:ServiceTask"))r.log(c||"Service Task","info","bpmn-icon-service");else if(sn(a,"bpmn:StartEvent"))r.log(c||"Start Event","info","bpmn-icon-start-event-none");else if(sn(a,"bpmn:Task"))r.log(c||"Task","info","bpmn-icon-task");else if(sn(a,"bpmn:UserTask"))r.log(c||"User Task","info","bpmn-icon-user");else if(sn(a,"bpmn:ExclusiveGateway")){if(a.outgoing.length<2)return;var l=lh(a.sequenceFlow),u=c||"Gateway";l&&(u=u.concat(' <i class="fa fa-angle-right" aria-hidden="true"></i> '+l)),r.log(u,"info","bpmn-icon-gateway-xor")}}),e.on(J1,function(o){var a=o.element,c=lh(a);sn(a,"bpmn:EndEvent")&&(K1(X1(a),"bpmn:TerminateEventDefinition")?r.log(c||"Terminate End Event","info","bpmn-icon-end-event-terminate"):r.log(c||"End Event","info","bpmn-icon-end-event-none"))}),e.on(eS,function(o){var a=o.processInstanceId,c=o.parent;sn(c,"bpmn:Process")?r.log("Process "+a+" started","success","fa-check"):r.log("Subprocess "+a+" started","info","fa-check")}),e.on(Z1,function(o){o.simulationModeActive||(r.emptyLog(),ti(r.container).add("hidden"))}),e.on(Q1,function(o){r.emptyLog(),ti(r.container).add("hidden")})}Yr.prototype._init=function(){var e=this;this.container=Sc('<div class="token-simulation-log hidden"><div class="header"><i class="fa fa-align-left"></i><button class="close"><i class="fa fa-times" aria-hidden="true"></i></button></div><div class="content"><p class="entry placeholder">No Entries</p></div></div>'),this.placeholder=Cc(".placeholder",this.container),this.content=Cc(".content",this.container),wa.bind(this.content,"wheel",function(t){t.stopPropagation()}),wa.bind(this.content,"mousedown",function(t){t.stopPropagation()}),this.close=Cc(".close",this.container),wa.bind(this.close,"click",function(){ti(e.container).add("hidden")}),this.icon=Cc(".fa-align-left",this.container),wa.bind(this.icon,"click",function(){ti(e.container).add("hidden")}),this._canvas.getContainer().appendChild(this.container),this.paletteEntry=Sc('<div class="entry" title="Show Simulation Log"><i class="fa fa-align-left"></i></div>'),wa.bind(this.paletteEntry,"click",function(){ti(e.container).remove("hidden")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,3)},Yr.prototype.toggle=function(){var e=this.container;ti(e).has("hidden")?ti(e).remove("hidden"):ti(e).add("hidden")},Yr.prototype.log=function(e,t,n){ti(this.placeholder).add("hidden");var i,r=new Date,o=r.toLocaleTimeString()+":"+r.getUTCMilliseconds();this._notifications.showNotification(e,t,n),n||(n="fa-info"),i=n.includes("bpmn")?'<span class="icon '+n+'">':'<i class="icon fa '+n+'"></i>';var a=Sc('<p class="entry '+t+'"><span class="date">'+o+"</span>"+i+"</span>"+e+"</p>");this.content.appendChild(a),this.content.scrollTop=this.content.scrollHeight},Yr.prototype.emptyLog=function(){for(;this.content.firstChild;)this.content.removeChild(this.content.firstChild);this.placeholder=Sc('<p class="entry placeholder">No Entries</p>'),this.content.appendChild(this.placeholder)},Yr.$inject=["eventBus","notifications","tokenSimulationPalette","canvas"];var tS=Yr,lb=Mt,nS=J.TOGGLE_MODE_EVENT;function Sa(e,t){var n=this;this._eventBus=e,this._canvas=t,this._init(),e.on(nS,function(i){i.simulationModeActive||n.removeAll()})}Sa.prototype._init=function(){this.container=lb('<div class="notifications"></div>'),this._canvas.getContainer().appendChild(this.container)},Sa.prototype.showNotification=function(e,t,n){var i;n||(n="fa-info"),i=n.includes("bpmn")?'<i class="'+n+'"></i>':'<i class="fa '+n+'"></i>';var r=lb('<div class="notification '+t+'"><span class="icon">'+i+"</span>"+e+"</div>");for(this.container.appendChild(r);this.container.children.length>5;)this.container.children[0].remove();setTimeout(function(){r.remove()},2e3)},Sa.prototype.removeAll=function(){for(;this.container.children.length;)this.container.children[0].remove()},Sa.$inject=["eventBus","canvas"];var iS=Sa,rS=Mt,ar=Mi,oS=vn,aS=J.TOGGLE_MODE_EVENT,sS=J.PLAY_SIMULATION_EVENT,cS=J.PAUSE_SIMULATION_EVENT,lS=J.RESET_SIMULATION_EVENT,uS=J.ANIMATION_CREATED_EVENT,pS=J.PROCESS_INSTANCE_CREATED_EVENT,ub='<i class="fa fa-play"></i>';function Ri(e,t,n,i){var r=this;this._eventBus=e,this._tokenSimulationPalette=t,this._notifications=n,this.canvasParent=i.getContainer().parentNode,this.isActive=!1,this.isPaused=!1,this._init(),e.on(pS,function(o){o.parent.parent||(r.activate(),r.unpause(),n.showNotification("Start Simulation","info"))}),e.on([lS,aS],function(){r.deactivate(),r.unpause()}),e.on(uS,function(o){var a=o.animation;r.isPaused&&a.pause()})}Ri.prototype._init=function(){this.paletteEntry=rS('<div class="entry disabled" title="Play/Pause Simulation">'+ub+"</div>"),oS.bind(this.paletteEntry,"click",this.toggle.bind(this)),this._tokenSimulationPalette.addEntry(this.paletteEntry,1)},Ri.prototype.toggle=function(){this.isActive&&(this.isPaused?this.unpause():this.pause())},Ri.prototype.pause=function(){this.isActive&&(ar(this.paletteEntry).remove("active"),ar(this.canvasParent).add("paused"),this.paletteEntry.innerHTML=ub,this._eventBus.fire(cS),this._notifications.showNotification("Pause Simulation","info"),this.isPaused=!0)},Ri.prototype.unpause=function(){this.isActive&&(ar(this.paletteEntry).add("active"),ar(this.canvasParent).remove("paused"),this.paletteEntry.innerHTML='<i class="fa fa-pause"></i>',this._eventBus.fire(sS),this._notifications.showNotification("Play Simulation","info"),this.isPaused=!1)},Ri.prototype.activate=function(){this.isActive=!0,ar(this.paletteEntry).remove("disabled")},Ri.prototype.deactivate=function(){this.isActive=!1,ar(this.paletteEntry).remove("active"),ar(this.paletteEntry).add("disabled")},Ri.$inject=["eventBus","tokenSimulationPalette","notifications","canvas"];var hS=Ri,dS=J.TOGGLE_MODE_EVENT;function Ca(e,t,n){var i=this;this._elementRegistry=t,this._graphicsFactory=n,this.elementColors={},e.on(dS,5e4,function(r){r.simulationModeActive?i.preserveColors():i.resetColors()})}Ca.prototype.preserveColors=function(){var e=this;this._elementRegistry.forEach(function(t){e.elementColors[t.id]={stroke:t.businessObject.di.get("stroke"),fill:t.businessObject.di.get("fill")},e.setColor(t,"#000","#fff")})},Ca.prototype.resetColors=function(){var e=this;this._elementRegistry.forEach(function(t){e.elementColors[t.id]&&e.setColor(t,e.elementColors[t.id].stroke,e.elementColors[t.id].fill)}),this.elementColors={}},Ca.prototype.setColor=function(e,t,n){var i=e.businessObject;i.di.set("stroke",t),i.di.set("fill",n);var r=this._elementRegistry.getGraphics(e),o=e.waypoints?"connection":"shape";this._graphicsFactory.update(o,e,r)},Ca.$inject=["eventBus","elementRegistry","graphicsFactory"];var mS=Ca,fS=J.TOGGLE_MODE_EVENT,vS=J.RESET_SIMULATION_EVENT;function Tc(e){this.nextProcessInstanceId=1,e.on(fS,this.reset.bind(this)),e.on(vS,this.reset.bind(this))}Tc.prototype.getNext=function(){var e=this.nextProcessInstanceId;return this.nextProcessInstanceId++,e},Tc.prototype.reset=function(){this.nextProcessInstanceId=1},Tc.$inject=["eventBus"];var yS=Tc,gS=J.TOGGLE_MODE_EVENT,bS=J.PROCESS_INSTANCE_CREATED_EVENT,xS=J.PROCESS_INSTANCE_FINISHED_EVENT,ES=J.PROCESS_INSTANCE_SHOWN_EVENT,_S=J.PROCESS_INSTANCE_HIDDEN_EVENT;function Ta(e,t,n,i){var r=this;this._animation=e,this._eventBus=t,this._processInstances=n,this._elementRegistry=i,this._eventBus.on(bS,500,function(o){var a=o.parent,c=o.processInstanceId,l=n.getProcessInstances(a).filter(function(u){return!u.isFinished});l.length===1?r.showProcessInstance(c,a):l.length>1&&r.hideProcessInstance(c)}),this._eventBus.on(xS,500,function(o){var a=o.parent,c=o.processInstanceId,l=n.getProcessInstances(a).filter(function(u){return c!==u.processInstanceId&&!u.isFinished});l.length&&c===a.shownProcessInstance?r.showProcessInstance(l[0].processInstanceId,a):delete a.shownProcessInstance,a.parent||i.forEach(function(u){delete u.shownProcessInstance})}),t.on(gS,function(){i.forEach(function(o){delete o.shownProcessInstance})})}Ta.prototype.showProcessInstance=function(e,t){this._animation.showProcessInstanceAnimations(e),t.shownProcessInstance=e,this._eventBus.fire(ES,{processInstanceId:e})},Ta.prototype.hideProcessInstance=function(e){this._animation.hideProcessInstanceAnimations(e),this._eventBus.fire(_S,{processInstanceId:e})},Ta.prototype.showNext=function(e){var t=this,n=this._processInstances.getProcessInstances(e),i=e.shownProcessInstance,r=0;for(let o=0;o<n.length&&n[o].processInstanceId!==i;o++)r++;n.forEach(function(o){t.hideProcessInstance(o.processInstanceId)}),r===n.length-1?this.showProcessInstance(n[0].processInstanceId,e):this.showProcessInstance(n[r+1].processInstanceId,e)},Ta.$inject=["animation","eventBus","processInstances","elementRegistry"];var wS=Ta,SS=J.TOGGLE_MODE_EVENT,CS=J.RESET_SIMULATION_EVENT,TS=J.PROCESS_INSTANCE_CREATED_EVENT,AS=J.PROCESS_INSTANCE_FINISHED_EVENT;function sr(e,t){var n=this;this._eventBus=e,this._processInstanceIds=t,this.processInstances=[],e.on([SS,CS],function(){n.processInstances=[]})}sr.prototype.create=function(e,t){var n=this._processInstanceIds.getNext(),i={parent:e,processInstanceId:n,parentProcessInstanceId:t};return this.processInstances.push(i),this._eventBus.fire(TS,i),n},sr.prototype.remove=function(e){this.processInstances=this.processInstances.filter(function(t){return t.processInstanceId!==e})},sr.prototype.finish=function(e){var t=this.processInstances.find(function(n){return n.processInstanceId===e});this._eventBus.fire(AS,t),t.isFinished=!0},sr.prototype.getProcessInstances=function(e,t){if(!e)return this.processInstances;var n=this.processInstances.filter(function(i){return i.parent===e});return t&&t.includeFinished!==!0&&(n=n.filter(function(i){return!i.isFinished})),n},sr.prototype.getProcessInstance=function(e){return this.processInstances.find(function(t){return t.processInstanceId===e})},sr.$inject=["eventBus","processInstanceIds"];var kS=sr,PS=Mt,pb=Mi,MS=vn,RS=Fe.is,NS=J.TOGGLE_MODE_EVENT,IS=J.GENERATE_TOKEN_EVENT,DS=J.RESET_SIMULATION_EVENT;function Ac(e,t,n,i){var r=this;this._eventBus=e,this._tokenSimulationPalette=t,this._notifications=n,this._elementRegistry=i,this._init(),e.on(IS,function(o){RS(o.element,"bpmn:StartEvent")&&pb(r.paletteEntry).remove("disabled")}),e.on(NS,function(o){o.simulationModeActive||r.resetSimulation()})}Ac.prototype._init=function(){var e=this;this.paletteEntry=PS('<div class="entry disabled" title="Reset Simulation"><i class="fa fa-refresh"></i></div>'),MS.bind(this.paletteEntry,"click",function(){e.resetSimulation(),e._notifications.showNotification("Reset Simulation","info")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,2)},Ac.prototype.resetSimulation=function(){pb(this.paletteEntry).add("disabled"),this._elementRegistry.forEach(function(e){e.tokenCount!==void 0&&delete e.tokenCount}),this._eventBus.fire(DS)},Ac.$inject=["eventBus","tokenSimulationPalette","notifications","elementRegistry"];var BS=Ac,OS=Mt,kc=Mi,uh=vn,Pc=ya,LS=J.TOGGLE_MODE_EVENT;function Mc(e,t,n){var i=this;this._canvas=e,this._animation=t,this._eventBus=n,this._init(),n.on(LS,function(r){r.simulationModeActive?kc(i.container).remove("hidden"):kc(i.container).add("hidden")})}Mc.prototype._init=function(){var e=this;this.container=OS('<div class="set-animation-speed hidden"><i title="Set Animation Speed" class="fa fa-tachometer" aria-hidden="true"></i><div class="animation-speed-buttons"><div title="Slow" id="animation-speed-1" class="animation-speed-button"><i class="fa fa-angle-right" aria-hidden="true"></i></div><div title="Normal" id="animation-speed-2" class="animation-speed-button active"><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i></div><div title="Fast" id="animation-speed-3" class="animation-speed-button"><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i></div></div></div>');var t=Pc("#animation-speed-1",this.container),n=Pc("#animation-speed-2",this.container),i=Pc("#animation-speed-3",this.container);uh.bind(t,"click",function(){e.setActive(t),e._animation.setAnimationSpeed(.5)}),uh.bind(n,"click",function(){e.setActive(n),e._animation.setAnimationSpeed(1)}),uh.bind(i,"click",function(){e.setActive(i),e._animation.setAnimationSpeed(1.5)}),this._canvas.getContainer().appendChild(this.container)},Mc.prototype.setActive=function(e){Pc.all(".animation-speed-button",this.container).forEach(function(t){kc(t).remove("active")}),kc(e).add("active")},Mc.$inject=["canvas","animation","eventBus"];var jS=Mc,hb=Mt,Jr=Mi,ph=vn,hh=ya,VS=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},FS=J.TOGGLE_MODE_EVENT,zS=J.PROCESS_INSTANCE_CREATED_EVENT,$S=J.PROCESS_INSTANCE_FINISHED_EVENT,GS=J.PROCESS_INSTANCE_SHOWN_EVENT,US=J.PROCESS_INSTANCE_HIDDEN_EVENT,HS=J.RESET_SIMULATION_EVENT,qS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-silver-base-97"),WS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function db(e){return e===null}function yn(e,t,n,i,r,o){var a=this;this._eventBus=e,this._canvas=t,this._processInstanceSettings=n,this._processInstances=i,this._graphicsFactory=r,this._elementRegistry=o,this.highlightedElement=null,this._init(),e.on(FS,function(c){c.simulationModeActive?Jr(a.container).remove("hidden"):(Jr(a.container).add("hidden"),VS(a.container),db(a.highlightedElement)||(a.removeHighlightFromProcess(a.highlightedElement.element),a.highlightedElement=null))}),e.on(zS,function(c){a.addInstance(c)}),e.on($S,function(c){a.removeInstance(c)}),e.on(GS,function(c){a.setInstanceShown(c.processInstanceId)}),e.on(US,function(c){a.setInstanceHidden(c.processInstanceId)}),e.on(HS,function(){a.removeAllInstances()})}yn.prototype._init=function(){this.container=hb('<div class="process-instances hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},yn.prototype.addInstance=function(e){var t=this,n=e.processInstanceId,i=e.parent,r=hb('<div id="instance-'+n+'" class="process-instance" title="View Process Instance '+n+'">'+n+"</div>");ph.bind(r,"click",function(){t._processInstances.getProcessInstances(i).forEach(function(o){t._processInstanceSettings.hideProcessInstance(o.processInstanceId)}),t._processInstanceSettings.showProcessInstance(n,i)}),ph.bind(r,"mouseenter",function(){t.highlightedElement={element:i,stroke:i.businessObject.di.get("stroke"),fill:i.businessObject.di.get("fill")},t.addHighlightToProcess(i)}),ph.bind(r,"mouseleave",function(){t.removeHighlightFromProcess(i),t.highlightedElement=null}),this.container.appendChild(r)},yn.prototype.removeInstance=function(e){var t=e.processInstanceId,n=hh("#instance-"+t,this.container);n&&n.remove()},yn.prototype.removeAllInstances=function(){this.container.innerHTML=""},yn.prototype.setInstanceShown=function(e){var t=hh("#instance-"+e,this.container);t&&Jr(t).add("active")},yn.prototype.setInstanceHidden=function(e){var t=hh("#instance-"+e,this.container);t&&Jr(t).remove("active")},yn.prototype.addHighlightToProcess=function(e){this.setColor(e,WS,qS),e.parent||Jr(this._canvas.getContainer()).add("highlight")},yn.prototype.removeHighlightFromProcess=function(e){db(this.highlightedElement)||(this.setColor(e,this.highlightedElement.stroke,this.highlightedElement.fill),e.parent||Jr(this._canvas.getContainer()).remove("highlight"))},yn.prototype.setColor=function(e,t,n){var i=e.businessObject;i.di.set("stroke",t),i.di.set("fill",n);var r=this._elementRegistry.getGraphics(e);this._graphicsFactory.update("connection",e,r)},yn.$inject=["eventBus","canvas","processInstanceSettings","processInstances","graphicsFactory","elementRegistry"];var XS=yn,Rc=Fe,KS=Rc.getBusinessObject,Nc=Rc.is,YS=Rc.isAncestor,JS=Rc.isTypedEvent,ZS=J.CONSUME_TOKEN_EVENT;function Ic(e,t,n,i,r,o,a){this._animation=t,this._elementRegistry=n,this._log=i,this._elementNotifications=r,this._canvas=o,this._processInstances=a,e.on(ZS,250,function(){})}Ic.prototype.isDeadlock=function(){var e=this,t=[];this._elementRegistry.forEach(function(r){r.tokenCount&&t.push(r)});var n=[],i=[];t.forEach(function(r){r.outgoing.filter(function(a){return Nc(a,"bpmn:SequenceFlow")}).length||n.push(r),Nc(r,"bpmn:ParallelGateway")&&r.incoming.filter(function(a){return Nc(a,"bpmn:SequenceFlow")}).length>r.tokenCount&&n.push(r);var o=[];(function a(c){c.outgoing.forEach(function(l){o.indexOf(l.target)===-1&&(o.push(l.target),JS(KS(l.target),"bpmn:TerminateEventDefinition")&&i.push(c),a(l.target))})})(r)}),t.length&&!i.length&&n.length&&!this._animation.animations.length&&(e._log.log("Deadlock","warning","fa-exclamation-triangle"),n.forEach(function(r){e._elementNotifications.addElementNotification(r,{type:"warning",icon:"fa-exclamation-triangle",text:"Deadlock"})}))},Ic.prototype.isFinished=function(e,t){var n=this._processInstances.getProcessInstance(t).parent,i=!1;n||(n=this._canvas.getRootElement()),n.children.forEach(function(o){o.tokenCount&&o.tokenCount[t]&&o.tokenCount[t].length&&(i=!0)});var r=!1;if(this._animation.animations.forEach(function(o){YS(n,o.element)&&o.processInstanceId===t&&(r=!0)}),!i&&!r)return Nc(n,"bpmn:SubProcess")?this._log.log("Subprocess "+t+" finished","info","fa-check-circle"):(this._log.log("Process "+t+" finished","success","fa-check-circle"),this._elementNotifications.addElementNotification(e,{type:"success",icon:"fa-check-circle",text:"Finished"})),!0},Ic.$inject=["eventBus","animation","elementRegistry","log","elementNotifications","canvas","processInstances"];var QS=Ic,eC=Mt,Dc=Mi,tC=vn,nC=ya,mb=J.TOGGLE_MODE_EVENT;function Bc(e,t,n,i){var r=this;this._eventBus=e,this._canvas=t,this._selection=n,this._contextPad=i,this.simulationModeActive=!1,e.on("import.done",function(){r.canvasParent=r._canvas.getContainer().parentNode,r.palette=nC(".djs-palette",r._canvas.getContainer()),r._init()})}Bc.prototype._init=function(){this.container=eC(`
  36. <div class="toggle-mode">
  37. Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>
  38. </div>
  39. `),tC.bind(this.container,"click",this.toggleMode.bind(this)),this._canvas.getContainer().appendChild(this.container)},Bc.prototype.toggleMode=function(){if(this.simulationModeActive){this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>',Dc(this.canvasParent).remove("simulation"),Dc(this.palette).remove("hidden"),this._eventBus.fire(mb,{simulationModeActive:!1});var e=this._selection.get();e.length===1&&this._contextPad.open(e[0])}else this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-on"></i></span>',Dc(this.canvasParent).add("simulation"),Dc(this.palette).add("hidden"),this._eventBus.fire(mb,{simulationModeActive:!0});this.simulationModeActive=!this.simulationModeActive},Bc.$inject=["eventBus","canvas","selection","contextPad"];var iC=Bc,rC=Mt,fb=Fe.isAncestor,oC=J.TOGGLE_MODE_EVENT,aC=J.GENERATE_TOKEN_EVENT,sC=J.CONSUME_TOKEN_EVENT,cC=J.RESET_SIMULATION_EVENT,lC=J.TERMINATE_EVENT,uC=J.PROCESS_INSTANCE_SHOWN_EVENT;function cr(e,t,n,i,r){var o=this;this._overlays=t,this._elementRegistry=n,this._canvas=i,this._processInstances=r,this.overlayIds={},e.on(oC,function(a){a.simulationModeActive||o.removeTokenCounts()}),e.on(cC,function(){o.removeTokenCounts()}),e.on(lC,function(a){var c=a.element.parent;o.removeTokenCounts(c)}),e.on([aC,sC],500,function(a){var c=a.element.parent;o.removeTokenCounts(c),o.addTokenCounts(c)}),e.on(uC,function(a){var c=a.processInstanceId,l=r.getProcessInstance(c).parent;o.removeTokenCounts(l),o.addTokenCounts(l)})}cr.prototype.addTokenCounts=function(e){var t=this;e||(e=this._canvas.getRootElement());var n=e.shownProcessInstance;if(!n){var i=this._processInstances.getProcessInstances(e);if(!i.length)return;n=i[0].processInstanceId}this._elementRegistry.forEach(function(r){fb(e,r)&&t.addTokenCount(r,n)})},cr.prototype.addTokenCount=function(e,t){var n=e.tokenCount&&e.tokenCount[t];if(n){var i=this.createTokenCount(n),r={bottom:10,left:-15},o=this._overlays.add(e,"token-count",{position:r,html:i,show:{minZoom:.5}});this.overlayIds[e.id]=o}},cr.prototype.createTokenCount=function(e){return rC('<div class="token-count waiting">'+e+"</div>")},cr.prototype.removeTokenCounts=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){fb(e,n)&&t.removeTokenCount(n)})},cr.prototype.removeTokenCount=function(e){var t=this.overlayIds[e.id];t&&(this._overlays.remove(t),delete this.overlayIds[e.id])},cr.$inject=["eventBus","overlays","elementRegistry","canvas","processInstances"];var pC=cr,Aa=Fe,hC=Aa.getBusinessObject,dC=Aa.is,mC=Aa.isAncestor,fC=Aa.getDescendants,vC=Aa.isTypedEvent,yC=J.GENERATE_TOKEN_EVENT,gC=J.TERMINATE_EVENT,bC=J.UPDATE_ELEMENTS_EVENT;function Oc(e,t,n,i,r,o){this._animation=e,this._eventBus=t,this._log=n,this._simulationState=i,this._elementRegistry=r,this._processInstances=o}Oc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=vC(hC(t),"bpmn:TerminateEventDefinition"),r=dC(t.parent,"bpmn:SubProcess");i&&(this._eventBus.fire(gC,e),this._elementRegistry.forEach(function(c){mC(t.parent,c)&&c.tokenCount&&c.tokenCount[n]&&delete c.tokenCount[n]}),this._processInstances.finish(n));var o=this._simulationState.isFinished(t,n);if(o&&this._processInstances.finish(n),(o||i)&&r){var a=this._processInstances.getProcessInstance(n);this._eventBus.fire(yC,{element:t.parent,processInstanceId:a.parentProcessInstanceId})}this._eventBus.fire(bC,{elements:fC(this._elementRegistry.getAll(),t.parent)})},Oc.prototype.generate=function(e){},Oc.$inject=["animation","eventBus","log","simulationState","elementRegistry","processInstances"];var xC=Oc,EC=Fe.is,_C=J.UPDATE_ELEMENTS_EVENT;function Lc(e,t){this._eventBus=e,this._animation=t}Lc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++;var i=t.outgoing,r=[];i.forEach(function(o){var a=o.target;EC(a,"bpmn:IntermediateCatchEvent")&&r.push(a)}),this._eventBus.fire(_C,{elements:r})},Lc.prototype.generate=function(){},Lc.$inject=["eventBus","animation"];var wC=Lc,SC=J.CONSUME_TOKEN_EVENT,CC=J.GENERATE_TOKEN_EVENT;function jc(e,t,n){this._eventBus=e,this._animation=t,this._elementRegistry=n}jc.prototype.consume=function(e){var t=e.element;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);this._eventBus.fire(CC,e)},jc.prototype.generate=function(e){var t=e.element,n=e.processInstanceId;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);var i=this,r=this._elementRegistry.get(t.sequenceFlow.id);this._animation.createAnimation(r,n,function(){i._eventBus.fire(SC,{element:r.target,processInstanceId:n})})},jc.$inject=["eventBus","animation","elementRegistry"];var TC=jc,vb=Fe.is,AC=J.CONSUME_TOKEN_EVENT,kC=J.UPDATE_ELEMENT_EVENT,PC=J.UPDATE_ELEMENTS_EVENT;function Vc(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}Vc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,this._eventBus.fire(kC,{element:t})},Vc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(a){return vb(a,"bpmn:SequenceFlow")}).forEach(function(a){t._animation.createAnimation(a,i,function(){t._eventBus.fire(AC,{element:a.target,processInstanceId:i})})});var r=n.parent,o=this._elementRegistry.filter(function(a){return vb(a,"bpmn:IntermediateCatchEvent")&&a.parent===r});this._eventBus.fire(PC,{elements:o})},Vc.$inject=["animation","eventBus","elementRegistry"];var MC=Vc,RC=Fe.is,NC=J.CONSUME_TOKEN_EVENT,IC=J.GENERATE_TOKEN_EVENT;function Fc(e,t){this._animation=e,this._eventBus=t}Fc.prototype.consume=function(e){this._eventBus.fire(IC,{element:e})},Fc.prototype.generate=function(e){var t=this;e.outgoing.filter(function(n){return RC(n,"bpmn:SequenceFlow")}).forEach(function(n){t._animation.createAnimation(n,function(){t._eventBus.fire(NC,{element:n.target})})})},Fc.$inject=["animation","eventBus"];var DC=Fc,BC=Fe.is,OC=J.CONSUME_TOKEN_EVENT,LC=J.GENERATE_TOKEN_EVENT;function zc(e,t){this._animation=e,this._eventBus=t}zc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,t.incoming.length===t.tokenCount[n]&&(this._eventBus.fire(LC,e),t.tokenCount[n]=0)},zc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return BC(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(OC,{element:r.target,processInstanceId:i})})})},zc.$inject=["animation","eventBus"];var jC=zc,dh=Fe.is,VC=J.CONSUME_TOKEN_EVENT,FC=J.UPDATE_ELEMENTS_EVENT;function $c(e,t,n,i){this._animation=e,this._eventBus=t,this._elementRegistry=n,this._processInstances=i}$c.prototype.consume=function(){},$c.prototype.generate=function(e){var t=this,n=e.element,i=e.parentProcessInstanceId,r=n.outgoing.filter(function(l){return dh(l,"bpmn:SequenceFlow")}),o=n.parent,a=this._processInstances.create(o,i);if(r.forEach(function(l){t._animation.createAnimation(l,a,function(){t._eventBus.fire(VC,{element:l.target,processInstanceId:a})})}),!dh(n.parent,"bpmn:SubProcess")){var c=this._elementRegistry.filter(function(l){return dh(l,"bpmn:StartEvent")});this._eventBus.fire(FC,{elements:c})}},$c.$inject=["animation","eventBus","elementRegistry","processInstances"];var zC=$c,yb=Fe.is,$C=J.CONSUME_TOKEN_EVENT,gb=J.GENERATE_TOKEN_EVENT,bb=J.UPDATE_ELEMENT_EVENT;function Gc(e,t,n){this._animation=e,this._eventBus=t,this._log=n}Gc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=t.children.filter(function(r){return yb(r,"bpmn:StartEvent")})[0];i?(this._log.log("Starting Subprocess","info","fa-sign-in"),this._eventBus.fire(gb,{element:i,parentProcessInstanceId:n})):(this._log.log("Skipping Subprocess","info","fa-angle-double-right"),this._eventBus.fire(gb,e)),this._eventBus.fire(bb,{element:t})},Gc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return yb(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire($C,{element:r.target,processInstanceId:i})})}),this._eventBus.fire(bb,{element:n})},Gc.$inject=["animation","eventBus","log"];var GC=Gc,UC=Fe.is,HC=J.CONSUME_TOKEN_EVENT,qC=J.UPDATE_ELEMENT_EVENT;function Uc(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}Uc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,this._eventBus.fire(qC,{element:t})},Uc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return UC(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(HC,{element:r.target,processInstanceId:i})})})},Uc.$inject=["animation","eventBus","elementRegistry"];var WC=Uc,XC=Fe.is,KC=J.CONSUME_TOKEN_EVENT,YC=J.GENERATE_TOKEN_EVENT;function Hc(e,t){this._animation=e,this._eventBus=t}Hc.prototype.consume=function(e){this._eventBus.fire(YC,e)},Hc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return XC(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(KC,{element:r.target,processInstanceId:i})})})},Hc.$inject=["animation","eventBus"];var JC=xC,ZC=wC,QC=TC,eT=MC,tT=DC,nT=jC,iT=zC,rT=GC,oT=WC,aT=Hc,sT=J.GENERATE_TOKEN_EVENT,cT=J.CONSUME_TOKEN_EVENT;function mh(e,t,n){var i=this;this._injector=n,this.handlers={},this.registerHandler("bpmn:EndEvent",JC),this.registerHandler("bpmn:EventBasedGateway",ZC),this.registerHandler("bpmn:ExclusiveGateway",QC),this.registerHandler("bpmn:IntermediateCatchEvent",eT),this.registerHandler("bpmn:IntermediateThrowEvent",tT),this.registerHandler("bpmn:ParallelGateway",nT),this.registerHandler("bpmn:StartEvent",iT),this.registerHandler("bpmn:SubProcess",rT),this.registerHandler("bpmn:BoundaryEvent",oT),this.registerHandler(["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"],aT),e.on(sT,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].generate(r)}),e.on(cT,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].consume(r)})}mh.prototype.registerHandler=function(e,t){var n=this,i=this._injector.instantiate(t);Array.isArray(e)||(e=[e]),e.forEach(function(r){n.handlers[r]=i})},mh.$inject=["eventBus","animation","injector"];var lT=mh;function xb(e,t,n,i,r,o){o.register({toggleTokenSimulation:function(){t.toggleMode()}}),o.register({togglePauseTokenSimulation:function(){n.toggle()}}),o.register({resetTokenSimulation:function(){r.resetSimulation()}}),o.register({toggleTokenSimulationLog:function(){i.toggle()}})}xb.$inject=["eventBus","toggleMode","pauseSimulation","log","resetSimulation","editorActions"];var uT=xb,pT=J.TOGGLE_MODE_EVENT;function Eb(e,t){var n=t.get("editorActions",!1),i=t.get("keyboard",!1);if(i&&n){var r=!1;e.on("keyboard.init",function(){i.addListener(1e4,function(o){(function(a){qc(["t","T"],a)?n.trigger("toggleTokenSimulation"):r&&(qc(["l","L"],a)?n.trigger("toggleTokenSimulationLog"):qc([" ","Spacebar"],a)?n.trigger("togglePauseTokenSimulation"):qc(["r","R"],a)&&n.trigger("resetTokenSimulation"))})(o.keyEvent)})}),e.on(pT,function(o){var a=o.simulationModeActive;r=!!a})}}function qc(e,t){return e.indexOf(t.key)>-1}Eb.$inject=["eventBus","injector"];var hT=Eb,dT=Mt,_b=Mi,mT=J.TOGGLE_MODE_EVENT;function Wc(e,t){var n=this;this._canvas=t,this.entries=[],this._init(),e.on(mT,function(i){i.simulationModeActive?_b(n.container).remove("hidden"):_b(n.container).add("hidden")})}Wc.prototype._init=function(){this.container=dT('<div class="token-simulation-palette hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},Wc.prototype.addEntry=function(e,t){var n=0;this.entries.forEach(function(i){t>=i.index&&n++}),this.container.insertBefore(e,this.container.childNodes[n]),this.entries.push({entry:e,index:t})},Wc.$inject=["eventBus","canvas"];const fT=oo({__init__:["animation","contextPads","disableModeling","elementNotifications","elementSupport","exclusiveGatewaySettings","log","notifications","pauseSimulation","preserveElementColors","processInstanceIds","processInstanceSettings","processInstances","resetSimulation","setAnimationSpeed","showProcessInstance","simulationState","toggleMode","tokenCount","tokenSimulationBehavior","tokenSimulationEditorActions","tokenSimulationKeyboardBindings","tokenSimulationPalette"],animation:["type",Qw],contextPads:["type",R1],disableModeling:["type",I1],elementNotifications:["type",j1],elementSupport:["type",G1],exclusiveGatewaySettings:["type",W1],log:["type",tS],notifications:["type",iS],pauseSimulation:["type",hS],preserveElementColors:["type",mS],processInstanceIds:["type",yS],processInstanceSettings:["type",wS],processInstances:["type",kS],resetSimulation:["type",BS],setAnimationSpeed:["type",jS],showProcessInstance:["type",XS],simulationState:["type",QS],toggleMode:["type",iC],tokenCount:["type",pC],tokenSimulationBehavior:["type",lT],tokenSimulationEditorActions:["type",uT],tokenSimulationKeyboardBindings:["type",hT],tokenSimulationPalette:["type",Wc]}),vT={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","camunda:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"camunda:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["camunda:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","camunda:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","camunda:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["camunda:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0},{name:"id",type:"String",isAttr:!0},{name:"eventDefinitions",type:"bpmn:TimerEventDefinition",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvents",isAttr:!0,type:"String"}]}],emumerations:[]},yT={name:"Activiti",uri:"http://activiti.org/bpmn",prefix:"activiti",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","activiti:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"activiti:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0},{name:"executionListener",isAbstract:!0,type:"Expression"}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"multiinstance_type",superClass:["Element"]},{name:"multiinstance_condition",superClass:["Element"]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"multiinstance_condition",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["activiti:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","activiti:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","activiti:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike","activiti:ExecutionListener","activiti:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["activiti:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["activiti:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormProperty",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]}],emumerations:[]},gT={name:"Flowable",uri:"http://flowable.org/bpmn",prefix:"flowable",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","flowable:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"flowable:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formType",isAttr:!0,type:"String"},{name:"formReadOnly",isAttr:!0,type:"Boolean",default:!1},{name:"formInit",isAttr:!0,type:"Boolean",default:!0}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"Assignee",supperClass:"Element",meta:{allowedIn:["*"]},properties:[{name:"label",type:"String",isAttr:!0},{name:"viewId",type:"Number",isAttr:!0}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["flowable:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","flowable:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Button",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"code",type:"String",isAttr:!0},{name:"isHide",type:"String",isAttr:!0},{name:"next",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Assignee",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"condition",type:"String",isAttr:!0},{name:"operationType",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","flowable:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike","flowable:ExecutionListener","flowable:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"ChildField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["flowable:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["flowable:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0},{name:"children",type:"ChildField",isMany:!0},{name:"extensionElements",type:"bpmn:ExtensionElements",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]},{name:"Condition",superClass:["Element"],meta:{allowedIn:["bpmn:SequenceFlow"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"field",type:"String",isAttr:!0},{name:"compare",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"logic",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]}],emumerations:[]},fh=Object.prototype.toString,bT=Object.prototype.hasOwnProperty;qh=function(e){return fh.call(e)==="[object Array]"};function wb(e){const t=fh.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function xT(e,t){return bT.call(e,t)}function ET(e,t){const n=function(r){return wb(r)?r:o=>o===r}(t);let i;return Wh(e,function(r,o){if(n(r,o))return i=r,!1}),i}Wh=function(e,t){let n,i;if(e===void 0)return;const r=qh(e)?wT:_T;for(let o in e)if(xT(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n};function Zr(e,t){return!!ET(e,t)}function _T(e){return e}function wT(e){return Number(e)}L0=function(e,...t){return Object.assign(e,...t)};const ST="*";function Qr(e){const t=this;e.on("moddleCopy.canCopyProperty",function(n){const i=n.property,r=n.parent;return t.canCopyProperty(i,r)})}function eo(e,t){return e&&wb(e.$instanceOf)&&e.$instanceOf(t)}function Sb(e,t){return Zr(t,function(n){return eo(e,n)})}function gn(e,t){return t?eo(e,t)?e:e.$parent?gn(e.$parent,t):void 0:e.$parent}Qr.$inject=["eventBus"],Qr.prototype.canCopyProperty=function(e,t){return n=e,!(fh.call(n)==="[object Object]"&&!function(i,r){const o=i.$type&&i.$model.getTypeDescriptor(i.$type),a=o&&o.meta&&o.meta.allowedIn;return!a||function(c){return c.indexOf(ST)!==-1}(a)?!0:Zr(a,function(c){return gn(r,c)})}(e,t))&&!(eo(e,"camunda:InputOutput")&&!this.canHostInputOutput(t))&&!(Sb(e,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(t))&&!(eo(e,"camunda:In")&&!this.canHostIn(t))&&void 0;var n},Qr.prototype.canHostInputOutput=function(e){if(gn(e,"camunda:Connector"))return!0;const t=gn(e,"bpmn:FlowNode");return!!t&&!Sb(t,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])&&!(eo(t,"bpmn:SubProcess")&&t.get("triggeredByEvent"))},Qr.prototype.canHostConnector=function(e){return!eo(gn(e,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||gn(e,"bpmn:IntermediateThrowEvent")||gn(e,"bpmn:EndEvent")},Qr.prototype.canHostIn=function(e){return gn(e,"bpmn:CallActivity")?!0:!gn(e,"bpmn:SignalEventDefinition")||gn(e,"bpmn:IntermediateThrowEvent")||gn(e,"bpmn:EndEvent")};const CT={__init__:["camundaModdleExtension"],camundaModdleExtension:["type",Qr]},TT={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function vh(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}function yh(e,t){return(n=e)&&n.length&&Zr(e,function(i){return vh(i,t)});var n}function gh(e,t,n){const i=t.name,r=TT[i.replace(/activiti:/,"")];return i===e&&function(o,a){return Zr(a,function(c){return vh(o,c)})}(n,r)}function bh(e){e.on("property.clone",function(t){const n=t.newElement,i=t.propertyDescriptor;this.canCloneProperty(n,i)},this)}bh.$inject=["eventBus"],bh.prototype.canCloneProperty=function(e,t){return gh("activiti:FailedJobRetryTimeCycle",t,e)?yh(e.eventDefinitions,"bpmn:TimerEventDefinition")||yh(e.eventDefinitions,"bpmn:SignalEventDefinition")||vh(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):gh("activiti:Connector",t,e)||gh("activiti:Field",t,e)?yh(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const AT={__init__:["ActivitiModdleExtension"],ActivitiModdleExtension:["type",bh]},kT={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function xh(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}function Eh(e,t){return(n=e)&&n.length&&Zr(e,function(i){return xh(i,t)});var n}function _h(e,t,n){const i=t.name,r=kT[i.replace(/flowable:/,"")];return i===e&&function(o,a){return Zr(a,function(c){return xh(o,c)})}(n,r)}function wh(e){e.on("property.clone",function(t){const n=t.newElement,i=t.propertyDescriptor;this.canCloneProperty(n,i)},this)}wh.$inject=["eventBus"],wh.prototype.canCloneProperty=function(e,t){return _h("flowable:FailedJobRetryTimeCycle",t,e)?Eh(e.eventDefinitions,"bpmn:TimerEventDefinition")||Eh(e.eventDefinitions,"bpmn:SignalEventDefinition")||xh(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):_h("flowable:Connector",t,e)||_h("flowable:Field",t,e)?Eh(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const PT={__init__:["FlowableModdleExtension"],FlowableModdleExtension:["type",wh]};var Te,Ni,MT=Object.defineProperty,Xc=Object.getOwnPropertySymbols,Cb=Object.prototype.hasOwnProperty,Tb=Object.prototype.propertyIsEnumerable,Sh=(e,t,n)=>t in e?MT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ab=(e,t)=>{for(var n in t||(t={}))Cb.call(t,n)&&Sh(e,n,t[n]);if(Xc)for(var n of Xc(t))Tb.call(t,n)&&Sh(e,n,t[n]);return e},Ii=(e,t,n)=>(Sh(e,typeof t!="symbol"?t+"":t,n),n);function bn(e){return e==null}function Ch(e){return typeof e=="string"}(Ni=Te||(Te={})).Root="Root",Ni.Declaration="Declaration",Ni.Comment="Comment",Ni.DocumentType="DocumentType",Ni.Element="Element",Ni.Text="Text",Ni.Instruction="Instruction",Ni.CDATA="CDATA";var cn=class{constructor(e,t=null,n=null){Ii(this,"name"),Ii(this,"type"),Ii(this,"parent"),Ii(this,"children"),Ii(this,"attributes"),Ii(this,"value"),Ii(this,"selfClosing"),Ii(this,"prefix"),this.name="",this.type=e,this.parent=t,this.value=n,this.children=null,this.attributes={},this.selfClosing=!1,this.prefix=""}setName(e){return this.name=e,this}setType(e){return this.type=e,this}setParent(e){return this.parent=e,this}setChildren(e){return this.children=e&&Array.from(e),this}setAttributes(e){return this.attributes=Ab({},e),this}setValue(e){return this.value=e,this}setSelfClosing(e){return this.selfClosing=e,this}setPrefix(e){return this.prefix=e,this}addAttribute(e,t){return this.attributes[e]=t,this}removeAttribute(e){return delete this.attributes[e],this}addChild(e){return e===this||(this.children||(this.children=[]),this.children.push(e),e.parent!==this&&(e.parent=this)),this}removeChild(e){if(this.children&&this.children.length){const t=this.children.findIndex(n=>n===e);~t&&(this.children.splice(t,1),e.parent=null)}return this}toJsObject(){return{name:this.name||void 0,prefix:this.prefix||void 0,type:this.type,attributes:Object.keys(this.attributes).length?this.attributes:void 0,value:bn(this.value)?void 0:this.value,selfClosing:this.selfClosing||void 0,children:(this.type===Te.Element||this.type===Te.Root)&&this.children&&this.children.length?this.children.map(e=>e.toJSON()):void 0}}toXmlString(e=" ",t=`
  40. `,n=0){const i=e.repeat(n);let r="";switch(this.type){case Te.Root:r+=this.children&&this.children.length?this.children.map(o=>o.toXmlString(e,t,n)).join(t):"";break;case Te.Element:{if(!this.name)return"";const o=this.prefix?`${this.prefix}:${this.name}`:this.name;r+=`${i}<${o}`;const a=kb(this.attributes||{});a&&(r+=` ${a}`),this.children&&this.children.length?r+=`>${t}${this.children.map(c=>c.toXmlString(e,t,n+1)).join(t)}${t}${i}</${o}>`:r+=this.selfClosing?" />":`></${o}>`;break}case Te.CDATA:r+=`${i}<![CDATA[${bn(this.value)?"":this.value}]]>`;break;case Te.Text:r+=bn(this.value)?"":`${i}${this.value}`;break;case Te.DocumentType:r+=bn(this.value)?"":`${i}<!DOCTYPE ${this.value}>`;break;case Te.Comment:r+=`${i}<!-- ${bn(this.value)?"":this.value+" "}-->`;break;case Te.Declaration:if(r+=`${i}<?xml `,!this.attributes||bn(this.attributes.version))r+='version="1.0" ';else{const o=parseFloat(this.attributes.version);r+=`version="${Number.isNaN(o)?"1.0":o.toFixed(1)}" `}if(this.attributes){const o=((a,c)=>{var l={};for(var u in a)Cb.call(a,u)&&c.indexOf(u)<0&&(l[u]=a[u]);if(a!=null&&Xc)for(var u of Xc(a))c.indexOf(u)<0&&Tb.call(a,u)&&(l[u]=a[u]);return l})(this.attributes,["version"]);o&&(r+=kb(o))}r+="?>";break;case Te.Instruction:r+=bn(this.value)?"":`${i}<?${this.value}?>`}return r}toJSON(){return this.toJsObject()}toString(){return this.toXmlString("","")}};function kb(e){return Object.keys(e).map(t=>{const n=e[t];return bn(n)?null:function(i){return typeof i=="boolean"}(n)?n?t:null:`${t}="${n}"`}).filter(Boolean).join(" ")}var Pb=e=>e,Mb={ignoreAttributes:!1,parseNodeValue:!0,trimValues:!0,prefixInName:!1,valueProcessor:Pb,attributeProcessor:Pb},RT=Object.keys(Mb),lr="Tag is not closed.";function NT(e,t={}){const n=e.replace(/\r\n?/g,`
  41. `),i=function(l={}){const u=Ab({},l);return RT.forEach(p=>{bn(u[p])&&(u[p]=Mb[p])}),u}(t),r=n.length,o=new cn(Te.Root);let a=o,c="";for(let l=0;l<r;l++){const u=n[l];if(u!=="<")c+=u;else if(n[l+1]==="/"){const p=to(n,">",l,`Element End ${lr}`);let d=n.substring(l+2,p),y="";if(!i.prefixInName){const f=d.indexOf(":");~f&&(y=d.substring(0,f),d=d.substring(f+1))}if(a.prefix!==y||a.name!==d)throw new Error("End Tag is incorrect.");if(c){const f=Th(ur("",Te.Text,c,i));f&&a.addChild(new cn(Te.Text,a,f))}a=a.parent,c="",l=p}else if(n[l+1]==="?"){const p=to(n,"?>",l,`Processing Instruction ${lr}`),d=n.substring(l+2,p-1);if(a)if(d.startsWith("xml ")&&d.includes("version=")&&a.type===Te.Root){const y=new cn(Te.Declaration,a);y.attributes=Ah(d.substr(4),Te.Declaration,i),a.addChild(y)}else a.addChild(new cn(Te.Instruction,a,ur("",Te.Instruction,d,i)));l=p}else if(n.substr(l+1,3)==="!--"){const p=to(n,"-->",l,`Comment ${lr}`),d=n.substring(l+4,p-2);a&&a.addChild(new cn(Te.Comment,a,ur("",Te.Comment,d,i))),l=p}else if(n.substr(l+1,8)==="!DOCTYPE"){let p=to(n,">",l,`Document Type ${lr}`),d=n.substring(l+9,p);d.includes("[")&&(p=to(n,"]>",l,`Document Type ${lr}`),d=n.substring(l+9,p)),a&&a.addChild(new cn(Te.DocumentType,a,ur("",Te.DocumentType,d,i))),l=p}else if(n.substr(l+1,8)==="![CDATA["){const p=to(n,"]]>",l,`CDATA Section ${lr}`),d=n.substring(l+9,p-2);if(a&&c){const y=Th(ur("",Te.Text,c,i));y&&a.addChild(new cn(Te.Text,a,y))}a.addChild(new cn(Te.CDATA,a,ur("",Te.CDATA,d,i))),c="",l=p}else{let p="",d="",y=l+1;for(;y<=r;){let b=n[y];if(p)b===p&&(p="");else if(b==='"'||b==="'")p=b;else if(b===" ")b=" ";else if(b===">")break;d+=b,y++}if(y>r)throw new Error(`Element ${lr}`);d=d.trim();const f=d.indexOf(" ");let v=d,g="";if(~f?(v=d.substr(0,f),d=d.substr(f+1)):d="",!i.prefixInName){const b=v.indexOf(":");~b&&(g=v.substring(0,b),v=v.substring(b+1))}if(a&&c){const b=Th(ur("",Te.Text,c,i));b&&a.addChild(new cn(Te.Text,a,b))}if(d.length&&d.lastIndexOf("/")===d.length-1){v[v.length-1]==="/"?(v=v.substr(0,v.length-1),d=""):d=d.substr(0,d.length-1);const b=new cn(Te.Element,a);b.name=v,b.selfClosing=!0,b.prefix=g,d&&!i.ignoreAttributes&&(b.attributes=Ah(d,Te.Element,i)),a.addChild(b)}else{const b=new cn(Te.Element,a);d&&!i.ignoreAttributes&&(b.attributes=Ah(d,Te.Element,i)),b.name=v,b.prefix=g,a.addChild(b),a=b}c="",l=y}}return o}function to(e,t,n,i){const r=e.indexOf(t,n);if(!~r)throw new Error(i);return r+t.length-1}function ur(e,t,n,i){return n?(i.trimValues&&(n=n.trim()),Rb(i.valueProcessor(n,t,e),i.parseNodeValue)):null}function Rb(e,t){return t&&Ch(e)?(e=e.trim())==="true"||e!=="false"&&function(n){const i=parseFloat(n);return Number.isNaN(i)?n:i}(e):bn(e)?null:e}function Th(e){return bn(e)?"":Ch(e)?e:String(e)}var IT=/[^\s=]+\s*(=\s*['"][\s\S]*?['"])?/g;function Ah(e,t,n){const i=(e=e.replace(/\r?\n/g," ")).match(IT)||[],r={};for(let o=0;o<i.length;o++){const a=i[o];let[c,l]=a.split("=");c=c.trim(),Ch(l)?(l=l.substring(1,l.length-1),n.trimValues&&(l=l.trim()),r[c]=Rb(n.attributeProcessor(l,c,t),n.parseNodeValue)):r[c]=!0}return r}let Nb,Ib,Db,Bb,Ob,Lb,jb,Vb,Fb;Nb={class:"my-process-designer"},Ib={class:"my-process-designer__header",style:{"z-index":"999",display:"table-row-group"}},Db={style:{color:"#409eff"}},Bb=Ve("br",null,null,-1),Ob=Ve("br",null,null,-1),Lb=Ve("br",null,null,-1),jb={class:"my-process-designer__container"},Vb={class:"hljs"},Fb=Rt({name:"MyProcessDesigner",__name:"ProcessDesigner",props:{value:String,processId:String,processName:String,formId:Number,translations:{type:Object,default:()=>{}},additionalModel:[Object,Array],moddleExtension:{type:Object,default:()=>{}},onlyCustomizeAddi:{type:Boolean,default:!1},onlyCustomizeModdle:{type:Boolean,default:!1},simulation:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},prefix:{type:String,default:"camunda"},events:{type:Array,default:()=>["element.click"]},headerButtonSize:{type:String,default:"small",validator:e=>["default","medium","small","mini"].indexOf(e)!==-1},headerButtonType:{type:String,default:"primary",validator:e=>["default","primary","success","warning","danger","info"].indexOf(e)!==-1}},emits:["destroy","init-finished","save","commandStack-changed","input","change","canvas-viewbox-changed","element-click"],setup(e,{emit:t}){const n=W(),i=W(),r=t,o=e;ol("configGlobal",o);let a=null;const c=W(1),l=W(!1),u=W(!1),p=W(""),d=W("xml"),y=W(!1),f=W(!1),v=$h(()=>{console.log(o.additionalModel,"additionalModel");const T=[];if(o.onlyCustomizeAddi)return Object.prototype.toString.call(o.additionalModel)=="[object Array]"?o.additionalModel||[]:[o.additionalModel];Object.prototype.toString.call(o.additionalModel)=="[object Array]"?T.push(...o.additionalModel):o.additionalModel&&T.push(o.additionalModel);const M={translate:["value",(N=o.translations||jw,function($,P){return P=P||{},($=N[$]||$).replace(/{([^}]+)}/g,function(x,I){let j=P[I];return N[P[I]]!==null&&N[P[I]]!==void 0&&(j=N[P[I]]),j||"{"+I+"}"})})]};var N;return T.push(M),o.simulation&&T.push(fT),console.log(o.prefix,"props.prefix "),o.prefix==="camunda"&&T.push(CT),o.prefix==="flowable"&&T.push(PT),o.prefix==="activiti"&&T.push(AT),T}),g=$h(()=>{console.log(o.onlyCustomizeModdle,"props.onlyCustomizeModdle"),console.log(o.moddleExtension,"props.moddleExtension"),console.log(o.prefix,"props.prefix");const T={};if(o.onlyCustomizeModdle)return o.moddleExtension||null;if(o.moddleExtension)for(let M in o.moddleExtension)T[M]=o.moddleExtension[M];return o.prefix==="activiti"&&(T.activiti=yT),o.prefix==="flowable"&&(T.flowable=gT),o.prefix==="camunda"&&(T.camunda=vT),T});console.log(v,"additionalModules()"),console.log(g,"moddleExtensions()");const b=()=>{const T=a.get("eventBus");console.log(T,"EventBus"),o.events.forEach(M=>{T.on(M,function(N){let $=M.replace(/\./g,"-"),P=N?N.element:null;console.log($,"eventName"),console.log(P,"element"),r("element-click",P,N)})}),T.on("commandStack.changed",async M=>{try{y.value=a.get("commandStack").canRedo(),f.value=a.get("commandStack").canUndo();let{xml:N}=await a.saveXML({format:!0});r("commandStack-changed",M),r("input",N),r("change",N)}catch(N){console.error(`[Process Designer Warn]: ${N.message||N}`)}}),a.on("canvas.viewbox.changed",({viewbox:M})=>{r("canvas-viewbox-changed",{viewbox:M});const{scale:N}=M;c.value=Math.floor(100*N)/100})},S=async T=>{console.log(T,"xml");let M=o.processId||`Process_${new Date().getTime()}`,N=o.processName||`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,$=T||Fg(M,N,o.prefix);try{let{warnings:P}=await a.importXML($);console.log(P,"warnings"),P&&P.length&&P.forEach(x=>console.warn(x))}catch(P){console.error(`[Process Designer Warn]: ${P.message||P}`)}},w=async T=>{try{if(T==="xml"||T==="bpmn"){const{err:N,xml:$}=await a.saveXML();N&&console.error(`[Process Designer Warn ]: ${N.message||N}`);let{href:P,filename:x}=_(T.toUpperCase(),$);M(P,x)}else{const{err:N,svg:$}=await a.saveSVG();if(N)return console.error(N);let{href:P,filename:x}=_("SVG",$);M(P,x)}}catch(N){console.error(`[Process Designer Warn ]: ${N.message||N}`)}function M(N,$){if(N&&$){let P=document.createElement("a");P.download=$,P.href=N,P.click(),URL.revokeObjectURL(P.href)}}},_=(T,M)=>({filename:`diagram.${T}`,href:`data:application/${T==="svg"?"text/xml":"bpmn20-xml"};charset=UTF-8,${encodeURIComponent(M)}`,data:M}),C=()=>{const T=i.value.files[0],M=new FileReader;M.readAsText(T),M.onload=function(){let N=this.result;S(N)}},B=()=>{u.value=!u.value,console.log(a.get("toggleMode","strict"),"bpmnModeler.get('toggleMode')"),o.simulation&&a.get("toggleMode","strict").toggleMode()},s=T=>{const M=a.get("alignElements"),N=a.get("selection").get();!N||N.length<=1?IA.warning("\u8BF7\u6309\u4F4F Shift \u952E\u9009\u62E9\u591A\u4E2A\u5143\u7D20\u5BF9\u9F50"):ao.confirm("\u81EA\u52A8\u5BF9\u9F50\u53EF\u80FD\u9020\u6210\u56FE\u5F62\u53D8\u5F62\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F","\u8B66\u544A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{M.trigger(N,T)})},h=()=>{console.log(a.saveXML,"bpmnModeler"),a.saveXML({format:!0}).then(({xml:T})=>{p.value=T,d.value="xml",l.value=!0})},m=()=>{a.saveXML({format:!0}).then(({xml:T})=>{var N;const M=new cn(Te.Root,NT(T));p.value=(N=M.parent)==null?void 0:N.toJSON(),d.value="json",l.value=!0})},E=async()=>{console.log(a,"bpmnModelerbpmnModelerbpmnModelerbpmnModeler");const{err:T,xml:M}=await a.saveXML();console.log(T,"errerrerrerrerr"),console.log(M,"xmlxmlxmlxmlxml"),T?alert("\u4FDD\u5B58\u6A21\u578B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01"):r("save",M)};return MA(()=>{console.log(o,"propspropspropsprops")}),Ma(()=>{(()=>{if(a)return;let T=document.getElementById("bpmnCanvas");console.log(T,"data"),console.log(o.keyboard,"props.keyboard"),console.log(v,"additionalModules()"),console.log(g,"moddleExtensions()"),a=new Ln({container:T,keyboard:o.keyboard?{bindTo:document}:null,additionalModules:v.value,moddleExtensions:g.value}),console.log(a,"bpmnModeler111111"),r("init-finished",a),b()})(),S(o.value)}),jn(()=>{a&&a.destroy(),r("destroy",a),a=null}),(T,M)=>{const N=ho,$=GA,P=DA,x=BA,I=so,j=AA,G=RA("highlight");return ne(),De("div",Nb,[Ve("div",Ib,[NA(T.$slots,"control-header"),T.$slots["control-header"]?ke("",!0):(ne(),De(ln,{key:0},[R(x,{key:"file-control"},{default:V(()=>[R(N,{preIcon:"ep:folder-opened",title:"\u6253\u5F00\u6587\u4EF6",onClick:M[0]||(M[0]=X=>D(i).click())}),R(P,{effect:"light",placement:"bottom"},{content:V(()=>[Ve("div",Db,[R($,{title:"\u4E0B\u8F7D\u4E3AXML\u6587\u4EF6",onClick:M[1]||(M[1]=X=>{w("xml")})}),Bb,R($,{title:"\u4E0B\u8F7D\u4E3ASVG\u6587\u4EF6",onClick:M[2]||(M[2]=X=>{w("svg")})}),Ob,R($,{title:"\u4E0B\u8F7D\u4E3ABPMN\u6587\u4EF6",onClick:M[3]||(M[3]=X=>{w("bpmn")})})])]),default:V(()=>[R(N,{title:"\u4E0B\u8F7D\u6587\u4EF6",preIcon:"ep:download"})]),_:1}),R(P,{effect:"light"},{content:V(()=>[R($,{title:"\u9884\u89C8XML",onClick:h}),Lb,R($,{title:"\u9884\u89C8JSON",onClick:m})]),default:V(()=>[R(N,{preIcon:"ep:view",title:"\u6D4F\u89C8"})]),_:1}),o.simulation?(ne(),Ce(P,{key:0,effect:"light",content:D(u)?"\u9000\u51FA\u6A21\u62DF":"\u5F00\u542F\u6A21\u62DF"},{default:V(()=>[R(N,{preIcon:"ep:cpu",title:"\u6A21\u62DF",onClick:B})]),_:1},8,["content"])):ke("",!0)]),_:1}),R(x,{key:"align-control"},{default:V(()=>[R(P,{effect:"light",content:"\u5411\u5DE6\u5BF9\u9F50"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-bottom",onClick:M[4]||(M[4]=X=>s("left"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u53F3\u5BF9\u9F50"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-top",onClick:M[5]||(M[5]=X=>s("right"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u4E0A\u5BF9\u9F50"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-left",onClick:M[6]||(M[6]=X=>s("top"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u4E0B\u5BF9\u9F50"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-right",onClick:M[7]||(M[7]=X=>s("bottom"))})]),_:1}),R(P,{effect:"light",content:"\u6C34\u5E73\u5C45\u4E2D"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-center",onClick:M[8]||(M[8]=X=>s("center"))})]),_:1}),R(P,{effect:"light",content:"\u5782\u76F4\u5C45\u4E2D"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-middle",onClick:M[9]||(M[9]=X=>s("middle"))})]),_:1})]),_:1}),R(x,{key:"scale-control"},{default:V(()=>[R(P,{effect:"light",content:"\u7F29\u5C0F\u89C6\u56FE"},{default:V(()=>[R(N,{preIcon:"ep:zoom-out",onClick:M[10]||(M[10]=X=>((ee=.1)=>{let re=Math.floor(100*c.value-100*ee)/100;if(re<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");c.value=re,a.get("canvas").zoom(c.value)})()),disabled:D(c)<.2},null,8,["disabled"])]),_:1}),R(I,null,{default:V(()=>[me(M0(Math.floor(10*D(c)*10)+"%"),1)]),_:1}),R(P,{effect:"light",content:"\u653E\u5927\u89C6\u56FE"},{default:V(()=>[R(N,{preIcon:"ep:zoom-in",onClick:M[11]||(M[11]=X=>((ee=.1)=>{let re=Math.floor(100*c.value+100*ee)/100;if(re>4)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");c.value=re,a.get("canvas").zoom(c.value)})()),disabled:D(c)>4},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u91CD\u7F6E\u89C6\u56FE\u5E76\u5C45\u4E2D"},{default:V(()=>[R(N,{preIcon:"ep:scale-to-original",onClick:M[12]||(M[12]=X=>(c.value=1,void a.get("canvas").zoom("fit-viewport","auto")))})]),_:1})]),_:1}),R(x,{key:"stack-control"},{default:V(()=>[R(P,{effect:"light",content:"\u64A4\u9500"},{default:V(()=>[R(N,{preIcon:"ep:refresh-left",onClick:M[13]||(M[13]=X=>{a.get("commandStack").undo()}),disabled:!D(f)},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u6062\u590D"},{default:V(()=>[R(N,{preIcon:"ep:refresh-right",onClick:M[14]||(M[14]=X=>{a.get("commandStack").redo()}),disabled:!D(y)},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u91CD\u65B0\u7ED8\u5236"},{default:V(()=>[R(N,{preIcon:"ep:refresh",onClick:M[15]||(M[15]=X=>(y.value=!1,f.value=!1,void S(null)))})]),_:1})]),_:1}),R(N,{preIcon:"ep:plus",title:"\u4FDD\u5B58\u6A21\u578B",onClick:E,type:o.headerButtonType,disabled:D(u)},null,8,["type","disabled"])],64)),Ve("input",{type:"file",id:"files",ref_key:"refFile",ref:i,style:{display:"none"},accept:".xml, .bpmn",onChange:C},null,544)]),Ve("div",jb,[Ve("div",{class:"my-process-designer__canvas",ref_key:"bpmnCanvas",ref:n,id:"bpmnCanvas",style:{width:"1680px",height:"800px"}},null,512)]),R(j,{title:"\u9884\u89C8",modelValue:D(l),"onUpdate:modelValue":M[16]||(M[16]=X=>un(l)?l.value=X:null),width:"80%",scroll:!0,"max-height":"600px"},{default:V(()=>[al((ne(),De("div",null,[Ve("code",Vb,M0(D(p)),1)])),[[G]])]),_:1},8,["modelValue"])])}}}),Na=Nt(Fb,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue"]]),Na.install=function(e){e.component(Na.name,Na)};const DT={class:"panel-tab__content"},BT={key:0},OT={key:1},LT=Rt({name:"ElementBaseInfo",__name:"ElementBaseInfo",props:{businessObject:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}}},setup(e){const t=e,n=W({}),i=W(),r=W({}),o=OA({id:[{required:!0,message:"\u6D41\u7A0B\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u6D41\u7A0B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),a=()=>window==null?void 0:window.bpmnInstances,c=p=>{p&&(p.match(/[a-zA-Z_][\-_.0-9a-zA-Z$]*/)?(console.log("key \u6EE1\u8DB3 XML NCName \u89C4\u5219\uFF0C\u6240\u4EE5\u8FDB\u884C\u8D4B\u503C"),r.value.id=p,setTimeout(()=>{u("id")},100)):console.log("key \u4E0D\u6EE1\u8DB3 XML NCName \u89C4\u5219\uFF0C\u6240\u4EE5\u4E0D\u8FDB\u884C\u8D4B\u503C"))},l=p=>{console.log(r,"elementBaseInfo"),p&&(r.value.name=p,setTimeout(()=>{u("name")},100))},u=p=>{console.log(p,"key");const d=Object.create(null);d[p]=r.value[p],console.log(r,"elementBaseInfo11111111111"),n.value={...r.value,...n.value},p==="id"?(console.log("jinru"),console.log(window,"window"),console.log(i.value,"bpmnElement"),console.log(Be(i.value),"bpmnElement"),a().modeling.updateProperties(Be(i.value),{id:r.value[p],di:{id:`${r.value[p]}_di`}})):(console.log(d,"attrObj"),a().modeling.updateProperties(Be(i.value),d))};return Ma(()=>{setTimeout(()=>{console.log(t.model,"props.model"),c(t.model.key),l(t.model.name),console.log(t,"propsssssssssssssssssssss")},1e3)}),mt(()=>t.businessObject,p=>{var d;console.log(p,"val11111111111111111111"),p&&(console.log(window,"window"),console.log(i.value,"bpmnElement"),i.value=(d=a())==null?void 0:d.bpmnElement,console.log(i.value,"resetBaseInfo11111111111"),r.value=i.value.businessObject,n.value.type=i.value.businessObject.$type,console.log(r.value,"elementBaseInfo22222222222"))}),jn(()=>{i.value=null}),(p,d)=>{const y=Hh,f=wn,v=Sn,g=oi;return ne(),De("div",DT,[R(g,{"label-width":"90px",model:D(n),rules:D(o)},{default:V(()=>[D(n).type=="bpmn:Process"?(ne(),De("div",BT,[R(y,{href:"https://doc.iocoder.cn/bpm/#_3-%E6%B5%81%E7%A8%8B%E5%9B%BE%E7%A4%BA%E4%BE%8B",type:"danger",target:"_blank"},{default:V(()=>[me(" \u5982\u4F55\u5B9E\u73B0\u5B9E\u73B0\u4F1A\u7B7E\u3001\u6216\u7B7E\uFF1F ")]),_:1}),R(v,{label:"\u6D41\u7A0B\u6807\u8BC6",prop:"id"},{default:V(()=>[R(f,{modelValue:D(n).id,"onUpdate:modelValue":d[0]||(d[0]=b=>D(n).id=b),placeholder:"\u8BF7\u8F93\u5165\u6D41\u6807\u6807\u8BC6",disabled:D(n).id!==void 0&&D(n).id.length>0,onChange:c},null,8,["modelValue","disabled"])]),_:1}),R(v,{label:"\u6D41\u7A0B\u540D\u79F0",prop:"name"},{default:V(()=>[R(f,{modelValue:D(n).name,"onUpdate:modelValue":d[1]||(d[1]=b=>D(n).name=b),placeholder:"\u8BF7\u8F93\u5165\u6D41\u7A0B\u540D\u79F0",clearable:"",onChange:l},null,8,["modelValue"])]),_:1})])):(ne(),De("div",OT,[R(v,{label:"ID"},{default:V(()=>[R(f,{modelValue:D(r).id,"onUpdate:modelValue":d[2]||(d[2]=b=>D(r).id=b),clearable:"",onChange:d[3]||(d[3]=b=>u("id"))},null,8,["modelValue"])]),_:1}),R(v,{label:"\u540D\u79F0"},{default:V(()=>[R(f,{modelValue:D(r).name,"onUpdate:modelValue":d[4]||(d[4]=b=>D(r).name=b),clearable:"",onChange:d[5]||(d[5]=b=>u("name"))},null,8,["modelValue"])]),_:1})]))]),_:1},8,["model","rules"])])}}}),jT=Nt(LT,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue"]]),VT={class:"panel-tab__content"},FT={class:"element-property input-property"},zT=Ve("div",{class:"element-property__label"},"\u5143\u7D20\u6587\u6863\uFF1A",-1),$T={class:"element-property__value"},GT=Rt({name:"ElementOtherConfig",__name:"ElementOtherConfig",props:{id:String},setup(e){const t=e,n=W(""),i=W(),r=()=>window.bpmnInstances,o=()=>{i.value&&i.value.id===t.id||(i.value=r().elementRegistry.get(t.id));const a=r().bpmnFactory.create("bpmn:Documentation",{text:n.value});r().modeling.updateProperties(Be(i.value),{documentation:[a]})};return jn(()=>{i.value=null}),mt(()=>t.id,a=>{a&&a.length?zt(()=>{var l;const c=(l=r().bpmnElement.businessObject)==null?void 0:l.documentation;n.value=c&&c.length?c[0].text:""}):n.value=""},{immediate:!0}),(a,c)=>{const l=wn;return ne(),De("div",VT,[Ve("div",FT,[zT,Ve("div",$T,[R(l,{type:"textarea",modelValue:D(n),"onUpdate:modelValue":c[0]||(c[0]=u=>un(n)?n.value=u:null),resize:"vertical",autosize:{minRows:2,maxRows:4},onInput:o,onBlur:o},null,8,["modelValue"])])])])}}}),UT=Nt(GT,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/other/ElementOtherConfig.vue"]]),HT={style:{"margin-top":"16px"}},qT=Rt({name:"UserTask",__name:"UserTask",props:{id:String,type:String},setup(e){const t=e,n=W({assignee:"",candidateUsers:[],candidateGroups:[],dueDate:"",followUpDate:"",priority:""}),i=W({}),r=W(),o=()=>window==null?void 0:window.bpmnInstances,a=c=>{const l=Object.create(null);l[c]=c==="candidateUsers"||c==="candidateGroups"?i.value[c]&&i.value[c].length?i.value[c].join():null:i.value[c]||null,o().modeling.updateProperties(Be(r.value),l)};return mt(()=>t.id,()=>{r.value=o().bpmnElement,zt(()=>{(()=>{var c,l;for(let u in n.value){let p;p=u==="candidateUsers"||u==="candidateGroups"?(c=r.value)!=null&&c.businessObject[u]?r.value.businessObject[u].split(","):[]:((l=r.value)==null?void 0:l.businessObject[u])||n.value[u],i.value[u]=p}})()})},{immediate:!0}),jn(()=>{r.value=null}),(c,l)=>{const u=wn,p=Sn,d=Hh,y=R0("router-link");return ne(),De("div",HT,[R(p,{label:"\u5230\u671F\u65F6\u95F4"},{default:V(()=>[R(u,{modelValue:D(i).dueDate,"onUpdate:modelValue":l[0]||(l[0]=f=>D(i).dueDate=f),clearable:"",onChange:l[1]||(l[1]=f=>a("dueDate"))},null,8,["modelValue"])]),_:1}),R(p,{label:"\u8DDF\u8E2A\u65F6\u95F4"},{default:V(()=>[R(u,{modelValue:D(i).followUpDate,"onUpdate:modelValue":l[2]||(l[2]=f=>D(i).followUpDate=f),clearable:"",onChange:l[3]||(l[3]=f=>a("followUpDate"))},null,8,["modelValue"])]),_:1}),R(p,{label:"\u4F18\u5148\u7EA7"},{default:V(()=>[R(u,{modelValue:D(i).priority,"onUpdate:modelValue":l[4]||(l[4]=f=>D(i).priority=f),clearable:"",onChange:l[5]||(l[5]=f=>a("priority"))},null,8,["modelValue"])]),_:1}),me(" \u53CB\u60C5\u63D0\u793A\uFF1A\u4EFB\u52A1\u7684\u5206\u914D\u89C4\u5219\uFF0C\u4F7F\u7528 "),R(y,{target:"_blank",to:{path:"/bpm/manager/model"}},{default:V(()=>[R(d,{type:"danger"},{default:V(()=>[me("\u6D41\u7A0B\u6A21\u578B")]),_:1})]),_:1}),me(" \u4E0B\u7684\u3010\u5206\u914D\u89C4\u5219\u3011\u66FF\u4EE3\uFF0C\u63D0\u4F9B\u6307\u5B9A\u89D2\u8272\u3001\u90E8\u95E8\u8D1F\u8D23\u4EBA\u3001\u90E8\u95E8\u6210\u5458\u3001\u5C97\u4F4D\u3001\u5DE5\u4F5C\u7EC4\u3001\u81EA\u5B9A\u4E49\u811A\u672C\u7B49 7 \u79CD\u7EF4\u62A4\u7684\u4EFB\u52A1\u5206\u914D\u7EF4\u5EA6\uFF0C\u66F4\u52A0\u7075\u6D3B\uFF01 ")])}}}),WT=Nt(qT,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue"]]),XT={style:{"margin-top":"16px"}},KT=Rt({name:"ScriptTask",__name:"ScriptTask",props:{id:String,type:String},setup(e){const t=e,n=W({scriptFormat:"",script:"",resource:"",resultVariable:""}),i=W({}),r=W(),o=()=>window==null?void 0:window.bpmnInstances,a=()=>{let c=Object.create(null);c.scriptFormat=i.value.scriptFormat||null,c.resultVariable=i.value.resultVariable||null,i.value.scriptType==="inline"?(c.script=i.value.script||null,c.resource=null):(c.resource=i.value.resource||null,c.script=null),o().modeling.updateProperties(Be(r.value),c)};return jn(()=>{r.value=null}),mt(()=>t.id,()=>{r.value=o().bpmnElement,zt(()=>{(()=>{var c;for(let l in n.value){let u=((c=r.value)==null?void 0:c.businessObject[l])||n.value[l];i.value[l]=u}i.value.scriptType=i.value.script?"inline":"external"})()})},{immediate:!0}),(c,l)=>{const u=wn,p=Sn,d=co,y=lo;return ne(),De("div",XT,[R(p,{label:"\u811A\u672C\u683C\u5F0F"},{default:V(()=>[R(u,{modelValue:D(i).scriptFormat,"onUpdate:modelValue":l[0]||(l[0]=f=>D(i).scriptFormat=f),clearable:"",onInput:l[1]||(l[1]=f=>a()),onChange:l[2]||(l[2]=f=>a())},null,8,["modelValue"])]),_:1}),R(p,{label:"\u811A\u672C\u7C7B\u578B"},{default:V(()=>[R(y,{modelValue:D(i).scriptType,"onUpdate:modelValue":l[3]||(l[3]=f=>D(i).scriptType=f)},{default:V(()=>[R(d,{label:"\u5185\u8054\u811A\u672C",value:"inline"}),R(d,{label:"\u5916\u90E8\u8D44\u6E90",value:"external"})]),_:1},8,["modelValue"])]),_:1}),al(R(p,{label:"\u811A\u672C"},{default:V(()=>[R(u,{modelValue:D(i).script,"onUpdate:modelValue":l[4]||(l[4]=f=>D(i).script=f),type:"textarea",resize:"vertical",autosize:{minRows:2,maxRows:4},clearable:"",onInput:l[5]||(l[5]=f=>a()),onChange:l[6]||(l[6]=f=>a())},null,8,["modelValue"])]),_:1},512),[[Gh,D(i).scriptType==="inline"]]),al(R(p,{label:"\u8D44\u6E90\u5730\u5740"},{default:V(()=>[R(u,{modelValue:D(i).resource,"onUpdate:modelValue":l[7]||(l[7]=f=>D(i).resource=f),clearable:"",onInput:l[8]||(l[8]=f=>a()),onChange:l[9]||(l[9]=f=>a())},null,8,["modelValue"])]),_:1},512),[[Gh,D(i).scriptType==="external"]]),R(p,{label:"\u7ED3\u679C\u53D8\u91CF"},{default:V(()=>[R(u,{modelValue:D(i).resultVariable,"onUpdate:modelValue":l[10]||(l[10]=f=>D(i).resultVariable=f),clearable:"",onInput:l[11]||(l[11]=f=>a()),onChange:l[12]||(l[12]=f=>a())},null,8,["modelValue"])]),_:1})])}}}),YT=Nt(KT,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue"]]),JT={style:{"margin-top":"16px"}},ZT={style:{display:"flex","align-items":"center","justify-content":"space-between","flex-wrap":"nowrap"}},QT=Rt({name:"ReceiveTask",__name:"ReceiveTask",props:{id:String,type:String},setup(e){const t=e,n=I0(),i=W(""),r=W({}),o=W({}),a=W(!1),c=W(),l=W(),u=W(),p=()=>window.bpmnInstances,d=()=>{a.value=!0,r.value={}},y=()=>{if(o.value[r.value.id])return void n.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const v=p().moddle.create("bpmn:Message",r.value);u.value.push(v),o.value[r.value.id]=r.value.name,l.value[r.value.id]=v,a.value=!1},f=v=>{v==="-1"?p().modeling.updateProperties(Be(c.value),{messageRef:null}):p().modeling.updateProperties(Be(c.value),{messageRef:l.value[v]})};return Ma(()=>{l.value=Object.create(null),u.value=p().modeler.getDefinitions().rootElements,u.value.filter(v=>v.$type==="bpmn:Message").forEach(v=>{l.value[v.id]=v,o.value[v.id]=v.name}),o.value[-1]="\u65E0"}),jn(()=>{c.value=null}),mt(()=>t.id,()=>{zt(()=>{var v,g;c.value=p().bpmnElement,i.value=((g=(v=c.value.businessObject)==null?void 0:v.messageRef)==null?void 0:g.id)||"-1"})},{immediate:!0}),(v,g)=>{const b=co,S=lo,w=ho,_=Sn,C=wn,B=oi,s=so,h=Ra;return ne(),De("div",JT,[R(_,{label:"\u6D88\u606F\u5B9E\u4F8B"},{default:V(()=>[Ve("div",ZT,[R(S,{modelValue:D(i),"onUpdate:modelValue":g[0]||(g[0]=m=>un(i)?i.value=m:null),onChange:f},{default:V(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(o)),m=>(ne(),Ce(b,{value:m,label:D(o)[m],key:m},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),R(w,{type:"primary",preIcon:"ep:plus",style:{"margin-left":"8px"},onClick:d})])]),_:1}),R(h,{modelValue:D(a),"onUpdate:modelValue":g[3]||(g[3]=m=>un(a)?a.value=m:null),"close-on-click-modal":!1,title:"\u521B\u5EFA\u65B0\u6D88\u606F",width:"400px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(s,{size:"small",type:"primary",onClick:y},{default:V(()=>[me("\u786E \u8BA4")]),_:1})]),default:V(()=>[R(B,{model:D(r),size:"small","label-width":"90px"},{default:V(()=>[R(_,{label:"\u6D88\u606FID"},{default:V(()=>[R(C,{modelValue:D(r).id,"onUpdate:modelValue":g[1]||(g[1]=m=>D(r).id=m),clearable:""},null,8,["modelValue"])]),_:1}),R(_,{label:"\u6D88\u606F\u540D\u79F0"},{default:V(()=>[R(C,{modelValue:D(r).name,"onUpdate:modelValue":g[2]||(g[2]=m=>D(r).name=m),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),eA=Nt(QT,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue"]]),tA={class:"panel-tab__content"},nA=Rt({name:"ElementTaskConfig",__name:"ElementTask",props:{id:String,type:String},setup(e){const t=e,n=W({asyncAfter:!1,asyncBefore:!1,exclusive:!1}),i=W(),r=W({UserTask:"UserTask",ScriptTask:"ScriptTask",ReceiveTask:"ReceiveTask"}),o=W(),a=()=>window.bpmnInstances,c=()=>{n.value.asyncBefore||n.value.asyncAfter||(n.value.exclusive=!1),a().modeling.updateProperties(a().bpmnElement,{...n.value})};return mt(()=>t.id,()=>{var l,u,p,d,y,f;o.value=a().bpmnElement,n.value.asyncBefore=(u=(l=o.value)==null?void 0:l.businessObject)==null?void 0:u.asyncBefore,n.value.asyncAfter=(d=(p=o.value)==null?void 0:p.businessObject)==null?void 0:d.asyncAfter,n.value.exclusive=(f=(y=o.value)==null?void 0:y.businessObject)==null?void 0:f.exclusive},{immediate:!0}),mt(()=>t.type,()=>{t.type==r.value.UserTask&&(i.value=WT),t.type==r.value.ScriptTask&&(i.value=YT),t.type==r.value.ReceiveTask&&(i.value=eA)},{immediate:!0}),(l,u)=>{const p=N0,d=Sn,y=oi;return ne(),De("div",tA,[R(y,{size:"small","label-width":"90px"},{default:V(()=>[R(d,{label:"\u5F02\u6B65\u5EF6\u7EED"},{default:V(()=>[R(p,{modelValue:D(n).asyncBefore,"onUpdate:modelValue":u[0]||(u[0]=f=>D(n).asyncBefore=f),label:"\u5F02\u6B65\u524D",onChange:c},null,8,["modelValue"]),R(p,{modelValue:D(n).asyncAfter,"onUpdate:modelValue":u[1]||(u[1]=f=>D(n).asyncAfter=f),label:"\u5F02\u6B65\u540E",onChange:c},null,8,["modelValue"]),D(n).asyncAfter||D(n).asyncBefore?(ne(),Ce(p,{key:0,modelValue:D(n).exclusive,"onUpdate:modelValue":u[2]||(u[2]=f=>D(n).exclusive=f),label:"\u6392\u9664",onChange:c},null,8,["modelValue"])):ke("",!0)]),_:1}),(ne(),Ce(VA(D(i)),LA(jA(l.$props)),null,16))]),_:1})])}}}),iA=Nt(nA,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue"]]),rA={class:"panel-tab__content"},oA=Rt({name:"ElementMultiInstance",__name:"ElementMultiInstance",props:{businessObject:Object,type:String},setup(e){const t=e,n=po("prefix"),i=W(""),r=W({completionCondition:"",loopCardinality:"",extensionElements:[],asyncAfter:!1,asyncBefore:!1,exclusive:!1}),o=W({}),a=W(null),c=W(null),l=()=>window==null?void 0:window.bpmnInstances,u=g=>{if(g!=="Null"){if(g==="StandardLoop"){const b=l().moddle.create("bpmn:StandardLoopCharacteristics");return l().modeling.updateProperties(Be(a.value),{loopCharacteristics:b}),void(c.value=null)}c.value=g==="SequentialMultiInstance"?l().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{isSequential:!0}):l().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{collection:"${coll_userList}"}),l().modeling.updateProperties(Be(a.value),{loopCharacteristics:Be(c.value)})}else l().modeling.updateProperties(Be(a.value),{loopCharacteristics:null})},p=g=>{let b=null;g&&g.length&&(b=l().moddle.create("bpmn:FormalExpression",{body:g})),l().modeling.updateModdleProperties(Be(a.value),c.value,{loopCardinality:b})},d=g=>{let b=null;g&&g.length&&(b=l().moddle.create("bpmn:FormalExpression",{body:g})),l().modeling.updateModdleProperties(Be(a.value),c.value,{completionCondition:b})},y=g=>{const b=l().moddle.create("bpmn:ExtensionElements",{values:[l().moddle.create(`${n}:FailedJobRetryTimeCycle`,{body:g})]});l().modeling.updateModdleProperties(Be(a.value),c.value,{extensionElements:b})},f=()=>{l().modeling.updateModdleProperties(Be(a.value),c.value,{collection:o.value.collection||null,elementVariable:o.value.elementVariable||null})},v=g=>{const{asyncBefore:b,asyncAfter:S}=o.value;let w=Object.create(null);b||S?w[g]=o.value[g]:(o.value.exclusive=!1,w={asyncBefore:!1,asyncAfter:!1,exclusive:!1,extensionElements:null}),l().modeling.updateModdleProperties(Be(a.value),c.value,w)};return jn(()=>{c.value=null,a.value=null}),mt(()=>t.businessObject,g=>{var S,w,_,C;var b;a.value=l().bpmnElement,(b=g).loopCharacteristics?b.loopCharacteristics.$type==="bpmn:StandardLoopCharacteristics"?(i.value="StandardLoop",o.value={}):(b.loopCharacteristics.isSequential?i.value="SequentialMultiInstance":i.value="ParallelMultiInstance",o.value={...r.value,...b.loopCharacteristics,completionCondition:((w=(S=b.loopCharacteristics)==null?void 0:S.completionCondition)==null?void 0:w.body)??"",loopCardinality:((C=(_=b.loopCharacteristics)==null?void 0:_.loopCardinality)==null?void 0:C.body)??""},c.value=l().bpmnElement.businessObject.loopCharacteristics,b.loopCharacteristics.extensionElements&&b.loopCharacteristics.extensionElements.values&&b.loopCharacteristics.extensionElements.values.length&&(o.value.timeCycle=b.loopCharacteristics.extensionElements.values[0].body)):(i.value="Null",o.value={})},{immediate:!0}),(g,b)=>{const S=co,w=lo,_=Sn,C=wn,B=N0,s=oi;return ne(),De("div",rA,[R(s,{"label-width":"90px"},{default:V(()=>[R(_,{label:"\u56DE\u8DEF\u7279\u6027"},{default:V(()=>[R(w,{modelValue:D(i),"onUpdate:modelValue":b[0]||(b[0]=h=>un(i)?i.value=h:null),onChange:u},{default:V(()=>[R(S,{label:"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6",value:"ParallelMultiInstance"}),R(S,{label:"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",value:"SequentialMultiInstance"}),R(S,{label:"\u5FAA\u73AF\u4E8B\u4EF6",value:"StandardLoop"}),R(S,{label:"\u65E0",value:"Null"})]),_:1},8,["modelValue"])]),_:1}),D(i)==="ParallelMultiInstance"||D(i)==="SequentialMultiInstance"?(ne(),De(ln,{key:0},[R(_,{label:"\u5FAA\u73AF\u57FA\u6570",key:"loopCardinality"},{default:V(()=>[R(C,{modelValue:D(o).loopCardinality,"onUpdate:modelValue":b[1]||(b[1]=h=>D(o).loopCardinality=h),clearable:"",onChange:p},null,8,["modelValue"])]),_:1}),al(R(_,{label:"\u96C6\u5408",key:"collection"},{default:V(()=>[R(C,{modelValue:D(o).collection,"onUpdate:modelValue":b[2]||(b[2]=h=>D(o).collection=h),clearable:"",onChange:f},null,8,["modelValue"])]),_:1},512),[[Gh,!1]]),R(_,{label:"\u5143\u7D20\u53D8\u91CF",key:"elementVariable"},{default:V(()=>[R(C,{modelValue:D(o).elementVariable,"onUpdate:modelValue":b[3]||(b[3]=h=>D(o).elementVariable=h),clearable:"",onChange:f},null,8,["modelValue"])]),_:1}),R(_,{label:"\u5B8C\u6210\u6761\u4EF6",key:"completionCondition"},{default:V(()=>[R(C,{modelValue:D(o).completionCondition,"onUpdate:modelValue":b[4]||(b[4]=h=>D(o).completionCondition=h),clearable:"",onChange:d},null,8,["modelValue"])]),_:1}),R(_,{label:"\u5F02\u6B65\u72B6\u6001",key:"async"},{default:V(()=>[R(B,{modelValue:D(o).asyncBefore,"onUpdate:modelValue":b[5]||(b[5]=h=>D(o).asyncBefore=h),label:"\u5F02\u6B65\u524D",onChange:b[6]||(b[6]=h=>v("asyncBefore"))},null,8,["modelValue"]),R(B,{modelValue:D(o).asyncAfter,"onUpdate:modelValue":b[7]||(b[7]=h=>D(o).asyncAfter=h),label:"\u5F02\u6B65\u540E",onChange:b[8]||(b[8]=h=>v("asyncAfter"))},null,8,["modelValue"]),D(o).asyncAfter||D(o).asyncBefore?(ne(),Ce(B,{key:0,modelValue:D(o).exclusive,"onUpdate:modelValue":b[9]||(b[9]=h=>D(o).exclusive=h),label:"\u6392\u9664",onChange:b[10]||(b[10]=h=>v("exclusive"))},null,8,["modelValue"])):ke("",!0)]),_:1}),D(o).asyncAfter||D(o).asyncBefore?(ne(),Ce(_,{label:"\u91CD\u8BD5\u5468\u671F",prop:"timeCycle",key:"timeCycle"},{default:V(()=>[R(C,{modelValue:D(o).timeCycle,"onUpdate:modelValue":b[11]||(b[11]=h=>D(o).timeCycle=h),clearable:"",onChange:y},null,8,["modelValue"])]),_:1})):ke("",!0)],64)):ke("",!0)]),_:1})])}}}),aA=Nt(oA,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue"]]),sA={class:"panel-tab__content"},cA=Rt({name:"FlowCondition",__name:"FlowCondition",props:{businessObject:Object,type:String},setup(e){const t=e,n=W({}),i=W(),r=W(),o=W(),a=W(),c=()=>window==null?void 0:window.bpmnInstances,l=p=>p==="condition"?(a.value=c().moddle.create("bpmn:FormalExpression"),void c().modeling.updateProperties(Be(i.value),{conditionExpression:a.value})):p==="default"?(c().modeling.updateProperties(Be(i.value),{conditionExpression:null}),void c().modeling.updateProperties(Be(r.value),{default:i.value})):(o.value.default&&o.value.default.id===i.value.id&&c().modeling.updateProperties(Be(r.value),{default:null}),void c().modeling.updateProperties(Be(i.value),{conditionExpression:null})),u=()=>{let p,{conditionType:d,scriptType:y,body:f,resource:v,language:g}=n.value;d==="expression"?p=c().moddle.create("bpmn:FormalExpression",{body:f}):y==="inlineScript"?(p=c().moddle.create("bpmn:FormalExpression",{body:f,language:g}),n.value.resource=""):(n.value.body="",p=c().moddle.create("bpmn:FormalExpression",{resource:v,language:g})),c().modeling.updateProperties(Be(i.value),{conditionExpression:p})};return jn(()=>{i.value=null,r.value=null,o.value=null}),mt(()=>t.businessObject,p=>{console.log(p,"val"),zt(()=>{(()=>{if(i.value=c().bpmnElement,r.value=i.value.source,o.value=i.value.businessObject.sourceRef,o.value&&o.value.default&&o.value.default.id===i.value.id&&n.value.type=="default")n.value={type:"default"};else if(i.value.businessObject.conditionExpression){const d=i.value.businessObject.conditionExpression;if(n.value={...d,type:"condition"},n.value.resource)return n.value.conditionType="script",void(n.value.scriptType="externalScript");if(d.language)return n.value.conditionType="script",void(n.value.scriptType="inlineScript");n.value.conditionType="expression"}else n.value={type:"normal"}})()})},{immediate:!0}),(p,d)=>{const y=co,f=lo,v=Sn,g=wn,b=oi;return ne(),De("div",sA,[R(b,{model:D(n),"label-width":"90px",size:"small"},{default:V(()=>[R(v,{label:"\u6D41\u8F6C\u7C7B\u578B"},{default:V(()=>[R(f,{modelValue:D(n).type,"onUpdate:modelValue":d[0]||(d[0]=S=>D(n).type=S),onChange:l},{default:V(()=>[R(y,{label:"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",value:"normal"}),R(y,{label:"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84",value:"default"}),R(y,{label:"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84",value:"condition"})]),_:1},8,["modelValue"])]),_:1}),D(n).type==="condition"?(ne(),Ce(v,{label:"\u6761\u4EF6\u683C\u5F0F",key:"condition"},{default:V(()=>[R(f,{modelValue:D(n).conditionType,"onUpdate:modelValue":d[1]||(d[1]=S=>D(n).conditionType=S)},{default:V(()=>[R(y,{label:"\u8868\u8FBE\u5F0F",value:"expression"}),R(y,{label:"\u811A\u672C",value:"script"})]),_:1},8,["modelValue"])]),_:1})):ke("",!0),D(n).conditionType&&D(n).conditionType==="expression"?(ne(),Ce(v,{label:"\u8868\u8FBE\u5F0F",key:"express"},{default:V(()=>[R(g,{modelValue:D(n).body,"onUpdate:modelValue":d[2]||(d[2]=S=>D(n).body=S),style:{width:"192px"},clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):ke("",!0),D(n).conditionType&&D(n).conditionType==="script"?(ne(),De(ln,{key:2},[R(v,{label:"\u811A\u672C\u8BED\u8A00",key:"language"},{default:V(()=>[R(g,{modelValue:D(n).language,"onUpdate:modelValue":d[3]||(d[3]=S=>D(n).language=S),clearable:"",onChange:u},null,8,["modelValue"])]),_:1}),R(v,{label:"\u811A\u672C\u7C7B\u578B",key:"scriptType"},{default:V(()=>[R(f,{modelValue:D(n).scriptType,"onUpdate:modelValue":d[4]||(d[4]=S=>D(n).scriptType=S)},{default:V(()=>[R(y,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(y,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(n).scriptType==="inlineScript"?(ne(),Ce(v,{label:"\u811A\u672C",key:"body"},{default:V(()=>[R(g,{modelValue:D(n).body,"onUpdate:modelValue":d[5]||(d[5]=S=>D(n).body=S),type:"textarea",clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):ke("",!0),D(n).scriptType==="externalScript"?(ne(),Ce(v,{label:"\u8D44\u6E90\u5730\u5740",key:"resource"},{default:V(()=>[R(g,{modelValue:D(n).resource,"onUpdate:modelValue":d[6]||(d[6]=S=>D(n).resource=S),clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):ke("",!0)],64)):ke("",!0)]),_:1},8,["model"])])}}}),lA=Nt(cA,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue"]]),uA={class:"panel-tab__content"},pA={class:"panel-tab__content--title"},hA={class:"panel-tab__content--title",style:{"padding-top":"8px","margin-top":"8px","border-top":"1px solid #eee"}},dA=Rt({name:"SignalAndMassage",__name:"SignalAndMessage",setup(e){const t=I0(),n=W([]),i=W([]),r=W(!1),o=W(""),a=W({}),c=W(),l=W(),u=W(),p=$h(()=>o.value==="message"?{title:"\u521B\u5EFA\u6D88\u606F",idLabel:"\u6D88\u606FID",nameLabel:"\u6D88\u606F\u540D\u79F0"}:{title:"\u521B\u5EFA\u4FE1\u53F7",idLabel:"\u4FE1\u53F7ID",nameLabel:"\u4FE1\u53F7\u540D\u79F0"}),d=()=>window==null?void 0:window.bpmnInstances,y=()=>{console.log(window,"window"),c.value=d().modeler.getDefinitions().rootElements,l.value={},u.value={},i.value=[],n.value=[],c.value.forEach(g=>{g.$type==="bpmn:Message"&&(l.value[g.id]=!0,i.value.push({...g})),g.$type==="bpmn:Signal"&&(u.value[g.id]=!0,n.value.push({...g}))})},f=g=>{o.value=g,a.value={},r.value=!0},v=()=>{if(o.value==="message"){l.value[a.value.id]&&t.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=d().moddle.create("bpmn:Message",a.value);c.value.push(g)}else{u.value[a.value.id]&&t.error("\u8BE5\u4FE1\u53F7\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=d().moddle.create("bpmn:Signal",a.value);c.value.push(g)}r.value=!1,y()};return Ma(()=>{y()}),(g,b)=>{const S=ll,w=ho,_=sl,C=cl,B=wn,s=Sn,h=oi,m=so,E=Ra;return ne(),De("div",uA,[Ve("div",pA,[Ve("span",null,[R(S,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),me("\u6D88\u606F\u5217\u8868")]),R(w,{type:"primary",title:"\u521B\u5EFA\u65B0\u6D88\u606F",preIcon:"ep:plus",onClick:b[0]||(b[0]=T=>f("message"))})]),R(C,{data:D(i),border:""},{default:V(()=>[R(_,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),R(_,{label:"\u6D88\u606FID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),R(_,{label:"\u6D88\u606F\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),Ve("div",hA,[Ve("span",null,[R(S,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),me("\u4FE1\u53F7\u5217\u8868")]),R(w,{type:"primary",title:"\u521B\u5EFA\u65B0\u4FE1\u53F7",preIcon:"ep:plus",onClick:b[1]||(b[1]=T=>f("signal"))})]),R(C,{data:D(n),border:""},{default:V(()=>[R(_,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),R(_,{label:"\u4FE1\u53F7ID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),R(_,{label:"\u4FE1\u53F7\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),R(E,{modelValue:D(r),"onUpdate:modelValue":b[5]||(b[5]=T=>un(r)?r.value=T:null),title:D(p).title,"close-on-click-modal":!1,width:"400px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(m,{onClick:b[4]||(b[4]=T=>r.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(m,{type:"primary",onClick:v},{default:V(()=>[me("\u4FDD \u5B58")]),_:1})]),default:V(()=>[R(h,{model:D(a),"label-width":"90px"},{default:V(()=>[R(s,{label:D(p).idLabel},{default:V(()=>[R(B,{modelValue:D(a).id,"onUpdate:modelValue":b[2]||(b[2]=T=>D(a).id=T),clearable:""},null,8,["modelValue"])]),_:1},8,["label"]),R(s,{label:D(p).nameLabel},{default:V(()=>[R(B,{modelValue:D(a).name,"onUpdate:modelValue":b[3]||(b[3]=T=>D(a).name=T),clearable:""},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}}),mA=Nt(dA,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue"]]),pr=()=>window==null?void 0:window.bpmnInstances;function zb(e,t,n){const i=Object.create(null);switch(i.event=e.event,t&&(i.id=e.id),e.listenerType){case"scriptListener":i.script=function(r,o){const{scriptType:a,scriptFormat:c,value:l,resource:u}=r,p=a==="inlineScript"?{scriptFormat:c,value:l}:{scriptFormat:c,resource:u};return pr().moddle.create(`${o}:Script`,p)}(e,n);break;case"expressionListener":i.expression=e.expression;break;case"delegateExpressionListener":i.delegateExpression=e.delegateExpression;break;default:i.class=e.class}if(e.fields&&(i.fields=e.fields.map(r=>function(o,a){const{name:c,fieldType:l,string:u,expression:p}=o,d=l==="string"?{name:c,string:u}:{name:c,expression:p};return pr().moddle.create(`${a}:Field`,d)}(r,n))),t&&e.event==="timeout"&&e.eventDefinitionType){const r=pr().moddle.create("bpmn:FormalExpression",{body:e.eventTimeDefinitions}),o=pr().moddle.create("bpmn:TimerEventDefinition",{id:`TimerEventDefinition_${fA(8)}`,[`time${e.eventDefinitionType.replace(/^\S/,a=>a.toUpperCase())}`]:r});i.eventDefinitions=[o]}return pr().moddle.create(`${n}:${t?"TaskListener":"ExecutionListener"}`,i)}function Kc(e,t){const n=pr().moddle.create("bpmn:ExtensionElements",{values:t});pr().modeling.updateProperties(Be(e),{extensionElements:n})}function fA(e=8,t){let n="";const i=t||"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=e;r>0;--r)n+=i[Math.floor(Math.random()*i.length)];return n}function $b(e){let t={...e};if(e.script&&(t={...e,...e.script,scriptType:e.script.resource?"externalScript":"inlineScript"}),e.event==="timeout"&&e.eventDefinitions&&e.eventDefinitions.length){let n="";for(const i in e.eventDefinitions[0])console.log(e.eventDefinitions,i),i.indexOf("time")!==-1&&(n=i,t.eventDefinitionType=i.replace("time","").toLowerCase());console.log(n),t.eventTimeDefinitions=e.eventDefinitions[0][n].body}return t}function Gb(e){let t;return e.class&&(t="classListener"),e.expression&&(t="expressionListener"),e.delegateExpression&&(t="delegateExpressionListener"),e.script&&(t="scriptListener"),{...JSON.parse(JSON.stringify(e)),...e.script??{},listenerType:t}}let kh,Ub,Ph,Hb,qb,Wb,Xb,Kb,Yb,Jb,Zb,Qb,e0,t0,n0,i0,r0,o0,a0,s0;kh={classListener:"Java \u7C7B",expressionListener:"\u8868\u8FBE\u5F0F",delegateExpressionListener:"\u4EE3\u7406\u8868\u8FBE\u5F0F",scriptListener:"\u811A\u672C"},Ub={create:"\u521B\u5EFA",assignment:"\u6307\u6D3E",complete:"\u5B8C\u6210",delete:"\u5220\u9664",update:"\u66F4\u65B0",timeout:"\u8D85\u65F6"},Ph={string:"\u5B57\u7B26\u4E32",expression:"\u8868\u8FBE\u5F0F"},Hb={class:"panel-tab__content"},qb={class:"element-drawer__button"},Wb={class:"listener-filed__title"},Xb={class:"element-drawer__button"},Kb=Rt({name:"ElementListeners",__name:"ElementListeners",props:{id:String,type:String},setup(e){const t=e,n=po("prefix"),i=po("width"),r=W([]),o=W({}),a=W(!1),c=W([]),l=W({}),u=W(!1),p=W(-1),d=W(-1),y=W(kh),f=W(Ph),v=W(),g=W(),b=W(),S=W(),w=W(),_=()=>{var m,E,T;v.value=(window==null?void 0:window.bpmnInstances).bpmnElement,g.value=[],b.value=((T=(E=(m=v.value.businessObject)==null?void 0:m.extensionElements)==null?void 0:E.values)==null?void 0:T.filter(M=>M.$type===`${n}:ExecutionListener`))??[],r.value=b.value.map(M=>Gb(M))},C=(m,E)=>{m?(o.value=$b(m),p.value=E):(o.value={},p.value=-1),m&&m.fields?c.value=m.fields.map(T=>({...T,fieldType:T.string?"string":"expression"})):(c.value=[],o.value.fields=[]),a.value=!0,zt(()=>{S.value&&S.value.clearValidate()})},B=(m,E)=>{l.value=m?JSON.parse(JSON.stringify(m)):{},d.value=m?E:-1,u.value=!0,zt(()=>{w.value&&w.value.clearValidate()})},s=async()=>{await w.value.validate()&&(d.value===-1?(c.value.push(l.value),o.value.fields.push(l.value)):(c.value.splice(d.value,1,l.value),o.value.fields.splice(d.value,1,l.value)),u.value=!1,zt(()=>{l.value={}}))},h=async()=>{var E,T,M;if(!await S.value.validate())return;const m=zb(o.value,!1,n);p.value===-1?(b.value.push(m),r.value.push(o.value)):(b.value.splice(p.value,1,m),r.value.splice(p.value,1,o.value)),g.value=((M=(T=(E=v.value.businessObject)==null?void 0:E.extensionElements)==null?void 0:T.values)==null?void 0:M.filter(N=>N.$type!==`${n}:ExecutionListener`))??[],Kc(v.value,g.value.concat(b.value)),a.value=!1,o.value={}};return mt(()=>t.id,m=>{m&&m.length&&zt(()=>{_()})},{immediate:!0}),(m,E)=>{const T=sl,M=so,N=Uh,$=cl,P=ho,x=co,I=lo,j=Sn,G=wn,X=oi,ee=ll,re=D0,se=Ra;return ne(),De("div",Hb,[R($,{data:D(r),size:"small",border:""},{default:V(()=>[R(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(T,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"100px",prop:"event"}),R(T,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"100px","show-overflow-tooltip":"",formatter:H=>D(y)[H.listenerType]},null,8,["formatter"]),R(T,{label:"\u64CD\u4F5C",width:"100px"},{default:V(H=>[R(M,{size:"small",link:"",onClick:q=>C(H.row,H.$index)},{default:V(()=>[me("\u7F16\u8F91")]),_:2},1032,["onClick"]),R(N,{direction:"vertical"}),R(M,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:q=>(xe=>{ao.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{b.value.splice(xe,1),r.value.splice(xe,1),Kc(v.value,g.value.concat(b.value))}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(H.$index)},{default:V(()=>[me("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ve("div",qb,[R(P,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:E[0]||(E[0]=H=>C(null))})]),R(re,{modelValue:D(a),"onUpdate:modelValue":E[12]||(E[12]=H=>un(a)?a.value=H:null),title:"\u6267\u884C\u76D1\u542C\u5668",size:`${D(i)}px`,"append-to-body":"","destroy-on-close":""},{default:V(()=>[R(X,{model:D(o),"label-width":"96px",ref_key:"listenerFormRef",ref:S},{default:V(()=>[R(j,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(I,{modelValue:D(o).event,"onUpdate:modelValue":E[1]||(E[1]=H=>D(o).event=H)},{default:V(()=>[R(x,{label:"start",value:"start"}),R(x,{label:"end",value:"end"})]),_:1},8,["modelValue"])]),_:1}),R(j,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(I,{modelValue:D(o).listenerType,"onUpdate:modelValue":E[2]||(E[2]=H=>D(o).listenerType=H)},{default:V(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(y)),H=>(ne(),Ce(x,{key:H,label:D(y)[H],value:H},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(o).listenerType==="classListener"?(ne(),Ce(j,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).class,"onUpdate:modelValue":E[3]||(E[3]=H=>D(o).class=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(o).listenerType==="expressionListener"?(ne(),Ce(j,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).expression,"onUpdate:modelValue":E[4]||(E[4]=H=>D(o).expression=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(o).listenerType==="delegateExpressionListener"?(ne(),Ce(j,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).delegateExpression,"onUpdate:modelValue":E[5]||(E[5]=H=>D(o).delegateExpression=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(o).listenerType==="scriptListener"?(ne(),De(ln,{key:3},[R(j,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:V(()=>[R(G,{modelValue:D(o).scriptFormat,"onUpdate:modelValue":E[6]||(E[6]=H=>D(o).scriptFormat=H),clearable:""},null,8,["modelValue"])]),_:1}),R(j,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:V(()=>[R(I,{modelValue:D(o).scriptType,"onUpdate:modelValue":E[7]||(E[7]=H=>D(o).scriptType=H)},{default:V(()=>[R(x,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(x,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(o).scriptType==="inlineScript"?(ne(),Ce(j,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:V(()=>[R(G,{modelValue:D(o).value,"onUpdate:modelValue":E[8]||(E[8]=H=>D(o).value=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(o).scriptType==="externalScript"?(ne(),Ce(j,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:V(()=>[R(G,{modelValue:D(o).resource,"onUpdate:modelValue":E[9]||(E[9]=H=>D(o).resource=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0)],64)):ke("",!0)]),_:1},8,["model"]),R(N),Ve("p",Wb,[Ve("span",null,[R(ee,{icon:"ep:menu"}),me("\u6CE8\u5165\u5B57\u6BB5\uFF1A")]),R(P,{type:"primary",onClick:E[10]||(E[10]=H=>B(null)),title:"\u6DFB\u52A0\u5B57\u6BB5"})]),R($,{data:D(c),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:V(()=>[R(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(T,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),R(T,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:H=>D(f)[H.fieldType]},null,8,["formatter"]),R(T,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:H=>H.string||H.expression},null,8,["formatter"]),R(T,{label:"\u64CD\u4F5C",width:"130px"},{default:V(H=>[R(M,{size:"small",link:"",onClick:q=>B(H.row,H.$index)},{default:V(()=>[me("\u7F16\u8F91")]),_:2},1032,["onClick"]),R(N,{direction:"vertical"}),R(M,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:q=>(xe=>{ao.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{c.value.splice(xe,1),o.value.fields.splice(xe,1)}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(H.$index)},{default:V(()=>[me("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ve("div",Xb,[R(M,{onClick:E[11]||(E[11]=H=>a.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(M,{type:"primary",onClick:h},{default:V(()=>[me("\u4FDD \u5B58")]),_:1})])]),_:1},8,["modelValue","size"]),R(se,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:D(u),"onUpdate:modelValue":E[18]||(E[18]=H=>un(u)?u.value=H:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(M,{size:"small",onClick:E[17]||(E[17]=H=>u.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(M,{size:"small",type:"primary",onClick:s},{default:V(()=>[me("\u786E \u5B9A")]),_:1})]),default:V(()=>[R(X,{model:D(l),"label-width":"96spx",ref_key:"listenerFieldFormRef",ref:w,style:{height:"136px"}},{default:V(()=>[R(j,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).name,"onUpdate:modelValue":E[13]||(E[13]=H=>D(l).name=H),clearable:""},null,8,["modelValue"])]),_:1}),R(j,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(I,{modelValue:D(l).fieldType,"onUpdate:modelValue":E[14]||(E[14]=H=>D(l).fieldType=H)},{default:V(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(f)),H=>(ne(),Ce(x,{key:H,label:D(f)[H],value:H},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(l).fieldType==="string"?(ne(),Ce(j,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).string,"onUpdate:modelValue":E[15]||(E[15]=H=>D(l).string=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(l).fieldType==="expression"?(ne(),Ce(j,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).expression,"onUpdate:modelValue":E[16]||(E[16]=H=>D(l).expression=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),Yb=Nt(Kb,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue"]]),Jb={class:"panel-tab__content"},Zb={class:"element-drawer__button"},Qb=Rt({name:"ElementProperties",__name:"ElementProperties",props:{id:String,type:String},setup(e){const t=e,n=po("prefix"),i=W([]),r=W({}),o=W(-1),a=W(!1),c=W(),l=W(),u=W(),p=W(),d=W(),y=()=>window==null?void 0:window.bpmnInstances,f=()=>{var S,w;console.log(window,"windowwindowwindowwindowwindowwindowwindow"),c.value=y().bpmnElement,l.value=[],u.value=((w=(S=c.value.businessObject)==null?void 0:S.extensionElements)==null?void 0:w.values.filter(_=>(_.$type!==`${n}:Properties`&&l.value.push(_),_.$type===`${n}:Properties`)))??[],p.value=u.value.reduce((_,C)=>_.concat(C.values),[]),i.value=JSON.parse(JSON.stringify(p.value??[]))},v=(S,w)=>{o.value=w,r.value=w===-1?{}:JSON.parse(JSON.stringify(S)),a.value=!0,zt(()=>{d.value&&d.value.clearValidate()})},g=()=>{console.log(r.value,"propertyForm.value");const{name:S,value:w}=r.value;if(o.value!==-1)y().modeling.updateModdleProperties(Be(c.value),Be(p.value)[Be(o.value)],{name:S,value:w});else{const _=y().moddle.create(`${n}:Property`,{name:S,value:w}),C=y().moddle.create(`${n}:Properties`,{values:p.value.concat([_])});b(C)}a.value=!1,f()},b=S=>{const w=y().moddle.create("bpmn:ExtensionElements",{values:l.value.concat([S])});y().modeling.updateProperties(Be(c.value),{extensionElements:w})};return mt(()=>t.id,S=>{S&&S&&S.length&&f()},{immediate:!0}),(S,w)=>{const _=sl,C=so,B=Uh,s=cl,h=ho,m=wn,E=Sn,T=oi,M=Ra;return ne(),De("div",Jb,[R(s,{data:D(i),"max-height":"240",fit:"",border:""},{default:V(()=>[R(_,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(_,{label:"\u5C5E\u6027\u540D",prop:"name","min-width":"100px","show-overflow-tooltip":""}),R(_,{label:"\u5C5E\u6027\u503C",prop:"value","min-width":"100px","show-overflow-tooltip":""}),R(_,{label:"\u64CD\u4F5C",width:"110px"},{default:V(N=>[R(C,{link:"",onClick:$=>v(N.row,N.$index),size:"small"},{default:V(()=>[me(" \u7F16\u8F91 ")]),_:2},1032,["onClick"]),R(B,{direction:"vertical"}),R(C,{link:"",size:"small",style:{color:"#ff4d4f"},onClick:$=>((P,x)=>{console.log(P,"attr"),ao.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5C5E\u6027\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{i.value.splice(x,1),p.value.splice(x,1);const I=y().moddle.create(`${n}:Properties`,{values:p.value});b(I),f()}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(N.row,N.$index)},{default:V(()=>[me(" \u79FB\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ve("div",Zb,[R(h,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u5C5E\u6027",onClick:w[0]||(w[0]=N=>v(null,-1))})]),R(M,{modelValue:D(a),"onUpdate:modelValue":w[4]||(w[4]=N=>un(a)?a.value=N:null),title:"\u5C5E\u6027\u914D\u7F6E",width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(C,{onClick:w[3]||(w[3]=N=>a.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(C,{type:"primary",onClick:g},{default:V(()=>[me("\u786E \u5B9A")]),_:1})]),default:V(()=>[R(T,{model:D(r),"label-width":"80px",ref_key:"attributeFormRef",ref:d},{default:V(()=>[R(E,{label:"\u5C5E\u6027\u540D\uFF1A",prop:"name"},{default:V(()=>[R(m,{modelValue:D(r).name,"onUpdate:modelValue":w[1]||(w[1]=N=>D(r).name=N),clearable:""},null,8,["modelValue"])]),_:1}),R(E,{label:"\u5C5E\u6027\u503C\uFF1A",prop:"value"},{default:V(()=>[R(m,{modelValue:D(r).value,"onUpdate:modelValue":w[2]||(w[2]=N=>D(r).value=N),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),e0=Nt(Qb,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue"]]),t0={class:"panel-tab__content"},n0={class:"element-drawer__button"},i0={class:"listener-filed__title"},r0={class:"element-drawer__button"},o0=Rt({name:"UserTaskListeners",__name:"UserTaskListeners",props:{id:String,type:String},setup(e){const t=e,n=po("prefix"),i=po("width"),r=W([]),o=W(Ub),a=W(kh),c=W(!1),l=W({}),u=W(Ph),p=W([]),d=W(!1),y=W(-1),f=W(-1),v=W({}),g=W(),b=W(),S=W(),w=W(),_=W(),C=()=>window==null?void 0:window.bpmnInstances,B=(E,T)=>{E?(l.value=$b(E),y.value=T):(l.value={},y.value=-1),E&&E.fields?p.value=E.fields.map(M=>({...M,fieldType:M.string?"string":"expression"})):(p.value=[],l.value.fields=[]),c.value=!0,zt(()=>{w.value&&w.value.clearValidate()})},s=async()=>{var T,M,N;if(!await w.value.validate())return;const E=zb(l.value,!0,n);y.value===-1?(b.value.push(E),r.value.push(l.value)):(b.value.splice(y.value,1,E),r.value.splice(y.value,1,l.value)),S.value=((N=(M=(T=g.value.businessObject)==null?void 0:T.extensionElements)==null?void 0:M.values)==null?void 0:N.filter($=>$.$type!==`${n}:TaskListener`))??[],Kc(g.value,S.value.concat(b.value)),c.value=!1,l.value={}},h=(E,T)=>{v.value=E?JSON.parse(JSON.stringify(E)):{},f.value=E?T:-1,d.value=!0,zt(()=>{_.value&&_.value.clearValidate()})},m=async()=>{await _.value.validate()&&(f.value===-1?(p.value.push(v.value),l.value.fields.push(v.value)):(p.value.splice(f.value,1,v.value),l.value.fields.splice(f.value,1,v.value)),d.value=!1,zt(()=>{v.value={}}))};return mt(()=>t.id,E=>{E&&E.length&&zt(()=>{var T,M;console.log(C().bpmnElement,"window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement"),g.value=C().bpmnElement,S.value=[],b.value=((M=(T=g.value.businessObject)==null?void 0:T.extensionElements)==null?void 0:M.values.filter(N=>N.$type===`${n}:TaskListener`))??[],r.value=b.value.map(N=>Gb(N))})},{immediate:!0}),(E,T)=>{const M=sl,N=so,$=Uh,P=cl,x=ho,I=co,j=lo,G=Sn,X=wn,ee=oi,re=ll,se=D0,H=Ra;return ne(),De("div",t0,[R(P,{data:D(r),size:"small",border:""},{default:V(()=>[R(M,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(M,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(o)[q.event]},null,8,["formatter"]),R(M,{label:"\u4E8B\u4EF6id","min-width":"80px",prop:"id","show-overflow-tooltip":""}),R(M,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(a)[q.listenerType]},null,8,["formatter"]),R(M,{label:"\u64CD\u4F5C",width:"90px"},{default:V(q=>[R(N,{size:"small",link:"",onClick:xe=>B(q.row,q.$index)},{default:V(()=>[me("\u7F16\u8F91")]),_:2},1032,["onClick"]),R($,{direction:"vertical"}),R(N,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:xe=>((ze,ct)=>{console.log(ze,"listener"),ao.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{b.value.splice(ct,1),r.value.splice(ct,1),Kc(g.value,S.value.concat(b.value))}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(q.row,q.$index)},{default:V(()=>[me("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ve("div",n0,[R(x,{size:"small",type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:T[0]||(T[0]=q=>B(null))})]),R(se,{modelValue:D(c),"onUpdate:modelValue":T[15]||(T[15]=q=>un(c)?c.value=q:null),title:"\u4EFB\u52A1\u76D1\u542C\u5668",size:`${D(i)}px`,"append-to-body":"","destroy-on-close":""},{default:V(()=>[R(ee,{size:"small",model:D(l),"label-width":"96px",ref_key:"listenerFormRef",ref:w},{default:V(()=>[R(G,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(l).event,"onUpdate:modelValue":T[1]||(T[1]=q=>D(l).event=q)},{default:V(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(o)),q=>(ne(),Ce(I,{key:q,label:D(o)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),R(G,{label:"\u76D1\u542C\u5668ID",prop:"id",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).id,"onUpdate:modelValue":T[2]||(T[2]=q=>D(l).id=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(l).listenerType,"onUpdate:modelValue":T[3]||(T[3]=q=>D(l).listenerType=q)},{default:V(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(a)),q=>(ne(),Ce(I,{key:q,label:D(a)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(l).listenerType==="classListener"?(ne(),Ce(G,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).class,"onUpdate:modelValue":T[4]||(T[4]=q=>D(l).class=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(l).listenerType==="expressionListener"?(ne(),Ce(G,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).expression,"onUpdate:modelValue":T[5]||(T[5]=q=>D(l).expression=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(l).listenerType==="delegateExpressionListener"?(ne(),Ce(G,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).delegateExpression,"onUpdate:modelValue":T[6]||(T[6]=q=>D(l).delegateExpression=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(l).listenerType==="scriptListener"?(ne(),De(ln,{key:3},[R(G,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:V(()=>[R(X,{modelValue:D(l).scriptFormat,"onUpdate:modelValue":T[7]||(T[7]=q=>D(l).scriptFormat=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:V(()=>[R(j,{modelValue:D(l).scriptType,"onUpdate:modelValue":T[8]||(T[8]=q=>D(l).scriptType=q)},{default:V(()=>[R(I,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(I,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(l).scriptType==="inlineScript"?(ne(),Ce(G,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:V(()=>[R(X,{modelValue:D(l).value,"onUpdate:modelValue":T[9]||(T[9]=q=>D(l).value=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(l).scriptType==="externalScript"?(ne(),Ce(G,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:V(()=>[R(X,{modelValue:D(l).resource,"onUpdate:modelValue":T[10]||(T[10]=q=>D(l).resource=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0)],64)):ke("",!0),D(l).event==="timeout"?(ne(),De(ln,{key:4},[R(G,{label:"\u5B9A\u65F6\u5668\u7C7B\u578B",prop:"eventDefinitionType",key:"eventDefinitionType"},{default:V(()=>[R(j,{modelValue:D(l).eventDefinitionType,"onUpdate:modelValue":T[11]||(T[11]=q=>D(l).eventDefinitionType=q)},{default:V(()=>[R(I,{label:"\u65E5\u671F",value:"date"}),R(I,{label:"\u6301\u7EED\u65F6\u957F",value:"duration"}),R(I,{label:"\u5FAA\u73AF",value:"cycle"}),R(I,{label:"\u65E0",value:"null"})]),_:1},8,["modelValue"])]),_:1}),D(l).eventDefinitionType&&D(l).eventDefinitionType!=="null"?(ne(),Ce(G,{label:"\u5B9A\u65F6\u5668",prop:"eventTimeDefinitions",key:"eventTimeDefinitions",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u5B9A\u65F6\u5668\u914D\u7F6E"}},{default:V(()=>[R(X,{modelValue:D(l).eventTimeDefinitions,"onUpdate:modelValue":T[12]||(T[12]=q=>D(l).eventTimeDefinitions=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0)],64)):ke("",!0)]),_:1},8,["model"]),R($),Ve("p",i0,[Ve("span",null,[R(re,{icon:"ep:menu"}),me("\u6CE8\u5165\u5B57\u6BB5\uFF1A")]),R(N,{size:"small",type:"primary",onClick:T[13]||(T[13]=q=>h(null))},{default:V(()=>[me("\u6DFB\u52A0\u5B57\u6BB5")]),_:1})]),R(P,{data:D(p),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:V(()=>[R(M,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(M,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),R(M,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(u)[q.fieldType]},null,8,["formatter"]),R(M,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:q=>q.string||q.expression},null,8,["formatter"]),R(M,{label:"\u64CD\u4F5C",width:"100px"},{default:V(q=>[R(N,{size:"small",link:"",onClick:xe=>h(q.row,q.$index)},{default:V(()=>[me("\u7F16\u8F91")]),_:2},1032,["onClick"]),R($,{direction:"vertical"}),R(N,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:xe=>((ze,ct)=>{console.log(ze,"field"),ao.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{p.value.splice(ct,1),l.value.fields.splice(ct,1)}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(q.row,q.$index)},{default:V(()=>[me("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ve("div",r0,[R(N,{size:"small",onClick:T[14]||(T[14]=q=>c.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(N,{size:"small",type:"primary",onClick:s},{default:V(()=>[me("\u4FDD \u5B58")]),_:1})])]),_:1},8,["modelValue","size"]),R(H,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:D(d),"onUpdate:modelValue":T[21]||(T[21]=q=>un(d)?d.value=q:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(N,{size:"small",onClick:T[20]||(T[20]=q=>d.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(N,{size:"small",type:"primary",onClick:m},{default:V(()=>[me("\u786E \u5B9A")]),_:1})]),default:V(()=>[R(ee,{model:D(v),size:"small","label-width":"96px",ref_key:"listenerFieldFormRef",ref:_,style:{height:"136px"}},{default:V(()=>[R(G,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(v).name,"onUpdate:modelValue":T[16]||(T[16]=q=>D(v).name=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(v).fieldType,"onUpdate:modelValue":T[17]||(T[17]=q=>D(v).fieldType=q)},{default:V(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(u)),q=>(ne(),Ce(I,{key:q,label:D(u)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(v).fieldType==="string"?(ne(),Ce(G,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(v).string,"onUpdate:modelValue":T[18]||(T[18]=q=>D(v).string=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(v).fieldType==="expression"?(ne(),Ce(G,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(v).expression,"onUpdate:modelValue":T[19]||(T[19]=q=>D(v).expression=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),a0=Nt(o0,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue"]]),s0=Rt({name:"MyPropertiesPanel",__name:"PropertiesPanel",props:{bpmnModeler:{type:Object,default:()=>{}},prefix:{type:String,default:"camunda"},width:{type:Number,default:480},idEditDisabled:{type:Boolean,default:!1},model:Object},setup(e){const t=e,n=W("base"),i=W(""),r=W(""),o=W({}),a=W(!1),c=W(!1),l=W();ol("prefix",t.prefix),ol("width",t.width);const u=()=>window==null?void 0:window.bpmnInstances,p=mt(()=>t.bpmnModeler,()=>{if(!t.bpmnModeler)return void console.log("\u7F3A\u5C11props.bpmnModeler");console.log("props.bpmnModeler \u6709\u503C\u4E86\uFF01\uFF01\uFF01"),window.bpmnInstances={modeler:t.bpmnModeler,modeling:t.bpmnModeler.get("modeling"),moddle:t.bpmnModeler.get("moddle"),eventBus:t.bpmnModeler.get("eventBus"),bpmnFactory:t.bpmnModeler.get("bpmnFactory"),elementFactory:t.bpmnModeler.get("elementFactory"),elementRegistry:t.bpmnModeler.get("elementRegistry"),replace:t.bpmnModeler.get("replace"),selection:t.bpmnModeler.get("selection")},console.log(u(),"window.bpmnInstances"),d(),p()},{immediate:!0}),d=()=>{y(null),t.bpmnModeler.on("import.done",f=>{console.log(f,"eeeee"),y(null)}),t.bpmnModeler.on("selection.changed",({newSelection:f})=>{y(f[0]||null)}),t.bpmnModeler.on("element.changed",({element:f})=>{f&&f.id===i.value&&y(f)})},y=f=>{let v=f;v||(v=u().elementRegistry.find(g=>g.type==="bpmn:Process")??u().elementRegistry.find(g=>g.type==="bpmn:Collaboration")),v&&(console.log(`
  42. ----------
  43. select element changed:
  44. id: ${v.id}
  45. type: ${v.businessObject.$type}
  46. ----------
  47. `),console.log("businessObject: ",v.businessObject),u().bpmnElement=v,l.value=v,i.value=v.id,r.value=v.type.split(":")[1]||"",o.value=JSON.parse(JSON.stringify(v.businessObject)),a.value=!(r.value!=="SequenceFlow"||!v.source||v.source.type.indexOf("StartEvent")!==-1),c.value=r.value==="UserTask"||r.value==="StartEvent")};return jn(()=>{window.bpmnInstances=null,console.log(t,"props1"),console.log(t.bpmnModeler,"props.bpmnModeler1")}),mt(()=>i.value,()=>{n.value="base"}),(f,v)=>{const g=ll,b=qA,S=Hh,w=R0("router-link"),_=WA;return ne(),De("div",{class:"process-panel__container",style:FA({width:`${e.width}px`})},[R(_,{modelValue:D(n),"onUpdate:modelValue":v[0]||(v[0]=C=>un(n)?n.value=C:null)},{default:V(()=>[R(b,{name:"base"},{title:V(()=>[R(g,{icon:"ep:info-filled"}),me(" \u5E38\u89C4")]),default:V(()=>[R(jT,{"id-edit-disabled":e.idEditDisabled,"business-object":D(o),type:D(r),model:e.model},null,8,["id-edit-disabled","business-object","type","model"])]),_:1}),D(r)==="Process"?(ne(),Ce(b,{name:"condition",key:"message"},{title:V(()=>[R(g,{icon:"ep:comment"}),me("\u6D88\u606F\u4E0E\u4FE1\u53F7")]),default:V(()=>[R(mA)]),_:1})):ke("",!0),D(a)?(ne(),Ce(b,{name:"condition",key:"condition"},{title:V(()=>[R(g,{icon:"ep:promotion"}),me("\u6D41\u8F6C\u6761\u4EF6")]),default:V(()=>[R(lA,{"business-object":D(o),type:D(r)},null,8,["business-object","type"])]),_:1})):ke("",!0),D(c)?(ne(),Ce(b,{name:"condition",key:"form"},{title:V(()=>[R(g,{icon:"ep:list"}),me("\u8868\u5355")]),default:V(()=>[me(" \u53CB\u60C5\u63D0\u793A\uFF1A\u4F7F\u7528 "),R(w,{to:{path:"/bpm/manager/form"}},{default:V(()=>[R(S,{type:"danger"},{default:V(()=>[me("\u6D41\u7A0B\u8868\u5355")]),_:1})]),_:1}),me(" \u66FF\u4EE3\uFF0C\u63D0\u4F9B\u66F4\u597D\u7684\u8868\u5355\u8BBE\u8BA1\u529F\u80FD ")]),_:1})):ke("",!0),D(r).indexOf("Task")!==-1?(ne(),Ce(b,{name:"task",key:"task"},{title:V(()=>[R(g,{icon:"ep:checked"}),me("\u4EFB\u52A1")]),default:V(()=>[R(iA,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1})):ke("",!0),D(r).indexOf("Task")!==-1?(ne(),Ce(b,{name:"multiInstance",key:"multiInstance"},{title:V(()=>[R(g,{icon:"ep:help-filled"}),me("\u591A\u5B9E\u4F8B")]),default:V(()=>[R(aA,{"business-object":D(o),type:D(r)},null,8,["business-object","type"])]),_:1})):ke("",!0),R(b,{name:"listeners",key:"listeners"},{title:V(()=>[R(g,{icon:"ep:bell-filled"}),me("\u6267\u884C\u76D1\u542C\u5668")]),default:V(()=>[R(Yb,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1}),D(r)==="UserTask"?(ne(),Ce(b,{name:"taskListeners",key:"taskListeners"},{title:V(()=>[R(g,{icon:"ep:bell-filled"}),me("\u4EFB\u52A1\u76D1\u542C\u5668")]),default:V(()=>[R(a0,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1})):ke("",!0),R(b,{name:"extensions",key:"extensions"},{title:V(()=>[R(g,{icon:"ep:circle-plus-filled"}),me("\u6269\u5C55\u5C5E\u6027")]),default:V(()=>[R(e0,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1}),R(b,{name:"other",key:"other"},{title:V(()=>[R(g,{icon:"ep:promotion"}),me("\u5176\u4ED6")]),default:V(()=>[R(UT,{id:D(i)},null,8,["id"])]),_:1})]),_:1},8,["modelValue"])],4)}}}),Da=Nt(s0,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue"]]),Da.install=function(e){e.component(Da.name,Da)};let c0,l0,u0;c0={class:"my-process-designer"},l0={class:"my-process-designer__container"},u0=Rt({name:"MyProcessViewer",__name:"ProcessViewer",props:{value:{type:String,default:""},prefix:{type:String,default:"camunda"},activityData:{type:Array,default:()=>[]},processInstanceData:{type:Object,default:()=>{}},taskData:{type:Array,default:()=>[]}},emits:["destroy"],setup(e,{emit:t}){const n=e;ol("configGlobal",n);const i=t;let r;const o=W(""),a=W([]),c=W(void 0),l=W([]),u=W(),p=W(null),d=W(null),y=async _=>{let C=`Process_${new Date().getTime()}`,B=`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,s=_||Fg(C,B,n.prefix);try{let{warnings:h}=await r.importXML(s);h&&h.length&&h.forEach(m=>console.warn(m)),await f(),r.get("canvas").zoom("fit-viewport","auto")}catch(h){console.error(h)}},f=async()=>{var E;const _=a.value;if(_.length===0)return;let C=r.get("canvas"),B=_.find(T=>!T.endTime),s=_[_.length-1],h=!1,m=[];(E=r.getDefinitions().rootElements[0].flowElements)==null||E.forEach(T=>{var N,$,P;let M=_.find(x=>x.key===T.id);if(M){if(T.$type==="bpmn:UserTask"){const x=l.value.find(j=>j.id===M.taskId);if(!x)return;if(h)return void m.push(T.id);if(C.addMarker(T.id,g(x.result)),x.result===1&&(h=!0),x.result!==2)return;const I=b(M);I==null||I.forEach(j=>{let G=_.find(X=>X.key===j.targetRef.id);G?C.addMarker(j.id,G.endTime?"highlight":"highlight-todo"):j.targetRef.$type==="bpmn:ExclusiveGateway"?(C.addMarker(j.id,M.endTime?"highlight":"highlight-todo"),C.addMarker(j.targetRef.id,M.endTime?"highlight":"highlight-todo")):j.targetRef.$type==="bpmn:EndEvent"&&(B||s.key!==T.id||(C.addMarker(j.id,"highlight"),C.addMarker(j.targetRef.id,"highlight")),M.endTime||(C.addMarker(j.id,"highlight-todo"),C.addMarker(j.targetRef.id,"highlight-todo")))})}else if(T.$type==="bpmn:ExclusiveGateway"){let x,I;C.addMarker(T.id,v(M)),(N=T.outgoing)==null||N.forEach(j=>{let G=_.find(X=>X.key===j.targetRef.id);G&&(I&&I.type!=="endEvent"||(x=j,I=G))}),x&&I&&C.addMarker(x.id,v(I))}else if(T.$type==="bpmn:ParallelGateway")C.addMarker(T.id,v(M)),($=T.outgoing)==null||$.forEach(x=>{const I=_.find(j=>j.key===x.targetRef.id);I&&(C.addMarker(x.id,v(I)),C.addMarker(x.targetRef.id,v(I)))});else if(T.$type==="bpmn:StartEvent")(P=T.outgoing)==null||P.forEach(x=>{_.find(I=>I.key===x.targetRef.id)&&(C.addMarker(x.id,"highlight"),C.addMarker(T.id,"highlight"))});else if(T.$type==="bpmn:EndEvent"){if(!c.value||c.value.result===1)return;C.addMarker(T.id,g(c.value.result))}else if(T.$type==="bpmn:ServiceTask"&&(M.startTime>0&&M.endTime===0&&C.addMarker(T.id,g(1)),M.endTime>0)){C.addMarker(T.id,g(2));const x=b(M);x==null||x.forEach(I=>{C.addMarker(I.id,g(2))})}}}),zA(m)||(l.value=l.value.filter(T=>!m.includes(T.definitionKey)))},v=_=>_.endTime?"highlight":"highlight-todo",g=_=>_===1?"highlight-todo":_===2?"highlight":_===3?"highlight-reject":_===4?"highlight-cancel":_===5||_===6||_===7||_===8||_===9?"highlight-return":"",b=_=>{if(_.outgoing&&_.outgoing.length>0)return _.outgoing;const C=r.getDefinitions().rootElements[0].flowElements,B=[];return C.forEach(s=>{s.$type==="bpmn:SequenceFlow"&&s.sourceRef.id===_.key&&B.push(s)}),B},S=_=>{var B;_.value=_,!p.value&&(p.value={}),!d.value&&(d.value=r.get("overlays")),console.log(a.value,"activityLists.value"),console.log(_.value,"element.value");const C=a.value.find(s=>s.key===_.value.id);if(console.log(C,"activityactivityactivityactivity"),C&&!p.value[_.value.id]&&_.value.type!=="bpmn:Process"){let s=`<div class="element-overlays">
  48. <p>Elemet id: ${_.value.id}</p>
  49. <p>Elemet type: ${_.value.type}</p>
  50. </div>`;if(_.value.type==="bpmn:StartEvent"&&c.value)s=`<p>\u53D1\u8D77\u4EBA\uFF1A${c.value.startUser.nickname}</p>
  51. <p>\u90E8\u95E8\uFF1A${c.value.startUser.deptName}</p>
  52. <p>\u521B\u5EFA\u65F6\u95F4\uFF1A${mo(c.value.createTime)}`;else if(_.value.type==="bpmn:UserTask"){let h=l.value.find(T=>T.id===C.taskId);if(!h)return;let m=B0(O0.BPM_PROCESS_INSTANCE_RESULT),E="";m.forEach(T=>{T.value==h.result&&(E=T.label)}),s=`<p>\u5BA1\u6279\u4EBA\uFF1A${h.assigneeUser.nickname}</p>
  53. <p>\u90E8\u95E8\uFF1A${h.assigneeUser.deptName}</p>
  54. <p>\u7ED3\u679C\uFF1A${E}</p>
  55. <p>\u521B\u5EFA\u65F6\u95F4\uFF1A${mo(h.createTime)}</p>`,h.endTime&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${mo(h.endTime)}</p>`),h.reason&&(s+=`<p>\u5BA1\u6279\u5EFA\u8BAE\uFF1A${h.reason}</p>`)}else if(_.value.type==="bpmn:ServiceTask"&&c.value)C.startTime>0&&(s=`<p>\u521B\u5EFA\u65F6\u95F4\uFF1A${mo(C.startTime)}</p>`),C.endTime>0&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${mo(C.endTime)}</p>`),console.log(s);else if(_.value.type==="bpmn:EndEvent"&&c.value){let h=B0(O0.BPM_PROCESS_INSTANCE_RESULT),m="";h.forEach(E=>{E.value==c.value.result&&(m=E.label)}),s=`<p>\u7ED3\u679C\uFF1A${m}</p>`,c.value.endTime&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${mo(c.value.endTime)}</p>`)}console.log(s,"html111111111111111"),p.value[_.value.id]=(B=Be(d.value))==null?void 0:B.add(_.value,{position:{left:0,bottom:0},html:`<div class="element-overlays">${s}</div>`})}},w=_=>{Be(d.value).remove({element:_}),p.value[_.id]=null};return Ma(()=>{o.value=n.value,a.value=n.activityData,r||(r=new qn({container:u.value,bpmnRenderer:{}})),y(o.value),(()=>{const _=r.get("eventBus");_.on("element.hover",function(C){let B=C?C.element:null;S(B)}),_.on("element.out",function(C){let B=C?C.element:null;w(B)})})()}),jn(()=>{r&&r.destroy(),i("destroy",r),r=null}),mt(()=>n.value,_=>{o.value=_,y(o.value)}),mt(()=>n.activityData,_=>{a.value=_,y(o.value)}),mt(()=>n.processInstanceData,_=>{c.value=_,y(o.value)}),mt(()=>n.taskData,_=>{l.value=_,y(o.value)}),(_,C)=>(ne(),De("div",c0,[Ve("div",l0,[Ve("div",{class:"my-process-designer__canvas",style:{height:"760px"},ref_key:"bpmnCanvas",ref:u},null,512)])]))}}),Ba=Nt(u0,[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue"]]),Ba.install=function(e){e.component(Ba.name,Ba)}});export{Na as M,Ia as P,ek as __tla,A as a,L0 as b,It as c,qh as d,Me as e,Wh as f,ai as g,Da as h,we as i,Ba as j};