From 49e33a0842ce43fe90bbbb606ba783e7e6302ac1 Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 11 Oct 2021 14:31:06 +0200 Subject: [PATCH] Updated rules --- .bpmnlintrc | 3 +- bpmnlint-plugin-custom/index.js | 8 +- .../rules/script-task-error.js | 29 ++ .../rules/script-task-warn.js | 21 ++ bpmnlint-plugin-custom/rules/script-task.js | 25 -- .../rules/service-task-httpRequest-error.js | 34 ++ .../rules/service-task-httpRequest-warn.js | 28 ++ .../service-task-onifyApiRequest-error.js | 34 ++ bpmnlint-plugin-custom/rules/service-task.js | 34 +- bpmnlint-plugin-custom/utils.js | 12 + dist/client.js | 305 +++++++++++++----- dist/client.js.map | 2 +- 12 files changed, 394 insertions(+), 141 deletions(-) create mode 100644 bpmnlint-plugin-custom/rules/script-task-error.js create mode 100644 bpmnlint-plugin-custom/rules/script-task-warn.js delete mode 100644 bpmnlint-plugin-custom/rules/script-task.js create mode 100644 bpmnlint-plugin-custom/rules/service-task-httpRequest-error.js create mode 100644 bpmnlint-plugin-custom/rules/service-task-httpRequest-warn.js create mode 100644 bpmnlint-plugin-custom/rules/service-task-onifyApiRequest-error.js create mode 100644 bpmnlint-plugin-custom/utils.js diff --git a/.bpmnlintrc b/.bpmnlintrc index 8812579..7a75d0a 100644 --- a/.bpmnlintrc +++ b/.bpmnlintrc @@ -5,6 +5,7 @@ "plugin:custom/recommended" ], "rules": { - "label-required": "on" + "label-required": "on", + "camunda/avoid-lanes": "off" } } diff --git a/bpmnlint-plugin-custom/index.js b/bpmnlint-plugin-custom/index.js index edcbc6b..853c843 100644 --- a/bpmnlint-plugin-custom/index.js +++ b/bpmnlint-plugin-custom/index.js @@ -2,8 +2,12 @@ module.exports = { configs: { recommended: { rules: { - 'script-task': 'error', - 'service-task': 'error' + 'script-task-error': 'error', + 'script-task-warn': 'warn', + 'service-task': 'error', + 'service-task-httpRequest-error': 'error', + 'service-task-httpRequest-warn': 'warn', + 'service-task-onifyApiRequest-error': 'error' } } } diff --git a/bpmnlint-plugin-custom/rules/script-task-error.js b/bpmnlint-plugin-custom/rules/script-task-error.js new file mode 100644 index 0000000..7444a0e --- /dev/null +++ b/bpmnlint-plugin-custom/rules/script-task-error.js @@ -0,0 +1,29 @@ +const { is } = require('bpmnlint-utils'); + + +/** + * Rule that reports missing Script format on bpmn:ScriptTask. + * Script format can supports js or javascript + */ +module.exports = function () { + + function check(node, reporter) { + if (is(node, 'bpmn:ScriptTask')) { + if (!node.scriptFormat) { + return reporter.report(node.id, 'Script format must be defined'); + } + + if (node.scriptFormat !== 'js' && node.scriptFormat !== 'javascript') { + return reporter.report(node.id, 'Only `js/javascript` are supported script formats'); + } + + if (!node.script) { + reporter.report(node.id, 'Script must be defined'); + } + } + } + + return { + check: check + }; +}; diff --git a/bpmnlint-plugin-custom/rules/script-task-warn.js b/bpmnlint-plugin-custom/rules/script-task-warn.js new file mode 100644 index 0000000..cede8f2 --- /dev/null +++ b/bpmnlint-plugin-custom/rules/script-task-warn.js @@ -0,0 +1,21 @@ +const { is } = require('bpmnlint-utils'); + + +/** + * Rule that reports missing Script format on bpmn:ScriptTask. + * Script format can supports js or javascript + */ +module.exports = function () { + + function check(node, reporter) { + if (is(node, 'bpmn:ScriptTask') && (node.scriptFormat === 'js' || node.scriptFormat === 'javascript')) { + if (node.script && !node.script.includes('next()')) { + reporter.report(node.id, 'next() functions does not exist'); + } + } + } + + return { + check: check + }; +}; diff --git a/bpmnlint-plugin-custom/rules/script-task.js b/bpmnlint-plugin-custom/rules/script-task.js deleted file mode 100644 index 3074782..0000000 --- a/bpmnlint-plugin-custom/rules/script-task.js +++ /dev/null @@ -1,25 +0,0 @@ -const { - is -} = require('bpmnlint-utils'); - - -/** - * Rule that reports missing Script format on bpmn:ScriptTask. - * Script format can supports js or javascript - */ -module.exports = function () { - - function check(node, reporter) { - if (is(node, 'bpmn:ScriptTask') && (!node.scriptFormat || (node.scriptFormat !== 'js' && node.scriptFormat !== 'javascript'))) { - if (!node.scriptFormat) { - reporter.report(node.id, 'Script format must be defined'); - } else { - reporter.report(node.id, 'Only `js`/`javascript` are supported script formats'); - } - } - } - - return { - check: check - }; -}; diff --git a/bpmnlint-plugin-custom/rules/service-task-httpRequest-error.js b/bpmnlint-plugin-custom/rules/service-task-httpRequest-error.js new file mode 100644 index 0000000..4a13dd8 --- /dev/null +++ b/bpmnlint-plugin-custom/rules/service-task-httpRequest-error.js @@ -0,0 +1,34 @@ +const { is } = require('bpmnlint-utils'); +const { findElement } = require('../utils'); + +/** + * Rule that reports missing responseType on bpmn:ServiceTask. + */ +module.exports = function () { + + function check(node, reporter) { + if (is(node, 'bpmn:ServiceTask')) { + const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector'); + + if (!connector || connector.connectorId !== 'httpRequest') { + return; + } + + const url = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'url'); + const json = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'json'); + const method = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'method'); + + if (!url) { + reporter.report(node.id, 'Connector input parameter `url` must be defined'); + } + + if (method && (method.value.toUpperCase() === 'POST' || method.value.toUpperCase() === 'PUT' || method.value.toUpperCase() === 'PATCH') && !json) { + reporter.report(node.id, 'Connector input parameter `json` must be defined when `method` is POST, PUT or PATCH'); + } + } + } + + return { + check: check + }; +}; diff --git a/bpmnlint-plugin-custom/rules/service-task-httpRequest-warn.js b/bpmnlint-plugin-custom/rules/service-task-httpRequest-warn.js new file mode 100644 index 0000000..9fbac50 --- /dev/null +++ b/bpmnlint-plugin-custom/rules/service-task-httpRequest-warn.js @@ -0,0 +1,28 @@ +const { is } = require('bpmnlint-utils'); +const { findElement } = require('../utils'); + +/** + * Rule that reports missing responseType on bpmn:ServiceTask. + */ +module.exports = function () { + + function check(node, reporter) { + if (is(node, 'bpmn:ServiceTask')) { + const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector'); + + if (!connector || connector.connectorId !== 'httpRequest') { + return; + } + + const responseType = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'responseType'); + + if (!responseType) { + reporter.report(node.id, 'Connector input parameter `responseType` is not defined'); + } + } + } + + return { + check: check + }; +}; diff --git a/bpmnlint-plugin-custom/rules/service-task-onifyApiRequest-error.js b/bpmnlint-plugin-custom/rules/service-task-onifyApiRequest-error.js new file mode 100644 index 0000000..b44c9af --- /dev/null +++ b/bpmnlint-plugin-custom/rules/service-task-onifyApiRequest-error.js @@ -0,0 +1,34 @@ +const { is } = require('bpmnlint-utils'); +const { findElement } = require('../utils'); + +/** + * Rule for onifyApiRequest and onifyElevatedApiRequest + */ +module.exports = function () { + + function check(node, reporter) { + if (is(node, 'bpmn:ServiceTask')) { + const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector'); + + if (!connector || (connector.connectorId !== 'onifyApiRequest' && connector.connectorId !== 'onifyElevatedApiRequest')) { + return; + } + + const url = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'url'); + const payload = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'payload'); + const method = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'method'); + + if (!url) { + reporter.report(node.id, 'Connector input parameter `url` must be defined'); + } + + if (method && (method.value.toUpperCase() === 'POST' || method.value.toUpperCase() === 'PUT' || method.value.toUpperCase() === 'PATCH') && !payload) { + reporter.report(node.id, 'Connector input parameter `payload` must be defined when `method` is POST, PUT or PATCH'); + } + } + } + + return { + check: check + }; +}; diff --git a/bpmnlint-plugin-custom/rules/service-task.js b/bpmnlint-plugin-custom/rules/service-task.js index b75eb12..4c10e38 100644 --- a/bpmnlint-plugin-custom/rules/service-task.js +++ b/bpmnlint-plugin-custom/rules/service-task.js @@ -1,20 +1,13 @@ -const { - is -} = require('bpmnlint-utils'); - +const { is } = require('bpmnlint-utils'); +const { findElement } = require('../utils'); /** * Rule that reports missing Implementation on bpmn:ServiceTask. * Implementation only supports Connector - * Connector Id only supports our service tasks (eg. httpRequest, onifyApiRequest, etc) + * Connector Id only supports our service tasks (eg. httpRequest, onifyApiRequest, onifyElevatedApiRequest, etc) */ module.exports = function () { - function findElement(elements, name) { - if (!elements || !elements.length) return false; - return elements.find((element) => is(element, name)); - } - function check(node, reporter) { if (is(node, 'bpmn:ServiceTask')) { const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector'); @@ -31,27 +24,6 @@ module.exports = function () { if (connector.connectorId !== 'httpRequest' && connector.connectorId !== 'onifyApiRequest' && connector.connectorId !== 'onifyElevatedApiRequest') { return reporter.report(node.id, 'Connector Id only supports `httpRequest`, `onifyApiRequest` and `onifyElevatedApiRequest`'); } - - if (!connector.inputOutput || !connector.inputOutput.inputParameters) { - return reporter.report(node.id, 'Connector input parameters `url` and `responseType` must be defined'); - } - - const url = connector.inputOutput.inputParameters.find((input) => input.name === 'url'); - const responseType = connector.inputOutput.inputParameters.find((input) => input.name === 'responseType'); - const method = connector.inputOutput.inputParameters.find((input) => input.name === 'method'); - const json = connector.inputOutput.inputParameters.find((input) => input.name === 'json'); - - if (!url) { - return reporter.report(node.id, 'Connector input parameter `url` must be defined'); - } - - if (!responseType) { - return reporter.report(node.id, 'Connector input parameter `responseType` must be defined'); - } - - if (method && (method.value.toUpperCase() === 'POST' || method.value.toUpperCase() === 'PUT' || method.value.toUpperCase() === 'PATCH') && !json) { - return reporter.report(node.id, 'Connector input parameters `json` must be defined when `method` is POST, PUT or PATCH'); - } } } diff --git a/bpmnlint-plugin-custom/utils.js b/bpmnlint-plugin-custom/utils.js new file mode 100644 index 0000000..e65eece --- /dev/null +++ b/bpmnlint-plugin-custom/utils.js @@ -0,0 +1,12 @@ +const { + is +} = require('bpmnlint-utils'); + +module.exports = { + findElement, +}; + +function findElement(elements, name) { + if (!elements || !elements.length) return false; + return elements.find((element) => is(element, name)); +} diff --git a/dist/client.js b/dist/client.js index f12fe4d..3538018 100644 --- a/dist/client.js +++ b/dist/client.js @@ -1,15 +1,13 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ "./bpmnlint-plugin-custom/rules/script-task.js": -/*!*****************************************************!*\ - !*** ./bpmnlint-plugin-custom/rules/script-task.js ***! - \*****************************************************/ +/***/ "./bpmnlint-plugin-custom/rules/script-task-error.js": +/*!***********************************************************!*\ + !*** ./bpmnlint-plugin-custom/rules/script-task-error.js ***! + \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -const { - is -} = __webpack_require__(/*! bpmnlint-utils */ "./node_modules/bpmnlint-utils/dist/index.esm.js"); +const { is } = __webpack_require__(/*! bpmnlint-utils */ "./node_modules/bpmnlint-utils/dist/index.esm.js"); /** @@ -19,11 +17,17 @@ const { module.exports = function () { function check(node, reporter) { - if (is(node, 'bpmn:ScriptTask') && (!node.scriptFormat || (node.scriptFormat !== 'js' && node.scriptFormat !== 'javascript'))) { + if (is(node, 'bpmn:ScriptTask')) { if (!node.scriptFormat) { - reporter.report(node.id, 'Script format must be defined'); - } else { - reporter.report(node.id, 'Only `js`/`javascript` are supported script formats'); + return reporter.report(node.id, 'Script format must be defined'); + } + + if (node.scriptFormat !== 'js' && node.scriptFormat !== 'javascript') { + return reporter.report(node.id, 'Only `js/javascript` are supported script formats'); + } + + if (!node.script) { + reporter.report(node.id, 'Script must be defined'); } } } @@ -36,65 +40,194 @@ module.exports = function () { /***/ }), -/***/ "./bpmnlint-plugin-custom/rules/service-task.js": -/*!******************************************************!*\ - !*** ./bpmnlint-plugin-custom/rules/service-task.js ***! - \******************************************************/ +/***/ "./bpmnlint-plugin-custom/rules/script-task-warn.js": +/*!**********************************************************!*\ + !*** ./bpmnlint-plugin-custom/rules/script-task-warn.js ***! + \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -const { - is -} = __webpack_require__(/*! bpmnlint-utils */ "./node_modules/bpmnlint-utils/dist/index.esm.js"); +const { is } = __webpack_require__(/*! bpmnlint-utils */ "./node_modules/bpmnlint-utils/dist/index.esm.js"); /** - * Rule that reports missing Implementation on bpmn:ServiceTask. - * Implementation only supports Connector - * Connector Id only supports our service tasks (eg. httpRequest, onifyApiRequest, etc) + * Rule that reports missing Script format on bpmn:ScriptTask. + * Script format can supports js or javascript */ module.exports = function () { - function findElement(elements, name) { - if (!elements || !elements.length) return false; - return elements.find((element) => is(element, name)); + function check(node, reporter) { + if (is(node, 'bpmn:ScriptTask') && (node.scriptFormat === 'js' || node.scriptFormat === 'javascript')) { + if (node.script && !node.script.includes('next()')) { + reporter.report(node.id, 'next() functions does not exist'); + } + } } + return { + check: check + }; +}; + + +/***/ }), + +/***/ "./bpmnlint-plugin-custom/rules/service-task-httpRequest-error.js": +/*!************************************************************************!*\ + !*** ./bpmnlint-plugin-custom/rules/service-task-httpRequest-error.js ***! + \************************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const { is } = __webpack_require__(/*! bpmnlint-utils */ "./node_modules/bpmnlint-utils/dist/index.esm.js"); +const { findElement } = __webpack_require__(/*! ../utils */ "./bpmnlint-plugin-custom/utils.js"); + +/** + * Rule that reports missing responseType on bpmn:ServiceTask. + */ +module.exports = function () { + function check(node, reporter) { if (is(node, 'bpmn:ServiceTask')) { const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector'); - if (!node.extensionElements || !connector) { - reporter.report(node.id, 'Implementation must be defined'); - return reporter.report(node.id, 'Implementation only supports `Connector`'); + if (!connector || connector.connectorId !== 'httpRequest') { + return; } - if (!connector.connectorId) { - return reporter.report(node.id, 'Connector Id must be defined'); + const url = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'url'); + const json = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'json'); + const method = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'method'); + + if (!url) { + reporter.report(node.id, 'Connector input parameter `url` must be defined'); } - if (connector.connectorId !== 'httpRequest' && connector.connectorId !== 'onifyApiRequest' && connector.connectorId !== 'onifyElevatedApiRequest') { - return reporter.report(node.id, 'Connector Id only supports `httpRequest`, `onifyApiRequest` and `onifyElevatedApiRequest`'); + if (method && (method.value.toUpperCase() === 'POST' || method.value.toUpperCase() === 'PUT' || method.value.toUpperCase() === 'PATCH') && !json) { + reporter.report(node.id, 'Connector input parameter `json` must be defined when `method` is POST, PUT or PATCH'); + } + } + } + + return { + check: check + }; +}; + + +/***/ }), + +/***/ "./bpmnlint-plugin-custom/rules/service-task-httpRequest-warn.js": +/*!***********************************************************************!*\ + !*** ./bpmnlint-plugin-custom/rules/service-task-httpRequest-warn.js ***! + \***********************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const { is } = __webpack_require__(/*! bpmnlint-utils */ "./node_modules/bpmnlint-utils/dist/index.esm.js"); +const { findElement } = __webpack_require__(/*! ../utils */ "./bpmnlint-plugin-custom/utils.js"); + +/** + * Rule that reports missing responseType on bpmn:ServiceTask. + */ +module.exports = function () { + + function check(node, reporter) { + if (is(node, 'bpmn:ServiceTask')) { + const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector'); + + if (!connector || connector.connectorId !== 'httpRequest') { + return; } - if (!connector.inputOutput || !connector.inputOutput.inputParameters) { - return reporter.report(node.id, 'Connector input parameters `url` and `responseType` must be defined'); + const responseType = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'responseType'); + + if (!responseType) { + reporter.report(node.id, 'Connector input parameter `responseType` is not defined'); } + } + } + + return { + check: check + }; +}; - const url = connector.inputOutput.inputParameters.find((input) => input.name === 'url'); - const responseType = connector.inputOutput.inputParameters.find((input) => input.name === 'responseType'); - const method = connector.inputOutput.inputParameters.find((input) => input.name === 'method'); - const json = connector.inputOutput.inputParameters.find((input) => input.name === 'json'); + +/***/ }), + +/***/ "./bpmnlint-plugin-custom/rules/service-task-onifyApiRequest-error.js": +/*!****************************************************************************!*\ + !*** ./bpmnlint-plugin-custom/rules/service-task-onifyApiRequest-error.js ***! + \****************************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const { is } = __webpack_require__(/*! bpmnlint-utils */ "./node_modules/bpmnlint-utils/dist/index.esm.js"); +const { findElement } = __webpack_require__(/*! ../utils */ "./bpmnlint-plugin-custom/utils.js"); + +/** + * Rule for onifyApiRequest and onifyElevatedApiRequest + */ +module.exports = function () { + + function check(node, reporter) { + if (is(node, 'bpmn:ServiceTask')) { + const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector'); + + if (!connector || (connector.connectorId !== 'onifyApiRequest' && connector.connectorId !== 'onifyElevatedApiRequest')) { + return; + } + + const url = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'url'); + const payload = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'payload'); + const method = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'method'); if (!url) { - return reporter.report(node.id, 'Connector input parameter `url` must be defined'); + reporter.report(node.id, 'Connector input parameter `url` must be defined'); } - if (!responseType) { - return reporter.report(node.id, 'Connector input parameter `responseType` must be defined'); + if (method && (method.value.toUpperCase() === 'POST' || method.value.toUpperCase() === 'PUT' || method.value.toUpperCase() === 'PATCH') && !payload) { + reporter.report(node.id, 'Connector input parameter `payload` must be defined when `method` is POST, PUT or PATCH'); } + } + } - if (method && (method.value.toUpperCase() === 'POST' || method.value.toUpperCase() === 'PUT' || method.value.toUpperCase() === 'PATCH') && !json) { - return reporter.report(node.id, 'Connector input parameters `json` must be defined when `method` is POST, PUT or PATCH'); + return { + check: check + }; +}; + + +/***/ }), + +/***/ "./bpmnlint-plugin-custom/rules/service-task.js": +/*!******************************************************!*\ + !*** ./bpmnlint-plugin-custom/rules/service-task.js ***! + \******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const { is } = __webpack_require__(/*! bpmnlint-utils */ "./node_modules/bpmnlint-utils/dist/index.esm.js"); +const { findElement } = __webpack_require__(/*! ../utils */ "./bpmnlint-plugin-custom/utils.js"); + +/** + * Rule that reports missing Implementation on bpmn:ServiceTask. + * Implementation only supports Connector + * Connector Id only supports our service tasks (eg. httpRequest, onifyApiRequest, onifyElevatedApiRequest, etc) + */ +module.exports = function () { + + function check(node, reporter) { + if (is(node, 'bpmn:ServiceTask')) { + const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector'); + + if (!node.extensionElements || !connector) { + reporter.report(node.id, 'Implementation must be defined'); + return reporter.report(node.id, 'Implementation only supports `Connector`'); + } + + if (!connector.connectorId) { + return reporter.report(node.id, 'Connector Id must be defined'); + } + + if (connector.connectorId !== 'httpRequest' && connector.connectorId !== 'onifyApiRequest' && connector.connectorId !== 'onifyElevatedApiRequest') { + return reporter.report(node.id, 'Connector Id only supports `httpRequest`, `onifyApiRequest` and `onifyElevatedApiRequest`'); } } } @@ -105,6 +238,28 @@ module.exports = function () { }; +/***/ }), + +/***/ "./bpmnlint-plugin-custom/utils.js": +/*!*****************************************!*\ + !*** ./bpmnlint-plugin-custom/utils.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const { + is +} = __webpack_require__(/*! bpmnlint-utils */ "./node_modules/bpmnlint-utils/dist/index.esm.js"); + +module.exports = { + findElement, +}; + +function findElement(elements, name) { + if (!elements || !elements.length) return false; + return elements.find((element) => is(element, name)); +} + + /***/ }), /***/ "./node_modules/bpmn-js-bpmnlint/dist/index.esm.js": @@ -710,16 +865,22 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var bpmnlint_rules_sub_process_blank_start_event__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_rules_sub_process_blank_start_event__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var bpmnlint_rules_superfluous_gateway__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! bpmnlint/rules/superfluous-gateway */ "./node_modules/bpmnlint/rules/superfluous-gateway.js"); /* harmony import */ var bpmnlint_rules_superfluous_gateway__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_rules_superfluous_gateway__WEBPACK_IMPORTED_MODULE_16__); -/* harmony import */ var bpmnlint_plugin_camunda_rules_avoid_lanes__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! bpmnlint-plugin-camunda/rules/avoid-lanes */ "./node_modules/bpmnlint-plugin-camunda/rules/avoid-lanes.js"); -/* harmony import */ var bpmnlint_plugin_camunda_rules_avoid_lanes__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_camunda_rules_avoid_lanes__WEBPACK_IMPORTED_MODULE_17__); -/* harmony import */ var bpmnlint_plugin_camunda_rules_forking_conditions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! bpmnlint-plugin-camunda/rules/forking-conditions */ "./node_modules/bpmnlint-plugin-camunda/rules/forking-conditions.js"); -/* harmony import */ var bpmnlint_plugin_camunda_rules_forking_conditions__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_camunda_rules_forking_conditions__WEBPACK_IMPORTED_MODULE_18__); -/* harmony import */ var bpmnlint_plugin_camunda_rules_no_collapsed_sub_processes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! bpmnlint-plugin-camunda/rules/no-collapsed-sub-processes */ "./node_modules/bpmnlint-plugin-camunda/rules/no-collapsed-sub-processes.js"); -/* harmony import */ var bpmnlint_plugin_camunda_rules_no_collapsed_sub_processes__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_camunda_rules_no_collapsed_sub_processes__WEBPACK_IMPORTED_MODULE_19__); -/* harmony import */ var bpmnlint_plugin_custom_rules_script_task__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! bpmnlint-plugin-custom/rules/script-task */ "./bpmnlint-plugin-custom/rules/script-task.js"); -/* harmony import */ var bpmnlint_plugin_custom_rules_script_task__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_custom_rules_script_task__WEBPACK_IMPORTED_MODULE_20__); +/* harmony import */ var bpmnlint_plugin_camunda_rules_forking_conditions__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! bpmnlint-plugin-camunda/rules/forking-conditions */ "./node_modules/bpmnlint-plugin-camunda/rules/forking-conditions.js"); +/* harmony import */ var bpmnlint_plugin_camunda_rules_forking_conditions__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_camunda_rules_forking_conditions__WEBPACK_IMPORTED_MODULE_17__); +/* harmony import */ var bpmnlint_plugin_camunda_rules_no_collapsed_sub_processes__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! bpmnlint-plugin-camunda/rules/no-collapsed-sub-processes */ "./node_modules/bpmnlint-plugin-camunda/rules/no-collapsed-sub-processes.js"); +/* harmony import */ var bpmnlint_plugin_camunda_rules_no_collapsed_sub_processes__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_camunda_rules_no_collapsed_sub_processes__WEBPACK_IMPORTED_MODULE_18__); +/* harmony import */ var bpmnlint_plugin_custom_rules_script_task_error__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! bpmnlint-plugin-custom/rules/script-task-error */ "./bpmnlint-plugin-custom/rules/script-task-error.js"); +/* harmony import */ var bpmnlint_plugin_custom_rules_script_task_error__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_custom_rules_script_task_error__WEBPACK_IMPORTED_MODULE_19__); +/* harmony import */ var bpmnlint_plugin_custom_rules_script_task_warn__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! bpmnlint-plugin-custom/rules/script-task-warn */ "./bpmnlint-plugin-custom/rules/script-task-warn.js"); +/* harmony import */ var bpmnlint_plugin_custom_rules_script_task_warn__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_custom_rules_script_task_warn__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var bpmnlint_plugin_custom_rules_service_task__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! bpmnlint-plugin-custom/rules/service-task */ "./bpmnlint-plugin-custom/rules/service-task.js"); /* harmony import */ var bpmnlint_plugin_custom_rules_service_task__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_custom_rules_service_task__WEBPACK_IMPORTED_MODULE_21__); +/* harmony import */ var bpmnlint_plugin_custom_rules_service_task_httpRequest_error__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! bpmnlint-plugin-custom/rules/service-task-httpRequest-error */ "./bpmnlint-plugin-custom/rules/service-task-httpRequest-error.js"); +/* harmony import */ var bpmnlint_plugin_custom_rules_service_task_httpRequest_error__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_custom_rules_service_task_httpRequest_error__WEBPACK_IMPORTED_MODULE_22__); +/* harmony import */ var bpmnlint_plugin_custom_rules_service_task_httpRequest_warn__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! bpmnlint-plugin-custom/rules/service-task-httpRequest-warn */ "./bpmnlint-plugin-custom/rules/service-task-httpRequest-warn.js"); +/* harmony import */ var bpmnlint_plugin_custom_rules_service_task_httpRequest_warn__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_custom_rules_service_task_httpRequest_warn__WEBPACK_IMPORTED_MODULE_23__); +/* harmony import */ var bpmnlint_plugin_custom_rules_service_task_onifyApiRequest_error__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! bpmnlint-plugin-custom/rules/service-task-onifyApiRequest-error */ "./bpmnlint-plugin-custom/rules/service-task-onifyApiRequest-error.js"); +/* harmony import */ var bpmnlint_plugin_custom_rules_service_task_onifyApiRequest_error__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(bpmnlint_plugin_custom_rules_service_task_onifyApiRequest_error__WEBPACK_IMPORTED_MODULE_24__); const cache = {}; @@ -768,11 +929,14 @@ const rules = { "start-event-required": "error", "sub-process-blank-start-event": "error", "superfluous-gateway": "warning", - "camunda/avoid-lanes": "warn", "camunda/forking-conditions": "error", "camunda/no-collapsed-sub-processes": "error", - "custom/script-task": "error", - "custom/service-task": "error" + "custom/script-task-error": "error", + "custom/script-task-warn": "warn", + "custom/service-task": "error", + "custom/service-task-httpRequest-error": "error", + "custom/service-task-httpRequest-warn": "warn", + "custom/service-task-onifyApiRequest-error": "error" }; const config = { @@ -842,49 +1006,28 @@ cache['bpmnlint/sub-process-blank-start-event'] = (bpmnlint_rules_sub_process_bl cache['bpmnlint/superfluous-gateway'] = (bpmnlint_rules_superfluous_gateway__WEBPACK_IMPORTED_MODULE_16___default()); -cache['bpmnlint-plugin-camunda/avoid-lanes'] = (bpmnlint_plugin_camunda_rules_avoid_lanes__WEBPACK_IMPORTED_MODULE_17___default()); +cache['bpmnlint-plugin-camunda/forking-conditions'] = (bpmnlint_plugin_camunda_rules_forking_conditions__WEBPACK_IMPORTED_MODULE_17___default()); -cache['bpmnlint-plugin-camunda/forking-conditions'] = (bpmnlint_plugin_camunda_rules_forking_conditions__WEBPACK_IMPORTED_MODULE_18___default()); +cache['bpmnlint-plugin-camunda/no-collapsed-sub-processes'] = (bpmnlint_plugin_camunda_rules_no_collapsed_sub_processes__WEBPACK_IMPORTED_MODULE_18___default()); -cache['bpmnlint-plugin-camunda/no-collapsed-sub-processes'] = (bpmnlint_plugin_camunda_rules_no_collapsed_sub_processes__WEBPACK_IMPORTED_MODULE_19___default()); +cache['bpmnlint-plugin-custom/script-task-error'] = (bpmnlint_plugin_custom_rules_script_task_error__WEBPACK_IMPORTED_MODULE_19___default()); -cache['bpmnlint-plugin-custom/script-task'] = (bpmnlint_plugin_custom_rules_script_task__WEBPACK_IMPORTED_MODULE_20___default()); +cache['bpmnlint-plugin-custom/script-task-warn'] = (bpmnlint_plugin_custom_rules_script_task_warn__WEBPACK_IMPORTED_MODULE_20___default()); cache['bpmnlint-plugin-custom/service-task'] = (bpmnlint_plugin_custom_rules_service_task__WEBPACK_IMPORTED_MODULE_21___default()); -/***/ }), -/***/ "./node_modules/bpmnlint-plugin-camunda/rules/avoid-lanes.js": -/*!*******************************************************************!*\ - !*** ./node_modules/bpmnlint-plugin-camunda/rules/avoid-lanes.js ***! - \*******************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +cache['bpmnlint-plugin-custom/service-task-httpRequest-error'] = (bpmnlint_plugin_custom_rules_service_task_httpRequest_error__WEBPACK_IMPORTED_MODULE_22___default()); -const { - is -} = __webpack_require__(/*! bpmnlint-utils */ "./node_modules/bpmnlint-utils/dist/index.esm.js"); +cache['bpmnlint-plugin-custom/service-task-httpRequest-warn'] = (bpmnlint_plugin_custom_rules_service_task_httpRequest_warn__WEBPACK_IMPORTED_MODULE_23___default()); -/** - * Rule that reports the usage of lanes. - */ -module.exports = function() { - - function check(node, reporter) { - if (is(node, 'bpmn:Lane')) { - reporter.report(node.id, 'lanes should be avoided'); - } - } - - return { - check: check - }; -}; +cache['bpmnlint-plugin-custom/service-task-onifyApiRequest-error'] = (bpmnlint_plugin_custom_rules_service_task_onifyApiRequest_error__WEBPACK_IMPORTED_MODULE_24___default()); /***/ }), diff --git a/dist/client.js.map b/dist/client.js.map index 764154c..0718d8e 100644 --- a/dist/client.js.map +++ b/dist/client.js.map @@ -1 +1 @@ -{"version":3,"file":"client.js","mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACtIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AClcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC/HA;AACA;AACA;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACjDA;AACA;AACA;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AC7pBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACjgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://onify-camunda-modeler-plugin/./bpmnlint-plugin-custom/rules/script-task.js","webpack://onify-camunda-modeler-plugin/./bpmnlint-plugin-custom/rules/service-task.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmn-js-bpmnlint/dist/index.esm.js","webpack://onify-camunda-modeler-plugin/./.bpmnlintrc","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint-plugin-camunda/rules/avoid-lanes.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint-plugin-camunda/rules/forking-conditions.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint-plugin-camunda/rules/no-collapsed-sub-processes.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint-utils/dist/index.esm.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/lib/index.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/lib/linter.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/lib/test-rule.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/lib/traverse.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/conditional-flows.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/end-event-required.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/event-sub-process-typed-start-event.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/fake-join.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/helper.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/label-required.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-bpmndi.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-complex-gateway.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-disconnected.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-duplicate-sequence-flows.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-gateway-join-fork.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-implicit-split.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-inclusive-gateway.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/single-blank-start-event.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/single-event-definition.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/start-event-required.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/sub-process-blank-start-event.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/superfluous-gateway.js","webpack://onify-camunda-modeler-plugin/./node_modules/camunda-modeler-plugin-helpers/index.js","webpack://onify-camunda-modeler-plugin/./node_modules/css.escape/css.escape.js","webpack://onify-camunda-modeler-plugin/./node_modules/diagram-js/lib/util/EscapeUtil.js","webpack://onify-camunda-modeler-plugin/./node_modules/min-dash/dist/index.esm.js","webpack://onify-camunda-modeler-plugin/./node_modules/min-dom/dist/index.esm.js","webpack://onify-camunda-modeler-plugin/webpack/bootstrap","webpack://onify-camunda-modeler-plugin/webpack/runtime/compat get default export","webpack://onify-camunda-modeler-plugin/webpack/runtime/define property getters","webpack://onify-camunda-modeler-plugin/webpack/runtime/global","webpack://onify-camunda-modeler-plugin/webpack/runtime/hasOwnProperty shorthand","webpack://onify-camunda-modeler-plugin/webpack/runtime/make namespace object","webpack://onify-camunda-modeler-plugin/./client/index.js"],"sourcesContent":["const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * Rule that reports missing Script format on bpmn:ScriptTask.\n * Script format can supports js or javascript\n */\nmodule.exports = function () {\n\n function check(node, reporter) {\n if (is(node, 'bpmn:ScriptTask') && (!node.scriptFormat || (node.scriptFormat !== 'js' && node.scriptFormat !== 'javascript'))) {\n if (!node.scriptFormat) {\n reporter.report(node.id, 'Script format must be defined');\n } else {\n reporter.report(node.id, 'Only `js`/`javascript` are supported script formats');\n }\n }\n }\n\n return {\n check: check\n };\n};\n","const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * Rule that reports missing Implementation on bpmn:ServiceTask.\n * Implementation only supports Connector\n * Connector Id only supports our service tasks (eg. httpRequest, onifyApiRequest, etc)\n */\nmodule.exports = function () {\n\n function findElement(elements, name) {\n if (!elements || !elements.length) return false;\n return elements.find((element) => is(element, name));\n }\n\n function check(node, reporter) {\n if (is(node, 'bpmn:ServiceTask')) {\n const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector');\n\n if (!node.extensionElements || !connector) {\n reporter.report(node.id, 'Implementation must be defined');\n return reporter.report(node.id, 'Implementation only supports `Connector`');\n }\n\n if (!connector.connectorId) {\n return reporter.report(node.id, 'Connector Id must be defined');\n }\n\n if (connector.connectorId !== 'httpRequest' && connector.connectorId !== 'onifyApiRequest' && connector.connectorId !== 'onifyElevatedApiRequest') {\n return reporter.report(node.id, 'Connector Id only supports `httpRequest`, `onifyApiRequest` and `onifyElevatedApiRequest`');\n }\n\n if (!connector.inputOutput || !connector.inputOutput.inputParameters) {\n return reporter.report(node.id, 'Connector input parameters `url` and `responseType` must be defined');\n }\n\n const url = connector.inputOutput.inputParameters.find((input) => input.name === 'url');\n const responseType = connector.inputOutput.inputParameters.find((input) => input.name === 'responseType');\n const method = connector.inputOutput.inputParameters.find((input) => input.name === 'method');\n const json = connector.inputOutput.inputParameters.find((input) => input.name === 'json');\n\n if (!url) {\n return reporter.report(node.id, 'Connector input parameter `url` must be defined');\n }\n\n if (!responseType) {\n return reporter.report(node.id, 'Connector input parameter `responseType` must be defined');\n }\n\n if (method && (method.value.toUpperCase() === 'POST' || method.value.toUpperCase() === 'PUT' || method.value.toUpperCase() === 'PATCH') && !json) {\n return reporter.report(node.id, 'Connector input parameters `json` must be defined when `method` is POST, PUT or PATCH');\n }\n }\n }\n\n return {\n check: check\n };\n};\n","import { Linter } from 'bpmnlint';\nimport { reduce, map, groupBy, assign } from 'min-dash';\nimport { domify } from 'min-dom';\nimport { escapeHTML } from 'diagram-js/lib/util/EscapeUtil';\n\nfunction EditorActions(injector, linting) {\n var editorActions = injector.get('editorActions', false);\n\n editorActions && editorActions.register({\n toggleLinting: function() {\n linting.toggle();\n }\n });\n}\n\nEditorActions.$inject = [\n 'injector',\n 'linting'\n];\n\nvar ErrorSvg = \"\";\n\nvar WarningSvg = \"\";\n\nvar SuccessSvg = \"\";\n\nvar OFFSET_TOP = -7,\r\n OFFSET_RIGHT = -7;\r\n\r\nvar LOW_PRIORITY = 500;\r\n\r\nvar emptyConfig = {\r\n resolver: {\r\n resolveRule: function() {\r\n return null;\r\n }\r\n },\r\n config: {}\r\n};\r\n\r\nvar stateToIcon = {\r\n error: ErrorSvg,\r\n warning: WarningSvg,\r\n success: SuccessSvg,\r\n inactive: SuccessSvg\r\n};\r\n\r\nfunction Linting(\r\n bpmnjs,\r\n canvas,\r\n config,\r\n elementRegistry,\r\n eventBus,\r\n overlays,\r\n translate\r\n) {\r\n this._bpmnjs = bpmnjs;\r\n this._canvas = canvas;\r\n this._elementRegistry = elementRegistry;\r\n this._eventBus = eventBus;\r\n this._overlays = overlays;\r\n this._translate = translate;\r\n\r\n this._issues = {};\r\n\r\n this._active = config && config.active || false;\r\n this._linterConfig = emptyConfig;\r\n\r\n this._overlayIds = {};\r\n\r\n var self = this;\r\n\r\n eventBus.on([\r\n 'import.done',\r\n 'elements.changed',\r\n 'linting.configChanged',\r\n 'linting.toggle'\r\n ], LOW_PRIORITY, function(e) {\r\n if (self.isActive()) {\r\n self.update();\r\n }\r\n });\r\n\r\n eventBus.on('linting.toggle', function(event) {\r\n\r\n const active = event.active;\r\n\r\n if (!active) {\r\n self._clearIssues();\r\n self._updateButton();\r\n }\r\n });\r\n\r\n eventBus.on('diagram.clear', function() {\r\n self._clearIssues();\r\n });\r\n\r\n var linterConfig = config && config.bpmnlint;\r\n\r\n linterConfig && eventBus.once('diagram.init', function() {\r\n\r\n // bail out if config was already provided\r\n // during initialization of other modules\r\n if (self.getLinterConfig() !== emptyConfig) {\r\n return;\r\n }\r\n\r\n try {\r\n self.setLinterConfig(linterConfig);\r\n } catch (err) {\r\n console.error(\r\n '[bpmn-js-bpmnlint] Invalid lint rules configured. ' +\r\n 'Please doublecheck your linting.bpmnlint configuration, ' +\r\n 'cf. https://github.com/bpmn-io/bpmn-js-bpmnlint#configure-lint-rules'\r\n );\r\n }\r\n });\r\n\r\n this._init();\r\n}\r\n\r\nLinting.prototype.setLinterConfig = function(linterConfig) {\r\n\r\n if (!linterConfig.config || !linterConfig.resolver) {\r\n throw new Error('Expected linterConfig = { config, resolver }');\r\n }\r\n\r\n this._linterConfig = linterConfig;\r\n\r\n this._eventBus.fire('linting.configChanged');\r\n};\r\n\r\nLinting.prototype.getLinterConfig = function() {\r\n return this._linterConfig;\r\n};\r\n\r\nLinting.prototype._init = function() {\r\n this._createButton();\r\n\r\n this._updateButton();\r\n};\r\n\r\nLinting.prototype.isActive = function() {\r\n return this._active;\r\n};\r\n\r\nLinting.prototype._formatIssues = function(issues) {\r\n\r\n let self = this;\r\n\r\n // (1) reduce issues to flat list of issues including the affected element\r\n let reports = reduce(issues, function(reports, ruleReports, rule) {\r\n\r\n return reports.concat(ruleReports.map(function(report) {\r\n report.rule = rule;\r\n\r\n return report;\r\n }));\r\n\r\n }, []);\r\n\r\n // (2) if affected element is not visible, then report it on root level\r\n reports = map(reports, function(report) {\r\n const element = self._elementRegistry.get(report.id);\r\n\r\n if (!element) {\r\n report.isChildIssue = true;\r\n report.actualElementId = report.id;\r\n\r\n report.id = self._canvas.getRootElement().id;\r\n }\r\n\r\n return report;\r\n });\r\n\r\n // (3) group issues per elementId (resulting in ie. [elementId1: [{issue1}, {issue2}]] structure)\r\n reports = groupBy(reports, function(report) {\r\n return report.id;\r\n });\r\n\r\n return reports;\r\n};\r\n\r\n/**\r\n * Toggle linting on or off.\r\n *\r\n * @param {boolean} [newActive]\r\n *\r\n * @return {boolean} the new active state\r\n */\r\nLinting.prototype.toggle = function(newActive) {\r\n\r\n newActive = typeof newActive === 'undefined' ? !this.isActive() : newActive;\r\n\r\n this._setActive(newActive);\r\n\r\n return newActive;\r\n};\r\n\r\nLinting.prototype._setActive = function(active) {\r\n\r\n if (this._active === active) {\r\n return;\r\n }\r\n\r\n this._active = active;\r\n\r\n this._eventBus.fire('linting.toggle', { active: active });\r\n};\r\n\r\n/**\r\n * Update overlays. Always lint and check wether overlays need update or not.\r\n */\r\nLinting.prototype.update = function() {\r\n var self = this;\r\n\r\n var definitions = this._bpmnjs.getDefinitions();\r\n\r\n if (!definitions) {\r\n return;\r\n }\r\n\r\n var lintStart = this._lintStart = Math.random();\r\n\r\n this.lint().then(function(newIssues) {\r\n\r\n if (self._lintStart !== lintStart) {\r\n return;\r\n }\r\n\r\n newIssues = self._formatIssues(newIssues);\r\n\r\n var remove = {},\r\n update = {},\r\n add = {};\r\n\r\n for (var id1 in self._issues) {\r\n if (!newIssues[id1]) {\r\n remove[id1] = self._issues[id1];\r\n }\r\n }\r\n\r\n for (var id2 in newIssues) {\r\n if (!self._issues[id2]) {\r\n add[id2] = newIssues[id2];\r\n } else {\r\n if (newIssues[id2] !== self._issues[id2]) {\r\n update[id2] = newIssues[id2];\r\n }\r\n }\r\n }\r\n\r\n remove = assign(remove, update);\r\n add = assign(add, update);\r\n\r\n self._clearOverlays();\r\n self._createIssues(add);\r\n\r\n self._issues = newIssues;\r\n\r\n self._updateButton();\r\n\r\n self._fireComplete(newIssues);\r\n });\r\n};\r\n\r\nLinting.prototype._fireComplete = function(issues) {\r\n this._eventBus.fire('linting.completed', { issues: issues });\r\n};\r\n\r\nLinting.prototype._createIssues = function(issues) {\r\n for (var id in issues) {\r\n this._createElementIssues(id, issues[id]);\r\n }\r\n};\r\n\r\n/**\r\n * Create overlay including all issues which are given for a single element.\r\n *\r\n * @param {string} elementId - id of element, for which the issue shall be displayed.\r\n * @param {Array} elementIssues - All element issues including warnings and errors.\r\n */\r\nLinting.prototype._createElementIssues = function(elementId, elementIssues) {\r\n var element = this._elementRegistry.get(elementId);\r\n\r\n if (!element) {\r\n return;\r\n }\r\n\r\n var menuPosition;\r\n var position;\r\n\r\n if (element === this._canvas.getRootElement()) {\r\n menuPosition = 'bottom-right';\r\n\r\n position = {\r\n top: 20,\r\n left: 150\r\n };\r\n } else {\r\n menuPosition = 'top-right';\r\n\r\n position = {\r\n top: OFFSET_TOP,\r\n left: OFFSET_RIGHT\r\n };\r\n }\r\n\r\n var issuesByType = groupBy(elementIssues, function(elementIssue) {\r\n return (elementIssue.isChildIssue ? 'child' : '') + elementIssue.category;\r\n });\r\n\r\n var errors = issuesByType.error,\r\n warnings = issuesByType.warn,\r\n childErrors = issuesByType.childerror,\r\n childWarnings = issuesByType.childwarning;\r\n\r\n if (!errors && !warnings && !childErrors && !childWarnings) {\r\n return;\r\n }\r\n\r\n var $html = domify(\r\n '
'\r\n );\r\n\r\n var $icon = (errors || childErrors)\r\n ? domify('
' + ErrorSvg + '
')\r\n : domify('
' + WarningSvg + '
');\r\n\r\n var $dropdown = domify('
');\r\n var $dropdownContent = domify('
');\r\n\r\n var $issueContainer = domify('
');\r\n\r\n var $issues = domify('
');\r\n var $issueList = domify('');\r\n\r\n $html.appendChild($icon);\r\n $html.appendChild($dropdown);\r\n\r\n $dropdown.appendChild($dropdownContent);\r\n $dropdownContent.appendChild($issueContainer);\r\n\r\n $issueContainer.appendChild($issues);\r\n\r\n $issues.appendChild($issueList);\r\n\r\n // Add errors and warnings to issueList\r\n if (errors) {\r\n this._addErrors($issueList, errors);\r\n }\r\n\r\n if (warnings) {\r\n this._addWarnings($issueList, warnings);\r\n }\r\n\r\n // If errors or warnings for child elements of the current element are to be displayed,\r\n // then add an additional list\r\n if (childErrors || childWarnings) {\r\n var $childIssues = domify('
');\r\n var $childIssueList = domify('');\r\n var $childIssueLabel = domify('Issues for child elements:');\r\n\r\n if (childErrors) {\r\n this._addErrors($childIssueList, childErrors);\r\n }\r\n\r\n if (childWarnings) {\r\n this._addWarnings($childIssueList, childWarnings);\r\n }\r\n\r\n if (errors || warnings) {\r\n var $childIssuesSeperator = domify('
');\r\n $childIssues.appendChild($childIssuesSeperator);\r\n }\r\n\r\n $childIssues.appendChild($childIssueLabel);\r\n $childIssues.appendChild($childIssueList);\r\n $issueContainer.appendChild($childIssues);\r\n }\r\n\r\n this._overlayIds[elementId] = this._overlays.add(element, 'linting', {\r\n position: position,\r\n html: $html,\r\n scale: {\r\n min: .9\r\n }\r\n });\r\n};\r\n\r\nLinting.prototype._addErrors = function($ul, errors) {\r\n\r\n var self = this;\r\n\r\n errors.forEach(function(error) {\r\n self._addEntry($ul, 'error', error);\r\n });\r\n};\r\n\r\nLinting.prototype._addWarnings = function($ul, warnings) {\r\n\r\n var self = this;\r\n\r\n warnings.forEach(function(error) {\r\n self._addEntry($ul, 'warning', error);\r\n });\r\n};\r\n\r\nLinting.prototype._addEntry = function($ul, state, entry) {\r\n\r\n var rule = entry.rule,\r\n message = this._translate(entry.message),\r\n actualElementId = entry.actualElementId;\r\n\r\n var icon = stateToIcon[state];\r\n\r\n var $entry = domify(\r\n '
  • ' +\r\n ' ' + icon + '' +\r\n '' +\r\n escapeHTML(message) +\r\n '' +\r\n (actualElementId\r\n ? '' + actualElementId + ''\r\n : '') +\r\n '
  • '\r\n );\r\n\r\n $ul.appendChild($entry);\r\n};\r\n\r\nLinting.prototype._clearOverlays = function() {\r\n this._overlays.remove({ type: 'linting' });\r\n\r\n this._overlayIds = {};\r\n};\r\n\r\nLinting.prototype._clearIssues = function() {\r\n this._issues = {};\r\n\r\n this._clearOverlays();\r\n};\r\n\r\nLinting.prototype._setButtonState = function(state, errors, warnings) {\r\n var button = this._button;\r\n\r\n var icon = stateToIcon[state];\r\n\r\n var html = icon + '' + this._translate('{errors} Errors, {warnings} Warnings', { errors: errors.toString(), warnings: warnings.toString() }) + '';\r\n\r\n [\r\n 'error',\r\n 'inactive',\r\n 'success',\r\n 'warning'\r\n ].forEach(function(s) {\r\n if (state === s) {\r\n button.classList.add('bjsl-button-' + s);\r\n } else {\r\n button.classList.remove('bjsl-button-' + s);\r\n }\r\n });\r\n\r\n button.innerHTML = html;\r\n};\r\n\r\nLinting.prototype._updateButton = function() {\r\n\r\n if (!this.isActive()) {\r\n this._setButtonState('inactive', 0, 0);\r\n\r\n return;\r\n }\r\n\r\n var errors = 0,\r\n warnings = 0;\r\n\r\n for (var id in this._issues) {\r\n this._issues[id].forEach(function(issue) {\r\n if (issue.category === 'error') {\r\n errors++;\r\n } else if (issue.category === 'warn') {\r\n warnings++;\r\n }\r\n });\r\n }\r\n\r\n var state = (errors && 'error') || (warnings && 'warning') || 'success';\r\n\r\n this._setButtonState(state, errors, warnings);\r\n};\r\n\r\nLinting.prototype._createButton = function() {\r\n\r\n var self = this;\r\n\r\n this._button = domify(\r\n ''\r\n );\r\n\r\n this._button.addEventListener('click', function() {\r\n self.toggle();\r\n });\r\n\r\n this._canvas.getContainer().appendChild(this._button);\r\n};\r\n\r\nLinting.prototype.lint = function() {\r\n var definitions = this._bpmnjs.getDefinitions();\r\n\r\n var linter = new Linter(this._linterConfig);\r\n\r\n return linter.lint(definitions);\r\n};\r\n\r\nLinting.$inject = [\r\n 'bpmnjs',\r\n 'canvas',\r\n 'config.linting',\r\n 'elementRegistry',\r\n 'eventBus',\r\n 'overlays',\r\n 'translate'\r\n];\n\nvar index = {\r\n __init__: [ 'linting', 'lintingEditorActions' ],\r\n linting: [ 'type', Linting ],\r\n lintingEditorActions: ['type', EditorActions ]\r\n};\n\nexport default index;\n//# sourceMappingURL=index.esm.js.map\n","\nconst cache = {};\n\n/**\n * A resolver that caches rules and configuration as part of the bundle,\n * making them accessible in the browser.\n *\n * @param {Object} cache\n */\nfunction Resolver() {}\n\nResolver.prototype.resolveRule = function(pkg, ruleName) {\n\n const rule = cache[pkg + '/' + ruleName];\n\n if (!rule) {\n throw new Error('cannot resolve rule <' + pkg + '/' + ruleName + '>');\n }\n\n return rule;\n};\n\nResolver.prototype.resolveConfig = function(pkg, configName) {\n throw new Error(\n 'cannot resolve config <' + configName + '> in <' + pkg +'>'\n );\n};\n\nconst resolver = new Resolver();\n\nconst rules = {\n \"conditional-flows\": \"error\",\n \"end-event-required\": \"error\",\n \"event-sub-process-typed-start-event\": \"error\",\n \"fake-join\": \"warn\",\n \"label-required\": \"on\",\n \"no-bpmndi\": \"error\",\n \"no-complex-gateway\": \"error\",\n \"no-disconnected\": \"error\",\n \"no-duplicate-sequence-flows\": \"error\",\n \"no-gateway-join-fork\": \"error\",\n \"no-implicit-split\": \"error\",\n \"no-inclusive-gateway\": \"error\",\n \"single-blank-start-event\": \"error\",\n \"single-event-definition\": \"error\",\n \"start-event-required\": \"error\",\n \"sub-process-blank-start-event\": \"error\",\n \"superfluous-gateway\": \"warning\",\n \"camunda/avoid-lanes\": \"warn\",\n \"camunda/forking-conditions\": \"error\",\n \"camunda/no-collapsed-sub-processes\": \"error\",\n \"custom/script-task\": \"error\",\n \"custom/service-task\": \"error\"\n};\n\nconst config = {\n rules: rules\n};\n\nconst bundle = {\n resolver: resolver,\n config: config\n};\n\nexport { resolver, config };\n\nexport default bundle;\n\n\n\nimport rule_0 from 'bpmnlint/rules/conditional-flows';\ncache['bpmnlint/conditional-flows'] = rule_0;\n\nimport rule_1 from 'bpmnlint/rules/end-event-required';\ncache['bpmnlint/end-event-required'] = rule_1;\n\nimport rule_2 from 'bpmnlint/rules/event-sub-process-typed-start-event';\ncache['bpmnlint/event-sub-process-typed-start-event'] = rule_2;\n\nimport rule_3 from 'bpmnlint/rules/fake-join';\ncache['bpmnlint/fake-join'] = rule_3;\n\nimport rule_4 from 'bpmnlint/rules/label-required';\ncache['bpmnlint/label-required'] = rule_4;\n\nimport rule_5 from 'bpmnlint/rules/no-bpmndi';\ncache['bpmnlint/no-bpmndi'] = rule_5;\n\nimport rule_6 from 'bpmnlint/rules/no-complex-gateway';\ncache['bpmnlint/no-complex-gateway'] = rule_6;\n\nimport rule_7 from 'bpmnlint/rules/no-disconnected';\ncache['bpmnlint/no-disconnected'] = rule_7;\n\nimport rule_8 from 'bpmnlint/rules/no-duplicate-sequence-flows';\ncache['bpmnlint/no-duplicate-sequence-flows'] = rule_8;\n\nimport rule_9 from 'bpmnlint/rules/no-gateway-join-fork';\ncache['bpmnlint/no-gateway-join-fork'] = rule_9;\n\nimport rule_10 from 'bpmnlint/rules/no-implicit-split';\ncache['bpmnlint/no-implicit-split'] = rule_10;\n\nimport rule_11 from 'bpmnlint/rules/no-inclusive-gateway';\ncache['bpmnlint/no-inclusive-gateway'] = rule_11;\n\nimport rule_12 from 'bpmnlint/rules/single-blank-start-event';\ncache['bpmnlint/single-blank-start-event'] = rule_12;\n\nimport rule_13 from 'bpmnlint/rules/single-event-definition';\ncache['bpmnlint/single-event-definition'] = rule_13;\n\nimport rule_14 from 'bpmnlint/rules/start-event-required';\ncache['bpmnlint/start-event-required'] = rule_14;\n\nimport rule_15 from 'bpmnlint/rules/sub-process-blank-start-event';\ncache['bpmnlint/sub-process-blank-start-event'] = rule_15;\n\nimport rule_16 from 'bpmnlint/rules/superfluous-gateway';\ncache['bpmnlint/superfluous-gateway'] = rule_16;\n\nimport rule_17 from 'bpmnlint-plugin-camunda/rules/avoid-lanes';\ncache['bpmnlint-plugin-camunda/avoid-lanes'] = rule_17;\n\nimport rule_18 from 'bpmnlint-plugin-camunda/rules/forking-conditions';\ncache['bpmnlint-plugin-camunda/forking-conditions'] = rule_18;\n\nimport rule_19 from 'bpmnlint-plugin-camunda/rules/no-collapsed-sub-processes';\ncache['bpmnlint-plugin-camunda/no-collapsed-sub-processes'] = rule_19;\n\nimport rule_20 from 'bpmnlint-plugin-custom/rules/script-task';\ncache['bpmnlint-plugin-custom/script-task'] = rule_20;\n\nimport rule_21 from 'bpmnlint-plugin-custom/rules/service-task';\ncache['bpmnlint-plugin-custom/service-task'] = rule_21;","const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * Rule that reports the usage of lanes.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n if (is(node, 'bpmn:Lane')) {\n reporter.report(node.id, 'lanes should be avoided');\n }\n }\n\n return {\n check: check\n };\n};\n","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * A rule that checks that sequence flows after\n * an exclusive forking gateway have conditions\n * attached.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n const outgoing = node.outgoing || [];\n\n if (!is(node, 'bpmn:ExclusiveGateway') || outgoing.length < 2) {\n return;\n }\n\n outgoing.forEach((flow) => {\n const missingCondition = (\n !hasCondition(flow) &&\n !isDefaultFlow(node, flow)\n );\n\n if (missingCondition) {\n reporter.report(flow.id, 'Sequence flow is missing condition');\n }\n });\n }\n\n return {\n check\n };\n\n};\n\n\n// helpers /////////////////////////////\n\nfunction hasCondition(flow) {\n return !!flow.conditionExpression;\n}\n\nfunction isDefaultFlow(node, flow) {\n return node['default'] === flow;\n}","const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * Rule that reports the usage of collapsed sub-processes.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n if (is(node, 'bpmndi:BPMNShape')) {\n\n const bpmnElement = node.bpmnElement;\n\n if (is(bpmnElement, 'bpmn:SubProcess') && !node.isExpanded) {\n reporter.report(bpmnElement.id, 'Sub-process should be expanded');\n }\n }\n }\n\n return {\n check: check\n };\n};\n","/**\n * Checks whether node is of specific bpmn type.\n *\n * @param {ModdleElement} node\n * @param {String} type\n *\n * @return {Boolean}\n */\nfunction is(node, type) {\n\n if (type.indexOf(':') === -1) {\n type = 'bpmn:' + type;\n }\n\n return (\n (typeof node.$instanceOf === 'function')\n ? node.$instanceOf(type)\n : node.$type === type\n );\n}\n\n/**\n * Checks whether node has any of the specified types.\n *\n * @param {ModdleElement} node\n * @param {Array} types\n *\n * @return {Boolean}\n */\nfunction isAny(node, types) {\n return types.some(function(type) {\n return is(node, type);\n });\n}\n\nexport { is, isAny };\n//# sourceMappingURL=index.esm.js.map\n","const Linter = require('./linter');\n\nmodule.exports = {\n Linter\n};","const testRule = require('./test-rule');\n\nconst categoryMap = {\n 0: 'off',\n 1: 'warn',\n 2: 'error'\n};\n\n\nfunction Linter(options = {}) {\n\n const {\n config,\n resolver\n } = options;\n\n if (typeof resolver === 'undefined') {\n throw new Error('must provide ');\n }\n\n this.config = config;\n this.resolver = resolver;\n\n this.cachedRules = {};\n this.cachedConfigs = {};\n}\n\n\nmodule.exports = Linter;\n\n/**\n * Applies a rule on the moddleRoot and adds reports to the finalReport\n *\n * @param {ModdleElement} moddleRoot\n *\n * @param {Object} ruleDefinition.name\n * @param {Object} ruleDefinition.config\n * @param {Object} ruleDefinition.category\n * @param {Rule} ruleDefinition.rule\n *\n * @return {Array} rule reports\n */\nLinter.prototype.applyRule = function applyRule(moddleRoot, ruleDefinition) {\n\n const {\n config,\n rule,\n category,\n name\n } = ruleDefinition;\n\n try {\n\n const reports = testRule({\n moddleRoot,\n rule,\n config\n });\n\n return reports.map(function(report) {\n return {\n ...report,\n category\n };\n });\n } catch (e) {\n console.error('rule <' + name + '> failed with error: ', e);\n\n return [\n {\n message: 'Rule error: ' + e.message,\n category: 'error'\n }\n ];\n }\n\n};\n\n\nLinter.prototype.resolveRule = function(name) {\n\n const {\n pkg,\n ruleName\n } = this.parseRuleName(name);\n\n const id = `${pkg}-${ruleName}`;\n\n const rule = this.cachedRules[id];\n\n if (rule) {\n return Promise.resolve(rule);\n }\n\n return Promise.resolve(this.resolver.resolveRule(pkg, ruleName)).then((ruleFactory) => {\n\n if (!ruleFactory) {\n throw new Error(`unknown rule <${name}>`);\n }\n\n const rule = this.cachedRules[id] = ruleFactory();\n\n return rule;\n });\n};\n\nLinter.prototype.resolveConfig = function(name) {\n\n const {\n pkg,\n configName\n } = this.parseConfigName(name);\n\n const id = `${pkg}-${configName}`;\n\n const config = this.cachedConfigs[id];\n\n if (config) {\n return Promise.resolve(config);\n }\n\n return Promise.resolve(this.resolver.resolveConfig(pkg, configName)).then((config) => {\n\n if (!config) {\n throw new Error(`unknown config <${name}>`);\n }\n\n const actualConfig = this.cachedConfigs[id] = this.normalizeConfig(config, pkg);\n\n return actualConfig;\n });\n};\n\n/**\n * Take a linter config and return list of resolved rules.\n *\n * @param {Object} config\n *\n * @return {Array}\n */\nLinter.prototype.resolveRules = function(config) {\n\n return this.resolveConfiguredRules(config).then((rulesConfig) => {\n\n // parse rule values\n const parsedRules = Object.entries(rulesConfig).map(([ name, value ]) => {\n const {\n category,\n config\n } = this.parseRuleValue(value);\n\n return {\n name,\n category,\n config\n };\n });\n\n // filter only for enabled rules\n const enabledRules = parsedRules.filter(definition => definition.category !== 'off');\n\n // load enabled rules\n const loaders = enabledRules.map((definition) => {\n\n const {\n name\n } = definition;\n\n return this.resolveRule(name).then(function(rule) {\n return {\n ...definition,\n rule\n };\n });\n });\n\n return Promise.all(loaders);\n });\n};\n\n\nLinter.prototype.resolveConfiguredRules = function(config) {\n\n let parents = config.extends;\n\n if (typeof parents === 'string') {\n parents = [ parents ];\n }\n\n if (typeof parents === 'undefined') {\n parents = [];\n }\n\n return Promise.all(\n parents.map((configName) => {\n return this.resolveConfig(configName).then((config) => {\n return this.resolveConfiguredRules(config);\n });\n })\n ).then((inheritedRules) => {\n\n const overrideRules = this.normalizeConfig(config, 'bpmnlint').rules;\n\n const rules = [ ...inheritedRules, overrideRules ].reduce((rules, currentRules) => {\n return {\n ...rules,\n ...currentRules\n };\n }, {});\n\n return rules;\n });\n};\n\n\n/**\n * Lint the given model root, using the specified linter config.\n *\n * @param {ModdleElement} moddleRoot\n * @param {Object} [config] the bpmnlint configuration to use\n *\n * @return {Object} lint results, keyed by category names\n */\nLinter.prototype.lint = function(moddleRoot, config) {\n\n config = config || this.config;\n\n // load rules\n return this.resolveRules(config).then((ruleDefinitions) => {\n\n const allReports = {};\n\n ruleDefinitions.forEach((ruleDefinition) => {\n\n const {\n name\n } = ruleDefinition;\n\n const reports = this.applyRule(moddleRoot, ruleDefinition);\n\n if (reports.length) {\n allReports[name] = reports;\n }\n });\n\n return allReports;\n });\n};\n\n\nLinter.prototype.parseRuleValue = function(value) {\n\n let category;\n let config;\n\n if (Array.isArray(value)) {\n category = value[0];\n config = value[1];\n } else {\n category = value;\n config = {};\n }\n\n // normalize rule flag to and which\n // may be upper case or a number at this point\n if (typeof category === 'string') {\n category = category.toLowerCase();\n }\n\n category = categoryMap[category] || category;\n\n return {\n config,\n category\n };\n};\n\nLinter.prototype.parseRuleName = function(name, localPackage = 'bpmnlint') {\n\n /**\n * We recognize the following rule name patterns:\n *\n * {RULE_NAME} => PKG = 'bpmnlint'\n * bpmnlint/{RULE_NAME} => PKG = 'bpmnlint'\n * {PACKAGE_SHORTCUT}/{RULE_NAME} => PKG = 'bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * bpmnlint-plugin-{PACKAGE_SHORTCUT}/{RULE_NAME} => PKG = 'bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * @scope/{PACKAGE_SHORTCUT}/{RULE_NAME} => PKG = '@scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * @scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}/{RULE_NAME} => PKG = '@scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n */\n\n const match = /^(?:(?:(@[^/]+)\\/)?([^@]{1}[^/]*)\\/)?([^/]+)$/.exec(name);\n\n if (!match) {\n throw new Error(`unparseable rule name <${name}>`);\n }\n\n const [\n _,\n ns,\n packageName,\n ruleName\n ] = match;\n\n if (!packageName) {\n return {\n pkg: localPackage,\n ruleName\n };\n }\n\n const pkg = `${ns ? ns + '/' : '' }${prefixPackage(packageName)}`;\n\n return {\n pkg,\n ruleName\n };\n};\n\n\nLinter.prototype.parseConfigName = function(name) {\n\n /**\n * We recognize the following config name patterns:\n *\n * bpmnlint:{CONFIG_NAME} => PKG = 'bpmnlint'\n * plugin:{PACKAGE_SHORTCUT}/{CONFIG_NAME} => PKG = 'bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * plugin:bpmnlint-plugin-{PACKAGE_SHORTCUT}/{CONFIG_NAME} => PKG = 'bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * plugin:@scope/{PACKAGE_SHORTCUT}/{CONFIG_NAME} => PKG = '@scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * plugin:@scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}/{CONFIG_NAME} => PKG = '@scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n */\n\n const match = /^(?:(?:plugin:(?:(@[^/]+)\\/)?([^@]{1}[^/]*)\\/)|bpmnlint:)([^/]+)$/.exec(name);\n\n if (!match) {\n throw new Error(`unparseable config name <${name}>`);\n }\n\n const [\n _,\n ns,\n packageName,\n configName\n ] = match;\n\n if (!packageName) {\n return {\n pkg: 'bpmnlint',\n configName\n };\n }\n\n const pkg = `${ns ? ns + '/' : '' }${prefixPackage(packageName)}`;\n\n return {\n pkg,\n configName\n };\n};\n\n\nLinter.prototype.getSimplePackageName = function(name) {\n\n /**\n * We recognize the following package name patterns:\n *\n * bpmnlint => PKG = 'bpmnlint'\n * {PACKAGE_SHORTCUT} => PKG = PACKAGE_SHORTCUT\n * bpmnlint-plugin-{PACKAGE_SHORTCUT}' => PKG = PACKAGE_SHORTCUT\n * @scope/{PACKAGE_SHORTCUT} => PKG = '@scope/{PACKAGE_SHORTCUT}'\n * @scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}' => PKG = '@scope/PACKAGE_SHORTCUT'\n */\n\n const match = /^(?:(@[^/]+)\\/)?([^/]+)$/.exec(name);\n\n if (!match) {\n throw new Error(`unparseable package name <${name}>`);\n }\n\n const [\n _,\n ns,\n packageName\n ] = match;\n\n return `${ns ? ns + '/' : '' }${unprefixPackage(packageName)}`;\n};\n\n\n/**\n * Validate and return validated config.\n *\n * @param {Object} config\n * @param {String} localPackage\n *\n * @return {Object} validated config\n */\nLinter.prototype.normalizeConfig = function(config, localPackage) {\n\n const rules = config.rules || {};\n\n const validatedRules = Object.keys(rules).reduce((normalizedRules, name) => {\n\n const value = rules[name];\n\n const {\n pkg,\n ruleName\n } = this.parseRuleName(name, localPackage);\n\n const normalizedName = (\n pkg === 'bpmnlint'\n ? ruleName\n : `${this.getSimplePackageName(pkg)}/${ruleName}`\n );\n\n normalizedRules[normalizedName] = value;\n\n return normalizedRules;\n }, {});\n\n return {\n ...config,\n rules: validatedRules\n };\n};\n\n\n// helpers ///////////////////////////\n\nfunction prefixPackage(pkg) {\n\n if (pkg === 'bpmnlint') {\n return 'bpmnlint';\n }\n\n if (pkg.startsWith('bpmnlint-plugin-')) {\n return pkg;\n }\n\n return `bpmnlint-plugin-${pkg}`;\n}\n\n\nfunction unprefixPackage(pkg) {\n\n if (pkg.startsWith('bpmnlint-plugin-')) {\n return pkg.substring('bpmnlint-plugin-'.length);\n }\n\n return pkg;\n}","const traverse = require('./traverse');\n\nclass Reporter {\n constructor({ moddleRoot, rule }) {\n this.rule = rule;\n this.moddleRoot = moddleRoot;\n this.messages = [];\n this.report = this.report.bind(this);\n }\n\n report(id, message) {\n this.messages.push({ id, message });\n }\n}\n\nmodule.exports = function testRule({ moddleRoot, rule }) {\n const reporter = new Reporter({ rule, moddleRoot });\n\n const check = rule.check;\n\n const enter = check && check.enter || check;\n const leave = check && check.leave;\n\n if (!enter && !leave) {\n throw new Error('no check implemented');\n }\n\n traverse(moddleRoot, {\n enter: enter ? (node) => enter(node, reporter) : null,\n leave: leave ? (node) => leave(node, reporter) : null\n });\n\n return reporter.messages;\n};\n","/**\n * Traverse a moddle tree, depth first from top to bottom\n * and call the passed visitor fn.\n *\n * @param {ModdleElement} element\n * @param {{ enter?: Function; leave?: Function }} options\n */\nmodule.exports = function traverse(element, options) {\n\n const enter = options.enter || null;\n const leave = options.leave || null;\n\n const enterSubTree = enter && enter(element);\n\n const descriptor = element.$descriptor;\n\n if (enterSubTree !== false && !descriptor.isGeneric) {\n\n const containedProperties = descriptor.properties.filter(p => {\n return !p.isAttr && !p.isReference && p.type !== 'String';\n });\n\n containedProperties.forEach(p => {\n if (p.name in element) {\n const propertyValue = element[p.name];\n\n if (p.isMany) {\n propertyValue.forEach(child => {\n traverse(child, options);\n });\n } else {\n traverse(propertyValue, options);\n }\n }\n });\n }\n\n leave && leave(element);\n};\n","/**\n * A rule that checks that sequence flows outgoing from a\n * conditional forking gateway or activity are\n * either default flows _or_ have a condition attached\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!isConditionalForking(node)) {\n return;\n }\n\n const outgoing = node.outgoing || [];\n\n outgoing.forEach((flow) => {\n const missingCondition = (\n !hasCondition(flow) &&\n !isDefaultFlow(node, flow)\n );\n\n if (missingCondition) {\n reporter.report(flow.id, 'Sequence flow is missing condition');\n }\n });\n }\n\n return {\n check\n };\n\n};\n\n\n// helpers /////////////////////////////\n\nfunction isConditionalForking(node) {\n\n const defaultFlow = node['default'];\n const outgoing = node.outgoing || [];\n\n return defaultFlow || outgoing.find(hasCondition);\n}\n\nfunction hasCondition(flow) {\n return !!flow.conditionExpression;\n}\n\nfunction isDefaultFlow(node, flow) {\n return node['default'] === flow;\n}","const {\n is,\n isAny\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks the presence of an end event per scope.\n */\nmodule.exports = function() {\n\n function hasEndEvent(node) {\n const flowElements = node.flowElements || [];\n\n return (\n flowElements.some(node => is(node, 'bpmn:EndEvent'))\n );\n }\n\n function check(node, reporter) {\n\n if (!isAny(node, [\n 'bpmn:Process',\n 'bpmn:SubProcess'\n ])) {\n return;\n }\n\n if (!hasEndEvent(node)) {\n const type = is(node, 'bpmn:SubProcess') ? 'Sub process' : 'Process';\n\n reporter.report(node.id, type + ' is missing end event');\n }\n }\n\n return { check };\n};\n","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * A rule that checks that start events inside an event sub-process\n * are typed.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:SubProcess') || !node.triggeredByEvent) {\n return;\n }\n\n const flowElements = node.flowElements || [];\n\n flowElements.forEach(function(flowElement) {\n\n if (!is(flowElement, 'bpmn:StartEvent')) {\n return false;\n }\n\n const eventDefinitions = flowElement.eventDefinitions || [];\n\n if (eventDefinitions.length === 0) {\n reporter.report(flowElement.id, 'Start event is missing event definition');\n }\n });\n }\n\n return {\n check\n };\n\n};","const {\n isAny\n} = require('bpmnlint-utils');\n\n/**\n * A rule that checks that no fake join is modeled by attempting\n * to give a task or event join semantics.\n *\n * Users should model a parallel joining gateway\n * to achieve the desired behavior.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!isAny(node, [\n 'bpmn:Task',\n 'bpmn:Event'\n ])) {\n return;\n }\n\n const incoming = node.incoming || [];\n\n if (incoming.length > 1) {\n reporter.report(node.id, 'Incoming flows do not join');\n }\n }\n\n return {\n check\n };\n\n};","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * Create a checker that disallows the given element type.\n *\n * @param {String} type\n *\n * @return {Function} ruleImpl\n */\nfunction disallowNodeType(type) {\n\n return function() {\n\n function check(node, reporter) {\n\n if (is(node, type)) {\n reporter.report(node.id, 'Element has disallowed type <' + type + '>');\n }\n }\n\n return {\n check\n };\n\n };\n\n}\n\nmodule.exports.disallowNodeType = disallowNodeType;","const {\n is,\n isAny\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks the presence of a label.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (isAny(node, [\n 'bpmn:ParallelGateway',\n 'bpmn:EventBasedGateway'\n ])) {\n return;\n }\n\n // ignore joining gateways\n if (is(node, 'bpmn:Gateway') && !isForking(node)) {\n return;\n }\n\n if (is(node, 'bpmn:BoundaryEvent')) {\n return;\n }\n\n // ignore sub-processes\n if (is(node, 'bpmn:SubProcess')) {\n\n // TODO(nikku): better ignore expanded sub-processes only\n return;\n }\n\n // ignore sequence flow without condition\n if (is(node, 'bpmn:SequenceFlow') && !hasCondition(node)) {\n return;\n }\n\n // ignore data objects and artifacts for now\n if (isAny(node, [\n 'bpmn:FlowNode',\n 'bpmn:SequenceFlow',\n 'bpmn:Participant',\n 'bpmn:Lane'\n ])) {\n\n const name = (node.name || '').trim();\n\n if (name.length === 0) {\n reporter.report(node.id, 'Element is missing label/name');\n }\n }\n }\n\n return { check };\n};\n\n\n// helpers ////////////////////////\n\nfunction isForking(node) {\n const outgoing = node.outgoing || [];\n\n return outgoing.length > 1;\n}\n\nfunction hasCondition(node) {\n return node.conditionExpression;\n}","const {\n is\n} = require('bpmnlint-utils');\n\nconst {\n flatten\n} = require('min-dash');\n\n/**\n * A rule that checks that there is no BPMNDI information missing for elements,\n * which require BPMNDI.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:Definitions')) {\n return false;\n }\n\n // (1) Construct array of all BPMN elements\n const bpmnElements = getAllBpmnElements(node.rootElements);\n\n // (2) Filter BPMN elements without visual representation\n const visualBpmnElements = bpmnElements.filter(hasVisualRepresentation);\n\n // (3) Construct array of BPMNDI references\n const diBpmnReferences = getAllDiBpmnReferences(node);\n\n // (4) Report elements without BPMNDI\n visualBpmnElements.forEach((element) => {\n if (diBpmnReferences.indexOf(element.id) === -1) {\n reporter.report(element.id, 'Element is missing bpmndi');\n }\n });\n }\n\n return {\n check\n };\n\n};\n\n\n// helpers /////////////////////////////\n\n/**\n * Get all BPMN elements within a bpmn:Definitions node\n *\n * @param {array} rootElements - An array of Moddle rootElements\n * @return {array} A flat array with all BPMN elements, each represented with { id: elementId, $type: elementType }\n *\n */\nfunction getAllBpmnElements(rootElements) {\n return flatten(rootElements.map((rootElement) => {\n\n // Include\n // * flowElements (e.g., tasks, sequenceFlows),\n // * nested flowElements,\n // * participants,\n // * artifacts (groups),\n // * laneSets\n // * nested laneSets\n // * childLaneSets\n // * nested childLaneSets\n const elements = flatten([].concat(\n rootElement.flowElements || [],\n (rootElement.flowElements && getAllBpmnElements(rootElement.flowElements.filter(hasFlowElements))) || [],\n rootElement.participants || [],\n rootElement.artifacts || [],\n (rootElement.laneSets && rootElement.laneSets[0].lanes) || [],\n (rootElement.laneSets && getAllBpmnElements(rootElement.laneSets[0].lanes.filter(hasChildLaneSet))) || [],\n (rootElement.childLaneSet && rootElement.childLaneSet.lanes) || [],\n (rootElement.childLaneSet && getAllBpmnElements(rootElement.childLaneSet.lanes.filter(hasChildLaneSet))) || []\n ));\n\n if (elements.length > 0) {\n return elements.map((element) => {\n\n return {\n id: element.id,\n $type: element.$type\n };\n });\n } else {\n\n // We are not interested in the rest here (DI)\n return [];\n }\n }));\n}\n\n/**\n * Get all BPMN elements within a bpmn:Definitions node\n *\n * @param {ModdleElement} definitionsNode - A moddleElement representing the\n * bpmn:Definitions element\n * @return {array} A flat array with all BPMNDI element ids part of\n * this bpmn:Definitions node\n *\n */\nfunction getAllDiBpmnReferences(definitionsNode) {\n return flatten(\n definitionsNode.diagrams.map((diagram) => {\n\n const diElements = diagram.plane.planeElement || [];\n\n return diElements.map((element) => {\n\n return element.bpmnElement.id;\n });\n })\n );\n}\n\nfunction hasVisualRepresentation(element) {\n const noVisRepresentation = ['bpmn:DataObject'];\n\n return noVisRepresentation.includes(element.$type) ? false : true;\n}\n\nfunction hasFlowElements(element) {\n return element.flowElements ? true : false;\n}\n\nfunction hasChildLaneSet(element) {\n return element.childLaneSet ? true : false;\n}\n","const disallowNodeType = require('./helper').disallowNodeType;\n\nmodule.exports = disallowNodeType('bpmn:ComplexGateway');","const {\n isAny,\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that verifies that there exists no disconnected\n * flow elements, i.e. elements without incoming\n * _or_ outgoing sequence flows\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!isAny(node, [\n 'bpmn:Task',\n 'bpmn:Gateway',\n 'bpmn:SubProcess',\n 'bpmn:Event'\n ]) || node.triggeredByEvent) {\n return;\n }\n\n // compensation activity and boundary events are\n // linked visually via associations. If these associations\n // exist we are fine, too\n if (isCompensationLinked(node)) {\n return;\n }\n\n const incoming = node.incoming || [];\n const outgoing = node.outgoing || [];\n\n if (!incoming.length && !outgoing.length) {\n reporter.report(node.id, 'Element is not connected');\n }\n }\n\n return {\n check\n };\n};\n\n\n// helpers /////////////////\n\nfunction isCompensationBoundary(node) {\n\n var eventDefinitions = node.eventDefinitions;\n\n if (!is(node, 'bpmn:BoundaryEvent')) {\n return false;\n }\n\n if (!eventDefinitions || eventDefinitions.length !== 1) {\n return false;\n }\n\n return is(eventDefinitions[0], 'bpmn:CompensateEventDefinition');\n}\n\nfunction isCompensationActivity(node) {\n return node.isForCompensation;\n}\n\nfunction isCompensationLinked(node) {\n var source = isCompensationBoundary(node);\n var target = isCompensationActivity(node);\n\n // TODO(nikku): check, whether compensation association exists\n return source || target;\n}","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * A rule that verifies that there are no disconnected\n * flow elements, i.e. elements without incoming\n * _or_ outgoing sequence flows\n */\nmodule.exports = function() {\n\n const keyed = {};\n\n const outgoingReported = {};\n const incomingReported = {};\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:SequenceFlow')) {\n return;\n }\n\n const key = flowKey(node);\n\n if (key in keyed) {\n reporter.report(node.id, 'SequenceFlow is a duplicate');\n\n const sourceId = node.sourceRef.id;\n const targetId = node.targetRef.id;\n\n if (!outgoingReported[sourceId]) {\n reporter.report(sourceId, 'Duplicate outgoing sequence flows');\n\n outgoingReported[sourceId] = true;\n }\n\n if (!incomingReported[targetId]) {\n reporter.report(targetId, 'Duplicate incoming sequence flows');\n\n incomingReported[targetId] = true;\n }\n } else {\n keyed[key] = node;\n }\n }\n\n return {\n check\n };\n\n};\n\n\n// helpers /////////////////\n\nfunction flowKey(flow) {\n const conditionExpression = flow.conditionExpression;\n\n const condition = conditionExpression ? conditionExpression.body : '';\n const source = flow.sourceRef ? flow.sourceRef.id : flow.id;\n const target = flow.targetRef ? flow.targetRef.id : flow.id;\n\n return source + '#' + target + '#' + condition;\n}","const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks, whether a gateway forks and joins\n * at the same time.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:Gateway')) {\n return;\n }\n\n const incoming = node.incoming || [];\n const outgoing = node.outgoing || [];\n\n if (incoming.length > 1 && outgoing.length > 1) {\n reporter.report(node.id, 'Gateway forks and joins');\n }\n }\n\n return {\n check\n };\n\n};","const {\n isAny\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks that no implicit split is modeled\n * starting from a task.\n *\n * users should model the parallel splitting gateway\n * explicitly instead.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!isAny(node, [\n 'bpmn:Task',\n 'bpmn:Event'\n ])) {\n return;\n }\n\n const outgoing = node.outgoing || [];\n\n const outgoingWithoutCondition = outgoing.filter((flow) => {\n return !hasCondition(flow) && !isDefaultFlow(node, flow);\n });\n\n if (outgoingWithoutCondition.length > 1) {\n reporter.report(node.id, 'Flow splits implicitly');\n }\n }\n\n return {\n check\n };\n\n};\n\n\n// helpers /////////////////////////////\n\nfunction hasCondition(flow) {\n return !!flow.conditionExpression;\n}\n\nfunction isDefaultFlow(node, flow) {\n return node['default'] === flow;\n}","const disallowNodeType = require('./helper').disallowNodeType;\n\nmodule.exports = disallowNodeType('bpmn:InclusiveGateway');","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * A rule that checks whether not more than one blank start event\n * exists per scope.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:FlowElementsContainer')) {\n return;\n }\n\n const flowElements = node.flowElements || [];\n\n const blankStartEvents = flowElements.filter(function(flowElement) {\n\n if (!is(flowElement, 'bpmn:StartEvent')) {\n return false;\n }\n\n const eventDefinitions = flowElement.eventDefinitions || [];\n\n return eventDefinitions.length === 0;\n });\n\n if (blankStartEvents.length > 1) {\n const type = is(node, 'bpmn:SubProcess') ? 'Sub process' : 'Process';\n\n reporter.report(node.id, type + ' has multiple blank start events');\n }\n }\n\n return {\n check\n };\n\n};","const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that verifies that an event contains maximum one event definition.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:Event')) {\n return;\n }\n\n const eventDefinitions = node.eventDefinitions || [];\n\n if (eventDefinitions.length > 1) {\n reporter.report(node.id, 'Event has multiple event definitions');\n }\n }\n\n return {\n check\n };\n\n};","const {\n is,\n isAny\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks for the presence of a start event per scope.\n */\nmodule.exports = function() {\n\n function hasStartEvent(node) {\n const flowElements = node.flowElements || [];\n\n return (\n flowElements.some(node => is(node, 'bpmn:StartEvent'))\n );\n }\n\n function check(node, reporter) {\n\n if (!isAny(node, [\n 'bpmn:Process',\n 'bpmn:SubProcess'\n ])) {\n return;\n }\n\n if (!hasStartEvent(node)) {\n const type = is(node, 'bpmn:SubProcess') ? 'Sub process' : 'Process';\n\n reporter.report(node.id, type + ' is missing start event');\n }\n }\n\n return { check };\n};\n","const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks that start events inside a normal sub-processes\n * are blank (do not have an event definition).\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:SubProcess') || node.triggeredByEvent) {\n return;\n }\n\n const flowElements = node.flowElements || [];\n\n flowElements.forEach(function(flowElement) {\n\n if (!is(flowElement, 'bpmn:StartEvent')) {\n return false;\n }\n\n const eventDefinitions = flowElement.eventDefinitions || [];\n\n if (eventDefinitions.length > 0) {\n reporter.report(flowElement.id, 'Start event must be blank');\n }\n });\n }\n\n return {\n check\n };\n\n};","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * A rule that checks, whether a gateway has only one source and target.\n *\n * Those gateways are superfluous since they don't do anything.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:Gateway')) {\n return;\n }\n\n const incoming = node.incoming || [];\n const outgoing = node.outgoing || [];\n\n if (incoming.length === 1 && outgoing.length === 1) {\n reporter.report(node.id, 'Gateway is superfluous. It only has one source and target.');\n }\n }\n\n return {\n check\n };\n\n};","/**\r\n * Validate and register a client plugin.\r\n *\r\n * @param {Object} plugin\r\n * @param {String} type\r\n */\r\nexport function registerClientPlugin(plugin, type) {\r\n var plugins = window.plugins || [];\r\n window.plugins = plugins;\r\n\r\n if (!plugin) {\r\n throw new Error('plugin not specified');\r\n }\r\n\r\n if (!type) {\r\n throw new Error('type not specified');\r\n }\r\n\r\n plugins.push({\r\n plugin: plugin,\r\n type: type\r\n });\r\n}\r\n\r\n/**\r\n * Validate and register a bpmn-js plugin.\r\n *\r\n * @param {Object} module\r\n *\r\n * @example\r\n *\r\n * import {\r\n * registerBpmnJSPlugin\r\n * } from 'camunda-modeler-plugin-helpers';\r\n *\r\n * const BpmnJSModule = {\r\n * __init__: [ 'myService' ],\r\n * myService: [ 'type', ... ]\r\n * };\r\n *\r\n * registerBpmnJSPlugin(BpmnJSModule);\r\n */\r\nexport function registerBpmnJSPlugin(module) {\r\n registerClientPlugin(module, 'bpmn.modeler.additionalModules');\r\n}\r\n\r\n/**\r\n * Validate and register a bpmn-moddle extension plugin.\r\n *\r\n * @param {Object} descriptor\r\n *\r\n * @example\r\n * import {\r\n * registerBpmnJSModdleExtension\r\n * } from 'camunda-modeler-plugin-helpers';\r\n *\r\n * var moddleDescriptor = {\r\n * name: 'my descriptor',\r\n * uri: 'http://example.my.company.localhost/schema/my-descriptor/1.0',\r\n * prefix: 'mydesc',\r\n *\r\n * ...\r\n * };\r\n *\r\n * registerBpmnJSModdleExtension(moddleDescriptor);\r\n */\r\nexport function registerBpmnJSModdleExtension(descriptor) {\r\n registerClientPlugin(descriptor, 'bpmn.modeler.moddleExtension');\r\n}\r\n\r\n/**\r\n * Return the modeler directory, as a string.\r\n *\r\n * @deprecated Will be removed in future Camunda Modeler versions without replacement.\r\n *\r\n * @return {String}\r\n */\r\nexport function getModelerDirectory() {\r\n return window.getModelerDirectory();\r\n}\r\n\r\n/**\r\n * Return the modeler plugin directory, as a string.\r\n *\r\n * @deprecated Will be removed in future Camunda Modeler versions without replacement.\r\n *\r\n * @return {String}\r\n */\r\nexport function getPluginsDirectory() {\r\n return window.getPluginsDirectory();\r\n}","/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */\n;(function(root, factory) {\n\t// https://github.com/umdjs/umd/blob/master/returnExports.js\n\tif (typeof exports == 'object') {\n\t\t// For Node.js.\n\t\tmodule.exports = factory(root);\n\t} else if (typeof define == 'function' && define.amd) {\n\t\t// For AMD. Register as an anonymous module.\n\t\tdefine([], factory.bind(root, root));\n\t} else {\n\t\t// For browser globals (not exposing the function separately).\n\t\tfactory(root);\n\t}\n}(typeof global != 'undefined' ? global : this, function(root) {\n\n\tif (root.CSS && root.CSS.escape) {\n\t\treturn root.CSS.escape;\n\t}\n\n\t// https://drafts.csswg.org/cssom/#serialize-an-identifier\n\tvar cssEscape = function(value) {\n\t\tif (arguments.length == 0) {\n\t\t\tthrow new TypeError('`CSS.escape` requires an argument.');\n\t\t}\n\t\tvar string = String(value);\n\t\tvar length = string.length;\n\t\tvar index = -1;\n\t\tvar codeUnit;\n\t\tvar result = '';\n\t\tvar firstCodeUnit = string.charCodeAt(0);\n\t\twhile (++index < length) {\n\t\t\tcodeUnit = string.charCodeAt(index);\n\t\t\t// Note: there’s no need to special-case astral symbols, surrogate\n\t\t\t// pairs, or lone surrogates.\n\n\t\t\t// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER\n\t\t\t// (U+FFFD).\n\t\t\tif (codeUnit == 0x0000) {\n\t\t\t\tresult += '\\uFFFD';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// If the character is in the range [\\1-\\1F] (U+0001 to U+001F) or is\n\t\t\t\t// U+007F, […]\n\t\t\t\t(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||\n\t\t\t\t// If the character is the first character and is in the range [0-9]\n\t\t\t\t// (U+0030 to U+0039), […]\n\t\t\t\t(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||\n\t\t\t\t// If the character is the second character and is in the range [0-9]\n\t\t\t\t// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]\n\t\t\t\t(\n\t\t\t\t\tindex == 1 &&\n\t\t\t\t\tcodeUnit >= 0x0030 && codeUnit <= 0x0039 &&\n\t\t\t\t\tfirstCodeUnit == 0x002D\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point\n\t\t\t\tresult += '\\\\' + codeUnit.toString(16) + ' ';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// If the character is the first character and is a `-` (U+002D), and\n\t\t\t\t// there is no second character, […]\n\t\t\t\tindex == 0 &&\n\t\t\t\tlength == 1 &&\n\t\t\t\tcodeUnit == 0x002D\n\t\t\t) {\n\t\t\t\tresult += '\\\\' + string.charAt(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the character is not handled by one of the above rules and is\n\t\t\t// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or\n\t\t\t// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to\n\t\t\t// U+005A), or [a-z] (U+0061 to U+007A), […]\n\t\t\tif (\n\t\t\t\tcodeUnit >= 0x0080 ||\n\t\t\t\tcodeUnit == 0x002D ||\n\t\t\t\tcodeUnit == 0x005F ||\n\t\t\t\tcodeUnit >= 0x0030 && codeUnit <= 0x0039 ||\n\t\t\t\tcodeUnit >= 0x0041 && codeUnit <= 0x005A ||\n\t\t\t\tcodeUnit >= 0x0061 && codeUnit <= 0x007A\n\t\t\t) {\n\t\t\t\t// the character itself\n\t\t\t\tresult += string.charAt(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Otherwise, the escaped character.\n\t\t\t// https://drafts.csswg.org/cssom/#escape-a-character\n\t\t\tresult += '\\\\' + string.charAt(index);\n\n\t\t}\n\t\treturn result;\n\t};\n\n\tif (!root.CSS) {\n\t\troot.CSS = {};\n\t}\n\n\troot.CSS.escape = cssEscape;\n\treturn cssEscape;\n\n}));\n","export {\n default as escapeCSS\n} from 'css.escape';\n\nvar HTML_ESCAPE_MAP = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n};\n\nexport function escapeHTML(str) {\n str = '' + str;\n\n return str && str.replace(/[&<>\"']/g, function(match) {\n return HTML_ESCAPE_MAP[match];\n });\n}\n","/**\n * Flatten array, one level deep.\n *\n * @param {Array} arr\n *\n * @return {Array}\n */\nfunction flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}\n\nvar nativeToString = Object.prototype.toString;\nvar nativeHasOwnProperty = Object.prototype.hasOwnProperty;\nfunction isUndefined(obj) {\n return obj === undefined;\n}\nfunction isDefined(obj) {\n return obj !== undefined;\n}\nfunction isNil(obj) {\n return obj == null;\n}\nfunction isArray(obj) {\n return nativeToString.call(obj) === '[object Array]';\n}\nfunction isObject(obj) {\n return nativeToString.call(obj) === '[object Object]';\n}\nfunction isNumber(obj) {\n return nativeToString.call(obj) === '[object Number]';\n}\nfunction isFunction(obj) {\n var tag = nativeToString.call(obj);\n return tag === '[object Function]' || tag === '[object AsyncFunction]' || tag === '[object GeneratorFunction]' || tag === '[object AsyncGeneratorFunction]' || tag === '[object Proxy]';\n}\nfunction isString(obj) {\n return nativeToString.call(obj) === '[object String]';\n}\n/**\n * Ensure collection is an array.\n *\n * @param {Object} obj\n */\n\nfunction ensureArray(obj) {\n if (isArray(obj)) {\n return;\n }\n\n throw new Error('must supply array');\n}\n/**\n * Return true, if target owns a property with the given key.\n *\n * @param {Object} target\n * @param {String} key\n *\n * @return {Boolean}\n */\n\nfunction has(target, key) {\n return nativeHasOwnProperty.call(target, key);\n}\n\n/**\n * Find element in collection.\n *\n * @param {Array|Object} collection\n * @param {Function|Object} matcher\n *\n * @return {Object}\n */\n\nfunction find(collection, matcher) {\n matcher = toMatcher(matcher);\n var match;\n forEach(collection, function (val, key) {\n if (matcher(val, key)) {\n match = val;\n return false;\n }\n });\n return match;\n}\n/**\n * Find element index in collection.\n *\n * @param {Array|Object} collection\n * @param {Function} matcher\n *\n * @return {Object}\n */\n\nfunction findIndex(collection, matcher) {\n matcher = toMatcher(matcher);\n var idx = isArray(collection) ? -1 : undefined;\n forEach(collection, function (val, key) {\n if (matcher(val, key)) {\n idx = key;\n return false;\n }\n });\n return idx;\n}\n/**\n * Find element in collection.\n *\n * @param {Array|Object} collection\n * @param {Function} matcher\n *\n * @return {Array} result\n */\n\nfunction filter(collection, matcher) {\n var result = [];\n forEach(collection, function (val, key) {\n if (matcher(val, key)) {\n result.push(val);\n }\n });\n return result;\n}\n/**\n * Iterate over collection; returning something\n * (non-undefined) will stop iteration.\n *\n * @param {Array|Object} collection\n * @param {Function} iterator\n *\n * @return {Object} return result that stopped the iteration\n */\n\nfunction forEach(collection, iterator) {\n var val, result;\n\n if (isUndefined(collection)) {\n return;\n }\n\n var convertKey = isArray(collection) ? toNum : identity;\n\n for (var key in collection) {\n if (has(collection, key)) {\n val = collection[key];\n result = iterator(val, convertKey(key));\n\n if (result === false) {\n return val;\n }\n }\n }\n}\n/**\n * Return collection without element.\n *\n * @param {Array} arr\n * @param {Function} matcher\n *\n * @return {Array}\n */\n\nfunction without(arr, matcher) {\n if (isUndefined(arr)) {\n return [];\n }\n\n ensureArray(arr);\n matcher = toMatcher(matcher);\n return arr.filter(function (el, idx) {\n return !matcher(el, idx);\n });\n}\n/**\n * Reduce collection, returning a single result.\n *\n * @param {Object|Array} collection\n * @param {Function} iterator\n * @param {Any} result\n *\n * @return {Any} result returned from last iterator\n */\n\nfunction reduce(collection, iterator, result) {\n forEach(collection, function (value, idx) {\n result = iterator(result, value, idx);\n });\n return result;\n}\n/**\n * Return true if every element in the collection\n * matches the criteria.\n *\n * @param {Object|Array} collection\n * @param {Function} matcher\n *\n * @return {Boolean}\n */\n\nfunction every(collection, matcher) {\n return !!reduce(collection, function (matches, val, key) {\n return matches && matcher(val, key);\n }, true);\n}\n/**\n * Return true if some elements in the collection\n * match the criteria.\n *\n * @param {Object|Array} collection\n * @param {Function} matcher\n *\n * @return {Boolean}\n */\n\nfunction some(collection, matcher) {\n return !!find(collection, matcher);\n}\n/**\n * Transform a collection into another collection\n * by piping each member through the given fn.\n *\n * @param {Object|Array} collection\n * @param {Function} fn\n *\n * @return {Array} transformed collection\n */\n\nfunction map(collection, fn) {\n var result = [];\n forEach(collection, function (val, key) {\n result.push(fn(val, key));\n });\n return result;\n}\n/**\n * Get the collections keys.\n *\n * @param {Object|Array} collection\n *\n * @return {Array}\n */\n\nfunction keys(collection) {\n return collection && Object.keys(collection) || [];\n}\n/**\n * Shorthand for `keys(o).length`.\n *\n * @param {Object|Array} collection\n *\n * @return {Number}\n */\n\nfunction size(collection) {\n return keys(collection).length;\n}\n/**\n * Get the values in the collection.\n *\n * @param {Object|Array} collection\n *\n * @return {Array}\n */\n\nfunction values(collection) {\n return map(collection, function (val) {\n return val;\n });\n}\n/**\n * Group collection members by attribute.\n *\n * @param {Object|Array} collection\n * @param {Function} extractor\n *\n * @return {Object} map with { attrValue => [ a, b, c ] }\n */\n\nfunction groupBy(collection, extractor) {\n var grouped = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n extractor = toExtractor(extractor);\n forEach(collection, function (val) {\n var discriminator = extractor(val) || '_';\n var group = grouped[discriminator];\n\n if (!group) {\n group = grouped[discriminator] = [];\n }\n\n group.push(val);\n });\n return grouped;\n}\nfunction uniqueBy(extractor) {\n extractor = toExtractor(extractor);\n var grouped = {};\n\n for (var _len = arguments.length, collections = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n collections[_key - 1] = arguments[_key];\n }\n\n forEach(collections, function (c) {\n return groupBy(c, extractor, grouped);\n });\n var result = map(grouped, function (val, key) {\n return val[0];\n });\n return result;\n}\nvar unionBy = uniqueBy;\n/**\n * Sort collection by criteria.\n *\n * @param {Object|Array} collection\n * @param {String|Function} extractor\n *\n * @return {Array}\n */\n\nfunction sortBy(collection, extractor) {\n extractor = toExtractor(extractor);\n var sorted = [];\n forEach(collection, function (value, key) {\n var disc = extractor(value, key);\n var entry = {\n d: disc,\n v: value\n };\n\n for (var idx = 0; idx < sorted.length; idx++) {\n var d = sorted[idx].d;\n\n if (disc < d) {\n sorted.splice(idx, 0, entry);\n return;\n }\n } // not inserted, append (!)\n\n\n sorted.push(entry);\n });\n return map(sorted, function (e) {\n return e.v;\n });\n}\n/**\n * Create an object pattern matcher.\n *\n * @example\n *\n * const matcher = matchPattern({ id: 1 });\n *\n * let element = find(elements, matcher);\n *\n * @param {Object} pattern\n *\n * @return {Function} matcherFn\n */\n\nfunction matchPattern(pattern) {\n return function (el) {\n return every(pattern, function (val, key) {\n return el[key] === val;\n });\n };\n}\n\nfunction toExtractor(extractor) {\n return isFunction(extractor) ? extractor : function (e) {\n return e[extractor];\n };\n}\n\nfunction toMatcher(matcher) {\n return isFunction(matcher) ? matcher : function (e) {\n return e === matcher;\n };\n}\n\nfunction identity(arg) {\n return arg;\n}\n\nfunction toNum(arg) {\n return Number(arg);\n}\n\n/**\n * Debounce fn, calling it only once if the given time\n * elapsed between calls.\n *\n * Lodash-style the function exposes methods to `#clear`\n * and `#flush` to control internal behavior.\n *\n * @param {Function} fn\n * @param {Number} timeout\n *\n * @return {Function} debounced function\n */\nfunction debounce(fn, timeout) {\n var timer;\n var lastArgs;\n var lastThis;\n var lastNow;\n\n function fire(force) {\n var now = Date.now();\n var scheduledDiff = force ? 0 : lastNow + timeout - now;\n\n if (scheduledDiff > 0) {\n return schedule(scheduledDiff);\n }\n\n fn.apply(lastThis, lastArgs);\n clear();\n }\n\n function schedule(timeout) {\n timer = setTimeout(fire, timeout);\n }\n\n function clear() {\n if (timer) {\n clearTimeout(timer);\n }\n\n timer = lastNow = lastArgs = lastThis = undefined;\n }\n\n function flush() {\n if (timer) {\n fire(true);\n }\n\n clear();\n }\n\n function callback() {\n lastNow = Date.now();\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n lastArgs = args;\n lastThis = this; // ensure an execution is scheduled\n\n if (!timer) {\n schedule(timeout);\n }\n }\n\n callback.flush = flush;\n callback.cancel = clear;\n return callback;\n}\n/**\n * Throttle fn, calling at most once\n * in the given interval.\n *\n * @param {Function} fn\n * @param {Number} interval\n *\n * @return {Function} throttled function\n */\n\nfunction throttle(fn, interval) {\n var throttling = false;\n return function () {\n if (throttling) {\n return;\n }\n\n fn.apply(void 0, arguments);\n throttling = true;\n setTimeout(function () {\n throttling = false;\n }, interval);\n };\n}\n/**\n * Bind function against target .\n *\n * @param {Function} fn\n * @param {Object} target\n *\n * @return {Function} bound function\n */\n\nfunction bind(fn, target) {\n return fn.bind(target);\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\n/**\n * Convenience wrapper for `Object.assign`.\n *\n * @param {Object} target\n * @param {...Object} others\n *\n * @return {Object} the target\n */\n\nfunction assign(target) {\n for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n others[_key - 1] = arguments[_key];\n }\n\n return _extends.apply(void 0, [target].concat(others));\n}\n/**\n * Sets a nested property of a given object to the specified value.\n *\n * This mutates the object and returns it.\n *\n * @param {Object} target The target of the set operation.\n * @param {(string|number)[]} path The path to the nested value.\n * @param {any} value The value to set.\n */\n\nfunction set(target, path, value) {\n var currentTarget = target;\n forEach(path, function (key, idx) {\n if (key === '__proto__') {\n throw new Error('illegal key: __proto__');\n }\n\n var nextKey = path[idx + 1];\n var nextTarget = currentTarget[key];\n\n if (isDefined(nextKey) && isNil(nextTarget)) {\n nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : [];\n }\n\n if (isUndefined(nextKey)) {\n if (isUndefined(value)) {\n delete currentTarget[key];\n } else {\n currentTarget[key] = value;\n }\n } else {\n currentTarget = nextTarget;\n }\n });\n return target;\n}\n/**\n * Gets a nested property of a given object.\n *\n * @param {Object} target The target of the get operation.\n * @param {(string|number)[]} path The path to the nested value.\n * @param {any} [defaultValue] The value to return if no value exists.\n */\n\nfunction get(target, path, defaultValue) {\n var currentTarget = target;\n forEach(path, function (key) {\n // accessing nil property yields \n if (isNil(currentTarget)) {\n currentTarget = undefined;\n return false;\n }\n\n currentTarget = currentTarget[key];\n });\n return isUndefined(currentTarget) ? defaultValue : currentTarget;\n}\n/**\n * Pick given properties from the target object.\n *\n * @param {Object} target\n * @param {Array} properties\n *\n * @return {Object} target\n */\n\nfunction pick(target, properties) {\n var result = {};\n var obj = Object(target);\n forEach(properties, function (prop) {\n if (prop in obj) {\n result[prop] = target[prop];\n }\n });\n return result;\n}\n/**\n * Pick all target properties, excluding the given ones.\n *\n * @param {Object} target\n * @param {Array} properties\n *\n * @return {Object} target\n */\n\nfunction omit(target, properties) {\n var result = {};\n var obj = Object(target);\n forEach(obj, function (prop, key) {\n if (properties.indexOf(key) === -1) {\n result[key] = prop;\n }\n });\n return result;\n}\n/**\n * Recursively merge `...sources` into given target.\n *\n * Does support merging objects; does not support merging arrays.\n *\n * @param {Object} target\n * @param {...Object} sources\n *\n * @return {Object} the target\n */\n\nfunction merge(target) {\n for (var _len2 = arguments.length, sources = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n sources[_key2 - 1] = arguments[_key2];\n }\n\n if (!sources.length) {\n return target;\n }\n\n forEach(sources, function (source) {\n // skip non-obj sources, i.e. null\n if (!source || !isObject(source)) {\n return;\n }\n\n forEach(source, function (sourceVal, key) {\n if (key === '__proto__') {\n return;\n }\n\n var targetVal = target[key];\n\n if (isObject(sourceVal)) {\n if (!isObject(targetVal)) {\n // override target[key] with object\n targetVal = {};\n }\n\n target[key] = merge(targetVal, sourceVal);\n } else {\n target[key] = sourceVal;\n }\n });\n });\n return target;\n}\n\nexport { assign, bind, debounce, ensureArray, every, filter, find, findIndex, flatten, forEach, get, groupBy, has, isArray, isDefined, isFunction, isNil, isNumber, isObject, isString, isUndefined, keys, map, matchPattern, merge, omit, pick, reduce, set, size, some, sortBy, throttle, unionBy, uniqueBy, values, without };\n","/**\n * Set attribute `name` to `val`, or get attr `name`.\n *\n * @param {Element} el\n * @param {String} name\n * @param {String} [val]\n * @api public\n */\nfunction attr(el, name, val) {\n // get\n if (arguments.length == 2) {\n return el.getAttribute(name);\n }\n\n // remove\n if (val === null) {\n return el.removeAttribute(name);\n }\n\n // set\n el.setAttribute(name, val);\n\n return el;\n}\n\nvar indexOf = [].indexOf;\n\nvar indexof = function(arr, obj){\n if (indexOf) return arr.indexOf(obj);\n for (var i = 0; i < arr.length; ++i) {\n if (arr[i] === obj) return i;\n }\n return -1;\n};\n\n/**\n * Taken from https://github.com/component/classes\n *\n * Without the component bits.\n */\n\n/**\n * Whitespace regexp.\n */\n\nvar re = /\\s+/;\n\n/**\n * toString reference.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Wrap `el` in a `ClassList`.\n *\n * @param {Element} el\n * @return {ClassList}\n * @api public\n */\n\nfunction classes(el) {\n return new ClassList(el);\n}\n\n/**\n * Initialize a new ClassList for `el`.\n *\n * @param {Element} el\n * @api private\n */\n\nfunction ClassList(el) {\n if (!el || !el.nodeType) {\n throw new Error('A DOM element reference is required');\n }\n this.el = el;\n this.list = el.classList;\n}\n\n/**\n * Add class `name` if not already present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.add = function (name) {\n // classList\n if (this.list) {\n this.list.add(name);\n return this;\n }\n\n // fallback\n var arr = this.array();\n var i = indexof(arr, name);\n if (!~i) arr.push(name);\n this.el.className = arr.join(' ');\n return this;\n};\n\n/**\n * Remove class `name` when present, or\n * pass a regular expression to remove\n * any which match.\n *\n * @param {String|RegExp} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.remove = function (name) {\n if ('[object RegExp]' == toString.call(name)) {\n return this.removeMatching(name);\n }\n\n // classList\n if (this.list) {\n this.list.remove(name);\n return this;\n }\n\n // fallback\n var arr = this.array();\n var i = indexof(arr, name);\n if (~i) arr.splice(i, 1);\n this.el.className = arr.join(' ');\n return this;\n};\n\n/**\n * Remove all classes matching `re`.\n *\n * @param {RegExp} re\n * @return {ClassList}\n * @api private\n */\n\nClassList.prototype.removeMatching = function (re) {\n var arr = this.array();\n for (var i = 0; i < arr.length; i++) {\n if (re.test(arr[i])) {\n this.remove(arr[i]);\n }\n }\n return this;\n};\n\n/**\n * Toggle class `name`, can force state via `force`.\n *\n * For browsers that support classList, but do not support `force` yet,\n * the mistake will be detected and corrected.\n *\n * @param {String} name\n * @param {Boolean} force\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.toggle = function (name, force) {\n // classList\n if (this.list) {\n if ('undefined' !== typeof force) {\n if (force !== this.list.toggle(name, force)) {\n this.list.toggle(name); // toggle again to correct\n }\n } else {\n this.list.toggle(name);\n }\n return this;\n }\n\n // fallback\n if ('undefined' !== typeof force) {\n if (!force) {\n this.remove(name);\n } else {\n this.add(name);\n }\n } else {\n if (this.has(name)) {\n this.remove(name);\n } else {\n this.add(name);\n }\n }\n\n return this;\n};\n\n/**\n * Return an array of classes.\n *\n * @return {Array}\n * @api public\n */\n\nClassList.prototype.array = function () {\n var className = this.el.getAttribute('class') || '';\n var str = className.replace(/^\\s+|\\s+$/g, '');\n var arr = str.split(re);\n if ('' === arr[0]) arr.shift();\n return arr;\n};\n\n/**\n * Check if class `name` is present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.has = ClassList.prototype.contains = function (name) {\n return this.list ? this.list.contains(name) : !!~indexof(this.array(), name);\n};\n\n/**\n * Remove all children from the given element.\n */\nfunction clear(el) {\n\n var c;\n\n while (el.childNodes.length) {\n c = el.childNodes[0];\n el.removeChild(c);\n }\n\n return el;\n}\n\nvar proto = typeof Element !== 'undefined' ? Element.prototype : {};\nvar vendor = proto.matches\n || proto.matchesSelector\n || proto.webkitMatchesSelector\n || proto.mozMatchesSelector\n || proto.msMatchesSelector\n || proto.oMatchesSelector;\n\nvar matchesSelector = match;\n\n/**\n * Match `el` to `selector`.\n *\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n * @api public\n */\n\nfunction match(el, selector) {\n if (!el || el.nodeType !== 1) return false;\n if (vendor) return vendor.call(el, selector);\n var nodes = el.parentNode.querySelectorAll(selector);\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i] == el) return true;\n }\n return false;\n}\n\n/**\n * Closest\n *\n * @param {Element} el\n * @param {String} selector\n * @param {Boolean} checkYourSelf (optional)\n */\nfunction closest (element, selector, checkYourSelf) {\n var currentElem = checkYourSelf ? element : element.parentNode;\n\n while (currentElem && currentElem.nodeType !== document.DOCUMENT_NODE && currentElem.nodeType !== document.DOCUMENT_FRAGMENT_NODE) {\n\n if (matchesSelector(currentElem, selector)) {\n return currentElem;\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return matchesSelector(currentElem, selector) ? currentElem : null;\n}\n\nvar bind = window.addEventListener ? 'addEventListener' : 'attachEvent',\n unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',\n prefix = bind !== 'addEventListener' ? 'on' : '';\n\n/**\n * Bind `el` event `type` to `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nvar bind_1 = function(el, type, fn, capture){\n el[bind](prefix + type, fn, capture || false);\n return fn;\n};\n\n/**\n * Unbind `el` event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nvar unbind_1 = function(el, type, fn, capture){\n el[unbind](prefix + type, fn, capture || false);\n return fn;\n};\n\nvar componentEvent = {\n\tbind: bind_1,\n\tunbind: unbind_1\n};\n\n/**\n * Module dependencies.\n */\n\n/**\n * Delegate event `type` to `selector`\n * and invoke `fn(e)`. A callback function\n * is returned which may be passed to `.unbind()`.\n *\n * @param {Element} el\n * @param {String} selector\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\n// Some events don't bubble, so we want to bind to the capture phase instead\n// when delegating.\nvar forceCaptureEvents = ['focus', 'blur'];\n\nfunction bind$1(el, selector, type, fn, capture) {\n if (forceCaptureEvents.indexOf(type) !== -1) {\n capture = true;\n }\n\n return componentEvent.bind(el, type, function (e) {\n var target = e.target || e.srcElement;\n e.delegateTarget = closest(target, selector, true, el);\n if (e.delegateTarget) {\n fn.call(el, e);\n }\n }, capture);\n}\n\n/**\n * Unbind event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\nfunction unbind$1(el, type, fn, capture) {\n if (forceCaptureEvents.indexOf(type) !== -1) {\n capture = true;\n }\n\n return componentEvent.unbind(el, type, fn, capture);\n}\n\nvar delegate = {\n bind: bind$1,\n unbind: unbind$1\n};\n\n/**\n * Expose `parse`.\n */\n\nvar domify = parse;\n\n/**\n * Tests for browser support.\n */\n\nvar innerHTMLBug = false;\nvar bugTestDiv;\nif (typeof document !== 'undefined') {\n bugTestDiv = document.createElement('div');\n // Setup\n bugTestDiv.innerHTML = '
    a';\n // Make sure that link elements get serialized correctly by innerHTML\n // This requires a wrapper element in IE\n innerHTMLBug = !bugTestDiv.getElementsByTagName('link').length;\n bugTestDiv = undefined;\n}\n\n/**\n * Wrap map from jquery.\n */\n\nvar map = {\n legend: [1, '
    ', '
    '],\n tr: [2, '', '
    '],\n col: [2, '', '
    '],\n // for script/link/style tags to work in IE6-8, you have to wrap\n // in a div with a non-whitespace character in front, ha!\n _default: innerHTMLBug ? [1, 'X
    ', '
    '] : [0, '', '']\n};\n\nmap.td =\nmap.th = [3, '', '
    '];\n\nmap.option =\nmap.optgroup = [1, ''];\n\nmap.thead =\nmap.tbody =\nmap.colgroup =\nmap.caption =\nmap.tfoot = [1, '', '
    '];\n\nmap.polyline =\nmap.ellipse =\nmap.polygon =\nmap.circle =\nmap.text =\nmap.line =\nmap.path =\nmap.rect =\nmap.g = [1, '',''];\n\n/**\n * Parse `html` and return a DOM Node instance, which could be a TextNode,\n * HTML DOM Node of some kind (
    for example), or a DocumentFragment\n * instance, depending on the contents of the `html` string.\n *\n * @param {String} html - HTML string to \"domify\"\n * @param {Document} doc - The `document` instance to create the Node for\n * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance\n * @api private\n */\n\nfunction parse(html, doc) {\n if ('string' != typeof html) throw new TypeError('String expected');\n\n // default to the global `document` object\n if (!doc) doc = document;\n\n // tag name\n var m = /<([\\w:]+)/.exec(html);\n if (!m) return doc.createTextNode(html);\n\n html = html.replace(/^\\s+|\\s+$/g, ''); // Remove leading/trailing whitespace\n\n var tag = m[1];\n\n // body support\n if (tag == 'body') {\n var el = doc.createElement('html');\n el.innerHTML = html;\n return el.removeChild(el.lastChild);\n }\n\n // wrap map\n var wrap = map[tag] || map._default;\n var depth = wrap[0];\n var prefix = wrap[1];\n var suffix = wrap[2];\n var el = doc.createElement('div');\n el.innerHTML = prefix + html + suffix;\n while (depth--) el = el.lastChild;\n\n // one element\n if (el.firstChild == el.lastChild) {\n return el.removeChild(el.firstChild);\n }\n\n // several elements\n var fragment = doc.createDocumentFragment();\n while (el.firstChild) {\n fragment.appendChild(el.removeChild(el.firstChild));\n }\n\n return fragment;\n}\n\nfunction query(selector, el) {\n el = el || document;\n\n return el.querySelector(selector);\n}\n\nfunction all(selector, el) {\n el = el || document;\n\n return el.querySelectorAll(selector);\n}\n\nfunction remove(el) {\n el.parentNode && el.parentNode.removeChild(el);\n}\n\nexport { attr, classes, clear, closest, delegate, domify, componentEvent as event, matchesSelector as matches, query, all as queryAll, remove };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n registerClientPlugin,\n registerBpmnJSPlugin\n} from 'camunda-modeler-plugin-helpers';\n\nimport lintingModule from 'bpmn-js-bpmnlint';\n\nimport defaultConfig from '../.bpmnlintrc';\n\nconst persistLintingStateModule = {\n __init__: [\n [ 'eventBus', function (eventBus) {\n\n eventBus.on('linting.toggle', function (event) {\n const {\n active\n } = event;\n\n setLintingActive(active);\n });\n\n } ]\n ]\n};\n\nregisterBpmnJSPlugin({\n __init__: [\n function (linting) {\n linting.setLinterConfig(defaultConfig);\n }\n ]\n});\n\nregisterClientPlugin(config => {\n\n const {\n additionalModules,\n ...rest\n } = config;\n\n return {\n ...rest,\n additionalModules: [\n ...(additionalModules || []),\n lintingModule,\n persistLintingStateModule\n ],\n linting: {\n bpmnlint: defaultConfig,\n active: getLintingActive()\n }\n };\n}, 'bpmn.modeler.configure');\n\n\n// helpers ///////////////\n\nconst LINTING_STATE_KEY = 'camunda-modeler-linter-plugin.active';\n\nfunction getLintingActive() {\n // eslint-disable-next-line\n const str = window.localStorage.getItem(LINTING_STATE_KEY);\n\n return str && JSON.parse(str) || false;\n}\n\nfunction setLintingActive(active) {\n // eslint-disable-next-line\n window.localStorage.setItem(LINTING_STATE_KEY, JSON.stringify(active));\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"client.js","mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AClJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AClcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC/HA;AACA;AACA;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACjDA;AACA;AACA;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AC7pBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACjgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://onify-camunda-modeler-plugin/./bpmnlint-plugin-custom/rules/script-task-error.js","webpack://onify-camunda-modeler-plugin/./bpmnlint-plugin-custom/rules/script-task-warn.js","webpack://onify-camunda-modeler-plugin/./bpmnlint-plugin-custom/rules/service-task-httpRequest-error.js","webpack://onify-camunda-modeler-plugin/./bpmnlint-plugin-custom/rules/service-task-httpRequest-warn.js","webpack://onify-camunda-modeler-plugin/./bpmnlint-plugin-custom/rules/service-task-onifyApiRequest-error.js","webpack://onify-camunda-modeler-plugin/./bpmnlint-plugin-custom/rules/service-task.js","webpack://onify-camunda-modeler-plugin/./bpmnlint-plugin-custom/utils.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmn-js-bpmnlint/dist/index.esm.js","webpack://onify-camunda-modeler-plugin/./.bpmnlintrc","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint-plugin-camunda/rules/forking-conditions.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint-plugin-camunda/rules/no-collapsed-sub-processes.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint-utils/dist/index.esm.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/lib/index.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/lib/linter.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/lib/test-rule.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/lib/traverse.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/conditional-flows.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/end-event-required.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/event-sub-process-typed-start-event.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/fake-join.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/helper.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/label-required.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-bpmndi.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-complex-gateway.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-disconnected.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-duplicate-sequence-flows.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-gateway-join-fork.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-implicit-split.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/no-inclusive-gateway.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/single-blank-start-event.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/single-event-definition.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/start-event-required.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/sub-process-blank-start-event.js","webpack://onify-camunda-modeler-plugin/./node_modules/bpmnlint/rules/superfluous-gateway.js","webpack://onify-camunda-modeler-plugin/./node_modules/camunda-modeler-plugin-helpers/index.js","webpack://onify-camunda-modeler-plugin/./node_modules/css.escape/css.escape.js","webpack://onify-camunda-modeler-plugin/./node_modules/diagram-js/lib/util/EscapeUtil.js","webpack://onify-camunda-modeler-plugin/./node_modules/min-dash/dist/index.esm.js","webpack://onify-camunda-modeler-plugin/./node_modules/min-dom/dist/index.esm.js","webpack://onify-camunda-modeler-plugin/webpack/bootstrap","webpack://onify-camunda-modeler-plugin/webpack/runtime/compat get default export","webpack://onify-camunda-modeler-plugin/webpack/runtime/define property getters","webpack://onify-camunda-modeler-plugin/webpack/runtime/global","webpack://onify-camunda-modeler-plugin/webpack/runtime/hasOwnProperty shorthand","webpack://onify-camunda-modeler-plugin/webpack/runtime/make namespace object","webpack://onify-camunda-modeler-plugin/./client/index.js"],"sourcesContent":["const { is } = require('bpmnlint-utils');\n\n\n/**\n * Rule that reports missing Script format on bpmn:ScriptTask.\n * Script format can supports js or javascript\n */\nmodule.exports = function () {\n\n function check(node, reporter) {\n if (is(node, 'bpmn:ScriptTask')) {\n if (!node.scriptFormat) {\n return reporter.report(node.id, 'Script format must be defined');\n }\n\n if (node.scriptFormat !== 'js' && node.scriptFormat !== 'javascript') {\n return reporter.report(node.id, 'Only `js/javascript` are supported script formats');\n }\n\n if (!node.script) {\n reporter.report(node.id, 'Script must be defined');\n }\n }\n }\n\n return {\n check: check\n };\n};\n","const { is } = require('bpmnlint-utils');\n\n\n/**\n * Rule that reports missing Script format on bpmn:ScriptTask.\n * Script format can supports js or javascript\n */\nmodule.exports = function () {\n\n function check(node, reporter) {\n if (is(node, 'bpmn:ScriptTask') && (node.scriptFormat === 'js' || node.scriptFormat === 'javascript')) {\n if (node.script && !node.script.includes('next()')) {\n reporter.report(node.id, 'next() functions does not exist');\n }\n }\n }\n\n return {\n check: check\n };\n};\n","const { is } = require('bpmnlint-utils');\nconst { findElement } = require('../utils');\n\n/**\n * Rule that reports missing responseType on bpmn:ServiceTask.\n */\nmodule.exports = function () {\n\n function check(node, reporter) {\n if (is(node, 'bpmn:ServiceTask')) {\n const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector');\n\n if (!connector || connector.connectorId !== 'httpRequest') {\n return;\n }\n\n const url = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'url');\n const json = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'json');\n const method = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'method');\n\n if (!url) {\n reporter.report(node.id, 'Connector input parameter `url` must be defined');\n }\n\n if (method && (method.value.toUpperCase() === 'POST' || method.value.toUpperCase() === 'PUT' || method.value.toUpperCase() === 'PATCH') && !json) {\n reporter.report(node.id, 'Connector input parameter `json` must be defined when `method` is POST, PUT or PATCH');\n }\n }\n }\n\n return {\n check: check\n };\n};\n","const { is } = require('bpmnlint-utils');\nconst { findElement } = require('../utils');\n\n/**\n * Rule that reports missing responseType on bpmn:ServiceTask.\n */\nmodule.exports = function () {\n\n function check(node, reporter) {\n if (is(node, 'bpmn:ServiceTask')) {\n const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector');\n\n if (!connector || connector.connectorId !== 'httpRequest') {\n return;\n }\n\n const responseType = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'responseType');\n\n if (!responseType) {\n reporter.report(node.id, 'Connector input parameter `responseType` is not defined');\n }\n }\n }\n\n return {\n check: check\n };\n};\n","const { is } = require('bpmnlint-utils');\nconst { findElement } = require('../utils');\n\n/**\n * Rule for onifyApiRequest and onifyElevatedApiRequest\n */\nmodule.exports = function () {\n\n function check(node, reporter) {\n if (is(node, 'bpmn:ServiceTask')) {\n const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector');\n\n if (!connector || (connector.connectorId !== 'onifyApiRequest' && connector.connectorId !== 'onifyElevatedApiRequest')) {\n return;\n }\n\n const url = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'url');\n const payload = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'payload');\n const method = connector.inputOutput && connector.inputOutput.inputParameters && connector.inputOutput.inputParameters.find((input) => input.name === 'method');\n\n if (!url) {\n reporter.report(node.id, 'Connector input parameter `url` must be defined');\n }\n\n if (method && (method.value.toUpperCase() === 'POST' || method.value.toUpperCase() === 'PUT' || method.value.toUpperCase() === 'PATCH') && !payload) {\n reporter.report(node.id, 'Connector input parameter `payload` must be defined when `method` is POST, PUT or PATCH');\n }\n }\n }\n\n return {\n check: check\n };\n};\n","const { is } = require('bpmnlint-utils');\nconst { findElement } = require('../utils');\n\n/**\n * Rule that reports missing Implementation on bpmn:ServiceTask.\n * Implementation only supports Connector\n * Connector Id only supports our service tasks (eg. httpRequest, onifyApiRequest, onifyElevatedApiRequest, etc)\n */\nmodule.exports = function () {\n\n function check(node, reporter) {\n if (is(node, 'bpmn:ServiceTask')) {\n const connector = findElement(node.extensionElements && node.extensionElements.values, 'camunda:Connector');\n\n if (!node.extensionElements || !connector) {\n reporter.report(node.id, 'Implementation must be defined');\n return reporter.report(node.id, 'Implementation only supports `Connector`');\n }\n\n if (!connector.connectorId) {\n return reporter.report(node.id, 'Connector Id must be defined');\n }\n\n if (connector.connectorId !== 'httpRequest' && connector.connectorId !== 'onifyApiRequest' && connector.connectorId !== 'onifyElevatedApiRequest') {\n return reporter.report(node.id, 'Connector Id only supports `httpRequest`, `onifyApiRequest` and `onifyElevatedApiRequest`');\n }\n }\n }\n\n return {\n check: check\n };\n};\n","const {\n is\n} = require('bpmnlint-utils');\n\nmodule.exports = {\n findElement,\n};\n\nfunction findElement(elements, name) {\n if (!elements || !elements.length) return false;\n return elements.find((element) => is(element, name));\n}\n","import { Linter } from 'bpmnlint';\nimport { reduce, map, groupBy, assign } from 'min-dash';\nimport { domify } from 'min-dom';\nimport { escapeHTML } from 'diagram-js/lib/util/EscapeUtil';\n\nfunction EditorActions(injector, linting) {\n var editorActions = injector.get('editorActions', false);\n\n editorActions && editorActions.register({\n toggleLinting: function() {\n linting.toggle();\n }\n });\n}\n\nEditorActions.$inject = [\n 'injector',\n 'linting'\n];\n\nvar ErrorSvg = \"\";\n\nvar WarningSvg = \"\";\n\nvar SuccessSvg = \"\";\n\nvar OFFSET_TOP = -7,\r\n OFFSET_RIGHT = -7;\r\n\r\nvar LOW_PRIORITY = 500;\r\n\r\nvar emptyConfig = {\r\n resolver: {\r\n resolveRule: function() {\r\n return null;\r\n }\r\n },\r\n config: {}\r\n};\r\n\r\nvar stateToIcon = {\r\n error: ErrorSvg,\r\n warning: WarningSvg,\r\n success: SuccessSvg,\r\n inactive: SuccessSvg\r\n};\r\n\r\nfunction Linting(\r\n bpmnjs,\r\n canvas,\r\n config,\r\n elementRegistry,\r\n eventBus,\r\n overlays,\r\n translate\r\n) {\r\n this._bpmnjs = bpmnjs;\r\n this._canvas = canvas;\r\n this._elementRegistry = elementRegistry;\r\n this._eventBus = eventBus;\r\n this._overlays = overlays;\r\n this._translate = translate;\r\n\r\n this._issues = {};\r\n\r\n this._active = config && config.active || false;\r\n this._linterConfig = emptyConfig;\r\n\r\n this._overlayIds = {};\r\n\r\n var self = this;\r\n\r\n eventBus.on([\r\n 'import.done',\r\n 'elements.changed',\r\n 'linting.configChanged',\r\n 'linting.toggle'\r\n ], LOW_PRIORITY, function(e) {\r\n if (self.isActive()) {\r\n self.update();\r\n }\r\n });\r\n\r\n eventBus.on('linting.toggle', function(event) {\r\n\r\n const active = event.active;\r\n\r\n if (!active) {\r\n self._clearIssues();\r\n self._updateButton();\r\n }\r\n });\r\n\r\n eventBus.on('diagram.clear', function() {\r\n self._clearIssues();\r\n });\r\n\r\n var linterConfig = config && config.bpmnlint;\r\n\r\n linterConfig && eventBus.once('diagram.init', function() {\r\n\r\n // bail out if config was already provided\r\n // during initialization of other modules\r\n if (self.getLinterConfig() !== emptyConfig) {\r\n return;\r\n }\r\n\r\n try {\r\n self.setLinterConfig(linterConfig);\r\n } catch (err) {\r\n console.error(\r\n '[bpmn-js-bpmnlint] Invalid lint rules configured. ' +\r\n 'Please doublecheck your linting.bpmnlint configuration, ' +\r\n 'cf. https://github.com/bpmn-io/bpmn-js-bpmnlint#configure-lint-rules'\r\n );\r\n }\r\n });\r\n\r\n this._init();\r\n}\r\n\r\nLinting.prototype.setLinterConfig = function(linterConfig) {\r\n\r\n if (!linterConfig.config || !linterConfig.resolver) {\r\n throw new Error('Expected linterConfig = { config, resolver }');\r\n }\r\n\r\n this._linterConfig = linterConfig;\r\n\r\n this._eventBus.fire('linting.configChanged');\r\n};\r\n\r\nLinting.prototype.getLinterConfig = function() {\r\n return this._linterConfig;\r\n};\r\n\r\nLinting.prototype._init = function() {\r\n this._createButton();\r\n\r\n this._updateButton();\r\n};\r\n\r\nLinting.prototype.isActive = function() {\r\n return this._active;\r\n};\r\n\r\nLinting.prototype._formatIssues = function(issues) {\r\n\r\n let self = this;\r\n\r\n // (1) reduce issues to flat list of issues including the affected element\r\n let reports = reduce(issues, function(reports, ruleReports, rule) {\r\n\r\n return reports.concat(ruleReports.map(function(report) {\r\n report.rule = rule;\r\n\r\n return report;\r\n }));\r\n\r\n }, []);\r\n\r\n // (2) if affected element is not visible, then report it on root level\r\n reports = map(reports, function(report) {\r\n const element = self._elementRegistry.get(report.id);\r\n\r\n if (!element) {\r\n report.isChildIssue = true;\r\n report.actualElementId = report.id;\r\n\r\n report.id = self._canvas.getRootElement().id;\r\n }\r\n\r\n return report;\r\n });\r\n\r\n // (3) group issues per elementId (resulting in ie. [elementId1: [{issue1}, {issue2}]] structure)\r\n reports = groupBy(reports, function(report) {\r\n return report.id;\r\n });\r\n\r\n return reports;\r\n};\r\n\r\n/**\r\n * Toggle linting on or off.\r\n *\r\n * @param {boolean} [newActive]\r\n *\r\n * @return {boolean} the new active state\r\n */\r\nLinting.prototype.toggle = function(newActive) {\r\n\r\n newActive = typeof newActive === 'undefined' ? !this.isActive() : newActive;\r\n\r\n this._setActive(newActive);\r\n\r\n return newActive;\r\n};\r\n\r\nLinting.prototype._setActive = function(active) {\r\n\r\n if (this._active === active) {\r\n return;\r\n }\r\n\r\n this._active = active;\r\n\r\n this._eventBus.fire('linting.toggle', { active: active });\r\n};\r\n\r\n/**\r\n * Update overlays. Always lint and check wether overlays need update or not.\r\n */\r\nLinting.prototype.update = function() {\r\n var self = this;\r\n\r\n var definitions = this._bpmnjs.getDefinitions();\r\n\r\n if (!definitions) {\r\n return;\r\n }\r\n\r\n var lintStart = this._lintStart = Math.random();\r\n\r\n this.lint().then(function(newIssues) {\r\n\r\n if (self._lintStart !== lintStart) {\r\n return;\r\n }\r\n\r\n newIssues = self._formatIssues(newIssues);\r\n\r\n var remove = {},\r\n update = {},\r\n add = {};\r\n\r\n for (var id1 in self._issues) {\r\n if (!newIssues[id1]) {\r\n remove[id1] = self._issues[id1];\r\n }\r\n }\r\n\r\n for (var id2 in newIssues) {\r\n if (!self._issues[id2]) {\r\n add[id2] = newIssues[id2];\r\n } else {\r\n if (newIssues[id2] !== self._issues[id2]) {\r\n update[id2] = newIssues[id2];\r\n }\r\n }\r\n }\r\n\r\n remove = assign(remove, update);\r\n add = assign(add, update);\r\n\r\n self._clearOverlays();\r\n self._createIssues(add);\r\n\r\n self._issues = newIssues;\r\n\r\n self._updateButton();\r\n\r\n self._fireComplete(newIssues);\r\n });\r\n};\r\n\r\nLinting.prototype._fireComplete = function(issues) {\r\n this._eventBus.fire('linting.completed', { issues: issues });\r\n};\r\n\r\nLinting.prototype._createIssues = function(issues) {\r\n for (var id in issues) {\r\n this._createElementIssues(id, issues[id]);\r\n }\r\n};\r\n\r\n/**\r\n * Create overlay including all issues which are given for a single element.\r\n *\r\n * @param {string} elementId - id of element, for which the issue shall be displayed.\r\n * @param {Array} elementIssues - All element issues including warnings and errors.\r\n */\r\nLinting.prototype._createElementIssues = function(elementId, elementIssues) {\r\n var element = this._elementRegistry.get(elementId);\r\n\r\n if (!element) {\r\n return;\r\n }\r\n\r\n var menuPosition;\r\n var position;\r\n\r\n if (element === this._canvas.getRootElement()) {\r\n menuPosition = 'bottom-right';\r\n\r\n position = {\r\n top: 20,\r\n left: 150\r\n };\r\n } else {\r\n menuPosition = 'top-right';\r\n\r\n position = {\r\n top: OFFSET_TOP,\r\n left: OFFSET_RIGHT\r\n };\r\n }\r\n\r\n var issuesByType = groupBy(elementIssues, function(elementIssue) {\r\n return (elementIssue.isChildIssue ? 'child' : '') + elementIssue.category;\r\n });\r\n\r\n var errors = issuesByType.error,\r\n warnings = issuesByType.warn,\r\n childErrors = issuesByType.childerror,\r\n childWarnings = issuesByType.childwarning;\r\n\r\n if (!errors && !warnings && !childErrors && !childWarnings) {\r\n return;\r\n }\r\n\r\n var $html = domify(\r\n '
    '\r\n );\r\n\r\n var $icon = (errors || childErrors)\r\n ? domify('
    ' + ErrorSvg + '
    ')\r\n : domify('
    ' + WarningSvg + '
    ');\r\n\r\n var $dropdown = domify('
    ');\r\n var $dropdownContent = domify('
    ');\r\n\r\n var $issueContainer = domify('
    ');\r\n\r\n var $issues = domify('
    ');\r\n var $issueList = domify('
      ');\r\n\r\n $html.appendChild($icon);\r\n $html.appendChild($dropdown);\r\n\r\n $dropdown.appendChild($dropdownContent);\r\n $dropdownContent.appendChild($issueContainer);\r\n\r\n $issueContainer.appendChild($issues);\r\n\r\n $issues.appendChild($issueList);\r\n\r\n // Add errors and warnings to issueList\r\n if (errors) {\r\n this._addErrors($issueList, errors);\r\n }\r\n\r\n if (warnings) {\r\n this._addWarnings($issueList, warnings);\r\n }\r\n\r\n // If errors or warnings for child elements of the current element are to be displayed,\r\n // then add an additional list\r\n if (childErrors || childWarnings) {\r\n var $childIssues = domify('
      ');\r\n var $childIssueList = domify('
        ');\r\n var $childIssueLabel = domify('Issues for child elements:');\r\n\r\n if (childErrors) {\r\n this._addErrors($childIssueList, childErrors);\r\n }\r\n\r\n if (childWarnings) {\r\n this._addWarnings($childIssueList, childWarnings);\r\n }\r\n\r\n if (errors || warnings) {\r\n var $childIssuesSeperator = domify('
        ');\r\n $childIssues.appendChild($childIssuesSeperator);\r\n }\r\n\r\n $childIssues.appendChild($childIssueLabel);\r\n $childIssues.appendChild($childIssueList);\r\n $issueContainer.appendChild($childIssues);\r\n }\r\n\r\n this._overlayIds[elementId] = this._overlays.add(element, 'linting', {\r\n position: position,\r\n html: $html,\r\n scale: {\r\n min: .9\r\n }\r\n });\r\n};\r\n\r\nLinting.prototype._addErrors = function($ul, errors) {\r\n\r\n var self = this;\r\n\r\n errors.forEach(function(error) {\r\n self._addEntry($ul, 'error', error);\r\n });\r\n};\r\n\r\nLinting.prototype._addWarnings = function($ul, warnings) {\r\n\r\n var self = this;\r\n\r\n warnings.forEach(function(error) {\r\n self._addEntry($ul, 'warning', error);\r\n });\r\n};\r\n\r\nLinting.prototype._addEntry = function($ul, state, entry) {\r\n\r\n var rule = entry.rule,\r\n message = this._translate(entry.message),\r\n actualElementId = entry.actualElementId;\r\n\r\n var icon = stateToIcon[state];\r\n\r\n var $entry = domify(\r\n '
      • ' +\r\n ' ' + icon + '' +\r\n '' +\r\n escapeHTML(message) +\r\n '' +\r\n (actualElementId\r\n ? '' + actualElementId + ''\r\n : '') +\r\n '
      • '\r\n );\r\n\r\n $ul.appendChild($entry);\r\n};\r\n\r\nLinting.prototype._clearOverlays = function() {\r\n this._overlays.remove({ type: 'linting' });\r\n\r\n this._overlayIds = {};\r\n};\r\n\r\nLinting.prototype._clearIssues = function() {\r\n this._issues = {};\r\n\r\n this._clearOverlays();\r\n};\r\n\r\nLinting.prototype._setButtonState = function(state, errors, warnings) {\r\n var button = this._button;\r\n\r\n var icon = stateToIcon[state];\r\n\r\n var html = icon + '' + this._translate('{errors} Errors, {warnings} Warnings', { errors: errors.toString(), warnings: warnings.toString() }) + '';\r\n\r\n [\r\n 'error',\r\n 'inactive',\r\n 'success',\r\n 'warning'\r\n ].forEach(function(s) {\r\n if (state === s) {\r\n button.classList.add('bjsl-button-' + s);\r\n } else {\r\n button.classList.remove('bjsl-button-' + s);\r\n }\r\n });\r\n\r\n button.innerHTML = html;\r\n};\r\n\r\nLinting.prototype._updateButton = function() {\r\n\r\n if (!this.isActive()) {\r\n this._setButtonState('inactive', 0, 0);\r\n\r\n return;\r\n }\r\n\r\n var errors = 0,\r\n warnings = 0;\r\n\r\n for (var id in this._issues) {\r\n this._issues[id].forEach(function(issue) {\r\n if (issue.category === 'error') {\r\n errors++;\r\n } else if (issue.category === 'warn') {\r\n warnings++;\r\n }\r\n });\r\n }\r\n\r\n var state = (errors && 'error') || (warnings && 'warning') || 'success';\r\n\r\n this._setButtonState(state, errors, warnings);\r\n};\r\n\r\nLinting.prototype._createButton = function() {\r\n\r\n var self = this;\r\n\r\n this._button = domify(\r\n ''\r\n );\r\n\r\n this._button.addEventListener('click', function() {\r\n self.toggle();\r\n });\r\n\r\n this._canvas.getContainer().appendChild(this._button);\r\n};\r\n\r\nLinting.prototype.lint = function() {\r\n var definitions = this._bpmnjs.getDefinitions();\r\n\r\n var linter = new Linter(this._linterConfig);\r\n\r\n return linter.lint(definitions);\r\n};\r\n\r\nLinting.$inject = [\r\n 'bpmnjs',\r\n 'canvas',\r\n 'config.linting',\r\n 'elementRegistry',\r\n 'eventBus',\r\n 'overlays',\r\n 'translate'\r\n];\n\nvar index = {\r\n __init__: [ 'linting', 'lintingEditorActions' ],\r\n linting: [ 'type', Linting ],\r\n lintingEditorActions: ['type', EditorActions ]\r\n};\n\nexport default index;\n//# sourceMappingURL=index.esm.js.map\n","\nconst cache = {};\n\n/**\n * A resolver that caches rules and configuration as part of the bundle,\n * making them accessible in the browser.\n *\n * @param {Object} cache\n */\nfunction Resolver() {}\n\nResolver.prototype.resolveRule = function(pkg, ruleName) {\n\n const rule = cache[pkg + '/' + ruleName];\n\n if (!rule) {\n throw new Error('cannot resolve rule <' + pkg + '/' + ruleName + '>');\n }\n\n return rule;\n};\n\nResolver.prototype.resolveConfig = function(pkg, configName) {\n throw new Error(\n 'cannot resolve config <' + configName + '> in <' + pkg +'>'\n );\n};\n\nconst resolver = new Resolver();\n\nconst rules = {\n \"conditional-flows\": \"error\",\n \"end-event-required\": \"error\",\n \"event-sub-process-typed-start-event\": \"error\",\n \"fake-join\": \"warn\",\n \"label-required\": \"on\",\n \"no-bpmndi\": \"error\",\n \"no-complex-gateway\": \"error\",\n \"no-disconnected\": \"error\",\n \"no-duplicate-sequence-flows\": \"error\",\n \"no-gateway-join-fork\": \"error\",\n \"no-implicit-split\": \"error\",\n \"no-inclusive-gateway\": \"error\",\n \"single-blank-start-event\": \"error\",\n \"single-event-definition\": \"error\",\n \"start-event-required\": \"error\",\n \"sub-process-blank-start-event\": \"error\",\n \"superfluous-gateway\": \"warning\",\n \"camunda/forking-conditions\": \"error\",\n \"camunda/no-collapsed-sub-processes\": \"error\",\n \"custom/script-task-error\": \"error\",\n \"custom/script-task-warn\": \"warn\",\n \"custom/service-task\": \"error\",\n \"custom/service-task-httpRequest-error\": \"error\",\n \"custom/service-task-httpRequest-warn\": \"warn\",\n \"custom/service-task-onifyApiRequest-error\": \"error\"\n};\n\nconst config = {\n rules: rules\n};\n\nconst bundle = {\n resolver: resolver,\n config: config\n};\n\nexport { resolver, config };\n\nexport default bundle;\n\n\n\nimport rule_0 from 'bpmnlint/rules/conditional-flows';\ncache['bpmnlint/conditional-flows'] = rule_0;\n\nimport rule_1 from 'bpmnlint/rules/end-event-required';\ncache['bpmnlint/end-event-required'] = rule_1;\n\nimport rule_2 from 'bpmnlint/rules/event-sub-process-typed-start-event';\ncache['bpmnlint/event-sub-process-typed-start-event'] = rule_2;\n\nimport rule_3 from 'bpmnlint/rules/fake-join';\ncache['bpmnlint/fake-join'] = rule_3;\n\nimport rule_4 from 'bpmnlint/rules/label-required';\ncache['bpmnlint/label-required'] = rule_4;\n\nimport rule_5 from 'bpmnlint/rules/no-bpmndi';\ncache['bpmnlint/no-bpmndi'] = rule_5;\n\nimport rule_6 from 'bpmnlint/rules/no-complex-gateway';\ncache['bpmnlint/no-complex-gateway'] = rule_6;\n\nimport rule_7 from 'bpmnlint/rules/no-disconnected';\ncache['bpmnlint/no-disconnected'] = rule_7;\n\nimport rule_8 from 'bpmnlint/rules/no-duplicate-sequence-flows';\ncache['bpmnlint/no-duplicate-sequence-flows'] = rule_8;\n\nimport rule_9 from 'bpmnlint/rules/no-gateway-join-fork';\ncache['bpmnlint/no-gateway-join-fork'] = rule_9;\n\nimport rule_10 from 'bpmnlint/rules/no-implicit-split';\ncache['bpmnlint/no-implicit-split'] = rule_10;\n\nimport rule_11 from 'bpmnlint/rules/no-inclusive-gateway';\ncache['bpmnlint/no-inclusive-gateway'] = rule_11;\n\nimport rule_12 from 'bpmnlint/rules/single-blank-start-event';\ncache['bpmnlint/single-blank-start-event'] = rule_12;\n\nimport rule_13 from 'bpmnlint/rules/single-event-definition';\ncache['bpmnlint/single-event-definition'] = rule_13;\n\nimport rule_14 from 'bpmnlint/rules/start-event-required';\ncache['bpmnlint/start-event-required'] = rule_14;\n\nimport rule_15 from 'bpmnlint/rules/sub-process-blank-start-event';\ncache['bpmnlint/sub-process-blank-start-event'] = rule_15;\n\nimport rule_16 from 'bpmnlint/rules/superfluous-gateway';\ncache['bpmnlint/superfluous-gateway'] = rule_16;\n\nimport rule_17 from 'bpmnlint-plugin-camunda/rules/forking-conditions';\ncache['bpmnlint-plugin-camunda/forking-conditions'] = rule_17;\n\nimport rule_18 from 'bpmnlint-plugin-camunda/rules/no-collapsed-sub-processes';\ncache['bpmnlint-plugin-camunda/no-collapsed-sub-processes'] = rule_18;\n\nimport rule_19 from 'bpmnlint-plugin-custom/rules/script-task-error';\ncache['bpmnlint-plugin-custom/script-task-error'] = rule_19;\n\nimport rule_20 from 'bpmnlint-plugin-custom/rules/script-task-warn';\ncache['bpmnlint-plugin-custom/script-task-warn'] = rule_20;\n\nimport rule_21 from 'bpmnlint-plugin-custom/rules/service-task';\ncache['bpmnlint-plugin-custom/service-task'] = rule_21;\n\nimport rule_22 from 'bpmnlint-plugin-custom/rules/service-task-httpRequest-error';\ncache['bpmnlint-plugin-custom/service-task-httpRequest-error'] = rule_22;\n\nimport rule_23 from 'bpmnlint-plugin-custom/rules/service-task-httpRequest-warn';\ncache['bpmnlint-plugin-custom/service-task-httpRequest-warn'] = rule_23;\n\nimport rule_24 from 'bpmnlint-plugin-custom/rules/service-task-onifyApiRequest-error';\ncache['bpmnlint-plugin-custom/service-task-onifyApiRequest-error'] = rule_24;","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * A rule that checks that sequence flows after\n * an exclusive forking gateway have conditions\n * attached.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n const outgoing = node.outgoing || [];\n\n if (!is(node, 'bpmn:ExclusiveGateway') || outgoing.length < 2) {\n return;\n }\n\n outgoing.forEach((flow) => {\n const missingCondition = (\n !hasCondition(flow) &&\n !isDefaultFlow(node, flow)\n );\n\n if (missingCondition) {\n reporter.report(flow.id, 'Sequence flow is missing condition');\n }\n });\n }\n\n return {\n check\n };\n\n};\n\n\n// helpers /////////////////////////////\n\nfunction hasCondition(flow) {\n return !!flow.conditionExpression;\n}\n\nfunction isDefaultFlow(node, flow) {\n return node['default'] === flow;\n}","const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * Rule that reports the usage of collapsed sub-processes.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n if (is(node, 'bpmndi:BPMNShape')) {\n\n const bpmnElement = node.bpmnElement;\n\n if (is(bpmnElement, 'bpmn:SubProcess') && !node.isExpanded) {\n reporter.report(bpmnElement.id, 'Sub-process should be expanded');\n }\n }\n }\n\n return {\n check: check\n };\n};\n","/**\n * Checks whether node is of specific bpmn type.\n *\n * @param {ModdleElement} node\n * @param {String} type\n *\n * @return {Boolean}\n */\nfunction is(node, type) {\n\n if (type.indexOf(':') === -1) {\n type = 'bpmn:' + type;\n }\n\n return (\n (typeof node.$instanceOf === 'function')\n ? node.$instanceOf(type)\n : node.$type === type\n );\n}\n\n/**\n * Checks whether node has any of the specified types.\n *\n * @param {ModdleElement} node\n * @param {Array} types\n *\n * @return {Boolean}\n */\nfunction isAny(node, types) {\n return types.some(function(type) {\n return is(node, type);\n });\n}\n\nexport { is, isAny };\n//# sourceMappingURL=index.esm.js.map\n","const Linter = require('./linter');\n\nmodule.exports = {\n Linter\n};","const testRule = require('./test-rule');\n\nconst categoryMap = {\n 0: 'off',\n 1: 'warn',\n 2: 'error'\n};\n\n\nfunction Linter(options = {}) {\n\n const {\n config,\n resolver\n } = options;\n\n if (typeof resolver === 'undefined') {\n throw new Error('must provide ');\n }\n\n this.config = config;\n this.resolver = resolver;\n\n this.cachedRules = {};\n this.cachedConfigs = {};\n}\n\n\nmodule.exports = Linter;\n\n/**\n * Applies a rule on the moddleRoot and adds reports to the finalReport\n *\n * @param {ModdleElement} moddleRoot\n *\n * @param {Object} ruleDefinition.name\n * @param {Object} ruleDefinition.config\n * @param {Object} ruleDefinition.category\n * @param {Rule} ruleDefinition.rule\n *\n * @return {Array} rule reports\n */\nLinter.prototype.applyRule = function applyRule(moddleRoot, ruleDefinition) {\n\n const {\n config,\n rule,\n category,\n name\n } = ruleDefinition;\n\n try {\n\n const reports = testRule({\n moddleRoot,\n rule,\n config\n });\n\n return reports.map(function(report) {\n return {\n ...report,\n category\n };\n });\n } catch (e) {\n console.error('rule <' + name + '> failed with error: ', e);\n\n return [\n {\n message: 'Rule error: ' + e.message,\n category: 'error'\n }\n ];\n }\n\n};\n\n\nLinter.prototype.resolveRule = function(name) {\n\n const {\n pkg,\n ruleName\n } = this.parseRuleName(name);\n\n const id = `${pkg}-${ruleName}`;\n\n const rule = this.cachedRules[id];\n\n if (rule) {\n return Promise.resolve(rule);\n }\n\n return Promise.resolve(this.resolver.resolveRule(pkg, ruleName)).then((ruleFactory) => {\n\n if (!ruleFactory) {\n throw new Error(`unknown rule <${name}>`);\n }\n\n const rule = this.cachedRules[id] = ruleFactory();\n\n return rule;\n });\n};\n\nLinter.prototype.resolveConfig = function(name) {\n\n const {\n pkg,\n configName\n } = this.parseConfigName(name);\n\n const id = `${pkg}-${configName}`;\n\n const config = this.cachedConfigs[id];\n\n if (config) {\n return Promise.resolve(config);\n }\n\n return Promise.resolve(this.resolver.resolveConfig(pkg, configName)).then((config) => {\n\n if (!config) {\n throw new Error(`unknown config <${name}>`);\n }\n\n const actualConfig = this.cachedConfigs[id] = this.normalizeConfig(config, pkg);\n\n return actualConfig;\n });\n};\n\n/**\n * Take a linter config and return list of resolved rules.\n *\n * @param {Object} config\n *\n * @return {Array}\n */\nLinter.prototype.resolveRules = function(config) {\n\n return this.resolveConfiguredRules(config).then((rulesConfig) => {\n\n // parse rule values\n const parsedRules = Object.entries(rulesConfig).map(([ name, value ]) => {\n const {\n category,\n config\n } = this.parseRuleValue(value);\n\n return {\n name,\n category,\n config\n };\n });\n\n // filter only for enabled rules\n const enabledRules = parsedRules.filter(definition => definition.category !== 'off');\n\n // load enabled rules\n const loaders = enabledRules.map((definition) => {\n\n const {\n name\n } = definition;\n\n return this.resolveRule(name).then(function(rule) {\n return {\n ...definition,\n rule\n };\n });\n });\n\n return Promise.all(loaders);\n });\n};\n\n\nLinter.prototype.resolveConfiguredRules = function(config) {\n\n let parents = config.extends;\n\n if (typeof parents === 'string') {\n parents = [ parents ];\n }\n\n if (typeof parents === 'undefined') {\n parents = [];\n }\n\n return Promise.all(\n parents.map((configName) => {\n return this.resolveConfig(configName).then((config) => {\n return this.resolveConfiguredRules(config);\n });\n })\n ).then((inheritedRules) => {\n\n const overrideRules = this.normalizeConfig(config, 'bpmnlint').rules;\n\n const rules = [ ...inheritedRules, overrideRules ].reduce((rules, currentRules) => {\n return {\n ...rules,\n ...currentRules\n };\n }, {});\n\n return rules;\n });\n};\n\n\n/**\n * Lint the given model root, using the specified linter config.\n *\n * @param {ModdleElement} moddleRoot\n * @param {Object} [config] the bpmnlint configuration to use\n *\n * @return {Object} lint results, keyed by category names\n */\nLinter.prototype.lint = function(moddleRoot, config) {\n\n config = config || this.config;\n\n // load rules\n return this.resolveRules(config).then((ruleDefinitions) => {\n\n const allReports = {};\n\n ruleDefinitions.forEach((ruleDefinition) => {\n\n const {\n name\n } = ruleDefinition;\n\n const reports = this.applyRule(moddleRoot, ruleDefinition);\n\n if (reports.length) {\n allReports[name] = reports;\n }\n });\n\n return allReports;\n });\n};\n\n\nLinter.prototype.parseRuleValue = function(value) {\n\n let category;\n let config;\n\n if (Array.isArray(value)) {\n category = value[0];\n config = value[1];\n } else {\n category = value;\n config = {};\n }\n\n // normalize rule flag to and which\n // may be upper case or a number at this point\n if (typeof category === 'string') {\n category = category.toLowerCase();\n }\n\n category = categoryMap[category] || category;\n\n return {\n config,\n category\n };\n};\n\nLinter.prototype.parseRuleName = function(name, localPackage = 'bpmnlint') {\n\n /**\n * We recognize the following rule name patterns:\n *\n * {RULE_NAME} => PKG = 'bpmnlint'\n * bpmnlint/{RULE_NAME} => PKG = 'bpmnlint'\n * {PACKAGE_SHORTCUT}/{RULE_NAME} => PKG = 'bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * bpmnlint-plugin-{PACKAGE_SHORTCUT}/{RULE_NAME} => PKG = 'bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * @scope/{PACKAGE_SHORTCUT}/{RULE_NAME} => PKG = '@scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * @scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}/{RULE_NAME} => PKG = '@scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n */\n\n const match = /^(?:(?:(@[^/]+)\\/)?([^@]{1}[^/]*)\\/)?([^/]+)$/.exec(name);\n\n if (!match) {\n throw new Error(`unparseable rule name <${name}>`);\n }\n\n const [\n _,\n ns,\n packageName,\n ruleName\n ] = match;\n\n if (!packageName) {\n return {\n pkg: localPackage,\n ruleName\n };\n }\n\n const pkg = `${ns ? ns + '/' : '' }${prefixPackage(packageName)}`;\n\n return {\n pkg,\n ruleName\n };\n};\n\n\nLinter.prototype.parseConfigName = function(name) {\n\n /**\n * We recognize the following config name patterns:\n *\n * bpmnlint:{CONFIG_NAME} => PKG = 'bpmnlint'\n * plugin:{PACKAGE_SHORTCUT}/{CONFIG_NAME} => PKG = 'bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * plugin:bpmnlint-plugin-{PACKAGE_SHORTCUT}/{CONFIG_NAME} => PKG = 'bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * plugin:@scope/{PACKAGE_SHORTCUT}/{CONFIG_NAME} => PKG = '@scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n * plugin:@scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}/{CONFIG_NAME} => PKG = '@scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}'\n */\n\n const match = /^(?:(?:plugin:(?:(@[^/]+)\\/)?([^@]{1}[^/]*)\\/)|bpmnlint:)([^/]+)$/.exec(name);\n\n if (!match) {\n throw new Error(`unparseable config name <${name}>`);\n }\n\n const [\n _,\n ns,\n packageName,\n configName\n ] = match;\n\n if (!packageName) {\n return {\n pkg: 'bpmnlint',\n configName\n };\n }\n\n const pkg = `${ns ? ns + '/' : '' }${prefixPackage(packageName)}`;\n\n return {\n pkg,\n configName\n };\n};\n\n\nLinter.prototype.getSimplePackageName = function(name) {\n\n /**\n * We recognize the following package name patterns:\n *\n * bpmnlint => PKG = 'bpmnlint'\n * {PACKAGE_SHORTCUT} => PKG = PACKAGE_SHORTCUT\n * bpmnlint-plugin-{PACKAGE_SHORTCUT}' => PKG = PACKAGE_SHORTCUT\n * @scope/{PACKAGE_SHORTCUT} => PKG = '@scope/{PACKAGE_SHORTCUT}'\n * @scope/bpmnlint-plugin-{PACKAGE_SHORTCUT}' => PKG = '@scope/PACKAGE_SHORTCUT'\n */\n\n const match = /^(?:(@[^/]+)\\/)?([^/]+)$/.exec(name);\n\n if (!match) {\n throw new Error(`unparseable package name <${name}>`);\n }\n\n const [\n _,\n ns,\n packageName\n ] = match;\n\n return `${ns ? ns + '/' : '' }${unprefixPackage(packageName)}`;\n};\n\n\n/**\n * Validate and return validated config.\n *\n * @param {Object} config\n * @param {String} localPackage\n *\n * @return {Object} validated config\n */\nLinter.prototype.normalizeConfig = function(config, localPackage) {\n\n const rules = config.rules || {};\n\n const validatedRules = Object.keys(rules).reduce((normalizedRules, name) => {\n\n const value = rules[name];\n\n const {\n pkg,\n ruleName\n } = this.parseRuleName(name, localPackage);\n\n const normalizedName = (\n pkg === 'bpmnlint'\n ? ruleName\n : `${this.getSimplePackageName(pkg)}/${ruleName}`\n );\n\n normalizedRules[normalizedName] = value;\n\n return normalizedRules;\n }, {});\n\n return {\n ...config,\n rules: validatedRules\n };\n};\n\n\n// helpers ///////////////////////////\n\nfunction prefixPackage(pkg) {\n\n if (pkg === 'bpmnlint') {\n return 'bpmnlint';\n }\n\n if (pkg.startsWith('bpmnlint-plugin-')) {\n return pkg;\n }\n\n return `bpmnlint-plugin-${pkg}`;\n}\n\n\nfunction unprefixPackage(pkg) {\n\n if (pkg.startsWith('bpmnlint-plugin-')) {\n return pkg.substring('bpmnlint-plugin-'.length);\n }\n\n return pkg;\n}","const traverse = require('./traverse');\n\nclass Reporter {\n constructor({ moddleRoot, rule }) {\n this.rule = rule;\n this.moddleRoot = moddleRoot;\n this.messages = [];\n this.report = this.report.bind(this);\n }\n\n report(id, message) {\n this.messages.push({ id, message });\n }\n}\n\nmodule.exports = function testRule({ moddleRoot, rule }) {\n const reporter = new Reporter({ rule, moddleRoot });\n\n const check = rule.check;\n\n const enter = check && check.enter || check;\n const leave = check && check.leave;\n\n if (!enter && !leave) {\n throw new Error('no check implemented');\n }\n\n traverse(moddleRoot, {\n enter: enter ? (node) => enter(node, reporter) : null,\n leave: leave ? (node) => leave(node, reporter) : null\n });\n\n return reporter.messages;\n};\n","/**\n * Traverse a moddle tree, depth first from top to bottom\n * and call the passed visitor fn.\n *\n * @param {ModdleElement} element\n * @param {{ enter?: Function; leave?: Function }} options\n */\nmodule.exports = function traverse(element, options) {\n\n const enter = options.enter || null;\n const leave = options.leave || null;\n\n const enterSubTree = enter && enter(element);\n\n const descriptor = element.$descriptor;\n\n if (enterSubTree !== false && !descriptor.isGeneric) {\n\n const containedProperties = descriptor.properties.filter(p => {\n return !p.isAttr && !p.isReference && p.type !== 'String';\n });\n\n containedProperties.forEach(p => {\n if (p.name in element) {\n const propertyValue = element[p.name];\n\n if (p.isMany) {\n propertyValue.forEach(child => {\n traverse(child, options);\n });\n } else {\n traverse(propertyValue, options);\n }\n }\n });\n }\n\n leave && leave(element);\n};\n","/**\n * A rule that checks that sequence flows outgoing from a\n * conditional forking gateway or activity are\n * either default flows _or_ have a condition attached\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!isConditionalForking(node)) {\n return;\n }\n\n const outgoing = node.outgoing || [];\n\n outgoing.forEach((flow) => {\n const missingCondition = (\n !hasCondition(flow) &&\n !isDefaultFlow(node, flow)\n );\n\n if (missingCondition) {\n reporter.report(flow.id, 'Sequence flow is missing condition');\n }\n });\n }\n\n return {\n check\n };\n\n};\n\n\n// helpers /////////////////////////////\n\nfunction isConditionalForking(node) {\n\n const defaultFlow = node['default'];\n const outgoing = node.outgoing || [];\n\n return defaultFlow || outgoing.find(hasCondition);\n}\n\nfunction hasCondition(flow) {\n return !!flow.conditionExpression;\n}\n\nfunction isDefaultFlow(node, flow) {\n return node['default'] === flow;\n}","const {\n is,\n isAny\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks the presence of an end event per scope.\n */\nmodule.exports = function() {\n\n function hasEndEvent(node) {\n const flowElements = node.flowElements || [];\n\n return (\n flowElements.some(node => is(node, 'bpmn:EndEvent'))\n );\n }\n\n function check(node, reporter) {\n\n if (!isAny(node, [\n 'bpmn:Process',\n 'bpmn:SubProcess'\n ])) {\n return;\n }\n\n if (!hasEndEvent(node)) {\n const type = is(node, 'bpmn:SubProcess') ? 'Sub process' : 'Process';\n\n reporter.report(node.id, type + ' is missing end event');\n }\n }\n\n return { check };\n};\n","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * A rule that checks that start events inside an event sub-process\n * are typed.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:SubProcess') || !node.triggeredByEvent) {\n return;\n }\n\n const flowElements = node.flowElements || [];\n\n flowElements.forEach(function(flowElement) {\n\n if (!is(flowElement, 'bpmn:StartEvent')) {\n return false;\n }\n\n const eventDefinitions = flowElement.eventDefinitions || [];\n\n if (eventDefinitions.length === 0) {\n reporter.report(flowElement.id, 'Start event is missing event definition');\n }\n });\n }\n\n return {\n check\n };\n\n};","const {\n isAny\n} = require('bpmnlint-utils');\n\n/**\n * A rule that checks that no fake join is modeled by attempting\n * to give a task or event join semantics.\n *\n * Users should model a parallel joining gateway\n * to achieve the desired behavior.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!isAny(node, [\n 'bpmn:Task',\n 'bpmn:Event'\n ])) {\n return;\n }\n\n const incoming = node.incoming || [];\n\n if (incoming.length > 1) {\n reporter.report(node.id, 'Incoming flows do not join');\n }\n }\n\n return {\n check\n };\n\n};","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * Create a checker that disallows the given element type.\n *\n * @param {String} type\n *\n * @return {Function} ruleImpl\n */\nfunction disallowNodeType(type) {\n\n return function() {\n\n function check(node, reporter) {\n\n if (is(node, type)) {\n reporter.report(node.id, 'Element has disallowed type <' + type + '>');\n }\n }\n\n return {\n check\n };\n\n };\n\n}\n\nmodule.exports.disallowNodeType = disallowNodeType;","const {\n is,\n isAny\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks the presence of a label.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (isAny(node, [\n 'bpmn:ParallelGateway',\n 'bpmn:EventBasedGateway'\n ])) {\n return;\n }\n\n // ignore joining gateways\n if (is(node, 'bpmn:Gateway') && !isForking(node)) {\n return;\n }\n\n if (is(node, 'bpmn:BoundaryEvent')) {\n return;\n }\n\n // ignore sub-processes\n if (is(node, 'bpmn:SubProcess')) {\n\n // TODO(nikku): better ignore expanded sub-processes only\n return;\n }\n\n // ignore sequence flow without condition\n if (is(node, 'bpmn:SequenceFlow') && !hasCondition(node)) {\n return;\n }\n\n // ignore data objects and artifacts for now\n if (isAny(node, [\n 'bpmn:FlowNode',\n 'bpmn:SequenceFlow',\n 'bpmn:Participant',\n 'bpmn:Lane'\n ])) {\n\n const name = (node.name || '').trim();\n\n if (name.length === 0) {\n reporter.report(node.id, 'Element is missing label/name');\n }\n }\n }\n\n return { check };\n};\n\n\n// helpers ////////////////////////\n\nfunction isForking(node) {\n const outgoing = node.outgoing || [];\n\n return outgoing.length > 1;\n}\n\nfunction hasCondition(node) {\n return node.conditionExpression;\n}","const {\n is\n} = require('bpmnlint-utils');\n\nconst {\n flatten\n} = require('min-dash');\n\n/**\n * A rule that checks that there is no BPMNDI information missing for elements,\n * which require BPMNDI.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:Definitions')) {\n return false;\n }\n\n // (1) Construct array of all BPMN elements\n const bpmnElements = getAllBpmnElements(node.rootElements);\n\n // (2) Filter BPMN elements without visual representation\n const visualBpmnElements = bpmnElements.filter(hasVisualRepresentation);\n\n // (3) Construct array of BPMNDI references\n const diBpmnReferences = getAllDiBpmnReferences(node);\n\n // (4) Report elements without BPMNDI\n visualBpmnElements.forEach((element) => {\n if (diBpmnReferences.indexOf(element.id) === -1) {\n reporter.report(element.id, 'Element is missing bpmndi');\n }\n });\n }\n\n return {\n check\n };\n\n};\n\n\n// helpers /////////////////////////////\n\n/**\n * Get all BPMN elements within a bpmn:Definitions node\n *\n * @param {array} rootElements - An array of Moddle rootElements\n * @return {array} A flat array with all BPMN elements, each represented with { id: elementId, $type: elementType }\n *\n */\nfunction getAllBpmnElements(rootElements) {\n return flatten(rootElements.map((rootElement) => {\n\n // Include\n // * flowElements (e.g., tasks, sequenceFlows),\n // * nested flowElements,\n // * participants,\n // * artifacts (groups),\n // * laneSets\n // * nested laneSets\n // * childLaneSets\n // * nested childLaneSets\n const elements = flatten([].concat(\n rootElement.flowElements || [],\n (rootElement.flowElements && getAllBpmnElements(rootElement.flowElements.filter(hasFlowElements))) || [],\n rootElement.participants || [],\n rootElement.artifacts || [],\n (rootElement.laneSets && rootElement.laneSets[0].lanes) || [],\n (rootElement.laneSets && getAllBpmnElements(rootElement.laneSets[0].lanes.filter(hasChildLaneSet))) || [],\n (rootElement.childLaneSet && rootElement.childLaneSet.lanes) || [],\n (rootElement.childLaneSet && getAllBpmnElements(rootElement.childLaneSet.lanes.filter(hasChildLaneSet))) || []\n ));\n\n if (elements.length > 0) {\n return elements.map((element) => {\n\n return {\n id: element.id,\n $type: element.$type\n };\n });\n } else {\n\n // We are not interested in the rest here (DI)\n return [];\n }\n }));\n}\n\n/**\n * Get all BPMN elements within a bpmn:Definitions node\n *\n * @param {ModdleElement} definitionsNode - A moddleElement representing the\n * bpmn:Definitions element\n * @return {array} A flat array with all BPMNDI element ids part of\n * this bpmn:Definitions node\n *\n */\nfunction getAllDiBpmnReferences(definitionsNode) {\n return flatten(\n definitionsNode.diagrams.map((diagram) => {\n\n const diElements = diagram.plane.planeElement || [];\n\n return diElements.map((element) => {\n\n return element.bpmnElement.id;\n });\n })\n );\n}\n\nfunction hasVisualRepresentation(element) {\n const noVisRepresentation = ['bpmn:DataObject'];\n\n return noVisRepresentation.includes(element.$type) ? false : true;\n}\n\nfunction hasFlowElements(element) {\n return element.flowElements ? true : false;\n}\n\nfunction hasChildLaneSet(element) {\n return element.childLaneSet ? true : false;\n}\n","const disallowNodeType = require('./helper').disallowNodeType;\n\nmodule.exports = disallowNodeType('bpmn:ComplexGateway');","const {\n isAny,\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that verifies that there exists no disconnected\n * flow elements, i.e. elements without incoming\n * _or_ outgoing sequence flows\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!isAny(node, [\n 'bpmn:Task',\n 'bpmn:Gateway',\n 'bpmn:SubProcess',\n 'bpmn:Event'\n ]) || node.triggeredByEvent) {\n return;\n }\n\n // compensation activity and boundary events are\n // linked visually via associations. If these associations\n // exist we are fine, too\n if (isCompensationLinked(node)) {\n return;\n }\n\n const incoming = node.incoming || [];\n const outgoing = node.outgoing || [];\n\n if (!incoming.length && !outgoing.length) {\n reporter.report(node.id, 'Element is not connected');\n }\n }\n\n return {\n check\n };\n};\n\n\n// helpers /////////////////\n\nfunction isCompensationBoundary(node) {\n\n var eventDefinitions = node.eventDefinitions;\n\n if (!is(node, 'bpmn:BoundaryEvent')) {\n return false;\n }\n\n if (!eventDefinitions || eventDefinitions.length !== 1) {\n return false;\n }\n\n return is(eventDefinitions[0], 'bpmn:CompensateEventDefinition');\n}\n\nfunction isCompensationActivity(node) {\n return node.isForCompensation;\n}\n\nfunction isCompensationLinked(node) {\n var source = isCompensationBoundary(node);\n var target = isCompensationActivity(node);\n\n // TODO(nikku): check, whether compensation association exists\n return source || target;\n}","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * A rule that verifies that there are no disconnected\n * flow elements, i.e. elements without incoming\n * _or_ outgoing sequence flows\n */\nmodule.exports = function() {\n\n const keyed = {};\n\n const outgoingReported = {};\n const incomingReported = {};\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:SequenceFlow')) {\n return;\n }\n\n const key = flowKey(node);\n\n if (key in keyed) {\n reporter.report(node.id, 'SequenceFlow is a duplicate');\n\n const sourceId = node.sourceRef.id;\n const targetId = node.targetRef.id;\n\n if (!outgoingReported[sourceId]) {\n reporter.report(sourceId, 'Duplicate outgoing sequence flows');\n\n outgoingReported[sourceId] = true;\n }\n\n if (!incomingReported[targetId]) {\n reporter.report(targetId, 'Duplicate incoming sequence flows');\n\n incomingReported[targetId] = true;\n }\n } else {\n keyed[key] = node;\n }\n }\n\n return {\n check\n };\n\n};\n\n\n// helpers /////////////////\n\nfunction flowKey(flow) {\n const conditionExpression = flow.conditionExpression;\n\n const condition = conditionExpression ? conditionExpression.body : '';\n const source = flow.sourceRef ? flow.sourceRef.id : flow.id;\n const target = flow.targetRef ? flow.targetRef.id : flow.id;\n\n return source + '#' + target + '#' + condition;\n}","const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks, whether a gateway forks and joins\n * at the same time.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:Gateway')) {\n return;\n }\n\n const incoming = node.incoming || [];\n const outgoing = node.outgoing || [];\n\n if (incoming.length > 1 && outgoing.length > 1) {\n reporter.report(node.id, 'Gateway forks and joins');\n }\n }\n\n return {\n check\n };\n\n};","const {\n isAny\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks that no implicit split is modeled\n * starting from a task.\n *\n * users should model the parallel splitting gateway\n * explicitly instead.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!isAny(node, [\n 'bpmn:Task',\n 'bpmn:Event'\n ])) {\n return;\n }\n\n const outgoing = node.outgoing || [];\n\n const outgoingWithoutCondition = outgoing.filter((flow) => {\n return !hasCondition(flow) && !isDefaultFlow(node, flow);\n });\n\n if (outgoingWithoutCondition.length > 1) {\n reporter.report(node.id, 'Flow splits implicitly');\n }\n }\n\n return {\n check\n };\n\n};\n\n\n// helpers /////////////////////////////\n\nfunction hasCondition(flow) {\n return !!flow.conditionExpression;\n}\n\nfunction isDefaultFlow(node, flow) {\n return node['default'] === flow;\n}","const disallowNodeType = require('./helper').disallowNodeType;\n\nmodule.exports = disallowNodeType('bpmn:InclusiveGateway');","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * A rule that checks whether not more than one blank start event\n * exists per scope.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:FlowElementsContainer')) {\n return;\n }\n\n const flowElements = node.flowElements || [];\n\n const blankStartEvents = flowElements.filter(function(flowElement) {\n\n if (!is(flowElement, 'bpmn:StartEvent')) {\n return false;\n }\n\n const eventDefinitions = flowElement.eventDefinitions || [];\n\n return eventDefinitions.length === 0;\n });\n\n if (blankStartEvents.length > 1) {\n const type = is(node, 'bpmn:SubProcess') ? 'Sub process' : 'Process';\n\n reporter.report(node.id, type + ' has multiple blank start events');\n }\n }\n\n return {\n check\n };\n\n};","const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that verifies that an event contains maximum one event definition.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:Event')) {\n return;\n }\n\n const eventDefinitions = node.eventDefinitions || [];\n\n if (eventDefinitions.length > 1) {\n reporter.report(node.id, 'Event has multiple event definitions');\n }\n }\n\n return {\n check\n };\n\n};","const {\n is,\n isAny\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks for the presence of a start event per scope.\n */\nmodule.exports = function() {\n\n function hasStartEvent(node) {\n const flowElements = node.flowElements || [];\n\n return (\n flowElements.some(node => is(node, 'bpmn:StartEvent'))\n );\n }\n\n function check(node, reporter) {\n\n if (!isAny(node, [\n 'bpmn:Process',\n 'bpmn:SubProcess'\n ])) {\n return;\n }\n\n if (!hasStartEvent(node)) {\n const type = is(node, 'bpmn:SubProcess') ? 'Sub process' : 'Process';\n\n reporter.report(node.id, type + ' is missing start event');\n }\n }\n\n return { check };\n};\n","const {\n is\n} = require('bpmnlint-utils');\n\n\n/**\n * A rule that checks that start events inside a normal sub-processes\n * are blank (do not have an event definition).\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:SubProcess') || node.triggeredByEvent) {\n return;\n }\n\n const flowElements = node.flowElements || [];\n\n flowElements.forEach(function(flowElement) {\n\n if (!is(flowElement, 'bpmn:StartEvent')) {\n return false;\n }\n\n const eventDefinitions = flowElement.eventDefinitions || [];\n\n if (eventDefinitions.length > 0) {\n reporter.report(flowElement.id, 'Start event must be blank');\n }\n });\n }\n\n return {\n check\n };\n\n};","const {\n is\n} = require('bpmnlint-utils');\n\n/**\n * A rule that checks, whether a gateway has only one source and target.\n *\n * Those gateways are superfluous since they don't do anything.\n */\nmodule.exports = function() {\n\n function check(node, reporter) {\n\n if (!is(node, 'bpmn:Gateway')) {\n return;\n }\n\n const incoming = node.incoming || [];\n const outgoing = node.outgoing || [];\n\n if (incoming.length === 1 && outgoing.length === 1) {\n reporter.report(node.id, 'Gateway is superfluous. It only has one source and target.');\n }\n }\n\n return {\n check\n };\n\n};","/**\r\n * Validate and register a client plugin.\r\n *\r\n * @param {Object} plugin\r\n * @param {String} type\r\n */\r\nexport function registerClientPlugin(plugin, type) {\r\n var plugins = window.plugins || [];\r\n window.plugins = plugins;\r\n\r\n if (!plugin) {\r\n throw new Error('plugin not specified');\r\n }\r\n\r\n if (!type) {\r\n throw new Error('type not specified');\r\n }\r\n\r\n plugins.push({\r\n plugin: plugin,\r\n type: type\r\n });\r\n}\r\n\r\n/**\r\n * Validate and register a bpmn-js plugin.\r\n *\r\n * @param {Object} module\r\n *\r\n * @example\r\n *\r\n * import {\r\n * registerBpmnJSPlugin\r\n * } from 'camunda-modeler-plugin-helpers';\r\n *\r\n * const BpmnJSModule = {\r\n * __init__: [ 'myService' ],\r\n * myService: [ 'type', ... ]\r\n * };\r\n *\r\n * registerBpmnJSPlugin(BpmnJSModule);\r\n */\r\nexport function registerBpmnJSPlugin(module) {\r\n registerClientPlugin(module, 'bpmn.modeler.additionalModules');\r\n}\r\n\r\n/**\r\n * Validate and register a bpmn-moddle extension plugin.\r\n *\r\n * @param {Object} descriptor\r\n *\r\n * @example\r\n * import {\r\n * registerBpmnJSModdleExtension\r\n * } from 'camunda-modeler-plugin-helpers';\r\n *\r\n * var moddleDescriptor = {\r\n * name: 'my descriptor',\r\n * uri: 'http://example.my.company.localhost/schema/my-descriptor/1.0',\r\n * prefix: 'mydesc',\r\n *\r\n * ...\r\n * };\r\n *\r\n * registerBpmnJSModdleExtension(moddleDescriptor);\r\n */\r\nexport function registerBpmnJSModdleExtension(descriptor) {\r\n registerClientPlugin(descriptor, 'bpmn.modeler.moddleExtension');\r\n}\r\n\r\n/**\r\n * Return the modeler directory, as a string.\r\n *\r\n * @deprecated Will be removed in future Camunda Modeler versions without replacement.\r\n *\r\n * @return {String}\r\n */\r\nexport function getModelerDirectory() {\r\n return window.getModelerDirectory();\r\n}\r\n\r\n/**\r\n * Return the modeler plugin directory, as a string.\r\n *\r\n * @deprecated Will be removed in future Camunda Modeler versions without replacement.\r\n *\r\n * @return {String}\r\n */\r\nexport function getPluginsDirectory() {\r\n return window.getPluginsDirectory();\r\n}","/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */\n;(function(root, factory) {\n\t// https://github.com/umdjs/umd/blob/master/returnExports.js\n\tif (typeof exports == 'object') {\n\t\t// For Node.js.\n\t\tmodule.exports = factory(root);\n\t} else if (typeof define == 'function' && define.amd) {\n\t\t// For AMD. Register as an anonymous module.\n\t\tdefine([], factory.bind(root, root));\n\t} else {\n\t\t// For browser globals (not exposing the function separately).\n\t\tfactory(root);\n\t}\n}(typeof global != 'undefined' ? global : this, function(root) {\n\n\tif (root.CSS && root.CSS.escape) {\n\t\treturn root.CSS.escape;\n\t}\n\n\t// https://drafts.csswg.org/cssom/#serialize-an-identifier\n\tvar cssEscape = function(value) {\n\t\tif (arguments.length == 0) {\n\t\t\tthrow new TypeError('`CSS.escape` requires an argument.');\n\t\t}\n\t\tvar string = String(value);\n\t\tvar length = string.length;\n\t\tvar index = -1;\n\t\tvar codeUnit;\n\t\tvar result = '';\n\t\tvar firstCodeUnit = string.charCodeAt(0);\n\t\twhile (++index < length) {\n\t\t\tcodeUnit = string.charCodeAt(index);\n\t\t\t// Note: there’s no need to special-case astral symbols, surrogate\n\t\t\t// pairs, or lone surrogates.\n\n\t\t\t// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER\n\t\t\t// (U+FFFD).\n\t\t\tif (codeUnit == 0x0000) {\n\t\t\t\tresult += '\\uFFFD';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// If the character is in the range [\\1-\\1F] (U+0001 to U+001F) or is\n\t\t\t\t// U+007F, […]\n\t\t\t\t(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||\n\t\t\t\t// If the character is the first character and is in the range [0-9]\n\t\t\t\t// (U+0030 to U+0039), […]\n\t\t\t\t(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||\n\t\t\t\t// If the character is the second character and is in the range [0-9]\n\t\t\t\t// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]\n\t\t\t\t(\n\t\t\t\t\tindex == 1 &&\n\t\t\t\t\tcodeUnit >= 0x0030 && codeUnit <= 0x0039 &&\n\t\t\t\t\tfirstCodeUnit == 0x002D\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point\n\t\t\t\tresult += '\\\\' + codeUnit.toString(16) + ' ';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// If the character is the first character and is a `-` (U+002D), and\n\t\t\t\t// there is no second character, […]\n\t\t\t\tindex == 0 &&\n\t\t\t\tlength == 1 &&\n\t\t\t\tcodeUnit == 0x002D\n\t\t\t) {\n\t\t\t\tresult += '\\\\' + string.charAt(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the character is not handled by one of the above rules and is\n\t\t\t// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or\n\t\t\t// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to\n\t\t\t// U+005A), or [a-z] (U+0061 to U+007A), […]\n\t\t\tif (\n\t\t\t\tcodeUnit >= 0x0080 ||\n\t\t\t\tcodeUnit == 0x002D ||\n\t\t\t\tcodeUnit == 0x005F ||\n\t\t\t\tcodeUnit >= 0x0030 && codeUnit <= 0x0039 ||\n\t\t\t\tcodeUnit >= 0x0041 && codeUnit <= 0x005A ||\n\t\t\t\tcodeUnit >= 0x0061 && codeUnit <= 0x007A\n\t\t\t) {\n\t\t\t\t// the character itself\n\t\t\t\tresult += string.charAt(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Otherwise, the escaped character.\n\t\t\t// https://drafts.csswg.org/cssom/#escape-a-character\n\t\t\tresult += '\\\\' + string.charAt(index);\n\n\t\t}\n\t\treturn result;\n\t};\n\n\tif (!root.CSS) {\n\t\troot.CSS = {};\n\t}\n\n\troot.CSS.escape = cssEscape;\n\treturn cssEscape;\n\n}));\n","export {\n default as escapeCSS\n} from 'css.escape';\n\nvar HTML_ESCAPE_MAP = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n};\n\nexport function escapeHTML(str) {\n str = '' + str;\n\n return str && str.replace(/[&<>\"']/g, function(match) {\n return HTML_ESCAPE_MAP[match];\n });\n}\n","/**\n * Flatten array, one level deep.\n *\n * @param {Array} arr\n *\n * @return {Array}\n */\nfunction flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}\n\nvar nativeToString = Object.prototype.toString;\nvar nativeHasOwnProperty = Object.prototype.hasOwnProperty;\nfunction isUndefined(obj) {\n return obj === undefined;\n}\nfunction isDefined(obj) {\n return obj !== undefined;\n}\nfunction isNil(obj) {\n return obj == null;\n}\nfunction isArray(obj) {\n return nativeToString.call(obj) === '[object Array]';\n}\nfunction isObject(obj) {\n return nativeToString.call(obj) === '[object Object]';\n}\nfunction isNumber(obj) {\n return nativeToString.call(obj) === '[object Number]';\n}\nfunction isFunction(obj) {\n var tag = nativeToString.call(obj);\n return tag === '[object Function]' || tag === '[object AsyncFunction]' || tag === '[object GeneratorFunction]' || tag === '[object AsyncGeneratorFunction]' || tag === '[object Proxy]';\n}\nfunction isString(obj) {\n return nativeToString.call(obj) === '[object String]';\n}\n/**\n * Ensure collection is an array.\n *\n * @param {Object} obj\n */\n\nfunction ensureArray(obj) {\n if (isArray(obj)) {\n return;\n }\n\n throw new Error('must supply array');\n}\n/**\n * Return true, if target owns a property with the given key.\n *\n * @param {Object} target\n * @param {String} key\n *\n * @return {Boolean}\n */\n\nfunction has(target, key) {\n return nativeHasOwnProperty.call(target, key);\n}\n\n/**\n * Find element in collection.\n *\n * @param {Array|Object} collection\n * @param {Function|Object} matcher\n *\n * @return {Object}\n */\n\nfunction find(collection, matcher) {\n matcher = toMatcher(matcher);\n var match;\n forEach(collection, function (val, key) {\n if (matcher(val, key)) {\n match = val;\n return false;\n }\n });\n return match;\n}\n/**\n * Find element index in collection.\n *\n * @param {Array|Object} collection\n * @param {Function} matcher\n *\n * @return {Object}\n */\n\nfunction findIndex(collection, matcher) {\n matcher = toMatcher(matcher);\n var idx = isArray(collection) ? -1 : undefined;\n forEach(collection, function (val, key) {\n if (matcher(val, key)) {\n idx = key;\n return false;\n }\n });\n return idx;\n}\n/**\n * Find element in collection.\n *\n * @param {Array|Object} collection\n * @param {Function} matcher\n *\n * @return {Array} result\n */\n\nfunction filter(collection, matcher) {\n var result = [];\n forEach(collection, function (val, key) {\n if (matcher(val, key)) {\n result.push(val);\n }\n });\n return result;\n}\n/**\n * Iterate over collection; returning something\n * (non-undefined) will stop iteration.\n *\n * @param {Array|Object} collection\n * @param {Function} iterator\n *\n * @return {Object} return result that stopped the iteration\n */\n\nfunction forEach(collection, iterator) {\n var val, result;\n\n if (isUndefined(collection)) {\n return;\n }\n\n var convertKey = isArray(collection) ? toNum : identity;\n\n for (var key in collection) {\n if (has(collection, key)) {\n val = collection[key];\n result = iterator(val, convertKey(key));\n\n if (result === false) {\n return val;\n }\n }\n }\n}\n/**\n * Return collection without element.\n *\n * @param {Array} arr\n * @param {Function} matcher\n *\n * @return {Array}\n */\n\nfunction without(arr, matcher) {\n if (isUndefined(arr)) {\n return [];\n }\n\n ensureArray(arr);\n matcher = toMatcher(matcher);\n return arr.filter(function (el, idx) {\n return !matcher(el, idx);\n });\n}\n/**\n * Reduce collection, returning a single result.\n *\n * @param {Object|Array} collection\n * @param {Function} iterator\n * @param {Any} result\n *\n * @return {Any} result returned from last iterator\n */\n\nfunction reduce(collection, iterator, result) {\n forEach(collection, function (value, idx) {\n result = iterator(result, value, idx);\n });\n return result;\n}\n/**\n * Return true if every element in the collection\n * matches the criteria.\n *\n * @param {Object|Array} collection\n * @param {Function} matcher\n *\n * @return {Boolean}\n */\n\nfunction every(collection, matcher) {\n return !!reduce(collection, function (matches, val, key) {\n return matches && matcher(val, key);\n }, true);\n}\n/**\n * Return true if some elements in the collection\n * match the criteria.\n *\n * @param {Object|Array} collection\n * @param {Function} matcher\n *\n * @return {Boolean}\n */\n\nfunction some(collection, matcher) {\n return !!find(collection, matcher);\n}\n/**\n * Transform a collection into another collection\n * by piping each member through the given fn.\n *\n * @param {Object|Array} collection\n * @param {Function} fn\n *\n * @return {Array} transformed collection\n */\n\nfunction map(collection, fn) {\n var result = [];\n forEach(collection, function (val, key) {\n result.push(fn(val, key));\n });\n return result;\n}\n/**\n * Get the collections keys.\n *\n * @param {Object|Array} collection\n *\n * @return {Array}\n */\n\nfunction keys(collection) {\n return collection && Object.keys(collection) || [];\n}\n/**\n * Shorthand for `keys(o).length`.\n *\n * @param {Object|Array} collection\n *\n * @return {Number}\n */\n\nfunction size(collection) {\n return keys(collection).length;\n}\n/**\n * Get the values in the collection.\n *\n * @param {Object|Array} collection\n *\n * @return {Array}\n */\n\nfunction values(collection) {\n return map(collection, function (val) {\n return val;\n });\n}\n/**\n * Group collection members by attribute.\n *\n * @param {Object|Array} collection\n * @param {Function} extractor\n *\n * @return {Object} map with { attrValue => [ a, b, c ] }\n */\n\nfunction groupBy(collection, extractor) {\n var grouped = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n extractor = toExtractor(extractor);\n forEach(collection, function (val) {\n var discriminator = extractor(val) || '_';\n var group = grouped[discriminator];\n\n if (!group) {\n group = grouped[discriminator] = [];\n }\n\n group.push(val);\n });\n return grouped;\n}\nfunction uniqueBy(extractor) {\n extractor = toExtractor(extractor);\n var grouped = {};\n\n for (var _len = arguments.length, collections = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n collections[_key - 1] = arguments[_key];\n }\n\n forEach(collections, function (c) {\n return groupBy(c, extractor, grouped);\n });\n var result = map(grouped, function (val, key) {\n return val[0];\n });\n return result;\n}\nvar unionBy = uniqueBy;\n/**\n * Sort collection by criteria.\n *\n * @param {Object|Array} collection\n * @param {String|Function} extractor\n *\n * @return {Array}\n */\n\nfunction sortBy(collection, extractor) {\n extractor = toExtractor(extractor);\n var sorted = [];\n forEach(collection, function (value, key) {\n var disc = extractor(value, key);\n var entry = {\n d: disc,\n v: value\n };\n\n for (var idx = 0; idx < sorted.length; idx++) {\n var d = sorted[idx].d;\n\n if (disc < d) {\n sorted.splice(idx, 0, entry);\n return;\n }\n } // not inserted, append (!)\n\n\n sorted.push(entry);\n });\n return map(sorted, function (e) {\n return e.v;\n });\n}\n/**\n * Create an object pattern matcher.\n *\n * @example\n *\n * const matcher = matchPattern({ id: 1 });\n *\n * let element = find(elements, matcher);\n *\n * @param {Object} pattern\n *\n * @return {Function} matcherFn\n */\n\nfunction matchPattern(pattern) {\n return function (el) {\n return every(pattern, function (val, key) {\n return el[key] === val;\n });\n };\n}\n\nfunction toExtractor(extractor) {\n return isFunction(extractor) ? extractor : function (e) {\n return e[extractor];\n };\n}\n\nfunction toMatcher(matcher) {\n return isFunction(matcher) ? matcher : function (e) {\n return e === matcher;\n };\n}\n\nfunction identity(arg) {\n return arg;\n}\n\nfunction toNum(arg) {\n return Number(arg);\n}\n\n/**\n * Debounce fn, calling it only once if the given time\n * elapsed between calls.\n *\n * Lodash-style the function exposes methods to `#clear`\n * and `#flush` to control internal behavior.\n *\n * @param {Function} fn\n * @param {Number} timeout\n *\n * @return {Function} debounced function\n */\nfunction debounce(fn, timeout) {\n var timer;\n var lastArgs;\n var lastThis;\n var lastNow;\n\n function fire(force) {\n var now = Date.now();\n var scheduledDiff = force ? 0 : lastNow + timeout - now;\n\n if (scheduledDiff > 0) {\n return schedule(scheduledDiff);\n }\n\n fn.apply(lastThis, lastArgs);\n clear();\n }\n\n function schedule(timeout) {\n timer = setTimeout(fire, timeout);\n }\n\n function clear() {\n if (timer) {\n clearTimeout(timer);\n }\n\n timer = lastNow = lastArgs = lastThis = undefined;\n }\n\n function flush() {\n if (timer) {\n fire(true);\n }\n\n clear();\n }\n\n function callback() {\n lastNow = Date.now();\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n lastArgs = args;\n lastThis = this; // ensure an execution is scheduled\n\n if (!timer) {\n schedule(timeout);\n }\n }\n\n callback.flush = flush;\n callback.cancel = clear;\n return callback;\n}\n/**\n * Throttle fn, calling at most once\n * in the given interval.\n *\n * @param {Function} fn\n * @param {Number} interval\n *\n * @return {Function} throttled function\n */\n\nfunction throttle(fn, interval) {\n var throttling = false;\n return function () {\n if (throttling) {\n return;\n }\n\n fn.apply(void 0, arguments);\n throttling = true;\n setTimeout(function () {\n throttling = false;\n }, interval);\n };\n}\n/**\n * Bind function against target .\n *\n * @param {Function} fn\n * @param {Object} target\n *\n * @return {Function} bound function\n */\n\nfunction bind(fn, target) {\n return fn.bind(target);\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\n/**\n * Convenience wrapper for `Object.assign`.\n *\n * @param {Object} target\n * @param {...Object} others\n *\n * @return {Object} the target\n */\n\nfunction assign(target) {\n for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n others[_key - 1] = arguments[_key];\n }\n\n return _extends.apply(void 0, [target].concat(others));\n}\n/**\n * Sets a nested property of a given object to the specified value.\n *\n * This mutates the object and returns it.\n *\n * @param {Object} target The target of the set operation.\n * @param {(string|number)[]} path The path to the nested value.\n * @param {any} value The value to set.\n */\n\nfunction set(target, path, value) {\n var currentTarget = target;\n forEach(path, function (key, idx) {\n if (key === '__proto__') {\n throw new Error('illegal key: __proto__');\n }\n\n var nextKey = path[idx + 1];\n var nextTarget = currentTarget[key];\n\n if (isDefined(nextKey) && isNil(nextTarget)) {\n nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : [];\n }\n\n if (isUndefined(nextKey)) {\n if (isUndefined(value)) {\n delete currentTarget[key];\n } else {\n currentTarget[key] = value;\n }\n } else {\n currentTarget = nextTarget;\n }\n });\n return target;\n}\n/**\n * Gets a nested property of a given object.\n *\n * @param {Object} target The target of the get operation.\n * @param {(string|number)[]} path The path to the nested value.\n * @param {any} [defaultValue] The value to return if no value exists.\n */\n\nfunction get(target, path, defaultValue) {\n var currentTarget = target;\n forEach(path, function (key) {\n // accessing nil property yields \n if (isNil(currentTarget)) {\n currentTarget = undefined;\n return false;\n }\n\n currentTarget = currentTarget[key];\n });\n return isUndefined(currentTarget) ? defaultValue : currentTarget;\n}\n/**\n * Pick given properties from the target object.\n *\n * @param {Object} target\n * @param {Array} properties\n *\n * @return {Object} target\n */\n\nfunction pick(target, properties) {\n var result = {};\n var obj = Object(target);\n forEach(properties, function (prop) {\n if (prop in obj) {\n result[prop] = target[prop];\n }\n });\n return result;\n}\n/**\n * Pick all target properties, excluding the given ones.\n *\n * @param {Object} target\n * @param {Array} properties\n *\n * @return {Object} target\n */\n\nfunction omit(target, properties) {\n var result = {};\n var obj = Object(target);\n forEach(obj, function (prop, key) {\n if (properties.indexOf(key) === -1) {\n result[key] = prop;\n }\n });\n return result;\n}\n/**\n * Recursively merge `...sources` into given target.\n *\n * Does support merging objects; does not support merging arrays.\n *\n * @param {Object} target\n * @param {...Object} sources\n *\n * @return {Object} the target\n */\n\nfunction merge(target) {\n for (var _len2 = arguments.length, sources = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n sources[_key2 - 1] = arguments[_key2];\n }\n\n if (!sources.length) {\n return target;\n }\n\n forEach(sources, function (source) {\n // skip non-obj sources, i.e. null\n if (!source || !isObject(source)) {\n return;\n }\n\n forEach(source, function (sourceVal, key) {\n if (key === '__proto__') {\n return;\n }\n\n var targetVal = target[key];\n\n if (isObject(sourceVal)) {\n if (!isObject(targetVal)) {\n // override target[key] with object\n targetVal = {};\n }\n\n target[key] = merge(targetVal, sourceVal);\n } else {\n target[key] = sourceVal;\n }\n });\n });\n return target;\n}\n\nexport { assign, bind, debounce, ensureArray, every, filter, find, findIndex, flatten, forEach, get, groupBy, has, isArray, isDefined, isFunction, isNil, isNumber, isObject, isString, isUndefined, keys, map, matchPattern, merge, omit, pick, reduce, set, size, some, sortBy, throttle, unionBy, uniqueBy, values, without };\n","/**\n * Set attribute `name` to `val`, or get attr `name`.\n *\n * @param {Element} el\n * @param {String} name\n * @param {String} [val]\n * @api public\n */\nfunction attr(el, name, val) {\n // get\n if (arguments.length == 2) {\n return el.getAttribute(name);\n }\n\n // remove\n if (val === null) {\n return el.removeAttribute(name);\n }\n\n // set\n el.setAttribute(name, val);\n\n return el;\n}\n\nvar indexOf = [].indexOf;\n\nvar indexof = function(arr, obj){\n if (indexOf) return arr.indexOf(obj);\n for (var i = 0; i < arr.length; ++i) {\n if (arr[i] === obj) return i;\n }\n return -1;\n};\n\n/**\n * Taken from https://github.com/component/classes\n *\n * Without the component bits.\n */\n\n/**\n * Whitespace regexp.\n */\n\nvar re = /\\s+/;\n\n/**\n * toString reference.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Wrap `el` in a `ClassList`.\n *\n * @param {Element} el\n * @return {ClassList}\n * @api public\n */\n\nfunction classes(el) {\n return new ClassList(el);\n}\n\n/**\n * Initialize a new ClassList for `el`.\n *\n * @param {Element} el\n * @api private\n */\n\nfunction ClassList(el) {\n if (!el || !el.nodeType) {\n throw new Error('A DOM element reference is required');\n }\n this.el = el;\n this.list = el.classList;\n}\n\n/**\n * Add class `name` if not already present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.add = function (name) {\n // classList\n if (this.list) {\n this.list.add(name);\n return this;\n }\n\n // fallback\n var arr = this.array();\n var i = indexof(arr, name);\n if (!~i) arr.push(name);\n this.el.className = arr.join(' ');\n return this;\n};\n\n/**\n * Remove class `name` when present, or\n * pass a regular expression to remove\n * any which match.\n *\n * @param {String|RegExp} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.remove = function (name) {\n if ('[object RegExp]' == toString.call(name)) {\n return this.removeMatching(name);\n }\n\n // classList\n if (this.list) {\n this.list.remove(name);\n return this;\n }\n\n // fallback\n var arr = this.array();\n var i = indexof(arr, name);\n if (~i) arr.splice(i, 1);\n this.el.className = arr.join(' ');\n return this;\n};\n\n/**\n * Remove all classes matching `re`.\n *\n * @param {RegExp} re\n * @return {ClassList}\n * @api private\n */\n\nClassList.prototype.removeMatching = function (re) {\n var arr = this.array();\n for (var i = 0; i < arr.length; i++) {\n if (re.test(arr[i])) {\n this.remove(arr[i]);\n }\n }\n return this;\n};\n\n/**\n * Toggle class `name`, can force state via `force`.\n *\n * For browsers that support classList, but do not support `force` yet,\n * the mistake will be detected and corrected.\n *\n * @param {String} name\n * @param {Boolean} force\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.toggle = function (name, force) {\n // classList\n if (this.list) {\n if ('undefined' !== typeof force) {\n if (force !== this.list.toggle(name, force)) {\n this.list.toggle(name); // toggle again to correct\n }\n } else {\n this.list.toggle(name);\n }\n return this;\n }\n\n // fallback\n if ('undefined' !== typeof force) {\n if (!force) {\n this.remove(name);\n } else {\n this.add(name);\n }\n } else {\n if (this.has(name)) {\n this.remove(name);\n } else {\n this.add(name);\n }\n }\n\n return this;\n};\n\n/**\n * Return an array of classes.\n *\n * @return {Array}\n * @api public\n */\n\nClassList.prototype.array = function () {\n var className = this.el.getAttribute('class') || '';\n var str = className.replace(/^\\s+|\\s+$/g, '');\n var arr = str.split(re);\n if ('' === arr[0]) arr.shift();\n return arr;\n};\n\n/**\n * Check if class `name` is present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.has = ClassList.prototype.contains = function (name) {\n return this.list ? this.list.contains(name) : !!~indexof(this.array(), name);\n};\n\n/**\n * Remove all children from the given element.\n */\nfunction clear(el) {\n\n var c;\n\n while (el.childNodes.length) {\n c = el.childNodes[0];\n el.removeChild(c);\n }\n\n return el;\n}\n\nvar proto = typeof Element !== 'undefined' ? Element.prototype : {};\nvar vendor = proto.matches\n || proto.matchesSelector\n || proto.webkitMatchesSelector\n || proto.mozMatchesSelector\n || proto.msMatchesSelector\n || proto.oMatchesSelector;\n\nvar matchesSelector = match;\n\n/**\n * Match `el` to `selector`.\n *\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n * @api public\n */\n\nfunction match(el, selector) {\n if (!el || el.nodeType !== 1) return false;\n if (vendor) return vendor.call(el, selector);\n var nodes = el.parentNode.querySelectorAll(selector);\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i] == el) return true;\n }\n return false;\n}\n\n/**\n * Closest\n *\n * @param {Element} el\n * @param {String} selector\n * @param {Boolean} checkYourSelf (optional)\n */\nfunction closest (element, selector, checkYourSelf) {\n var currentElem = checkYourSelf ? element : element.parentNode;\n\n while (currentElem && currentElem.nodeType !== document.DOCUMENT_NODE && currentElem.nodeType !== document.DOCUMENT_FRAGMENT_NODE) {\n\n if (matchesSelector(currentElem, selector)) {\n return currentElem;\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return matchesSelector(currentElem, selector) ? currentElem : null;\n}\n\nvar bind = window.addEventListener ? 'addEventListener' : 'attachEvent',\n unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',\n prefix = bind !== 'addEventListener' ? 'on' : '';\n\n/**\n * Bind `el` event `type` to `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nvar bind_1 = function(el, type, fn, capture){\n el[bind](prefix + type, fn, capture || false);\n return fn;\n};\n\n/**\n * Unbind `el` event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nvar unbind_1 = function(el, type, fn, capture){\n el[unbind](prefix + type, fn, capture || false);\n return fn;\n};\n\nvar componentEvent = {\n\tbind: bind_1,\n\tunbind: unbind_1\n};\n\n/**\n * Module dependencies.\n */\n\n/**\n * Delegate event `type` to `selector`\n * and invoke `fn(e)`. A callback function\n * is returned which may be passed to `.unbind()`.\n *\n * @param {Element} el\n * @param {String} selector\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\n// Some events don't bubble, so we want to bind to the capture phase instead\n// when delegating.\nvar forceCaptureEvents = ['focus', 'blur'];\n\nfunction bind$1(el, selector, type, fn, capture) {\n if (forceCaptureEvents.indexOf(type) !== -1) {\n capture = true;\n }\n\n return componentEvent.bind(el, type, function (e) {\n var target = e.target || e.srcElement;\n e.delegateTarget = closest(target, selector, true, el);\n if (e.delegateTarget) {\n fn.call(el, e);\n }\n }, capture);\n}\n\n/**\n * Unbind event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\nfunction unbind$1(el, type, fn, capture) {\n if (forceCaptureEvents.indexOf(type) !== -1) {\n capture = true;\n }\n\n return componentEvent.unbind(el, type, fn, capture);\n}\n\nvar delegate = {\n bind: bind$1,\n unbind: unbind$1\n};\n\n/**\n * Expose `parse`.\n */\n\nvar domify = parse;\n\n/**\n * Tests for browser support.\n */\n\nvar innerHTMLBug = false;\nvar bugTestDiv;\nif (typeof document !== 'undefined') {\n bugTestDiv = document.createElement('div');\n // Setup\n bugTestDiv.innerHTML = '
        a';\n // Make sure that link elements get serialized correctly by innerHTML\n // This requires a wrapper element in IE\n innerHTMLBug = !bugTestDiv.getElementsByTagName('link').length;\n bugTestDiv = undefined;\n}\n\n/**\n * Wrap map from jquery.\n */\n\nvar map = {\n legend: [1, '
        ', '
        '],\n tr: [2, '', '
        '],\n col: [2, '', '
        '],\n // for script/link/style tags to work in IE6-8, you have to wrap\n // in a div with a non-whitespace character in front, ha!\n _default: innerHTMLBug ? [1, 'X
        ', '
        '] : [0, '', '']\n};\n\nmap.td =\nmap.th = [3, '', '
        '];\n\nmap.option =\nmap.optgroup = [1, ''];\n\nmap.thead =\nmap.tbody =\nmap.colgroup =\nmap.caption =\nmap.tfoot = [1, '', '
        '];\n\nmap.polyline =\nmap.ellipse =\nmap.polygon =\nmap.circle =\nmap.text =\nmap.line =\nmap.path =\nmap.rect =\nmap.g = [1, '',''];\n\n/**\n * Parse `html` and return a DOM Node instance, which could be a TextNode,\n * HTML DOM Node of some kind (
        for example), or a DocumentFragment\n * instance, depending on the contents of the `html` string.\n *\n * @param {String} html - HTML string to \"domify\"\n * @param {Document} doc - The `document` instance to create the Node for\n * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance\n * @api private\n */\n\nfunction parse(html, doc) {\n if ('string' != typeof html) throw new TypeError('String expected');\n\n // default to the global `document` object\n if (!doc) doc = document;\n\n // tag name\n var m = /<([\\w:]+)/.exec(html);\n if (!m) return doc.createTextNode(html);\n\n html = html.replace(/^\\s+|\\s+$/g, ''); // Remove leading/trailing whitespace\n\n var tag = m[1];\n\n // body support\n if (tag == 'body') {\n var el = doc.createElement('html');\n el.innerHTML = html;\n return el.removeChild(el.lastChild);\n }\n\n // wrap map\n var wrap = map[tag] || map._default;\n var depth = wrap[0];\n var prefix = wrap[1];\n var suffix = wrap[2];\n var el = doc.createElement('div');\n el.innerHTML = prefix + html + suffix;\n while (depth--) el = el.lastChild;\n\n // one element\n if (el.firstChild == el.lastChild) {\n return el.removeChild(el.firstChild);\n }\n\n // several elements\n var fragment = doc.createDocumentFragment();\n while (el.firstChild) {\n fragment.appendChild(el.removeChild(el.firstChild));\n }\n\n return fragment;\n}\n\nfunction query(selector, el) {\n el = el || document;\n\n return el.querySelector(selector);\n}\n\nfunction all(selector, el) {\n el = el || document;\n\n return el.querySelectorAll(selector);\n}\n\nfunction remove(el) {\n el.parentNode && el.parentNode.removeChild(el);\n}\n\nexport { attr, classes, clear, closest, delegate, domify, componentEvent as event, matchesSelector as matches, query, all as queryAll, remove };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n registerClientPlugin,\n registerBpmnJSPlugin\n} from 'camunda-modeler-plugin-helpers';\n\nimport lintingModule from 'bpmn-js-bpmnlint';\n\nimport defaultConfig from '../.bpmnlintrc';\n\nconst persistLintingStateModule = {\n __init__: [\n [ 'eventBus', function (eventBus) {\n\n eventBus.on('linting.toggle', function (event) {\n const {\n active\n } = event;\n\n setLintingActive(active);\n });\n\n } ]\n ]\n};\n\nregisterBpmnJSPlugin({\n __init__: [\n function (linting) {\n linting.setLinterConfig(defaultConfig);\n }\n ]\n});\n\nregisterClientPlugin(config => {\n\n const {\n additionalModules,\n ...rest\n } = config;\n\n return {\n ...rest,\n additionalModules: [\n ...(additionalModules || []),\n lintingModule,\n persistLintingStateModule\n ],\n linting: {\n bpmnlint: defaultConfig,\n active: getLintingActive()\n }\n };\n}, 'bpmn.modeler.configure');\n\n\n// helpers ///////////////\n\nconst LINTING_STATE_KEY = 'camunda-modeler-linter-plugin.active';\n\nfunction getLintingActive() {\n // eslint-disable-next-line\n const str = window.localStorage.getItem(LINTING_STATE_KEY);\n\n return str && JSON.parse(str) || false;\n}\n\nfunction setLintingActive(active) {\n // eslint-disable-next-line\n window.localStorage.setItem(LINTING_STATE_KEY, JSON.stringify(active));\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file