/*! dmn-js - dmn-viewer v12.2.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).DmnJS=t()}(this,function(){"use strict";function y(e){return(y="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})(e)}function i(e,t){for(var n=0;n or , got "+e);n=o[1],r=o[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}}function V(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function z(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,g(e,E(this.registerPackage,this))}function U(e,t,n){t=t[n];if(t in e)throw new Error("package with "+n+" <"+t+"> already defined")}function F(e){this.model=e}function G(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function q(e){this.properties=new F(this),this.factory=new M(this,this.properties),this.registry=new z(e,this.properties),this.typeCache={}}V.prototype.build=function(){return t=this,e=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},r=Object(t),g(e,function(e){e in r&&(n[e]=t[e])}),n;var t,e,n,r},V.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);n=this.properties;void 0!==t?n.splice(t,0,e):n.push(e)},V.prototype.replaceProperty=function(e,t,n){var r=e.ns,o=this.properties,i=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)}e=o.indexOf(e);if(-1===e)throw new Error("property <"+r.name+"> not found in property list");o.splice(e,1),this.addProperty(t,n?void 0:e,a),i[r.name]=i[r.localName]=t},V.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,t=t.split("#"),r=$(t[0],r),t=$(t[1],r.prefix).name,r=this.propertiesByName[t];if(!r)throw new Error("refined property <"+t+"> not found");this.replaceProperty(r,e,n),delete e.redefines},V.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},V.prototype.removeNamedProperty=function(e){var t=e.ns,e=this.propertiesByName;delete e[t.name],delete e[t.localName]},V.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},V.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},V.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")},V.prototype.hasProperty=function(e){return this.propertiesByName[e]},V.prototype.addTrait=function(r,o){var e=this.allTypesByName,t=this.allTypes,n=r.name;n in e||(g(r.properties,E(function(e){e=P({},e,{name:e.ns.localName,inherited:o}),Object.defineProperty(e,"definedBy",{value:r});var t=e.replaces,n=e.redefines;t||n?this.redefineProperty(e,t||n,t):(e.isBody&&this.setBodyProperty(e),e.isId&&this.setIdProperty(e),this.addProperty(e))},this)),t.push(r),e[n]=r)},z.prototype.getPackage=function(e){return this.packageMap[e]},z.prototype.getPackages=function(){return this.packages},z.prototype.registerPackage=function(t){t=P({},t);var e=this.packageMap;U(e,t,"prefix"),U(e,t,"uri"),g(t.types,E(function(e){this.registerType(e,t)},this)),e[t.uri]=e[t.prefix]=t,this.packages.push(t)},z.prototype.registerType=function(e,t){var r=$((e=P({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:P(e.meta||{})})).name,t.prefix),n=r.name,o={};g(e.properties,E(function(e){var t=$(e.name,r.prefix),n=t.name;I(e.type)||(e.type=$(e.type,t.prefix).name),P(e,{ns:t,name:n}),o[n]=e},this)),P(e,{ns:r,name:n,propertiesByName:o}),g(e.extends,E(function(e){e=this.typeMap[e];e.traits=e.traits||[],e.traits.push(n)},this)),this.definePackage(e,t),this.typeMap[n]=e},z.prototype.mapTypes=function(n,r,e){var t=I(n.name)?{name:n.name}:this.typeMap[n.name],o=this;function i(e){return a(e,!0)}function a(e,t){e=$(e,T[e]?"":n.prefix);o.mapTypes(e,r,t)}if(!t)throw new Error("unknown type <"+n.name+">");g(t.superClass,e?i:a),r(t,!e),g(t.traits,i)},z.prototype.getEffectiveDescriptor=function(e){var e=$(e),n=new V(e);this.mapTypes(e,function(e,t){n.addTrait(e,t)});e=n.build();return this.definePackage(e,e.allTypes[e.allTypes.length-1].$pkg),e},z.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},F.prototype.set=function(e,t,n){var r=this.model.getPropertyDescriptor(e,t),o=r&&r.name;void 0===n?r?delete e[o]:delete e.$attrs[t]:r?o in e?e[o]=n:G(e,r,n):e.$attrs[t]=n},F.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];t=n.name;return!e[t]&&n.isMany&&G(e,n,[]),e[t]},F.prototype.define=function(e,t,n){var r;n.writable||(r=n.value,delete(n=P({},n,{get:function(){return r}})).value),Object.defineProperty(e,t,n)},F.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},F.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},q.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},q.prototype.getType=function(e){var t=this.typeCache,n=h(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},q.prototype.createAny=function(e,t,n){var r=$(e),o={$type:e,$instanceOf:function(e){return e===this.$type}},t={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(o,t),this.properties.defineModel(o,this),this.properties.define(o,"$parent",{enumerable:!1,writable:!0}),this.properties.define(o,"$instanceOf",{enumerable:!1,writable:!0}),g(n,function(e,t){w(e)&&void 0!==e.value?o[e.name]=e.value:o[t]=e}),o},q.prototype.getPackage=function(e){return this.registry.getPackage(e)},q.prototype.getPackages=function(){return this.registry.getPackages()},q.prototype.getElementDescriptor=function(e){return e.$descriptor},q.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},q.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},q.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var W=String.fromCharCode,H=Object.prototype.hasOwnProperty,K=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,X={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Y(e,t,n,r){return r?H.call(X,r)?X[r]:"&"+r+";":W(t||parseInt(n,16))}function Q(e){return 3"}function ne(e){return{get:e,enumerable:!0}}function re(e){return e+"$uri"}function oe(){return{line:0,column:0}}function ie(e){throw e}function ae(e){if(!this)return new ae(e);var O,j,E,k,n,P,S,C,R,D=e&&e.proxy,r=ie,N=oe,M=!1,T=!1,t=null,A=!1;function B(e){e instanceof Error||(e=ee(e)),r(t=e,N)}function I(e){n&&(e instanceof Error||(e=ee(e)),n(e,N))}this.on=function(e,t){if("function"!=typeof t)throw ee("required args ");switch(e){case"openTag":j=t;break;case"text":O=t;break;case"closeTag":E=t;break;case"error":r=t;break;case"warn":n=t;break;case"cdata":k=t;break;case"attention":C=t;break;case"question":S=t;break;case"comment":P=t;break;default:throw ee("unsupported event: "+e)}return this},this.ns=function(e){if("object"!==y(e=void 0===e?{}:e))throw ee("required args ");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",T=!0,R=n,this},this.parse=function(e){if("string"!=typeof e)throw ee("required args ");return t=null,function(a){var e,t,n,r,o,i,s,c,u,l,g,f=T?[]:null,b=T?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[re(n)]=t;return r}(R):null,p=[],w=0,h=!1,d=!1,y=0,m=0,_="",x=0;function v(){if(null!==g)return g;var e,t,n,r,o,i,a,s,c,u,l,f=T&&b.xmlns,p=T&&M?[]:null,h=x,d=_,y=d.length,m={},v={};e:for(;h already defined");else if(v[s]=!0,T)if(M)if(null===(o="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null))p.push(s,i);else{if(e=Q(i),t=re(o),!(a=R[e])){if("xmlns"===o||t in b&&b[t]!==e)for(;a="ns"+w++,void 0!==b[a];);else a=o;R[e]=a}b[o]!==a&&(r||(b=function(e){var t,n={};for(t in e)n[t]=e[t];return n}(b),r=!0),b[o]=a,"xmlns"===o&&(b[re(a)]=e,f=a),b[t]=e),m[s]=i}else-1!==(u=s.indexOf(":"))?(n=b[s.substring(0,u)])?((s=f===n?s.substr(u+1):n+s.substr(u))===Z&&(i=-1!==(u=i.indexOf(":"))?(n=i.substring(0,u),(n=b[n]||n)+i.substring(u)):f+":"+i),m[s]=i):I(te(s.substring(0,u))):m[s]=i;else m[s]=i}if(M)for(h=0,y=p.length;h",y)))return B("unclosed cdata");if(k&&(k(a.substring(y+9,m),N),A))return;m+=3;continue}if(45===r&&45===a.charCodeAt(y+3)){if(-1===(m=a.indexOf("--\x3e",y)))return B("unclosed comment");if(P&&(P(a.substring(y+4,m),Q,N),A))return;m+=3;continue}}if(63!==o){for(t=y+1;;t++){if(i=a.charCodeAt(t),isNaN(i))return m=-1,B("unclosed tag");if(34===i)r=a.indexOf('"',t+1),t=-1!==r?r:t;else if(39===i)r=a.indexOf("'",t+1),t=-1!==r?r:t;else if(62===i){m=t;break}}if(33!==o){if(g={},47===o){if(d=!(h=!1),!p.length)return B("missing open tag");if(t=c=p.pop(),r=y+2+t.length,a.substring(y+2,r)!==t)return B("closing tag mismatch");for(;r");c=c.substr(o+1)}else s=b.xmlns;s&&(c=s+":"+c)}if(h&&(x=r,_=t,j&&(D?j(l,Q,d,N):j(c,v,Q,d,N),A)))return;if(d){if(E&&(E(D?l:c,Q,h,N),A))return;T&&(b=h?e:f.pop())}m+=1}else{if(C&&(C(a.substring(y,m+1),Q,N),A))return;m+=1}}else{if(-1===(m=a.indexOf("?>",y)))return B("unclosed question");if(S&&(S(a.substring(y,m+2),N),A))return;m+=2}}}(e),N=oe,A=!1,t},this.stop=function(){A=!0}}function se(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var ce={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ue="xsi:type";function le(e){return e.xml&&e.xml.serialize}function fe(e){return le(e)===ue}function pe(e,t){return se(t)?e.prefix+":"+((t=e.localName).charAt(0).toUpperCase()+t.slice(1)):e.name}function he(e){return new Error(e)}function de(e){return e.$descriptor}function ye(e){P(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw he("expected element");var t,n=this.elementsById,r=de(e).idProperty;if(r&&(t=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw he("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function e(){}function me(){}function ve(){}function ge(e,t){this.property=e,this.context=t}function be(e,t){this.element=t,this.propertyDesc=e}function we(){}function _e(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function xe(e,t,n){_e.call(this,e,t,n)}function Oe(e,t,n){this.model=e,this.context=n}function je(e){P(this,{lax:!1},e=e instanceof q?{model:e}:e)}e.prototype.handleEnd=function(){},e.prototype.handleText=function(){},e.prototype.handleNode=function(){},(me.prototype=Object.create(e.prototype)).handleNode=function(){return this},(ve.prototype=Object.create(e.prototype)).handleText=function(e){this.body=(this.body||"")+e},(ge.prototype=Object.create(ve.prototype)).handleNode=function(e){if(this.element)throw he("expected no sub nodes");return this.element=this.createReference(e),this},ge.prototype.handleEnd=function(){this.element.id=this.body},ge.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},(be.prototype=Object.create(ve.prototype)).handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc,e=B(n.type,e);n.isMany?t.get(n.name).push(e):t.set(n.name,e)},(we.prototype=Object.create(ve.prototype)).handleNode=function(e){var t,n=this;return(t=this.element)?n=this.handleChild(e):(t=this.element=this.createElement(e),this.context.addElement(t)),n},(_e.prototype=Object.create(we.prototype)).addReference=function(e){this.context.addReference(e)},_e.prototype.handleText=function(e){if(!de(this.element).bodyProperty)throw he("unexpected body text <"+e+">");ve.prototype.handleText.call(this,e)},_e.prototype.handleEnd=function(){var e=this.body,t=this.element,n=de(t).bodyProperty;n&&void 0!==e&&(e=B(n.type,e),t.set(n.name,e))},_e.prototype.createElement=function(e){var r,t=e.attributes,e=this.type,o=de(e),i=this.context,a=new e({}),s=this.model;return g(t,function(e,t){var n=o.propertiesByName[t];n&&n.isReference?n.isMany?g(e.split(" "),function(e){i.addReference({element:a,property:n.ns.name,id:e})}):i.addReference({element:a,property:n.ns.name,id:e}):(n?e=B(n.type,e):"xmlns"!==t&&(r=$(t,o.ns.prefix),s.getPackage(r.prefix)&&i.addWarning({message:"unknown attribute <"+t+">",element:a,property:t,value:e})),a.set(t,e))}),a},_e.prototype.getPropertyForNode=function(e){var t,n,r=$(e.name),o=this.type,i=this.model,a=de(o),s=r.name,c=a.propertiesByName[s];if(c&&!c.isAttr)return fe(c)&&(t=e.attributes[ue])?(o=i,e=$(s=t),u=o.getPackage(e.prefix),s=u,u=(o=e).name,e=o.localName,t=(s=s.xml&&s.xml.typePrefix)&&0===e.indexOf(s)?o.prefix+":"+e.slice(s.length):u,P({},c,{effectiveType:de(n=i.getType(t)).name})):c;var u=i.getPackage(r.prefix);if(u){if(t=pe(r,u),n=i.getType(t),c=m(a.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return P({},c,{effectiveType:de(n).name})}else if(c=m(a.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return c;throw he("unrecognized element <"+r.name+">")},_e.prototype.toString=function(){return"ElementDescriptor["+de(this.type).name+"]"},_e.prototype.valueHandler=function(e,t){return new be(e,t)},_e.prototype.referenceHandler=function(e){return new ge(e,this.context)},_e.prototype.handler=function(e){return new("Element"===e?Oe:_e)(this.model,e,this.context)},_e.prototype.handleChild=function(e){var t=this.getPropertyForNode(e),n=this.element,r=t.effectiveType||t.type;if(A[r])return this.valueHandler(t,n);e=(r=(t.isReference?this.referenceHandler(t):this.handler(r)).handleNode(e)).element;return void 0!==e&&(t.isMany?n.get(t.name).push(e):n.set(t.name,e),t.isReference?(P(e,{element:n}),this.context.addReference(e)):e.$parent=n),r},(xe.prototype=Object.create(_e.prototype)).createElement=function(e){var t=e.name,n=$(t),r=this.model,o=this.type,r=r.getPackage(n.prefix),t=r&&pe(n,r)||t;if(!o.hasType(t))throw he("unexpected element <"+e.originalName+">");return _e.prototype.createElement.call(this,e)},(Oe.prototype=Object.create(we.prototype)).createElement=function(e){var t=e.name,n=$(t).prefix,n=e.ns[n+"$uri"],e=e.attributes;return this.model.createAny(t,n,e)},Oe.prototype.handleChild=function(e){var t=new Oe(this.model,0,this.context).handleNode(e),n=this.element,e=t.element;return void 0!==e&&((n.$children=n.$children||[]).push(e),e.$parent=n),t},Oe.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},je.prototype.fromXML=function(s,e,t){var c=e.rootHandler;e instanceof _e?(c=e,e={}):"string"==typeof e?(c=this.handler(e),e={}):"string"==typeof c&&(c=this.handler(c));var n=this.model,a=this.lax,u=new ye(P({},e,{rootHandler:c})),l=new ae({proxy:!0}),f=(e=[],Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e);function p(e,t,n){var r=t(),o=r.line,t=r.column,r=r.data,t="unparsable content "+((r="<"===r.charAt(0)&&-1!==r.indexOf(" ")?r.slice(0,r.indexOf(" "))+">":r)?r+" ":"")+"detected\n\tline: "+o+"\n\tcolumn: "+t+"\n\tnested error: "+e.message;if(n)return u.addWarning({message:t,error:e}),!0;throw he(t)}function r(e,t){return p(e,t,!0)}c.context=u,f.push(c);var o=/^<\?xml /i,i=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function d(e,t){try{f.peek().handleText(e)}catch(e){r(e,t)}}n=n.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{"http://www.w3.org/XML/1998/namespace":"xml"});return l.ns(n).on("openTag",function(e,r,t,n){var o=e.attrs||{},i=Object.keys(o).reduce(function(e,t){var n=r(o[t]);return e[t]=n,e},{});!function(e,t){var n=f.peek();try{f.push(n.handleNode(e))}catch(e){p(e,t,a)&&f.push(new me)}}({name:e.name,originalName:e.originalName,attributes:i,ns:e.ns},n)}).on("question",function(e){!o.test(e)||(e=(e=i.exec(e))&&e[1])&&!h.test(e)&&u.addWarning({message:"unsupported document encoding <"+e+">, falling back to UTF-8"})}).on("closeTag",function(){f.pop().handleEnd()}).on("cdata",d).on("text",function(e,t,n){e=t(e),n=n,e.trim()&&d(e,n)}).on("error",p).on("warn",r),new Promise(function(e,t){var n;try{l.parse(s),function(){for(var e=u.elementsById,t=u.references,n=0;o=t[n];n++){var r,o,i=o.element,a=e[o.id],s=de(i).propertiesByName[o.property];a||u.addWarning({message:"unresolved reference <"+o.id+">",element:o.element,property:o.property,value:o.id}),s.isMany?(-1===(o=(r=i.get(s.name)).indexOf(o))&&(o=r.length),a?r[o]=a:r.splice(o,1)):i.set(s.name,a)}}()}catch(e){n=e}var r=c.element;n||r||(n=he("failed to parse document as <"+c.type.$descriptor.name+">"));var o=u.warnings,i=u.references,a=u.elementsById;return n?(n.warnings=o,t(n)):e({rootElement:r,elementsById:a,references:i,warnings:o})})},je.prototype.handler=function(e){return new xe(this.model,e)};var Ee=/<|>|'|"|&|\n\r|\n/g,ke=/<|>|&/g;function Pe(r){var n={},o={},i={},a=[],s=[];this.byUri=function(e){return o[e]||r&&r.byUri(e)},this.add=function(e,t){o[e.uri]=e,(t?a:s).push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return n[e||"xmlns"]},this.mapPrefix=function(e,t){n[e||"xmlns"]=t},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);i[n]=this.byUri(t),r&&r.logUsed(e)},this.getUsed=function(e){var t=this;return[].concat(a,s).filter(function(e){return e=t.getNSKey(e),i[e]})}}function Se(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Ce(e){return h(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Re(e,t){return t.isGeneric?P({localName:t.ns.localName},e):P({localName:(n=t.ns.localName,se(t=t.$pkg)?(t=n).charAt(0).toLowerCase()+t.slice(1):n)},e);var n}var De={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Ne={"<":"lt",">":"gt","&":"amp"};function Me(e,t,n){return(e=h(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function Te(e){this.tagName=e}function Ae(){}function Be(e){this.tagName=e}function Ie(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Le(e,t){Ie.call(this,e,t)}function $e(){this.value="",this.write=function(e){this.value+=e}}function Ve(t,e){var n=[""];this.append=function(e){return t.write(e),this},this.appendNewLine=function(){return e&&t.write("\n"),this},this.appendIndent=function(){return e&&t.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function ze(o){return o=P({format:!1,preamble:!0},o||{}),{toXML:function(e,t){var n=t||new $e,r=new Ve(n,o.format);if(o.preamble&&r.append('\n'),(new Ie).build(e).serializeTo(r),!t)return n.value}}}function Ue(e,t){q.call(this,e,t)}Te.prototype.build=function(e){return this.element=e,this},Te.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()},Ae.prototype.serializeValue=Ae.prototype.serializeTo=function(e){e.append(this.escape?Me(this.value,ke,Ne):this.value)},Ae.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(ke)&&(this.escape=!0),this},Se(Be,Ae),Be.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()},Ie.prototype.build=function(e){var n,t=(this.element=e).$descriptor,r=this.propertyDescriptor,o=t.isGeneric,i=o?this.parseGeneric(e):this.parseNsAttributes(e);return this.ns=r?this.nsPropertyTagName(r):this.nsTagName(t),this.tagName=this.addTagName(this.ns),o||(o=v((n=e).$descriptor.properties,function(e){var t=e.name;if(!e.isVirtual&&d(n,t)){t=n[t];return t!==e.default?null!==t&&(!e.isMany||t.length):void 0}}),this.parseAttributes(v(o,function(e){return e.isAttr})),this.parseContainments(v(o,function(e){return!e.isAttr}))),this.parseGenericAttributes(e,i),this},Ie.prototype.nsTagName=function(e){return Re(this.logNamespaceUsed(e.ns),e)},Ie.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return P({localName:e.ns.localName},t)},Ie.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ie.prototype.nsAttributeName=function(e){var t=h(e)?$(e):e.ns;if(e.inherited)return{localName:t.localName};e=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(e),this.isLocalNs(e)?{localName:t.localName}:P({localName:t.localName},e)},Ie.prototype.parseGeneric=function(n){var r=this,o=this.body,i=[];return g(n,function(e,t){"$body"===t?o.push((new Ae).build({type:"String"},e)):"$children"===t?g(e,function(e){o.push(new Ie(r).build(e))}):0!==t.indexOf("$")&&r.parseNsAttribute(n,t,e)&&i.push({name:t,value:e})}),i},Ie.prototype.parseNsAttribute=function(e,t,n){var r,o=e.$model,e=$(t);if("xmlns"===e.prefix&&(r={prefix:e.localName,uri:n}),!(r=!e.prefix&&"xmlns"===e.localName?{uri:n}:r))return{name:t,value:n};o&&o.getPackage(n)?this.logNamespace(r,!0,!0):(r=this.logNamespaceUsed(r,!0),this.getNamespaces().logUsed(r))},Ie.prototype.parseNsAttributes=function(n,e){var r=this,t=n.$attrs,o=[];return g(t,function(e,t){e=r.parseNsAttribute(n,t,e);e&&o.push(e)}),o},Ie.prototype.parseGenericAttributes=function(n,e){var r=this;g(e,function(t){if(t.name!==ue)try{r.addAttribute(r.nsAttributeName(t.name),t.value)}catch(e){console.warn("missing namespace information for ",t.name,"=",t.value,"on",n,e)}})},Ie.prototype.parseContainments=function(e){var i=this,a=this.body,s=this.element;g(e,function(n){var r,o,e=s.get(n.name),t=n.isReference;n.isMany||(e=[e]),n.isBody?a.push((new Ae).build(n,e[0])):L(n.type)?g(e,function(e){a.push(new Be(i.addTagName(i.nsPropertyTagName(n))).build(n,e))}):t?g(e,function(e){a.push(new Te(i.addTagName(i.nsPropertyTagName(n))).build(e))}):(r=fe(n),o="property"===le(n),g(e,function(e){var t=r?new Le(i,n):o?new Ie(i,n):new Ie(i);a.push(t.build(e))}))})},Ie.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent;return t||(n=n&&n.getNamespaces(),e||!n?this.namespaces=t=new Pe(n):t=n),t},Ie.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),o=e.uri,i=e.prefix;return r.byUri(o)&&!n||r.add(e,t),r.mapPrefix(i,o),e},Ie.prototype.logNamespaceUsed=function(e,t){var n,r,o=this.element.$model,i=this.getNamespaces(t),a=e.prefix,t=e.uri;if(!a&&!t)return{localName:e.localName};if(o=ce[a]||o&&(o.getPackage(a)||{}).uri,!(t=t||o||i.uriByPrefix(a)))throw new Error("no namespace uri given for prefix <"+a+">");if(!(e=i.byUri(t))){for(n=a,r=1;i.uriByPrefix(n);)n=a+"_"+r++;e=this.logNamespace({prefix:n,uri:t},o===t)}return a&&i.mapPrefix(a,t),e},Ie.prototype.parseAttributes=function(e){var r=this,o=this.element;g(e,function(e){var t,n=o.get(e.name);e.isReference&&(n=e.isMany?(t=[],g(n,function(e){t.push(e.id)}),t.join(" ")):n.id),r.addAttribute(r.nsAttributeName(e),n)})},Ie.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Ce(e)},Ie.prototype.addAttribute=function(e,t){var n=this.attrs;h(t)&&(t=Me(t,Ee,De)),n.push({name:e,value:t})},Ie.prototype.serializeAttributes=function(t){var e=this.attrs,n=this.namespaces;g(e=n?n.getUsed().filter(function(e){return"xml"!==e.prefix}).map(function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}).concat(e):e,function(e){t.append(" ").append(Ce(e.name)).append('="').append(e.value).append('"')})},Ie.prototype.serializeTo=function(t){var e=this.body[0],n=e&&e.constructor!==Ae;t.appendIndent().append("<"+this.tagName),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),g(this.body,function(e){e.serializeTo(t)}),n&&t.unindent().appendIndent(),t.append("")),t.appendNewLine()},Se(Le,Ie),Le.prototype.parseNsAttributes=function(e){var t=Ie.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);e=e.$model.getPackage(r.uri),e=e.xml&&e.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(ue),(r.prefix?r.prefix+":":"")+e+n.ns.localName),t},Le.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},(Ue.prototype=Object.create(q.prototype)).fromXML=function(e,t,n){h(t)||(n=t,t="dmn:Definitions");n=new je(P({model:this,lax:!0},n)),t=n.handler(t);return n.fromXML(e,t)},Ue.prototype.toXML=function(n,e){var r=new ze(e);return new Promise(function(e,t){try{return e({xml:r.toXML(n)})}catch(e){return t(e)}})};var Fe={dc:{name:"DC",prefix:"dc",uri:"http://www.omg.org/spec/DMN/20180521/DC/",types:[{name:"Dimension",properties:[{name:"width",isAttr:!0,type:"Real"},{name:"height",isAttr:!0,type:"Real"}]},{name:"Bounds",properties:[{name:"height",isAttr:!0,type:"Real"},{name:"width",isAttr:!0,type:"Real"},{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Point",properties:[{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Color",properties:[{name:"red",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"green",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"blue",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"}]}],associations:[],enumerations:[{name:"AlignmentKind",literalValues:[{name:"start"},{name:"center"},{name:"end"}]}]},di:{name:"DI",prefix:"di",uri:"http://www.omg.org/spec/DMN/20180521/DI/",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"style",isReference:!0,type:"Style",xml:{serialize:"property"}},{name:"sharedStyle",isReference:!0,isVirtual:!0,type:"Style"}]},{name:"Diagram",superClass:["DiagramElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"}]},{name:"Shape",isAbstract:!0,properties:[{name:"bounds",type:"dc:Bounds"}],superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,properties:[{name:"waypoint",type:"dc:Point",isMany:!0,xml:{serialize:"property"}}],superClass:["DiagramElement"]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],enumerations:[],xml:{tagAlias:"lowerCase"}},dmn:{name:"DMN",prefix:"dmn",uri:"https://www.omg.org/spec/DMN/20191111/MODEL/",types:[{name:"AuthorityRequirement",superClass:["DMNElement"],properties:[{name:"requiredAuthority",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ItemDefinition",superClass:["NamedElement"],properties:[{name:"typeRef",type:"String"},{name:"allowedValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"typeLanguage",type:"String",isAttr:!0},{name:"itemComponent",type:"ItemDefinition",isMany:!0,xml:{serialize:"property"}},{name:"functionItem",type:"FunctionItem"},{name:"isCollection",isAttr:!0,type:"Boolean"}]},{name:"Definitions",superClass:["NamedElement"],properties:[{name:"import",type:"Import",isMany:!0},{name:"itemDefinition",type:"ItemDefinition",isMany:!0},{name:"drgElement",type:"DRGElement",isMany:!0},{name:"artifact",type:"Artifact",isMany:!0},{name:"elementCollection",type:"ElementCollection",isMany:!0},{name:"businessContextElement",type:"BusinessContextElement",isMany:!0},{name:"namespace",type:"String",isAttr:!0},{name:"expressionLanguage",type:"String",isAttr:!0},{name:"typeLanguage",type:"String",isAttr:!0},{name:"exporter",isAttr:!0,type:"String"},{name:"exporterVersion",isAttr:!0,type:"String"},{name:"dmnDI",type:"dmndi:DMNDI"}]},{name:"KnowledgeSource",superClass:["DRGElement"],properties:[{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"type",type:"String"},{name:"owner",type:"DMNElementReference",xml:{serialize:"property"}},{name:"locationURI",type:"String",isAttr:!0}]},{name:"DecisionRule",superClass:["DMNElement"],properties:[{name:"inputEntry",type:"UnaryTests",isMany:!0,xml:{serialize:"property"}},{name:"outputEntry",type:"LiteralExpression",isMany:!0,xml:{serialize:"property"}},{name:"annotationEntry",type:"RuleAnnotation",isMany:!0,xml:{serialize:"property"}}]},{name:"Expression",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"InformationItem",superClass:["NamedElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"Decision",superClass:["DRGElement"],properties:[{name:"question",type:"String",xml:{serialize:"property"}},{name:"allowedAnswers",type:"String",xml:{serialize:"property"}},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"informationRequirement",type:"InformationRequirement",isMany:!0},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"supportedObjective",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"impactedPerformanceIndicator",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionMaker",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionOwner",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"usingProcess",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"usingTask",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"decisionLogic",type:"Expression"}]},{name:"Invocation",superClass:["Expression"],properties:[{name:"calledFunction",type:"Expression"},{name:"binding",type:"Binding",isMany:!0}]},{name:"OrganisationalUnit",superClass:["BusinessContextElement"],properties:[{name:"decisionMade",type:"Decision",isReference:!0,isMany:!0},{name:"decisionOwned",type:"Decision",isReference:!0,isMany:!0}]},{name:"Import",superClass:["NamedElement"],properties:[{name:"importType",type:"String",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0},{name:"namespace",type:"String",isAttr:!0}]},{name:"InformationRequirement",superClass:["DMNElement"],properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ElementCollection",superClass:["NamedElement"],properties:[{name:"drgElement",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"DRGElement",isAbstract:!0,superClass:["NamedElement"],properties:[]},{name:"InputData",superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"DMNElement",isAbstract:!0,properties:[{name:"description",type:"String"},{name:"extensionElements",type:"ExtensionElements"},{name:"id",type:"String",isAttr:!0,isId:!0},{name:"extensionAttribute",type:"ExtensionAttribute",isMany:!0},{name:"label",isAttr:!0,type:"String"}]},{name:"InputClause",superClass:["DMNElement"],properties:[{name:"inputExpression",type:"LiteralExpression",xml:{serialize:"property"}},{name:"inputValues",type:"UnaryTests",xml:{serialize:"property"}}]},{name:"DecisionTable",superClass:["Expression"],properties:[{name:"input",type:"InputClause",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"OutputClause",isMany:!0,xml:{serialize:"property"}},{name:"annotation",type:"RuleAnnotationClause",isMany:!0,xml:{serialize:"property"}},{name:"rule",type:"DecisionRule",isMany:!0,xml:{serialize:"property"}},{name:"hitPolicy",type:"HitPolicy",isAttr:!0,default:"UNIQUE"},{name:"aggregation",type:"BuiltinAggregator",isAttr:!0},{name:"preferredOrientation",type:"DecisionTableOrientation",isAttr:!0},{name:"outputLabel",isAttr:!0,type:"String"}]},{name:"LiteralExpression",superClass:["Expression"],properties:[{name:"expressionLanguage",type:"String",isAttr:!0},{name:"text",type:"String"},{name:"importedValues",type:"ImportedValues"}]},{name:"Binding",properties:[{name:"parameter",type:"InformationItem",xml:{serialize:"property"}},{name:"bindingFormula",type:"Expression"}]},{name:"KnowledgeRequirement",superClass:["DMNElement"],properties:[{name:"requiredKnowledge",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"BusinessKnowledgeModel",superClass:["Invocable"],properties:[{name:"encapsulatedLogic",type:"FunctionDefinition",xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0}]},{name:"BusinessContextElement",isAbstract:!0,superClass:["NamedElement"],properties:[{name:"URI",type:"String",isAttr:!0}]},{name:"PerformanceIndicator",superClass:["BusinessContextElement"],properties:[{name:"impactingDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"FunctionDefinition",superClass:["Expression"],properties:[{name:"formalParameter",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"body",type:"Expression"},{name:"kind",type:"FunctionKind",isAttr:!0}]},{name:"Context",superClass:["Expression"],properties:[{name:"contextEntry",type:"ContextEntry",isMany:!0}]},{name:"ContextEntry",superClass:["DMNElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"value",type:"Expression"}]},{name:"List",superClass:["Expression"],properties:[{name:"elements",isMany:!0,type:"Expression"}]},{name:"Relation",superClass:["Expression"],properties:[{name:"column",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"row",type:"List",isMany:!0,xml:{serialize:"property"}}]},{name:"OutputClause",superClass:["DMNElement"],properties:[{name:"outputValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"defaultOutputEntry",type:"LiteralExpression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"typeRef",isAttr:!0,type:"String"}]},{name:"UnaryTests",superClass:["Expression"],properties:[{name:"text",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"NamedElement",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ImportedValues",superClass:["Import"],properties:[{name:"importedElement",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"DecisionService",superClass:["Invocable"],properties:[{name:"outputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"encapsulatedDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputData",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"ExtensionElements",properties:[{name:"values",type:"Element",isMany:!0}]},{name:"ExtensionAttribute",properties:[{name:"value",type:"Element"},{name:"valueRef",type:"Element",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Element",isAbstract:!0,properties:[{name:"extensionAttribute",type:"ExtensionAttribute",isAttr:!0,isReference:!0},{name:"elements",type:"ExtensionElements",isAttr:!0,isReference:!0}]},{name:"Artifact",isAbstract:!0,superClass:["DMNElement"],properties:[]},{name:"Association",superClass:["Artifact"],properties:[{name:"sourceRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"targetRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"associationDirection",type:"AssociationDirection",isAttr:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",isAttr:!0,type:"String",default:"text/plain"}]},{name:"RuleAnnotationClause",properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"RuleAnnotation",properties:[{name:"text",type:"String"}]},{name:"Invocable",isAbstract:!0,superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"Group",superClass:["Artifact"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"FunctionItem",superClass:["DMNElement"],properties:[{name:"parameters",isMany:!0,type:"InformationItem",xml:{serialize:"property"}},{name:"outputTypeRef",isAttr:!0,type:"String"}]},{name:"DMNElementReference",properties:[{isAttr:!0,name:"href",type:"String"}]}],enumerations:[{name:"HitPolicy",literalValues:[{name:"UNIQUE"},{name:"FIRST"},{name:"PRIORITY"},{name:"ANY"},{name:"COLLECT"},{name:"RULE ORDER"},{name:"OUTPUT ORDER"}]},{name:"BuiltinAggregator",literalValues:[{name:"SUM"},{name:"COUNT"},{name:"MIN"},{name:"MAX"}]},{name:"DecisionTableOrientation",literalValues:[{name:"Rule-as-Row"},{name:"Rule-as-Column"},{name:"CrossTable"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"FunctionKind",literalValues:[{name:"FEEL"},{name:"Java"},{name:"PMML"}]}],associations:[],xml:{tagAlias:"lowerCase"}},dmndi:{name:"DMNDI",prefix:"dmndi",uri:"https://www.omg.org/spec/DMN/20191111/DMNDI/",types:[{name:"DMNDI",properties:[{name:"diagrams",type:"DMNDiagram",isMany:!0},{name:"styles",type:"DMNStyle",isMany:!0}]},{name:"DMNStyle",superClass:["di:Style"],properties:[{name:"fillColor",type:"dc:Color",isAttr:!0},{name:"strokeColor",type:"dc:Color",isAttr:!0},{name:"fontColor",type:"dc:Color",isAttr:!0},{name:"fontSize",isAttr:!0,type:"Real"},{name:"fontFamily",isAttr:!0,type:"String"},{name:"fontItalic",isAttr:!0,type:"Boolean"},{name:"fontBold",isAttr:!0,type:"Boolean"},{name:"fontUnderline",isAttr:!0,type:"Boolean"},{name:"fontStrikeThrough",isAttr:!0,type:"Boolean"},{name:"labelHorizontalAlignment",type:"dc:AlignmentKind",isAttr:!0},{name:"labelVerticalAlignment",type:"dc:AlignmentKind",isAttr:!0}]},{name:"DMNDiagram",superClass:["di:Diagram"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"size",type:"Size"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"diagramElements",type:"DMNDiagramElement",isMany:!0}]},{name:"DMNDiagramElement",isAbstract:!0,superClass:["di:DiagramElement"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"label",type:"DMNLabel"}]},{name:"DMNLabel",superClass:["di:Shape"],properties:[{name:"text",type:"Text"}]},{name:"DMNShape",superClass:["di:Shape","DMNDiagramElement"],properties:[{name:"isListedInputData",isAttr:!0,type:"Boolean"},{name:"decisionServiceDividerLine",type:"DMNDecisionServiceDividerLine"},{name:"isCollapsed",isAttr:!0,type:"Boolean"}]},{name:"DMNEdge",superClass:["di:Edge","DMNDiagramElement"],properties:[{name:"sourceElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0},{name:"targetElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0}]},{name:"DMNDecisionServiceDividerLine",superClass:["di:Edge"]},{name:"Text",properties:[{name:"text",isBody:!0,type:"String"}]},{name:"Size",superClass:["dc:Dimension"]}],associations:[],enumerations:[]},biodi:{name:"bpmn.io DI for DMN",uri:"http://bpmn.io/schema/dmn/biodi/2.0",prefix:"biodi",xml:{tagAlias:"lowerCase"},types:[{name:"DecisionTable",isAbstract:!0,extends:["dmn:DecisionTable"],properties:[{name:"annotationsWidth",isAttr:!0,type:"Integer"}]},{name:"OutputClause",isAbstract:!0,extends:["dmn:OutputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]},{name:"InputClause",isAbstract:!0,extends:["dmn:InputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]}]}};function Ge(e,t){return new Ue(P({},Fe,e),t)}var qe=Object.prototype.toString,We=Object.prototype.hasOwnProperty;function He(e,t){var n;if(void 0!==e){var r,o,i="[object Array]"===qe.call(e)?Xe:Ke;for(r in e)if(o=r,We.call(e,o)&&!1===t(n=e[r],i(r)))return n}}function Ke(e){return e}function Xe(e){return Number(e)}function Ye(e){for(var n=e.style,t=arguments.length,r=Array(1
a',yt=!Cr.getElementsByTagName("link").length,Cr=void 0);var mt={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:yt?[1,"X
","
"]:[0,"",""]};function vt(e,t){return(t=t||document).querySelector(e)}function gt(e){e.parentNode&&e.parentNode.removeChild(e)}function bt(t){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var e=arguments.length;if(!(1<=e&&p(arguments[e-1])))return t.apply(this,arguments);var n=arguments[e-1];console.warn(new Error("Passing callbacks to "+t.name.replace("bound ","")+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));e=Array.prototype.slice.call(arguments,0,-1);t.apply(this,e).then(function(e){var t=Object.keys(e)[0];return n(null,e[t])},function(e){return n(e,e.warnings)})}}function wt(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function _t(t){for(var e=1;ee.length)&&(t=e.length);for(var n=0,r=new Array(t);n",""],mt.option=mt.optgroup=[1,'"],mt.thead=mt.tbody=mt.colgroup=mt.caption=mt.tfoot=[1,"","
"],mt.polyline=mt.ellipse=mt.polygon=mt.circle=mt.text=mt.line=mt.path=mt.rect=mt.g=[1,'',""];var Pt={width:"100%",height:"100%",position:"relative"},St=function(){function n(){var e=this,t=0"!==e.message)return null;t=-1!==t.indexOf('"http://www.omg.org/spec/DMN/20151101/dmn.xsd"')?"1.1":-1!==t.indexOf('"http://www.omg.org/spec/DMN/20180521/MODEL/"')&&"1.2";return t?(e=new Error("unsupported DMN "+t+" file detected; only DMN 1.3 files can be opened"),console.error("Cannot open what looks like a DMN "+t+" diagram. Please refer to https://bpmn.io/l/dmn-compatibility.html to learn how to make the toolkit compatible with older DMN files",e),e):null}(e,r)||(t=e,(n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(t.message))?(t.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid DMN 1.3 diagram file"+n[2],t):null)||e,u._emit("import.parse.complete",l({error:e,warnings:o})),u._emit("import.done",{error:e,warnings:o}),e.warnings=o,a(e)})}).catch(function(e){return u._emit("import.done",{error:e,warnings:[]}),e.warnings=[],a(e)})});function l(e){var t=u._eventBus.createEvent(e);return Object.defineProperty(t,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete is deprecated and will be removed in future library versions")),{warnings:e.warnings,references:e.references,elementsById:e.elementsById}}}),t}}},{key:"getDefinitions",value:function(){return this._definitions}},{key:"getActiveView",value:function(){return this._activeView}},{key:"getActiveViewer",value:function(){var e=this.getActiveView();return e&&this._getViewer(e)}},{key:"getView",value:function(t){return this._views.filter(function(e){return e.element===t})[0]}},{key:"getViews",value:function(){return this._views}},{key:"saveXML",value:function(e){var r=this;e=e||{};var o=this._definitions;return new Promise(function(t,n){o?(o=r._emit("saveXML.start",{definitions:o})||o,r._moddle.toXML(o,e).then(function(e){var e=e.xml;return{xml:e=r._emit("saveXML.serialized",{xml:e})||e}}).catch(function(e){return{error:e}}).then(function(e){r._emit("saveXML.done",e),e.error?n(e.error):t({xml:e.xml})})):n(new Error("no definitions loaded"))})}},{key:"on",value:function(){var e;(e=this._eventBus).on.apply(e,arguments)}},{key:"off",value:function(){var e;(e=this._eventBus).off.apply(e,arguments)}},{key:"once",value:function(){var e;(e=this._eventBus).once.apply(e,arguments)}},{key:"attachTo",value:function(e){(e="string"==typeof(e=e.get&&e.constructor.prototype.jquery?e.get(0):e)?vt(e):e).appendChild(this._container),this._emit("attach",{})}},{key:"detach",value:function(){this._emit("detach",{}),gt(this._container)}},{key:"destroy",value:function(){var t=this;Object.keys(this._viewers).forEach(function(e){Nt(t._viewers[e],"destroy")}),gt(this._container)}},{key:"_init",value:function(e){this._options=e,this._moddle=this._createModdle(e),this._viewers={},this._views=[];var t=dt('
'),n=P({},Pt,e);P(t.style,{width:Ct(n.width),height:Ct(n.height),position:n.position}),this._container=t,e.container&&this.attachTo(e.container)}},{key:"_clear",value:function(){return this._switchView(null)}},{key:"open",value:function(e){return this._switchView(e)}},{key:"_setDefinitions",value:function(e){this._definitions=e,this._updateViews()}},{key:"_updateViews",value:function(){var e=this._definitions;if(!e)return this._views=[],void this._switchView(null);var t,n=this._getViewProviders(),r=[e].concat(xt(e.drgElement||[])),o=this._views,i=[],a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ot(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,t=function(){};return{s:t,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}(r);try{for(a.s();!(t=a.n()).done;){var s,c=t.value,u=m(n,function(e){return"string"==typeof e.opens?e.opens===c.$type:e.opens(c)});u&&(s={element:c,id:c.id,name:c.name,type:u.id},i.push(s))}}catch(e){a.e(e)}finally{a.f()}var l,f=this._activeView;!f||(l=m(i,function(e){return Rt(f,e)})||this._getInitialView(i))?(e=!Rt(f,l)||Dt(f,l),r=o.length!==i.length||!_(i,function(t){return m(o,function(e){return Rt(e,t)&&!Dt(e,t)})}),this._activeView=l,this._views=i,(e||r)&&this._viewsChanged()):this._switchView(null)}},{key:"_getInitialView",value:function(e,t){var n;return(n=t?m(e,function(e){return Rt(e,t)})||m(e,function(e){return e.type===t}):n)||e[0]}},{key:"_switchView",value:function(s){var c=this;return new Promise(function(n,r){function t(e,t){c._viewsChanged(),e?r(e):n(t)}var e,o=c.getActiveView(),i=s&&c._getViewer(s),a=s&&s.element;if(o&&(e=c._getViewer(o))!==i&&(Nt(e,"clear"),e.detach()),c._activeView=s,i)return e!==i&&i.attachTo(c._container),c._emit("import.render.start",{view:s,element:a}),void i.open(a).then(function(e){c._emit("import.render.complete",{view:s,error:null,warnings:e.warnings}),t(null,e)}).catch(function(e){c._emit("import.render.complete",{view:s,error:e,warnings:e.warnings}),t(e,null)});t()})}},{key:"_getViewer",value:function(e){var t=e.type,n=this._viewers[t];return n||(n=this._viewers[t]=this._createViewer(e.type),this._emit("viewer.created",{type:t,viewer:n})),n}},{key:"_createViewer",value:function(t){var e=m(this._getViewProviders(),function(e){return e.id===t});if(!e)throw new Error("no provider for view type <"+t+">");var n=e.constructor,e=this._options[t]||{};return new n(_t(_t(_t({},this._options.common||{}),e),{},{additionalModules:[].concat(xt(e.additionalModules||[]),[{_parent:["value",this],moddle:["value",this._moddle]}])}))}},{key:"_emit",value:function(){var e;return(e=this._eventBus).fire.apply(e,arguments)}},{key:"_createModdle",value:function(e){return new Ge(e.moddleExtensions)}},{key:"_getViewProviders",value:function(){return[]}}])&&Et(e.prototype,t),r&&Et(e,r),Object.defineProperty(e,"prototype",{writable:!1}),n}();function Ct(e){return e+(f(e)?"px":"")}function Rt(e,t){return u(e)?!!u(t)&&(e.element===t.element||e.id===t.id):!u(t)}function Dt(e,t){return!e||!t||e.name!==t.name}function Nt(e,t){p(e[t])&&e[t]()}var Mt=/^class /;function Tt(e){return"[object Array]"===Object.prototype.toString.call(e)}function At(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Bt(){var e=Array.prototype.slice.call(arguments),t=(e=1===e.length&&Tt(e[0])?e[0]:e).pop();return t.$inject=e,t}var It=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Lt=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,$t=/\/\*([^*]*)\*\//m;function Vt(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');e=e.toString().match(Mt.test(e.toString())?It:Lt);if(!e)return[];e=e[1]||e[2];return e&&e.split(",").map(function(e){var t=e.match($t);return(t&&t[1]||e).trim()})||[]}function zt(e,o){o=o||{get:function(e,t){if(i.push(e),!1===t)return null;throw s('No provider for "'+e+'"!')}};var i=[],p=this._providers=Object.create(o._providers||null),a=this._instances=Object.create(null),h=a.injector=this,s=function(e){var t=i.join(" -> ");return i.length=0,new Error(t?e+" (Resolving: "+t+")":e)};function c(e,t){if(!p[e]&&-1!==e.indexOf(".")){for(var n=e.split("."),r=c(n.shift());n.length;)r=r[n.shift()];return r}if(At(a,e))return a[e];if(At(p,e)){if(-1!==i.indexOf(e))throw i.push(e),s("Cannot resolve circular dependency!");return i.push(e),a[e]=p[e][0](p[e][1]),i.pop(),a[e]}return o.get(e,t)}function r(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Tt(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=Bt(e.slice())}return{fn:e,dependencies:(e.$inject||Vt(e)).map(function(e){return At(t,e)?t[e]:c(e)})}}function t(e){var t=r(e),e=t.fn,t=t.dependencies;return new(Function.prototype.bind.apply(e,[null].concat(t)))}function n(e,t,n){e=r(e,n),n=e.fn,e=e.dependencies;return n.apply(t,e)}function u(e,t){if(t&&t.length){var n,r,o,i,a,s=Object.create(null),c=Object.create(null),u=[],l=[],f=[];for(a in p)n=p[a],-1!==t.indexOf(a)&&("private"===n[2]?-1===(r=u.indexOf(n[3]))?(i=function(t){return Bt(function(e){return t.get(e)})}(o=n[3].createChild([],t)),u.push(n[3]),l.push(o),f.push(i),s[a]=[i,a,"private",o]):s[a]=[f[r],a,"private",l[r]]:s[a]=[n[2],n[1]],c[a]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(s[a]=[n[2],n[1]],c[e]=!0)});t.forEach(function(e){if(!c[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(s)}return new zt(e,h)}var l,f,d={factory:n,type:t,value:function(e){return e}};function y(e,t){var n=e.__init__||[];return function(){n.forEach(function(e){try{"string"==typeof e?t.get(e):t.invoke(e)}catch(e){if("undefined"!=typeof AggregateError)throw new AggregateError([e],"Failed to initialize!");throw new Error("Failed to initialize! "+e.message)}})}}function m(r){var e=r.__exports__;if(e){var t=r.__modules__,n=Object.keys(r).reduce(function(e,t){return"__exports__"!==t&&"__modules__"!==t&&"__init__"!==t&&"__depends__"!==t&&(e[t]=r[t]),e},Object.create(null)),o=u((t||[]).concat(n)),i=Bt(function(e){return o.get(e)});e.forEach(function(e){p[e]=[i,e,"private",o]});e=(r.__init__||[]).slice();return e.unshift(function(){o.init()}),y(r=Object.assign({},r,{__init__:e}),o)}return Object.keys(r).forEach(function(e){var t,n;"__init__"!==e&&"__depends__"!==e&&("private"!==r[e][2]?(t=r[e][0],n=r[e][1],p[e]=[d[t],function(e,t){"value"!==e&&Tt(t)&&(t=Bt(t.slice()));return t}(t,n),t]):p[e]=r[e])}),y(r,h)}function v(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(v,e)).indexOf(t)?e:e.concat(t)}this.get=c,this.invoke=n,this.instantiate=t,this.createChild=u,this.init=(l=e.reduce(v,[]).map(m),f=!1,function(){f||(f=!0,l.forEach(function(e){return e()}))})}function Ut(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function Ft(e,t){var o=this;e.on(["render.shape","render.connection"],t=t||1e3,function(e,t){var n=e.type,r=t.element,e=t.gfx,t=t.attrs;if(o.canRender(r))return"render.shape"===n?o.drawShape(e,r,t):o.drawConnection(e,r,t)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(e,t){if(o.canRender(t))return"render.getShapePath"===e.type?o.getShapePath(t):o.getConnectionPath(t)})}function Gt(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function qt(e,t){return Gt(t,e),e}Ft.prototype.canRender=function(){},Ft.prototype.drawShape=function(){},Ft.prototype.drawConnection=function(){},Ft.prototype.getShapePath=function(){},Ft.prototype.getConnectionPath=function(){};var Wt=2,Ht={"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":Wt,"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":Wt,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Kt(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=Ht[r];o?(o===Wt&&"number"==typeof n&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function Xt(e,t,n){if("string"==typeof t){if(void 0===n)return r=e,Ht[o=t]?r.style[o]:r.getAttributeNS(null,o);Kt(e,t,n)}else!function(e,t){for(var n,r=Object.keys(t),o=0;n=r[o];o++)Kt(e,n,t[n])}(e,t);var r,o;return e}function Yt(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n"+e+"",t=!0);var n=(n=e,(e=new DOMParser).async=!1,e.parseFromString(n,"text/xml"));if(!t)return n;for(var r=document.createDocumentFragment(),o=n.firstChild;o.firstChild;)r.appendChild(o.firstChild);return r}function cn(e,t){var n="<"===e.charAt(0)?(n=sn(e).firstChild,document.importNode(n,!0)):document.createElementNS(on.svg,e);return t&&Xt(n,t),n}var un=cn("svg");function ln(e,t){for(var n,r=Object.keys(t),o=0;n=r[o];o++)e[n]=t[n];return e}var fn=/([&<>]{1})/g,pn=/([\n\r"]{1})/g,hn={"&":"&","<":"<",">":">",'"':"'"};function dn(e,t){return e.replace(t,function(e,t){return hn[t]||t})}function yn(e,t){var n=sn(t);if(rn(e),t){"#document-fragment"!==n.nodeName&&(n=n.documentElement);for(var r=(n=n.childNodes,Array.prototype.slice.call(n)),o=0;o"),r=0,o=(s=t.childNodes).length;r")}else n.push("/>");break;case 8:n.push("\x3c!--",dn(t.nodeValue,fn),"--\x3e");break;case 4:n.push("");break;default:throw new Error("unable to handle node "+t.nodeType)}return n}(t,n),t=t.nextSibling;return n.join("")}function vn(e,t){var n,r,o;for(e.clear(),n=0;o=t[n];n++)e.appendItem((r=e,(o=o)instanceof SVGMatrix?r.createSVGTransformFromMatrix(o):o))}function gn(e,t){e=e.transform.baseVal;return t&&vn(e,t=!Array.isArray(t)?[t]:t),e.consolidate()}function bn(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function wn(e){for(var t,n="",r=0;t=e[r];r++)n+=t.x+","+t.y+" ";return n}function _n(e,t){var n=cn("polyline");return Xt(n,{points:wn(e)}),t&&Xt(n,t),n}function xn(e,o){var i,a,s,c;return o=!!o,g(e=!l(e)?[e]:e,function(e){var t=e,n=(t=e.waypoints&&!o?xn(e.waypoints,!0):t).x,r=t.y,e=t.height||0,t=t.width||0;(n already created at index <"+t+">");return n.group},Dn.prototype._getChildIndex=function(n){return b(this._layers,function(e,t){return t.visible&&n>=t.index&&e++,e},0)},Dn.prototype._createLayer=function(e,t){var n=this._getChildIndex(t=void 0===t?1:t);return{group:Cn(this._viewport,"layer-"+e,n),index:t,visible:!0}},Dn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=this._viewport,r=t.group,e=t.index;if(t.visible)return r;e=this._getChildIndex(e);return n.insertBefore(r,n.childNodes[e]||null),t.visible=!0,r},Dn.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");e=t.group;return t.visible&&(nn(e),t.visible=!1),e},Dn.prototype._removeLayer=function(e){var t=this._layers[e];t&&(delete this._layers[e],nn(t.group))},Dn.prototype.getActiveLayer=function(){var e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Dn.prototype.findRoot=function(e){if(e="string"==typeof e?this._elementRegistry.get(e):e)return(this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{}).rootElement},Dn.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},Dn.prototype._findPlaneForRoot=function(t){return m(this._planes,function(e){return e.rootElement===t})},Dn.prototype.getContainer=function(){return this._container},Dn.prototype._updateMarker=function(e,t,n){var r;e.id||(e=this._elementRegistry.get(e)),(r=this._elementRegistry._elements[e.id])&&(g([r.gfx,r.secondaryGfx],function(e){e&&(n?en(e).add(t):en(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},Dn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Dn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Dn.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),en(this.getGraphics(e)).has(t)},Dn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Dn.prototype.getRootElement=function(){var e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Dn.prototype.addRootElement=function(e){var t=this._rootsIdx++,n=(e=e||{id:"__implicitroot_"+t,children:[],isImplicit:!0}).layer="root-"+t;this._ensureValid("root",e);t=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,t),this._planes.push({rootElement:e,layer:t}),e},Dn.prototype.removeRootElement=function(t){if("string"==typeof t&&(t=this._elementRegistry.get(t)),this._findPlaneForRoot(t))return this._removeRoot(t),this._removeLayer(t.layer),this._planes=this._planes.filter(function(e){return e.rootElement!==t}),this._rootElement===t&&(this._rootElement=null),t},Dn.prototype.setRootElement=function(e,t){if(u(t))throw new Error("override not supported");if(e!==this._rootElement){if(!e)throw new Error("rootElement required");return this._findPlaneForRoot(e)||(e=this.addRootElement(e)),this._setRoot(e),e}},Dn.prototype._removeRoot=function(e){var t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},Dn.prototype._addRoot=function(e,t){var n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})},Dn.prototype._setRoot=function(e,t){var n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t=t||this._findPlaneForRoot(e).layer,this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},Dn.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");var n=Rn[e];if(!_(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},Dn.prototype._setParent=function(e,t,n){!function(e,t,n){if(e&&t){"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)}}(t.children,e,n),e.parent=t},Dn.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();var o=this._eventBus,i=this._graphicsFactory;this._ensureValid(e,t),o.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);r=i.create(e,t,r);return this._elementRegistry.add(t,r),i.update(e,t,r),o.fire(e+".added",{element:t,gfx:r}),t},Dn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Dn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Dn.prototype._removeElement=function(e,t){var n,r=this._elementRegistry,o=this._graphicsFactory,i=this._eventBus;if(e=r.get(e.id||e))return i.fire(t+".remove",{element:e}),o.remove(e),n=e.parent&&e.parent.children,o=e,!n||!o||-1!==(o=n.indexOf(o))&&n.splice(o,1),e.parent=null,i.fire(t+".removed",{element:e}),r.remove(e),e},Dn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Dn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Dn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Dn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Dn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Dn.prototype.viewbox=function(t){if(void 0===t&&this._cachedViewbox)return this._cachedViewbox;var e,n,r,o,i=this._viewport,a=this.getSize();return t?(this._changeViewbox(function(){n=Math.min(a.width/t.width,a.height/t.height);var e=this._svg.createSVGMatrix().scale(n).translate(-t.x,-t.y);gn(i,e)}),t):(e=(o=this._rootElement?this.getActiveLayer():null)&&o.getBBox()||{},o=(r=gn(i))?r.matrix:function(e,t,n,r,o,i){var a=un.createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return ln(a,e);case 6:return ln(a,{a:e,b:t,c:n,d:r,e:o,f:i})}}(),n=Pn(o.a,1e3),r=Pn(-o.e||0,1e3),o=Pn(-o.f||0,1e3),t=this._cachedViewbox={x:r?r/n:0,y:o?o/n:0,width:a.width/n,height:a.height/n,scale:n,inner:{width:e.width||0,height:e.height||0,x:e.x||0,y:e.y||0},outer:a})},Dn.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=P({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Nn(t,n)}),{x:n.e,y:n.f}},Dn.prototype.scrollToElement=function(e,t){var n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));var r=this.findRoot(e);r!==this.getRootElement()&&this.setRootElement(r),"number"==typeof(t=t||{})&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var o=xn(e),i=kn(o),a=this.viewbox(),r=this.zoom();a.y+=t.top/r,a.x+=t.left/r,a.width-=(t.right+t.left)/r,a.height-=(t.bottom+t.top)/r;var s,n=kn(a);a=o.width in ref");t=this.props[t]}var n,r,o,i;t.collection?Bn(this,t,e):(n=this,r=e,o=(t=t).inverse,i=r[t.name],Object.defineProperty(r,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(e){var t;e!==i&&(t=i,i=null,t&&n.unset(t,o,r),i=e,n.set(i,o,r))}}))},In.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return An.isExtended(n)||Bn(this,t,e),n},In.prototype.ensureBound=function(e,t){var n;n=t,Object.prototype.hasOwnProperty.call(e,n.name||n)||this.bind(e,t)},In.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},In.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Ln=In;Ln.Collection=An;var $n=new Ln({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Vn=new Ln({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),zn=new Ln({name:"attachers",collection:!0},{name:"host"}),Un=new Ln({name:"outgoing",collection:!0},{name:"source"}),Fn=new Ln({name:"incoming",collection:!0},{name:"target"});function Gn(){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)}}),$n.bind(this,"parent"),Vn.bind(this,"labels"),Un.bind(this,"outgoing"),Fn.bind(this,"incoming")}function qn(){Gn.call(this),$n.bind(this,"children"),zn.bind(this,"host"),zn.bind(this,"attachers")}function Wn(){qn.call(this)}function Hn(){qn.call(this),Vn.bind(this,"labelTarget")}function Kn(){Gn.call(this),Un.bind(this,"source"),Fn.bind(this,"target")}Ut(qn,Gn),Ut(Wn,qn),Ut(Hn,qn),Ut(Kn,Gn);var Xn={connection:Kn,shape:qn,label:Hn,root:Wn};function Yn(){this._uid=12}function Qn(e,t,n){var r=r?un.createSVGTransformFromMatrix(r):un.createSVGTransform();r.setTranslate(t,n),gn(e,r)}function Zn(e,t){this._eventBus=e,this._elementRegistry=t}function Jn(e,t,n){n=n||t.firstChild;e!==n&&t.insertBefore(e,n)}Yn.prototype.createRoot=function(e){return this.create("root",e)},Yn.prototype.createLabel=function(e){return this.create("label",e)},Yn.prototype.createShape=function(e){return this.create("shape",e)},Yn.prototype.createConnection=function(e){return this.create("connection",e)},Yn.prototype.create=function(e,t){return(t=P({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Xn[e];if(!n)throw new Error("unknown type: <"+e+">");return P(new n,t)}(e,t)},Zn.$inject=["eventBus","elementRegistry"],Zn.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=n.parentNode.childNodes[1])||(en(t=cn("g")).add("djs-children"),qt(n.parentNode,t)):t=n,t},Zn.prototype._clear=function(e){e=e.childNodes[0];return ot(e),e},Zn.prototype._createContainer=function(e,t,n,r){var o=cn("g");en(o).add("djs-group"),void 0!==n?Jn(o,t,t.childNodes[n]):qt(t,o);t=cn("g");en(t).add("djs-element"),en(t).add("djs-"+e),r&&en(t).add("djs-frame"),qt(o,t);o=cn("g");return en(o).add("djs-visual"),qt(t,o),t},Zn.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,On(t))},Zn.prototype.updateContainments=function(e){var r=this,o=this._elementRegistry;g(b(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),function(e){var t,n=e.children;n&&(t=r._getChildrenContainer(e),g(n.slice().reverse(),function(e){Jn(o.getGraphics(e).parentNode,t)}))})},Zn.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Zn.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Zn.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Zn.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Zn.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),Qn(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(r,t)}t.hidden?Xt(n,"display","none"):Xt(n,"display","block")}},Zn.prototype.remove=function(e){nn(this._elementRegistry.getGraphics(e).parentNode)};var er={__depends__:[En],__init__:["canvas"],canvas:["type",Dn],elementRegistry:["type",Tn],elementFactory:["type",Yn],eventBus:["type",R],graphicsFactory:["type",Zn]};function tr(e){var e=[{config:["value",e=e||{}]},er].concat(e.modules||[]);return(e=new zt(e=e)).init(),e}function nr(e,t){this.injector=t=t||tr(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function rr(e,t){return e(t={exports:{}},t.exports),t.exports}nr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},nr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var or=rr(function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;function n(){}n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}});function ir(e,t){e=ar(e);return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}function ar(e){return e&&e.businessObject||e}var sr=new Ln({name:"dmnElementRef",enumerable:!0},{name:"di",configurable:!0});function cr(r,e){var o=[];function i(t){try{return t.di&&function(e){if(e.gfx)throw new Error("already rendered "+e.id);return r.element(e)}(t)}catch(e){n(e.message,{element:t,error:e})}}function a(e){var t;(e=(t=e).dmnElementRef)?e.di?n("multiple DI elements defined for element",{element:e}):(sr.bind(e,"di"),e.di=t):n("no DMN element referenced in element",{element:t})}function s(e){o.push(e)}function n(e,t){r.error(e,t)}return{handleDefinitions:function(e,t){var n=e.dmnDI;if(!n)throw new Error("no dmndi:DMNDI");if(n=n.diagrams||[],t&&-1===n.indexOf(t))throw new Error("diagram not part of dmndi:DMNDI");if(!(t=!t&&n&&n.length?n[0]:t))throw new Error("no diagram to display");g((e.di=t).diagramElements,a),r.root(e),g(e.get("drgElement"),function(e){var t;i(e),t=e,g(["informationRequirement","knowledgeRequirement","authorityRequirement"],function(e){g(t[e],function(e){s(function(){i(e)})})})}),g(e.get("artifact"),function(e){var t;ir(e,"dmn:Association")?(t=e,s(function(){i(t)})):i(e)}),g(o,function(e){e()})}}}function ur(e,t,n){var r,o=e.get("drdImporter"),e=e.get("eventBus"),i=[];e.fire("import.start",{definitions:t});try{new cr({root:function(e){return o.root(e)},element:function(e,t){return o.add(e,t)},error:function(e,t){i.push({message:e,context:t})}}).handleDefinitions(t)}catch(e){r=e}e.fire("import.done",{error:r,warnings:i}),n(r,i)}var lr=rr(function(e){var s=e.exports=function(e,t){if(t=t||16,(e=void 0===e?128:e)<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),r=2;n===1/0;r*=2)n=Math.log(Math.pow(2,e/r))/Math.log(t)*r;for(var o=n-Math.floor(n),i="",r=0;r=Math.pow(2,e)?s(e,t):i};s.rack=function(r,o,i){function n(e){var t=0;do{if(10e?t.width:e},0),d=a.top;"middle"===i.vertical&&(d+=(r.height-e)/2),d-=(c||l[0].height)/4;var y=cn("text");return Xt(y,o),g(l,function(e){var t;switch(d+=c||e.height,i.horizontal){case"left":t=a.left;break;case"right":t=(s?h:f)-a.right-e.width;break;default:t=Math.max(((s?h:f)-e.width)/2+a.left,0)}var n=cn("tspan");Xt(n,{x:t,y:d}),n.textContent=e.text,qt(y,n)}),nn(p),{dimensions:{width:h,height:e},element:y}};function Or(e){var n=P({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),t=parseInt(n.fontSize,10)-1,r=P({},n,{fontSize:t},e&&e.externalStyle||{}),o=new xr({style:n});this.getExternalLabelBounds=function(e,t){t=o.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:r});return{x:Math.round(e.x+e.width/2-t.width/2),y:Math.round(e.y),width:Math.ceil(t.width),height:Math.ceil(t.height)}},this.getTextAnnotationBounds=function(e,t){t=o.getDimensions(t,{box:e,style:n,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(t.height))}},this.createText=function(e,t){return o.createText(e,t||{})},this.getDefaultStyle=function(){return n},this.getExternalStyle=function(){return r}}Or.$inject=["config.textRenderer"];var jr=/\{([^{}]+)\}/g,Er=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;it={__init__:["drdRenderer"],drdRenderer:["type",yr],textRenderer:["type",Or],pathMap:["type",function(){this.pathMap={KNOWLEDGE_SOURCE:{d:"m {mx},{my} l 0,{e.y0} c {e.x0},{e.y1} {e.x1},-{e.y2} {e.x2},-{e.y3} c {e.x3},-{e.y4} {e.x4},{e.y5} {e.x5},{e.y6} l 0,-{e.y7}z",width:100,height:65,widthElements:[29.8,48.4,67.2,12.2,19.8,30.8],heightElements:[55.3,19.7,4.2,6.7,2.3,1.6,6.2,54.6]},BUSINESS_KNOWLEDGE_MODEL:{d:"m {mx},{my} l {e.x0},-{e.y0} l {e.x1},0 l 0,{e.y1} l -{e.x2},{e.y2} l -{e.x3},0z",width:125,height:45,widthElements:[13.8,109.2,13.8,109.1],heightElements:[13.2,29.8,13.2]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",width:10,height:30,widthElements:[10],heightElements:[30]}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,r,o=this.pathMap[e],e=t.abspos?(n=t.abspos.x,t.abspos.y):(n=t.containerWidth*t.position.mx,t.containerHeight*t.position.my),i={};if(t.position){for(var a=t.containerHeight/o.height*t.yScaleFactor,s=t.containerWidth/o.width*t.xScaleFactor,c=0;c");return Xt(e,n),e}function v(e,t){qt(e,t)}this.removeHits=function(e){var t;g((t=".djs-hit",(e||document).querySelectorAll(t)),nn)},this.createDefaultHit=function(e,t){var n=e.waypoints,r=e.isFrame;return n?this.createWaypointsHit(t,n):this.createBoxHit(t,r?"stroke":"all",{width:e.width,height:e.height})},this.createWaypointsHit=function(e,t){t=_n(t);return m(t,"stroke"),v(e,t),t},this.createBoxHit=function(e,t,n){n=P({x:0,y:0},n);var r=cn("rect");return m(r,t),Xt(r,n),v(e,r),r},this.updateDefaultHit=function(e,t){var n,r=vt(".djs-hit",t);if(r)return e.waypoints?(n=r,t=e.waypoints,Xt(n,{points:wn(t)})):Xt(r,{width:e.width,height:e.height}),r},this.fire=s,this.triggerMouseEvent=function(e,t,n){var r=u[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");return s(r,t,n)},this.mouseHandler=o,this.registerEvent=p,this.unregisterEvent=h}Ir.$inject=["eventBus","elementRegistry","styles"];yt={__init__:["interactionEvents"],interactionEvents:["type",Ir]};function Lr(e,t,n){this.offset=6;var r=t.cls("djs-outline",["no-fill"]),o=this;function i(e){var t=cn("rect");return Xt(t,P({x:10,y:10,rx:3,width:100,height:100},r)),qt(e,t),t}e.on(["shape.added","shape.changed"],500,function(e){var t=e.element,n=e.gfx,e=(e=vt(".djs-outline",n))||i(n);o.updateShapeOutline(e,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,e=(e=vt(".djs-outline",n))||i(n);o.updateConnectionOutline(e,t)})}Lr.prototype.updateShapeOutline=function(e,t){Xt(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Lr.prototype.updateConnectionOutline=function(e,t){t=xn(t);Xt(e,{x:t.x-this.offset,y:t.y-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Lr.$inject=["eventBus","styles","elementRegistry"];En={__init__:["outline"],outline:["type",Lr]};function $r(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(e){e=e.element;n.deselect(e)}),e.on(["diagram.clear","root.set"],function(e){n.select(null)})}$r.$inject=["eventBus","canvas"],$r.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);-1!==n&&(e=t.slice(),t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:e,newSelection:t}))},$r.prototype.get=function(){return this._selectedElements},$r.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},$r.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();l(e)||(e=e?[e]:[]);var o=this._canvas,i=o.getRootElement();e=e.filter(function(e){e=o.findRoot(e);return i===e}),t?g(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 Vr="selected";function zr(n,e,t){this._canvas=n;var r=this;function o(e,t){n.addMarker(e,t)}function i(e,t){n.removeMarker(e,t)}this._multiSelectionBox=null,e.on("element.hover",function(e){o(e.element,"hover")}),e.on("element.out",function(e){i(e.element,"hover")}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;g(t,function(e){-1===n.indexOf(e)&&i(e,Vr)}),g(n,function(e){-1===t.indexOf(e)&&o(e,Vr)}),r._updateSelectionOutline(n)}),e.on("element.changed",function(e){t.isSelected(e.element)&&r._updateSelectionOutline(t.get())})}function Ur(e,i,a,r){e.on("create.end",500,function(e){var t=e.context,n=t.canExecute,e=t.elements,t=(t.hints||{}).autoSelect;n&&!1!==t&&(l(t)?i.select(t):i.select(e.filter(Fr)))}),e.on("connect.end",500,function(e){e=e.context.connection;e&&i.select(e)}),e.on("shape.move.end",500,function(e){var t=e.previousSelection||[],n=r.get(e.context.shape.id);m(t,function(e){return n.id===e.id})||i.select(n)}),e.on("element.click",function(e){if(Mr(e)){var t=e.element;t===a.getRootElement()&&(t=null);var n=i.isSelected(t),r=1'),{position:"absolute",width:0,height:0}),e.insertBefore(n,e.firstChild),n),this._init()}function Hr(e,t,n){Ye(e,{left:t+"px",top:n+"px"})}function Kr(e,t){e.style.display=!1===t?"none":""}function Xr(t,n){t.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(e){t.style[e+"transform"]=n})}Wr.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Wr.prototype.get=function(e){if(h(e)&&(e={id:e}),h(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?v(t.overlays,r({type:e.type})):t.overlays.slice():[]}return e.type?v(this._overlays,r({type:e.type})):e.id?this._overlays[e.id]:null},Wr.prototype.add=function(e,t,n){if(w(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=P({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},Wr.prototype.remove=function(e){e=this.get(e)||[];l(e)||(e=[e]);var n=this;g(e,function(e){var t=n._getOverlayContainer(e.element,!0);e&&(gt(e.html),gt(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),!t||-1!==(e=t.overlays.indexOf(e))&&t.overlays.splice(e,1)})},Wr.prototype.show=function(){Kr(this._overlayRoot)},Wr.prototype.hide=function(){Kr(this._overlayRoot,!1)},Wr.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ot(this._overlayRoot)},Wr.prototype._updateOverlayContainer=function(e){var t,n=e.element,r=e.html,o=n.x,i=n.y;n.waypoints&&(o=(t=xn(n)).x,i=t.y),Hr(r,o,i),Qe(e.html,"data-container-id",n.id)},Wr.prototype._updateOverlay=function(e){var t,n=e.position,r=e.htmlContainer,o=e.element,i=n.left,a=n.top;void 0!==n.right&&(t=(o.waypoints?xn(o):o).width,i=-1*n.right+t),void 0!==n.bottom&&(o=(o.waypoints?xn(o):o).height,a=-1*n.bottom+o),Hr(r,i||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Wr.prototype._createOverlayContainer=function(e){var t=dt('
');Ye(t,{position:"absolute"}),this._overlayRoot.appendChild(t);e={html:t,element:e,overlays:[]};return this._updateOverlayContainer(e),this._overlayContainers.push(e),e},Wr.prototype._updateRoot=function(e){var t=e.scale||1,t="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Xr(this._overlayRoot,t)},Wr.prototype._getOverlayContainer=function(t,e){var n=m(this._overlayContainers,function(e){return e.element===t});return n||e?n:this._createOverlayContainer(t)},Wr.prototype._addOverlay=function(e){var t,n,r=e.id,o=e.element,i=e.html;h(i=i.get&&i.constructor.prototype.jquery?i.get(0):i)&&(i=dt(i)),n=this._getOverlayContainer(o),Ye(t=dt('
'),{position:"absolute"}),t.appendChild(i),e.type&&nt(t).add("djs-overlay-"+e.type),Kr(t,this._canvas.findRoot(o)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Wr.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),o=n&&n.minZoom,i=n&&n.maxZoom,a=!0;Kr(e.htmlContainer,a=r!==this._canvas.getRootElement()||n&&(u(o)&&o>t.scale||u(i)&&io&&(r=(1/t.scale||1)*o)),Xr(i,e=u(r)?"scale("+r+","+r+")":e)},Wr.prototype._updateOverlaysVisibilty=function(t){var n=this;g(this._overlays,function(e){n._updateOverlayVisibilty(e,t)})},Wr.prototype._init=function(){var e=this._eventBus,n=this;e.on("canvas.viewbox.changing",function(e){n.hide()}),e.on("canvas.viewbox.changed",function(e){e=e.viewbox,n._updateRoot(e),n._updateOverlaysVisibilty(e),n.show()}),e.on(["shape.remove","connection.remove"],function(e){e=e.element;g(n.get({element:e}),function(e){n.remove(e.id)});var e=n._getOverlayContainer(e);e&&(gt(e.html),-1!==(e=n._overlayContainers.indexOf(e))&&n._overlayContainers.splice(e,1))}),e.on("element.changed",500,function(e){e=e.element,e=n._getOverlayContainer(e,!0);e&&(g(e.overlays,function(e){n._updateOverlay(e)}),n._updateOverlayContainer(e))}),e.on("element.marker.update",function(e){var t=n._getOverlayContainer(e.element,!0);t&&nt(t.html)[e.add?"add":"remove"](e.marker)}),e.on("root.set",function(){n._updateOverlaysVisibilty(n._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};pr={__init__:["overlays"],overlays:["type",Wr]};function Yr(e,t){this._eventBus=e,this._canvas=t,e.on("diagram.init",function(){this._init()},this),e.on("import.done",function(e){e.error||this.update()},this)}function Qr(e,n){function t(e,t){nt(n.getContainer()).toggle(e,t)}e.on("palette.create",function(){t("with-palette",!0)}),e.on("palette.changed",function(e){t("with-palette-two-column",e.twoColumn)})}Yr.$inject=["eventBus","canvas"],Yr.prototype._init=function(){var e=this._canvas,t=this._eventBus,n=e.getContainer(),e=this._container=dt(Yr.HTML_MARKUP);n.appendChild(e),this.nameElement=vt(".dmn-definitions-name",this._container),this.idElement=vt(".dmn-definitions-id",this._container),ht.bind(e,".dmn-definitions-name, .dmn-definitions-id","mousedown",function(e){e.stopPropagation()}),t.fire("definitionIdView.create",{html:e})},Yr.prototype.update=function(){var e=this._canvas.getRootElement().businessObject;this.nameElement.textContent=e.name,this.idElement.textContent=e.id},Yr.HTML_MARKUP='
',Qr.$inject=["eventBus","canvas"];it={__init__:["definitionPropertiesView","definitionPropertiesPaletteAdapter"],definitionPropertiesView:["type",Yr],definitionPropertiesPaletteAdapter:["type",Qr]};function Zr(e,t){for(var n=0;n\n \n
\n ')),t=this._overlays.add(e,{position:{top:2,left:2},html:n});!1!==this._config.enabled&&(nt(n).add("interactive"),this.bindEventListener(e,n,t))}},{key:"bindEventListener",value:function(e,t,n){var r=this,o=this._overlays,i=this._eventBus,o=o._overlayRoot;ht.bind(o,'[data-overlay-id="'+n+'"]',"click",function(){!1!==i.fire("drillDown.click",{element:e})&&r.drillDown(e)})}},{key:"drillDown",value:function(e){var t=this._injector.get("_parent",!1);if(!t)return!1;e=t.getView(e.businessObject);return!!e&&(t.open(e),!0)}}])&&Zr(e.prototype,t),n&&Zr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();yt.$inject=["injector","eventBus","overlays","config.drillDown"];var En={__depends__:[pr],__init__:["drillDown"],drillDown:["type",yt]},eo=''; /** * This file must not be changed or exchanged. * * @see http://bpmn.io/license for more information. */function to(e){return e.join(";")}var no,ro='
'+eo+'Web-based tooling for BPMN, DMN and CMMN diagrams powered by bpmn.io.
';var oo=["additionalModules","canvas"];function io(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function ao(r){for(var e=1;ee.length)&&(t=e.length);for(var n=0,r=new Array(t);n'+eo+""),t.appendChild(n),ft.bind(n,"click",function(e){no||(no=dt(ro),ht.bind(no,".backdrop","click",function(e){document.body.removeChild(no)})),document.body.appendChild(no),e.preventDefault()}),this._init(this._container,e)}or(lo,nr),lo.prototype.saveSVG=bt(function(e){var o=this;return new Promise(function(e){var t=o.get("canvas"),n=t.getDefaultLayer(),r=vt("defs",t._svg),t=function(e,t){if(void 0===t)return mn(e);try{yn(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}(n),r=r&&r.outerHTML||"",n=n.getBBox();e({svg:'\n\x3c!-- created with dmn-js / http://bpmn.io --\x3e\n\n'+r+t+""})})}),lo.prototype.getModules=function(){return this._modules},lo.prototype.destroy=function(){nr.prototype.destroy.call(this),gt(this._container)},lo.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},lo.prototype.off=function(e,t){this.get("eventBus").off(e,t)},lo.prototype._init=function(e,t){var n=t.additionalModules,r=t.canvas,o=uo(t,oo),i=t.modules||this.getModules(),n=[].concat([{drd:["value",this]}],so(i),so(n||[])),n=ao(ao({},o),{},{canvas:ao(ao({},r),{},{container:e}),modules:n});nr.call(this,n),t&&t.container&&this.attachTo(t.container)},lo.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},lo.prototype._createContainer=function(){return dt('
')},lo.prototype.open=function(e){var o=this;return new Promise(function(n,r){var t;try{return o._definitions&&o.clear(),o._definitions=e,ur(o,e,function(e,t){e?(e.warnings=t||[],r(e)):n({warnings:t||[]})})}catch(e){t=e}t?(t.warnings=t.warnings||[],r(t)):n({warnings:[]})})},lo.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach();var t=this._container;e.appendChild(t),this._emit("attach",{}),this.get("canvas").resized()},lo.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},lo.prototype._modules=[Cr,Rr,Ln,pr,it,En];var fo=/^class /;function po(e){return"[object Array]"===Object.prototype.toString.call(e)}function ho(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function yo(){var e=Array.prototype.slice.call(arguments),t=(e=1===e.length&&po(e[0])?e[0]:e).pop();return t.$inject=e,t}var mo=/constructor\s*[^(]*\(\s*([^)]*)\)/m,vo=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,go=/\/\*([^*]*)\*\//m;function bo(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(fo.test(e.toString())?mo:vo);return t&&t[1]&&t[1].split(",").map(function(e){return((t=e.match(go))?t[1]:e).trim()})||[]}function wo(e,i){i=i||{get:function(e,t){if(a.push(e),!1===t)return null;throw c('No provider for "'+e+'"!')}};function t(e){var e=(t=o(e)).fn,t=t.dependencies;return new(Function.prototype.bind.apply(e,[null].concat(t)))}function n(e,t,n){return e=o(e,n),n=e.fn,e=e.dependencies,n.apply(t,e)}var a=[],p=this._providers=Object.create(i._providers||null),s=this._instances=Object.create(null),h=s.injector=this,c=function(e){var t=a.join(" -> ");return a.length=0,new Error(t?e+" (Resolving: "+t+")":e)},r=function e(t,n){if(!p[t]&&-1!==t.indexOf(".")){for(var r=t.split("."),o=e(r.shift());r.length;)o=o[r.shift()];return o}if(ho(s,t))return s[t];if(ho(p,t)){if(-1!==a.indexOf(t))throw a.push(t),c("Cannot resolve circular dependency!");return a.push(t),s[t]=p[t][0](p[t][1]),a.pop(),s[t]}return i.get(t,n)},o=function(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!po(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=yo(e.slice())}return{fn:e,dependencies:(e.$inject||bo(e)).map(function(e){return ho(t,e)?t[e]:r(e)})}},d=function(t){return yo(function(e){return t.get(e)})},u={factory:n,type:t,value:function(e){return e}};e.forEach(function(r){function o(e,t){return t="value"!==e&&po(t)?yo(t.slice()):t}var e,t,n;r instanceof function(){var n=[];this.factory=function(e,t){return n.push([e,"factory",t]),this},this.value=function(e,t){return n.push([e,"value",t]),this},this.type=function(e,t){return n.push([e,"type",t]),this},this.forEach=function(e){n.forEach(e)}}?r.forEach(function(e){var t=e[0],n=e[1],e=e[2];p[t]=[u[n],o(n,e),n]}):"object"===y(r)&&(r.__exports__?(e=Object.keys(r).reduce(function(e,t){return"__"!==t.substring(0,2)&&(e[t]=r[t]),e},Object.create(null)),t=new wo((r.__modules__||[]).concat([e]),h),n=yo(function(e){return t.get(e)}),r.__exports__.forEach(function(e){p[e]=[n,e,"private",t]})):Object.keys(r).forEach(function(e){var t,n;"private"!==r[e][2]?(t=r[e][0],n=r[e][1],p[e]=[u[t],o(t,n),t]):p[e]=r[e]}))}),this.get=r,this.invoke=n,this.instantiate=t,this.createChild=function(e,t){if(t&&t.length){var n,r,o,i,a,s=Object.create(null),c=Object.create(null),u=[],l=[],f=[];for(a in p)n=p[a],-1!==t.indexOf(a)&&("private"===n[2]?-1===(r=u.indexOf(n[3]))?(o=n[3].createChild([],t),i=d(o),u.push(n[3]),l.push(o),f.push(i),s[a]=[i,a,"private",o]):s[a]=[f[r],a,"private",l[r]]:s[a]=[n[2],n[1]],c[a]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(s[a]=[n[2],n[1]],c[e]=!0)});t.forEach(function(e){if(!c[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(s)}return new wo(e,h)}}function _o(e){return(_o="function"==typeof Symbol&&"symbol"===y(Symbol.iterator)?function(e){return y(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":y(e)})(e)}function xo(e,t){return!t||"object"!==_o(t)&&"function"!=typeof t?jo(e):t}function Oo(e){return(Oo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function jo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eo(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ko(e,t)}function ko(e,t){return(ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Po(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function So(e){Po(this,So),P(this,e),Ro(this,"businessObject",{writable:!0})}var Co={root:function(){function t(e){return Po(this,t),Ro(jo(e=xo(this,Oo(t).call(this,e))),"rows",{enumerable:!0,value:e.rows||[]}),Ro(jo(e),"cols",{enumerable:!0,value:e.cols||[]}),e}return Eo(t,So),t}(),row:function(){function t(e){return Po(this,t),Ro(jo(e=xo(this,Oo(t).call(this,e))),"root",{writable:!0}),Ro(jo(e),"cells",{enumerable:!0,value:e.cells||[]}),e}return Eo(t,So),t}(),col:function(){function t(e){return Po(this,t),Ro(jo(e=xo(this,Oo(t).call(this,e))),"root",{writable:!0}),Ro(jo(e),"cells",{enumerable:!0,value:e.cells||[]}),e}return Eo(t,So),t}(),cell:function(){function t(e){return Po(this,t),Ro(jo(e=xo(this,Oo(t).call(this,e))),"row",{writable:!0}),Ro(jo(e),"col",{writable:!0}),e}return Eo(t,So),t}()};function Ro(e,t,n){Object.defineProperty(e,t,n)}function Do(e,t){for(var n=0;n> "+(Lo(e)?"Array("+(3":16&t?"Text("+e.children+")":1024&t?"Portal*":"<"+((e=e.type).name||e.displayName||e.constructor.name||(e.toString().match(/^function\s*([^\s(]+)/)||[])[1])+" />")+"\n"}function Qo(e){var t;1&e.childFlags||(64&e.flags&&Ho("input elements can't have children."),128&e.flags&&Ho("textarea elements can't have children."),481&e.flags&&(t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],"media"===(e=e.type.toLowerCase())&&Ho("media elements can't have children."),-1!==(e=t.indexOf(e))&&Ho(t[e]+" elements can't have children.")))}function Zo(e){var t;!1===e.isValidated&&e.children&&481&e.flags&&((t=function e(t,n){for(var r={},o=0,i=t.length;o";var t=e.id?' id="'.concat(e.id,'"'):"";return"<".concat(e.$type).concat(t," />")}function Na(i,e){function a(e,t,n){if(e.gfx)throw new Error("already rendered ".concat(Da(e)));return i.element(e,t,n)}function s(e,t,n){g(e,function(e){a(e,t,n)})}function c(e,t,n){g(e,function(e){a(e,t,n)})}return{handleDecision:function(e){e.id||(e.id="decision");var t=e.decisionLogic;if(!t)throw new Error("no table for ".concat(Da(e)));if(!t.output)throw new Error("missing output for ".concat(Da(t)));var n,r,o=i.table(t);t.input&&s(t.input,o,t),s(t.output,o,t),e=t.rule,n=o,r=t,g(e,function(e){a(e,n,r),c(e.inputEntry,e),c(e.outputEntry,e)})}}}function Ma(e,t,n){var r,o=e.get("tableImporter"),i=e.get("eventBus"),a=e.get("sheet"),s=(e.get("modeling",!1),[]);i.fire("import.render.start",{decision:t});try{new Na({create:function(e,t,n,r){return o.create(e,t,n,r)},table:function(e){return o.add(e)},element:function(e,t,n){return o.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}}).handleDecision(t)}catch(e){r=e}i.fire("import.render.complete",{error:r,warnings:s}),i.fire("elements.changed",{elements:[a.getRoot()]}),n(r,s)}function Ta(e){return(Ta="function"==typeof Symbol&&"symbol"===y(Symbol.iterator)?function(e){return y(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":y(e)})(e)}function Aa(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),n=e?n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}):n}function Ba(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ia(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t: cannot combine with non-fn component value"));r[e]=function(o){for(var e=arguments.length,i=new Array(1e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n
')}}],(t=[{key:"open",value:function(e){var o=this;return new Promise(function(n,r){var t;try{return o._decision&&o.clear(),o._decision=e,Ma(o,e,function(e,t){e?(e.warnings=t||[],r(e)):n({warnings:t||[]})})}catch(e){t=e}t?(t.warnings=t.warnings||[],r(t)):n({warnings:[]})})}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,r=gu(e,yu),e=t||this.getModules(),t=n||[],n=[{decisionTable:["value",this]}];return{modules:[hu].concat(mu(e),mu(t),n),config:r}}},{key:"on",value:function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)}},{key:"off",value:function(e,t){this.get("eventBus").off(e,t)}},{key:"_emit",value:function(e,t){return this.get("eventBus").fire(e,t)}},{key:"attachTo",value:function(e){if(!e)throw new Error("parentNode required");this.detach();var t=this._container;e.appendChild(t),this._emit("attach",{})}},{key:"detach",value:function(){var e=this._container;e.parentNode&&(this._emit("detach",{}),gt(e))}},{key:"destroy",value:function(){wu(Ou(o.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return o._getModules()}}])&&bu(e.prototype,t),n&&bu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();function Eu(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n')}}],(t=[{key:"open",value:function(r){var o=this;return new Promise(function(e,t){var n;try{o._decision&&(o.clear(),o.get("eventBus").fire("renderer.unmount")),o._decision=r,o.get("eventBus").fire("import",r),o.get("eventBus").fire("renderer.mount")}catch(e){n=e}n?(n.warnings=n.warnings||[],t(n)):e({warnings:[]})})}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,r=Gl(e,zl),e=t||this.getModules(),t=n||[],n=[{viewer:["value",this]}];return{modules:[].concat(Ul(e),Ul(t),n),config:r}}},{key:"on",value:function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)}},{key:"off",value:function(e,t){this.get("eventBus").off(e,t)}},{key:"_emit",value:function(e,t){return this.get("eventBus").fire(e,t)}},{key:"getDecision",value:function(){return this._decision}},{key:"attachTo",value:function(e){if(!e)throw new Error("parentNode required");this.detach(),e.appendChild(this._container),this._emit("attach",{})}},{key:"detach",value:function(){var e=this._container;e.parentNode&&(this._emit("detach",{}),gt(e))}},{key:"destroy",value:function(){Wl(Xl(o.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return o._getModules()}}])&&ql(e.prototype,t),n&&ql(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}();return function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(o,St);var e,t,n,r=c(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,(t=[{key:"_getViewProviders",value:function(){return[{id:"drd",constructor:lo,opens:function(e){return ir(e,"dmn:Definitions")&&((e=e).dmnDI&&e.dmnDI.diagrams&&e.dmnDI.diagrams[0])}},{id:"decisionTable",constructor:ju,opens:function(e){return ir(e,"dmn:Decision")&&ir(e.decisionLogic,"dmn:DecisionTable")}},{id:"literalExpression",constructor:Yl,opens:function(e){return ir(e,"dmn:Decision")&&ir(e.decisionLogic,"dmn:LiteralExpression")}}]}}])&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}()});