cmmn-js
Version:
A cmmn 1.1 toolkit
2 lines • 140 kB
JavaScript
/*! cmmn-js - cmmn-viewer v0.20.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).CmmnJS=e()}}(function(){var e={};function t(e,t){return function(e,t){return!(!e||"function"!=typeof e.$instanceOf||!e.$instanceOf(t))}(n(e),t)}function n(e){return e&&e.businessObject?e.businessObject:e}function r(e){return t(e=n(e),"cmmn:Stage")&&e.$parent&&t(e.$parent,"cmmn:Case")}function i(e){var r=n(e);return t(e,"cmmn:PlanItemDefinition")||t(e,"cmmn:CaseFileItemDefinition")?r:r&&r.definitionRef}function o(e){var t=i(e);return t&&t.defaultControl}function a(e){return(e=n(e))&&e.itemControl}function s(e,t){var n=a(e),r=o(e);return n&&n[t]?n[t]:r&&r[t]}e.is=t,e.getBusinessObject=n,e.isCasePlanModel=r,e.getDefinition=i,e.isRequired=function(e){return!!s(e,"requiredRule")},e.isRepeatable=function(e){return!!s(e,"repetitionRule")},e.isManualActivation=function(e){return!!s(e,"manualActivationRule")},e.isAutoComplete=function(e){var t=i(e=n(e));return e.autoComplete||t&&t.autoComplete},e.hasPlanningTable=function(e){return(e=n(e)).planningTable||i(e)&&i(e).planningTable},e.getName=function(e){t(e=n(e),"cmmndi:CMMNEdge")&&e.cmmnElementRef&&(e=e.cmmnElementRef);var r=e.name;return r||e.definitionRef&&(r=e.definitionRef.name),r},e.getSentry=function(e){var r=n(e);return t(r,"cmmn:Sentry")?r:r&&r.sentryRef},e.getStandardEvent=function(e){return(e=n(e)).cmmnElementRef&&e.cmmnElementRef.standardEvent};var l={};l="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var c={};Object.defineProperty(c,"__esModule",{value:!0});var u=Object.prototype.toString,p=Object.prototype.hasOwnProperty;function f(e){return void 0===e}function d(e){return"[object Array]"===u.call(e)}function h(e){return"[object Object]"===u.call(e)}function m(e){var t=u.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function y(e,t){return p.call(e,t)}function g(e,t){var n;return t=M(t),v(e,function(e,r){if(t(e,r))return n=e,!1}),n}function v(e,t){var n;if(!f(e)){var r=d(e)?A:C;for(var i in e)if(y(e,i)&&!1===t(n=e[i],r(i)))return n}}function b(e,t,n){return v(e,function(e,r){n=t(n,e,r)}),n}function _(e,t){return b(e,function(e,n,r){return e&&t(n,r)},!0)}function x(e,t){var n=[];return v(e,function(e,r){n.push(t(e,r))}),n}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=E(t),v(e,function(e){var r=t(e)||"_",i=n[r];i||(i=n[r]=[]),i.push(e)}),n}function E(e){return m(e)?e:function(t){return t[e]}}function M(e){return m(e)?e:function(t){return t===e}}function C(e){return e}function A(e){return Number(e)}function S(){return(S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}c.find=g,c.filter=function(e,t){var n=[];return v(e,function(e,r){t(e,r)&&n.push(e)}),n},c.forEach=v,c.reduce=b,c.every=_,c.some=function(e,t){return!!g(e,t)},c.map=x,c.groupBy=w,c.matchPattern=function(e){return function(t){return _(e,function(e,n){return t[n]===e})}},c.debounce=function(e,t){var n,r,i,o;function a(){var a=Date.now(),l=o+t-a;if(l>0)return s(l);e.apply(i,r),n=o=r=i=void 0}function s(e){n=setTimeout(a,e)}return function(){o=Date.now();for(var e=arguments.length,a=new Array(e),l=0;l<e;l++)a[l]=arguments[l];r=a,i=this,n||s(t)}},c.bind=function(e,t){return e.bind(t)},c.isUndefined=f,c.isDefined=function(e){return void 0!==e},c.isArray=d,c.isObject=h,c.isNumber=function(e){return"[object Number]"===u.call(e)},c.isFunction=m,c.isString=function(e){return"[object String]"===u.call(e)},c.assign=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return S.apply(void 0,[e].concat(n))},c.pick=function(e,t){var n={},r=Object(e);return v(t,function(t){t in r&&(n[t]=e[t])}),n},c.omit=function(e,t){var n={};return v(Object(e),function(e,r){-1===t.indexOf(r)&&(n[r]=e)}),n};var P={};function N(e,t,n){var r=P.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(r){e.set(r,t.inverse,n)})}function R(e,t){if(!(this instanceof R))return new R(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}P.extend=function(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,i,r)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},P.isExtended=function(e){return!0===e.__refs_collection},R.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?N(this,t,e):function(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var o=i;i=null,o&&e.unset(o,r,n),i=t,e.set(i,r,n)}}})}(this,t,e)},R.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return P.isExtended(n)||N(this,t,e),n},R.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},R.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},R.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var k={};(k=R).Collection=P;var O={};Object.defineProperty(O,"__esModule",{value:!0}),O.Label=W,O.create=function(e,t){var n=H[e];if(!n)throw new Error("unknown type: <"+e+">");return(0,c.assign)(new n,t)};var T=D(l),j=D(k);function D(e){return e&&e.__esModule?e:{default:e}}var B=new j.default({name:"children",enumerable:!0,collection:!0},{name:"parent"}),I=new j.default({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),L=new j.default({name:"attachers",collection:!0},{name:"host"}),F=new j.default({name:"outgoing",collection:!0},{name:"source"}),z=new j.default({name:"incoming",collection:!0},{name:"target"});function V(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),B.bind(this,"parent"),I.bind(this,"labels"),F.bind(this,"outgoing"),z.bind(this,"incoming")}function $(){V.call(this),B.bind(this,"children"),L.bind(this,"host"),L.bind(this,"attachers")}function U(){$.call(this)}function W(){$.call(this),I.bind(this,"labelTarget")}function G(){V.call(this),F.bind(this,"source"),z.bind(this,"target")}(0,T.default)($,V),(0,T.default)(U,$),(0,T.default)(W,$),(0,T.default)(G,V);var H={connection:G,shape:$,label:W,root:U};var q={},K=c.some,Y=e.is;e.getBusinessObject;function X(e,t){return K(t,function(t){return Y(e,t)})}q.isAny=X;var Z=e.getDefinition,J=e.getSentry,Q=q.isAny,ee=c.forEach,te=c.isArray;function ne(e,t){this._items={},this._referencedBy={},this._elementRegistry=e,this._eventBus=t,this._init()}ne.$inject=["elementRegistry","eventBus"];var re=ne;function ie(e){return Z(e)||J(e)}function oe(e){return Q(e,["cmmn:PlanItemDefinition","cmmn:Sentry","cmmn:CaseFileItemDefinition"])}ne.prototype._init=function(e){var t=this._eventBus;t.on("diagram.destroy",500,this._clear,this),t.on("diagram.clear",500,this._clear,this)},ne.prototype._clear=function(){this._items={},this._referencedBy={}},ne.prototype.add=function(e){var t=this._items,n=e.id,r=this._referencedBy,i=ie(e),o=i&&i.id;t[n]=e,i&&(r[o]=r[o]||[],-1===r[o].indexOf(e)&&r[o].push(e))},ne.prototype.remove=function(e){var t=this._items,n=e.id,r=this._referencedBy,i=ie(e),o=i&&i.id;if(delete t[n],i){var a=r[o]||[],s=a.indexOf(e);-1!==s&&a.splice(s,1),a.length||delete r[o]}},ne.prototype.updateId=function(e,t){var n,r;"string"==typeof e&&(e=this.get(e)),n=oe(e)?this._referencedBy:this._items,e&&(r=n[e.id],delete n[e.id],n[t]=r)},ne.prototype.updateReference=function(e,t){var n=this._referencedBy,r=ie(e),i=r&&r.id;if(r){var o=n[i]||[],a=o.indexOf(e);-1!==a&&o.splice(a,1),o.length||delete n[i]}if(t){var s=t.id;s&&(n[s]=n[s]||[],-1===n[s].indexOf(e)&&n[s].push(e))}},ne.prototype.get=function(e){return this._items[e]},ne.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t},ne.prototype.getAll=function(){return this.filter(function(e){return e})},ne.prototype.forEach=function(e){var t=this._items;ee(t,function(t){return e(t,ie(t))})},ne.prototype.getReferences=function(e){var t=e.id||e;return(this._referencedBy[t]||[]).slice()},ne.prototype.getShape=function(e){var t=e.id||e;return this._elementRegistry&&this._elementRegistry.get(t)},ne.prototype.getShapes=function(e){var t=[],n=this;function r(e){e&&t.push(e)}if(te(e))ee(e,function(e){r(n.getShape(e))});else if(oe(e)){var i=n.getReferences(e);ee(i,function(e){r(n.getShape(e))})}else r(n.getShape(e));return t};var ae={},se=e.is,le=e.getBusinessObject,ce=e.isCasePlanModel;ae.isCollapsed=function(e){if(!ce(e)){var t=(e=le(e)).definitionRef;if(se(t,"cmmn:PlanFragment"))return!!(e&&e.di&&e.di.isCollapsed)}return!1},ae.isPlanningTableCollapsed=function(e){return e=le(e),!!(se(e,"cmmn:Stage")||e.definitionRef&&(se(e.definitionRef,"cmmn:Stage")||se(e.definitionRef,"cmmn:HumanTask")))&&(e.di&&e.di.isPlanningTableCollapsed)},ae.isStandardEventVisible=function(e){var t=(e=le(e)).cmmnElementRef;return!(!se(t,"cmmn:OnPart")||!e.isStandardEventVisible)};var ue={};Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=fe;var pe=1e3;function fe(e,t){var n=this;t=t||pe,e.on(["render.shape","render.connection"],t,function(e,t){var r=e.type,i=t.element,o=t.gfx;if(n.canRender(i))return"render.shape"===r?n.drawShape(o,i):n.drawConnection(o,i)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)})}fe.prototype.canRender=function(){},fe.prototype.drawShape=function(){},fe.prototype.drawConnection=function(){},fe.prototype.getShapePath=function(){},fe.prototype.getConnectionPath=function(){};var de={};function he(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}function me(e,t){return t.appendChild(he(e,t))}Object.defineProperty(de,"__esModule",{value:!0});var ye=2,ge={"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":ye,"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":ye,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function ve(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=ge[r];i?(i===ye&&"number"==typeof n&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function be(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return ge[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);ve(e,t,n)}else!function(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)ve(e,r,t[r])}(e,t);return e}function _e(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var xe=/\s+/,we=Object.prototype.toString;function Ee(e){return void 0!==e}function Me(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ce(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Ae(e){for(var t;t=e.firstChild;)Ce(t);return e}Me.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~_e(t,e)||t.push(e),Ee(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},Me.prototype.remove=function(e){if("[object RegExp]"===we.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=_e(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},Me.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Me.prototype.toggle=function(e,t){return this.list?(Ee(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(Ee(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},Me.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(xe);return""===e[0]&&e.shift(),e},Me.prototype.has=Me.prototype.contains=function(e){return this.list?this.list.contains(e):!!~_e(this.array(),e)};var Se={svg:"http://www.w3.org/2000/svg"},Pe='<svg xmlns="'+Se.svg+'"';function Ne(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Se.svg)&&(e=Pe+e.substring(4)):(e=Pe+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function Re(e,t){var n;return"<"===e.charAt(0)?(n=Ne(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Se.svg,e),t&&be(n,t),n}var ke=Re("svg");function Oe(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}var Te=/([&<>]{1})/g,je=/([\n\r"]{1})/g,De={"&":"&","<":"<",">":">",'"':"'"};function Be(e,t){return e.replace(t,function(e,t){return De[t]||t})}function Ie(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(Be(e.textContent,Te));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,r=(i=e.attributes).length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',Be(o.value,je),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,r=(a=e.childNodes).length;n<r;++n)Ie(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Be(e.nodeValue,Te),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Le(e,t){var n=Ne(t);if(Ae(e),t){"#document-fragment"!==n.nodeName&&(n=n.documentElement);for(var r,i=(r=n.childNodes,Array.prototype.slice.call(r)),o=0;o<i.length;o++)me(i[o],e)}}function Fe(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}de.append=function(e,t){return me(t,e),e},de.attr=be,de.classes=function(e){return new Me(e)},de.create=Re,de.innerSVG=function(e,t){if(void 0!==t){try{Le(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)Ie(t,n),t=t.nextSibling;return n.join("")}(e)},de.remove=Ce,de.transform=function(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(Fe(e,r))}(n,t)),n.consolidate()},de.createMatrix=function(e,t,n,r,i,o){var a=ke.createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Oe(a,e);case 6:return Oe(a,{a:e,b:t,c:n,d:r,e:i,f:o})}},de.createTransform=function(e){return e?ke.createSVGTransformFromMatrix(e):ke.createSVGTransform()};var ze={};function Ve(e){for(var t,n="",r=0;t=e[r];r++)n+=t.x+","+t.y+" ";return n}Object.defineProperty(ze,"__esModule",{value:!0}),ze.componentsToPath=function(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")},ze.createLine=function(e,t){var n=(0,de.create)("polyline");(0,de.attr)(n,{points:Ve(e)}),t&&(0,de.attr)(n,t);return n},ze.updateLine=function(e,t){return(0,de.attr)(e,{points:Ve(t)}),e};var $e={};Object.defineProperty($e,"__esModule",{value:!0}),$e.translate=function(e,t,n){var r=(0,de.createTransform)();r.setTranslate(t,n),(0,de.transform)(e,r)};var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.default=Xe;var We=0,Ge={width:150,height:50};function He(e,t){var n;t.textContent=e;try{var r,i=""===e;return t.textContent=i?"dummy":e,r={width:(n=t.getBBox()).width+2*n.x,height:n.height},i&&(r.width=0),r}catch(e){return{width:0,height:0}}}function qe(e,t,n){for(var r,i=e.shift(),o=i;;){if((r=He(o,n)).width=o?r.width:0," "===o||""===o||r.width<Math.round(t)||o.length<2)return Ke(e,o,i,r);o=Ye(o,r.width,t)}}function Ke(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}function Ye(e,t,n){var r=Math.max(e.length*(n/t),1),i=function(e,t){var n,r=e.split(/(\s|-)/g),i=[],o=0;if(r.length>1)for(;n=r.shift();){if(!(n.length+o<t)){"-"===n&&i.pop();break}i.push(n),o+=n.length}return i.join("")}(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function Xe(e){this._config=(0,c.assign)({},{size:Ge,padding:We,style:{},align:"center-top"},e||{})}Xe.prototype.createText=function(e,t){return this.layoutText(e,t).element},Xe.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Xe.prototype.layoutText=function(e,t){var n=(0,c.assign)({},this._config.size,t.box),r=(0,c.assign)({},this._config.style,t.style),i=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return(0,c.isObject)(e)?(0,c.assign)({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,s=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(r),l=e.split(/\r?\n/g),u=[],p=n.width-o.left-o.right,f=(0,de.create)("text");(0,de.attr)(f,{x:0,y:0}),(0,de.attr)(f,r);var d=function(){var e=document.getElementById("helper-svg");return e||(e=(0,de.create)("svg"),(0,de.attr)(e,{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(e)),e}();for((0,de.append)(d,f);l.length;)u.push(qe(l,p,f));"middle"===i.vertical&&(o.top=o.bottom=0);var h=(0,c.reduce)(u,function(e,t,n){return e+(s||t.height)},0)+o.top+o.bottom,m=(0,c.reduce)(u,function(e,t,n){return t.width>e?t.width:e},0),y=o.top;"middle"===i.vertical&&(y+=(n.height-h)/2),y-=(s||u[0].height)/4;var g=(0,de.create)("text");return(0,de.attr)(g,r),(0,c.forEach)(u,function(e){var t;switch(y+=s||e.height,i.horizontal){case"left":t=o.left;break;case"right":t=(a?m:p)-o.right-e.width;break;default:t=Math.max(((a?m:p)-e.width)/2+o.left,0)}var n=(0,de.create)("tspan");(0,de.attr)(n,{x:t,y:y}),n.textContent=e.text,(0,de.append)(g,n)}),(0,de.remove)(f),{dimensions:{width:m,height:h},element:g}};var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});var Je=[].indexOf,Qe=function(e,t){if(Je)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},et=/\s+/,tt=Object.prototype.toString;function nt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}nt.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Qe(t,e)||t.push(e),this.el.className=t.join(" "),this},nt.prototype.remove=function(e){if("[object RegExp]"==tt.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Qe(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},nt.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},nt.prototype.toggle=function(e,t){return this.list?(void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},nt.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(et);return""===e[0]&&e.shift(),e},nt.prototype.has=nt.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Qe(this.array(),e)};var rt=Element.prototype,it=rt.matchesSelector||rt.webkitMatchesSelector||rt.mozMatchesSelector||rt.msMatchesSelector||rt.oMatchesSelector,ot=function(e,t){if(it)return it.call(e,t);for(var n=e.parentNode.querySelectorAll(t),r=0;r<n.length;++r)if(n[r]==e)return!0;return!1};var at,st=function(e,t,n){for(var r=n?e:e.parentNode;r&&r!==document;){if(ot(r,t))return r;r=r.parentNode}},lt=window.addEventListener?"addEventListener":"attachEvent",ct=window.removeEventListener?"removeEventListener":"detachEvent",ut="addEventListener"!==lt?"on":"",pt={bind:function(e,t,n,r){return e[lt](ut+t,n,r||!1),n},unbind:function(e,t,n,r){return e[ct](ut+t,n,r||!1),n}},ft=["focus","blur"],dt={bind:function(e,t,n,r,i){return-1!==ft.indexOf(n)&&(i=!0),pt.bind(e,n,function(n){var i=n.target||n.srcElement;n.delegateTarget=st(i,t,!0),n.delegateTarget&&r.call(e,n)},i)},unbind:function(e,t,n,r){-1!==ft.indexOf(t)&&(r=!0),pt.unbind(e,t,n,r)}},ht=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){var i=t.createElement("html");return i.innerHTML=e,i.removeChild(i.lastChild)}var o=yt[r]||yt._default,a=o[0],s=o[1],l=o[2];(i=t.createElement("div")).innerHTML=s+e+l;for(;a--;)i=i.lastChild;if(i.firstChild==i.lastChild)return i.removeChild(i.firstChild);var c=t.createDocumentFragment();for(;i.firstChild;)c.appendChild(i.removeChild(i.firstChild));return c},mt=!1;"undefined"!=typeof document&&((at=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',mt=!at.getElementsByTagName("link").length,at=void 0);var yt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:mt?[1,"X<div>","</div>"]:[0,"",""]};yt.td=yt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],yt.option=yt.optgroup=[1,'<select multiple="multiple">',"</select>"],yt.thead=yt.tbody=yt.colgroup=yt.caption=yt.tfoot=[1,"<table>","</table>"],yt.polyline=yt.ellipse=yt.polygon=yt.circle=yt.text=yt.line=yt.path=yt.rect=yt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var gt="undefined"!=typeof Element?Element.prototype:{};gt.matches||gt.matchesSelector||gt.webkitMatchesSelector||gt.mozMatchesSelector||gt.msMatchesSelector||gt.oMatchesSelector;Ze.attr=function(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)},Ze.classes=function(e){return new nt(e)},Ze.clear=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},Ze.delegate=dt,Ze.domify=ht,Ze.event=pt,Ze.query=function(e,t){return(t=t||document).querySelector(e)},Ze.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var vt=c.isArray,bt=c.isObject,_t=c.assign,xt=ue.default,wt=Ue.default,Et=ae.isStandardEventVisible,Mt=ae.isPlanningTableCollapsed,Ct=ae.isCollapsed,At=e.isCasePlanModel,St=e.getBusinessObject,Pt=e.getDefinition,Nt=e.isRequired,Rt=e.isRepeatable,kt=e.isManualActivation,Ot=e.isAutoComplete,Tt=e.hasPlanningTable,jt=e.getName,Dt=e.is,Bt=e.getStandardEvent,It=Ze.query,Lt=de.append,Ft=de.attr,zt=de.classes,Vt=de.create,$t=$e.translate,Ut=ze.createLine;function Wt(e,t,n){xt.call(this,e);var r=20,i=new wt({style:{fontFamily:"Arial, sans-serif",fontSize:"12px"},size:{width:100}}),o={};function a(e){return o[e]}function s(e){function t(t,n){var r=_t({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},n.attrs),i=n.ref||{x:0,y:0},a=n.scale||1;"none"===r.strokeDasharray&&(r.strokeDasharray=[1e4,1]);var s=Vt("marker");Ft(n.element,r),Lt(s,n.element),Ft(s,{id:t,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*a,markerHeight:20*a,orient:"auto"});var l=It("defs",e);return l||(l=Vt("defs"),Lt(e,l)),Lt(l,s),function(e,t){o[e]=t}(t,s)}var n=Vt("path");Ft(n,{d:"M 11 5 L 1 10 L 11 15"}),t("association-start",{element:n,attrs:{fill:"none",stroke:"black",strokeWidth:1.5},ref:{x:1,y:10},scale:.5});var r=Vt("path");Ft(r,{d:"M 1 5 L 11 10 L 1 15"}),t("association-end",{element:r,attrs:{fill:"none",stroke:"black",strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}function l(e,n,r){return vt(n)||(r=n,n=[]),t.style(n||[],_t(r,e||{}))}function c(e,t,n,r,i){bt(r)&&(i=r,r=0),r=r||0,i=l(i,{stroke:"black",strokeWidth:2,fill:"white"});var o=t/2,a=n/2,s=Vt("circle");return Ft(s,{cx:o,cy:a,r:Math.round((t+n)/4-r)}),Ft(s,i),Lt(e,s),s}function u(e,t,n,r,i,o){bt(i)&&(o=i,i=0),i=i||0,o=l(o,{stroke:"black",strokeWidth:2,fill:"white"});var a=Vt("rect");return Ft(a,{x:i,y:i,width:t-2*i,height:n-2*i,rx:r,ry:r}),Ft(a,o),Lt(e,a),a}function p(e,t,n,r){var i=t/2,o=n/2,a=[{x:i,y:0},{x:t,y:o},{x:i,y:n},{x:0,y:o}].map(function(e){return e.x+","+e.y}).join(" ");r=l(r,{stroke:"black",strokeWidth:2,fill:"white"});var s=Vt("polygon");return Ft(s,{points:a}),Ft(s,r),Lt(e,s),s}function f(e,t,n){n=l(n,["no-fill"],{strokeWidth:2,stroke:"black"});var r=Vt("path");return Ft(r,{d:t}),Ft(r,n),Lt(e,r),r}function d(e,t,n){var r=t.map(function(e){return e.x+","+e.y}).join(" "),i=Vt("polygon");return Ft(i,{points:r}),Ft(i,n),Lt(e,i),i}function h(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,r=1;r<t.length;r++)n+="L"+t[r].x+","+t[r].y+" ";return n}function m(e,t,n){var r=i.createText(t||"",n);return zt(r).add("djs-label"),Lt(e,r),r}function y(e,t,n){return m(e,jt(t),{box:t,align:n,padding:5})}function g(e){return v[e]}var v={"cmmn:PlanItem":function(e,t){return g(Pt(t).$type)(e,t)},"cmmn:DiscretionaryItem":function(e,t){var n=Pt(t),r={strokeDasharray:"10, 12"};return Dt(n,"cmmn:Task")&&_t(r,{strokeDasharray:"12, 12.4",strokeDashoffset:13.6}),g(n.$type)(e,t,r)},"cmmn:Stage":function(e,t,n){var i;return n=_t({fillOpacity:.95},n),At(t)?v["cmmn:CasePlanModel"](e,t):(i=function(e,t,n,r,i){var o=[{x:r=r||20,y:n},{x:0,y:n-r},{x:0,y:r},{x:r,y:0},{x:t-r,y:0},{x:t,y:r},{x:t,y:n-r},{x:t-r,y:n}];return(i=i||{}).fill="white",i.stroke="black",i.strokeWidth=2,d(e,o,i)}(e,t.width,t.height,r,n),Ct(t)?y(e,t,"center-middle"):function(e,t,n){var i=m(e,jt(t),{box:t,align:n,padding:5});$t(i,r,0)}(e,t,"left-top"),x(e,t),_(e,t),i)},"cmmn:PlanFragment":function(e,t,n){var r=u(e,t.width,t.height,10,{strokeDasharray:"10, 12",fillOpacity:.95});return y(e,t,Ct(t)?"center-middle":"left-top"),_(e,t),r},"cmmn:CasePlanModel":function(e,t){var n=u(e,t.width,t.height,0,{fillOpacity:.95});return function(e,t){var n=St(t),r=t.width/2-60,i=m(e,n.name,{box:{height:18,width:r},align:"left-top"}),o=i.getBBox().width,a=o+40;o<60&&(a=100);var s=d(e,[{x:10,y:0},{x:20,y:-18},{x:a,y:-18},{x:a+10,y:0}],{fill:"white",stroke:"black",strokeWidth:2,fillOpacity:.95,"pointer-events":"all"});i.parentNode.insertBefore(s,i),$t(i,25,-13)}(e,t),x(e,t),function(e,t){var n=St(t);Ot(n)&&w("AutoCompleteMarker",e,t,-7)}(e,t),n},"cmmn:Milestone":function(e,t,n){var r=u(e,t.width,t.height,24,n);return y(e,t,"center-middle"),b(e,t),r},"cmmn:EventListener":function(e,t,n){var r=c(e,t.width,t.height,n);return(n=n||{}).strokeWidth=2,c(e,t.width,t.height,.1*t.height,n),r},"cmmn:TimerEventListener":function(e,t,r){var i=g("cmmn:EventListener")(e,t,r);f(e,n.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square"});for(var o=0;o<12;o++){var a=n.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),s=t.width/2;f(e,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*o+","+t.height/2+","+s+")"})}return i},"cmmn:UserEventListener":function(e,t,r){var i=g("cmmn:EventListener")(e,t,r);return f(e,n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:20,y:15}}),{strokeWidth:.5,fill:"none"}),f(e,n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:20,y:15}}),{strokeWidth:.5,fill:"none"}),f(e,n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:20,y:15}}),{strokeWidth:.5,fill:"black"}),i},"cmmn:Task":function(e,t,n){var r=u(e,t.width,t.height,10,n);return y(e,t,"center-middle"),b(e,t),r},"cmmn:HumanTask":function(e,t,r){var i=g("cmmn:Task")(e,t,r);if(t.businessObject.definitionRef.isBlocking){f(e,n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:"none"}),f(e,n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:"none"}),f(e,n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:"black"})}else{f(e,n.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:1.25,fill:"white",stroke:"black"})}return x(e,t),i},"cmmn:CaseTask":function(e,t,r){var i=g("cmmn:Task")(e,t,r);return f(e,n.getScaledPath("TASK_TYPE_FOLDER",{abspos:{x:7,y:7}}),{strokeWidth:1.25,fill:"white",stroke:"black"}),i},"cmmn:ProcessTask":function(e,t,r){var i=g("cmmn:Task")(e,t,r);return f(e,n.getScaledPath("TASK_TYPE_CHEVRON",{abspos:{x:5,y:5}}),{strokeWidth:1.25,fill:"white",stroke:"black"}),i},"cmmn:DecisionTask":function(e,t,r){var i=g("cmmn:Task")(e,t,r);return f(e,n.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),{strokeWidth:1,fill:"000"}),f(e,n.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),{strokeWidth:1}),i},"cmmn:CaseFileItem":function(e,t,r){return f(e,n.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:"white"})},"cmmn:TextAnnotation":function(e,t){var r=u(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return f(e,n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}})),m(e,St(t).text||"",{box:t,align:"left-middle",padding:5}),r},"cmmn:Association":function(e,t,n){var r=St(t);return n=_t({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round"},n||{}),"One"!==r.associationDirection&&"Both"!==r.associationDirection||(n.markerEnd=a("association-end")),"Both"===r.associationDirection&&(n.markerStart=a("association-start")),function(e,t,n){n=l(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"});var r=Ut(t,n);return Lt(e,r),r}(e,t.waypoints,n)},StageMarker:function(e,t){var r=u(e,14,14,0,{strokeWidth:1,stroke:"black"});$t(r,t.width/2-7,t.height-17);var i=Ct(t)?"MARKER_STAGE_COLLAPSED":"MARKER_STAGE_EXPANDED";f(e,n.getScaledPath(i,{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7)/t.width,my:(t.height-17)/t.height}}))},RequiredMarker:function(e,t,r){f(e,n.getScaledPath("MARKER_REQUIRED",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r)/t.width,my:(t.height-17)/t.height}}),{strokeWidth:3})},AutoCompleteMarker:function(e,t,n){var r=u(e,11,14,0,{strokeWidth:1,stroke:"black",fill:"black"});$t(r,t.width/2+n+2,t.height-17)},ManualActivationMarker:function(e,t,r){f(e,n.getScaledPath("MARKER_MANUAL_ACTIVATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r)/t.width,my:(t.height-17)/t.height}}),{strokeWidth:1})},RepetitionMarker:function(e,t,r){f(e,n.getScaledPath("MARKER_REPEATABLE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r)/t.width,my:(t.height-17)/t.height}}))},PlanningTableMarker:function(e,t,r){var i=u(e,30,24,0,{strokeWidth:1.5,stroke:"black"});$t(i,t.width/2-15,-17);var o=Mt(t)?"MARKER_PLANNING_TABLE_COLLAPSED":"MARKER_PLANNING_TABLE_EXPANDED";f(e,n.getScaledPath(o,{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-15)/t.width,my:-17/t.height}}),{strokeWidth:1.5})},"cmmn:OnPart":function(e,t){return f(e,h(t),{strokeDasharray:"10, 5, 2, 5, 2, 5",strokeWidth:1.5})},"cmmn:PlanItemOnPart":function(e,t){return g("cmmn:OnPart")(e,t)},"cmmn:CaseFileItemOnPart":function(e,t){return g("cmmn:OnPart")(e,t)},"cmmn:EntryCriterion":function(e,t){return p(e,t.width,t.height,{fill:"white"})},"cmmn:ExitCriterion":function(e,t){return p(e,t.width,t.height,{fill:"black"})},"cmmndi:CMMNEdge":function(e,t){var n=St(t);return n.cmmnElementRef?g(n.cmmnElementRef.$type)(e,t):f(e,h(t),{strokeDasharray:"3, 5",strokeWidth:1})},label:function(e,t){var n,r=function(e,t){var n=jt(t),r=!1,i=Bt(t);if(i){var o=Et(t);i="["+i+"]",n?o&&(n=n+" "+i):(n=i,t.hidden=r=!o)}var a={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return t.hidden=t.labelTarget.hidden||r||!n,m(e,n,{box:a,style:{fontSize:"11px"}})}(e,t);try{n=r.getBBox()}catch(e){n={width:0,height:0,x:0}}return t.x=Math.ceil(t.x+t.width/2)-Math.ceil(n.width/2),t.width=Math.ceil(n.width),t.height=Math.ceil(n.height),Ft(r,{transform:"translate("+-1*n.x+",0)"}),r}};function b(e,t){var n=St(t),r=[];Nt(n)&&r.push({marker:"RequiredMarker",width:1}),kt(n)&&r.push({marker:"ManualActivationMarker",width:14}),Rt(n)&&r.push({marker:"RepetitionMarker",width:14}),r.length&&(1===r.length?w(r[0].marker,e,t,r[0].width/2*-1):2===r.length?(w(r[0].marker,e,t,-1*r[0].width-3),w(r[1].marker,e,t,3)):3===r.length&&(w(r[1].marker,e,t,r[1].width/2*-1),w(r[0].marker,e,t,r[1].width/2*-1-6-r[0].width),w(r[2].marker,e,t,r[1].width/2+6)))}function _(e,t,n){var r=St(t);w("StageMarker",e,t,-7);var i=[];Nt(r)&&i.push({marker:"RequiredMarker",width:1}),Ot(r)&&i.push({marker:"AutoCompleteMarker",width:14}),i.length&&(1===i.length?w(i[0].marker,e,t,-1*i[0].width-7-6):2===i.length&&(w(i[0].marker,e,t,-1*i[1].width-7-6- -1*i[0].width-6),w(i[1].marker,e,t,-1*i[1].width-7-6)));var o=[];kt(r)&&o.push({marker:"ManualActivationMarker",width:14}),Rt(r)&&o.push({marker:"RepetitionMarker",width:14}),o.length&&(1===o.length?w(o[0].marker,e,t,13):2===o.length&&(w(o[0].marker,e,t,13),w(o[1].marker,e,t,13+o[0].width+6)))}function x(e,t){Tt(t)&&w("PlanningTableMarker",e,t)}function w(e,t,n,r){g(e)(t,n,r)}this.canRender=function(e){return Dt(e,"cmmn:CMMNElement")||Dt(e,"cmmndi:CMMNEdge")},this.drawShape=function(e,t){var n=v[t.type];return n?n(e,t):xt.prototype.drawShape.apply(this,[e,t])},this.drawConnection=function(e,t){var n=t.type,r=v[n];return r?r(e,t):xt.prototype.drawConnection.apply(this,[e,t])},e.on("canvas.init",function(e){s(e.svg)})}l(Wt,xt),Wt.$inject=["eventBus","styles","pathMap"];var Gt=function(){var e="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",t="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",n="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";this.pathMap={TASK_TYPE_FOLDER:{d:"m {mx},{my} l18,0 l0,12 l-18,0 l0,-12 m 2,0 l3,-4 l5,0 l3,4"},TASK_TYPE_CHEVRON:{d:"m {mx},{my} l15,0 l6,6 l-6,6 l-15,0 l6,-6 l-6,-6"},TASK_TYPE_USER_1:{d:e},TASK_TYPE_USER_2:{d:t},TASK_TYPE_USER_3:{d:n},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_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"},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_USER_1:{d:e,height:36,width:36,heightElements:[],widthElements:[]},EVENT_USER_2:{d:t,height:36,width:36,heightElements:[],widthElements:[]},EVENT_USER_3:{d:n,height:36,width:36,heightElements:[],widthElements:[]},MARKER_STAGE_EXPANDED:{d:"m{mx},{my} m 2,7 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_STAGE_COLLAPSED:{d:"m{mx},{my} m 2,7 l 10,0 m -5,-5 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_REQUIRED:{d:"m{mx},{my} l 0,9 m 0,2 l0,3",height:14,width:3,heightElements:[],widthElements:[]},MARKER_MANUAL_ACTIVATION:{d:"m{mx}, {my} l 14,7 l -14,7 l 0,-14 z",height:14,width:14,heightElements:[],widthElements:[]},MARKER_REPEATABLE:{d:"m{mx},{my} m 3,0 l 0,14 m 6,-14 l 0,14 m -10,-10 l 14,0 m -14,6 l 14,0",height:14,width:14,heightElements:[],widthElements:[]},MARKER_PLANNING_TABLE_EXPANDED:{d:"m{mx},{my} m 0,12 l 30,0 m -20,-12 l 0, 24 m 10, -24 l 0, 24 m -10, -6 l 10,0",height:24,width:30,heightElements:[],widthElements:[]},MARKER_PLANNING_TABLE_COLLAPSED:{d:"m{mx},{my} m 0,12 l 30,0 m -20,-12 l 0, 24 m 10, -24 l 0, 24 m -10, -6 l 10,0 m -5, -6 l 0,12",height:10,width:10,heightElements:[],widthElements:[]},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]},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]}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,r,i=this.pathMap[e];t.abspos?(n=t.abspos.x,r=t.abspos.y):(n=t.containerWidth*t.position.mx,r=t.containerHeight*t.position.my);var o,a,s={};if(t.position){for(var l=t.containerHeight/i.height*t.yScaleFactor,c=t.containerWidth/i.width*t.xScaleFactor,u=0;u<i.heightElements.length;u++)s["y"+u]=i.heightElements[u]*l;for(var p=0;p<i.widthElements.length;p++)s["x"+p]=i.widthElements[p]*c}return o=i.d,a={mx:n,my:r,e:s},String(o).replace(Ht,function(e,t){return function(e,t,n){var r=n;return t.replace(qt,function(e,t,n,i,o){t=t||i,r&&(t in r&&(r=r[t]),"function"==typeof r&&o&&(r=r()))}),r=(null==r||r==n?e:r)+""}(e,t,a)})}},Ht=/\{([^}]+)\}/g,qt=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Kt={__init__:["cmmnRenderer"],cmmnRenderer:["type",Wt],pathMap:["type",Gt]},Yt={elementToString:function(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}},Xt={},Zt=e.is,Jt=c.assign,Qt={width:90,height:20};Xt.hasExternalLabel=function(e){return(Zt(e,"cmmn:PlanItem")||Zt(e,"cmmn:DiscretionaryItem"))&&(e=e.definitionRef),Zt(e,"cmmndi:CMMNEdge")&&e.cmmnElementRef&&Zt(e.cmmnElementRef,"cmmn:OnPart")&&(e=e.cmmnElementRef),Zt(e,"cmmn:EventListener")||Zt(e,"cmmn:OnPart")||Zt(e,"cmmn:CaseFileItem")};var en=function(e){var t,n,r,i,o=e.businessObject,a=o.di;return!a&&Zt(o,"cmmndi:CMMNEdge")&&o.cmmnElementRef&&(a=o),o&&a&&a.waypoint?(t=a.waypoint,n=t.length/2-1,r=t[Math.floor(n)],i=t[Math.ceil(n+.01)],{x:r.x+(i.x-r.x)/2,y:r.y+(i.y-r.y)/2}):{x:e.x+e.width/2,y:e.y+e.height+Qt.height/2}};Xt.getExternalLabelBounds=function(e,t){var n,r,i,o=(e.di||e).label;return o&&o.bounds?(i=o.bounds,r={width:Math.max(Qt.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=en(t),r=Qt),Jt({x:n.x-r.width/2,y:n.y-r.height/2},r)};var tn=c.assign,nn=c.map,rn=e.is,on=Xt.hasExternalLabel,an=Xt.getExternalLabelBounds,sn=ae.isCollapsed,ln=Yt.elementToString;function cn(e,t){return tn({id:e.id,type:e.$type,businessObject:e},t)}function un(e,t,n){return new Error("element "+ln(t)+" referenced by "+ln(e)+"#"+n+" not yet drawn")}function pn(e,t,n,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r}pn.$inject=["eventBus","canvas","elementFactory","elementRegistry"];var fn=pn;pn.prototype.root=function(e){var t=this._elementFactory.createRoot(cn(e));return this._canvas.setRootElement(t),t},pn.prototype.add=function(e,t){var n,r,i,o=e.di;if(o&&rn(o,"cmmndi:CMMNShape")&&!this._getElement(e)){var a=sn(e);r=t&&(t.hidden||t.collapsed);var s=e.di.bounds;n=this._elementFactory.createShape(cn(e,{collapsed:a,hidden:r,x:Math.round(s.x),y:Math.round(s.y),width:Math.round(s.width),height:Math.round(s.height)})),rn(e,"cmmn:Criterion")&&this._attachCriterion(e,n),this._canvas.addShape(n,t)}else{if(!(o&&rn(o,"cmmndi:CMMNEdge")||rn(e,"cmmndi:CMMNEdge")))throw new Error("unknown di "+ln(o)+" for element "+ln(e));var l=this._getSource(e),c=this._getTarget(e);r=t&&(t.hidden||t.collapsed)||l&&l.hidden||c&&c.hidden;var u=(e.di||{}).waypoint||e.waypoint;n=this._elementFactory.createConnection(cn(e,{hidden:r,source:l,target:c,waypoints:(i=u,nn(i,function(e){return{x:e.x,y:e.y}}))})),this._canvas.addConnection(n,t)}return on(e)&&this.addLabel(e,n),this._eventBus.fire("cmmnElement.added",{element:n}),n},pn.prototype._attachCriterion=function(e,t){var n=e.$parent;if(!n)throw new Error("missing "+ln(e)+"$parent");var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw un(e,n,"criterion");t.host=r,i||(r.attachers=i=[]),-1===i.indexOf(t)&&i.push(t)},pn.prototype.addLabel=function(e,t){var n=an(e,t),r=this._elementFactory.createLabel(cn(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden,x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)}));return this._canvas.addShape(r,t.parent)},pn.prototype._getSource=function(e){var t=e.cmmnElementRef;if(t){if(rn(t,"cmmn:OnPart"))return t.exitCriterionRef?this._getEnd(t,"exitCriterionRef"):this._getEnd(t,"sourceRef");if(rn(t,"cmmn:Association"))return this._getEnd(t,"sourceRef")}if(rn(e,"cmmndi:CMMNEdge"))return this._getEnd(e,"sourceCMMNElementRef")},pn.prototype._getTarget=function(e){var t=e.cmmnElementRef;return t&&rn(t,"cmmn:Association")?this._getEnd(t,"targetRef"):this._getEnd(e,"targetCMMNElementRef")},pn.prototype._getEnd=function(e,t){var n=e[t],r=n&&this._getElement(n);if(r)return r;throw n?un(e,n,t):new Error(ln(e)+"#"+t+"Ref not specified")},pn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var dn={__depends__:[Kt,{cmmnImporter:["type",fn]}],itemRegistry:["type",re]},hn={};Object.defineProperty(hn,"__esModule",{value:!0}),hn.remove=function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1);return n},hn.add=function(e,t,n){if(!e||!t)return;"number"!=typeof n&&(n=-1);var r=e.indexOf(t);if(-1!==r){if(r===n)return;if(-1===n)return;e.splice(r,1)}-1!==n?e.splice(n,0,t):e.push(t)};var mn=c.forEach,yn=c.filter,gn=Yt.elementToString,vn=e.is,bn=new k({name:"cmmnElement",enumerable:!0},{name:"di"});var _n=function(e){var t=[],n=[],r={},i=[],o={},a=[],s=[];function l(t,n){return e.element(t,n)}function c(t,n){try{return e.addItem(t),t.di&&l(t,n)}catch(e){u(e.message,{element:t,error:e}),console.error("failed to import "+gn(t)),console.error(e)}}function u(t,n){e.error(t,n)}function p(e,t){return function(n){e(n,t)}}function f(e){var t,o=e.cmmnElementRef;if(o&&!vn(e,"cmmndi:CMMNEdge"))if(o.di)u("multiple DI elements defined for "+gn(o),{element:o});else{var c=function(e){for(;e&&!vn(e,"cmmn:Case");)e=e.$parent;return e}(o);c&&-1===i.indexOf(c)&&i.push(c),(vn(o,"cmmn:TextAnnotation")||vn(o,"cmmn:CaseFileItem"))&&a.push(o),bn.bind(o,"di"),o.di=e}else if(vn(e,"cmmndi:CMMNEdge")){var p=!0;if((vn((t=e).cmmnElementRef,"cmmn:Association")?!!t.cmmnElementRef.targetRef:!!t.targetCMMNElementRef)||(p=!1,u("no target referenced in "+gn(e),{element:e})),function(e){return vn(e.cmmnElementRef,"cmmn:OnPart")?!(!e.cmmnElementRef.exitCriterionRef&&!e.cmmnElementRef.sourceRef):vn(e.cmmnElementRef,"cmmn:Association")?!!e.cmmnElementRef.sourceRef:!!e.sourceCMMNElementRef}(e)||(p=!1,u("no source referenced in "+gn(e),{element:e})),p)if(vn(o,"cmmn:Association"))s.push(e);else if(o)n.push(function(t){l(e,t)});else{var f=e.sourceCMMNElementRef;r[f.id]=r[f.id]||[],r[f.id].push(e)}}else u("no cmmnElement referenced in "+gn(e),{element:e})}function d(e){var t;t=e.diagramElements,mn(t,h)}function h(e){f(e)}function m(e,t){!function(e,t){mn(e,p(g,t))}(e.planItems,t),vn(e,"cmmn:Stage")&&function(e,t){y(e.planningTable,t)}(e,t)}function y(e,t){e&&mn(e.tableItems,function(e){vn(e,"cmmn:DiscretionaryItem")?function(e,t){o[e.id]||(function(e){o[e.id]=e}(e),g(e,t))}(e,t):vn(e,"cmmn:PlanningTable")&&y(e,t)})}function g(e,t){var n=c(e,t);mn(e.exitCriteria,p(v,t)),mn(e.entryCriteria,p(v,t));var i=e.definitionRef;if(vn(i,"cmmn:PlanFragment"))m(i,n),b(e,n);else if(vn(i,"cmmn:HumanTask")){y(i.planningTable,t);var o=r[e.id];mn(o,p(w,t)),delete r[e.id]}}function v(e,n){t.unshift(function(){c(e,n)})}function b(e,t){if(e.di&&e.di.bounds){var n=function(e,t){var n=t.di.bounds;return yn(e,function(e){return e.di.bounds.x>n.x&&e.di.bounds.x<n.x+n.width&&e.di.bounds.y>n.y&&e.di.bounds.y<n.y+n.height})}(a,e);mn(n,function(e){hn.remove(a,e),_(e,t)})}}function _(e,t){vn(e,"cmmn:TextAnnotation")?function(e,t){c(e,t)}(e,t):vn(e,"cmmn:CaseFileItem")&&function(e,t){c(e,t)}(e,t)}function x(e,t){l(e,t)}function w(e,n){t.push(function(){l(e,n)})}return{handleDefinitions:function(r,o){var l=r.CMMNDI;if(l){var u=l.diagrams;if(o&&-1===u.indexOf(o))throw new Error("diagram not part of cmmn:Definitions");!o&&u&&u.length&&(o=u[0]),d(o);var f=function(t,n){return e.root(t,n)}(o,o);!function(e,r){mn(e,function(e){!function(e,r){var i,o=e.casePlanModel;o&&(i=function(e,t){var n=c(e,t);return mn(e.exitCriteria,p(v,n)),m(e,n),b(e,n),n}(o,r)),function(e){mn(e,function(e){e()})}(t),mn(n,function(e){e(i)})}(e,r),t=[],n=[]})}(i,f),mn(a,p(_)),mn(s,p(x))}}}},xn={};xn.importCmmnDiagram=function(e,t,n){var r,i=e.get("cmmnImporter"),o=e.get("eventBus"),a=e.get("itemRegistry"),s=[];o.fire("import.render.start",{definitions:t});try{!function(e){new _n({root:function(e){return i.root(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){s.push({message:e,context:t})},addItem:function(e){a.add(e)}}).handleDefinitions(e)}(t)}catch(e){r=e}o.fire("import.render.complete",{error:r,warnings:s}),n(r,s)};var wn={},En=Ze.domify,Mn=Ze.delegate,Cn='<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 An(e){return e.join(";")}var Sn,Pn=An(["color: #404040"]),Nn='<div class="bjs-powered-by-lightbox" style="'+An(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+An(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+An(["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;'+Pn+'">'+Cn+'</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>';wn.open=function(){Sn||(Sn=En(Nn),Mn.bind(Sn,".backdrop","click",function(e){document.body.removeChild(Sn)})),document.body.appendChild(Sn)},wn.BPMNIO_IMG=Cn,wn.LINK_STYLES=Pn;var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.hasLowerCaseAlias=function(e){return e.xml&&"lowerCase"===e.xml.tagAlias},Rn.serializeAsType=function(e){return On(e)===kn},Rn.serializeAsProperty=function(e){return"property"===On(e)};Rn.DEFAULT_NS_MAP={xsi:"http://www.w3.org/2001/XMLSchema-instance"};var kn=Rn.XSI_TYPE="xsi:type";function On(e){return e.xml&&e.xml.serialize}var Tn={};function jn(){}Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.default=jn,jn.prototype.get=function(e){return this.$model.properties.get(this,e)},jn.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.default=Ln;var Bn,In=(Bn=Tn)&&Bn.__esModule?Bn:{default:Bn};function Ln(e,t){this.model=e,this.properties=t}Ln.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(In.default.prototype);(0,c.forEach)(e.properties,function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(e){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),(0,c.forEach)(e,(0,c.bind)(function(e,t){this.set(t,e)},this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.parseName=function(e,t){var n,r,i=e.split(/:/);if(1===i.length)n=e,r=t;else{if(2!==i.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=i[1],r=i[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}};var zn={};function Vn(e){this.model=e}function $n(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}Object.defineProperty(zn,"__esModule",{value:!0}),zn.default=Vn,Vn.prototype.set=function(e,t,n){var r=this.model.getPropertyDescriptor(e,t),i=r&&r.name;void 0===n?r?delete e[i]:delete e.$attrs[t]:r?i in e?e[i]=n:$n(e,r,n):e.$attrs[t]=n},Vn.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var r=n.name;return!e[r]&&n.isMany&&$n(e,n,[]),e[r]},Vn.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},Vn.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Vn.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};var Un={};function Wn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Object.defineProperty(Un,"__esModule",{value:!0}),Un.default=Wn,Wn.prototype.build=function(){return(0,c.pick)(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Wn.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var r=this.properties;void 0!==t?r.splice(t,0,e):r.push(e)},Wn.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(-1===s)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t},Wn.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=(0,Fn.parseName)(i[0],r),a=(0,Fn.parseName)(i[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Wn.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},Wn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Wn.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Wn.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Wn.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Wn.prototype.hasProperty=function(e){return this.propertiesByName[e]},Wn.prototype.addTrait=function(e,t){var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||((0,c.forEach)(e.properties,(0,c.bind)(function(n){n=(0,c.assign)({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var r=n.replaces,i=n.redefines;r||i?this.redefineProperty(n,r||i,r):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))},this)),r.push(e),n[i]=e)};var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.coerceType=function(e,t){var n=qn[e];return n?n(t):t},Gn.isBuiltIn=function(e){return!!Hn[e]},Gn.isSimple=function(e){return!!qn[e]};var Hn={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},qn={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.default=Xn;var Yn=function(e){return e&&e.__esModule?e:{default:e}}(Un);function Xn(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,(0,c.forEach)(e,(0,c.bind)(this.registerPackage,this))}function Zn(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}Xn.prototype.getPackage=function(e){return this.packageMap[e]},Xn.prototype.getPackages=function(){return this.packages},Xn.prototype.registerPackage=function(e){e=(0,c.assign)({},e);var t=this.packageMap;Zn(t,e,"prefix"),Zn(t,e,"uri"),(0,c.forEach)(e.types,(0,c.bind)(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Xn.prototype.registerType=function(e,t){e=(0,c.assign)({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:(0,c.assign)(e.meta||{})});var n=(0,Fn.parseName)(e.name,t.prefix),r=n.name,i={};(0,c.forEach)(e.properties,(0,c.bind)(function(e){var t=(0,Fn.parseName)(e.name,n.prefix),r=t.name;(0,Gn.isBuiltIn)(e.type)||(e.type=(0,Fn.parseName)(e.type,t.prefix).name),(0,c.assign)(e,{ns:t,name:r}),i[r]=e},this)),(0,c.assign)(e,{ns:n,name:r,propertiesByName:i}),(0,c.forEach)(e.extends,(0,c.bind)(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e},Xn.prototype.mapTypes=function(e,t,n){var r=(0,Gn.isBuiltIn)(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(e){return a(e,!0)}function a(n,r){var o=(0,Fn.parseName)(n,(0,Gn.isBuiltIn)(n)?"":e.prefix);i.mapTypes(o,t,r)}if(!r)throw new Error("unknown type <"+e.name+">");(0,c.forEach)(r.superClass,n?o:a),t(r,!n),(0,c.forEach)(r.traits,o)},Xn.prototype.getEffectiveDescriptor=function(e){var t=(0,Fn.parseName)(e),n=new Yn.default(t);this.mapTypes(t,function(e,t){n.addTrait(e,t)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},Xn.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.default=rr;var Qn=nr(Dn),er=nr(Kn),tr=nr(zn);function nr(e){return e&&e.__esModule?e:{default:e}}function rr(e){this.properties=new tr.default(this),this.factory=new Qn.default(this,this.properties),this.registry=new er.default(e,this.properties),this.typeCache={}}rr.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},rr.prototype.getType=function(e){var t=this.typeCache,n=(0,c.isString)(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},rr.prototype.createAny=function(e,t,n){var r=(0,Fn.parseName)(e),i={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),(0,c.forEach)(n,function(e,t){(0,c.isObject)(e)&&void 0!==e.value?i[e.name]=e.value:i[t]=e}),i},rr.prototype.getPackage=function(e){return this.registry.getPackage(e)},rr.prototype.getPackages=function(){return this.registry.getPackages()},rr.prototype.getElementDescriptor=function(e){return e.$descriptor},rr.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},rr.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},rr.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),Object.defineProperty(ir,"default",{enumerable:!0,get:function(){return(e=Jn,e&&e.__esModule?e:{default:e}).default;var e}});var or={},ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(or,"__esModule",{value:!0});var sr=String.fromCharCode,lr=Object.prototype.hasOwnProperty,cr=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ur={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function pr(e,t,n,r){return r?lr.call(ur,r)?ur[r]:"&"+r+";":sr(t||parseInt(n,16))}function fr(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(cr,pr):e}Object.keys(ur).forEach(function(e){ur[e.toUpperCase()]=ur[e]});var dr="http://www.w3.org/2001/XMLSchema-instance",hr="xsi",mr="xsi:type",yr="non-whitespace outside of root node";function gr(e){return new Error(e)}function vr(e){return"missing namespace for prefix <"+e+">"}function br(e){return{get:e,enumerable:!0}}function _r(e){var t,n={};for(t in e)n[t]=e[t];return n}function xr(e){return e+"$uri"}function wr(){return{line:0,column:0}}function Er(e){throw e}or.Parser=function e(t){if(!this)return new e(t);var n,r,i,o,a,s,l,c,u,p=t&&t.proxy,f=Er,d=wr,h=!1,m=!1,y=null,g=!1;function v(e){e instanceof Error||(e=gr(e)),y=e,f(e,d)}function b(e){a&&(e instanceof Error||(e=gr(e)),a(e,d))}this.on=function(e,t){if("function"!=typeof t)throw gr("required args <name, cb>");switch(e){case"openTag":r=t;break;case"text":n=t;break;case"closeTag":i=t;break;case"error":f=t;break;case"warn":a=t;break;case"cdata":o=t;break;case"attention":c=t;break;case"question":l=t;break;case"comment":s=t;break;default:throw gr("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!==(void 0===e?"undefined":ar(e)))throw gr("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n[dr]=hr,m=!0,u=n,this},this.parse=function(e){if("string"!=typeof e)throw gr("required args <xml=string>");return y=null,function(e){var t,a,f,y,_,x,w,E,M,C,A=m?[]:null,S=m?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[xr(n)]=t;return r}(u):null,P=[],N=0,R=!1,k=!1,O=0,T=0,j="",D=0;function B(){if(null!==C)return C;var e,t,n,r,i,o,a,s,l,c,p,f=m&&S.xmlns,d=m&&h?[]:null,y=D,g=j,v=g.length,_={},x={};e:for(;y<v;y++)if(l=!1,!(32===(c=g.charCodeAt(y))||c<14&&c>8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(b("illegal first char attribute name"),l=!0),p=y+1;p<v;p++)if(!((c=g.charCodeAt(p))>96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){b("missing attribute value"),y=p;continue e}if(61===c)break;b("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,p))&&(b("illegal declaration of xmlns"),l=!0),34===(c=g.charCodeAt(p+1)))-1===(p=g.indexOf('"',y=p+2))&&-1!==(p=g.indexOf("'",y))&&(b("attribute value quote missmatch"),l=!0);else if(39===c)-1===(p=g.indexOf("'",y=p+2))&&-1!==(p=g.indexOf('"',y))&&(b("attribute value quote missmatch"),l=!0);else for(b("missing attribute value quotes"),l=!0,p+=1;p<v&&!(32===(c=g.charCodeAt(p+1))||c<14&&c>8);p++);for(-1===p&&(b("missing closing quotes"),p=v,l=!0),l||(o=g.substring(y,p)),y=p;p+1<v&&!(32===(c=g.charCodeAt(p+1))||c<14&&c>8);p++)y===p&&(b("illegal character after attribute end"),l=!0);if(y=p+1,!l)if(s in x)b("attribute <"+s+"> already defined");else if(x[s]=!0,m)if(h){if(null!==(i="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=fr(o),t=xr(i),!(a=u[e])){if("xmlns"===i||t in S&&S[t]!==e)do{a="ns"+N++}while(void 0!==S[a]);else a=i;u[e]=a}S[i]!==a&&(r||(S=_r(S),r=!0),S[i]=a,"xmlns"===i&&(S[xr(a)]=e,f=a),S[t]=e),_[s]=o;continue}d.push(s,o)}else-1!==(c=s.indexOf(":"))?(n=S[s.substring(0,c)])?((s=f===n?s.substr(c+1):n+s.substr(c))===mr&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),n=S[n]||n,o=n+o.substring(c)):o=f+":"+o),_[s]=o):b(vr(s.substring(0,c))):_[s]=o;else _[s]=o}if(h)for(y=0,v=d.length;y<v;y++){if(s=d[y++],o=d[y],-1!==(c=s.indexOf(":"))){if(!(n=S[s.substring(0,c)])){b(vr(s.substring(0,c)));continue}(s=f===n?s.substr(c+1):n+s.substr(c))===mr&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),n=S[n]||n,o=n+o.substring(c)):o=f+":"+o)}_[s]=o}return C=_}for(d=function(){for(var t,n,r=/(\r\n|\r|\n)/g,i=0,o=0,a=0,s=T;O>=a&&(t=r.exec(e))&&!((s=t[0].length+t.index)>O);)i+=1,a=s;return-1==O?(o=s,n=e.substring(T)):0===T?(console.log(O-a),n=e.substring(T,O)):(o=O-a,n=-1==T?e.substring(O):e.substring(O,T+1)),{data:n,line:i,column:o}},p&&(M=Object.create({},{name:br(function(){return w}),originalName:br(function(){return E}),attrs:br(B),ns:br(function(){return S})}));-1!==T;){if(-1===(O=60===e.charCodeAt(T)?T:e.indexOf("<",T)))return P.length?v("unexpected end of file"):0===T?v("missing start tag"):void(T<e.length&&e.substring(T).trim()&&b(yr));if(T!==O)if(P.length){if(n&&(n(e.substring(T,O),fr,d),g))return}else if(e.substring(T,O).trim()&&(b(yr),g))return;if(33!==(_=e.charCodeAt(O+1)))if(63!==_){if(-1==(T=e.indexOf(">",O+1)))return v("unclosed tag");if(C={},47===_){if(R=!1,k=!0,!P.length)return v("missing open tag");if(a=w=P.pop(),y=O+2+a.length,e.substring(O+2,y)!==a)return v("closing tag mismatch");for(;y<T;y++)if(!(32===(_=e.charCodeAt(y))||_>8&&_<14))return v("close tag")}else{if(47===e.charCodeAt(T-1)?(a=w=e.substring(O+1,T-1),R=!0,k=!0):(a=w=e.substring(O+1,T),R=!0,k=!1),!(_>96&&_<123||_>64&&_<91||95===_||58===_))return v("illegal first char nodeName");for(y=1,f=a.length;y<f;y++)if(!((_=a.charCodeAt(y))>96&&_<123||_>64&&_<91||_>47&&_<59||45===_||95===_||46==_)){if(32===_||_<14&&_>8){w=a.substring(0,y),C=null;break}return v("invalid nodeName")}k||P.push(w)}if(m){if(t=S,R&&(k||A.push(t),null===C&&(h=-1!==a.indexOf("xmlns",y))&&(D=y,j=a,B(),h=!1)),E=w,-1!==(_=w.indexOf(":"))){if(!(x=S[w.substring(0,_)]))return v("missing namespace on <"+E+">");w=w.substr(_+1)}else x=S.xmlns;x&&(w=x+":"+w)}if(R&&(D=y,j=a,r&&(p?r(M,fr,k,d):r(w,B,fr,k,d),g)))return;if(k){if(i&&(i(p?M:w,fr,R,d),g))return;m&&(S=R?t:A.pop())}T+=1}else{if(-1===(T=e.indexOf("?>",O)))return v("unclosed question");if(l&&(l(e.substring(O,T+2),d),g))return;T+=2}else{if(91===(_=e.charCodeAt(O+2))&&"CDATA["===e.substr(O+3,6)){if(-1===(T=e.indexOf("]]>",O)))return v("unclosed cdata");if(o&&(o(e.substring(O+9,T),d),g))return;T+=3;continue}if(45===_&&45===e.charCodeAt(O+3)){if(-1===(T=e.indexOf("--\x3e",O)))return v("unclosed comment");if(s&&(s(e.substring(O+4,T),fr,d),g))return;T+=3;continue}if(-1===(T=e.indexOf(">",O+1)))return v("unclosed tag");if(c&&(c(e.substring(O,T+1),fr,d),g))return;T+=1}}}(e),d=wr,g=!1,y},this.stop=function(){g=!0}};var Mr={};(function(e){"use strict";var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();!function(e){var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this.data=[null].concat(n),this.top=this.data.length-1}return t(e,[{key:"clear",value:function(){return this.data.length=1,this.top=0,this}},{key:"empty",value:function(){return 0===this.top}},{key:"length",value:function(){return this.top}},{key:"peek",value:function(){return this.data[this.top]}},{key:"pop",value:function(){var e=void 0;return this.top>0&&(e=this.data.pop(),this.top--),e}},{key:"push",value:function(e){return this.data[++this.top]=e,this}},{key:"search",value:function(e){var t=this.data.indexOf(e);return-1===t?-1:this.data.length-t}}]),e}();function r(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new(Function.prototype.bind.apply(n,[null].concat(t)))}void 0!==Mr?Mr=r:e.stack=r}("undefined"!=typeof window?window:e)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.Reader=$r;var Ar=Pr(Mr),Sr=Pr(ir);function Pr(e){return e&&e.__esModule?e:{default:e}}function Nr(e,t){return(0,Rn.hasLowerCaseAlias)(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Rr(e){return new Error(e)}function kr(e){return e.$descriptor}function Or(e){(0,c.assign)(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Rr("expected element");var t,n=this.elementsById,r=kr(e).idProperty;if(r&&(t=e.get(r.name))){if(n[t])throw Rr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Tr(){}function jr(){}function Dr(){}function Br(e,t){this.property=e,this.context=t}function Ir(e,t){this.element=t,this.propertyDesc=e}function Lr(){}function Fr(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function zr(e,t,n){Fr.call(this,e,t,n)}function Vr(e,t,n){this.model=e,this.context=n}function $r(e){e instanceof Sr.default&&(e={model:e}),(0,c.assign)(this,{lax:!1},e)}Tr.prototype.handleEnd=function(){},Tr.prototype.handleText=function(){},Tr.prototype.handleNode=function(){},jr.prototype=Object.create(Tr.prototype),jr.prototype.handleNode=function(){return this},Dr.prototype=Object.create(Tr.prototype),Dr.prototype.handleText=function(e){this.body=(this.body||"")+e},Br.prototype=Object.create(Dr.prototype),Br.prototype.handleNode=function(e){if(this.element)throw Rr("expected no sub nodes");return this.element=this.createReference(e),this},Br.prototype.handleEnd=function(){this.element.id=this.body},Br.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Ir.prototype=Object.create(Dr.prototype),Ir.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=(0,Gn.coerceType)(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Lr.prototype=Object.create(Dr.prototype),Lr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},Fr.prototype=Object.create(Lr.prototype),Fr.prototype.addReference=function(e){this.context.addReference(e)},Fr.prototype.handleEnd=function(){var e=this.body,t=this.element,n=kr(t).bodyProperty;n&&void 0!==e&&(e=(0,Gn.coerceType)(n.type,e),t.set(n.name,e))},Fr.prototype.createElement=function(e){var t,n=e.attributes,r=this.type,i=kr(r),o=this.context,a=new r({}),s=this.model;return(0,c.forEach)(n,function(e,n){var r,l=i.propertiesByName[n];l&&l.isReference?l.isMany?(r=e.split(" "),(0,c.forEach)(r,function(e){o.addReference({element:a,property:l.ns.name,id:e})})):o.addReference({element:a,property:l.ns.name,id:e}):(l?e=(0,Gn.coerceType)(l.type,e):"xmlns"!==n&&(t=(0,Fn.parseName)(n,i.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))}),a},Fr.prototype.getPropertyForNode=function(e){var t,n,r=e.name,i=(0,Fn.parseName)(r),o=this.type,a=this.model,s=kr(o),l=i.name,u=s.propertiesByName[l];if(u)return(0,Rn.serializeAsType)(u)&&(t=e.attributes[Rn.XSI_TYPE])?(t=function(e,t){var n=(0,Fn.parseName)(e);return function(e,t){var n=e.name,r=e.localName,i=t.xml&&t.xml.typePrefix;return i&&0===r.indexOf(i)?e.prefix+":"+r.slice(i.length):n}(n,t.getPackage(n.prefix))}(t,a),n=a.getType(t),(0,c.assign)({},u,{effectiveType:kr(n).name})):u;var p=a.getPackage(i.prefix);if(p){if(t=Nr(i,p),n=a.getType(t),u=(0,c.find)(s.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return(0,c.assign)({},u,{effectiveType:kr(n).name})}else if(u=(0,c.find)(s.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return u;throw Rr("unrecognized element <"+i.name+">")},Fr.prototype.toString=function(){return"ElementDescriptor["+kr(this.type).name+"]"},Fr.prototype.valueHandler=function(e,t){return new Ir(e,t)},Fr.prototype.referenceHandler=function(e){return new Br(e,this.context)},Fr.prototype.handler=function(e){return"Element"===e?new Vr(this.model,e,this.context):new Fr(this.model,e,this.context)},Fr.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,(0,Gn.isSimple)(n))return this.valueHandler(t,r);var o=(i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?((0,c.assign)(o,{element:r}),this.context.addReference(o)):o.$parent=r),i},zr.prototype=Object.create(Fr.prototype),zr.prototype.createElement=function(e){var t=e.name,n=(0,Fn.parseName)(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&Nr(n,o)||t;if(!i.hasType(a))throw Rr("unexpected element <"+e.originalName+">");return Fr.prototype.createElement.call(this,e)},Vr.prototype=Object.create(Lr.prototype),Vr.prototype.createElement=function(e){var t=e.name,n=(0,Fn.parseName)(t).prefix,r=e.ns[n+"$uri"],i=e.attributes;return this.model.createAny(t,r,i)},Vr.prototype.handleChild=function(e){var t=new Vr(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element;return void 0!==r&&((n.$children=n.$children||[]).push(r),r.$parent=n),t},Vr.prototype.handleText=function(e){this.body=this.body||""+e},Vr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},$r.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Fr?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var i=this.model,o=this.lax,a=new Or((0,c.assign)({},t,{rootHandler:r})),s=new or.Parser({proxy:!0}),l=new Ar.default;function u(e,t,n){var r=t(),i=r.line,o=r.column,s=r.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+i+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),console.warn("could not parse node"),console.warn(e),!0;throw console.error("could not parse document"),console.error(e),Rr(l)}r.context=a,l.push(r);var p=/^<\?xml /i,f=/ encoding="([^"]+)"/i,d=/^utf-8$/i;var h=i.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});s.ns(h).on("openTag",function(e,t,n,r){var i=e.attrs||{},a=Object.keys(i).reduce(function(e,n){var r=t(i[n]);return e[n]=r,e},{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){u(e,t,o)&&l.push(new jr)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},r)}).on("question",function(e){if(p.test(e)){var t=f.exec(e),n=t&&t[1];n&&!d.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",function(e){l.peek().handleText(e)}).on("text",function(e,t){!function(e){(e=e.trim())&&l.peek().handleText(e)}(t(e))}).on("error",u).on("warn",function(e,t){return u(e,t,!0)}),setTimeout(function(){var t;try{s.parse(e),function(){var e,t,n=a.elementsById,r=a.references;for(e=0;t=r[e];e++){var i=t.element,o=n[t.id],s=kr(i).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=i.get(s.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else i.set(s.name,o)}}()}catch(e){t=e}var i=r.element;t||i||(t=Rr("failed to parse document as <"+r.type.$descriptor.name+">")),n(t,t?void 0:i,a)},0)},$r.prototype.handler=function(e){return new zr(this.model,e)};var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.Writer=function(e){return e=(0,c.assign)({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var r=n||new function(){this.value="",this.write=function(e){this.value+=e}},i=new function(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}(r,e.format);if(e.preamble&&i.append(Wr),(new ri).build(t).serializeTo(i),!n)return r.value}}};var Wr='<?xml version="1.0" encoding="UTF-8"?>\n',Gr=/<|>|'|"|&|\n\r|\n/g,Hr=/<|>|&/g;function qr(e){var t={},n={},r={},i=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?i.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.logUsed=function(e){var t=e.uri;r[t]=this.byUri(t)},this.getUsed=function(e){return[].concat(i,o).filter(function(e){return r[e.uri]})}}function Kr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Yr(e){return(0,c.isString)(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Xr(e,t){return t.isGeneric?(0,c.assign)({localName:t.ns.localName},e):(0,c.assign)({localName:(n=t.ns.localName,r=t.$pkg,(0,Rn.hasLowerCaseAlias)(r)?(i=n).charAt(0).toLowerCase()+i.slice(1):n)},e);var n,r,i}var Zr={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Jr={"<":"lt",">":"gt","&":"amp"};function Qr(e,t,n){return(e=(0,c.isString)(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function ei(e){this.tagName=e}function ti(){}function ni(e){this.tagName=e}function ri(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function ii(e,t){ri.call(this,e,t)}ei.prototype.build=function(e){return this.element=e,this},ei.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},ti.prototype.serializeValue=ti.prototype.serializeTo=function(e){e.append(this.escape?Qr(this.value,Hr,Jr):this.value)},ti.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Hr)&&(this.escape=!0),this},Kr(ni,ti),ni.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},ri.prototype.build=function(e){this.element=e;var t,n,r,i=e.$descriptor,o=this.propertyDescriptor,a=i.isGeneric;return t=a?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=o?this.nsPropertyTagName(o):this.nsTagName(i),this.tagName=this.addTagName(this.ns),a||(n=function(e){var t=e.$descriptor;return(0,c.filter)(t.properties,function(t){var n=t.name;if(t.isVirtual)return!1;if(!e.hasOwnProperty(n))return!1;var r=e[n];return r!==t.default&&null!==r&&(!t.isMany||r.length)})}(e),this.parseAttributes((r=n,(0,c.filter)(r,function(e){return e.isAttr}))),this.parseContainments(function(e){return(0,c.filter)(e,function(e){return!e.isAttr})}(n))),this.parseGenericAttributes(e,t),this},ri.prototype.nsTagName=function(e){return Xr(this.logNamespaceUsed(e.ns),e)},ri.prototype.nsPropertyTagName=function(e){return function(e,t){return(0,c.assign)({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},ri.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},ri.prototype.nsAttributeName=function(e){var t;if(t=(0,c.isString)(e)?(0,Fn.parseName)(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:(0,c.assign)({localName:t.localName},n)},ri.prototype.parseGeneric=function(e){var t=this,n=this.body,r=[];return(0,c.forEach)(e,function(i,o){"$body"===o?n.push((new ti).build({type:"String"},i)):"$children"===o?(0,c.forEach)(i,function(e){n.push(new ri(t).build(e))}):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,i)&&r.push({name:o,value:i})}),r},ri.prototype.parseNsAttribute=function(e,t,n){var r,i=e.$model,o=(0,Fn.parseName)(t);if("xmlns"===o.prefix&&(r={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(r={uri:n}),!r)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(r,!0,!0);else{var a=this.logNamespaceUsed(r,!0);this.getNamespaces().logUsed(a)}},ri.prototype.parseNsAttributes=function(e,t){var n=this,r=e.$attrs,i=[];return(0,c.forEach)(r,function(t,r){var o=n.parseNsAttribute(e,r,t);o&&i.push(o)}),i},ri.prototype.parseGenericAttributes=function(e,t){var n=this;(0,c.forEach)(t,function(t){if(t.name!==Rn.XSI_TYPE)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}})},ri.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;(0,c.forEach)(e,function(e){var i=r.get(e.name),o=e.isReference;if(e.isMany||(i=[i]),e.isBody)n.push((new ti).build(e,i[0]));else if((0,Gn.isSimple)(e.type))(0,c.forEach)(i,function(r){n.push(new ni(t.addTagName(t.nsPropertyTagName(e))).build(e,r))});else if(o)(0,c.forEach)(i,function(r){n.push(new ei(t.addTagName(t.nsPropertyTagName(e))).build(r))});else{var a=(0,Rn.serializeAsType)(e),s=(0,Rn.serializeAsProperty)(e);(0,c.forEach)(i,function(r){var i;i=a?new ii(t,e):s?new ri(t,e):new ri(t),n.push(i.build(r))})}})},ri.prototype.getNamespaces=function(e){var t,n=this.namespaces,r=this.parent;return n||(t=r&&r.getNamespaces(),e||!t?this.namespaces=n=new qr(t):n=t),n},ri.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix;return r.byUri(i)||r.add(e,t),r.mapPrefix(o,i),e},ri.prototype.logNamespaceUsed=function(e,t){var n,r,i,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(i=Rn.DEFAULT_NS_MAP[s]||o&&(o.getPackage(s)||{}).uri,!(l=l||i||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(l))){for(n=s,r=1;a.uriByPrefix(n);)n=s+"_"+r++;e=this.logNamespace({prefix:n,uri:l},i===l)}return s&&a.mapPrefix(s,l),e},ri.prototype.parseAttributes=function(e){var t=this,n=this.element;(0,c.forEach)(e,function(e){var r=n.get(e.name);if(e.isReference)if(e.isMany){var i=[];(0,c.forEach)(r,function(e){i.push(e.id)}),r=i.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(e),r)})},ri.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Yr(e)},ri.prototype.addAttribute=function(e,t){var n=this.attrs;(0,c.isString)(t)&&(t=Qr(t,Gr,Zr)),n.push({name:e,value:t})},ri.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return(0,c.map)(e.getUsed(),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})}(n).concat(t)),(0,c.forEach)(t,function(t){e.append(" ").append(Yr(t.name)).append('="').append(t.value).append('"')})},ri.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==ti;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),(0,c.forEach)(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Kr(ii,ri),ii.prototype.parseNsAttributes=function(e){var t=ri.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Rn.XSI_TYPE),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t},ii.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};var oi={};Object.defineProperty(oi,"__esModule",{value:!0}),Object.defineProperty(oi,"Reader",{enumerable:!0,get:function(){return Cr.Reader}}),Object.defineProperty(oi,"Writer",{enumerable:!0,get:function(){return Ur.Writer}});var ai={};Object.defineProperty(ai,"__esModule",{value:!0}),ai.default=li;var si=function(e){return e&&e.__esModule?e:{default:e}}(ir);function li(e,t){si.default.call(this,e,t)}li.prototype=Object.create(si.default.prototype),li.prototype.fromXML=function(e,t,n,r){(0,c.isString)(t)||(r=n,n=t,t="cmmn:Definitions"),(0,c.isFunction)(n)&&(r=n,n={});var i=new oi.Reader((0,c.assign)({model:this,lax:!0},n)),o=i.handler(t);i.fromXML(e,o,r)},li.prototype.toXML=function(e,t,n){(0,c.isFunction)(t)&&(n=t,t={});var r,i,o=new oi.Writer(t);try{r=o.toXML(e)}catch(e){i=e}return n(i,r)};var ci={};Object.defineProperty(ci,"__esModule",{value:!0}),ci.default=function(e,t){var n=(0,c.assign)({},yi,e);return new ui.default(n,t)};var ui=mi(ai),pi=mi({name:"CMMN",uri:"http://www.omg.org/spec/CMMN/20151109/MODEL",types:[{name:"ApplicabilityRule",superClass:["CMMNElement"],properties:[{name:"condition",type:"Expression",xml:{serialize:"property"}},{name:"contextRef",type:"CaseFileItem",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["CMMNElement"]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"CMMNElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"CMMNElement",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"ManualActivationRule",superClass:["CMMNElement"],properties:[{name:"condition",type:"Expression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"contextRef",type:"CaseFileItem",isAttr:!0,isReference:!0}]},{name:"Case",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"caseFileModel",type:"CaseFile",xml:{serialize:"property"}},{name:"casePlanModel",type:"Stage",xml:{serialize:"property"}},{name:"caseRoles",type:"CaseRoles"},{name:"input",type:"CaseParameter",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"CaseParameter",isMany:!0,xml:{serialize:"property"}}]},{name:"CaseFile",superClass:["CMMNElement"],properties:[{name:"caseFileItems",type:"CaseFileItem",isMany:!0}]},{name:"CaseFileItem",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"multiplicity",type:"String",isAttr:!0,default:"Unspecified"},{name:"definitionRef",type:"CaseFileItemDefinition",isAttr:!0,isReference:!0},{name:"sourceRef",type:"CaseFileItem",isAttr:!0,isReference:!0},{name:"targetRefs",type:"CaseFileItem",isAttr:!0,isReference:!0,isMany:!0},{name:"children",type:"Children",xml:{serialize:"property"}}]},{name:"CaseFileItemDefinition",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"definitionType",type:"String",default:"http://www.omg.org/spec/CMMN/DefinitionType/Unspecified",isAttr:!0},{name:"properties",type:"Property",isMany:!0},{name:"structureRef",type:"String",isAttr:!0},{name:"importRef",type:"Import",isAttr:!0,isReference:!0}]},{name:"CaseFileItemOnPart",superClass:["OnPart"],properties:[{name:"standardEvent",type:"String"},{name:"sourceRef",type:"CaseFileItem",isAttr:!0,isReference:!0}]},{name:"CaseParameter",superClass:["Parameter"],properties:[{name:"bindingRef",type:"CaseFileItem",isAttr:!0,isReference:!0},{name:"bindingRefinement",type:"Expression",xml:{serialize:"property"}}]},{name:"CaseRoles",superClass:["Parameter"],properties:[{name:"role",type:"Role",isMany:!0}]},{name:"CaseTask",superClass:["Task"],properties:[{name:"parameterMapping",type:"ParameterMapping",isMany:!0},{name:"caseRefExpression",type:"Expression",xml:{serialize:"property"}},{name:"caseRef",type:"String",isAttr:!0}]},{name:"Children",superClass:["CMMNElement"],properties:[{name:"caseFileItems",type:"CaseFileItem",isMany:!0}]},{name:"CMMNElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionElements",type:"ExtensionElements"},{name:"extensionDefinitions",type:"ExtensionDefinition",isReference:!0,isMany:!0}]},{name:"Definitions",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",type:"String",isAttr:!0},{name:"expressionLanguage",type:"String",isAttr:!0,default:"http://www.w3.org/1999/XPath"},{name:"exporter",isAttr:!0,type:"String"},{name:"exporterVersion",isAttr:!0,type:"String"},{name:"author",isAttr:!0,type:"String"},{name:"creationDate",type:"DateTime",isAttr:!0},{name:"imports",type:"Import",isMany:!0},{name:"caseFileItemDefinitions",type:"CaseFileItemDefinition",isMany:!0},{name:"cases",type:"Case",isMany:!0},{name:"processes",type:"Process",isMany:!0},{name:"decisions",type:"Decision",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"relationships",type:"Relationship",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"CMMNDI",type:"cmmndi:CMMNDI"}]},{name:"DiscretionaryItem",superClass:["TableItem"],properties:[{name:"itemControl",type:"PlanItemControl",xml:{serialize:"property"}},{name:"definitionRef",type:"PlanItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"entryCriteria",type:"EntryCriterion",isMany:!0},{name:"exitCriteria",type:"ExitCriterion",isMany:!0}]},{name:"EventListener",superClass:["PlanItemDefinition"]},{name:"Expression",superClass:["CMMNElement"],properties:[{name:"language",type:"String",isAttr:!0},{name:"body",isBody:!0,type:"String"}]},{name:"HumanTask",superClass:["Task"],properties:[{name:"planningTable",type:"PlanningTable"},{name:"performerRef",type:"Role",isAttr:!0,isReference:!0}]},{name:"IfPart",superClass:["CMMNElement"],properties:[{name:"contextRef",type:"CaseFileItem",isAttr:!0,isReference:!0},{name:"condition",type:"Expression",xml:{serialize:"property"}}]},{name:"Import",properties:[{name:"location",isAttr:!0,type:"String"},{name:"namespace",type:"String",isAttr:!0},{name:"importType",isAttr:!0,type:"String"}]},{name:"Milestone",superClass:["PlanItemDefinition"]},{name:"On",isAbstract:!0,superClass:["CMMNElement"]},{name:"OnPart",isAbstract:!0,superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"Parameter",isAbstract:!0,superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ParameterMapping",properties:[{name:"sourceRef",type:"Parameter",isAttr:!0,isReference:!0},{name:"targetRef",type:"Parameter",isAttr:!0,isReference:!0},{name:"transformation",type:"Expression",xml:{serialize:"property"}}]},{name:"PlanFragment",superClass:["PlanItemDefinition"],properties:[{name:"planItems",type:"PlanItem",isMany:!0},{name:"sentries",type:"Sentry",isMany:!0}]},{name:"PlanItem",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"definitionRef",type:"PlanItemDefinition",isAttr:!0,isReference:!0},{name:"itemControl",type:"PlanItemControl",xml:{serialize:"property"}},{name:"entryCriteria",type:"EntryCriterion",isMany:!0},{name:"exitCriteria",type:"ExitCriterion",isMany:!0}]},{name:"PlanItemControl",superClass:["CMMNElement"],properties:[{name:"repetitionRule",type:"RepetitionRule"},{name:"requiredRule",type:"RequiredRule"},{name:"manualActivationRule",type:"ManualActivationRule"}]},{name:"PlanItemDefinition",isAbstract:!0,superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"defaultControl",type:"PlanItemControl",xml:{serialize:"property"}}]},{name:"PlanItemOnPart",superClass:["OnPart"],properties:[{name:"standardEvent",type:"String"},{name:"sourceRef",type:"PlanItem",isAttr:!0,isReference:!0},{name:"exitCriterionRef",type:"ExitCriterion",isAttr:!0,isReference:!0}]},{name:"PlanningTable",superClass:["TableItem"],properties:[{name:"tableItems",type:"TableItem",isMany:!0},{name:"applicabilityRules",type:"ApplicabilityRule",isMany:!0}]},{name:"Process",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"implementationType",type:"String",isAttr:!0,default:"http://www.omg.org/spec/CMMN/ProcessType/Unspecified"},{name:"externalRef",type:"String",isAttr:!0},{name:"input",type:"ProcessParameter",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"ProcessParameter",isMany:!0,xml:{serialize:"property"}}]},{name:"ProcessParameter",superClass:["Parameter"]},{name:"ProcessTask",superClass:["Task"],properties:[{name:"parameterMapping",type:"ParameterMapping",isMany:!0},{name:"processRefExpression",type:"Expression",xml:{serialize:"property"}},{name:"processRef",type:"String",isAttr:!0}]},{name:"Property",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",type:"String",isAttr:!0,default:"http://www.omg.org/spec/CMMN/PropertyType/Unspecified"}]},{name:"RepetitionRule",superClass:["CMMNElement"],properties:[{name:"condition",type:"Expression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"contextRef",type:"CaseFileItem",isAttr:!0,isReference:!0}]},{name:"RequiredRule",superClass:["CMMNElement"],properties:[{name:"condition",type:"Expression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"contextRef",type:"CaseFileItem",isAttr:!0,isReference:!0}]},{name:"Role",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"Sentry",superClass:["CMMNElement"],properties:[{name:"onParts",type:"OnPart",isMany:!0},{name:"ifPart",type:"IfPart"},{name:"name",isAttr:!0,type:"String"}]},{name:"Stage",superClass:["PlanFragment"],properties:[{name:"planningTable",type:"PlanningTable"},{name:"planItemDefinitions",type:"PlanItemDefinition",isMany:!0},{name:"autoComplete",isAttr:!0,type:"Boolean"},{name:"exitCriteria",type:"ExitCriterion",isMany:!0}]},{name:"TableItem",isAbstract:!0,superClass:["CMMNElement"],properties:[{name:"authorizedRoleRefs",type:"Role",isAttr:!0,isReference:!0,isMany:!0},{name:"applicabilityRuleRefs",type:"ApplicabilityRule",isAttr:!0,isReference:!0,isMany:!0}]},{name:"Task",superClass:["PlanItemDefinition"],properties:[{name:"input",type:"CaseParameter",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"CaseParameter",isMany:!0,xml:{serialize:"property"}},{name:"isBlocking",isAttr:!0,default:!0,type:"Boolean"}]},{name:"TimerEventListener",superClass:["EventListener"],properties:[{name:"timerExpression",type:"Expression",xml:{serialize:"property"}},{name:"timerStart",type:"StartTrigger"}]},{name:"UserEventListener",superClass:["EventListener"],properties:[{name:"authorizedRoleRefs",type:"Role",isMany:!0,isAttr:!0}]},{name:"DateTime",superClass:[]},{name:"StartTrigger",isAbstract:!0,superClass:["CMMNElement"]},{name:"PlanItemStartTrigger",superClass:["StartTrigger"],properties:[{name:"standardEvent",type:"String",isAttr:!0},{name:"sourceRef",type:"PlanItem",isAttr:!0,isReference:!0}]},{name:"CaseFileItemStartTrigger",superClass:["StartTrigger"],properties:[{name:"standardEvent",type:"String",isAttr:!0},{name:"sourceRef",type:"CaseFileItem",isAttr:!0,isReference:!0}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition"}]},{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",isAttr:!0,default:!1,type:"Boolean"}]},{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:"Relationship",properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,type:"Element"},{name:"target",isMany:!0,type:"Element"}]},{name:"Documentation",superClass:["CMMNElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"DecisionTask",superClass:["Task"],properties:[{name:"mappings",type:"ParameterMapping",isMany:!0},{name:"decisionRef",type:"String",isAttr:!0},{name:"decisionRefExpression",type:"Expression",xml:{serialize:"property"}}]},{name:"Decision",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"implementationType",type:"String",isAttr:!0,default:"http://www.omg.org/spec/CMMN/DecisionType/Unspecified"},{name:"input",type:"DecisionParameter",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"DecisionParameter",isMany:!0,xml:{serialize:"property"}},{name:"externalRef",type:"String",isAttr:!0}]},{name:"DecisionParameter",superClass:["Parameter"]},{name:"Criterion",isAbstract:!0,superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sentryRef",type:"Sentry",isAttr:!0,isReference:!0}]},{name:"EntryCriterion",superClass:["Criterion"]},{name:"ExitCriterion",superClass:["Criterion"]}],emumerations:[{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"CaseFileItemTransition",literalValues:[{name:"addChild"},{name:"addReference"},{name:"create"},{name:"delete"},{name:"removeChild"},{name:"removeReference"},{name:"replace"},{name:"update"}]},{name:"MultiplicityEnum",literalValues:[{name:"ZeroOrOne"},{name:"ZeroOrMore"},{name:"ExactlyOne"},{name:"OneOrMore"},{name:"Unspecified"},{name:"Unknown"}]},{name:"PlanItemTransition",literalValues:[{name:"close"},{name:"complete"},{name:"create"},{name:"disable"},{name:"enable"},{name:"exit"},{name:"fault"},{name:"manualStart"},{name:"occur"},{name:"parentResume"},{name:"parentSuspend"},{name:"reactivate"},{name:"reenable"},{name:"resume"},{name:"start"},{name:"suspend"},{name:"terminate"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]}],associations:[],xml:{tagAlias:"lowerCase",typePrefix:"t"},prefix:"cmmn"}),fi=mi({name:"CMMNDI",uri:"http://www.omg.org/spec/CMMN/20151109/CMMNDI",types:[{name:"CMMNDI",properties:[{name:"diagrams",type:"CMMNDiagram",isMany:!0},{name:"styles",type:"CMMNStyle",isMany:!0}]},{name:"CMMNDiagram",properties:[{name:"cmmnElementRef",isAttr:!0,type:"cmmn:CMMNElement",isReference:!0},{name:"Size",type:"dc:Dimension",xml:{serialize:"xsi:type"}},{name:"diagramElements",type:"CMMNDiagramElement",isMany:!0}],superClass:["di:Diagram"]},{name:"CMMNDiagramElement",superClass:["di:DiagramElement"]},{name:"CMMNShape",properties:[{name:"cmmnElementRef",isAttr:!0,isReference:!0,type:"cmmn:CMMNElement"},{name:"label",type:"CMMNLabel"},{name:"isCollapsed",isAttr:!0,type:"Boolean"},{name:"isPlanningTableCollapsed",isAttr:!0,type:"Boolean"}],superClass:["CMMNDiagramElement","di:Shape"]},{name:"CMMNEdge",properties:[{name:"label",type:"CMMNLabel"},{name:"cmmnElementRef",isAttr:!0,isReference:!0,type:"cmmn:CMMNElement"},{name:"sourceCMMNElementRef",isAttr:!0,isReference:!0,type:"cmmn:CMMNElement"},{name:"targetCMMNElementRef",isAttr:!0,isReference:!0,type:"cmmn:CMMNElement"},{name:"isStandardEventVisible",type:"Boolean",isAttr:!0}],superClass:["CMMNDiagramElement","di:Edge"]},{name:"CMMNLabel",superClass:["di:Shape"]},{name:"CMMNStyle",properties:[{name:"FillColor",type:"dc:Color",xml:{serialize:"xsi:type"}},{name:"StrokeColor",type:"dc:Color",xml:{serialize:"xsi:type"}},{name:"FontColor",type:"dc:Color",xml:{serialize:"xsi:type"}},{name:"fontFamily",type:"String",isAttr:!0},{name:"fontSize",type:"Real",isAttr:!0},{name:"fontItalic",type:"Boolean",isAttr:!0},{name:"fontBold",type:"Boolean",isAttr:!0},{name:"fontUnderline",type:"Boolean",isAttr:!0},{name:"fontStrikeThrough",type:"Boolean",isAttr:!0}],superClass:["di:Style"]}],associations:[],prefix:"cmmndi"}),di=mi({name:"DC",uri:"http://www.omg.org/spec/CMMN/20151109/DC",types:[{name:"rgb"},{name:"Real"},{name:"Color",properties:[{name:"red",type:"rgb",isAttr:!0},{name:"green",type:"rgb",isAttr:!0},{name:"blue",type:"rgb",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",isAttr:!0},{name:"y",type:"Real",isAttr:!0}]},{name:"Dimension",properties:[{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",isAttr:!0},{name:"y",type:"Real",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],prefix:"dc",associations:[]}),hi=mi({name:"DI",uri:"http://www.omg.org/spec/CMMN/20151109/DI",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"style",type:"Style"},{name:"sharedStyle",type:"Style",isReference:!0,isAttr:!0},{name:"id",type:"String",isAttr:!0,isId:!0}]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"waypoint",isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"name",type:"String",isAttr:!0},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,default:300,type:"double"}]},{name:"Shape",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"id",type:"String",isAttr:!0,isId:!0}]},{name:"Extension",properties:[{name:"values",type:"Element",isMany:!0}]}],associations:[],prefix:"di",xml:{tagAlias:"lowerCase"}});function mi(e){return e&&e.__esModule?e:{default:e}}var yi={cmmn:pi.default,cmmndi:fi.default,dc:di.default,di:hi.default},gi={};Object.defineProperty(gi,"__esModule",{value:!0}),Object.defineProperty(gi,"default",{enumerable:!0,get:function(){return(e=ci,e&&e.__esModule?e:{default:e}).default;var e}});var vi={};function bi(e,t){var n,r,i,o;return t=!!t,(0,c.isArray)(e)||(e=[e]),(0,c.forEach)(e,function(e){var a=e;e.waypoints&&!t&&(a=bi(e.waypoints,!0));var s=a.x,l=a.y,c=a.height||0,u=a.width||0;(s<n||void 0===n)&&(n=s),(l<r||void 0===r)&&(r=l),(s+u>i||void 0===i)&&(i=s+u),(l+c>o||void 0===o)&&(o=l+c)}),{x:n,y:r,height:o-r,width:i-n}}Object.defineProperty(vi,"__esModule",{value:!0}),vi.getBBox=bi,vi.getType=function(e){if("waypoints"in e)return"connection";if("x"in e)return"shape";return"root"},vi.isFrameElement=function(e){return!(!e||!e.isFrame)};var _i={};Object.defineProperty(_i,"__esModule",{value:!0});var xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function wi(e,t){return Math.round(e*t)/t}function Ei(e){return(0,c.isNumber)(e)?e+"px":e}function Mi(e,t,n){var r=(0,de.create)("g");(0,de.classes)(r).add(t);var i=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}_i.default=Ai;var Ci={shape:["x","y","width","height"],connection:["waypoints"]};function Ai(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._init(e||{})}function Si(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Ai.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Ai.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=(0,c.assign)({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),(0,c.assign)(n.style,{position:"relative",overflow:"hidden",width:Ei(e.width),height:Ei(e.height)}),t.appendChild(n),n}(e),r=this._svg=(0,de.create)("svg");(0,de.attr)(r,{width:"100%",height:"100%"}),(0,de.append)(n,r);var i=this._viewport=Mi(r,"viewport");this._layers={},!1!==e.deferUpdate&&(this._viewboxChanged=(0,c.debounce)((0,c.bind)(this._viewboxChanged,this),300)),t.on("diagram.init",function(){t.fire("canvas.init",{svg:r,viewport:i})},this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed"],function(){delete this._cachedViewbox},this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Ai.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._rootElement,delete this._viewport},Ai.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=(0,vi.getType)(t);"root"===n?e.setRootElement(null,!0):e._removeElement(t,n)}),delete this._cachedViewbox},Ai.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Ai.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},Ai.prototype._createLayer=function(e,t){t||(t=0);var n=(0,c.reduce)(this._layers,function(e,n){return t>=n.index&&e++,e},0);return{group:Mi(this._viewport,"layer-"+e,n),index:t}},Ai.prototype.getContainer=function(){return this._container},Ai.prototype._updateMarker=function(e,t,n){var r;e.id||(e=this._elementRegistry.get(e)),(r=this._elementRegistry._elements[e.id])&&((0,c.forEach)([r.gfx,r.secondaryGfx],function(e){e&&(n?(0,de.classes)(e).add(t):(0,de.classes)(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},Ai.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Ai.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Ai.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));var n=this.getGraphics(e);return(0,de.classes)(n).has(t)},Ai.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Ai.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},Ai.prototype.setRootElement=function(e,t){e&&this._ensureValid("root",e);var n=this._rootElement,r=this._elementRegistry,i=this._eventBus;if(n){if(!t)throw new Error("rootElement already set, need to specify override");i.fire("root.remove",{element:n}),i.fire("root.removed",{element:n}),r.remove(n)}if(e){var o=this.getDefaultLayer();i.fire("root.add",{element:e}),r.add(e,o,this._svg),i.fire("root.added",{element:e,gfx:o})}return this._rootElement=e,e},Ai.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element with id "+t.id+" already exists");var n=Ci[e];if(!(0,c.every)(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},Ai.prototype._setParent=function(e,t,n){(0,hn.add)(t.children,e,n),e.parent=t},Ai.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();var i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);var a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t},Ai.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Ai.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Ai.prototype._removeElement=function(e,t){var n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e))return i.fire(t+".remove",{element:e}),r.remove(e),(0,hn.remove)(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e},Ai.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Ai.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Ai.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Ai.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Ai.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Ai.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,r,i,o,a,s=this._viewport,l=this.getSize();return e?(this._changeViewbox(function(){i=Math.min(l.width/e.width,l.height/e.height);var t=this._svg.createSVGMatrix().scale(i).translate(-e.x,-e.y);(0,de.transform)(s,t)}),e):(t=this.getDefaultLayer().getBBox(),n=(r=(0,de.transform)(s))?r.matrix:(0,de.createMatrix)(),i=wi(n.a,1e3),o=wi(-n.e||0,1e3),a=wi(-n.f||0,1e3),e=this._cachedViewbox={x:o?o/i:0,y:a?a/i:0,width:l.width/i,height:l.height/i,scale:i,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:l})},Ai.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=(0,c.assign)({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Si(t,n)}),{x:n.e,y:n.f}},Ai.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox(function(){"object"!==(void 0===t?"undefined":xi(t))&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),wi(r.a,1e3)):this.viewbox(e).scale;var n,r},Ai.prototype._fitViewport=function(e){var t,n,r=this.viewbox(),i=r.outer,o=r.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=i.width&&o.y+o.height<=i.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,i.width),height:Math.max(o.height+o.y,i.height)}:(t=Math.min(1,i.width/o.width,i.height/o.height),n={x:o.x+(e?o.width/2-i.width/t/2:0),y:o.y+(e?o.height/2-i.height/t/2:0),width:i.width/t,height:i.height/t}),this.viewbox(n),this.viewbox(!1).scale},Ai.prototype._setZoom=function(e,t){var n,r,i,o,a=this._svg,s=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),p=(r=s.getCTM()).a;return t?(n=(0,c.assign)(u,t).matrixTransform(r.inverse()),i=l.translate(n.x,n.y).scale(1/p*e).translate(-n.x,-n.y),o=r.multiply(i)):o=l.scale(e),Si(this._viewport,o),o},Ai.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Ai.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();e.waypoints?t=this.getGraphics(e).getBBox():t=e;return{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},Ai.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Pi={};function Ni(){this._uid=12}Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.default=Ni,Ni.prototype.createRoot=function(e){return this.create("root",e)},Ni.prototype.createLabel=function(e){return this.create("label",e)},Ni.prototype.createShape=function(e){return this.create("shape",e)},Ni.prototype.createConnection=function(e){return this.create("connection",e)},Ni.prototype.create=function(e,t){return(t=(0,c.assign)({},t||{})).id||(t.id=e+"_"+this._uid++),(0,O.create)(e,t)};var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.default=Oi;var ki="data-element-id";function Oi(e){this._elements={},this._eventBus=e}Oi.$inject=["eventBus"],Oi.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),(0,de.attr)(t,ki,r),n&&(0,de.attr)(n,ki,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},Oi.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&((0,de.attr)(r.gfx,ki,""),r.secondaryGfx&&(0,de.attr)(r.secondaryGfx,ki,""),delete t[n])},Oi.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},Oi.prototype.get=function(e){var t;t="string"==typeof e?e:e&&(0,de.attr)(e,ki);var n=this._elements[t];return n&&n.element},Oi.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t},Oi.prototype.getAll=function(){return this.filter(function(e){return e})},Oi.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)})},Oi.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},Oi.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});var ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Ti.default=Bi;var Di=Array.prototype.slice;function Bi(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Ii(){}Bi.prototype.on=function(e,t,n,r){if(e=(0,c.isArray)(e)?e:[e],(0,c.isFunction)(t)&&(r=n,n=t,t=1e3),!(0,c.isNumber)(t))throw new Error("priority must be a number");var i=n;r&&((i=(0,c.bind)(n,r)).__fn=n.__fn||n);var o=this;e.forEach(function(e){o._addListener(e,{priority:t,callback:i,next:null})})},Bi.prototype.once=function(e,t,n,r){var i=this;if((0,c.isFunction)(t)&&(r=n,n=t,t=1e3),!(0,c.isNumber)(t))throw new Error("priority must be a number");function o(){var t=n.apply(r,arguments);return i.off(e,o),t}o.__fn=n,this.on(e,t,o)},Bi.prototype.off=function(e,t){e=(0,c.isArray)(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},Bi.prototype.createEvent=function(e){var t=new Ii;return t.init(e),t},Bi.prototype.fire=function(e,t){var n,r,i,o;if(o=Di.call(arguments),"object"===(void 0===e?"undefined":ji(e))&&(e=(n=e).type),!e)throw new Error("no event type specified");if(r=this._listeners[e]){n=t instanceof Ii?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return void 0===i&&n.defaultPrevented&&(i=!1),i}},Bi.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Bi.prototype._destroy=function(){this._listeners={}},Bi.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},Bi.prototype._invokeListener=function(e,t,n){var r;try{void 0!==(r=function(e,t){return e.apply(null,t)}(n.callback,t))&&(e.returnValue=r,e.stopPropagation()),!1===r&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener"),console.error(e.stack),e}return r},Bi.prototype._addListener=function(e,t){var n,r=this._getListeners(e);if(r){for(;r;){if(r.priority<t.priority)return t.next=r,void(n?n.next=t:this._setListeners(e,t));n=r,r=r.next}n.next=t}else this._setListeners(e,t)},Bi.prototype._getListeners=function(e){return this._listeners[e]},Bi.prototype._setListeners=function(e,t){this._listeners[e]=t},Bi.prototype._removeListener=function(e,t){var n,r,i,o=this._getListeners(e);if(t)for(;o;)n=o.next,(i=o.callback)!==t&&i.__fn!==t||(r?r.next=n:this._setListeners(e,n)),r=o,o=n;else this._setListeners(e,null)},Ii.prototype.stopPropagation=function(){this.cancelBubble=!0},Ii.prototype.preventDefault=function(){this.defaultPrevented=!0},Ii.prototype.init=function(e){(0,c.assign)(this,e||{})};var Li={};Object.defineProperty(Li,"__esModule",{value:!0}),Li.getVisual=function(e){return(0,Ze.query)(".djs-visual",e)},Li.getChildren=function(e){return e.parentNode.childNodes[1]};var Fi={};function zi(e,t){this._eventBus=e,this._elementRegistry=t}function Vi(e,t,n){t.insertBefore(e,n||t.firstChild)}Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.default=zi,zi.$inject=["eventBus","elementRegistry"],zi.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=(0,Li.getChildren)(n))||(t=(0,de.create)("g"),(0,de.classes)(t).add("djs-children"),(0,de.append)(n.parentNode,t)):t=n,t},zi.prototype._clear=function(e){var t=(0,Li.getVisual)(e);return(0,Ze.clear)(t),t},zi.prototype._createContainer=function(e,t,n,r){var i=(0,de.create)("g");(0,de.classes)(i).add("djs-group"),void 0!==n?Vi(i,t,t.childNodes[n]):(0,de.append)(t,i);var o=(0,de.create)("g");(0,de.classes)(o).add("djs-element"),(0,de.classes)(o).add("djs-"+e),r&&(0,de.classes)(o).add("djs-frame"),(0,de.append)(i,o);var a=(0,de.create)("g");return(0,de.classes)(a).add("djs-visual"),(0,de.append)(o,a),o},zi.prototype.create=function(e,t,n){var r=this._getChildren(t.parent);return this._createContainer(e,r,n,(0,vi.isFrameElement)(t))},zi.prototype.updateContainments=function(e){var t,n=this,r=this._elementRegistry;t=(0,c.reduce)(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),(0,c.forEach)(t,function(e){var t=e.children;if(t&&!(t.length<2)){var i=n._getChildren(e);(0,c.forEach)(t.slice().reverse(),function(e){Vi(r.getGraphics(e).parentNode,i)})}})},zi.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},zi.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},zi.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},zi.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},zi.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),(0,$e.translate)(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(r,t)}t.hidden?(0,de.attr)(n,"display","none"):(0,de.attr)(n,"display","block")}},zi.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);(0,de.remove)(t.parentNode)};var $i={};Object.defineProperty($i,"__esModule",{value:!0}),$i.default=qi;var Ui=Gi(l),Wi=Gi(ue);function Gi(e){return e&&e.__esModule?e:{default:e}}var Hi=1;function qi(e,t){Wi.default.call(this,e,Hi),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}(0,Ui.default)(qi,Wi.default),qi.prototype.canRender=function(){return!0},qi.prototype.drawShape=function(e,t){var n=(0,de.create)("rect");return(0,de.attr)(n,{x:0,y:0,width:t.width||0,height:t.height||0}),(0,vi.isFrameElement)(t)?(0,de.attr)(n,this.FRAME_STYLE):(0,de.attr)(n,this.SHAPE_STYLE),(0,de.append)(e,n),n},qi.prototype.drawConnection=function(e,t){var n=(0,ze.createLine)(t.waypoints,this.CONNECTION_STYLE);return(0,de.append)(e,n),n},qi.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width,i=[["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]];return(0,ze.componentsToPath)(i)},qi.prototype.getConnectionPath=function(e){var t,n,r=e.waypoints,i=[];for(t=0;n=r[t];t++)n=n.original||n,i.push([0===t?"M":"L",n.x,n.y]);return(0,ze.componentsToPath)(i)},qi.$inject=["eventBus","styles"];var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){var r=this.style(t,n);return(0,c.assign)(r,{class:e})},this.style=function(t,n){(0,c.isArray)(t)||n||(n=t,t=[]);var r=(0,c.reduce)(t,function(t,n){return(0,c.assign)(t,e[n]||{})},{});return n?(0,c.assign)(r,n):r},this.computeStyle=function(e,n,r){return(0,c.isArray)(n)||(r=n,n=[]),t.style(n||[],(0,c.assign)({},r,e||{}))}};var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});var Xi=Ji($i),Zi=Ji(Ki);function Ji(e){return e&&e.__esModule?e:{default:e}}Yi.default={__init__:["defaultRenderer"],defaultRenderer:["type",Xi.default],styles:["type",Zi.default]};var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0});var eo=ao(Yi),to=ao(_i),no=ao(Ri),ro=ao(Pi),io=ao(Ti),oo=ao(Fi);function ao(e){return e&&e.__esModule?e:{default:e}}Qi.default={__depends__:[eo.default],__init__:["canvas"],canvas:["type",to.default],elementRegistry:["type",no.default],elementFactory:["type",ro.default],eventBus:["type",io.default],graphicsFactory:["type",oo.default]};var so={},lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(so,"__esModule",{value:!0});var co=/^class /;function uo(e){return"[object Array]"===Object.prototype.toString.call(e)}function po(){var e=Array.prototype.slice.call(arguments);1===e.length&&uo(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var fo=/constructor\s*[^(]*\(\s*([^)]*)\)/m,ho=/^function\s*[^(]*\(\s*([^)]*)\)/m,mo=/\/\*([^*]*)\*\//m;function yo(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(e){return co.test(e.toString())}(e)?fo:ho);return t&&t[1]&&t[1].split(",").map(function(e){return(t=e.match(mo))?t[1].trim():e.trim()})||[]}function go(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}}var vo="function"==typeof Symbol&&"symbol"===lo(Symbol.iterator)?function(e){return void 0===e?"undefined":lo(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":lo(e)};function bo(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function _o(e,t){return Object.hasOwnProperty.call(e,t)}so.Injector=function e(t,n){n=n||{get:function(e,t){if(r.push(e),!1===t)return null;throw s('No provider for "'+e+'"!')}};var r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(e){var t=r.join(" -> ");return r.length=0,new Error(t?e+" (Resolving: "+t+")":e)},l=function e(t,a){if(!i[t]&&-1!==t.indexOf(".")){for(var l=t.split("."),c=e(l.shift());l.length;)c=c[l.shift()];return c}if(_o(o,t))return o[t];if(_o(i,t)){if(-1!==r.indexOf(t))throw r.push(t),s("Cannot resolve circular dependency!");return r.push(t),o[t]=i[t][0](i[t][1]),r.pop(),o[t]}return n.get(t,a)},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e){if(!uo(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=po(e.slice())}return{fn:e,dependencies:(e.$inject||yo(e)).map(function(e){return _o(t,e)?t[e]:l(e)})}},u=function(e){var t=c(e),n=t.dependencies,r=t.fn;return new(Function.prototype.bind.apply(r,[null].concat(bo(n))))},p=function(e,t,n){var r=c(e,n),i=r.dependencies,o=r.fn;return o.call.apply(o,[t].concat(bo(i)))},f=function(e){return po(function(t){return e.get(t)})},d={factory:p,type:u,value:function(e){return e}};t.forEach(function(t){function n(e,t){return"value"!==e&&uo(t)&&(t=po(t.slice())),t}if(t instanceof go)t.forEach(function(e){var t=e[0],r=e[1],o=e[2];i[t]=[d[r],n(r,o),r]});else if("object"===(void 0===t?"undefined":vo(t)))if(t.__exports__){var r=Object.keys(t).reduce(function(e,n){return"__"!==n.substring(0,2)&&(e[n]=t[n]),e},Object.create(null)),o=new e((t.__modules__||[]).concat([r]),a),s=po(function(e){return o.get(e)});t.__exports__.forEach(function(e){i[e]=[s,e,"private",o]})}else Object.keys(t).forEach(function(e){if("private"!==t[e][2]){var r=t[e][0],o=t[e][1];i[e]=[d[r],n(r,o),r]}else i[e]=t[e]})}),this.get=l,this.invoke=p,this.instantiate=u,this.createChild=function(t,n){if(n&&n.length){var r,o,s,l,c=Object.create(null),u=Object.create(null),p=[],d=[],h=[];for(var m in i)r=i[m],-1!==n.indexOf(m)&&("private"===r[2]?-1===(o=p.indexOf(r[3]))?(s=r[3].createChild([],n),l=f(s),p.push(r[3]),d.push(s),h.push(l),c[m]=[l,m,"private",s]):c[m]=[h[o],m,"private",d[o]]:c[m]=[r[2],r[1]],u[m]=!0),"factory"!==r[2]&&"type"!==r[2]||!r[1].$scope||n.forEach(function(e){-1!==r[1].$scope.indexOf(e)&&(c[m]=[r[2],r[1]],u[e]=!0)});n.forEach(function(e){if(!u[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),t.unshift(c)}return new e(t,a)}};var xo={};Object.defineProperty(xo,"__esModule",{value:!0}),xo.default=Mo;var wo=function(e){return e&&e.__esModule?e:{default:e}}(Qi);function Eo(e){var t=[],n=[];function r(e){return t.indexOf(e)>=0}e.forEach(function e(i){r(i)||((i.__depends__||[]).forEach(e),r(i)||(function(e){t.push(e)}(i),(i.__init__||[]).forEach(function(e){n.push(e)})))});var i=new so.Injector(t);return n.forEach(function(e){try{i["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}}),i}function Mo(e,t){this.injector=t=t||function(e){return Eo([{config:["value",e=e||{}]},wo.default].concat(e.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}Mo.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Mo.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var Co={};Object.defineProperty(Co,"__esModule",{value:!0}),Object.defineProperty(Co,"default",{enumerable:!0,get:function(){return(e=xo,e&&e.__esModule?e:{default:e}).default;var e}});var Ao={};function So(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.default=So,So.prototype.next=function(){return this._prefix+ ++this._counter};var Po={};Object.defineProperty(Po,"__esModule",{value:!0}),Po.default=Ro;var No=new(function(e){return e&&e.__esModule?e:{default:e}}(Ao).default)("ov");function Ro(e,t,n,r){var i,o;this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=No,this._overlayDefaults=(0,c.assign)({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(i=n.getContainer(),o=(0,Ze.domify)('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),i.insertBefore(o,i.firstChild),o),this._init()}function ko(e,t,n){(0,c.assign)(e.style,{left:t+"px",top:n+"px"})}function Oo(e,t){e.style.display=!1===t?"none":""}function To(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}Ro.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Ro.prototype.get=function(e){if((0,c.isString)(e)&&(e={id:e}),(0,c.isString)(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?(0,c.filter)(t.overlays,(0,c.matchPattern)({type:e.type})):t.overlays.slice():[]}return e.type?(0,c.filter)(this._overlays,(0,c.matchPattern)({type:e.type})):e.id?this._overlays[e.id]:null},Ro.prototype.add=function(e,t,n){if((0,c.isObject)(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=(0,c.assign)({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},Ro.prototype.remove=function(e){var t=this.get(e)||[];(0,c.isArray)(t)||(t=[t]);var n=this;(0,c.forEach)(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&((0,Ze.remove)(e.html),(0,Ze.remove)(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);-1!==r&&t.overlays.splice(r,1)}})},Ro.prototype.show=function(){Oo(this._overlayRoot)},Ro.prototype.hide=function(){Oo(this._overlayRoot,!1)},Ro.prototype.clear=function(){this._overlays={},this._overlayContainers=[],(0,Ze.clear)(this._overlayRoot)},Ro.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=(0,vi.getBBox)(t);r=o.x,i=o.y}ko(n,r,i),(0,Ze.attr)(e.html,"data-container-id",t.id)},Ro.prototype._updateOverlay=function(e){var t,n,r=e.position,i=e.htmlContainer,o=e.element,a=r.left,s=r.top;void 0!==r.right&&(t=o.waypoints?(0,vi.getBBox)(o).width:o.width,a=-1*r.right+t);void 0!==r.bottom&&(n=o.waypoints?(0,vi.getBBox)(o).height:o.height,s=-1*r.bottom+n);ko(i,a||0,s||0)},Ro.prototype._createOverlayContainer=function(e){var t=(0,Ze.domify)('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Ro.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";To(this._overlayRoot,n)},Ro.prototype._getOverlayContainer=function(e,t){var n=(0,c.find)(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},Ro.prototype._addOverlay=function(e){var t,n,r=e.id,i=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),(0,c.isString)(o)&&(o=(0,Ze.domify)(o)),n=this._getOverlayContainer(i),(t=(0,Ze.domify)('<div class="djs-overlay" data-overlay-id="'+r+'" style="position: absolute">')).appendChild(o),e.type&&(0,Ze.classes)(t).add("djs-overlay-"+e.type),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Ro.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=n&&n.minZoom,i=n&&n.maxZoom,o=e.htmlContainer,a=!0;n&&(((0,c.isDefined)(r)&&r>t.scale||(0,c.isDefined)(i)&&i<t.scale)&&(a=!1),Oo(o,a)),this._updateOverlayScale(e,t)},Ro.prototype._updateOverlayScale=function(e,t){var n,r,i,o=e.scale,a=e.htmlContainer,s="";!0!==o&&(!1===o?(n=1,r=1):(n=o.min,r=o.max),(0,c.isDefined)(n)&&t.scale<n&&(i=(1/t.scale||1)*n),(0,c.isDefined)(r)&&t.scale>r&&(i=(1/t.scale||1)*r)),(0,c.isDefined)(i)&&(s="scale("+i+","+i+")"),To(a,s)},Ro.prototype._updateOverlaysVisibilty=function(e){var t=this;(0,c.forEach)(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},Ro.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(e){t.hide()}),e.on("canvas.viewbox.changed",function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()}),e.on(["shape.remove","connection.remove"],function(e){var n=e.element,r=t.get({element:n});(0,c.forEach)(r,function(e){t.remove(e.id)});var i=t._getOverlayContainer(n);if(i){(0,Ze.remove)(i.html);var o=t._overlayContainers.indexOf(i);-1!==o&&t._overlayContainers.splice(o,1)}}),e.on("element.changed",500,function(e){var n=e.element,r=t._getOverlayContainer(n,!0);r&&((0,c.forEach)(r.overlays,function(e){t._updateOverlay(e)}),t._updateOverlayContainer(r))}),e.on("element.marker.update",function(e){var n=t._getOverlayContainer(e.element,!0);n&&(0,Ze.classes)(n.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var jo={};Object.defineProperty(jo,"__esModule",{value:!0});var Do=function(e){return e&&e.__esModule?e:{default:e}}(Po);jo.default={__init__:["overlays"],overlays:["type",Do.default]};var Bo={};function Io(e){return e.originalEvent||e.srcEvent}Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.getOriginal=Io;var Lo={};Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.isMac=function(){return/mac/i.test(navigator.platform)};var Fo={};function zo(e){return!((0,Bo.getOriginal)(e)||e).button}Object.defineProperty(Fo,"__esModule",{value:!0}),Object.defineProperty(Fo,"isMac",{enumerable:!0,get:function(){return Lo.isMac}}),Fo.isPrimaryButton=zo,Fo.hasPrimaryModifier=function(e){var t=(0,Bo.getOriginal)(e)||e;if(!zo(e))return!1;return(0,Lo.isMac)()?t.metaKey:t.ctrlKey};var Vo={};function $o(e){return!0}Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.default=Wo;var Uo=500;function Wo(e,t,n){var r=n.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15});function i(n,r,i){var o,a;(function(e,t){return!(l[e]||Fo.isPrimaryButton)(t)})(n,r)||(i?a=t.getGraphics(i):(o=r.delegateTarget||r.target)&&(a=o,i=t.get(a)),a&&i&&!1===e.fire(n,{element:i,gfx:a,originalEvent:r})&&(r.stopPropagation(),r.preventDefault()))}var o={};function a(e){return o[e]}var s={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseup:"element.mouseup",contextmenu:"element.contextmenu"},l={"element.contextmenu":$o};var u="svg, .djs-element";function p(e,t,n,r){var a=o[n]=function(e){i(n,e)};r&&(l[n]=r),a.$delegate=Ze.delegate.bind(e,u,t,a)}function f(e,t,n){var r=a(n);r&&Ze.delegate.unbind(e,t,r.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,(0,c.forEach)(s,function(e,n){f(t,n,e)})}),e.on("canvas.init",function(e){var t;t=e.svg,(0,c.forEach)(s,function(e,n){p(t,n,e)})}),e.on(["shape.added","connection.added"],function(e){var t,n=e.element,i=e.gfx;n.waypoints?t=(0,ze.createLine)(n.waypoints):(t=(0,de.create)("rect"),(0,de.attr)(t,{x:0,y:0,width:n.width,height:n.height})),(0,de.attr)(t,r),(0,de.append)(i,t)}),e.on("shape.changed",Uo,function(e){var t=e.element,n=e.gfx,r=(0,Ze.query)(".djs-hit",n);(0,de.attr)(r,{width:t.width,height:t.height})}),e.on("connection.changed",function(e){var t=e.element,n=e.gfx,r=(0,Ze.query)(".djs-hit",n);(0,ze.updateLine)(r,t.waypoints)}),this.fire=i,this.triggerMouseEvent=function(e,t,n){var r=s[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");return i(r,t,n)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=f}Wo.$inject=["eventBus","elementRegistry","styles"];var Go={};Object.defineProperty(Go,"__esModule",{value:!0});var Ho=function(e){return e&&e.__esModule?e:{default:e}}(Vo);Go.default={__init__:["interactionEvents"],interactionEvents:["type",Ho.default]};var qo={};Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=Yo;var Ko=500;function Yo(e,t,n){this.offset=6;var r=t.cls("djs-outline",["no-fill"]),i=this;function o(e,t){var n=(0,de.create)("rect");return(0,de.attr)(n,(0,c.assign)({x:10,y:10,width:100,height:100},r)),(0,de.append)(e,n),n}e.on(["shape.added","shape.changed"],Ko,function(e){var t=e.element,n=e.gfx,r=(0,Ze.query)(".djs-outline",n);r||(r=o(n)),i.updateShapeOutline(r,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,r=(0,Ze.query)(".djs-outline",n);r||(r=o(n)),i.updateConnectionOutline(r,t)})}Yo.prototype.updateShapeOutline=function(e,t){(0,de.attr)(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Yo.prototype.updateConnectionOutline=function(e,t){var n=(0,vi.getBBox)(t);(0,de.attr)(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Yo.$inject=["eventBus","styles","elementRegistry"];var Xo={};Object.defineProperty(Xo,"__esModule",{value:!0});var Zo=function(e){return e&&e.__esModule?e:{default:e}}(qo);Xo.default={__init__:["outline"],outline:["type",Zo.default]};var Jo={};function Qo(e){this._eventBus=e,this._selectedElements=[];var t=this;e.on(["shape.remove","connection.remove"],function(e){var n=e.element;t.deselect(n)}),e.on(["diagram.clear"],function(e){t.select(null)})}Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=Qo,Qo.$inject=["eventBus"],Qo.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}},Qo.prototype.get=function(){return this._selectedElements},Qo.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Qo.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();(0,c.isArray)(e)||(e=e?[e]:[]),t?(0,c.forEach)(e,function(e){-1===n.indexOf(e)&&n.push(e)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};var ea={};function ta(e,t,n,r){e.on("create.end",500,function(e){e.context.canExecute&&t.select(e.context.shape)}),e.on("connect.end",500,function(e){e.context.canExecute&&e.context.target&&t.select(e.context.target)}),e.on("shape.move.end",500,function(e){var n=e.previousSelection||[],i=r.get(e.context.shape.id);(0,c.find)(n,function(e){return i.id===e.id})||t.select(i)}),e.on("element.click",function(e){var r=e.element;r===n.getRootElement()&&(r=null);var i=t.isSelected(r),o=t.get().length>1,a=(0,Fo.hasPrimaryModifier)(e);if(i&&o)return a?t.deselect(r):t.select(r);i?t.deselect(r):t.select(r,a)})}Object.defineProperty(ea,"__esModule",{value:!0}),ea.default=ta,ta.$inject=["eventBus","selection","canvas","elementRegistry"];var na={};Object.defineProperty(na,"__esModule",{value:!0}),na.default=oa;var ra="hover",ia="selected";function oa(e,t,n,r){function i(e,n){t.addMarker(e,n)}function o(e,n){t.removeMarker(e,n)}this._multiSelectionBox=null,e.on("element.hover",function(e){i(e.element,ra)}),e.on("element.out",function(e){o(e.element,ra)}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;(0,c.forEach)(t,function(e){-1===n.indexOf(e)&&o(e,ia)}),(0,c.forEach)(n,function(e){-1===t.indexOf(e)&&i(e,ia)})})}oa.$inject=["eventBus","canvas","selection","styles"];var aa={};Object.defineProperty(aa,"__esModule",{value:!0});var sa=fa(Go),la=fa(Xo),ca=fa(Jo),ua=fa(na),pa=fa(ea);function fa(e){return e&&e.__esModule?e:{default:e}}aa.default={__init__:["selectionVisuals","selectionBehavior"],__depends__:[sa.default,la.default],selection:["type",ca.default],selectionVisuals:["type",ua.default],selectionBehavior:["type",pa.default]};var da=c.assign,ha=c.omit,ma=c.isNumber,ya=Ze.domify,ga=Ze.query,va=Ze.remove,ba=de.innerSVG,_a=Co.default,xa=gi.default;var wa={width:"100%",height:"100%",position:"relative"};function Ea(e){return e+(ma(e)?"px":"")}function Ma(e){var t,n,r;e=da({},wa,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n='<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; '+wn.LINK_STYLES+'">'+wn.BPMNIO_IMG+"</a>",r=ya(n),t.appendChild(r),Aa.bind(r,"click",function(e){wn.open(),e.preventDefault()}),this._init(this._container,this._moddle,e)}l(Ma,_a);var Ca=Ma;Ma.prototype.importXML=function(e,t){t=t||function(){};var n=this;e=this._emit("import.parse.start",{xml:e})||e,this._moddle.fromXML(e,"cmmn:Definitions",function(e,r,i){r=n._emit("import.parse.complete",{error:e,definitions:r,context:i})||r;var o=i.warnings;if(e)return e=function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid CMMN 1.1 diagram file"+t[2]),e}(e),n._emit("import.done",{error:e,warnings:o}),t(e,o);n.importDefinitions(r,function(e,r){var i=[].concat(o,r||[]);n._emit("import.done",{error:e,warnings:i}),t(e,i)})})},Ma.prototype.saveXML=function(e,t){t||(t=e,e={});var n=this,r=this._definitions;if(!r)return t(new Error("no definitions loaded"));r=this._emit("saveXML.start",{definitions:r})||r,this._moddle.toXML(r,e,function(e,r){try{r=n._emit("saveXML.serialized",{error:e,xml:r})||r,n._emit("saveXML.done",{error:e,xml:r})}catch(e){console.error("error in saveXML life-cycle listener",e)}t(e,r)})},Ma.prototype.saveSVG=function(e,t){t||(t=e,e={});var n=this.get("canvas"),r=n.getDefaultLayer(),i=ga("defs",n._svg),o=ba(r),a=i&&i.outerHTML||"",s=r.getBBox();t(null,'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with cmmn-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="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+a+o+"</svg>")},Ma.prototype.importDefinitions=function(e,t){try{this._definitions&&this.clear(),this._definitions=e,xn.importCmmnDiagram(this,e,t)}catch(e){t(e)}},Ma.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=ga(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Ma.prototype.getDefinitions=function(){return this._definitions},Ma.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Ma.prototype.getModules=function(){return this._modules},Ma.prototype.destroy=function(){_a.prototype.destroy.call(this),va(this._container)},Ma.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},Ma.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Ma.prototype._init=function(e,t,n){var r=n.modules||this.getModules(),i=n.additionalModules||[],o=[].concat([{cmmnjs:["value",this],moddle:["value",t]}],r,i),a=da(ha(n,"additionalModules"),{canvas:da({},n.canvas,{container:e}),modules:o});_a.call(this,a),n&&n.container&&this.attachTo(n.container)},Ma.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Ma.prototype._createContainer=function(e){var t=ya('<div class="cjs-container"></div>');return da(t.style,{width:Ea(e.width),height:Ea(e.height),position:e.position}),t},Ma.prototype._createModdle=function(e){var t=da({},this._moddleExtensions,e.moddleExtensions);return new xa(t)},Ma.prototype._modules=[dn,aa.default,jo.default];var Aa=Ze.event;return Ca});