|
|
|
|
/*! bpmn-js - bpmn-navigated-viewer v9.4.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
|
|
|
|
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BpmnJS=t()}(this,(function(){"use strict";function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return void 0!==e}function r(e){return"[object Array]"===t.call(e)}function o(e){return"[object Object]"===t.call(e)}function a(e){return"[object Number]"===t.call(e)}function s(e){var n=t.call(e);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function l(e){return"[object String]"===t.call(e)}function p(e,t){return n.call(e,t)}function c(e,t){var n;return t=g(t),h(e,(function(e,i){if(t(e,i))return n=e,!1})),n}function u(e,t){var n=[];return h(e,(function(e,i){t(e,i)&&n.push(e)})),n}function h(e,t){var n;if(void 0!==e){var i=r(e)?b:v;for(var o in e)if(p(e,o)&&!1===t(n=e[o],i(o)))return n}}function m(e,t,n){return h(e,(function(e,i){n=t(n,e,i)})),n}function f(e,t){return!!m(e,(function(e,n,i){return e&&t(n,i)}),!0)}function d(e,t){return!!c(e,t)}function y(e){return function(t){return f(e,(function(e,n){return t[n]===e}))}}function g(e){return s(e)?e:function(t){return t===e}}function v(e){return e}function b(e){return Number(e)}function x(e,t){return e.bind(t)}function w(){return w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},w.apply(this,arguments)}function E(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return w.apply(void 0,[e].concat(n))}function _(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,a):n.drawConnection(o,r,a)})),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)}))}function A(e,t){var n=S(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function S(e){return e&&e.businessObject||e}function R(e){return e&&e.di}function C(e,t){return!A(e,"bpmn:CallActivity")&&(A(e,"bpmn:SubProcess")?!(!(t=t||R(e))||!A(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!A(e,"bpmn:Participant")||!!S(e).processRef)}function M(e){var t=e.businessObject,n=function(e){return A(e,"bpmn:FlowElement")||A(e,"bpmn:Participant")||A(e,"bpmn:Lane")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")?"name":A(e,"bpmn:TextAnnotation")?"text":A(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function k(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function P(e,t){return k(t,e),e}_.prototype.canRender=function(){},_.prototype.drawShape=function(){},_.prototype.drawConnection=function(){},_.prototype.getShapePath=function(){},_.prototype.getConnectionPath=function(){};var D={"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":2,"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,"poin
|
|
|
|
|
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
|
|
|
|
|
!function(e,t){var n;n=ut,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),i=n.length,r=-1,o="",a=n.charCodeAt(0);++r<i;)0!=(t=n.charCodeAt(r))?o+=t>=1&&t<=31||127==t||0==r&&t>=48&&t<=57||1==r&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==r&&1==i&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(r):n.charAt(r):o+="<EFBFBD>";return o};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(n)}({exports:{}});var nn={"&":"&","<":"<",">":">",'"':""","'":"'"};var rn="_plane";function on(e){var t=e.id;return A(e,"bpmn:SubProcess")?function(e){return e+rn}(t):t}function an(e,t,n,i){var r=Fe('<ul class="bjs-breadcrumbs"></ul>'),o=i.getContainer(),a=Se(o);o.appendChild(r);var s=[];function l(e){e&&(s=function(e){for(var t=S(e),n=[],i=t;i;i=i.$parent)(A(i,"bpmn:SubProcess")||A(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var n=s.map((function(e){var n,r=(n=""+(n=e.name||e.id))&&n.replace(/[&<>"']/g,(function(e){return nn[e]})),o=Fe('<li><span class="bjs-crumb"><a title="'+r+'">'+r+"</a></span></li>"),a=i.findRoot(on(e))||i.findRoot(e.id);if(!a&&A(e,"bpmn:Process")){var s=t.find((function(t){var n=S(t);return n&&n.processRef&&n.processRef===e}));a=i.findRoot(s.id)}return o.addEventListener("click",(function(){i.setRootElement(a)})),o}));r.innerHTML="";var o=n.length>1;a.toggle("bjs-breadcrumbs-shown",o),n.forEach((function(e){r.appendChild(e)}))}e.on("element.changed",(function(e){var t=S(e.element);c(s,(function(e){return e===t}))&&l()})),e.on("root.set",(function(e){l(e.element)}))}function sn(e,t){var n=null,i=new ln;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),a=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!A(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,l=(o.y-a.y)*o.scale;0===s&&0===l||t.scroll({dx:s,dy:l}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function ln(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}an.$inject=["eventBus","elementRegistry","overlays","canvas"],sn.$inject=["eventBus","canvas"];var pn=180,cn=160;function un(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,(function(e,t){n.handleImport(t.definitions)}))}function hn(e){return A(e,"bpmndi:BPMNDiagram")?e:hn(e.$parent)}un.prototype.handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t.createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t.movePlaneElementsToOrigin(e.plane)}))}},un.prototype.createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;A(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!A(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(function(e,t){return d(t,(function(t){return A(e,t)}))}(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}}));var r=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t.createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}})),i.forEach((function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t.moveToDiPlane(i,o.plane)}})),r},un.prototype.movePlaneElementsToOrigin=function(e){var t=
|
|
|
|
|
/**
|
|
|
|
|
* This file must not be changed or exchanged.
|
|
|
|
|
*
|
|
|
|
|
* @see http://bpmn.io/license for more information.
|
|
|
|
|
*/(i));n=A(r,"bpmn:Collaboration")?r:c(e.rootElements,(function(e){if(A(e,"bpmn:Collaboration"))return c(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=function(e,t){var n=[];return h(e,(function(e,i){n.push(t(e,i))})),n}(n.participants,(function(e){return e.processRef})),o.push(n));var a=Mr(o),s=[t],l=[i];return h(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===l.indexOf(t)&&(s.push(e),l.push(t))})),s}(e,t);if(!r)throw new Error(o("no diagram to display"));h(r,(function(t){n.handleDefinitions(e,t)}));var l=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(l+"_plane")||a.findRoot(l))}return new Promise((function(p,c){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),a=e.get("canvas"),r.fire("import.render.start",{definitions:t}),l(t,n),r.fire("import.render.complete",{error:undefined,warnings:s}),p({warnings:s})}catch(e){return e.warnings=s,c(e)}}))}function Mr(e){var t=[];return h(e,(function(e){e&&(t.push(e),t=t.concat(Mr(e.flowElements)))})),t}var kr,Pr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><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>',Dr={verticalAlign:"middle"},Tr={color:"#404040"},Nr={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Or={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Br={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"};function Lr(){kr||(xe(kr=Fe('<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><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></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>'),Nr),xe(We("svg",kr),Dr),xe(We(".backdrop",kr),Or),xe(We(".notice",kr),Br),xe(We(".link",kr),Tr,{margin:"15px 20px 15px 10px",alignSelf:"center"}),je.bind(kr,".backdrop","click",(function(e){document.body.removeChild(kr)}))),document.body.appendChild(kr)}
|
|
|
|
|
/**
|
|
|
|
|
* The code in the <project-logo></project-logo> area
|
|
|
|
|
* must not be changed.
|
|
|
|
|
*
|
|
|
|
|
* @see http://bpmn.io/license for more information.
|
|
|
|
|
*/function Ir(e){
|
|
|
|
|
/**
|
|
|
|
|
* Adds the project logo to the diagram container as
|
|
|
|
|
* required by the bpmn.io license.
|
|
|
|
|
*
|
|
|
|
|
* @see http://bpmn.io/license
|
|
|
|
|
*
|
|
|
|
|
* @param {Element} container
|
|
|
|
|
*/
|
|
|
|
|
var t,n;e=E({},Fr,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,xe(We("svg",n=Fe('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Pr+"</a>")),Dr),xe(n,Tr,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),t.appendChild(n),Be.bind(n,"click",(function(e){Lr(),e.preventDefault()})),this._init(this._container,this._moddle,e)}function jr(e,t){return e.warnings=t,e}e(Ir,li),Ir.prototype.importXML=Ar((function(e,t){var n=this;return new Promise((function(i,r){e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"bpmn:Definitions").then((function(e){var o,a,s=e.rootElement,l=e.references,p=e.warnings,c=e.elementsById;s=n._emit("import.parse.complete",(o={error:null,definitions:s,elementsById:c,references:l,warnings:p},a=n.get("eventBus").createEvent(o),Object.defineProperty(a,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:o.warnings,references:o.references,elementsById:o.elementsById}}}),a))||s,n.importDefinitions(s,t).then((function(e){var t=[].concat(p,e.warnings||[]);return n._emit("import.done",{error:null,warnings:t}),i({warnings:t})})).catch((function(e){var t=[].concat(p,e.warnings||[]);return n._emit("import.done",{error:e,warnings:t}),r(jr(e,t))}))})).catch((function(e){return n._emit("import.parse.complete",{error:e}),e=function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(e),n._emit("import.done",{error:e,warnings:e.warnings}),r(e)}))}))})),Ir.prototype.importDefinitions=Ar((function(e,t){var n=this;return new Promise((function(i,r){n._setDefinitions(e),n.open(t).then((function(e){var t=e.warnings;return i({warnings:t})})).catch((function(e){return r(e)}))}))})),Ir.prototype.open=Ar((function(e){var t=this._definitions,n=e,i=this;return new Promise((function(r,o){if(!t){var a=new Error("no XML imported");return o(jr(a,[]))}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return c(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){var s=new Error("BPMNDiagram <"+e+"> not found");return o(jr(s,[]))}try{i.clear()}catch(e){return o(jr(e,[]))}Cr(i,t,n).then((function(e){var t=e.warnings;return r({warnings:t})})).catch((function(e){return o(e)}))}))})),Ir.prototype.saveXML=Ar((function(e){e=e||{};var t=this,n=this._definitions;return new Promise((function(i){if(!n)return i({error:new Error("no definitions loaded")});n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then((function(e){var n=e.xml;return n=t._emit("saveXML.serialized",{xml:n})||n,i({xml:n})}))})).catch((function(e){return{error:e}})).then((function(e){t._emit("saveXML.done",e);var n=e.error;return n?Promise.reject(n):e}))})),Ir.prototype.saveSVG=Ar((function(e){var t=this;return new Promise((function(e,n){var i,r;t._emit("saveSVG.start");try{var o=t.get("canvas"),a=o.getActiveLayer(),s=We("defs",o._svg),l=ne(a),p=s?"<defs>"+ne(s)+"</defs>":"",c=a.getBBox();i='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-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="'+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+p+l+"</svg>"}catch(e){r=e}return t._emit("saveSVG.done",{error:r,svg:i}),r?n(r):e({svg:i})}))})),Ir.prototype._setDefinitions=function(e){this._definitions=e},Ir.prototype.getModules=function(){return this._modules},Ir.prototype.clear=function(){this.getDefinitions()&&li.prototype.clear.call(this)},Ir.prototype.destroy=function(){li.prototype.destroy.call(this),Ge(this._container)},Ir.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Ir.prototype.off=function(e,t){this.get("e
|