camunda-bpmn-js 5.16.0 → 5.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/base-modeler.development.js +18839 -15666
  2. package/dist/base-modeler.production.min.js +45 -45
  3. package/dist/base-navigated-viewer.development.js +1958 -1314
  4. package/dist/base-navigated-viewer.production.min.js +1 -1
  5. package/dist/base-viewer.development.js +1221 -599
  6. package/dist/base-viewer.production.min.js +1 -1
  7. package/dist/camunda-cloud-modeler.development.js +11497 -7207
  8. package/dist/camunda-cloud-modeler.production.min.js +47 -47
  9. package/dist/camunda-cloud-navigated-viewer.development.js +1850 -1171
  10. package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
  11. package/dist/camunda-cloud-viewer.development.js +1842 -1185
  12. package/dist/camunda-cloud-viewer.production.min.js +1 -1
  13. package/dist/camunda-platform-modeler.development.js +9052 -4379
  14. package/dist/camunda-platform-modeler.production.min.js +45 -45
  15. package/dist/camunda-platform-navigated-viewer.development.js +1839 -1183
  16. package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
  17. package/dist/camunda-platform-viewer.development.js +1818 -1184
  18. package/dist/camunda-platform-viewer.production.min.js +1 -1
  19. package/index.js +1 -0
  20. package/lib/base/Modeler.js +12 -0
  21. package/lib/base/NavigatedViewer.js +10 -0
  22. package/lib/base/Viewer.js +10 -0
  23. package/lib/camunda-cloud/ElementTemplatesValidator.js +10 -0
  24. package/lib/camunda-cloud/Modeler.js +10 -0
  25. package/lib/camunda-cloud/NavigatedViewer.js +10 -0
  26. package/lib/camunda-cloud/Viewer.js +10 -0
  27. package/lib/camunda-cloud/features/external-resources/README.md +1 -1
  28. package/lib/camunda-cloud/features/external-resources/ResourceLoader.d.ts +9 -0
  29. package/lib/camunda-cloud/features/external-resources/ResourceLoader.js +10 -0
  30. package/lib/camunda-cloud/features/external-resources/Resources.d.ts +9 -0
  31. package/lib/camunda-cloud/features/external-resources/Resources.js +10 -0
  32. package/lib/camunda-cloud/features/external-resources/cmd/ComposedCommandHandler.d.ts +9 -0
  33. package/lib/camunda-cloud/features/external-resources/cmd/ComposedCommandHandler.js +10 -0
  34. package/lib/camunda-cloud/features/external-resources/cmd/index.js +10 -0
  35. package/lib/camunda-cloud/features/external-resources/handlers/decision/AppendMenuProvider.js +11 -1
  36. package/lib/camunda-cloud/features/external-resources/handlers/decision/CreateMenuProvider.js +11 -1
  37. package/lib/camunda-cloud/features/external-resources/handlers/decision/ReplaceMenuProvider.js +11 -1
  38. package/lib/camunda-cloud/features/external-resources/handlers/decision/createElement.d.ts +15 -5
  39. package/lib/camunda-cloud/features/external-resources/handlers/decision/createElement.js +29 -4
  40. package/lib/camunda-cloud/features/external-resources/handlers/decision/index.js +10 -0
  41. package/lib/camunda-cloud/features/external-resources/handlers/decision/replaceElement.js +10 -0
  42. package/lib/camunda-cloud/features/external-resources/handlers/decision/searchTerms.d.ts +9 -0
  43. package/lib/camunda-cloud/features/external-resources/handlers/decision/searchTerms.js +10 -0
  44. package/lib/camunda-cloud/features/external-resources/handlers/form/AppendMenuProvider.js +11 -1
  45. package/lib/camunda-cloud/features/external-resources/handlers/form/CreateMenuProvider.js +11 -1
  46. package/lib/camunda-cloud/features/external-resources/handlers/form/ReplaceMenuProvider.js +11 -1
  47. package/lib/camunda-cloud/features/external-resources/handlers/form/createElement.d.ts +15 -1
  48. package/lib/camunda-cloud/features/external-resources/handlers/form/createElement.js +28 -3
  49. package/lib/camunda-cloud/features/external-resources/handlers/form/index.js +10 -0
  50. package/lib/camunda-cloud/features/external-resources/handlers/form/replaceElement.js +10 -0
  51. package/lib/camunda-cloud/features/external-resources/handlers/form/searchTerms.d.ts +9 -0
  52. package/lib/camunda-cloud/features/external-resources/handlers/form/searchTerms.js +10 -0
  53. package/lib/camunda-cloud/features/external-resources/handlers/process/AppendMenuProvider.js +11 -1
  54. package/lib/camunda-cloud/features/external-resources/handlers/process/CreateMenuProvider.js +11 -1
  55. package/lib/camunda-cloud/features/external-resources/handlers/process/ReplaceMenuProvider.js +11 -1
  56. package/lib/camunda-cloud/features/external-resources/handlers/process/createElement.d.ts +14 -5
  57. package/lib/camunda-cloud/features/external-resources/handlers/process/createElement.js +35 -4
  58. package/lib/camunda-cloud/features/external-resources/handlers/process/index.js +10 -0
  59. package/lib/camunda-cloud/features/external-resources/handlers/process/replaceElement.js +10 -0
  60. package/lib/camunda-cloud/features/external-resources/handlers/process/searchTerms.d.ts +9 -0
  61. package/lib/camunda-cloud/features/external-resources/handlers/process/searchTerms.js +10 -0
  62. package/lib/camunda-cloud/features/external-resources/handlers/rpa/AppendMenuProvider.d.ts +6 -0
  63. package/lib/camunda-cloud/features/external-resources/handlers/rpa/AppendMenuProvider.js +41 -0
  64. package/lib/camunda-cloud/features/external-resources/handlers/rpa/CreateMenuProvider.d.ts +6 -0
  65. package/lib/camunda-cloud/features/external-resources/handlers/rpa/CreateMenuProvider.js +41 -0
  66. package/lib/camunda-cloud/features/external-resources/handlers/rpa/ReplaceMenuProvider.d.ts +6 -0
  67. package/lib/camunda-cloud/features/external-resources/handlers/rpa/ReplaceMenuProvider.js +41 -0
  68. package/lib/camunda-cloud/features/external-resources/handlers/rpa/constants.d.ts +12 -0
  69. package/lib/camunda-cloud/features/external-resources/handlers/rpa/constants.js +14 -0
  70. package/lib/camunda-cloud/features/external-resources/handlers/rpa/createElement.d.ts +14 -0
  71. package/lib/camunda-cloud/features/external-resources/handlers/rpa/createElement.js +61 -0
  72. package/lib/camunda-cloud/features/external-resources/handlers/rpa/index.d.ts +8 -0
  73. package/lib/camunda-cloud/features/external-resources/handlers/rpa/index.js +20 -0
  74. package/lib/camunda-cloud/features/external-resources/handlers/rpa/replaceElement.d.ts +15 -0
  75. package/lib/camunda-cloud/features/external-resources/handlers/rpa/replaceElement.js +59 -0
  76. package/lib/camunda-cloud/features/external-resources/handlers/rpa/searchTerms.d.ts +10 -0
  77. package/lib/camunda-cloud/features/external-resources/handlers/rpa/searchTerms.js +11 -0
  78. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseAppendMenuProvider.d.ts +21 -4
  79. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseAppendMenuProvider.js +26 -8
  80. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseCreateMenuProvider.d.ts +19 -3
  81. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseCreateMenuProvider.js +24 -7
  82. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseReplaceMenuProvider.d.ts +6 -2
  83. package/lib/camunda-cloud/features/external-resources/handlers/util/BaseReplaceMenuProvider.js +19 -6
  84. package/lib/camunda-cloud/features/external-resources/index.d.ts +4 -0
  85. package/lib/camunda-cloud/features/external-resources/index.js +13 -1
  86. package/lib/camunda-cloud/features/popup-menu/CamundaDetailsPopupMenuProvider.js +10 -0
  87. package/lib/camunda-cloud/features/popup-menu/index.js +10 -0
  88. package/lib/camunda-cloud/util/commonModules.js +10 -0
  89. package/lib/camunda-platform/Modeler.js +10 -0
  90. package/lib/camunda-platform/NavigatedViewer.js +10 -0
  91. package/lib/camunda-platform/Viewer.js +10 -0
  92. package/lib/camunda-platform/util/commonModules.js +10 -0
  93. package/lib/util/ExtensionElementsUtil.js +10 -0
  94. package/package.json +21 -20
@@ -16,31 +16,27 @@
16
16
  * @return {T[]}
17
17
  */
18
18
 
19
- const nativeToString$2 = Object.prototype.toString;
20
- const nativeHasOwnProperty$2 = Object.prototype.hasOwnProperty;
19
+ const nativeToString$6 = Object.prototype.toString;
20
+ const nativeHasOwnProperty$5 = Object.prototype.hasOwnProperty;
21
21
 
22
- function isUndefined$3(obj) {
22
+ function isUndefined$6(obj) {
23
23
  return obj === undefined;
24
24
  }
25
25
 
26
- function isDefined(obj) {
27
- return obj !== undefined;
28
- }
29
-
30
- function isNil(obj) {
26
+ function isNil$3(obj) {
31
27
  return obj == null;
32
28
  }
33
29
 
34
- function isArray$3(obj) {
35
- return nativeToString$2.call(obj) === '[object Array]';
30
+ function isArray$6(obj) {
31
+ return nativeToString$6.call(obj) === '[object Array]';
36
32
  }
37
33
 
38
- function isObject(obj) {
39
- return nativeToString$2.call(obj) === '[object Object]';
34
+ function isObject$2(obj) {
35
+ return nativeToString$6.call(obj) === '[object Object]';
40
36
  }
41
37
 
42
- function isNumber(obj) {
43
- return nativeToString$2.call(obj) === '[object Number]';
38
+ function isNumber$1(obj) {
39
+ return nativeToString$6.call(obj) === '[object Number]';
44
40
  }
45
41
 
46
42
  /**
@@ -48,8 +44,8 @@
48
44
  *
49
45
  * @return {boolean}
50
46
  */
51
- function isFunction(obj) {
52
- const tag = nativeToString$2.call(obj);
47
+ function isFunction$2(obj) {
48
+ const tag = nativeToString$6.call(obj);
53
49
 
54
50
  return (
55
51
  tag === '[object Function]' ||
@@ -60,10 +56,6 @@
60
56
  );
61
57
  }
62
58
 
63
- function isString(obj) {
64
- return nativeToString$2.call(obj) === '[object String]';
65
- }
66
-
67
59
  /**
68
60
  * Return true, if target owns a property with the given key.
69
61
  *
@@ -72,8 +64,8 @@
72
64
  *
73
65
  * @return {Boolean}
74
66
  */
75
- function has$2(target, key) {
76
- return !isNil(target) && nativeHasOwnProperty$2.call(target, key);
67
+ function has$5(target, key) {
68
+ return !isNil$3(target) && nativeHasOwnProperty$5.call(target, key);
77
69
  }
78
70
 
79
71
  /**
@@ -136,13 +128,13 @@
136
128
  *
137
129
  * @return {Object}
138
130
  */
139
- function find(collection, matcher) {
131
+ function find$2(collection, matcher) {
140
132
 
141
- const matchFn = toMatcher(matcher);
133
+ const matchFn = toMatcher$2(matcher);
142
134
 
143
135
  let match;
144
136
 
145
- forEach$2(collection, function(val, key) {
137
+ forEach$5(collection, function(val, key) {
146
138
  if (matchFn(val, key)) {
147
139
  match = val;
148
140
 
@@ -155,33 +147,6 @@
155
147
  }
156
148
 
157
149
 
158
- /**
159
- * Find element index in collection.
160
- *
161
- * @template T
162
- * @param {Collection<T>} collection
163
- * @param {Matcher<T>} matcher
164
- *
165
- * @return {number | string | undefined}
166
- */
167
- function findIndex(collection, matcher) {
168
-
169
- const matchFn = toMatcher(matcher);
170
-
171
- let idx = isArray$3(collection) ? -1 : undefined;
172
-
173
- forEach$2(collection, function(val, key) {
174
- if (matchFn(val, key)) {
175
- idx = key;
176
-
177
- return false;
178
- }
179
- });
180
-
181
- return idx;
182
- }
183
-
184
-
185
150
  /**
186
151
  * Filter elements in collection.
187
152
  *
@@ -191,13 +156,13 @@
191
156
  *
192
157
  * @return {T[]} result
193
158
  */
194
- function filter(collection, matcher) {
159
+ function filter$2(collection, matcher) {
195
160
 
196
- const matchFn = toMatcher(matcher);
161
+ const matchFn = toMatcher$2(matcher);
197
162
 
198
163
  let result = [];
199
164
 
200
- forEach$2(collection, function(val, key) {
165
+ forEach$5(collection, function(val, key) {
201
166
  if (matchFn(val, key)) {
202
167
  result.push(val);
203
168
  }
@@ -217,20 +182,20 @@
217
182
  *
218
183
  * @return {T} return result that stopped the iteration
219
184
  */
220
- function forEach$2(collection, iterator) {
185
+ function forEach$5(collection, iterator) {
221
186
 
222
187
  let val,
223
188
  result;
224
189
 
225
- if (isUndefined$3(collection)) {
190
+ if (isUndefined$6(collection)) {
226
191
  return;
227
192
  }
228
193
 
229
- const convertKey = isArray$3(collection) ? toNum$2 : identity$2;
194
+ const convertKey = isArray$6(collection) ? toNum$5 : identity$5;
230
195
 
231
196
  for (let key in collection) {
232
197
 
233
- if (has$2(collection, key)) {
198
+ if (has$5(collection, key)) {
234
199
  val = collection[key];
235
200
 
236
201
  result = iterator(val, convertKey(key));
@@ -243,45 +208,6 @@
243
208
  }
244
209
 
245
210
 
246
- /**
247
- * Reduce collection, returning a single result.
248
- *
249
- * @template T
250
- * @template V
251
- *
252
- * @param {Collection<T>} collection
253
- * @param {(result: V, entry: T, index: any) => V} iterator
254
- * @param {V} result
255
- *
256
- * @return {V} result returned from last iterator
257
- */
258
- function reduce(collection, iterator, result) {
259
-
260
- forEach$2(collection, function(value, idx) {
261
- result = iterator(result, value, idx);
262
- });
263
-
264
- return result;
265
- }
266
-
267
-
268
- /**
269
- * Return true if every element in the collection
270
- * matches the criteria.
271
- *
272
- * @param {Object|Array} collection
273
- * @param {Function} matcher
274
- *
275
- * @return {Boolean}
276
- */
277
- function every(collection, matcher) {
278
-
279
- return !!reduce(collection, function(matches, val, key) {
280
- return matches && matcher(val, key);
281
- }, true);
282
- }
283
-
284
-
285
211
  /**
286
212
  * Return true if some elements in the collection
287
213
  * match the criteria.
@@ -293,7 +219,7 @@
293
219
  */
294
220
  function some(collection, matcher) {
295
221
 
296
- return !!find(collection, matcher);
222
+ return !!find$2(collection, matcher);
297
223
  }
298
224
 
299
225
 
@@ -310,7 +236,7 @@
310
236
 
311
237
  let result = [];
312
238
 
313
- forEach$2(collection, function(val, key) {
239
+ forEach$5(collection, function(val, key) {
314
240
  result.push(fn(val, key));
315
241
  });
316
242
 
@@ -318,331 +244,124 @@
318
244
  }
319
245
 
320
246
 
321
- /**
322
- * Create an object pattern matcher.
323
- *
324
- * @example
325
- *
326
- * ```javascript
327
- * const matcher = matchPattern({ id: 1 });
328
- *
329
- * let element = find(elements, matcher);
330
- * ```
331
- *
332
- * @template T
333
- *
334
- * @param {T} pattern
335
- *
336
- * @return { (el: any) => boolean } matcherFn
337
- */
338
- function matchPattern(pattern) {
339
-
340
- return function(el) {
341
-
342
- return every(pattern, function(val, key) {
343
- return el[key] === val;
344
- });
345
-
346
- };
347
- }
348
-
349
-
350
247
  /**
351
248
  * @template T
352
249
  * @param {Matcher<T>} matcher
353
250
  *
354
251
  * @return {MatchFn<T>}
355
252
  */
356
- function toMatcher(matcher) {
357
- return isFunction(matcher) ? matcher : (e) => {
253
+ function toMatcher$2(matcher) {
254
+ return isFunction$2(matcher) ? matcher : (e) => {
358
255
  return e === matcher;
359
256
  };
360
257
  }
361
258
 
362
259
 
363
- function identity$2(arg) {
260
+ function identity$5(arg) {
364
261
  return arg;
365
262
  }
366
263
 
367
- function toNum$2(arg) {
264
+ function toNum$5(arg) {
368
265
  return Number(arg);
369
266
  }
370
267
 
371
- /* global setTimeout clearTimeout */
372
-
373
268
  /**
374
- * @typedef { {
375
- * (...args: any[]): any;
376
- * flush: () => void;
377
- * cancel: () => void;
378
- * } } DebouncedFunction
269
+ * Convenience wrapper for `Object.assign`.
270
+ *
271
+ * @param {Object} target
272
+ * @param {...Object} others
273
+ *
274
+ * @return {Object} the target
379
275
  */
276
+ function assign$6(target, ...others) {
277
+ return Object.assign(target, ...others);
278
+ }
380
279
 
381
280
  /**
382
- * Debounce fn, calling it only once if the given time
383
- * elapsed between calls.
281
+ * Pick all target properties, excluding the given ones.
384
282
  *
385
- * Lodash-style the function exposes methods to `#clear`
386
- * and `#flush` to control internal behavior.
283
+ * @template T
284
+ * @template {any[]} V
387
285
  *
388
- * @param {Function} fn
389
- * @param {Number} timeout
286
+ * @param {T} target
287
+ * @param {V} properties
390
288
  *
391
- * @return {DebouncedFunction} debounced function
289
+ * @return {Omit<T, V>} target
392
290
  */
393
- function debounce(fn, timeout) {
394
-
395
- let timer;
396
-
397
- let lastArgs;
398
- let lastThis;
399
-
400
- let lastNow;
291
+ function omit(target, properties) {
401
292
 
402
- function fire(force) {
293
+ let result = {};
403
294
 
404
- let now = Date.now();
295
+ let obj = Object(target);
405
296
 
406
- let scheduledDiff = force ? 0 : (lastNow + timeout) - now;
297
+ forEach$5(obj, function(prop, key) {
407
298
 
408
- if (scheduledDiff > 0) {
409
- return schedule(scheduledDiff);
299
+ if (properties.indexOf(key) === -1) {
300
+ result[key] = prop;
410
301
  }
302
+ });
411
303
 
412
- fn.apply(lastThis, lastArgs);
413
-
414
- clear();
415
- }
416
-
417
- function schedule(timeout) {
418
- timer = setTimeout(fire, timeout);
419
- }
420
-
421
- function clear() {
422
- if (timer) {
423
- clearTimeout(timer);
424
- }
304
+ return result;
305
+ }
425
306
 
426
- timer = lastNow = lastArgs = lastThis = undefined;
427
- }
307
+ var DEFAULT_RENDER_PRIORITY$1 = 1000;
428
308
 
429
- function flush() {
430
- if (timer) {
431
- fire(true);
432
- }
309
+ /**
310
+ * @typedef {import('../core/Types').ElementLike} Element
311
+ * @typedef {import('../core/Types').ConnectionLike} Connection
312
+ * @typedef {import('../core/Types').ShapeLike} Shape
313
+ *
314
+ * @typedef {import('../core/EventBus').default} EventBus
315
+ */
433
316
 
434
- clear();
435
- }
317
+ /**
318
+ * The base implementation of shape and connection renderers.
319
+ *
320
+ * @param {EventBus} eventBus
321
+ * @param {number} [renderPriority=1000]
322
+ */
323
+ function BaseRenderer(eventBus, renderPriority) {
324
+ var self = this;
436
325
 
437
- /**
438
- * @type { DebouncedFunction }
439
- */
440
- function callback(...args) {
441
- lastNow = Date.now();
326
+ renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY$1;
442
327
 
443
- lastArgs = args;
444
- lastThis = this;
328
+ eventBus.on([ 'render.shape', 'render.connection' ], renderPriority, function(evt, context) {
329
+ var type = evt.type,
330
+ element = context.element,
331
+ visuals = context.gfx,
332
+ attrs = context.attrs;
445
333
 
446
- // ensure an execution is scheduled
447
- if (!timer) {
448
- schedule(timeout);
334
+ if (self.canRender(element)) {
335
+ if (type === 'render.shape') {
336
+ return self.drawShape(visuals, element, attrs);
337
+ } else {
338
+ return self.drawConnection(visuals, element, attrs);
339
+ }
449
340
  }
450
- }
451
-
452
- callback.flush = flush;
453
- callback.cancel = clear;
341
+ });
454
342
 
455
- return callback;
343
+ eventBus.on([ 'render.getShapePath', 'render.getConnectionPath' ], renderPriority, function(evt, element) {
344
+ if (self.canRender(element)) {
345
+ if (evt.type === 'render.getShapePath') {
346
+ return self.getShapePath(element);
347
+ } else {
348
+ return self.getConnectionPath(element);
349
+ }
350
+ }
351
+ });
456
352
  }
457
353
 
458
354
  /**
459
- * Bind function against target <this>.
355
+ * Checks whether an element can be rendered.
460
356
  *
461
- * @param {Function} fn
462
- * @param {Object} target
357
+ * @param {Element} element The element to be rendered.
463
358
  *
464
- * @return {Function} bound function
359
+ * @return {boolean} Whether the element can be rendered.
465
360
  */
466
- function bind$3(fn, target) {
467
- return fn.bind(target);
468
- }
361
+ BaseRenderer.prototype.canRender = function(element) {};
469
362
 
470
363
  /**
471
- * Convenience wrapper for `Object.assign`.
472
- *
473
- * @param {Object} target
474
- * @param {...Object} others
475
- *
476
- * @return {Object} the target
477
- */
478
- function assign$2(target, ...others) {
479
- return Object.assign(target, ...others);
480
- }
481
-
482
- /**
483
- * Sets a nested property of a given object to the specified value.
484
- *
485
- * This mutates the object and returns it.
486
- *
487
- * @template T
488
- *
489
- * @param {T} target The target of the set operation.
490
- * @param {(string|number)[]} path The path to the nested value.
491
- * @param {any} value The value to set.
492
- *
493
- * @return {T}
494
- */
495
- function set(target, path, value) {
496
-
497
- let currentTarget = target;
498
-
499
- forEach$2(path, function(key, idx) {
500
-
501
- if (typeof key !== 'number' && typeof key !== 'string') {
502
- throw new Error('illegal key type: ' + typeof key + '. Key should be of type number or string.');
503
- }
504
-
505
- if (key === 'constructor') {
506
- throw new Error('illegal key: constructor');
507
- }
508
-
509
- if (key === '__proto__') {
510
- throw new Error('illegal key: __proto__');
511
- }
512
-
513
- let nextKey = path[idx + 1];
514
- let nextTarget = currentTarget[key];
515
-
516
- if (isDefined(nextKey) && isNil(nextTarget)) {
517
- nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : [];
518
- }
519
-
520
- if (isUndefined$3(nextKey)) {
521
- if (isUndefined$3(value)) {
522
- delete currentTarget[key];
523
- } else {
524
- currentTarget[key] = value;
525
- }
526
- } else {
527
- currentTarget = nextTarget;
528
- }
529
- });
530
-
531
- return target;
532
- }
533
-
534
- /**
535
- * Pick properties from the given target.
536
- *
537
- * @template T
538
- * @template {any[]} V
539
- *
540
- * @param {T} target
541
- * @param {V} properties
542
- *
543
- * @return Pick<T, V>
544
- */
545
- function pick(target, properties) {
546
-
547
- let result = {};
548
-
549
- let obj = Object(target);
550
-
551
- forEach$2(properties, function(prop) {
552
-
553
- if (prop in obj) {
554
- result[prop] = target[prop];
555
- }
556
- });
557
-
558
- return result;
559
- }
560
-
561
- /**
562
- * Pick all target properties, excluding the given ones.
563
- *
564
- * @template T
565
- * @template {any[]} V
566
- *
567
- * @param {T} target
568
- * @param {V} properties
569
- *
570
- * @return {Omit<T, V>} target
571
- */
572
- function omit(target, properties) {
573
-
574
- let result = {};
575
-
576
- let obj = Object(target);
577
-
578
- forEach$2(obj, function(prop, key) {
579
-
580
- if (properties.indexOf(key) === -1) {
581
- result[key] = prop;
582
- }
583
- });
584
-
585
- return result;
586
- }
587
-
588
- var DEFAULT_RENDER_PRIORITY$1 = 1000;
589
-
590
- /**
591
- * @typedef {import('../core/Types').ElementLike} Element
592
- * @typedef {import('../core/Types').ConnectionLike} Connection
593
- * @typedef {import('../core/Types').ShapeLike} Shape
594
- *
595
- * @typedef {import('../core/EventBus').default} EventBus
596
- */
597
-
598
- /**
599
- * The base implementation of shape and connection renderers.
600
- *
601
- * @param {EventBus} eventBus
602
- * @param {number} [renderPriority=1000]
603
- */
604
- function BaseRenderer(eventBus, renderPriority) {
605
- var self = this;
606
-
607
- renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY$1;
608
-
609
- eventBus.on([ 'render.shape', 'render.connection' ], renderPriority, function(evt, context) {
610
- var type = evt.type,
611
- element = context.element,
612
- visuals = context.gfx,
613
- attrs = context.attrs;
614
-
615
- if (self.canRender(element)) {
616
- if (type === 'render.shape') {
617
- return self.drawShape(visuals, element, attrs);
618
- } else {
619
- return self.drawConnection(visuals, element, attrs);
620
- }
621
- }
622
- });
623
-
624
- eventBus.on([ 'render.getShapePath', 'render.getConnectionPath' ], renderPriority, function(evt, element) {
625
- if (self.canRender(element)) {
626
- if (evt.type === 'render.getShapePath') {
627
- return self.getShapePath(element);
628
- } else {
629
- return self.getConnectionPath(element);
630
- }
631
- }
632
- });
633
- }
634
-
635
- /**
636
- * Checks whether an element can be rendered.
637
- *
638
- * @param {Element} element The element to be rendered.
639
- *
640
- * @return {boolean} Whether the element can be rendered.
641
- */
642
- BaseRenderer.prototype.canRender = function(element) {};
643
-
644
- /**
645
- * Draws a shape.
364
+ * Draws a shape.
646
365
  *
647
366
  * @param {SVGElement} visuals The SVG element to draw the shape into.
648
367
  * @param {Shape} shape The shape to be drawn.
@@ -790,12 +509,422 @@
790
509
  }
791
510
 
792
511
  /**
793
- * @param {Element} element
512
+ * @param {Element} element
513
+ *
514
+ * @return {boolean}
515
+ */
516
+ function isEventSubProcess(element) {
517
+ return element && !!getBusinessObject(element).triggeredByEvent;
518
+ }
519
+
520
+ /**
521
+ * Flatten array, one level deep.
522
+ *
523
+ * @template T
524
+ *
525
+ * @param {T[][] | T[] | null} [arr]
526
+ *
527
+ * @return {T[]}
528
+ */
529
+
530
+ const nativeToString$5 = Object.prototype.toString;
531
+ const nativeHasOwnProperty$4 = Object.prototype.hasOwnProperty;
532
+
533
+ function isUndefined$5(obj) {
534
+ return obj === undefined;
535
+ }
536
+
537
+ function isDefined$1(obj) {
538
+ return obj !== undefined;
539
+ }
540
+
541
+ function isNil$2(obj) {
542
+ return obj == null;
543
+ }
544
+
545
+ function isArray$5(obj) {
546
+ return nativeToString$5.call(obj) === '[object Array]';
547
+ }
548
+
549
+ function isObject$1(obj) {
550
+ return nativeToString$5.call(obj) === '[object Object]';
551
+ }
552
+
553
+ function isNumber(obj) {
554
+ return nativeToString$5.call(obj) === '[object Number]';
555
+ }
556
+
557
+ /**
558
+ * @param {any} obj
559
+ *
560
+ * @return {boolean}
561
+ */
562
+ function isFunction$1(obj) {
563
+ const tag = nativeToString$5.call(obj);
564
+
565
+ return (
566
+ tag === '[object Function]' ||
567
+ tag === '[object AsyncFunction]' ||
568
+ tag === '[object GeneratorFunction]' ||
569
+ tag === '[object AsyncGeneratorFunction]' ||
570
+ tag === '[object Proxy]'
571
+ );
572
+ }
573
+
574
+ function isString$3(obj) {
575
+ return nativeToString$5.call(obj) === '[object String]';
576
+ }
577
+
578
+ /**
579
+ * Return true, if target owns a property with the given key.
580
+ *
581
+ * @param {Object} target
582
+ * @param {String} key
583
+ *
584
+ * @return {Boolean}
585
+ */
586
+ function has$4(target, key) {
587
+ return !isNil$2(target) && nativeHasOwnProperty$4.call(target, key);
588
+ }
589
+
590
+ /**
591
+ * @template T
592
+ * @typedef { (
593
+ * ((e: T) => boolean) |
594
+ * ((e: T, idx: number) => boolean) |
595
+ * ((e: T, key: string) => boolean) |
596
+ * string |
597
+ * number
598
+ * ) } Matcher
599
+ */
600
+
601
+ /**
602
+ * @template T
603
+ * @template U
604
+ *
605
+ * @typedef { (
606
+ * ((e: T) => U) | string | number
607
+ * ) } Extractor
608
+ */
609
+
610
+
611
+ /**
612
+ * @template T
613
+ * @typedef { (val: T, key: any) => boolean } MatchFn
614
+ */
615
+
616
+ /**
617
+ * @template T
618
+ * @typedef { T[] } ArrayCollection
619
+ */
620
+
621
+ /**
622
+ * @template T
623
+ * @typedef { { [key: string]: T } } StringKeyValueCollection
624
+ */
625
+
626
+ /**
627
+ * @template T
628
+ * @typedef { { [key: number]: T } } NumberKeyValueCollection
629
+ */
630
+
631
+ /**
632
+ * @template T
633
+ * @typedef { StringKeyValueCollection<T> | NumberKeyValueCollection<T> } KeyValueCollection
634
+ */
635
+
636
+ /**
637
+ * @template T
638
+ * @typedef { KeyValueCollection<T> | ArrayCollection<T> } Collection
639
+ */
640
+
641
+ /**
642
+ * Find element in collection.
643
+ *
644
+ * @template T
645
+ * @param {Collection<T>} collection
646
+ * @param {Matcher<T>} matcher
647
+ *
648
+ * @return {Object}
649
+ */
650
+ function find$1(collection, matcher) {
651
+
652
+ const matchFn = toMatcher$1(matcher);
653
+
654
+ let match;
655
+
656
+ forEach$4(collection, function(val, key) {
657
+ if (matchFn(val, key)) {
658
+ match = val;
659
+
660
+ return false;
661
+ }
662
+ });
663
+
664
+ return match;
665
+
666
+ }
667
+
668
+
669
+ /**
670
+ * Filter elements in collection.
671
+ *
672
+ * @template T
673
+ * @param {Collection<T>} collection
674
+ * @param {Matcher<T>} matcher
675
+ *
676
+ * @return {T[]} result
677
+ */
678
+ function filter$1(collection, matcher) {
679
+
680
+ const matchFn = toMatcher$1(matcher);
681
+
682
+ let result = [];
683
+
684
+ forEach$4(collection, function(val, key) {
685
+ if (matchFn(val, key)) {
686
+ result.push(val);
687
+ }
688
+ });
689
+
690
+ return result;
691
+ }
692
+
693
+
694
+ /**
695
+ * Iterate over collection; returning something
696
+ * (non-undefined) will stop iteration.
697
+ *
698
+ * @template T
699
+ * @param {Collection<T>} collection
700
+ * @param { ((item: T, idx: number) => (boolean|void)) | ((item: T, key: string) => (boolean|void)) } iterator
701
+ *
702
+ * @return {T} return result that stopped the iteration
703
+ */
704
+ function forEach$4(collection, iterator) {
705
+
706
+ let val,
707
+ result;
708
+
709
+ if (isUndefined$5(collection)) {
710
+ return;
711
+ }
712
+
713
+ const convertKey = isArray$5(collection) ? toNum$4 : identity$4;
714
+
715
+ for (let key in collection) {
716
+
717
+ if (has$4(collection, key)) {
718
+ val = collection[key];
719
+
720
+ result = iterator(val, convertKey(key));
721
+
722
+ if (result === false) {
723
+ return val;
724
+ }
725
+ }
726
+ }
727
+ }
728
+
729
+
730
+ /**
731
+ * Reduce collection, returning a single result.
732
+ *
733
+ * @template T
734
+ * @template V
735
+ *
736
+ * @param {Collection<T>} collection
737
+ * @param {(result: V, entry: T, index: any) => V} iterator
738
+ * @param {V} result
739
+ *
740
+ * @return {V} result returned from last iterator
741
+ */
742
+ function reduce(collection, iterator, result) {
743
+
744
+ forEach$4(collection, function(value, idx) {
745
+ result = iterator(result, value, idx);
746
+ });
747
+
748
+ return result;
749
+ }
750
+
751
+
752
+ /**
753
+ * Return true if every element in the collection
754
+ * matches the criteria.
755
+ *
756
+ * @param {Object|Array} collection
757
+ * @param {Function} matcher
758
+ *
759
+ * @return {Boolean}
760
+ */
761
+ function every(collection, matcher) {
762
+
763
+ return !!reduce(collection, function(matches, val, key) {
764
+ return matches && matcher(val, key);
765
+ }, true);
766
+ }
767
+
768
+
769
+ /**
770
+ * Create an object pattern matcher.
771
+ *
772
+ * @example
773
+ *
774
+ * ```javascript
775
+ * const matcher = matchPattern({ id: 1 });
776
+ *
777
+ * let element = find(elements, matcher);
778
+ * ```
779
+ *
780
+ * @template T
781
+ *
782
+ * @param {T} pattern
783
+ *
784
+ * @return { (el: any) => boolean } matcherFn
785
+ */
786
+ function matchPattern(pattern) {
787
+
788
+ return function(el) {
789
+
790
+ return every(pattern, function(val, key) {
791
+ return el[key] === val;
792
+ });
793
+
794
+ };
795
+ }
796
+
797
+
798
+ /**
799
+ * @template T
800
+ * @param {Matcher<T>} matcher
801
+ *
802
+ * @return {MatchFn<T>}
803
+ */
804
+ function toMatcher$1(matcher) {
805
+ return isFunction$1(matcher) ? matcher : (e) => {
806
+ return e === matcher;
807
+ };
808
+ }
809
+
810
+
811
+ function identity$4(arg) {
812
+ return arg;
813
+ }
814
+
815
+ function toNum$4(arg) {
816
+ return Number(arg);
817
+ }
818
+
819
+ /* global setTimeout clearTimeout */
820
+
821
+ /**
822
+ * @typedef { {
823
+ * (...args: any[]): any;
824
+ * flush: () => void;
825
+ * cancel: () => void;
826
+ * } } DebouncedFunction
827
+ */
828
+
829
+ /**
830
+ * Debounce fn, calling it only once if the given time
831
+ * elapsed between calls.
832
+ *
833
+ * Lodash-style the function exposes methods to `#clear`
834
+ * and `#flush` to control internal behavior.
835
+ *
836
+ * @param {Function} fn
837
+ * @param {Number} timeout
838
+ *
839
+ * @return {DebouncedFunction} debounced function
840
+ */
841
+ function debounce(fn, timeout) {
842
+
843
+ let timer;
844
+
845
+ let lastArgs;
846
+ let lastThis;
847
+
848
+ let lastNow;
849
+
850
+ function fire(force) {
851
+
852
+ let now = Date.now();
853
+
854
+ let scheduledDiff = force ? 0 : (lastNow + timeout) - now;
855
+
856
+ if (scheduledDiff > 0) {
857
+ return schedule(scheduledDiff);
858
+ }
859
+
860
+ fn.apply(lastThis, lastArgs);
861
+
862
+ clear();
863
+ }
864
+
865
+ function schedule(timeout) {
866
+ timer = setTimeout(fire, timeout);
867
+ }
868
+
869
+ function clear() {
870
+ if (timer) {
871
+ clearTimeout(timer);
872
+ }
873
+
874
+ timer = lastNow = lastArgs = lastThis = undefined;
875
+ }
876
+
877
+ function flush() {
878
+ if (timer) {
879
+ fire(true);
880
+ }
881
+
882
+ clear();
883
+ }
884
+
885
+ /**
886
+ * @type { DebouncedFunction }
887
+ */
888
+ function callback(...args) {
889
+ lastNow = Date.now();
890
+
891
+ lastArgs = args;
892
+ lastThis = this;
893
+
894
+ // ensure an execution is scheduled
895
+ if (!timer) {
896
+ schedule(timeout);
897
+ }
898
+ }
899
+
900
+ callback.flush = flush;
901
+ callback.cancel = clear;
902
+
903
+ return callback;
904
+ }
905
+
906
+ /**
907
+ * Bind function against target <this>.
908
+ *
909
+ * @param {Function} fn
910
+ * @param {Object} target
911
+ *
912
+ * @return {Function} bound function
913
+ */
914
+ function bind$4(fn, target) {
915
+ return fn.bind(target);
916
+ }
917
+
918
+ /**
919
+ * Convenience wrapper for `Object.assign`.
794
920
  *
795
- * @return {boolean}
921
+ * @param {Object} target
922
+ * @param {...Object} others
923
+ *
924
+ * @return {Object} the target
796
925
  */
797
- function isEventSubProcess(element) {
798
- return element && !!getBusinessObject(element).triggeredByEvent;
926
+ function assign$5(target, ...others) {
927
+ return Object.assign(target, ...others);
799
928
  }
800
929
 
801
930
  /**
@@ -806,7 +935,7 @@
806
935
  * @return {boolean}
807
936
  */
808
937
  function isConnection(value) {
809
- return isObject(value) && has$2(value, 'waypoints');
938
+ return isObject$1(value) && has$4(value, 'waypoints');
810
939
  }
811
940
 
812
941
  /**
@@ -817,7 +946,7 @@
817
946
  * @return {boolean}
818
947
  */
819
948
  function isLabel(value) {
820
- return isObject(value) && has$2(value, 'labelTarget');
949
+ return isObject$1(value) && has$4(value, 'labelTarget');
821
950
  }
822
951
 
823
952
  /**
@@ -969,7 +1098,7 @@
969
1098
  size = DEFAULT_LABEL_SIZE$1;
970
1099
  }
971
1100
 
972
- return assign$2({
1101
+ return assign$6({
973
1102
  x: mid.x - size.width / 2,
974
1103
  y: mid.y - size.height / 2
975
1104
  }, size);
@@ -1504,7 +1633,7 @@
1504
1633
  */
1505
1634
 
1506
1635
  var TEXT_ENTITIES = /([&<>]{1})/g;
1507
- var ATTR_ENTITIES = /([\n\r"]{1})/g;
1636
+ var ATTR_ENTITIES = /([&<>\n\r"]{1})/g;
1508
1637
 
1509
1638
  var ENTITY_REPLACEMENT = {
1510
1639
  '&': '&amp;',
@@ -2017,7 +2146,7 @@
2017
2146
  * @returns {number}
2018
2147
  */
2019
2148
  function getWidth(bounds, overrides = {}) {
2020
- return has$2(overrides, 'width') ? overrides.width : bounds.width;
2149
+ return has$5(overrides, 'width') ? overrides.width : bounds.width;
2021
2150
  }
2022
2151
 
2023
2152
  /**
@@ -2029,7 +2158,7 @@
2029
2158
  * @returns {number}
2030
2159
  */
2031
2160
  function getHeight(bounds, overrides = {}) {
2032
- return has$2(overrides, 'height') ? overrides.height : bounds.height;
2161
+ return has$5(overrides, 'height') ? overrides.height : bounds.height;
2033
2162
  }
2034
2163
 
2035
2164
  function _mergeNamespaces$2(n, m) {
@@ -2057,15 +2186,15 @@
2057
2186
  * @return {T[]}
2058
2187
  */
2059
2188
 
2060
- const nativeToString$1 = Object.prototype.toString;
2061
- const nativeHasOwnProperty$1 = Object.prototype.hasOwnProperty;
2189
+ const nativeToString$4 = Object.prototype.toString;
2190
+ const nativeHasOwnProperty$3 = Object.prototype.hasOwnProperty;
2062
2191
 
2063
- function isUndefined$2(obj) {
2192
+ function isUndefined$4(obj) {
2064
2193
  return obj === undefined;
2065
2194
  }
2066
2195
 
2067
- function isArray$2(obj) {
2068
- return nativeToString$1.call(obj) === '[object Array]';
2196
+ function isArray$4(obj) {
2197
+ return nativeToString$4.call(obj) === '[object Array]';
2069
2198
  }
2070
2199
 
2071
2200
  /**
@@ -2076,8 +2205,8 @@
2076
2205
  *
2077
2206
  * @return {Boolean}
2078
2207
  */
2079
- function has$1(target, key) {
2080
- return nativeHasOwnProperty$1.call(target, key);
2208
+ function has$3(target, key) {
2209
+ return nativeHasOwnProperty$3.call(target, key);
2081
2210
  }
2082
2211
 
2083
2212
 
@@ -2091,20 +2220,20 @@
2091
2220
  *
2092
2221
  * @return {T} return result that stopped the iteration
2093
2222
  */
2094
- function forEach$1(collection, iterator) {
2223
+ function forEach$3(collection, iterator) {
2095
2224
 
2096
2225
  let val,
2097
2226
  result;
2098
2227
 
2099
- if (isUndefined$2(collection)) {
2228
+ if (isUndefined$4(collection)) {
2100
2229
  return;
2101
2230
  }
2102
2231
 
2103
- const convertKey = isArray$2(collection) ? toNum$1 : identity$1;
2232
+ const convertKey = isArray$4(collection) ? toNum$3 : identity$3;
2104
2233
 
2105
2234
  for (let key in collection) {
2106
2235
 
2107
- if (has$1(collection, key)) {
2236
+ if (has$3(collection, key)) {
2108
2237
  val = collection[key];
2109
2238
 
2110
2239
  result = iterator(val, convertKey(key));
@@ -2117,11 +2246,11 @@
2117
2246
  }
2118
2247
 
2119
2248
 
2120
- function identity$1(arg) {
2249
+ function identity$3(arg) {
2121
2250
  return arg;
2122
2251
  }
2123
2252
 
2124
- function toNum$1(arg) {
2253
+ function toNum$3(arg) {
2125
2254
  return Number(arg);
2126
2255
  }
2127
2256
 
@@ -2133,15 +2262,15 @@
2133
2262
  *
2134
2263
  * @return {Element} the element
2135
2264
  */
2136
- function assign$1(element, ...styleSources) {
2265
+ function assign$4(element, ...styleSources) {
2137
2266
  const target = element.style;
2138
2267
 
2139
- forEach$1(styleSources, function(style) {
2268
+ forEach$3(styleSources, function(style) {
2140
2269
  if (!style) {
2141
2270
  return;
2142
2271
  }
2143
2272
 
2144
- forEach$1(style, function(value, key) {
2273
+ forEach$3(style, function(value, key) {
2145
2274
  target[key] = value;
2146
2275
  });
2147
2276
  });
@@ -2371,7 +2500,7 @@
2371
2500
  // when delegating.
2372
2501
  var forceCaptureEvents$1 = [ 'focus', 'blur' ];
2373
2502
 
2374
- function bind$2(el, selector, type, fn, capture) {
2503
+ function bind$3(el, selector, type, fn, capture) {
2375
2504
  if (forceCaptureEvents$1.indexOf(type) !== -1) {
2376
2505
  capture = true;
2377
2506
  }
@@ -2403,7 +2532,7 @@
2403
2532
  }
2404
2533
 
2405
2534
  var delegate$1 = {
2406
- bind: bind$2,
2535
+ bind: bind$3,
2407
2536
  unbind: unbind$2
2408
2537
  };
2409
2538
 
@@ -2990,7 +3119,7 @@
2990
3119
 
2991
3120
  function drawCircle(parentGfx, width, height, offset, attrs = {}) {
2992
3121
 
2993
- if (isObject(offset)) {
3122
+ if (isObject$2(offset)) {
2994
3123
  attrs = offset;
2995
3124
  offset = 0;
2996
3125
  }
@@ -3016,7 +3145,7 @@
3016
3145
 
3017
3146
  function drawRect(parentGfx, width, height, r, offset, attrs) {
3018
3147
 
3019
- if (isObject(offset)) {
3148
+ if (isObject$2(offset)) {
3020
3149
  attrs = offset;
3021
3150
  offset = 0;
3022
3151
  }
@@ -3111,7 +3240,7 @@
3111
3240
  }
3112
3241
 
3113
3242
  function drawMarker(type, parentGfx, path, attrs) {
3114
- return drawPath(parentGfx, path, assign$2({ 'data-marker': type }, attrs));
3243
+ return drawPath(parentGfx, path, assign$6({ 'data-marker': type }, attrs));
3115
3244
  }
3116
3245
 
3117
3246
  function renderer(type) {
@@ -3658,7 +3787,7 @@
3658
3787
  taskMarkers.push('AdhocMarker');
3659
3788
 
3660
3789
  if (!subprocess) {
3661
- assign$2(attrs, { compensation: attrs.compensation - 18 });
3790
+ assign$6(attrs, { compensation: attrs.compensation - 18 });
3662
3791
  }
3663
3792
  }
3664
3793
 
@@ -3667,12 +3796,12 @@
3667
3796
 
3668
3797
  if (loopCharacteristics) {
3669
3798
 
3670
- assign$2(attrs, {
3799
+ assign$6(attrs, {
3671
3800
  compensation: attrs.compensation - 18,
3672
3801
  });
3673
3802
 
3674
3803
  if (taskMarkers.includes('AdhocMarker')) {
3675
- assign$2(attrs, {
3804
+ assign$6(attrs, {
3676
3805
  seq: -23,
3677
3806
  loop: -18,
3678
3807
  parallel: -24
@@ -3693,18 +3822,18 @@
3693
3822
  }
3694
3823
 
3695
3824
  if (taskMarkers.includes('CompensationMarker') && taskMarkers.length === 1) {
3696
- assign$2(attrs, {
3825
+ assign$6(attrs, {
3697
3826
  compensation: -8
3698
3827
  });
3699
3828
  }
3700
3829
 
3701
- forEach$2(taskMarkers, function(marker) {
3830
+ forEach$5(taskMarkers, function(marker) {
3702
3831
  renderTaskMarker(marker, parentGfx, element, attrs);
3703
3832
  });
3704
3833
  }
3705
3834
 
3706
3835
  function renderLabel(parentGfx, label, attrs = {}) {
3707
- attrs = assign$2({
3836
+ attrs = assign$6({
3708
3837
  size: {
3709
3838
  width: 100
3710
3839
  }
@@ -3750,7 +3879,7 @@
3750
3879
  return renderLabel(parentGfx, getLabel(element), {
3751
3880
  box: box,
3752
3881
  fitBox: true,
3753
- style: assign$2(
3882
+ style: assign$6(
3754
3883
  {},
3755
3884
  textRenderer.getExternalStyle(),
3756
3885
  {
@@ -5109,15 +5238,15 @@
5109
5238
  * @return {T[]}
5110
5239
  */
5111
5240
 
5112
- const nativeToString = Object.prototype.toString;
5113
- const nativeHasOwnProperty = Object.prototype.hasOwnProperty;
5241
+ const nativeToString$3 = Object.prototype.toString;
5242
+ const nativeHasOwnProperty$2 = Object.prototype.hasOwnProperty;
5114
5243
 
5115
- function isUndefined$1(obj) {
5244
+ function isUndefined$3(obj) {
5116
5245
  return obj === undefined;
5117
5246
  }
5118
5247
 
5119
- function isArray$1(obj) {
5120
- return nativeToString.call(obj) === '[object Array]';
5248
+ function isArray$3(obj) {
5249
+ return nativeToString$3.call(obj) === '[object Array]';
5121
5250
  }
5122
5251
 
5123
5252
  /**
@@ -5128,8 +5257,8 @@
5128
5257
  *
5129
5258
  * @return {Boolean}
5130
5259
  */
5131
- function has(target, key) {
5132
- return nativeHasOwnProperty.call(target, key);
5260
+ function has$2(target, key) {
5261
+ return nativeHasOwnProperty$2.call(target, key);
5133
5262
  }
5134
5263
 
5135
5264
 
@@ -5143,20 +5272,20 @@
5143
5272
  *
5144
5273
  * @return {T} return result that stopped the iteration
5145
5274
  */
5146
- function forEach(collection, iterator) {
5275
+ function forEach$2(collection, iterator) {
5147
5276
 
5148
5277
  let val,
5149
5278
  result;
5150
5279
 
5151
- if (isUndefined$1(collection)) {
5280
+ if (isUndefined$3(collection)) {
5152
5281
  return;
5153
5282
  }
5154
5283
 
5155
- const convertKey = isArray$1(collection) ? toNum : identity;
5284
+ const convertKey = isArray$3(collection) ? toNum$2 : identity$2;
5156
5285
 
5157
5286
  for (let key in collection) {
5158
5287
 
5159
- if (has(collection, key)) {
5288
+ if (has$2(collection, key)) {
5160
5289
  val = collection[key];
5161
5290
 
5162
5291
  result = iterator(val, convertKey(key));
@@ -5169,11 +5298,11 @@
5169
5298
  }
5170
5299
 
5171
5300
 
5172
- function identity(arg) {
5301
+ function identity$2(arg) {
5173
5302
  return arg;
5174
5303
  }
5175
5304
 
5176
- function toNum(arg) {
5305
+ function toNum$2(arg) {
5177
5306
  return Number(arg);
5178
5307
  }
5179
5308
 
@@ -5185,15 +5314,15 @@
5185
5314
  *
5186
5315
  * @return {Element} the element
5187
5316
  */
5188
- function assign(element, ...styleSources) {
5317
+ function assign$3(element, ...styleSources) {
5189
5318
  const target = element.style;
5190
5319
 
5191
- forEach(styleSources, function(style) {
5320
+ forEach$2(styleSources, function(style) {
5192
5321
  if (!style) {
5193
5322
  return;
5194
5323
  }
5195
5324
 
5196
- forEach(style, function(value, key) {
5325
+ forEach$2(style, function(value, key) {
5197
5326
  target[key] = value;
5198
5327
  });
5199
5328
  });
@@ -5470,7 +5599,7 @@
5470
5599
  // when delegating.
5471
5600
  var forceCaptureEvents = [ 'focus', 'blur' ];
5472
5601
 
5473
- function bind(el, selector, type, fn, capture) {
5602
+ function bind$2(el, selector, type, fn, capture) {
5474
5603
  if (forceCaptureEvents.indexOf(type) !== -1) {
5475
5604
  capture = true;
5476
5605
  }
@@ -5502,7 +5631,7 @@
5502
5631
  }
5503
5632
 
5504
5633
  var delegate = {
5505
- bind,
5634
+ bind: bind$2,
5506
5635
  unbind
5507
5636
  };
5508
5637
 
@@ -5704,8 +5833,8 @@
5704
5833
  */
5705
5834
  function parsePadding(padding) {
5706
5835
 
5707
- if (isObject(padding)) {
5708
- return assign$2({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
5836
+ if (isObject$1(padding)) {
5837
+ return assign$5({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
5709
5838
  } else {
5710
5839
  return {
5711
5840
  top: padding,
@@ -5899,7 +6028,7 @@
5899
6028
  id: 'helper-svg'
5900
6029
  });
5901
6030
 
5902
- assign(helperSvg, {
6031
+ assign$3(helperSvg, {
5903
6032
  visibility: 'hidden',
5904
6033
  position: 'fixed',
5905
6034
  width: 0,
@@ -5920,7 +6049,7 @@
5920
6049
  */
5921
6050
  function Text(config) {
5922
6051
 
5923
- this._config = assign$2({}, {
6052
+ this._config = assign$5({}, {
5924
6053
  size: DEFAULT_LABEL_SIZE,
5925
6054
  padding: DEFAULT_BOX_PADDING,
5926
6055
  style: {},
@@ -5964,8 +6093,8 @@
5964
6093
  * } }
5965
6094
  */
5966
6095
  Text.prototype.layoutText = function(text, options) {
5967
- var box = assign$2({}, this._config.size, options.box),
5968
- style = assign$2({}, this._config.style, options.style),
6096
+ var box = assign$5({}, this._config.size, options.box),
6097
+ style = assign$5({}, this._config.style, options.style),
5969
6098
  align = parseAlign(options.align || this._config.align),
5970
6099
  padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding),
5971
6100
  fitBox = options.fitBox || false;
@@ -6021,7 +6150,7 @@
6021
6150
 
6022
6151
  // layout each line taking into account that parent
6023
6152
  // shape might resize to fit text size
6024
- forEach$2(layouted, function(line) {
6153
+ forEach$4(layouted, function(line) {
6025
6154
 
6026
6155
  var x;
6027
6156
 
@@ -6103,7 +6232,7 @@
6103
6232
  */
6104
6233
  function TextRenderer(config) {
6105
6234
 
6106
- var defaultStyle = assign$2({
6235
+ var defaultStyle = assign$6({
6107
6236
  fontFamily: 'Arial, sans-serif',
6108
6237
  fontSize: DEFAULT_FONT_SIZE,
6109
6238
  fontWeight: 'normal',
@@ -6112,7 +6241,7 @@
6112
6241
 
6113
6242
  var fontSize = parseInt(defaultStyle.fontSize, 10) - 1;
6114
6243
 
6115
- var externalStyle = assign$2({}, defaultStyle, {
6244
+ var externalStyle = assign$6({}, defaultStyle, {
6116
6245
  fontSize: fontSize
6117
6246
  }, config && config.externalStyle || {});
6118
6247
 
@@ -6909,7 +7038,7 @@
6909
7038
  * @return {Object}
6910
7039
  */
6911
7040
  function elementData(semantic, di, attrs) {
6912
- return assign$2({
7041
+ return assign$6({
6913
7042
  id: semantic.id,
6914
7043
  type: semantic.$type,
6915
7044
  businessObject: semantic,
@@ -7251,7 +7380,7 @@
7251
7380
  function getBBox(elements, stopRecursion) {
7252
7381
 
7253
7382
  stopRecursion = !!stopRecursion;
7254
- if (!isArray$3(elements)) {
7383
+ if (!isArray$5(elements)) {
7255
7384
  elements = [ elements ];
7256
7385
  }
7257
7386
 
@@ -7260,7 +7389,7 @@
7260
7389
  maxX,
7261
7390
  maxY;
7262
7391
 
7263
- forEach$2(elements, function(element) {
7392
+ forEach$4(elements, function(element) {
7264
7393
 
7265
7394
  // If element is a connection the bbox must be computed first
7266
7395
  var bbox = element;
@@ -7488,7 +7617,7 @@
7488
7617
  /**
7489
7618
  * @type {OverlaysConfigDefault}
7490
7619
  */
7491
- this._overlayDefaults = assign$2({
7620
+ this._overlayDefaults = assign$5({
7492
7621
 
7493
7622
  // no show constraints
7494
7623
  show: null,
@@ -7550,11 +7679,11 @@
7550
7679
  */
7551
7680
  Overlays.prototype.get = function(search) {
7552
7681
 
7553
- if (isString(search)) {
7682
+ if (isString$3(search)) {
7554
7683
  search = { id: search };
7555
7684
  }
7556
7685
 
7557
- if (isString(search.element)) {
7686
+ if (isString$3(search.element)) {
7558
7687
  search.element = this._elementRegistry.get(search.element);
7559
7688
  }
7560
7689
 
@@ -7563,12 +7692,12 @@
7563
7692
 
7564
7693
  // return a list of overlays when searching by element (+type)
7565
7694
  if (container) {
7566
- return search.type ? filter(container.overlays, matchPattern({ type: search.type })) : container.overlays.slice();
7695
+ return search.type ? filter$1(container.overlays, matchPattern({ type: search.type })) : container.overlays.slice();
7567
7696
  } else {
7568
7697
  return [];
7569
7698
  }
7570
7699
  } else if (search.type) {
7571
- return filter(this._overlays, matchPattern({ type: search.type }));
7700
+ return filter$1(this._overlays, matchPattern({ type: search.type }));
7572
7701
  } else {
7573
7702
 
7574
7703
  // return single element when searching by id
@@ -7587,7 +7716,7 @@
7587
7716
  */
7588
7717
  Overlays.prototype.add = function(element, type, overlay) {
7589
7718
 
7590
- if (isObject(type)) {
7719
+ if (isObject$1(type)) {
7591
7720
  overlay = type;
7592
7721
  type = null;
7593
7722
  }
@@ -7610,7 +7739,7 @@
7610
7739
 
7611
7740
  var id = this._ids.next();
7612
7741
 
7613
- overlay = assign$2({}, this._overlayDefaults, overlay, {
7742
+ overlay = assign$5({}, this._overlayDefaults, overlay, {
7614
7743
  id: id,
7615
7744
  type: type,
7616
7745
  element: element,
@@ -7634,13 +7763,13 @@
7634
7763
 
7635
7764
  var overlays = this.get(filter) || [];
7636
7765
 
7637
- if (!isArray$3(overlays)) {
7766
+ if (!isArray$5(overlays)) {
7638
7767
  overlays = [ overlays ];
7639
7768
  }
7640
7769
 
7641
7770
  var self = this;
7642
7771
 
7643
- forEach$2(overlays, function(overlay) {
7772
+ forEach$4(overlays, function(overlay) {
7644
7773
 
7645
7774
  var container = self._getOverlayContainer(overlay.element, true);
7646
7775
 
@@ -7766,7 +7895,7 @@
7766
7895
 
7767
7896
  Overlays.prototype._createOverlayContainer = function(element) {
7768
7897
  var html = domify$1('<div class="djs-overlays" />');
7769
- assign(html, { position: 'absolute' });
7898
+ assign$3(html, { position: 'absolute' });
7770
7899
 
7771
7900
  this._overlayRoot.appendChild(html);
7772
7901
 
@@ -7803,7 +7932,7 @@
7803
7932
 
7804
7933
 
7805
7934
  Overlays.prototype._getOverlayContainer = function(element, raw) {
7806
- var container = find(this._overlayContainers, function(c) {
7935
+ var container = find$1(this._overlayContainers, function(c) {
7807
7936
  return c.element === element;
7808
7937
  });
7809
7938
 
@@ -7831,14 +7960,14 @@
7831
7960
 
7832
7961
  // create proper html elements from
7833
7962
  // overlay HTML strings
7834
- if (isString(html)) {
7963
+ if (isString$3(html)) {
7835
7964
  html = domify$1(html);
7836
7965
  }
7837
7966
 
7838
7967
  overlayContainer = this._getOverlayContainer(element);
7839
7968
 
7840
7969
  htmlContainer = domify$1('<div class="djs-overlay" data-overlay-id="' + id + '">');
7841
- assign(htmlContainer, { position: 'absolute' });
7970
+ assign$3(htmlContainer, { position: 'absolute' });
7842
7971
 
7843
7972
  htmlContainer.appendChild(html);
7844
7973
 
@@ -7876,8 +8005,8 @@
7876
8005
  visible = false;
7877
8006
  } else if (show) {
7878
8007
  if (
7879
- (isDefined(minZoom) && minZoom > viewbox.scale) ||
7880
- (isDefined(maxZoom) && maxZoom < viewbox.scale)
8008
+ (isDefined$1(minZoom) && minZoom > viewbox.scale) ||
8009
+ (isDefined$1(maxZoom) && maxZoom < viewbox.scale)
7881
8010
  ) {
7882
8011
  visible = false;
7883
8012
  }
@@ -7907,16 +8036,16 @@
7907
8036
  maxScale = shouldScale.max;
7908
8037
  }
7909
8038
 
7910
- if (isDefined(minScale) && viewbox.scale < minScale) {
8039
+ if (isDefined$1(minScale) && viewbox.scale < minScale) {
7911
8040
  scale = (1 / viewbox.scale || 1) * minScale;
7912
8041
  }
7913
8042
 
7914
- if (isDefined(maxScale) && viewbox.scale > maxScale) {
8043
+ if (isDefined$1(maxScale) && viewbox.scale > maxScale) {
7915
8044
  scale = (1 / viewbox.scale || 1) * maxScale;
7916
8045
  }
7917
8046
  }
7918
8047
 
7919
- if (isDefined(scale)) {
8048
+ if (isDefined$1(scale)) {
7920
8049
  transform = 'scale(' + scale + ',' + scale + ')';
7921
8050
  }
7922
8051
 
@@ -7928,7 +8057,7 @@
7928
8057
 
7929
8058
  var self = this;
7930
8059
 
7931
- forEach$2(this._overlays, function(overlay) {
8060
+ forEach$4(this._overlays, function(overlay) {
7932
8061
  self._updateOverlayVisibilty(overlay, viewbox);
7933
8062
  });
7934
8063
  };
@@ -7965,7 +8094,7 @@
7965
8094
  var element = e.element;
7966
8095
  var overlays = self.get({ element: element });
7967
8096
 
7968
- forEach$2(overlays, function(o) {
8097
+ forEach$4(overlays, function(o) {
7969
8098
  self.remove(o.id);
7970
8099
  });
7971
8100
 
@@ -7989,7 +8118,7 @@
7989
8118
  var container = self._getOverlayContainer(element, true);
7990
8119
 
7991
8120
  if (container) {
7992
- forEach$2(container.overlays, function(overlay) {
8121
+ forEach$4(container.overlays, function(overlay) {
7993
8122
  self._updateOverlay(overlay);
7994
8123
  });
7995
8124
 
@@ -8026,7 +8155,7 @@
8026
8155
  '<div class="djs-overlay-container" />'
8027
8156
  );
8028
8157
 
8029
- assign(root, {
8158
+ assign$3(root, {
8030
8159
  position: 'absolute',
8031
8160
  width: 0,
8032
8161
  height: 0
@@ -8038,7 +8167,7 @@
8038
8167
  }
8039
8168
 
8040
8169
  function setPosition(el, x, y) {
8041
- assign(el, { left: x + 'px', top: y + 'px' });
8170
+ assign$3(el, { left: x + 'px', top: y + 'px' });
8042
8171
  }
8043
8172
 
8044
8173
  /**
@@ -8212,7 +8341,7 @@
8212
8341
  */
8213
8342
  CommandInterceptor.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
8214
8343
 
8215
- if (isFunction(hook) || isNumber(hook)) {
8344
+ if (isFunction$1(hook) || isNumber(hook)) {
8216
8345
  that = unwrap;
8217
8346
  unwrap = handlerFn;
8218
8347
  handlerFn = priority;
@@ -8220,29 +8349,29 @@
8220
8349
  hook = null;
8221
8350
  }
8222
8351
 
8223
- if (isFunction(priority)) {
8352
+ if (isFunction$1(priority)) {
8224
8353
  that = unwrap;
8225
8354
  unwrap = handlerFn;
8226
8355
  handlerFn = priority;
8227
8356
  priority = DEFAULT_PRIORITY$1;
8228
8357
  }
8229
8358
 
8230
- if (isObject(unwrap)) {
8359
+ if (isObject$1(unwrap)) {
8231
8360
  that = unwrap;
8232
8361
  unwrap = false;
8233
8362
  }
8234
8363
 
8235
- if (!isFunction(handlerFn)) {
8364
+ if (!isFunction$1(handlerFn)) {
8236
8365
  throw new Error('handlerFn must be a function');
8237
8366
  }
8238
8367
 
8239
- if (!isArray$3(events)) {
8368
+ if (!isArray$5(events)) {
8240
8369
  events = [ events ];
8241
8370
  }
8242
8371
 
8243
8372
  var eventBus = this._eventBus;
8244
8373
 
8245
- forEach$2(events, function(event) {
8374
+ forEach$4(events, function(event) {
8246
8375
 
8247
8376
  // concat commandStack(.event)?(.hook)?
8248
8377
  var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
@@ -8376,7 +8505,7 @@
8376
8505
  */
8377
8506
  const hookFn = function(events, priority, handlerFn, unwrap, that) {
8378
8507
 
8379
- if (isFunction(events) || isNumber(events)) {
8508
+ if (isFunction$1(events) || isNumber(events)) {
8380
8509
  that = unwrap;
8381
8510
  unwrap = handlerFn;
8382
8511
  handlerFn = priority;
@@ -8525,7 +8654,7 @@
8525
8654
  var shape = event.element,
8526
8655
  businessObject = getBusinessObject(shape);
8527
8656
 
8528
- var isPresent = find(businessObjectParents, function(element) {
8657
+ var isPresent = find$2(businessObjectParents, function(element) {
8529
8658
  return element === businessObject;
8530
8659
  });
8531
8660
 
@@ -9466,13 +9595,13 @@
9466
9595
  }
9467
9596
 
9468
9597
  function registerEvents(svg) {
9469
- forEach$2(bindings, function(val, key) {
9598
+ forEach$4(bindings, function(val, key) {
9470
9599
  registerEvent(svg, key, val);
9471
9600
  });
9472
9601
  }
9473
9602
 
9474
9603
  function unregisterEvents(svg) {
9475
- forEach$2(bindings, function(val, key) {
9604
+ forEach$4(bindings, function(val, key) {
9476
9605
  unregisterEvent(svg, key, val);
9477
9606
  });
9478
9607
  }
@@ -9543,7 +9672,7 @@
9543
9672
 
9544
9673
  function createHitStyle(classNames, attrs) {
9545
9674
 
9546
- attrs = assign$2({
9675
+ attrs = assign$5({
9547
9676
  stroke: 'white',
9548
9677
  strokeWidth: 15
9549
9678
  }, attrs || {});
@@ -9582,7 +9711,7 @@
9582
9711
  this.removeHits = function(gfx) {
9583
9712
  var hits = all('.djs-hit', gfx);
9584
9713
 
9585
- forEach$2(hits, remove$3);
9714
+ forEach$4(hits, remove$3);
9586
9715
  };
9587
9716
 
9588
9717
  /**
@@ -9641,7 +9770,7 @@
9641
9770
  */
9642
9771
  this.createBoxHit = function(gfx, type, attrs) {
9643
9772
 
9644
- attrs = assign$2({
9773
+ attrs = assign$5({
9645
9774
  x: 0,
9646
9775
  y: 0
9647
9776
  }, attrs);
@@ -9876,7 +10005,7 @@
9876
10005
  var selectedElements = this._selectedElements,
9877
10006
  oldSelection = selectedElements.slice();
9878
10007
 
9879
- if (!isArray$3(elements)) {
10008
+ if (!isArray$5(elements)) {
9880
10009
  elements = elements ? [ elements ] : [];
9881
10010
  }
9882
10011
 
@@ -9893,7 +10022,7 @@
9893
10022
  // selection may be cleared by passing an empty array or null
9894
10023
  // to the method
9895
10024
  if (add) {
9896
- forEach$2(elements, function(element) {
10025
+ forEach$4(elements, function(element) {
9897
10026
  if (selectedElements.indexOf(element) !== -1) {
9898
10027
 
9899
10028
  // already selected
@@ -9960,13 +10089,13 @@
9960
10089
  var oldSelection = event.oldSelection,
9961
10090
  newSelection = event.newSelection;
9962
10091
 
9963
- forEach$2(oldSelection, function(e) {
10092
+ forEach$4(oldSelection, function(e) {
9964
10093
  if (newSelection.indexOf(e) === -1) {
9965
10094
  deselect(e);
9966
10095
  }
9967
10096
  });
9968
10097
 
9969
- forEach$2(newSelection, function(e) {
10098
+ forEach$4(newSelection, function(e) {
9970
10099
  if (oldSelection.indexOf(e) === -1) {
9971
10100
  select(e);
9972
10101
  }
@@ -10009,7 +10138,7 @@
10009
10138
  return;
10010
10139
  }
10011
10140
 
10012
- if (isArray$3(autoSelect)) {
10141
+ if (isArray$5(autoSelect)) {
10013
10142
  selection.select(autoSelect);
10014
10143
  } else {
10015
10144
 
@@ -10036,7 +10165,7 @@
10036
10165
  var shape = elementRegistry.get(event.context.shape.id);
10037
10166
 
10038
10167
  // Always select main shape on move
10039
- var isSelected = find(previousSelection, function(selectedShape) {
10168
+ var isSelected = find$1(previousSelection, function(selectedShape) {
10040
10169
  return shape.id === selectedShape.id;
10041
10170
  });
10042
10171
 
@@ -10128,7 +10257,7 @@
10128
10257
  *
10129
10258
  * @return {boolean}
10130
10259
  */
10131
- function isArray(obj) {
10260
+ function isArray$2(obj) {
10132
10261
  return Array.isArray(obj);
10133
10262
  }
10134
10263
 
@@ -10155,7 +10284,7 @@
10155
10284
  */
10156
10285
  function annotate(...args) {
10157
10286
 
10158
- if (args.length === 1 && isArray(args[0])) {
10287
+ if (args.length === 1 && isArray$2(args[0])) {
10159
10288
  args = args[0];
10160
10289
  }
10161
10290
 
@@ -10300,7 +10429,7 @@
10300
10429
  }
10301
10430
 
10302
10431
  if (typeof fn !== 'function') {
10303
- if (isArray(fn)) {
10432
+ if (isArray$2(fn)) {
10304
10433
  fn = annotate(fn.slice());
10305
10434
  } else {
10306
10435
  throw error(`Cannot invoke "${ fn }". Expected a function!`);
@@ -10599,7 +10728,7 @@
10599
10728
  // helpers ///////////////
10600
10729
 
10601
10730
  function arrayUnwrap(type, value) {
10602
- if (type !== 'value' && isArray(value)) {
10731
+ if (type !== 'value' && isArray$2(value)) {
10603
10732
  value = annotate(value.slice());
10604
10733
  }
10605
10734
 
@@ -10654,9 +10783,9 @@
10654
10783
  });
10655
10784
 
10656
10785
  if (isFrameElement(element)) {
10657
- attr$1(rect, assign$2({}, this.FRAME_STYLE, attrs || {}));
10786
+ attr$1(rect, assign$5({}, this.FRAME_STYLE, attrs || {}));
10658
10787
  } else {
10659
- attr$1(rect, assign$2({}, this.SHAPE_STYLE, attrs || {}));
10788
+ attr$1(rect, assign$5({}, this.SHAPE_STYLE, attrs || {}));
10660
10789
  }
10661
10790
 
10662
10791
  append(visuals, rect);
@@ -10669,7 +10798,7 @@
10669
10798
  */
10670
10799
  DefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {
10671
10800
 
10672
- var line = createLine(connection.waypoints, assign$2({}, this.CONNECTION_STYLE, attrs || {}));
10801
+ var line = createLine(connection.waypoints, assign$5({}, this.CONNECTION_STYLE, attrs || {}));
10673
10802
  append(visuals, line);
10674
10803
 
10675
10804
  return line;
@@ -10751,7 +10880,7 @@
10751
10880
  this.cls = function(className, traits, additionalAttrs) {
10752
10881
  var attrs = this.style(traits, additionalAttrs);
10753
10882
 
10754
- return assign$2(attrs, { 'class': className });
10883
+ return assign$5(attrs, { 'class': className });
10755
10884
  };
10756
10885
 
10757
10886
  /**
@@ -10765,16 +10894,16 @@
10765
10894
  */
10766
10895
  this.style = function(traits, additionalAttrs) {
10767
10896
 
10768
- if (!isArray$3(traits) && !additionalAttrs) {
10897
+ if (!isArray$5(traits) && !additionalAttrs) {
10769
10898
  additionalAttrs = traits;
10770
10899
  traits = [];
10771
10900
  }
10772
10901
 
10773
10902
  var attrs = reduce(traits, function(attrs, t) {
10774
- return assign$2(attrs, defaultTraits[t] || {});
10903
+ return assign$5(attrs, defaultTraits[t] || {});
10775
10904
  }, {});
10776
10905
 
10777
- return additionalAttrs ? assign$2(attrs, additionalAttrs) : attrs;
10906
+ return additionalAttrs ? assign$5(attrs, additionalAttrs) : attrs;
10778
10907
  };
10779
10908
 
10780
10909
 
@@ -10789,12 +10918,12 @@
10789
10918
  * @return {Object} the style definition
10790
10919
  */
10791
10920
  this.computeStyle = function(custom, traits, defaultStyles) {
10792
- if (!isArray$3(traits)) {
10921
+ if (!isArray$5(traits)) {
10793
10922
  defaultStyles = traits;
10794
10923
  traits = [];
10795
10924
  }
10796
10925
 
10797
- return self.style(traits || [], assign$2({}, defaultStyles, custom || {}));
10926
+ return self.style(traits || [], assign$5({}, defaultStyles, custom || {}));
10798
10927
  };
10799
10928
  }
10800
10929
 
@@ -10949,7 +11078,7 @@
10949
11078
  */
10950
11079
  function createContainer(options) {
10951
11080
 
10952
- options = assign$2({}, { width: '100%', height: '100%' }, options);
11081
+ options = assign$5({}, { width: '100%', height: '100%' }, options);
10953
11082
 
10954
11083
  const container = options.container || document.body;
10955
11084
 
@@ -10959,7 +11088,7 @@
10959
11088
  const parent = document.createElement('div');
10960
11089
  parent.setAttribute('class', 'djs-container djs-parent');
10961
11090
 
10962
- assign(parent, {
11091
+ assign$3(parent, {
10963
11092
  position: 'relative',
10964
11093
  overflow: 'hidden',
10965
11094
  width: ensurePx(options.width),
@@ -11102,7 +11231,7 @@
11102
11231
  // debounce canvas.viewbox.changed events when deferUpdate is set
11103
11232
  // to help with potential performance issues
11104
11233
  if (config.deferUpdate) {
11105
- this._viewboxChanged = debounce(bind$3(this._viewboxChanged, this), 300);
11234
+ this._viewboxChanged = debounce(bind$4(this._viewboxChanged, this), 300);
11106
11235
  }
11107
11236
 
11108
11237
  eventBus.on('diagram.init', () => {
@@ -11444,7 +11573,7 @@
11444
11573
  };
11445
11574
 
11446
11575
  Canvas.prototype._findPlaneForRoot = function(rootElement) {
11447
- return find(this._planes, function(plane) {
11576
+ return find$1(this._planes, function(plane) {
11448
11577
  return plane.rootElement === rootElement;
11449
11578
  });
11450
11579
  };
@@ -11479,7 +11608,7 @@
11479
11608
  return;
11480
11609
  }
11481
11610
 
11482
- forEach$2([ container.gfx, container.secondaryGfx ], function(gfx) {
11611
+ forEach$4([ container.gfx, container.secondaryGfx ], function(gfx) {
11483
11612
  if (gfx) {
11484
11613
 
11485
11614
  // invoke either addClass or removeClass based on mode
@@ -12137,7 +12266,7 @@
12137
12266
 
12138
12267
  if (delta) {
12139
12268
  this._changeViewbox(function() {
12140
- delta = assign$2({ dx: 0, dy: 0 }, delta || {});
12269
+ delta = assign$5({ dx: 0, dy: 0 }, delta || {});
12141
12270
 
12142
12271
  matrix = this._svg.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
12143
12272
 
@@ -12336,7 +12465,7 @@
12336
12465
  const currentScale = currentMatrix.a;
12337
12466
 
12338
12467
  if (center) {
12339
- centerPoint = assign$2(point, center);
12468
+ centerPoint = assign$5(point, center);
12340
12469
 
12341
12470
  // revert applied viewport transformations
12342
12471
  originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
@@ -13276,7 +13405,7 @@
13276
13405
  if (!Type) {
13277
13406
  throw new Error('unknown type: <' + type + '>');
13278
13407
  }
13279
- return assign$2(new Type(), attrs);
13408
+ return assign$5(new Type(), attrs);
13280
13409
  }
13281
13410
 
13282
13411
  /**
@@ -13376,7 +13505,7 @@
13376
13505
  */
13377
13506
  ElementFactory.prototype.create = function(type, attrs) {
13378
13507
 
13379
- attrs = assign$2({}, attrs || {});
13508
+ attrs = assign$5({}, attrs || {});
13380
13509
 
13381
13510
  if (!attrs.id) {
13382
13511
  attrs.id = type + '_' + (this._uid++);
@@ -13554,9 +13683,9 @@
13554
13683
  */
13555
13684
  EventBus.prototype.on = function(events, priority, callback, that) {
13556
13685
 
13557
- events = isArray$3(events) ? events : [ events ];
13686
+ events = isArray$5(events) ? events : [ events ];
13558
13687
 
13559
- if (isFunction(priority)) {
13688
+ if (isFunction$1(priority)) {
13560
13689
  that = callback;
13561
13690
  callback = priority;
13562
13691
  priority = DEFAULT_PRIORITY;
@@ -13569,7 +13698,7 @@
13569
13698
  var actualCallback = callback;
13570
13699
 
13571
13700
  if (that) {
13572
- actualCallback = bind$3(callback, that);
13701
+ actualCallback = bind$4(callback, that);
13573
13702
 
13574
13703
  // make sure we remember and are able to remove
13575
13704
  // bound callbacks via {@link #off} using the original
@@ -13613,7 +13742,7 @@
13613
13742
  EventBus.prototype.once = function(events, priority, callback, that) {
13614
13743
  var self = this;
13615
13744
 
13616
- if (isFunction(priority)) {
13745
+ if (isFunction$1(priority)) {
13617
13746
  that = callback;
13618
13747
  callback = priority;
13619
13748
  priority = DEFAULT_PRIORITY;
@@ -13652,7 +13781,7 @@
13652
13781
  */
13653
13782
  EventBus.prototype.off = function(events, callback) {
13654
13783
 
13655
- events = isArray$3(events) ? events : [ events ];
13784
+ events = isArray$5(events) ? events : [ events ];
13656
13785
 
13657
13786
  var self = this;
13658
13787
 
@@ -13977,7 +14106,7 @@
13977
14106
  };
13978
14107
 
13979
14108
  InternalEvent.prototype.init = function(data) {
13980
- assign$2(this, data || {});
14109
+ assign$5(this, data || {});
13981
14110
  };
13982
14111
 
13983
14112
 
@@ -14176,7 +14305,7 @@
14176
14305
 
14177
14306
  // update all parents of changed and reorganized their children
14178
14307
  // in the correct order (as indicated in our model)
14179
- forEach$2(parents, function(parent) {
14308
+ forEach$4(parents, function(parent) {
14180
14309
 
14181
14310
  var children = parent.children;
14182
14311
 
@@ -14186,7 +14315,7 @@
14186
14315
 
14187
14316
  var childrenGfx = self._getChildrenContainer(parent);
14188
14317
 
14189
- forEach$2(children.slice().reverse(), function(child) {
14318
+ forEach$4(children.slice().reverse(), function(child) {
14190
14319
  var childGfx = elementRegistry.getGraphics(child);
14191
14320
 
14192
14321
  prependTo(childGfx.parentNode, childrenGfx);
@@ -14556,6 +14685,231 @@
14556
14685
  this.get('eventBus').fire('diagram.clear');
14557
14686
  };
14558
14687
 
14688
+ /**
14689
+ * Flatten array, one level deep.
14690
+ *
14691
+ * @template T
14692
+ *
14693
+ * @param {T[][] | T[] | null} [arr]
14694
+ *
14695
+ * @return {T[]}
14696
+ */
14697
+
14698
+ const nativeToString$2 = Object.prototype.toString;
14699
+
14700
+ function isString$2(obj) {
14701
+ return nativeToString$2.call(obj) === '[object String]';
14702
+ }
14703
+
14704
+ /**
14705
+ * Convenience wrapper for `Object.assign`.
14706
+ *
14707
+ * @param {Object} target
14708
+ * @param {...Object} others
14709
+ *
14710
+ * @return {Object} the target
14711
+ */
14712
+ function assign$2(target, ...others) {
14713
+ return Object.assign(target, ...others);
14714
+ }
14715
+
14716
+ /**
14717
+ * Flatten array, one level deep.
14718
+ *
14719
+ * @template T
14720
+ *
14721
+ * @param {T[][] | T[] | null} [arr]
14722
+ *
14723
+ * @return {T[]}
14724
+ */
14725
+
14726
+ const nativeToString$1 = Object.prototype.toString;
14727
+ const nativeHasOwnProperty$1 = Object.prototype.hasOwnProperty;
14728
+
14729
+ function isUndefined$2(obj) {
14730
+ return obj === undefined;
14731
+ }
14732
+
14733
+ function isDefined(obj) {
14734
+ return obj !== undefined;
14735
+ }
14736
+
14737
+ function isNil$1(obj) {
14738
+ return obj == null;
14739
+ }
14740
+
14741
+ function isArray$1(obj) {
14742
+ return nativeToString$1.call(obj) === '[object Array]';
14743
+ }
14744
+
14745
+ function isObject(obj) {
14746
+ return nativeToString$1.call(obj) === '[object Object]';
14747
+ }
14748
+
14749
+ function isString$1(obj) {
14750
+ return nativeToString$1.call(obj) === '[object String]';
14751
+ }
14752
+
14753
+ /**
14754
+ * Return true, if target owns a property with the given key.
14755
+ *
14756
+ * @param {Object} target
14757
+ * @param {String} key
14758
+ *
14759
+ * @return {Boolean}
14760
+ */
14761
+ function has$1(target, key) {
14762
+ return !isNil$1(target) && nativeHasOwnProperty$1.call(target, key);
14763
+ }
14764
+
14765
+
14766
+ /**
14767
+ * Iterate over collection; returning something
14768
+ * (non-undefined) will stop iteration.
14769
+ *
14770
+ * @template T
14771
+ * @param {Collection<T>} collection
14772
+ * @param { ((item: T, idx: number) => (boolean|void)) | ((item: T, key: string) => (boolean|void)) } iterator
14773
+ *
14774
+ * @return {T} return result that stopped the iteration
14775
+ */
14776
+ function forEach$1(collection, iterator) {
14777
+
14778
+ let val,
14779
+ result;
14780
+
14781
+ if (isUndefined$2(collection)) {
14782
+ return;
14783
+ }
14784
+
14785
+ const convertKey = isArray$1(collection) ? toNum$1 : identity$1;
14786
+
14787
+ for (let key in collection) {
14788
+
14789
+ if (has$1(collection, key)) {
14790
+ val = collection[key];
14791
+
14792
+ result = iterator(val, convertKey(key));
14793
+
14794
+ if (result === false) {
14795
+ return val;
14796
+ }
14797
+ }
14798
+ }
14799
+ }
14800
+
14801
+
14802
+ function identity$1(arg) {
14803
+ return arg;
14804
+ }
14805
+
14806
+ function toNum$1(arg) {
14807
+ return Number(arg);
14808
+ }
14809
+
14810
+ /**
14811
+ * Bind function against target <this>.
14812
+ *
14813
+ * @param {Function} fn
14814
+ * @param {Object} target
14815
+ *
14816
+ * @return {Function} bound function
14817
+ */
14818
+ function bind(fn, target) {
14819
+ return fn.bind(target);
14820
+ }
14821
+
14822
+ /**
14823
+ * Convenience wrapper for `Object.assign`.
14824
+ *
14825
+ * @param {Object} target
14826
+ * @param {...Object} others
14827
+ *
14828
+ * @return {Object} the target
14829
+ */
14830
+ function assign$1(target, ...others) {
14831
+ return Object.assign(target, ...others);
14832
+ }
14833
+
14834
+ /**
14835
+ * Sets a nested property of a given object to the specified value.
14836
+ *
14837
+ * This mutates the object and returns it.
14838
+ *
14839
+ * @template T
14840
+ *
14841
+ * @param {T} target The target of the set operation.
14842
+ * @param {(string|number)[]} path The path to the nested value.
14843
+ * @param {any} value The value to set.
14844
+ *
14845
+ * @return {T}
14846
+ */
14847
+ function set(target, path, value) {
14848
+
14849
+ let currentTarget = target;
14850
+
14851
+ forEach$1(path, function(key, idx) {
14852
+
14853
+ if (typeof key !== 'number' && typeof key !== 'string') {
14854
+ throw new Error('illegal key type: ' + typeof key + '. Key should be of type number or string.');
14855
+ }
14856
+
14857
+ if (key === 'constructor') {
14858
+ throw new Error('illegal key: constructor');
14859
+ }
14860
+
14861
+ if (key === '__proto__') {
14862
+ throw new Error('illegal key: __proto__');
14863
+ }
14864
+
14865
+ let nextKey = path[idx + 1];
14866
+ let nextTarget = currentTarget[key];
14867
+
14868
+ if (isDefined(nextKey) && isNil$1(nextTarget)) {
14869
+ nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : [];
14870
+ }
14871
+
14872
+ if (isUndefined$2(nextKey)) {
14873
+ if (isUndefined$2(value)) {
14874
+ delete currentTarget[key];
14875
+ } else {
14876
+ currentTarget[key] = value;
14877
+ }
14878
+ } else {
14879
+ currentTarget = nextTarget;
14880
+ }
14881
+ });
14882
+
14883
+ return target;
14884
+ }
14885
+
14886
+ /**
14887
+ * Pick properties from the given target.
14888
+ *
14889
+ * @template T
14890
+ * @template {any[]} V
14891
+ *
14892
+ * @param {T} target
14893
+ * @param {V} properties
14894
+ *
14895
+ * @return Pick<T, V>
14896
+ */
14897
+ function pick(target, properties) {
14898
+
14899
+ let result = {};
14900
+
14901
+ let obj = Object(target);
14902
+
14903
+ forEach$1(properties, function(prop) {
14904
+
14905
+ if (prop in obj) {
14906
+ result[prop] = target[prop];
14907
+ }
14908
+ });
14909
+
14910
+ return result;
14911
+ }
14912
+
14559
14913
  /**
14560
14914
  * Moddle base element.
14561
14915
  */
@@ -14589,7 +14943,7 @@
14589
14943
  prototype = Object.create(Base.prototype);
14590
14944
 
14591
14945
  // initialize default values
14592
- forEach$2(descriptor.properties, function(p) {
14946
+ forEach$1(descriptor.properties, function(p) {
14593
14947
  if (!p.isMany && p.default !== undefined) {
14594
14948
  prototype[p.name] = p.default;
14595
14949
  }
@@ -14608,7 +14962,7 @@
14608
14962
  props.define(this, '$attrs', { value: {} });
14609
14963
  props.define(this, '$parent', { writable: true });
14610
14964
 
14611
- forEach$2(attrs, bind$3(function(val, key) {
14965
+ forEach$1(attrs, bind(function(val, key) {
14612
14966
  this.set(key, val);
14613
14967
  }, this));
14614
14968
  }
@@ -14915,10 +15269,10 @@
14915
15269
  return;
14916
15270
  }
14917
15271
 
14918
- forEach$2(t.properties, bind$3(function(p) {
15272
+ forEach$1(t.properties, bind(function(p) {
14919
15273
 
14920
15274
  // clone property to allow extensions
14921
- p = assign$2({}, p, {
15275
+ p = assign$1({}, p, {
14922
15276
  name: p.ns.localName,
14923
15277
  inherited: inherited
14924
15278
  });
@@ -14962,7 +15316,7 @@
14962
15316
 
14963
15317
  this.properties = properties;
14964
15318
 
14965
- forEach$2(packages, bind$3(this.registerPackage, this));
15319
+ forEach$1(packages, bind(this.registerPackage, this));
14966
15320
  }
14967
15321
 
14968
15322
 
@@ -14978,7 +15332,7 @@
14978
15332
  Registry.prototype.registerPackage = function(pkg) {
14979
15333
 
14980
15334
  // copy package
14981
- pkg = assign$2({}, pkg);
15335
+ pkg = assign$1({}, pkg);
14982
15336
 
14983
15337
  var pkgMap = this.packageMap;
14984
15338
 
@@ -14986,7 +15340,7 @@
14986
15340
  ensureAvailable(pkgMap, pkg, 'uri');
14987
15341
 
14988
15342
  // register types
14989
- forEach$2(pkg.types, bind$3(function(descriptor) {
15343
+ forEach$1(pkg.types, bind(function(descriptor) {
14990
15344
  this.registerType(descriptor, pkg);
14991
15345
  }, this));
14992
15346
 
@@ -15000,11 +15354,11 @@
15000
15354
  */
15001
15355
  Registry.prototype.registerType = function(type, pkg) {
15002
15356
 
15003
- type = assign$2({}, type, {
15357
+ type = assign$1({}, type, {
15004
15358
  superClass: (type.superClass || []).slice(),
15005
15359
  extends: (type.extends || []).slice(),
15006
15360
  properties: (type.properties || []).slice(),
15007
- meta: assign$2((type.meta || {}))
15361
+ meta: assign$1((type.meta || {}))
15008
15362
  });
15009
15363
 
15010
15364
  var ns = parseName(type.name, pkg.prefix),
@@ -15012,7 +15366,7 @@
15012
15366
  propertiesByName = {};
15013
15367
 
15014
15368
  // parse properties
15015
- forEach$2(type.properties, bind$3(function(p) {
15369
+ forEach$1(type.properties, bind(function(p) {
15016
15370
 
15017
15371
  // namespace property names
15018
15372
  var propertyNs = parseName(p.name, ns.prefix),
@@ -15023,7 +15377,7 @@
15023
15377
  p.type = parseName(p.type, propertyNs.prefix).name;
15024
15378
  }
15025
15379
 
15026
- assign$2(p, {
15380
+ assign$1(p, {
15027
15381
  ns: propertyNs,
15028
15382
  name: propertyName
15029
15383
  });
@@ -15032,13 +15386,13 @@
15032
15386
  }, this));
15033
15387
 
15034
15388
  // update ns + name
15035
- assign$2(type, {
15389
+ assign$1(type, {
15036
15390
  ns: ns,
15037
15391
  name: name,
15038
15392
  propertiesByName: propertiesByName
15039
15393
  });
15040
15394
 
15041
- forEach$2(type.extends, bind$3(function(extendsName) {
15395
+ forEach$1(type.extends, bind(function(extendsName) {
15042
15396
  var extendsNameNs = parseName(extendsName, ns.prefix);
15043
15397
 
15044
15398
  var extended = this.typeMap[extendsNameNs.name];
@@ -15103,12 +15457,12 @@
15103
15457
  throw new Error('unknown type <' + nsName.name + '>');
15104
15458
  }
15105
15459
 
15106
- forEach$2(type.superClass, trait ? traverseTrait : traverseSuper);
15460
+ forEach$1(type.superClass, trait ? traverseTrait : traverseSuper);
15107
15461
 
15108
15462
  // call iterator with (type, inherited=!trait)
15109
15463
  iterator(type, !trait);
15110
15464
 
15111
- forEach$2(type.traits, traverseTrait);
15465
+ forEach$1(type.traits, traverseTrait);
15112
15466
  };
15113
15467
 
15114
15468
 
@@ -15175,7 +15529,7 @@
15175
15529
  */
15176
15530
  Properties.prototype.set = function(target, name, value) {
15177
15531
 
15178
- if (!isString(name) || !name.length) {
15532
+ if (!isString$1(name) || !name.length) {
15179
15533
  throw new TypeError('property name must be a non-empty string');
15180
15534
  }
15181
15535
 
@@ -15183,7 +15537,7 @@
15183
15537
 
15184
15538
  var propertyName = property && property.name;
15185
15539
 
15186
- if (isUndefined(value)) {
15540
+ if (isUndefined$1(value)) {
15187
15541
 
15188
15542
  // unset the property, if the specified value is undefined;
15189
15543
  // delete from $attrs (for extensions) or the target itself
@@ -15250,7 +15604,7 @@
15250
15604
 
15251
15605
  // use getters for read-only variables to support ES6 proxies
15252
15606
  // cf. https://github.com/bpmn-io/internal-docs/issues/386
15253
- options = assign$2({}, options, {
15607
+ options = assign$1({}, options, {
15254
15608
  get: function() { return value; }
15255
15609
  });
15256
15610
 
@@ -15314,7 +15668,7 @@
15314
15668
  return null;
15315
15669
  };
15316
15670
 
15317
- function isUndefined(val) {
15671
+ function isUndefined$1(val) {
15318
15672
  return typeof val === 'undefined';
15319
15673
  }
15320
15674
 
@@ -15411,7 +15765,7 @@
15411
15765
 
15412
15766
  var cache = this.typeCache;
15413
15767
 
15414
- var name = isString(descriptor) ? descriptor : descriptor.ns.name;
15768
+ var name = isString$1(descriptor) ? descriptor : descriptor.ns.name;
15415
15769
 
15416
15770
  var type = cache[name];
15417
15771
 
@@ -15485,7 +15839,7 @@
15485
15839
  this.properties.define(element, '$parent', { enumerable: false, writable: true });
15486
15840
  this.properties.define(element, '$instanceOf', { enumerable: false, writable: true });
15487
15841
 
15488
- forEach$2(properties, function(a, key) {
15842
+ forEach$1(properties, function(a, key) {
15489
15843
  if (isObject(a) && a.value !== undefined) {
15490
15844
  element[a.name] = a.value;
15491
15845
  } else {
@@ -15552,6 +15906,264 @@
15552
15906
  return this.registry.typeMap[type];
15553
15907
  };
15554
15908
 
15909
+ /**
15910
+ * Flatten array, one level deep.
15911
+ *
15912
+ * @template T
15913
+ *
15914
+ * @param {T[][] | T[] | null} [arr]
15915
+ *
15916
+ * @return {T[]}
15917
+ */
15918
+
15919
+ const nativeToString = Object.prototype.toString;
15920
+ const nativeHasOwnProperty = Object.prototype.hasOwnProperty;
15921
+
15922
+ function isUndefined(obj) {
15923
+ return obj === undefined;
15924
+ }
15925
+
15926
+ function isNil(obj) {
15927
+ return obj == null;
15928
+ }
15929
+
15930
+ function isArray(obj) {
15931
+ return nativeToString.call(obj) === '[object Array]';
15932
+ }
15933
+
15934
+ /**
15935
+ * @param {any} obj
15936
+ *
15937
+ * @return {boolean}
15938
+ */
15939
+ function isFunction(obj) {
15940
+ const tag = nativeToString.call(obj);
15941
+
15942
+ return (
15943
+ tag === '[object Function]' ||
15944
+ tag === '[object AsyncFunction]' ||
15945
+ tag === '[object GeneratorFunction]' ||
15946
+ tag === '[object AsyncGeneratorFunction]' ||
15947
+ tag === '[object Proxy]'
15948
+ );
15949
+ }
15950
+
15951
+ function isString(obj) {
15952
+ return nativeToString.call(obj) === '[object String]';
15953
+ }
15954
+
15955
+ /**
15956
+ * Return true, if target owns a property with the given key.
15957
+ *
15958
+ * @param {Object} target
15959
+ * @param {String} key
15960
+ *
15961
+ * @return {Boolean}
15962
+ */
15963
+ function has(target, key) {
15964
+ return !isNil(target) && nativeHasOwnProperty.call(target, key);
15965
+ }
15966
+
15967
+ /**
15968
+ * @template T
15969
+ * @typedef { (
15970
+ * ((e: T) => boolean) |
15971
+ * ((e: T, idx: number) => boolean) |
15972
+ * ((e: T, key: string) => boolean) |
15973
+ * string |
15974
+ * number
15975
+ * ) } Matcher
15976
+ */
15977
+
15978
+ /**
15979
+ * @template T
15980
+ * @template U
15981
+ *
15982
+ * @typedef { (
15983
+ * ((e: T) => U) | string | number
15984
+ * ) } Extractor
15985
+ */
15986
+
15987
+
15988
+ /**
15989
+ * @template T
15990
+ * @typedef { (val: T, key: any) => boolean } MatchFn
15991
+ */
15992
+
15993
+ /**
15994
+ * @template T
15995
+ * @typedef { T[] } ArrayCollection
15996
+ */
15997
+
15998
+ /**
15999
+ * @template T
16000
+ * @typedef { { [key: string]: T } } StringKeyValueCollection
16001
+ */
16002
+
16003
+ /**
16004
+ * @template T
16005
+ * @typedef { { [key: number]: T } } NumberKeyValueCollection
16006
+ */
16007
+
16008
+ /**
16009
+ * @template T
16010
+ * @typedef { StringKeyValueCollection<T> | NumberKeyValueCollection<T> } KeyValueCollection
16011
+ */
16012
+
16013
+ /**
16014
+ * @template T
16015
+ * @typedef { KeyValueCollection<T> | ArrayCollection<T> } Collection
16016
+ */
16017
+
16018
+ /**
16019
+ * Find element in collection.
16020
+ *
16021
+ * @template T
16022
+ * @param {Collection<T>} collection
16023
+ * @param {Matcher<T>} matcher
16024
+ *
16025
+ * @return {Object}
16026
+ */
16027
+ function find(collection, matcher) {
16028
+
16029
+ const matchFn = toMatcher(matcher);
16030
+
16031
+ let match;
16032
+
16033
+ forEach(collection, function(val, key) {
16034
+ if (matchFn(val, key)) {
16035
+ match = val;
16036
+
16037
+ return false;
16038
+ }
16039
+ });
16040
+
16041
+ return match;
16042
+
16043
+ }
16044
+
16045
+
16046
+ /**
16047
+ * Find element index in collection.
16048
+ *
16049
+ * @template T
16050
+ * @param {Collection<T>} collection
16051
+ * @param {Matcher<T>} matcher
16052
+ *
16053
+ * @return {number | string | undefined}
16054
+ */
16055
+ function findIndex(collection, matcher) {
16056
+
16057
+ const matchFn = toMatcher(matcher);
16058
+
16059
+ let idx = isArray(collection) ? -1 : undefined;
16060
+
16061
+ forEach(collection, function(val, key) {
16062
+ if (matchFn(val, key)) {
16063
+ idx = key;
16064
+
16065
+ return false;
16066
+ }
16067
+ });
16068
+
16069
+ return idx;
16070
+ }
16071
+
16072
+
16073
+ /**
16074
+ * Filter elements in collection.
16075
+ *
16076
+ * @template T
16077
+ * @param {Collection<T>} collection
16078
+ * @param {Matcher<T>} matcher
16079
+ *
16080
+ * @return {T[]} result
16081
+ */
16082
+ function filter(collection, matcher) {
16083
+
16084
+ const matchFn = toMatcher(matcher);
16085
+
16086
+ let result = [];
16087
+
16088
+ forEach(collection, function(val, key) {
16089
+ if (matchFn(val, key)) {
16090
+ result.push(val);
16091
+ }
16092
+ });
16093
+
16094
+ return result;
16095
+ }
16096
+
16097
+
16098
+ /**
16099
+ * Iterate over collection; returning something
16100
+ * (non-undefined) will stop iteration.
16101
+ *
16102
+ * @template T
16103
+ * @param {Collection<T>} collection
16104
+ * @param { ((item: T, idx: number) => (boolean|void)) | ((item: T, key: string) => (boolean|void)) } iterator
16105
+ *
16106
+ * @return {T} return result that stopped the iteration
16107
+ */
16108
+ function forEach(collection, iterator) {
16109
+
16110
+ let val,
16111
+ result;
16112
+
16113
+ if (isUndefined(collection)) {
16114
+ return;
16115
+ }
16116
+
16117
+ const convertKey = isArray(collection) ? toNum : identity;
16118
+
16119
+ for (let key in collection) {
16120
+
16121
+ if (has(collection, key)) {
16122
+ val = collection[key];
16123
+
16124
+ result = iterator(val, convertKey(key));
16125
+
16126
+ if (result === false) {
16127
+ return val;
16128
+ }
16129
+ }
16130
+ }
16131
+ }
16132
+
16133
+
16134
+ /**
16135
+ * @template T
16136
+ * @param {Matcher<T>} matcher
16137
+ *
16138
+ * @return {MatchFn<T>}
16139
+ */
16140
+ function toMatcher(matcher) {
16141
+ return isFunction(matcher) ? matcher : (e) => {
16142
+ return e === matcher;
16143
+ };
16144
+ }
16145
+
16146
+
16147
+ function identity(arg) {
16148
+ return arg;
16149
+ }
16150
+
16151
+ function toNum(arg) {
16152
+ return Number(arg);
16153
+ }
16154
+
16155
+ /**
16156
+ * Convenience wrapper for `Object.assign`.
16157
+ *
16158
+ * @param {Object} target
16159
+ * @param {...Object} others
16160
+ *
16161
+ * @return {Object} the target
16162
+ */
16163
+ function assign(target, ...others) {
16164
+ return Object.assign(target, ...others);
16165
+ }
16166
+
15555
16167
  var fromCharCode = String.fromCharCode;
15556
16168
 
15557
16169
  var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -16698,7 +17310,7 @@
16698
17310
  * @property {Boolean} lax
16699
17311
  */
16700
17312
 
16701
- assign$2(this, options);
17313
+ assign(this, options);
16702
17314
 
16703
17315
  this.elementsById = {};
16704
17316
  this.references = [];
@@ -16919,7 +17531,7 @@
16919
17531
  model = this.model,
16920
17532
  propNameNs;
16921
17533
 
16922
- forEach$2(attributes, function(value, name) {
17534
+ forEach(attributes, function(value, name) {
16923
17535
 
16924
17536
  var prop = descriptor.propertiesByName[name],
16925
17537
  values;
@@ -16937,7 +17549,7 @@
16937
17549
  // IDREFS: parse references as whitespace-separated list
16938
17550
  values = value.split(' ');
16939
17551
 
16940
- forEach$2(values, function(v) {
17552
+ forEach(values, function(v) {
16941
17553
  context.addReference({
16942
17554
  element: instance,
16943
17555
  property: prop.ns.name,
@@ -17006,7 +17618,7 @@
17006
17618
 
17007
17619
  const elementType = model.getType(normalizedTypeName);
17008
17620
 
17009
- return assign$2({}, property, {
17621
+ return assign({}, property, {
17010
17622
  effectiveType: getModdleDescriptor(elementType).name
17011
17623
  });
17012
17624
  }
@@ -17028,7 +17640,7 @@
17028
17640
  });
17029
17641
 
17030
17642
  if (property) {
17031
- return assign$2({}, property, {
17643
+ return assign({}, property, {
17032
17644
  effectiveType: getModdleDescriptor(elementType).name
17033
17645
  });
17034
17646
  }
@@ -17103,7 +17715,7 @@
17103
17715
  }
17104
17716
 
17105
17717
  if (propertyDesc.isReference) {
17106
- assign$2(newElement, {
17718
+ assign(newElement, {
17107
17719
  element: element
17108
17720
  });
17109
17721
 
@@ -17212,7 +17824,7 @@
17212
17824
  };
17213
17825
  }
17214
17826
 
17215
- assign$2(this, { lax: false }, options);
17827
+ assign(this, { lax: false }, options);
17216
17828
  }
17217
17829
 
17218
17830
  /**
@@ -17267,7 +17879,7 @@
17267
17879
  var model = this.model,
17268
17880
  lax = this.lax;
17269
17881
 
17270
- var context = new Context(assign$2({}, options, { rootHandler: rootHandler })),
17882
+ var context = new Context(assign({}, options, { rootHandler: rootHandler })),
17271
17883
  parser = new Parser({ proxy: true }),
17272
17884
  stack = createStack();
17273
17885
 
@@ -17672,14 +18284,14 @@
17672
18284
 
17673
18285
  function getElementNs(ns, descriptor) {
17674
18286
  if (descriptor.isGeneric) {
17675
- return assign$2({ localName: descriptor.ns.localName }, ns);
18287
+ return assign({ localName: descriptor.ns.localName }, ns);
17676
18288
  } else {
17677
- return assign$2({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);
18289
+ return assign({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);
17678
18290
  }
17679
18291
  }
17680
18292
 
17681
18293
  function getPropertyNs(ns, descriptor) {
17682
- return assign$2({ localName: descriptor.ns.localName }, ns);
18294
+ return assign({ localName: descriptor.ns.localName }, ns);
17683
18295
  }
17684
18296
 
17685
18297
  function getSerializableProperties(element) {
@@ -17693,7 +18305,7 @@
17693
18305
  }
17694
18306
 
17695
18307
  // do not serialize defaults
17696
- if (!has$2(element, name)) {
18308
+ if (!has(element, name)) {
17697
18309
  return false;
17698
18310
  }
17699
18311
 
@@ -17913,7 +18525,7 @@
17913
18525
  if (this.isLocalNs(effectiveNs)) {
17914
18526
  return { localName: ns.localName };
17915
18527
  } else {
17916
- return assign$2({ localName: ns.localName }, effectiveNs);
18528
+ return assign({ localName: ns.localName }, effectiveNs);
17917
18529
  }
17918
18530
  };
17919
18531
 
@@ -17936,7 +18548,7 @@
17936
18548
  var children = element.$children;
17937
18549
 
17938
18550
  if (children) {
17939
- forEach$2(children, child => {
18551
+ forEach(children, child => {
17940
18552
  this.body.push(new ElementSerializer(this).build(child));
17941
18553
  });
17942
18554
  }
@@ -17996,7 +18608,7 @@
17996
18608
  // parse namespace attributes first
17997
18609
  // and log them. push non namespace attributes to a list
17998
18610
  // and process them later
17999
- forEach$2(genericAttrs, function(value, name) {
18611
+ forEach(genericAttrs, function(value, name) {
18000
18612
 
18001
18613
  var nonNsAttr = self.parseNsAttribute(element, name, value);
18002
18614
 
@@ -18012,7 +18624,7 @@
18012
18624
 
18013
18625
  var self = this;
18014
18626
 
18015
- forEach$2(attributes, function(attr) {
18627
+ forEach(attributes, function(attr) {
18016
18628
 
18017
18629
  try {
18018
18630
  self.addAttribute(self.nsAttributeName(attr.name), attr.value);
@@ -18034,7 +18646,7 @@
18034
18646
  body = this.body,
18035
18647
  element = this.element;
18036
18648
 
18037
- forEach$2(properties, function(p) {
18649
+ forEach(properties, function(p) {
18038
18650
  var value = element.get(p.name),
18039
18651
  isReference = p.isReference,
18040
18652
  isMany = p.isMany;
@@ -18046,11 +18658,11 @@
18046
18658
  if (p.isBody) {
18047
18659
  body.push(new BodySerializer().build(p, value[0]));
18048
18660
  } else if (isSimple(p.type)) {
18049
- forEach$2(value, function(v) {
18661
+ forEach(value, function(v) {
18050
18662
  body.push(new ValueSerializer(self.addTagName(self.nsPropertyTagName(p))).build(p, v));
18051
18663
  });
18052
18664
  } else if (isReference) {
18053
- forEach$2(value, function(v) {
18665
+ forEach(value, function(v) {
18054
18666
  body.push(new ReferenceSerializer(self.addTagName(self.nsPropertyTagName(p))).build(v));
18055
18667
  });
18056
18668
  } else {
@@ -18059,7 +18671,7 @@
18059
18671
  // rather than element name
18060
18672
  var serialization = getSerialization(p);
18061
18673
 
18062
- forEach$2(value, function(v) {
18674
+ forEach(value, function(v) {
18063
18675
  var serializer;
18064
18676
 
18065
18677
  if (serialization) {
@@ -18171,7 +18783,7 @@
18171
18783
  var self = this,
18172
18784
  element = this.element;
18173
18785
 
18174
- forEach$2(properties, function(p) {
18786
+ forEach(properties, function(p) {
18175
18787
 
18176
18788
  var value = element.get(p.name);
18177
18789
 
@@ -18181,7 +18793,7 @@
18181
18793
  value = value.id;
18182
18794
  } else {
18183
18795
  var values = [];
18184
- forEach$2(value, function(v) {
18796
+ forEach(value, function(v) {
18185
18797
  values.push(v.id);
18186
18798
  });
18187
18799
 
@@ -18237,7 +18849,7 @@
18237
18849
  attrs = getNsAttrs(namespaces).concat(attrs);
18238
18850
  }
18239
18851
 
18240
- forEach$2(attrs, function(a) {
18852
+ forEach(attrs, function(a) {
18241
18853
  writer
18242
18854
  .append(' ')
18243
18855
  .append(nsName(a.name)).append('="').append(a.value).append('"');
@@ -18264,7 +18876,7 @@
18264
18876
  .indent();
18265
18877
  }
18266
18878
 
18267
- forEach$2(this.body, function(b) {
18879
+ forEach(this.body, function(b) {
18268
18880
  b.serializeTo(writer);
18269
18881
  });
18270
18882
 
@@ -18379,7 +18991,7 @@
18379
18991
  */
18380
18992
  function Writer(options) {
18381
18993
 
18382
- options = assign$2({ format: false, preamble: true }, options || {});
18994
+ options = assign({ format: false, preamble: true }, options || {});
18383
18995
 
18384
18996
  function toXML(tree, writer) {
18385
18997
  var internalWriter = writer || new SavingWriter();
@@ -18485,7 +19097,7 @@
18485
19097
  */
18486
19098
  BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options) {
18487
19099
 
18488
- if (!isString(typeName)) {
19100
+ if (!isString$2(typeName)) {
18489
19101
  options = typeName;
18490
19102
  typeName = 'bpmn:Definitions';
18491
19103
  }
@@ -22197,7 +22809,7 @@
22197
22809
  function ensureCompatDiRef(businessObject) {
22198
22810
 
22199
22811
  // bpmnElement can have multiple independent DIs
22200
- if (!has$2(businessObject, 'di')) {
22812
+ if (!has$5(businessObject, 'di')) {
22201
22813
  Object.defineProperty(businessObject, 'di', {
22202
22814
  enumerable: false,
22203
22815
  get: function() {
@@ -22233,7 +22845,7 @@
22233
22845
  * @return {ModdleElement}
22234
22846
  */
22235
22847
  function findDisplayCandidate(definitions) {
22236
- return find(definitions.rootElements, function(e) {
22848
+ return find$2(definitions.rootElements, function(e) {
22237
22849
  return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
22238
22850
  });
22239
22851
  }
@@ -22337,7 +22949,7 @@
22337
22949
  function handlePlane(plane) {
22338
22950
  registerDi(plane);
22339
22951
 
22340
- forEach$2(plane.planeElement, handlePlaneElement);
22952
+ forEach$5(plane.planeElement, handlePlaneElement);
22341
22953
  }
22342
22954
 
22343
22955
  function handlePlaneElement(planeElement) {
@@ -22455,7 +23067,7 @@
22455
23067
  // walk through all processes that have not yet been drawn and draw them
22456
23068
  // if they contain lanes with DI information.
22457
23069
  // we do this to pass the free-floating lane test cases in the MIWG test suite
22458
- var processes = filter(rootElements, function(e) {
23070
+ var processes = filter$2(rootElements, function(e) {
22459
23071
  return !isHandled(e) && is(e, 'bpmn:Process') && e.laneSets;
22460
23072
  });
22461
23073
 
@@ -22467,7 +23079,7 @@
22467
23079
  }
22468
23080
 
22469
23081
  function handleMessageFlows(messageFlows, context) {
22470
- forEach$2(messageFlows, contextual(handleMessageFlow, context));
23082
+ forEach$5(messageFlows, contextual(handleMessageFlow, context));
22471
23083
  }
22472
23084
 
22473
23085
  function handleDataAssociation(association, context) {
@@ -22493,7 +23105,7 @@
22493
23105
 
22494
23106
  function handleArtifacts(artifacts, context) {
22495
23107
 
22496
- forEach$2(artifacts, function(e) {
23108
+ forEach$5(artifacts, function(e) {
22497
23109
  if (is(e, 'bpmn:Association')) {
22498
23110
  deferred.push(function() {
22499
23111
  handleArtifact(e, context);
@@ -22510,8 +23122,8 @@
22510
23122
  return;
22511
23123
  }
22512
23124
 
22513
- forEach$2(ioSpecification.dataInputs, contextual(handleDataInput, context));
22514
- forEach$2(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
23125
+ forEach$5(ioSpecification.dataInputs, contextual(handleDataInput, context));
23126
+ forEach$5(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
22515
23127
  }
22516
23128
 
22517
23129
  var handleSubProcess = this.handleSubProcess = function handleSubProcess(subProcess, context) {
@@ -22538,8 +23150,8 @@
22538
23150
  // * bpmn:CatchEvent
22539
23151
  //
22540
23152
  deferred.push(function() {
22541
- forEach$2(flowNode.dataInputAssociations, contextual(handleDataAssociation, context));
22542
- forEach$2(flowNode.dataOutputAssociations, contextual(handleDataAssociation, context));
23153
+ forEach$5(flowNode.dataInputAssociations, contextual(handleDataAssociation, context));
23154
+ forEach$5(flowNode.dataOutputAssociations, contextual(handleDataAssociation, context));
22543
23155
  });
22544
23156
  }
22545
23157
 
@@ -22566,11 +23178,11 @@
22566
23178
  }
22567
23179
 
22568
23180
  function handleLaneSet(laneSet, context) {
22569
- forEach$2(laneSet.lanes, contextual(handleLane, context));
23181
+ forEach$5(laneSet.lanes, contextual(handleLane, context));
22570
23182
  }
22571
23183
 
22572
23184
  function handleLaneSets(laneSets, context) {
22573
- forEach$2(laneSets, contextual(handleLaneSet, context));
23185
+ forEach$5(laneSets, contextual(handleLaneSet, context));
22574
23186
  }
22575
23187
 
22576
23188
  function handleFlowElementsContainer(container, context) {
@@ -22582,7 +23194,7 @@
22582
23194
  }
22583
23195
 
22584
23196
  function handleFlowElements(flowElements, context) {
22585
- forEach$2(flowElements, function(flowElement) {
23197
+ forEach$5(flowElements, function(flowElement) {
22586
23198
  if (is(flowElement, 'bpmn:SequenceFlow')) {
22587
23199
  deferred.push(function() {
22588
23200
  handleSequenceFlow(flowElement, context);
@@ -22620,7 +23232,7 @@
22620
23232
 
22621
23233
  function handleCollaboration(collaboration, context) {
22622
23234
 
22623
- forEach$2(collaboration.participants, contextual(handleParticipant, context));
23235
+ forEach$5(collaboration.participants, contextual(handleParticipant, context));
22624
23236
 
22625
23237
  deferred.push(function() {
22626
23238
  handleMessageFlows(collaboration.messageFlows, context);
@@ -22633,7 +23245,7 @@
22633
23245
  function wireFlowNodeRefs(lane) {
22634
23246
 
22635
23247
  // wire the virtual flowNodeRefs <-> relationship
22636
- forEach$2(lane.flowNodeRef, function(flowNode) {
23248
+ forEach$5(lane.flowNodeRef, function(flowNode) {
22637
23249
  var lanes = flowNode.get('lanes');
22638
23250
 
22639
23251
  if (lanes) {
@@ -22711,7 +23323,7 @@
22711
23323
 
22712
23324
  // traverse BPMN 2.0 document model,
22713
23325
  // starting at definitions
22714
- forEach$2(diagramsToImport, function(diagram) {
23326
+ forEach$5(diagramsToImport, function(diagram) {
22715
23327
  walker.handleDefinitions(definitions, diagram);
22716
23328
  });
22717
23329
 
@@ -22777,12 +23389,12 @@
22777
23389
  if (is$1(rootElement, 'bpmn:Collaboration')) {
22778
23390
  collaboration = rootElement;
22779
23391
  } else {
22780
- collaboration = find(definitions.rootElements, function(element) {
23392
+ collaboration = find$2(definitions.rootElements, function(element) {
22781
23393
  if (!is$1(element, 'bpmn:Collaboration')) {
22782
23394
  return;
22783
23395
  }
22784
23396
 
22785
- return find(element.participants, function(participant) {
23397
+ return find$2(element.participants, function(participant) {
22786
23398
  return participant.processRef === rootElement;
22787
23399
  });
22788
23400
  });
@@ -22806,7 +23418,7 @@
22806
23418
  var diagramsToImport = [ bpmnDiagram ];
22807
23419
  var handledElements = [ bpmnElement ];
22808
23420
 
22809
- forEach$2(definitions.diagrams, function(diagram) {
23421
+ forEach$5(definitions.diagrams, function(diagram) {
22810
23422
 
22811
23423
  if (!diagram.plane) {
22812
23424
  return;
@@ -22830,7 +23442,7 @@
22830
23442
  function selfAndAllFlowElements(elements) {
22831
23443
  var result = [];
22832
23444
 
22833
- forEach$2(elements, function(element) {
23445
+ forEach$5(elements, function(element) {
22834
23446
  if (!element) {
22835
23447
  return;
22836
23448
  }
@@ -22926,11 +23538,11 @@
22926
23538
  function createLightbox() {
22927
23539
  lightbox = domify$1$1(LIGHTBOX_MARKUP);
22928
23540
 
22929
- assign$1(lightbox, LIGHTBOX_STYLES);
22930
- assign$1(query$1('svg', lightbox), LOGO_STYLES);
22931
- assign$1(query$1('.backdrop', lightbox), BACKDROP_STYLES);
22932
- assign$1(query$1('.notice', lightbox), NOTICE_STYLES);
22933
- assign$1(query$1('.link', lightbox), LINK_STYLES, {
23541
+ assign$4(lightbox, LIGHTBOX_STYLES);
23542
+ assign$4(query$1('svg', lightbox), LOGO_STYLES);
23543
+ assign$4(query$1('.backdrop', lightbox), BACKDROP_STYLES);
23544
+ assign$4(query$1('.notice', lightbox), NOTICE_STYLES);
23545
+ assign$4(query$1('.link', lightbox), LINK_STYLES, {
22934
23546
  'margin': '15px 20px 15px 10px',
22935
23547
  'alignSelf': 'center'
22936
23548
  });
@@ -23070,7 +23682,7 @@
23070
23682
  /**
23071
23683
  * @type {BaseViewerOptions}
23072
23684
  */
23073
- options = assign$2({}, DEFAULT_OPTIONS, options);
23685
+ options = assign$6({}, DEFAULT_OPTIONS, options);
23074
23686
 
23075
23687
  /**
23076
23688
  * @type {Moddle}
@@ -23614,8 +24226,8 @@
23614
24226
 
23615
24227
  const diagramModules = [].concat(staticModules, baseModules, additionalModules);
23616
24228
 
23617
- const diagramOptions = assign$2(omit(options, [ 'additionalModules' ]), {
23618
- canvas: assign$2({}, options.canvas, { container: container }),
24229
+ const diagramOptions = assign$6(omit(options, [ 'additionalModules' ]), {
24230
+ canvas: assign$6({}, options.canvas, { container: container }),
23619
24231
  modules: diagramModules
23620
24232
  });
23621
24233
 
@@ -23648,7 +24260,7 @@
23648
24260
 
23649
24261
  const container = domify$1$1('<div class="bjs-container"></div>');
23650
24262
 
23651
- assign$1(container, {
24263
+ assign$4(container, {
23652
24264
  width: ensureUnit(options.width),
23653
24265
  height: ensureUnit(options.height),
23654
24266
  position: options.position
@@ -23663,7 +24275,7 @@
23663
24275
  * @return {Moddle}
23664
24276
  */
23665
24277
  BaseViewer.prototype._createModdle = function(options) {
23666
- const moddleOptions = assign$2({}, this._moddleExtensions, options.moddleExtensions);
24278
+ const moddleOptions = assign$6({}, this._moddleExtensions, options.moddleExtensions);
23667
24279
 
23668
24280
  return new SimpleBpmnModdle(moddleOptions);
23669
24281
  };
@@ -23705,7 +24317,7 @@
23705
24317
  * Ensure the passed argument is a proper unit (defaulting to px)
23706
24318
  */
23707
24319
  function ensureUnit(val) {
23708
- return val + (isNumber(val) ? 'px' : '');
24320
+ return val + (isNumber$1(val) ? 'px' : '');
23709
24321
  }
23710
24322
 
23711
24323
 
@@ -23722,7 +24334,7 @@
23722
24334
  return null;
23723
24335
  }
23724
24336
 
23725
- return find(definitions.diagrams, function(element) {
24337
+ return find$2(definitions.diagrams, function(element) {
23726
24338
  return element.id === diagramId;
23727
24339
  }) || null;
23728
24340
  }
@@ -23749,8 +24361,8 @@
23749
24361
 
23750
24362
  const linkElement = domify$1$1(linkMarkup);
23751
24363
 
23752
- assign$1(query$1('svg', linkElement), LOGO_STYLES);
23753
- assign$1(linkElement, LINK_STYLES, {
24364
+ assign$4(query$1('svg', linkElement), LOGO_STYLES);
24365
+ assign$4(linkElement, LINK_STYLES, {
23754
24366
  position: 'absolute',
23755
24367
  bottom: '15px',
23756
24368
  right: '15px',
@@ -23835,6 +24447,16 @@
23835
24447
  // default moddle extensions the viewer is composed of
23836
24448
  Viewer.prototype._moddleExtensions = {};
23837
24449
 
24450
+ /**
24451
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
24452
+ * under one or more contributor license agreements. See the NOTICE file
24453
+ * distributed with this work for additional information regarding copyright
24454
+ * ownership.
24455
+ *
24456
+ * Camunda licenses this file to you under the MIT; you may not use this file
24457
+ * except in compliance with the MIT License.
24458
+ */
24459
+
23838
24460
  return Viewer;
23839
24461
 
23840
24462
  }));