/*! dmn-js - dmn-viewer v6.0.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.DmnJS=t()}(this,function(){"use strict";var t=Object.prototype.toString,a=Object.prototype.hasOwnProperty;function u(e){return void 0!==e}function y(e){return"[object Array]"===t.call(e)}function w(e){return"[object Object]"===t.call(e)}function s(e){return"[object Number]"===t.call(e)}function c(e){return"[object Function]"===t.call(e)}function l(e){return"[object String]"===t.call(e)}function g(e,n){var t,r;return n=c(t=n)?t:function(e){return e===t},_(e,function(e,t){if(n(e,t))return r=e,!1}),r}function f(e,n){var r=[];return _(e,function(e,t){n(e,t)&&r.push(e)}),r}function _(e,t){if(void 0!==e){var n,r,o=y(e)?m:d;for(var i in e){if(n=e,r=i,a.call(n,r))if(!1===t(e[i],o(i)))return}}}function x(e,n,r){return _(e,function(e,t){r=n(r,e,t)}),r}function r(e,r){return x(e,function(e,t,n){return e&&r(t,n)},!0)}function h(e,n){var r=[];return _(e,function(e,t){r.push(n(e,t))}),r}function p(e){return function(n){return r(e,function(e,t){return n[t]===e})}}function d(e){return e}function m(e){return Number(e)}var o=Array.prototype.slice;function v(t,n){var r;return function(){var e=o.call(arguments);r&&clearTimeout(r),r=setTimeout(function(){t.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t or , got "+e);n=o[1],r=o[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}}function M(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function I(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,_(e,b(this.registerPackage,this))}function V(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function $(e){this.model=e}function L(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function U(e){this.properties=new $(this),this.factory=new n(this,this.properties),this.registry=new I(e,this.properties),this.typeCache={}}M.prototype.build=function(){return t=this,e=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},r=Object(t),_(e,function(e){e in r&&(n[e]=t[e])}),n;var t,e,n,r},M.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var r=this.properties;void 0!==t?r.splice(t,0,e):r.push(e)},M.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)}var s=o.indexOf(e);if(-1===s)throw new Error("property <"+r.name+"> not found in property list");o.splice(s,1),this.addProperty(t,n?void 0:s,a),i[r.name]=i[r.localName]=t},M.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,o=t.split("#"),i=D(o[0],r),a=D(o[1],i.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},M.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},M.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},M.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},M.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},M.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")},M.prototype.hasProperty=function(e){return this.propertiesByName[e]},M.prototype.addTrait=function(r,o){var e=this.allTypesByName,t=this.allTypes,n=r.name;n in e||(_(r.properties,b(function(e){e=O({},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)},I.prototype.getPackage=function(e){return this.packageMap[e]},I.prototype.getPackages=function(){return this.packages},I.prototype.registerPackage=function(t){t=O({},t);var e=this.packageMap;V(e,t,"prefix"),V(e,t,"uri"),_(t.types,b(function(e){this.registerType(e,t)},this)),e[t.uri]=e[t.prefix]=t,this.packages.push(t)},I.prototype.registerType=function(e,t){var r=D((e=O({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:O(e.meta||{})})).name,t.prefix),n=r.name,o={};_(e.properties,b(function(e){var t=D(e.name,r.prefix),n=t.name;T(e.type)||(e.type=D(e.type,t.prefix).name),O(e,{ns:t,name:n}),o[n]=e},this)),O(e,{ns:r,name:n,propertiesByName:o}),_(e.extends,b(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(n)},this)),this.definePackage(e,t),this.typeMap[n]=e},I.prototype.mapTypes=function(r,o,e){var t=T(r.name)?{name:r.name}:this.typeMap[r.name],i=this;function n(e){return a(e,!0)}function a(e,t){var n=D(e,T(e)?"":r.prefix);i.mapTypes(n,o,t)}if(!t)throw new Error("unknown type <"+r.name+">");_(t.superClass,e?n:a),o(t,!e),_(t.traits,n)},I.prototype.getEffectiveDescriptor=function(e){var t=D(e),n=new M(t);this.mapTypes(t,function(e,t){n.addTrait(e,t)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},I.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},$.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:L(e,r,n):e.$attrs[t]=n},$.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var r=n.name;return!e[r]&&n.isMany&&L(e,n,[]),e[r]},$.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},$.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},$.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},U.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},U.prototype.getType=function(e){var t=this.typeCache,n=l(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},U.prototype.createAny=function(e,t,n){var r=D(e),o={$type:e,$instanceOf:function(e){return e===this.$type}},i={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(o,i),this.properties.defineModel(o,this),this.properties.define(o,"$parent",{enumerable:!1,writable:!0}),_(n,function(e,t){w(e)&&void 0!==e.value?o[e.name]=e.value:o[t]=e}),o},U.prototype.getPackage=function(e){return this.registry.getPackage(e)},U.prototype.getPackages=function(){return this.registry.getPackages()},U.prototype.getElementDescriptor=function(e){return e.$descriptor},U.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},U.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},U.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e,t){return e(t={exports:{}},t.exports),t.exports}var F=e(function(e,t){var r,n=function(){function r(e,t){for(var n=0;n * @copyright 2018 * @license BSD-3-Clause * @link http://avoidwork.github.io/tiny-stack * @version 1.1.0 */ r=function(){function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")} /** * Tiny stack for browser or server * * @author Jason Mulligan * @copyright 2018 * @license BSD-3-Clause * @link http://avoidwork.github.io/tiny-stack * @version 1.1.0 */(this,r);for(var e=arguments.length,t=Array(e),n=0;n",lt:"<",quot:'"'};function Q(e,t,n,r){return r?W.call(Z,r)?Z[r]:"&"+r+";":G(t||parseInt(n,16))}function J(e){return 3"}function ne(e){return{get:e,enumerable:!0}}function re(e){var t,n={};for(t in e)n[t]=e[t];return n}function oe(e){return e+"$uri"}function ie(){return{line:0,column:0}}function ae(e){throw e}function se(e){if(!this)return new se(e);var v,O,k,S,n,E,C,j,A,P=e&&e.proxy,r=ae,N=ie,B=!1,T=!1,t=null,R=!1;function D(e){e instanceof Error||(e=ee(e)),r(t=e,N)}function M(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":O=t;break;case"text":v=t;break;case"closeTag":k=t;break;case"error":r=t;break;case"warn":n=t;break;case"cdata":S=t;break;case"attention":j=t;break;case"question":C=t;break;case"comment":E=t;break;default:throw ee("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!==(void 0===e?"undefined":z(e)))throw ee("required args ");var t,n={};for(t in e)n[t]=e[t];return n[H]=X,T=!0,A=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,u,c,g,l=T?[]:null,b=T?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[oe(n)]=t;return r}(A):null,f=[],w=0,p=!1,h=!1,d=0,y=0,_="",x=0;function m(){if(null!==g)return g;var e,t,n,r,o,i,a,s,u,c,l,f=T&&b.xmlns,p=T&&B?[]:null,h=x,d=_,y=d.length,m={},v={};e:for(;h already defined");else if(v[s]=!0,T)if(B){if(null!==(o="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=J(i),t=oe(o),!(a=A[e])){if("xmlns"===o||t in b&&b[t]!==e)for(;a="ns"+w++,void 0!==b[a];);else a=o;A[e]=a}b[o]!==a&&(r||(b=re(b),r=!0),b[o]=a,"xmlns"===o&&(b[oe(a)]=e,f=a),b[t]=e),m[s]=i;continue}p.push(s,i)}else-1!==(c=s.indexOf(":"))?(n=b[s.substring(0,c)])?((s=f===n?s.substr(c+1):n+s.substr(c))===K&&(i=-1!==(c=i.indexOf(":"))?(n=i.substring(0,c),(n=b[n]||n)+i.substring(c)):f+":"+i),m[s]=i):M(te(s.substring(0,c))):m[s]=i;else m[s]=i}if(B)for(h=0,y=p.length;h",d+1)))return D("unclosed tag");if(g={},47===o){if(h=!(p=!1),!f.length)return D("missing open tag");if(t=s=f.pop(),r=d+2+t.length,a.substring(d+2,r)!==t)return D("closing tag mismatch");for(;r");s=s.substr(o+1)}else i=b.xmlns;i&&(s=i+":"+s)}if(p&&(x=r,_=t,O&&(P?O(c,J,h,N):O(s,m,J,h,N),R)))return;if(h){if(k&&(k(P?c:s,J,p,N),R))return;T&&(b=p?e:l.pop())}y+=1}else{if(-1===(y=a.indexOf("?>",d)))return D("unclosed question");if(C&&(C(a.substring(d,y+2),N),R))return;y+=2}else{if(91===(o=a.charCodeAt(d+2))&&"CDATA["===a.substr(d+3,6)){if(-1===(y=a.indexOf("]]>",d)))return D("unclosed cdata");if(S&&(S(a.substring(d+9,y),N),R))return;y+=3;continue}if(45===o&&45===a.charCodeAt(d+3)){if(-1===(y=a.indexOf("--\x3e",d)))return D("unclosed comment");if(E&&(E(a.substring(d+4,y),J,N),R))return;y+=3;continue}if(-1===(y=a.indexOf(">",d+1)))return D("unclosed tag");if(j&&(j(a.substring(d,y+1),J,N),R))return;y+=1}}}(e),N=ie,R=!1,t},this.stop=function(){R=!0}}function ue(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var ce={xsi:"http://www.w3.org/2001/XMLSchema-instance"},le="xsi:type";function fe(e){return e.xml&&e.xml.serialize}function pe(e){return fe(e)===le}function he(e,t){return ue(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function de(e){return new Error(e)}function ye(e){return e.$descriptor}function me(e){O(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw de("expected element");var t,n=this.elementsById,r=ye(e).idProperty;if(r&&(t=e.get(r.name))){if(n[t])throw de("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function ve(){}function ge(){}function be(){}function we(e,t){this.property=e,this.context=t}function _e(e,t){this.element=t,this.propertyDesc=e}function xe(){}function Oe(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function ke(e,t,n){Oe.call(this,e,t,n)}function Se(e,t,n){this.model=e,this.context=n}function Ee(e){e instanceof U&&(e={model:e}),O(this,{lax:!1},e)}ve.prototype.handleEnd=function(){},ve.prototype.handleText=function(){},ve.prototype.handleNode=function(){},(ge.prototype=Object.create(ve.prototype)).handleNode=function(){return this},(be.prototype=Object.create(ve.prototype)).handleText=function(e){this.body=(this.body||"")+e},(we.prototype=Object.create(be.prototype)).handleNode=function(e){if(this.element)throw de("expected no sub nodes");return this.element=this.createReference(e),this},we.prototype.handleEnd=function(){this.element.id=this.body},we.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},(_e.prototype=Object.create(be.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)},(xe.prototype=Object.create(be.prototype)).handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},(Oe.prototype=Object.create(xe.prototype)).addReference=function(e){this.context.addReference(e)},Oe.prototype.handleEnd=function(){var e=this.body,t=this.element,n=ye(t).bodyProperty;n&&void 0!==e&&(e=B(n.type,e),t.set(n.name,e))},Oe.prototype.createElement=function(e){var r,t=e.attributes,n=this.type,o=ye(n),i=this.context,a=new n({}),s=this.model;return _(t,function(e,t){var n=o.propertiesByName[t];n&&n.isReference?n.isMany?_(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=D(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},Oe.prototype.getPropertyForNode=function(e){var t,n,r,o,i,a,s,u,c,l,f=D(e.name),p=this.type,h=this.model,d=ye(p),y=f.name,m=d.propertiesByName[y];if(m)return pe(m)&&(t=e.attributes[le])?(r=h,c=D(t),l=r.getPackage(c.prefix),i=l,a=(o=c).name,s=o.localName,t=(u=i.xml&&i.xml.typePrefix)&&0===s.indexOf(u)?o.prefix+":"+s.slice(u.length):a,O({},m,{effectiveType:ye(n=h.getType(t)).name})):m;var v=h.getPackage(f.prefix);if(v){if(t=he(f,v),n=h.getType(t),m=g(d.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return O({},m,{effectiveType:ye(n).name})}else if(m=g(d.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return m;throw de("unrecognized element <"+f.name+">")},Oe.prototype.toString=function(){return"ElementDescriptor["+ye(this.type).name+"]"},Oe.prototype.valueHandler=function(e,t){return new _e(e,t)},Oe.prototype.referenceHandler=function(e){return new we(e,this.context)},Oe.prototype.handler=function(e){return"Element"===e?new Se(this.model,e,this.context):new Oe(this.model,e,this.context)},Oe.prototype.handleChild=function(e){var t,n,r,o;if(t=this.getPropertyForNode(e),r=this.element,R(n=t.effectiveType||t.type))return this.valueHandler(t,r);var i=(o=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==i&&(t.isMany?r.get(t.name).push(i):r.set(t.name,i),t.isReference?(O(i,{element:r}),this.context.addReference(i)):i.$parent=r),o},(ke.prototype=Object.create(Oe.prototype)).createElement=function(e){var t=e.name,n=D(t),r=this.model,o=this.type,i=r.getPackage(n.prefix),a=i&&he(n,i)||t;if(!o.hasType(a))throw de("unexpected element <"+e.originalName+">");return Oe.prototype.createElement.call(this,e)},(Se.prototype=Object.create(xe.prototype)).createElement=function(e){var t=e.name,n=D(t).prefix,r=e.ns[n+"$uri"],o=e.attributes;return this.model.createAny(t,r,o)},Se.prototype.handleChild=function(e){var t=new Se(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element;return void 0!==r&&((n.$children=n.$children||[]).push(r),r.$parent=n),t},Se.prototype.handleText=function(e){this.body=this.body||""+e},Se.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Ee.prototype.fromXML=function(n,e,r){var o=e.rootHandler;e instanceof Oe?(o=e,e={}):"string"==typeof e?(o=this.handler(e),e={}):"string"==typeof o&&(o=this.handler(o));var t=this.model,a=this.lax,c=new me(O({},e,{rootHandler:o})),i=new se({proxy:!0}),s=new F;function u(e,t,n){var r=t(),o=r.line,i=r.column,a=r.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var s="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+o+"\n\tcolumn: "+i+"\n\tnested error: "+e.message;if(n)return c.addWarning({message:s,error:e}),console.warn("could not parse node"),console.warn(e),!0;throw console.error("could not parse document"),console.error(e),de(s)}o.context=c,s.push(o);var l=/^<\?xml /i,f=/ encoding="([^"]+)"/i,p=/^utf-8$/i;var h=t.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});i.ns(h).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=s.peek();try{s.push(n.handleNode(e))}catch(e){u(e,t,a)&&s.push(new ge)}}({name:e.name,originalName:e.originalName,attributes:i,ns:e.ns},n)}).on("question",function(e){if(l.test(e)){var t=f.exec(e),n=t&&t[1];n&&!p.test(n)&&c.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){s.pop().handleEnd()}).on("cdata",function(e){s.peek().handleText(e)}).on("text",function(e,t){var n;(n=(n=t(e)).trim())&&s.peek().handleText(n)}).on("error",u).on("warn",function(e,t){return u(e,t,!0)}),setTimeout(function(){var t;try{i.parse(n),function(){var e,t,n=c.elementsById,r=c.references;for(e=0;t=r[e];e++){var o=t.element,i=n[t.id],a=ye(o).propertiesByName[t.property];if(i||c.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var s=o.get(a.name),u=s.indexOf(t);-1===u&&(u=s.length),i?s[u]=i:s.splice(u,1)}else o.set(a.name,i)}}()}catch(e){t=e}var e=o.element;t||e||(t=de("failed to parse document as <"+o.type.$descriptor.name+">")),r(t,t?void 0:e,c)},0)},Ee.prototype.handler=function(e){return new ke(this.model,e)};var Ce=/<|>|'|"|&|\n\r|\n/g,je=/<|>|&/g;function Ae(t){var n={},r={},o={},i=[],a=[];this.byUri=function(e){return r[e]||t&&t.byUri(e)},this.add=function(e,t){r[e.uri]=e,t?i.push(e):a.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.logUsed=function(e){var t=e.uri;o[t]=this.byUri(t)},this.getUsed=function(e){return[].concat(i,a).filter(function(e){return o[e.uri]})}}function Pe(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Ne(e){return l(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Be(e,t){return t.isGeneric?O({localName:t.ns.localName},e):O({localName:(n=t.ns.localName,r=t.$pkg,ue(r)?(o=n).charAt(0).toLowerCase()+o.slice(1):n)},e);var n,r,o}var Te={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Re={"<":"lt",">":"gt","&":"amp"};function De(e,t,n){return(e=l(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function Me(e){this.tagName=e}function Ie(){}function Ve(e){this.tagName=e}function $e(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Le(e,t){$e.call(this,e,t)}function Ue(){this.value="",this.write=function(e){this.value+=e}}function Fe(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=O({format:!1,preamble:!0},o||{}),{toXML:function(e,t){var n=t||new Ue,r=new Fe(n,o.format);if(o.preamble&&r.append('\n'),(new $e).build(e).serializeTo(r),!t)return n.value}}}function Ge(e,t){U.call(this,e,t)}Me.prototype.build=function(e){return this.element=e,this},Me.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()},Ie.prototype.serializeValue=Ie.prototype.serializeTo=function(e){e.append(this.escape?De(this.value,je,Re):this.value)},Ie.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(je)&&(this.escape=!0),this},Pe(Ve,Ie),Ve.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()},$e.prototype.build=function(e){var t,n,r,o=(this.element=e).$descriptor,i=this.propertyDescriptor,a=o.isGeneric;return t=a?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=i?this.nsPropertyTagName(i):this.nsTagName(o),this.tagName=this.addTagName(this.ns),a||(n=f((r=e).$descriptor.properties,function(e){var t=e.name;if(e.isVirtual)return!1;if(!r.hasOwnProperty(t))return!1;var n=r[t];return n!==e.default&&null!==n&&(!e.isMany||n.length)}),this.parseAttributes(f(n,function(e){return e.isAttr})),this.parseContainments(f(n,function(e){return!e.isAttr}))),this.parseGenericAttributes(e,t),this},$e.prototype.nsTagName=function(e){return Be(this.logNamespaceUsed(e.ns),e)},$e.prototype.nsPropertyTagName=function(e){var t,n=this.logNamespaceUsed(e.ns);return t=n,O({localName:e.ns.localName},t)},$e.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},$e.prototype.nsAttributeName=function(e){var t;if(t=l(e)?D(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:O({localName:t.localName},n)},$e.prototype.parseGeneric=function(n){var r=this,o=this.body,i=[];return _(n,function(e,t){"$body"===t?o.push((new Ie).build({type:"String"},e)):"$children"===t?_(e,function(e){o.push(new $e(r).build(e))}):0!==t.indexOf("$")&&r.parseNsAttribute(n,t,e)&&i.push({name:t,value:e})}),i},$e.prototype.parseNsAttribute=function(e,t,n){var r,o=e.$model,i=D(t);if("xmlns"===i.prefix&&(r={prefix:i.localName,uri:n}),i.prefix||"xmlns"!==i.localName||(r={uri:n}),!r)return{name:t,value:n};if(o&&o.getPackage(n))this.logNamespace(r,!0,!0);else{var a=this.logNamespaceUsed(r,!0);this.getNamespaces().logUsed(a)}},$e.prototype.parseNsAttributes=function(r,e){var o=this,t=r.$attrs,i=[];return _(t,function(e,t){var n=o.parseNsAttribute(r,t,e);n&&i.push(n)}),i},$e.prototype.parseGenericAttributes=function(n,e){var r=this;_(e,function(t){if(t.name!==le)try{r.addAttribute(r.nsAttributeName(t.name),t.value)}catch(e){console.warn("missing namespace information for ",t.name,"=",t.value,"on",n,e)}})},$e.prototype.parseContainments=function(e){var i=this,a=this.body,s=this.element;_(e,function(n){var e=s.get(n.name),t=n.isReference;if(n.isMany||(e=[e]),n.isBody)a.push((new Ie).build(n,e[0]));else if(R(n.type))_(e,function(e){a.push(new Ve(i.addTagName(i.nsPropertyTagName(n))).build(n,e))});else if(t)_(e,function(e){a.push(new Me(i.addTagName(i.nsPropertyTagName(n))).build(e))});else{var r=pe(n),o="property"===fe(n);_(e,function(e){var t;t=r?new Le(i,n):o?new $e(i,n):new $e(i),a.push(t.build(e))})}})},$e.prototype.getNamespaces=function(e){var t,n=this.namespaces,r=this.parent;return n||(t=r&&r.getNamespaces(),e||!t?this.namespaces=n=new Ae(t):n=t),n},$e.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),o=e.uri,i=e.prefix;return r.byUri(o)||r.add(e,t),r.mapPrefix(i,o),e},$e.prototype.logNamespaceUsed=function(e,t){var n,r,o,i=this.element.$model,a=this.getNamespaces(t),s=e.prefix,u=e.uri;if(!s&&!u)return{localName:e.localName};if(o=ce[s]||i&&(i.getPackage(s)||{}).uri,!(u=u||o||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(u))){for(n=s,r=1;a.uriByPrefix(n);)n=s+"_"+r++;e=this.logNamespace({prefix:n,uri:u},o===u)}return s&&a.mapPrefix(s,u),e},$e.prototype.parseAttributes=function(e){var r=this,o=this.element;_(e,function(e){var t=o.get(e.name);if(e.isReference)if(e.isMany){var n=[];_(t,function(e){n.push(e.id)}),t=n.join(" ")}else t=t.id;r.addAttribute(r.nsAttributeName(e),t)})},$e.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Ne(e)},$e.prototype.addAttribute=function(e,t){var n=this.attrs;l(t)&&(t=De(t,Ce,Te)),n.push({name:e,value:t})},$e.prototype.serializeAttributes=function(t){var e,n=this.attrs,r=this.namespaces;r&&(n=(e=r,h(e.getUsed(),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})).concat(n)),_(n,function(e){t.append(" ").append(Ne(e.name)).append('="').append(e.value).append('"')})},$e.prototype.serializeTo=function(t){var e=this.body[0],n=e&&e.constructor!==Ie;t.appendIndent().append("<"+this.tagName),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),_(this.body,function(e){e.serializeTo(t)}),n&&t.unindent().appendIndent(),t.append("")),t.appendNewLine()},Pe(Le,$e),Le.prototype.parseNsAttributes=function(e){var t=$e.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var o=e.$model.getPackage(r.uri),i=o.xml&&o.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(le),(r.prefix?r.prefix+":":"")+i+n.ns.localName),t},Le.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},(Ge.prototype=Object.create(U.prototype)).fromXML=function(e,t,n,r){l(t)||(r=n,n=t,t="dmn:Definitions"),c(n)&&(r=n,n={});var o=new Ee(O({model:this,lax:!0},n)),i=o.handler(t);o.fromXML(e,i,r)};Ge.prototype.toXML=function(e,t,n){c(t)&&(n=t,t={});var r,o,i=new ze(t);try{r=i.toXML(e)}catch(e){o=e}return n(o,r)};var We={dmn:{name:"DMN",uri:"http://www.omg.org/spec/DMN/20151101/dmn.xsd",xml:{tagAlias:"lowerCase"},prefix:"dmn",types:[{name:"DMNElement",isAbstract:!0,properties:[{name:"description",type:"String"},{name:"id",type:"String",isAttr:!0,isId:!0},{name:"label",type:"String",isAttr:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"NamedElement",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"name",type:"String",isAttr:!0}]},{name:"DMNElementReference",properties:[{name:"href",type:"String",isAttr:!0}]},{name:"ExtensionElements",properties:[{name:"values",type:"Element",isMany:!0}]},{name:"Definitions",superClass:["NamedElement"],properties:[{name:"namespace",type:"String",isAttr:!0},{name:"typeLanguage",type:"String",isAttr:!0,default:"http://www.omg.org/spec/FEEL/20140401"},{name:"expressionLanguage",type:"String",isAttr:!0,default:"http://www.omg.org/spec/FEEL/20140401"},{name:"exporter",type:"String",isAttr:!0},{name:"exporterVersion",type:"String",isAttr:!0},{name:"itemDefinition",type:"ItemDefinition",isMany:!0,xml:{serialize:"property"}},{name:"drgElements",type:"DRGElement",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"Import",properties:[{name:"namespace",type:"String",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0},{name:"importType",type:"String",isAttr:!0}]},{name:"DRGElement",isAbstract:!0,superClass:["NamedElement"]},{name:"Decision",superClass:["DRGElement"],properties:[{name:"question",type:"String"},{name:"allowedAnswers",type:"String"},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"informationRequirement",type:"InformationRequirement",isMany:!0,xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0,xml:{serialize:"property"}},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0,xml:{serialize:"property"}},{name:"decisionTable",type:"DecisionTable",xml:{serialize:"property"}},{name:"literalExpression",type:"LiteralExpression",xml:{serialize:"property"}}]},{name:"BusinessKnowledgeModel",superClass:["DRGElement"],properties:[{name:"encapsulatedLogic",type:"FunctionDefinition"},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0,xml:{serialize:"property"}},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0,xml:{serialize:"property"}}]},{name:"InputData",superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"KnowledgeSource",superClass:["DRGElement"],properties:[{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0,xml:{serialize:"property"}},{name:"type",type:"String",isAttr:!0},{name:"owner",type:"DMNElementReference",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0}]},{name:"InformationRequirement",properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"KnowledgeRequirement",properties:[{name:"requiredKnowledge",type:"DMNElementReference",isUnique:!0,xml:{serialize:"property"}}]},{name:"AuthorityRequirement",properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredAuthority",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"Expression",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"typeRef",type:"String",isAttr:!0}]},{name:"ItemDefinition",superClass:["NamedElement"],properties:[{name:"typeLanguage",type:"String",isAttr:!0},{name:"isCollection",type:"Boolean",isAttr:!0,default:!1},{name:"typeRef",type:"String"},{name:"allowedValues",type:"UnaryTests",isMany:!0,xml:{serialize:"property"}}]},{name:"LiteralExpression",superClass:["Expression"],properties:[{name:"expressionLanguage",type:"String",isAttr:!0},{name:"importedValues",type:"ImportedValues"},{name:"text",type:"String"}]},{name:"InformationItem",superClass:["NamedElement"],properties:[{name:"typeRef",type:"String",isAttr:!0}]},{name:"DecisionTable",superClass:["Expression"],properties:[{name:"input",type:"InputClause",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"OutputClause",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,default:"Rule-as-Row"},{name:"outputLabel",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:"ImportedValues",superClass:["Import"],properties:[{name:"importedElement",type:"String",isMany:!0,xml:{serialize:"property"}},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"Artifact",isAbstract:!0,superClass:["DMNElement"]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String",xml:{serialize:"property"}},{name:"textFormat",type:"String",isAttr:!0}]},{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,default:"None"}]},{name:"InputClause",superClass:["DMNElement"],properties:[{name:"inputExpression",type:"LiteralExpression",xml:{serialize:"property"}},{name:"inputValues",type:"UnaryTests",xml:{serialize:"property"}}]},{name:"OutputClause",superClass:["DMNElement"],properties:[{name:"outputValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"defaultOutputEntry",type:"LiteralExpression",xml:{serialize:"property"}},{name:"name",type:"String",isAttr:!0},{name:"typeRef",type:"String",isAttr:!0}]},{name:"UnaryTests",superClass:["DMNElement"],properties:[{name:"text",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"FunctionDefinition",superClass:["Expression"],properties:[{name:"formalParameter",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"expression",type:"String",isReference:!0,xml:{serialize:"property"}}]}],emumerations:[{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{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"}]}]},camunda:{name:"Camunda",uri:"http://camunda.org/schema/1.0/dmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},types:[{name:"InputVariable",extends:["dmn:InputClause"],properties:[{name:"inputVariable",isAttr:!0,type:"String"}]}]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],prefix:"dc",associations:[]},biodi:{name:"bpmn.io DI for DMN",uri:"http://bpmn.io/schema/dmn/biodi/1.0",prefix:"biodi",xml:{tagAlias:"lowerCase"},types:[{name:"Edge",superClass:["Element"],properties:[{name:"source",type:"String",isAttr:!0},{name:"waypoints",type:"Waypoint",isMany:!0,xml:{serialize:"property"}}]},{name:"Bounds",superClass:["dc:Bounds","Element"]},{name:"Waypoint",superClass:["dc:Point"]}]}};function qe(e,t){return new Ge(O({},We,e),t)}function Ze(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}var Qe=[].indexOf,Je=function(e,t){if(Qe)return e.indexOf(t);for(var n=0;n
a',pt=!ot.getElementsByTagName("link").length,ot=void 0);var ht={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:pt?[1,"X
","
"]:[0,"",""]};ht.td=ht.th=[3,"","
"],ht.option=ht.optgroup=[1,'"],ht.thead=ht.tbody=ht.colgroup=ht.caption=ht.tfoot=[1,"","
"],ht.polyline=ht.ellipse=ht.polygon=ht.circle=ht.text=ht.line=ht.path=ht.rect=ht.g=[1,'',""];var dt="undefined"!=typeof Element?Element.prototype:{};dt.matches||dt.matchesSelector||dt.webkitMatchesSelector||dt.mozMatchesSelector||dt.msMatchesSelector||dt.oMatchesSelector;function yt(e,t){return(t=t||document).querySelector(e)}function mt(e){e.parentNode&&e.parentNode.removeChild(e)}var vt="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},gt=Object.assign||function(e){for(var t=1;t]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid DMN 1.1 diagram file"+t[2]);return e}(e)),e||!i.open)return s._emit("import.done",{error:e,warmings:r}),a(e,r);var o=s._activeView||s._getInitialView(s._views);if(!o)return a(new Error("no displayable contents"));s.open(o,function(e,t){var n=[].concat(r,t||[]);s._emit("import.done",{error:e,warnings:n}),a(e,n)})})}},{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,n){var r=this;"function"==typeof e&&(n=e,e={});var t=this._definitions;if(!t)return n(new Error("no definitions loaded"));t=this._emit("saveXML.start",{definitions:t})||t,this._moddle.toXML(t,e,function(e,t){try{t=r._emit("saveXML.serialized",{error:e,xml:t})||t,r._emit("saveXML.done",{error:e,xml:t})}catch(e){console.error("error in saveXML life-cycle listener",e)}n(e,t)})}},{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.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=yt(e)),e.appendChild(this._container)}},{key:"detach",value:function(){mt(this._container)}},{key:"destroy",value:function(){var t=this;Object.keys(this._viewers,function(e){jt(t._viewers[e],"destroy")}),mt(this._container)}},{key:"_init",value:function(e){this._options=e,this._moddle=this._createModdle(e),this._viewers={},this._views=[];var t=ft('
'),n=O({},xt,e);O(t.style,{width:St(n.width),height:St(n.height),position:n.position}),this._container=t,e.container&&this.attachTo(e.container)}},{key:"open",value:function(e){var t=1");var n=e.constructor,r=this._options[t]||{},o=this._options.common||{};return new n(gt({},o,r,{additionalModules:[].concat(_t(r.additionalModules||[]),[{_parent:["value",this],moddle:["value",this._moddle]}])}))}},{key:"_emit",value:function(){var e;(e=this._eventBus).fire.apply(e,arguments)}},{key:"_createModdle",value:function(e){return new qe(e.moddleExtensions||{})}},{key:"_getViewProviders",value:function(){return[]}}]),n}();function kt(){}function St(e){return e+(s(e)?"px":"")}function Et(e,t){return e.filter(t)[0]}function Ct(e,t){return void 0===e?void 0===t:void 0!==t&&(e.element===t.element||e.element.id===t.element.id)}function jt(e,t){"function"==typeof e[t]&&e[t]()}var At="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},Pt=/^class /;function Nt(e){return"[object Array]"===Object.prototype.toString.call(e)}function Bt(){var e=Array.prototype.slice.call(arguments);1===e.length&&Nt(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var Tt=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Rt=/^function\s*[^(]*\(\s*([^)]*)\)/m,Dt=/\/\*([^*]*)\*\//m;function Mt(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t,n=e.toString().match((t=e,Pt.test(t.toString())?Tt:Rt));return n&&n[1]&&n[1].split(",").map(function(e){return(n=e.match(Dt))?n[1].trim():e.trim()})||[]}var It="function"==typeof Symbol&&"symbol"===At(Symbol.iterator)?function(e){return void 0===e?"undefined":At(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":At(e)};function Vt(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t ");return a.length=0,new Error(t?e+" (Resolving: "+t+")":e)},n=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(Lt(s,t))return s[t];if(Lt(p,t)){if(-1!==a.indexOf(t))throw a.push(t),u("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)},c=function(e){var t=1"+e+"",t=!0);var n,r,o=(n=e,(r=new DOMParser).async=!1,r.parseFromString(n,"text/xml"));if(!t)return o;for(var i=document.createDocumentFragment(),a=o.firstChild;a.firstChild;)i.appendChild(a.firstChild);return i}function sn(e,t){var n;return n="<"===e.charAt(0)?(n=an(e).firstChild,document.importNode(n,!0)):document.createElementNS(rn.svg,e),t&&Jt(n,t),n}var un=sn("svg");function cn(e,t,n,r,o,i){var a=un.createSVGMatrix();switch(arguments.length){case 0:return a;case 6:e={a:e,b:t,c:n,d:r,e:o,f:i}}return function(e,t){var n,r,o=Object.keys(t);for(n=0;r=o[n];n++)e[r]=t[r];return e}(a,e)}var ln=/([&<>]{1})/g,fn=/([\n\r"]{1})/g,pn={"&":"&","<":"<",">":">",'"':"'"};function hn(e,t){return e.replace(t,function(e,t){return pn[t]||t})}function dn(e,t){var n,r,o,i,a;switch(e.nodeType){case 3:t.push(hn(e.textContent,ln));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,r=(o=e.attributes).length;n"),n=0,r=(a=e.childNodes).length;n")}else t.push("/>");break;case 8:t.push("\x3c!--",hn(e.nodeValue,ln),"--\x3e");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function yn(e,t){var n=an(t);if(function(e){for(var t;t=e.firstChild;)nn(t)}(e),t){"#document-fragment"!==n.nodeName&&(n=n.documentElement);for(var r,o=(r=n.childNodes,Array.prototype.slice.call(r)),i=0;i already created at index <"+t+">");return n.group},Pn.prototype._createLayer=function(e,n){n||(n=0);var t=x(this._layers,function(e,t){return n>=t.index&&e++,e},0);return{group:jn(this._viewport,"layer-"+e,t),index:n}},Pn.prototype.getContainer=function(){return this._container},Pn.prototype._updateMarker=function(e,t,n){var r;e.id||(e=this._elementRegistry.get(e)),(r=this._elementRegistry._elements[e.id])&&(_([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}))},Pn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Pn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Pn.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),en(this.getGraphics(e)).has(t)},Pn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Pn.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},Pn.prototype.setRootElement=function(e,t){e&&this._ensureValid("root",e);var n=this._rootElement,r=this._elementRegistry,o=this._eventBus;if(n){if(!t)throw new Error("rootElement already set, need to specify override");o.fire("root.remove",{element:n}),o.fire("root.removed",{element:n}),r.remove(n)}if(e){var i=this.getDefaultLayer();o.fire("root.add",{element:e}),r.add(e,i,this._svg),o.fire("root.added",{element:e,gfx:i})}return this._rootElement=e},Pn.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element with id "+t.id+" already exists");var n=An[e];if(!r(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},Pn.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},Pn.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);var a=i.create(e,t,r);return this._elementRegistry.add(t,a),i.update(e,t,a),o.fire(e+".added",{element:t,gfx:a}),t},Pn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Pn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Pn.prototype._removeElement=function(e,t){var n=this._elementRegistry,r=this._graphicsFactory,o=this._eventBus;if(e=n.get(e.id||e))return o.fire(t+".remove",{element:e}),r.remove(e),function(e,t){if(!e||!t)return;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,o.fire(t+".removed",{element:e}),n.remove(e),e},Pn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Pn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Pn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Pn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Pn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Pn.prototype.viewbox=function(t){if(void 0===t&&this._cachedViewbox)return this._cachedViewbox;var e,n,r,o,i,a,s=this._viewport,u=this.getSize();return t?(this._changeViewbox(function(){o=Math.min(u.width/t.width,u.height/t.height);var e=this._svg.createSVGMatrix().scale(o).translate(-t.x,-t.y);gn(s,e)}),t):(e=this.getDefaultLayer().getBBox(),n=(r=gn(s))?r.matrix:cn(),o=En(n.a,1e3),i=En(-n.e||0,1e3),a=En(-n.f||0,1e3),t=this._cachedViewbox={x:i?i/o:0,y:a?a/o:0,width:u.width/o,height:u.height/o,scale:o,inner:{width:e.width,height:e.height,x:e.x,y:e.y},outer:u})},Pn.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=O({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}},Pn.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox(function(){"object"!==(void 0===t?"undefined":Sn(t))&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),En(r.a,1e3)):this.viewbox(e).scale;var n,r},Pn.prototype._fitViewport=function(e){var t,n,r=this.viewbox(),o=r.outer,i=r.inner;return n=0<=i.x&&0<=i.y&&i.x+i.width<=o.width&&i.y+i.height<=o.height&&!e?{x:0,y:0,width:Math.max(i.width+i.x,o.width),height:Math.max(i.height+i.y,o.height)}:(t=Math.min(1,o.width/i.width,o.height/i.height),{x:i.x+(e?i.width/2-o.width/t/2:0),y:i.y+(e?i.height/2-o.height/t/2:0),width:o.width/t,height:o.height/t}),this.viewbox(n),this.viewbox(!1).scale},Pn.prototype._setZoom=function(e,t){var n,r,o,i,a=this._svg,s=this._viewport,u=a.createSVGMatrix(),c=a.createSVGPoint(),l=(r=s.getCTM()).a;return i=t?(n=O(c,t).matrixTransform(r.inverse()),o=u.translate(n.x,n.y).scale(1/l*e).translate(-n.x,-n.y),r.multiply(o)):u.scale(e),Nn(this._viewport,i),i},Pn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Pn.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();e.waypoints?t=this.getGraphics(e).getBBox():t=e;return{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},Pn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Bn="data-element-id";function Tn(e){this._elements={},this._eventBus=e}Tn.$inject=["eventBus"],Tn.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),Jt(t,Bn,r),n&&Jt(n,Bn,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},Tn.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(Jt(r.gfx,Bn,""),r.secondaryGfx&&Jt(r.secondaryGfx,Bn,""),delete t[n])},Tn.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},Tn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&Jt(e,Bn);var n=this._elements[t];return n&&n.element},Tn.prototype.filter=function(n){var r=[];return this.forEach(function(e,t){n(e,t)&&r.push(e)}),r},Tn.prototype.getAll=function(){return this.filter(function(e){return e})},Tn.prototype.forEach=function(o){var i=this._elements;Object.keys(i).forEach(function(e){var t=i[e],n=t.element,r=t.gfx;return o(n,r)})},Tn.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},Tn.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var Rn={extend:function(e,r,t,o){var i=t.inverse;return Object.defineProperty(e,"remove",{value:function(e){var t=this.indexOf(e);return-1!==t&&(this.splice(t,1),r.unset(e,i,o)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,t){var n=this.indexOf(e);if(void 0===t){if(-1!==n)return;t=this.length}-1!==n&&this.splice(n,1),this.splice(t,0,e),-1===n&&r.set(e,i,o)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},isExtended:function(e){return!0===e.__refs_collection}};function Dn(t,n,r){var e=Rn.extend(r[n.name]||[],t,n,r);Object.defineProperty(r,n.name,{enumerable:n.enumerable,value:e}),e.length&&e.forEach(function(e){t.set(e,n.inverse,r)})}function Mn(e,t){if(!(this instanceof Mn))return new Mn(e,t);(e.inverse=t).inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Mn.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}var n,r,o,i,a;t.collection?Dn(this,t,e):(n=this,o=e,i=(r=t).inverse,a=o[r.name],Object.defineProperty(o,r.name,{configurable:r.configurable,enumerable:r.enumerable,get:function(){return a},set:function(e){if(e!==a){var t=a;a=null,t&&n.unset(t,i,o),a=e,n.set(a,i,o)}}}))},Mn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Rn.isExtended(n)||Dn(this,t,e),n},Mn.prototype.ensureBound=function(e,t){var n,r;n=e,r=t,Object.prototype.hasOwnProperty.call(n,r.name||r)||this.bind(e,t)},Mn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Mn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var In=Mn,Vn=Rn;In.Collection=Vn;var $n=new In({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Ln=new In({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Un=new In({name:"attachers",collection:!0},{name:"host"}),Fn=new In({name:"outgoing",collection:!0},{name:"source"}),zn=new In({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"),Ln.bind(this,"labels"),Fn.bind(this,"outgoing"),zn.bind(this,"incoming")}function Wn(){Gn.call(this),$n.bind(this,"children"),Un.bind(this,"host"),Un.bind(this,"attachers")}function qn(){Wn.call(this)}function Zn(){Wn.call(this),Ln.bind(this,"labelTarget")}function Qn(){Gn.call(this),Fn.bind(this,"source"),zn.bind(this,"target")}Ut(Wn,Gn),Ut(qn,Wn),Ut(Zn,Wn),Ut(Qn,Gn);var Jn={connection:Qn,shape:Wn,label:Zn,root:qn};function Hn(){this._uid=12}function Xn(e,t,n){var r,o=r?un.createSVGTransformFromMatrix(r):un.createSVGTransform();o.setTranslate(t,n),gn(e,o)}function Kn(e,t){this._eventBus=e,this._elementRegistry=t}function Yn(e,t,n){t.insertBefore(e,n||t.firstChild)}Hn.prototype.createRoot=function(e){return this.create("root",e)},Hn.prototype.createLabel=function(e){return this.create("label",e)},Hn.prototype.createShape=function(e){return this.create("shape",e)},Hn.prototype.createConnection=function(e){return this.create("connection",e)},Hn.prototype.create=function(e,t){return(t=O({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Jn[e];if(!n)throw new Error("unknown type: <"+e+">");return O(new n,t)}(e,t)},Kn.$inject=["eventBus","elementRegistry"],Kn.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=n.parentNode.childNodes[1])||(en(t=sn("g")).add("djs-children"),Wt(n.parentNode,t)):t=n,t},Kn.prototype._clear=function(e){var t=yt(".djs-visual",e);return et(t),t},Kn.prototype._createContainer=function(e,t,n){var r=sn("g");en(r).add("djs-group"),void 0!==n?Yn(r,t,t.childNodes[n]):Wt(t,r);var o=sn("g");en(o).add("djs-element"),en(o).add("djs-"+e),Wt(r,o);var i=sn("g");return en(i).add("djs-visual"),Wt(o,i),o},Kn.prototype.create=function(e,t,n){var r=this._getChildren(t.parent);return this._createContainer(e,r,n)},Kn.prototype.updateContainments=function(e){var r=this,o=this._elementRegistry;_(x(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),function(e){var t=e.children;if(t){var n=r._getChildren(e);_(t.slice().reverse(),function(e){Yn(o.getGraphics(e).parentNode,n)})}})},Kn.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Kn.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Kn.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Kn.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Kn.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),Xn(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(r,t)}t.hidden?Jt(n,"display","none"):Jt(n,"display","block")}},Kn.prototype.remove=function(e){nn(this._elementRegistry.getGraphics(e).parentNode)};var er={__depends__:[On],__init__:["canvas"],canvas:["type",Pn],elementRegistry:["type",Tn],elementFactory:["type",Hn],eventBus:["type",C],graphicsFactory:["type",Kn]};function tr(e){var r=[],o=[];function i(e){return 0<=r.indexOf(e)}e.forEach(function e(t){var n;i(t)||((t.__depends__||[]).forEach(e),i(t)||(n=t,r.push(n),(t.__init__||[]).forEach(function(e){o.push(e)})))});var t=new $t(r);return o.forEach(function(e){try{t["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}}),t}function nr(e,t){var n;this.injector=t=t||tr([{config:["value",n=(n=e)||{}]},er].concat(n.modules||[])),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}nr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},nr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var rr,or=(rr=Object.freeze({default:nr}))&&rr.default||rr;function ir(e,t){var n=ar(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function ar(e){return e&&e.businessObject||e}function sr(n,e){var a=[];function s(e,t){if(e.gfx)throw new Error("already rendered "+e.id);return n.element(e,t)}function r(t){var n=[];!function(e,t){var n=e.extensionElements;if(!n)return;_(n.values,t)}(t,function(e){ir(e,"biodi:Bounds")?s(t,e):ir(e,"biodi:Edge")&&n.push(e)}),function(i,t){function n(e,t){var n,r=(n=t)&&n.href.slice(1),o=g(i,p({source:r}));o&&a.push(function(){s(e,o)})}if(ir(t,"dmn:Association"))return n(t,t.sourceRef);_(["informationRequirement","knowledgeRequirement","authorityRequirement"],function(e){_(t[e],function(t){var e=null;ir(t,"dmn:InformationRequirement")?e=["requiredDecision","requiredInput"]:ir(t,"dmn:KnowledgeRequirement")?e=["requiredKnowledge"]:ir(t,"dmn:AuthorityRequirement")&&(e=["requiredDecision","requiredInput","requiredAuthority"]),e&&_(e,function(e){t[e]&&n(t,t[e])})})})}(n,t)}return{handleDefinitions:function(t){n.root(t),_(["decision","drgElements","artifacts"],function(e){t[e]&&_(t[e],r)}),_(a,function(e){e()})}}}var ur=0,cr={width:150,height:50};function lr(e,t){var n;t.textContent=e;try{var r,o=""===e;return t.textContent=o?"dummy":e,r={width:(n=t.getBBox()).width+2*n.x,height:n.height},o&&(r.width=0),r}catch(e){return{width:0,height:0}}}function fr(e,t,n){for(var r,o=e.shift(),i=o;;){if((r=lr(i,n)).width=i?r.width:0," "===i||""===i||r.widthe?t.width:e},0),g=c.top;"middle"===u.vertical&&(g+=(a.height-m)/2),g-=(f||h[0].height)/4;var b=sn("text");return Jt(b,s),_(h,function(e){var t;switch(g+=f||e.height,u.horizontal){case"left":t=c.left;break;case"right":t=(l?v:d)-c.right-e.width;break;default:t=Math.max(((l?v:d)-e.width)/2+c.left,0)}var n=sn("tspan");Jt(n,{x:t,y:g}),n.textContent=e.text,Wt(b,n)}),nn(y),{dimensions:{width:v,height:m},element:b}},Ut(yr,zt),yr.$inject=["eventBus","pathMap","styles"];var vr=/\{([^}]+)\}/g,gr=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var br={__init__:["drdRenderer"],drdRenderer:["type",yr],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];r=t.abspos?(n=t.abspos.x,t.abspos.y):(n=t.containerWidth*t.position.mx,t.containerHeight*t.position.my);var i,a,s={};if(t.position){for(var u=t.containerHeight/o.height*t.yScaleFactor,c=t.containerWidth/o.width*t.xScaleFactor,l=0;l");return i(r,t,n)},this.mouseHandler=c,this.registerEvent=r,this.unregisterEvent=h}jr.$inject=["eventBus","elementRegistry","styles"];var Ar={__init__:["interactionEvents"],interactionEvents:["type",jr]};function Pr(e,t,n){this.offset=6;var r=t.cls("djs-outline",["no-fill"]),o=this;function i(e,t){var n=sn("rect");return Jt(n,O({x:10,y:10,width:100,height:100},r)),Wt(e,n),n}e.on(["shape.added","shape.changed"],500,function(e){var t=e.element,n=e.gfx,r=yt(".djs-outline",n);r||(r=i(n)),o.updateShapeOutline(r,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,r=yt(".djs-outline",n);r||(r=i(n)),o.updateConnectionOutline(r,t)})}Pr.prototype.updateShapeOutline=function(e,t){Jt(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Pr.prototype.updateConnectionOutline=function(e,t){var n=kn(t);Jt(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Pr.$inject=["eventBus","styles","elementRegistry"];var Nr={__init__:["outline"],outline:["type",Pr]};function Br(e){this._eventBus=e,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(e){var t=e.element;n.deselect(t)}),e.on(["diagram.clear"],function(e){n.select(null)})}Br.$inject=["eventBus"],Br.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}},Br.prototype.get=function(){return this._selectedElements},Br.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Br.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();y(e)||(e=e?[e]:[]),t?_(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 Tr="selected";function Rr(e,n,t,r){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;_(t,function(e){-1===n.indexOf(e)&&i(e,Tr)}),_(n,function(e){-1===t.indexOf(e)&&o(e,Tr)})})}function Dr(e,i,a,r){e.on("create.end",500,function(e){e.context.canExecute&&i.select(e.context.shape)}),e.on("connect.end",500,function(e){e.context.canExecute&&e.context.target&&i.select(e.context.target)}),e.on("shape.move.end",500,function(e){var t=e.previousSelection||[],n=r.get(e.context.shape.id);g(t,function(e){return n.id===e.id})||i.select(n)}),e.on("element.click",function(e){var t=e.element;t===a.getRootElement()&&(t=null);var n=i.isSelected(t),r=1'),o.insertBefore(i,o.firstChild),i),this._init()}function Lr(e,t,n){O(e.style,{left:t+"px",top:n+"px"})}function Ur(e,t){e.style.display=!1===t?"none":""}function Fr(t,n){t.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(e){t.style[e+"transform"]=n})}$r.$inject=["config.overlays","eventBus","canvas","elementRegistry"],$r.prototype.get=function(e){if(l(e)&&(e={id:e}),l(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?f(t.overlays,p({type:e.type})):t.overlays.slice():[]}return e.type?f(this._overlays,p({type:e.type})):e.id?this._overlays[e.id]:null},$r.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=O({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},$r.prototype.remove=function(e){var t=this.get(e)||[];y(t)||(t=[t]);var r=this;_(t,function(e){var t=r._getOverlayContainer(e.element,!0);if(e&&(mt(e.html),mt(e.htmlContainer),delete e.htmlContainer,delete e.element,delete r._overlays[e.id]),t){var n=t.overlays.indexOf(e);-1!==n&&t.overlays.splice(n,1)}})},$r.prototype.show=function(){Ur(this._overlayRoot)},$r.prototype.hide=function(){Ur(this._overlayRoot,!1)},$r.prototype.clear=function(){this._overlays={},this._overlayContainers=[],et(this._overlayRoot)},$r.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,o=t.y;if(t.waypoints){var i=kn(t);r=i.x,o=i.y}Lr(n,r,o),Ze(e.html,"data-container-id",t.id)},$r.prototype._updateOverlay=function(e){var t,n,r=e.position,o=e.htmlContainer,i=e.element,a=r.left,s=r.top;void 0!==r.right&&(t=i.waypoints?kn(i).width:i.width,a=-1*r.right+t);void 0!==r.bottom&&(n=i.waypoints?kn(i).height:i.height,s=-1*r.bottom+n);Lr(o,a||0,s||0)},$r.prototype._createOverlayContainer=function(e){var t=ft('
');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},$r.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Fr(this._overlayRoot,n)},$r.prototype._getOverlayContainer=function(t,e){var n=g(this._overlayContainers,function(e){return e.element===t});return n||e?n:this._createOverlayContainer(t)},$r.prototype._addOverlay=function(e){var t,n,r=e.id,o=e.element,i=e.html;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),l(i)&&(i=ft(i)),n=this._getOverlayContainer(o),(t=ft('
')).appendChild(i),e.type&&Ke(t).add("djs-overlay-"+e.type),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},$r.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=n&&n.minZoom,o=n&&n.maxZoom,i=e.htmlContainer,a=!0;n&&((u(r)&&r>t.scale||u(o)&&or&&(o=(1/t.scale||1)*r)),u(o)&&(s="scale("+o+","+o+")"),Fr(a,s)},$r.prototype._updateOverlaysVisibilty=function(t){var n=this;_(this._overlays,function(e){n._updateOverlayVisibilty(e,t)})},$r.prototype._init=function(){var e=this._eventBus,o=this;e.on("canvas.viewbox.changing",function(e){o.hide()}),e.on("canvas.viewbox.changed",function(e){var t;t=e.viewbox,o._updateRoot(t),o._updateOverlaysVisibilty(t),o.show()}),e.on(["shape.remove","connection.remove"],function(e){var t=e.element;_(o.get({element:t}),function(e){o.remove(e.id)});var n=o._getOverlayContainer(t);if(n){mt(n.html);var r=o._overlayContainers.indexOf(n);-1!==r&&o._overlayContainers.splice(r,1)}}),e.on("element.changed",500,function(e){var t=e.element,n=o._getOverlayContainer(t,!0);n&&(_(n.overlays,function(e){o._updateOverlay(e)}),o._updateOverlayContainer(n))}),e.on("element.marker.update",function(e){var t=o._getOverlayContainer(e.element,!0);t&&Ke(t.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var zr={__init__:["overlays"],overlays:["type",$r]};function Gr(e,t){this._eventBus=e,this._canvas=t,e.on("diagram.init",function(){this._init()},this),e.on("import.done",function(e){this.update()},this)}function Wr(e,n){function t(e,t){Ke(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)})}Gr.$inject=["eventBus","canvas"],Gr.prototype._init=function(){var e=this._canvas,t=this._eventBus,n=e.getContainer(),r=this._container=ft(Gr.HTML_MARKUP);n.appendChild(r),this.nameElement=yt(".dmn-definitions-name",this._container),this.idElement=yt(".dmn-definitions-id",this._container),lt.bind(r,".dmn-definitions-name, .dmn-definitions-id","mousedown",function(e){e.stopPropagation()}),t.fire("definitionIdView.create",{html:r})},Gr.prototype.update=function(e){var t=this._canvas.getRootElement().businessObject;this.nameElement.textContent=t.name,this.idElement.textContent=t.id},Gr.HTML_MARKUP='
',Wr.$inject=["eventBus","canvas"];var qr={__init__:["definitionPropertiesView","definitionPropertiesPaletteAdapter"],definitionPropertiesView:["type",Gr],definitionPropertiesPaletteAdapter:["type",Wr]},Zr=function(){function r(e,t){for(var n=0;n\n \n
\n '),r=this._overlays.add(e,{position:{top:2,left:2},html:n});!1!==this._config.enabled&&(Ke(n).add("interactive"),this.bindEventListener(e,n,r))}},{key:"bindEventListener",value:function(e,t,n){var r=this,o=this._overlays,i=this._eventBus,a=o._overlayRoot;lt.bind(a,'[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;var n=t.getView(e.businessObject);return!!n&&(t.open(n),!0)}}]),o}();Jr.$inject=["injector","eventBus","overlays","config.drillDown"];var Hr={__depends__:[zr],__init__:["drillDown"],drillDown:["type",Jr]},Xr=''))+'" />'; /** * This file must not be changed or exchanged. * * @see http://bpmn.io/license for more information. */function Kr(e){return e.join(";")}var Yr,eo='
'+Xr+'Web-based tooling for BPMN, DMN and CMMN diagrams powered by bpmn.io.
';var to=Object.assign||function(e){for(var t=1;t'+Xr+""),t.appendChild(n),ut.bind(n,"click",function(e){Yr||(Yr=ft(eo),lt.bind(Yr,".backdrop","click",function(e){document.body.removeChild(Yr)})),document.body.appendChild(Yr),e.preventDefault()}),this._init(this._container,e)}Ut(ro,or),ro.prototype.saveSVG=function(e,t){t||(t=e,e={});var n=this.get("canvas"),r=n.getDefaultLayer(),o=yt("defs",n._svg),i=mn(r),a=o&&o.outerHTML||"",s=r.getBBox();t(null,'\n\x3c!-- created with dmn-js / http://bpmn.io --\x3e\n\n'+a+i+"")},ro.prototype.getModules=function(){return this._modules},ro.prototype.destroy=function(){or.prototype.destroy.call(this),mt(this._container)},ro.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},ro.prototype.off=function(e,t){this.get("eventBus").off(e,t)},ro.prototype._init=function(e,t){var n=t.additionalModules,r=t.canvas,o=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["additionalModules","canvas"]),i=t.modules||this.getModules(),a=[].concat([{drd:["value",this]}],no(i),no(n||[])),s=to({},o,{canvas:to({},r,{container:e}),modules:a});or.call(this,s),t&&t.container&&this.attachTo(t.container)},ro.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},ro.prototype._createContainer=function(){return ft('
')},ro.prototype.open=function(e,t){var n;try{return this._definitions&&this.clear(),this._definitions=e,function(e,t,n){var r,o,i=e.get("drdImporter"),a=e.get("eventBus"),s=[];a.fire("import.start",{definitions:t});try{o=t,new sr({root:function(e){return i.root(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){s.push({message:e,context:t})}}).handleDefinitions(o)}catch(e){r=e}a.fire("import.done",{error:r,warnings:s}),n(r,s)}(this,e,t)}catch(e){n=e}return t(n)},ro.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()},ro.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},ro.prototype._modules=[xr,Or,Mr,zr,qr,Hr];var oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function io(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":oo(t))&&"function"!=typeof t?e:t}function ao(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":oo(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function so(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var uo=function e(t){so(this,e),O(this,t),lo(this,"businessObject",{writable:!0})},co={root:function(e){function n(e){so(this,n);var t=io(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return lo(t,"rows",{enumerable:!0,value:t.rows||[]}),lo(t,"cols",{enumerable:!0,value:t.cols||[]}),t}return ao(n,uo),n}(),row:function(e){function n(e){so(this,n);var t=io(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return lo(t,"root",{writable:!0}),lo(t,"cells",{enumerable:!0,value:t.cells||[]}),t}return ao(n,uo),n}(),col:function(e){function n(e){so(this,n);var t=io(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return lo(t,"root",{writable:!0}),lo(t,"cells",{enumerable:!0,value:t.cells||[]}),t}return ao(n,uo),n}(),cell:function(e){function n(e){so(this,n);var t=io(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return lo(t,"row",{writable:!0}),lo(t,"col",{writable:!0}),t}return ao(n,uo),n}()};function lo(e,t,n){Object.defineProperty(e,t,n)}var fo=function(){function r(e,t){for(var n=0;n";var t=e.id?' id="'+e.id+'"':"";return"<"+e.$type+t+" />"}function da(s,e){function u(e,t,n){if(e.gfx)throw new Error("already rendered "+ha(e));return s.element(e,t,n)}function c(e,t,n){_(e,function(e){u(e,t,n)})}function l(e,t,n){_(e,function(e){u(e,t,n)})}return{handleDecision:function(e){e.id||(e.id="decision");var t=e.decisionTable;if(!t)throw new Error("no table for "+ha(e));if(!t.output)throw new Error("missing output for "+ha(t));var n,r,o,i,a=(i=t,s.table(i));t.input&&c(t.input,a,t),c(t.output,a,t),n=t.rule,r=a,o=t,_(n,function(e){u(e,r,o),l(e.inputEntry,e),l(e.outputEntry,e)})}}}function ya(){return Io(1,"th","annotation header",$o("Annotation"),2,{rowspan:"3"})}var ma="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},va="function"==typeof Symbol&&"symbol"===ma(Symbol.iterator)?function(e){return void 0===e?"undefined":ma(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":ma(e)},ga=Object.assign||function(e){for(var t=1;t: cannot combine with non-fn component value");r[e]=function(o){for(var e=arguments.length,i=Array(1";case"COUNT":return"#";default:return""}}(e.aggregation)],0,{rowspan:"3",title:"Hit Policy = "+t})}}]),t}();function Ns(e){e.onGetComponent("cell",function(e){if("before-label-cells"===e.cellType)return Ps})}Ns.$inject=["components"];var Bs={__init__:["hitPolicyProvider"],hitPolicyProvider:["type",Ns]},Ts="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},Rs=function(){function r(e,t){for(var n=0;n
')}}]),r}(),Ks=function(){function r(e,t){for(var n=0;n')}}]),r}();function qu(e){return!!g(e.drgElements,Zu)}function Zu(e){var t=e.extensionElements,n=t&&t.values;return n&&g(n,function(e){return ir(e,"biodi:Bounds")})}var Qu=function(){function r(e,t){for(var n=0;n