dmn-moddle
Version:
A moddle wrapper for DMN 1.3
2 lines (1 loc) • 46.3 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DmnModdle=t()}(this,(function(){"use strict";var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty;function n(t){return"[object String]"===e.call(t)}function r(e,n){return t.call(e,n)}function i(t,n){var r;return n=function(t){return n=t,r=e.call(n),"[object Function]"===r||"[object AsyncFunction]"===r||"[object GeneratorFunction]"===r||"[object AsyncGeneratorFunction]"===r||"[object Proxy]"===r?t:function(e){return e===t};var n,r}(n),s(t,(function(e,t){if(n(e,t))return r=e,!1})),r}function a(e,t){var n=[];return s(e,(function(e,r){t(e,r)&&n.push(e)})),n}function s(t,n){var i;if(void 0!==t){var a=function(t){return"[object Array]"===e.call(t)}(t)?p:o;for(var s in t)if(r(t,s)&&!1===n(i=t[s],a(s)))return i}}function o(e){return e}function p(e){return Number(e)}function l(e,t){return e.bind(t)}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function u(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return m.apply(void 0,[e].concat(n))}function c(){}function y(e,t){this.model=e,this.properties=t}c.prototype.get=function(e){return this.$model.properties.get(this,e)},c.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},y.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(c.prototype);s(e.properties,(function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)})),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function a(e){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),s(e,l((function(e,t){this.set(t,e)}),this))}return a.prototype=r,a.hasType=r.$instanceOf=this.model.hasType,n.defineModel(a,t),n.defineDescriptor(a,e),a};var f={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},d={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function h(e,t){var n=d[e];return n?n(t):t}function g(e){return!!f[e]}function x(e){return!!d[e]}function b(e,t){var n,r,i=e.split(/:/);if(1===i.length)n=e,r=t;else{if(2!==i.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=i[1],r=i[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}}function N(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function v(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,s(e,l(this.registerPackage,this))}function E(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function A(e){this.model=e}function D(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function w(e){this.properties=new A(this),this.factory=new y(this,this.properties),this.registry=new v(e,this.properties),this.typeCache={}}N.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},r=Object(e),s(t,(function(t){t in r&&(n[t]=e[t])})),n;var e,t,n,r},N.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)},N.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,a=this.propertiesByName,s=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 o=i.indexOf(e);if(-1===o)throw new Error("property <"+r.name+"> not found in property list");i.splice(o,1),this.addProperty(t,n?void 0:o,s),a[r.name]=a[r.localName]=t},N.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),a=b(i[0],r),s=b(i[1],a.prefix).name,o=this.propertiesByName[s];if(!o)throw new Error("refined property <"+s+"> not found");this.replaceProperty(o,e,n),delete e.redefines},N.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},N.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},N.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},N.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},N.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")},N.prototype.hasProperty=function(e){return this.propertiesByName[e]},N.prototype.addTrait=function(e,t){var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(s(e.properties,l((function(n){n=u({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var r=n.replaces,i=n.redefines;r||i?this.redefineProperty(n,r||i,r):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),r.push(e),n[i]=e)},v.prototype.getPackage=function(e){return this.packageMap[e]},v.prototype.getPackages=function(){return this.packages},v.prototype.registerPackage=function(e){e=u({},e);var t=this.packageMap;E(t,e,"prefix"),E(t,e,"uri"),s(e.types,l((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},v.prototype.registerType=function(e,t){var n=b((e=u({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:u(e.meta||{})})).name,t.prefix),r=n.name,i={};s(e.properties,l((function(e){var t=b(e.name,n.prefix),r=t.name;g(e.type)||(e.type=b(e.type,t.prefix).name),u(e,{ns:t,name:r}),i[r]=e}),this)),u(e,{ns:n,name:r,propertiesByName:i}),s(e.extends,l((function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(r)}),this)),this.definePackage(e,t),this.typeMap[r]=e},v.prototype.mapTypes=function(e,t,n){var r=g(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function a(e){return o(e,!0)}function o(n,r){var a=b(n,g(n)?"":e.prefix);i.mapTypes(a,t,r)}if(!r)throw new Error("unknown type <"+e.name+">");s(r.superClass,n?a:o),t(r,!n),s(r.traits,a)},v.prototype.getEffectiveDescriptor=function(e){var t=b(e),n=new N(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},v.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},A.prototype.set=function(e,t,n){var r=this.model.getPropertyDescriptor(e,t),i=r&&r.name;void 0===n?r?delete e[i]:delete e.$attrs[t]:r?i in e?e[i]=n:D(e,r,n):e.$attrs[t]=n},A.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&&D(e,n,[]),e[r]},A.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},A.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},A.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},w.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},w.prototype.getType=function(e){var t=this.typeCache,r=n(e)?e:e.ns.name,i=t[r];return i||(e=this.registry.getEffectiveDescriptor(r),i=t[r]=this.factory.createType(e)),i},w.prototype.createAny=function(t,n,r){var i=b(t),a={$type:t,$instanceOf:function(e){return e===this.$type}},o={name:t,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:n}};return this.properties.defineDescriptor(a,o),this.properties.defineModel(a,this),this.properties.define(a,"$parent",{enumerable:!1,writable:!0}),this.properties.define(a,"$instanceOf",{enumerable:!1,writable:!0}),s(r,(function(t,n){var r;r=t,"[object Object]"===e.call(r)&&void 0!==t.value?a[t.name]=t.value:a[n]=t})),a},w.prototype.getPackage=function(e){return this.registry.getPackage(e)},w.prototype.getPackages=function(){return this.registry.getPackages()},w.prototype.getElementDescriptor=function(e){return e.$descriptor},w.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},w.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},w.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var M=String.fromCharCode,C=Object.prototype.hasOwnProperty,R=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,S={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function I(e,t,n,r){return r?C.call(S,r)?S[r]:"&"+r+";":M(t||parseInt(n,16))}function P(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(R,I):e}Object.keys(S).forEach((function(e){S[e.toUpperCase()]=S[e]}));var T="xsi:type",O="non-whitespace outside of root node";function z(e){return new Error(e)}function B(e){return"missing namespace for prefix <"+e+">"}function k(e){return{get:e,enumerable:!0}}function L(e){var t,n={};for(t in e)n[t]=e[t];return n}function U(e){return e+"$uri"}function $(){return{line:0,column:0}}function j(e){throw e}function q(e){if(!this)return new q(e);var t,n,r,i,a,s,o,p,l,m=e&&e.proxy,u=j,c=$,y=!1,f=!1,d=null,h=!1;function g(e){e instanceof Error||(e=z(e)),d=e,u(e,c)}function x(e){a&&(e instanceof Error||(e=z(e)),a(e,c))}this.on=function(e,l){if("function"!=typeof l)throw z("required args <name, cb>");switch(e){case"openTag":n=l;break;case"text":t=l;break;case"closeTag":r=l;break;case"error":u=l;break;case"warn":a=l;break;case"cdata":i=l;break;case"attention":p=l;break;case"question":o=l;break;case"comment":s=l;break;default:throw z("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw z("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,l=n,this},this.parse=function(e){if("string"!=typeof e)throw z("required args <xml=string>");return d=null,function(e){var a,u,d,b,N,v,E,A,D,w,M,C=f?[]:null,R=f?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[U(n)]=t;return r}(l):null,S=[],I=0,z=!1,$=!1,j=0,q=0,V="",F=0;function _(){if(null!==M)return M;var e,t,n,r,i,a,s,o,p,m,u,c=f&&R.xmlns,d=f&&y?[]:null,h=F,g=V,b=g.length,N={},v={};e:for(;h<b;h++)if(p=!1,!(32===(m=g.charCodeAt(h))||m<14&&m>8)){for((m<65||m>122||m>90&&m<97)&&95!==m&&58!==m&&(x("illegal first char attribute name"),p=!0),u=h+1;u<b;u++)if(!((m=g.charCodeAt(u))>96&&m<123||m>64&&m<91||m>47&&m<59||46===m||45===m||95===m)){if(32===m||m<14&&m>8){x("missing attribute value"),h=u;continue e}if(61===m)break;x("illegal attribute name char"),p=!0}if("xmlns:xmlns"===(o=g.substring(h,u))&&(x("illegal declaration of xmlns"),p=!0),34===(m=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',h=u+2))&&-1!==(u=g.indexOf("'",h))&&(x("attribute value quote missmatch"),p=!0);else if(39===m)-1===(u=g.indexOf("'",h=u+2))&&-1!==(u=g.indexOf('"',h))&&(x("attribute value quote missmatch"),p=!0);else for(x("missing attribute value quotes"),p=!0,u+=1;u<b&&!(32===(m=g.charCodeAt(u+1))||m<14&&m>8);u++);for(-1===u&&(x("missing closing quotes"),u=b,p=!0),p||(a=g.substring(h,u)),h=u;u+1<b&&!(32===(m=g.charCodeAt(u+1))||m<14&&m>8);u++)h===u&&(x("illegal character after attribute end"),p=!0);if(h=u+1,!p)if(o in v)x("attribute <"+o+"> already defined");else if(v[o]=!0,f)if(y){if(null!==(i="xmlns"===o?"xmlns":120===o.charCodeAt(0)&&"xmlns:"===o.substr(0,6)?o.substr(6):null)){if(e=P(a),t=U(i),!(s=l[e])){if("xmlns"===i||t in R&&R[t]!==e)do{s="ns"+I++}while(void 0!==R[s]);else s=i;l[e]=s}R[i]!==s&&(r||(R=L(R),r=!0),R[i]=s,"xmlns"===i&&(R[U(s)]=e,c=s),R[t]=e),N[o]=a;continue}d.push(o,a)}else-1!==(m=o.indexOf(":"))?(n=R[o.substring(0,m)])?((o=c===n?o.substr(m+1):n+o.substr(m))===T&&(-1!==(m=a.indexOf(":"))?(n=a.substring(0,m),a=(n=R[n]||n)+a.substring(m)):a=c+":"+a),N[o]=a):x(B(o.substring(0,m))):N[o]=a;else N[o]=a}if(y)for(h=0,b=d.length;h<b;h++){if(o=d[h++],a=d[h],-1!==(m=o.indexOf(":"))){if(!(n=R[o.substring(0,m)])){x(B(o.substring(0,m)));continue}(o=c===n?o.substr(m+1):n+o.substr(m))===T&&(-1!==(m=a.indexOf(":"))?(n=a.substring(0,m),a=(n=R[n]||n)+a.substring(m)):a=c+":"+a)}N[o]=a}return M=N}function G(){for(var t,n,r=/(\r\n|\r|\n)/g,i=0,a=0,s=0,o=q;j>=s&&(t=r.exec(e))&&!((o=t[0].length+t.index)>j);)i+=1,s=o;return-1==j?(a=o,n=e.substring(q)):0===q?n=e.substring(q,j):(a=j-s,n=-1==q?e.substring(j):e.substring(j,q+1)),{data:n,line:i,column:a}}c=G,m&&(w=Object.create({},{name:k((function(){return A})),originalName:k((function(){return D})),attrs:k(_),ns:k((function(){return R}))}));for(;-1!==q;){if(-1===(j=60===e.charCodeAt(q)?q:e.indexOf("<",q)))return S.length?g("unexpected end of file"):0===q?g("missing start tag"):void(q<e.length&&e.substring(q).trim()&&x(O));if(q!==j)if(S.length){if(t&&(t(e.substring(q,j),P,c),h))return}else if(e.substring(q,j).trim()&&(x(O),h))return;if(33===(N=e.charCodeAt(j+1))){if(91===(b=e.charCodeAt(j+2))&&"CDATA["===e.substr(j+3,6)){if(-1===(q=e.indexOf("]]>",j)))return g("unclosed cdata");if(i&&(i(e.substring(j+9,q),c),h))return;q+=3;continue}if(45===b&&45===e.charCodeAt(j+3)){if(-1===(q=e.indexOf("--\x3e",j)))return g("unclosed comment");if(s&&(s(e.substring(j+4,q),P,c),h))return;q+=3;continue}}if(63!==N){for(u=j+1;;u++){if(v=e.charCodeAt(u),isNaN(v))return q=-1,g("unclosed tag");if(34===v)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===v)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===v){q=u;break}}if(33!==N){if(M={},47===N){if(z=!1,$=!0,!S.length)return g("missing open tag");if(u=A=S.pop(),b=j+2+u.length,e.substring(j+2,b)!==u)return g("closing tag mismatch");for(;b<q;b++)if(!(32===(N=e.charCodeAt(b))||N>8&&N<14))return g("close tag")}else{if(47===e.charCodeAt(q-1)?(u=A=e.substring(j+1,q-1),z=!0,$=!0):(u=A=e.substring(j+1,q),z=!0,$=!1),!(N>96&&N<123||N>64&&N<91||95===N||58===N))return g("illegal first char nodeName");for(b=1,d=u.length;b<d;b++)if(!((N=u.charCodeAt(b))>96&&N<123||N>64&&N<91||N>47&&N<59||45===N||95===N||46==N)){if(32===N||N<14&&N>8){A=u.substring(0,b),M=null;break}return g("invalid nodeName")}$||S.push(A)}if(f){if(a=R,z&&($||C.push(a),null===M&&(y=-1!==u.indexOf("xmlns",b))&&(F=b,V=u,_(),y=!1)),D=A,-1!==(N=A.indexOf(":"))){if(!(E=R[A.substring(0,N)]))return g("missing namespace on <"+D+">");A=A.substr(N+1)}else E=R.xmlns;E&&(A=E+":"+A)}if(z&&(F=b,V=u,n&&(m?n(w,P,$,c):n(A,_,P,$,c),h)))return;if($){if(r&&(r(m?w:A,P,z,c),h))return;f&&(R=z?a:C.pop())}q+=1}else{if(p&&(p(e.substring(j,q+1),P,c),h))return;q+=1}}else{if(-1===(q=e.indexOf("?>",j)))return g("unclosed question");if(o&&(o(e.substring(j,q+2),c),h))return;q+=2}}}(e),c=$,h=!1,d},this.stop=function(){h=!0}}function V(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var F={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},_="xsi:type";function G(e){return e.xml&&e.xml.serialize}function K(e){return G(e)===_}function X(e,t){return V(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function H(e){return new Error(e)}function W(e){return e.$descriptor}function Q(e){u(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw H("expected element");var t,n=this.elementsById,r=W(e).idProperty;if(r&&(t=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw H("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Y(){}function J(){}function Z(){}function ee(e,t){this.property=e,this.context=t}function te(e,t){this.element=t,this.propertyDesc=e}function ne(){}function re(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function ie(e,t,n){re.call(this,e,t,n)}function ae(e,t,n){this.model=e,this.context=n}function se(e){e instanceof w&&(e={model:e}),u(this,{lax:!1},e)}Y.prototype.handleEnd=function(){},Y.prototype.handleText=function(){},Y.prototype.handleNode=function(){},J.prototype=Object.create(Y.prototype),J.prototype.handleNode=function(){return this},Z.prototype=Object.create(Y.prototype),Z.prototype.handleText=function(e){this.body=(this.body||"")+e},ee.prototype=Object.create(Z.prototype),ee.prototype.handleNode=function(e){if(this.element)throw H("expected no sub nodes");return this.element=this.createReference(e),this},ee.prototype.handleEnd=function(){this.element.id=this.body},ee.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},te.prototype=Object.create(Z.prototype),te.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=h(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},ne.prototype=Object.create(Z.prototype),ne.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},re.prototype=Object.create(ne.prototype),re.prototype.addReference=function(e){this.context.addReference(e)},re.prototype.handleText=function(e){if(!W(this.element).bodyProperty)throw H("unexpected body text <"+e+">");Z.prototype.handleText.call(this,e)},re.prototype.handleEnd=function(){var e=this.body,t=this.element,n=W(t).bodyProperty;n&&void 0!==e&&(e=h(n.type,e),t.set(n.name,e))},re.prototype.createElement=function(e){var t,n=e.attributes,r=this.type,i=W(r),a=this.context,o=new r({}),p=this.model;return s(n,(function(e,n){var r=i.propertiesByName[n];r&&r.isReference?r.isMany?s(e.split(" "),(function(e){a.addReference({element:o,property:r.ns.name,id:e})})):a.addReference({element:o,property:r.ns.name,id:e}):(r?e=h(r.type,e):"xmlns"!==n&&(t=b(n,i.ns.prefix),p.getPackage(t.prefix)&&a.addWarning({message:"unknown attribute <"+n+">",element:o,property:n,value:e})),o.set(n,e))})),o},re.prototype.getPropertyForNode=function(e){var t,n,r=b(e.name),a=this.type,s=this.model,o=W(a),p=r.name,l=o.propertiesByName[p];if(l&&!l.isAttr)return K(l)&&(t=e.attributes[_])?(t=function(e,t){var n=b(e);return function(e,t){var n=e.name,r=e.localName,i=t.xml&&t.xml.typePrefix;return i&&0===r.indexOf(i)?e.prefix+":"+r.slice(i.length):n}(n,t.getPackage(n.prefix))}(t,s),u({},l,{effectiveType:W(n=s.getType(t)).name})):l;var m=s.getPackage(r.prefix);if(m){if(t=X(r,m),n=s.getType(t),l=i(o.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return u({},l,{effectiveType:W(n).name})}else if(l=i(o.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw H("unrecognized element <"+r.name+">")},re.prototype.toString=function(){return"ElementDescriptor["+W(this.type).name+"]"},re.prototype.valueHandler=function(e,t){return new te(e,t)},re.prototype.referenceHandler=function(e){return new ee(e,this.context)},re.prototype.handler=function(e){return"Element"===e?new ae(this.model,e,this.context):new re(this.model,e,this.context)},re.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,x(n=t.effectiveType||t.type))return this.valueHandler(t,r);var a=(i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==a&&(t.isMany?r.get(t.name).push(a):r.set(t.name,a),t.isReference?(u(a,{element:r}),this.context.addReference(a)):a.$parent=r),i},ie.prototype=Object.create(re.prototype),ie.prototype.createElement=function(e){var t=e.name,n=b(t),r=this.model,i=this.type,a=r.getPackage(n.prefix),s=a&&X(n,a)||t;if(!i.hasType(s))throw H("unexpected element <"+e.originalName+">");return re.prototype.createElement.call(this,e)},ae.prototype=Object.create(ne.prototype),ae.prototype.createElement=function(e){var t=e.name,n=b(t).prefix,r=e.ns[n+"$uri"],i=e.attributes;return this.model.createAny(t,r,i)},ae.prototype.handleChild=function(e){var t=new ae(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},ae.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},se.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof re?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var i=this.model,a=this.lax,s=new Q(u({},t,{rootHandler:r})),o=new q({proxy:!0}),p=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function l(e,t,n){var r=t(),i=r.line,a=r.column,o=r.data;"<"===o.charAt(0)&&-1!==o.indexOf(" ")&&(o=o.slice(0,o.indexOf(" "))+">");var p="unparsable content "+(o?o+" ":"")+"detected\n\tline: "+i+"\n\tcolumn: "+a+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:p,error:e}),!0;throw H(p)}function m(e,t){return l(e,t,!0)}r.context=s,p.push(r);var c=/^<\?xml /i,y=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function d(e,t){try{p.peek().handleText(e)}catch(e){m(e,t)}}var h=i.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return o.ns(h).on("openTag",(function(e,t,n,r){var i=e.attrs||{},s=Object.keys(i).reduce((function(e,n){var r=t(i[n]);return e[n]=r,e}),{});!function(e,t){var n=p.peek();try{p.push(n.handleNode(e))}catch(e){l(e,t,a)&&p.push(new J)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},r)})).on("question",(function(e){if(c.test(e)){var t=y.exec(e),n=t&&t[1];n&&!f.test(n)&&s.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){p.pop().handleEnd()})).on("cdata",d).on("text",(function(e,t,n){!function(e,t){e.trim()&&d(e,t)}(t(e),n)})).on("error",l).on("warn",m),new Promise((function(t,n){var i;try{o.parse(e),function(){var e,t,n=s.elementsById,r=s.references;for(e=0;t=r[e];e++){var i=t.element,a=n[t.id],o=W(i).propertiesByName[t.property];if(a||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),o.isMany){var p=i.get(o.name),l=p.indexOf(t);-1===l&&(l=p.length),a?p[l]=a:p.splice(l,1)}else i.set(o.name,a)}}()}catch(e){i=e}var a=r.element;i||a||(i=H("failed to parse document as <"+r.type.$descriptor.name+">"));var p=s.warnings,l=s.references,m=s.elementsById;return i?(i.warnings=p,n(i)):t({rootElement:a,elementsById:m,references:l,warnings:p})}))},se.prototype.handler=function(e){return new ie(this.model,e)};var oe=/<|>|'|"|&|\n\r|\n/g,pe=/<|>|&/g;function le(e){var t={},n={},r={},i=[],a=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?i.push(e):a.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,i=this.getNSKey(t);r[i]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(i,a).filter((function(e){var n=t.getNSKey(e);return r[n]}))}}function me(e,t){return V(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function ue(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function ce(e){return n(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var ye={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},fe={"<":"lt",">":"gt","&":"amp"};function de(e,t,r){return(e=n(e)?e:""+e).replace(t,(function(e){return"&"+r[e]+";"}))}function he(e){this.tagName=e}function ge(){}function xe(e){this.tagName=e}function be(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Ne(e,t){be.call(this,e,t)}function ve(){this.value="",this.write=function(e){this.value+=e}}function Ee(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Ae(e){return e=u({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var r=n||new ve,i=new Ee(r,e.format);if(e.preamble&&i.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new be).build(t).serializeTo(i),!n)return r.value}}}function De(e,t){w.call(this,e,t)}he.prototype.build=function(e){return this.element=e,this},he.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},ge.prototype.serializeValue=ge.prototype.serializeTo=function(e){e.append(this.escape?de(this.value,pe,fe):this.value)},ge.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(pe)&&(this.escape=!0),this},ue(xe,ge),xe.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},be.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,s=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=s?this.nsPropertyTagName(s):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return a(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!r(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(a(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return a(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},be.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?u({localName:t.ns.localName},e):u({localName:me(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},be.prototype.nsPropertyTagName=function(e){return function(e,t){return u({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},be.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},be.prototype.nsAttributeName=function(e){var t;if(t=n(e)?b(e):e.ns,e.inherited)return{localName:t.localName};var r=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(r),this.isLocalNs(r)?{localName:t.localName}:u({localName:t.localName},r)},be.prototype.parseGeneric=function(e){var t=this,n=this.body,r=[];return s(e,(function(i,a){"$body"===a?n.push((new ge).build({type:"String"},i)):"$children"===a?s(i,(function(e){n.push(new be(t).build(e))})):0!==a.indexOf("$")&&t.parseNsAttribute(e,a,i)&&r.push({name:a,value:i})})),r},be.prototype.parseNsAttribute=function(e,t,n){var r,i=e.$model,a=b(t);if("xmlns"===a.prefix&&(r={prefix:a.localName,uri:n}),a.prefix||"xmlns"!==a.localName||(r={uri:n}),!r)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(r,!0,!0);else{var s=this.logNamespaceUsed(r,!0);this.getNamespaces().logUsed(s)}},be.prototype.parseNsAttributes=function(e,t){var n=this,r=e.$attrs,i=[];return s(r,(function(t,r){var a=n.parseNsAttribute(e,r,t);a&&i.push(a)})),i},be.prototype.parseGenericAttributes=function(e,t){var n=this;s(t,(function(t){if(t.name!==_)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},be.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;s(e,(function(e){var i=r.get(e.name),a=e.isReference;if(e.isMany||(i=[i]),e.isBody)n.push((new ge).build(e,i[0]));else if(x(e.type))s(i,(function(r){n.push(new xe(t.addTagName(t.nsPropertyTagName(e))).build(e,r))}));else if(a)s(i,(function(r){n.push(new he(t.addTagName(t.nsPropertyTagName(e))).build(r))}));else{var o=K(e),p=function(e){return"property"===G(e)}(e);s(i,(function(r){var i;i=o?new Ne(t,e):p?new be(t,e):new be(t),n.push(i.build(r))}))}}))},be.prototype.getNamespaces=function(e){var t,n=this.namespaces,r=this.parent;return n||(t=r&&r.getNamespaces(),e||!t?this.namespaces=n=new le(t):n=t),n},be.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,a=e.prefix;return r.byUri(i)&&!n||r.add(e,t),r.mapPrefix(a,i),e},be.prototype.logNamespaceUsed=function(e,t){var n,r,i,a=this.element.$model,s=this.getNamespaces(t),o=e.prefix,p=e.uri;if(!o&&!p)return{localName:e.localName};if(i=F[o]||a&&(a.getPackage(o)||{}).uri,!(p=p||i||s.uriByPrefix(o)))throw new Error("no namespace uri given for prefix <"+o+">");if(!(e=s.byUri(p))){for(n=o,r=1;s.uriByPrefix(n);)n=o+"_"+r++;e=this.logNamespace({prefix:n,uri:p},i===p)}return o&&s.mapPrefix(o,p),e},be.prototype.parseAttributes=function(e){var t=this,n=this.element;s(e,(function(e){var r=n.get(e.name);if(e.isReference)if(e.isMany){var i=[];s(r,(function(e){i.push(e.id)})),r=i.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(e),r)}))},be.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),ce(e)},be.prototype.addAttribute=function(e,t){var r=this.attrs;n(t)&&(t=de(t,oe,ye)),r.push({name:e,value:t})},be.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),s(t,(function(t){e.append(" ").append(ce(t.name)).append('="').append(t.value).append('"')}))},be.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==ge;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),s(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},ue(Ne,be),Ne.prototype.parseNsAttributes=function(e){var t=be.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),a=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(_),(r.prefix?r.prefix+":":"")+a+n.ns.localName),t},Ne.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},De.prototype=Object.create(w.prototype),De.prototype.fromXML=function(e,t,r){n(t)||(r=t,t="dmn:Definitions");var i=new se(u({model:this,lax:!0},r)),a=i.handler(t);return i.fromXML(e,a)},De.prototype.toXML=function(e,t){var n=new Ae(t);return new Promise((function(t,r){try{return t({xml:n.toXML(e)})}catch(e){return r(e)}}))};var we={dc:{name:"DC",prefix:"dc",uri:"http://www.omg.org/spec/DMN/20180521/DC/",types:[{name:"Dimension",properties:[{name:"width",isAttr:!0,type:"Real"},{name:"height",isAttr:!0,type:"Real"}]},{name:"Bounds",properties:[{name:"height",isAttr:!0,type:"Real"},{name:"width",isAttr:!0,type:"Real"},{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Point",properties:[{name:"x",isAttr:!0,type:"Real"},{name:"y",isAttr:!0,type:"Real"}]},{name:"Color",properties:[{name:"red",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"green",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"},{name:"blue",type:"UML_Standard_Profile.mdzip:eee_1045467100323_917313_65"}]}],associations:[],enumerations:[{name:"AlignmentKind",literalValues:[{name:"start"},{name:"center"},{name:"end"}]}]},di:{name:"DI",prefix:"di",uri:"http://www.omg.org/spec/DMN/20180521/DI/",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"style",isReference:!0,type:"Style",xml:{serialize:"property"}},{name:"sharedStyle",isReference:!0,isVirtual:!0,type:"Style"}]},{name:"Diagram",superClass:["DiagramElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"}]},{name:"Shape",isAbstract:!0,properties:[{name:"bounds",type:"dc:Bounds"}],superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,properties:[{name:"waypoint",type:"dc:Point",isMany:!0,xml:{serialize:"property"}}],superClass:["DiagramElement"]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],enumerations:[],xml:{tagAlias:"lowerCase"}},dmn:{name:"DMN",prefix:"dmn",uri:"https://www.omg.org/spec/DMN/20191111/MODEL/",types:[{name:"AuthorityRequirement",superClass:["DMNElement"],properties:[{name:"requiredAuthority",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ItemDefinition",superClass:["NamedElement"],properties:[{name:"typeRef",type:"String"},{name:"allowedValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"typeLanguage",type:"String",isAttr:!0},{name:"itemComponent",type:"ItemDefinition",isMany:!0,xml:{serialize:"property"}},{name:"functionItem",type:"FunctionItem"},{name:"isCollection",isAttr:!0,type:"Boolean"}]},{name:"Definitions",superClass:["NamedElement"],properties:[{name:"import",type:"Import",isMany:!0},{name:"itemDefinition",type:"ItemDefinition",isMany:!0},{name:"drgElement",type:"DRGElement",isMany:!0},{name:"artifact",type:"Artifact",isMany:!0},{name:"elementCollection",type:"ElementCollection",isMany:!0},{name:"businessContextElement",type:"BusinessContextElement",isMany:!0},{name:"namespace",type:"String",isAttr:!0},{name:"expressionLanguage",type:"String",isAttr:!0},{name:"typeLanguage",type:"String",isAttr:!0},{name:"exporter",isAttr:!0,type:"String"},{name:"exporterVersion",isAttr:!0,type:"String"},{name:"dmnDI",type:"dmndi:DMNDI"}]},{name:"KnowledgeSource",superClass:["DRGElement"],properties:[{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"type",type:"String"},{name:"owner",type:"DMNElementReference",xml:{serialize:"property"}},{name:"locationURI",type:"String",isAttr:!0}]},{name:"DecisionRule",superClass:["DMNElement"],properties:[{name:"inputEntry",type:"UnaryTests",isMany:!0,xml:{serialize:"property"}},{name:"outputEntry",type:"LiteralExpression",isMany:!0,xml:{serialize:"property"}},{name:"annotationEntry",type:"RuleAnnotation",isMany:!0,xml:{serialize:"property"}}]},{name:"Expression",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"InformationItem",superClass:["NamedElement"],properties:[{name:"typeRef",isAttr:!0,type:"String"}]},{name:"Decision",superClass:["DRGElement"],properties:[{name:"question",type:"String",xml:{serialize:"property"}},{name:"allowedAnswers",type:"String",xml:{serialize:"property"}},{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"informationRequirement",type:"InformationRequirement",isMany:!0},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0},{name:"supportedObjective",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"impactedPerformanceIndicator",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionMaker",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"decisionOwner",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"usingProcess",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"usingTask",isMany:!0,type:"DMNElementReference",xml:{serialize:"property"}},{name:"decisionLogic",type:"Expression"}]},{name:"Invocation",superClass:["Expression"],properties:[{name:"calledFunction",type:"Expression"},{name:"binding",type:"Binding",isMany:!0}]},{name:"OrganisationalUnit",superClass:["BusinessContextElement"],properties:[{name:"decisionMade",type:"Decision",isReference:!0,isMany:!0},{name:"decisionOwned",type:"Decision",isReference:!0,isMany:!0}]},{name:"Import",superClass:["NamedElement"],properties:[{name:"importType",type:"String",isAttr:!0},{name:"locationURI",type:"String",isAttr:!0},{name:"namespace",type:"String",isAttr:!0}]},{name:"InformationRequirement",superClass:["DMNElement"],properties:[{name:"requiredDecision",type:"DMNElementReference",xml:{serialize:"property"}},{name:"requiredInput",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"ElementCollection",superClass:["NamedElement"],properties:[{name:"drgElement",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"DRGElement",isAbstract:!0,superClass:["NamedElement"],properties:[]},{name:"InputData",superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"DMNElement",isAbstract:!0,properties:[{name:"description",type:"String"},{name:"extensionElements",type:"ExtensionElements"},{name:"id",type:"String",isAttr:!0,isId:!0},{name:"extensionAttribute",type:"ExtensionAttribute",isMany:!0},{name:"label",isAttr:!0,type:"String"}]},{name:"InputClause",superClass:["DMNElement"],properties:[{name:"inputExpression",type:"LiteralExpression",xml:{serialize:"property"}},{name:"inputValues",type:"UnaryTests",xml:{serialize:"property"}}]},{name:"DecisionTable",superClass:["Expression"],properties:[{name:"input",type:"InputClause",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"OutputClause",isMany:!0,xml:{serialize:"property"}},{name:"annotation",type:"RuleAnnotationClause",isMany:!0,xml:{serialize:"property"}},{name:"rule",type:"DecisionRule",isMany:!0,xml:{serialize:"property"}},{name:"hitPolicy",type:"HitPolicy",isAttr:!0,default:"UNIQUE"},{name:"aggregation",type:"BuiltinAggregator",isAttr:!0},{name:"preferredOrientation",type:"DecisionTableOrientation",isAttr:!0},{name:"outputLabel",isAttr:!0,type:"String"}]},{name:"LiteralExpression",superClass:["Expression"],properties:[{name:"expressionLanguage",type:"String",isAttr:!0},{name:"text",type:"String"},{name:"importedValues",type:"ImportedValues"}]},{name:"Binding",properties:[{name:"parameter",type:"InformationItem",xml:{serialize:"property"}},{name:"bindingFormula",type:"Expression"}]},{name:"KnowledgeRequirement",superClass:["DMNElement"],properties:[{name:"requiredKnowledge",type:"DMNElementReference",xml:{serialize:"property"}}]},{name:"BusinessKnowledgeModel",superClass:["Invocable"],properties:[{name:"encapsulatedLogic",type:"FunctionDefinition",xml:{serialize:"property"}},{name:"knowledgeRequirement",type:"KnowledgeRequirement",isMany:!0},{name:"authorityRequirement",type:"AuthorityRequirement",isMany:!0}]},{name:"BusinessContextElement",isAbstract:!0,superClass:["NamedElement"],properties:[{name:"URI",type:"String",isAttr:!0}]},{name:"PerformanceIndicator",superClass:["BusinessContextElement"],properties:[{name:"impactingDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"FunctionDefinition",superClass:["Expression"],properties:[{name:"formalParameter",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"body",type:"Expression"},{name:"kind",type:"FunctionKind",isAttr:!0}]},{name:"Context",superClass:["Expression"],properties:[{name:"contextEntry",type:"ContextEntry",isMany:!0}]},{name:"ContextEntry",superClass:["DMNElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}},{name:"value",type:"Expression"}]},{name:"List",superClass:["Expression"],properties:[{name:"elements",isMany:!0,type:"Expression"}]},{name:"Relation",superClass:["Expression"],properties:[{name:"column",type:"InformationItem",isMany:!0,xml:{serialize:"property"}},{name:"row",type:"List",isMany:!0,xml:{serialize:"property"}}]},{name:"OutputClause",superClass:["DMNElement"],properties:[{name:"outputValues",type:"UnaryTests",xml:{serialize:"property"}},{name:"defaultOutputEntry",type:"LiteralExpression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"typeRef",isAttr:!0,type:"String"}]},{name:"UnaryTests",superClass:["Expression"],properties:[{name:"text",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"NamedElement",isAbstract:!0,superClass:["DMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ImportedValues",superClass:["Import"],properties:[{name:"importedElement",type:"String"},{name:"expressionLanguage",type:"String",isAttr:!0}]},{name:"DecisionService",superClass:["Invocable"],properties:[{name:"outputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"encapsulatedDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputDecision",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}},{name:"inputData",type:"DMNElementReference",isMany:!0,xml:{serialize:"property"}}]},{name:"ExtensionElements",properties:[{name:"values",type:"Element",isMany:!0}]},{name:"ExtensionAttribute",properties:[{name:"value",type:"Element"},{name:"valueRef",type:"Element",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Element",isAbstract:!0,properties:[{name:"extensionAttribute",type:"ExtensionAttribute",isAttr:!0,isReference:!0},{name:"elements",type:"ExtensionElements",isAttr:!0,isReference:!0}]},{name:"Artifact",isAbstract:!0,superClass:["DMNElement"],properties:[]},{name:"Association",superClass:["Artifact"],properties:[{name:"sourceRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"targetRef",type:"DMNElementReference",xml:{serialize:"property"}},{name:"associationDirection",type:"AssociationDirection",isAttr:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",isAttr:!0,type:"String",default:"text/plain"}]},{name:"RuleAnnotationClause",properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"RuleAnnotation",properties:[{name:"text",type:"String"}]},{name:"Invocable",isAbstract:!0,superClass:["DRGElement"],properties:[{name:"variable",type:"InformationItem",xml:{serialize:"property"}}]},{name:"Group",superClass:["Artifact"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"FunctionItem",superClass:["DMNElement"],properties:[{name:"parameters",isMany:!0,type:"InformationItem",xml:{serialize:"property"}},{name:"outputTypeRef",isAttr:!0,type:"String"}]},{name:"DMNElementReference",properties:[{isAttr:!0,name:"href",type:"String"}]}],enumerations:[{name:"HitPolicy",literalValues:[{name:"UNIQUE"},{name:"FIRST"},{name:"PRIORITY"},{name:"ANY"},{name:"COLLECT"},{name:"RULE ORDER"},{name:"OUTPUT ORDER"}]},{name:"BuiltinAggregator",literalValues:[{name:"SUM"},{name:"COUNT"},{name:"MIN"},{name:"MAX"}]},{name:"DecisionTableOrientation",literalValues:[{name:"Rule-as-Row"},{name:"Rule-as-Column"},{name:"CrossTable"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"FunctionKind",literalValues:[{name:"FEEL"},{name:"Java"},{name:"PMML"}]}],associations:[],xml:{tagAlias:"lowerCase"}},dmndi:{name:"DMNDI",prefix:"dmndi",uri:"https://www.omg.org/spec/DMN/20191111/DMNDI/",types:[{name:"DMNDI",properties:[{name:"diagrams",type:"DMNDiagram",isMany:!0},{name:"styles",type:"DMNStyle",isMany:!0}]},{name:"DMNStyle",superClass:["di:Style"],properties:[{name:"fillColor",type:"dc:Color",isAttr:!0},{name:"strokeColor",type:"dc:Color",isAttr:!0},{name:"fontColor",type:"dc:Color",isAttr:!0},{name:"fontSize",isAttr:!0,type:"Real"},{name:"fontFamily",isAttr:!0,type:"String"},{name:"fontItalic",isAttr:!0,type:"Boolean"},{name:"fontBold",isAttr:!0,type:"Boolean"},{name:"fontUnderline",isAttr:!0,type:"Boolean"},{name:"fontStrikeThrough",isAttr:!0,type:"Boolean"},{name:"labelHorizontalAlignment",type:"dc:AlignmentKind",isAttr:!0},{name:"labelVerticalAlignment",type:"dc:AlignmentKind",isAttr:!0}]},{name:"DMNDiagram",superClass:["di:Diagram"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"size",type:"Size"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"diagramElements",type:"DMNDiagramElement",isMany:!0}]},{name:"DMNDiagramElement",isAbstract:!0,superClass:["di:DiagramElement"],properties:[{name:"dmnElementRef",type:"dmn:DMNElement",isAttr:!0,isReference:!0},{name:"sharedStyle",type:"DMNStyle",isVirtual:!0,isReference:!0,redefines:"di:DiagramElement#sharedStyle"},{name:"localStyle",type:"DMNStyle",isVirtual:!0},{name:"label",type:"DMNLabel"}]},{name:"DMNLabel",superClass:["di:Shape"],properties:[{name:"text",type:"Text"}]},{name:"DMNShape",superClass:["di:Shape","DMNDiagramElement"],properties:[{name:"isListedInputData",isAttr:!0,type:"Boolean"},{name:"decisionServiceDividerLine",type:"DMNDecisionServiceDividerLine"},{name:"isCollapsed",isAttr:!0,type:"Boolean"}]},{name:"DMNEdge",superClass:["di:Edge","DMNDiagramElement"],properties:[{name:"sourceElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0},{name:"targetElement",type:"DMNDiagramElement",isAttr:!0,isReference:!0}]},{name:"DMNDecisionServiceDividerLine",superClass:["di:Edge"]},{name:"Text",properties:[{name:"text",isBody:!0,type:"String"}]},{name:"Size",superClass:["dc:Dimension"]}],associations:[],enumerations:[]},biodi:{name:"bpmn.io DI for DMN",uri:"http://bpmn.io/schema/dmn/biodi/2.0",prefix:"biodi",xml:{tagAlias:"lowerCase"},types:[{name:"DecisionTable",isAbstract:!0,extends:["dmn:DecisionTable"],properties:[{name:"annotationsWidth",isAttr:!0,type:"Integer"}]},{name:"OutputClause",isAbstract:!0,extends:["dmn:OutputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]},{name:"InputClause",isAbstract:!0,extends:["dmn:InputClause"],properties:[{name:"width",isAttr:!0,type:"Integer"}]}]}};return function(e,t){return new De(u({},we,e),t)}}));