xref: /plugin/bpmnio/vendor/dmn-js/dist/dmn-viewer.production.min.js (revision 15138fe7f7159d148873552b1c475bbfbd565ffd)
1/*! dmn-js - dmn-viewer v6.0.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2!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<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e))},n)}}function b(e,t){return e.bind(t)}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function O(e){for(var t=arguments.length,n=Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return i.apply(void 0,[e].concat(n))}var k="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},S="__fn",E=Array.prototype.slice;function C(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function j(){}function A(){}function n(e,t){this.model=e,this.properties=t}C.prototype.on=function(e,t,n,r){if(e=y(e)?e:[e],c(t)&&(r=n,n=t,t=1e3),!s(t))throw new Error("priority must be a number");var o=n;r&&((o=b(n,r))[S]=n[S]||n);var i=this,a={priority:t,callback:o};e.forEach(function(e){i._addListener(e,a)})},C.prototype.once=function(e,t,n,r){var o=this;if(c(t)&&(r=n,n=t,t=1e3),!s(t))throw new Error("priority must be a number");function i(){return o.off(e,i),n.apply(r,arguments)}i[S]=n,this.on(e,t,i)},C.prototype.off=function(e,t){e=y(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},C.prototype.createEvent=function(e){var t=new j;return t.init(e),t},C.prototype.fire=function(e,t){var n,r,o,i;if(i=E.call(arguments),"object"===(void 0===e?"undefined":k(e))&&(e=(n=e).type),!e)throw new Error("no event type specified");if(r=this._listeners[e]){n=t instanceof j?t:this.createEvent(t);var a=(i[0]=n).type;e!==a&&(n.type=e);try{o=this._invokeListeners(n,i,r)}finally{e!==a&&(n.type=a)}return void 0===o&&n.defaultPrevented&&(o=!1),o}},C.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},C.prototype._destroy=function(){this._listeners={}},C.prototype._invokeListeners=function(e,t,n){var r,o,i;for(r=0;(o=n[r])&&!e.cancelBubble;r++)i=this._invokeListener(e,t,o);return i},C.prototype._invokeListener=function(e,t,n){var r,o,i;try{o=n.callback,i=t,void 0!==(r=o.apply(null,i))&&(e.returnValue=r,e.stopPropagation()),!1===r&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener"),console.error(e.stack),e}return r},C.prototype._addListener=function(e,t){var n,r,o=this._getListeners(e);for(r=0;n=o[r];r++)if(n.priority<t.priority)return void o.splice(r,0,t);o.push(t)},C.prototype._getListeners=function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t},C.prototype._removeListener=function(e,t){var n,r,o,i=this._getListeners(e);if(t)for(o=i.length-1;n=i[o];o--)(r=n.callback)!==t&&r[S]!==t||i.splice(o,1);else i.length=0},j.prototype.stopPropagation=function(){this.cancelBubble=!0},j.prototype.preventDefault=function(){this.defaultPrevented=!0},j.prototype.init=function(e){O(this,e||{})},A.prototype.get=function(e){return this.$model.properties.get(this,e)},A.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},n.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(A.prototype);_(e.properties,function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var o=e.ns.name;function i(e){n.define(this,"$type",{value:o,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),_(e,b(function(e,t){this.set(t,e)},this))}return i.prototype=r,i.hasType=r.$instanceOf=this.model.hasType,n.defineModel(i,t),n.defineDescriptor(i,e),i};var P={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},N={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};function B(e,t){var n=N[e];return n?n(t):t}function T(e){return!!P[e]}function R(e){return!!N[e]}function D(e,t){var n,r,o=e.split(/:/);if(1===o.length)n=e,r=t;else{if(2!==o.length)throw new Error("expected <prefix:localName> or <localName>, 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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();"undefined"!=typeof window&&window,
3/**
4   * Tiny stack for browser or server
5   *
6   * @author Jason Mulligan <jason.mulligan@avoidwork.com>
7   * @copyright 2018
8   * @license BSD-3-Clause
9   * @link http://avoidwork.github.io/tiny-stack
10   * @version 1.1.0
11   */
12r=function(){function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}
13/**
14   * Tiny stack for browser or server
15   *
16   * @author Jason Mulligan <jason.mulligan@avoidwork.com>
17   * @copyright 2018
18   * @license BSD-3-Clause
19   * @link http://avoidwork.github.io/tiny-stack
20   * @version 1.1.0
21   */(this,r);for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];this.data=[null].concat(t),this.top=this.data.length-1}return n(r,[{key:"clear",value:function(){return this.data.length=1,this.top=0,this}},{key:"empty",value:function(){return 0===this.top}},{key:"length",value:function(){return this.top}},{key:"peek",value:function(){return this.data[this.top]}},{key:"pop",value:function(){var e=void 0;return 0<this.top&&(e=this.data.pop(),this.top--),e}},{key:"push",value:function(e){return this.data[++this.top]=e,this}},{key:"search",value:function(e){var t=this.data.indexOf(e);return-1===t?-1:this.data.length-t}}]),r}(),e.exports=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return new(Function.prototype.bind.apply(r,[null].concat(t)))}}),z="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},G=String.fromCharCode,W=Object.prototype.hasOwnProperty,q=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Z={amp:"&",apos:"'",gt:">",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<e.length&&-1!==e.indexOf("&")?e.replace(q,Q):e}Object.keys(Z).forEach(function(e){Z[e.toUpperCase()]=Z[e]});var H="http://www.w3.org/2001/XMLSchema-instance",X="xsi",K="xsi:type",Y="non-whitespace outside of root node";function ee(e){return new Error(e)}function te(e){return"missing namespace for prefix <"+e+">"}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 <name, cb>");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 <nsMap={}>");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 <xml=string>");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<y;h++)if(u=!1,!(32===(c=d.charCodeAt(h))||c<14&&8<c)){for((c<65||122<c||90<c&&c<97)&&95!==c&&58!==c&&(M("illegal first char attribute name"),u=!0),l=h+1;l<y;l++)if(!(96<(c=d.charCodeAt(l))&&c<123||64<c&&c<91||47<c&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&8<c){M("missing attribute value"),h=l;continue e}if(61===c)break;M("illegal attribute name char"),u=!0}if("xmlns:xmlns"===(s=d.substring(h,l))&&(M("illegal declaration of xmlns"),u=!0),34===(c=d.charCodeAt(l+1)))-1===(l=d.indexOf('"',h=l+2))&&-1!==(l=d.indexOf("'",h))&&(M("attribute value quote missmatch"),u=!0);else if(39===c)-1===(l=d.indexOf("'",h=l+2))&&-1!==(l=d.indexOf('"',h))&&(M("attribute value quote missmatch"),u=!0);else for(M("missing attribute value quotes"),u=!0,l+=1;l<y&&!(32===(c=d.charCodeAt(l+1))||c<14&&8<c);l++);for(-1===l&&(M("missing closing quotes"),l=y,u=!0),u||(i=d.substring(h,l)),h=l;l+1<y&&!(32===(c=d.charCodeAt(l+1))||c<14&&8<c);l++)h===l&&(M("illegal character after attribute end"),u=!0);if(h=l+1,!u)if(s in v)M("attribute <"+s+"> 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<y;h++){if(s=p[h++],i=p[h],-1!==(c=s.indexOf(":"))){if(!(n=b[s.substring(0,c)])){M(te(s.substring(0,c)));continue}(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}return g=m}N=function(){for(var e,t=/(\r\n|\r|\n)/g,n=0,r=0,o=0,i=y;o<=d&&(e=t.exec(a))&&(i=e[0].length+e.index,!(d<i));)n+=1,o=i;return{data:-1==d?(r=i,a.substring(y)):0===y?(console.log(d-o),a.substring(y,d)):(r=d-o,-1==y?a.substring(d):a.substring(d,y+1)),line:n,column:r}},P&&(c=Object.create({},{name:ne(function(){return s}),originalName:ne(function(){return u}),attrs:ne(m),ns:ne(function(){return b})}));for(;-1!==y;){if(-1===(d=60===a.charCodeAt(y)?y:a.indexOf("<",y)))return f.length?D("unexpected end of file"):0===y?D("missing start tag"):y<a.length&&a.substring(y).trim()&&M(Y);if(y!==d)if(f.length){if(v&&(v(a.substring(y,d),J,N),R))return}else if(a.substring(y,d).trim()&&(M(Y),R))return;if(33!==(o=a.charCodeAt(d+1)))if(63!==o){if(-1==(y=a.indexOf(">",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<y;r++)if(!(32===(o=a.charCodeAt(r))||8<o&&o<14))return D("close tag")}else{if(h=47===a.charCodeAt(y-1)?(t=s=a.substring(d+1,y-1),p=!0):(t=s=a.substring(d+1,y),!(p=!0)),!(96<o&&o<123||64<o&&o<91||95===o||58===o))return D("illegal first char nodeName");for(r=1,n=t.length;r<n;r++)if(!(96<(o=t.charCodeAt(r))&&o<123||64<o&&o<91||47<o&&o<59||45===o||95===o||46==o)){if(32===o||o<14&&8<o){s=t.substring(0,r),g=null;break}return D("invalid nodeName")}h||f.push(s)}if(T){if(e=b,p&&(h||l.push(e),null===g&&(B=-1!==t.indexOf("xmlns",r))&&(x=r,_=t,m(),B=!1)),-1!==(o=(u=s).indexOf(":"))){if(!(i=b[s.substring(0,o)]))return D("missing namespace on <"+u+">");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('<?xml version="1.0" encoding="UTF-8"?>\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+"</"+this.tagName+">").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("</"+this.tagName+">").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("</"+this.tagName+">")),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<e.length;++n)if(e[n]===t)return n;return-1},He=/\s+/,Xe=Object.prototype.toString;function Ke(e){return new Ye(e)}function Ye(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function et(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}Ye.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Je(t,e)||t.push(e),this.el.className=t.join(" "),this},Ye.prototype.remove=function(e){if("[object RegExp]"==Xe.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Je(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},Ye.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ye.prototype.toggle=function(e,t){return this.list?void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e):void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this},Ye.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(He);return""===e[0]&&e.shift(),e},Ye.prototype.has=Ye.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Je(this.array(),e)};var tt=Element.prototype,nt=tt.matchesSelector||tt.webkitMatchesSelector||tt.mozMatchesSelector||tt.msMatchesSelector||tt.oMatchesSelector,rt=function(e,t){if(nt)return nt.call(e,t);for(var n=e.parentNode.querySelectorAll(t),r=0;r<n.length;++r)if(n[r]==e)return!0;return!1};var ot,it=window.addEventListener?"addEventListener":"attachEvent",at=window.removeEventListener?"removeEventListener":"detachEvent",st="addEventListener"!==it?"on":"",ut={bind:function(e,t,n,r){return e[it](st+t,n,r||!1),n},unbind:function(e,t,n,r){return e[at](st+t,n,r||!1),n}},ct=["focus","blur"],lt={bind:function(n,r,e,o,t){return-1!==ct.indexOf(e)&&(t=!0),ut.bind(n,e,function(e){var t=e.target||e.srcElement;e.delegateTarget=function(e,t,n){for(var r=n?e:e.parentNode;r&&r!==document;){if(rt(r,t))return r;r=r.parentNode}}(t,r,!0),e.delegateTarget&&o.call(n,e)},t)},unbind:function(e,t,n,r){-1!==ct.indexOf(t)&&(r=!0),ut.unbind(e,t,n,r)}},ft=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){var o=t.createElement("html");return o.innerHTML=e,o.removeChild(o.lastChild)}var i=ht[r]||ht._default,a=i[0],s=i[1],u=i[2];(o=t.createElement("div")).innerHTML=s+e+u;for(;a--;)o=o.lastChild;if(o.firstChild==o.lastChild)return o.removeChild(o.firstChild);var c=t.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.removeChild(o.firstChild));return c},pt=!1;"undefined"!=typeof document&&((ot=document.createElement("div")).innerHTML='  <link/><table></table><a href="/a">a</a><input type="checkbox"/>',pt=!ot.getElementsByTagName("link").length,ot=void 0);var ht={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:pt?[1,"X<div>","</div>"]:[0,"",""]};ht.td=ht.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],ht.option=ht.optgroup=[1,'<select multiple="multiple">',"</select>"],ht.thead=ht.tbody=ht.colgroup=ht.caption=ht.tfoot=[1,"<table>","</table>"],ht.polyline=ht.ellipse=ht.polygon=ht.circle=ht.text=ht.line=ht.path=ht.rect=ht.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];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<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bt="function"==typeof Symbol&&"symbol"===vt(Symbol.iterator)?function(e){return void 0===e?"undefined":vt(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":vt(e)},wt=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function _t(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var xt={width:"100%",height:"100%",position:"relative"},Ot=function(){function n(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._viewsChanged=function(){e._emit("views.changed",{views:e._views,activeView:e._activeView})},this._eventBus=new C,this._viewsChanged=v(this._viewsChanged,0),this._views=[],this._viewers={},this._init(t)}return wt(n,[{key:"importXML",value:function(e,i,a){var s=this;"object"!==(void 0===i?"undefined":bt(i))&&(a=i,i={open:!0}),"function"!=typeof a&&(a=kt),e=this._emit("import.parse.start",{xml:e})||e,this._moddle.fromXML(e,"dmn:Definitions",function(e,t,n){t=s._emit("import.parse.complete",{error:e,definitions:t,context:n})||t;var r=n.warnings;if(s._setDefinitions(t),e&&(e=function(e){var t=/unparsable content <([^>]+)> 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('<div class="dmn-js-parent"></div>'),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<arguments.length&&void 0!==arguments[1]?arguments[1]:kt;this._switchView(e,t)}},{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 o=this._getViewProviders(),t=[e].concat(_t(e.drgElements||[]));this._views=t.reduce(function(e,t){var n=Et(o,function(e){return"string"==typeof e.opens?e.opens===t.$type:e.opens(t)});if(!n)return e;var r={element:t,type:n.id};return[].concat(_t(e),[r])},[]);var n,r=this._activeView;if(r){if(n=Et(this._views,function(e){return Ct(r,e)})||this._getInitialView(this._views),!Ct(r,n))return this._switchView(null);this._activeView=n}this._viewsChanged()}},{key:"_getInitialView",value:function(e){return e[0]}},{key:"_switchView",value:function(n){var e,r=this,o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:kt,i=function(e,t){r._viewsChanged(),o(e,t)},t=this.getActiveView(),a=n&&this._getViewer(n),s=n&&n.element;if(t&&(e=this._getViewer(t))!==a&&(jt(e,"clear"),e.detach()),this._activeView=n,a)return e!==a&&a.attachTo(this._container),this._emit("import.render.start",{view:n,element:s}),a.open(s,function(e,t){r._emit("import.render.complete",{view:n,error:e,warnings:t}),i(e,t)});i()}},{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=Et(this._getViewProviders(),function(e){return e.id===t});if(!e)throw new Error("no provider for view type <"+t+">");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<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function $t(e,i){i=i||{get:function(e,t){if(a.push(e),!1===t)return null;throw u('No provider for "'+e+'"!')}};var a=[],p=this._providers=Object.create(i._providers||null),s=this._instances=Object.create(null),h=s.injector=this,u=function(e){var t=a.join(" -> ");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<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e){if(!Nt(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=Bt(e.slice())}return{fn:e,dependencies:(e.$inject||Mt(e)).map(function(e){return Lt(t,e)?t[e]:n(e)})}},t=function(e){var t=c(e),n=t.dependencies,r=t.fn;return new(Function.prototype.bind.apply(r,[null].concat(Vt(n))))},r=function(e,t,n){var r=c(e,n),o=r.dependencies,i=r.fn;return i.call.apply(i,[t].concat(Vt(o)))},d=function(t){return Bt(function(e){return t.get(e)})},l={factory:r,type:t,value:function(e){return e}};e.forEach(function(r){function o(e,t){return"value"!==e&&Nt(t)&&(t=Bt(t.slice())),t}if(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],r=e[2];p[t]=[l[n],o(n,r),n]});else if("object"===(void 0===r?"undefined":It(r)))if(r.__exports__){var e=Object.keys(r).reduce(function(e,t){return"__"!==t.substring(0,2)&&(e[t]=r[t]),e},Object.create(null)),t=new $t((r.__modules__||[]).concat([e]),h),n=Bt(function(e){return t.get(e)});r.__exports__.forEach(function(e){p[e]=[n,e,"private",t]})}else Object.keys(r).forEach(function(e){if("private"!==r[e][2]){var t=r[e][0],n=r[e][1];p[e]=[l[t],o(t,n),t]}else p[e]=r[e]})}),this.get=n,this.invoke=r,this.instantiate=t,this.createChild=function(e,t){if(t&&t.length){var n,r,o,i,a=Object.create(null),s=Object.create(null),u=[],c=[],l=[];for(var f in p)n=p[f],-1!==t.indexOf(f)&&("private"===n[2]?(r=u.indexOf(n[3]),a[f]=-1===r?(o=n[3].createChild([],t),i=d(o),u.push(n[3]),c.push(o),l.push(i),[i,f,"private",o]):[l[r],f,"private",c[r]]):a[f]=[n[2],n[1]],s[f]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(a[f]=[n[2],n[1]],s[e]=!0)});t.forEach(function(e){if(!s[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(a)}return new $t(e,h)}}function Lt(e,t){return Object.hasOwnProperty.call(e,t)}var Ut=e(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;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),Ft=1e3;function zt(e,t){var i=this;t=t||Ft,e.on(["render.shape","render.connection"],t,function(e,t){var n=e.type,r=t.element,o=t.gfx;if(i.canRender(r))return"render.shape"===n?i.drawShape(o,r):i.drawConnection(o,r)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(e,t){if(i.canRender(t))return"render.getShapePath"===e.type?i.getShapePath(t):i.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 Wt(e,t){return Gt(t,e),e}zt.prototype.canRender=function(){},zt.prototype.drawShape=function(){},zt.prototype.drawConnection=function(){},zt.prototype.getShapePath=function(){},zt.prototype.getConnectionPath=function(){};var qt=2,Zt={"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":qt,"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":qt,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Qt(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=Zt[r];o?(o===qt&&"number"==typeof n&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function Jt(e,t,n){if("string"==typeof t){if(void 0===n)return r=e,Zt[o=t]?r.style[o]:r.getAttributeNS(null,o);Qt(e,t,n)}else!function(e,t){var n,r,o=Object.keys(t);for(n=0;r=o[n];n++)Qt(e,r,t[r])}(e,t);var r,o;return e}function Ht(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var Xt=/\s+/,Kt=Object.prototype.toString;function Yt(e){return void 0!==e}function en(e){return new tn(e)}function tn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function nn(e){var t=e.parentNode;return t&&t.removeChild(e),e}tn.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Ht(t,e)||t.push(e),Yt(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},tn.prototype.remove=function(e){if("[object RegExp]"===Kt.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Ht(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},tn.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},tn.prototype.toggle=function(e,t){return this.list?Yt(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e):Yt(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this},tn.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(Xt);return""===e[0]&&e.shift(),e},tn.prototype.has=tn.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Ht(this.array(),e)};var rn={svg:"http://www.w3.org/2000/svg"},on='<svg xmlns="'+rn.svg+'"';function an(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(rn.svg)&&(e=on+e.substring(4)):(e=on+">"+e+"</svg>",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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};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<r;++n)i=o.item(n),t.push(" ",i.name,'="',hn(i.value,fn),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,r=(a=e.childNodes).length;n<r;++n)dn(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",hn(e.nodeValue,ln),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");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<o.length;i++)Gt(o[i],e)}}function mn(e,t){if(void 0===t)return function(e){for(var t=e.firstChild,n=[];t;)dn(t,n),t=t.nextSibling;return n.join("")}(e);try{yn(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}function vn(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function gn(e,t){var n=e.transform.baseVal;if(1===arguments.length)return n.consolidate();t.length?function(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(vn(e,r));e.consolidate()}(n,t):n.initialize(vn(n,t))}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=sn("polyline");return Jt(n,{points:wn(e)}),t&&Jt(n,t),n}function xn(e,t){zt.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2})}Ut(xn,zt),xn.prototype.canRender=function(){return!0},xn.prototype.drawShape=function(e,t){var n=sn("rect");return Jt(n,{x:0,y:0,width:t.width||0,height:t.height||0}),Jt(n,this.SHAPE_STYLE),Wt(e,n),n},xn.prototype.drawConnection=function(e,t){var n=_n(t.waypoints,this.CONNECTION_STYLE);return Wt(e,n),n},xn.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width;return bn([["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]])},xn.prototype.getConnectionPath=function(e){var t,n,r=e.waypoints,o=[];for(t=0;n=r[t];t++)n=n.original||n,o.push([0===t?"M":"L",n.x,n.y]);return bn(o)},xn.$inject=["eventBus","styles"];var On={__init__:["defaultRenderer"],defaultRenderer:["type",xn],styles:["type",function(){var r={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},o=this;this.cls=function(e,t,n){return O(this.style(t,n),{class:e})},this.style=function(e,t){y(e)||t||(t=e,e=[]);var n=x(e,function(e,t){return O(e,r[t]||{})},{});return t?O(n,t):n},this.computeStyle=function(e,t,n){return y(t)||(n=t,t=[]),o.style(t||[],O({},n,e||{}))}}]};function kn(e,a){var s,u,c,l;return a=!!a,y(e)||(e=[e]),_(e,function(e){var t=e;e.waypoints&&!a&&(t=kn(e.waypoints,!0));var n=t.x,r=t.y,o=t.height||0,i=t.width||0;(n<s||void 0===s)&&(s=n),(r<u||void 0===u)&&(u=r),(c<n+i||void 0===c)&&(c=n+i),(l<r+o||void 0===l)&&(l=r+o)}),{x:s,y:u,height:l-u,width:c-s}}var Sn="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 En(e,t){return Math.round(e*t)/t}function Cn(e){return s(e)?e+"px":e}function jn(e,t,n){var r=sn("g");en(r).add(t);var o=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[o]||null),r}var An={shape:["x","y","width","height"],connection:["waypoints"]};function Pn(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._init(e||{})}function Nn(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Pn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Pn.prototype._init=function(e){var t,n,r,o=this._eventBus,i=this._container=(n=(t=O({},{width:"100%",height:"100%"},t=e)).container||document.body,(r=document.createElement("div")).setAttribute("class","djs-container"),O(r.style,{position:"relative",overflow:"hidden",width:Cn(t.width),height:Cn(t.height)}),n.appendChild(r),r),a=this._svg=sn("svg");Jt(a,{width:"100%",height:"100%"}),Wt(i,a);var s=this._viewport=jn(a,"viewport");!(this._layers={})!==e.deferUpdate&&(this._viewboxChanged=v(b(this._viewboxChanged,this),300)),o.on("diagram.init",function(){o.fire("canvas.init",{svg:a,viewport:s})},this),o.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed"],function(){delete this._cachedViewbox},this),o.on("diagram.destroy",500,this._destroy,this),o.on("diagram.clear",500,this._clear,this)},Pn.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._rootElement,delete this._viewport},Pn.prototype._clear=function(){var r=this;this._elementRegistry.getAll().forEach(function(e){var t,n="waypoints"in(t=e)?"connection":"x"in t?"shape":"root";"root"===n?r.setRootElement(null,!0):r._removeElement(e,n)}),delete this._cachedViewbox},Pn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Pn.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},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.width<Math.round(t)||i.length<2)return pr(e,i,o,r);i=hr(i,r.width,t)}}function pr(e,t,n,r){if(t.length<n.length){var o=n.slice(t.length).trim();e.unshift(o)}return{width:r.width,height:r.height,text:t}}function hr(e,t,n){var r=Math.max(e.length*(n/t),1),o=function(e,t){var n,r=e.split(/(\s|-)/g),o=[],i=0;if(1<r.length)for(;n=r.shift();){if(!(n.length+i<t)){"-"===n&&o.pop();break}o.push(n),i+=n.length}return o.join("")}(e,r);return o||(o=e.slice(0,Math.max(Math.round(r-1),1))),o}function dr(e){this._config=O({},{size:cr,padding:ur,style:{},align:"center-top"},e||{})}function yr(e,o,r){zt.call(this,e);var i=new dr({style:{fontFamily:"Arial, sans-serif",fontSize:"12px"},size:{width:100}}),c={};function a(e){return"url(#"+c[e].id+")"}function t(u){function e(e,t){var n=O({strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),r=t.ref||{x:0,y:0},o=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var i=sn("marker");Jt(t.element,n),Wt(i,t.element),Jt(i,{id:e,viewBox:"0 0 20 20",refX:r.x,refY:r.y,markerWidth:20*o,markerHeight:20*o,orient:"auto"});var a,s=yt("defs",u);return s||(s=sn("defs"),Wt(u,s)),Wt(s,i),a=i,void(c[e]=a)}var t=sn("path");Jt(t,{d:"M 11 5 L 1 10 L 11 15"}),e("association-start",{element:t,attrs:{fill:"none",stroke:"black",strokeWidth:1.5},ref:{x:1,y:10},scale:.5});var n=sn("path");Jt(n,{d:"M 1 5 L 11 10 L 1 15"}),e("association-end",{element:n,attrs:{fill:"none",stroke:"black",strokeWidth:1.5},ref:{x:12,y:10},scale:.5});var r=sn("path");Jt(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),e("information-requirement-end",{element:r,ref:{x:11,y:10},scale:1});var o=sn("path");Jt(o,{d:"M 1 3 L 11 10 L 1 17"}),e("knowledge-requirement-end",{element:o,attrs:{fill:"none",stroke:"black",strokeWidth:2},ref:{x:11,y:10},scale:.8});var i=sn("circle");Jt(i,{cx:3,cy:3,r:3}),e("authority-requirement-end",{element:i,ref:{x:3,y:3},scale:.9})}function s(e,t,n){return y(t)||(n=t,t=[]),r.style(t||[],O(n,e||{}))}function u(e,t,n,r,o,i){w(o)&&(i=o,o=0),o=o||0,i=s(i,{stroke:"black",strokeWidth:2,fill:"white"});var a=sn("rect");return Jt(a,{x:o,y:o,width:t-2*o,height:n-2*o,rx:r,ry:r}),Jt(a,i),Wt(e,a),a}function l(e,t,n){var r=i.createText(t||"",n);return Ze(r,"class","djs-label"),Wt(e,r),r}function f(e,t,n){return l(e,ar(t).name,{box:t,align:n,padding:5})}function p(e,t,n){n=s(n,["no-fill"],{strokeWidth:2,stroke:"black"});var r=sn("path");return Jt(r,{d:t}),Jt(r,n),Wt(e,r),r}var h={"dmn:Decision":function(e,t,n){var r=u(e,t.width,t.height,0,n);return f(e,t,"center-middle"),r},"dmn:KnowledgeSource":function(e,t,n){var r=p(e,o.getScaledPath("KNOWLEDGE_SOURCE",{xScaleFactor:1.021,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.075}}),{strokeWidth:2,fill:"white",stroke:"black"});return f(e,t,"center-middle"),r},"dmn:BusinessKnowledgeModel":function(e,t,n){var r=p(e,o.getScaledPath("BUSINESS_KNOWLEDGE_MODEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.3}}),{strokeWidth:2,fill:"white",stroke:"black"});return f(e,t,"center-middle"),r},"dmn:InputData":function(e,t,n){var r=u(e,t.width,t.height,22,n);return f(e,t,"center-middle"),r},"dmn:TextAnnotation":function(e,t,n){var r=u(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return p(e,o.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}})),l(e,mr(t).text||"",{box:t,align:"left-middle",padding:5}),r},"dmn:Association":function(e,t,n){var r=mr(t);return n=O({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"},n||{}),"One"!==r.associationDirection&&"Both"!==r.associationDirection||(n.markerEnd=a("association-end")),"Both"===r.associationDirection&&(n.markerStart=a("association-start")),d(e,t.waypoints,n)},"dmn:InformationRequirement":function(e,t,n){return n=O({strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:a("information-requirement-end")},n||{}),d(e,t.waypoints,n)},"dmn:KnowledgeRequirement":function(e,t,n){return n=O({strokeWidth:1,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:a("knowledge-requirement-end")},n||{}),d(e,t.waypoints,n)},"dmn:AuthorityRequirement":function(e,t,n){return n=O({strokeWidth:1.5,strokeDasharray:5,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:a("authority-requirement-end")},n||{}),d(e,t.waypoints,n)}};function d(e,t,n){var r=_n(t,n=s(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return Wt(e,r),r}this.canRender=function(e){return ir(e,"dmn:DMNElement")||ir(e,"dmn:InformationRequirement")||ir(e,"dmn:KnowledgeRequirement")||ir(e,"dmn:AuthorityRequirement")},this.drawShape=function(e,t){var n=h[t.type];return n?n(e,t):zt.prototype.drawShape.apply(this,[e,t])},this.drawConnection=function(e,t){var n=t.type,r=h[n];return r?r(e,t):zt.prototype.drawConnection.apply(this,[e,t])},e.on("canvas.init",function(e){t(e.svg)})}function mr(e){return e.businessObject}dr.prototype.createText=function(e,t){return this.layoutText(e,t).element},dr.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},dr.prototype.layoutText=function(e,t){var n,r,o,i,a=O({},this._config.size,t.box),s=O({},this._config.style,t.style),u=(r=t.align||this._config.align,{horizontal:(o=r.split("-"))[0]||"center",vertical:o[1]||"top"}),c=w(n=void 0!==t.padding?t.padding:this._config.padding)?O({top:0,left:0,right:0,bottom:0},n):{top:n,left:n,right:n,bottom:n},l=t.fitBox||!1,f=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(s),p=e.split(/\r?\n/g),h=[],d=a.width-c.left-c.right,y=sn("text");for(Jt(y,{x:0,y:0}),Jt(y,s),Wt(((i=document.getElementById("helper-svg"))||(Jt(i=sn("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(i)),i),y);p.length;)h.push(fr(p,d,y));"middle"===u.vertical&&(c.top=c.bottom=0);var m=x(h,function(e,t,n){return e+(f||t.height)},0)+c.top+c.bottom,v=x(h,function(e,t,n){return t.width>e?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<o.heightElements.length;l++)s["y"+l]=o.heightElements[l]*u;for(var f=0;f<o.widthElements.length;f++)s["x"+f]=o.widthElements[f]*c}return i=o.d,a={mx:n,my:r,e:s},String(i).replace(vr,function(e,t){return n=e,i=r=a,t.replace(gr,function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))}),i=(null==i||i==r?n:i)+"";var n,r,i})}}]};function wr(e,t){return O({id:e.id,type:e.$type,businessObject:e},t)}function _r(e,t,n,r){this._eventBus=e,this._canvas=t,this._elementRegistry=r,this._elementFactory=n}_r.$inject=["eventBus","canvas","elementFactory","elementRegistry"],_r.prototype.root=function(e){var t=this._elementFactory.createRoot(wr(e));return this._canvas.setRootElement(t),t},_r.prototype.add=function(e,t){var n,r,o,i,a,s,u,c,l=this._elementFactory,f=this._canvas,p=this._eventBus;if(t.$instanceOf("biodi:Bounds"))a=wr(e,{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}),n=l.createShape(a),f.addShape(n),p.fire("drdElement.added",{element:n,di:t});else{if(!t.$instanceOf("biodi:Edge"))throw new Error("unknown di for element "+e.id);r=function(e){var t=e.waypoints;if(t)return h(t,function(e){var t={x:e.x,y:e.y};return O({original:t},t)})}(t),s=t.source,u=e.$parent.id,ir(e,"dmn:Association")&&(u=(c=e.targetRef)&&c.href.slice(1)),o=this._getShape(s),i=this._getShape(u),o&&i&&(a=wr(e,{hidden:!1,source:o,target:i,waypoints:r}),n=l.createConnection(a),f.addConnection(n),p.fire("drdElement.added",{element:n,di:t}))}return n},_r.prototype._getShape=function(e){return this._elementRegistry.get(e)};var xr={__depends__:[br,{drdImporter:["type",_r]}]};var Or={translate:["value",function(e,n){return n=n||{},e.replace(/{([^}]+)}/g,function(e,t){return n[t]||"{"+t+"}"})}]};function kr(e){return e.originalEvent||e.srcEvent}function Sr(e){return!(kr(e)||e).button}function Er(e){var t=kr(e)||e;return!!Sr(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function Cr(e){return!0}function jr(a,s,e){var o=e.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15});function i(e,t,n){var r,o,i;(r=t,(f[e]||Sr)(r))&&(n?i=s.getGraphics(n):(o=t.delegateTarget||t.target)&&(i=o,n=s.get(i)),i&&n&&!1===a.fire(e,{element:n,gfx:i,originalEvent:t})&&(t.stopPropagation(),t.preventDefault()))}var u={};function c(e){return u[e]}var l={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mouseup:"element.mouseup",contextmenu:"element.contextmenu"},f={"element.contextmenu":Cr};var p="svg, .djs-element";function r(e,t,n,r){var o=u[n]=function(e){i(n,e)};r&&(f[n]=r),o.$delegate=lt.bind(e,p,t,o)}function h(e,t,n){var r=c(n);r&&lt.unbind(e,t,r.$delegate)}a.on("canvas.destroy",function(e){var n;n=e.svg,_(l,function(e,t){h(n,t,e)})}),a.on("canvas.init",function(e){var n;n=e.svg,_(l,function(e,t){r(n,t,e)})}),a.on(["shape.added","connection.added"],function(e){var t,n=e.element,r=e.gfx;n.waypoints?t=_n(n.waypoints):Jt(t=sn("rect"),{x:0,y:0,width:n.width,height:n.height}),Jt(t,o),Wt(r,t)}),a.on("shape.changed",500,function(e){var t=e.element;Jt(yt(".djs-hit",e.gfx),{width:t.width,height:t.height})}),a.on("connection.changed",function(e){var t,n,r=e.element,o=yt(".djs-hit",e.gfx);t=o,n=r.waypoints,Jt(t,{points:wn(n)})}),this.fire=i,this.triggerMouseEvent=function(e,t,n){var r=l[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");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<i.get().length,o=Er(e);if(n&&r)return o?i.deselect(t):i.select(t);n?i.deselect(t):i.select(t,o)})}Rr.$inject=["eventBus","canvas","selection","styles"],Dr.$inject=["eventBus","selection","canvas","elementRegistry"];var Mr={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Ar,Nr],selection:["type",Br],selectionVisuals:["type",Rr],selectionBehavior:["type",Dr]};function Ir(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Ir.prototype.next=function(){return this._prefix+ ++this._counter};var Vr=new Ir("ov");function $r(e,t,n,r){var o,i;this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=Vr,this._overlayDefaults=O({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(o=n.getContainer(),i=ft('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),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('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},$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('<div class="djs-overlay" data-overlay-id="'+r+'" style="position: absolute">')).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)&&o<t.scale)&&(a=!1),Ur(i,a)),this._updateOverlayScale(e,t)},$r.prototype._updateOverlayScale=function(e,t){var n,r,o,i=e.scale,a=e.htmlContainer,s="";!0!==i&&(r=!1===i?n=1:(n=i.min,i.max),u(n)&&t.scale<n&&(o=(1/t.scale||1)*n),u(r)&&t.scale>r&&(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='<div class="dmn-definitions"><div class="dmn-definitions-name" title="Definition Name"></div><div class="dmn-definitions-id" title="Definition ID"></div></div>',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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Qr=[{className:"dmn-icon-decision-table",matches:function(e){var t=e.businessObject;return ir(t,"dmn:Decision")&&t.decisionTable}},{className:"dmn-icon-literal-expression",matches:function(e){var t=e.businessObject;return ir(t,"dmn:Decision")&&t.literalExpression}}],Jr=function(){function o(e,t,n,r){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this._injector=e,this._eventBus=t,this._overlays=n,this._config=r||{enabled:!0},t.on(["shape.added"],function(e){for(var t=e.element,n=0;n<Qr.length;n++){var r=Qr[n],o=r.matches,i=r.className;o&&o(t)&&a.addOverlay(t,i)}})}return Zr(o,[{key:"addOverlay",value:function(e,t){var n=ft('\n      <div class="drill-down-overlay">\n        <span class="'+t+'"></span>\n      </div>\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='<img width="52" height="52" src="'+("data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960"><path fill="#fff" d="M960 60v839c0 33-27 61-60 61H60c-33 0-60-27-60-60V60C0 27 27 0 60 0h839c34 0 61 27 61 60z"/><path fill="#52b415" d="M217 548a205 205 0 0 0-144 58 202 202 0 0 0-4 286 202 202 0 0 0 285 3 200 200 0 0 0 48-219 203 203 0 0 0-185-128zM752 6a206 206 0 0 0-192 285 206 206 0 0 0 269 111 207 207 0 0 0 111-260A204 204 0 0 0 752 6zM62 0A62 62 0 0 0 0 62v398l60 46a259 259 0 0 1 89-36c5-28 10-57 14-85l99 2 12 85a246 246 0 0 1 88 38l70-52 69 71-52 68c17 30 29 58 35 90l86 14-2 100-86 12a240 240 0 0 1-38 89l43 58h413c37 0 60-27 60-61V407a220 220 0 0 1-44 40l21 85-93 39-45-76a258 258 0 0 1-98 1l-45 76-94-39 22-85a298 298 0 0 1-70-69l-86 22-38-94 76-45a258 258 0 0 1-1-98l-76-45 40-94 85 22a271 271 0 0 1 41-47z"/></svg>'))+'" />';
22/**
23   * This file must not be changed or exchanged.
24   *
25   * @see http://bpmn.io/license for more information.
26   */function Kr(e){return e.join(";")}var Yr,eo='<div class="bjs-powered-by-lightbox" style="'+Kr(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+Kr(["width: 100%","height: 100%","background: rgba(0,0,0,0.2)"])+'"></div><div class="notice" style="'+Kr(["position: absolute","left: 50%","top: 40%","margin: 0 -130px","width: 260px","padding: 10px","background: white","border: solid 1px #AAA","border-radius: 3px","font-family: Helvetica, Arial, sans-serif","font-size: 14px","line-height: 1.2em"])+'"><a href="http://bpmn.io" target="_blank" style="float: left; margin-right: 10px">'+Xr+'</a>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="http://bpmn.io" target="_blank">bpmn.io</a>.</div></div>';var to=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function no(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function ro(e){
27/**
28   * Adds the project logo to the diagram container as
29   * required by the bpmn.io license.
30   *
31   * @see http://bpmn.io/license
32   *
33   * @param {Element} container
34   */
35var t,n;this._container=this._createContainer(),t=this._container,n=ft('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100">'+Xr+"</a>"),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,'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with dmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+a+i+"</svg>")},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('<div class="dmn-drd-container"></div>')},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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var po=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._uid=12}return fo(e,[{key:"create",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return t.id||(t.id=e+"_"+this._uid++),function(e,t){var n=co[e];if(!n)throw new Error("unknown type "+e);return new n(t)}(e,t)}},{key:"createRoot",value:function(e){return this.create("root",e)}},{key:"createRow",value:function(e){return this.create("row",e)}},{key:"createCol",value:function(e){return this.create("col",e)}},{key:"createCell",value:function(e){return this.create("cell",e)}}]),e}(),ho=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var yo=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._eventBus=e,this._elements={},e.on("table.clear",this.clear.bind(this))}return ho(t,[{key:"add",value:function(e,t){var n=e.id;this._elements[n]=e}},{key:"remove",value:function(e){var t=e.id||e;delete this._elements[t]}},{key:"get",value:function(e){return this._elements[e]}},{key:"getAll",value:function(){return mo(this._elements)}},{key:"forEach",value:function(t){mo(this._elements).forEach(function(e){return t(e)})}},{key:"filter",value:function(t){return mo(this._elements).filter(function(e){return t(e)})}},{key:"clear",value:function(){this._elements={}}},{key:"updateId",value:function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t}),this.remove(e),e.id=t,this.add(e)}},{key:"_validateId",value: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")}}]),t}();function mo(t){return Object.keys(t).map(function(e){return t[e]})}yo.$inject=["eventBus"];var vo=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var go=function(){function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners={},t.on("elements.changed",function(e){var t=e.elements;r.elementsChanged(t)}),t.on("root.remove",function(e){var n=e.root.id;r._listeners[n]&&t.once("root.add",function(e){var t=e.root.id;r.updateId(n,t)})}),t.on("element.updateId",function(e){var t=e.element,n=e.newId;r.updateId(t.id,n)})}return vo(e,[{key:"elementsChanged",value:function(e){for(var t={},n=e.length,r=0;r<n;r++){var o=e[r].id;if(t[o])return;t[o]=!0;var i=this._listeners[o]&&this._listeners[o].length;if(i)for(var a=0;a<i;a++)this._listeners[o][a]&&this._listeners[o][a]()}}},{key:"onElementsChanged",value:function(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}},{key:"offElementsChanged",value:function(e,t){if(this._listeners[e])if(t){var n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}else this._listeners[e].length=0}},{key:"updateId",value:function(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}}]),e}();go.$inject=["eventBus"];var bo=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var wo=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners={}}return bo(e,[{key:"getComponent",value:function(e,t){var n=this._listeners[e];if(n){for(var r=void 0,o=0;o<n.length&&!(r=n[o].callback(t));o++);return r}}},{key:"getComponents",value:function(e,t){var n=this._listeners[e],r=[];if(!n)return r;for(var o=0;o<n.length;o++){var i=n[o].callback(t);i&&r.push(i)}return r.length,r}},{key:"onGetComponent",value:function(e,t,n){if(c(t)&&(n=t,t=1e3),!s(t))throw new Error("priority must be a number");var r=this._getListeners(e),o=void 0,i=void 0,a={priority:t,callback:n};for(i=0;o=r[i];i++)if(o.priority<t)return void r.splice(i,0,a);r.push(a)}},{key:"offGetComponent",value:function(e,t){var n=this._getListeners(e),r=void 0,o=void 0;if(t)for(o=n.length-1;r=n[o];o--)r.callback===t&&n.splice(o,1);else n.length=0}},{key:"_getListeners",value:function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}]),e}(),_o="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},xo="$NO_OP",Oo="a runtime error occured! Use Inferno in development environment to find the error.",ko=!("undefined"==typeof window||!window.document),So=Array.isArray;function Eo(e){var t=void 0===e?"undefined":_o(e);return"string"===t||"number"===t}function Co(e){return To(e)||Bo(e)}function jo(e){return Bo(e)||!1===e||!0===e||To(e)}function Ao(e){return"function"==typeof e}function Po(e){return"string"==typeof e}function No(e){return"number"==typeof e}function Bo(e){return null===e}function To(e){return void 0===e}function Ro(e,t){var n={};if(e)for(var r in e)n[r]=e[r];if(t)for(var o in t)n[o]=t[o];return n}var Do="$";function Mo(e,t,n,r,o,i,a,s){return{childFlags:e,children:t,className:n,dom:null,flags:r,key:void 0===o?null:o,parentVNode:null,props:void 0===i?null:i,ref:void 0===a?null:a,type:s}}function Io(e,t,n,r,o,i,a,s){var u=void 0===o?1:o,c=Mo(u,r,n,e,a,i,s,t);return 0===u&&Go(c,c.children),c}function Vo(e,t,n,r,o){0<(2&e)&&(e=t.prototype&&Ao(t.prototype.render)?4:8);var i=t.defaultProps;if(!Co(i))for(var a in n||(n={}),i)To(n[a])&&(n[a]=i[a]);if(0<(8&e)){var s=t.defaultHooks;if(!Co(s))if(o)for(var u in s)To(o[u])&&(o[u]=s[u]);else o=s}var c=Mo(1,null,null,e,r,n,o,t),l=Wo.createVNode;return Ao(l)&&l(c),c}function $o(e,t){return Mo(1,Co(e)?"":e,null,16,t,null,null,null)}function Lo(e){var t=e.props;if(t){var n=e.flags;481&n&&(void 0!==t.children&&Co(e.children)&&Go(e,t.children),void 0!==t.className&&(e.className=t.className||null,t.className=void 0)),void 0!==t.key&&(e.key=t.key,t.key=void 0),void 0!==t.ref&&(e.ref=8&n?Ro(e.ref,t.ref):t.ref,t.ref=void 0)}return e}function Uo(e){var t,n=e.flags;if(14&n){var r,o=e.props;if(!Bo(o))for(var i in r={},o)r[i]=o[i];t=Vo(n,e.type,r,e.key,e.ref)}else if(481&n){var a=e.children;t=Io(n,e.type,e.className,a,e.childFlags,e.props,e.key,e.ref)}else 16&n?t=$o(e.children,e.key):1024&n&&(t=e);return t}function Fo(){return $o("",null)}function zo(e,t,n,r){for(var o=e.length;n<o;n++){var i=e[n];if(!jo(i)){var a=r+Do+n;if(So(i))zo(i,t,0,a);else{if(Eo(i))i=$o(i,a);else{var s=i.key,u=Po(s)&&s[0]===Do;Bo(i.dom)&&!u||(i=Uo(i)),Bo(s)||u?i.key=a:i.key=r+s}t.push(i)}}}}function Go(e,t){var n,r=1;if(jo(t))n=t;else if(Po(t))r=2,n=$o(t);else if(No(t))r=2,n=$o(t+"");else if(So(t)){var o=t.length;if(0===o)n=null,r=1;else{(Object.isFrozen(t)||!0===t.$)&&(t=t.slice()),r=8;for(var i=0;i<o;i++){var a=t[i];if(jo(a)||So(a)){zo(t,n=n||t.slice(0,i),i,"");break}if(Eo(a))(n=n||t.slice(0,i)).push($o(a,Do+i));else{var s=a.key,u=Bo(a.dom),c=Bo(s),l=!c&&s[0]===Do;!u||c||l?(n=n||t.slice(0,i),u&&!l||(a=Uo(a)),(c||l)&&(a.key=Do+i),n.push(a)):n&&n.push(a)}}(n=n||t).$=!0}}else Bo((n=t).dom)||(n=Uo(t)),r=2;return e.children=n,e.childFlags=r,e}var Wo={afterMount:null,afterRender:null,afterUpdate:null,beforeRender:null,beforeUnmount:null,createVNode:null,roots:[]},qo="http://www.w3.org/1999/xlink",Zo="http://www.w3.org/XML/1998/namespace",Qo="http://www.w3.org/2000/svg",Jo={"xlink:actuate":qo,"xlink:arcrole":qo,"xlink:href":qo,"xlink:role":qo,"xlink:show":qo,"xlink:title":qo,"xlink:type":qo,"xml:base":Zo,"xml:lang":Zo,"xml:space":Zo},Ho={},Xo=[];function Ko(e,t){e.appendChild(t)}function Yo(e,t,n){Co(n)?Ko(e,t):e.insertBefore(t,n)}function ei(e,t,n){e.replaceChild(t,n)}function ti(e){for(var t;void 0!==(t=e.shift());)t()}var ni={},ri={};function oi(e,t,n){var o,r,i=ni[e],a=n.$EV;t?(i||(ri[e]=(o=e,r=function(e){var t=e.type,n="click"===t||"dblclick"===t;if(n&&0!==e.button)return e.preventDefault(),e.stopPropagation(),!1;e.stopPropagation=ai;var r={dom:document};Object.defineProperty(e,"currentTarget",{configurable:!0,get:function(){return r.dom}}),function(e,t,n,r,o){var i=t;for(;!Bo(i);){if(n&&i.disabled)return;var a=i.$EV;if(a){var s=a[r];if(s&&(o.dom=i,s.event?s.event(s.data,e):s(e),e.cancelBubble))return}i=i.parentNode}}(e,e.target,n,o,r)},document.addEventListener(ii(o),r),r),ni[e]=0),a||(a=n.$EV={}),a[e]||ni[e]++,a[e]=t):a&&a[e]&&(ni[e]--,1===i&&(document.removeEventListener(ii(e),ri[e]),ri[e]=null),a[e]=t)}function ii(e){return e.substr(2).toLowerCase()}function ai(){this.cancelBubble=!0,this.immediatePropagationStopped||this.stopImmediatePropagation()}function si(e,t){var n=document.createElement("i");return n.innerHTML=t,n.innerHTML===e.innerHTML}function ui(e,t,n){if(e[t]){var r=e[t];r.event?r.event(r.data,n):r(n)}else{var o=t.toLowerCase();e[o]&&e[o](n)}}function ci(s,u){var e=function(e){e.stopPropagation();var t=this.$V;if(t){var n=t.props||Ho,r=t.dom;if(Po(s))ui(n,s,e);else for(var o=0;o<s.length;o++)ui(n,s[o],e);if(Ao(u)){var i=this.$V,a=i.props||Ho;u(a,r,!1,i)}}};return Object.defineProperty(e,"wrapped",{configurable:!1,enumerable:!1,value:!0,writable:!1}),e}function li(e){return"checkbox"===e||"radio"===e}var fi=ci("onInput",di),pi=ci(["onClick","onChange"],di);function hi(e){e.stopPropagation()}function di(e,t){var n=e.type,r=e.value,o=e.checked,i=e.multiple,a=e.defaultValue,s=!Co(r);n&&n!==t.type&&t.setAttribute("type",n),Co(i)||i===t.multiple||(t.multiple=i),Co(a)||s||(t.defaultValue=a+""),li(n)?(s&&(t.value=r),Co(o)||(t.checked=o)):s&&t.value!==r?(t.defaultValue=r,t.value=r):Co(o)||(t.checked=o)}function yi(e,t){if("optgroup"===e.type){var n=e.children,r=e.childFlags;if(12&r)for(var o=0,i=n.length;o<i;o++)mi(n[o],t);else 2===r&&mi(n,t)}else mi(e,t)}function mi(e,t){var n=e.props||Ho,r=e.dom;r.value=n.value,So(t)&&-1!==t.indexOf(n.value)||n.value===t?r.selected=!0:Co(t)&&Co(n.selected)||(r.selected=n.selected||!1)}hi.wrapped=!0;var vi=ci("onChange",gi);function gi(e,t,n,r){var o=Boolean(e.multiple);Co(e.multiple)||o===t.multiple||(t.multiple=o);var i=r.childFlags;if(0==(1&i)){var a=r.children,s=e.value;if(n&&Co(s)&&(s=e.defaultValue),12&i)for(var u=0,c=a.length;u<c;u++)yi(a[u],s);else 2===i&&yi(a,s)}}var bi=ci("onInput",_i),wi=ci("onChange");function _i(e,t,n){var r=e.value,o=t.value;if(Co(r)){if(n){var i=e.defaultValue;Co(i)||i===o||(t.defaultValue=i,t.value=i)}}else o!==r&&(t.defaultValue=r,t.value=r)}function xi(e,t,n,r,o,i){64&e?di(r,n):256&e?gi(r,n,o,t):128&e&&_i(r,n,o),i&&(n.$V=t)}function Oi(e,t,n){var r,o,i;64&e?(i=t,li(n.type)?(i.onchange=pi,i.onclick=hi):i.oninput=fi):256&e?t.onchange=vi:128&e&&(o=n,(r=t).oninput=bi,o.onChange&&(r.onchange=wi))}function ki(e){return e.type&&li(e.type)?!Co(e.checked):!Co(e.value)}function Si(e,t){var n,r;Ei(e),Bo(t)||(n=t,r=e.dom,n.removeChild(r),e.dom=null)}function Ei(e){var t,n=e.flags;if(481&n){var r=e.ref,o=e.props;Ao(r)&&r(null);var i=e.children,a=e.childFlags;if(12&a?Ci(i):2===a&&Ei(i),!Bo(o))for(var s in o)switch(s){case"onClick":case"onDblClick":case"onFocusIn":case"onFocusOut":case"onKeyDown":case"onKeyPress":case"onKeyUp":case"onMouseDown":case"onMouseMove":case"onMouseUp":case"onSubmit":case"onTouchEnd":case"onTouchMove":case"onTouchStart":oi(s,null,e.dom)}}else if(14&n){var u=e.children,c=e.ref;4&n?(Ao(Wo.beforeUnmount)&&Wo.beforeUnmount(e),Ao(u.componentWillUnmount)&&u.componentWillUnmount(),Ao(c)&&c(null),u.$UN=!0,Ei(u.$LI)):(!Co(c)&&Ao(c.onComponentWillUnmount)&&c.onComponentWillUnmount(e.dom,e.props||Ho),Ei(u))}else if(1024&n){var l=e.children;Bo(l)||"object"!==(void 0===(t=l)?"undefined":_o(t))||Si(l,e.type)}}function Ci(e){for(var t=0,n=e.length;t<n;t++)Ei(e[t])}function ji(e,t){Ci(t),e.textContent=""}function Ai(e,t){switch(e){case"animationIterationCount":case"borderImageOutset":case"borderImageSlice":case"borderImageWidth":case"boxFlex":case"boxFlexGroup":case"boxOrdinalGroup":case"columnCount":case"fillOpacity":case"flex":case"flexGrow":case"flexNegative":case"flexOrder":case"flexPositive":case"flexShrink":case"floodOpacity":case"fontWeight":case"gridColumn":case"gridRow":case"lineClamp":case"lineHeight":case"opacity":case"order":case"orphans":case"stopOpacity":case"strokeDasharray":case"strokeDashoffset":case"strokeMiterlimit":case"strokeOpacity":case"strokeWidth":case"tabSize":case"widows":case"zIndex":case"zoom":return t;default:return t+"px"}}function Pi(e,t,n,r,o,i,a){switch(e){case"onClick":case"onDblClick":case"onFocusIn":case"onFocusOut":case"onKeyDown":case"onKeyPress":case"onKeyUp":case"onMouseDown":case"onMouseMove":case"onMouseUp":case"onSubmit":case"onTouchEnd":case"onTouchMove":case"onTouchStart":oi(e,n,r);break;case"children":case"childrenType":case"className":case"defaultValue":case"key":case"multiple":case"ref":return;case"allowfullscreen":case"autoFocus":case"autoplay":case"capture":case"checked":case"controls":case"default":case"disabled":case"hidden":case"indeterminate":case"loop":case"muted":case"novalidate":case"open":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"selected":r[e="autoFocus"===e?e.toLowerCase():e]=!!n;break;case"defaultChecked":case"value":case"volume":if(i&&"value"===e)return;var s=Co(n)?"":n;r[e]!==s&&(r[e]=s);break;case"dangerouslySetInnerHTML":var u=t&&t.__html||"",c=n&&n.__html||"";u!==c&&(Co(c)||si(r,c)||(Bo(a)||(12&a.childFlags?Ci(a.children):2===a.childFlags&&Ei(a.children),a.children=null,a.childFlags=1),r.innerHTML=c));break;default:"o"===e[0]&&"n"===e[1]?function(e,t,n,r){var o,i,a=e.toLowerCase();if(Ao(n)||Co(n)){var s=r[a];s&&s.wrapped||(r[a]=n)}else{var u=n.event;u&&Ao(u)&&(r[a]=(o=u,i=n,function(e){o(i.data,e)}))}}(e,0,n,r):Co(n)?r.removeAttribute(e):"style"===e?function(e,t,n){var r,o,i=n.style;if(Po(t))i.cssText=t;else if(Co(e)||Po(e))for(r in t)o=t[r],i[r]=No(o)?Ai(r,o):o;else{for(r in t)(o=t[r])!==e[r]&&(i[r]=No(o)?Ai(r,o):o);for(r in e)Co(t[r])&&(i[r]="")}}(t,n,r):o&&Jo[e]?r.setAttributeNS(Jo[e],e,n):r.setAttribute(e,n)}}function Ni(e,t,n,r,o){var i=!1,a=0<(448&t);for(var s in a&&(i=ki(n))&&Oi(t,r,n),n)Pi(s,null,n[s],r,o,i,null);a&&xi(t,e,r,n,!0,i)}function Bi(e,t,n,r){var o=new t(n,r);if((e.children=o).$V=e,o.$BS=!1,o.context=r,o.props===Ho&&(o.props=n),o.$UN=!1,Ao(o.componentWillMount)){if(o.$BR=!0,o.componentWillMount(),o.$PSS){var i=o.state,a=o.$PS;if(Bo(i))o.state=a;else for(var s in a)i[s]=a[s];o.$PSS=!1,o.$PS=null}o.$BR=!1}Ao(Wo.beforeRender)&&Wo.beforeRender(o);var u,c=Ti(o.render(n,o.state,r),e);return Ao(o.getChildContext)&&(u=o.getChildContext()),Co(u)?o.$CX=r:o.$CX=Ro(r,u),Ao(Wo.afterRender)&&Wo.afterRender(o),o.$LI=c,o}function Ti(e,t){return jo(e)?e=Fo():Eo(e)?e=$o(e,null):(e.dom&&(e=Uo(e)),14&e.flags&&(e.parentVNode=t)),e}function Ri(e,t,n,r,o){var i=e.flags;return 481&i?Mi(e,t,n,r,o):14&i?function(e,t,n,r,o,i){var a,s=e.type,u=e.props||Ho,c=e.ref;if(i){var l=Bi(e,s,u,r);e.dom=a=Ri(l.$LI,null,n,l.$CX,o),Vi(e,c,l,n),l.$UPD=!1}else{var f=Ti(s(u,r),e);e.children=f,e.dom=a=Ri(f,null,n,r,o),$i(u,c,a,n)}Bo(t)||Ko(t,a);return a}(e,t,n,r,o,0<(4&i)):512&i||16&i?Di(e,t):1024&i?(Ri(e.children,e.type,n,r,!1),e.dom=Di(Fo(),t)):void 0}function Di(e,t){var n=e.dom=document.createTextNode(e.children);return Bo(t)||Ko(t,n),n}function Mi(e,t,n,r,o){var i=e.flags,a=e.children,s=e.props,u=e.className,c=e.ref,l=e.childFlags;o=o||0<(32&i);var f,p=(f=e.type,!0===o?document.createElementNS(Qo,f):document.createElement(f));if(e.dom=p,Co(u)||""===u||(o?p.setAttribute("class",u):p.className=u),Bo(t)||Ko(t,p),0==(1&l)){var h=!0===o&&"foreignObject"!==e.type;2===l?Ri(a,p,n,r,h):12&l&&Ii(a,p,n,r,h)}return Bo(s)||Ni(e,i,s,p,o),Ao(c)&&Li(p,c,n),p}function Ii(e,t,n,r,o){for(var i=0,a=e.length;i<a;i++){var s=e[i];Bo(s.dom)||(e[i]=s=Uo(s)),Ri(s,t,n,r,o)}}function Vi(e,t,n,r){Ao(t)&&t(n);var o,i,a,s,u,c=Ao(n.componentDidMount),l=Wo.afterMount,f=Ao(l);(c||f)&&r.push((o=n,i=f,a=l,s=e,u=c,function(){o.$UPD=!0,i&&a(s),u&&o.componentDidMount(),o.$UPD=!1}))}function $i(e,t,n,r){var o,i,a;Co(t)||(Ao(t.onComponentWillMount)&&t.onComponentWillMount(e),Ao(t.onComponentDidMount)&&r.push((o=t,i=n,a=e,function(){return o.onComponentDidMount(i,a)})))}function Li(e,t,n){n.push(function(){return t(e)})}function Ui(e,t,n,r,o){var i,a,s=e.children,u=e.props,c=e.className,l=e.flags,f=e.ref;if(o=o||0<(32&l),1!==t.nodeType||t.tagName.toLowerCase()!==e.type){var p=Mi(e,null,n,r,o);e.dom=p,ei(t.parentNode,p,t)}else{var h=(e.dom=t).firstChild,d=e.childFlags;if(0==(1&d)){for(var y=null;h;)y=h.nextSibling,8===h.nodeType&&("!"===h.data?t.replaceChild(document.createTextNode(""),h):t.removeChild(h)),h=y;if(h=t.firstChild,2===d)Bo(h)?Ri(s,t,n,r,o):(y=h.nextSibling,Fi(s,h,n,r,o),h=y);else if(12&d)for(var m=0,v=s.length;m<v;m++){var g=s[m];Bo(h)?Ri(g,t,n,r,o):(y=h.nextSibling,Fi(g,h,n,r,o),h=y)}for(;h;)y=h.nextSibling,t.removeChild(h),h=y}else Bo(t.firstChild)||(i=t,a=u,Boolean(a&&a.dangerouslySetInnerHTML&&a.dangerouslySetInnerHTML.__html&&si(i,a.dangerouslySetInnerHTML.__html)))||(t.textContent="",448&l&&(t.defaultValue=""));Bo(u)||Ni(e,l,u,t,o),Co(c)?""!==t.className&&t.removeAttribute("class"):o?t.setAttribute("class",c):t.className=c,Ao(f)&&Li(t,f,n)}}function Fi(e,t,n,r,o){var i=e.flags;14&i?function(e,t,n,r,o,i){var a=e.type,s=e.ref,u=e.props||Ho;if(i){var c=Bi(e,a,u,r),l=c.$LI;Fi(l,t,n,c.$CX,o),e.dom=l.dom,Vi(e,s,c,n),c.$UPD=!1}else{var f=Ti(a(u,r),e);Fi(f,t,n,r,o),e.children=f,e.dom=f.dom,$i(u,s,t,n)}}(e,t,n,r,o,0<(4&i)):481&i?Ui(e,t,n,r,o):16&i?function(e,t){if(3!==t.nodeType){var n=Di(e,null);e.dom=n,ei(t.parentNode,n,t)}else{var r=e.children;t.nodeValue!==r&&(t.nodeValue=r),e.dom=t}}(e,t):512&i?e.dom=t:function(e){throw e||(e=Oo),new Error("Inferno Error: "+e)}()}function zi(e,t,n,r,o,i){Ei(e),ei(n,Ri(t,null,r,o,i),e.dom)}function Gi(e,t,n,r,o,i){if(e!==t){var a=0|t.flags;e.flags!==a||2048&a?zi(e,t,n,r,o,i):481&a?function(e,t,n,r,o,i){var a=t.type;if(e.type!==a)zi(e,t,n,r,o,i);else{var s,u=e.dom,c=t.flags,l=e.props,f=t.props,p=!1,h=!1;if(t.dom=u,i=i||0<(32&c),l!==f){var d=l||Ho;if((s=f||Ho)!==Ho)for(var y in(p=0<(448&c))&&(h=ki(s)),s){var m=d[y],v=s[y];m!==v&&Pi(y,m,v,u,i,h,e)}if(d!==Ho)for(var g in d)s.hasOwnProperty(g)||Co(d[g])||Pi(g,d[g],null,u,i,h,e)}var b=e.children,w=t.children,_=t.ref,x=e.className,O=t.className;b!==w&&Wi(e.childFlags,t.childFlags,b,w,u,r,o,i&&"foreignObject"!==a),p&&xi(c,t,u,s,!1,h),x!==O&&(Co(O)?u.removeAttribute("class"):i?u.setAttribute("class",O):u.className=O),Ao(_)&&e.ref!==_&&Li(u,_,r)}}(e,t,n,r,o,i):14&a?function(e,t,n,r,o,i,a){var s=t.type,u=e.key,c=t.key;if(e.type!==s||u!==c)zi(e,t,n,r,o,i);else{var l=t.props||Ho;if(a){var f=e.children;f.$UPD=!0,qi(f,f.state,t,l,n,r,o,i,!1,!1),f.$V=t,f.$UPD=!1}else{var p=!0,h=e.props,d=t.ref,y=!Co(d),m=e.children;if(t.dom=e.dom,t.children=m,y&&Ao(d.onComponentShouldUpdate)&&(p=d.onComponentShouldUpdate(h,l)),!1!==p){y&&Ao(d.onComponentWillUpdate)&&d.onComponentWillUpdate(h,l);var v=s(l,o);v!==xo&&(v=Ti(v,t),Gi(m,v,n,r,o,i),t.children=v,t.dom=v.dom,y&&Ao(d.onComponentDidUpdate)&&d.onComponentDidUpdate(h,l))}else 14&m.flags&&(m.parentVNode=t)}}}(e,t,n,r,o,i,0<(4&a)):16&a?function(e,t,n){var r,o=t.children;Bo(n.firstChild)?(n.textContent=o,r=n.firstChild):(r=e.dom,o!==e.children&&(r.nodeValue=o));t.dom=r}(e,t,n):512&a?t.dom=e.dom:function(e,t,n,r){var o=e.type,i=t.type,a=t.children;if(Wi(e.childFlags,t.childFlags,e.children,a,o,n,r,!1),t.dom=e.dom,o!==i&&!jo(a)){var s=a.dom;o.removeChild(s),i.appendChild(s)}}(e,t,r,o)}}function Wi(e,t,n,r,o,i,a,s){switch(e){case 2:switch(t){case 2:Gi(n,r,o,i,a,s);break;case 1:Si(n,o);break;default:Si(n,o),Ii(r,o,i,a,s)}break;case 1:switch(t){case 2:Ri(r,o,i,a,s);break;case 1:break;default:Ii(r,o,i,a,s)}break;default:if(12&t){var u=n.length,c=r.length;0===u?0<c&&Ii(r,o,i,a,s):0===c?ji(o,n):8===t&&8===e?function(e,t,n,r,o,i,a,s){var u,c,l,f,p=a-1,h=s-1,d=0,y=0,m=e[d],v=t[y];e:{for(;m.key===v.key;){if(v.dom&&(t[y]=v=Uo(v)),Gi(m,v,n,r,o,i),y++,p<++d||h<y)break e;m=e[d],v=t[y]}for(m=e[p],v=t[h];m.key===v.key;){if(v.dom&&(t[h]=v=Uo(v)),Gi(m,v,n,r,o,i),h--,--p<d||h<y)break e;m=e[p],v=t[h]}}if(p<d){if(y<=h)for(l=(f=h+1)<s?t[f].dom:null;y<=h;)(v=t[y]).dom&&(t[y]=v=Uo(v)),y++,Yo(n,Ri(v,null,r,o,i),l)}else if(h<y)for(;d<=p;)Si(e[d++],n);else{var g=p-d+1,b=h-y+1,w=[];for(u=0;u<b;u++)w.push(0);var _=g===a,x=!1,O=0,k=0;if(s<4||(g|b)<32)for(u=d;u<=p;u++)if(m=e[u],k<b){for(c=y;c<=h;c++)if(v=t[c],m.key===v.key){if(w[c-y]=u+1,_)for(_=!1;d<u;)Si(e[d++],n);c<O?x=!0:O=c,v.dom&&(t[c]=v=Uo(v)),Gi(m,v,n,r,o,i),k++;break}!_&&h<c&&Si(m,n)}else _||Si(m,n);else{var S={};for(u=y;u<=h;u++)S[t[u].key]=u;for(u=d;u<=p;u++)if(m=e[u],k<b)if(void 0!==(c=S[m.key])){if(_)for(_=!1;d<u;)Si(e[d++],n);v=t[c],w[c-y]=u+1,c<O?x=!0:O=c,v.dom&&(t[c]=v=Uo(v)),Gi(m,v,n,r,o,i),k++}else _||Si(m,n);else _||Si(m,n)}if(_)ji(n,e),Ii(t,n,r,o,i);else if(x){var E=function(e){var t,n,r,o,i,a=e.slice(),s=[0],u=e.length;for(t=0;t<u;t++){var c=e[t];if(0!==c){if(n=s[s.length-1],e[n]<c){a[t]=n,s.push(t);continue}for(r=0,o=s.length-1;r<o;)e[s[i=(r+o)/2|0]]<c?r=i+1:o=i;c<e[s[r]]&&(0<r&&(a[t]=s[r-1]),s[r]=t)}}r=s.length,o=s[r-1];for(;0<r--;)s[r]=o,o=a[o];return s}(w);for(c=E.length-1,u=b-1;0<=u;u--)0===w[u]?((v=t[O=u+y]).dom&&(t[O]=v=Uo(v)),f=O+1,Yo(n,Ri(v,null,r,o,i),f<s?t[f].dom:null)):c<0||u!==E[c]?(v=t[O=u+y],f=O+1,Yo(n,v.dom,f<s?t[f].dom:null)):c--}else if(k!==b)for(u=b-1;0<=u;u--)0===w[u]&&((v=t[O=u+y]).dom&&(t[O]=v=Uo(v)),f=O+1,Yo(n,Ri(v,null,r,o,i),f<s?t[f].dom:null))}}(n,r,o,i,a,s,u,c):function(e,t,n,r,o,i,a,s){for(var u,c=s<a?s:a,l=0;l<c;l++)(u=t[l]).dom&&(u=t[l]=Uo(u)),Gi(e[l],u,n,r,o,i);if(a<s)for(l=c;l<s;l++)(u=t[l]).dom&&(u=t[l]=Uo(u)),Ri(u,n,r,o,i);else if(s<a)for(l=c;l<a;l++)Si(e[l],n)}(n,r,o,i,a,s,u,c)}else 1===t?ji(o,n):(ji(o,n),Ri(r,o,i,a,s))}}function qi(e,t,n,r,o,i,a,s,u,c){var l,f=e.state,p=e.props;if(!(n.children=e).$UN){if(p!==r||r===Ho){if(!c&&Ao(e.componentWillReceiveProps)){if(e.$BR=!0,e.componentWillReceiveProps(r,a),e.$UN)return;e.$BR=!1}e.$PSS&&(t=Ro(t,e.$PS),e.$PSS=!1,e.$PS=null)}var h=Ao(e.shouldComponentUpdate);if(u||!h||h&&e.shouldComponentUpdate(r,t,a)){Ao(e.componentWillUpdate)&&(e.$BS=!0,e.componentWillUpdate(r,t,a),e.$BS=!1),e.props=r,e.state=t,e.context=a,Ao(Wo.beforeRender)&&Wo.beforeRender(e),l=e.render(r,t,a),Ao(Wo.afterRender)&&Wo.afterRender(e);var d,y=l!==xo;if(Ao(e.getChildContext)&&(d=e.getChildContext()),d=Co(d)?a:Ro(a,d),e.$CX=d,y)Gi(e.$LI,e.$LI=Ti(l,n),o,i,d,s),Ao(e.componentDidUpdate)&&e.componentDidUpdate(p,f),Ao(Wo.afterUpdate)&&Wo.afterUpdate(n)}else e.props=r,e.state=t,e.context=a;n.dom=e.$LI.dom}}var Zi=Wo.roots;ko&&document.body;function Qi(e,t,n){if(e!==xo){var r,o,i=Zi.length;for(o=0;o<i;o++)if(Zi[o]===t){r=t.$V;break}return To(r)?jo(e)||(e.dom&&(e=Uo(e)),Bo(t.firstChild)?(Ri(e,t,Xo,Ho,!1),t.$V=e,Zi.push(t)):function(e,t,n){var r=t.firstChild;if(!Bo(r))for(jo(e)||Fi(e,r,Xo,Ho,!1),r=t.firstChild;r=r.nextSibling;)t.removeChild(r);0<Xo.length&&ti(Xo),t.$V||Wo.roots.push(t),t.$V=e,Ao(n)&&n()}(e,t),r=e):Co(e)?(Si(r,t),Zi.splice(o,1)):(e.dom&&(e=Uo(e)),Gi(r,e,t,Xo,Ho,!1),r=t.$V=e),0<Xo.length&&ti(Xo),Ao(n)&&n(),r&&14&r.flags?r.children:void 0}}var Ji="undefined"==typeof Promise?null:Promise.resolve(),Hi="undefined"==typeof requestAnimationFrame?setTimeout:requestAnimationFrame.bind(window);function Xi(e,t,n){Ao(t)&&(t=t(e.state,e.props,e.context));var r,o,i,a=e.$PS;if(Co(a))e.$PS=t;else for(var s in t)a[s]=t[s];if(e.$PSS||e.$BR)e.$PSS=!0,e.$BR&&Ao(n)&&Xo.push(n.bind(e));else if(e.$UPD){var u=e.$QU;Bo(u)&&(u=e.$QU=[],o=e,i=u,r=function(){o.$QU=null,o.$UPD=!0,Ki(o,!1,function(){for(var e=0,t=i.length;e<t;e++)i[e].call(o)}),o.$UPD=!1},Ji?Ji.then(r):Hi(r)),Ao(n)&&u.push(n)}else e.$PSS=!0,e.$UPD=!0,Ki(e,!1,n),e.$UPD=!1}function Ki(e,t,n){if(!e.$UN){if(t||!e.$BR){e.$PSS=!1;var r=e.$PS,o=Ro(e.state,r),i=e.props,a=e.context;e.$PS=null;var s=e.$V,u=e.$LI;if(qi(e,o,s,i,u.dom&&u.dom.parentNode,Xo,a,0<(32&s.flags),t,!0),e.$UN)return;if(0==(1024&e.$LI.flags))for(var c=e.$LI.dom;!Bo(s=s.parentVNode);)0<(14&s.flags)&&(s.dom=c);0<Xo.length&&ti(Xo)}else e.state=e.$PS,e.$PS=null;Ao(n)&&n.call(e)}}var Yi=function(e,t){this.state=null,this.$BR=!1,this.$BS=!0,this.$PSS=!1,this.$PS=null,this.$LI=null,this.$V=null,this.$UN=!1,this.$CX=null,this.$UPD=!0,this.$QU=null,this.props=e||Ho,this.context=t||Ho};Yi.prototype.forceUpdate=function(e){this.$UN||Ki(this,!0,e)},Yi.prototype.setState=function(e,t){this.$UN||this.$BS||Xi(this,e,t)},Yi.prototype.render=function(e,t,n){},Yi.defaultProps=null;var ea="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},ta=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var na=function(e){function r(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ea(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e)),n=t._injector=e.injector;return t._sheet=n.get("sheet"),t._changeSupport=n.get("changeSupport"),t._components=n.get("components"),t.onElementsChanged=t.onElementsChanged.bind(t),t}return function(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":ea(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)}(r,Yi),ta(r,[{key:"onElementsChanged",value:function(){this.forceUpdate()}},{key:"getChildContext",value:function(){return{changeSupport:this._changeSupport,components:this._components,injector:this._injector}}},{key:"componentWillMount",value:function(){var e=this._sheet.getRoot().id;this._changeSupport.onElementsChanged(e,this.onElementsChanged)}},{key:"componentWillUnmount",value:function(){var e=this._sheet.getRoot().id;this._changeSupport.offElementsChanged(e,this.onElementsChanged)}},{key:"render",value:function(){var e=this._sheet.getRoot(),t=e.rows,n=e.cols,r=this._components.getComponents("table.before"),o=this._components.getComponents("table.after"),i=this._components.getComponent("table.head"),a=this._components.getComponent("table.body"),s=this._components.getComponent("table.foot");return Io(1,"div","tjs-container",[r&&r.map(function(e,t){return Vo(2,e,null,t)}),Io(1,"table","tjs-table",[i&&Vo(2,i,{rows:t,cols:n}),a&&Vo(2,a,{rows:t,cols:n}),s&&Vo(2,s,{rows:t,cols:n})],0),o&&o.map(function(e,t){return Vo(2,e,null,t)})],0)}}]),r}(),ra=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var oa=function(){function a(e,t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var i=n.container;this._container=i,r.on("root.added",function(){Qi(Vo(2,na,{injector:o}),i)}),r.on("root.remove",function(){Qi(null,i)})}return ra(a,[{key:"getContainer",value:function(){return this._container}}]),a}();oa.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var ia={__init__:["changeSupport","components","renderer"],changeSupport:["type",go],components:["type",wo],renderer:["type",oa]},aa=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var sa=function(){function r(e,t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._elementRegistry=e,this._eventBus=t,this._root=null,t.on("table.clear",function(){n.setRoot(null)})}return aa(r,[{key:"setRoot",value:function(e){if(this._root){var t=this._root;this._eventBus.fire("root.remove",{root:t}),this._root=null,this._eventBus.fire("root.removed",{root:t})}e&&this._eventBus.fire("root.add",{root:e}),(this._root=e)&&this._eventBus.fire("root.added",{root:e})}},{key:"getRoot",value:function(){return this._root||this.setRoot({id:"__implicitroot",rows:[],cols:[]}),this._root}},{key:"addRow",value:function(n,r){var o=this,i=this.getRoot();if(i.cols.length!=n.cells.length)throw new Error("number of cells is not equal to number of cols");return void 0===r&&(r=i.rows.length),ua(r,i.rows,n),n.root=i,this._elementRegistry.add(n),n.cells.forEach(function(e,t){o._elementRegistry.add(e),e.row=n,e.col=i.cols[t],ua(r,i.cols[t].cells,e)}),this._eventBus.fire("row.add",{row:n}),n}},{key:"removeRow",value:function(e){var n=this,r=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));var o=r.rows.indexOf(e);-1!==o&&(ca(o,r.rows),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach(function(e,t){n._elementRegistry.remove(e),e.col=void 0,ca(o,r.cols[t].cells)}),this._eventBus.fire("row.remove",{row:e}))}},{key:"addCol",value:function(n,r){var o=this,i=this.getRoot();if(this._elementRegistry.add(n),i.rows.length!=n.cells.length)throw new Error("number of cells is not equal to number of rows");return void 0===r&&(r=i.cols.length),ua(r,i.cols,n),n.root=i,n.cells.forEach(function(e,t){o._elementRegistry.add(e),e.col=n,e.row=i.rows[t],ua(r,i.rows[t].cells,e)}),this._eventBus.fire("col.add",{col:n}),n}},{key:"removeCol",value:function(e){var n=this,r=this.getRoot();"string"==typeof e&&(e=this._elementRegistry.get(e));var o=r.cols.indexOf(e);-1!==o&&(ca(o,r.cols),e.root=void 0,this._elementRegistry.remove(e),e.cells.forEach(function(e,t){n._elementRegistry.remove(e),e.row=void 0,ca(o,r.rows[t].cells)}),this._eventBus.fire("col.remove",{col:e}))}},{key:"resized",value:function(){this._eventBus.fire("sheet.resized")}}]),r}();function ua(e,t,n){return t.splice(e,0,n)}function ca(e,t){return t.splice(e,1)}sa.$inject=["elementRegistry","eventBus"];var la={__depends__:[ia],__init__:["elementFactory","sheet"],elementFactory:["type",po],elementRegistry:["type",yo],eventBus:["type",C],sheet:["type",sa]},fa=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var pa=function(){function i(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var t=e.injector;if(!t){var n=this._init(e),r=n.modules,o=n.config;t=function(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}([{config:["value",o]},la].concat(r||[]))}this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("table.init"),this.get("eventBus").fire("diagram.init")}return fa(i,[{key:"_init",value:function(e){return{modules:e.modules,config: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}(e,["modules"])}}},{key:"destroy",value:function(){var e=this.get("eventBus");e.fire("table.destroy"),e.fire("diagram.destroy")}},{key:"clear",value:function(){var e=this.get("eventBus");e.fire("table.clear"),e.fire("diagram.clear")}}]),i}();function ha(e){if(!e)return"<null>";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<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function ba(e,t){var n,r,o,i=e.elements,a=e.index;return a[t]?e:{elements:[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i),[t]),index:ga({},a,(n={},r=t,o=!0,r in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,n))}}function wa(){for(var e,n={elements:[],index:{}},t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return r.forEach(function(t){var e=void 0===t?"undefined":va(t);"string"===e&&0<t.length?n=ba(n,t):"object"===e&&null!==t&&Object.keys(t).forEach(function(e){t[e]&&(n=ba(n,e))})}),e=" ",n.elements.join(e)}function _a(e,a){var s=e.$inject;if(s){var t=a.context.injector,n=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(s),[function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r in t){var o=s[r],i=t[r];a[o]=i}}]);t.invoke(n)}}function xa(r,o){Object.keys(o).forEach(function(e){if("$inject"!==e&&"__init"!==e){var t=o[e];"constructor"===e&&t.call(r,r.props,r.context);var n=r[e];if(void 0!==n){if("function"!=typeof n)throw new Error("failed to mixin <"+e+">: cannot combine with non-fn component value");r[e]=function(o){for(var e=arguments.length,i=Array(1<e?e-1:0),t=1;t<e;t++)i[t-1]=arguments[t];return function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=void 0;return i.forEach(function(e){if(void 0!==(r=e.call.apply(e,[o].concat(t))))return!1}),r}.bind(o)}(r,n,t)}else r[e]=t.bind(r)}}),"$inject"in o&&_a(o,r),"__init"in o&&o.__init.call(r,r.props,r.context)}var Oa={getSelectionClasses:function(){var e=this.state;return wa({selected:e.selected,"selected-secondary":e.selectedSecondary,focussed:e.focussed})},selectionChanged:function(e){this.setState(e)},componentWillUpdate:function(e){e.elementId!==this.props.elementId&&this.updateSelectionSubscription(!1)},componentDidUpdate:function(e){e.elementId!==this.props.elementId&&this.updateSelectionSubscription(!0)},componentDidMount:function(){this.updateSelectionSubscription(!0)},componentWillUnmount:function(){this.updateSelectionSubscription(!1)},updateSelectionSubscription:function(e){var t=this.props.elementId;t&&t&&this.eventBus[e?"on":"off"]("selection."+t+".changed",this.selectionChanged)},$inject:["eventBus"]},ka="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},Sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ea=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Ca=function(e){function o(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n,r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ka(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));return xa(r,Oa),_a((n=r).constructor,n),r}return function(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":ka(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)}(o,Yi),Ea(o,[{key:"getRenderProps",value:function(){for(var e=this.props,t=e.className,n=e.elementId,r=e.coords,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}(e,["className","elementId","coords"]),i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];var u={className:wa.apply(void 0,a.concat([this.getSelectionClasses(),t]))};return n&&(u["data-element-id"]=n),r&&(u["data-coords"]=r),Sa({},u,o)}}]),o}(),ja="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},Aa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pa=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Na=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ja(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return n.state={},n}return function(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":ja(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)}(r,Ca),Pa(r,[{key:"render",value:function(){var e=this.props.children,t=this.getRenderProps("cell");return Lo(Io(1,"td",null,e,0,Aa({},t)))}}]),r}(),Ba="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},Ta=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();!function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Ba(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}(function(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":Ba(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)})(t,Yi),Ta(t,[{key:"getChildContext",value:function(){return{injector:this.props.injector}}},{key:"render",value:function(){return this.props.children}}])}();var Ra="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},Da=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ma=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();!function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Ra(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return n.state={},n}(function(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":Ra(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)})(r,Ca),Ma(r,[{key:"render",value:function(){var e=this.props.children,t=this.getRenderProps("cell","header-cell");return Lo(Io(1,"th",null,e,0,Da({},t)))}}])}();function Ia(e){var t=e.row.businessObject,n=t.id,r=t.description;return Vo(2,Na,{className:"annotation",elementId:n+"__annotation",children:r||"-"})}function Va(e){e.onGetComponent("cell",function(e){var t=e.cellType;return"after-label-cells"===t?ya:"after-rule-cells"===t?Ia:void 0})}Va.$inject=["components"];var $a={__init__:["annotationsProvider"],annotationsProvider:["type",Va]},La=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function Ua(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function Fa(e,t){return O({id:e.id,type:e.$type,businessObject:e},t)}var za=function(){function r(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._elementFactory=e,this._eventBus=t,this._sheet=n}return La(r,[{key:"add",value:function(e){var t=this,n=void 0;if(ir(e,"dmn:DecisionTable"))n=this._elementFactory.createRoot(Fa(e)),this._sheet.setRoot(n);else if(ir(e,"dmn:InputClause"))n=this._elementFactory.createCol(Fa(e)),this._sheet.addCol(n);else if(ir(e,"dmn:OutputClause"))n=this._elementFactory.createCol(Fa(e)),this._sheet.addCol(n);else if(ir(e,"dmn:DecisionRule")){e.inputEntry||(e.inputEntry=[]),e.outputEntry||(e.outputEntry=[]);var r=[].concat(Ua(e.inputEntry),Ua(e.outputEntry)).map(function(e){return t._elementFactory.createCell(Fa(e))});n=this._elementFactory.createRow(O(Fa(e),{cells:r})),this._sheet.addRow(n)}return this._eventBus.fire("dmnElement.added",{element:n}),n}}]),r}();za.$inject=["elementFactory","eventBus","sheet"];var Ga={__depends__:[{tableImporter:["type",za]},ia]},Wa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function qa(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}var Za={slotFill:function(e,t){var n=e.type,r=e.context,o=qa(e,["type","context"]),i=this.components.getComponent(n,r)||t;return i?Lo(Vo(2,i,Wa({},r,o))):null},slotFills:function(e){var t=e.type,n=e.context,r=qa(e,["type","context"]);return this.components.getComponents(t,n).map(function(e){return Lo(Vo(2,e,Wa({},n,r)))})},$inject:["components"]},Qa="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},Ja=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function Ha(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xa(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Qa(t))&&"function"!=typeof t?e:t}function Ka(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":Qa(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)}var Ya=function(e){function r(e,t){Ha(this,r);var n=Xa(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return n.onElementsChanged=function(){n.forceUpdate()},xa(n,Za),n._sheet=t.injector.get("sheet"),n._changeSupport=t.changeSupport,n}return Ka(r,Yi),Ja(r,[{key:"componentWillMount",value:function(){var e=this._sheet.getRoot();this._changeSupport.onElementsChanged(e.id,this.onElementsChanged)}},{key:"componentWillUnmout",value:function(){var e=this._sheet.getRoot();this._changeSupport.offElementsChanged(e.id,this.onElementsChanged)}},{key:"render",value:function(e){var r=this,t=this._sheet.getRoot();if(!ir(t,"dmn:DMNElement"))return null;var n=ar(t),o=n.input,i=n.output;return Io(1,"thead",null,[Io(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-label-cells"}}),this.slotFill({type:"cell",context:{cellType:"input-label"}},ts),this.slotFill({type:"cell",context:{cellType:"output-label"}},rs),this.slotFills({type:"cell",context:{cellType:"after-label-cells"}})],0),Io(1,"tr",null,[o&&o.map(function(e){return r.slotFill({type:"cell",context:{cellType:"input-header",input:e},key:e.id},es)}),i.map(function(e){return r.slotFill({type:"cell",context:{cellType:"output-header",output:e},key:e.id},ns)})],0),Io(1,"tr",null,[o&&o.map(function(e,t){var n=e.inputExpression;return r.slotFill({type:"cell",context:{cellType:"input-header-type-ref",element:n},className:"input-cell",key:e.id},os)}),i.map(function(e){return r.slotFill({type:"cell",context:{cellType:"output-header-type-ref",element:e},className:"output-cell",key:e.id},os)})],0)],4)}}]),r}();function es(e){var t=e.input,n=e.className,r=t.label,o=t.inputExpression;return Io(1,"th",(n||"")+" input-cell",r?Io(1,"span","input-label",r,0,{title:"Input Label"}):Io(1,"span","input-expression",o.text||"-",0,{title:"Input Expression"}),0,{"data-col-id":t.id},t.id)}var ts=function(e){function r(e,t){Ha(this,r);var n=Xa(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return n._sheet=t.injector.get("sheet"),n}return Ka(r,Yi),Ja(r,[{key:"render",value:function(){var e=this._sheet.getRoot().businessObject,t=e.input;if(!t||!t.length)return null;var n=e.input.length;return Io(1,"th","input-cell inputs-label header",$o("Input"),2,{colspan:n})}}]),r}();function ns(e){var t=e.output,n=e.className,r=t.label,o=t.name;return Io(1,"th",(n||"")+" output-cell",r?Io(1,"span","output-label",r,0,{title:"Output Label"}):Io(1,"span","output-name",o||"-",0,{title:"Output Name"}),0,null,t.id)}var rs=function(e){function r(e,t){Ha(this,r);var n=Xa(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return n._sheet=t.injector.get("sheet"),n}return Ka(r,Yi),Ja(r,[{key:"render",value:function(){var e=this._sheet.getRoot().businessObject.output.length;return Io(1,"th","output-cell outputs-label header",$o("Output"),2,{colspan:e})}}]),r}();function os(e){return Io(1,"th",e.className+" type-ref",e.element.typeRef,0,{title:"Data Type"})}function is(e){e.onGetComponent("table.head",function(){return Ya})}is.$inject=["components"];var as={__init__:["decisionTableHeadProvider"],decisionTableHeadProvider:["type",is]},ss="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},us=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var cs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ss(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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":ss(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)}(t,Yi),us(t,[{key:"componentWillMount",value:function(){var e=this.context.injector;this._sheet=e.get("sheet")}},{key:"render",value:function(){var e=this._sheet.getRoot();if(!ir(e,"dmn:DMNElement"))return null;var t=e.businessObject.$parent,n=t.id;return Io(1,"header","decision-table-properties",[Io(1,"h3","decision-table-name",t.name,0,{title:"Decision Name"}),Io(1,"h5","decision-table-id",n,0,{title:"Decision Id"})],4)}}]),t}();var ls=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("table.before",function(){return cs})};ls.$inject=["components"];var fs={__init__:["decisionTableProperties"],decisionTableProperties:["type",ls]},ps="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},hs=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var ds=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ps(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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":ps(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)}(t,Yi),hs(t,[{key:"render",value:function(){var e=this.props,t=e.row,n=e.rowIndex,r=this.context.components.getComponents("cell-inner",{cellType:"rule-index",row:t,rowIndex:n});return Io(1,"td","rule-index",[r&&r.map(function(e){return Vo(2,e,{row:t,rowIndex:n})}),n+1],0,{"data-row-id":t.id})}}]),t}();var ys=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("cell",function(e){if("before-rule-cells"===e.cellType)return ds})};ys.$inject=["components"];var ms={__init__:["decisionRuleIndices"],decisionRuleIndices:["type",ys]},vs="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},gs=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var bs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":vs(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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":vs(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)}(t,Yi),gs(t,[{key:"render",value:function(e){var t=e.rows,r=e.cols,o=this.context.components;return Io(1,"tbody",null,t.map(function(e,t){var n=o.getComponent("row",{rowType:"rule"});return n&&Vo(2,n,{row:e,rowIndex:t,cols:r},e.id)}),0)}}]),t}(),ws="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},_s=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var xs=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":ws(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return xa(n,Za),n}return function(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":ws(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)}(r,Yi),_s(r,[{key:"render",value:function(){var n=this,e=this.props,r=e.row,o=e.rowIndex,i=e.cols,t=r.cells;return Io(1,"tr",null,[this.slotFills({type:"cell",context:{cellType:"before-rule-cells",row:r,rowIndex:o}}),t.map(function(e,t){return n.slotFill({type:"cell",context:{cellType:"rule",cell:e,rowIndex:o,colIndex:t},key:e.id,row:r,col:i[t]})}),this.slotFills({type:"cell",context:{cellType:"after-rule-cells",row:r,rowIndex:o}})],0)}}]),r}(),Os="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},ks=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Ss=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Os(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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":Os(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)}(t,Yi),ks(t,[{key:"render",value:function(){var e=this.props,t=e.cell,n=e.row,r=e.col;return ir(t,"dmn:UnaryTests")?Vo(2,Na,{className:"input-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":r.id,children:t.businessObject.text}):Vo(2,Na,{className:"output-cell",elementId:t.id,"data-row-id":n.id,"data-col-id":r.id,children:t.businessObject.text})}}]),t}();var Es=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("table.body",function(){return bs}),t.onGetComponent("row",function(e){if("rule"===e.rowType)return xs}),t.onGetComponent("cell",function(e){if("rule"===e.cellType)return Ss})};Es.$inject=["components"];var Cs={__init__:["decisionRules"],decisionRules:["type",Es]},js="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},As=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Ps=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":js(t))&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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":js(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)}(t,Yi),As(t,[{key:"componentWillMount",value:function(){var e=this.context.injector;this._sheet=e.get("sheet")}},{key:"render",value:function(){var e=this._sheet.getRoot().businessObject,t=e.hitPolicy;return Io(1,"th","hit-policy header",[t.charAt(0),function(e){switch(e){case"SUM":return"+";case"MIN":return"<";case"MAX":return">";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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Ds=function(e){function o(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Ts(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));n.onClick=function(){n._eventBus.fire("showDrd")};var r=t.injector;return n._eventBus=r.get("eventBus"),n}return function(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":Ts(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)}(o,Yi),Rs(o,[{key:"render",value:function(){var t=this;return Io(1,"div","view-drd",Io(1,"button","view-drd-button",$o("View DRD"),2,{onClick:this.onClick}),2,null,null,function(e){return t.node=e})}}]),o}(),Ms=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Is=function(){function i(e,t,r,o){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this._injector=r,this._sheet=o,e.onGetComponent("table.before",function(){if(n.canViewDrd())return Ds}),t.on("showDrd",function(){var e=r.get("_parent",!1),t=Vs(o.getRoot());if(t){var n=e.getView(t);e.open(n)}})}return Ms(i,[{key:"canViewDrd",value:function(){var e=this._injector.get("_parent",!1);if(!e)return!1;var t=Vs(this._sheet.getRoot());return!!e.getView(t)}}]),i}();function Vs(e){var t=e.businessObject;if(t)return t.$parent.$parent}Is.$inject=["components","eventBus","injector","sheet"];var $s={__init__:["viewDrd"],viewDrd:["type",Is]},Ls="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},Us=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Fs=function(e){function o(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Ls(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));n.onClick=function(){n._eventBus.fire("poweredBy.show")};var r=t.injector;return n._eventBus=r.get("eventBus"),n}return function(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":Ls(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)}(o,Yi),Us(o,[{key:"render",value:function(){var t=this;return Io(1,"div","powered-by-logo",Io(1,"img","logo",null,1,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC"}),2,{onClick:this.onClick,title:"Powered by bpmn.io"},null,function(e){return t.node=e})}}]),o}(),zs="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},Gs=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Ws=function(e){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":zs(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={show:!1},t.onClick=t.onClick.bind(t),t.onShow=t.onShow.bind(t),t}return function(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":zs(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)}(n,Yi),Gs(n,[{key:"onClick",value:function(){this.setState({show:!1})}},{key:"onShow",value:function(){this.setState({show:!0})}},{key:"componentWillMount",value:function(){(this._eventBus=this.context.injector.get("eventBus")).on("poweredBy.show",this.onShow)}},{key:"componentWillUnmount",value:function(){this._eventBus.off("poweredBy.show",this.onShow)}},{key:"render",value:function(){return this.state.show&&Io(1,"div","powered-by-overlay",Io(1,"div","powered-by-overlay-content",[Io(1,"div",null,Io(1,"img","logo",null,1,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC"}),2),Io(1,"div",null,[$o("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),Io(1,"a",null,$o("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),$o(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}]),n}();var qs=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("table.before",function(){return Fs}),t.onGetComponent("table.before",function(){return Ws})};qs.$inject=["components","eventBus"];var Zs={__init__:["poweredBy"],poweredBy:["type",qs]},Qs="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},Js=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function Hs(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Xs=function(e){function r(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var t=r._createContainer(),n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Qs(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,O(e,{renderer:{container:t}})));return n._container=t,n}return function(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":Qs(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)}(r,pa),Js(r,[{key:"open",value:function(e,t){var n;try{return this._decision&&this.clear(),this._decision=e,function(e,t,n){var r,o=e.get("tableImporter"),i=e.get("eventBus"),a=e.get("sheet"),s=e.get("modeling",!1),u=void 0,c=[];i.fire("import.render.start",{decision:t});try{r=t,new da({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){c.push({message:e,context:t})}},{canAddMissingEntries:s}).handleDecision(r)}catch(e){u=e}i.fire("import.render.complete",{error:u,warnings:c}),i.fire("elements.changed",{elements:[a.getRoot()]}),n(u,c)}(this,e,t)}catch(e){n=e}return t(n)}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,r=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}(e,["modules","additionalModules"]),o=t||this.getModules(),i=n||[],a=[{decisionTable:["value",this]}];return{modules:[Zs].concat(Hs(o),Hs(i),a),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",{}),mt(e))}},{key:"destroy",value:function(){(function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0})(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return r._getModules()}}],[{key:"_getModules",value:function(){return[$a,Ga,as,fs,ms,Cs,Bs,$s]}},{key:"_createContainer",value:function(){return ft('<div class="dmn-decision-table-container"></div>')}}]),r}(),Ks=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Ys=function(){function t(e){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._listeners={},e.on("elements.changed",function(e){var t=e.elements;r.elementsChanged(t)}),e.on("element.updateId",function(e){var t=e.element,n=e.newId;r.updateId(t.id,n)})}return Ks(t,[{key:"elementsChanged",value:function(e){for(var t={},n=e.length,r=0;r<n;r++){var o=e[r].id;if(t[o])return;t[o]=!0;var i=this._listeners[o]&&this._listeners[o].length;if(i)for(var a=0;a<i;a++)this._listeners[o][a]&&this._listeners[o][a]()}}},{key:"onElementsChanged",value:function(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e][this._listeners[e].length]=t}},{key:"offElementsChanged",value:function(e,t){if(this._listeners[e])if(t){var n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}else this._listeners[e].length=0}},{key:"updateId",value:function(e,t){this._listeners[e]&&(this._listeners[t]=this._listeners[e],delete this._listeners[e])}}]),t}();Ys.$inject=["eventBus"];var eu=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var tu=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners={}}return eu(e,[{key:"getComponent",value:function(e,t){var n=this._listeners[e];if(n){for(var r=void 0,o=0;o<n.length&&!(r=n[o].callback(t));o++);return r}}},{key:"getComponents",value:function(e,t){var n=this._listeners[e];if(n){for(var r=[],o=0;o<n.length;o++){var i=n[o].callback(t);i&&r.push(i)}if(r.length)return r}}},{key:"onGetComponent",value:function(e,t,n){if(c(t)&&(n=t,t=1e3),!s(t))throw new Error("priority must be a number");var r=this._getListeners(e),o=void 0,i=void 0,a={priority:t,callback:n};for(i=0;o=r[i];i++)if(o.priority<t)return void r.splice(i,0,a);r.push(a)}},{key:"offGetComponent",value:function(e,t){var n=this._getListeners(e),r=void 0,o=void 0;if(t)for(o=n.length-1;r=n[o];o--)r.callback===t&&n.splice(o,1);else n.length=0}},{key:"_getListeners",value:function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t}}]),e}(),nu="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},ru=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var ou=function(e){function r(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":nu(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e)),n=t._injector=e.injector;return t._changeSupport=n.get("changeSupport"),t._components=n.get("components"),t._renderer=n.get("renderer"),t}return function(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":nu(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)}(r,Yi),ru(r,[{key:"getChildContext",value:function(){return{changeSupport:this._changeSupport,components:this._components,renderer:this._renderer,injector:this._injector}}},{key:"render",value:function(){var e=this._components.getComponents("viewer");return Io(1,"div","viewer-container",e&&e.map(function(e,t){return Vo(2,e,null,t)}),0)}}]),r}(),iu=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var au=function(){function a(e,t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var i=n.container;this._container=i,r.on("renderer.mount",function(){Qi(Vo(2,ou,{injector:o}),i)}),r.on("renderer.unmount",function(){Qi(null,i)})}return iu(a,[{key:"getContainer",value:function(){return this._container}}]),a}();au.$inject=["changeSupport","components","config.renderer","eventBus","injector"];var su={__init__:["changeSupport","components","renderer"],changeSupport:["type",Ys],components:["type",tu],eventBus:["type",C],renderer:["type",au]},uu=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var cu=function(){function i(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var t=e.injector;if(!t){var n=this._init(e),r=n.modules,o=n.config;t=function(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}([{config:["value",o]},su].concat(r||[]))}this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("viewer.init")}return uu(i,[{key:"_init",value:function(e){return{modules:e.modules,config: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}(e,["modules"])}}},{key:"destroy",value:function(){this.get("eventBus").fire("viewer.destroy")}},{key:"clear",value:function(){this.get("eventBus").fire("viewer.clear")}}]),i}();var lu=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var fu=function(){function n(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this._eventBus=t,this._viewer=e}return lu(n,[{key:"getDecision",value:function(){return this._viewer.getDecision()}},{key:"updateId",value:function(e,t){if(e!==this.getDecision())throw new Error("element !== decision");this._eventBus.fire("element.updateId",{element:e,newId:t}),e.id=t}}]),n}();fu.$inject=["viewer","eventBus"];var pu={__init__:["elementRegistry"],elementRegistry:["type",fu]},hu="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},du=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var yu=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":hu(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return n._viewer=t.injector.get("viewer"),n}return function(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":hu(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)}(r,Yi),du(r,[{key:"render",value:function(){var e=this._viewer.getDecision(),t=e.name,n=e.id;return Io(1,"div","decision-properties",[Io(1,"h3","decision-name",t,0),Io(1,"h5","decision-id",n,0)],4)}}]),r}();var mu=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",2e3,function(){return yu})};mu.$inject=["components"];var vu={__init__:["decisionProperties"],decisionProperties:["type",mu]},gu="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},bu=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var wu=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":gu(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return n._viewer=t.injector.get("viewer"),n}return function(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":gu(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)}(r,Yi),bu(r,[{key:"render",value:function(){var e=this._viewer.getDecision(),t=e.literalExpression,n=e.variable;return Io(1,"div","literal-expression-properties",Io(1,"table",null,[Io(1,"tr",null,[Io(1,"td",null,$o("Variable Name:"),2),Io(1,"td",null,Io(1,"span",null,n.name||"-",0),2)],4),Io(1,"tr",null,[Io(1,"td",null,$o("Variable Type:"),2),Io(1,"td",null,Io(1,"span",null,n.typeRef||"-",0),2)],4),Io(1,"tr",null,[Io(1,"td",null,$o("Expression Language:"),2),Io(1,"td",null,Io(1,"span",null,t.expressionLanguage||"-",0),2)],4)],4),2)}}]),r}();var _u=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",500,function(){return wu})};_u.$inject=["components"];var xu={__init__:["literalExpressionProperties"],literalExpressionProperties:["type",_u]},Ou="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},ku=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Su=function(e){function o(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Ou(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));n.onClick=function(){n._eventBus.fire("poweredBy.show")};var r=t.injector;return n._eventBus=r.get("eventBus"),n}return function(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":Ou(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)}(o,Yi),ku(o,[{key:"render",value:function(){var t=this;return Io(1,"div","powered-by-logo",Io(1,"img","logo",null,1,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC"}),2,{onClick:this.onClick,title:"Powered by bpmn.io"},null,function(e){return t.node=e})}}]),o}(),Eu="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},Cu=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var ju=function(e){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Eu(t))&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={show:!1},t.onClick=t.onClick.bind(t),t.onShow=t.onShow.bind(t),t}return function(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":Eu(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)}(n,Yi),Cu(n,[{key:"onClick",value:function(){this.setState({show:!1})}},{key:"onShow",value:function(){this.setState({show:!0})}},{key:"componentWillMount",value:function(){(this._eventBus=this.context.injector.get("eventBus")).on("poweredBy.show",this.onShow)}},{key:"componentWillUnmount",value:function(){this._eventBus.off("poweredBy.show",this.onShow)}},{key:"render",value:function(){return this.state.show&&Io(1,"div","powered-by-overlay",Io(1,"div","powered-by-overlay-content",[Io(1,"div",null,Io(1,"img","logo",null,1,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC"}),2),Io(1,"div",null,[$o("Web-based tooling for BPMN, DMN and CMMN diagrams powered by "),Io(1,"a",null,$o("bpmn.io"),2,{href:"http://bpmn.io",target:"_blank"}),$o(".")],4)],4,{onClick:function(e){return e.stopPropagation()}}),2,{onClick:this.onClick})}}]),n}();var Au=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",2e3,function(){return Su}),t.onGetComponent("viewer",function(){return ju})};Au.$inject=["components","eventBus"];var Pu={__init__:["poweredBy"],poweredBy:["type",Au]},Nu="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},Bu=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Tu=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Nu(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return n._viewer=t.injector.get("viewer"),n}return function(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":Nu(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)}(r,Yi),Bu(r,[{key:"render",value:function(){return Io(1,"div","textarea",Io(1,"div","content",this._viewer.getDecision().literalExpression.text,0),2)}}]),r}();var Ru=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.onGetComponent("viewer",function(){return Tu})};Ru.$inject=["components"];var Du={__init__:["textarea"],textarea:["type",Ru]},Mu="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},Iu=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Vu=function(e){function o(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Mu(t))&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e,t));n.onClick=function(){n._eventBus.fire("showDrd")};var r=t.injector;return n._eventBus=r.get("eventBus"),n}return function(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":Mu(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)}(o,Yi),Iu(o,[{key:"render",value:function(){var t=this;return Io(1,"div","view-drd",Io(1,"button","view-drd-button",$o("View DRD"),2,{onClick:this.onClick}),2,null,null,function(e){return t.node=e})}}]),o}(),$u=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();var Lu=function(){function i(e,t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this._injector=r,this._viewer=t,e.onGetComponent("viewer",1500,function(){if(o.canViewDrd())return Vu}),n.on("showDrd",function(){var e=r.get("_parent",!1),t=o.getDefinitions(),n=e.getView(t);e.open(n)})}return $u(i,[{key:"canViewDrd",value:function(){var e=this._injector.get("_parent",!1);if(e){var t=this.getDefinitions();return!!e.getView(t)}}},{key:"getDefinitions",value:function(){return this._viewer.getDecision().$parent}}]),i}();Lu.$inject=["components","viewer","eventBus","injector"];var Uu={__init__:["viewDrd"],viewDrd:["type",Lu]},Fu="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},zu=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function Gu(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Wu=function(e){function r(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var t=r._createContainer(),n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":Fu(t))&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,O(e,{renderer:{container:t}})));return n._container=t,n}return function(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":Fu(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)}(r,cu),zu(r,[{key:"open",value:function(e,t){var n;try{this._decision&&(this.clear(),this.get("eventBus").fire("renderer.unmount")),this._decision=e,this.get("eventBus").fire("import",e),this.get("eventBus").fire("renderer.mount")}catch(e){n=e}return t(n)}},{key:"_init",value:function(e){var t=e.modules,n=e.additionalModules,r=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}(e,["modules","additionalModules"]),o=t||this.getModules(),i=n||[],a=[{viewer:["value",this]}];return{modules:[].concat(Gu(o),Gu(i),a),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",{}),mt(e))}},{key:"destroy",value:function(){(function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0})(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"destroy",this).call(this),this.detach()}},{key:"getModules",value:function(){return r._getModules()}}],[{key:"_getModules",value:function(){return[pu,vu,xu,Pu,Du,Uu]}},{key:"_createContainer",value:function(){return ft('<div class="dmn-literal-expression-container"></div>')}}]),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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();return function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof 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)}(t,Ot),Qu(t,[{key:"_getViewProviders",value:function(){return[{id:"drd",constructor:ro,opens:function(e){return ir(e,"dmn:Definitions")&&qu(e)}},{id:"decisionTable",constructor:Xs,opens:function(e){return ir(e,"dmn:Decision")&&e.decisionTable}},{id:"literalExpression",constructor:Wu,opens:function(e){return ir(e,"dmn:Decision")&&e.literalExpression}}]}}]),t}()});
36