@sme.up/ketchup 3.0.0-SNAPSHOT → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{drag-and-drop-bbbf419d.js → drag-and-drop-4787ff6f.js} +1 -1
- package/dist/cjs/{f-button-929bbaa5.js → f-button-8812fb28.js} +2 -2
- package/dist/cjs/{f-image-9221e56e.js → f-image-a2211186.js} +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +24 -18
- package/dist/cjs/kup-box_2.cjs.entry.js +5 -5
- package/dist/cjs/kup-bpmn.cjs.entry.js +1 -1
- package/dist/cjs/kup-calendar.cjs.entry.js +1 -1
- package/dist/cjs/kup-dash_2.cjs.entry.js +1 -1
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-editor.cjs.entry.js +1 -1
- package/dist/cjs/kup-field.cjs.entry.js +1 -1
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
- package/dist/cjs/{kup-manager-bf580cf7.js → kup-manager-03ea9815.js} +39 -30
- package/dist/cjs/kup-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/{kup-paginator-declarations-25c881ab.js → kup-paginator-declarations-8029e07e.js} +3 -3
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
- package/dist/collection/assets/data-table-performance.js +64 -919
- package/dist/collection/assets/data-table.js +44 -0
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +1 -1
- package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
- package/dist/collection/components/kup-data-table/kup-data-table.css +7 -0
- package/dist/collection/components/kup-data-table/kup-data-table.js +18 -10
- package/dist/collection/utils/kup-debug/kup-debug.js +17 -7
- package/dist/collection/utils/kup-dynamic-position/kup-dynamic-position.js +5 -3
- package/dist/collection/utils/kup-manager/kup-manager.js +2 -8
- package/dist/collection/utils/kup-scroll-on-hover/kup-scroll-on-hover.js +14 -11
- package/dist/esm/{drag-and-drop-cc72ec41.js → drag-and-drop-e88a00a2.js} +1 -1
- package/dist/esm/{f-button-f7a21749.js → f-button-52db5f1b.js} +2 -2
- package/dist/esm/{f-image-0f1d37f3.js → f-image-9dbc901f.js} +1 -1
- package/dist/esm/kup-accordion.entry.js +2 -2
- package/dist/esm/kup-autocomplete_27.entry.js +24 -18
- package/dist/esm/kup-box_2.entry.js +5 -5
- package/dist/esm/kup-bpmn.entry.js +1 -1
- package/dist/esm/kup-calendar.entry.js +1 -1
- package/dist/esm/kup-dash_2.entry.js +1 -1
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-editor.entry.js +1 -1
- package/dist/esm/kup-field.entry.js +1 -1
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +3 -3
- package/dist/esm/{kup-manager-f3bbd16f.js → kup-manager-5a812e97.js} +39 -30
- package/dist/esm/kup-modal_2.entry.js +1 -1
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/{kup-paginator-declarations-4c512743.js → kup-paginator-declarations-4253e2a2.js} +3 -3
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-9a63d358.entry.js → p-12c796d1.entry.js} +1 -1
- package/dist/ketchup/{p-4ceff81e.entry.js → p-144d078b.entry.js} +1 -1
- package/dist/ketchup/{p-8cd0e70c.js → p-21b4005f.js} +1 -1
- package/dist/ketchup/{p-5919b78a.entry.js → p-29c79da9.entry.js} +1 -1
- package/dist/ketchup/{p-4fa707a0.entry.js → p-48c65b8d.entry.js} +1 -1
- package/dist/ketchup/{p-e3d99a3f.entry.js → p-6da2b313.entry.js} +1 -1
- package/dist/ketchup/{p-78784608.js → p-706474f3.js} +1 -1
- package/dist/ketchup/{p-078691de.entry.js → p-73e65ff4.entry.js} +1 -1
- package/dist/ketchup/{p-29b9f6c1.entry.js → p-7a01dbbb.entry.js} +1 -1
- package/dist/ketchup/{p-7806e2d7.entry.js → p-844c424b.entry.js} +1 -1
- package/dist/ketchup/{p-6352cbc7.js → p-a643165c.js} +1 -1
- package/dist/ketchup/{p-e2cf131d.entry.js → p-bfbc6b8c.entry.js} +2 -2
- package/dist/ketchup/{p-b780967f.entry.js → p-bfd42c64.entry.js} +1 -1
- package/dist/ketchup/{p-e573dadb.entry.js → p-c23b501e.entry.js} +1 -1
- package/dist/ketchup/{p-abc7addd.entry.js → p-cd009fed.entry.js} +1 -1
- package/dist/ketchup/{p-3efe8512.entry.js → p-cffa93f1.entry.js} +1 -1
- package/dist/ketchup/{p-ad230690.entry.js → p-dcd13c1f.entry.js} +1 -1
- package/dist/ketchup/{p-b2c51c48.entry.js → p-dfbfad81.entry.js} +1 -1
- package/dist/ketchup/{p-f0b640c3.entry.js → p-e2458e49.entry.js} +1 -1
- package/dist/ketchup/p-ecf7ddf4.js +1 -0
- package/dist/ketchup/{p-fafee99d.entry.js → p-f0fae900.entry.js} +1 -1
- package/dist/ketchup/{p-785a37e5.js → p-fda4b1a0.js} +1 -1
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +1 -1
- package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +2 -0
- package/dist/types/utils/kup-debug/kup-debug.d.ts +5 -3
- package/dist/types/utils/kup-dynamic-position/kup-dynamic-position.d.ts +2 -2
- package/dist/types/utils/kup-manager/kup-manager-declarations.d.ts +0 -7
- package/dist/types/utils/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ketchup/p-75bac26c.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,f as e,h as n,H as i,d as r}from"./p-4bc39b24.js";import{c as o,a,g as c}from"./p-dfe5a97d.js";import{k as s}from"./p-75bac26c.js";import{g as u,s as l}from"./p-5777d9de.js";import{c as f}from"./p-ad2e21d2.js";import"./p-022fe49e.js";var d,p=o((function(t){t.exports="function"==typeof Object.create?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}})),m=(function(t){var e=t.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var i=Math.log(Math.pow(2,t))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,t/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r<Math.floor(i);r++)a=Math.floor(Math.random()*n).toString(n)+a;if(o){var c=Math.pow(n,o);a=Math.floor(Math.random()*c).toString(n)+a}var s=parseInt(a,n);return s!==1/0&&s>=Math.pow(2,t)?e(t,n):a};e.rack=function(t,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");t+=i}var c=e(t,n)}while(Object.hasOwnProperty.call(o,c));return o[c]=r,c},o=r.hats={};return r.get=function(t){return r.hats[t]},r.set=function(t,e){return r.hats[t]=e,r},r.bits=t||128,r.base=n||16,r}}(d={exports:{}}),d.exports);function h(t){if(!(this instanceof h))return new h(t);this._seed=(t=t||[128,36,1]).length?m.rack(t[0],t[1],t[2]):t}function v(t){return Array.prototype.concat.apply([],t)}h.prototype.next=function(t){return this._seed(t||!0)},h.prototype.nextPrefixed=function(t,e){var n;do{n=t+this.next(!0)}while(this.assigned(n));return this.claim(n,e),n},h.prototype.claim=function(t,e){this._seed.set(t,e||!0)},h.prototype.assigned=function(t){return this._seed.get(t)||!1},h.prototype.unclaim=function(t){delete this._seed.hats[t]},h.prototype.clear=function(){var t,e=this._seed.hats;for(t in e)this.unclaim(t)};var b=Object.prototype.toString,g=Object.prototype.hasOwnProperty;function y(t){return void 0===t}function x(t){return void 0!==t}function w(t){return null==t}function E(t){return"[object Array]"===b.call(t)}function k(t){return"[object Object]"===b.call(t)}function I(t){return"[object Number]"===b.call(t)}function _(t){var e=b.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object AsyncGeneratorFunction]"===e||"[object Proxy]"===e}function M(t){return"[object String]"===b.call(t)}function S(t){if(!E(t))throw new Error("must supply array")}function B(t,e){return g.call(t,e)}function N(t,e){var n;return e=V(e),R(t,(function(t,i){if(e(t,i))return n=t,!1})),n}function A(t,e){e=V(e);var n=E(t)?-1:void 0;return R(t,(function(t,i){if(e(t,i))return n=i,!1})),n}function D(t,e){var n=[];return R(t,(function(t,i){e(t,i)&&n.push(t)})),n}function R(t,e){var n;if(!y(t)){var i=E(t)?J:X;for(var r in t)if(B(t,r)&&!1===e(n=t[r],i(r)))return n}}function C(t,e){return y(t)?[]:(S(t),e=V(e),t.filter((function(t,n){return!e(t,n)})))}function T(t,e,n){return R(t,(function(t,i){n=e(n,t,i)})),n}function P(t,e){return!!T(t,(function(t,n,i){return t&&e(n,i)}),!0)}function z(t,e){return!!N(t,e)}function j(t,e){var n=[];return R(t,(function(t,i){n.push(e(t,i))})),n}function G(t){return t&&Object.keys(t)||[]}function F(t){return G(t).length}function L(t){return j(t,(function(t){return t}))}function O(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=U(e),R(t,(function(t){var i=e(t)||"_",r=n[i];r||(r=n[i]=[]),r.push(t)})),n}function W(t){t=U(t);for(var e={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];R(i,(function(n){return O(n,t,e)}));var o=j(e,(function(t){return t[0]}));return o}var Z=W;function H(t,e){e=U(e);var n=[];return R(t,(function(t,i){for(var r=e(t,i),o={d:r,v:t},a=0;a<n.length;a++)if(r<n[a].d)return void n.splice(a,0,o);n.push(o)})),j(n,(function(t){return t.v}))}function Y(t){return function(e){return P(t,(function(t,n){return e[n]===t}))}}function U(t){return _(t)?t:function(e){return e[t]}}function V(t){return _(t)?t:function(e){return e===t}}function X(t){return t}function J(t){return Number(t)}function Q(t,e){var n,i,r,o;function a(){var a=Date.now(),s=o+e-a;if(s>0)return c(s);t.apply(r,i),n=o=i=r=void 0}function c(t){n=setTimeout(a,t)}return function(){o=Date.now();for(var t=arguments.length,a=new Array(t),s=0;s<t;s++)a[s]=arguments[s];i=a,r=this,n||c(e)}}function q(t,e){return t.bind(e)}function K(){return(K=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function $(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return K.apply(void 0,[t].concat(n))}function tt(t,e){var n={},i=Object(t);return R(e,(function(e){e in i&&(n[e]=t[e])})),n}function et(t,e){var n={};return R(Object(t),(function(t,i){-1===e.indexOf(i)&&(n[i]=t)})),n}const nt=Object.freeze({__proto__:null,assign:$,bind:q,debounce:Q,ensureArray:S,every:P,filter:D,find:N,findIndex:A,flatten:v,forEach:R,get:function(t,e,n){var i=t;return R(e,(function(t){if(w(i))return i=void 0,!1;i=i[t]})),y(i)?n:i},groupBy:O,has:B,isArray:E,isDefined:x,isFunction:_,isNil:w,isNumber:I,isObject:k,isString:M,isUndefined:y,keys:G,map:j,matchPattern:Y,merge:function t(e){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?(R(i,(function(n){n&&k(n)&&R(n,(function(n,i){if("__proto__"!==i){var r=e[i];k(n)?(k(r)||(r={}),e[i]=t(r,n)):e[i]=n}}))})),e):e},omit:et,pick:tt,reduce:T,set:function(t,e,n){var i=t;return R(e,(function(t,r){if("__proto__"===t)throw new Error("illegal key: __proto__");var o=e[r+1],a=i[t];x(o)&&w(a)&&(a=i[t]=isNaN(+o)?{}:[]),y(o)?y(n)?delete i[t]:i[t]=n:i=a})),t},size:F,some:z,sortBy:H,throttle:function(t,e){var n=!1;return function(){n||(t.apply(void 0,arguments),n=!0,setTimeout((function(){n=!1}),e))}},unionBy:Z,uniqueBy:W,values:L,without:C});function it(t,e,n){return 2==arguments.length?t.getAttribute(e):null===n?t.removeAttribute(e):(t.setAttribute(e,n),t)}var rt=[].indexOf,ot=function(t,e){if(rt)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1},at=/\s+/,ct=Object.prototype.toString;function st(t){return new ut(t)}function ut(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}function lt(t){for(;t.childNodes.length;)t.removeChild(t.childNodes[0]);return t}ut.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~ot(e,t)||e.push(t),this.el.className=e.join(" "),this},ut.prototype.remove=function(t){if("[object RegExp]"==ct.call(t))return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=ot(e,t);return~n&&e.splice(n,1),this.el.className=e.join(" "),this},ut.prototype.removeMatching=function(t){for(var e=this.array(),n=0;n<e.length;n++)t.test(e[n])&&this.remove(e[n]);return this},ut.prototype.toggle=function(t,e){return this.list?(void 0!==e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(void 0!==e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},ut.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(at);return""===t[0]&&t.shift(),t},ut.prototype.has=ut.prototype.contains=function(t){return this.list?this.list.contains(t):!!~ot(this.array(),t)};var ft="undefined"!=typeof Element?Element.prototype:{},dt=ft.matches||ft.matchesSelector||ft.webkitMatchesSelector||ft.mozMatchesSelector||ft.msMatchesSelector||ft.oMatchesSelector,pt=function(t,e){if(!t||1!==t.nodeType)return!1;if(dt)return dt.call(t,e);for(var n=t.parentNode.querySelectorAll(e),i=0;i<n.length;i++)if(n[i]==t)return!0;return!1};function mt(t,e,n){for(var i=n?t:t.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(pt(i,e))return i;i=i.parentNode}return pt(i,e)?i:null}var ht,vt=window.addEventListener?"addEventListener":"attachEvent",bt=window.removeEventListener?"removeEventListener":"detachEvent",gt="addEventListener"!==vt?"on":"",yt={bind:function(t,e,n,i){return t[vt](gt+e,n,i||!1),n},unbind:function(t,e,n,i){return t[bt](gt+e,n,i||!1),n}},xt=["focus","blur"],wt=function(t,e,n,i,r){return-1!==xt.indexOf(n)&&(r=!0),yt.bind(t,n,(function(n){n.delegateTarget=mt(n.target||n.srcElement,e,!0),n.delegateTarget&&i.call(t,n)}),r)},Et=function(t,e,n,i){return-1!==xt.indexOf(e)&&(i=!0),yt.unbind(t,e,n,i)},kt=function(t,e){if("string"!=typeof t)throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i)return(r=e.createElement("html")).innerHTML=t,r.removeChild(r.lastChild);var r,o=_t[i]||_t._default,a=o[0],c=o[1],s=o[2];for((r=e.createElement("div")).innerHTML=c+t+s;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=e.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},It=!1;"undefined"!=typeof document&&((ht=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',It=!ht.getElementsByTagName("link").length,ht=void 0);var _t={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:It?[1,"X<div>","</div>"]:[0,"",""]};function Mt(t,e){return(e=e||document).querySelector(t)}function St(t,e){return(e=e||document).querySelectorAll(t)}function Bt(t){t.parentNode&&t.parentNode.removeChild(t)}function Nt(t,e){return e.appendChild(function(t,e){if(t.ownerDocument!==e.ownerDocument)try{return e.ownerDocument.importNode(t,!0)}catch(t){}return t}(t,e))}function At(t,e){return Nt(e,t),t}_t.td=_t.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],_t.option=_t.optgroup=[1,'<select multiple="multiple">',"</select>"],_t.thead=_t.tbody=_t.colgroup=_t.caption=_t.tfoot=[1,"<table>","</table>"],_t.polyline=_t.ellipse=_t.polygon=_t.circle=_t.text=_t.line=_t.path=_t.rect=_t.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Dt={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Rt(t,e,n){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Dt[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),t.style[i]=n):t.setAttributeNS(null,e,n)}function Ct(t,e,n){if("string"==typeof e){if(void 0===n)return function(t,e){return Dt[e]?t.style[e]:t.getAttributeNS(null,e)}(t,e);Rt(t,e,n)}else!function(t,e){var n,i,r=Object.keys(e);for(n=0;i=r[n];n++)Rt(t,i,e[i])}(t,e);return t}function Tt(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}var Pt=/\s+/,zt=Object.prototype.toString;function jt(t){return void 0!==t}function Gt(t){return new Ft(t)}function Ft(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}function Lt(t){var e=t.parentNode;return e&&e.removeChild(t),t}function Ot(t){for(var e;e=t.firstChild;)Lt(e);return t}function Wt(t){return t.cloneNode(!0)}Ft.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~Tt(e,t)||e.push(t),jt(this.el.className.baseVal)?this.el.className.baseVal=e.join(" "):this.el.className=e.join(" "),this},Ft.prototype.remove=function(t){if("[object RegExp]"===zt.call(t))return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=Tt(e,t);return~n&&e.splice(n,1),this.el.className.baseVal=e.join(" "),this},Ft.prototype.removeMatching=function(t){for(var e=this.array(),n=0;n<e.length;n++)t.test(e[n])&&this.remove(e[n]);return this},Ft.prototype.toggle=function(t,e){return this.list?(jt(e)?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(jt(e)?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},Ft.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(Pt);return""===t[0]&&t.shift(),t},Ft.prototype.has=Ft.prototype.contains=function(t){return this.list?this.list.contains(t):!!~Tt(this.array(),t)};var Zt="http://www.w3.org/2000/svg",Ht='<svg xmlns="'+Zt+'"';function Yt(t){var e=!1;"<svg"===t.substring(0,4)?-1===t.indexOf(Zt)&&(t=Ht+t.substring(4)):(t=Ht+">"+t+"</svg>",e=!0);var n=function(t){var e;return(e=new DOMParser).async=!1,e.parseFromString(t,"text/xml")}(t);if(!e)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function Ut(t,e){var n;return"<"===t.charAt(0)?(n=Yt(t).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Zt,t),e&&Ct(n,e),n}var Vt=Ut("svg");function Xt(t,e){var n,i,r=Object.keys(e);for(n=0;i=r[n];n++)t[i]=e[i];return t}function Jt(t){return t?Vt.createSVGTransformFromMatrix(t):Vt.createSVGTransform()}var Qt=/([&<>]{1})/g,qt=/([\n\r"]{1})/g,Kt={"&":"&","<":"<",">":">",'"':"'"};function $t(t,e){return t.replace(e,(function(t,e){return Kt[e]||e}))}function te(t,e){var n,i,r,o,a;switch(t.nodeType){case 3:e.push($t(t.textContent,Qt));break;case 1:if(e.push("<",t.tagName),t.hasAttributes())for(n=0,i=(r=t.attributes).length;n<i;++n)o=r.item(n),e.push(" ",o.name,'="',$t(o.value,qt),'"');if(t.hasChildNodes()){for(e.push(">"),n=0,i=(a=t.childNodes).length;n<i;++n)te(a.item(n),e);e.push("</",t.tagName,">")}else e.push("/>");break;case 8:e.push("\x3c!--",$t(t.nodeValue,Qt),"--\x3e");break;case 4:e.push("<![CDATA[",t.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+t.nodeType)}return e}function ee(t,e){if(void 0!==e){try{!function(t,e){var n=Yt(e);if(Ot(t),e){(function(t){return"#document-fragment"===t.nodeName})(n)||(n=n.documentElement);for(var i=Array.prototype.slice.call(n.childNodes),r=0;r<i.length;r++)Nt(i[r],t)}}(t,e)}catch(t){throw new Error("error parsing SVG: "+t.message)}return t}return function(t){for(var e=t.firstChild,n=[];e;)te(e,n),e=e.nextSibling;return n.join("")}(t)}function ne(t,e){return e instanceof SVGMatrix?t.createSVGTransformFromMatrix(e):e}function ie(t,e){var n=t.transform.baseVal;return e&&(Array.isArray(e)||(e=[e]),function(t,e){var n,i;for(t.clear(),n=0;i=e[n];n++)t.appendItem(ne(t,i))}(n,e)),n.consolidate()}var re=/^class /;function oe(t){return"[object Array]"===Object.prototype.toString.call(t)}function ae(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ce(){var t=Array.prototype.slice.call(arguments);1===t.length&&oe(t[0])&&(t=t[0]);var e=t.pop();return e.$inject=t,e}var se=/constructor\s*[^(]*\(\s*([^)]*)\)/m,ue=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,le=/\/\*([^*]*)\*\//m;function fe(t){if("function"!=typeof t)throw new Error('Cannot annotate "'+t+'". Expected a function!');var e=t.toString().match(function(t){return re.test(t.toString())}(t)?se:ue);return e&&e[1]&&e[1].split(",").map((function(t){return(e=t.match(le))?e[1].trim():t.trim()}))||[]}function de(){var t=[];this.factory=function(e,n){return t.push([e,"factory",n]),this},this.value=function(e,n){return t.push([e,"value",n]),this},this.type=function(e,n){return t.push([e,"type",n]),this},this.forEach=function(e){t.forEach(e)}}function pe(t,e){e=e||{get:function(t,e){if(n.push(t),!1===e)return null;throw a('No provider for "'+t+'"!')}};var n=[],i=this._providers=Object.create(e._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(t){var e=n.join(" -> ");return n.length=0,new Error(e?t+" (Resolving: "+e+")":t)},c=function(t,o){if(!i[t]&&-1!==t.indexOf(".")){for(var s=t.split("."),u=c(s.shift());s.length;)u=u[s.shift()];return u}if(ae(r,t))return r[t];if(ae(i,t)){if(-1!==n.indexOf(t))throw n.push(t),a("Cannot resolve circular dependency!");return n.push(t),r[t]=i[t][0](i[t][1]),n.pop(),r[t]}return e.get(t,o)},s=function(t,e){if(void 0===e&&(e={}),"function"!=typeof t){if(!oe(t))throw new Error('Cannot invoke "'+t+'". Expected a function!');t=ce(t.slice())}return{fn:t,dependencies:(t.$inject||fe(t)).map((function(t){return ae(e,t)?e[t]:c(t)}))}},u=function(t){var e=s(t);return new(Function.prototype.bind.apply(e.fn,[null].concat(e.dependencies)))},l=function(t,e,n){var i=s(t,n);return i.fn.apply(e,i.dependencies)},f=function(t){return ce((function(e){return t.get(e)}))},d={factory:l,type:u,value:function(t){return t}};t.forEach((function(t){function e(t,e){return"value"!==t&&oe(e)&&(e=ce(e.slice())),e}if(t instanceof de)t.forEach((function(t){var n=t[1];i[t[0]]=[d[n],e(n,t[2]),n]}));else if("object"==typeof t)if(t.__exports__){var n=Object.keys(t).reduce((function(e,n){return"__"!==n.substring(0,2)&&(e[n]=t[n]),e}),Object.create(null)),r=new pe((t.__modules__||[]).concat([n]),o),a=ce((function(t){return r.get(t)}));t.__exports__.forEach((function(t){i[t]=[a,t,"private",r]}))}else Object.keys(t).forEach((function(n){if("private"!==t[n][2]){var r=t[n][0];i[n]=[d[r],e(r,t[n][1]),r]}else i[n]=t[n]}))})),this.get=c,this.invoke=l,this.instantiate=u,this.createChild=function(t,e){if(e&&e.length){var n,r,a,c,s=Object.create(null),u=Object.create(null),l=[],d=[],p=[];for(var m in i)n=i[m],-1!==e.indexOf(m)&&("private"===n[2]?-1===(r=l.indexOf(n[3]))?(a=n[3].createChild([],e),c=f(a),l.push(n[3]),d.push(a),p.push(c),s[m]=[c,m,"private",a]):s[m]=[p[r],m,"private",d[r]]:s[m]=[n[2],n[1]],u[m]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||e.forEach((function(t){-1!==n[1].$scope.indexOf(t)&&(s[m]=[n[2],n[1]],u[t]=!0)}));e.forEach((function(t){if(!u[t])throw new Error('No provider for "'+t+'". Cannot use provider from the parent!')})),t.unshift(s)}return new pe(t,o)}}function me(t,e){var n=this;t.on(["render.shape","render.connection"],e=e||1e3,(function(t,e){var i=t.type,r=e.element,o=e.gfx;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r):n.drawConnection(o,r)})),t.on(["render.getShapePath","render.getConnectionPath"],e,(function(t,e){if(n.canRender(e))return"render.getShapePath"===t.type?n.getShapePath(e):n.getConnectionPath(e)}))}function he(t){return t.join(",").replace(/,?([A-z]),?/g,"$1")}function ve(t){for(var e,n="",i=0;e=t[i];i++)n+=e.x+","+e.y+" ";return n}function be(t,e){var n=Ut("polyline");return Ct(n,{points:ve(t)}),e&&Ct(n,e),n}function ge(t){return D(t,(function(e){return!N(t,(function(t){return t!==e&&ye(e,t)}))}))}function ye(t,e){if(e){if(t===e)return e;if(t.parent)return ye(t.parent,e)}}function xe(t,e,n){var i=!n||-1===t.indexOf(e);return i&&t.push(e),i}function we(t,e,n){n=n||0,E(t)||(t=[t]),R(t,(function(t,i){var r=e(t,i,n);E(r)&&r.length&&we(r,e,n+1)}))}function Ee(t,e){return function(t,e){var n=[],i=[];return we(t,(function(t){xe(n,t,e);var r=t.children;if(r&&xe(i,r,e))return r})),n}(t,!e)}function ke(t,e){var n,i,r,o;return e=!!e,E(t)||(t=[t]),R(t,(function(t){var a=t;t.waypoints&&!e&&(a=ke(t.waypoints,!0));var c=a.x,s=a.y,u=a.height||0,l=a.width||0;(c<n||void 0===n)&&(n=c),(s<i||void 0===i)&&(i=s),(c+l>r||void 0===r)&&(r=c+l),(s+u>o||void 0===o)&&(o=s+u)})),{x:n,y:i,height:o-i,width:r-n}}function Ie(t){return"waypoints"in t?"connection":"x"in t?"shape":"root"}function _e(t){return!(!t||!t.isFrame)}function Me(t,e){return $({},t||{},e||{})}function Se(t,e){me.call(this,t,1),this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=e.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}me.prototype.canRender=function(){},me.prototype.drawShape=function(){},me.prototype.drawConnection=function(){},me.prototype.getShapePath=function(){},me.prototype.getConnectionPath=function(){},p(Se,me),Se.prototype.canRender=function(){return!0},Se.prototype.drawShape=function(t,e){var n=Ut("rect");return Ct(n,{x:0,y:0,width:e.width||0,height:e.height||0}),_e(e)?Ct(n,this.FRAME_STYLE):Ct(n,this.SHAPE_STYLE),At(t,n),n},Se.prototype.drawConnection=function(t,e){var n=be(e.waypoints,this.CONNECTION_STYLE);return At(t,n),n},Se.prototype.getShapePath=function(t){var e=t.width;return he([["M",t.x,t.y],["l",e,0],["l",0,t.height],["l",-e,0],["z"]])},Se.prototype.getConnectionPath=function(t){var e,n,i=t.waypoints,r=[];for(e=0;n=i[e];e++)r.push([0===e?"M":"L",(n=n.original||n).x,n.y]);return he(r)},Se.$inject=["eventBus","styles"];const Be={__init__:["defaultRenderer"],defaultRenderer:["type",Se],styles:["type",function(){var t={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},e=this;this.cls=function(t,e,n){return $(this.style(e,n),{class:t})},this.style=function(e,n){E(e)||n||(n=e,e=[]);var i=T(e,(function(e,n){return $(e,t[n]||{})}),{});return n?$(i,n):i},this.computeStyle=function(t,n,i){return E(n)||(i=n,n=[]),e.style(n||[],$({},i,t||{}))}}]};function Ne(t,e){if(!t||!e)return-1;var n=t.indexOf(e);return-1!==n&&t.splice(n,1),n}function Ae(t,e,n){if(t&&e){"number"!=typeof n&&(n=-1);var i=t.indexOf(e);if(-1!==i){if(i===n)return;if(-1===n)return;t.splice(i,1)}-1!==n?t.splice(n,0,e):t.push(e)}}function De(t,e){return t&&e?t.indexOf(e):-1}function Re(t,e){return t&&e?Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):-1}function Ce(t,e,n,i){if(void 0===i&&(i=5),!t||!e||!n)return!1;var r=(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x),o=Re(t,e);return Math.abs(r/o)<=i}function Te(t,e){var n;return function(t){var e,n=(e=E(t)?t:[t,void 0]).slice().shift();return P(e,(function(t){return Math.abs(n.y-t.y)<=2}))}(n=E(t)?t:[t,e])?"h":!!function(t){var e,n=(e=E(t)?t:[t,void 0]).slice().shift();return P(e,(function(t){return Math.abs(n.x-t.x)<=2}))}(n)&&"v"}function Pe(t,e,n){return t.x>e.x-(n=n||0)&&t.y>e.y-n&&t.x<e.x+e.width+n&&t.y<e.y+e.height+n}function ze(t,e){return{x:Math.round(t.x+(e.x-t.x)/2),y:Math.round(t.y+(e.y-t.y)/2)}}var je=/,?([a-z]),?/gi,Ge=parseFloat,Fe=Math,Le=Fe.PI,Oe=Fe.min,We=Fe.max,Ze=Fe.pow,He=Fe.abs,Ye=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,Ue=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,Ve=Array.isArray||function(t){return t instanceof Array};function Xe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Je(t){if("function"==typeof t||Object(t)!==t)return t;var e=new t.constructor;for(var n in t)Xe(t,n)&&(e[n]=Je(t[n]));return e}function Qe(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return t.push(t.splice(n,1)[0])}function qe(t){var e=qe.ps=qe.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout((function(){for(var n in e)Xe(e,n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])})),e[t]}function Ke(t,e,n,i){return 1===arguments.length&&(e=t.y,n=t.width,i=t.height,t=t.x),{x:t,y:e,width:n,height:i,x2:t+n,y2:e+i}}function $e(){return this.join(",").replace(je,"$1")}function tn(t){var e=Je(t);return e.toString=$e,e}function en(t,e,n,i,r,o,a,c,s){var u=1-s,l=Ze(u,3),f=Ze(u,2),d=s*s*s,p=l*e+3*f*s*i+3*u*s*s*o+d*c;return{x:sn(l*t+3*f*s*n+3*u*s*s*r+d*a),y:sn(p)}}function nn(t){var e=hn.apply(null,t);return Ke(e.x0,e.y0,e.x1-e.x0,e.y1-e.y0)}function rn(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height}function on(t,e,n,i,r){return t*(t*(-3*e+9*n-9*i+3*r)+6*e-12*n+6*i)-3*e+3*n}function an(t,e,n,i,r,o,a,c,s){null==s&&(s=1);for(var u=(s=s>1?1:s<0?0:s)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,p=0;p<12;p++){var m=u*l[p]+u,h=on(m,t,n,r,a),v=on(m,e,i,o,c);d+=f[p]*Fe.sqrt(h*h+v*v)}return u*d}function cn(t,e,n,i,r,o,a,c){if(!(We(t,n)<Oe(r,a)||Oe(t,n)>We(r,a)||We(e,i)<Oe(o,c)||Oe(e,i)>We(o,c))){var s=(t*i-e*n)*(o-c)-(e-i)*(r*c-o*a),u=(t-n)*(o-c)-(e-i)*(r-a);if(u){var l=sn(((t*i-e*n)*(r-a)-(t-n)*(r*c-o*a))/u),f=sn(s/u),d=+l.toFixed(2),p=+f.toFixed(2);if(!(d<+Oe(t,n).toFixed(2)||d>+We(t,n).toFixed(2)||d<+Oe(r,a).toFixed(2)||d>+We(r,a).toFixed(2)||p<+Oe(e,i).toFixed(2)||p>+We(e,i).toFixed(2)||p<+Oe(o,c).toFixed(2)||p>+We(o,c).toFixed(2)))return{x:l,y:f}}}}function sn(t){return Math.round(1e11*t)/1e11}function un(t,e,n){if(i=nn(t),r=nn(e),i=Ke(i),!(rn(r=Ke(r),i.x,i.y)||rn(r,i.x2,i.y)||rn(r,i.x,i.y2)||rn(r,i.x2,i.y2)||rn(i,r.x,r.y)||rn(i,r.x2,r.y)||rn(i,r.x,r.y2)||rn(i,r.x2,r.y2)||(i.x<r.x2&&i.x>r.x||r.x<i.x2&&r.x>i.x)&&(i.y<r.y2&&i.y>r.y||r.y<i.y2&&r.y>i.y)))return n?0:[];for(var i,r,o=an.apply(0,t),a=an.apply(0,e),c=fn(t)?1:~~(o/5)||1,s=fn(e)?1:~~(a/5)||1,u=[],l=[],f={},d=n?0:[],p=0;p<c+1;p++){var m=en.apply(0,t.concat(p/c));u.push({x:m.x,y:m.y,t:p/c})}for(p=0;p<s+1;p++)m=en.apply(0,e.concat(p/s)),l.push({x:m.x,y:m.y,t:p/s});for(p=0;p<c;p++)for(var h=0;h<s;h++){var v,b=u[p],g=u[p+1],y=l[h],x=l[h+1],w=He(g.x-b.x)<.01?"y":"x",E=He(x.x-y.x)<.01?"y":"x",k=cn(b.x,b.y,g.x,g.y,y.x,y.y,x.x,x.y);if(k){if(f[v=k.x.toFixed(9)+"#"+k.y.toFixed(9)])continue;f[v]=!0;var I=b.t+He((k[w]-b[w])/(g[w]-b[w]))*(g.t-b.t),_=y.t+He((k[E]-y[E])/(x[E]-y[E]))*(x.t-y.t);I>=0&&I<=1&&_>=0&&_<=1&&(n?d++:d.push({x:k.x,y:k.y,t1:I,t2:_}))}}return d}function ln(t){var e=qe(t);if(e.abs)return tn(e.abs);if(Ve(t)&&Ve(t&&t[0])||(t=function(t){if(!t)return null;var e=qe(t);if(e.arr)return Je(e.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return Ve(t)&&Ve(t[0])&&(i=Je(t)),i.length||String(t).replace(Ye,(function(t,e,r){var o=[],a=e.toLowerCase();for(r.replace(Ue,(function(t,e){e&&o.push(+e)})),"m"==a&&o.length>2&&(i.push([e].concat(o.splice(0,2))),a="l",e="m"==e?"l":"L");o.length>=n[a]&&(i.push([e].concat(o.splice(0,n[a]))),n[a]););})),i.toString=qe.toString,e.arr=Je(i),i}(t)),!t||!t.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,c=0,s=0;"M"==t[0][0]&&(a=r=+t[0][1],c=o=+t[0][2],s++,i[0]=["M",r,o]);for(var u,l,f=s,d=t.length;f<d;f++){if(i.push(u=[]),(n=(l=t[f])[0])!=n.toUpperCase())switch(u[0]=n.toUpperCase(),u[0]){case"A":u[1]=l[1],u[2]=l[2],u[3]=l[3],u[4]=l[4],u[5]=l[5],u[6]=+l[6]+r,u[7]=+l[7]+o;break;case"V":u[1]=+l[1]+o;break;case"H":u[1]=+l[1]+r;break;case"M":a=+l[1]+r,c=+l[2]+o;default:for(var p=1,m=l.length;p<m;p++)u[p]=+l[p]+(p%2?r:o)}else for(var h=0,v=l.length;h<v;h++)u[h]=l[h];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=$e,e.abs=tn(i),i}function fn(t){return t[0]===t[2]&&t[1]===t[3]&&t[4]===t[6]&&t[5]===t[7]}function dn(t,e,n,i){return[t,e,n,i,n,i]}function pn(t,e,n,i,r,o){var a=1/3,c=2/3;return[a*t+c*n,a*e+c*i,a*r+c*n,a*o+c*i,r,o]}function mn(t,e,n,i,r,o,a,c,s,u){var l,f,d=120*Le/180,p=Le/180*(+r||0),m=[],h=(f=function(t,e,n){return{x:t*Fe.cos(n)-e*Fe.sin(n),y:t*Fe.sin(n)+e*Fe.cos(n)}},function t(){var e=Array.prototype.slice.call(arguments,0),n=e.join("␀"),i=t.cache=t.cache||{},r=t.count=t.count||[];return Xe(i,n)?(Qe(r,n),i[n]):(r.length>=1e3&&delete i[r.shift()],r.push(n),i[n]=f.apply(0,e),i[n])});if(u)I=u[0],_=u[1],E=u[2],k=u[3];else{e=(l=h(t,e,-p)).y;var v=((t=l.x)-(c=(l=h(c,s,-p)).x))/2,b=(e-(s=l.y))/2,g=v*v/(n*n)+b*b/(i*i);g>1&&(n*=g=Fe.sqrt(g),i*=g);var y=n*n,x=i*i,w=(o==a?-1:1)*Fe.sqrt(He((y*x-y*b*b-x*v*v)/(y*b*b+x*v*v))),E=w*n*b/i+(t+c)/2,k=w*-i*v/n+(e+s)/2,I=Fe.asin(((e-k)/i).toFixed(9)),_=Fe.asin(((s-k)/i).toFixed(9));(I=t<E?Le-I:I)<0&&(I=2*Le+I),(_=c<E?Le-_:_)<0&&(_=2*Le+_),a&&I>_&&(I-=2*Le),!a&&_>I&&(_-=2*Le)}var M=_-I;if(He(M)>d){var S=_,B=c,N=s;m=mn(c=E+n*Fe.cos(_=I+d*(a&&_>I?1:-1)),s=k+i*Fe.sin(_),n,i,r,0,a,B,N,[_,S,E,k])}M=_-I;var A=Fe.cos(I),D=Fe.sin(I),R=Fe.cos(_),C=Fe.sin(_),T=Fe.tan(M/4),P=4/3*n*T,z=4/3*i*T,j=[t,e],G=[t+P*D,e-z*A],F=[c+P*C,s-z*R],L=[c,s];if(G[0]=2*j[0]-G[0],G[1]=2*j[1]-G[1],u)return[G,F,L].concat(m);for(var O=[],W=0,Z=(m=[G,F,L].concat(m).join().split(",")).length;W<Z;W++)O[W]=W%2?h(m[W-1],m[W],p).y:h(m[W],m[W+1],p).x;return O}function hn(t,e,n,i,r,o,a,c){for(var s,u,l,f,d,p,m,h,v=[],b=[[],[]],g=0;g<2;++g)if(0==g?(u=6*t-12*n+6*r,s=-3*t+9*n-9*r+3*a,l=3*n-3*t):(u=6*e-12*i+6*o,s=-3*e+9*i-9*o+3*c,l=3*i-3*e),He(s)<1e-12){if(He(u)<1e-12)continue;0<(f=-l/u)&&f<1&&v.push(f)}else h=Fe.sqrt(m=u*u-4*l*s),m<0||(0<(d=(-u+h)/(2*s))&&d<1&&v.push(d),0<(p=(-u-h)/(2*s))&&p<1&&v.push(p));for(var y,x=v.length,w=x;x--;)b[0][x]=(y=1-(f=v[x]))*y*y*t+3*y*y*f*n+3*y*f*f*r+f*f*f*a,b[1][x]=y*y*y*e+3*y*y*f*i+3*y*f*f*o+f*f*f*c;return b[0][w]=t,b[1][w]=e,b[0][w+1]=a,b[1][w+1]=c,b[0].length=b[1].length=w+2,{x0:Oe.apply(0,b[0]),y0:Oe.apply(0,b[1]),x1:We.apply(0,b[0]),y1:We.apply(0,b[1])}}function vn(t){var e=qe(t);if(e.curve)return tn(e.curve);for(var n=ln(t),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(t,e,n){var i,r;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(mn.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"==n||"S"==n?(i=2*e.x-e.bx,r=2*e.y-e.by):(i=e.x,r=e.y),t=["C",i,r].concat(t.slice(1));break;case"T":"Q"==n||"T"==n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(pn(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(pn(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(dn(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(dn(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(dn(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(dn(e.x,e.y,e.X,e.Y))}return t},o=function(t,e){if(t[e].length>7){t[e].shift();for(var i=t[e];i.length;)a[e]="A",t.splice(e++,0,["C"].concat(i.splice(0,6)));t.splice(e,1),l=n.length}},a=[],c="",s="",u=0,l=n.length;u<l;u++){n[u]&&(c=n[u][0]),"C"!=c&&(a[u]=c,u&&(s=a[u-1])),n[u]=r(n[u],i,s),"A"!=a[u]&&"C"==c&&(a[u]="C"),o(n,u);var f=n[u],d=f.length;i.x=f[d-2],i.y=f[d-1],i.bx=Ge(f[d-4])||i.x,i.by=Ge(f[d-3])||i.y}return e.curve=tn(n),n}var bn=function(t,e,n){t=vn(t),e=vn(e);for(var i,r,o,a,c,s,u,l,f,d,p=n?0:[],m=0,h=t.length;m<h;m++){var v=t[m];if("M"==v[0])i=c=v[1],r=s=v[2];else{"C"==v[0]?(f=[i,r].concat(v.slice(1)),i=f[6],r=f[7]):(f=[i,r,i,r,c,s,c,s],i=c,r=s);for(var b=0,g=e.length;b<g;b++){var y=e[b];if("M"==y[0])o=u=y[1],a=l=y[2];else{"C"==y[0]?(d=[o,a].concat(y.slice(1)),o=d[6],a=d[7]):(d=[o,a,o,a,u,l,u,l],o=u,a=l);var x=un(f,d,n);if(n)p+=x;else{for(var w=0,E=x.length;w<E;w++)x[w].segment1=m,x[w].segment2=b,x[w].bez1=f,x[w].bez2=d;p=p.concat(x)}}}}}return p};function gn(t){return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function yn(t){return{x:Math.round(t.x),y:Math.round(t.y)}}function xn(t){return{top:t.y,right:t.x+(t.width||0),bottom:t.y+(t.height||0),left:t.x}}function wn(t){return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}function En(t){return yn({x:t.x+(t.width||0)/2,y:t.y+(t.height||0)/2})}function kn(t,e,n){k(n=n||0)||(n={x:n,y:n});var i=xn(t),r=xn(e),o=i.bottom+n.y<=r.top?"top":i.top-n.y>=r.bottom?"bottom":null,a=i.right+n.x<=r.left?"left":i.left-n.x>=r.right?"right":null;return a&&o?o+"-"+a:a||o||"intersect"}function In(t,e,n){var i=bn(t,e);return 1===i.length||2===i.length&&Re(i[0],i[1])<1?yn(i[0]):i.length>1?yn((i=H(i,(function(t){var e=Math.floor(100*t.t2)||1;return t.segment2+"#"+((e=100-e)<10?"0":"")+e})))[n?0:i.length-1]):null}function _n(t,e){return Math.round(t*e)/e}function Mn(t){return I(t)?t+"px":t}function Sn(t,e,n){var i=Ut("g");return Gt(i).add(e),t.insertBefore(i,t.childNodes[void 0!==n?n:t.childNodes.length-1]||null),i}var Bn={shape:["x","y","width","height"],connection:["waypoints"]};function Nn(t,e,n,i){this._eventBus=e,this._elementRegistry=i,this._graphicsFactory=n,this._init(t||{})}function An(t,e){t.setAttribute("transform","matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")")}Nn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Nn.prototype._init=function(t){var e=this._eventBus,n=this._container=function(t){var e=(t=$({},{width:"100%",height:"100%"},t)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),$(n.style,{position:"relative",overflow:"hidden",width:Mn(t.width),height:Mn(t.height)}),e.appendChild(n),n}(t),i=this._svg=Ut("svg");Ct(i,{width:"100%",height:"100%"}),At(n,i);var r=this._viewport=Sn(i,"viewport");this._layers={},!1!==t.deferUpdate&&(this._viewboxChanged=Q(q(this._viewboxChanged,this),300)),e.on("diagram.init",(function(){e.fire("canvas.init",{svg:i,viewport:r})}),this),e.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed"],(function(){delete this._cachedViewbox}),this),e.on("diagram.destroy",500,this._destroy,this),e.on("diagram.clear",500,this._clear,this)},Nn.prototype._destroy=function(){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._rootElement,delete this._viewport},Nn.prototype._clear=function(){var t=this;this._elementRegistry.getAll().forEach((function(e){var n=Ie(e);"root"===n?t.setRootElement(null,!0):t._removeElement(e,n)})),delete this._cachedViewbox},Nn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Nn.prototype.getLayer=function(t,e){if(!t)throw new Error("must specify a name");var n=this._layers[t];if(n||(n=this._layers[t]=this._createLayer(t,e)),void 0!==e&&n.index!==e)throw new Error("layer <"+t+"> already created at index <"+e+">");return n.group},Nn.prototype._createLayer=function(t,e){e||(e=0);var n=T(this._layers,(function(t,n){return e>=n.index&&t++,t}),0);return{group:Sn(this._viewport,"layer-"+t,n),index:e}},Nn.prototype.getContainer=function(){return this._container},Nn.prototype._updateMarker=function(t,e,n){var i;t.id||(t=this._elementRegistry.get(t)),(i=this._elementRegistry._elements[t.id])&&(R([i.gfx,i.secondaryGfx],(function(t){t&&(n?Gt(t).add(e):Gt(t).remove(e))})),this._eventBus.fire("element.marker.update",{element:t,gfx:i.gfx,marker:e,add:!!n}))},Nn.prototype.addMarker=function(t,e){this._updateMarker(t,e,!0)},Nn.prototype.removeMarker=function(t,e){this._updateMarker(t,e,!1)},Nn.prototype.hasMarker=function(t,e){return t.id||(t=this._elementRegistry.get(t)),Gt(this.getGraphics(t)).has(e)},Nn.prototype.toggleMarker=function(t,e){this.hasMarker(t,e)?this.removeMarker(t,e):this.addMarker(t,e)},Nn.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},Nn.prototype.setRootElement=function(t,e){t&&this._ensureValid("root",t);var n=this._rootElement,i=this._elementRegistry,r=this._eventBus;if(n){if(!e)throw new Error("rootElement already set, need to specify override");r.fire("root.remove",{element:n}),r.fire("root.removed",{element:n}),i.remove(n)}if(t){var o=this.getDefaultLayer();r.fire("root.add",{element:t}),i.add(t,o,this._svg),r.fire("root.added",{element:t,gfx:o})}return this._rootElement=t,t},Nn.prototype._ensureValid=function(t,e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element with id "+e.id+" already exists");var n=Bn[t];if(!P(n,(function(t){return void 0!==e[t]})))throw new Error("must supply { "+n.join(", ")+" } with "+t)},Nn.prototype._setParent=function(t,e,n){Ae(e.children,t,n),t.parent=e},Nn.prototype._addElement=function(t,e,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(t,e),r.fire(t+".add",{element:e,parent:n}),this._setParent(e,n,i);var a=o.create(t,e,i);return this._elementRegistry.add(e,a),o.update(t,e,a),r.fire(t+".added",{element:e,gfx:a}),e},Nn.prototype.addShape=function(t,e,n){return this._addElement("shape",t,e,n)},Nn.prototype.addConnection=function(t,e,n){return this._addElement("connection",t,e,n)},Nn.prototype._removeElement=function(t,e){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(t=n.get(t.id||t))return r.fire(e+".remove",{element:t}),i.remove(t),Ne(t.parent&&t.parent.children,t),t.parent=null,r.fire(e+".removed",{element:t}),n.remove(t),t},Nn.prototype.removeShape=function(t){return this._removeElement(t,"shape")},Nn.prototype.removeConnection=function(t){return this._removeElement(t,"connection")},Nn.prototype.getGraphics=function(t,e){return this._elementRegistry.getGraphics(t,e)},Nn.prototype._changeViewbox=function(t){this._eventBus.fire("canvas.viewbox.changing"),t.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Nn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Nn.prototype.viewbox=function(t){if(void 0===t&&this._cachedViewbox)return this._cachedViewbox;var e,n,i,r,o,a,c=this._viewport,s=this.getSize();return t?(this._changeViewbox((function(){r=Math.min(s.width/t.width,s.height/t.height);var e=this._svg.createSVGMatrix().scale(r).translate(-t.x,-t.y);ie(c,e)})),t):(e=this.getDefaultLayer().getBBox(),n=(i=ie(c))?i.matrix:function(t,e,n,i,r,o){var a=Vt.createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Xt(a,t);case 6:return Xt(a,{a:t,b:e,c:n,d:i,e:r,f:o})}}(),r=_n(n.a,1e3),o=_n(-n.e||0,1e3),a=_n(-n.f||0,1e3),t=this._cachedViewbox={x:o?o/r:0,y:a?a/r:0,width:s.width/r,height:s.height/r,scale:r,inner:{width:e.width,height:e.height,x:e.x,y:e.y},outer:s})},Nn.prototype.scroll=function(t){var e=this._viewport,n=e.getCTM();return t&&this._changeViewbox((function(){t=$({dx:0,dy:0},t||{}),n=this._svg.createSVGMatrix().translate(t.dx,t.dy).multiply(n),An(e,n)})),{x:n.e,y:n.f}},Nn.prototype.scrollToElement=function(t,e){var n=100;e||(e={}),"number"==typeof e&&(n=e),e={top:e.top||n,right:e.right||n,bottom:e.bottom||n,left:e.left||n};var i,r,o=ke(t),a=xn(o),c=this.viewbox(),s=this.zoom();c.y+=e.top/s,c.x+=e.left/s,c.width-=(e.right+e.left)/s,c.height-=(e.bottom+e.top)/s;var u=xn(c);if(o.width<c.width&&o.height<c.height){var l=Math.max(0,a.right-u.right),f=Math.min(0,a.left-u.left),d=Math.max(0,a.bottom-u.bottom),p=Math.min(0,a.top-u.top);i=l||f,r=d||p}else i=o.x-c.x,r=o.y-c.y;this.scroll({dx:-i*s,dy:-r*s})},Nn.prototype.zoom=function(t,e){return t?"fit-viewport"===t?this._fitViewport(e):(this._changeViewbox((function(){"object"!=typeof e&&(n=this.viewbox().outer,e={x:n.width/2,y:n.height/2}),i=this._setZoom(t,e)})),_n(i.a,1e3)):this.viewbox(t).scale;var n,i},Nn.prototype._fitViewport=function(t){var e,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&&!t?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(e=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(t?o.width/2-r.width/e/2:0),y:o.y+(t?o.height/2-r.height/e/2:0),width:r.width/e,height:r.height/e}),this.viewbox(n),this.viewbox(!1).scale},Nn.prototype._setZoom=function(t,e){var n,i,r,o,a=this._svg,c=this._viewport,s=a.createSVGMatrix(),u=a.createSVGPoint(),l=(i=c.getCTM()).a;return e?(n=$(u,e).matrixTransform(i.inverse()),r=s.translate(n.x,n.y).scale(1/l*t).translate(-n.x,-n.y),o=i.multiply(r)):o=s.scale(t),An(this._viewport,o),o},Nn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Nn.prototype.getAbsoluteBBox=function(t){var e,n=this.viewbox();return{x:(e=t.waypoints?this.getGraphics(t).getBBox():t).x*n.scale-n.x*n.scale,y:e.y*n.scale-n.y*n.scale,width:e.width*n.scale,height:e.height*n.scale}},Nn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Dn="data-element-id";function Rn(t){this._elements={},this._eventBus=t}Rn.$inject=["eventBus"],Rn.prototype.add=function(t,e,n){var i=t.id;this._validateId(i),Ct(e,Dn,i),n&&Ct(n,Dn,i),this._elements[i]={element:t,gfx:e,secondaryGfx:n}},Rn.prototype.remove=function(t){var e=this._elements,n=t.id||t,i=n&&e[n];i&&(Ct(i.gfx,Dn,""),i.secondaryGfx&&Ct(i.secondaryGfx,Dn,""),delete e[n])},Rn.prototype.updateId=function(t,e){this._validateId(e),"string"==typeof t&&(t=this.get(t)),this._eventBus.fire("element.updateId",{element:t,newId:e});var n=this.getGraphics(t),i=this.getGraphics(t,!0);this.remove(t),t.id=e,this.add(t,n,i)},Rn.prototype.get=function(t){var e;e="string"==typeof t?t:t&&Ct(t,Dn);var n=this._elements[e];return n&&n.element},Rn.prototype.filter=function(t){var e=[];return this.forEach((function(n,i){t(n,i)&&e.push(n)})),e},Rn.prototype.find=function(t){for(var e=this._elements,n=Object.keys(e),i=0;i<n.length;i++){var r=e[n[i]],o=r.element;if(t(o,r.gfx))return o}},Rn.prototype.getAll=function(){return this.filter((function(t){return t}))},Rn.prototype.forEach=function(t){var e=this._elements;Object.keys(e).forEach((function(n){var i=e[n];return t(i.element,i.gfx)}))},Rn.prototype.getGraphics=function(t,e){var n=this._elements[t.id||t];return n&&(e?n.secondaryGfx:n.gfx)},Rn.prototype._validateId=function(t){if(!t)throw new Error("element must have an id");if(this._elements[t])throw new Error("element with id "+t+" already added")};var Cn={extend:function(t,e,n,i){var r=n.inverse;return Object.defineProperty(t,"remove",{value:function(t){var n=this.indexOf(t);return-1!==n&&(this.splice(n,1),e.unset(t,r,i)),t}}),Object.defineProperty(t,"contains",{value:function(t){return-1!==this.indexOf(t)}}),Object.defineProperty(t,"add",{value:function(t,n){var o=this.indexOf(t);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,t),-1===o&&e.set(t,r,i)}}),Object.defineProperty(t,"__refs_collection",{value:!0}),t},isExtended:function(t){return!0===t.__refs_collection}};function Tn(t,e,n){var i=Cn.extend(n[e.name]||[],t,e,n);Object.defineProperty(n,e.name,{enumerable:e.enumerable,value:i}),i.length&&i.forEach((function(i){t.set(i,e.inverse,n)}))}function Pn(t,e){if(!(this instanceof Pn))return new Pn(t,e);t.inverse=e,e.inverse=t,this.props={},this.props[t.name]=t,this.props[e.name]=e}Pn.prototype.bind=function(t,e){if("string"==typeof e){if(!this.props[e])throw new Error("no property <"+e+"> in ref");e=this.props[e]}e.collection?Tn(this,e,t):function(t,e,n){var i=e.inverse,r=n[e.name];Object.defineProperty(n,e.name,{configurable:e.configurable,enumerable:e.enumerable,get:function(){return r},set:function(e){if(e!==r){var o=r;r=null,o&&t.unset(o,i,n),t.set(r=e,i,n)}}})}(this,e,t)},Pn.prototype.ensureRefsCollection=function(t,e){var n=t[e.name];return Cn.isExtended(n)||Tn(this,e,t),n},Pn.prototype.ensureBound=function(t,e){(function(t,e){return Object.prototype.hasOwnProperty.call(t,e.name||e)})(t,e)||this.bind(t,e)},Pn.prototype.unset=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).remove(n):t[e.name]=void 0)},Pn.prototype.set=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).add(n):t[e.name]=n)};var zn=Pn;zn.Collection=Cn;var jn=new zn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Gn=new zn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Fn=new zn({name:"attachers",collection:!0},{name:"host"}),Ln=new zn({name:"outgoing",collection:!0},{name:"source"}),On=new zn({name:"incoming",collection:!0},{name:"target"});function Wn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(t){var e=this.label,n=this.labels;!t&&e?n.remove(e):n.add(t,0)}}),jn.bind(this,"parent"),Gn.bind(this,"labels"),Ln.bind(this,"outgoing"),On.bind(this,"incoming")}function Zn(){Wn.call(this),jn.bind(this,"children"),Fn.bind(this,"host"),Fn.bind(this,"attachers")}function Hn(){Zn.call(this)}function Yn(){Zn.call(this),Gn.bind(this,"labelTarget")}function Un(){Wn.call(this),Ln.bind(this,"source"),On.bind(this,"target")}p(Zn,Wn),p(Hn,Zn),p(Yn,Zn),p(Un,Wn);var Vn={connection:Un,shape:Zn,label:Yn,root:Hn};function Xn(){this._uid=12}Xn.prototype.createRoot=function(t){return this.create("root",t)},Xn.prototype.createLabel=function(t){return this.create("label",t)},Xn.prototype.createShape=function(t){return this.create("shape",t)},Xn.prototype.createConnection=function(t){return this.create("connection",t)},Xn.prototype.create=function(t,e){return(e=$({},e||{})).id||(e.id=t+"_"+this._uid++),function(t,e){var n=Vn[t];if(!n)throw new Error("unknown type: <"+t+">");return $(new n,e)}(t,e)};var Jn=Array.prototype.slice;function Qn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function qn(){}function Kn(t){return t.childNodes[0]}function $n(t,e,n,i,r){var o=Jt();o.setTranslate(e,n);var a=Jt();a.setRotate(i||0,0,0);var c=Jt();c.setScale(r||1,r||1),ie(t,[o,a,c])}function ti(t,e,n){var i=Jt();i.setTranslate(e,n),ie(t,i)}function ei(t,e){var n=Jt();n.setRotate(e,0,0),ie(t,n)}function ni(t,e){this._eventBus=t,this._elementRegistry=e}function ii(t,e,n){var i=n||e.firstChild;t!==i&&e.insertBefore(t,i)}Qn.prototype.on=function(t,e,n,i){if(t=E(t)?t:[t],_(e)&&(i=n,n=e,e=1e3),!I(e))throw new Error("priority must be a number");var r=n;i&&((r=q(n,i)).__fn=n.__fn||n);var o=this;t.forEach((function(t){o._addListener(t,{priority:e,callback:r,next:null})}))},Qn.prototype.once=function(t,e,n,i){var r=this;if(_(e)&&(i=n,n=e,e=1e3),!I(e))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var e=n.apply(i,arguments);return r.off(t,o),e}o.__fn=n,this.on(t,e,o)},Qn.prototype.off=function(t,e){t=E(t)?t:[t];var n=this;t.forEach((function(t){n._removeListener(t,e)}))},Qn.prototype.createEvent=function(t){var e=new qn;return e.init(t),e},Qn.prototype.fire=function(t,e){var n,i,r,o;if(o=Jn.call(arguments),"object"==typeof t&&(t=(e=t).type),!t)throw new Error("no event type specified");if(i=this._listeners[t]){n=e instanceof qn?e:this.createEvent(e),o[0]=n;var a=n.type;t!==a&&(n.type=t);try{r=this._invokeListeners(n,o,i)}finally{t!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},Qn.prototype.handleError=function(t){return!1===this.fire("error",{error:t})},Qn.prototype._destroy=function(){this._listeners={}},Qn.prototype._invokeListeners=function(t,e,n){for(var i;n&&!t.cancelBubble;)i=this._invokeListener(t,e,n),n=n.next;return i},Qn.prototype._invokeListener=function(t,e,n){var i;if(n.callback.__isTomb)return i;try{void 0!==(i=function(t,e){return t.apply(null,e)}(n.callback,e))&&(t.returnValue=i,t.stopPropagation()),!1===i&&t.preventDefault()}catch(t){if(!this.handleError(t))throw console.error("unhandled error in event listener"),console.error(t.stack),t}return i},Qn.prototype._addListener=function(t,e){var n,i=this._getListeners(t);if(i){for(;i;){if(i.priority<e.priority)return e.next=i,void(n?n.next=e:this._setListeners(t,e));n=i,i=i.next}n.next=e}else this._setListeners(t,e)},Qn.prototype._getListeners=function(t){return this._listeners[t]},Qn.prototype._setListeners=function(t,e){this._listeners[t]=e},Qn.prototype._removeListener=function(t,e){var n,i,r,o=this._getListeners(t);if(e)for(;o;)n=o.next,(r=o.callback)!==e&&r.__fn!==e||(i?i.next=n:this._setListeners(t,n)),i=o,o=n;else this._setListeners(t,null)},qn.prototype.stopPropagation=function(){this.cancelBubble=!0},qn.prototype.preventDefault=function(){this.defaultPrevented=!0},qn.prototype.init=function(t){$(this,t||{})},ni.$inject=["eventBus","elementRegistry"],ni.prototype._getChildrenContainer=function(t){var e,n=this._elementRegistry.getGraphics(t);return t.parent?(e=function(t){return t.parentNode.childNodes[1]}(n))||(Gt(e=Ut("g")).add("djs-children"),At(n.parentNode,e)):e=n,e},ni.prototype._clear=function(t){var e=Kn(t);return lt(e),e},ni.prototype._createContainer=function(t,e,n,i){var r=Ut("g");Gt(r).add("djs-group"),void 0!==n?ii(r,e,e.childNodes[n]):At(e,r);var o=Ut("g");Gt(o).add("djs-element"),Gt(o).add("djs-"+t),i&&Gt(o).add("djs-frame"),At(r,o);var a=Ut("g");return Gt(a).add("djs-visual"),At(o,a),o},ni.prototype.create=function(t,e,n){var i=this._getChildrenContainer(e.parent);return this._createContainer(t,i,n,_e(e))},ni.prototype.updateContainments=function(t){var e=this,n=this._elementRegistry;R(T(t,(function(t,e){return e.parent&&(t[e.parent.id]=e.parent),t}),{}),(function(t){var i=t.children;if(i){var r=e._getChildrenContainer(t);R(i.slice().reverse(),(function(t){ii(n.getGraphics(t).parentNode,r)}))}}))},ni.prototype.drawShape=function(t,e){return this._eventBus.fire("render.shape",{gfx:t,element:e})},ni.prototype.getShapePath=function(t){return this._eventBus.fire("render.getShapePath",t)},ni.prototype.drawConnection=function(t,e){return this._eventBus.fire("render.connection",{gfx:t,element:e})},ni.prototype.getConnectionPath=function(t){return this._eventBus.fire("render.getConnectionPath",t)},ni.prototype.update=function(t,e,n){if(e.parent){var i=this._clear(n);if("shape"===t)this.drawShape(i,e),ti(n,e.x,e.y);else{if("connection"!==t)throw new Error("unknown type: "+t);this.drawConnection(i,e)}Ct(n,"display",e.hidden?"none":"block")}},ni.prototype.remove=function(t){Lt(this._elementRegistry.getGraphics(t).parentNode)};const ri={__depends__:[Be],__init__:["canvas"],canvas:["type",Nn],elementRegistry:["type",Rn],elementFactory:["type",Xn],eventBus:["type",Qn],graphicsFactory:["type",ni]};function oi(t,e){this.injector=e=e||function(t){return function(t){var e=[],n=[];function i(t){return e.indexOf(t)>=0}t.forEach((function t(r){i(r)||((r.__depends__||[]).forEach(t),i(r)||(function(t){e.push(t)}(r),(r.__init__||[]).forEach((function(t){n.push(t)}))))}));var r=new pe(e);return n.forEach((function(t){try{r["string"==typeof t?"get":"invoke"](t)}catch(t){throw console.error("Failed to instantiate component"),console.error(t.stack),t}})),r}([{config:["value",t=t||{}]},ri].concat(t.modules||[]))}(t),this.get=e.get,this.invoke=e.invoke,this.get("eventBus").fire("diagram.init")}function ai(){}function ci(t,e){this.model=t,this.properties=e}oi.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},oi.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},ai.prototype.get=function(t){return this.$model.properties.get(this,t)},ai.prototype.set=function(t,e){this.$model.properties.set(this,t,e)},ci.prototype.createType=function(t){var e=this.model,n=this.properties,i=Object.create(ai.prototype);R(t.properties,(function(t){t.isMany||void 0===t.default||(i[t.name]=t.default)})),n.defineModel(i,e),n.defineDescriptor(i,t);var r=t.ns.name;function o(t){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),R(t,q((function(t,e){this.set(e,t)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,e),n.defineDescriptor(o,t),o};var si={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},ui={String:function(t){return t},Boolean:function(t){return"true"===t},Integer:function(t){return parseInt(t,10)},Real:function(t){return parseFloat(t)}};function li(t,e){var n=ui[t];return n?n(e):e}function fi(t){return!!si[t]}function di(t){return!!ui[t]}function pi(t,e){var n,i,r=t.split(/:/);if(1===r.length)n=t,i=e;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+t);n=r[1],i=r[0]}return{name:t=(i?i+":":"")+n,prefix:i,localName:n}}function mi(t){this.ns=t,this.name=t.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function hi(t,e){this.packageMap={},this.typeMap={},this.packages=[],this.properties=e,R(t,q(this.registerPackage,this))}function vi(t,e,n){var i=e[n];if(i in t)throw new Error("package with "+n+" <"+i+"> already defined")}function bi(t){this.model=t}function gi(t,e,n){Object.defineProperty(t,e.name,{enumerable:!e.isReference,writable:!0,value:n,configurable:!0})}function yi(t){this.properties=new bi(this),this.factory=new ci(this,this.properties),this.registry=new hi(t,this.properties),this.typeCache={}}mi.prototype.build=function(){return tt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},mi.prototype.addProperty=function(t,e,n){"boolean"==typeof e&&(n=e,e=void 0),this.addNamedProperty(t,!1!==n);var i=this.properties;void 0!==e?i.splice(e,0,t):i.push(t)},mi.prototype.replaceProperty=function(t,e,n){var i=t.ns,r=this.properties,o=this.propertiesByName,a=t.name!==e.name;if(t.isId){if(!e.isId)throw new Error("property <"+e.ns.name+"> must be id property to refine <"+t.ns.name+">");this.setIdProperty(e,!1)}if(t.isBody){if(!e.isBody)throw new Error("property <"+e.ns.name+"> must be body property to refine <"+t.ns.name+">");this.setBodyProperty(e,!1)}var c=r.indexOf(t);if(-1===c)throw new Error("property <"+i.name+"> not found in property list");r.splice(c,1),this.addProperty(e,n?void 0:c,a),o[i.name]=o[i.localName]=e},mi.prototype.redefineProperty=function(t,e,n){var i=t.ns.prefix,r=e.split("#"),o=pi(r[0],i),a=pi(r[1],o.prefix).name,c=this.propertiesByName[a];if(!c)throw new Error("refined property <"+a+"> not found");this.replaceProperty(c,t,n),delete t.redefines},mi.prototype.addNamedProperty=function(t,e){var n=t.ns,i=this.propertiesByName;e&&(this.assertNotDefined(t,n.name),this.assertNotDefined(t,n.localName)),i[n.name]=i[n.localName]=t},mi.prototype.removeNamedProperty=function(t){var e=t.ns,n=this.propertiesByName;delete n[e.name],delete n[e.localName]},mi.prototype.setBodyProperty=function(t,e){if(e&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+t.ns.name+">)");this.bodyProperty=t},mi.prototype.setIdProperty=function(t,e){if(e&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+t.ns.name+">)");this.idProperty=t},mi.prototype.assertNotDefined=function(t){var e=t.name,n=this.propertiesByName[e];if(n)throw new Error("property <"+e+"> already defined; override of <"+n.definedBy.ns.name+"#"+n.ns.name+"> by <"+t.definedBy.ns.name+"#"+t.ns.name+"> not allowed without redefines")},mi.prototype.hasProperty=function(t){return this.propertiesByName[t]},mi.prototype.addTrait=function(t,e){var n=this.allTypesByName,i=this.allTypes,r=t.name;r in n||(R(t.properties,q((function(n){n=$({},n,{name:n.ns.localName,inherited:e}),Object.defineProperty(n,"definedBy",{value:t});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(t),n[r]=t)},hi.prototype.getPackage=function(t){return this.packageMap[t]},hi.prototype.getPackages=function(){return this.packages},hi.prototype.registerPackage=function(t){t=$({},t);var e=this.packageMap;vi(e,t,"prefix"),vi(e,t,"uri"),R(t.types,q((function(e){this.registerType(e,t)}),this)),e[t.uri]=e[t.prefix]=t,this.packages.push(t)},hi.prototype.registerType=function(t,e){var n=pi((t=$({},t,{superClass:(t.superClass||[]).slice(),extends:(t.extends||[]).slice(),properties:(t.properties||[]).slice(),meta:$(t.meta||{})})).name,e.prefix),i=n.name,r={};R(t.properties,q((function(t){var e=pi(t.name,n.prefix),i=e.name;fi(t.type)||(t.type=pi(t.type,e.prefix).name),$(t,{ns:e,name:i}),r[i]=t}),this)),$(t,{ns:n,name:i,propertiesByName:r}),R(t.extends,q((function(t){var e=this.typeMap[t];e.traits=e.traits||[],e.traits.push(i)}),this)),this.definePackage(t,e),this.typeMap[i]=t},hi.prototype.mapTypes=function(t,e,n){var i=fi(t.name)?{name:t.name}:this.typeMap[t.name],r=this;function o(t){return a(t,!0)}function a(n,i){var o=pi(n,fi(n)?"":t.prefix);r.mapTypes(o,e,i)}if(!i)throw new Error("unknown type <"+t.name+">");R(i.superClass,n?o:a),e(i,!n),R(i.traits,o)},hi.prototype.getEffectiveDescriptor=function(t){var e=pi(t),n=new mi(e);this.mapTypes(e,(function(t,e){n.addTrait(t,e)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},hi.prototype.definePackage=function(t,e){this.properties.define(t,"$pkg",{value:e})},bi.prototype.set=function(t,e,n){var i=this.model.getPropertyDescriptor(t,e),r=i&&i.name;void 0===n?i?delete t[r]:delete t.$attrs[e]:i?r in t?t[r]=n:gi(t,i,n):t.$attrs[e]=n},bi.prototype.get=function(t,e){var n=this.model.getPropertyDescriptor(t,e);if(!n)return t.$attrs[e];var i=n.name;return!t[i]&&n.isMany&&gi(t,n,[]),t[i]},bi.prototype.define=function(t,e,n){Object.defineProperty(t,e,n)},bi.prototype.defineDescriptor=function(t,e){this.define(t,"$descriptor",{value:e})},bi.prototype.defineModel=function(t,e){this.define(t,"$model",{value:e})},yi.prototype.create=function(t,e){var n=this.getType(t);if(!n)throw new Error("unknown type <"+t+">");return new n(e)},yi.prototype.getType=function(t){var e=this.typeCache,n=M(t)?t:t.ns.name,i=e[n];return i||(t=this.registry.getEffectiveDescriptor(n),i=e[n]=this.factory.createType(t)),i},yi.prototype.createAny=function(t,e,n){var i=pi(t),r={$type:t,$instanceOf:function(t){return t===this.$type}};return this.properties.defineDescriptor(r,{name:t,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:e}}),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),R(n,(function(t,e){k(t)&&void 0!==t.value?r[t.name]=t.value:r[e]=t})),r},yi.prototype.getPackage=function(t){return this.registry.getPackage(t)},yi.prototype.getPackages=function(){return this.registry.getPackages()},yi.prototype.getElementDescriptor=function(t){return t.$descriptor},yi.prototype.hasType=function(t,e){return void 0===e&&(e=t,t=this),e in t.$model.getElementDescriptor(t).allTypesByName},yi.prototype.getPropertyDescriptor=function(t,e){return this.getElementDescriptor(t).propertiesByName[e]},yi.prototype.getTypeDescriptor=function(t){return this.registry.typeMap[t]};var xi=String.fromCharCode,wi=Object.prototype.hasOwnProperty,Ei=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ki={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Ii(t,e,n,i){return i?wi.call(ki,i)?ki[i]:"&"+i+";":xi(e||parseInt(n,16))}function _i(t){return t.length>3&&-1!==t.indexOf("&")?t.replace(Ei,Ii):t}function Mi(t){return new Error(t)}function Si(t){return"missing namespace for prefix <"+t+">"}function Bi(t){return{get:t,enumerable:!0}}function Ni(t){var e,n={};for(e in t)n[e]=t[e];return n}function Ai(t){return t+"$uri"}function Di(){return{line:0,column:0}}function Ri(t){throw t}function Ci(t){if(!this)return new Ci(t);var e,n,i,r,o,a,c,s,u,l=t&&t.proxy,f=Ri,d=Di,p=!1,m=!1,h=null,v=!1;function b(t){t instanceof Error||(t=Mi(t)),h=t,f(t,d)}function g(t){o&&(t instanceof Error||(t=Mi(t)),o(t,d))}this.on=function(t,u){if("function"!=typeof u)throw Mi("required args <name, cb>");switch(t){case"openTag":n=u;break;case"text":e=u;break;case"closeTag":i=u;break;case"error":f=u;break;case"warn":o=u;break;case"cdata":r=u;break;case"attention":s=u;break;case"question":c=u;break;case"comment":a=u;break;default:throw Mi("unsupported event: "+t)}return this},this.ns=function(t){if(void 0===t&&(t={}),"object"!=typeof t)throw Mi("required args <nsMap={}>");var e,n={};for(e in t)n[e]=t[e];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",m=!0,u=n,this},this.parse=function(t){if("string"!=typeof t)throw Mi("required args <xml=string>");return h=null,function(t){var o,f,h,y,x,w,E,k,I,_,M,S=m?[]:null,B=m?function(t){var e,n,i={};for(e in t)i[n=t[e]]=n,i[Ai(n)]=e;return i}(u):null,N=[],A=0,D=!1,R=!1,C=0,T=0,P="",z=0;function j(){if(null!==M)return M;var t,e,n,i,r,o,a,c,s,l,f,d=m&&B.xmlns,h=m&&p?[]:null,v=z,b=P,y=b.length,x={},w={};t:for(;v<y;v++)if(s=!1,!(32===(l=b.charCodeAt(v))||l<14&&l>8)){for((l<65||l>122||l>90&&l<97)&&95!==l&&58!==l&&(g("illegal first char attribute name"),s=!0),f=v+1;f<y;f++)if(!((l=b.charCodeAt(f))>96&&l<123||l>64&&l<91||l>47&&l<59||46===l||45===l||95===l)){if(32===l||l<14&&l>8){g("missing attribute value"),v=f;continue t}if(61===l)break;g("illegal attribute name char"),s=!0}if("xmlns:xmlns"===(c=b.substring(v,f))&&(g("illegal declaration of xmlns"),s=!0),34===(l=b.charCodeAt(f+1)))-1===(f=b.indexOf('"',v=f+2))&&-1!==(f=b.indexOf("'",v))&&(g("attribute value quote missmatch"),s=!0);else if(39===l)-1===(f=b.indexOf("'",v=f+2))&&-1!==(f=b.indexOf('"',v))&&(g("attribute value quote missmatch"),s=!0);else for(g("missing attribute value quotes"),s=!0,f+=1;f<y&&!(32===(l=b.charCodeAt(f+1))||l<14&&l>8);f++);for(-1===f&&(g("missing closing quotes"),f=y,s=!0),s||(o=b.substring(v,f)),v=f;f+1<y&&!(32===(l=b.charCodeAt(f+1))||l<14&&l>8);f++)v===f&&(g("illegal character after attribute end"),s=!0);if(v=f+1,!s)if(c in w)g("attribute <"+c+"> already defined");else if(w[c]=!0,m)if(p){if(null!==(r="xmlns"===c?"xmlns":120===c.charCodeAt(0)&&"xmlns:"===c.substr(0,6)?c.substr(6):null)){if(t=_i(o),e=Ai(r),!(a=u[t])){if("xmlns"===r||e in B&&B[e]!==t)do{a="ns"+A++}while(void 0!==B[a]);else a=r;u[t]=a}B[r]!==a&&(i||(B=Ni(B),i=!0),B[r]=a,"xmlns"===r&&(B[Ai(a)]=t,d=a),B[e]=t),x[c]=o;continue}h.push(c,o)}else-1!==(l=c.indexOf(":"))?(n=B[c.substring(0,l)])?("xsi:type"===(c=d===n?c.substr(l+1):n+c.substr(l))&&(-1!==(l=o.indexOf(":"))?(n=o.substring(0,l),o=(n=B[n]||n)+o.substring(l)):o=d+":"+o),x[c]=o):g(Si(c.substring(0,l))):x[c]=o;else x[c]=o}if(p)for(v=0,y=h.length;v<y;v++){if(c=h[v++],o=h[v],-1!==(l=c.indexOf(":"))){if(!(n=B[c.substring(0,l)])){g(Si(c.substring(0,l)));continue}"xsi:type"===(c=d===n?c.substr(l+1):n+c.substr(l))&&(-1!==(l=o.indexOf(":"))?(n=o.substring(0,l),o=(n=B[n]||n)+o.substring(l)):o=d+":"+o)}x[c]=o}return M=x}for(d=function(){for(var e,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,c=T;C>=a&&(e=i.exec(t))&&!((c=e[0].length+e.index)>C);)r+=1,a=c;return-1==C?(o=c,n=t.substring(T)):0===T?n=t.substring(T,C):(o=C-a,n=-1==T?t.substring(C):t.substring(C,T+1)),{data:n,line:r,column:o}},l&&(_=Object.create({},{name:Bi((function(){return k})),originalName:Bi((function(){return I})),attrs:Bi(j),ns:Bi((function(){return B}))}));-1!==T;){if(-1===(C=60===t.charCodeAt(T)?T:t.indexOf("<",T)))return N.length?b("unexpected end of file"):0===T?b("missing start tag"):void(T<t.length&&t.substring(T).trim()&&g("non-whitespace outside of root node"));if(T!==C)if(N.length){if(e&&(e(t.substring(T,C),_i,d),v))return}else if(t.substring(T,C).trim()&&(g("non-whitespace outside of root node"),v))return;if(33===(x=t.charCodeAt(C+1))){if(91===(y=t.charCodeAt(C+2))&&"CDATA["===t.substr(C+3,6)){if(-1===(T=t.indexOf("]]>",C)))return b("unclosed cdata");if(r&&(r(t.substring(C+9,T),d),v))return;T+=3;continue}if(45===y&&45===t.charCodeAt(C+3)){if(-1===(T=t.indexOf("--\x3e",C)))return b("unclosed comment");if(a&&(a(t.substring(C+4,T),_i,d),v))return;T+=3;continue}}if(63!==x){for(f=C+1;;f++){if(w=t.charCodeAt(f),isNaN(w))return T=-1,b("unclosed tag");if(34===w)f=-1!==(y=t.indexOf('"',f+1))?y:f;else if(39===w)f=-1!==(y=t.indexOf("'",f+1))?y:f;else if(62===w){T=f;break}}if(33!==x){if(M={},47===x){if(D=!1,R=!0,!N.length)return b("missing open tag");if(f=k=N.pop(),t.substring(C+2,y=C+2+f.length)!==f)return b("closing tag mismatch");for(;y<T;y++)if(!(32===(x=t.charCodeAt(y))||x>8&&x<14))return b("close tag")}else{if(47===t.charCodeAt(T-1)?(f=k=t.substring(C+1,T-1),D=!0,R=!0):(f=k=t.substring(C+1,T),D=!0,R=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return b("illegal first char nodeName");for(y=1,h=f.length;y<h;y++)if(!((x=f.charCodeAt(y))>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){k=f.substring(0,y),M=null;break}return b("invalid nodeName")}R||N.push(k)}if(m){if(o=B,D&&(R||S.push(o),null===M&&(p=-1!==f.indexOf("xmlns",y))&&(z=y,P=f,j(),p=!1)),I=k,-1!==(x=k.indexOf(":"))){if(!(E=B[k.substring(0,x)]))return b("missing namespace on <"+I+">");k=k.substr(x+1)}else E=B.xmlns;E&&(k=E+":"+k)}if(D&&(z=y,P=f,n&&(l?n(_,_i,R,d):n(k,j,_i,R,d),v)))return;if(R){if(i&&(i(l?_:k,_i,D,d),v))return;m&&(B=D?o:S.pop())}T+=1}else{if(s&&(s(t.substring(C,T+1),_i,d),v))return;T+=1}}else{if(-1===(T=t.indexOf("?>",C)))return b("unclosed question");if(c&&(c(t.substring(C,T+2),d),v))return;T+=2}}}(t),d=Di,v=!1,h},this.stop=function(){v=!0}}function Ti(t){return t.xml&&"lowerCase"===t.xml.tagAlias}Object.keys(ki).forEach((function(t){ki[t.toUpperCase()]=ki[t]}));var Pi={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"};function zi(t){return t.xml&&t.xml.serialize}function ji(t){return"xsi:type"===zi(t)}function Gi(t,e){return Ti(e)?t.prefix+":"+((n=t.localName).charAt(0).toUpperCase()+n.slice(1)):t.name;var n}function Fi(t){return new Error(t)}function Li(t){return t.$descriptor}function Oi(t){$(this,t),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Fi("expected element");var e,n=this.elementsById,i=Li(t).idProperty;if(i&&(e=t.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(e))throw new Error("illegal ID <"+e+">");if(n[e])throw Fi("duplicate ID <"+e+">");n[e]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Wi(){}function Zi(){}function Hi(){}function Yi(t,e){this.property=t,this.context=e}function Ui(t,e){this.element=e,this.propertyDesc=t}function Vi(){}function Xi(t,e,n){this.model=t,this.type=t.getType(e),this.context=n}function Ji(t,e,n){Xi.call(this,t,e,n)}function Qi(t,e,n){this.model=t,this.context=n}function qi(t){t instanceof yi&&(t={model:t}),$(this,{lax:!1},t)}Wi.prototype.handleEnd=function(){},Wi.prototype.handleText=function(){},Wi.prototype.handleNode=function(){},(Zi.prototype=Object.create(Wi.prototype)).handleNode=function(){return this},(Hi.prototype=Object.create(Wi.prototype)).handleText=function(t){this.body=(this.body||"")+t},(Yi.prototype=Object.create(Hi.prototype)).handleNode=function(t){if(this.element)throw Fi("expected no sub nodes");return this.element=this.createReference(t),this},Yi.prototype.handleEnd=function(){this.element.id=this.body},Yi.prototype.createReference=function(){return{property:this.property.ns.name,id:""}},(Ui.prototype=Object.create(Hi.prototype)).handleEnd=function(){var t=this.body||"",e=this.element,n=this.propertyDesc;t=li(n.type,t),n.isMany?e.get(n.name).push(t):e.set(n.name,t)},(Vi.prototype=Object.create(Hi.prototype)).handleNode=function(t){var e=this,n=this.element;return n?e=this.handleChild(t):(n=this.element=this.createElement(t),this.context.addElement(n)),e},(Xi.prototype=Object.create(Vi.prototype)).addReference=function(t){this.context.addReference(t)},Xi.prototype.handleText=function(t){if(!Li(this.element).bodyProperty)throw Fi("unexpected body text <"+t+">");Hi.prototype.handleText.call(this,t)},Xi.prototype.handleEnd=function(){var t=this.body,e=this.element,n=Li(e).bodyProperty;n&&void 0!==t&&(t=li(n.type,t),e.set(n.name,t))},Xi.prototype.createElement=function(t){var e,n=t.attributes,i=this.type,r=Li(i),o=this.context,a=new i({}),c=this.model;return R(n,(function(t,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?R(t.split(" "),(function(t){o.addReference({element:a,property:i.ns.name,id:t})})):o.addReference({element:a,property:i.ns.name,id:t}):(i?t=li(i.type,t):"xmlns"!==n&&(e=pi(n,r.ns.prefix),c.getPackage(e.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:t})),a.set(n,t))})),a},Xi.prototype.getPropertyForNode=function(t){var e,n,i=pi(t.name),r=this.model,o=Li(this.type),a=o.propertiesByName[i.name];if(a&&!a.isAttr)return ji(a)&&(e=t.attributes["xsi:type"])?(e=function(t,e){var n=pi(t);return function(t,e){var n=t.name,i=t.localName,r=e.xml&&e.xml.typePrefix;return r&&0===i.indexOf(r)?t.prefix+":"+i.slice(r.length):n}(n,e.getPackage(n.prefix))}(e,r),$({},a,{effectiveType:Li(n=r.getType(e)).name})):a;var c=r.getPackage(i.prefix);if(c){if(e=Gi(i,c),n=r.getType(e),a=N(o.properties,(function(t){return!t.isVirtual&&!t.isReference&&!t.isAttribute&&n.hasType(t.type)})))return $({},a,{effectiveType:Li(n).name})}else if(a=N(o.properties,(function(t){return!t.isReference&&!t.isAttribute&&"Element"===t.type})))return a;throw Fi("unrecognized element <"+i.name+">")},Xi.prototype.toString=function(){return"ElementDescriptor["+Li(this.type).name+"]"},Xi.prototype.valueHandler=function(t,e){return new Ui(t,e)},Xi.prototype.referenceHandler=function(t){return new Yi(t,this.context)},Xi.prototype.handler=function(t){return"Element"===t?new Qi(this.model,t,this.context):new Xi(this.model,t,this.context)},Xi.prototype.handleChild=function(t){var e,n,i,r;if(e=this.getPropertyForNode(t),i=this.element,di(n=e.effectiveType||e.type))return this.valueHandler(e,i);var o=(r=e.isReference?this.referenceHandler(e).handleNode(t):this.handler(n).handleNode(t)).element;return void 0!==o&&(e.isMany?i.get(e.name).push(o):i.set(e.name,o),e.isReference?($(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},(Ji.prototype=Object.create(Xi.prototype)).createElement=function(t){var e=t.name,n=pi(e),i=this.type,r=this.model.getPackage(n.prefix),o=r&&Gi(n,r)||e;if(!i.hasType(o))throw Fi("unexpected element <"+t.originalName+">");return Xi.prototype.createElement.call(this,t)},(Qi.prototype=Object.create(Vi.prototype)).createElement=function(t){var e=t.name,n=pi(e);return this.model.createAny(e,t.ns[n.prefix+"$uri"],t.attributes)},Qi.prototype.handleChild=function(t){var e=new Qi(this.model,"Element",this.context).handleNode(t),n=this.element,i=e.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),e},Qi.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},qi.prototype.fromXML=function(t,e){var n=e.rootHandler;e instanceof Xi?(n=e,e={}):"string"==typeof e?(n=this.handler(e),e={}):"string"==typeof n&&(n=this.handler(n));var i=this.model,r=this.lax,o=new Oi($({},e,{rootHandler:n})),a=new Ci({proxy:!0}),c=function(){var t=[];return Object.defineProperty(t,"peek",{value:function(){return this[this.length-1]}}),t}();function s(t,e,n){var i=e(),r=i.line,a=i.column,c=i.data;"<"===c.charAt(0)&&-1!==c.indexOf(" ")&&(c=c.slice(0,c.indexOf(" "))+">");var s="unparsable content "+(c?c+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+a+"\n\tnested error: "+t.message;if(n)return o.addWarning({message:s,error:t}),!0;throw Fi(s)}function u(t,e){return s(t,e,!0)}n.context=o,c.push(n);var l=/^<\?xml /i,f=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function p(t,e){try{c.peek().handleText(t)}catch(t){u(t,e)}}var m=i.getPackages().reduce((function(t,e){return t[e.uri]=e.prefix,t}),{"http://www.w3.org/XML/1998/namespace":"xml"});return a.ns(m).on("openTag",(function(t,e,n,i){var o=t.attrs||{},a=Object.keys(o).reduce((function(t,n){var i=e(o[n]);return t[n]=i,t}),{});!function(t,e){var n=c.peek();try{c.push(n.handleNode(t))}catch(t){s(t,e,r)&&c.push(new Zi)}}({name:t.name,originalName:t.originalName,attributes:a,ns:t.ns},i)})).on("question",(function(t){if(l.test(t)){var e=f.exec(t),n=e&&e[1];n&&!d.test(n)&&o.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){c.pop().handleEnd()})).on("cdata",p).on("text",(function(t,e,n){!function(t,e){t.trim()&&p(t,e)}(e(t),n)})).on("error",s).on("warn",u),new Promise((function(e,i){var r;try{a.parse(t),function(){var t,e,n=o.elementsById,i=o.references;for(t=0;e=i[t];t++){var r=e.element,a=n[e.id],c=Li(r).propertiesByName[e.property];if(a||o.addWarning({message:"unresolved reference <"+e.id+">",element:e.element,property:e.property,value:e.id}),c.isMany){var s=r.get(c.name),u=s.indexOf(e);-1===u&&(u=s.length),a?s[u]=a:s.splice(u,1)}else r.set(c.name,a)}}()}catch(t){r=t}var c=n.element;r||c||(r=Fi("failed to parse document as <"+n.type.$descriptor.name+">"));var s=o.warnings,u=o.references,l=o.elementsById;return r?(r.warnings=s,i(r)):e({rootElement:c,elementsById:l,references:u,warnings:s})}))},qi.prototype.handler=function(t){return new Ji(this.model,t)};var Ki=/<|>|'|"|&|\n\r|\n/g,$i=/<|>|&/g;function tr(t){var e={},n={},i={},r=[],o=[];this.byUri=function(e){return n[e]||t&&t.byUri(e)},this.add=function(t,e){n[t.uri]=t,e?r.push(t):o.push(t),this.mapPrefix(t.prefix,t.uri)},this.uriByPrefix=function(t){return e[t||"xmlns"]},this.mapPrefix=function(t,n){e[t||"xmlns"]=n},this.getNSKey=function(t){return void 0!==t.prefix?t.uri+"|"+t.prefix:t.uri},this.logUsed=function(e){var n=e.uri,r=this.getNSKey(e);i[r]=this.byUri(n),t&&t.logUsed(e)},this.getUsed=function(){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function er(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}function nr(t){return M(t)?t:(t.prefix?t.prefix+":":"")+t.localName}var ir={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},rr={"<":"lt",">":"gt","&":"amp"};function or(t,e,n){return(t=M(t)?t:""+t).replace(e,(function(t){return"&"+n[t]+";"}))}function ar(t){this.tagName=t}function cr(){}function sr(t){this.tagName=t}function ur(t,e){this.body=[],this.attrs=[],this.parent=t,this.propertyDescriptor=e}function lr(t,e){ur.call(this,t,e)}function fr(){this.value="",this.write=function(t){this.value+=t}}function dr(t,e){var n=[""];this.append=function(e){return t.write(e),this},this.appendNewLine=function(){return e&&t.write("\n"),this},this.appendIndent=function(){return e&&t.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function pr(t){return t=$({format:!1,preamble:!0},t||{}),{toXML:function(e,n){var i=n||new fr,r=new dr(i,t.format);if(t.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new ur).build(e).serializeTo(r),!n)return i.value}}}function mr(t,e){yi.call(this,t,e)}ar.prototype.build=function(t){return this.element=t,this},ar.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},cr.prototype.serializeValue=cr.prototype.serializeTo=function(t){t.append(this.escape?or(this.value,$i,rr):this.value)},cr.prototype.build=function(t,e){return this.value=e,"String"===t.type&&-1!==e.search($i)&&(this.escape=!0),this},er(sr,cr),sr.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"),this.serializeValue(t),t.append("</"+this.tagName+">").appendNewLine()},ur.prototype.build=function(t){this.element=t;var e,n,i=t.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return e=o?this.parseGeneric(t):this.parseNsAttributes(t),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(t){return D(t.$descriptor.properties,(function(e){var n=e.name;if(e.isVirtual)return!1;if(!B(t,n))return!1;var i=t[n];return i!==e.default&&null!==i&&(!e.isMany||i.length)}))}(t),this.parseAttributes(D(n,(function(t){return t.isAttr}))),this.parseContainments(D(n,(function(t){return!t.isAttr})))),this.parseGenericAttributes(t,e),this},ur.prototype.nsTagName=function(t){return function(t,e){return $(e.isGeneric?{localName:e.ns.localName}:{localName:(n=e.ns.localName,i=e.$pkg,Ti(i)?(r=n).charAt(0).toLowerCase()+r.slice(1):n)},t);var n,i,r}(this.logNamespaceUsed(t.ns),t)},ur.prototype.nsPropertyTagName=function(t){return function(t,e){return $({localName:e.ns.localName},t)}(this.logNamespaceUsed(t.ns),t)},ur.prototype.isLocalNs=function(t){return t.uri===this.ns.uri},ur.prototype.nsAttributeName=function(t){var e;if(e=M(t)?pi(t):t.ns,t.inherited)return{localName:e.localName};var n=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:e.localName}:$({localName:e.localName},n)},ur.prototype.parseGeneric=function(t){var e=this,n=this.body,i=[];return R(t,(function(r,o){"$body"===o?n.push((new cr).build({type:"String"},r)):"$children"===o?R(r,(function(t){n.push(new ur(e).build(t))})):0!==o.indexOf("$")&&e.parseNsAttribute(t,o,r)&&i.push({name:o,value:r})})),i},ur.prototype.parseNsAttribute=function(t,e,n){var i,r=t.$model,o=pi(e);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:e,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},ur.prototype.parseNsAttributes=function(t){var e=this,n=[];return R(t.$attrs,(function(i,r){var o=e.parseNsAttribute(t,r,i);o&&n.push(o)})),n},ur.prototype.parseGenericAttributes=function(t,e){var n=this;R(e,(function(e){if("xsi:type"!==e.name)try{n.addAttribute(n.nsAttributeName(e.name),e.value)}catch(n){console.warn("missing namespace information for ",e.name,"=",e.value,"on",t,n)}}))},ur.prototype.parseContainments=function(t){var e=this,n=this.body,i=this.element;R(t,(function(t){var r=i.get(t.name),o=t.isReference;if(t.isMany||(r=[r]),t.isBody)n.push((new cr).build(t,r[0]));else if(di(t.type))R(r,(function(i){n.push(new sr(e.addTagName(e.nsPropertyTagName(t))).build(t,i))}));else if(o)R(r,(function(i){n.push(new ar(e.addTagName(e.nsPropertyTagName(t))).build(i))}));else{var a=ji(t),c=function(t){return"property"===zi(t)}(t);R(r,(function(i){var r;r=a?new lr(e,t):c?new ur(e,t):new ur(e),n.push(r.build(i))}))}}))},ur.prototype.getNamespaces=function(t){var e,n=this.namespaces,i=this.parent;return n||(e=i&&i.getNamespaces(),t||!e?this.namespaces=n=new tr(e):n=e),n},ur.prototype.logNamespace=function(t,e,n){var i=this.getNamespaces(n),r=t.uri,o=t.prefix;return i.byUri(r)&&!n||i.add(t,e),i.mapPrefix(o,r),t},ur.prototype.logNamespaceUsed=function(t,e){var n,i,r,o=this.element.$model,a=this.getNamespaces(e),c=t.prefix,s=t.uri;if(!c&&!s)return{localName:t.localName};if(r=Pi[c]||o&&(o.getPackage(c)||{}).uri,!(s=s||r||a.uriByPrefix(c)))throw new Error("no namespace uri given for prefix <"+c+">");if(!(t=a.byUri(s))){for(n=c,i=1;a.uriByPrefix(n);)n=c+"_"+i++;t=this.logNamespace({prefix:n,uri:s},r===s)}return c&&a.mapPrefix(c,s),t},ur.prototype.parseAttributes=function(t){var e=this,n=this.element;R(t,(function(t){var i=n.get(t.name);if(t.isReference)if(t.isMany){var r=[];R(i,(function(t){r.push(t.id)})),i=r.join(" ")}else i=i.id;e.addAttribute(e.nsAttributeName(t),i)}))},ur.prototype.addTagName=function(t){var e=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(e),nr(t)},ur.prototype.addAttribute=function(t,e){var n=this.attrs;M(e)&&(e=or(e,Ki,ir)),n.push({name:t,value:e})},ur.prototype.serializeAttributes=function(t){var e=this.attrs,n=this.namespaces;n&&(e=function(t){return t.getUsed().filter((function(t){return"xml"!==t.prefix})).map((function(t){return{name:"xmlns"+(t.prefix?":"+t.prefix:""),value:t.uri}}))}(n).concat(e)),R(e,(function(e){t.append(" ").append(nr(e.name)).append('="').append(e.value).append('"')}))},ur.prototype.serializeTo=function(t){var e=this.body[0],n=e&&e.constructor!==cr;t.appendIndent().append("<"+this.tagName),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),R(this.body,(function(e){e.serializeTo(t)})),n&&t.unindent().appendIndent(),t.append("</"+this.tagName+">")),t.appendNewLine()},er(lr,ur),lr.prototype.parseNsAttributes=function(t){var e=ur.prototype.parseNsAttributes.call(this,t),n=t.$descriptor;if(n.name===this.propertyDescriptor.type)return e;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=t.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName("xsi:type"),(i.prefix?i.prefix+":":"")+o+n.ns.localName),e},lr.prototype.isLocalNs=function(t){return t.uri===(this.typeNs||this.ns).uri},(mr.prototype=Object.create(yi.prototype)).fromXML=function(t,e,n){M(e)||(n=e,e="bpmn:Definitions");var i=new qi($({model:this,lax:!0},n)),r=i.handler(e);return i.fromXML(t,r)},mr.prototype.toXML=function(t,e){var n=new pr(e);return new Promise((function(e,i){try{return e({xml:n.toXML(t)})}catch(t){return i(t)}}))};var hr={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 vr(t,e){return new mr($({},hr,t),e)}function br(t){return t?"<"+t.$type+(t.id?' id="'+t.id:"")+'" />':"<null>"}var gr=new zn({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function yr(t,e){return t.$instanceOf(e)}function xr(t,e){var n={},i=[];function r(t,e){return function(n){t(n,e)}}function o(t){n[t.id]=t}function a(n,i){try{var r=n.di&&function(n,i){if(n.gfx)throw new Error(e("already rendered {element}",{element:br(n)}));return t.element(n,i)}(n,i);return o(n),r}catch(t){c(t.message,{element:n,error:t}),console.error(e("failed to import {element}",{element:br(n)})),console.error(t)}}function c(e,n){t.error(e,n)}function s(t){var n=t.bpmnElement;n?n.di?c(e("multiple DI elements defined for {element}",{element:br(n)}),{element:n}):(gr.bind(n,"di"),n.di=t):c(e("no bpmnElement referenced in {element}",{element:br(t)}),{element:t})}function u(t){s(t)}function l(){for(;i.length;)i.shift()()}function f(t,e){k(t,e),g(t.ioSpecification,e),b(t.artifacts,e),o(t)}function d(t,e){a(t,e)}function p(t,e){a(t,e)}function m(t,e){a(t,e)}function h(t,e){a(t,e)}function v(t,e){a(t,e)}function b(t,e){R(t,(function(t){yr(t,"bpmn:Association")?i.push((function(){v(t,e)})):v(t,e)}))}function g(t,e){t&&(R(t.dataInputs,r(m,e)),R(t.dataOutputs,r(h,e)))}function y(t,e){k(t,e),b(t.artifacts,e)}function x(t,e){var n=a(t,e);yr(t,"bpmn:SubProcess")&&y(t,n||e),yr(t,"bpmn:Activity")&&g(t.ioSpecification,e),i.push((function(){R(t.dataInputAssociations,r(p,e)),R(t.dataOutputAssociations,r(p,e))}))}function w(t,e){i.push((function(){var n=a(t,e);t.childLaneSet&&E(t.childLaneSet,n||e),function(t){R(t.flowNodeRef,(function(e){var n=e.get("lanes");n&&n.push(t)}))}(t)}))}function E(t,e){R(t.lanes,r(w,e))}function k(t,n){!function(t,n){R(t,(function(t){yr(t,"bpmn:SequenceFlow")?i.push((function(){!function(t,e){a(t,e)}(t,n)})):yr(t,"bpmn:BoundaryEvent")?i.unshift((function(){x(t,n)})):yr(t,"bpmn:FlowNode")?x(t,n):yr(t,"bpmn:DataObject")||(yr(t,"bpmn:DataStoreReference")||yr(t,"bpmn:DataObjectReference")?function(t,e){a(t,e)}(t,n):c(e("unrecognized flowElement {element} in context {context}",{element:br(t),context:n?br(n.businessObject):"null"}),{element:t,context:n}))}))}(t.flowElements,n),t.laneSets&&function(t,e){R(t,r(E,e))}(t.laneSets,n)}function I(t,e){var n=a(t,e),i=t.processRef;i&&f(i,n||e)}return{handleDeferred:l,handleDefinitions:function(o,a){var p=o.diagrams;if(a&&-1===p.indexOf(a))throw new Error(e("diagram not part of bpmn:Definitions"));if(!a&&p&&p.length&&(a=p[0]),!a)throw new Error(e("no diagram to display"));!function(t){var e;s(e=t.plane),R(e.planeElement,u)}(a);var m=a.plane;if(!m)throw new Error(e("no plane for {element}",{element:br(a)}));var h=m.bpmnElement;if(!h){if(!(h=function(t){return N(t.rootElements,(function(t){return yr(t,"bpmn:Process")||yr(t,"bpmn:Collaboration")}))}(o)))throw new Error(e("no process or collaboration to display"));c(e("correcting missing bpmnElement on {plane} to {rootElement}",{plane:br(m),rootElement:br(h)})),m.bpmnElement=h,s(m)}var v,g=function(e,n){return t.root(e,n)}(h,m);if(yr(h,"bpmn:Process"))f(h,g);else{if(!yr(h,"bpmn:Collaboration"))throw new Error(e("unsupported bpmnElement for {plane}: {rootElement}",{plane:br(m),rootElement:br(h)}));R((v=h).participants,r(I)),b(v.artifacts),i.push((function(){R(v.messageFlows,r(d,undefined))})),function(t,e){D(t,(function(t){return!n[t.id]&&yr(t,"bpmn:Process")&&t.laneSets})).forEach(r(f,e))}(o.rootElements,g)}l()},handleSubProcess:y,registerDi:s}}function wr(t){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var e=arguments.length;if(!(e>=1&&_(arguments[e-1])))return t.apply(this,arguments);var n=arguments[e-1];console.warn(new Error("Passing callbacks to "+t.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);t.apply(this,i).then((function(t){var e=Object.keys(t)[0];return n(null,t[e])}),(function(t){return n(t,t.warnings)}))}}var Er='<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 kr(t){return t.join(";")}var Ir,_r=kr(["color: #404040"]),Mr='<div class="bjs-powered-by-lightbox" style="'+kr(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+kr(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+kr(["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;'+_r+'">'+Er+'</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 Sr(t){var e,n;t=$({},Nr,t),this._moddle=this._createModdle(t),this._container=this._createContainer(t),e=this._container,n=kt('<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; '+_r+'">'+Er+"</a>"),e.appendChild(n),yt.bind(n,"click",(function(t){Ir||(Ir=kt(Mr),wt(Ir,".backdrop","click",(function(){document.body.removeChild(Ir)}))),document.body.appendChild(Ir),t.preventDefault()})),this._init(this._container,this._moddle,t)}function Br(t,e){return t.warnings=e,t}p(Sr,oi),Sr.prototype.importXML=wr((function(t,e){var n=this;return new Promise((function(i,r){t=n._emit("import.parse.start",{xml:t})||t,n._moddle.fromXML(t,"bpmn:Definitions").then((function(t){var o,a,c=t.rootElement,s=t.warnings;c=n._emit("import.parse.complete",(o={error:null,definitions:c,elementsById:t.elementsById,references:t.references,warnings:s},a=n.get("eventBus").createEvent(o),Object.defineProperty(a,"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:o.warnings,references:o.references,elementsById:o.elementsById}}}),a))||c,n.importDefinitions(c,e).then((function(t){var e=[].concat(s,t.warnings||[]);return n._emit("import.done",{error:null,warnings:e}),i({warnings:e})})).catch((function(t){var e=[].concat(s,t.warnings||[]);return n._emit("import.done",{error:t,warnings:e}),r(Br(t,e))}))})).catch((function(t){return n._emit("import.parse.complete",{error:t}),t=function(t){var e=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(t.message);return e&&(t.message="unparsable content <"+e[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+e[2]),t}(t),n._emit("import.done",{error:t,warnings:t.warnings}),r(t)}))}))})),Sr.prototype.importDefinitions=wr((function(t,e){var n=this;return new Promise((function(i,r){n._setDefinitions(t),n.open(e).then((function(t){return i({warnings:t.warnings})})).catch((function(t){return r(t)}))}))})),Sr.prototype.open=wr((function(t){var e=this._definitions,n=t,i=this;return new Promise((function(r,o){if(!e){var a=new Error("no XML imported");return o(Br(a,[]))}if("string"==typeof t&&!(n=function(t,e){return e&&N(t.diagrams,(function(t){return t.id===e}))||null}(e,t))){var c=new Error("BPMNDiagram <"+t+"> not found");return o(Br(c,[]))}try{i.clear()}catch(t){return o(Br(t,[]))}(function(t,e,n){var i,r,o,a=[];return new Promise((function(c,s){try{return i=t.get("bpmnImporter"),r=t.get("eventBus"),o=t.get("translate"),r.fire("import.render.start",{definitions:e}),function(t,e){new xr({root:function(t){return i.add(t)},element:function(t,e){return i.add(t,e)},error:function(t,e){a.push({message:t,context:e})}},o).handleDefinitions(t,e)}(e,n),r.fire("import.render.complete",{error:void 0,warnings:a}),c({warnings:a})}catch(t){return t.warnings=a,s(t)}}))})(i,e,n).then((function(t){return r({warnings:t.warnings})})).catch((function(t){return o(t)}))}))})),Sr.prototype.saveXML=wr((function(t){t=t||{};var e=this,n=this._definitions;return new Promise((function(i){if(!n)return i({error:new Error("no definitions loaded")});n=e._emit("saveXML.start",{definitions:n})||n,e._moddle.toXML(n,t).then((function(t){var n=t.xml;return n=e._emit("saveXML.serialized",{xml:n})||n,i({xml:n})}))})).catch((function(t){return{error:t}})).then((function(t){e._emit("saveXML.done",t);var n=t.error;return n?Promise.reject(n):t}))})),Sr.prototype.saveSVG=wr((function(){var t=this;return new Promise((function(e,n){var i,r;t._emit("saveSVG.start");try{var o=t.get("canvas"),a=o.getDefaultLayer(),c=Mt("defs",o._svg),s=ee(a),u=c?"<defs>"+ee(c)+"</defs>":"",l=a.getBBox();i='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+l.width+'" height="'+l.height+'" viewBox="'+l.x+" "+l.y+" "+l.width+" "+l.height+'" version="1.1">'+u+s+"</svg>"}catch(t){r=t}return t._emit("saveSVG.done",{error:r,svg:i}),r?n(r):e({svg:i})}))})),Sr.prototype._setDefinitions=function(t){this._definitions=t},Sr.prototype.getModules=function(){return this._modules},Sr.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach((function(t){var e=t.businessObject;e&&e.di&&delete e.di})),oi.prototype.clear.call(this))},Sr.prototype.destroy=function(){oi.prototype.destroy.call(this),Bt(this._container)},Sr.prototype.on=function(t,e,n,i){return this.get("eventBus").on(t,e,n,i)},Sr.prototype.off=function(t,e){this.get("eventBus").off(t,e)},Sr.prototype.attachTo=function(t){if(!t)throw new Error("parentNode required");this.detach(),t.get&&t.constructor.prototype.jquery&&(t=t.get(0)),"string"==typeof t&&(t=Mt(t)),t.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Sr.prototype.getDefinitions=function(){return this._definitions},Sr.prototype.detach=function(){var t=this._container,e=t.parentNode;e&&(this._emit("detach",{}),e.removeChild(t))},Sr.prototype._init=function(t,e,n){var i=n.modules||this.getModules(),r=[].concat([{bpmnjs:["value",this],moddle:["value",e]}],i,n.additionalModules||[]),o=$(et(n,["additionalModules"]),{canvas:$({},n.canvas,{container:t}),modules:r});oi.call(this,o),n&&n.container&&this.attachTo(n.container)},Sr.prototype._emit=function(t,e){return this.get("eventBus").fire(t,e)},Sr.prototype._createContainer=function(t){var e=kt('<div class="bjs-container"></div>');return $(e.style,{width:Ar(t.width),height:Ar(t.height),position:t.position}),e},Sr.prototype._createModdle=function(t){return new vr($({},this._moddleExtensions,t.moddleExtensions))},Sr.prototype._modules=[];var Nr={width:"100%",height:"100%",position:"relative"};function Ar(t){return t+(I(t)?"px":"")}function Dr(t){Sr.call(this,t),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)}function Rr(t,e){var n=Cr(t);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(e)}function Cr(t){return t&&t.businessObject||t}p(Dr,Sr),Dr.prototype._createModdle=function(t){var e=Sr.prototype._createModdle.call(this,t);return e.ids=new h([32,36,1]),e},Dr.prototype._collectIds=function(t,e){var n,i=t.$model.ids;for(n in i.clear(),e)i.claim(n,e[n])};const Tr=Object.freeze({__proto__:null,is:Rr,getBusinessObject:Cr});function Pr(t){return!Rr(t,"bpmn:CallActivity")&&(Rr(t,"bpmn:SubProcess")?Cr(t).di&&!!Cr(t).di.isExpanded:!Rr(t,"bpmn:Participant")||!!Cr(t).processRef)}function zr(t){return t&&!!Cr(t).triggeredByEvent}function jr(t,e){var n=Cr(t),i=!1;return n.eventDefinitions&&R(n.eventDefinitions,(function(t){Rr(t,e)&&(i=!0)})),i}function Gr(t){return Rr(t,"bpmn:FlowElement")||Rr(t,"bpmn:Participant")||Rr(t,"bpmn:Lane")||Rr(t,"bpmn:SequenceFlow")||Rr(t,"bpmn:MessageFlow")||Rr(t,"bpmn:DataInput")||Rr(t,"bpmn:DataOutput")?"name":Rr(t,"bpmn:TextAnnotation")?"text":Rr(t,"bpmn:Group")?"categoryValueRef":void 0}function Fr(t){var e=t.businessObject,n=Gr(e);if(n)return"categoryValueRef"===n?function(t){var e=t.categoryValueRef;return e&&e.value||""}(e):e[n]||""}function Lr(t,e,n){return z(t.eventDefinitions,(function(i){return i.$type===e&&function(t,e){return P(e,(function(e,n){return t[n]==e}))}(t,n)}))}function Or(t){return t.businessObject.di}function Wr(t){return t.businessObject}function Zr(t,e){var n=Or(t);return n.get("color:background-color")||n.get("bioc:fill")||e||"white"}function Hr(t,e){var n=Or(t);return n.get("color:border-color")||n.get("bioc:stroke")||e||"black"}function Yr(t,e,n){var i=Or(t).get("label");return i&&i.get("color:color")||e||Hr(t,n)}var Ur=new h;function Vr(t,e,n,i,r,o,a){me.call(this,e,a);var c=t&&t.defaultFillColor,s=t&&t.defaultStrokeColor,u=t&&t.defaultLabelColor,l=Ur.next(),f={},d=n.computeStyle;function p(t,e){var n=$({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},e.attrs),i=e.ref||{x:0,y:0},o=e.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=Ut("marker");Ct(e.element,n),At(a,e.element),Ct(a,{id:t,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*o,markerHeight:20*o,orient:"auto"});var c=Mt("defs",r._svg);c||(c=Ut("defs"),At(r._svg,c)),At(c,a),f[t]=a}function m(t){return t.replace(/[^0-9a-zA-z]+/g,"_")}function h(t,e,n){var i=t+"-"+m(e)+"-"+m(n)+"-"+l;return f[i]||function(t,e,n,i){if("sequenceflow-end"===e){var r=Ut("path");Ct(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),p(t,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===e){var o=Ut("circle");Ct(o,{cx:6,cy:6,r:3.5}),p(t,{element:o,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===e){var a=Ut("path");Ct(a,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),p(t,{element:a,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===e){var c=Ut("path");Ct(c,{d:"M 11 5 L 1 10 L 11 15"}),p(t,{element:c,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===e){var s=Ut("path");Ct(s,{d:"M 1 5 L 11 10 L 1 15"}),p(t,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===e){var u=Ut("path");Ct(u,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),p(t,{element:u,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===e){var l=Ut("path");Ct(l,{d:"M 6 4 L 10 16"}),p(t,{element:l,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(i,t,e,n),"url(#"+i+")"}function v(t,e,n,i,r){k(i)&&(r=i,i=0),i=i||0,"none"===(r=d(r,{stroke:"black",strokeWidth:2,fill:"white"})).fill&&delete r.fillOpacity;var o=e/2,a=n/2,c=Ut("circle");return Ct(c,{cx:o,cy:a,r:Math.round((e+n)/4-i)}),Ct(c,r),At(t,c),c}function b(t,e,n,i,r,o){k(r)&&(o=r,r=0),r=r||0,o=d(o,{stroke:"black",strokeWidth:2,fill:"white"});var a=Ut("rect");return Ct(a,{x:r,y:r,width:e-2*r,height:n-2*r,rx:i,ry:i}),Ct(a,o),At(t,a),a}function g(t,e,n){var i=be(e,n=d(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return At(t,i),i}function y(t,e,n){n=d(n,["no-fill"],{strokeWidth:2,stroke:"black"});var i=Ut("path");return Ct(i,{d:e}),Ct(i,n),At(t,i),i}function x(t,e,n,i){return y(e,n,$({"data-marker":t},i))}function w(t){return function(e,n){return N[t](e,n)}}function E(t){return N[t]}function I(t,e){var n=Wr(t),i=function(t){return"bpmn:IntermediateThrowEvent"===t.$type||"bpmn:EndEvent"===t.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?E("bpmn:ParallelMultipleEventDefinition")(e,t,i):E("bpmn:MultipleEventDefinition")(e,t,i):Lr(n,"bpmn:MessageEventDefinition")?E("bpmn:MessageEventDefinition")(e,t,i):Lr(n,"bpmn:TimerEventDefinition")?E("bpmn:TimerEventDefinition")(e,t,i):Lr(n,"bpmn:ConditionalEventDefinition")?E("bpmn:ConditionalEventDefinition")(e,t):Lr(n,"bpmn:SignalEventDefinition")?E("bpmn:SignalEventDefinition")(e,t,i):Lr(n,"bpmn:EscalationEventDefinition")?E("bpmn:EscalationEventDefinition")(e,t,i):Lr(n,"bpmn:LinkEventDefinition")?E("bpmn:LinkEventDefinition")(e,t,i):Lr(n,"bpmn:ErrorEventDefinition")?E("bpmn:ErrorEventDefinition")(e,t,i):Lr(n,"bpmn:CancelEventDefinition")?E("bpmn:CancelEventDefinition")(e,t,i):Lr(n,"bpmn:CompensateEventDefinition")?E("bpmn:CompensateEventDefinition")(e,t,i):Lr(n,"bpmn:TerminateEventDefinition")?E("bpmn:TerminateEventDefinition")(e,t,i):null}function _(t,e,n){n=$({size:{width:100}},n);var i=o.createText(e||"",n);return Gt(i).add("djs-label"),At(t,i),i}function M(t,e,n){return _(t,Wr(e).name,{box:e,align:n,padding:5,style:{fill:Yr(e,u,s)}})}function S(t,e,n){$n(_(t,e,{box:{height:30,width:n.height},align:"center-middle",style:{fill:Yr(n,u,s)}}),0,1*n.height,270)}function B(t){for(var e=t.waypoints,n="m "+e[0].x+","+e[0].y,i=1;i<e.length;i++)n+="L"+e[i].x+","+e[i].y+" ";return n}var N=this.handlers={"bpmn:Event":function(t,e,n){return"fillOpacity"in n||(n.fillOpacity=.95),v(t,e.width,e.height,n)},"bpmn:StartEvent":function(t,e){var n={fill:Zr(e,c),stroke:Hr(e,s)};Wr(e).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:Zr(e,c),stroke:Hr(e,s)});var i=E("bpmn:Event")(t,e,n);return I(e,t),i},"bpmn:MessageEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:e.width,containerHeight:e.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?Hr(e,s):Zr(e,c),stroke:n?Zr(e,c):Hr(e,s)})},"bpmn:TimerEventDefinition":function(t,e){var n=v(t,e.width,e.height,.2*e.height,{strokeWidth:2,fill:Zr(e,c),stroke:Hr(e,s)});y(t,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:Hr(e,s)});for(var r=0;r<12;r++)y(t,i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.5}}),{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+e.height/2+","+e.width/2+")",stroke:Hr(e,s)});return n},"bpmn:EscalationEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)})},"bpmn:ConditionalEventDefinition":function(t,e){return y(t,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:Hr(e,s)})},"bpmn:LinkEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)})},"bpmn:ErrorEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:e.width,containerHeight:e.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)})},"bpmn:CancelEventDefinition":function(t,e,n){var r=y(t,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)});return ei(r,45),r},"bpmn:CompensateEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)})},"bpmn:SignalEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)})},"bpmn:MultipleEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:e.width,containerHeight:e.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:n?Hr(e,s):"none"})},"bpmn:ParallelMultipleEventDefinition":function(t,e){return y(t,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:e.width,containerHeight:e.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:Hr(e,s),stroke:Hr(e,s)})},"bpmn:EndEvent":function(t,e){var n=E("bpmn:Event")(t,e,{strokeWidth:4,fill:Zr(e,c),stroke:Hr(e,s)});return I(e,t),n},"bpmn:TerminateEventDefinition":function(t,e){return v(t,e.width,e.height,8,{strokeWidth:4,fill:Hr(e,s),stroke:Hr(e,s)})},"bpmn:IntermediateEvent":function(t,e){var n=E("bpmn:Event")(t,e,{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)});return v(t,e.width,e.height,3,{strokeWidth:1,fill:Zr(e,"none"),stroke:Hr(e,s)}),I(e,t),n},"bpmn:IntermediateCatchEvent":w("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":w("bpmn:IntermediateEvent"),"bpmn:Activity":function(t,e,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=.95),b(t,e.width,e.height,10,n)},"bpmn:Task":function(t,e){var n={fill:Zr(e,c),stroke:Hr(e,s)},i=E("bpmn:Activity")(t,e,n);return M(t,e,"center-middle"),A(t,e),i},"bpmn:ServiceTask":function(t,e){var n=E("bpmn:Task")(t,e);return y(t,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)}),y(t,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:Zr(e,c)}),y(t,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)}),n},"bpmn:UserTask":function(t,e){var n=E("bpmn:Task")(t,e);return y(t,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Zr(e,c),stroke:Hr(e,s)}),y(t,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Zr(e,c),stroke:Hr(e,s)}),y(t,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Hr(e,s),stroke:Hr(e,s)}),n},"bpmn:ManualTask":function(t,e){var n=E("bpmn:Task")(t,e);return y(t,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:Zr(e,c),stroke:Hr(e,s)}),n},"bpmn:SendTask":function(t,e){var n=E("bpmn:Task")(t,e);return y(t,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:Hr(e,s),stroke:Zr(e,c)}),n},"bpmn:ReceiveTask":function(t,e){var n,r=Wr(e),o=E("bpmn:Task")(t,e);return r.instantiate?(v(t,28,28,4.4,{strokeWidth:1}),n=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):n=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),y(t,n,{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)}),o},"bpmn:ScriptTask":function(t,e){var n=E("bpmn:Task")(t,e);return y(t,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:Hr(e,s)}),n},"bpmn:BusinessRuleTask":function(t,e){var n=E("bpmn:Task")(t,e);return Ct(y(t,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:Zr(e,"#aaaaaa"),stroke:Hr(e,s)}),Ct(y(t,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:Hr(e,s)}),n},"bpmn:SubProcess":function(t,e,n){n=$({fill:Zr(e,c),stroke:Hr(e,s)},n);var i=E("bpmn:Activity")(t,e,n),r=Pr(e);return zr(e)&&Ct(i,{strokeDasharray:"1,2"}),M(t,e,r?"center-top":"center-middle"),r?A(t,e):A(t,e,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(t,e){return E("bpmn:SubProcess")(t,e)},"bpmn:Transaction":function(t,e){var i=E("bpmn:SubProcess")(t,e),r=n.style(["no-fill","no-events"],{stroke:Hr(e,s)});return b(t,e.width,e.height,8,3,r),i},"bpmn:CallActivity":function(t,e){return E("bpmn:SubProcess")(t,e,{strokeWidth:5})},"bpmn:Participant":function(t,e){var n={fillOpacity:.95,fill:Zr(e,c),stroke:Hr(e,s)},i=E("bpmn:Lane")(t,e,n);return Pr(e)?(g(t,[{x:30,y:0},{x:30,y:e.height}],{stroke:Hr(e,s)}),S(t,Wr(e).name,e)):_(t,Wr(e).name,{box:e,align:"center-middle",style:{fill:Yr(e,u,s)}}),!!Wr(e).participantMultiplicity&&E("ParticipantMultiplicityMarker")(t,e),i},"bpmn:Lane":function(t,e,n){var i=b(t,e.width,e.height,0,$({fill:Zr(e,c),fillOpacity:.35,stroke:Hr(e,s)},n)),r=Wr(e);return"bpmn:Lane"===r.$type&&S(t,r.name,e),i},"bpmn:InclusiveGateway":function(t,e){var n=E("bpmn:Gateway")(t,e);return v(t,e.width,e.height,.24*e.height,{strokeWidth:2.5,fill:Zr(e,c),stroke:Hr(e,s)}),n},"bpmn:ExclusiveGateway":function(t,e){var n=E("bpmn:Gateway")(t,e),r=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:e.width,containerHeight:e.height,position:{mx:.32,my:.3}});return Or(e).isMarkerVisible&&y(t,r,{strokeWidth:1,fill:Hr(e,s),stroke:Hr(e,s)}),n},"bpmn:ComplexGateway":function(t,e){var n=E("bpmn:Gateway")(t,e);return y(t,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:e.width,containerHeight:e.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:Hr(e,s),stroke:Hr(e,s)}),n},"bpmn:ParallelGateway":function(t,e){var n=E("bpmn:Gateway")(t,e);return y(t,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:e.width,containerHeight:e.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:Hr(e,s),stroke:Hr(e,s)}),n},"bpmn:EventBasedGateway":function(t,e){var n=Wr(e),r=E("bpmn:Gateway")(t,e);v(t,e.width,e.height,.2*e.height,{strokeWidth:1,fill:"none",stroke:Hr(e,s)});var o=n.eventGatewayType,a=!!n.instantiate;if("Parallel"===o){var c=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:e.width,containerHeight:e.height,position:{mx:.474,my:.296}});Ct(y(t,c),{strokeWidth:1,fill:"none"})}else"Exclusive"===o&&(a||Ct(v(t,e.width,e.height,.26*e.height),{strokeWidth:1,fill:"none",stroke:Hr(e,s)}),function(){var n=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:e.width,containerHeight:e.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:Zr(e,"none"),stroke:Hr(e,s)};y(t,n,r)}());return r},"bpmn:Gateway":function(t,e){var n={fill:Zr(e,c),fillOpacity:.95,stroke:Hr(e,s)};return function(t,e,n,i){var r=e/2,o=n/2,a=[{x:r,y:0},{x:e,y:o},{x:r,y:n},{x:0,y:o}].map((function(t){return t.x+","+t.y})).join(" ");i=d(i,{stroke:"black",strokeWidth:2,fill:"white"});var c=Ut("polygon");return Ct(c,{points:a}),Ct(c,i),At(t,c),c}(t,e.width,e.height,n)},"bpmn:SequenceFlow":function(t,e){var n,i=B(e),r=Zr(e,c),o=Hr(e,s),a=y(t,i,{strokeLinejoin:"round",markerEnd:h("sequenceflow-end",r,o),stroke:Hr(e,s)}),u=Wr(e);return e.source&&(n=e.source.businessObject,u.conditionExpression&&n.$instanceOf("bpmn:Activity")&&Ct(a,{markerStart:h("conditional-flow-marker",r,o)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===u&&Ct(a,{markerStart:h("conditional-default-flow-marker",r,o)})),a},"bpmn:Association":function(t,e,n){var i=Wr(e),r=Zr(e,c),o=Hr(e,s);return n=$({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:Hr(e,s)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=h("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=h("association-start",r,o)),g(t,e.waypoints,n)},"bpmn:DataInputAssociation":function(t,e){var n=Zr(e,c),i=Hr(e,s);return E("bpmn:Association")(t,e,{markerEnd:h("association-end",n,i)})},"bpmn:DataOutputAssociation":function(t,e){var n=Zr(e,c),i=Hr(e,s);return E("bpmn:Association")(t,e,{markerEnd:h("association-end",n,i)})},"bpmn:MessageFlow":function(t,e){var n=Wr(e),r=Or(e),o=Zr(e,c),a=Hr(e,s),l=y(t,B(e),{markerEnd:h("messageflow-end",o,a),markerStart:h("messageflow-start",o,a),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:Hr(e,s)});if(n.messageRef){var f=l.getPointAtLength(l.getTotalLength()/2),d=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:f.x,y:f.y}}),p={strokeWidth:1};"initiating"===r.messageVisibleKind?(p.fill="white",p.stroke="black"):(p.fill="#888",p.stroke="white");var m=y(t,d,p),v=_(t,n.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:Hr(e,u)}}),b=m.getBBox(),g=v.getBBox();$n(v,f.x-g.width/2,f.y+b.height/2+10,0)}return l},"bpmn:DataObject":function(t,e){var n=y(t,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.474,my:.296}}),{fill:Zr(e,c),fillOpacity:.95,stroke:Hr(e,s)});return function(t){var e=t.dataObjectRef;return t.isCollection||e&&e.isCollection}(Wr(e))&&function(t,e){y(t,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.33,my:(e.height-18)/e.height}}),{strokeWidth:2})}(t,e),n},"bpmn:DataObjectReference":w("bpmn:DataObject"),"bpmn:DataInput":function(t,e){var n=i.getRawPath("DATA_ARROW"),r=E("bpmn:DataObject")(t,e);return y(t,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(t,e){var n=i.getRawPath("DATA_ARROW"),r=E("bpmn:DataObject")(t,e);return y(t,n,{strokeWidth:1,fill:"black"}),r},"bpmn:DataStoreReference":function(t,e){return y(t,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:Zr(e,c),fillOpacity:.95,stroke:Hr(e,s)})},"bpmn:BoundaryEvent":function(t,e){var n=Wr(e).cancelActivity,i={strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=$({},i,{fillOpacity:1}),o=$({},i,{fill:"none"}),a=E("bpmn:Event")(t,e,r);return v(t,e.width,e.height,3,o),I(e,t),a},"bpmn:Group":function(t,e){return b(t,e.width,e.height,10,{stroke:Hr(e,s),strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(t,e){return function(t,e){var n={width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y};return _(t,Fr(e),{box:n,fitBox:!0,style:$({},o.getExternalStyle(),{fill:Yr(e,u,s)})})}(t,e)},"bpmn:TextAnnotation":function(t,e){var n=b(t,e.width,e.height,0,0,{fill:"none",stroke:"none"});return y(t,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:0,my:0}}),{stroke:Hr(e,s)}),_(t,Wr(e).text||"",{box:e,align:"left-top",padding:5,style:{fill:Yr(e,u,s)}}),n},ParticipantMultiplicityMarker:function(t,e){x("participant-multiplicity",t,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:e.width/2/e.width,my:(e.height-15)/e.height}}),{strokeWidth:2,fill:Zr(e,c),stroke:Hr(e,s)})},SubProcessMarker:function(t,e){ti(b(t,14,14,0,{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)}),e.width/2-7.5,e.height-20),x("sub-process",t,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2-7.5)/e.width,my:(e.height-20)/e.height}}),{fill:Zr(e,c),stroke:Hr(e,s)})},ParallelMarker:function(t,e,n){x("parallel",t,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+n.parallel)/e.width,my:(e.height-20)/e.height}}),{fill:Zr(e,c),stroke:Hr(e,s)})},SequentialMarker:function(t,e,n){x("sequential",t,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+n.seq)/e.width,my:(e.height-19)/e.height}}),{fill:Zr(e,c),stroke:Hr(e,s)})},CompensationMarker:function(t,e,n){x("compensation",t,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+n.compensation)/e.width,my:(e.height-13)/e.height}}),{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)})},LoopMarker:function(t,e,n){x("loop",t,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+n.loop)/e.width,my:(e.height-7)/e.height}}),{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(t,e,n){x("adhoc",t,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+n.adhoc)/e.width,my:(e.height-15)/e.height}}),{strokeWidth:1,fill:Hr(e,s),stroke:Hr(e,s)})}};function A(t,e,n){var i,r=Wr(e),o=n&&-1!==n.indexOf("SubProcessMarker");i=o?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},R(n,(function(n){E(n)(t,e,i)})),r.isForCompensation&&E("CompensationMarker")(t,e,i),"bpmn:AdHocSubProcess"===r.$type&&E("AdhocMarker")(t,e,i);var a=r.loopCharacteristics,c=a&&a.isSequential;a&&(void 0===c&&E("LoopMarker")(t,e,i),!1===c&&E("ParallelMarker")(t,e,i),!0===c&&E("SequentialMarker")(t,e,i))}this._drawPath=y}p(Vr,me),Vr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Vr.prototype.canRender=function(t){return Rr(t,"bpmn:BaseElement")},Vr.prototype.drawShape=function(t,e){return(0,this.handlers[e.type])(t,e)},Vr.prototype.drawConnection=function(t,e){return(0,this.handlers[e.type])(t,e)},Vr.prototype.getShapePath=function(t){return Rr(t,"bpmn:Event")?he([["M",(e=t).x+e.width/2,e.y+e.height/2],["m",0,-(n=e.width/2)],["a",n,n,0,1,1,0,2*n],["a",n,n,0,1,1,0,-2*n],["z"]]):Rr(t,"bpmn:Activity")?function(t,e){var n=t.width,i=t.height;return he([["M",t.x+e,t.y],["l",n-20,0],["a",e,e,0,0,1,e,e],["l",0,i-20],["a",e,e,0,0,1,-10,e],["l",20-n,0],["a",e,e,0,0,1,-10,-10],["l",0,20-i],["a",e,e,0,0,1,e,-10],["z"]])}(t,10):Rr(t,"bpmn:Gateway")?function(t){var e=t.width/2,n=t.height/2;return he([["M",t.x+e,t.y],["l",e,n],["l",-e,n],["l",-e,-n],["z"]])}(t):function(t){var e=t.width;return he([["M",t.x,t.y],["l",e,0],["l",0,t.height],["l",-e,0],["z"]])}(t);var e,n};var Xr={width:150,height:50};function Jr(t,e){var n;e.textContent=t;try{var i,r=""===t;return e.textContent=r?"dummy":t,i={width:(n=e.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(t){return{width:0,height:0}}}function Qr(t,e,n){for(var i,r=t.shift(),o=r;;){if((i=Jr(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(e)||o.length<2)return qr(t,o,r,i);o=Kr(o,i.width,e)}}function qr(t,e,n,i){if(e.length<n.length){var r=n.slice(e.length).trim();t.unshift(r)}return{width:i.width,height:i.height,text:e}}function Kr(t,e,n){var i=Math.max(t.length*(n/e),1),r=function(t,e){var n,i=t.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<e)){"-"!==n&&""!==n||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&""===a&&(r[r.length-1]="-"),r.join("")}(t,i);return r||(r=t.slice(0,Math.max(Math.round(i-1),1))),r}function $r(t){this._config=$({},{size:Xr,padding:0,style:{},align:"center-top"},t||{})}function to(t){var e=$({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},t&&t.defaultStyle||{}),n=parseInt(e.fontSize,10)-1,i=$({},e,{fontSize:n},t&&t.externalStyle||{}),r=new $r({style:e});this.getExternalLabelBounds=function(t,e){var n=r.getDimensions(e,{box:{width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y},style:i});return{x:Math.round(t.x+t.width/2-n.width/2),y:Math.round(t.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(t,n){var i=r.getDimensions(n,{box:t,style:e,align:"left-top",padding:5});return{x:t.x,y:t.y,width:t.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(t,e){return r.createText(t,e||{})},this.getDefaultStyle=function(){return e},this.getExternalStyle=function(){return i}}$r.prototype.createText=function(t,e){return this.layoutText(t,e).element},$r.prototype.getDimensions=function(t,e){return this.layoutText(t,e).dimensions},$r.prototype.layoutText=function(t,e){var n,i=$({},this._config.size,e.box),r=$({},this._config.style,e.style),o=function(t){var e=t.split("-");return{horizontal:e[0]||"center",vertical:e[1]||"top"}}(e.align||this._config.align),a=function(t){return k(t)?$({top:0,left:0,right:0,bottom:0},t):{top:t,left:t,right:t,bottom:t}}(void 0!==e.padding?e.padding:this._config.padding),c=e.fitBox||!1,s=function(t){if("fontSize"in t&&"lineHeight"in t)return t.lineHeight*parseInt(t.fontSize,10)}(r),u=t.split(/\u00AD?\r?\n/),l=[],f=i.width-a.left-a.right,d=Ut("text");for(Ct(d,{x:0,y:0}),Ct(d,r),At((n=void 0,(n=document.getElementById("helper-svg"))||(Ct(n=Ut("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(n)),n),d);u.length;)l.push(Qr(u,f,d));"middle"===o.vertical&&(a.top=a.bottom=0);var p=T(l,(function(t,e){return t+(s||e.height)}),0)+a.top+a.bottom,m=T(l,(function(t,e){return e.width>t?e.width:t}),0),h=a.top;"middle"===o.vertical&&(h+=(i.height-p)/2),h-=(s||l[0].height)/4;var v=Ut("text");return Ct(v,r),R(l,(function(t){var e;switch(h+=s||t.height,o.horizontal){case"left":e=a.left;break;case"right":e=(c?m:f)-a.right-t.width;break;default:e=Math.max(((c?m:f)-t.width)/2+a.left,0)}var n=Ut("tspan");Ct(n,{x:e,y:h}),n.textContent=t.text,At(v,n)})),Lt(d),{dimensions:{width:m,height:p},element:v}},to.$inject=["config.textRenderer"];var eo=/\{([^}]+)\}/g,no=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const io={__init__:["bpmnRenderer"],bpmnRenderer:["type",Vr],textRenderer:["type",to],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(t){return this.pathMap[t].d},this.getScaledPath=function(t,e){var n,i,r=this.pathMap[t];e.abspos?(n=e.abspos.x,i=e.abspos.y):(n=e.containerWidth*e.position.mx,i=e.containerHeight*e.position.my);var o,a={};if(e.position){for(var c=e.containerHeight/r.height*e.yScaleFactor,s=e.containerWidth/r.width*e.xScaleFactor,u=0;u<r.heightElements.length;u++)a["y"+u]=r.heightElements[u]*c;for(var l=0;l<r.widthElements.length;l++)a["x"+l]=r.widthElements[l]*s}return o={mx:n,my:i,e:a},String(r.d).replace(eo,(function(t,e){return function(t,e,n){var i=n;return e.replace(no,(function(t,e,n,r,o){e=e||r,i&&(e in i&&(i=i[e]),"function"==typeof i&&o&&(i=i()))})),i=(null==i||i==n?t:i)+""}(t,e,o)}))}}]},ro={translate:["value",function(t,e){return e=e||{},t.replace(/{([^}]+)}/g,(function(t,n){return e[n]||"{"+n+"}"}))}]};var oo={width:90,height:20};function ao(t){return Rr(t,"bpmn:Event")||Rr(t,"bpmn:Gateway")||Rr(t,"bpmn:DataStoreReference")||Rr(t,"bpmn:DataObjectReference")||Rr(t,"bpmn:DataInput")||Rr(t,"bpmn:DataOutput")||Rr(t,"bpmn:SequenceFlow")||Rr(t,"bpmn:MessageFlow")||Rr(t,"bpmn:Group")}function co(t){return uo(t.label)}function so(t){return t.waypoints?(n=(e=t.waypoints).length/2-1,i=e[Math.floor(n)],r=e[Math.ceil(n+.01)],o=function(t){var e=t.length/2-1,n=t[Math.floor(e)],i=t[Math.ceil(e+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),a=Math.atan((r.y-i.y)/(r.x-i.x)),c=o.x,s=o.y,Math.abs(a)<Math.PI/2?s-=15:c+=15,{x:c,y:s}):Rr(t,"bpmn:Group")?{x:t.x+t.width/2,y:t.y+oo.height/2}:{x:t.x+t.width/2,y:t.y+t.height+oo.height/2};var e,n,i,r,o,a,c,s}function uo(t){return t&&!!t.labelTarget}function lo(t,e){return $({id:t.id,type:t.$type,businessObject:t},e)}function fo(t,e,n){var i=t.di.waypoint;return!i||i.length<2?[En(e),En(n)]:i.map((function(t){return{x:t.x,y:t.y}}))}function po(t,e,n,i){return new Error(t("element {element} referenced by {referenced}#{property} not yet drawn",{element:br(n),referenced:br(e),property:i}))}function mo(t,e,n,i,r,o){this._eventBus=t,this._canvas=e,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}mo.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],mo.prototype.add=function(t,e){var n,i,r,o,a,c,s=t.di,u=this._translate;if(Rr(s,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(lo(t)),this._canvas.setRootElement(n);else if(Rr(s,"bpmndi:BPMNShape")){var l=!Pr(t),f=function(t){return Rr(t,"bpmn:Group")}(t),d=t.di.bounds;n=this._elementFactory.createShape(lo(t,{collapsed:l,hidden:e&&(e.hidden||e.collapsed),x:Math.round(d.x),y:Math.round(d.y),width:Math.round(d.width),height:Math.round(d.height),isFrame:f})),Rr(t,"bpmn:BoundaryEvent")&&this._attachBoundary(t,n),Rr(t,"bpmn:Lane")&&(i=0),Rr(t,"bpmn:DataStoreReference")&&(r=e,c=(o=En(d)).y,(a=o.x)>=r.x&&a<=r.x+r.width&&c>=r.y&&c<=r.y+r.height||(e=this._canvas.getRootElement())),this._canvas.addShape(n,e,i)}else{if(!Rr(s,"bpmndi:BPMNEdge"))throw new Error(u("unknown di {di} for element {semantic}",{di:br(s),semantic:br(t)}));var p=this._getSource(t),m=this._getTarget(t);n=this._elementFactory.createConnection(lo(t,{hidden:e&&(e.hidden||e.collapsed),source:p,target:m,waypoints:fo(t,p,m)})),Rr(t,"bpmn:DataAssociation")&&(e=null),Rr(t,"bpmn:SequenceFlow")&&(i=0),this._canvas.addConnection(n,e,i)}return ao(t)&&Fr(n)&&this.addLabel(t,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},mo.prototype._attachBoundary=function(t,e){var n=this._translate,i=t.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:br(t)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw po(n,t,i,"attachedToRef");e.host=r,o||(r.attachers=o=[]),-1===o.indexOf(e)&&o.push(e)},mo.prototype.addLabel=function(t,e){var n,i,r;return n=function(t,e){var n,i,r,o=t.di.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(oo.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=so(e),i=oo),$({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,e),(i=Fr(e))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(lo(t,{id:t.id+"_label",labelTarget:e,type:"label",hidden:e.hidden||!Fr(e),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,e.parent)},mo.prototype._getEnd=function(t,e){var n,i,r=t.$type,o=this._translate;if(i=t[e+"Ref"],"source"===e&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===e&&"bpmn:DataOutputAssociation"===r||"target"===e&&"bpmn:DataInputAssociation"===r)&&(i=t.$parent),n=i&&this._getElement(i))return n;throw i?po(o,t,i,e+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:br(t),side:e}))},mo.prototype._getSource=function(t){return this._getEnd(t,"source")},mo.prototype._getTarget=function(t){return this._getEnd(t,"target")},mo.prototype._getElement=function(t){return this._elementRegistry.get(t.id)};const ho={__depends__:[io,{__depends__:[ro],bpmnImporter:["type",mo]}]};function vo(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}function bo(t){return t.originalEvent||t.srcEvent}function go(t){vo(t),vo(bo(t))}function yo(t){return t.pointers&&t.pointers.length&&(t=t.pointers[0]),t.touches&&t.touches.length&&(t=t.touches[0]),t?{x:t.clientX,y:t.clientY}:null}function xo(t,e){return(bo(t)||t).button===e}function wo(t){return xo(t,0)}function Eo(t){var e=bo(t)||t;return!!wo(t)&&(/mac/i.test(navigator.platform)?e.metaKey:e.ctrlKey)}function ko(t){var e=bo(t)||t;return wo(t)&&e.shiftKey}function Io(){return!0}function _o(t){return wo(t)||function(t){return xo(t,1)}(t)}function Mo(t,e,n){var i=this;function r(n,i,r){var o,a;(function(t,e){return!(s[t]||wo)(e)})(n,i)||(r?a=e.getGraphics(r):(o=i.delegateTarget||i.target)&&(r=e.get(a=o)),a&&r&&!1===t.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function a(t){return o[t]}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"},s={"element.contextmenu":Io,"element.mousedown":_o,"element.mouseup":_o,"element.click":_o,"element.dblclick":_o};function u(t,e,n,i){var a=o[n]=function(t){r(n,t)};i&&(s[n]=i),a.$delegate=wt(t,"svg, .djs-element",e,a)}function l(t,e,n){var i=a(n);i&&Et(t,e,i.$delegate)}t.on("canvas.destroy",(function(t){var e;e=t.svg,R(c,(function(t,n){l(e,n,t)}))})),t.on("canvas.init",(function(t){var e;e=t.svg,R(c,(function(t,n){u(e,n,t)}))})),t.on(["shape.added","connection.added"],(function(e){t.fire("interactionEvents.createHit",{element:e.element,gfx:e.gfx})})),t.on(["shape.changed","connection.changed"],500,(function(e){t.fire("interactionEvents.updateHit",{element:e.element,gfx:e.gfx})})),t.on("interactionEvents.createHit",500,(function(t){i.createDefaultHit(t.element,t.gfx)})),t.on("interactionEvents.updateHit",(function(t){i.updateDefaultHit(t.element,t.gfx)}));var f=m("djs-hit djs-hit-stroke"),d=m("djs-hit djs-hit-click-stroke"),p={all:m("djs-hit djs-hit-all"),"click-stroke":d,stroke:f};function m(t,e){return e=$({stroke:"white",strokeWidth:15},e||{}),n.cls(t,["no-fill","no-border"],e)}function h(t,e){var n=p[e];if(!n)throw new Error("invalid hit type <"+e+">");return Ct(t,n),t}function v(t,e){At(t,e)}this.removeHits=function(t){R(St(".djs-hit",t),Lt)},this.createDefaultHit=function(t,e){var n=t.waypoints,i=t.isFrame;return n?this.createWaypointsHit(e,n):this.createBoxHit(e,i?"stroke":"all",{width:t.width,height:t.height})},this.createWaypointsHit=function(t,e){var n=be(e);return h(n,"stroke"),v(t,n),n},this.createBoxHit=function(t,e,n){n=$({x:0,y:0},n);var i=Ut("rect");return h(i,e),Ct(i,n),v(t,i),i},this.updateDefaultHit=function(t,e){var n=Mt(".djs-hit",e);if(n)return t.waypoints?function(t,e){Ct(t,{points:ve(e)})}(n,t.waypoints):Ct(n,{width:t.width,height:t.height}),n},this.fire=r,this.triggerMouseEvent=function(t,e,n){var i=c[t];if(!i)throw new Error("unmapped DOM event name <"+t+">");return r(i,e,n)},this.mouseHandler=a,this.registerEvent=u,this.unregisterEvent=l}Mo.$inject=["eventBus","elementRegistry","styles"];const So={__init__:["interactionEvents"],interactionEvents:["type",Mo]};function Bo(t,e){this.offset=6;var n=e.cls("djs-outline",["no-fill"]),i=this;function r(t){var e=Ut("rect");return Ct(e,$({x:10,y:10,width:100,height:100},n)),At(t,e),e}t.on(["shape.added","shape.changed"],500,(function(t){var e=t.element,n=t.gfx,o=Mt(".djs-outline",n);o||(o=r(n)),i.updateShapeOutline(o,e)})),t.on(["connection.added","connection.changed"],(function(t){var e=t.element,n=t.gfx,o=Mt(".djs-outline",n);o||(o=r(n)),i.updateConnectionOutline(o,e)}))}Bo.prototype.updateShapeOutline=function(t,e){Ct(t,{x:-this.offset,y:-this.offset,width:e.width+2*this.offset,height:e.height+2*this.offset})},Bo.prototype.updateConnectionOutline=function(t,e){var n=ke(e);Ct(t,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Bo.$inject=["eventBus","styles","elementRegistry"];const No={__init__:["outline"],outline:["type",Bo]};function Ao(t){this._eventBus=t,this._selectedElements=[];var e=this;t.on(["shape.remove","connection.remove"],(function(t){e.deselect(t.element)})),t.on(["diagram.clear"],(function(){e.select(null)}))}function Do(t,e){function n(t,n){e.addMarker(t,n)}function i(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(t){n(t.element,"hover")})),t.on("element.out",(function(t){i(t.element,"hover")})),t.on("selection.changed",(function(t){var e=t.oldSelection,r=t.newSelection;R(e,(function(t){-1===r.indexOf(t)&&i(t,"selected")})),R(r,(function(t){-1===e.indexOf(t)&&n(t,"selected")}))}))}function Ro(t,e,n,i){t.on("create.end",500,(function(t){var n=t.context,i=n.elements,r=(n.hints||{}).autoSelect;if(n.canExecute){if(!1===r)return;E(r)?e.select(r):e.select(i.filter(Co))}})),t.on("connect.end",500,(function(t){var n=t.context,i=n.hover;n.canExecute&&i&&e.select(i)})),t.on("shape.move.end",500,(function(t){var n=t.previousSelection||[],r=i.get(t.context.shape.id);N(n,(function(t){return r.id===t.id}))||e.select(r)})),t.on("element.click",(function(t){if(wo(t)){var i=t.element;i===n.getRootElement()&&(i=null);var r=e.isSelected(i),o=e.get().length>1,a=Eo(t)||ko(t);if(r&&o)return a?e.deselect(i):e.select(i);r?e.deselect(i):e.select(i,a)}}))}function Co(t){return!t.hidden}Ao.$inject=["eventBus"],Ao.prototype.deselect=function(t){var e=this._selectedElements,n=e.indexOf(t);if(-1!==n){var i=e.slice();e.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:e})}},Ao.prototype.get=function(){return this._selectedElements},Ao.prototype.isSelected=function(t){return-1!==this._selectedElements.indexOf(t)},Ao.prototype.select=function(t,e){var n=this._selectedElements,i=n.slice();E(t)||(t=t?[t]:[]),e?R(t,(function(t){-1===n.indexOf(t)&&n.push(t)})):this._selectedElements=n=t.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})},Do.$inject=["eventBus","canvas","selection","styles"],Ro.$inject=["eventBus","selection","canvas","elementRegistry"];const To={__init__:["selectionVisuals","selectionBehavior"],__depends__:[So,No],selection:["type",Ao],selectionVisuals:["type",Do],selectionBehavior:["type",Ro]};function Po(t){this._counter=0,this._prefix=(t?t+"-":"")+Math.floor(1e9*Math.random())+"-"}Po.prototype.next=function(){return this._prefix+ ++this._counter};var zo=new Po("ov");function jo(t,e,n,i){var r,o;this._eventBus=e,this._canvas=n,this._elementRegistry=i,this._ids=zo,this._overlayDefaults=$({show:null,scale:!0},t&&t.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),o=kt('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(o,r.firstChild),o),this._init()}function Go(t,e,n){$(t.style,{left:e+"px",top:n+"px"})}function Fo(t,e){t.style.display=!1===e?"none":""}function Lo(t,e){t.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){t.style[n+"transform"]=e}))}jo.$inject=["config.overlays","eventBus","canvas","elementRegistry"],jo.prototype.get=function(t){if(M(t)&&(t={id:t}),M(t.element)&&(t.element=this._elementRegistry.get(t.element)),t.element){var e=this._getOverlayContainer(t.element,!0);return e?t.type?D(e.overlays,Y({type:t.type})):e.overlays.slice():[]}return t.type?D(this._overlays,Y({type:t.type})):t.id?this._overlays[t.id]:null},jo.prototype.add=function(t,e,n){if(k(e)&&(n=e,e=null),t.id||(t=this._elementRegistry.get(t)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!t)throw new Error("invalid element specified");var i=this._ids.next();return n=$({},this._overlayDefaults,n,{id:i,type:e,element:t,html:n.html}),this._addOverlay(n),i},jo.prototype.remove=function(t){var e=this.get(t)||[];E(e)||(e=[e]);var n=this;R(e,(function(t){var e=n._getOverlayContainer(t.element,!0);if(t&&(Bt(t.html),Bt(t.htmlContainer),delete t.htmlContainer,delete t.element,delete n._overlays[t.id]),e){var i=e.overlays.indexOf(t);-1!==i&&e.overlays.splice(i,1)}}))},jo.prototype.show=function(){Fo(this._overlayRoot)},jo.prototype.hide=function(){Fo(this._overlayRoot,!1)},jo.prototype.clear=function(){this._overlays={},this._overlayContainers=[],lt(this._overlayRoot)},jo.prototype._updateOverlayContainer=function(t){var e=t.element,n=t.html,i=e.x,r=e.y;if(e.waypoints){var o=ke(e);i=o.x,r=o.y}Go(n,i,r),it(t.html,"data-container-id",e.id)},jo.prototype._updateOverlay=function(t){var e,n,i=t.position,r=t.htmlContainer,o=t.element,a=i.left,c=i.top;void 0!==i.right&&(e=o.waypoints?ke(o).width:o.width,a=-1*i.right+e),void 0!==i.bottom&&(n=o.waypoints?ke(o).height:o.height,c=-1*i.bottom+n),Go(r,a||0,c||0)},jo.prototype._createOverlayContainer=function(t){var e=kt('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(e);var n={html:e,element:t,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},jo.prototype._updateRoot=function(t){var e=t.scale||1,n="matrix("+[e,0,0,e,-1*t.x*e,-1*t.y*e].join(",")+")";Lo(this._overlayRoot,n)},jo.prototype._getOverlayContainer=function(t,e){var n=N(this._overlayContainers,(function(e){return e.element===t}));return n||e?n:this._createOverlayContainer(t)},jo.prototype._addOverlay=function(t){var e,n,i=t.id,r=t.element,o=t.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),M(o)&&(o=kt(o)),n=this._getOverlayContainer(r),(e=kt('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(o),t.type&&st(e).add("djs-overlay-"+t.type),t.htmlContainer=e,n.overlays.push(t),n.html.appendChild(e),this._overlays[i]=t,this._updateOverlay(t),this._updateOverlayVisibilty(t,this._canvas.viewbox())},jo.prototype._updateOverlayVisibilty=function(t,e){var n=t.show,i=n&&n.minZoom,r=n&&n.maxZoom,o=t.htmlContainer,a=!0;n&&((x(i)&&i>e.scale||x(r)&&r<e.scale)&&(a=!1),Fo(o,a)),this._updateOverlayScale(t,e)},jo.prototype._updateOverlayScale=function(t,e){var n,i,r,o=t.scale,a=t.htmlContainer,c="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),x(n)&&e.scale<n&&(r=(1/e.scale||1)*n),x(i)&&e.scale>i&&(r=(1/e.scale||1)*i)),x(r)&&(c="scale("+r+","+r+")"),Lo(a,c)},jo.prototype._updateOverlaysVisibilty=function(t){var e=this;R(this._overlays,(function(n){e._updateOverlayVisibilty(n,t)}))},jo.prototype._init=function(){var t=this._eventBus,e=this;t.on("canvas.viewbox.changing",(function(){e.hide()})),t.on("canvas.viewbox.changed",(function(t){var n;e._updateRoot(n=t.viewbox),e._updateOverlaysVisibilty(n),e.show()})),t.on(["shape.remove","connection.remove"],(function(t){var n=t.element;R(e.get({element:n}),(function(t){e.remove(t.id)}));var i=e._getOverlayContainer(n);if(i){Bt(i.html);var r=e._overlayContainers.indexOf(i);-1!==r&&e._overlayContainers.splice(r,1)}})),t.on("element.changed",500,(function(t){var n=e._getOverlayContainer(t.element,!0);n&&(R(n.overlays,(function(t){e._updateOverlay(t)})),e._updateOverlayContainer(n))})),t.on("element.marker.update",(function(t){var n=e._getOverlayContainer(t.element,!0);n&&st(n.html)[t.add?"add":"remove"](t.marker)})),t.on("diagram.clear",this.clear,this)};const Oo={__init__:["overlays"],overlays:["type",jo]};function Wo(t){Sr.call(this,t)}function Zo(t){return!t.altKey&&(t.ctrlKey||t.metaKey)}function Ho(t,e){return-1!==(t=E(t)?t:[t]).indexOf(e.key)||-1!==t.indexOf(e.keyCode)}function Yo(t){return t.shiftKey}function Uo(t,e){var n=this;this._config=t||{},this._eventBus=e,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),e.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),e.on("diagram.init",(function(){n._fire("init")})),e.on("attach",(function(){t&&t.bindTo&&n.bind(t.bindTo)})),e.on("detach",(function(){n.unbind()}))}p(Wo,Sr),Wo.prototype._modules=[ho,ro,To,Oo],Wo.prototype._moddleExtensions={},Uo.$inject=["config.keyboard","eventBus"],Uo.prototype._keydownHandler=function(t){this._keyHandler(t,"keyboard.keydown")},Uo.prototype._keyupHandler=function(t){this._keyHandler(t,"keyboard.keyup")},Uo.prototype._keyHandler=function(t,e){var n;(n=t.target)&&(pt(n,"input, textarea")||"true"===n.contentEditable)||this._eventBus.fire(e||"keyboard.keydown",{keyEvent:t})&&t.preventDefault()},Uo.prototype.bind=function(t){this.unbind(),this._node=t,yt.bind(t,"keydown",this._keydownHandler,!0),yt.bind(t,"keyup",this._keyupHandler,!0),this._fire("bind")},Uo.prototype.getBinding=function(){return this._node},Uo.prototype.unbind=function(){var t=this._node;t&&(this._fire("unbind"),yt.unbind(t,"keydown",this._keydownHandler,!0),yt.unbind(t,"keyup",this._keyupHandler,!0)),this._node=null},Uo.prototype._fire=function(t){this._eventBus.fire("keyboard."+t,{node:this._node})},Uo.prototype.addListener=function(t,e,n){_(t)&&(n=e,e=t,t=1e3),this._eventBus.on(n||"keyboard.keydown",t,e)},Uo.prototype.removeListener=function(t,e){this._eventBus.off(e||"keyboard.keydown",t)},Uo.prototype.hasModifier=function(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey},Uo.prototype.isCmd=Zo,Uo.prototype.isShift=Yo,Uo.prototype.isKey=Ho;var Vo=["c","C",67],Xo=["v","V",86],Jo=["y","Y",89],Qo=["z","Z",90];function qo(t,e){var n=this;t.on("editorActions.init",500,(function(t){n.registerBindings(e,t.editorActions)}))}qo.$inject=["eventBus","keyboard"],qo.prototype.registerBindings=function(t,e){function n(n,i){e.isRegistered(n)&&t.addListener(i)}n("undo",(function(t){var n=t.keyEvent;if(Zo(n)&&!Yo(n)&&Ho(Qo,n))return e.trigger("undo"),!0})),n("redo",(function(t){var n=t.keyEvent;if(Zo(n)&&(Ho(Jo,n)||Ho(Qo,n)&&Yo(n)))return e.trigger("redo"),!0})),n("copy",(function(t){var n=t.keyEvent;if(Zo(n)&&Ho(Vo,n))return e.trigger("copy"),!0})),n("paste",(function(t){var n=t.keyEvent;if(Zo(n)&&Ho(Xo,n))return e.trigger("paste"),!0})),n("stepZoom",(function(t){var n=t.keyEvent;if(Ho(["+","Add","="],n)&&Zo(n))return e.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(t){var n=t.keyEvent;if(Ho(["-","Subtract"],n)&&Zo(n))return e.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(t){var n=t.keyEvent;if(Ho("0",n)&&Zo(n))return e.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(t){if(Ho(["Backspace","Delete","Del"],t.keyEvent))return e.trigger("removeSelection"),!0}))};const Ko={__init__:["keyboard","keyboardBindings"],keyboard:["type",Uo],keyboardBindings:["type",qo]};var $o={moveSpeed:50,moveSpeedAccelerated:200};function ta(t,e,n){var i=this;this._config=$({},$o,t||{}),e.addListener((function(t){var n=t.keyEvent,r=i._config;if(e.isCmd(n)&&e.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,a=e.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:a,direction:o}),!0}})),this.moveCanvas=function(t){var e=0,i=0,r=t.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(t.direction){case"left":e=r;break;case"up":i=r;break;case"right":e=-r;break;case"down":i=-r}n.scroll({dx:e,dy:i})}}ta.$inject=["config.keyboardMove","keyboard","canvas"];const ea={__depends__:[Ko],__init__:["keyboardMove"],keyboardMove:["type",ta]};var na=/^djs-cursor-.*$/;function ia(t){var e=st(document.body);e.removeMatching(na),t&&e.add("djs-cursor-"+t)}function ra(){ia(null)}function oa(t,e){function n(){return!1}return t.once(e=e||"element.click",5e3,n),function(){t.off(e,n)}}function aa(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function ca(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sa(t,e){var n;function i(i){var r,o=n.start,a=n.button,c=yo(i),s=ca(c,o);!n.dragging&&(r=s,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&oa(t),ia("grab")),n.dragging&&(s=ca(c,n.last||n.start),e.scroll({dx:s.x,dy:s.y}),n.last=c),i.preventDefault()}function r(){yt.unbind(document,"mousemove",i),yt.unbind(document,"mouseup",r),n=null,ra()}t.on("element.mousedown",500,(function(t){return function(t){if(!mt(t.target,".djs-draggable")){var e=t.button;if(!(e>=2||t.ctrlKey||t.shiftKey||t.altKey))return n={button:e,start:yo(t)},yt.bind(document,"mousemove",i),yt.bind(document,"mouseup",r),!0}}(t.originalEvent)})),this.isActive=function(){return!!n}}sa.$inject=["eventBus","canvas"];const ua={__init__:["moveCanvas"],moveCanvas:["type",sa]};function la(t){return Math.log(t)/Math.log(10)}function fa(t,e){var n=la(t.min),i=la(t.max);return(Math.abs(n)+Math.abs(i))/e}var da=Math.sign||function(t){return t>=0?1:-1},pa={min:.2,max:4};function ma(t,e,n){t=t||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=q(this._handleWheel,this),this._totalDelta=0,this._scale=t.scale||.75;var i=this;e.on("canvas.init",(function(){i._init(!1!==t.enabled)}))}ma.$inject=["config.zoomScroll","eventBus","canvas"],ma.prototype.scroll=function(t){this._canvas.scroll(t)},ma.prototype.reset=function(){this._canvas.zoom("fit-viewport")},ma.prototype.zoom=function(t,e){var n=fa(pa,20);this._totalDelta+=t,Math.abs(this._totalDelta)>.1&&(this._zoom(t,e,n),this._totalDelta=0)},ma.prototype._handleWheel=function(t){if(!mt(t.target,".djs-scrollable",!0)){var e=this._container;t.preventDefault();var n,i=t.ctrlKey,r=t.shiftKey,o=-1*this._scale;if(o*=i?0===t.deltaMode?.02:.32:0===t.deltaMode?1:16,i){var a=e.getBoundingClientRect(),c={x:t.clientX-a.left,y:t.clientY-a.top};n=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*da(t.deltaY)*o,this.zoom(n,c)}else this.scroll(n=r?{dx:o*t.deltaY,dy:0}:{dx:o*t.deltaX,dy:o*t.deltaY})}},ma.prototype.stepZoom=function(t,e){var n=fa(pa,10);this._zoom(t,e,n)},ma.prototype._zoom=function(t,e,n){var i,r=this._canvas,o=t>0?1:-1,a=la(r.zoom()),c=Math.round(a/n)*n,s=Math.pow(10,c+=n*o);r.zoom((i=pa,Math.max(i.min,Math.min(i.max,s))),e)},ma.prototype.toggle=function(t){var e=this._enabled;return void 0===t&&(t=!e),e!==t&&yt[t?"bind":"unbind"](this._container,"wheel",this._handleWheel,!1),this._enabled=t,t},ma.prototype._init=function(t){this.toggle(t)};const ha={__init__:["zoomScroll"],zoomScroll:["type",ma]};function va(t){Wo.call(this,t)}p(va,Wo),va.prototype._modules=[].concat(Wo.prototype._modules,va.prototype._navigationModules=[ea,ua,ha]);var ba=o((function(t){
|
|
1
|
+
import{r as t,f as e,h as n,H as i,d as r}from"./p-4bc39b24.js";import{c as o,a,g as c}from"./p-dfe5a97d.js";import{k as s}from"./p-ecf7ddf4.js";import{g as u,s as l}from"./p-5777d9de.js";import{c as f}from"./p-ad2e21d2.js";import"./p-022fe49e.js";var d,p=o((function(t){t.exports="function"==typeof Object.create?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}})),m=(function(t){var e=t.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var i=Math.log(Math.pow(2,t))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,t/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r<Math.floor(i);r++)a=Math.floor(Math.random()*n).toString(n)+a;if(o){var c=Math.pow(n,o);a=Math.floor(Math.random()*c).toString(n)+a}var s=parseInt(a,n);return s!==1/0&&s>=Math.pow(2,t)?e(t,n):a};e.rack=function(t,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");t+=i}var c=e(t,n)}while(Object.hasOwnProperty.call(o,c));return o[c]=r,c},o=r.hats={};return r.get=function(t){return r.hats[t]},r.set=function(t,e){return r.hats[t]=e,r},r.bits=t||128,r.base=n||16,r}}(d={exports:{}}),d.exports);function h(t){if(!(this instanceof h))return new h(t);this._seed=(t=t||[128,36,1]).length?m.rack(t[0],t[1],t[2]):t}function v(t){return Array.prototype.concat.apply([],t)}h.prototype.next=function(t){return this._seed(t||!0)},h.prototype.nextPrefixed=function(t,e){var n;do{n=t+this.next(!0)}while(this.assigned(n));return this.claim(n,e),n},h.prototype.claim=function(t,e){this._seed.set(t,e||!0)},h.prototype.assigned=function(t){return this._seed.get(t)||!1},h.prototype.unclaim=function(t){delete this._seed.hats[t]},h.prototype.clear=function(){var t,e=this._seed.hats;for(t in e)this.unclaim(t)};var b=Object.prototype.toString,g=Object.prototype.hasOwnProperty;function y(t){return void 0===t}function x(t){return void 0!==t}function w(t){return null==t}function E(t){return"[object Array]"===b.call(t)}function k(t){return"[object Object]"===b.call(t)}function I(t){return"[object Number]"===b.call(t)}function _(t){var e=b.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object AsyncGeneratorFunction]"===e||"[object Proxy]"===e}function M(t){return"[object String]"===b.call(t)}function S(t){if(!E(t))throw new Error("must supply array")}function B(t,e){return g.call(t,e)}function N(t,e){var n;return e=V(e),R(t,(function(t,i){if(e(t,i))return n=t,!1})),n}function A(t,e){e=V(e);var n=E(t)?-1:void 0;return R(t,(function(t,i){if(e(t,i))return n=i,!1})),n}function D(t,e){var n=[];return R(t,(function(t,i){e(t,i)&&n.push(t)})),n}function R(t,e){var n;if(!y(t)){var i=E(t)?J:X;for(var r in t)if(B(t,r)&&!1===e(n=t[r],i(r)))return n}}function C(t,e){return y(t)?[]:(S(t),e=V(e),t.filter((function(t,n){return!e(t,n)})))}function T(t,e,n){return R(t,(function(t,i){n=e(n,t,i)})),n}function P(t,e){return!!T(t,(function(t,n,i){return t&&e(n,i)}),!0)}function z(t,e){return!!N(t,e)}function j(t,e){var n=[];return R(t,(function(t,i){n.push(e(t,i))})),n}function G(t){return t&&Object.keys(t)||[]}function F(t){return G(t).length}function L(t){return j(t,(function(t){return t}))}function O(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=U(e),R(t,(function(t){var i=e(t)||"_",r=n[i];r||(r=n[i]=[]),r.push(t)})),n}function W(t){t=U(t);for(var e={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];R(i,(function(n){return O(n,t,e)}));var o=j(e,(function(t){return t[0]}));return o}var Z=W;function H(t,e){e=U(e);var n=[];return R(t,(function(t,i){for(var r=e(t,i),o={d:r,v:t},a=0;a<n.length;a++)if(r<n[a].d)return void n.splice(a,0,o);n.push(o)})),j(n,(function(t){return t.v}))}function Y(t){return function(e){return P(t,(function(t,n){return e[n]===t}))}}function U(t){return _(t)?t:function(e){return e[t]}}function V(t){return _(t)?t:function(e){return e===t}}function X(t){return t}function J(t){return Number(t)}function Q(t,e){var n,i,r,o;function a(){var a=Date.now(),s=o+e-a;if(s>0)return c(s);t.apply(r,i),n=o=i=r=void 0}function c(t){n=setTimeout(a,t)}return function(){o=Date.now();for(var t=arguments.length,a=new Array(t),s=0;s<t;s++)a[s]=arguments[s];i=a,r=this,n||c(e)}}function q(t,e){return t.bind(e)}function K(){return(K=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function $(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return K.apply(void 0,[t].concat(n))}function tt(t,e){var n={},i=Object(t);return R(e,(function(e){e in i&&(n[e]=t[e])})),n}function et(t,e){var n={};return R(Object(t),(function(t,i){-1===e.indexOf(i)&&(n[i]=t)})),n}const nt=Object.freeze({__proto__:null,assign:$,bind:q,debounce:Q,ensureArray:S,every:P,filter:D,find:N,findIndex:A,flatten:v,forEach:R,get:function(t,e,n){var i=t;return R(e,(function(t){if(w(i))return i=void 0,!1;i=i[t]})),y(i)?n:i},groupBy:O,has:B,isArray:E,isDefined:x,isFunction:_,isNil:w,isNumber:I,isObject:k,isString:M,isUndefined:y,keys:G,map:j,matchPattern:Y,merge:function t(e){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?(R(i,(function(n){n&&k(n)&&R(n,(function(n,i){if("__proto__"!==i){var r=e[i];k(n)?(k(r)||(r={}),e[i]=t(r,n)):e[i]=n}}))})),e):e},omit:et,pick:tt,reduce:T,set:function(t,e,n){var i=t;return R(e,(function(t,r){if("__proto__"===t)throw new Error("illegal key: __proto__");var o=e[r+1],a=i[t];x(o)&&w(a)&&(a=i[t]=isNaN(+o)?{}:[]),y(o)?y(n)?delete i[t]:i[t]=n:i=a})),t},size:F,some:z,sortBy:H,throttle:function(t,e){var n=!1;return function(){n||(t.apply(void 0,arguments),n=!0,setTimeout((function(){n=!1}),e))}},unionBy:Z,uniqueBy:W,values:L,without:C});function it(t,e,n){return 2==arguments.length?t.getAttribute(e):null===n?t.removeAttribute(e):(t.setAttribute(e,n),t)}var rt=[].indexOf,ot=function(t,e){if(rt)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1},at=/\s+/,ct=Object.prototype.toString;function st(t){return new ut(t)}function ut(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}function lt(t){for(;t.childNodes.length;)t.removeChild(t.childNodes[0]);return t}ut.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~ot(e,t)||e.push(t),this.el.className=e.join(" "),this},ut.prototype.remove=function(t){if("[object RegExp]"==ct.call(t))return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=ot(e,t);return~n&&e.splice(n,1),this.el.className=e.join(" "),this},ut.prototype.removeMatching=function(t){for(var e=this.array(),n=0;n<e.length;n++)t.test(e[n])&&this.remove(e[n]);return this},ut.prototype.toggle=function(t,e){return this.list?(void 0!==e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(void 0!==e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},ut.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(at);return""===t[0]&&t.shift(),t},ut.prototype.has=ut.prototype.contains=function(t){return this.list?this.list.contains(t):!!~ot(this.array(),t)};var ft="undefined"!=typeof Element?Element.prototype:{},dt=ft.matches||ft.matchesSelector||ft.webkitMatchesSelector||ft.mozMatchesSelector||ft.msMatchesSelector||ft.oMatchesSelector,pt=function(t,e){if(!t||1!==t.nodeType)return!1;if(dt)return dt.call(t,e);for(var n=t.parentNode.querySelectorAll(e),i=0;i<n.length;i++)if(n[i]==t)return!0;return!1};function mt(t,e,n){for(var i=n?t:t.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(pt(i,e))return i;i=i.parentNode}return pt(i,e)?i:null}var ht,vt=window.addEventListener?"addEventListener":"attachEvent",bt=window.removeEventListener?"removeEventListener":"detachEvent",gt="addEventListener"!==vt?"on":"",yt={bind:function(t,e,n,i){return t[vt](gt+e,n,i||!1),n},unbind:function(t,e,n,i){return t[bt](gt+e,n,i||!1),n}},xt=["focus","blur"],wt=function(t,e,n,i,r){return-1!==xt.indexOf(n)&&(r=!0),yt.bind(t,n,(function(n){n.delegateTarget=mt(n.target||n.srcElement,e,!0),n.delegateTarget&&i.call(t,n)}),r)},Et=function(t,e,n,i){return-1!==xt.indexOf(e)&&(i=!0),yt.unbind(t,e,n,i)},kt=function(t,e){if("string"!=typeof t)throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i)return(r=e.createElement("html")).innerHTML=t,r.removeChild(r.lastChild);var r,o=_t[i]||_t._default,a=o[0],c=o[1],s=o[2];for((r=e.createElement("div")).innerHTML=c+t+s;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=e.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},It=!1;"undefined"!=typeof document&&((ht=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',It=!ht.getElementsByTagName("link").length,ht=void 0);var _t={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:It?[1,"X<div>","</div>"]:[0,"",""]};function Mt(t,e){return(e=e||document).querySelector(t)}function St(t,e){return(e=e||document).querySelectorAll(t)}function Bt(t){t.parentNode&&t.parentNode.removeChild(t)}function Nt(t,e){return e.appendChild(function(t,e){if(t.ownerDocument!==e.ownerDocument)try{return e.ownerDocument.importNode(t,!0)}catch(t){}return t}(t,e))}function At(t,e){return Nt(e,t),t}_t.td=_t.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],_t.option=_t.optgroup=[1,'<select multiple="multiple">',"</select>"],_t.thead=_t.tbody=_t.colgroup=_t.caption=_t.tfoot=[1,"<table>","</table>"],_t.polyline=_t.ellipse=_t.polygon=_t.circle=_t.text=_t.line=_t.path=_t.rect=_t.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Dt={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Rt(t,e,n){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Dt[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),t.style[i]=n):t.setAttributeNS(null,e,n)}function Ct(t,e,n){if("string"==typeof e){if(void 0===n)return function(t,e){return Dt[e]?t.style[e]:t.getAttributeNS(null,e)}(t,e);Rt(t,e,n)}else!function(t,e){var n,i,r=Object.keys(e);for(n=0;i=r[n];n++)Rt(t,i,e[i])}(t,e);return t}function Tt(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}var Pt=/\s+/,zt=Object.prototype.toString;function jt(t){return void 0!==t}function Gt(t){return new Ft(t)}function Ft(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}function Lt(t){var e=t.parentNode;return e&&e.removeChild(t),t}function Ot(t){for(var e;e=t.firstChild;)Lt(e);return t}function Wt(t){return t.cloneNode(!0)}Ft.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~Tt(e,t)||e.push(t),jt(this.el.className.baseVal)?this.el.className.baseVal=e.join(" "):this.el.className=e.join(" "),this},Ft.prototype.remove=function(t){if("[object RegExp]"===zt.call(t))return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=Tt(e,t);return~n&&e.splice(n,1),this.el.className.baseVal=e.join(" "),this},Ft.prototype.removeMatching=function(t){for(var e=this.array(),n=0;n<e.length;n++)t.test(e[n])&&this.remove(e[n]);return this},Ft.prototype.toggle=function(t,e){return this.list?(jt(e)?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(jt(e)?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},Ft.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(Pt);return""===t[0]&&t.shift(),t},Ft.prototype.has=Ft.prototype.contains=function(t){return this.list?this.list.contains(t):!!~Tt(this.array(),t)};var Zt="http://www.w3.org/2000/svg",Ht='<svg xmlns="'+Zt+'"';function Yt(t){var e=!1;"<svg"===t.substring(0,4)?-1===t.indexOf(Zt)&&(t=Ht+t.substring(4)):(t=Ht+">"+t+"</svg>",e=!0);var n=function(t){var e;return(e=new DOMParser).async=!1,e.parseFromString(t,"text/xml")}(t);if(!e)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function Ut(t,e){var n;return"<"===t.charAt(0)?(n=Yt(t).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Zt,t),e&&Ct(n,e),n}var Vt=Ut("svg");function Xt(t,e){var n,i,r=Object.keys(e);for(n=0;i=r[n];n++)t[i]=e[i];return t}function Jt(t){return t?Vt.createSVGTransformFromMatrix(t):Vt.createSVGTransform()}var Qt=/([&<>]{1})/g,qt=/([\n\r"]{1})/g,Kt={"&":"&","<":"<",">":">",'"':"'"};function $t(t,e){return t.replace(e,(function(t,e){return Kt[e]||e}))}function te(t,e){var n,i,r,o,a;switch(t.nodeType){case 3:e.push($t(t.textContent,Qt));break;case 1:if(e.push("<",t.tagName),t.hasAttributes())for(n=0,i=(r=t.attributes).length;n<i;++n)o=r.item(n),e.push(" ",o.name,'="',$t(o.value,qt),'"');if(t.hasChildNodes()){for(e.push(">"),n=0,i=(a=t.childNodes).length;n<i;++n)te(a.item(n),e);e.push("</",t.tagName,">")}else e.push("/>");break;case 8:e.push("\x3c!--",$t(t.nodeValue,Qt),"--\x3e");break;case 4:e.push("<![CDATA[",t.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+t.nodeType)}return e}function ee(t,e){if(void 0!==e){try{!function(t,e){var n=Yt(e);if(Ot(t),e){(function(t){return"#document-fragment"===t.nodeName})(n)||(n=n.documentElement);for(var i=Array.prototype.slice.call(n.childNodes),r=0;r<i.length;r++)Nt(i[r],t)}}(t,e)}catch(t){throw new Error("error parsing SVG: "+t.message)}return t}return function(t){for(var e=t.firstChild,n=[];e;)te(e,n),e=e.nextSibling;return n.join("")}(t)}function ne(t,e){return e instanceof SVGMatrix?t.createSVGTransformFromMatrix(e):e}function ie(t,e){var n=t.transform.baseVal;return e&&(Array.isArray(e)||(e=[e]),function(t,e){var n,i;for(t.clear(),n=0;i=e[n];n++)t.appendItem(ne(t,i))}(n,e)),n.consolidate()}var re=/^class /;function oe(t){return"[object Array]"===Object.prototype.toString.call(t)}function ae(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ce(){var t=Array.prototype.slice.call(arguments);1===t.length&&oe(t[0])&&(t=t[0]);var e=t.pop();return e.$inject=t,e}var se=/constructor\s*[^(]*\(\s*([^)]*)\)/m,ue=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,le=/\/\*([^*]*)\*\//m;function fe(t){if("function"!=typeof t)throw new Error('Cannot annotate "'+t+'". Expected a function!');var e=t.toString().match(function(t){return re.test(t.toString())}(t)?se:ue);return e&&e[1]&&e[1].split(",").map((function(t){return(e=t.match(le))?e[1].trim():t.trim()}))||[]}function de(){var t=[];this.factory=function(e,n){return t.push([e,"factory",n]),this},this.value=function(e,n){return t.push([e,"value",n]),this},this.type=function(e,n){return t.push([e,"type",n]),this},this.forEach=function(e){t.forEach(e)}}function pe(t,e){e=e||{get:function(t,e){if(n.push(t),!1===e)return null;throw a('No provider for "'+t+'"!')}};var n=[],i=this._providers=Object.create(e._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(t){var e=n.join(" -> ");return n.length=0,new Error(e?t+" (Resolving: "+e+")":t)},c=function(t,o){if(!i[t]&&-1!==t.indexOf(".")){for(var s=t.split("."),u=c(s.shift());s.length;)u=u[s.shift()];return u}if(ae(r,t))return r[t];if(ae(i,t)){if(-1!==n.indexOf(t))throw n.push(t),a("Cannot resolve circular dependency!");return n.push(t),r[t]=i[t][0](i[t][1]),n.pop(),r[t]}return e.get(t,o)},s=function(t,e){if(void 0===e&&(e={}),"function"!=typeof t){if(!oe(t))throw new Error('Cannot invoke "'+t+'". Expected a function!');t=ce(t.slice())}return{fn:t,dependencies:(t.$inject||fe(t)).map((function(t){return ae(e,t)?e[t]:c(t)}))}},u=function(t){var e=s(t);return new(Function.prototype.bind.apply(e.fn,[null].concat(e.dependencies)))},l=function(t,e,n){var i=s(t,n);return i.fn.apply(e,i.dependencies)},f=function(t){return ce((function(e){return t.get(e)}))},d={factory:l,type:u,value:function(t){return t}};t.forEach((function(t){function e(t,e){return"value"!==t&&oe(e)&&(e=ce(e.slice())),e}if(t instanceof de)t.forEach((function(t){var n=t[1];i[t[0]]=[d[n],e(n,t[2]),n]}));else if("object"==typeof t)if(t.__exports__){var n=Object.keys(t).reduce((function(e,n){return"__"!==n.substring(0,2)&&(e[n]=t[n]),e}),Object.create(null)),r=new pe((t.__modules__||[]).concat([n]),o),a=ce((function(t){return r.get(t)}));t.__exports__.forEach((function(t){i[t]=[a,t,"private",r]}))}else Object.keys(t).forEach((function(n){if("private"!==t[n][2]){var r=t[n][0];i[n]=[d[r],e(r,t[n][1]),r]}else i[n]=t[n]}))})),this.get=c,this.invoke=l,this.instantiate=u,this.createChild=function(t,e){if(e&&e.length){var n,r,a,c,s=Object.create(null),u=Object.create(null),l=[],d=[],p=[];for(var m in i)n=i[m],-1!==e.indexOf(m)&&("private"===n[2]?-1===(r=l.indexOf(n[3]))?(a=n[3].createChild([],e),c=f(a),l.push(n[3]),d.push(a),p.push(c),s[m]=[c,m,"private",a]):s[m]=[p[r],m,"private",d[r]]:s[m]=[n[2],n[1]],u[m]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||e.forEach((function(t){-1!==n[1].$scope.indexOf(t)&&(s[m]=[n[2],n[1]],u[t]=!0)}));e.forEach((function(t){if(!u[t])throw new Error('No provider for "'+t+'". Cannot use provider from the parent!')})),t.unshift(s)}return new pe(t,o)}}function me(t,e){var n=this;t.on(["render.shape","render.connection"],e=e||1e3,(function(t,e){var i=t.type,r=e.element,o=e.gfx;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r):n.drawConnection(o,r)})),t.on(["render.getShapePath","render.getConnectionPath"],e,(function(t,e){if(n.canRender(e))return"render.getShapePath"===t.type?n.getShapePath(e):n.getConnectionPath(e)}))}function he(t){return t.join(",").replace(/,?([A-z]),?/g,"$1")}function ve(t){for(var e,n="",i=0;e=t[i];i++)n+=e.x+","+e.y+" ";return n}function be(t,e){var n=Ut("polyline");return Ct(n,{points:ve(t)}),e&&Ct(n,e),n}function ge(t){return D(t,(function(e){return!N(t,(function(t){return t!==e&&ye(e,t)}))}))}function ye(t,e){if(e){if(t===e)return e;if(t.parent)return ye(t.parent,e)}}function xe(t,e,n){var i=!n||-1===t.indexOf(e);return i&&t.push(e),i}function we(t,e,n){n=n||0,E(t)||(t=[t]),R(t,(function(t,i){var r=e(t,i,n);E(r)&&r.length&&we(r,e,n+1)}))}function Ee(t,e){return function(t,e){var n=[],i=[];return we(t,(function(t){xe(n,t,e);var r=t.children;if(r&&xe(i,r,e))return r})),n}(t,!e)}function ke(t,e){var n,i,r,o;return e=!!e,E(t)||(t=[t]),R(t,(function(t){var a=t;t.waypoints&&!e&&(a=ke(t.waypoints,!0));var c=a.x,s=a.y,u=a.height||0,l=a.width||0;(c<n||void 0===n)&&(n=c),(s<i||void 0===i)&&(i=s),(c+l>r||void 0===r)&&(r=c+l),(s+u>o||void 0===o)&&(o=s+u)})),{x:n,y:i,height:o-i,width:r-n}}function Ie(t){return"waypoints"in t?"connection":"x"in t?"shape":"root"}function _e(t){return!(!t||!t.isFrame)}function Me(t,e){return $({},t||{},e||{})}function Se(t,e){me.call(this,t,1),this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=e.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}me.prototype.canRender=function(){},me.prototype.drawShape=function(){},me.prototype.drawConnection=function(){},me.prototype.getShapePath=function(){},me.prototype.getConnectionPath=function(){},p(Se,me),Se.prototype.canRender=function(){return!0},Se.prototype.drawShape=function(t,e){var n=Ut("rect");return Ct(n,{x:0,y:0,width:e.width||0,height:e.height||0}),_e(e)?Ct(n,this.FRAME_STYLE):Ct(n,this.SHAPE_STYLE),At(t,n),n},Se.prototype.drawConnection=function(t,e){var n=be(e.waypoints,this.CONNECTION_STYLE);return At(t,n),n},Se.prototype.getShapePath=function(t){var e=t.width;return he([["M",t.x,t.y],["l",e,0],["l",0,t.height],["l",-e,0],["z"]])},Se.prototype.getConnectionPath=function(t){var e,n,i=t.waypoints,r=[];for(e=0;n=i[e];e++)r.push([0===e?"M":"L",(n=n.original||n).x,n.y]);return he(r)},Se.$inject=["eventBus","styles"];const Be={__init__:["defaultRenderer"],defaultRenderer:["type",Se],styles:["type",function(){var t={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},e=this;this.cls=function(t,e,n){return $(this.style(e,n),{class:t})},this.style=function(e,n){E(e)||n||(n=e,e=[]);var i=T(e,(function(e,n){return $(e,t[n]||{})}),{});return n?$(i,n):i},this.computeStyle=function(t,n,i){return E(n)||(i=n,n=[]),e.style(n||[],$({},i,t||{}))}}]};function Ne(t,e){if(!t||!e)return-1;var n=t.indexOf(e);return-1!==n&&t.splice(n,1),n}function Ae(t,e,n){if(t&&e){"number"!=typeof n&&(n=-1);var i=t.indexOf(e);if(-1!==i){if(i===n)return;if(-1===n)return;t.splice(i,1)}-1!==n?t.splice(n,0,e):t.push(e)}}function De(t,e){return t&&e?t.indexOf(e):-1}function Re(t,e){return t&&e?Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):-1}function Ce(t,e,n,i){if(void 0===i&&(i=5),!t||!e||!n)return!1;var r=(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x),o=Re(t,e);return Math.abs(r/o)<=i}function Te(t,e){var n;return function(t){var e,n=(e=E(t)?t:[t,void 0]).slice().shift();return P(e,(function(t){return Math.abs(n.y-t.y)<=2}))}(n=E(t)?t:[t,e])?"h":!!function(t){var e,n=(e=E(t)?t:[t,void 0]).slice().shift();return P(e,(function(t){return Math.abs(n.x-t.x)<=2}))}(n)&&"v"}function Pe(t,e,n){return t.x>e.x-(n=n||0)&&t.y>e.y-n&&t.x<e.x+e.width+n&&t.y<e.y+e.height+n}function ze(t,e){return{x:Math.round(t.x+(e.x-t.x)/2),y:Math.round(t.y+(e.y-t.y)/2)}}var je=/,?([a-z]),?/gi,Ge=parseFloat,Fe=Math,Le=Fe.PI,Oe=Fe.min,We=Fe.max,Ze=Fe.pow,He=Fe.abs,Ye=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,Ue=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,Ve=Array.isArray||function(t){return t instanceof Array};function Xe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Je(t){if("function"==typeof t||Object(t)!==t)return t;var e=new t.constructor;for(var n in t)Xe(t,n)&&(e[n]=Je(t[n]));return e}function Qe(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return t.push(t.splice(n,1)[0])}function qe(t){var e=qe.ps=qe.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout((function(){for(var n in e)Xe(e,n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])})),e[t]}function Ke(t,e,n,i){return 1===arguments.length&&(e=t.y,n=t.width,i=t.height,t=t.x),{x:t,y:e,width:n,height:i,x2:t+n,y2:e+i}}function $e(){return this.join(",").replace(je,"$1")}function tn(t){var e=Je(t);return e.toString=$e,e}function en(t,e,n,i,r,o,a,c,s){var u=1-s,l=Ze(u,3),f=Ze(u,2),d=s*s*s,p=l*e+3*f*s*i+3*u*s*s*o+d*c;return{x:sn(l*t+3*f*s*n+3*u*s*s*r+d*a),y:sn(p)}}function nn(t){var e=hn.apply(null,t);return Ke(e.x0,e.y0,e.x1-e.x0,e.y1-e.y0)}function rn(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height}function on(t,e,n,i,r){return t*(t*(-3*e+9*n-9*i+3*r)+6*e-12*n+6*i)-3*e+3*n}function an(t,e,n,i,r,o,a,c,s){null==s&&(s=1);for(var u=(s=s>1?1:s<0?0:s)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,p=0;p<12;p++){var m=u*l[p]+u,h=on(m,t,n,r,a),v=on(m,e,i,o,c);d+=f[p]*Fe.sqrt(h*h+v*v)}return u*d}function cn(t,e,n,i,r,o,a,c){if(!(We(t,n)<Oe(r,a)||Oe(t,n)>We(r,a)||We(e,i)<Oe(o,c)||Oe(e,i)>We(o,c))){var s=(t*i-e*n)*(o-c)-(e-i)*(r*c-o*a),u=(t-n)*(o-c)-(e-i)*(r-a);if(u){var l=sn(((t*i-e*n)*(r-a)-(t-n)*(r*c-o*a))/u),f=sn(s/u),d=+l.toFixed(2),p=+f.toFixed(2);if(!(d<+Oe(t,n).toFixed(2)||d>+We(t,n).toFixed(2)||d<+Oe(r,a).toFixed(2)||d>+We(r,a).toFixed(2)||p<+Oe(e,i).toFixed(2)||p>+We(e,i).toFixed(2)||p<+Oe(o,c).toFixed(2)||p>+We(o,c).toFixed(2)))return{x:l,y:f}}}}function sn(t){return Math.round(1e11*t)/1e11}function un(t,e,n){if(i=nn(t),r=nn(e),i=Ke(i),!(rn(r=Ke(r),i.x,i.y)||rn(r,i.x2,i.y)||rn(r,i.x,i.y2)||rn(r,i.x2,i.y2)||rn(i,r.x,r.y)||rn(i,r.x2,r.y)||rn(i,r.x,r.y2)||rn(i,r.x2,r.y2)||(i.x<r.x2&&i.x>r.x||r.x<i.x2&&r.x>i.x)&&(i.y<r.y2&&i.y>r.y||r.y<i.y2&&r.y>i.y)))return n?0:[];for(var i,r,o=an.apply(0,t),a=an.apply(0,e),c=fn(t)?1:~~(o/5)||1,s=fn(e)?1:~~(a/5)||1,u=[],l=[],f={},d=n?0:[],p=0;p<c+1;p++){var m=en.apply(0,t.concat(p/c));u.push({x:m.x,y:m.y,t:p/c})}for(p=0;p<s+1;p++)m=en.apply(0,e.concat(p/s)),l.push({x:m.x,y:m.y,t:p/s});for(p=0;p<c;p++)for(var h=0;h<s;h++){var v,b=u[p],g=u[p+1],y=l[h],x=l[h+1],w=He(g.x-b.x)<.01?"y":"x",E=He(x.x-y.x)<.01?"y":"x",k=cn(b.x,b.y,g.x,g.y,y.x,y.y,x.x,x.y);if(k){if(f[v=k.x.toFixed(9)+"#"+k.y.toFixed(9)])continue;f[v]=!0;var I=b.t+He((k[w]-b[w])/(g[w]-b[w]))*(g.t-b.t),_=y.t+He((k[E]-y[E])/(x[E]-y[E]))*(x.t-y.t);I>=0&&I<=1&&_>=0&&_<=1&&(n?d++:d.push({x:k.x,y:k.y,t1:I,t2:_}))}}return d}function ln(t){var e=qe(t);if(e.abs)return tn(e.abs);if(Ve(t)&&Ve(t&&t[0])||(t=function(t){if(!t)return null;var e=qe(t);if(e.arr)return Je(e.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return Ve(t)&&Ve(t[0])&&(i=Je(t)),i.length||String(t).replace(Ye,(function(t,e,r){var o=[],a=e.toLowerCase();for(r.replace(Ue,(function(t,e){e&&o.push(+e)})),"m"==a&&o.length>2&&(i.push([e].concat(o.splice(0,2))),a="l",e="m"==e?"l":"L");o.length>=n[a]&&(i.push([e].concat(o.splice(0,n[a]))),n[a]););})),i.toString=qe.toString,e.arr=Je(i),i}(t)),!t||!t.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,c=0,s=0;"M"==t[0][0]&&(a=r=+t[0][1],c=o=+t[0][2],s++,i[0]=["M",r,o]);for(var u,l,f=s,d=t.length;f<d;f++){if(i.push(u=[]),(n=(l=t[f])[0])!=n.toUpperCase())switch(u[0]=n.toUpperCase(),u[0]){case"A":u[1]=l[1],u[2]=l[2],u[3]=l[3],u[4]=l[4],u[5]=l[5],u[6]=+l[6]+r,u[7]=+l[7]+o;break;case"V":u[1]=+l[1]+o;break;case"H":u[1]=+l[1]+r;break;case"M":a=+l[1]+r,c=+l[2]+o;default:for(var p=1,m=l.length;p<m;p++)u[p]=+l[p]+(p%2?r:o)}else for(var h=0,v=l.length;h<v;h++)u[h]=l[h];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=$e,e.abs=tn(i),i}function fn(t){return t[0]===t[2]&&t[1]===t[3]&&t[4]===t[6]&&t[5]===t[7]}function dn(t,e,n,i){return[t,e,n,i,n,i]}function pn(t,e,n,i,r,o){var a=1/3,c=2/3;return[a*t+c*n,a*e+c*i,a*r+c*n,a*o+c*i,r,o]}function mn(t,e,n,i,r,o,a,c,s,u){var l,f,d=120*Le/180,p=Le/180*(+r||0),m=[],h=(f=function(t,e,n){return{x:t*Fe.cos(n)-e*Fe.sin(n),y:t*Fe.sin(n)+e*Fe.cos(n)}},function t(){var e=Array.prototype.slice.call(arguments,0),n=e.join("␀"),i=t.cache=t.cache||{},r=t.count=t.count||[];return Xe(i,n)?(Qe(r,n),i[n]):(r.length>=1e3&&delete i[r.shift()],r.push(n),i[n]=f.apply(0,e),i[n])});if(u)I=u[0],_=u[1],E=u[2],k=u[3];else{e=(l=h(t,e,-p)).y;var v=((t=l.x)-(c=(l=h(c,s,-p)).x))/2,b=(e-(s=l.y))/2,g=v*v/(n*n)+b*b/(i*i);g>1&&(n*=g=Fe.sqrt(g),i*=g);var y=n*n,x=i*i,w=(o==a?-1:1)*Fe.sqrt(He((y*x-y*b*b-x*v*v)/(y*b*b+x*v*v))),E=w*n*b/i+(t+c)/2,k=w*-i*v/n+(e+s)/2,I=Fe.asin(((e-k)/i).toFixed(9)),_=Fe.asin(((s-k)/i).toFixed(9));(I=t<E?Le-I:I)<0&&(I=2*Le+I),(_=c<E?Le-_:_)<0&&(_=2*Le+_),a&&I>_&&(I-=2*Le),!a&&_>I&&(_-=2*Le)}var M=_-I;if(He(M)>d){var S=_,B=c,N=s;m=mn(c=E+n*Fe.cos(_=I+d*(a&&_>I?1:-1)),s=k+i*Fe.sin(_),n,i,r,0,a,B,N,[_,S,E,k])}M=_-I;var A=Fe.cos(I),D=Fe.sin(I),R=Fe.cos(_),C=Fe.sin(_),T=Fe.tan(M/4),P=4/3*n*T,z=4/3*i*T,j=[t,e],G=[t+P*D,e-z*A],F=[c+P*C,s-z*R],L=[c,s];if(G[0]=2*j[0]-G[0],G[1]=2*j[1]-G[1],u)return[G,F,L].concat(m);for(var O=[],W=0,Z=(m=[G,F,L].concat(m).join().split(",")).length;W<Z;W++)O[W]=W%2?h(m[W-1],m[W],p).y:h(m[W],m[W+1],p).x;return O}function hn(t,e,n,i,r,o,a,c){for(var s,u,l,f,d,p,m,h,v=[],b=[[],[]],g=0;g<2;++g)if(0==g?(u=6*t-12*n+6*r,s=-3*t+9*n-9*r+3*a,l=3*n-3*t):(u=6*e-12*i+6*o,s=-3*e+9*i-9*o+3*c,l=3*i-3*e),He(s)<1e-12){if(He(u)<1e-12)continue;0<(f=-l/u)&&f<1&&v.push(f)}else h=Fe.sqrt(m=u*u-4*l*s),m<0||(0<(d=(-u+h)/(2*s))&&d<1&&v.push(d),0<(p=(-u-h)/(2*s))&&p<1&&v.push(p));for(var y,x=v.length,w=x;x--;)b[0][x]=(y=1-(f=v[x]))*y*y*t+3*y*y*f*n+3*y*f*f*r+f*f*f*a,b[1][x]=y*y*y*e+3*y*y*f*i+3*y*f*f*o+f*f*f*c;return b[0][w]=t,b[1][w]=e,b[0][w+1]=a,b[1][w+1]=c,b[0].length=b[1].length=w+2,{x0:Oe.apply(0,b[0]),y0:Oe.apply(0,b[1]),x1:We.apply(0,b[0]),y1:We.apply(0,b[1])}}function vn(t){var e=qe(t);if(e.curve)return tn(e.curve);for(var n=ln(t),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(t,e,n){var i,r;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(mn.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"==n||"S"==n?(i=2*e.x-e.bx,r=2*e.y-e.by):(i=e.x,r=e.y),t=["C",i,r].concat(t.slice(1));break;case"T":"Q"==n||"T"==n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(pn(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(pn(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(dn(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(dn(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(dn(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(dn(e.x,e.y,e.X,e.Y))}return t},o=function(t,e){if(t[e].length>7){t[e].shift();for(var i=t[e];i.length;)a[e]="A",t.splice(e++,0,["C"].concat(i.splice(0,6)));t.splice(e,1),l=n.length}},a=[],c="",s="",u=0,l=n.length;u<l;u++){n[u]&&(c=n[u][0]),"C"!=c&&(a[u]=c,u&&(s=a[u-1])),n[u]=r(n[u],i,s),"A"!=a[u]&&"C"==c&&(a[u]="C"),o(n,u);var f=n[u],d=f.length;i.x=f[d-2],i.y=f[d-1],i.bx=Ge(f[d-4])||i.x,i.by=Ge(f[d-3])||i.y}return e.curve=tn(n),n}var bn=function(t,e,n){t=vn(t),e=vn(e);for(var i,r,o,a,c,s,u,l,f,d,p=n?0:[],m=0,h=t.length;m<h;m++){var v=t[m];if("M"==v[0])i=c=v[1],r=s=v[2];else{"C"==v[0]?(f=[i,r].concat(v.slice(1)),i=f[6],r=f[7]):(f=[i,r,i,r,c,s,c,s],i=c,r=s);for(var b=0,g=e.length;b<g;b++){var y=e[b];if("M"==y[0])o=u=y[1],a=l=y[2];else{"C"==y[0]?(d=[o,a].concat(y.slice(1)),o=d[6],a=d[7]):(d=[o,a,o,a,u,l,u,l],o=u,a=l);var x=un(f,d,n);if(n)p+=x;else{for(var w=0,E=x.length;w<E;w++)x[w].segment1=m,x[w].segment2=b,x[w].bez1=f,x[w].bez2=d;p=p.concat(x)}}}}}return p};function gn(t){return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function yn(t){return{x:Math.round(t.x),y:Math.round(t.y)}}function xn(t){return{top:t.y,right:t.x+(t.width||0),bottom:t.y+(t.height||0),left:t.x}}function wn(t){return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}function En(t){return yn({x:t.x+(t.width||0)/2,y:t.y+(t.height||0)/2})}function kn(t,e,n){k(n=n||0)||(n={x:n,y:n});var i=xn(t),r=xn(e),o=i.bottom+n.y<=r.top?"top":i.top-n.y>=r.bottom?"bottom":null,a=i.right+n.x<=r.left?"left":i.left-n.x>=r.right?"right":null;return a&&o?o+"-"+a:a||o||"intersect"}function In(t,e,n){var i=bn(t,e);return 1===i.length||2===i.length&&Re(i[0],i[1])<1?yn(i[0]):i.length>1?yn((i=H(i,(function(t){var e=Math.floor(100*t.t2)||1;return t.segment2+"#"+((e=100-e)<10?"0":"")+e})))[n?0:i.length-1]):null}function _n(t,e){return Math.round(t*e)/e}function Mn(t){return I(t)?t+"px":t}function Sn(t,e,n){var i=Ut("g");return Gt(i).add(e),t.insertBefore(i,t.childNodes[void 0!==n?n:t.childNodes.length-1]||null),i}var Bn={shape:["x","y","width","height"],connection:["waypoints"]};function Nn(t,e,n,i){this._eventBus=e,this._elementRegistry=i,this._graphicsFactory=n,this._init(t||{})}function An(t,e){t.setAttribute("transform","matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")")}Nn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Nn.prototype._init=function(t){var e=this._eventBus,n=this._container=function(t){var e=(t=$({},{width:"100%",height:"100%"},t)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),$(n.style,{position:"relative",overflow:"hidden",width:Mn(t.width),height:Mn(t.height)}),e.appendChild(n),n}(t),i=this._svg=Ut("svg");Ct(i,{width:"100%",height:"100%"}),At(n,i);var r=this._viewport=Sn(i,"viewport");this._layers={},!1!==t.deferUpdate&&(this._viewboxChanged=Q(q(this._viewboxChanged,this),300)),e.on("diagram.init",(function(){e.fire("canvas.init",{svg:i,viewport:r})}),this),e.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed"],(function(){delete this._cachedViewbox}),this),e.on("diagram.destroy",500,this._destroy,this),e.on("diagram.clear",500,this._clear,this)},Nn.prototype._destroy=function(){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._rootElement,delete this._viewport},Nn.prototype._clear=function(){var t=this;this._elementRegistry.getAll().forEach((function(e){var n=Ie(e);"root"===n?t.setRootElement(null,!0):t._removeElement(e,n)})),delete this._cachedViewbox},Nn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Nn.prototype.getLayer=function(t,e){if(!t)throw new Error("must specify a name");var n=this._layers[t];if(n||(n=this._layers[t]=this._createLayer(t,e)),void 0!==e&&n.index!==e)throw new Error("layer <"+t+"> already created at index <"+e+">");return n.group},Nn.prototype._createLayer=function(t,e){e||(e=0);var n=T(this._layers,(function(t,n){return e>=n.index&&t++,t}),0);return{group:Sn(this._viewport,"layer-"+t,n),index:e}},Nn.prototype.getContainer=function(){return this._container},Nn.prototype._updateMarker=function(t,e,n){var i;t.id||(t=this._elementRegistry.get(t)),(i=this._elementRegistry._elements[t.id])&&(R([i.gfx,i.secondaryGfx],(function(t){t&&(n?Gt(t).add(e):Gt(t).remove(e))})),this._eventBus.fire("element.marker.update",{element:t,gfx:i.gfx,marker:e,add:!!n}))},Nn.prototype.addMarker=function(t,e){this._updateMarker(t,e,!0)},Nn.prototype.removeMarker=function(t,e){this._updateMarker(t,e,!1)},Nn.prototype.hasMarker=function(t,e){return t.id||(t=this._elementRegistry.get(t)),Gt(this.getGraphics(t)).has(e)},Nn.prototype.toggleMarker=function(t,e){this.hasMarker(t,e)?this.removeMarker(t,e):this.addMarker(t,e)},Nn.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},Nn.prototype.setRootElement=function(t,e){t&&this._ensureValid("root",t);var n=this._rootElement,i=this._elementRegistry,r=this._eventBus;if(n){if(!e)throw new Error("rootElement already set, need to specify override");r.fire("root.remove",{element:n}),r.fire("root.removed",{element:n}),i.remove(n)}if(t){var o=this.getDefaultLayer();r.fire("root.add",{element:t}),i.add(t,o,this._svg),r.fire("root.added",{element:t,gfx:o})}return this._rootElement=t,t},Nn.prototype._ensureValid=function(t,e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element with id "+e.id+" already exists");var n=Bn[t];if(!P(n,(function(t){return void 0!==e[t]})))throw new Error("must supply { "+n.join(", ")+" } with "+t)},Nn.prototype._setParent=function(t,e,n){Ae(e.children,t,n),t.parent=e},Nn.prototype._addElement=function(t,e,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(t,e),r.fire(t+".add",{element:e,parent:n}),this._setParent(e,n,i);var a=o.create(t,e,i);return this._elementRegistry.add(e,a),o.update(t,e,a),r.fire(t+".added",{element:e,gfx:a}),e},Nn.prototype.addShape=function(t,e,n){return this._addElement("shape",t,e,n)},Nn.prototype.addConnection=function(t,e,n){return this._addElement("connection",t,e,n)},Nn.prototype._removeElement=function(t,e){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(t=n.get(t.id||t))return r.fire(e+".remove",{element:t}),i.remove(t),Ne(t.parent&&t.parent.children,t),t.parent=null,r.fire(e+".removed",{element:t}),n.remove(t),t},Nn.prototype.removeShape=function(t){return this._removeElement(t,"shape")},Nn.prototype.removeConnection=function(t){return this._removeElement(t,"connection")},Nn.prototype.getGraphics=function(t,e){return this._elementRegistry.getGraphics(t,e)},Nn.prototype._changeViewbox=function(t){this._eventBus.fire("canvas.viewbox.changing"),t.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Nn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Nn.prototype.viewbox=function(t){if(void 0===t&&this._cachedViewbox)return this._cachedViewbox;var e,n,i,r,o,a,c=this._viewport,s=this.getSize();return t?(this._changeViewbox((function(){r=Math.min(s.width/t.width,s.height/t.height);var e=this._svg.createSVGMatrix().scale(r).translate(-t.x,-t.y);ie(c,e)})),t):(e=this.getDefaultLayer().getBBox(),n=(i=ie(c))?i.matrix:function(t,e,n,i,r,o){var a=Vt.createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Xt(a,t);case 6:return Xt(a,{a:t,b:e,c:n,d:i,e:r,f:o})}}(),r=_n(n.a,1e3),o=_n(-n.e||0,1e3),a=_n(-n.f||0,1e3),t=this._cachedViewbox={x:o?o/r:0,y:a?a/r:0,width:s.width/r,height:s.height/r,scale:r,inner:{width:e.width,height:e.height,x:e.x,y:e.y},outer:s})},Nn.prototype.scroll=function(t){var e=this._viewport,n=e.getCTM();return t&&this._changeViewbox((function(){t=$({dx:0,dy:0},t||{}),n=this._svg.createSVGMatrix().translate(t.dx,t.dy).multiply(n),An(e,n)})),{x:n.e,y:n.f}},Nn.prototype.scrollToElement=function(t,e){var n=100;e||(e={}),"number"==typeof e&&(n=e),e={top:e.top||n,right:e.right||n,bottom:e.bottom||n,left:e.left||n};var i,r,o=ke(t),a=xn(o),c=this.viewbox(),s=this.zoom();c.y+=e.top/s,c.x+=e.left/s,c.width-=(e.right+e.left)/s,c.height-=(e.bottom+e.top)/s;var u=xn(c);if(o.width<c.width&&o.height<c.height){var l=Math.max(0,a.right-u.right),f=Math.min(0,a.left-u.left),d=Math.max(0,a.bottom-u.bottom),p=Math.min(0,a.top-u.top);i=l||f,r=d||p}else i=o.x-c.x,r=o.y-c.y;this.scroll({dx:-i*s,dy:-r*s})},Nn.prototype.zoom=function(t,e){return t?"fit-viewport"===t?this._fitViewport(e):(this._changeViewbox((function(){"object"!=typeof e&&(n=this.viewbox().outer,e={x:n.width/2,y:n.height/2}),i=this._setZoom(t,e)})),_n(i.a,1e3)):this.viewbox(t).scale;var n,i},Nn.prototype._fitViewport=function(t){var e,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&&!t?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(e=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(t?o.width/2-r.width/e/2:0),y:o.y+(t?o.height/2-r.height/e/2:0),width:r.width/e,height:r.height/e}),this.viewbox(n),this.viewbox(!1).scale},Nn.prototype._setZoom=function(t,e){var n,i,r,o,a=this._svg,c=this._viewport,s=a.createSVGMatrix(),u=a.createSVGPoint(),l=(i=c.getCTM()).a;return e?(n=$(u,e).matrixTransform(i.inverse()),r=s.translate(n.x,n.y).scale(1/l*t).translate(-n.x,-n.y),o=i.multiply(r)):o=s.scale(t),An(this._viewport,o),o},Nn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Nn.prototype.getAbsoluteBBox=function(t){var e,n=this.viewbox();return{x:(e=t.waypoints?this.getGraphics(t).getBBox():t).x*n.scale-n.x*n.scale,y:e.y*n.scale-n.y*n.scale,width:e.width*n.scale,height:e.height*n.scale}},Nn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Dn="data-element-id";function Rn(t){this._elements={},this._eventBus=t}Rn.$inject=["eventBus"],Rn.prototype.add=function(t,e,n){var i=t.id;this._validateId(i),Ct(e,Dn,i),n&&Ct(n,Dn,i),this._elements[i]={element:t,gfx:e,secondaryGfx:n}},Rn.prototype.remove=function(t){var e=this._elements,n=t.id||t,i=n&&e[n];i&&(Ct(i.gfx,Dn,""),i.secondaryGfx&&Ct(i.secondaryGfx,Dn,""),delete e[n])},Rn.prototype.updateId=function(t,e){this._validateId(e),"string"==typeof t&&(t=this.get(t)),this._eventBus.fire("element.updateId",{element:t,newId:e});var n=this.getGraphics(t),i=this.getGraphics(t,!0);this.remove(t),t.id=e,this.add(t,n,i)},Rn.prototype.get=function(t){var e;e="string"==typeof t?t:t&&Ct(t,Dn);var n=this._elements[e];return n&&n.element},Rn.prototype.filter=function(t){var e=[];return this.forEach((function(n,i){t(n,i)&&e.push(n)})),e},Rn.prototype.find=function(t){for(var e=this._elements,n=Object.keys(e),i=0;i<n.length;i++){var r=e[n[i]],o=r.element;if(t(o,r.gfx))return o}},Rn.prototype.getAll=function(){return this.filter((function(t){return t}))},Rn.prototype.forEach=function(t){var e=this._elements;Object.keys(e).forEach((function(n){var i=e[n];return t(i.element,i.gfx)}))},Rn.prototype.getGraphics=function(t,e){var n=this._elements[t.id||t];return n&&(e?n.secondaryGfx:n.gfx)},Rn.prototype._validateId=function(t){if(!t)throw new Error("element must have an id");if(this._elements[t])throw new Error("element with id "+t+" already added")};var Cn={extend:function(t,e,n,i){var r=n.inverse;return Object.defineProperty(t,"remove",{value:function(t){var n=this.indexOf(t);return-1!==n&&(this.splice(n,1),e.unset(t,r,i)),t}}),Object.defineProperty(t,"contains",{value:function(t){return-1!==this.indexOf(t)}}),Object.defineProperty(t,"add",{value:function(t,n){var o=this.indexOf(t);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,t),-1===o&&e.set(t,r,i)}}),Object.defineProperty(t,"__refs_collection",{value:!0}),t},isExtended:function(t){return!0===t.__refs_collection}};function Tn(t,e,n){var i=Cn.extend(n[e.name]||[],t,e,n);Object.defineProperty(n,e.name,{enumerable:e.enumerable,value:i}),i.length&&i.forEach((function(i){t.set(i,e.inverse,n)}))}function Pn(t,e){if(!(this instanceof Pn))return new Pn(t,e);t.inverse=e,e.inverse=t,this.props={},this.props[t.name]=t,this.props[e.name]=e}Pn.prototype.bind=function(t,e){if("string"==typeof e){if(!this.props[e])throw new Error("no property <"+e+"> in ref");e=this.props[e]}e.collection?Tn(this,e,t):function(t,e,n){var i=e.inverse,r=n[e.name];Object.defineProperty(n,e.name,{configurable:e.configurable,enumerable:e.enumerable,get:function(){return r},set:function(e){if(e!==r){var o=r;r=null,o&&t.unset(o,i,n),t.set(r=e,i,n)}}})}(this,e,t)},Pn.prototype.ensureRefsCollection=function(t,e){var n=t[e.name];return Cn.isExtended(n)||Tn(this,e,t),n},Pn.prototype.ensureBound=function(t,e){(function(t,e){return Object.prototype.hasOwnProperty.call(t,e.name||e)})(t,e)||this.bind(t,e)},Pn.prototype.unset=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).remove(n):t[e.name]=void 0)},Pn.prototype.set=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).add(n):t[e.name]=n)};var zn=Pn;zn.Collection=Cn;var jn=new zn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Gn=new zn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Fn=new zn({name:"attachers",collection:!0},{name:"host"}),Ln=new zn({name:"outgoing",collection:!0},{name:"source"}),On=new zn({name:"incoming",collection:!0},{name:"target"});function Wn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(t){var e=this.label,n=this.labels;!t&&e?n.remove(e):n.add(t,0)}}),jn.bind(this,"parent"),Gn.bind(this,"labels"),Ln.bind(this,"outgoing"),On.bind(this,"incoming")}function Zn(){Wn.call(this),jn.bind(this,"children"),Fn.bind(this,"host"),Fn.bind(this,"attachers")}function Hn(){Zn.call(this)}function Yn(){Zn.call(this),Gn.bind(this,"labelTarget")}function Un(){Wn.call(this),Ln.bind(this,"source"),On.bind(this,"target")}p(Zn,Wn),p(Hn,Zn),p(Yn,Zn),p(Un,Wn);var Vn={connection:Un,shape:Zn,label:Yn,root:Hn};function Xn(){this._uid=12}Xn.prototype.createRoot=function(t){return this.create("root",t)},Xn.prototype.createLabel=function(t){return this.create("label",t)},Xn.prototype.createShape=function(t){return this.create("shape",t)},Xn.prototype.createConnection=function(t){return this.create("connection",t)},Xn.prototype.create=function(t,e){return(e=$({},e||{})).id||(e.id=t+"_"+this._uid++),function(t,e){var n=Vn[t];if(!n)throw new Error("unknown type: <"+t+">");return $(new n,e)}(t,e)};var Jn=Array.prototype.slice;function Qn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function qn(){}function Kn(t){return t.childNodes[0]}function $n(t,e,n,i,r){var o=Jt();o.setTranslate(e,n);var a=Jt();a.setRotate(i||0,0,0);var c=Jt();c.setScale(r||1,r||1),ie(t,[o,a,c])}function ti(t,e,n){var i=Jt();i.setTranslate(e,n),ie(t,i)}function ei(t,e){var n=Jt();n.setRotate(e,0,0),ie(t,n)}function ni(t,e){this._eventBus=t,this._elementRegistry=e}function ii(t,e,n){var i=n||e.firstChild;t!==i&&e.insertBefore(t,i)}Qn.prototype.on=function(t,e,n,i){if(t=E(t)?t:[t],_(e)&&(i=n,n=e,e=1e3),!I(e))throw new Error("priority must be a number");var r=n;i&&((r=q(n,i)).__fn=n.__fn||n);var o=this;t.forEach((function(t){o._addListener(t,{priority:e,callback:r,next:null})}))},Qn.prototype.once=function(t,e,n,i){var r=this;if(_(e)&&(i=n,n=e,e=1e3),!I(e))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var e=n.apply(i,arguments);return r.off(t,o),e}o.__fn=n,this.on(t,e,o)},Qn.prototype.off=function(t,e){t=E(t)?t:[t];var n=this;t.forEach((function(t){n._removeListener(t,e)}))},Qn.prototype.createEvent=function(t){var e=new qn;return e.init(t),e},Qn.prototype.fire=function(t,e){var n,i,r,o;if(o=Jn.call(arguments),"object"==typeof t&&(t=(e=t).type),!t)throw new Error("no event type specified");if(i=this._listeners[t]){n=e instanceof qn?e:this.createEvent(e),o[0]=n;var a=n.type;t!==a&&(n.type=t);try{r=this._invokeListeners(n,o,i)}finally{t!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},Qn.prototype.handleError=function(t){return!1===this.fire("error",{error:t})},Qn.prototype._destroy=function(){this._listeners={}},Qn.prototype._invokeListeners=function(t,e,n){for(var i;n&&!t.cancelBubble;)i=this._invokeListener(t,e,n),n=n.next;return i},Qn.prototype._invokeListener=function(t,e,n){var i;if(n.callback.__isTomb)return i;try{void 0!==(i=function(t,e){return t.apply(null,e)}(n.callback,e))&&(t.returnValue=i,t.stopPropagation()),!1===i&&t.preventDefault()}catch(t){if(!this.handleError(t))throw console.error("unhandled error in event listener"),console.error(t.stack),t}return i},Qn.prototype._addListener=function(t,e){var n,i=this._getListeners(t);if(i){for(;i;){if(i.priority<e.priority)return e.next=i,void(n?n.next=e:this._setListeners(t,e));n=i,i=i.next}n.next=e}else this._setListeners(t,e)},Qn.prototype._getListeners=function(t){return this._listeners[t]},Qn.prototype._setListeners=function(t,e){this._listeners[t]=e},Qn.prototype._removeListener=function(t,e){var n,i,r,o=this._getListeners(t);if(e)for(;o;)n=o.next,(r=o.callback)!==e&&r.__fn!==e||(i?i.next=n:this._setListeners(t,n)),i=o,o=n;else this._setListeners(t,null)},qn.prototype.stopPropagation=function(){this.cancelBubble=!0},qn.prototype.preventDefault=function(){this.defaultPrevented=!0},qn.prototype.init=function(t){$(this,t||{})},ni.$inject=["eventBus","elementRegistry"],ni.prototype._getChildrenContainer=function(t){var e,n=this._elementRegistry.getGraphics(t);return t.parent?(e=function(t){return t.parentNode.childNodes[1]}(n))||(Gt(e=Ut("g")).add("djs-children"),At(n.parentNode,e)):e=n,e},ni.prototype._clear=function(t){var e=Kn(t);return lt(e),e},ni.prototype._createContainer=function(t,e,n,i){var r=Ut("g");Gt(r).add("djs-group"),void 0!==n?ii(r,e,e.childNodes[n]):At(e,r);var o=Ut("g");Gt(o).add("djs-element"),Gt(o).add("djs-"+t),i&&Gt(o).add("djs-frame"),At(r,o);var a=Ut("g");return Gt(a).add("djs-visual"),At(o,a),o},ni.prototype.create=function(t,e,n){var i=this._getChildrenContainer(e.parent);return this._createContainer(t,i,n,_e(e))},ni.prototype.updateContainments=function(t){var e=this,n=this._elementRegistry;R(T(t,(function(t,e){return e.parent&&(t[e.parent.id]=e.parent),t}),{}),(function(t){var i=t.children;if(i){var r=e._getChildrenContainer(t);R(i.slice().reverse(),(function(t){ii(n.getGraphics(t).parentNode,r)}))}}))},ni.prototype.drawShape=function(t,e){return this._eventBus.fire("render.shape",{gfx:t,element:e})},ni.prototype.getShapePath=function(t){return this._eventBus.fire("render.getShapePath",t)},ni.prototype.drawConnection=function(t,e){return this._eventBus.fire("render.connection",{gfx:t,element:e})},ni.prototype.getConnectionPath=function(t){return this._eventBus.fire("render.getConnectionPath",t)},ni.prototype.update=function(t,e,n){if(e.parent){var i=this._clear(n);if("shape"===t)this.drawShape(i,e),ti(n,e.x,e.y);else{if("connection"!==t)throw new Error("unknown type: "+t);this.drawConnection(i,e)}Ct(n,"display",e.hidden?"none":"block")}},ni.prototype.remove=function(t){Lt(this._elementRegistry.getGraphics(t).parentNode)};const ri={__depends__:[Be],__init__:["canvas"],canvas:["type",Nn],elementRegistry:["type",Rn],elementFactory:["type",Xn],eventBus:["type",Qn],graphicsFactory:["type",ni]};function oi(t,e){this.injector=e=e||function(t){return function(t){var e=[],n=[];function i(t){return e.indexOf(t)>=0}t.forEach((function t(r){i(r)||((r.__depends__||[]).forEach(t),i(r)||(function(t){e.push(t)}(r),(r.__init__||[]).forEach((function(t){n.push(t)}))))}));var r=new pe(e);return n.forEach((function(t){try{r["string"==typeof t?"get":"invoke"](t)}catch(t){throw console.error("Failed to instantiate component"),console.error(t.stack),t}})),r}([{config:["value",t=t||{}]},ri].concat(t.modules||[]))}(t),this.get=e.get,this.invoke=e.invoke,this.get("eventBus").fire("diagram.init")}function ai(){}function ci(t,e){this.model=t,this.properties=e}oi.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},oi.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},ai.prototype.get=function(t){return this.$model.properties.get(this,t)},ai.prototype.set=function(t,e){this.$model.properties.set(this,t,e)},ci.prototype.createType=function(t){var e=this.model,n=this.properties,i=Object.create(ai.prototype);R(t.properties,(function(t){t.isMany||void 0===t.default||(i[t.name]=t.default)})),n.defineModel(i,e),n.defineDescriptor(i,t);var r=t.ns.name;function o(t){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),R(t,q((function(t,e){this.set(e,t)}),this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,e),n.defineDescriptor(o,t),o};var si={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},ui={String:function(t){return t},Boolean:function(t){return"true"===t},Integer:function(t){return parseInt(t,10)},Real:function(t){return parseFloat(t)}};function li(t,e){var n=ui[t];return n?n(e):e}function fi(t){return!!si[t]}function di(t){return!!ui[t]}function pi(t,e){var n,i,r=t.split(/:/);if(1===r.length)n=t,i=e;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+t);n=r[1],i=r[0]}return{name:t=(i?i+":":"")+n,prefix:i,localName:n}}function mi(t){this.ns=t,this.name=t.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function hi(t,e){this.packageMap={},this.typeMap={},this.packages=[],this.properties=e,R(t,q(this.registerPackage,this))}function vi(t,e,n){var i=e[n];if(i in t)throw new Error("package with "+n+" <"+i+"> already defined")}function bi(t){this.model=t}function gi(t,e,n){Object.defineProperty(t,e.name,{enumerable:!e.isReference,writable:!0,value:n,configurable:!0})}function yi(t){this.properties=new bi(this),this.factory=new ci(this,this.properties),this.registry=new hi(t,this.properties),this.typeCache={}}mi.prototype.build=function(){return tt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},mi.prototype.addProperty=function(t,e,n){"boolean"==typeof e&&(n=e,e=void 0),this.addNamedProperty(t,!1!==n);var i=this.properties;void 0!==e?i.splice(e,0,t):i.push(t)},mi.prototype.replaceProperty=function(t,e,n){var i=t.ns,r=this.properties,o=this.propertiesByName,a=t.name!==e.name;if(t.isId){if(!e.isId)throw new Error("property <"+e.ns.name+"> must be id property to refine <"+t.ns.name+">");this.setIdProperty(e,!1)}if(t.isBody){if(!e.isBody)throw new Error("property <"+e.ns.name+"> must be body property to refine <"+t.ns.name+">");this.setBodyProperty(e,!1)}var c=r.indexOf(t);if(-1===c)throw new Error("property <"+i.name+"> not found in property list");r.splice(c,1),this.addProperty(e,n?void 0:c,a),o[i.name]=o[i.localName]=e},mi.prototype.redefineProperty=function(t,e,n){var i=t.ns.prefix,r=e.split("#"),o=pi(r[0],i),a=pi(r[1],o.prefix).name,c=this.propertiesByName[a];if(!c)throw new Error("refined property <"+a+"> not found");this.replaceProperty(c,t,n),delete t.redefines},mi.prototype.addNamedProperty=function(t,e){var n=t.ns,i=this.propertiesByName;e&&(this.assertNotDefined(t,n.name),this.assertNotDefined(t,n.localName)),i[n.name]=i[n.localName]=t},mi.prototype.removeNamedProperty=function(t){var e=t.ns,n=this.propertiesByName;delete n[e.name],delete n[e.localName]},mi.prototype.setBodyProperty=function(t,e){if(e&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+t.ns.name+">)");this.bodyProperty=t},mi.prototype.setIdProperty=function(t,e){if(e&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+t.ns.name+">)");this.idProperty=t},mi.prototype.assertNotDefined=function(t){var e=t.name,n=this.propertiesByName[e];if(n)throw new Error("property <"+e+"> already defined; override of <"+n.definedBy.ns.name+"#"+n.ns.name+"> by <"+t.definedBy.ns.name+"#"+t.ns.name+"> not allowed without redefines")},mi.prototype.hasProperty=function(t){return this.propertiesByName[t]},mi.prototype.addTrait=function(t,e){var n=this.allTypesByName,i=this.allTypes,r=t.name;r in n||(R(t.properties,q((function(n){n=$({},n,{name:n.ns.localName,inherited:e}),Object.defineProperty(n,"definedBy",{value:t});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(t),n[r]=t)},hi.prototype.getPackage=function(t){return this.packageMap[t]},hi.prototype.getPackages=function(){return this.packages},hi.prototype.registerPackage=function(t){t=$({},t);var e=this.packageMap;vi(e,t,"prefix"),vi(e,t,"uri"),R(t.types,q((function(e){this.registerType(e,t)}),this)),e[t.uri]=e[t.prefix]=t,this.packages.push(t)},hi.prototype.registerType=function(t,e){var n=pi((t=$({},t,{superClass:(t.superClass||[]).slice(),extends:(t.extends||[]).slice(),properties:(t.properties||[]).slice(),meta:$(t.meta||{})})).name,e.prefix),i=n.name,r={};R(t.properties,q((function(t){var e=pi(t.name,n.prefix),i=e.name;fi(t.type)||(t.type=pi(t.type,e.prefix).name),$(t,{ns:e,name:i}),r[i]=t}),this)),$(t,{ns:n,name:i,propertiesByName:r}),R(t.extends,q((function(t){var e=this.typeMap[t];e.traits=e.traits||[],e.traits.push(i)}),this)),this.definePackage(t,e),this.typeMap[i]=t},hi.prototype.mapTypes=function(t,e,n){var i=fi(t.name)?{name:t.name}:this.typeMap[t.name],r=this;function o(t){return a(t,!0)}function a(n,i){var o=pi(n,fi(n)?"":t.prefix);r.mapTypes(o,e,i)}if(!i)throw new Error("unknown type <"+t.name+">");R(i.superClass,n?o:a),e(i,!n),R(i.traits,o)},hi.prototype.getEffectiveDescriptor=function(t){var e=pi(t),n=new mi(e);this.mapTypes(e,(function(t,e){n.addTrait(t,e)}));var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},hi.prototype.definePackage=function(t,e){this.properties.define(t,"$pkg",{value:e})},bi.prototype.set=function(t,e,n){var i=this.model.getPropertyDescriptor(t,e),r=i&&i.name;void 0===n?i?delete t[r]:delete t.$attrs[e]:i?r in t?t[r]=n:gi(t,i,n):t.$attrs[e]=n},bi.prototype.get=function(t,e){var n=this.model.getPropertyDescriptor(t,e);if(!n)return t.$attrs[e];var i=n.name;return!t[i]&&n.isMany&&gi(t,n,[]),t[i]},bi.prototype.define=function(t,e,n){Object.defineProperty(t,e,n)},bi.prototype.defineDescriptor=function(t,e){this.define(t,"$descriptor",{value:e})},bi.prototype.defineModel=function(t,e){this.define(t,"$model",{value:e})},yi.prototype.create=function(t,e){var n=this.getType(t);if(!n)throw new Error("unknown type <"+t+">");return new n(e)},yi.prototype.getType=function(t){var e=this.typeCache,n=M(t)?t:t.ns.name,i=e[n];return i||(t=this.registry.getEffectiveDescriptor(n),i=e[n]=this.factory.createType(t)),i},yi.prototype.createAny=function(t,e,n){var i=pi(t),r={$type:t,$instanceOf:function(t){return t===this.$type}};return this.properties.defineDescriptor(r,{name:t,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:e}}),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),R(n,(function(t,e){k(t)&&void 0!==t.value?r[t.name]=t.value:r[e]=t})),r},yi.prototype.getPackage=function(t){return this.registry.getPackage(t)},yi.prototype.getPackages=function(){return this.registry.getPackages()},yi.prototype.getElementDescriptor=function(t){return t.$descriptor},yi.prototype.hasType=function(t,e){return void 0===e&&(e=t,t=this),e in t.$model.getElementDescriptor(t).allTypesByName},yi.prototype.getPropertyDescriptor=function(t,e){return this.getElementDescriptor(t).propertiesByName[e]},yi.prototype.getTypeDescriptor=function(t){return this.registry.typeMap[t]};var xi=String.fromCharCode,wi=Object.prototype.hasOwnProperty,Ei=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ki={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Ii(t,e,n,i){return i?wi.call(ki,i)?ki[i]:"&"+i+";":xi(e||parseInt(n,16))}function _i(t){return t.length>3&&-1!==t.indexOf("&")?t.replace(Ei,Ii):t}function Mi(t){return new Error(t)}function Si(t){return"missing namespace for prefix <"+t+">"}function Bi(t){return{get:t,enumerable:!0}}function Ni(t){var e,n={};for(e in t)n[e]=t[e];return n}function Ai(t){return t+"$uri"}function Di(){return{line:0,column:0}}function Ri(t){throw t}function Ci(t){if(!this)return new Ci(t);var e,n,i,r,o,a,c,s,u,l=t&&t.proxy,f=Ri,d=Di,p=!1,m=!1,h=null,v=!1;function b(t){t instanceof Error||(t=Mi(t)),h=t,f(t,d)}function g(t){o&&(t instanceof Error||(t=Mi(t)),o(t,d))}this.on=function(t,u){if("function"!=typeof u)throw Mi("required args <name, cb>");switch(t){case"openTag":n=u;break;case"text":e=u;break;case"closeTag":i=u;break;case"error":f=u;break;case"warn":o=u;break;case"cdata":r=u;break;case"attention":s=u;break;case"question":c=u;break;case"comment":a=u;break;default:throw Mi("unsupported event: "+t)}return this},this.ns=function(t){if(void 0===t&&(t={}),"object"!=typeof t)throw Mi("required args <nsMap={}>");var e,n={};for(e in t)n[e]=t[e];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",m=!0,u=n,this},this.parse=function(t){if("string"!=typeof t)throw Mi("required args <xml=string>");return h=null,function(t){var o,f,h,y,x,w,E,k,I,_,M,S=m?[]:null,B=m?function(t){var e,n,i={};for(e in t)i[n=t[e]]=n,i[Ai(n)]=e;return i}(u):null,N=[],A=0,D=!1,R=!1,C=0,T=0,P="",z=0;function j(){if(null!==M)return M;var t,e,n,i,r,o,a,c,s,l,f,d=m&&B.xmlns,h=m&&p?[]:null,v=z,b=P,y=b.length,x={},w={};t:for(;v<y;v++)if(s=!1,!(32===(l=b.charCodeAt(v))||l<14&&l>8)){for((l<65||l>122||l>90&&l<97)&&95!==l&&58!==l&&(g("illegal first char attribute name"),s=!0),f=v+1;f<y;f++)if(!((l=b.charCodeAt(f))>96&&l<123||l>64&&l<91||l>47&&l<59||46===l||45===l||95===l)){if(32===l||l<14&&l>8){g("missing attribute value"),v=f;continue t}if(61===l)break;g("illegal attribute name char"),s=!0}if("xmlns:xmlns"===(c=b.substring(v,f))&&(g("illegal declaration of xmlns"),s=!0),34===(l=b.charCodeAt(f+1)))-1===(f=b.indexOf('"',v=f+2))&&-1!==(f=b.indexOf("'",v))&&(g("attribute value quote missmatch"),s=!0);else if(39===l)-1===(f=b.indexOf("'",v=f+2))&&-1!==(f=b.indexOf('"',v))&&(g("attribute value quote missmatch"),s=!0);else for(g("missing attribute value quotes"),s=!0,f+=1;f<y&&!(32===(l=b.charCodeAt(f+1))||l<14&&l>8);f++);for(-1===f&&(g("missing closing quotes"),f=y,s=!0),s||(o=b.substring(v,f)),v=f;f+1<y&&!(32===(l=b.charCodeAt(f+1))||l<14&&l>8);f++)v===f&&(g("illegal character after attribute end"),s=!0);if(v=f+1,!s)if(c in w)g("attribute <"+c+"> already defined");else if(w[c]=!0,m)if(p){if(null!==(r="xmlns"===c?"xmlns":120===c.charCodeAt(0)&&"xmlns:"===c.substr(0,6)?c.substr(6):null)){if(t=_i(o),e=Ai(r),!(a=u[t])){if("xmlns"===r||e in B&&B[e]!==t)do{a="ns"+A++}while(void 0!==B[a]);else a=r;u[t]=a}B[r]!==a&&(i||(B=Ni(B),i=!0),B[r]=a,"xmlns"===r&&(B[Ai(a)]=t,d=a),B[e]=t),x[c]=o;continue}h.push(c,o)}else-1!==(l=c.indexOf(":"))?(n=B[c.substring(0,l)])?("xsi:type"===(c=d===n?c.substr(l+1):n+c.substr(l))&&(-1!==(l=o.indexOf(":"))?(n=o.substring(0,l),o=(n=B[n]||n)+o.substring(l)):o=d+":"+o),x[c]=o):g(Si(c.substring(0,l))):x[c]=o;else x[c]=o}if(p)for(v=0,y=h.length;v<y;v++){if(c=h[v++],o=h[v],-1!==(l=c.indexOf(":"))){if(!(n=B[c.substring(0,l)])){g(Si(c.substring(0,l)));continue}"xsi:type"===(c=d===n?c.substr(l+1):n+c.substr(l))&&(-1!==(l=o.indexOf(":"))?(n=o.substring(0,l),o=(n=B[n]||n)+o.substring(l)):o=d+":"+o)}x[c]=o}return M=x}for(d=function(){for(var e,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,c=T;C>=a&&(e=i.exec(t))&&!((c=e[0].length+e.index)>C);)r+=1,a=c;return-1==C?(o=c,n=t.substring(T)):0===T?n=t.substring(T,C):(o=C-a,n=-1==T?t.substring(C):t.substring(C,T+1)),{data:n,line:r,column:o}},l&&(_=Object.create({},{name:Bi((function(){return k})),originalName:Bi((function(){return I})),attrs:Bi(j),ns:Bi((function(){return B}))}));-1!==T;){if(-1===(C=60===t.charCodeAt(T)?T:t.indexOf("<",T)))return N.length?b("unexpected end of file"):0===T?b("missing start tag"):void(T<t.length&&t.substring(T).trim()&&g("non-whitespace outside of root node"));if(T!==C)if(N.length){if(e&&(e(t.substring(T,C),_i,d),v))return}else if(t.substring(T,C).trim()&&(g("non-whitespace outside of root node"),v))return;if(33===(x=t.charCodeAt(C+1))){if(91===(y=t.charCodeAt(C+2))&&"CDATA["===t.substr(C+3,6)){if(-1===(T=t.indexOf("]]>",C)))return b("unclosed cdata");if(r&&(r(t.substring(C+9,T),d),v))return;T+=3;continue}if(45===y&&45===t.charCodeAt(C+3)){if(-1===(T=t.indexOf("--\x3e",C)))return b("unclosed comment");if(a&&(a(t.substring(C+4,T),_i,d),v))return;T+=3;continue}}if(63!==x){for(f=C+1;;f++){if(w=t.charCodeAt(f),isNaN(w))return T=-1,b("unclosed tag");if(34===w)f=-1!==(y=t.indexOf('"',f+1))?y:f;else if(39===w)f=-1!==(y=t.indexOf("'",f+1))?y:f;else if(62===w){T=f;break}}if(33!==x){if(M={},47===x){if(D=!1,R=!0,!N.length)return b("missing open tag");if(f=k=N.pop(),t.substring(C+2,y=C+2+f.length)!==f)return b("closing tag mismatch");for(;y<T;y++)if(!(32===(x=t.charCodeAt(y))||x>8&&x<14))return b("close tag")}else{if(47===t.charCodeAt(T-1)?(f=k=t.substring(C+1,T-1),D=!0,R=!0):(f=k=t.substring(C+1,T),D=!0,R=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return b("illegal first char nodeName");for(y=1,h=f.length;y<h;y++)if(!((x=f.charCodeAt(y))>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){k=f.substring(0,y),M=null;break}return b("invalid nodeName")}R||N.push(k)}if(m){if(o=B,D&&(R||S.push(o),null===M&&(p=-1!==f.indexOf("xmlns",y))&&(z=y,P=f,j(),p=!1)),I=k,-1!==(x=k.indexOf(":"))){if(!(E=B[k.substring(0,x)]))return b("missing namespace on <"+I+">");k=k.substr(x+1)}else E=B.xmlns;E&&(k=E+":"+k)}if(D&&(z=y,P=f,n&&(l?n(_,_i,R,d):n(k,j,_i,R,d),v)))return;if(R){if(i&&(i(l?_:k,_i,D,d),v))return;m&&(B=D?o:S.pop())}T+=1}else{if(s&&(s(t.substring(C,T+1),_i,d),v))return;T+=1}}else{if(-1===(T=t.indexOf("?>",C)))return b("unclosed question");if(c&&(c(t.substring(C,T+2),d),v))return;T+=2}}}(t),d=Di,v=!1,h},this.stop=function(){v=!0}}function Ti(t){return t.xml&&"lowerCase"===t.xml.tagAlias}Object.keys(ki).forEach((function(t){ki[t.toUpperCase()]=ki[t]}));var Pi={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"};function zi(t){return t.xml&&t.xml.serialize}function ji(t){return"xsi:type"===zi(t)}function Gi(t,e){return Ti(e)?t.prefix+":"+((n=t.localName).charAt(0).toUpperCase()+n.slice(1)):t.name;var n}function Fi(t){return new Error(t)}function Li(t){return t.$descriptor}function Oi(t){$(this,t),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Fi("expected element");var e,n=this.elementsById,i=Li(t).idProperty;if(i&&(e=t.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(e))throw new Error("illegal ID <"+e+">");if(n[e])throw Fi("duplicate ID <"+e+">");n[e]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Wi(){}function Zi(){}function Hi(){}function Yi(t,e){this.property=t,this.context=e}function Ui(t,e){this.element=e,this.propertyDesc=t}function Vi(){}function Xi(t,e,n){this.model=t,this.type=t.getType(e),this.context=n}function Ji(t,e,n){Xi.call(this,t,e,n)}function Qi(t,e,n){this.model=t,this.context=n}function qi(t){t instanceof yi&&(t={model:t}),$(this,{lax:!1},t)}Wi.prototype.handleEnd=function(){},Wi.prototype.handleText=function(){},Wi.prototype.handleNode=function(){},(Zi.prototype=Object.create(Wi.prototype)).handleNode=function(){return this},(Hi.prototype=Object.create(Wi.prototype)).handleText=function(t){this.body=(this.body||"")+t},(Yi.prototype=Object.create(Hi.prototype)).handleNode=function(t){if(this.element)throw Fi("expected no sub nodes");return this.element=this.createReference(t),this},Yi.prototype.handleEnd=function(){this.element.id=this.body},Yi.prototype.createReference=function(){return{property:this.property.ns.name,id:""}},(Ui.prototype=Object.create(Hi.prototype)).handleEnd=function(){var t=this.body||"",e=this.element,n=this.propertyDesc;t=li(n.type,t),n.isMany?e.get(n.name).push(t):e.set(n.name,t)},(Vi.prototype=Object.create(Hi.prototype)).handleNode=function(t){var e=this,n=this.element;return n?e=this.handleChild(t):(n=this.element=this.createElement(t),this.context.addElement(n)),e},(Xi.prototype=Object.create(Vi.prototype)).addReference=function(t){this.context.addReference(t)},Xi.prototype.handleText=function(t){if(!Li(this.element).bodyProperty)throw Fi("unexpected body text <"+t+">");Hi.prototype.handleText.call(this,t)},Xi.prototype.handleEnd=function(){var t=this.body,e=this.element,n=Li(e).bodyProperty;n&&void 0!==t&&(t=li(n.type,t),e.set(n.name,t))},Xi.prototype.createElement=function(t){var e,n=t.attributes,i=this.type,r=Li(i),o=this.context,a=new i({}),c=this.model;return R(n,(function(t,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?R(t.split(" "),(function(t){o.addReference({element:a,property:i.ns.name,id:t})})):o.addReference({element:a,property:i.ns.name,id:t}):(i?t=li(i.type,t):"xmlns"!==n&&(e=pi(n,r.ns.prefix),c.getPackage(e.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:t})),a.set(n,t))})),a},Xi.prototype.getPropertyForNode=function(t){var e,n,i=pi(t.name),r=this.model,o=Li(this.type),a=o.propertiesByName[i.name];if(a&&!a.isAttr)return ji(a)&&(e=t.attributes["xsi:type"])?(e=function(t,e){var n=pi(t);return function(t,e){var n=t.name,i=t.localName,r=e.xml&&e.xml.typePrefix;return r&&0===i.indexOf(r)?t.prefix+":"+i.slice(r.length):n}(n,e.getPackage(n.prefix))}(e,r),$({},a,{effectiveType:Li(n=r.getType(e)).name})):a;var c=r.getPackage(i.prefix);if(c){if(e=Gi(i,c),n=r.getType(e),a=N(o.properties,(function(t){return!t.isVirtual&&!t.isReference&&!t.isAttribute&&n.hasType(t.type)})))return $({},a,{effectiveType:Li(n).name})}else if(a=N(o.properties,(function(t){return!t.isReference&&!t.isAttribute&&"Element"===t.type})))return a;throw Fi("unrecognized element <"+i.name+">")},Xi.prototype.toString=function(){return"ElementDescriptor["+Li(this.type).name+"]"},Xi.prototype.valueHandler=function(t,e){return new Ui(t,e)},Xi.prototype.referenceHandler=function(t){return new Yi(t,this.context)},Xi.prototype.handler=function(t){return"Element"===t?new Qi(this.model,t,this.context):new Xi(this.model,t,this.context)},Xi.prototype.handleChild=function(t){var e,n,i,r;if(e=this.getPropertyForNode(t),i=this.element,di(n=e.effectiveType||e.type))return this.valueHandler(e,i);var o=(r=e.isReference?this.referenceHandler(e).handleNode(t):this.handler(n).handleNode(t)).element;return void 0!==o&&(e.isMany?i.get(e.name).push(o):i.set(e.name,o),e.isReference?($(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},(Ji.prototype=Object.create(Xi.prototype)).createElement=function(t){var e=t.name,n=pi(e),i=this.type,r=this.model.getPackage(n.prefix),o=r&&Gi(n,r)||e;if(!i.hasType(o))throw Fi("unexpected element <"+t.originalName+">");return Xi.prototype.createElement.call(this,t)},(Qi.prototype=Object.create(Vi.prototype)).createElement=function(t){var e=t.name,n=pi(e);return this.model.createAny(e,t.ns[n.prefix+"$uri"],t.attributes)},Qi.prototype.handleChild=function(t){var e=new Qi(this.model,"Element",this.context).handleNode(t),n=this.element,i=e.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),e},Qi.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},qi.prototype.fromXML=function(t,e){var n=e.rootHandler;e instanceof Xi?(n=e,e={}):"string"==typeof e?(n=this.handler(e),e={}):"string"==typeof n&&(n=this.handler(n));var i=this.model,r=this.lax,o=new Oi($({},e,{rootHandler:n})),a=new Ci({proxy:!0}),c=function(){var t=[];return Object.defineProperty(t,"peek",{value:function(){return this[this.length-1]}}),t}();function s(t,e,n){var i=e(),r=i.line,a=i.column,c=i.data;"<"===c.charAt(0)&&-1!==c.indexOf(" ")&&(c=c.slice(0,c.indexOf(" "))+">");var s="unparsable content "+(c?c+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+a+"\n\tnested error: "+t.message;if(n)return o.addWarning({message:s,error:t}),!0;throw Fi(s)}function u(t,e){return s(t,e,!0)}n.context=o,c.push(n);var l=/^<\?xml /i,f=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function p(t,e){try{c.peek().handleText(t)}catch(t){u(t,e)}}var m=i.getPackages().reduce((function(t,e){return t[e.uri]=e.prefix,t}),{"http://www.w3.org/XML/1998/namespace":"xml"});return a.ns(m).on("openTag",(function(t,e,n,i){var o=t.attrs||{},a=Object.keys(o).reduce((function(t,n){var i=e(o[n]);return t[n]=i,t}),{});!function(t,e){var n=c.peek();try{c.push(n.handleNode(t))}catch(t){s(t,e,r)&&c.push(new Zi)}}({name:t.name,originalName:t.originalName,attributes:a,ns:t.ns},i)})).on("question",(function(t){if(l.test(t)){var e=f.exec(t),n=e&&e[1];n&&!d.test(n)&&o.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){c.pop().handleEnd()})).on("cdata",p).on("text",(function(t,e,n){!function(t,e){t.trim()&&p(t,e)}(e(t),n)})).on("error",s).on("warn",u),new Promise((function(e,i){var r;try{a.parse(t),function(){var t,e,n=o.elementsById,i=o.references;for(t=0;e=i[t];t++){var r=e.element,a=n[e.id],c=Li(r).propertiesByName[e.property];if(a||o.addWarning({message:"unresolved reference <"+e.id+">",element:e.element,property:e.property,value:e.id}),c.isMany){var s=r.get(c.name),u=s.indexOf(e);-1===u&&(u=s.length),a?s[u]=a:s.splice(u,1)}else r.set(c.name,a)}}()}catch(t){r=t}var c=n.element;r||c||(r=Fi("failed to parse document as <"+n.type.$descriptor.name+">"));var s=o.warnings,u=o.references,l=o.elementsById;return r?(r.warnings=s,i(r)):e({rootElement:c,elementsById:l,references:u,warnings:s})}))},qi.prototype.handler=function(t){return new Ji(this.model,t)};var Ki=/<|>|'|"|&|\n\r|\n/g,$i=/<|>|&/g;function tr(t){var e={},n={},i={},r=[],o=[];this.byUri=function(e){return n[e]||t&&t.byUri(e)},this.add=function(t,e){n[t.uri]=t,e?r.push(t):o.push(t),this.mapPrefix(t.prefix,t.uri)},this.uriByPrefix=function(t){return e[t||"xmlns"]},this.mapPrefix=function(t,n){e[t||"xmlns"]=n},this.getNSKey=function(t){return void 0!==t.prefix?t.uri+"|"+t.prefix:t.uri},this.logUsed=function(e){var n=e.uri,r=this.getNSKey(e);i[r]=this.byUri(n),t&&t.logUsed(e)},this.getUsed=function(){var t=this;return[].concat(r,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function er(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}function nr(t){return M(t)?t:(t.prefix?t.prefix+":":"")+t.localName}var ir={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},rr={"<":"lt",">":"gt","&":"amp"};function or(t,e,n){return(t=M(t)?t:""+t).replace(e,(function(t){return"&"+n[t]+";"}))}function ar(t){this.tagName=t}function cr(){}function sr(t){this.tagName=t}function ur(t,e){this.body=[],this.attrs=[],this.parent=t,this.propertyDescriptor=e}function lr(t,e){ur.call(this,t,e)}function fr(){this.value="",this.write=function(t){this.value+=t}}function dr(t,e){var n=[""];this.append=function(e){return t.write(e),this},this.appendNewLine=function(){return e&&t.write("\n"),this},this.appendIndent=function(){return e&&t.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function pr(t){return t=$({format:!1,preamble:!0},t||{}),{toXML:function(e,n){var i=n||new fr,r=new dr(i,t.format);if(t.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new ur).build(e).serializeTo(r),!n)return i.value}}}function mr(t,e){yi.call(this,t,e)}ar.prototype.build=function(t){return this.element=t,this},ar.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},cr.prototype.serializeValue=cr.prototype.serializeTo=function(t){t.append(this.escape?or(this.value,$i,rr):this.value)},cr.prototype.build=function(t,e){return this.value=e,"String"===t.type&&-1!==e.search($i)&&(this.escape=!0),this},er(sr,cr),sr.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"),this.serializeValue(t),t.append("</"+this.tagName+">").appendNewLine()},ur.prototype.build=function(t){this.element=t;var e,n,i=t.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return e=o?this.parseGeneric(t):this.parseNsAttributes(t),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(t){return D(t.$descriptor.properties,(function(e){var n=e.name;if(e.isVirtual)return!1;if(!B(t,n))return!1;var i=t[n];return i!==e.default&&null!==i&&(!e.isMany||i.length)}))}(t),this.parseAttributes(D(n,(function(t){return t.isAttr}))),this.parseContainments(D(n,(function(t){return!t.isAttr})))),this.parseGenericAttributes(t,e),this},ur.prototype.nsTagName=function(t){return function(t,e){return $(e.isGeneric?{localName:e.ns.localName}:{localName:(n=e.ns.localName,i=e.$pkg,Ti(i)?(r=n).charAt(0).toLowerCase()+r.slice(1):n)},t);var n,i,r}(this.logNamespaceUsed(t.ns),t)},ur.prototype.nsPropertyTagName=function(t){return function(t,e){return $({localName:e.ns.localName},t)}(this.logNamespaceUsed(t.ns),t)},ur.prototype.isLocalNs=function(t){return t.uri===this.ns.uri},ur.prototype.nsAttributeName=function(t){var e;if(e=M(t)?pi(t):t.ns,t.inherited)return{localName:e.localName};var n=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:e.localName}:$({localName:e.localName},n)},ur.prototype.parseGeneric=function(t){var e=this,n=this.body,i=[];return R(t,(function(r,o){"$body"===o?n.push((new cr).build({type:"String"},r)):"$children"===o?R(r,(function(t){n.push(new ur(e).build(t))})):0!==o.indexOf("$")&&e.parseNsAttribute(t,o,r)&&i.push({name:o,value:r})})),i},ur.prototype.parseNsAttribute=function(t,e,n){var i,r=t.$model,o=pi(e);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:e,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},ur.prototype.parseNsAttributes=function(t){var e=this,n=[];return R(t.$attrs,(function(i,r){var o=e.parseNsAttribute(t,r,i);o&&n.push(o)})),n},ur.prototype.parseGenericAttributes=function(t,e){var n=this;R(e,(function(e){if("xsi:type"!==e.name)try{n.addAttribute(n.nsAttributeName(e.name),e.value)}catch(n){console.warn("missing namespace information for ",e.name,"=",e.value,"on",t,n)}}))},ur.prototype.parseContainments=function(t){var e=this,n=this.body,i=this.element;R(t,(function(t){var r=i.get(t.name),o=t.isReference;if(t.isMany||(r=[r]),t.isBody)n.push((new cr).build(t,r[0]));else if(di(t.type))R(r,(function(i){n.push(new sr(e.addTagName(e.nsPropertyTagName(t))).build(t,i))}));else if(o)R(r,(function(i){n.push(new ar(e.addTagName(e.nsPropertyTagName(t))).build(i))}));else{var a=ji(t),c=function(t){return"property"===zi(t)}(t);R(r,(function(i){var r;r=a?new lr(e,t):c?new ur(e,t):new ur(e),n.push(r.build(i))}))}}))},ur.prototype.getNamespaces=function(t){var e,n=this.namespaces,i=this.parent;return n||(e=i&&i.getNamespaces(),t||!e?this.namespaces=n=new tr(e):n=e),n},ur.prototype.logNamespace=function(t,e,n){var i=this.getNamespaces(n),r=t.uri,o=t.prefix;return i.byUri(r)&&!n||i.add(t,e),i.mapPrefix(o,r),t},ur.prototype.logNamespaceUsed=function(t,e){var n,i,r,o=this.element.$model,a=this.getNamespaces(e),c=t.prefix,s=t.uri;if(!c&&!s)return{localName:t.localName};if(r=Pi[c]||o&&(o.getPackage(c)||{}).uri,!(s=s||r||a.uriByPrefix(c)))throw new Error("no namespace uri given for prefix <"+c+">");if(!(t=a.byUri(s))){for(n=c,i=1;a.uriByPrefix(n);)n=c+"_"+i++;t=this.logNamespace({prefix:n,uri:s},r===s)}return c&&a.mapPrefix(c,s),t},ur.prototype.parseAttributes=function(t){var e=this,n=this.element;R(t,(function(t){var i=n.get(t.name);if(t.isReference)if(t.isMany){var r=[];R(i,(function(t){r.push(t.id)})),i=r.join(" ")}else i=i.id;e.addAttribute(e.nsAttributeName(t),i)}))},ur.prototype.addTagName=function(t){var e=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(e),nr(t)},ur.prototype.addAttribute=function(t,e){var n=this.attrs;M(e)&&(e=or(e,Ki,ir)),n.push({name:t,value:e})},ur.prototype.serializeAttributes=function(t){var e=this.attrs,n=this.namespaces;n&&(e=function(t){return t.getUsed().filter((function(t){return"xml"!==t.prefix})).map((function(t){return{name:"xmlns"+(t.prefix?":"+t.prefix:""),value:t.uri}}))}(n).concat(e)),R(e,(function(e){t.append(" ").append(nr(e.name)).append('="').append(e.value).append('"')}))},ur.prototype.serializeTo=function(t){var e=this.body[0],n=e&&e.constructor!==cr;t.appendIndent().append("<"+this.tagName),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),R(this.body,(function(e){e.serializeTo(t)})),n&&t.unindent().appendIndent(),t.append("</"+this.tagName+">")),t.appendNewLine()},er(lr,ur),lr.prototype.parseNsAttributes=function(t){var e=ur.prototype.parseNsAttributes.call(this,t),n=t.$descriptor;if(n.name===this.propertyDescriptor.type)return e;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=t.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName("xsi:type"),(i.prefix?i.prefix+":":"")+o+n.ns.localName),e},lr.prototype.isLocalNs=function(t){return t.uri===(this.typeNs||this.ns).uri},(mr.prototype=Object.create(yi.prototype)).fromXML=function(t,e,n){M(e)||(n=e,e="bpmn:Definitions");var i=new qi($({model:this,lax:!0},n)),r=i.handler(e);return i.fromXML(t,r)},mr.prototype.toXML=function(t,e){var n=new pr(e);return new Promise((function(e,i){try{return e({xml:n.toXML(t)})}catch(t){return i(t)}}))};var hr={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 vr(t,e){return new mr($({},hr,t),e)}function br(t){return t?"<"+t.$type+(t.id?' id="'+t.id:"")+'" />':"<null>"}var gr=new zn({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function yr(t,e){return t.$instanceOf(e)}function xr(t,e){var n={},i=[];function r(t,e){return function(n){t(n,e)}}function o(t){n[t.id]=t}function a(n,i){try{var r=n.di&&function(n,i){if(n.gfx)throw new Error(e("already rendered {element}",{element:br(n)}));return t.element(n,i)}(n,i);return o(n),r}catch(t){c(t.message,{element:n,error:t}),console.error(e("failed to import {element}",{element:br(n)})),console.error(t)}}function c(e,n){t.error(e,n)}function s(t){var n=t.bpmnElement;n?n.di?c(e("multiple DI elements defined for {element}",{element:br(n)}),{element:n}):(gr.bind(n,"di"),n.di=t):c(e("no bpmnElement referenced in {element}",{element:br(t)}),{element:t})}function u(t){s(t)}function l(){for(;i.length;)i.shift()()}function f(t,e){k(t,e),g(t.ioSpecification,e),b(t.artifacts,e),o(t)}function d(t,e){a(t,e)}function p(t,e){a(t,e)}function m(t,e){a(t,e)}function h(t,e){a(t,e)}function v(t,e){a(t,e)}function b(t,e){R(t,(function(t){yr(t,"bpmn:Association")?i.push((function(){v(t,e)})):v(t,e)}))}function g(t,e){t&&(R(t.dataInputs,r(m,e)),R(t.dataOutputs,r(h,e)))}function y(t,e){k(t,e),b(t.artifacts,e)}function x(t,e){var n=a(t,e);yr(t,"bpmn:SubProcess")&&y(t,n||e),yr(t,"bpmn:Activity")&&g(t.ioSpecification,e),i.push((function(){R(t.dataInputAssociations,r(p,e)),R(t.dataOutputAssociations,r(p,e))}))}function w(t,e){i.push((function(){var n=a(t,e);t.childLaneSet&&E(t.childLaneSet,n||e),function(t){R(t.flowNodeRef,(function(e){var n=e.get("lanes");n&&n.push(t)}))}(t)}))}function E(t,e){R(t.lanes,r(w,e))}function k(t,n){!function(t,n){R(t,(function(t){yr(t,"bpmn:SequenceFlow")?i.push((function(){!function(t,e){a(t,e)}(t,n)})):yr(t,"bpmn:BoundaryEvent")?i.unshift((function(){x(t,n)})):yr(t,"bpmn:FlowNode")?x(t,n):yr(t,"bpmn:DataObject")||(yr(t,"bpmn:DataStoreReference")||yr(t,"bpmn:DataObjectReference")?function(t,e){a(t,e)}(t,n):c(e("unrecognized flowElement {element} in context {context}",{element:br(t),context:n?br(n.businessObject):"null"}),{element:t,context:n}))}))}(t.flowElements,n),t.laneSets&&function(t,e){R(t,r(E,e))}(t.laneSets,n)}function I(t,e){var n=a(t,e),i=t.processRef;i&&f(i,n||e)}return{handleDeferred:l,handleDefinitions:function(o,a){var p=o.diagrams;if(a&&-1===p.indexOf(a))throw new Error(e("diagram not part of bpmn:Definitions"));if(!a&&p&&p.length&&(a=p[0]),!a)throw new Error(e("no diagram to display"));!function(t){var e;s(e=t.plane),R(e.planeElement,u)}(a);var m=a.plane;if(!m)throw new Error(e("no plane for {element}",{element:br(a)}));var h=m.bpmnElement;if(!h){if(!(h=function(t){return N(t.rootElements,(function(t){return yr(t,"bpmn:Process")||yr(t,"bpmn:Collaboration")}))}(o)))throw new Error(e("no process or collaboration to display"));c(e("correcting missing bpmnElement on {plane} to {rootElement}",{plane:br(m),rootElement:br(h)})),m.bpmnElement=h,s(m)}var v,g=function(e,n){return t.root(e,n)}(h,m);if(yr(h,"bpmn:Process"))f(h,g);else{if(!yr(h,"bpmn:Collaboration"))throw new Error(e("unsupported bpmnElement for {plane}: {rootElement}",{plane:br(m),rootElement:br(h)}));R((v=h).participants,r(I)),b(v.artifacts),i.push((function(){R(v.messageFlows,r(d,undefined))})),function(t,e){D(t,(function(t){return!n[t.id]&&yr(t,"bpmn:Process")&&t.laneSets})).forEach(r(f,e))}(o.rootElements,g)}l()},handleSubProcess:y,registerDi:s}}function wr(t){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var e=arguments.length;if(!(e>=1&&_(arguments[e-1])))return t.apply(this,arguments);var n=arguments[e-1];console.warn(new Error("Passing callbacks to "+t.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);t.apply(this,i).then((function(t){var e=Object.keys(t)[0];return n(null,t[e])}),(function(t){return n(t,t.warnings)}))}}var Er='<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 kr(t){return t.join(";")}var Ir,_r=kr(["color: #404040"]),Mr='<div class="bjs-powered-by-lightbox" style="'+kr(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+kr(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+kr(["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;'+_r+'">'+Er+'</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 Sr(t){var e,n;t=$({},Nr,t),this._moddle=this._createModdle(t),this._container=this._createContainer(t),e=this._container,n=kt('<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; '+_r+'">'+Er+"</a>"),e.appendChild(n),yt.bind(n,"click",(function(t){Ir||(Ir=kt(Mr),wt(Ir,".backdrop","click",(function(){document.body.removeChild(Ir)}))),document.body.appendChild(Ir),t.preventDefault()})),this._init(this._container,this._moddle,t)}function Br(t,e){return t.warnings=e,t}p(Sr,oi),Sr.prototype.importXML=wr((function(t,e){var n=this;return new Promise((function(i,r){t=n._emit("import.parse.start",{xml:t})||t,n._moddle.fromXML(t,"bpmn:Definitions").then((function(t){var o,a,c=t.rootElement,s=t.warnings;c=n._emit("import.parse.complete",(o={error:null,definitions:c,elementsById:t.elementsById,references:t.references,warnings:s},a=n.get("eventBus").createEvent(o),Object.defineProperty(a,"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:o.warnings,references:o.references,elementsById:o.elementsById}}}),a))||c,n.importDefinitions(c,e).then((function(t){var e=[].concat(s,t.warnings||[]);return n._emit("import.done",{error:null,warnings:e}),i({warnings:e})})).catch((function(t){var e=[].concat(s,t.warnings||[]);return n._emit("import.done",{error:t,warnings:e}),r(Br(t,e))}))})).catch((function(t){return n._emit("import.parse.complete",{error:t}),t=function(t){var e=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(t.message);return e&&(t.message="unparsable content <"+e[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+e[2]),t}(t),n._emit("import.done",{error:t,warnings:t.warnings}),r(t)}))}))})),Sr.prototype.importDefinitions=wr((function(t,e){var n=this;return new Promise((function(i,r){n._setDefinitions(t),n.open(e).then((function(t){return i({warnings:t.warnings})})).catch((function(t){return r(t)}))}))})),Sr.prototype.open=wr((function(t){var e=this._definitions,n=t,i=this;return new Promise((function(r,o){if(!e){var a=new Error("no XML imported");return o(Br(a,[]))}if("string"==typeof t&&!(n=function(t,e){return e&&N(t.diagrams,(function(t){return t.id===e}))||null}(e,t))){var c=new Error("BPMNDiagram <"+t+"> not found");return o(Br(c,[]))}try{i.clear()}catch(t){return o(Br(t,[]))}(function(t,e,n){var i,r,o,a=[];return new Promise((function(c,s){try{return i=t.get("bpmnImporter"),r=t.get("eventBus"),o=t.get("translate"),r.fire("import.render.start",{definitions:e}),function(t,e){new xr({root:function(t){return i.add(t)},element:function(t,e){return i.add(t,e)},error:function(t,e){a.push({message:t,context:e})}},o).handleDefinitions(t,e)}(e,n),r.fire("import.render.complete",{error:void 0,warnings:a}),c({warnings:a})}catch(t){return t.warnings=a,s(t)}}))})(i,e,n).then((function(t){return r({warnings:t.warnings})})).catch((function(t){return o(t)}))}))})),Sr.prototype.saveXML=wr((function(t){t=t||{};var e=this,n=this._definitions;return new Promise((function(i){if(!n)return i({error:new Error("no definitions loaded")});n=e._emit("saveXML.start",{definitions:n})||n,e._moddle.toXML(n,t).then((function(t){var n=t.xml;return n=e._emit("saveXML.serialized",{xml:n})||n,i({xml:n})}))})).catch((function(t){return{error:t}})).then((function(t){e._emit("saveXML.done",t);var n=t.error;return n?Promise.reject(n):t}))})),Sr.prototype.saveSVG=wr((function(){var t=this;return new Promise((function(e,n){var i,r;t._emit("saveSVG.start");try{var o=t.get("canvas"),a=o.getDefaultLayer(),c=Mt("defs",o._svg),s=ee(a),u=c?"<defs>"+ee(c)+"</defs>":"",l=a.getBBox();i='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+l.width+'" height="'+l.height+'" viewBox="'+l.x+" "+l.y+" "+l.width+" "+l.height+'" version="1.1">'+u+s+"</svg>"}catch(t){r=t}return t._emit("saveSVG.done",{error:r,svg:i}),r?n(r):e({svg:i})}))})),Sr.prototype._setDefinitions=function(t){this._definitions=t},Sr.prototype.getModules=function(){return this._modules},Sr.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach((function(t){var e=t.businessObject;e&&e.di&&delete e.di})),oi.prototype.clear.call(this))},Sr.prototype.destroy=function(){oi.prototype.destroy.call(this),Bt(this._container)},Sr.prototype.on=function(t,e,n,i){return this.get("eventBus").on(t,e,n,i)},Sr.prototype.off=function(t,e){this.get("eventBus").off(t,e)},Sr.prototype.attachTo=function(t){if(!t)throw new Error("parentNode required");this.detach(),t.get&&t.constructor.prototype.jquery&&(t=t.get(0)),"string"==typeof t&&(t=Mt(t)),t.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Sr.prototype.getDefinitions=function(){return this._definitions},Sr.prototype.detach=function(){var t=this._container,e=t.parentNode;e&&(this._emit("detach",{}),e.removeChild(t))},Sr.prototype._init=function(t,e,n){var i=n.modules||this.getModules(),r=[].concat([{bpmnjs:["value",this],moddle:["value",e]}],i,n.additionalModules||[]),o=$(et(n,["additionalModules"]),{canvas:$({},n.canvas,{container:t}),modules:r});oi.call(this,o),n&&n.container&&this.attachTo(n.container)},Sr.prototype._emit=function(t,e){return this.get("eventBus").fire(t,e)},Sr.prototype._createContainer=function(t){var e=kt('<div class="bjs-container"></div>');return $(e.style,{width:Ar(t.width),height:Ar(t.height),position:t.position}),e},Sr.prototype._createModdle=function(t){return new vr($({},this._moddleExtensions,t.moddleExtensions))},Sr.prototype._modules=[];var Nr={width:"100%",height:"100%",position:"relative"};function Ar(t){return t+(I(t)?"px":"")}function Dr(t){Sr.call(this,t),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)}function Rr(t,e){var n=Cr(t);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(e)}function Cr(t){return t&&t.businessObject||t}p(Dr,Sr),Dr.prototype._createModdle=function(t){var e=Sr.prototype._createModdle.call(this,t);return e.ids=new h([32,36,1]),e},Dr.prototype._collectIds=function(t,e){var n,i=t.$model.ids;for(n in i.clear(),e)i.claim(n,e[n])};const Tr=Object.freeze({__proto__:null,is:Rr,getBusinessObject:Cr});function Pr(t){return!Rr(t,"bpmn:CallActivity")&&(Rr(t,"bpmn:SubProcess")?Cr(t).di&&!!Cr(t).di.isExpanded:!Rr(t,"bpmn:Participant")||!!Cr(t).processRef)}function zr(t){return t&&!!Cr(t).triggeredByEvent}function jr(t,e){var n=Cr(t),i=!1;return n.eventDefinitions&&R(n.eventDefinitions,(function(t){Rr(t,e)&&(i=!0)})),i}function Gr(t){return Rr(t,"bpmn:FlowElement")||Rr(t,"bpmn:Participant")||Rr(t,"bpmn:Lane")||Rr(t,"bpmn:SequenceFlow")||Rr(t,"bpmn:MessageFlow")||Rr(t,"bpmn:DataInput")||Rr(t,"bpmn:DataOutput")?"name":Rr(t,"bpmn:TextAnnotation")?"text":Rr(t,"bpmn:Group")?"categoryValueRef":void 0}function Fr(t){var e=t.businessObject,n=Gr(e);if(n)return"categoryValueRef"===n?function(t){var e=t.categoryValueRef;return e&&e.value||""}(e):e[n]||""}function Lr(t,e,n){return z(t.eventDefinitions,(function(i){return i.$type===e&&function(t,e){return P(e,(function(e,n){return t[n]==e}))}(t,n)}))}function Or(t){return t.businessObject.di}function Wr(t){return t.businessObject}function Zr(t,e){var n=Or(t);return n.get("color:background-color")||n.get("bioc:fill")||e||"white"}function Hr(t,e){var n=Or(t);return n.get("color:border-color")||n.get("bioc:stroke")||e||"black"}function Yr(t,e,n){var i=Or(t).get("label");return i&&i.get("color:color")||e||Hr(t,n)}var Ur=new h;function Vr(t,e,n,i,r,o,a){me.call(this,e,a);var c=t&&t.defaultFillColor,s=t&&t.defaultStrokeColor,u=t&&t.defaultLabelColor,l=Ur.next(),f={},d=n.computeStyle;function p(t,e){var n=$({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},e.attrs),i=e.ref||{x:0,y:0},o=e.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=Ut("marker");Ct(e.element,n),At(a,e.element),Ct(a,{id:t,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*o,markerHeight:20*o,orient:"auto"});var c=Mt("defs",r._svg);c||(c=Ut("defs"),At(r._svg,c)),At(c,a),f[t]=a}function m(t){return t.replace(/[^0-9a-zA-z]+/g,"_")}function h(t,e,n){var i=t+"-"+m(e)+"-"+m(n)+"-"+l;return f[i]||function(t,e,n,i){if("sequenceflow-end"===e){var r=Ut("path");Ct(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),p(t,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===e){var o=Ut("circle");Ct(o,{cx:6,cy:6,r:3.5}),p(t,{element:o,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===e){var a=Ut("path");Ct(a,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),p(t,{element:a,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===e){var c=Ut("path");Ct(c,{d:"M 11 5 L 1 10 L 11 15"}),p(t,{element:c,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===e){var s=Ut("path");Ct(s,{d:"M 1 5 L 11 10 L 1 15"}),p(t,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===e){var u=Ut("path");Ct(u,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),p(t,{element:u,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===e){var l=Ut("path");Ct(l,{d:"M 6 4 L 10 16"}),p(t,{element:l,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(i,t,e,n),"url(#"+i+")"}function v(t,e,n,i,r){k(i)&&(r=i,i=0),i=i||0,"none"===(r=d(r,{stroke:"black",strokeWidth:2,fill:"white"})).fill&&delete r.fillOpacity;var o=e/2,a=n/2,c=Ut("circle");return Ct(c,{cx:o,cy:a,r:Math.round((e+n)/4-i)}),Ct(c,r),At(t,c),c}function b(t,e,n,i,r,o){k(r)&&(o=r,r=0),r=r||0,o=d(o,{stroke:"black",strokeWidth:2,fill:"white"});var a=Ut("rect");return Ct(a,{x:r,y:r,width:e-2*r,height:n-2*r,rx:i,ry:i}),Ct(a,o),At(t,a),a}function g(t,e,n){var i=be(e,n=d(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return At(t,i),i}function y(t,e,n){n=d(n,["no-fill"],{strokeWidth:2,stroke:"black"});var i=Ut("path");return Ct(i,{d:e}),Ct(i,n),At(t,i),i}function x(t,e,n,i){return y(e,n,$({"data-marker":t},i))}function w(t){return function(e,n){return N[t](e,n)}}function E(t){return N[t]}function I(t,e){var n=Wr(t),i=function(t){return"bpmn:IntermediateThrowEvent"===t.$type||"bpmn:EndEvent"===t.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?E("bpmn:ParallelMultipleEventDefinition")(e,t,i):E("bpmn:MultipleEventDefinition")(e,t,i):Lr(n,"bpmn:MessageEventDefinition")?E("bpmn:MessageEventDefinition")(e,t,i):Lr(n,"bpmn:TimerEventDefinition")?E("bpmn:TimerEventDefinition")(e,t,i):Lr(n,"bpmn:ConditionalEventDefinition")?E("bpmn:ConditionalEventDefinition")(e,t):Lr(n,"bpmn:SignalEventDefinition")?E("bpmn:SignalEventDefinition")(e,t,i):Lr(n,"bpmn:EscalationEventDefinition")?E("bpmn:EscalationEventDefinition")(e,t,i):Lr(n,"bpmn:LinkEventDefinition")?E("bpmn:LinkEventDefinition")(e,t,i):Lr(n,"bpmn:ErrorEventDefinition")?E("bpmn:ErrorEventDefinition")(e,t,i):Lr(n,"bpmn:CancelEventDefinition")?E("bpmn:CancelEventDefinition")(e,t,i):Lr(n,"bpmn:CompensateEventDefinition")?E("bpmn:CompensateEventDefinition")(e,t,i):Lr(n,"bpmn:TerminateEventDefinition")?E("bpmn:TerminateEventDefinition")(e,t,i):null}function _(t,e,n){n=$({size:{width:100}},n);var i=o.createText(e||"",n);return Gt(i).add("djs-label"),At(t,i),i}function M(t,e,n){return _(t,Wr(e).name,{box:e,align:n,padding:5,style:{fill:Yr(e,u,s)}})}function S(t,e,n){$n(_(t,e,{box:{height:30,width:n.height},align:"center-middle",style:{fill:Yr(n,u,s)}}),0,1*n.height,270)}function B(t){for(var e=t.waypoints,n="m "+e[0].x+","+e[0].y,i=1;i<e.length;i++)n+="L"+e[i].x+","+e[i].y+" ";return n}var N=this.handlers={"bpmn:Event":function(t,e,n){return"fillOpacity"in n||(n.fillOpacity=.95),v(t,e.width,e.height,n)},"bpmn:StartEvent":function(t,e){var n={fill:Zr(e,c),stroke:Hr(e,s)};Wr(e).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:Zr(e,c),stroke:Hr(e,s)});var i=E("bpmn:Event")(t,e,n);return I(e,t),i},"bpmn:MessageEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:e.width,containerHeight:e.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?Hr(e,s):Zr(e,c),stroke:n?Zr(e,c):Hr(e,s)})},"bpmn:TimerEventDefinition":function(t,e){var n=v(t,e.width,e.height,.2*e.height,{strokeWidth:2,fill:Zr(e,c),stroke:Hr(e,s)});y(t,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:Hr(e,s)});for(var r=0;r<12;r++)y(t,i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.5}}),{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+e.height/2+","+e.width/2+")",stroke:Hr(e,s)});return n},"bpmn:EscalationEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)})},"bpmn:ConditionalEventDefinition":function(t,e){return y(t,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:Hr(e,s)})},"bpmn:LinkEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)})},"bpmn:ErrorEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:e.width,containerHeight:e.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)})},"bpmn:CancelEventDefinition":function(t,e,n){var r=y(t,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)});return ei(r,45),r},"bpmn:CompensateEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)})},"bpmn:SignalEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?Hr(e,s):"none",stroke:Hr(e,s)})},"bpmn:MultipleEventDefinition":function(t,e,n){return y(t,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:e.width,containerHeight:e.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:n?Hr(e,s):"none"})},"bpmn:ParallelMultipleEventDefinition":function(t,e){return y(t,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:e.width,containerHeight:e.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:Hr(e,s),stroke:Hr(e,s)})},"bpmn:EndEvent":function(t,e){var n=E("bpmn:Event")(t,e,{strokeWidth:4,fill:Zr(e,c),stroke:Hr(e,s)});return I(e,t),n},"bpmn:TerminateEventDefinition":function(t,e){return v(t,e.width,e.height,8,{strokeWidth:4,fill:Hr(e,s),stroke:Hr(e,s)})},"bpmn:IntermediateEvent":function(t,e){var n=E("bpmn:Event")(t,e,{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)});return v(t,e.width,e.height,3,{strokeWidth:1,fill:Zr(e,"none"),stroke:Hr(e,s)}),I(e,t),n},"bpmn:IntermediateCatchEvent":w("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":w("bpmn:IntermediateEvent"),"bpmn:Activity":function(t,e,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=.95),b(t,e.width,e.height,10,n)},"bpmn:Task":function(t,e){var n={fill:Zr(e,c),stroke:Hr(e,s)},i=E("bpmn:Activity")(t,e,n);return M(t,e,"center-middle"),A(t,e),i},"bpmn:ServiceTask":function(t,e){var n=E("bpmn:Task")(t,e);return y(t,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)}),y(t,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:Zr(e,c)}),y(t,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)}),n},"bpmn:UserTask":function(t,e){var n=E("bpmn:Task")(t,e);return y(t,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Zr(e,c),stroke:Hr(e,s)}),y(t,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Zr(e,c),stroke:Hr(e,s)}),y(t,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Hr(e,s),stroke:Hr(e,s)}),n},"bpmn:ManualTask":function(t,e){var n=E("bpmn:Task")(t,e);return y(t,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:Zr(e,c),stroke:Hr(e,s)}),n},"bpmn:SendTask":function(t,e){var n=E("bpmn:Task")(t,e);return y(t,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:Hr(e,s),stroke:Zr(e,c)}),n},"bpmn:ReceiveTask":function(t,e){var n,r=Wr(e),o=E("bpmn:Task")(t,e);return r.instantiate?(v(t,28,28,4.4,{strokeWidth:1}),n=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):n=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),y(t,n,{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)}),o},"bpmn:ScriptTask":function(t,e){var n=E("bpmn:Task")(t,e);return y(t,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:Hr(e,s)}),n},"bpmn:BusinessRuleTask":function(t,e){var n=E("bpmn:Task")(t,e);return Ct(y(t,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:Zr(e,"#aaaaaa"),stroke:Hr(e,s)}),Ct(y(t,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:Hr(e,s)}),n},"bpmn:SubProcess":function(t,e,n){n=$({fill:Zr(e,c),stroke:Hr(e,s)},n);var i=E("bpmn:Activity")(t,e,n),r=Pr(e);return zr(e)&&Ct(i,{strokeDasharray:"1,2"}),M(t,e,r?"center-top":"center-middle"),r?A(t,e):A(t,e,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(t,e){return E("bpmn:SubProcess")(t,e)},"bpmn:Transaction":function(t,e){var i=E("bpmn:SubProcess")(t,e),r=n.style(["no-fill","no-events"],{stroke:Hr(e,s)});return b(t,e.width,e.height,8,3,r),i},"bpmn:CallActivity":function(t,e){return E("bpmn:SubProcess")(t,e,{strokeWidth:5})},"bpmn:Participant":function(t,e){var n={fillOpacity:.95,fill:Zr(e,c),stroke:Hr(e,s)},i=E("bpmn:Lane")(t,e,n);return Pr(e)?(g(t,[{x:30,y:0},{x:30,y:e.height}],{stroke:Hr(e,s)}),S(t,Wr(e).name,e)):_(t,Wr(e).name,{box:e,align:"center-middle",style:{fill:Yr(e,u,s)}}),!!Wr(e).participantMultiplicity&&E("ParticipantMultiplicityMarker")(t,e),i},"bpmn:Lane":function(t,e,n){var i=b(t,e.width,e.height,0,$({fill:Zr(e,c),fillOpacity:.35,stroke:Hr(e,s)},n)),r=Wr(e);return"bpmn:Lane"===r.$type&&S(t,r.name,e),i},"bpmn:InclusiveGateway":function(t,e){var n=E("bpmn:Gateway")(t,e);return v(t,e.width,e.height,.24*e.height,{strokeWidth:2.5,fill:Zr(e,c),stroke:Hr(e,s)}),n},"bpmn:ExclusiveGateway":function(t,e){var n=E("bpmn:Gateway")(t,e),r=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:e.width,containerHeight:e.height,position:{mx:.32,my:.3}});return Or(e).isMarkerVisible&&y(t,r,{strokeWidth:1,fill:Hr(e,s),stroke:Hr(e,s)}),n},"bpmn:ComplexGateway":function(t,e){var n=E("bpmn:Gateway")(t,e);return y(t,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:e.width,containerHeight:e.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:Hr(e,s),stroke:Hr(e,s)}),n},"bpmn:ParallelGateway":function(t,e){var n=E("bpmn:Gateway")(t,e);return y(t,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:e.width,containerHeight:e.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:Hr(e,s),stroke:Hr(e,s)}),n},"bpmn:EventBasedGateway":function(t,e){var n=Wr(e),r=E("bpmn:Gateway")(t,e);v(t,e.width,e.height,.2*e.height,{strokeWidth:1,fill:"none",stroke:Hr(e,s)});var o=n.eventGatewayType,a=!!n.instantiate;if("Parallel"===o){var c=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:e.width,containerHeight:e.height,position:{mx:.474,my:.296}});Ct(y(t,c),{strokeWidth:1,fill:"none"})}else"Exclusive"===o&&(a||Ct(v(t,e.width,e.height,.26*e.height),{strokeWidth:1,fill:"none",stroke:Hr(e,s)}),function(){var n=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:e.width,containerHeight:e.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:Zr(e,"none"),stroke:Hr(e,s)};y(t,n,r)}());return r},"bpmn:Gateway":function(t,e){var n={fill:Zr(e,c),fillOpacity:.95,stroke:Hr(e,s)};return function(t,e,n,i){var r=e/2,o=n/2,a=[{x:r,y:0},{x:e,y:o},{x:r,y:n},{x:0,y:o}].map((function(t){return t.x+","+t.y})).join(" ");i=d(i,{stroke:"black",strokeWidth:2,fill:"white"});var c=Ut("polygon");return Ct(c,{points:a}),Ct(c,i),At(t,c),c}(t,e.width,e.height,n)},"bpmn:SequenceFlow":function(t,e){var n,i=B(e),r=Zr(e,c),o=Hr(e,s),a=y(t,i,{strokeLinejoin:"round",markerEnd:h("sequenceflow-end",r,o),stroke:Hr(e,s)}),u=Wr(e);return e.source&&(n=e.source.businessObject,u.conditionExpression&&n.$instanceOf("bpmn:Activity")&&Ct(a,{markerStart:h("conditional-flow-marker",r,o)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===u&&Ct(a,{markerStart:h("conditional-default-flow-marker",r,o)})),a},"bpmn:Association":function(t,e,n){var i=Wr(e),r=Zr(e,c),o=Hr(e,s);return n=$({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:Hr(e,s)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=h("association-end",r,o)),"Both"===i.associationDirection&&(n.markerStart=h("association-start",r,o)),g(t,e.waypoints,n)},"bpmn:DataInputAssociation":function(t,e){var n=Zr(e,c),i=Hr(e,s);return E("bpmn:Association")(t,e,{markerEnd:h("association-end",n,i)})},"bpmn:DataOutputAssociation":function(t,e){var n=Zr(e,c),i=Hr(e,s);return E("bpmn:Association")(t,e,{markerEnd:h("association-end",n,i)})},"bpmn:MessageFlow":function(t,e){var n=Wr(e),r=Or(e),o=Zr(e,c),a=Hr(e,s),l=y(t,B(e),{markerEnd:h("messageflow-end",o,a),markerStart:h("messageflow-start",o,a),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:Hr(e,s)});if(n.messageRef){var f=l.getPointAtLength(l.getTotalLength()/2),d=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:f.x,y:f.y}}),p={strokeWidth:1};"initiating"===r.messageVisibleKind?(p.fill="white",p.stroke="black"):(p.fill="#888",p.stroke="white");var m=y(t,d,p),v=_(t,n.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:Hr(e,u)}}),b=m.getBBox(),g=v.getBBox();$n(v,f.x-g.width/2,f.y+b.height/2+10,0)}return l},"bpmn:DataObject":function(t,e){var n=y(t,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.474,my:.296}}),{fill:Zr(e,c),fillOpacity:.95,stroke:Hr(e,s)});return function(t){var e=t.dataObjectRef;return t.isCollection||e&&e.isCollection}(Wr(e))&&function(t,e){y(t,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.33,my:(e.height-18)/e.height}}),{strokeWidth:2})}(t,e),n},"bpmn:DataObjectReference":w("bpmn:DataObject"),"bpmn:DataInput":function(t,e){var n=i.getRawPath("DATA_ARROW"),r=E("bpmn:DataObject")(t,e);return y(t,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(t,e){var n=i.getRawPath("DATA_ARROW"),r=E("bpmn:DataObject")(t,e);return y(t,n,{strokeWidth:1,fill:"black"}),r},"bpmn:DataStoreReference":function(t,e){return y(t,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:Zr(e,c),fillOpacity:.95,stroke:Hr(e,s)})},"bpmn:BoundaryEvent":function(t,e){var n=Wr(e).cancelActivity,i={strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=$({},i,{fillOpacity:1}),o=$({},i,{fill:"none"}),a=E("bpmn:Event")(t,e,r);return v(t,e.width,e.height,3,o),I(e,t),a},"bpmn:Group":function(t,e){return b(t,e.width,e.height,10,{stroke:Hr(e,s),strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(t,e){return function(t,e){var n={width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y};return _(t,Fr(e),{box:n,fitBox:!0,style:$({},o.getExternalStyle(),{fill:Yr(e,u,s)})})}(t,e)},"bpmn:TextAnnotation":function(t,e){var n=b(t,e.width,e.height,0,0,{fill:"none",stroke:"none"});return y(t,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:0,my:0}}),{stroke:Hr(e,s)}),_(t,Wr(e).text||"",{box:e,align:"left-top",padding:5,style:{fill:Yr(e,u,s)}}),n},ParticipantMultiplicityMarker:function(t,e){x("participant-multiplicity",t,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:e.width/2/e.width,my:(e.height-15)/e.height}}),{strokeWidth:2,fill:Zr(e,c),stroke:Hr(e,s)})},SubProcessMarker:function(t,e){ti(b(t,14,14,0,{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)}),e.width/2-7.5,e.height-20),x("sub-process",t,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2-7.5)/e.width,my:(e.height-20)/e.height}}),{fill:Zr(e,c),stroke:Hr(e,s)})},ParallelMarker:function(t,e,n){x("parallel",t,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+n.parallel)/e.width,my:(e.height-20)/e.height}}),{fill:Zr(e,c),stroke:Hr(e,s)})},SequentialMarker:function(t,e,n){x("sequential",t,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+n.seq)/e.width,my:(e.height-19)/e.height}}),{fill:Zr(e,c),stroke:Hr(e,s)})},CompensationMarker:function(t,e,n){x("compensation",t,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+n.compensation)/e.width,my:(e.height-13)/e.height}}),{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s)})},LoopMarker:function(t,e,n){x("loop",t,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+n.loop)/e.width,my:(e.height-7)/e.height}}),{strokeWidth:1,fill:Zr(e,c),stroke:Hr(e,s),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(t,e,n){x("adhoc",t,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+n.adhoc)/e.width,my:(e.height-15)/e.height}}),{strokeWidth:1,fill:Hr(e,s),stroke:Hr(e,s)})}};function A(t,e,n){var i,r=Wr(e),o=n&&-1!==n.indexOf("SubProcessMarker");i=o?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},R(n,(function(n){E(n)(t,e,i)})),r.isForCompensation&&E("CompensationMarker")(t,e,i),"bpmn:AdHocSubProcess"===r.$type&&E("AdhocMarker")(t,e,i);var a=r.loopCharacteristics,c=a&&a.isSequential;a&&(void 0===c&&E("LoopMarker")(t,e,i),!1===c&&E("ParallelMarker")(t,e,i),!0===c&&E("SequentialMarker")(t,e,i))}this._drawPath=y}p(Vr,me),Vr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Vr.prototype.canRender=function(t){return Rr(t,"bpmn:BaseElement")},Vr.prototype.drawShape=function(t,e){return(0,this.handlers[e.type])(t,e)},Vr.prototype.drawConnection=function(t,e){return(0,this.handlers[e.type])(t,e)},Vr.prototype.getShapePath=function(t){return Rr(t,"bpmn:Event")?he([["M",(e=t).x+e.width/2,e.y+e.height/2],["m",0,-(n=e.width/2)],["a",n,n,0,1,1,0,2*n],["a",n,n,0,1,1,0,-2*n],["z"]]):Rr(t,"bpmn:Activity")?function(t,e){var n=t.width,i=t.height;return he([["M",t.x+e,t.y],["l",n-20,0],["a",e,e,0,0,1,e,e],["l",0,i-20],["a",e,e,0,0,1,-10,e],["l",20-n,0],["a",e,e,0,0,1,-10,-10],["l",0,20-i],["a",e,e,0,0,1,e,-10],["z"]])}(t,10):Rr(t,"bpmn:Gateway")?function(t){var e=t.width/2,n=t.height/2;return he([["M",t.x+e,t.y],["l",e,n],["l",-e,n],["l",-e,-n],["z"]])}(t):function(t){var e=t.width;return he([["M",t.x,t.y],["l",e,0],["l",0,t.height],["l",-e,0],["z"]])}(t);var e,n};var Xr={width:150,height:50};function Jr(t,e){var n;e.textContent=t;try{var i,r=""===t;return e.textContent=r?"dummy":t,i={width:(n=e.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(t){return{width:0,height:0}}}function Qr(t,e,n){for(var i,r=t.shift(),o=r;;){if((i=Jr(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(e)||o.length<2)return qr(t,o,r,i);o=Kr(o,i.width,e)}}function qr(t,e,n,i){if(e.length<n.length){var r=n.slice(e.length).trim();t.unshift(r)}return{width:i.width,height:i.height,text:e}}function Kr(t,e,n){var i=Math.max(t.length*(n/e),1),r=function(t,e){var n,i=t.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<e)){"-"!==n&&""!==n||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&""===a&&(r[r.length-1]="-"),r.join("")}(t,i);return r||(r=t.slice(0,Math.max(Math.round(i-1),1))),r}function $r(t){this._config=$({},{size:Xr,padding:0,style:{},align:"center-top"},t||{})}function to(t){var e=$({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},t&&t.defaultStyle||{}),n=parseInt(e.fontSize,10)-1,i=$({},e,{fontSize:n},t&&t.externalStyle||{}),r=new $r({style:e});this.getExternalLabelBounds=function(t,e){var n=r.getDimensions(e,{box:{width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y},style:i});return{x:Math.round(t.x+t.width/2-n.width/2),y:Math.round(t.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(t,n){var i=r.getDimensions(n,{box:t,style:e,align:"left-top",padding:5});return{x:t.x,y:t.y,width:t.width,height:Math.max(30,Math.round(i.height))}},this.createText=function(t,e){return r.createText(t,e||{})},this.getDefaultStyle=function(){return e},this.getExternalStyle=function(){return i}}$r.prototype.createText=function(t,e){return this.layoutText(t,e).element},$r.prototype.getDimensions=function(t,e){return this.layoutText(t,e).dimensions},$r.prototype.layoutText=function(t,e){var n,i=$({},this._config.size,e.box),r=$({},this._config.style,e.style),o=function(t){var e=t.split("-");return{horizontal:e[0]||"center",vertical:e[1]||"top"}}(e.align||this._config.align),a=function(t){return k(t)?$({top:0,left:0,right:0,bottom:0},t):{top:t,left:t,right:t,bottom:t}}(void 0!==e.padding?e.padding:this._config.padding),c=e.fitBox||!1,s=function(t){if("fontSize"in t&&"lineHeight"in t)return t.lineHeight*parseInt(t.fontSize,10)}(r),u=t.split(/\u00AD?\r?\n/),l=[],f=i.width-a.left-a.right,d=Ut("text");for(Ct(d,{x:0,y:0}),Ct(d,r),At((n=void 0,(n=document.getElementById("helper-svg"))||(Ct(n=Ut("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(n)),n),d);u.length;)l.push(Qr(u,f,d));"middle"===o.vertical&&(a.top=a.bottom=0);var p=T(l,(function(t,e){return t+(s||e.height)}),0)+a.top+a.bottom,m=T(l,(function(t,e){return e.width>t?e.width:t}),0),h=a.top;"middle"===o.vertical&&(h+=(i.height-p)/2),h-=(s||l[0].height)/4;var v=Ut("text");return Ct(v,r),R(l,(function(t){var e;switch(h+=s||t.height,o.horizontal){case"left":e=a.left;break;case"right":e=(c?m:f)-a.right-t.width;break;default:e=Math.max(((c?m:f)-t.width)/2+a.left,0)}var n=Ut("tspan");Ct(n,{x:e,y:h}),n.textContent=t.text,At(v,n)})),Lt(d),{dimensions:{width:m,height:p},element:v}},to.$inject=["config.textRenderer"];var eo=/\{([^}]+)\}/g,no=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const io={__init__:["bpmnRenderer"],bpmnRenderer:["type",Vr],textRenderer:["type",to],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(t){return this.pathMap[t].d},this.getScaledPath=function(t,e){var n,i,r=this.pathMap[t];e.abspos?(n=e.abspos.x,i=e.abspos.y):(n=e.containerWidth*e.position.mx,i=e.containerHeight*e.position.my);var o,a={};if(e.position){for(var c=e.containerHeight/r.height*e.yScaleFactor,s=e.containerWidth/r.width*e.xScaleFactor,u=0;u<r.heightElements.length;u++)a["y"+u]=r.heightElements[u]*c;for(var l=0;l<r.widthElements.length;l++)a["x"+l]=r.widthElements[l]*s}return o={mx:n,my:i,e:a},String(r.d).replace(eo,(function(t,e){return function(t,e,n){var i=n;return e.replace(no,(function(t,e,n,r,o){e=e||r,i&&(e in i&&(i=i[e]),"function"==typeof i&&o&&(i=i()))})),i=(null==i||i==n?t:i)+""}(t,e,o)}))}}]},ro={translate:["value",function(t,e){return e=e||{},t.replace(/{([^}]+)}/g,(function(t,n){return e[n]||"{"+n+"}"}))}]};var oo={width:90,height:20};function ao(t){return Rr(t,"bpmn:Event")||Rr(t,"bpmn:Gateway")||Rr(t,"bpmn:DataStoreReference")||Rr(t,"bpmn:DataObjectReference")||Rr(t,"bpmn:DataInput")||Rr(t,"bpmn:DataOutput")||Rr(t,"bpmn:SequenceFlow")||Rr(t,"bpmn:MessageFlow")||Rr(t,"bpmn:Group")}function co(t){return uo(t.label)}function so(t){return t.waypoints?(n=(e=t.waypoints).length/2-1,i=e[Math.floor(n)],r=e[Math.ceil(n+.01)],o=function(t){var e=t.length/2-1,n=t[Math.floor(e)],i=t[Math.ceil(e+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),a=Math.atan((r.y-i.y)/(r.x-i.x)),c=o.x,s=o.y,Math.abs(a)<Math.PI/2?s-=15:c+=15,{x:c,y:s}):Rr(t,"bpmn:Group")?{x:t.x+t.width/2,y:t.y+oo.height/2}:{x:t.x+t.width/2,y:t.y+t.height+oo.height/2};var e,n,i,r,o,a,c,s}function uo(t){return t&&!!t.labelTarget}function lo(t,e){return $({id:t.id,type:t.$type,businessObject:t},e)}function fo(t,e,n){var i=t.di.waypoint;return!i||i.length<2?[En(e),En(n)]:i.map((function(t){return{x:t.x,y:t.y}}))}function po(t,e,n,i){return new Error(t("element {element} referenced by {referenced}#{property} not yet drawn",{element:br(n),referenced:br(e),property:i}))}function mo(t,e,n,i,r,o){this._eventBus=t,this._canvas=e,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}mo.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],mo.prototype.add=function(t,e){var n,i,r,o,a,c,s=t.di,u=this._translate;if(Rr(s,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(lo(t)),this._canvas.setRootElement(n);else if(Rr(s,"bpmndi:BPMNShape")){var l=!Pr(t),f=function(t){return Rr(t,"bpmn:Group")}(t),d=t.di.bounds;n=this._elementFactory.createShape(lo(t,{collapsed:l,hidden:e&&(e.hidden||e.collapsed),x:Math.round(d.x),y:Math.round(d.y),width:Math.round(d.width),height:Math.round(d.height),isFrame:f})),Rr(t,"bpmn:BoundaryEvent")&&this._attachBoundary(t,n),Rr(t,"bpmn:Lane")&&(i=0),Rr(t,"bpmn:DataStoreReference")&&(r=e,c=(o=En(d)).y,(a=o.x)>=r.x&&a<=r.x+r.width&&c>=r.y&&c<=r.y+r.height||(e=this._canvas.getRootElement())),this._canvas.addShape(n,e,i)}else{if(!Rr(s,"bpmndi:BPMNEdge"))throw new Error(u("unknown di {di} for element {semantic}",{di:br(s),semantic:br(t)}));var p=this._getSource(t),m=this._getTarget(t);n=this._elementFactory.createConnection(lo(t,{hidden:e&&(e.hidden||e.collapsed),source:p,target:m,waypoints:fo(t,p,m)})),Rr(t,"bpmn:DataAssociation")&&(e=null),Rr(t,"bpmn:SequenceFlow")&&(i=0),this._canvas.addConnection(n,e,i)}return ao(t)&&Fr(n)&&this.addLabel(t,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},mo.prototype._attachBoundary=function(t,e){var n=this._translate,i=t.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:br(t)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw po(n,t,i,"attachedToRef");e.host=r,o||(r.attachers=o=[]),-1===o.indexOf(e)&&o.push(e)},mo.prototype.addLabel=function(t,e){var n,i,r;return n=function(t,e){var n,i,r,o=t.di.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(oo.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=so(e),i=oo),$({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,e),(i=Fr(e))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(lo(t,{id:t.id+"_label",labelTarget:e,type:"label",hidden:e.hidden||!Fr(e),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,e.parent)},mo.prototype._getEnd=function(t,e){var n,i,r=t.$type,o=this._translate;if(i=t[e+"Ref"],"source"===e&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===e&&"bpmn:DataOutputAssociation"===r||"target"===e&&"bpmn:DataInputAssociation"===r)&&(i=t.$parent),n=i&&this._getElement(i))return n;throw i?po(o,t,i,e+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:br(t),side:e}))},mo.prototype._getSource=function(t){return this._getEnd(t,"source")},mo.prototype._getTarget=function(t){return this._getEnd(t,"target")},mo.prototype._getElement=function(t){return this._elementRegistry.get(t.id)};const ho={__depends__:[io,{__depends__:[ro],bpmnImporter:["type",mo]}]};function vo(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}function bo(t){return t.originalEvent||t.srcEvent}function go(t){vo(t),vo(bo(t))}function yo(t){return t.pointers&&t.pointers.length&&(t=t.pointers[0]),t.touches&&t.touches.length&&(t=t.touches[0]),t?{x:t.clientX,y:t.clientY}:null}function xo(t,e){return(bo(t)||t).button===e}function wo(t){return xo(t,0)}function Eo(t){var e=bo(t)||t;return!!wo(t)&&(/mac/i.test(navigator.platform)?e.metaKey:e.ctrlKey)}function ko(t){var e=bo(t)||t;return wo(t)&&e.shiftKey}function Io(){return!0}function _o(t){return wo(t)||function(t){return xo(t,1)}(t)}function Mo(t,e,n){var i=this;function r(n,i,r){var o,a;(function(t,e){return!(s[t]||wo)(e)})(n,i)||(r?a=e.getGraphics(r):(o=i.delegateTarget||i.target)&&(r=e.get(a=o)),a&&r&&!1===t.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function a(t){return o[t]}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"},s={"element.contextmenu":Io,"element.mousedown":_o,"element.mouseup":_o,"element.click":_o,"element.dblclick":_o};function u(t,e,n,i){var a=o[n]=function(t){r(n,t)};i&&(s[n]=i),a.$delegate=wt(t,"svg, .djs-element",e,a)}function l(t,e,n){var i=a(n);i&&Et(t,e,i.$delegate)}t.on("canvas.destroy",(function(t){var e;e=t.svg,R(c,(function(t,n){l(e,n,t)}))})),t.on("canvas.init",(function(t){var e;e=t.svg,R(c,(function(t,n){u(e,n,t)}))})),t.on(["shape.added","connection.added"],(function(e){t.fire("interactionEvents.createHit",{element:e.element,gfx:e.gfx})})),t.on(["shape.changed","connection.changed"],500,(function(e){t.fire("interactionEvents.updateHit",{element:e.element,gfx:e.gfx})})),t.on("interactionEvents.createHit",500,(function(t){i.createDefaultHit(t.element,t.gfx)})),t.on("interactionEvents.updateHit",(function(t){i.updateDefaultHit(t.element,t.gfx)}));var f=m("djs-hit djs-hit-stroke"),d=m("djs-hit djs-hit-click-stroke"),p={all:m("djs-hit djs-hit-all"),"click-stroke":d,stroke:f};function m(t,e){return e=$({stroke:"white",strokeWidth:15},e||{}),n.cls(t,["no-fill","no-border"],e)}function h(t,e){var n=p[e];if(!n)throw new Error("invalid hit type <"+e+">");return Ct(t,n),t}function v(t,e){At(t,e)}this.removeHits=function(t){R(St(".djs-hit",t),Lt)},this.createDefaultHit=function(t,e){var n=t.waypoints,i=t.isFrame;return n?this.createWaypointsHit(e,n):this.createBoxHit(e,i?"stroke":"all",{width:t.width,height:t.height})},this.createWaypointsHit=function(t,e){var n=be(e);return h(n,"stroke"),v(t,n),n},this.createBoxHit=function(t,e,n){n=$({x:0,y:0},n);var i=Ut("rect");return h(i,e),Ct(i,n),v(t,i),i},this.updateDefaultHit=function(t,e){var n=Mt(".djs-hit",e);if(n)return t.waypoints?function(t,e){Ct(t,{points:ve(e)})}(n,t.waypoints):Ct(n,{width:t.width,height:t.height}),n},this.fire=r,this.triggerMouseEvent=function(t,e,n){var i=c[t];if(!i)throw new Error("unmapped DOM event name <"+t+">");return r(i,e,n)},this.mouseHandler=a,this.registerEvent=u,this.unregisterEvent=l}Mo.$inject=["eventBus","elementRegistry","styles"];const So={__init__:["interactionEvents"],interactionEvents:["type",Mo]};function Bo(t,e){this.offset=6;var n=e.cls("djs-outline",["no-fill"]),i=this;function r(t){var e=Ut("rect");return Ct(e,$({x:10,y:10,width:100,height:100},n)),At(t,e),e}t.on(["shape.added","shape.changed"],500,(function(t){var e=t.element,n=t.gfx,o=Mt(".djs-outline",n);o||(o=r(n)),i.updateShapeOutline(o,e)})),t.on(["connection.added","connection.changed"],(function(t){var e=t.element,n=t.gfx,o=Mt(".djs-outline",n);o||(o=r(n)),i.updateConnectionOutline(o,e)}))}Bo.prototype.updateShapeOutline=function(t,e){Ct(t,{x:-this.offset,y:-this.offset,width:e.width+2*this.offset,height:e.height+2*this.offset})},Bo.prototype.updateConnectionOutline=function(t,e){var n=ke(e);Ct(t,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Bo.$inject=["eventBus","styles","elementRegistry"];const No={__init__:["outline"],outline:["type",Bo]};function Ao(t){this._eventBus=t,this._selectedElements=[];var e=this;t.on(["shape.remove","connection.remove"],(function(t){e.deselect(t.element)})),t.on(["diagram.clear"],(function(){e.select(null)}))}function Do(t,e){function n(t,n){e.addMarker(t,n)}function i(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(t){n(t.element,"hover")})),t.on("element.out",(function(t){i(t.element,"hover")})),t.on("selection.changed",(function(t){var e=t.oldSelection,r=t.newSelection;R(e,(function(t){-1===r.indexOf(t)&&i(t,"selected")})),R(r,(function(t){-1===e.indexOf(t)&&n(t,"selected")}))}))}function Ro(t,e,n,i){t.on("create.end",500,(function(t){var n=t.context,i=n.elements,r=(n.hints||{}).autoSelect;if(n.canExecute){if(!1===r)return;E(r)?e.select(r):e.select(i.filter(Co))}})),t.on("connect.end",500,(function(t){var n=t.context,i=n.hover;n.canExecute&&i&&e.select(i)})),t.on("shape.move.end",500,(function(t){var n=t.previousSelection||[],r=i.get(t.context.shape.id);N(n,(function(t){return r.id===t.id}))||e.select(r)})),t.on("element.click",(function(t){if(wo(t)){var i=t.element;i===n.getRootElement()&&(i=null);var r=e.isSelected(i),o=e.get().length>1,a=Eo(t)||ko(t);if(r&&o)return a?e.deselect(i):e.select(i);r?e.deselect(i):e.select(i,a)}}))}function Co(t){return!t.hidden}Ao.$inject=["eventBus"],Ao.prototype.deselect=function(t){var e=this._selectedElements,n=e.indexOf(t);if(-1!==n){var i=e.slice();e.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:e})}},Ao.prototype.get=function(){return this._selectedElements},Ao.prototype.isSelected=function(t){return-1!==this._selectedElements.indexOf(t)},Ao.prototype.select=function(t,e){var n=this._selectedElements,i=n.slice();E(t)||(t=t?[t]:[]),e?R(t,(function(t){-1===n.indexOf(t)&&n.push(t)})):this._selectedElements=n=t.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})},Do.$inject=["eventBus","canvas","selection","styles"],Ro.$inject=["eventBus","selection","canvas","elementRegistry"];const To={__init__:["selectionVisuals","selectionBehavior"],__depends__:[So,No],selection:["type",Ao],selectionVisuals:["type",Do],selectionBehavior:["type",Ro]};function Po(t){this._counter=0,this._prefix=(t?t+"-":"")+Math.floor(1e9*Math.random())+"-"}Po.prototype.next=function(){return this._prefix+ ++this._counter};var zo=new Po("ov");function jo(t,e,n,i){var r,o;this._eventBus=e,this._canvas=n,this._elementRegistry=i,this._ids=zo,this._overlayDefaults=$({show:null,scale:!0},t&&t.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),o=kt('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(o,r.firstChild),o),this._init()}function Go(t,e,n){$(t.style,{left:e+"px",top:n+"px"})}function Fo(t,e){t.style.display=!1===e?"none":""}function Lo(t,e){t.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){t.style[n+"transform"]=e}))}jo.$inject=["config.overlays","eventBus","canvas","elementRegistry"],jo.prototype.get=function(t){if(M(t)&&(t={id:t}),M(t.element)&&(t.element=this._elementRegistry.get(t.element)),t.element){var e=this._getOverlayContainer(t.element,!0);return e?t.type?D(e.overlays,Y({type:t.type})):e.overlays.slice():[]}return t.type?D(this._overlays,Y({type:t.type})):t.id?this._overlays[t.id]:null},jo.prototype.add=function(t,e,n){if(k(e)&&(n=e,e=null),t.id||(t=this._elementRegistry.get(t)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!t)throw new Error("invalid element specified");var i=this._ids.next();return n=$({},this._overlayDefaults,n,{id:i,type:e,element:t,html:n.html}),this._addOverlay(n),i},jo.prototype.remove=function(t){var e=this.get(t)||[];E(e)||(e=[e]);var n=this;R(e,(function(t){var e=n._getOverlayContainer(t.element,!0);if(t&&(Bt(t.html),Bt(t.htmlContainer),delete t.htmlContainer,delete t.element,delete n._overlays[t.id]),e){var i=e.overlays.indexOf(t);-1!==i&&e.overlays.splice(i,1)}}))},jo.prototype.show=function(){Fo(this._overlayRoot)},jo.prototype.hide=function(){Fo(this._overlayRoot,!1)},jo.prototype.clear=function(){this._overlays={},this._overlayContainers=[],lt(this._overlayRoot)},jo.prototype._updateOverlayContainer=function(t){var e=t.element,n=t.html,i=e.x,r=e.y;if(e.waypoints){var o=ke(e);i=o.x,r=o.y}Go(n,i,r),it(t.html,"data-container-id",e.id)},jo.prototype._updateOverlay=function(t){var e,n,i=t.position,r=t.htmlContainer,o=t.element,a=i.left,c=i.top;void 0!==i.right&&(e=o.waypoints?ke(o).width:o.width,a=-1*i.right+e),void 0!==i.bottom&&(n=o.waypoints?ke(o).height:o.height,c=-1*i.bottom+n),Go(r,a||0,c||0)},jo.prototype._createOverlayContainer=function(t){var e=kt('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(e);var n={html:e,element:t,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},jo.prototype._updateRoot=function(t){var e=t.scale||1,n="matrix("+[e,0,0,e,-1*t.x*e,-1*t.y*e].join(",")+")";Lo(this._overlayRoot,n)},jo.prototype._getOverlayContainer=function(t,e){var n=N(this._overlayContainers,(function(e){return e.element===t}));return n||e?n:this._createOverlayContainer(t)},jo.prototype._addOverlay=function(t){var e,n,i=t.id,r=t.element,o=t.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),M(o)&&(o=kt(o)),n=this._getOverlayContainer(r),(e=kt('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(o),t.type&&st(e).add("djs-overlay-"+t.type),t.htmlContainer=e,n.overlays.push(t),n.html.appendChild(e),this._overlays[i]=t,this._updateOverlay(t),this._updateOverlayVisibilty(t,this._canvas.viewbox())},jo.prototype._updateOverlayVisibilty=function(t,e){var n=t.show,i=n&&n.minZoom,r=n&&n.maxZoom,o=t.htmlContainer,a=!0;n&&((x(i)&&i>e.scale||x(r)&&r<e.scale)&&(a=!1),Fo(o,a)),this._updateOverlayScale(t,e)},jo.prototype._updateOverlayScale=function(t,e){var n,i,r,o=t.scale,a=t.htmlContainer,c="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),x(n)&&e.scale<n&&(r=(1/e.scale||1)*n),x(i)&&e.scale>i&&(r=(1/e.scale||1)*i)),x(r)&&(c="scale("+r+","+r+")"),Lo(a,c)},jo.prototype._updateOverlaysVisibilty=function(t){var e=this;R(this._overlays,(function(n){e._updateOverlayVisibilty(n,t)}))},jo.prototype._init=function(){var t=this._eventBus,e=this;t.on("canvas.viewbox.changing",(function(){e.hide()})),t.on("canvas.viewbox.changed",(function(t){var n;e._updateRoot(n=t.viewbox),e._updateOverlaysVisibilty(n),e.show()})),t.on(["shape.remove","connection.remove"],(function(t){var n=t.element;R(e.get({element:n}),(function(t){e.remove(t.id)}));var i=e._getOverlayContainer(n);if(i){Bt(i.html);var r=e._overlayContainers.indexOf(i);-1!==r&&e._overlayContainers.splice(r,1)}})),t.on("element.changed",500,(function(t){var n=e._getOverlayContainer(t.element,!0);n&&(R(n.overlays,(function(t){e._updateOverlay(t)})),e._updateOverlayContainer(n))})),t.on("element.marker.update",(function(t){var n=e._getOverlayContainer(t.element,!0);n&&st(n.html)[t.add?"add":"remove"](t.marker)})),t.on("diagram.clear",this.clear,this)};const Oo={__init__:["overlays"],overlays:["type",jo]};function Wo(t){Sr.call(this,t)}function Zo(t){return!t.altKey&&(t.ctrlKey||t.metaKey)}function Ho(t,e){return-1!==(t=E(t)?t:[t]).indexOf(e.key)||-1!==t.indexOf(e.keyCode)}function Yo(t){return t.shiftKey}function Uo(t,e){var n=this;this._config=t||{},this._eventBus=e,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),e.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),e.on("diagram.init",(function(){n._fire("init")})),e.on("attach",(function(){t&&t.bindTo&&n.bind(t.bindTo)})),e.on("detach",(function(){n.unbind()}))}p(Wo,Sr),Wo.prototype._modules=[ho,ro,To,Oo],Wo.prototype._moddleExtensions={},Uo.$inject=["config.keyboard","eventBus"],Uo.prototype._keydownHandler=function(t){this._keyHandler(t,"keyboard.keydown")},Uo.prototype._keyupHandler=function(t){this._keyHandler(t,"keyboard.keyup")},Uo.prototype._keyHandler=function(t,e){var n;(n=t.target)&&(pt(n,"input, textarea")||"true"===n.contentEditable)||this._eventBus.fire(e||"keyboard.keydown",{keyEvent:t})&&t.preventDefault()},Uo.prototype.bind=function(t){this.unbind(),this._node=t,yt.bind(t,"keydown",this._keydownHandler,!0),yt.bind(t,"keyup",this._keyupHandler,!0),this._fire("bind")},Uo.prototype.getBinding=function(){return this._node},Uo.prototype.unbind=function(){var t=this._node;t&&(this._fire("unbind"),yt.unbind(t,"keydown",this._keydownHandler,!0),yt.unbind(t,"keyup",this._keyupHandler,!0)),this._node=null},Uo.prototype._fire=function(t){this._eventBus.fire("keyboard."+t,{node:this._node})},Uo.prototype.addListener=function(t,e,n){_(t)&&(n=e,e=t,t=1e3),this._eventBus.on(n||"keyboard.keydown",t,e)},Uo.prototype.removeListener=function(t,e){this._eventBus.off(e||"keyboard.keydown",t)},Uo.prototype.hasModifier=function(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey},Uo.prototype.isCmd=Zo,Uo.prototype.isShift=Yo,Uo.prototype.isKey=Ho;var Vo=["c","C",67],Xo=["v","V",86],Jo=["y","Y",89],Qo=["z","Z",90];function qo(t,e){var n=this;t.on("editorActions.init",500,(function(t){n.registerBindings(e,t.editorActions)}))}qo.$inject=["eventBus","keyboard"],qo.prototype.registerBindings=function(t,e){function n(n,i){e.isRegistered(n)&&t.addListener(i)}n("undo",(function(t){var n=t.keyEvent;if(Zo(n)&&!Yo(n)&&Ho(Qo,n))return e.trigger("undo"),!0})),n("redo",(function(t){var n=t.keyEvent;if(Zo(n)&&(Ho(Jo,n)||Ho(Qo,n)&&Yo(n)))return e.trigger("redo"),!0})),n("copy",(function(t){var n=t.keyEvent;if(Zo(n)&&Ho(Vo,n))return e.trigger("copy"),!0})),n("paste",(function(t){var n=t.keyEvent;if(Zo(n)&&Ho(Xo,n))return e.trigger("paste"),!0})),n("stepZoom",(function(t){var n=t.keyEvent;if(Ho(["+","Add","="],n)&&Zo(n))return e.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(t){var n=t.keyEvent;if(Ho(["-","Subtract"],n)&&Zo(n))return e.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(t){var n=t.keyEvent;if(Ho("0",n)&&Zo(n))return e.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(t){if(Ho(["Backspace","Delete","Del"],t.keyEvent))return e.trigger("removeSelection"),!0}))};const Ko={__init__:["keyboard","keyboardBindings"],keyboard:["type",Uo],keyboardBindings:["type",qo]};var $o={moveSpeed:50,moveSpeedAccelerated:200};function ta(t,e,n){var i=this;this._config=$({},$o,t||{}),e.addListener((function(t){var n=t.keyEvent,r=i._config;if(e.isCmd(n)&&e.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,a=e.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:a,direction:o}),!0}})),this.moveCanvas=function(t){var e=0,i=0,r=t.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(t.direction){case"left":e=r;break;case"up":i=r;break;case"right":e=-r;break;case"down":i=-r}n.scroll({dx:e,dy:i})}}ta.$inject=["config.keyboardMove","keyboard","canvas"];const ea={__depends__:[Ko],__init__:["keyboardMove"],keyboardMove:["type",ta]};var na=/^djs-cursor-.*$/;function ia(t){var e=st(document.body);e.removeMatching(na),t&&e.add("djs-cursor-"+t)}function ra(){ia(null)}function oa(t,e){function n(){return!1}return t.once(e=e||"element.click",5e3,n),function(){t.off(e,n)}}function aa(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function ca(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sa(t,e){var n;function i(i){var r,o=n.start,a=n.button,c=yo(i),s=ca(c,o);!n.dragging&&(r=s,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&oa(t),ia("grab")),n.dragging&&(s=ca(c,n.last||n.start),e.scroll({dx:s.x,dy:s.y}),n.last=c),i.preventDefault()}function r(){yt.unbind(document,"mousemove",i),yt.unbind(document,"mouseup",r),n=null,ra()}t.on("element.mousedown",500,(function(t){return function(t){if(!mt(t.target,".djs-draggable")){var e=t.button;if(!(e>=2||t.ctrlKey||t.shiftKey||t.altKey))return n={button:e,start:yo(t)},yt.bind(document,"mousemove",i),yt.bind(document,"mouseup",r),!0}}(t.originalEvent)})),this.isActive=function(){return!!n}}sa.$inject=["eventBus","canvas"];const ua={__init__:["moveCanvas"],moveCanvas:["type",sa]};function la(t){return Math.log(t)/Math.log(10)}function fa(t,e){var n=la(t.min),i=la(t.max);return(Math.abs(n)+Math.abs(i))/e}var da=Math.sign||function(t){return t>=0?1:-1},pa={min:.2,max:4};function ma(t,e,n){t=t||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=q(this._handleWheel,this),this._totalDelta=0,this._scale=t.scale||.75;var i=this;e.on("canvas.init",(function(){i._init(!1!==t.enabled)}))}ma.$inject=["config.zoomScroll","eventBus","canvas"],ma.prototype.scroll=function(t){this._canvas.scroll(t)},ma.prototype.reset=function(){this._canvas.zoom("fit-viewport")},ma.prototype.zoom=function(t,e){var n=fa(pa,20);this._totalDelta+=t,Math.abs(this._totalDelta)>.1&&(this._zoom(t,e,n),this._totalDelta=0)},ma.prototype._handleWheel=function(t){if(!mt(t.target,".djs-scrollable",!0)){var e=this._container;t.preventDefault();var n,i=t.ctrlKey,r=t.shiftKey,o=-1*this._scale;if(o*=i?0===t.deltaMode?.02:.32:0===t.deltaMode?1:16,i){var a=e.getBoundingClientRect(),c={x:t.clientX-a.left,y:t.clientY-a.top};n=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*da(t.deltaY)*o,this.zoom(n,c)}else this.scroll(n=r?{dx:o*t.deltaY,dy:0}:{dx:o*t.deltaX,dy:o*t.deltaY})}},ma.prototype.stepZoom=function(t,e){var n=fa(pa,10);this._zoom(t,e,n)},ma.prototype._zoom=function(t,e,n){var i,r=this._canvas,o=t>0?1:-1,a=la(r.zoom()),c=Math.round(a/n)*n,s=Math.pow(10,c+=n*o);r.zoom((i=pa,Math.max(i.min,Math.min(i.max,s))),e)},ma.prototype.toggle=function(t){var e=this._enabled;return void 0===t&&(t=!e),e!==t&&yt[t?"bind":"unbind"](this._container,"wheel",this._handleWheel,!1),this._enabled=t,t},ma.prototype._init=function(t){this.toggle(t)};const ha={__init__:["zoomScroll"],zoomScroll:["type",ma]};function va(t){Wo.call(this,t)}p(va,Wo),va.prototype._modules=[].concat(Wo.prototype._modules,va.prototype._navigationModules=[ea,ua,ha]);var ba=o((function(t){
|
|
2
2
|
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
3
3
|
* http://hammerjs.github.io/
|
|
4
4
|
*
|