🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

bpmn-js-bpmnlint

Package Overview
Dependencies
Maintainers
9
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpmn-js-bpmnlint - npm Package Compare versions

Comparing version

to
0.20.1

708

dist/bpmn-js-bpmnlint.umd.js

@@ -5,3 +5,3 @@ (function (global, factory) {

(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BpmnJSBpmnlint = factory());
}(this, (function () { 'use strict';
})(this, (function () { 'use strict';

@@ -23,2 +23,32 @@ function EditorActions(injector, linting) {

var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function getAugmentedNamespace(n) {
if (n.__esModule) return n;
var f = n.default;
if (typeof f == "function") {
var a = function a () {
if (this instanceof a) {
var args = [null];
args.push.apply(args, arguments);
var Ctor = Function.bind.apply(f, args);
return new Ctor();
}
return f.apply(this, arguments);
};
a.prototype = f.prototype;
} else a = {};
Object.defineProperty(a, '__esModule', {value: true});
Object.keys(n).forEach(function (k) {
var d = Object.getOwnPropertyDescriptor(n, k);
Object.defineProperty(a, k, d.get ? d : {
enumerable: true,
get: function () {
return n[k];
}
});
});
return a;
}
/**

@@ -31,4 +61,5 @@ * Traverse a moddle tree, depth first from top to bottom

*/
var traverse = function traverse(element, options) {
var traverse$1 = function traverse(element, options) {
const enter = options.enter || null;

@@ -76,5 +107,5 @@ const leave = options.leave || null;

var nativeToString = Object.prototype.toString;
var nativeHasOwnProperty = Object.prototype.hasOwnProperty;
function isUndefined(obj) {
var nativeToString$1 = Object.prototype.toString;
var nativeHasOwnProperty$1 = Object.prototype.hasOwnProperty;
function isUndefined$1(obj) {
return obj === undefined;

@@ -88,17 +119,17 @@ }

}
function isArray(obj) {
return nativeToString.call(obj) === '[object Array]';
function isArray$2(obj) {
return nativeToString$1.call(obj) === '[object Array]';
}
function isObject(obj) {
return nativeToString.call(obj) === '[object Object]';
function isObject$1(obj) {
return nativeToString$1.call(obj) === '[object Object]';
}
function isNumber(obj) {
return nativeToString.call(obj) === '[object Number]';
return nativeToString$1.call(obj) === '[object Number]';
}
function isFunction(obj) {
var tag = nativeToString.call(obj);
function isFunction$1(obj) {
var tag = nativeToString$1.call(obj);
return tag === '[object Function]' || tag === '[object AsyncFunction]' || tag === '[object GeneratorFunction]' || tag === '[object AsyncGeneratorFunction]' || tag === '[object Proxy]';
}
function isString(obj) {
return nativeToString.call(obj) === '[object String]';
return nativeToString$1.call(obj) === '[object String]';
}

@@ -112,3 +143,3 @@ /**

function ensureArray(obj) {
if (isArray(obj)) {
if (isArray$2(obj)) {
return;

@@ -128,4 +159,4 @@ }

function has(target, key) {
return nativeHasOwnProperty.call(target, key);
function has$1(target, key) {
return nativeHasOwnProperty$1.call(target, key);
}

@@ -145,3 +176,3 @@

var match;
forEach(collection, function (val, key) {
forEach$1(collection, function (val, key) {
if (matcher(val, key)) {

@@ -165,4 +196,4 @@ match = val;

matcher = toMatcher(matcher);
var idx = isArray(collection) ? -1 : undefined;
forEach(collection, function (val, key) {
var idx = isArray$2(collection) ? -1 : undefined;
forEach$1(collection, function (val, key) {
if (matcher(val, key)) {

@@ -186,3 +217,3 @@ idx = key;

var result = [];
forEach(collection, function (val, key) {
forEach$1(collection, function (val, key) {
if (matcher(val, key)) {

@@ -204,13 +235,13 @@ result.push(val);

function forEach(collection, iterator) {
function forEach$1(collection, iterator) {
var val, result;
if (isUndefined(collection)) {
if (isUndefined$1(collection)) {
return;
}
var convertKey = isArray(collection) ? toNum : identity;
var convertKey = isArray$2(collection) ? toNum$1 : identity$1;
for (var key in collection) {
if (has(collection, key)) {
if (has$1(collection, key)) {
val = collection[key];

@@ -235,3 +266,3 @@ result = iterator(val, convertKey(key));

function without(arr, matcher) {
if (isUndefined(arr)) {
if (isUndefined$1(arr)) {
return [];

@@ -256,4 +287,4 @@ }

function reduce(collection, iterator, result) {
forEach(collection, function (value, idx) {
function reduce$1(collection, iterator, result) {
forEach$1(collection, function (value, idx) {
result = iterator(result, value, idx);

@@ -274,3 +305,3 @@ });

function every(collection, matcher) {
return !!reduce(collection, function (matches, val, key) {
return !!reduce$1(collection, function (matches, val, key) {
return matches && matcher(val, key);

@@ -302,5 +333,5 @@ }, true);

function map(collection, fn) {
function map$2(collection, fn) {
var result = [];
forEach(collection, function (val, key) {
forEach$1(collection, function (val, key) {
result.push(fn(val, key));

@@ -341,3 +372,3 @@ });

function values(collection) {
return map(collection, function (val) {
return map$2(collection, function (val) {
return val;

@@ -355,6 +386,6 @@ });

function groupBy(collection, extractor) {
function groupBy$1(collection, extractor) {
var grouped = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
extractor = toExtractor(extractor);
forEach(collection, function (val) {
extractor = toExtractor$1(extractor);
forEach$1(collection, function (val) {
var discriminator = extractor(val) || '_';

@@ -372,3 +403,3 @@ var group = grouped[discriminator];

function uniqueBy(extractor) {
extractor = toExtractor(extractor);
extractor = toExtractor$1(extractor);
var grouped = {};

@@ -380,6 +411,6 @@

forEach(collections, function (c) {
return groupBy(c, extractor, grouped);
forEach$1(collections, function (c) {
return groupBy$1(c, extractor, grouped);
});
var result = map(grouped, function (val, key) {
var result = map$2(grouped, function (val, key) {
return val[0];

@@ -400,5 +431,5 @@ });

function sortBy(collection, extractor) {
extractor = toExtractor(extractor);
extractor = toExtractor$1(extractor);
var sorted = [];
forEach(collection, function (value, key) {
forEach$1(collection, function (value, key) {
var disc = extractor(value, key);

@@ -422,3 +453,3 @@ var entry = {

});
return map(sorted, function (e) {
return map$2(sorted, function (e) {
return e.v;

@@ -449,4 +480,4 @@ });

function toExtractor(extractor) {
return isFunction(extractor) ? extractor : function (e) {
function toExtractor$1(extractor) {
return isFunction$1(extractor) ? extractor : function (e) {
return e[extractor];

@@ -457,3 +488,3 @@ };

function toMatcher(matcher) {
return isFunction(matcher) ? matcher : function (e) {
return isFunction$1(matcher) ? matcher : function (e) {
return e === matcher;

@@ -463,7 +494,7 @@ };

function identity(arg) {
function identity$1(arg) {
return arg;
}
function toNum(arg) {
function toNum$1(arg) {
return Number(arg);

@@ -621,3 +652,3 @@ }

function assign(target) {
function assign$1(target) {
for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {

@@ -641,3 +672,3 @@ others[_key - 1] = arguments[_key];

var currentTarget = target;
forEach(path, function (key, idx) {
forEach$1(path, function (key, idx) {
if (typeof key !== 'number' && typeof key !== 'string') {

@@ -662,4 +693,4 @@ throw new Error('illegal key type: ' + _typeof(key) + '. Key should be of type number or string.');

if (isUndefined(nextKey)) {
if (isUndefined(value)) {
if (isUndefined$1(nextKey)) {
if (isUndefined$1(value)) {
delete currentTarget[key];

@@ -685,3 +716,3 @@ } else {

var currentTarget = target;
forEach(path, function (key) {
forEach$1(path, function (key) {
// accessing nil property yields <undefined>

@@ -695,3 +726,3 @@ if (isNil(currentTarget)) {

});
return isUndefined(currentTarget) ? defaultValue : currentTarget;
return isUndefined$1(currentTarget) ? defaultValue : currentTarget;
}

@@ -710,3 +741,3 @@ /**

var obj = Object(target);
forEach(properties, function (prop) {
forEach$1(properties, function (prop) {
if (prop in obj) {

@@ -730,3 +761,3 @@ result[prop] = target[prop];

var obj = Object(target);
forEach(obj, function (prop, key) {
forEach$1(obj, function (prop, key) {
if (properties.indexOf(key) === -1) {

@@ -758,9 +789,9 @@ result[key] = prop;

forEach(sources, function (source) {
forEach$1(sources, function (source) {
// skip non-obj sources, i.e. null
if (!source || !isObject(source)) {
if (!source || !isObject$1(source)) {
return;
}
forEach(source, function (sourceVal, key) {
forEach$1(source, function (sourceVal, key) {
if (key === '__proto__') {

@@ -772,4 +803,4 @@ return;

if (isObject(sourceVal)) {
if (!isObject(targetVal)) {
if (isObject$1(sourceVal)) {
if (!isObject$1(targetVal)) {
// override target[key] with object

@@ -790,3 +821,3 @@ targetVal = {};

__proto__: null,
assign: assign,
assign: assign$1,
bind: bind,

@@ -800,16 +831,16 @@ debounce: debounce,

flatten: flatten,
forEach: forEach,
forEach: forEach$1,
get: get,
groupBy: groupBy,
has: has,
isArray: isArray,
groupBy: groupBy$1,
has: has$1,
isArray: isArray$2,
isDefined: isDefined,
isFunction: isFunction,
isFunction: isFunction$1,
isNil: isNil,
isNumber: isNumber,
isObject: isObject,
isObject: isObject$1,
isString: isString,
isUndefined: isUndefined,
isUndefined: isUndefined$1,
keys: keys,
map: map,
map: map$2,
matchPattern: matchPattern,

@@ -819,3 +850,3 @@ merge: merge,

pick: pick,
reduce: reduce,
reduce: reduce$1,
set: set,

@@ -832,30 +863,10 @@ size: size,

var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
var require$$1 = /*@__PURE__*/getAugmentedNamespace(index_esm);
function getAugmentedNamespace(n) {
if (n.__esModule) return n;
var a = Object.defineProperty({}, '__esModule', {value: true});
Object.keys(n).forEach(function (k) {
var d = Object.getOwnPropertyDescriptor(n, k);
Object.defineProperty(a, k, d.get ? d : {
enumerable: true,
get: function () {
return n[k];
}
});
});
return a;
}
const traverse = traverse$1;
function createCommonjsModule(fn) {
var module = { exports: {} };
return fn(module, module.exports), module.exports;
}
var require$$0 = /*@__PURE__*/getAugmentedNamespace(index_esm);
const {
isArray: isArray$1,
isObject: isObject$1
} = require$$0;
isObject
} = require$$1;

@@ -900,3 +911,3 @@

if (path && isObject$1(path)) {
if (path && isObject(path)) {
report = {

@@ -912,3 +923,3 @@ ...report,

var testRule = function testRule({ moddleRoot, rule }) {
var testRule$1 = function testRule({ moddleRoot, rule }) {
const reporter = new Reporter({ rule, moddleRoot });

@@ -933,2 +944,4 @@

const testRule = testRule$1;
const categoryMap = {

@@ -941,3 +954,3 @@ 0: 'off',

function Linter(options = {}) {
function Linter$1(options = {}) {

@@ -961,3 +974,3 @@ const {

var linter = Linter;
var linter = Linter$1;

@@ -976,3 +989,3 @@ /**

*/
Linter.prototype.applyRule = function applyRule(moddleRoot, ruleDefinition) {
Linter$1.prototype.applyRule = function applyRule(moddleRoot, ruleDefinition) {

@@ -1014,3 +1027,3 @@ const {

Linter.prototype.resolveRule = function(name, config) {
Linter$1.prototype.resolveRule = function(name, config) {

@@ -1042,3 +1055,3 @@ const {

Linter.prototype.resolveConfig = function(name) {
Linter$1.prototype.resolveConfig = function(name) {

@@ -1077,3 +1090,3 @@ const {

*/
Linter.prototype.resolveRules = function(config) {
Linter$1.prototype.resolveRules = function(config) {

@@ -1120,3 +1133,3 @@ return this.resolveConfiguredRules(config).then((rulesConfig) => {

Linter.prototype.resolveConfiguredRules = function(config) {
Linter$1.prototype.resolveConfiguredRules = function(config) {

@@ -1163,3 +1176,3 @@ let parents = config.extends;

*/
Linter.prototype.lint = function(moddleRoot, config) {
Linter$1.prototype.lint = function(moddleRoot, config) {

@@ -1191,3 +1204,3 @@ config = config || this.config;

Linter.prototype.parseRuleValue = function(value) {
Linter$1.prototype.parseRuleValue = function(value) {

@@ -1219,3 +1232,3 @@ let category;

Linter.prototype.parseRuleName = function(name, localPackage = 'bpmnlint') {
Linter$1.prototype.parseRuleName = function(name, localPackage = 'bpmnlint') {

@@ -1262,3 +1275,3 @@ /**

Linter.prototype.parseConfigName = function(name) {
Linter$1.prototype.parseConfigName = function(name) {

@@ -1304,3 +1317,3 @@ /**

Linter.prototype.getSimplePackageName = function(name) {
Linter$1.prototype.getSimplePackageName = function(name) {

@@ -1341,3 +1354,3 @@ /**

*/
Linter.prototype.normalizeConfig = function(config, localPackage) {
Linter$1.prototype.normalizeConfig = function(config, localPackage) {

@@ -1398,16 +1411,227 @@ const rules = config.rules || {};

const Linter = linter;
var lib = {
Linter: linter
Linter
};
/**
* Set attribute `name` to `val`, or get attr `name`.
* Flatten array, one level deep.
*
* @param {Array<?>} arr
*
* @return {Array<?>}
*/
const nativeToString = Object.prototype.toString;
const nativeHasOwnProperty = Object.prototype.hasOwnProperty;
function isUndefined(obj) {
return obj === undefined;
}
function isArray(obj) {
return nativeToString.call(obj) === '[object Array]';
}
function isFunction(obj) {
const tag = nativeToString.call(obj);
return (
tag === '[object Function]' ||
tag === '[object AsyncFunction]' ||
tag === '[object GeneratorFunction]' ||
tag === '[object AsyncGeneratorFunction]' ||
tag === '[object Proxy]'
);
}
/**
* Return true, if target owns a property with the given key.
*
* @param {Object} target
* @param {String} key
*
* @return {Boolean}
*/
function has(target, key) {
return nativeHasOwnProperty.call(target, key);
}
/**
* Iterate over collection; returning something
* (non-undefined) will stop iteration.
*
* @param {Array|Object} collection
* @param {Function} iterator
*
* @return {Object} return result that stopped the iteration
*/
function forEach(collection, iterator) {
let val,
result;
if (isUndefined(collection)) {
return;
}
const convertKey = isArray(collection) ? toNum : identity;
for (let key in collection) {
if (has(collection, key)) {
val = collection[key];
result = iterator(val, convertKey(key));
if (result === false) {
return val;
}
}
}
}
/**
* Reduce collection, returning a single result.
*
* @param {Object|Array} collection
* @param {Function} iterator
* @param {Any} result
*
* @return {Any} result returned from last iterator
*/
function reduce(collection, iterator, result) {
forEach(collection, function(value, idx) {
result = iterator(result, value, idx);
});
return result;
}
/**
* Transform a collection into another collection
* by piping each member through the given fn.
*
* @param {Object|Array} collection
* @param {Function} fn
*
* @return {Array} transformed collection
*/
function map$1(collection, fn) {
let result = [];
forEach(collection, function(val, key) {
result.push(fn(val, key));
});
return result;
}
/**
* Group collection members by attribute.
*
* @param {Object|Array} collection
* @param {Function} extractor
*
* @return {Object} map with { attrValue => [ a, b, c ] }
*/
function groupBy(collection, extractor, grouped = {}) {
extractor = toExtractor(extractor);
forEach(collection, function(val) {
let discriminator = extractor(val) || '_';
let group = grouped[discriminator];
if (!group) {
group = grouped[discriminator] = [];
}
group.push(val);
});
return grouped;
}
function toExtractor(extractor) {
return isFunction(extractor) ? extractor : (e) => {
return e[extractor];
};
}
function identity(arg) {
return arg;
}
function toNum(arg) {
return Number(arg);
}
/**
* Convenience wrapper for `Object.assign`.
*
* @param {Object} target
* @param {...Object} others
*
* @return {Object} the target
*/
function assign(target, ...others) {
return Object.assign(target, ...others);
}
var componentEvent = {};
var bind$1, unbind$1, prefix;
function detect () {
bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent';
unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent';
prefix = bind$1 !== 'addEventListener' ? 'on' : '';
}
/**
* Bind `el` event `type` to `fn`.
*
* @param {Element} el
* @param {String} name
* @param {String} [val]
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @return {Function}
* @api public
*/
componentEvent.bind = function(el, type, fn, capture){
if (!bind$1) detect();
el[bind$1](prefix + type, fn, capture || false);
return fn;
};
/**
* Unbind `el` event `type`'s callback `fn`.
*
* @param {Element} el
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @return {Function}
* @api public
*/
componentEvent.unbind = function(el, type, fn, capture){
if (!unbind$1) detect();
el[unbind$1](prefix + type, fn, capture || false);
return fn;
};
/**
* Expose `parse`.

@@ -1438,3 +1662,3 @@ */

var map$1 = {
var map = {
legend: [1, '<fieldset>', '</fieldset>'],

@@ -1448,23 +1672,23 @@ tr: [2, '<table><tbody>', '</tbody></table>'],

map$1.td =
map$1.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
map.td =
map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
map$1.option =
map$1.optgroup = [1, '<select multiple="multiple">', '</select>'];
map.option =
map.optgroup = [1, '<select multiple="multiple">', '</select>'];
map$1.thead =
map$1.tbody =
map$1.colgroup =
map$1.caption =
map$1.tfoot = [1, '<table>', '</table>'];
map.thead =
map.tbody =
map.colgroup =
map.caption =
map.tfoot = [1, '<table>', '</table>'];
map$1.polyline =
map$1.ellipse =
map$1.polygon =
map$1.circle =
map$1.text =
map$1.line =
map$1.path =
map$1.rect =
map$1.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
map.polyline =
map.ellipse =
map.polygon =
map.circle =
map.text =
map.line =
map.path =
map.rect =
map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];

@@ -1504,3 +1728,3 @@ /**

// wrap map
var wrap = map$1[tag] || map$1._default;
var wrap = Object.prototype.hasOwnProperty.call(map, tag) ? map[tag] : map._default;
var depth = wrap[0];

@@ -1527,106 +1751,114 @@ var prefix = wrap[1];

var domify$1 = domify;
var css_escapeExports = {};
var css_escape = {
get exports(){ return css_escapeExports; },
set exports(v){ css_escapeExports = v; },
};
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
var css_escape = createCommonjsModule(function (module, exports) {
(function (module, exports) {
(function(root, factory) {
// https://github.com/umdjs/umd/blob/master/returnExports.js
{
// For Node.js.
module.exports = factory(root);
}
}(typeof commonjsGlobal != 'undefined' ? commonjsGlobal : commonjsGlobal, function(root) {
// https://github.com/umdjs/umd/blob/master/returnExports.js
{
// For Node.js.
module.exports = factory(root);
}
}(typeof commonjsGlobal != 'undefined' ? commonjsGlobal : commonjsGlobal, function(root) {
if (root.CSS && root.CSS.escape) {
return root.CSS.escape;
}
// https://drafts.csswg.org/cssom/#serialize-an-identifier
var cssEscape = function(value) {
if (arguments.length == 0) {
throw new TypeError('`CSS.escape` requires an argument.');
if (root.CSS && root.CSS.escape) {
return root.CSS.escape;
}
var string = String(value);
var length = string.length;
var index = -1;
var codeUnit;
var result = '';
var firstCodeUnit = string.charCodeAt(0);
while (++index < length) {
codeUnit = string.charCodeAt(index);
// Note: there’s no need to special-case astral symbols, surrogate
// pairs, or lone surrogates.
// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
// (U+FFFD).
if (codeUnit == 0x0000) {
result += '\uFFFD';
continue;
// https://drafts.csswg.org/cssom/#serialize-an-identifier
var cssEscape = function(value) {
if (arguments.length == 0) {
throw new TypeError('`CSS.escape` requires an argument.');
}
var string = String(value);
var length = string.length;
var index = -1;
var codeUnit;
var result = '';
var firstCodeUnit = string.charCodeAt(0);
while (++index < length) {
codeUnit = string.charCodeAt(index);
// Note: there’s no need to special-case astral symbols, surrogate
// pairs, or lone surrogates.
if (
// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
// U+007F, […]
(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||
// If the character is the first character and is in the range [0-9]
// (U+0030 to U+0039), […]
(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
// If the character is the second character and is in the range [0-9]
// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
(
index == 1 &&
codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
firstCodeUnit == 0x002D
)
) {
// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
result += '\\' + codeUnit.toString(16) + ' ';
continue;
}
// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
// (U+FFFD).
if (codeUnit == 0x0000) {
result += '\uFFFD';
continue;
}
if (
// If the character is the first character and is a `-` (U+002D), and
// there is no second character, […]
index == 0 &&
length == 1 &&
codeUnit == 0x002D
) {
if (
// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
// U+007F, […]
(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||
// If the character is the first character and is in the range [0-9]
// (U+0030 to U+0039), […]
(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
// If the character is the second character and is in the range [0-9]
// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
(
index == 1 &&
codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
firstCodeUnit == 0x002D
)
) {
// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
result += '\\' + codeUnit.toString(16) + ' ';
continue;
}
if (
// If the character is the first character and is a `-` (U+002D), and
// there is no second character, […]
index == 0 &&
length == 1 &&
codeUnit == 0x002D
) {
result += '\\' + string.charAt(index);
continue;
}
// If the character is not handled by one of the above rules and is
// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
// U+005A), or [a-z] (U+0061 to U+007A), […]
if (
codeUnit >= 0x0080 ||
codeUnit == 0x002D ||
codeUnit == 0x005F ||
codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
codeUnit >= 0x0041 && codeUnit <= 0x005A ||
codeUnit >= 0x0061 && codeUnit <= 0x007A
) {
// the character itself
result += string.charAt(index);
continue;
}
// Otherwise, the escaped character.
// https://drafts.csswg.org/cssom/#escape-a-character
result += '\\' + string.charAt(index);
continue;
}
// If the character is not handled by one of the above rules and is
// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
// U+005A), or [a-z] (U+0061 to U+007A), […]
if (
codeUnit >= 0x0080 ||
codeUnit == 0x002D ||
codeUnit == 0x005F ||
codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
codeUnit >= 0x0041 && codeUnit <= 0x005A ||
codeUnit >= 0x0061 && codeUnit <= 0x007A
) {
// the character itself
result += string.charAt(index);
continue;
}
return result;
};
// Otherwise, the escaped character.
// https://drafts.csswg.org/cssom/#escape-a-character
result += '\\' + string.charAt(index);
if (!root.CSS) {
root.CSS = {};
}
return result;
};
if (!root.CSS) {
root.CSS = {};
}
root.CSS.escape = cssEscape;
return cssEscape;
root.CSS.escape = cssEscape;
return cssEscape;
}));
} (css_escape));
}));
});
var HTML_ESCAPE_MAP = {

@@ -1673,5 +1905,5 @@ '&': '&amp;',

var ErrorSvg = "<svg width=\"12\" height=\"12\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 352 512\"><path fill=\"currentColor\" d=\"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\"></path></svg>";
var ErrorSvg = "<svg width=\"12\" height=\"12\" version=\"1.1\" viewBox=\"0 0 352 512\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\" fill=\"currentColor\"/>\n</svg>\n";
var WarningSvg = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M288 328.83c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zM207.439 57.034l11.61 204.348c.544 9.334 8.78 16.64 18.755 16.64h100.392c9.975 0 18.211-7.306 18.754-16.64l11.611-204.348c.587-10.082-7.98-18.56-18.754-18.56H226.192c-10.775 0-19.34 8.478-18.753 18.56z\"/></svg>";
var WarningSvg = "<svg width=\"12\" height=\"12\" version=\"1.1\" viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m256 323.95c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zm-80.561-271.8 11.61 204.35c.544 9.334 8.78 16.64 18.755 16.64h100.39c9.975 0 18.211-7.306 18.754-16.64l11.611-204.35c.587-10.082-7.98-18.56-18.754-18.56h-123.62c-10.775 0-19.34 8.478-18.753 18.56z\" fill=\"currentColor\"/>\n</svg>\n";

@@ -1819,3 +2051,3 @@ var SuccessSvg = "<svg width=\"12\" height=\"12\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path></svg>";

reports = map(reports, function(report) {
reports = map$1(reports, function(report) {
const element = self._elementRegistry.get(report.id);

@@ -2006,3 +2238,3 @@

var $html = domify(
var $html = domify$1(
'<div class="bjsl-overlay bjsl-issues-' + menuPosition + '"></div>'

@@ -2012,12 +2244,12 @@ );

var $icon = (errors || childErrors)
? domify('<div class="bjsl-icon bjsl-icon-error">' + ErrorSvg + '</div>')
: domify('<div class="bjsl-icon bjsl-icon-warning">' + WarningSvg + '</div>');
? domify$1('<div class="bjsl-icon bjsl-icon-error">' + ErrorSvg + '</div>')
: domify$1('<div class="bjsl-icon bjsl-icon-warning">' + WarningSvg + '</div>');
var $dropdown = domify('<div class="bjsl-dropdown"></div>');
var $dropdownContent = domify('<div class="bjsl-dropdown-content"></div>');
var $dropdown = domify$1('<div class="bjsl-dropdown"></div>');
var $dropdownContent = domify$1('<div class="bjsl-dropdown-content"></div>');
var $issueContainer = domify('<div class="bjsl-issues"></div>');
var $issueContainer = domify$1('<div class="bjsl-issues"></div>');
var $issues = domify('<div class="bjsl-current-element-issues"></div>');
var $issueList = domify('<ul></ul>');
var $issues = domify$1('<div class="bjsl-current-element-issues"></div>');
var $issueList = domify$1('<ul></ul>');

@@ -2046,5 +2278,5 @@ $html.appendChild($icon);

if (childErrors || childWarnings) {
var $childIssues = domify('<div class="bjsl-child-issues"></div>');
var $childIssueList = domify('<ul></ul>');
var $childIssueLabel = domify('<a class="bjsl-issue-heading">Issues for child elements:</a>');
var $childIssues = domify$1('<div class="bjsl-child-issues"></div>');
var $childIssueList = domify$1('<ul></ul>');
var $childIssueLabel = domify$1('<a class="bjsl-issue-heading">Issues for child elements:</a>');

@@ -2060,3 +2292,3 @@ if (childErrors) {

if (errors || warnings) {
var $childIssuesSeperator = domify('<hr/>');
var $childIssuesSeperator = domify$1('<hr/>');
$childIssues.appendChild($childIssuesSeperator);

@@ -2105,3 +2337,3 @@ }

var $entry = domify(
var $entry = domify$1(
'<li class="' + state + '">' +

@@ -2189,3 +2421,3 @@ '<span class="icon"> ' + icon + '</span>' +

this._button = domify(
this._button = domify$1(
'<button class="bjsl-button bjsl-button-inactive" title="' + this._translate('Toggle linting') + '"></button>'

@@ -2222,3 +2454,3 @@ );

linting: [ 'type', Linting ],
lintingEditorActions: ['type', EditorActions ]
lintingEditorActions: [ 'type', EditorActions ]
};

@@ -2228,2 +2460,2 @@

})));
}));

@@ -1,2 +0,3 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).BpmnJSBpmnlint=e()}(this,(function(){"use strict";function t(t,e){var n=t.get("editorActions",!1);n&&n.register({toggleLinting:function(){e.toggle()}})}t.$inject=["injector","linting"];var e=function t(e,n){const r=n.enter||null,i=n.leave||null,o=r&&r(e),s=e.$descriptor;if(!1!==o&&!s.isGeneric){s.properties.filter((t=>!t.isAttr&&!t.isReference&&"String"!==t.type)).forEach((r=>{if(r.name in e){const i=e[r.name];r.isMany?i.forEach((e=>{t(e,n)})):t(i,n)}}))}i&&i(e)};var n=Object.prototype.toString,r=Object.prototype.hasOwnProperty;function i(t){return void 0===t}function o(t){return void 0!==t}function s(t){return null==t}function u(t){return"[object Array]"===n.call(t)}function c(t){return"[object Object]"===n.call(t)}function l(t){var e=n.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object AsyncGeneratorFunction]"===e||"[object Proxy]"===e}function a(t){if(!u(t))throw new Error("must supply array")}function f(t,e){return r.call(t,e)}function p(t,e){var n;return e=C(e),h(t,(function(t,r){if(e(t,r))return n=t,!1})),n}function h(t,e){var n;if(!i(t)){var r=u(t)?E:j;for(var o in t)if(f(t,o)&&!1===e(n=t[o],r(o)))return n}}function d(t,e,n){return h(t,(function(t,r){n=e(n,t,r)})),n}function g(t,e){return!!d(t,(function(t,n,r){return t&&e(n,r)}),!0)}function v(t,e){var n=[];return h(t,(function(t,r){n.push(e(t,r))})),n}function m(t){return t&&Object.keys(t)||[]}function y(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=w(e),h(t,(function(t){var r=e(t)||"_",i=n[r];i||(i=n[r]=[]),i.push(t)})),n}function b(t){t=w(t);for(var e={},n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];h(r,(function(n){return y(n,t,e)}));var o=v(e,(function(t,e){return t[0]}));return o}var _=b;function w(t){return l(t)?t:function(e){return e[t]}}function C(t){return l(t)?t:function(e){return e===t}}function j(t){return t}function E(t){return Number(t)}function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function R(){return R=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},R.apply(this,arguments)}function O(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return R.apply(void 0,[t].concat(n))}var k=Object.freeze({__proto__:null,assign:O,bind:function(t,e){return t.bind(e)},debounce:function(t,e){var n,r,i,o;function s(n){var s=Date.now(),l=n?0:o+e-s;if(l>0)return u(l);t.apply(i,r),c()}function u(t){n=setTimeout(s,t)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function l(){o=Date.now();for(var t=arguments.length,s=new Array(t),c=0;c<t;c++)s[c]=arguments[c];r=s,i=this,n||u(e)}return l.flush=function(){n&&s(!0),c()},l.cancel=c,l},ensureArray:a,every:g,filter:function(t,e){var n=[];return h(t,(function(t,r){e(t,r)&&n.push(t)})),n},find:p,findIndex:function(t,e){e=C(e);var n=u(t)?-1:void 0;return h(t,(function(t,r){if(e(t,r))return n=r,!1})),n},flatten:function(t){return Array.prototype.concat.apply([],t)},forEach:h,get:function(t,e,n){var r=t;return h(e,(function(t){if(s(r))return r=void 0,!1;r=r[t]})),i(r)?n:r},groupBy:y,has:f,isArray:u,isDefined:o,isFunction:l,isNil:s,isNumber:function(t){return"[object Number]"===n.call(t)},isObject:c,isString:function(t){return"[object String]"===n.call(t)},isUndefined:i,keys:m,map:v,matchPattern:function(t){return function(e){return g(t,(function(t,n){return e[n]===t}))}},merge:function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.length?(h(r,(function(n){n&&c(n)&&h(n,(function(n,r){if("__proto__"!==r){var i=e[r];c(n)?(c(i)||(i={}),e[r]=t(i,n)):e[r]=n}}))})),e):e},omit:function(t,e){var n={};return h(Object(t),(function(t,r){-1===e.indexOf(r)&&(n[r]=t)})),n},pick:function(t,e){var n={},r=Object(t);return h(e,(function(e){e in r&&(n[e]=t[e])})),n},reduce:d,set:function(t,e,n){var r=t;return h(e,(function(t,u){if("number"!=typeof t&&"string"!=typeof t)throw new Error("illegal key type: "+S(t)+". Key should be of type number or string.");if("constructor"===t)throw new Error("illegal key: constructor");if("__proto__"===t)throw new Error("illegal key: __proto__");var c=e[u+1],l=r[t];o(c)&&s(l)&&(l=r[t]=isNaN(+c)?{}:[]),i(c)?i(n)?delete r[t]:r[t]=n:r=l})),t},size:function(t){return m(t).length},some:function(t,e){return!!p(t,e)},sortBy:function(t,e){e=w(e);var n=[];return h(t,(function(t,r){for(var i=e(t,r),o={d:i,v:t},s=0;s<n.length;s++){if(i<n[s].d)return void n.splice(s,0,o)}n.push(o)})),v(n,(function(t){return t.v}))},throttle:function(t,e){var n=!1;return function(){n||(t.apply(void 0,arguments),n=!0,setTimeout((function(){n=!1}),e))}},unionBy:_,uniqueBy:b,values:function(t){return v(t,(function(t){return t}))},without:function(t,e){return i(t)?[]:(a(t),e=C(e),t.filter((function(t,n){return!e(t,n)})))}}),A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function $(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})})),e}var x=$(k);const{isArray:B,isObject:N}=x;class L{constructor({moddleRoot:t,rule:e}){this.rule=e,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,e,n){let r={id:t,message:e};n&&B(n)&&(r={...r,path:n}),n&&N(n)&&(r={...r,...n}),this.messages.push(r)}}const I={0:"off",1:"warn",2:"error"};function P(t={}){const{config:e,resolver:n}=t;if(void 0===n)throw new Error("must provide <options.resolver>");this.config=e,this.resolver=n,this.cachedRules={},this.cachedConfigs={}}var T=P;function M(t){return"bpmnlint"===t?"bpmnlint":t.startsWith("bpmnlint-plugin-")?t:`bpmnlint-plugin-${t}`}P.prototype.applyRule=function(t,n){const{config:r,rule:i,category:o,name:s}=n;try{const n=function({moddleRoot:t,rule:n}){const r=new L({rule:n,moddleRoot:t}),i=n.check,o=i&&i.enter||i,s=i&&i.leave;if(!o&&!s)throw new Error("no check implemented");return e(t,{enter:o?t=>o(t,r):null,leave:s?t=>s(t,r):null}),r.messages}({moddleRoot:t,rule:i,config:r});return n.map((function(t){return{...t,category:o}}))}catch(t){return console.error("rule <"+s+"> failed with error: ",t),[{message:"Rule error: "+t.message,category:"error"}]}},P.prototype.resolveRule=function(t,e){const{pkg:n,ruleName:r}=this.parseRuleName(t),i=`${n}-${r}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,r)).then((n=>{if(!n)throw new Error(`unknown rule <${t}>`);return this.cachedRules[i]=n(e)}))},P.prototype.resolveConfig=function(t){const{pkg:e,configName:n}=this.parseConfigName(t),r=`${e}-${n}`,i=this.cachedConfigs[r];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(e,n)).then((n=>{if(!n)throw new Error(`unknown config <${t}>`);return this.cachedConfigs[r]=this.normalizeConfig(n,e)}))},P.prototype.resolveRules=function(t){return this.resolveConfiguredRules(t).then((t=>{const e=Object.entries(t).map((([t,e])=>{const{category:n,config:r}=this.parseRuleValue(e);return{name:t,category:n,config:r}})),n=e.filter((t=>"off"!==t.category)).map((t=>{const{name:e,config:n}=t;return this.resolveRule(e,n).then((function(e){return{...t,rule:e}}))}));return Promise.all(n)}))},P.prototype.resolveConfiguredRules=function(t){let e=t.extends;return"string"==typeof e&&(e=[e]),void 0===e&&(e=[]),Promise.all(e.map((t=>this.resolveConfig(t).then((t=>this.resolveConfiguredRules(t)))))).then((e=>[...e,this.normalizeConfig(t,"bpmnlint").rules].reduce(((t,e)=>({...t,...e})),{})))},P.prototype.lint=function(t,e){return e=e||this.config,this.resolveRules(e).then((e=>{const n={};return e.forEach((e=>{const{name:r}=e,i=this.applyRule(t,e);i.length&&(n[r]=i)})),n}))},P.prototype.parseRuleValue=function(t){let e,n;return Array.isArray(t)?(e=t[0],n=t[1]):(e=t,n={}),"string"==typeof e&&(e=e.toLowerCase()),e=I[e]||e,{config:n,category:e}},P.prototype.parseRuleName=function(t,e="bpmnlint"){const n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(t);if(!n)throw new Error(`unparseable rule name <${t}>`);const[r,i,o,s]=n;if(!o)return{pkg:e,ruleName:s};return{pkg:`${i?i+"/":""}${M(o)}`,ruleName:s}},P.prototype.parseConfigName=function(t){const e=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(t);if(!e)throw new Error(`unparseable config name <${t}>`);const[n,r,i,o]=e;if(!i)return{pkg:"bpmnlint",configName:o};return{pkg:`${r?r+"/":""}${M(i)}`,configName:o}},P.prototype.getSimplePackageName=function(t){const e=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(t);if(!e)throw new Error(`unparseable package name <${t}>`);const[n,r,i]=e;return`${r?r+"/":""}${function(t){if(t.startsWith("bpmnlint-plugin-"))return t.substring("bpmnlint-plugin-".length);return t}(i)}`},P.prototype.normalizeConfig=function(t,e){const n=t.rules||{},r=Object.keys(n).reduce(((t,r)=>{const i=n[r],{pkg:o,ruleName:s}=this.parseRuleName(r,e);return t["bpmnlint"===o?s:`${this.getSimplePackageName(o)}/${s}`]=i,t}),{});return{...t,rules:r}};var z,D={Linter:T},F=function(t,e){if("string"!=typeof t)throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){return(i=e.createElement("html")).innerHTML=t,i.removeChild(i.lastChild)}var i,o=H[r]||H._default,s=o[0],u=o[1],c=o[2];(i=e.createElement("div")).innerHTML=u+t+c;for(;s--;)i=i.lastChild;if(i.firstChild==i.lastChild)return i.removeChild(i.firstChild);var l=e.createDocumentFragment();for(;i.firstChild;)l.appendChild(i.removeChild(i.firstChild));return l}
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */,W=!1;"undefined"!=typeof document&&((z=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',W=!z.getElementsByTagName("link").length,z=void 0);var H={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:W?[1,"X<div>","</div>"]:[0,"",""]};H.td=H.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],H.option=H.optgroup=[1,'<select multiple="multiple">',"</select>"],H.thead=H.tbody=H.colgroup=H.caption=H.tfoot=[1,"<table>","</table>"],H.polyline=H.ellipse=H.polygon=H.circle=H.text=H.line=H.path=H.rect=H.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];!function(t){var e={exports:{}};t(e,e.exports)}((function(t,e){var n;n=A,t.exports=function(t){if(t.CSS&&t.CSS.escape)return t.CSS.escape;var e=function(t){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var e,n=String(t),r=n.length,i=-1,o="",s=n.charCodeAt(0);++i<r;)0!=(e=n.charCodeAt(i))?o+=e>=1&&e<=31||127==e||0==i&&e>=48&&e<=57||1==i&&e>=48&&e<=57&&45==s?"\\"+e.toString(16)+" ":0==i&&1==r&&45==e||!(e>=128||45==e||95==e||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)?"\\"+n.charAt(i):n.charAt(i):o+="�";return o};return t.CSS||(t.CSS={}),t.CSS.escape=e,e}(n)}));var q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function G(t){return(t=""+t)&&t.replace(/[&<>"']/g,(function(t){return q[t]}))}function V(t,e){var n=function(t){return t&&t.businessObject||t}(t);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(e)}var J='<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>',K='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 512 512"><path fill="currentColor" d="M288 328.83c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zM207.439 57.034l11.61 204.348c.544 9.334 8.78 16.64 18.755 16.64h100.392c9.975 0 18.211-7.306 18.754-16.64l11.611-204.348c.587-10.082-7.98-18.56-18.754-18.56H226.192c-10.775 0-19.34 8.478-18.753 18.56z"/></svg>',U='<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>',X={resolver:{resolveRule:function(){return null}},config:{}},Q={error:J,warning:K,success:U,inactive:U};function Y(t,e,n,r,i,o,s){this._bpmnjs=t,this._canvas=e,this._elementRegistry=r,this._eventBus=i,this._overlays=o,this._translate=s,this._issues={},this._active=n&&n.active||!1,this._linterConfig=X,this._overlayIds={};var u=this;i.on(["import.done","elements.changed","linting.configChanged","linting.toggle"],500,(function(t){u.isActive()&&u.update()})),i.on("linting.toggle",(function(t){t.active||(u._clearIssues(),u._updateButton())})),i.on("diagram.clear",(function(){u._clearIssues()}));var c=n&&n.bpmnlint;c&&i.once("diagram.init",(function(){if(u.getLinterConfig()===X)try{u.setLinterConfig(c)}catch(t){console.error("[bpmn-js-bpmnlint] Invalid lint rules configured. Please doublecheck your linting.bpmnlint configuration, cf. https://github.com/bpmn-io/bpmn-js-bpmnlint#configure-lint-rules")}})),this._init()}return Y.prototype.setLinterConfig=function(t){if(!t.config||!t.resolver)throw new Error("Expected linterConfig = { config, resolver }");this._linterConfig=t,this._eventBus.fire("linting.configChanged")},Y.prototype.getLinterConfig=function(){return this._linterConfig},Y.prototype._init=function(){this._createButton(),this._updateButton()},Y.prototype.isActive=function(){return this._active},Y.prototype._formatIssues=function(t){let e=this,n=d(t,(function(t,e,n){return t.concat(e.map((function(t){return t.rule=n,t})))}),[]);const r=e._elementRegistry.filter((t=>V(t,"bpmn:Participant"))).map((t=>t.businessObject));return n=v(n,(function(t){if(!e._elementRegistry.get(t.id)){t.isChildIssue=!0,t.actualElementId=t.id;const n=r.filter((e=>e.processRef&&e.processRef.id&&e.processRef.id===t.id));n.length?t.id=n[0].id:t.id=e._canvas.getRootElement().id}return t})),n=y(n,(function(t){return t.id})),n},Y.prototype.toggle=function(t){return t=void 0===t?!this.isActive():t,this._setActive(t),t},Y.prototype._setActive=function(t){this._active!==t&&(this._active=t,this._eventBus.fire("linting.toggle",{active:t}))},Y.prototype.update=function(){var t=this;if(this._bpmnjs.getDefinitions()){var e=this._lintStart=Math.random();this.lint().then((function(n){if(t._lintStart===e){n=t._formatIssues(n);var r={},i={},o={};for(var s in t._issues)n[s]||(r[s]=t._issues[s]);for(var u in n)t._issues[u]?n[u]!==t._issues[u]&&(i[u]=n[u]):o[u]=n[u];r=O(r,i),o=O(o,i),t._clearOverlays(),t._createIssues(o),t._issues=n,t._updateButton(),t._fireComplete(n)}}))}},Y.prototype._fireComplete=function(t){this._eventBus.fire("linting.completed",{issues:t})},Y.prototype._createIssues=function(t){for(var e in t)this._createElementIssues(e,t[e])},Y.prototype._createElementIssues=function(t,e){var n=this._elementRegistry.get(t);if(n){var r,i,o=this._elementRegistry.get(t+"_plane");o&&this._createElementIssues(o.id,e);var s=!n.parent;s&&V(n,"bpmn:Process")?(r="bottom-right",i={top:20,left:150}):s&&V(n,"bpmn:SubProcess")?(r="bottom-right",i={top:50,left:150}):(r="top-right",i={top:-7,left:-7});var u=y(e,(function(t){return(t.isChildIssue?"child":"")+t.category})),c=u.error,l=u.warn,a=u.childerror,f=u.childwarn;if(c||l||a||f){var p=F('<div class="bjsl-overlay bjsl-issues-'+r+'"></div>'),h=F(c||a?'<div class="bjsl-icon bjsl-icon-error">'+J+"</div>":'<div class="bjsl-icon bjsl-icon-warning">'+K+"</div>"),d=F('<div class="bjsl-dropdown"></div>'),g=F('<div class="bjsl-dropdown-content"></div>'),v=F('<div class="bjsl-issues"></div>'),m=F('<div class="bjsl-current-element-issues"></div>'),b=F("<ul></ul>");if(p.appendChild(h),p.appendChild(d),d.appendChild(g),g.appendChild(v),v.appendChild(m),m.appendChild(b),c&&this._addErrors(b,c),l&&this._addWarnings(b,l),a||f){var _=F('<div class="bjsl-child-issues"></div>'),w=F("<ul></ul>"),C=F('<a class="bjsl-issue-heading">Issues for child elements:</a>');if(a&&this._addErrors(w,a),f&&this._addWarnings(w,f),c||l){var j=F("<hr/>");_.appendChild(j)}_.appendChild(C),_.appendChild(w),v.appendChild(_)}this._overlayIds[t]=this._overlays.add(n,"linting",{position:i,html:p,scale:{min:.9}})}}},Y.prototype._addErrors=function(t,e){var n=this;e.forEach((function(e){n._addEntry(t,"error",e)}))},Y.prototype._addWarnings=function(t,e){var n=this;e.forEach((function(e){n._addEntry(t,"warning",e)}))},Y.prototype._addEntry=function(t,e,n){var r=n.rule,i=this._translate(n.message),o=n.actualElementId,s=F('<li class="'+e+'"><span class="icon"> '+Q[e]+'</span><a title="'+G(r)+": "+G(i)+'" data-rule="'+G(r)+'" data-message="'+G(i)+'">'+G(i)+"</a>"+(o?'<a class="bjsl-id-hint"><code>'+o+"</code></a>":"")+"</li>");t.appendChild(s)},Y.prototype._clearOverlays=function(){this._overlays.remove({type:"linting"}),this._overlayIds={}},Y.prototype._clearIssues=function(){this._issues={},this._clearOverlays()},Y.prototype._setButtonState=function(t,e,n){var r=this._button,i=Q[t]+"<span>"+this._translate("{errors} Errors, {warnings} Warnings",{errors:e.toString(),warnings:n.toString()})+"</span>";["error","inactive","success","warning"].forEach((function(e){t===e?r.classList.add("bjsl-button-"+e):r.classList.remove("bjsl-button-"+e)})),r.innerHTML=i},Y.prototype._updateButton=function(){if(this.isActive()){var t=0,e=0;for(var n in this._issues)this._issues[n].forEach((function(n){"error"===n.category?t++:"warn"===n.category&&e++}));var r=(t?"error":e&&"warning")||"success";this._setButtonState(r,t,e)}else this._setButtonState("inactive",0,0)},Y.prototype._createButton=function(){var t=this;this._button=F('<button class="bjsl-button bjsl-button-inactive" title="'+this._translate("Toggle linting")+'"></button>'),this._button.addEventListener("click",(function(){t.toggle()})),this._canvas.getContainer().appendChild(this._button)},Y.prototype.lint=function(){var t=this._bpmnjs.getDefinitions();return new D.Linter(this._linterConfig).lint(t)},Y.$inject=["bpmnjs","canvas","config.linting","elementRegistry","eventBus","overlays","translate"],{__init__:["linting","lintingEditorActions"],linting:["type",Y],lintingEditorActions:["type",t]}}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).BpmnJSBpmnlint=e()}(this,(function(){"use strict";function t(t,e){var n=t.get("editorActions",!1);n&&n.register({toggleLinting:function(){e.toggle()}})}t.$inject=["injector","linting"];var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){if(this instanceof t){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(e,n))}return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var r=Object.prototype.toString,i=Object.prototype.hasOwnProperty;function o(t){return void 0===t}function s(t){return void 0!==t}function u(t){return null==t}function c(t){return"[object Array]"===r.call(t)}function l(t){return"[object Object]"===r.call(t)}function a(t){var e=r.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object AsyncGeneratorFunction]"===e||"[object Proxy]"===e}function f(t){if(!c(t))throw new Error("must supply array")}function p(t,e){return i.call(t,e)}function d(t,e){var n;return e=j(e),h(t,(function(t,r){if(e(t,r))return n=t,!1})),n}function h(t,e){var n;if(!o(t)){var r=c(t)?S:E;for(var i in t)if(p(t,i)&&!1===e(n=t[i],r(i)))return n}}function g(t,e,n){return h(t,(function(t,r){n=e(n,t,r)})),n}function v(t,e){return!!g(t,(function(t,n,r){return t&&e(n,r)}),!0)}function y(t,e){var n=[];return h(t,(function(t,r){n.push(e(t,r))})),n}function m(t){return t&&Object.keys(t)||[]}function b(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=C(e),h(t,(function(t){var r=e(t)||"_",i=n[r];i||(i=n[r]=[]),i.push(t)})),n}function _(t){t=C(t);for(var e={},n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return h(r,(function(n){return b(n,t,e)})),y(e,(function(t,e){return t[0]}))}var w=_;function C(t){return a(t)?t:function(e){return e[t]}}function j(t){return a(t)?t:function(e){return e===t}}function E(t){return t}function S(t){return Number(t)}function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function O(){return O=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},O.apply(this,arguments)}var A=Object.freeze({__proto__:null,assign:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return O.apply(void 0,[t].concat(n))},bind:function(t,e){return t.bind(e)},debounce:function(t,e){var n,r,i,o;function s(n){var s=Date.now(),l=n?0:o+e-s;if(l>0)return u(l);t.apply(i,r),c()}function u(t){n=setTimeout(s,t)}function c(){n&&clearTimeout(n),n=o=r=i=void 0}function l(){o=Date.now();for(var t=arguments.length,s=new Array(t),c=0;c<t;c++)s[c]=arguments[c];r=s,i=this,n||u(e)}return l.flush=function(){n&&s(!0),c()},l.cancel=c,l},ensureArray:f,every:v,filter:function(t,e){var n=[];return h(t,(function(t,r){e(t,r)&&n.push(t)})),n},find:d,findIndex:function(t,e){e=j(e);var n=c(t)?-1:void 0;return h(t,(function(t,r){if(e(t,r))return n=r,!1})),n},flatten:function(t){return Array.prototype.concat.apply([],t)},forEach:h,get:function(t,e,n){var r=t;return h(e,(function(t){if(u(r))return r=void 0,!1;r=r[t]})),o(r)?n:r},groupBy:b,has:p,isArray:c,isDefined:s,isFunction:a,isNil:u,isNumber:function(t){return"[object Number]"===r.call(t)},isObject:l,isString:function(t){return"[object String]"===r.call(t)},isUndefined:o,keys:m,map:y,matchPattern:function(t){return function(e){return v(t,(function(t,n){return e[n]===t}))}},merge:function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.length?(h(r,(function(n){n&&l(n)&&h(n,(function(n,r){if("__proto__"!==r){var i=e[r];l(n)?(l(i)||(i={}),e[r]=t(i,n)):e[r]=n}}))})),e):e},omit:function(t,e){var n={};return h(Object(t),(function(t,r){-1===e.indexOf(r)&&(n[r]=t)})),n},pick:function(t,e){var n={},r=Object(t);return h(e,(function(e){e in r&&(n[e]=t[e])})),n},reduce:g,set:function(t,e,n){var r=t;return h(e,(function(t,i){if("number"!=typeof t&&"string"!=typeof t)throw new Error("illegal key type: "+R(t)+". Key should be of type number or string.");if("constructor"===t)throw new Error("illegal key: constructor");if("__proto__"===t)throw new Error("illegal key: __proto__");var c=e[i+1],l=r[t];s(c)&&u(l)&&(l=r[t]=isNaN(+c)?{}:[]),o(c)?o(n)?delete r[t]:r[t]=n:r=l})),t},size:function(t){return m(t).length},some:function(t,e){return!!d(t,e)},sortBy:function(t,e){e=C(e);var n=[];return h(t,(function(t,r){for(var i=e(t,r),o={d:i,v:t},s=0;s<n.length;s++){if(i<n[s].d)return void n.splice(s,0,o)}n.push(o)})),y(n,(function(t){return t.v}))},throttle:function(t,e){var n=!1;return function(){n||(t.apply(void 0,arguments),n=!0,setTimeout((function(){n=!1}),e))}},unionBy:w,uniqueBy:_,values:function(t){return y(t,(function(t){return t}))},without:function(t,e){return o(t)?[]:(f(t),e=j(e),t.filter((function(t,n){return!e(t,n)})))}}),k=n(A);const $=function t(e,n){const r=n.enter||null,i=n.leave||null,o=r&&r(e),s=e.$descriptor;if(!1!==o&&!s.isGeneric){s.properties.filter((t=>!t.isAttr&&!t.isReference&&"String"!==t.type)).forEach((r=>{if(r.name in e){const i=e[r.name];r.isMany?i.forEach((e=>{t(e,n)})):t(i,n)}}))}i&&i(e)},{isArray:x,isObject:L}=k;class B{constructor({moddleRoot:t,rule:e}){this.rule=e,this.moddleRoot=t,this.messages=[],this.report=this.report.bind(this)}report(t,e,n){let r={id:t,message:e};n&&x(n)&&(r={...r,path:n}),n&&L(n)&&(r={...r,...n}),this.messages.push(r)}}const N=function({moddleRoot:t,rule:e}){const n=new B({rule:e,moddleRoot:t}),r=e.check,i=r&&r.enter||r,o=r&&r.leave;if(!i&&!o)throw new Error("no check implemented");return $(t,{enter:i?t=>i(t,n):null,leave:o?t=>o(t,n):null}),n.messages},P={0:"off",1:"warn",2:"error"};function I(t={}){const{config:e,resolver:n}=t;if(void 0===n)throw new Error("must provide <options.resolver>");this.config=e,this.resolver=n,this.cachedRules={},this.cachedConfigs={}}var T=I;function F(t){return"bpmnlint"===t?"bpmnlint":t.startsWith("bpmnlint-plugin-")?t:`bpmnlint-plugin-${t}`}I.prototype.applyRule=function(t,e){const{config:n,rule:r,category:i,name:o}=e;try{return N({moddleRoot:t,rule:r,config:n}).map((function(t){return{...t,category:i}}))}catch(t){return console.error("rule <"+o+"> failed with error: ",t),[{message:"Rule error: "+t.message,category:"error"}]}},I.prototype.resolveRule=function(t,e){const{pkg:n,ruleName:r}=this.parseRuleName(t),i=`${n}-${r}`,o=this.cachedRules[i];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,r)).then((n=>{if(!n)throw new Error(`unknown rule <${t}>`);return this.cachedRules[i]=n(e)}))},I.prototype.resolveConfig=function(t){const{pkg:e,configName:n}=this.parseConfigName(t),r=`${e}-${n}`,i=this.cachedConfigs[r];return i?Promise.resolve(i):Promise.resolve(this.resolver.resolveConfig(e,n)).then((n=>{if(!n)throw new Error(`unknown config <${t}>`);return this.cachedConfigs[r]=this.normalizeConfig(n,e)}))},I.prototype.resolveRules=function(t){return this.resolveConfiguredRules(t).then((t=>{const e=Object.entries(t).map((([t,e])=>{const{category:n,config:r}=this.parseRuleValue(e);return{name:t,category:n,config:r}})),n=e.filter((t=>"off"!==t.category)).map((t=>{const{name:e,config:n}=t;return this.resolveRule(e,n).then((function(e){return{...t,rule:e}}))}));return Promise.all(n)}))},I.prototype.resolveConfiguredRules=function(t){let e=t.extends;return"string"==typeof e&&(e=[e]),void 0===e&&(e=[]),Promise.all(e.map((t=>this.resolveConfig(t).then((t=>this.resolveConfiguredRules(t)))))).then((e=>[...e,this.normalizeConfig(t,"bpmnlint").rules].reduce(((t,e)=>({...t,...e})),{})))},I.prototype.lint=function(t,e){return e=e||this.config,this.resolveRules(e).then((e=>{const n={};return e.forEach((e=>{const{name:r}=e,i=this.applyRule(t,e);i.length&&(n[r]=i)})),n}))},I.prototype.parseRuleValue=function(t){let e,n;return Array.isArray(t)?(e=t[0],n=t[1]):(e=t,n={}),"string"==typeof e&&(e=e.toLowerCase()),e=P[e]||e,{config:n,category:e}},I.prototype.parseRuleName=function(t,e="bpmnlint"){const n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(t);if(!n)throw new Error(`unparseable rule name <${t}>`);const[r,i,o,s]=n;if(!o)return{pkg:e,ruleName:s};return{pkg:`${i?i+"/":""}${F(o)}`,ruleName:s}},I.prototype.parseConfigName=function(t){const e=/^(?:(?:plugin:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)|bpmnlint:)([^/]+)$/.exec(t);if(!e)throw new Error(`unparseable config name <${t}>`);const[n,r,i,o]=e;if(!i)return{pkg:"bpmnlint",configName:o};return{pkg:`${r?r+"/":""}${F(i)}`,configName:o}},I.prototype.getSimplePackageName=function(t){const e=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(t);if(!e)throw new Error(`unparseable package name <${t}>`);const[n,r,i]=e;return`${r?r+"/":""}${function(t){if(t.startsWith("bpmnlint-plugin-"))return t.substring("bpmnlint-plugin-".length);return t}(i)}`},I.prototype.normalizeConfig=function(t,e){const n=t.rules||{},r=Object.keys(n).reduce(((t,r)=>{const i=n[r],{pkg:o,ruleName:s}=this.parseRuleName(r,e);return t["bpmnlint"===o?s:`${this.getSimplePackageName(o)}/${s}`]=i,t}),{});return{...t,rules:r}};var M={Linter:T};const z=Object.prototype.toString,D=Object.prototype.hasOwnProperty;function W(t,e){return D.call(t,e)}function G(t,e){let n,r;if(void 0===t)return;const i=function(t){return"[object Array]"===z.call(t)}(t)?V:q;for(let o in t)if(W(t,o)&&(n=t[o],r=e(n,i(o)),!1===r))return n}function H(t,e,n={}){return e=function(t){return function(t){const e=z.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object AsyncGeneratorFunction]"===e||"[object Proxy]"===e}(t)?t:e=>e[t]}(e),G(t,(function(t){let r=e(t)||"_",i=n[r];i||(i=n[r]=[]),i.push(t)})),n}function q(t){return t}function V(t){return Number(t)}function J(t,...e){return Object.assign(t,...e)}var K,U,X,Q={};function Y(){K=window.addEventListener?"addEventListener":"attachEvent",U=window.removeEventListener?"removeEventListener":"detachEvent",X="addEventListener"!==K?"on":""}Q.bind=function(t,e,n,r){return K||Y(),t[K](X+e,n,r||!1),n},Q.unbind=function(t,e,n,r){return U||Y(),t[U](X+e,n,r||!1),n};var Z,tt=function(t,e){if("string"!=typeof t)throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){return(i=e.createElement("html")).innerHTML=t,i.removeChild(i.lastChild)}var i,o=Object.prototype.hasOwnProperty.call(nt,r)?nt[r]:nt._default,s=o[0],u=o[1],c=o[2];(i=e.createElement("div")).innerHTML=u+t+c;for(;s--;)i=i.lastChild;if(i.firstChild==i.lastChild)return i.removeChild(i.firstChild);var l=e.createDocumentFragment();for(;i.firstChild;)l.appendChild(i.removeChild(i.firstChild));return l},et=!1;"undefined"!=typeof document&&((Z=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',et=!Z.getElementsByTagName("link").length,Z=void 0);var nt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:et?[1,"X<div>","</div>"]:[0,"",""]};nt.td=nt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],nt.option=nt.optgroup=[1,'<select multiple="multiple">',"</select>"],nt.thead=nt.tbody=nt.colgroup=nt.caption=nt.tfoot=[1,"<table>","</table>"],nt.polyline=nt.ellipse=nt.polygon=nt.circle=nt.text=nt.line=nt.path=nt.rect=nt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var rt=tt,it={};
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
!function(t,n){var r;r=e,t.exports=function(t){if(t.CSS&&t.CSS.escape)return t.CSS.escape;var e=function(t){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var e,n=String(t),r=n.length,i=-1,o="",s=n.charCodeAt(0);++i<r;)0!=(e=n.charCodeAt(i))?o+=e>=1&&e<=31||127==e||0==i&&e>=48&&e<=57||1==i&&e>=48&&e<=57&&45==s?"\\"+e.toString(16)+" ":0==i&&1==r&&45==e||!(e>=128||45==e||95==e||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)?"\\"+n.charAt(i):n.charAt(i):o+="�";return o};return t.CSS||(t.CSS={}),t.CSS.escape=e,e}(r)}({get exports(){return it},set exports(t){it=t}});var ot={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function st(t){return(t=""+t)&&t.replace(/[&<>"']/g,(function(t){return ot[t]}))}function ut(t,e){var n=function(t){return t&&t.businessObject||t}(t);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(e)}var ct='<svg width="12" height="12" version="1.1" viewBox="0 0 352 512" xmlns="http://www.w3.org/2000/svg">\n <path d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z" fill="currentColor"/>\n</svg>\n',lt='<svg width="12" height="12" version="1.1" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <path d="m256 323.95c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zm-80.561-271.8 11.61 204.35c.544 9.334 8.78 16.64 18.755 16.64h100.39c9.975 0 18.211-7.306 18.754-16.64l11.611-204.35c.587-10.082-7.98-18.56-18.754-18.56h-123.62c-10.775 0-19.34 8.478-18.753 18.56z" fill="currentColor"/>\n</svg>\n',at='<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>',ft=500,pt={resolver:{resolveRule:function(){return null}},config:{}},dt={error:ct,warning:lt,success:at,inactive:at};function ht(t,e,n,r,i,o,s){this._bpmnjs=t,this._canvas=e,this._elementRegistry=r,this._eventBus=i,this._overlays=o,this._translate=s,this._issues={},this._active=n&&n.active||!1,this._linterConfig=pt,this._overlayIds={};var u=this;i.on(["import.done","elements.changed","linting.configChanged","linting.toggle"],ft,(function(t){u.isActive()&&u.update()})),i.on("linting.toggle",(function(t){t.active||(u._clearIssues(),u._updateButton())})),i.on("diagram.clear",(function(){u._clearIssues()}));var c=n&&n.bpmnlint;c&&i.once("diagram.init",(function(){if(u.getLinterConfig()===pt)try{u.setLinterConfig(c)}catch(t){console.error("[bpmn-js-bpmnlint] Invalid lint rules configured. Please doublecheck your linting.bpmnlint configuration, cf. https://github.com/bpmn-io/bpmn-js-bpmnlint#configure-lint-rules")}})),this._init()}return ht.prototype.setLinterConfig=function(t){if(!t.config||!t.resolver)throw new Error("Expected linterConfig = { config, resolver }");this._linterConfig=t,this._eventBus.fire("linting.configChanged")},ht.prototype.getLinterConfig=function(){return this._linterConfig},ht.prototype._init=function(){this._createButton(),this._updateButton()},ht.prototype.isActive=function(){return this._active},ht.prototype._formatIssues=function(t){let e=this,n=(r=function(t,e,n){return t.concat(e.map((function(t){return t.rule=n,t})))},i=[],G(t,(function(t,e){i=r(i,t,e)})),i);var r,i;const o=e._elementRegistry.filter((t=>ut(t,"bpmn:Participant"))).map((t=>t.businessObject));return n=function(t,e){let n=[];return G(t,(function(t,r){n.push(e(t,r))})),n}(n,(function(t){if(!e._elementRegistry.get(t.id)){t.isChildIssue=!0,t.actualElementId=t.id;const n=o.filter((e=>e.processRef&&e.processRef.id&&e.processRef.id===t.id));n.length?t.id=n[0].id:t.id=e._canvas.getRootElement().id}return t})),n=H(n,(function(t){return t.id})),n},ht.prototype.toggle=function(t){return t=void 0===t?!this.isActive():t,this._setActive(t),t},ht.prototype._setActive=function(t){this._active!==t&&(this._active=t,this._eventBus.fire("linting.toggle",{active:t}))},ht.prototype.update=function(){var t=this;if(this._bpmnjs.getDefinitions()){var e=this._lintStart=Math.random();this.lint().then((function(n){if(t._lintStart===e){n=t._formatIssues(n);var r={},i={},o={};for(var s in t._issues)n[s]||(r[s]=t._issues[s]);for(var u in n)t._issues[u]?n[u]!==t._issues[u]&&(i[u]=n[u]):o[u]=n[u];r=J(r,i),o=J(o,i),t._clearOverlays(),t._createIssues(o),t._issues=n,t._updateButton(),t._fireComplete(n)}}))}},ht.prototype._fireComplete=function(t){this._eventBus.fire("linting.completed",{issues:t})},ht.prototype._createIssues=function(t){for(var e in t)this._createElementIssues(e,t[e])},ht.prototype._createElementIssues=function(t,e){var n=this._elementRegistry.get(t);if(n){var r,i,o=this._elementRegistry.get(t+"_plane");o&&this._createElementIssues(o.id,e);var s=!n.parent;s&&ut(n,"bpmn:Process")?(r="bottom-right",i={top:20,left:150}):s&&ut(n,"bpmn:SubProcess")?(r="bottom-right",i={top:50,left:150}):(r="top-right",i={top:-7,left:-7});var u=H(e,(function(t){return(t.isChildIssue?"child":"")+t.category})),c=u.error,l=u.warn,a=u.childerror,f=u.childwarn;if(c||l||a||f){var p=rt('<div class="bjsl-overlay bjsl-issues-'+r+'"></div>'),d=rt(c||a?'<div class="bjsl-icon bjsl-icon-error">'+ct+"</div>":'<div class="bjsl-icon bjsl-icon-warning">'+lt+"</div>"),h=rt('<div class="bjsl-dropdown"></div>'),g=rt('<div class="bjsl-dropdown-content"></div>'),v=rt('<div class="bjsl-issues"></div>'),y=rt('<div class="bjsl-current-element-issues"></div>'),m=rt("<ul></ul>");if(p.appendChild(d),p.appendChild(h),h.appendChild(g),g.appendChild(v),v.appendChild(y),y.appendChild(m),c&&this._addErrors(m,c),l&&this._addWarnings(m,l),a||f){var b=rt('<div class="bjsl-child-issues"></div>'),_=rt("<ul></ul>"),w=rt('<a class="bjsl-issue-heading">Issues for child elements:</a>');if(a&&this._addErrors(_,a),f&&this._addWarnings(_,f),c||l){var C=rt("<hr/>");b.appendChild(C)}b.appendChild(w),b.appendChild(_),v.appendChild(b)}this._overlayIds[t]=this._overlays.add(n,"linting",{position:i,html:p,scale:{min:.9}})}}},ht.prototype._addErrors=function(t,e){var n=this;e.forEach((function(e){n._addEntry(t,"error",e)}))},ht.prototype._addWarnings=function(t,e){var n=this;e.forEach((function(e){n._addEntry(t,"warning",e)}))},ht.prototype._addEntry=function(t,e,n){var r=n.rule,i=this._translate(n.message),o=n.actualElementId,s=rt('<li class="'+e+'"><span class="icon"> '+dt[e]+'</span><a title="'+st(r)+": "+st(i)+'" data-rule="'+st(r)+'" data-message="'+st(i)+'">'+st(i)+"</a>"+(o?'<a class="bjsl-id-hint"><code>'+o+"</code></a>":"")+"</li>");t.appendChild(s)},ht.prototype._clearOverlays=function(){this._overlays.remove({type:"linting"}),this._overlayIds={}},ht.prototype._clearIssues=function(){this._issues={},this._clearOverlays()},ht.prototype._setButtonState=function(t,e,n){var r=this._button,i=dt[t]+"<span>"+this._translate("{errors} Errors, {warnings} Warnings",{errors:e.toString(),warnings:n.toString()})+"</span>";["error","inactive","success","warning"].forEach((function(e){t===e?r.classList.add("bjsl-button-"+e):r.classList.remove("bjsl-button-"+e)})),r.innerHTML=i},ht.prototype._updateButton=function(){if(this.isActive()){var t=0,e=0;for(var n in this._issues)this._issues[n].forEach((function(n){"error"===n.category?t++:"warn"===n.category&&e++}));var r=(t?"error":e&&"warning")||"success";this._setButtonState(r,t,e)}else this._setButtonState("inactive",0,0)},ht.prototype._createButton=function(){var t=this;this._button=rt('<button class="bjsl-button bjsl-button-inactive" title="'+this._translate("Toggle linting")+'"></button>'),this._button.addEventListener("click",(function(){t.toggle()})),this._canvas.getContainer().appendChild(this._button)},ht.prototype.lint=function(){var t=this._bpmnjs.getDefinitions();return new M.Linter(this._linterConfig).lint(t)},ht.$inject=["bpmnjs","canvas","config.linting","elementRegistry","eventBus","overlays","translate"],{__init__:["linting","lintingEditorActions"],linting:["type",ht],lintingEditorActions:["type",t]}}));

@@ -22,5 +22,5 @@ import { Linter } from 'bpmnlint';

var ErrorSvg = "<svg width=\"12\" height=\"12\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 352 512\"><path fill=\"currentColor\" d=\"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\"></path></svg>";
var ErrorSvg = "<svg width=\"12\" height=\"12\" version=\"1.1\" viewBox=\"0 0 352 512\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\" fill=\"currentColor\"/>\n</svg>\n";
var WarningSvg = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M288 328.83c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zM207.439 57.034l11.61 204.348c.544 9.334 8.78 16.64 18.755 16.64h100.392c9.975 0 18.211-7.306 18.754-16.64l11.611-204.348c.587-10.082-7.98-18.56-18.754-18.56H226.192c-10.775 0-19.34 8.478-18.753 18.56z\"/></svg>";
var WarningSvg = "<svg width=\"12\" height=\"12\" version=\"1.1\" viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m256 323.95c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zm-80.561-271.8 11.61 204.35c.544 9.334 8.78 16.64 18.755 16.64h100.39c9.975 0 18.211-7.306 18.754-16.64l11.611-204.35c.587-10.082-7.98-18.56-18.754-18.56h-123.62c-10.775 0-19.34 8.478-18.753 18.56z\" fill=\"currentColor\"/>\n</svg>\n";

@@ -564,6 +564,6 @@ var SuccessSvg = "<svg width=\"12\" height=\"12\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path></svg>";

linting: [ 'type', Linting ],
lintingEditorActions: ['type', EditorActions ]
lintingEditorActions: [ 'type', EditorActions ]
};
export default index;
export { index as default };
//# sourceMappingURL=index.esm.js.map

@@ -24,5 +24,5 @@ 'use strict';

var ErrorSvg = "<svg width=\"12\" height=\"12\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 352 512\"><path fill=\"currentColor\" d=\"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\"></path></svg>";
var ErrorSvg = "<svg width=\"12\" height=\"12\" version=\"1.1\" viewBox=\"0 0 352 512\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\" fill=\"currentColor\"/>\n</svg>\n";
var WarningSvg = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M288 328.83c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zM207.439 57.034l11.61 204.348c.544 9.334 8.78 16.64 18.755 16.64h100.392c9.975 0 18.211-7.306 18.754-16.64l11.611-204.348c.587-10.082-7.98-18.56-18.754-18.56H226.192c-10.775 0-19.34 8.478-18.753 18.56z\"/></svg>";
var WarningSvg = "<svg width=\"12\" height=\"12\" version=\"1.1\" viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m256 323.95c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zm-80.561-271.8 11.61 204.35c.544 9.334 8.78 16.64 18.755 16.64h100.39c9.975 0 18.211-7.306 18.754-16.64l11.611-204.35c.587-10.082-7.98-18.56-18.754-18.56h-123.62c-10.775 0-19.34 8.478-18.753 18.56z\" fill=\"currentColor\"/>\n</svg>\n";

@@ -566,3 +566,3 @@ var SuccessSvg = "<svg width=\"12\" height=\"12\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path></svg>";

linting: [ 'type', Linting ],
lintingEditorActions: ['type', EditorActions ]
lintingEditorActions: [ 'type', EditorActions ]
};

@@ -569,0 +569,0 @@

{
"name": "bpmn-js-bpmnlint",
"version": "0.20.0",
"version": "0.20.1",
"description": "bpmn-js integration for bpmnlint",

@@ -35,14 +35,14 @@ "main": "dist/index.js",

"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-terser": "^0.2.0",
"bpmn-js": "^11.1.0",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"bpmn-js": "^11.3.1",
"bpmnlint": "^8.1.1",
"bpmnlint-loader": "^0.1.6",
"chai": "^4.2.0",
"chai": "^4.3.7",
"cpx": "^1.5.0",
"cross-env": "^7.0.3",
"diagram-js": "^11.4.1",
"eslint": "^7.24.0",
"eslint-plugin-bpmn-io": "^0.12.0",
"diagram-js": "^11.9.0",
"eslint": "^8.34.0",
"eslint-plugin-bpmn-io": "^1.0.0",
"karma": "^6.4.1",

@@ -55,15 +55,15 @@ "karma-chrome-launcher": "^3.1.1",

"karma-webpack": "^5.0.0",
"mocha": "^8.2.1",
"mocha": "^8.4.0",
"mocha-test-container-support": "^0.2.0",
"npm-run-all": "^4.1.5",
"puppeteer": "^19.4.0",
"rollup": "^2.35.0",
"puppeteer": "^19.7.1",
"rollup": "^2.79.1",
"rollup-plugin-string": "^3.0.0",
"sinon": "^9.2.4",
"sinon-chai": "^3.5.0",
"sinon-chai": "^3.7.0",
"webpack": "^5.75.0"
},
"dependencies": {
"min-dash": "^3.5.2",
"min-dom": "^3.1.3"
"min-dash": "^4.0.0",
"min-dom": "^4.1.0"
},

@@ -74,3 +74,6 @@ "peerDependencies": {

"diagram-js": "*"
}
},
"files": [
"dist"
]
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet