@jylups/cmmn-js 0.0.0-stage → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/.babelrc +3 -0
  2. package/CHANGELOG.md +119 -0
  3. package/LICENSE +23 -0
  4. package/README.md +107 -2
  5. package/dist/assets/cmmn-font/css/cmmn-codes.css +41 -0
  6. package/dist/assets/cmmn-font/css/cmmn-embedded.css +94 -0
  7. package/dist/assets/cmmn-font/css/cmmn.css +97 -0
  8. package/dist/assets/cmmn-font/font/cmmn.eot +0 -0
  9. package/dist/assets/cmmn-font/font/cmmn.svg +90 -0
  10. package/dist/assets/cmmn-font/font/cmmn.ttf +0 -0
  11. package/dist/assets/cmmn-font/font/cmmn.woff +0 -0
  12. package/dist/assets/cmmn-font/font/cmmn.woff2 +0 -0
  13. package/dist/assets/diagram-js.css +713 -0
  14. package/dist/cmmn-modeler.development.js +44817 -0
  15. package/dist/cmmn-modeler.production.min.js +2 -0
  16. package/dist/cmmn-navigated-viewer.development.js +18131 -0
  17. package/dist/cmmn-navigated-viewer.production.min.js +2 -0
  18. package/dist/cmmn-viewer.development.js +17599 -0
  19. package/dist/cmmn-viewer.production.min.js +2 -0
  20. package/index.js +1 -0
  21. package/lib/Modeler.js +222 -0
  22. package/lib/NavigatedViewer.js +28 -0
  23. package/lib/Viewer.js +489 -0
  24. package/lib/core/ItemRegistry.js +316 -0
  25. package/lib/core/index.js +7 -0
  26. package/lib/draw/CmmnRenderer.js +1235 -0
  27. package/lib/draw/PathMap.js +335 -0
  28. package/lib/draw/index.js +5 -0
  29. package/lib/features/auto-resize/CmmnAutoResizeProvider.js +57 -0
  30. package/lib/features/auto-resize/index.js +7 -0
  31. package/lib/features/context-pad/ContextPadProvider.js +240 -0
  32. package/lib/features/context-pad/index.js +11 -0
  33. package/lib/features/editor-actions/CmmnEditorActions.js +105 -0
  34. package/lib/features/editor-actions/index.js +10 -0
  35. package/lib/features/keyboard/CmmnKeyboardBindings.js +159 -0
  36. package/lib/features/keyboard/index.js +7 -0
  37. package/lib/features/label-editing/LabelEditingProvider.js +221 -0
  38. package/lib/features/label-editing/LabelUtil.js +95 -0
  39. package/lib/features/label-editing/cmd/UpdateLabelHandler.js +63 -0
  40. package/lib/features/label-editing/index.js +9 -0
  41. package/lib/features/modeling/CmmnFactory.js +166 -0
  42. package/lib/features/modeling/CmmnLayouter.js +49 -0
  43. package/lib/features/modeling/CmmnUpdater.js +511 -0
  44. package/lib/features/modeling/ElementFactory.js +215 -0
  45. package/lib/features/modeling/Modeling.js +185 -0
  46. package/lib/features/modeling/behavior/AttachCriterionBehavior.js +58 -0
  47. package/lib/features/modeling/behavior/CaseFileItemUpdater.js +324 -0
  48. package/lib/features/modeling/behavior/LabelBehavior.js +139 -0
  49. package/lib/features/modeling/behavior/PlanItemDefinitionUpdater.js +449 -0
  50. package/lib/features/modeling/behavior/PlanningTableUpdater.js +620 -0
  51. package/lib/features/modeling/behavior/ReplaceConnectionBehavior.js +320 -0
  52. package/lib/features/modeling/behavior/ReplaceElementBehavior.js +395 -0
  53. package/lib/features/modeling/behavior/ResizeCasePlanModelBehavior.js +108 -0
  54. package/lib/features/modeling/behavior/SentryUpdater.js +678 -0
  55. package/lib/features/modeling/behavior/UnclaimIdBehavior.js +28 -0
  56. package/lib/features/modeling/behavior/index.js +24 -0
  57. package/lib/features/modeling/cmd/AppendShapeHandler.js +52 -0
  58. package/lib/features/modeling/cmd/IdClaimHandler.js +38 -0
  59. package/lib/features/modeling/cmd/ReconnectConnectionHandler.js +57 -0
  60. package/lib/features/modeling/cmd/ReplaceShapeHandler.js +46 -0
  61. package/lib/features/modeling/cmd/UpdateControlsHandler.js +221 -0
  62. package/lib/features/modeling/cmd/UpdatePropertiesHandler.js +240 -0
  63. package/lib/features/modeling/cmd/UpdateSemanticParentHandler.js +94 -0
  64. package/lib/features/modeling/index.js +20 -0
  65. package/lib/features/modeling/util/ModelingUtil.js +138 -0
  66. package/lib/features/modeling/util/PlanItemDefinitionUtil.js +183 -0
  67. package/lib/features/ordering/CmmnOrderingProvider.js +146 -0
  68. package/lib/features/ordering/index.js +4 -0
  69. package/lib/features/outline/Outline.js +47 -0
  70. package/lib/features/outline/index.js +6 -0
  71. package/lib/features/palette/PaletteProvider.js +171 -0
  72. package/lib/features/palette/index.js +12 -0
  73. package/lib/features/popup-menu/ReplaceMenuProvider.js +448 -0
  74. package/lib/features/popup-menu/index.js +4 -0
  75. package/lib/features/replace/CmmnReplace.js +355 -0
  76. package/lib/features/replace/ReplaceOptions.js +241 -0
  77. package/lib/features/replace/index.js +8 -0
  78. package/lib/features/replace-preview/CmmnReplacePreview.js +247 -0
  79. package/lib/features/replace-preview/index.js +7 -0
  80. package/lib/features/rules/CmmnRules.js +1040 -0
  81. package/lib/features/rules/index.js +7 -0
  82. package/lib/features/search/CmmnSearchProvider.js +129 -0
  83. package/lib/features/search/index.js +7 -0
  84. package/lib/features/snapping/CmmnConnectSnapping.js +110 -0
  85. package/lib/features/snapping/CmmnCreateMoveSnapping.js +148 -0
  86. package/lib/features/snapping/CmmnResizeSnapping.js +42 -0
  87. package/lib/features/snapping/CmmnSnappingUtil.js +76 -0
  88. package/lib/features/snapping/index.js +17 -0
  89. package/lib/import/CmmnImporter.js +251 -0
  90. package/lib/import/CmmnTreeWalker.js +410 -0
  91. package/lib/import/Importer.js +73 -0
  92. package/lib/import/Util.js +9 -0
  93. package/lib/import/index.js +3 -0
  94. package/lib/util/DiUtil.js +39 -0
  95. package/lib/util/LabelUtil.js +124 -0
  96. package/lib/util/ModelUtil.js +257 -0
  97. package/lib/util/PoweredByUtil.js +91 -0
  98. package/package.json +88 -4
  99. package/test/helper/index.js +231 -0
  100. package/test/util/KeyEvents.js +23 -0
  101. package/test/util/MockEvents.js +55 -0
  102. package/test/util/custom-rules/CustomRules.js +19 -0
  103. package/test/util/custom-rules/index.js +4 -0
@@ -0,0 +1,2 @@
1
+ /*! cmmn-js - cmmn-viewer v0.21.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).CmmnJS=e()}}(function(){var e={};function t(e,t){return function(e,t){return!(!e||"function"!=typeof e.$instanceOf||!e.$instanceOf(t))}(n(e),t)}function n(e){return e&&e.businessObject?e.businessObject:e}function r(e){return t(e=n(e),"cmmn:Stage")&&e.$parent&&t(e.$parent,"cmmn:Case")}function i(e){var r=n(e);return t(e,"cmmn:PlanItemDefinition")||t(e,"cmmn:CaseFileItemDefinition")?r:r&&r.definitionRef}function o(e){var t=i(e);return t&&t.defaultControl}function a(e){return(e=n(e))&&e.itemControl}function s(e,t){var n=a(e),r=o(e);return n&&n[t]?n[t]:r&&r[t]}e.is=t,e.getBusinessObject=n,e.isCasePlanModel=r,e.getDefinition=i,e.isRequired=function(e){return!!s(e,"requiredRule")},e.isRepeatable=function(e){return!!s(e,"repetitionRule")},e.isManualActivation=function(e){return!!s(e,"manualActivationRule")},e.isAutoComplete=function(e){var t=i(e=n(e));return e.autoComplete||t&&t.autoComplete},e.hasPlanningTable=function(e){return(e=n(e)).planningTable||i(e)&&i(e).planningTable},e.getName=function(e){t(e=n(e),"cmmndi:CMMNEdge")&&e.cmmnElementRef&&(e=e.cmmnElementRef);var r=e.name;return r||e.definitionRef&&(r=e.definitionRef.name),r},e.getSentry=function(e){var r=n(e);return t(r,"cmmn:Sentry")?r:r&&r.sentryRef},e.getStandardEvent=function(e){return(e=n(e)).cmmnElementRef&&e.cmmnElementRef.standardEvent};var l={};l="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var c={};"function"==typeof Symbol&&Symbol.iterator;Object.defineProperty(c,"__esModule",{value:!0});var u=Object.prototype.toString,p=Object.prototype.hasOwnProperty;function f(e){return void 0===e}function d(e){return void 0!==e}function h(e){return"[object Array]"===u.call(e)}function m(e){return"[object Object]"===u.call(e)}function y(e){var t=u.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function g(e,t){return p.call(e,t)}function v(e,t){var n;return t=C(t),b(e,function(e,r){if(t(e,r))return n=e,!1}),n}function b(e,t){var n;if(!f(e)){var r=h(e)?P:A;for(var i in e)if(g(e,i)&&!1===t(n=e[i],r(i)))return n}}function _(e,t,n){return b(e,function(e,r){n=t(n,e,r)}),n}function x(e,t){return!!_(e,function(e,n,r){return e&&t(n,r)},!0)}function w(e,t){var n=[];return b(e,function(e,r){n.push(t(e,r))}),n}function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=M(t),b(e,function(e){var r=t(e)||"_",i=n[r];i||(i=n[r]=[]),i.push(e)}),n}function M(e){return y(e)?e:function(t){return t[e]}}function C(e){return y(e)?e:function(t){return t===e}}function A(e){return e}function P(e){return Number(e)}function S(){return(S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}c.assign=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return S.apply(void 0,[e].concat(n))},c.bind=function(e,t){return e.bind(t)},c.debounce=function(e,t){var n,r,i,o;function a(n){var a=Date.now(),c=n?0:o+t-a;if(c>0)return s(c);e.apply(i,r),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=r=i=void 0}function c(){o=Date.now();for(var e=arguments.length,a=new Array(e),l=0;l<e;l++)a[l]=arguments[l];r=a,i=this,n||s(t)}return c.flush=function(){n&&a(!0),l()},c.cancel=l,c},c.every=x,c.filter=function(e,t){var n=[];return b(e,function(e,r){t(e,r)&&n.push(e)}),n},c.find=v,c.forEach=b,c.groupBy=E,c.isArray=h,c.isDefined=d,c.isFunction=y,c.isNumber=function(e){return"[object Number]"===u.call(e)},c.isObject=m,c.isString=function(e){return"[object String]"===u.call(e)},c.isUndefined=f,c.map=w,c.matchPattern=function(e){return function(t){return x(e,function(e,n){return t[n]===e})}},c.omit=function(e,t){var n={};return b(Object(e),function(e,r){-1===t.indexOf(r)&&(n[r]=e)}),n},c.pick=function(e,t){var n={},r=Object(e);return b(t,function(t){t in r&&(n[t]=e[t])}),n},c.reduce=_,c.some=function(e,t){return!!v(e,t)};var N={};function R(e,t,n){var r=N.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(r){e.set(r,t.inverse,n)})}function k(e,t){if(!(this instanceof k))return new k(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}N.extend=function(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,i,r)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},N.isExtended=function(e){return!0===e.__refs_collection},k.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?R(this,t,e):function(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var o=i;i=null,o&&e.unset(o,r,n),i=t,e.set(i,r,n)}}})}(this,t,e)},k.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return N.isExtended(n)||R(this,t,e),n},k.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},k.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},k.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var O={};(O=k).Collection=N;var T={};Object.defineProperty(T,"__esModule",{value:!0}),T.Label=G,T.create=function(e,t){var n=q[e];if(!n)throw new Error("unknown type: <"+e+">");return(0,c.assign)(new n,t)};var j=B(l),D=B(O);function B(e){return e&&e.__esModule?e:{default:e}}var I=new D.default({name:"children",enumerable:!0,collection:!0},{name:"parent"}),L=new D.default({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),F=new D.default({name:"attachers",collection:!0},{name:"host"}),z=new D.default({name:"outgoing",collection:!0},{name:"source"}),V=new D.default({name:"incoming",collection:!0},{name:"target"});function $(){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)}}),I.bind(this,"parent"),L.bind(this,"labels"),z.bind(this,"outgoing"),V.bind(this,"incoming")}function U(){$.call(this),I.bind(this,"children"),F.bind(this,"host"),F.bind(this,"attachers")}function W(){U.call(this)}function G(){U.call(this),L.bind(this,"labelTarget")}function H(){$.call(this),z.bind(this,"source"),V.bind(this,"target")}(0,j.default)(U,$),(0,j.default)(W,U),(0,j.default)(G,U),(0,j.default)(H,$);var q={connection:H,shape:U,label:G,root:W};var K={},Y=c.some,X=e.is;e.getBusinessObject;function Z(e,t){return Y(t,function(t){return X(e,t)})}K.isAny=Z;var J=e.getDefinition,Q=e.getSentry,ee=K.isAny,te=c.forEach,ne=c.isArray;function re(e,t){this._items={},this._referencedBy={},this._elementRegistry=e,this._eventBus=t,this._init()}re.$inject=["elementRegistry","eventBus"];var ie=re;function oe(e){return J(e)||Q(e)}function ae(e){return ee(e,["cmmn:PlanItemDefinition","cmmn:Sentry","cmmn:CaseFileItemDefinition"])}re.prototype._init=function(e){var t=this._eventBus;t.on("diagram.destroy",500,this._clear,this),t.on("diagram.clear",500,this._clear,this)},re.prototype._clear=function(){this._items={},this._referencedBy={}},re.prototype.add=function(e){var t=this._items,n=e.id,r=this._referencedBy,i=oe(e),o=i&&i.id;t[n]=e,i&&(r[o]=r[o]||[],-1===r[o].indexOf(e)&&r[o].push(e))},re.prototype.remove=function(e){var t=this._items,n=e.id,r=this._referencedBy,i=oe(e),o=i&&i.id;if(delete t[n],i){var a=r[o]||[],s=a.indexOf(e);-1!==s&&a.splice(s,1),a.length||delete r[o]}},re.prototype.updateId=function(e,t){var n,r;"string"==typeof e&&(e=this.get(e)),n=ae(e)?this._referencedBy:this._items,e&&(r=n[e.id],delete n[e.id],n[t]=r)},re.prototype.updateReference=function(e,t){var n=this._referencedBy,r=oe(e),i=r&&r.id;if(r){var o=n[i]||[],a=o.indexOf(e);-1!==a&&o.splice(a,1),o.length||delete n[i]}if(t){var s=t.id;s&&(n[s]=n[s]||[],-1===n[s].indexOf(e)&&n[s].push(e))}},re.prototype.get=function(e){return this._items[e]},re.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t},re.prototype.getAll=function(){return this.filter(function(e){return e})},re.prototype.forEach=function(e){var t=this._items;te(t,function(t){return e(t,oe(t))})},re.prototype.getReferences=function(e){var t=e.id||e;return(this._referencedBy[t]||[]).slice()},re.prototype.getShape=function(e){var t=e.id||e;return this._elementRegistry&&this._elementRegistry.get(t)},re.prototype.getShapes=function(e){var t=[],n=this;function r(e){e&&t.push(e)}if(ne(e))te(e,function(e){r(n.getShape(e))});else if(ae(e)){var i=n.getReferences(e);te(i,function(e){r(n.getShape(e))})}else r(n.getShape(e));return t};var se={},le=e.is,ce=e.getBusinessObject,ue=e.isCasePlanModel;se.isCollapsed=function(e){if(!ue(e)){var t=(e=ce(e)).definitionRef;if(le(t,"cmmn:PlanFragment"))return!!(e&&e.di&&e.di.isCollapsed)}return!1},se.isPlanningTableCollapsed=function(e){return e=ce(e),!!(le(e,"cmmn:Stage")||e.definitionRef&&(le(e.definitionRef,"cmmn:Stage")||le(e.definitionRef,"cmmn:HumanTask")))&&(e.di&&e.di.isPlanningTableCollapsed)},se.isStandardEventVisible=function(e){var t=(e=ce(e)).cmmnElementRef;return!(!le(t,"cmmn:OnPart")||!e.isStandardEventVisible)};var pe={};Object.defineProperty(pe,"__esModule",{value:!0}),pe.default=de;var fe=1e3;function de(e,t){var n=this;t=t||fe,e.on(["render.shape","render.connection"],t,function(e,t){var r=e.type,i=t.element,o=t.gfx;if(n.canRender(i))return"render.shape"===r?n.drawShape(o,i):n.drawConnection(o,i)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)})}de.prototype.canRender=function(){},de.prototype.drawShape=function(){},de.prototype.drawConnection=function(){},de.prototype.getShapePath=function(){},de.prototype.getConnectionPath=function(){};var he={};function me(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}function ye(e,t){return t.appendChild(me(e,t))}Object.defineProperty(he,"__esModule",{value:!0});var ge=2,ve={"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":ge,"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":ge,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function be(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=ve[r];i?(i===ge&&"number"==typeof n&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function _e(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return ve[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);be(e,t,n)}else!function(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)be(e,r,t[r])}(e,t);return e}function xe(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 we=/\s+/,Ee=Object.prototype.toString;function Me(e){return void 0!==e}function Ce(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ae(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Pe(e){for(var t;t=e.firstChild;)Ae(t);return e}Ce.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~xe(t,e)||t.push(e),Me(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},Ce.prototype.remove=function(e){if("[object RegExp]"===Ee.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=xe(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},Ce.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},Ce.prototype.toggle=function(e,t){return this.list?(Me(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(Me(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},Ce.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(we);return""===e[0]&&e.shift(),e},Ce.prototype.has=Ce.prototype.contains=function(e){return this.list?this.list.contains(e):!!~xe(this.array(),e)};var Se={svg:"http://www.w3.org/2000/svg"},Ne='<svg xmlns="'+Se.svg+'"';function Re(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(Se.svg)&&(e=Ne+e.substring(4)):(e=Ne+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function ke(e,t){var n;return"<"===e.charAt(0)?(n=Re(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Se.svg,e),t&&_e(n,t),n}var Oe=null;function Te(){return null===Oe&&(Oe=ke("svg")),Oe}function je(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}var De=/([&<>]{1})/g,Be=/([\n\r"]{1})/g,Ie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Le(e,t){return e.replace(t,function(e,t){return Ie[t]||t})}function Fe(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(Le(e.textContent,De));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,r=(i=e.attributes).length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',Le(o.value,Be),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,r=(a=e.childNodes).length;n<r;++n)Fe(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Le(e.nodeValue,De),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function ze(e,t){var n=Re(t);if(Pe(e),t){"#document-fragment"!==n.nodeName&&(n=n.documentElement);for(var r,i=(r=n.childNodes,Array.prototype.slice.call(r)),o=0;o<i.length;o++)ye(i[o],e)}}function Ve(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}he.append=function(e,t){return ye(t,e),e},he.attr=_e,he.classes=function(e){return new Ce(e)},he.create=ke,he.innerSVG=function(e,t){if(void 0!==t){try{ze(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)Fe(t,n),t=t.nextSibling;return n.join("")}(e)},he.remove=Ae,he.transform=function(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(Ve(e,r))}(n,t)),n.consolidate()},he.createMatrix=function(e,t,n,r,i,o){var a=Te().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return je(a,e);case 6:return je(a,{a:e,b:t,c:n,d:r,e:i,f:o})}},he.createTransform=function(e){return e?Te().createSVGTransformFromMatrix(e):Te().createSVGTransform()};var $e={};function Ue(e){for(var t,n="",r=0;t=e[r];r++)n+=t.x+","+t.y+" ";return n}Object.defineProperty($e,"__esModule",{value:!0}),$e.componentsToPath=function(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")},$e.createLine=function(e,t){var n=(0,he.create)("polyline");(0,he.attr)(n,{points:Ue(e)}),t&&(0,he.attr)(n,t);return n},$e.updateLine=function(e,t){return(0,he.attr)(e,{points:Ue(t)}),e};var We={};Object.defineProperty(We,"__esModule",{value:!0}),We.translate=function(e,t,n){var r=(0,he.createTransform)();r.setTranslate(t,n),(0,he.transform)(e,r)};var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.default=Je;var He=0,qe={width:150,height:50};function Ke(e,t){var n;t.textContent=e;try{var r,i=""===e;return t.textContent=i?"dummy":e,r={width:(n=t.getBBox()).width+2*n.x,height:n.height},i&&(r.width=0),r}catch(e){return{width:0,height:0}}}function Ye(e,t,n){for(var r,i=e.shift(),o=i;;){if((r=Ke(o,n)).width=o?r.width:0," "===o||""===o||r.width<Math.round(t)||o.length<2)return Xe(e,o,i,r);o=Ze(o,r.width,t)}}function Xe(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}function Ze(e,t,n){var r=Math.max(e.length*(n/t),1),i=function(e,t){var n,r=e.split(/(\s|-)/g),i=[],o=0;if(r.length>1)for(;n=r.shift();){if(!(n.length+o<t)){"-"===n&&i.pop();break}i.push(n),o+=n.length}return i.join("")}(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function Je(e){this._config=(0,c.assign)({},{size:qe,padding:He,style:{},align:"center-top"},e||{})}Je.prototype.createText=function(e,t){return this.layoutText(e,t).element},Je.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Je.prototype.layoutText=function(e,t){var n=(0,c.assign)({},this._config.size,t.box),r=(0,c.assign)({},this._config.style,t.style),i=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return(0,c.isObject)(e)?(0,c.assign)({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,s=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(r),l=e.split(/\r?\n/g),u=[],p=n.width-o.left-o.right,f=(0,he.create)("text");(0,he.attr)(f,{x:0,y:0}),(0,he.attr)(f,r);var d=function(){var e=document.getElementById("helper-svg");return e||(e=(0,he.create)("svg"),(0,he.attr)(e,{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(e)),e}();for((0,he.append)(d,f);l.length;)u.push(Ye(l,p,f));"middle"===i.vertical&&(o.top=o.bottom=0);var h=(0,c.reduce)(u,function(e,t,n){return e+(s||t.height)},0)+o.top+o.bottom,m=(0,c.reduce)(u,function(e,t,n){return t.width>e?t.width:e},0),y=o.top;"middle"===i.vertical&&(y+=(n.height-h)/2),y-=(s||u[0].height)/4;var g=(0,he.create)("text");return(0,he.attr)(g,r),(0,c.forEach)(u,function(e){var t;switch(y+=s||e.height,i.horizontal){case"left":t=o.left;break;case"right":t=(a?m:p)-o.right-e.width;break;default:t=Math.max(((a?m:p)-e.width)/2+o.left,0)}var n=(0,he.create)("tspan");(0,he.attr)(n,{x:t,y:y}),n.textContent=e.text,(0,he.append)(g,n)}),(0,he.remove)(f),{dimensions:{width:m,height:h},element:g}};var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Object.prototype.toString,Object.prototype.hasOwnProperty;var et=[].indexOf,tt=function(e,t){if(et)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},nt=/\s+/,rt=Object.prototype.toString;function it(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}it.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~tt(t,e)||t.push(e),this.el.className=t.join(" "),this},it.prototype.remove=function(e){if("[object RegExp]"==rt.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=tt(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},it.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},it.prototype.toggle=function(e,t){return this.list?(void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},it.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(nt);return""===e[0]&&e.shift(),e},it.prototype.has=it.prototype.contains=function(e){return this.list?this.list.contains(e):!!~tt(this.array(),e)};var ot="undefined"!=typeof Element?Element.prototype:{},at=ot.matches||ot.matchesSelector||ot.webkitMatchesSelector||ot.mozMatchesSelector||ot.msMatchesSelector||ot.oMatchesSelector,st=function(e,t){if(!e||1!==e.nodeType)return!1;if(at)return at.call(e,t);for(var n=e.parentNode.querySelectorAll(t),r=0;r<n.length;r++)if(n[r]==e)return!0;return!1};function lt(e,t,n){for(var r=n?e:e.parentNode;r&&r.nodeType!==document.DOCUMENT_NODE&&r.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(st(r,t))return r;r=r.parentNode}return st(r,t)?r:null}var ct=window.addEventListener?"addEventListener":"attachEvent",ut=window.removeEventListener?"removeEventListener":"detachEvent",pt="addEventListener"!==ct?"on":"",ft={bind:function(e,t,n,r){return e[ct](pt+t,n,r||!1),n},unbind:function(e,t,n,r){return e[ut](pt+t,n,r||!1),n}},dt=["focus","blur"];var ht,mt={bind:function(e,t,n,r,i){return-1!==dt.indexOf(n)&&(i=!0),ft.bind(e,n,function(n){var i=n.target||n.srcElement;n.delegateTarget=lt(i,t,!0),n.delegateTarget&&r.call(e,n)},i)},unbind:function(e,t,n,r){return-1!==dt.indexOf(t)&&(r=!0),ft.unbind(e,t,n,r)}},yt=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){var i=t.createElement("html");return i.innerHTML=e,i.removeChild(i.lastChild)}var o=vt[r]||vt._default,a=o[0],s=o[1],l=o[2];(i=t.createElement("div")).innerHTML=s+e+l;for(;a--;)i=i.lastChild;if(i.firstChild==i.lastChild)return i.removeChild(i.firstChild);var c=t.createDocumentFragment();for(;i.firstChild;)c.appendChild(i.removeChild(i.firstChild));return c},gt=!1;"undefined"!=typeof document&&((ht=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',gt=!ht.getElementsByTagName("link").length,ht=void 0);var vt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:gt?[1,"X<div>","</div>"]:[0,"",""]};vt.td=vt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],vt.option=vt.optgroup=[1,'<select multiple="multiple">',"</select>"],vt.thead=vt.tbody=vt.colgroup=vt.caption=vt.tfoot=[1,"<table>","</table>"],vt.polyline=vt.ellipse=vt.polygon=vt.circle=vt.text=vt.line=vt.path=vt.rect=vt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"],Qe.attr=function(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)},Qe.classes=function(e){return new it(e)},Qe.clear=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},Qe.delegate=mt,Qe.domify=yt,Qe.event=ft,Qe.query=function(e,t){return(t=t||document).querySelector(e)},Qe.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var bt=c.isArray,_t=c.isObject,xt=c.assign,wt=pe.default,Et=Ge.default,Mt=se.isStandardEventVisible,Ct=se.isPlanningTableCollapsed,At=se.isCollapsed,Pt=e.isCasePlanModel,St=e.getBusinessObject,Nt=e.getDefinition,Rt=e.isRequired,kt=e.isRepeatable,Ot=e.isManualActivation,Tt=e.isAutoComplete,jt=e.hasPlanningTable,Dt=e.getName,Bt=e.is,It=e.getStandardEvent,Lt=Qe.query,Ft=he.append,zt=he.attr,Vt=he.classes,$t=he.create,Ut=We.translate,Wt=$e.createLine;function Gt(e,t,n){wt.call(this,e);var r=20,i=new Et({style:{fontFamily:"Arial, sans-serif",fontSize:"12px"},size:{width:100}}),o={};function a(e){return o[e]}function s(e){function t(t,n){var r=xt({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},n.attrs),i=n.ref||{x:0,y:0},a=n.scale||1;"none"===r.strokeDasharray&&(r.strokeDasharray=[1e4,1]);var s=$t("marker");zt(n.element,r),Ft(s,n.element),zt(s,{id:t,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*a,markerHeight:20*a,orient:"auto"});var l=Lt("defs",e);return l||(l=$t("defs"),Ft(e,l)),Ft(l,s),function(e,t){o[e]=t}(t,s)}var n=$t("path");zt(n,{d:"M 11 5 L 1 10 L 11 15"}),t("association-start",{element:n,attrs:{fill:"none",stroke:"black",strokeWidth:1.5},ref:{x:1,y:10},scale:.5});var r=$t("path");zt(r,{d:"M 1 5 L 11 10 L 1 15"}),t("association-end",{element:r,attrs:{fill:"none",stroke:"black",strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}function l(e,n,r){return bt(n)||(r=n,n=[]),t.style(n||[],xt(r,e||{}))}function c(e,t,n,r,i){_t(r)&&(i=r,r=0),r=r||0,i=l(i,{stroke:"black",strokeWidth:2,fill:"white"});var o=t/2,a=n/2,s=$t("circle");return zt(s,{cx:o,cy:a,r:Math.round((t+n)/4-r)}),zt(s,i),Ft(e,s),s}function u(e,t,n,r,i,o){_t(i)&&(o=i,i=0),i=i||0,o=l(o,{stroke:"black",strokeWidth:2,fill:"white"});var a=$t("rect");return zt(a,{x:i,y:i,width:t-2*i,height:n-2*i,rx:r,ry:r}),zt(a,o),Ft(e,a),a}function p(e,t,n,r){var i=t/2,o=n/2,a=[{x:i,y:0},{x:t,y:o},{x:i,y:n},{x:0,y:o}].map(function(e){return e.x+","+e.y}).join(" ");r=l(r,{stroke:"black",strokeWidth:2,fill:"white"});var s=$t("polygon");return zt(s,{points:a}),zt(s,r),Ft(e,s),s}function f(e,t,n){n=l(n,["no-fill"],{strokeWidth:2,stroke:"black"});var r=$t("path");return zt(r,{d:t}),zt(r,n),Ft(e,r),r}function d(e,t,n){var r=t.map(function(e){return e.x+","+e.y}).join(" "),i=$t("polygon");return zt(i,{points:r}),zt(i,n),Ft(e,i),i}function h(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,r=1;r<t.length;r++)n+="L"+t[r].x+","+t[r].y+" ";return n}function m(e,t,n){var r=i.createText(t||"",n);return Vt(r).add("djs-label"),Ft(e,r),r}function y(e,t,n){return m(e,Dt(t),{box:t,align:n,padding:5})}function g(e){return v[e]}var v={"cmmn:PlanItem":function(e,t){return g(Nt(t).$type)(e,t)},"cmmn:DiscretionaryItem":function(e,t){var n=Nt(t),r={strokeDasharray:"10, 12"};return Bt(n,"cmmn:Task")&&xt(r,{strokeDasharray:"12, 12.4",strokeDashoffset:13.6}),g(n.$type)(e,t,r)},"cmmn:Stage":function(e,t,n){var i;return n=xt({fillOpacity:.95},n),Pt(t)?v["cmmn:CasePlanModel"](e,t):(i=function(e,t,n,r,i){var o=[{x:r=r||20,y:n},{x:0,y:n-r},{x:0,y:r},{x:r,y:0},{x:t-r,y:0},{x:t,y:r},{x:t,y:n-r},{x:t-r,y:n}];return(i=i||{}).fill="white",i.stroke="black",i.strokeWidth=2,d(e,o,i)}(e,t.width,t.height,r,n),At(t)?y(e,t,"center-middle"):function(e,t,n){var i=m(e,Dt(t),{box:t,align:n,padding:5});Ut(i,r,0)}(e,t,"left-top"),x(e,t),_(e,t),i)},"cmmn:PlanFragment":function(e,t,n){var r=u(e,t.width,t.height,10,{strokeDasharray:"10, 12",fillOpacity:.95});return y(e,t,At(t)?"center-middle":"left-top"),_(e,t),r},"cmmn:CasePlanModel":function(e,t){var n=u(e,t.width,t.height,0,{fillOpacity:.95});return function(e,t){var n=St(t),r=t.width/2-60,i=m(e,n.name,{box:{height:18,width:r},align:"left-top"}),o=i.getBBox().width,a=o+40;o<60&&(a=100);var s=d(e,[{x:10,y:0},{x:20,y:-18},{x:a,y:-18},{x:a+10,y:0}],{fill:"white",stroke:"black",strokeWidth:2,fillOpacity:.95,"pointer-events":"all"});i.parentNode.insertBefore(s,i),Ut(i,25,-13)}(e,t),x(e,t),function(e,t){var n=St(t);Tt(n)&&w("AutoCompleteMarker",e,t,-7)}(e,t),n},"cmmn:Milestone":function(e,t,n){var r=u(e,t.width,t.height,24,n);return y(e,t,"center-middle"),b(e,t),r},"cmmn:EventListener":function(e,t,n){var r=c(e,t.width,t.height,n);return(n=n||{}).strokeWidth=2,c(e,t.width,t.height,.1*t.height,n),r},"cmmn:TimerEventListener":function(e,t,r){var i=g("cmmn:EventListener")(e,t,r);f(e,n.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square"});for(var o=0;o<12;o++){var a=n.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),s=t.width/2;f(e,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*o+","+t.height/2+","+s+")"})}return i},"cmmn:UserEventListener":function(e,t,r){var i=g("cmmn:EventListener")(e,t,r);return f(e,n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:20,y:15}}),{strokeWidth:.5,fill:"none"}),f(e,n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:20,y:15}}),{strokeWidth:.5,fill:"none"}),f(e,n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:20,y:15}}),{strokeWidth:.5,fill:"black"}),i},"cmmn:Task":function(e,t,n){var r=u(e,t.width,t.height,10,n);return y(e,t,"center-middle"),b(e,t),r},"cmmn:HumanTask":function(e,t,r){var i=g("cmmn:Task")(e,t,r);if(t.businessObject.definitionRef.isBlocking){f(e,n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:"none"}),f(e,n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:"none"}),f(e,n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:"black"})}else{f(e,n.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:1.25,fill:"white",stroke:"black"})}return x(e,t),i},"cmmn:CaseTask":function(e,t,r){var i=g("cmmn:Task")(e,t,r);return f(e,n.getScaledPath("TASK_TYPE_FOLDER",{abspos:{x:7,y:7}}),{strokeWidth:1.25,fill:"white",stroke:"black"}),i},"cmmn:ProcessTask":function(e,t,r){var i=g("cmmn:Task")(e,t,r);return f(e,n.getScaledPath("TASK_TYPE_CHEVRON",{abspos:{x:5,y:5}}),{strokeWidth:1.25,fill:"white",stroke:"black"}),i},"cmmn:DecisionTask":function(e,t,r){var i=g("cmmn:Task")(e,t,r);return f(e,n.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),{strokeWidth:1,fill:"000"}),f(e,n.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),{strokeWidth:1}),i},"cmmn:CaseFileItem":function(e,t,r){return f(e,n.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:"white"})},"cmmn:TextAnnotation":function(e,t){var r=u(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return f(e,n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}})),m(e,St(t).text||"",{box:t,align:"left-middle",padding:5}),r},"cmmn:Association":function(e,t,n){var r=St(t);return n=xt({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round"},n||{}),"One"!==r.associationDirection&&"Both"!==r.associationDirection||(n.markerEnd=a("association-end")),"Both"===r.associationDirection&&(n.markerStart=a("association-start")),function(e,t,n){n=l(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"});var r=Wt(t,n);return Ft(e,r),r}(e,t.waypoints,n)},StageMarker:function(e,t){var r=u(e,14,14,0,{strokeWidth:1,stroke:"black"});Ut(r,t.width/2-7,t.height-17);var i=At(t)?"MARKER_STAGE_COLLAPSED":"MARKER_STAGE_EXPANDED";f(e,n.getScaledPath(i,{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7)/t.width,my:(t.height-17)/t.height}}))},RequiredMarker:function(e,t,r){f(e,n.getScaledPath("MARKER_REQUIRED",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r)/t.width,my:(t.height-17)/t.height}}),{strokeWidth:3})},AutoCompleteMarker:function(e,t,n){var r=u(e,11,14,0,{strokeWidth:1,stroke:"black",fill:"black"});Ut(r,t.width/2+n+2,t.height-17)},ManualActivationMarker:function(e,t,r){f(e,n.getScaledPath("MARKER_MANUAL_ACTIVATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r)/t.width,my:(t.height-17)/t.height}}),{strokeWidth:1})},RepetitionMarker:function(e,t,r){f(e,n.getScaledPath("MARKER_REPEATABLE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r)/t.width,my:(t.height-17)/t.height}}))},PlanningTableMarker:function(e,t,r){var i=u(e,30,24,0,{strokeWidth:1.5,stroke:"black"});Ut(i,t.width/2-15,-17);var o=Ct(t)?"MARKER_PLANNING_TABLE_COLLAPSED":"MARKER_PLANNING_TABLE_EXPANDED";f(e,n.getScaledPath(o,{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-15)/t.width,my:-17/t.height}}),{strokeWidth:1.5})},"cmmn:OnPart":function(e,t){return f(e,h(t),{strokeDasharray:"10, 5, 2, 5, 2, 5",strokeWidth:1.5})},"cmmn:PlanItemOnPart":function(e,t){return g("cmmn:OnPart")(e,t)},"cmmn:CaseFileItemOnPart":function(e,t){return g("cmmn:OnPart")(e,t)},"cmmn:EntryCriterion":function(e,t){return p(e,t.width,t.height,{fill:"white"})},"cmmn:ExitCriterion":function(e,t){return p(e,t.width,t.height,{fill:"black"})},"cmmndi:CMMNEdge":function(e,t){var n=St(t);return n.cmmnElementRef?g(n.cmmnElementRef.$type)(e,t):f(e,h(t),{strokeDasharray:"3, 5",strokeWidth:1})},label:function(e,t){var n,r=function(e,t){var n=Dt(t),r=!1,i=It(t);if(i){var o=Mt(t);i="["+i+"]",n?o&&(n=n+" "+i):(n=i,t.hidden=r=!o)}var a={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return t.hidden=t.labelTarget.hidden||r||!n,m(e,n,{box:a,style:{fontSize:"11px"}})}(e,t);try{n=r.getBBox()}catch(e){n={width:0,height:0,x:0}}return t.x=Math.ceil(t.x+t.width/2)-Math.ceil(n.width/2),t.width=Math.ceil(n.width),t.height=Math.ceil(n.height),zt(r,{transform:"translate("+-1*n.x+",0)"}),r}};function b(e,t){var n=St(t),r=[];Rt(n)&&r.push({marker:"RequiredMarker",width:1}),Ot(n)&&r.push({marker:"ManualActivationMarker",width:14}),kt(n)&&r.push({marker:"RepetitionMarker",width:14}),r.length&&(1===r.length?w(r[0].marker,e,t,r[0].width/2*-1):2===r.length?(w(r[0].marker,e,t,-1*r[0].width-3),w(r[1].marker,e,t,3)):3===r.length&&(w(r[1].marker,e,t,r[1].width/2*-1),w(r[0].marker,e,t,r[1].width/2*-1-6-r[0].width),w(r[2].marker,e,t,r[1].width/2+6)))}function _(e,t,n){var r=St(t);w("StageMarker",e,t,-7);var i=[];Rt(r)&&i.push({marker:"RequiredMarker",width:1}),Tt(r)&&i.push({marker:"AutoCompleteMarker",width:14}),i.length&&(1===i.length?w(i[0].marker,e,t,-1*i[0].width-7-6):2===i.length&&(w(i[0].marker,e,t,-1*i[1].width-7-6- -1*i[0].width-6),w(i[1].marker,e,t,-1*i[1].width-7-6)));var o=[];Ot(r)&&o.push({marker:"ManualActivationMarker",width:14}),kt(r)&&o.push({marker:"RepetitionMarker",width:14}),o.length&&(1===o.length?w(o[0].marker,e,t,13):2===o.length&&(w(o[0].marker,e,t,13),w(o[1].marker,e,t,13+o[0].width+6)))}function x(e,t){jt(t)&&w("PlanningTableMarker",e,t)}function w(e,t,n,r){g(e)(t,n,r)}this.canRender=function(e){return Bt(e,"cmmn:CMMNElement")||Bt(e,"cmmndi:CMMNEdge")},this.drawShape=function(e,t){var n=v[t.type];return n?n(e,t):wt.prototype.drawShape.apply(this,[e,t])},this.drawConnection=function(e,t){var n=t.type,r=v[n];return r?r(e,t):wt.prototype.drawConnection.apply(this,[e,t])},e.on("canvas.init",function(e){s(e.svg)})}l(Gt,wt),Gt.$inject=["eventBus","styles","pathMap"];var Ht=function(){var e="m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5",t="m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005",n="m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z";this.pathMap={TASK_TYPE_FOLDER:{d:"m {mx},{my} l18,0 l0,12 l-18,0 l0,-12 m 2,0 l3,-4 l5,0 l3,4"},TASK_TYPE_CHEVRON:{d:"m {mx},{my} l15,0 l6,6 l-6,6 l-15,0 l6,-6 l-6,-6"},TASK_TYPE_USER_1:{d:e},TASK_TYPE_USER_2:{d:t},TASK_TYPE_USER_3:{d:n},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_USER_1:{d:e,height:36,width:36,heightElements:[],widthElements:[]},EVENT_USER_2:{d:t,height:36,width:36,heightElements:[],widthElements:[]},EVENT_USER_3:{d:n,height:36,width:36,heightElements:[],widthElements:[]},MARKER_STAGE_EXPANDED:{d:"m{mx},{my} m 2,7 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_STAGE_COLLAPSED:{d:"m{mx},{my} m 2,7 l 10,0 m -5,-5 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_REQUIRED:{d:"m{mx},{my} l 0,9 m 0,2 l0,3",height:14,width:3,heightElements:[],widthElements:[]},MARKER_MANUAL_ACTIVATION:{d:"m{mx}, {my} l 14,7 l -14,7 l 0,-14 z",height:14,width:14,heightElements:[],widthElements:[]},MARKER_REPEATABLE:{d:"m{mx},{my} m 3,0 l 0,14 m 6,-14 l 0,14 m -10,-10 l 14,0 m -14,6 l 14,0",height:14,width:14,heightElements:[],widthElements:[]},MARKER_PLANNING_TABLE_EXPANDED:{d:"m{mx},{my} m 0,12 l 30,0 m -20,-12 l 0, 24 m 10, -24 l 0, 24 m -10, -6 l 10,0",height:24,width:30,heightElements:[],widthElements:[]},MARKER_PLANNING_TABLE_COLLAPSED:{d:"m{mx},{my} m 0,12 l 30,0 m -20,-12 l 0, 24 m 10, -24 l 0, 24 m -10, -6 l 10,0 m -5, -6 l 0,12",height:10,width:10,heightElements:[],widthElements:[]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,r,i=this.pathMap[e];t.abspos?(n=t.abspos.x,r=t.abspos.y):(n=t.containerWidth*t.position.mx,r=t.containerHeight*t.position.my);var o,a,s={};if(t.position){for(var l=t.containerHeight/i.height*t.yScaleFactor,c=t.containerWidth/i.width*t.xScaleFactor,u=0;u<i.heightElements.length;u++)s["y"+u]=i.heightElements[u]*l;for(var p=0;p<i.widthElements.length;p++)s["x"+p]=i.widthElements[p]*c}return o=i.d,a={mx:n,my:r,e:s},String(o).replace(qt,function(e,t){return function(e,t,n){var r=n;return t.replace(Kt,function(e,t,n,i,o){t=t||i,r&&(t in r&&(r=r[t]),"function"==typeof r&&o&&(r=r()))}),r=(null==r||r==n?e:r)+""}(e,t,a)})}},qt=/\{([^}]+)\}/g,Kt=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Yt={__init__:["cmmnRenderer"],cmmnRenderer:["type",Gt],pathMap:["type",Ht]},Xt={elementToString:function(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}},Zt={},Jt=e.is,Qt=c.assign,en={width:90,height:20};Zt.hasExternalLabel=function(e){return(Jt(e,"cmmn:PlanItem")||Jt(e,"cmmn:DiscretionaryItem"))&&(e=e.definitionRef),Jt(e,"cmmndi:CMMNEdge")&&e.cmmnElementRef&&Jt(e.cmmnElementRef,"cmmn:OnPart")&&(e=e.cmmnElementRef),Jt(e,"cmmn:EventListener")||Jt(e,"cmmn:OnPart")||Jt(e,"cmmn:CaseFileItem")};var tn=function(e){var t,n,r,i,o=e.businessObject,a=o.di;return!a&&Jt(o,"cmmndi:CMMNEdge")&&o.cmmnElementRef&&(a=o),o&&a&&a.waypoint?(t=a.waypoint,n=t.length/2-1,r=t[Math.floor(n)],i=t[Math.ceil(n+.01)],{x:r.x+(i.x-r.x)/2,y:r.y+(i.y-r.y)/2}):{x:e.x+e.width/2,y:e.y+e.height+en.height/2}};Zt.getExternalLabelBounds=function(e,t){var n,r,i,o=(e.di||e).label;return o&&o.bounds?(i=o.bounds,r={width:Math.max(en.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=tn(t),r=en),Qt({x:n.x-r.width/2,y:n.y-r.height/2},r)};var nn=c.assign,rn=c.map,on=e.is,an=Zt.hasExternalLabel,sn=Zt.getExternalLabelBounds,ln=se.isCollapsed,cn=Xt.elementToString;function un(e,t){return nn({id:e.id,type:e.$type,businessObject:e},t)}function pn(e,t,n){return new Error("element "+cn(t)+" referenced by "+cn(e)+"#"+n+" not yet drawn")}function fn(e,t,n,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r}fn.$inject=["eventBus","canvas","elementFactory","elementRegistry"];var dn=fn;fn.prototype.root=function(e){var t=this._elementFactory.createRoot(un(e));return this._canvas.setRootElement(t),t},fn.prototype.add=function(e,t){var n,r,i,o=e.di;if(o&&on(o,"cmmndi:CMMNShape")&&!this._getElement(e)){var a=ln(e);r=t&&(t.hidden||t.collapsed);var s=e.di.bounds;n=this._elementFactory.createShape(un(e,{collapsed:a,hidden:r,x:Math.round(s.x),y:Math.round(s.y),width:Math.round(s.width),height:Math.round(s.height)})),on(e,"cmmn:Criterion")&&this._attachCriterion(e,n),this._canvas.addShape(n,t)}else{if(!(o&&on(o,"cmmndi:CMMNEdge")||on(e,"cmmndi:CMMNEdge")))throw new Error("unknown di "+cn(o)+" for element "+cn(e));var l=this._getSource(e),c=this._getTarget(e);r=t&&(t.hidden||t.collapsed)||l&&l.hidden||c&&c.hidden;var u=(e.di||{}).waypoint||e.waypoint;n=this._elementFactory.createConnection(un(e,{hidden:r,source:l,target:c,waypoints:(i=u,rn(i,function(e){return{x:e.x,y:e.y}}))})),this._canvas.addConnection(n,t)}return an(e)&&this.addLabel(e,n),this._eventBus.fire("cmmnElement.added",{element:n}),n},fn.prototype._attachCriterion=function(e,t){var n=e.$parent;if(!n)throw new Error("missing "+cn(e)+"$parent");var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw pn(e,n,"criterion");t.host=r,i||(r.attachers=i=[]),-1===i.indexOf(t)&&i.push(t)},fn.prototype.addLabel=function(e,t){var n=sn(e,t),r=this._elementFactory.createLabel(un(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden,x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)}));return this._canvas.addShape(r,t.parent)},fn.prototype._getSource=function(e){var t=e.cmmnElementRef;if(t){if(on(t,"cmmn:OnPart"))return t.exitCriterionRef?this._getEnd(t,"exitCriterionRef"):this._getEnd(t,"sourceRef");if(on(t,"cmmn:Association"))return this._getEnd(t,"sourceRef")}if(on(e,"cmmndi:CMMNEdge"))return this._getEnd(e,"sourceCMMNElementRef")},fn.prototype._getTarget=function(e){var t=e.cmmnElementRef;return t&&on(t,"cmmn:Association")?this._getEnd(t,"targetRef"):this._getEnd(e,"targetCMMNElementRef")},fn.prototype._getEnd=function(e,t){var n=e[t],r=n&&this._getElement(n);if(r)return r;throw n?pn(e,n,t):new Error(cn(e)+"#"+t+"Ref not specified")},fn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var hn={__depends__:[Yt,{cmmnImporter:["type",dn]}],itemRegistry:["type",ie]},mn={};Object.defineProperty(mn,"__esModule",{value:!0}),mn.remove=function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1);return n},mn.add=function(e,t,n){if(!e||!t)return;"number"!=typeof n&&(n=-1);var r=e.indexOf(t);if(-1!==r){if(r===n)return;if(-1===n)return;e.splice(r,1)}-1!==n?e.splice(n,0,t):e.push(t)};var yn=c.forEach,gn=c.filter,vn=Xt.elementToString,bn=e.is,_n=new O({name:"cmmnElement",enumerable:!0},{name:"di"});var xn=function(e){var t=[],n=[],r={},i=[],o={},a=[],s=[];function l(t,n){return e.element(t,n)}function c(t,n){try{return e.addItem(t),t.di&&l(t,n)}catch(e){p(e.message,{element:t,error:e}),console.error("failed to import "+vn(t)),console.error(e)}}function u(e,t){try{return l(e,t)}catch(t){p(t.message,{element:e,error:t}),console.error("failed to import "+vn(e)),console.error(t)}}function p(t,n){e.error(t,n)}function f(e,t){return function(n){e(n,t)}}function d(e){var t,o=e.cmmnElementRef;if(o&&!bn(e,"cmmndi:CMMNEdge"))if(o.di)p("multiple DI elements defined for "+vn(o),{element:o});else{var l=function(e){for(;e&&!bn(e,"cmmn:Case");)e=e.$parent;return e}(o);l&&-1===i.indexOf(l)&&i.push(l),(bn(o,"cmmn:TextAnnotation")||bn(o,"cmmn:CaseFileItem"))&&a.push(o),_n.bind(o,"di"),o.di=e}else if(bn(e,"cmmndi:CMMNEdge")){var c=!0;if((bn((t=e).cmmnElementRef,"cmmn:Association")?!!t.cmmnElementRef.targetRef:!!t.targetCMMNElementRef)||(c=!1,p("no target referenced in "+vn(e),{element:e})),function(e){return bn(e.cmmnElementRef,"cmmn:OnPart")?!(!e.cmmnElementRef.exitCriterionRef&&!e.cmmnElementRef.sourceRef):bn(e.cmmnElementRef,"cmmn:Association")?!!e.cmmnElementRef.sourceRef:!!e.sourceCMMNElementRef}(e)||(c=!1,p("no source referenced in "+vn(e),{element:e})),c)if(bn(o,"cmmn:Association"))s.push(e);else if(o)n.push(function(t){u(e,t)});else{var f=e.sourceCMMNElementRef;r[f.id]=r[f.id]||[],r[f.id].push(e)}}else p("no cmmnElement referenced in "+vn(e),{element:e})}function h(e){var t;t=e.diagramElements,yn(t,m)}function m(e){d(e)}function y(e,t){!function(e,t){yn(e,f(v,t))}(e.planItems,t),bn(e,"cmmn:Stage")&&function(e,t){g(e.planningTable,t)}(e,t)}function g(e,t){e&&yn(e.tableItems,function(e){bn(e,"cmmn:DiscretionaryItem")?function(e,t){o[e.id]||(function(e){o[e.id]=e}(e),v(e,t))}(e,t):bn(e,"cmmn:PlanningTable")&&g(e,t)})}function v(e,t){var n=c(e,t);yn(e.exitCriteria,f(b,t)),yn(e.entryCriteria,f(b,t));var i=e.definitionRef;if(bn(i,"cmmn:PlanFragment"))y(i,n),_(e,n);else if(bn(i,"cmmn:HumanTask")){g(i.planningTable,t);var o=r[e.id];yn(o,f(E,t)),delete r[e.id]}}function b(e,n){t.unshift(function(){c(e,n)})}function _(e,t){if(e.di&&e.di.bounds){var n=function(e,t){var n=t.di.bounds;return gn(e,function(e){return e.di.bounds.x>n.x&&e.di.bounds.x<n.x+n.width&&e.di.bounds.y>n.y&&e.di.bounds.y<n.y+n.height})}(a,e);yn(n,function(e){mn.remove(a,e),x(e,t)})}}function x(e,t){bn(e,"cmmn:TextAnnotation")?function(e,t){c(e,t)}(e,t):bn(e,"cmmn:CaseFileItem")&&function(e,t){c(e,t)}(e,t)}function w(e,t){u(e,t)}function E(e,n){t.push(function(){u(e,n)})}return{handleDefinitions:function(r,o){var l=r.CMMNDI;if(l){var u=l.diagrams;if(o&&-1===u.indexOf(o))throw new Error("diagram not part of cmmn:Definitions");!o&&u&&u.length&&(o=u[0]),h(o);var p=function(t,n){return e.root(t,n)}(o,o);!function(e,r){yn(e,function(e){!function(e,r){var i,o=e.casePlanModel;o&&(i=function(e,t){var n=c(e,t);return yn(e.exitCriteria,f(b,n)),y(e,n),_(e,n),n}(o,r)),function(e){yn(e,function(e){e()})}(t),yn(n,function(e){e(i)})}(e,r),t=[],n=[]})}(i,p),yn(a,f(x)),yn(s,f(w))}}}},wn={};wn.importCmmnDiagram=function(e,t,n){var r,i=e.get("cmmnImporter"),o=e.get("eventBus"),a=e.get("itemRegistry"),s=[];o.fire("import.render.start",{definitions:t});try{!function(e){new xn({root:function(e){return i.root(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){s.push({message:e,context:t})},addItem:function(e){a.add(e)}}).handleDefinitions(e)}(t)}catch(e){r=e}o.fire("import.render.complete",{error:r,warnings:s}),n(r,s)};var En={},Mn=Qe.domify,Cn=Qe.delegate,An='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';function Pn(e){return e.join(";")}var Sn,Nn=Pn(["color: #404040"]),Rn='<div class="bjs-powered-by-lightbox" style="'+Pn(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+Pn(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+Pn(["position: absolute","left: 50%","top: 40%","transform: translate(-50%)","width: 260px","padding: 10px","background: white","box-shadow: 0 1px 4px rgba(0,0,0,0.3)","font-family: Helvetica, Arial, sans-serif","font-size: 14px","display: flex","line-height: 1.3"])+'"><a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;'+Nn+'">'+An+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';En.open=function(){Sn||(Sn=Mn(Rn),Cn.bind(Sn,".backdrop","click",function(e){document.body.removeChild(Sn)})),document.body.appendChild(Sn)},En.BPMNIO_IMG=An,En.LINK_STYLES=Nn;var kn={};Object.defineProperty(kn,"__esModule",{value:!0}),kn.hasLowerCaseAlias=function(e){return e.xml&&"lowerCase"===e.xml.tagAlias},kn.serializeAsType=function(e){return Tn(e)===On},kn.serializeAsProperty=function(e){return"property"===Tn(e)};kn.DEFAULT_NS_MAP={xsi:"http://www.w3.org/2001/XMLSchema-instance"};var On=kn.XSI_TYPE="xsi:type";function Tn(e){return e.xml&&e.xml.serialize}var jn={};function Dn(){}Object.defineProperty(jn,"__esModule",{value:!0}),jn.default=Dn,Dn.prototype.get=function(e){return this.$model.properties.get(this,e)},Dn.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.default=Fn;var In,Ln=(In=jn)&&In.__esModule?In:{default:In};function Fn(e,t){this.model=e,this.properties=t}Fn.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(Ln.default.prototype);(0,c.forEach)(e.properties,function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(e){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),(0,c.forEach)(e,(0,c.bind)(function(e,t){this.set(t,e)},this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var zn={};Object.defineProperty(zn,"__esModule",{value:!0}),zn.parseName=function(e,t){var n,r,i=e.split(/:/);if(1===i.length)n=e,r=t;else{if(2!==i.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=i[1],r=i[0]}return{name:e=(r?r+":":"")+n,prefix:r,localName:n}};var Vn={};function $n(e){this.model=e}function Un(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.default=$n,$n.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:Un(e,r,n):e.$attrs[t]=n},$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&&Un(e,n,[]),e[r]},$n.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},$n.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},$n.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};var Wn={};function Gn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.default=Gn,Gn.prototype.build=function(){return(0,c.pick)(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Gn.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)},Gn.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(-1===s)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t},Gn.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=(0,zn.parseName)(i[0],r),a=(0,zn.parseName)(i[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Gn.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},Gn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Gn.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},Gn.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},Gn.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")},Gn.prototype.hasProperty=function(e){return this.propertiesByName[e]},Gn.prototype.addTrait=function(e,t){var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||((0,c.forEach)(e.properties,(0,c.bind)(function(n){n=(0,c.assign)({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var r=n.replaces,i=n.redefines;r||i?this.redefineProperty(n,r||i,r):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))},this)),r.push(e),n[i]=e)};var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.coerceType=function(e,t){var n=Kn[e];return n?n(t):t},Hn.isBuiltIn=function(e){return!!qn[e]},Hn.isSimple=function(e){return!!Kn[e]};var qn={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Kn={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.default=Zn;var Xn=function(e){return e&&e.__esModule?e:{default:e}}(Wn);function Zn(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,(0,c.forEach)(e,(0,c.bind)(this.registerPackage,this))}function Jn(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}Zn.prototype.getPackage=function(e){return this.packageMap[e]},Zn.prototype.getPackages=function(){return this.packages},Zn.prototype.registerPackage=function(e){e=(0,c.assign)({},e);var t=this.packageMap;Jn(t,e,"prefix"),Jn(t,e,"uri"),(0,c.forEach)(e.types,(0,c.bind)(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Zn.prototype.registerType=function(e,t){e=(0,c.assign)({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:(0,c.assign)(e.meta||{})});var n=(0,zn.parseName)(e.name,t.prefix),r=n.name,i={};(0,c.forEach)(e.properties,(0,c.bind)(function(e){var t=(0,zn.parseName)(e.name,n.prefix),r=t.name;(0,Hn.isBuiltIn)(e.type)||(e.type=(0,zn.parseName)(e.type,t.prefix).name),(0,c.assign)(e,{ns:t,name:r}),i[r]=e},this)),(0,c.assign)(e,{ns:n,name:r,propertiesByName:i}),(0,c.forEach)(e.extends,(0,c.bind)(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e},Zn.prototype.mapTypes=function(e,t,n){var r=(0,Hn.isBuiltIn)(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(e){return a(e,!0)}function a(n,r){var o=(0,zn.parseName)(n,(0,Hn.isBuiltIn)(n)?"":e.prefix);i.mapTypes(o,t,r)}if(!r)throw new Error("unknown type <"+e.name+">");(0,c.forEach)(r.superClass,n?o:a),t(r,!n),(0,c.forEach)(r.traits,o)},Zn.prototype.getEffectiveDescriptor=function(e){var t=(0,zn.parseName)(e),n=new Xn.default(t);this.mapTypes(t,function(e,t){n.addTrait(e,t)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},Zn.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.default=ir;var er=rr(Bn),tr=rr(Yn),nr=rr(Vn);function rr(e){return e&&e.__esModule?e:{default:e}}function ir(e){this.properties=new nr.default(this),this.factory=new er.default(this,this.properties),this.registry=new tr.default(e,this.properties),this.typeCache={}}ir.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},ir.prototype.getType=function(e){var t=this.typeCache,n=(0,c.isString)(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},ir.prototype.createAny=function(e,t,n){var r=(0,zn.parseName)(e),i={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),(0,c.forEach)(n,function(e,t){(0,c.isObject)(e)&&void 0!==e.value?i[e.name]=e.value:i[t]=e}),i},ir.prototype.getPackage=function(e){return this.registry.getPackage(e)},ir.prototype.getPackages=function(){return this.registry.getPackages()},ir.prototype.getElementDescriptor=function(e){return e.$descriptor},ir.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},ir.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},ir.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var or={};Object.defineProperty(or,"__esModule",{value:!0}),Object.defineProperty(or,"default",{enumerable:!0,get:function(){return(e=Qn,e&&e.__esModule?e:{default:e}).default;var e}});var ar={},sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(ar,"__esModule",{value:!0});var lr=String.fromCharCode,cr=Object.prototype.hasOwnProperty,ur=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,pr={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function fr(e,t,n,r){return r?cr.call(pr,r)?pr[r]:"&"+r+";":lr(t||parseInt(n,16))}function dr(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(ur,fr):e}Object.keys(pr).forEach(function(e){pr[e.toUpperCase()]=pr[e]});var hr="http://www.w3.org/2001/XMLSchema-instance",mr="xsi",yr="xsi:type",gr="non-whitespace outside of root node";function vr(e){return new Error(e)}function br(e){return"missing namespace for prefix <"+e+">"}function _r(e){return{get:e,enumerable:!0}}function xr(e){var t,n={};for(t in e)n[t]=e[t];return n}function wr(e){return e+"$uri"}function Er(){return{line:0,column:0}}function Mr(e){throw e}ar.Parser=function e(t){if(!this)return new e(t);var n,r,i,o,a,s,l,c,u,p=t&&t.proxy,f=Mr,d=Er,h=!1,m=!1,y=null,g=!1;function v(e){e instanceof Error||(e=vr(e)),y=e,f(e,d)}function b(e){a&&(e instanceof Error||(e=vr(e)),a(e,d))}this.on=function(e,t){if("function"!=typeof t)throw vr("required args <name, cb>");switch(e){case"openTag":r=t;break;case"text":n=t;break;case"closeTag":i=t;break;case"error":f=t;break;case"warn":a=t;break;case"cdata":o=t;break;case"attention":c=t;break;case"question":l=t;break;case"comment":s=t;break;default:throw vr("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!==(void 0===e?"undefined":sr(e)))throw vr("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n[hr]=mr,m=!0,u=n,this},this.parse=function(e){if("string"!=typeof e)throw vr("required args <xml=string>");return y=null,function(e){var t,a,f,y,_,x,w,E,M,C,A,P=m?[]:null,S=m?function(e){var t,n,r={};for(t in e)r[n=e[t]]=n,r[wr(n)]=t;return r}(u):null,N=[],R=0,k=!1,O=!1,T=0,j=0,D="",B=0;function I(){if(null!==A)return A;var e,t,n,r,i,o,a,s,l,c,p,f=m&&S.xmlns,d=m&&h?[]:null,y=B,g=D,v=g.length,_={},x={};e:for(;y<v;y++)if(l=!1,!(32===(c=g.charCodeAt(y))||c<14&&c>8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(b("illegal first char attribute name"),l=!0),p=y+1;p<v;p++)if(!((c=g.charCodeAt(p))>96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){b("missing attribute value"),y=p;continue e}if(61===c)break;b("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,p))&&(b("illegal declaration of xmlns"),l=!0),34===(c=g.charCodeAt(p+1)))-1===(p=g.indexOf('"',y=p+2))&&-1!==(p=g.indexOf("'",y))&&(b("attribute value quote missmatch"),l=!0);else if(39===c)-1===(p=g.indexOf("'",y=p+2))&&-1!==(p=g.indexOf('"',y))&&(b("attribute value quote missmatch"),l=!0);else for(b("missing attribute value quotes"),l=!0,p+=1;p<v&&!(32===(c=g.charCodeAt(p+1))||c<14&&c>8);p++);for(-1===p&&(b("missing closing quotes"),p=v,l=!0),l||(o=g.substring(y,p)),y=p;p+1<v&&!(32===(c=g.charCodeAt(p+1))||c<14&&c>8);p++)y===p&&(b("illegal character after attribute end"),l=!0);if(y=p+1,!l)if(s in x)b("attribute <"+s+"> already defined");else if(x[s]=!0,m)if(h){if(null!==(i="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=dr(o),t=wr(i),!(a=u[e])){if("xmlns"===i||t in S&&S[t]!==e)do{a="ns"+R++}while(void 0!==S[a]);else a=i;u[e]=a}S[i]!==a&&(r||(S=xr(S),r=!0),S[i]=a,"xmlns"===i&&(S[wr(a)]=e,f=a),S[t]=e),_[s]=o;continue}d.push(s,o)}else-1!==(c=s.indexOf(":"))?(n=S[s.substring(0,c)])?((s=f===n?s.substr(c+1):n+s.substr(c))===yr&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),n=S[n]||n,o=n+o.substring(c)):o=f+":"+o),_[s]=o):b(br(s.substring(0,c))):_[s]=o;else _[s]=o}if(h)for(y=0,v=d.length;y<v;y++){if(s=d[y++],o=d[y],-1!==(c=s.indexOf(":"))){if(!(n=S[s.substring(0,c)])){b(br(s.substring(0,c)));continue}(s=f===n?s.substr(c+1):n+s.substr(c))===yr&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),n=S[n]||n,o=n+o.substring(c)):o=f+":"+o)}_[s]=o}return A=_}for(d=function(){for(var t,n,r=/(\r\n|\r|\n)/g,i=0,o=0,a=0,s=j;T>=a&&(t=r.exec(e))&&!((s=t[0].length+t.index)>T);)i+=1,a=s;return-1==T?(o=s,n=e.substring(j)):0===j?n=e.substring(j,T):(o=T-a,n=-1==j?e.substring(T):e.substring(T,j+1)),{data:n,line:i,column:o}},p&&(C=Object.create({},{name:_r(function(){return E}),originalName:_r(function(){return M}),attrs:_r(I),ns:_r(function(){return S})}));-1!==j;){if(-1===(T=60===e.charCodeAt(j)?j:e.indexOf("<",j)))return N.length?v("unexpected end of file"):0===j?v("missing start tag"):void(j<e.length&&e.substring(j).trim()&&b(gr));if(j!==T)if(N.length){if(n&&(n(e.substring(j,T),dr,d),g))return}else if(e.substring(j,T).trim()&&(b(gr),g))return;if(33===(_=e.charCodeAt(T+1))){if(91===(y=e.charCodeAt(T+2))&&"CDATA["===e.substr(T+3,6)){if(-1===(j=e.indexOf("]]>",T)))return v("unclosed cdata");if(o&&(o(e.substring(T+9,j),d),g))return;j+=3;continue}if(45===y&&45===e.charCodeAt(T+3)){if(-1===(j=e.indexOf("--\x3e",T)))return v("unclosed comment");if(s&&(s(e.substring(T+4,j),dr,d),g))return;j+=3;continue}}if(63!==_){for(a=T+1;;a++){if(x=e.charCodeAt(a),isNaN(x))return j=-1,v("unclosed tag");if(34===x)y=e.indexOf('"',a+1),a=-1!==y?y:a;else if(39===x)y=e.indexOf("'",a+1),a=-1!==y?y:a;else if(62===x){j=a;break}}if(33!==_){if(A={},47===_){if(k=!1,O=!0,!N.length)return v("missing open tag");if(a=E=N.pop(),y=T+2+a.length,e.substring(T+2,y)!==a)return v("closing tag mismatch");for(;y<j;y++)if(!(32===(_=e.charCodeAt(y))||_>8&&_<14))return v("close tag")}else{if(47===e.charCodeAt(j-1)?(a=E=e.substring(T+1,j-1),k=!0,O=!0):(a=E=e.substring(T+1,j),k=!0,O=!1),!(_>96&&_<123||_>64&&_<91||95===_||58===_))return v("illegal first char nodeName");for(y=1,f=a.length;y<f;y++)if(!((_=a.charCodeAt(y))>96&&_<123||_>64&&_<91||_>47&&_<59||45===_||95===_||46==_)){if(32===_||_<14&&_>8){E=a.substring(0,y),A=null;break}return v("invalid nodeName")}O||N.push(E)}if(m){if(t=S,k&&(O||P.push(t),null===A&&(h=-1!==a.indexOf("xmlns",y))&&(B=y,D=a,I(),h=!1)),M=E,-1!==(_=E.indexOf(":"))){if(!(w=S[E.substring(0,_)]))return v("missing namespace on <"+M+">");E=E.substr(_+1)}else w=S.xmlns;w&&(E=w+":"+E)}if(k&&(B=y,D=a,r&&(p?r(C,dr,O,d):r(E,I,dr,O,d),g)))return;if(O){if(i&&(i(p?C:E,dr,k,d),g))return;m&&(S=k?t:P.pop())}j+=1}else{if(c&&(c(e.substring(T,j+1),dr,d),g))return;j+=1}}else{if(-1===(j=e.indexOf("?>",T)))return v("unclosed question");if(l&&(l(e.substring(T,j+2),d),g))return;j+=2}}}(e),d=Er,g=!1,y},this.stop=function(){g=!0}};var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.Reader=zr;var Ar=function(e){return e&&e.__esModule?e:{default:e}}(or);function Pr(e,t){return(0,kn.hasLowerCaseAlias)(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Sr(e){return new Error(e)}function Nr(e){return e.$descriptor}function Rr(e){(0,c.assign)(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Sr("expected element");var t,n=this.elementsById,r=Nr(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 Sr("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function kr(){}function Or(){}function Tr(){}function jr(e,t){this.property=e,this.context=t}function Dr(e,t){this.element=t,this.propertyDesc=e}function Br(){}function Ir(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Lr(e,t,n){Ir.call(this,e,t,n)}function Fr(e,t,n){this.model=e,this.context=n}function zr(e){e instanceof Ar.default&&(e={model:e}),(0,c.assign)(this,{lax:!1},e)}kr.prototype.handleEnd=function(){},kr.prototype.handleText=function(){},kr.prototype.handleNode=function(){},Or.prototype=Object.create(kr.prototype),Or.prototype.handleNode=function(){return this},Tr.prototype=Object.create(kr.prototype),Tr.prototype.handleText=function(e){this.body=(this.body||"")+e},jr.prototype=Object.create(Tr.prototype),jr.prototype.handleNode=function(e){if(this.element)throw Sr("expected no sub nodes");return this.element=this.createReference(e),this},jr.prototype.handleEnd=function(){this.element.id=this.body},jr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Dr.prototype=Object.create(Tr.prototype),Dr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=(0,Hn.coerceType)(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Br.prototype=Object.create(Tr.prototype),Br.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},Ir.prototype=Object.create(Br.prototype),Ir.prototype.addReference=function(e){this.context.addReference(e)},Ir.prototype.handleText=function(e){if(!Nr(this.element).bodyProperty)throw Sr("unexpected body text <"+e+">");Tr.prototype.handleText.call(this,e)},Ir.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Nr(t).bodyProperty;n&&void 0!==e&&(e=(0,Hn.coerceType)(n.type,e),t.set(n.name,e))},Ir.prototype.createElement=function(e){var t,n=e.attributes,r=this.type,i=Nr(r),o=this.context,a=new r({}),s=this.model;return(0,c.forEach)(n,function(e,n){var r,l=i.propertiesByName[n];l&&l.isReference?l.isMany?(r=e.split(" "),(0,c.forEach)(r,function(e){o.addReference({element:a,property:l.ns.name,id:e})})):o.addReference({element:a,property:l.ns.name,id:e}):(l?e=(0,Hn.coerceType)(l.type,e):"xmlns"!==n&&(t=(0,zn.parseName)(n,i.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))}),a},Ir.prototype.getPropertyForNode=function(e){var t,n,r=e.name,i=(0,zn.parseName)(r),o=this.type,a=this.model,s=Nr(o),l=i.name,u=s.propertiesByName[l];if(u)return(0,kn.serializeAsType)(u)&&(t=e.attributes[kn.XSI_TYPE])?(t=function(e,t){var n=(0,zn.parseName)(e);return function(e,t){var n=e.name,r=e.localName,i=t.xml&&t.xml.typePrefix;return i&&0===r.indexOf(i)?e.prefix+":"+r.slice(i.length):n}(n,t.getPackage(n.prefix))}(t,a),n=a.getType(t),(0,c.assign)({},u,{effectiveType:Nr(n).name})):u;var p=a.getPackage(i.prefix);if(p){if(t=Pr(i,p),n=a.getType(t),u=(0,c.find)(s.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return(0,c.assign)({},u,{effectiveType:Nr(n).name})}else if(u=(0,c.find)(s.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return u;throw Sr("unrecognized element <"+i.name+">")},Ir.prototype.toString=function(){return"ElementDescriptor["+Nr(this.type).name+"]"},Ir.prototype.valueHandler=function(e,t){return new Dr(e,t)},Ir.prototype.referenceHandler=function(e){return new jr(e,this.context)},Ir.prototype.handler=function(e){return"Element"===e?new Fr(this.model,e,this.context):new Ir(this.model,e,this.context)},Ir.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,(0,Hn.isSimple)(n))return this.valueHandler(t,r);var o=(i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?((0,c.assign)(o,{element:r}),this.context.addReference(o)):o.$parent=r),i},Lr.prototype=Object.create(Ir.prototype),Lr.prototype.createElement=function(e){var t=e.name,n=(0,zn.parseName)(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&Pr(n,o)||t;if(!i.hasType(a))throw Sr("unexpected element <"+e.originalName+">");return Ir.prototype.createElement.call(this,e)},Fr.prototype=Object.create(Br.prototype),Fr.prototype.createElement=function(e){var t=e.name,n=(0,zn.parseName)(t).prefix,r=e.ns[n+"$uri"],i=e.attributes;return this.model.createAny(t,r,i)},Fr.prototype.handleChild=function(e){var t=new Fr(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},Fr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},zr.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Ir?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var i=this.model,o=this.lax,a=new Rr((0,c.assign)({},t,{rootHandler:r})),s=new ar.Parser({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function u(e,t,n){var r=t(),i=r.line,o=r.column,s=r.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+i+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw Sr(l)}function p(e,t){return u(e,t,!0)}r.context=a,l.push(r);var f=/^<\?xml /i,d=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function m(e,t){try{l.peek().handleText(e)}catch(e){p(e,t)}}var y=i.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});s.ns(y).on("openTag",function(e,t,n,r){var i=e.attrs||{},a=Object.keys(i).reduce(function(e,n){var r=t(i[n]);return e[n]=r,e},{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){u(e,t,o)&&l.push(new Or)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},r)}).on("question",function(e){if(f.test(e)){var t=d.exec(e),n=t&&t[1];n&&!h.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",m).on("text",function(e,t,n){!function(e,t){(e=e.trim())&&m(e,t)}(t(e),n)}).on("error",u).on("warn",p),setTimeout(function(){var t;try{s.parse(e),function(){var e,t,n=a.elementsById,r=a.references;for(e=0;t=r[e];e++){var i=t.element,o=n[t.id],s=Nr(i).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=i.get(s.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else i.set(s.name,o)}}()}catch(e){t=e}var i=r.element;t||i||(t=Sr("failed to parse document as <"+r.type.$descriptor.name+">")),n(t,t?void 0:i,a)},0)},zr.prototype.handler=function(e){return new Lr(this.model,e)};var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.Writer=function(e){return e=(0,c.assign)({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var r=n||new function(){this.value="",this.write=function(e){this.value+=e}},i=new function(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}(r,e.format);if(e.preamble&&i.append($r),(new ti).build(t).serializeTo(i),!n)return r.value}}};var $r='<?xml version="1.0" encoding="UTF-8"?>\n',Ur=/<|>|'|"|&|\n\r|\n/g,Wr=/<|>|&/g;function Gr(e){var t={},n={},r={},i=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?i.push(e):o.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.logUsed=function(e){var t=e.uri;r[t]=this.byUri(t)},this.getUsed=function(e){return[].concat(i,o).filter(function(e){return r[e.uri]})}}function Hr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function qr(e){return(0,c.isString)(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Kr(e,t){return t.isGeneric?(0,c.assign)({localName:t.ns.localName},e):(0,c.assign)({localName:(n=t.ns.localName,r=t.$pkg,(0,kn.hasLowerCaseAlias)(r)?(i=n).charAt(0).toLowerCase()+i.slice(1):n)},e);var n,r,i}var Yr={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Xr={"<":"lt",">":"gt","&":"amp"};function Zr(e,t,n){return(e=(0,c.isString)(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function Jr(e){this.tagName=e}function Qr(){}function ei(e){this.tagName=e}function ti(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function ni(e,t){ti.call(this,e,t)}Jr.prototype.build=function(e){return this.element=e,this},Jr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Qr.prototype.serializeValue=Qr.prototype.serializeTo=function(e){e.append(this.escape?Zr(this.value,Wr,Xr):this.value)},Qr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Wr)&&(this.escape=!0),this},Hr(ei,Qr),ei.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},ti.prototype.build=function(e){this.element=e;var t,n,r,i=e.$descriptor,o=this.propertyDescriptor,a=i.isGeneric;return t=a?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=o?this.nsPropertyTagName(o):this.nsTagName(i),this.tagName=this.addTagName(this.ns),a||(n=function(e){var t=e.$descriptor;return(0,c.filter)(t.properties,function(t){var n=t.name;if(t.isVirtual)return!1;if(!e.hasOwnProperty(n))return!1;var r=e[n];return r!==t.default&&null!==r&&(!t.isMany||r.length)})}(e),this.parseAttributes((r=n,(0,c.filter)(r,function(e){return e.isAttr}))),this.parseContainments(function(e){return(0,c.filter)(e,function(e){return!e.isAttr})}(n))),this.parseGenericAttributes(e,t),this},ti.prototype.nsTagName=function(e){return Kr(this.logNamespaceUsed(e.ns),e)},ti.prototype.nsPropertyTagName=function(e){return function(e,t){return(0,c.assign)({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},ti.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},ti.prototype.nsAttributeName=function(e){var t;if(t=(0,c.isString)(e)?(0,zn.parseName)(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:(0,c.assign)({localName:t.localName},n)},ti.prototype.parseGeneric=function(e){var t=this,n=this.body,r=[];return(0,c.forEach)(e,function(i,o){"$body"===o?n.push((new Qr).build({type:"String"},i)):"$children"===o?(0,c.forEach)(i,function(e){n.push(new ti(t).build(e))}):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,i)&&r.push({name:o,value:i})}),r},ti.prototype.parseNsAttribute=function(e,t,n){var r,i=e.$model,o=(0,zn.parseName)(t);if("xmlns"===o.prefix&&(r={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(r={uri:n}),!r)return{name:t,value:n};if(i&&i.getPackage(n))this.logNamespace(r,!0,!0);else{var a=this.logNamespaceUsed(r,!0);this.getNamespaces().logUsed(a)}},ti.prototype.parseNsAttributes=function(e,t){var n=this,r=e.$attrs,i=[];return(0,c.forEach)(r,function(t,r){var o=n.parseNsAttribute(e,r,t);o&&i.push(o)}),i},ti.prototype.parseGenericAttributes=function(e,t){var n=this;(0,c.forEach)(t,function(t){if(t.name!==kn.XSI_TYPE)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}})},ti.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;(0,c.forEach)(e,function(e){var i=r.get(e.name),o=e.isReference;if(e.isMany||(i=[i]),e.isBody)n.push((new Qr).build(e,i[0]));else if((0,Hn.isSimple)(e.type))(0,c.forEach)(i,function(r){n.push(new ei(t.addTagName(t.nsPropertyTagName(e))).build(e,r))});else if(o)(0,c.forEach)(i,function(r){n.push(new Jr(t.addTagName(t.nsPropertyTagName(e))).build(r))});else{var a=(0,kn.serializeAsType)(e),s=(0,kn.serializeAsProperty)(e);(0,c.forEach)(i,function(r){var i;i=a?new ni(t,e):s?new ti(t,e):new ti(t),n.push(i.build(r))})}})},ti.prototype.getNamespaces=function(e){var t,n=this.namespaces,r=this.parent;return n||(t=r&&r.getNamespaces(),e||!t?this.namespaces=n=new Gr(t):n=t),n},ti.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix;return r.byUri(i)||r.add(e,t),r.mapPrefix(o,i),e},ti.prototype.logNamespaceUsed=function(e,t){var n,r,i,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(i=kn.DEFAULT_NS_MAP[s]||o&&(o.getPackage(s)||{}).uri,!(l=l||i||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(l))){for(n=s,r=1;a.uriByPrefix(n);)n=s+"_"+r++;e=this.logNamespace({prefix:n,uri:l},i===l)}return s&&a.mapPrefix(s,l),e},ti.prototype.parseAttributes=function(e){var t=this,n=this.element;(0,c.forEach)(e,function(e){var r=n.get(e.name);if(e.isReference)if(e.isMany){var i=[];(0,c.forEach)(r,function(e){i.push(e.id)}),r=i.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(e),r)})},ti.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),qr(e)},ti.prototype.addAttribute=function(e,t){var n=this.attrs;(0,c.isString)(t)&&(t=Zr(t,Ur,Yr)),n.push({name:e,value:t})},ti.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return(0,c.map)(e.getUsed(),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})}(n).concat(t)),(0,c.forEach)(t,function(t){e.append(" ").append(qr(t.name)).append('="').append(t.value).append('"')})},ti.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Qr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),(0,c.forEach)(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Hr(ni,ti),ni.prototype.parseNsAttributes=function(e){var t=ti.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(kn.XSI_TYPE),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t},ni.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};var ri={};Object.defineProperty(ri,"__esModule",{value:!0}),Object.defineProperty(ri,"Reader",{enumerable:!0,get:function(){return Cr.Reader}}),Object.defineProperty(ri,"Writer",{enumerable:!0,get:function(){return Vr.Writer}});var ii={};Object.defineProperty(ii,"__esModule",{value:!0}),ii.default=ai;var oi=function(e){return e&&e.__esModule?e:{default:e}}(or);function ai(e,t){oi.default.call(this,e,t)}ai.prototype=Object.create(oi.default.prototype),ai.prototype.fromXML=function(e,t,n,r){(0,c.isString)(t)||(r=n,n=t,t="cmmn:Definitions"),(0,c.isFunction)(n)&&(r=n,n={});var i=new ri.Reader((0,c.assign)({model:this,lax:!0},n)),o=i.handler(t);i.fromXML(e,o,r)},ai.prototype.toXML=function(e,t,n){(0,c.isFunction)(t)&&(n=t,t={});var r,i,o=new ri.Writer(t);try{r=o.toXML(e)}catch(e){i=e}return n(i,r)};var si={};Object.defineProperty(si,"__esModule",{value:!0}),si.default=function(e,t){var n=(0,c.assign)({},hi,e);return new li.default(n,t)};var li=di(ii),ci=di({name:"CMMN",uri:"http://www.omg.org/spec/CMMN/20151109/MODEL",types:[{name:"ApplicabilityRule",superClass:["CMMNElement"],properties:[{name:"condition",type:"Expression",xml:{serialize:"property"}},{name:"contextRef",type:"CaseFileItem",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["CMMNElement"]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"CMMNElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"CMMNElement",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"ManualActivationRule",superClass:["CMMNElement"],properties:[{name:"condition",type:"Expression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"contextRef",type:"CaseFileItem",isAttr:!0,isReference:!0}]},{name:"Case",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"caseFileModel",type:"CaseFile",xml:{serialize:"property"}},{name:"casePlanModel",type:"Stage",xml:{serialize:"property"}},{name:"caseRoles",type:"CaseRoles"},{name:"input",type:"CaseParameter",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"CaseParameter",isMany:!0,xml:{serialize:"property"}}]},{name:"CaseFile",superClass:["CMMNElement"],properties:[{name:"caseFileItems",type:"CaseFileItem",isMany:!0}]},{name:"CaseFileItem",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"multiplicity",type:"String",isAttr:!0,default:"Unspecified"},{name:"definitionRef",type:"CaseFileItemDefinition",isAttr:!0,isReference:!0},{name:"sourceRef",type:"CaseFileItem",isAttr:!0,isReference:!0},{name:"targetRefs",type:"CaseFileItem",isAttr:!0,isReference:!0,isMany:!0},{name:"children",type:"Children",xml:{serialize:"property"}}]},{name:"CaseFileItemDefinition",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"definitionType",type:"String",default:"http://www.omg.org/spec/CMMN/DefinitionType/Unspecified",isAttr:!0},{name:"properties",type:"Property",isMany:!0},{name:"structureRef",type:"String",isAttr:!0},{name:"importRef",type:"Import",isAttr:!0,isReference:!0}]},{name:"CaseFileItemOnPart",superClass:["OnPart"],properties:[{name:"standardEvent",type:"String"},{name:"sourceRef",type:"CaseFileItem",isAttr:!0,isReference:!0}]},{name:"CaseParameter",superClass:["Parameter"],properties:[{name:"bindingRef",type:"CaseFileItem",isAttr:!0,isReference:!0},{name:"bindingRefinement",type:"Expression",xml:{serialize:"property"}}]},{name:"CaseRoles",superClass:["Parameter"],properties:[{name:"role",type:"Role",isMany:!0}]},{name:"CaseTask",superClass:["Task"],properties:[{name:"parameterMapping",type:"ParameterMapping",isMany:!0},{name:"caseRefExpression",type:"Expression",xml:{serialize:"property"}},{name:"caseRef",type:"String",isAttr:!0}]},{name:"Children",superClass:["CMMNElement"],properties:[{name:"caseFileItems",type:"CaseFileItem",isMany:!0}]},{name:"CMMNElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionElements",type:"ExtensionElements"},{name:"extensionDefinitions",type:"ExtensionDefinition",isReference:!0,isMany:!0}]},{name:"Definitions",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",type:"String",isAttr:!0},{name:"expressionLanguage",type:"String",isAttr:!0,default:"http://www.w3.org/1999/XPath"},{name:"exporter",isAttr:!0,type:"String"},{name:"exporterVersion",isAttr:!0,type:"String"},{name:"author",isAttr:!0,type:"String"},{name:"creationDate",type:"DateTime",isAttr:!0},{name:"imports",type:"Import",isMany:!0},{name:"caseFileItemDefinitions",type:"CaseFileItemDefinition",isMany:!0},{name:"cases",type:"Case",isMany:!0},{name:"processes",type:"Process",isMany:!0},{name:"decisions",type:"Decision",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"relationships",type:"Relationship",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"CMMNDI",type:"cmmndi:CMMNDI"}]},{name:"DiscretionaryItem",superClass:["TableItem"],properties:[{name:"itemControl",type:"PlanItemControl",xml:{serialize:"property"}},{name:"definitionRef",type:"PlanItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"entryCriteria",type:"EntryCriterion",isMany:!0},{name:"exitCriteria",type:"ExitCriterion",isMany:!0}]},{name:"EventListener",superClass:["PlanItemDefinition"]},{name:"Expression",superClass:["CMMNElement"],properties:[{name:"language",type:"String",isAttr:!0},{name:"body",isBody:!0,type:"String"}]},{name:"HumanTask",superClass:["Task"],properties:[{name:"planningTable",type:"PlanningTable"},{name:"performerRef",type:"Role",isAttr:!0,isReference:!0}]},{name:"IfPart",superClass:["CMMNElement"],properties:[{name:"contextRef",type:"CaseFileItem",isAttr:!0,isReference:!0},{name:"condition",type:"Expression",xml:{serialize:"property"}}]},{name:"Import",properties:[{name:"location",isAttr:!0,type:"String"},{name:"namespace",type:"String",isAttr:!0},{name:"importType",isAttr:!0,type:"String"}]},{name:"Milestone",superClass:["PlanItemDefinition"]},{name:"On",isAbstract:!0,superClass:["CMMNElement"]},{name:"OnPart",isAbstract:!0,superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"Parameter",isAbstract:!0,superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ParameterMapping",properties:[{name:"sourceRef",type:"Parameter",isAttr:!0,isReference:!0},{name:"targetRef",type:"Parameter",isAttr:!0,isReference:!0},{name:"transformation",type:"Expression",xml:{serialize:"property"}}]},{name:"PlanFragment",superClass:["PlanItemDefinition"],properties:[{name:"planItems",type:"PlanItem",isMany:!0},{name:"sentries",type:"Sentry",isMany:!0}]},{name:"PlanItem",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"definitionRef",type:"PlanItemDefinition",isAttr:!0,isReference:!0},{name:"itemControl",type:"PlanItemControl",xml:{serialize:"property"}},{name:"entryCriteria",type:"EntryCriterion",isMany:!0},{name:"exitCriteria",type:"ExitCriterion",isMany:!0}]},{name:"PlanItemControl",superClass:["CMMNElement"],properties:[{name:"repetitionRule",type:"RepetitionRule"},{name:"requiredRule",type:"RequiredRule"},{name:"manualActivationRule",type:"ManualActivationRule"}]},{name:"PlanItemDefinition",isAbstract:!0,superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"defaultControl",type:"PlanItemControl",xml:{serialize:"property"}}]},{name:"PlanItemOnPart",superClass:["OnPart"],properties:[{name:"standardEvent",type:"String"},{name:"sourceRef",type:"PlanItem",isAttr:!0,isReference:!0},{name:"exitCriterionRef",type:"ExitCriterion",isAttr:!0,isReference:!0}]},{name:"PlanningTable",superClass:["TableItem"],properties:[{name:"tableItems",type:"TableItem",isMany:!0},{name:"applicabilityRules",type:"ApplicabilityRule",isMany:!0}]},{name:"Process",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"implementationType",type:"String",isAttr:!0,default:"http://www.omg.org/spec/CMMN/ProcessType/Unspecified"},{name:"externalRef",type:"String",isAttr:!0},{name:"input",type:"ProcessParameter",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"ProcessParameter",isMany:!0,xml:{serialize:"property"}}]},{name:"ProcessParameter",superClass:["Parameter"]},{name:"ProcessTask",superClass:["Task"],properties:[{name:"parameterMapping",type:"ParameterMapping",isMany:!0},{name:"processRefExpression",type:"Expression",xml:{serialize:"property"}},{name:"processRef",type:"String",isAttr:!0}]},{name:"Property",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",type:"String",isAttr:!0,default:"http://www.omg.org/spec/CMMN/PropertyType/Unspecified"}]},{name:"RepetitionRule",superClass:["CMMNElement"],properties:[{name:"condition",type:"Expression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"contextRef",type:"CaseFileItem",isAttr:!0,isReference:!0}]},{name:"RequiredRule",superClass:["CMMNElement"],properties:[{name:"condition",type:"Expression",xml:{serialize:"property"}},{name:"name",isAttr:!0,type:"String"},{name:"contextRef",type:"CaseFileItem",isAttr:!0,isReference:!0}]},{name:"Role",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"Sentry",superClass:["CMMNElement"],properties:[{name:"onParts",type:"OnPart",isMany:!0},{name:"ifPart",type:"IfPart"},{name:"name",isAttr:!0,type:"String"}]},{name:"Stage",superClass:["PlanFragment"],properties:[{name:"planningTable",type:"PlanningTable"},{name:"planItemDefinitions",type:"PlanItemDefinition",isMany:!0},{name:"autoComplete",isAttr:!0,type:"Boolean"},{name:"exitCriteria",type:"ExitCriterion",isMany:!0}]},{name:"TableItem",isAbstract:!0,superClass:["CMMNElement"],properties:[{name:"authorizedRoleRefs",type:"Role",isAttr:!0,isReference:!0,isMany:!0},{name:"applicabilityRuleRefs",type:"ApplicabilityRule",isAttr:!0,isReference:!0,isMany:!0}]},{name:"Task",superClass:["PlanItemDefinition"],properties:[{name:"input",type:"CaseParameter",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"CaseParameter",isMany:!0,xml:{serialize:"property"}},{name:"isBlocking",isAttr:!0,default:!0,type:"Boolean"}]},{name:"TimerEventListener",superClass:["EventListener"],properties:[{name:"timerExpression",type:"Expression",xml:{serialize:"property"}},{name:"timerStart",type:"StartTrigger"}]},{name:"UserEventListener",superClass:["EventListener"],properties:[{name:"authorizedRoleRefs",type:"Role",isMany:!0,isAttr:!0}]},{name:"DateTime",superClass:[]},{name:"StartTrigger",isAbstract:!0,superClass:["CMMNElement"]},{name:"PlanItemStartTrigger",superClass:["StartTrigger"],properties:[{name:"standardEvent",type:"String",isAttr:!0},{name:"sourceRef",type:"PlanItem",isAttr:!0,isReference:!0}]},{name:"CaseFileItemStartTrigger",superClass:["StartTrigger"],properties:[{name:"standardEvent",type:"String",isAttr:!0},{name:"sourceRef",type:"CaseFileItem",isAttr:!0,isReference:!0}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition"}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",isAttr:!0,default:!1,type:"Boolean"}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Relationship",properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,type:"Element"},{name:"target",isMany:!0,type:"Element"}]},{name:"Documentation",superClass:["CMMNElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"DecisionTask",superClass:["Task"],properties:[{name:"mappings",type:"ParameterMapping",isMany:!0},{name:"decisionRef",type:"String",isAttr:!0},{name:"decisionRefExpression",type:"Expression",xml:{serialize:"property"}}]},{name:"Decision",superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"implementationType",type:"String",isAttr:!0,default:"http://www.omg.org/spec/CMMN/DecisionType/Unspecified"},{name:"input",type:"DecisionParameter",isMany:!0,xml:{serialize:"property"}},{name:"output",type:"DecisionParameter",isMany:!0,xml:{serialize:"property"}},{name:"externalRef",type:"String",isAttr:!0}]},{name:"DecisionParameter",superClass:["Parameter"]},{name:"Criterion",isAbstract:!0,superClass:["CMMNElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sentryRef",type:"Sentry",isAttr:!0,isReference:!0}]},{name:"EntryCriterion",superClass:["Criterion"]},{name:"ExitCriterion",superClass:["Criterion"]}],emumerations:[{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"CaseFileItemTransition",literalValues:[{name:"addChild"},{name:"addReference"},{name:"create"},{name:"delete"},{name:"removeChild"},{name:"removeReference"},{name:"replace"},{name:"update"}]},{name:"MultiplicityEnum",literalValues:[{name:"ZeroOrOne"},{name:"ZeroOrMore"},{name:"ExactlyOne"},{name:"OneOrMore"},{name:"Unspecified"},{name:"Unknown"}]},{name:"PlanItemTransition",literalValues:[{name:"close"},{name:"complete"},{name:"create"},{name:"disable"},{name:"enable"},{name:"exit"},{name:"fault"},{name:"manualStart"},{name:"occur"},{name:"parentResume"},{name:"parentSuspend"},{name:"reactivate"},{name:"reenable"},{name:"resume"},{name:"start"},{name:"suspend"},{name:"terminate"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]}],associations:[],xml:{tagAlias:"lowerCase",typePrefix:"t"},prefix:"cmmn"}),ui=di({name:"CMMNDI",uri:"http://www.omg.org/spec/CMMN/20151109/CMMNDI",types:[{name:"CMMNDI",properties:[{name:"diagrams",type:"CMMNDiagram",isMany:!0},{name:"styles",type:"CMMNStyle",isMany:!0}]},{name:"CMMNDiagram",properties:[{name:"cmmnElementRef",isAttr:!0,type:"cmmn:CMMNElement",isReference:!0},{name:"Size",type:"dc:Dimension",xml:{serialize:"xsi:type"}},{name:"diagramElements",type:"CMMNDiagramElement",isMany:!0}],superClass:["di:Diagram"]},{name:"CMMNDiagramElement",superClass:["di:DiagramElement"]},{name:"CMMNShape",properties:[{name:"cmmnElementRef",isAttr:!0,isReference:!0,type:"cmmn:CMMNElement"},{name:"label",type:"CMMNLabel"},{name:"isCollapsed",isAttr:!0,type:"Boolean"},{name:"isPlanningTableCollapsed",isAttr:!0,type:"Boolean"}],superClass:["CMMNDiagramElement","di:Shape"]},{name:"CMMNEdge",properties:[{name:"label",type:"CMMNLabel"},{name:"cmmnElementRef",isAttr:!0,isReference:!0,type:"cmmn:CMMNElement"},{name:"sourceCMMNElementRef",isAttr:!0,isReference:!0,type:"cmmn:CMMNElement"},{name:"targetCMMNElementRef",isAttr:!0,isReference:!0,type:"cmmn:CMMNElement"},{name:"isStandardEventVisible",type:"Boolean",isAttr:!0}],superClass:["CMMNDiagramElement","di:Edge"]},{name:"CMMNLabel",superClass:["di:Shape"]},{name:"CMMNStyle",properties:[{name:"FillColor",type:"dc:Color",xml:{serialize:"xsi:type"}},{name:"StrokeColor",type:"dc:Color",xml:{serialize:"xsi:type"}},{name:"FontColor",type:"dc:Color",xml:{serialize:"xsi:type"}},{name:"fontFamily",type:"String",isAttr:!0},{name:"fontSize",type:"Real",isAttr:!0},{name:"fontItalic",type:"Boolean",isAttr:!0},{name:"fontBold",type:"Boolean",isAttr:!0},{name:"fontUnderline",type:"Boolean",isAttr:!0},{name:"fontStrikeThrough",type:"Boolean",isAttr:!0}],superClass:["di:Style"]}],associations:[],prefix:"cmmndi"}),pi=di({name:"DC",uri:"http://www.omg.org/spec/CMMN/20151109/DC",types:[{name:"rgb"},{name:"Real"},{name:"Color",properties:[{name:"red",type:"rgb",isAttr:!0},{name:"green",type:"rgb",isAttr:!0},{name:"blue",type:"rgb",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",isAttr:!0},{name:"y",type:"Real",isAttr:!0}]},{name:"Dimension",properties:[{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",isAttr:!0},{name:"y",type:"Real",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],prefix:"dc",associations:[]}),fi=di({name:"DI",uri:"http://www.omg.org/spec/CMMN/20151109/DI",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"style",type:"Style"},{name:"sharedStyle",type:"Style",isReference:!0,isAttr:!0},{name:"id",type:"String",isAttr:!0,isId:!0}]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"waypoint",isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"name",type:"String",isAttr:!0},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,default:300,type:"double"}]},{name:"Shape",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"id",type:"String",isAttr:!0,isId:!0}]},{name:"Extension",properties:[{name:"values",type:"Element",isMany:!0}]}],associations:[],prefix:"di",xml:{tagAlias:"lowerCase"}});function di(e){return e&&e.__esModule?e:{default:e}}var hi={cmmn:ci.default,cmmndi:ui.default,dc:pi.default,di:fi.default},mi={};Object.defineProperty(mi,"__esModule",{value:!0}),Object.defineProperty(mi,"default",{enumerable:!0,get:function(){return(e=si,e&&e.__esModule?e:{default:e}).default;var e}});var yi={};function gi(e,t){var n,r,i,o;return t=!!t,(0,c.isArray)(e)||(e=[e]),(0,c.forEach)(e,function(e){var a=e;e.waypoints&&!t&&(a=gi(e.waypoints,!0));var s=a.x,l=a.y,c=a.height||0,u=a.width||0;(s<n||void 0===n)&&(n=s),(l<r||void 0===r)&&(r=l),(s+u>i||void 0===i)&&(i=s+u),(l+c>o||void 0===o)&&(o=l+c)}),{x:n,y:r,height:o-r,width:i-n}}Object.defineProperty(yi,"__esModule",{value:!0}),yi.getBBox=gi,yi.getType=function(e){if("waypoints"in e)return"connection";if("x"in e)return"shape";return"root"},yi.isFrameElement=function(e){return!(!e||!e.isFrame)};var vi={};Object.defineProperty(vi,"__esModule",{value:!0});var bi="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 _i(e,t){return Math.round(e*t)/t}function xi(e){return(0,c.isNumber)(e)?e+"px":e}function wi(e,t,n){var r=(0,he.create)("g");(0,he.classes)(r).add(t);var i=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}vi.default=Mi;var Ei={shape:["x","y","width","height"],connection:["waypoints"]};function Mi(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._init(e||{})}function Ci(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Mi.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Mi.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=(0,c.assign)({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),(0,c.assign)(n.style,{position:"relative",overflow:"hidden",width:xi(e.width),height:xi(e.height)}),t.appendChild(n),n}(e),r=this._svg=(0,he.create)("svg");(0,he.attr)(r,{width:"100%",height:"100%"}),(0,he.append)(n,r);var i=this._viewport=wi(r,"viewport");this._layers={},!1!==e.deferUpdate&&(this._viewboxChanged=(0,c.debounce)((0,c.bind)(this._viewboxChanged,this),300)),t.on("diagram.init",function(){t.fire("canvas.init",{svg:r,viewport:i})},this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed"],function(){delete this._cachedViewbox},this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Mi.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},Mi.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=(0,yi.getType)(t);"root"===n?e.setRootElement(null,!0):e._removeElement(t,n)}),delete this._cachedViewbox},Mi.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Mi.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},Mi.prototype._createLayer=function(e,t){t||(t=0);var n=(0,c.reduce)(this._layers,function(e,n){return t>=n.index&&e++,e},0);return{group:wi(this._viewport,"layer-"+e,n),index:t}},Mi.prototype.getContainer=function(){return this._container},Mi.prototype._updateMarker=function(e,t,n){var r;e.id||(e=this._elementRegistry.get(e)),(r=this._elementRegistry._elements[e.id])&&((0,c.forEach)([r.gfx,r.secondaryGfx],function(e){e&&(n?(0,he.classes)(e).add(t):(0,he.classes)(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},Mi.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Mi.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Mi.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));var n=this.getGraphics(e);return(0,he.classes)(n).has(t)},Mi.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Mi.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},Mi.prototype.setRootElement=function(e,t){e&&this._ensureValid("root",e);var n=this._rootElement,r=this._elementRegistry,i=this._eventBus;if(n){if(!t)throw new Error("rootElement already set, need to specify override");i.fire("root.remove",{element:n}),i.fire("root.removed",{element:n}),r.remove(n)}if(e){var o=this.getDefaultLayer();i.fire("root.add",{element:e}),r.add(e,o,this._svg),i.fire("root.added",{element:e,gfx:o})}return this._rootElement=e,e},Mi.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=Ei[e];if(!(0,c.every)(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},Mi.prototype._setParent=function(e,t,n){(0,mn.add)(t.children,e,n),e.parent=t},Mi.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();var i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);var a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t},Mi.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Mi.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Mi.prototype._removeElement=function(e,t){var n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e))return i.fire(t+".remove",{element:e}),r.remove(e),(0,mn.remove)(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e},Mi.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Mi.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Mi.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Mi.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Mi.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Mi.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,r,i,o,a,s=this._viewport,l=this.getSize();return e?(this._changeViewbox(function(){i=Math.min(l.width/e.width,l.height/e.height);var t=this._svg.createSVGMatrix().scale(i).translate(-e.x,-e.y);(0,he.transform)(s,t)}),e):(t=this.getDefaultLayer().getBBox(),n=(r=(0,he.transform)(s))?r.matrix:(0,he.createMatrix)(),i=_i(n.a,1e3),o=_i(-n.e||0,1e3),a=_i(-n.f||0,1e3),e=this._cachedViewbox={x:o?o/i:0,y:a?a/i:0,width:l.width/i,height:l.height/i,scale:i,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:l})},Mi.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=(0,c.assign)({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Ci(t,n)}),{x:n.e,y:n.f}},Mi.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox(function(){"object"!==(void 0===t?"undefined":bi(t))&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),_i(r.a,1e3)):this.viewbox(e).scale;var n,r},Mi.prototype._fitViewport=function(e){var t,n,r=this.viewbox(),i=r.outer,o=r.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=i.width&&o.y+o.height<=i.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,i.width),height:Math.max(o.height+o.y,i.height)}:(t=Math.min(1,i.width/o.width,i.height/o.height),n={x:o.x+(e?o.width/2-i.width/t/2:0),y:o.y+(e?o.height/2-i.height/t/2:0),width:i.width/t,height:i.height/t}),this.viewbox(n),this.viewbox(!1).scale},Mi.prototype._setZoom=function(e,t){var n,r,i,o,a=this._svg,s=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),p=(r=s.getCTM()).a;return t?(n=(0,c.assign)(u,t).matrixTransform(r.inverse()),i=l.translate(n.x,n.y).scale(1/p*e).translate(-n.x,-n.y),o=r.multiply(i)):o=l.scale(e),Ci(this._viewport,o),o},Mi.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Mi.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}},Mi.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Ai={};function Pi(){this._uid=12}Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=Pi,Pi.prototype.createRoot=function(e){return this.create("root",e)},Pi.prototype.createLabel=function(e){return this.create("label",e)},Pi.prototype.createShape=function(e){return this.create("shape",e)},Pi.prototype.createConnection=function(e){return this.create("connection",e)},Pi.prototype.create=function(e,t){return(t=(0,c.assign)({},t||{})).id||(t.id=e+"_"+this._uid++),(0,T.create)(e,t)};var Si={};Object.defineProperty(Si,"__esModule",{value:!0}),Si.default=Ri;var Ni="data-element-id";function Ri(e){this._elements={},this._eventBus=e}Ri.$inject=["eventBus"],Ri.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),(0,he.attr)(t,Ni,r),n&&(0,he.attr)(n,Ni,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},Ri.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&((0,he.attr)(r.gfx,Ni,""),r.secondaryGfx&&(0,he.attr)(r.secondaryGfx,Ni,""),delete t[n])},Ri.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)},Ri.prototype.get=function(e){var t;t="string"==typeof e?e:e&&(0,he.attr)(e,Ni);var n=this._elements[t];return n&&n.element},Ri.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t},Ri.prototype.getAll=function(){return this.filter(function(e){return e})},Ri.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)})},Ri.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},Ri.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 ki={};Object.defineProperty(ki,"__esModule",{value:!0});var Oi="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};ki.default=ji;var Ti=Array.prototype.slice;function ji(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Di(){}ji.prototype.on=function(e,t,n,r){if(e=(0,c.isArray)(e)?e:[e],(0,c.isFunction)(t)&&(r=n,n=t,t=1e3),!(0,c.isNumber)(t))throw new Error("priority must be a number");var i=n;r&&((i=(0,c.bind)(n,r)).__fn=n.__fn||n);var o=this;e.forEach(function(e){o._addListener(e,{priority:t,callback:i,next:null})})},ji.prototype.once=function(e,t,n,r){var i=this;if((0,c.isFunction)(t)&&(r=n,n=t,t=1e3),!(0,c.isNumber)(t))throw new Error("priority must be a number");function o(){var t=n.apply(r,arguments);return i.off(e,o),t}o.__fn=n,this.on(e,t,o)},ji.prototype.off=function(e,t){e=(0,c.isArray)(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},ji.prototype.createEvent=function(e){var t=new Di;return t.init(e),t},ji.prototype.fire=function(e,t){var n,r,i,o;if(o=Ti.call(arguments),"object"===(void 0===e?"undefined":Oi(e))&&(e=(n=e).type),!e)throw new Error("no event type specified");if(r=this._listeners[e]){n=t instanceof Di?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return void 0===i&&n.defaultPrevented&&(i=!1),i}},ji.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},ji.prototype._destroy=function(){this._listeners={}},ji.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},ji.prototype._invokeListener=function(e,t,n){var r;try{void 0!==(r=function(e,t){return e.apply(null,t)}(n.callback,t))&&(e.returnValue=r,e.stopPropagation()),!1===r&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener"),console.error(e.stack),e}return r},ji.prototype._addListener=function(e,t){var n,r=this._getListeners(e);if(r){for(;r;){if(r.priority<t.priority)return t.next=r,void(n?n.next=t:this._setListeners(e,t));n=r,r=r.next}n.next=t}else this._setListeners(e,t)},ji.prototype._getListeners=function(e){return this._listeners[e]},ji.prototype._setListeners=function(e,t){this._listeners[e]=t},ji.prototype._removeListener=function(e,t){var n,r,i,o=this._getListeners(e);if(t)for(;o;)n=o.next,(i=o.callback)!==t&&i.__fn!==t||(r?r.next=n:this._setListeners(e,n)),r=o,o=n;else this._setListeners(e,null)},Di.prototype.stopPropagation=function(){this.cancelBubble=!0},Di.prototype.preventDefault=function(){this.defaultPrevented=!0},Di.prototype.init=function(e){(0,c.assign)(this,e||{})};var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.getVisual=function(e){return(0,Qe.query)(".djs-visual",e)},Bi.getChildren=function(e){return e.parentNode.childNodes[1]};var Ii={};function Li(e,t){this._eventBus=e,this._elementRegistry=t}function Fi(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.default=Li,Li.$inject=["eventBus","elementRegistry"],Li.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=(0,Bi.getChildren)(n))||(t=(0,he.create)("g"),(0,he.classes)(t).add("djs-children"),(0,he.append)(n.parentNode,t)):t=n,t},Li.prototype._clear=function(e){var t=(0,Bi.getVisual)(e);return(0,Qe.clear)(t),t},Li.prototype._createContainer=function(e,t,n,r){var i=(0,he.create)("g");(0,he.classes)(i).add("djs-group"),void 0!==n?Fi(i,t,t.childNodes[n]):(0,he.append)(t,i);var o=(0,he.create)("g");(0,he.classes)(o).add("djs-element"),(0,he.classes)(o).add("djs-"+e),r&&(0,he.classes)(o).add("djs-frame"),(0,he.append)(i,o);var a=(0,he.create)("g");return(0,he.classes)(a).add("djs-visual"),(0,he.append)(o,a),o},Li.prototype.create=function(e,t,n){var r=this._getChildren(t.parent);return this._createContainer(e,r,n,(0,yi.isFrameElement)(t))},Li.prototype.updateContainments=function(e){var t,n=this,r=this._elementRegistry;t=(0,c.reduce)(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),(0,c.forEach)(t,function(e){var t=e.children;if(t){var i=n._getChildren(e);(0,c.forEach)(t.slice().reverse(),function(e){Fi(r.getGraphics(e).parentNode,i)})}})},Li.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Li.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Li.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Li.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Li.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this.drawShape(r,t),(0,We.translate)(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(r,t)}t.hidden?(0,he.attr)(n,"display","none"):(0,he.attr)(n,"display","block")}},Li.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);(0,he.remove)(t.parentNode)};var zi={};Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=Gi;var Vi=Ui(l),$i=Ui(pe);function Ui(e){return e&&e.__esModule?e:{default:e}}var Wi=1;function Gi(e,t){$i.default.call(this,e,Wi),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}(0,Vi.default)(Gi,$i.default),Gi.prototype.canRender=function(){return!0},Gi.prototype.drawShape=function(e,t){var n=(0,he.create)("rect");return(0,he.attr)(n,{x:0,y:0,width:t.width||0,height:t.height||0}),(0,yi.isFrameElement)(t)?(0,he.attr)(n,this.FRAME_STYLE):(0,he.attr)(n,this.SHAPE_STYLE),(0,he.append)(e,n),n},Gi.prototype.drawConnection=function(e,t){var n=(0,$e.createLine)(t.waypoints,this.CONNECTION_STYLE);return(0,he.append)(e,n),n},Gi.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width,i=[["M",t,n],["l",r,0],["l",0,e.height],["l",-r,0],["z"]];return(0,$e.componentsToPath)(i)},Gi.prototype.getConnectionPath=function(e){var t,n,r=e.waypoints,i=[];for(t=0;n=r[t];t++)n=n.original||n,i.push([0===t?"M":"L",n.x,n.y]);return(0,$e.componentsToPath)(i)},Gi.$inject=["eventBus","styles"];var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){var r=this.style(t,n);return(0,c.assign)(r,{class:e})},this.style=function(t,n){(0,c.isArray)(t)||n||(n=t,t=[]);var r=(0,c.reduce)(t,function(t,n){return(0,c.assign)(t,e[n]||{})},{});return n?(0,c.assign)(r,n):r},this.computeStyle=function(e,n,r){return(0,c.isArray)(n)||(r=n,n=[]),t.style(n||[],(0,c.assign)({},r,e||{}))}};var qi={};Object.defineProperty(qi,"__esModule",{value:!0});var Ki=Xi(zi),Yi=Xi(Hi);function Xi(e){return e&&e.__esModule?e:{default:e}}qi.default={__init__:["defaultRenderer"],defaultRenderer:["type",Ki.default],styles:["type",Yi.default]};var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});var Ji=io(qi),Qi=io(vi),eo=io(Si),to=io(Ai),no=io(ki),ro=io(Ii);function io(e){return e&&e.__esModule?e:{default:e}}Zi.default={__depends__:[Ji.default],__init__:["canvas"],canvas:["type",Qi.default],elementRegistry:["type",eo.default],elementFactory:["type",to.default],eventBus:["type",no.default],graphicsFactory:["type",ro.default]};var oo={},ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(oo,"__esModule",{value:!0});var so=/^class /;function lo(e){return"[object Array]"===Object.prototype.toString.call(e)}function co(){var e=Array.prototype.slice.call(arguments);1===e.length&&lo(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var uo=/constructor\s*[^(]*\(\s*([^)]*)\)/m,po=/^function\s*[^(]*\(\s*([^)]*)\)/m,fo=/\/\*([^*]*)\*\//m;function ho(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(e){return so.test(e.toString())}(e)?uo:po);return t&&t[1]&&t[1].split(",").map(function(e){return(t=e.match(fo))?t[1].trim():e.trim()})||[]}function mo(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}}var yo="function"==typeof Symbol&&"symbol"===ao(Symbol.iterator)?function(e){return void 0===e?"undefined":ao(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":ao(e)};function go(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 vo(e,t){return Object.hasOwnProperty.call(e,t)}oo.Injector=function e(t,n){n=n||{get:function(e,t){if(r.push(e),!1===t)return null;throw s('No provider for "'+e+'"!')}};var r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(e){var t=r.join(" -> ");return r.length=0,new Error(t?e+" (Resolving: "+t+")":e)},l=function e(t,a){if(!i[t]&&-1!==t.indexOf(".")){for(var l=t.split("."),c=e(l.shift());l.length;)c=c[l.shift()];return c}if(vo(o,t))return o[t];if(vo(i,t)){if(-1!==r.indexOf(t))throw r.push(t),s("Cannot resolve circular dependency!");return r.push(t),o[t]=i[t][0](i[t][1]),r.pop(),o[t]}return n.get(t,a)},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e){if(!lo(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=co(e.slice())}return{fn:e,dependencies:(e.$inject||ho(e)).map(function(e){return vo(t,e)?t[e]:l(e)})}},u=function(e){var t=c(e),n=t.dependencies,r=t.fn;return new(Function.prototype.bind.apply(r,[null].concat(go(n))))},p=function(e,t,n){var r=c(e,n),i=r.dependencies,o=r.fn;return o.call.apply(o,[t].concat(go(i)))},f=function(e){return co(function(t){return e.get(t)})},d={factory:p,type:u,value:function(e){return e}};t.forEach(function(t){function n(e,t){return"value"!==e&&lo(t)&&(t=co(t.slice())),t}if(t instanceof mo)t.forEach(function(e){var t=e[0],r=e[1],o=e[2];i[t]=[d[r],n(r,o),r]});else if("object"===(void 0===t?"undefined":yo(t)))if(t.__exports__){var r=Object.keys(t).reduce(function(e,n){return"__"!==n.substring(0,2)&&(e[n]=t[n]),e},Object.create(null)),o=new e((t.__modules__||[]).concat([r]),a),s=co(function(e){return o.get(e)});t.__exports__.forEach(function(e){i[e]=[s,e,"private",o]})}else Object.keys(t).forEach(function(e){if("private"!==t[e][2]){var r=t[e][0],o=t[e][1];i[e]=[d[r],n(r,o),r]}else i[e]=t[e]})}),this.get=l,this.invoke=p,this.instantiate=u,this.createChild=function(t,n){if(n&&n.length){var r,o,s,l,c=Object.create(null),u=Object.create(null),p=[],d=[],h=[];for(var m in i)r=i[m],-1!==n.indexOf(m)&&("private"===r[2]?-1===(o=p.indexOf(r[3]))?(s=r[3].createChild([],n),l=f(s),p.push(r[3]),d.push(s),h.push(l),c[m]=[l,m,"private",s]):c[m]=[h[o],m,"private",d[o]]:c[m]=[r[2],r[1]],u[m]=!0),"factory"!==r[2]&&"type"!==r[2]||!r[1].$scope||n.forEach(function(e){-1!==r[1].$scope.indexOf(e)&&(c[m]=[r[2],r[1]],u[e]=!0)});n.forEach(function(e){if(!u[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),t.unshift(c)}return new e(t,a)}};var bo={};Object.defineProperty(bo,"__esModule",{value:!0}),bo.default=wo;var _o=function(e){return e&&e.__esModule?e:{default:e}}(Zi);function xo(e){var t=[],n=[];function r(e){return t.indexOf(e)>=0}e.forEach(function e(i){r(i)||((i.__depends__||[]).forEach(e),r(i)||(function(e){t.push(e)}(i),(i.__init__||[]).forEach(function(e){n.push(e)})))});var i=new oo.Injector(t);return n.forEach(function(e){try{i["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}}),i}function wo(e,t){this.injector=t=t||function(e){return xo([{config:["value",e=e||{}]},_o.default].concat(e.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}wo.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},wo.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var Eo={};Object.defineProperty(Eo,"__esModule",{value:!0}),Object.defineProperty(Eo,"default",{enumerable:!0,get:function(){return(e=bo,e&&e.__esModule?e:{default:e}).default;var e}});var Mo={};function Co(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.default=Co,Co.prototype.next=function(){return this._prefix+ ++this._counter};var Ao={};Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.default=So;var Po=new(function(e){return e&&e.__esModule?e:{default:e}}(Mo).default)("ov");function So(e,t,n,r){var i,o;this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=Po,this._overlayDefaults=(0,c.assign)({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(i=n.getContainer(),o=(0,Qe.domify)('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),i.insertBefore(o,i.firstChild),o),this._init()}function No(e,t,n){(0,c.assign)(e.style,{left:t+"px",top:n+"px"})}function Ro(e,t){e.style.display=!1===t?"none":""}function ko(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}So.$inject=["config.overlays","eventBus","canvas","elementRegistry"],So.prototype.get=function(e){if((0,c.isString)(e)&&(e={id:e}),(0,c.isString)(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?(0,c.filter)(t.overlays,(0,c.matchPattern)({type:e.type})):t.overlays.slice():[]}return e.type?(0,c.filter)(this._overlays,(0,c.matchPattern)({type:e.type})):e.id?this._overlays[e.id]:null},So.prototype.add=function(e,t,n){if((0,c.isObject)(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=(0,c.assign)({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},So.prototype.remove=function(e){var t=this.get(e)||[];(0,c.isArray)(t)||(t=[t]);var n=this;(0,c.forEach)(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&((0,Qe.remove)(e.html),(0,Qe.remove)(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);-1!==r&&t.overlays.splice(r,1)}})},So.prototype.show=function(){Ro(this._overlayRoot)},So.prototype.hide=function(){Ro(this._overlayRoot,!1)},So.prototype.clear=function(){this._overlays={},this._overlayContainers=[],(0,Qe.clear)(this._overlayRoot)},So.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=(0,yi.getBBox)(t);r=o.x,i=o.y}No(n,r,i),(0,Qe.attr)(e.html,"data-container-id",t.id)},So.prototype._updateOverlay=function(e){var t,n,r=e.position,i=e.htmlContainer,o=e.element,a=r.left,s=r.top;void 0!==r.right&&(t=o.waypoints?(0,yi.getBBox)(o).width:o.width,a=-1*r.right+t);void 0!==r.bottom&&(n=o.waypoints?(0,yi.getBBox)(o).height:o.height,s=-1*r.bottom+n);No(i,a||0,s||0)},So.prototype._createOverlayContainer=function(e){var t=(0,Qe.domify)('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},So.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";ko(this._overlayRoot,n)},So.prototype._getOverlayContainer=function(e,t){var n=(0,c.find)(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},So.prototype._addOverlay=function(e){var t,n,r=e.id,i=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),(0,c.isString)(o)&&(o=(0,Qe.domify)(o)),n=this._getOverlayContainer(i),(t=(0,Qe.domify)('<div class="djs-overlay" data-overlay-id="'+r+'" style="position: absolute">')).appendChild(o),e.type&&(0,Qe.classes)(t).add("djs-overlay-"+e.type),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},So.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=n&&n.minZoom,i=n&&n.maxZoom,o=e.htmlContainer,a=!0;n&&(((0,c.isDefined)(r)&&r>t.scale||(0,c.isDefined)(i)&&i<t.scale)&&(a=!1),Ro(o,a)),this._updateOverlayScale(e,t)},So.prototype._updateOverlayScale=function(e,t){var n,r,i,o=e.scale,a=e.htmlContainer,s="";!0!==o&&(!1===o?(n=1,r=1):(n=o.min,r=o.max),(0,c.isDefined)(n)&&t.scale<n&&(i=(1/t.scale||1)*n),(0,c.isDefined)(r)&&t.scale>r&&(i=(1/t.scale||1)*r)),(0,c.isDefined)(i)&&(s="scale("+i+","+i+")"),ko(a,s)},So.prototype._updateOverlaysVisibilty=function(e){var t=this;(0,c.forEach)(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},So.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(e){t.hide()}),e.on("canvas.viewbox.changed",function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()}),e.on(["shape.remove","connection.remove"],function(e){var n=e.element,r=t.get({element:n});(0,c.forEach)(r,function(e){t.remove(e.id)});var i=t._getOverlayContainer(n);if(i){(0,Qe.remove)(i.html);var o=t._overlayContainers.indexOf(i);-1!==o&&t._overlayContainers.splice(o,1)}}),e.on("element.changed",500,function(e){var n=e.element,r=t._getOverlayContainer(n,!0);r&&((0,c.forEach)(r.overlays,function(e){t._updateOverlay(e)}),t._updateOverlayContainer(r))}),e.on("element.marker.update",function(e){var n=t._getOverlayContainer(e.element,!0);n&&(0,Qe.classes)(n.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});var To=function(e){return e&&e.__esModule?e:{default:e}}(Ao);Oo.default={__init__:["overlays"],overlays:["type",To.default]};var jo={};function Do(e){return e.originalEvent||e.srcEvent}Object.defineProperty(jo,"__esModule",{value:!0}),jo.getOriginal=Do;var Bo={};Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.isMac=function(){return/mac/i.test(navigator.platform)};var Io={};function Lo(e){return!((0,jo.getOriginal)(e)||e).button}Object.defineProperty(Io,"__esModule",{value:!0}),Object.defineProperty(Io,"isMac",{enumerable:!0,get:function(){return Bo.isMac}}),Io.isPrimaryButton=Lo,Io.hasPrimaryModifier=function(e){var t=(0,jo.getOriginal)(e)||e;if(!Lo(e))return!1;return(0,Bo.isMac)()?t.metaKey:t.ctrlKey};var Fo={};function zo(e){return!0}Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.default=$o;var Vo=500;function $o(e,t,n){var r=n.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15});function i(n,r,i){var o,a;(function(e,t){return!(l[e]||Io.isPrimaryButton)(t)})(n,r)||(i?a=t.getGraphics(i):(o=r.delegateTarget||r.target)&&(a=o,i=t.get(a)),a&&i&&!1===e.fire(n,{element:i,gfx:a,originalEvent:r})&&(r.stopPropagation(),r.preventDefault()))}var o={};function a(e){return o[e]}var s={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseup:"element.mouseup",contextmenu:"element.contextmenu"},l={"element.contextmenu":zo};var u="svg, .djs-element";function p(e,t,n,r){var a=o[n]=function(e){i(n,e)};r&&(l[n]=r),a.$delegate=Qe.delegate.bind(e,u,t,a)}function f(e,t,n){var r=a(n);r&&Qe.delegate.unbind(e,t,r.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,(0,c.forEach)(s,function(e,n){f(t,n,e)})}),e.on("canvas.init",function(e){var t;t=e.svg,(0,c.forEach)(s,function(e,n){p(t,n,e)})}),e.on(["shape.added","connection.added"],function(e){var t,n=e.element,i=e.gfx;n.waypoints?t=(0,$e.createLine)(n.waypoints):(t=(0,he.create)("rect"),(0,he.attr)(t,{x:0,y:0,width:n.width,height:n.height})),(0,he.attr)(t,r),(0,he.append)(i,t)}),e.on("shape.changed",Vo,function(e){var t=e.element,n=e.gfx,r=(0,Qe.query)(".djs-hit",n);(0,he.attr)(r,{width:t.width,height:t.height})}),e.on("connection.changed",function(e){var t=e.element,n=e.gfx,r=(0,Qe.query)(".djs-hit",n);(0,$e.updateLine)(r,t.waypoints)}),this.fire=i,this.triggerMouseEvent=function(e,t,n){var r=s[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");return i(r,t,n)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=f}$o.$inject=["eventBus","elementRegistry","styles"];var Uo={};Object.defineProperty(Uo,"__esModule",{value:!0});var Wo=function(e){return e&&e.__esModule?e:{default:e}}(Fo);Uo.default={__init__:["interactionEvents"],interactionEvents:["type",Wo.default]};var Go={};Object.defineProperty(Go,"__esModule",{value:!0}),Go.default=qo;var Ho=500;function qo(e,t,n){this.offset=6;var r=t.cls("djs-outline",["no-fill"]),i=this;function o(e,t){var n=(0,he.create)("rect");return(0,he.attr)(n,(0,c.assign)({x:10,y:10,width:100,height:100},r)),(0,he.append)(e,n),n}e.on(["shape.added","shape.changed"],Ho,function(e){var t=e.element,n=e.gfx,r=(0,Qe.query)(".djs-outline",n);r||(r=o(n)),i.updateShapeOutline(r,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,r=(0,Qe.query)(".djs-outline",n);r||(r=o(n)),i.updateConnectionOutline(r,t)})}qo.prototype.updateShapeOutline=function(e,t){(0,he.attr)(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},qo.prototype.updateConnectionOutline=function(e,t){var n=(0,yi.getBBox)(t);(0,he.attr)(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},qo.$inject=["eventBus","styles","elementRegistry"];var Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});var Yo=function(e){return e&&e.__esModule?e:{default:e}}(Go);Ko.default={__init__:["outline"],outline:["type",Yo.default]};var Xo={};function Zo(e){this._eventBus=e,this._selectedElements=[];var t=this;e.on(["shape.remove","connection.remove"],function(e){var n=e.element;t.deselect(n)}),e.on(["diagram.clear"],function(e){t.select(null)})}Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=Zo,Zo.$inject=["eventBus"],Zo.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})}},Zo.prototype.get=function(){return this._selectedElements},Zo.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Zo.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();(0,c.isArray)(e)||(e=e?[e]:[]),t?(0,c.forEach)(e,function(e){-1===n.indexOf(e)&&n.push(e)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};var Jo={};function Qo(e,t,n,r){e.on("create.end",500,function(e){e.context.canExecute&&t.select(e.context.shape)}),e.on("connect.end",500,function(e){e.context.canExecute&&e.context.target&&t.select(e.context.target)}),e.on("shape.move.end",500,function(e){var n=e.previousSelection||[],i=r.get(e.context.shape.id);(0,c.find)(n,function(e){return i.id===e.id})||t.select(i)}),e.on("element.click",function(e){var r=e.element;r===n.getRootElement()&&(r=null);var i=t.isSelected(r),o=t.get().length>1,a=(0,Io.hasPrimaryModifier)(e);if(i&&o)return a?t.deselect(r):t.select(r);i?t.deselect(r):t.select(r,a)})}Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=Qo,Qo.$inject=["eventBus","selection","canvas","elementRegistry"];var ea={};Object.defineProperty(ea,"__esModule",{value:!0}),ea.default=ra;var ta="hover",na="selected";function ra(e,t,n,r){function i(e,n){t.addMarker(e,n)}function o(e,n){t.removeMarker(e,n)}this._multiSelectionBox=null,e.on("element.hover",function(e){i(e.element,ta)}),e.on("element.out",function(e){o(e.element,ta)}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;(0,c.forEach)(t,function(e){-1===n.indexOf(e)&&o(e,na)}),(0,c.forEach)(n,function(e){-1===t.indexOf(e)&&i(e,na)})})}ra.$inject=["eventBus","canvas","selection","styles"];var ia={};Object.defineProperty(ia,"__esModule",{value:!0});var oa=ua(Uo),aa=ua(Ko),sa=ua(Xo),la=ua(ea),ca=ua(Jo);function ua(e){return e&&e.__esModule?e:{default:e}}ia.default={__init__:["selectionVisuals","selectionBehavior"],__depends__:[oa.default,aa.default],selection:["type",sa.default],selectionVisuals:["type",la.default],selectionBehavior:["type",ca.default]};var pa=c.assign,fa=c.omit,da=c.isNumber,ha=Qe.domify,ma=Qe.query,ya=Qe.remove,ga=he.innerSVG,va=Eo.default,ba=mi.default;var _a={width:"100%",height:"100%",position:"relative"};function xa(e){return e+(da(e)?"px":"")}function wa(e){var t,n,r;e=pa({},_a,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100; '+En.LINK_STYLES+'">'+En.BPMNIO_IMG+"</a>",r=ha(n),t.appendChild(r),Ma.bind(r,"click",function(e){En.open(),e.preventDefault()}),this._init(this._container,this._moddle,e)}l(wa,va);var Ea=wa;wa.prototype.importXML=function(e,t){t=t||function(){};var n=this;e=this._emit("import.parse.start",{xml:e})||e,this._moddle.fromXML(e,"cmmn:Definitions",function(e,r,i){r=n._emit("import.parse.complete",{error:e,definitions:r,context:i})||r;var o=i.warnings;if(e)return e=function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid CMMN 1.1 diagram file"+t[2]),e}(e),n._emit("import.done",{error:e,warnings:o}),t(e,o);n.importDefinitions(r,function(e,r){var i=[].concat(o,r||[]);n._emit("import.done",{error:e,warnings:i}),t(e,i)})})},wa.prototype.saveXML=function(e,t){t||(t=e,e={});var n=this,r=this._definitions;if(!r)return t(new Error("no definitions loaded"));r=this._emit("saveXML.start",{definitions:r})||r,this._moddle.toXML(r,e,function(e,r){try{r=n._emit("saveXML.serialized",{error:e,xml:r})||r,n._emit("saveXML.done",{error:e,xml:r})}catch(e){console.error("error in saveXML life-cycle listener",e)}t(e,r)})},wa.prototype.saveSVG=function(e,t){t||(t=e,e={});var n=this.get("canvas"),r=n.getDefaultLayer(),i=ma("defs",n._svg),o=ga(r),a=i&&i.outerHTML||"",s=r.getBBox();t(null,'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with cmmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+a+o+"</svg>")},wa.prototype.importDefinitions=function(e,t){try{this._definitions&&this.clear(),this._definitions=e,wn.importCmmnDiagram(this,e,t)}catch(e){t(e)}},wa.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=ma(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},wa.prototype.getDefinitions=function(){return this._definitions},wa.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},wa.prototype.getModules=function(){return this._modules},wa.prototype.destroy=function(){va.prototype.destroy.call(this),ya(this._container)},wa.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},wa.prototype.off=function(e,t){this.get("eventBus").off(e,t)},wa.prototype._init=function(e,t,n){var r=n.modules||this.getModules(),i=n.additionalModules||[],o=[].concat([{cmmnjs:["value",this],moddle:["value",t]}],r,i),a=pa(fa(n,"additionalModules"),{canvas:pa({},n.canvas,{container:e}),modules:o});va.call(this,a),n&&n.container&&this.attachTo(n.container)},wa.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},wa.prototype._createContainer=function(e){var t=ha('<div class="cjs-container"></div>');return pa(t.style,{width:xa(e.width),height:xa(e.height),position:e.position}),t},wa.prototype._createModdle=function(e){var t=pa({},this._moddleExtensions,e.moddleExtensions);return new ba(t)},wa.prototype._modules=[hn,ia.default,Oo.default];var Ma=Qe.event;return Ea});
package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./lib/Viewer');
package/lib/Modeler.js ADDED
@@ -0,0 +1,222 @@
1
+ 'use strict';
2
+
3
+ var inherits = require('inherits');
4
+
5
+ var Ids = require('ids');
6
+
7
+ var Viewer = require('./Viewer');
8
+
9
+ var NavigatedViewer = require('./NavigatedViewer');
10
+
11
+ var initialDiagram = '<?xml version="1.0" encoding="UTF-8"?>' +
12
+ '<cmmn:definitions xmlns:dc="http://www.omg.org/spec/CMMN/20151109/DC" ' +
13
+ 'xmlns:di="http://www.omg.org/spec/CMMN/20151109/DI" ' +
14
+ 'xmlns:cmmndi="http://www.omg.org/spec/CMMN/20151109/CMMNDI" ' +
15
+ 'xmlns:cmmn="http://www.omg.org/spec/CMMN/20151109/MODEL" ' +
16
+ 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Test" ' +
17
+ 'targetNamespace="http://bpmn.io/schema/cmmn">' +
18
+ '<cmmn:case id="Case_1">' +
19
+ '<cmmn:casePlanModel id="CasePlanModel_1" name="A CasePlanModel">' +
20
+ '<cmmn:planItem id="PlanItem_1" definitionRef="Task_1" />' +
21
+ '<cmmn:task id="Task_1" />' +
22
+ '</cmmn:casePlanModel>' +
23
+ '</cmmn:case>' +
24
+ '<cmmndi:CMMNDI>' +
25
+ '<cmmndi:CMMNDiagram id="CMMNDiagram_1">' +
26
+ '<cmmndi:Size width="500" height="500" />' +
27
+ '<cmmndi:CMMNShape id="DI_CasePlanModel_1" cmmnElementRef="CasePlanModel_1">' +
28
+ '<dc:Bounds x="114" y="63" width="534" height="389" />' +
29
+ '<cmmndi:CMMNLabel />' +
30
+ '</cmmndi:CMMNShape>' +
31
+ '<cmmndi:CMMNShape id="PlanItem_1_di" cmmnElementRef="PlanItem_1">' +
32
+ '<dc:Bounds x="150" y="96" width="100" height="80" />' +
33
+ '<cmmndi:CMMNLabel />' +
34
+ '</cmmndi:CMMNShape>' +
35
+ '</cmmndi:CMMNDiagram>' +
36
+ '</cmmndi:CMMNDI>' +
37
+ '</cmmn:definitions>';
38
+
39
+ /**
40
+ * A modeler for CMMN 1.1 diagrams.
41
+ *
42
+ * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that include
43
+ * additional features.
44
+
45
+ *
46
+ * ## Extending the Modeler
47
+ *
48
+ * In order to extend the viewer pass extension modules to bootstrap via the
49
+ * `additionalModules` option. An extension module is an object that exposes
50
+ * named services.
51
+ *
52
+ * The following example depicts the integration of a simple
53
+ * logging component that integrates with interaction events:
54
+ *
55
+ *
56
+ * ```javascript
57
+ *
58
+ * // logging component
59
+ * function InteractionLogger(eventBus) {
60
+ * eventBus.on('element.hover', function(event) {
61
+ * console.log()
62
+ * })
63
+ * }
64
+ *
65
+ * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
66
+ *
67
+ * // extension module
68
+ * var extensionModule = {
69
+ * __init__: [ 'interactionLogger' ],
70
+ * interactionLogger: [ 'type', InteractionLogger ]
71
+ * };
72
+ *
73
+ * // extend the viewer
74
+ * var cmmnModeler = new Modeler({ additionalModules: [ extensionModule ] });
75
+ * cmmnModeler.importXML(...);
76
+ * ```
77
+ *
78
+ *
79
+ * ## Customizing / Replacing Components
80
+ *
81
+ * You can replace individual diagram components by redefining them in override modules.
82
+ * This works for all components, including those defined in the core.
83
+ *
84
+ * Pass in override modules via the `options.additionalModules` flag like this:
85
+ *
86
+ * ```javascript
87
+ * function CustomContextPadProvider(contextPad) {
88
+ *
89
+ * contextPad.registerProvider(this);
90
+ *
91
+ * this.getContextPadEntries = function(element) {
92
+ * // no entries, effectively disable the context pad
93
+ * return {};
94
+ * };
95
+ * }
96
+ *
97
+ * CustomContextPadProvider.$inject = [ 'contextPad' ];
98
+ *
99
+ * var overrideModule = {
100
+ * contextPadProvider: [ 'type', CustomContextPadProvider ]
101
+ * };
102
+ *
103
+ * var cmmnModeler = new Modeler({ additionalModules: [ overrideModule ]});
104
+ * ```
105
+ *
106
+ * @param {Object} [options] configuration options to pass to the viewer
107
+ * @param {DOMElement} [options.container] the container to attach to
108
+ * @param {String|Number} [options.width] the width of the viewer
109
+ * @param {String|Number} [options.height] the height of the viewer
110
+ * @param {Object} [options.moddleExtensions] extension packages to provide
111
+ * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules
112
+ * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules
113
+ */
114
+ function Modeler(options) {
115
+ Viewer.call(this, options);
116
+
117
+ // hook ID collection into the modeler
118
+ this.on('import.parse.complete', function(event) {
119
+ if (!event.error) {
120
+ this._collectIds(event.definitions, event.context);
121
+ }
122
+ }, this);
123
+
124
+ this.on('diagram.destroy', function() {
125
+ this.get('moddle').ids.clear();
126
+ }, this);
127
+ }
128
+
129
+ inherits(Modeler, Viewer);
130
+
131
+ module.exports = Modeler;
132
+
133
+ module.exports.Viewer = Viewer;
134
+
135
+ module.exports.NavigatedViewer = NavigatedViewer;
136
+
137
+ /**
138
+ * Create a new diagram to start modeling.
139
+ *
140
+ * @param {Function} [done]
141
+ */
142
+ Modeler.prototype.createDiagram = function(done) {
143
+ return this.importXML(initialDiagram, done);
144
+ };
145
+
146
+ /**
147
+ * Create a moddle instance, attaching ids to it.
148
+ *
149
+ * @param {Object} options
150
+ */
151
+ Modeler.prototype._createModdle = function(options) {
152
+ var moddle = Viewer.prototype._createModdle.call(this, options);
153
+
154
+ // attach ids to moddle to be able to track
155
+ // and validated ids in the CMMN 1.1 XML document
156
+ // tree
157
+ moddle.ids = new Ids([ 32, 36, 1 ]);
158
+
159
+ return moddle;
160
+ };
161
+
162
+ /**
163
+ * Collect ids processed during parsing of the
164
+ * definitions object.
165
+ *
166
+ * @param {ModdleElement} definitions
167
+ * @param {Context} context
168
+ */
169
+ Modeler.prototype._collectIds = function(definitions, context) {
170
+
171
+ var moddle = definitions.$model,
172
+ ids = moddle.ids,
173
+ id;
174
+
175
+ // remove references from previous import
176
+ ids.clear();
177
+
178
+ for (id in context.elementsById) {
179
+ ids.claim(id, context.elementsById[id]);
180
+ }
181
+ };
182
+
183
+
184
+ Modeler.prototype._interactionModules = [
185
+ // non-modeling components
186
+ require('diagram-js/lib/features/auto-scroll').default,
187
+ require('diagram-js/lib/navigation/keyboard-move').default,
188
+ require('diagram-js/lib/navigation/movecanvas').default,
189
+ require('diagram-js/lib/navigation/zoomscroll').default,
190
+ require('./features/outline')
191
+ ];
192
+
193
+ Modeler.prototype._modelingModules = [
194
+ // modeling components
195
+ require('diagram-js/lib/features/bendpoints').default,
196
+ require('diagram-js/lib/features/keyboard-move-selection').default,
197
+ require('diagram-js/lib/features/move').default,
198
+ require('diagram-js/lib/features/resize').default,
199
+ require('diagram-js/lib/features/connection-preview').default,
200
+ require('./features/auto-resize'),
201
+ require('./features/context-pad'),
202
+ require('./features/editor-actions'),
203
+ require('./features/keyboard'),
204
+ require('./features/label-editing'),
205
+ require('./features/modeling'),
206
+ require('./features/palette'),
207
+ require('./features/snapping'),
208
+ require('./features/search'),
209
+ require('./features/replace-preview')
210
+ ];
211
+
212
+
213
+ // modules the modeler is composed of
214
+ //
215
+ // - viewer modules
216
+ // - interaction modules
217
+ // - modeling modules
218
+
219
+ Modeler.prototype._modules = [].concat(
220
+ Modeler.prototype._modules,
221
+ Modeler.prototype._interactionModules,
222
+ Modeler.prototype._modelingModules);
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var inherits = require('inherits');
4
+
5
+ var Viewer = require('./Viewer');
6
+
7
+
8
+ /**
9
+ * A viewer that includes mouse navigation facilities
10
+ *
11
+ * @param {Object} options
12
+ */
13
+ function NavigatedViewer(options) {
14
+ Viewer.call(this, options);
15
+ }
16
+
17
+ inherits(NavigatedViewer, Viewer);
18
+
19
+ module.exports = NavigatedViewer;
20
+
21
+ NavigatedViewer.prototype._navigationModules = [
22
+ require('diagram-js/lib/navigation/zoomscroll').default,
23
+ require('diagram-js/lib/navigation/movecanvas').default
24
+ ];
25
+
26
+ NavigatedViewer.prototype._modules = [].concat(
27
+ NavigatedViewer.prototype._modules,
28
+ NavigatedViewer.prototype._navigationModules);