bpmn-js 10.0.0 → 10.2.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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-navigated-viewer v10.0.0
2
+ * bpmn-js - bpmn-navigated-viewer v10.2.0
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2022-09-20
11
+ * Date: 2022-10-02
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -26,30 +26,45 @@
26
26
  * @return {Array<?>}
27
27
  */
28
28
 
29
- var nativeToString$1 = Object.prototype.toString;
30
- var nativeHasOwnProperty$1 = Object.prototype.hasOwnProperty;
29
+ const nativeToString$1 = Object.prototype.toString;
30
+ const nativeHasOwnProperty$1 = Object.prototype.hasOwnProperty;
31
+
31
32
  function isUndefined$2(obj) {
32
33
  return obj === undefined;
33
34
  }
35
+
34
36
  function isDefined(obj) {
35
37
  return obj !== undefined;
36
38
  }
39
+
37
40
  function isArray$2(obj) {
38
41
  return nativeToString$1.call(obj) === '[object Array]';
39
42
  }
43
+
40
44
  function isObject(obj) {
41
45
  return nativeToString$1.call(obj) === '[object Object]';
42
46
  }
47
+
43
48
  function isNumber(obj) {
44
49
  return nativeToString$1.call(obj) === '[object Number]';
45
50
  }
51
+
46
52
  function isFunction(obj) {
47
- var tag = nativeToString$1.call(obj);
48
- return tag === '[object Function]' || tag === '[object AsyncFunction]' || tag === '[object GeneratorFunction]' || tag === '[object AsyncGeneratorFunction]' || tag === '[object Proxy]';
53
+ const tag = nativeToString$1.call(obj);
54
+
55
+ return (
56
+ tag === '[object Function]' ||
57
+ tag === '[object AsyncFunction]' ||
58
+ tag === '[object GeneratorFunction]' ||
59
+ tag === '[object AsyncGeneratorFunction]' ||
60
+ tag === '[object Proxy]'
61
+ );
49
62
  }
63
+
50
64
  function isString(obj) {
51
65
  return nativeToString$1.call(obj) === '[object String]';
52
66
  }
67
+
53
68
  /**
54
69
  * Return true, if target owns a property with the given key.
55
70
  *
@@ -58,7 +73,6 @@
58
73
  *
59
74
  * @return {Boolean}
60
75
  */
61
-
62
76
  function has$1(target, key) {
63
77
  return nativeHasOwnProperty$1.call(target, key);
64
78
  }
@@ -71,18 +85,25 @@
71
85
  *
72
86
  * @return {Object}
73
87
  */
74
-
75
88
  function find(collection, matcher) {
89
+
76
90
  matcher = toMatcher(matcher);
77
- var match;
78
- forEach$1(collection, function (val, key) {
91
+
92
+ let match;
93
+
94
+ forEach$1(collection, function(val, key) {
79
95
  if (matcher(val, key)) {
80
96
  match = val;
97
+
81
98
  return false;
82
99
  }
83
100
  });
101
+
84
102
  return match;
103
+
85
104
  }
105
+
106
+
86
107
  /**
87
108
  * Find element index in collection.
88
109
  *
@@ -91,18 +112,24 @@
91
112
  *
92
113
  * @return {Object}
93
114
  */
94
-
95
115
  function findIndex(collection, matcher) {
116
+
96
117
  matcher = toMatcher(matcher);
97
- var idx = isArray$2(collection) ? -1 : undefined;
98
- forEach$1(collection, function (val, key) {
118
+
119
+ let idx = isArray$2(collection) ? -1 : undefined;
120
+
121
+ forEach$1(collection, function(val, key) {
99
122
  if (matcher(val, key)) {
100
123
  idx = key;
124
+
101
125
  return false;
102
126
  }
103
127
  });
128
+
104
129
  return idx;
105
130
  }
131
+
132
+
106
133
  /**
107
134
  * Find element in collection.
108
135
  *
@@ -111,16 +138,20 @@
111
138
  *
112
139
  * @return {Array} result
113
140
  */
114
-
115
141
  function filter(collection, matcher) {
116
- var result = [];
117
- forEach$1(collection, function (val, key) {
142
+
143
+ let result = [];
144
+
145
+ forEach$1(collection, function(val, key) {
118
146
  if (matcher(val, key)) {
119
147
  result.push(val);
120
148
  }
121
149
  });
150
+
122
151
  return result;
123
152
  }
153
+
154
+
124
155
  /**
125
156
  * Iterate over collection; returning something
126
157
  * (non-undefined) will stop iteration.
@@ -130,19 +161,22 @@
130
161
  *
131
162
  * @return {Object} return result that stopped the iteration
132
163
  */
133
-
134
164
  function forEach$1(collection, iterator) {
135
- var val, result;
165
+
166
+ let val,
167
+ result;
136
168
 
137
169
  if (isUndefined$2(collection)) {
138
170
  return;
139
171
  }
140
172
 
141
- var convertKey = isArray$2(collection) ? toNum$1 : identity$1;
173
+ const convertKey = isArray$2(collection) ? toNum$1 : identity$1;
174
+
175
+ for (let key in collection) {
142
176
 
143
- for (var key in collection) {
144
177
  if (has$1(collection, key)) {
145
178
  val = collection[key];
179
+
146
180
  result = iterator(val, convertKey(key));
147
181
 
148
182
  if (result === false) {
@@ -151,6 +185,8 @@
151
185
  }
152
186
  }
153
187
  }
188
+
189
+
154
190
  /**
155
191
  * Reduce collection, returning a single result.
156
192
  *
@@ -160,13 +196,16 @@
160
196
  *
161
197
  * @return {Any} result returned from last iterator
162
198
  */
163
-
164
199
  function reduce(collection, iterator, result) {
165
- forEach$1(collection, function (value, idx) {
200
+
201
+ forEach$1(collection, function(value, idx) {
166
202
  result = iterator(result, value, idx);
167
203
  });
204
+
168
205
  return result;
169
206
  }
207
+
208
+
170
209
  /**
171
210
  * Return true if every element in the collection
172
211
  * matches the criteria.
@@ -176,12 +215,14 @@
176
215
  *
177
216
  * @return {Boolean}
178
217
  */
179
-
180
218
  function every(collection, matcher) {
181
- return !!reduce(collection, function (matches, val, key) {
219
+
220
+ return !!reduce(collection, function(matches, val, key) {
182
221
  return matches && matcher(val, key);
183
222
  }, true);
184
223
  }
224
+
225
+
185
226
  /**
186
227
  * Return true if some elements in the collection
187
228
  * match the criteria.
@@ -191,10 +232,12 @@
191
232
  *
192
233
  * @return {Boolean}
193
234
  */
194
-
195
235
  function some(collection, matcher) {
236
+
196
237
  return !!find(collection, matcher);
197
238
  }
239
+
240
+
198
241
  /**
199
242
  * Transform a collection into another collection
200
243
  * by piping each member through the given fn.
@@ -204,14 +247,18 @@
204
247
  *
205
248
  * @return {Array} transformed collection
206
249
  */
250
+ function map$1(collection, fn) {
207
251
 
208
- function map(collection, fn) {
209
- var result = [];
210
- forEach$1(collection, function (val, key) {
252
+ let result = [];
253
+
254
+ forEach$1(collection, function(val, key) {
211
255
  result.push(fn(val, key));
212
256
  });
257
+
213
258
  return result;
214
259
  }
260
+
261
+
215
262
  /**
216
263
  * Create an object pattern matcher.
217
264
  *
@@ -225,21 +272,25 @@
225
272
  *
226
273
  * @return {Function} matcherFn
227
274
  */
228
-
229
275
  function matchPattern(pattern) {
230
- return function (el) {
231
- return every(pattern, function (val, key) {
276
+
277
+ return function(el) {
278
+
279
+ return every(pattern, function(val, key) {
232
280
  return el[key] === val;
233
281
  });
282
+
234
283
  };
235
284
  }
236
285
 
286
+
237
287
  function toMatcher(matcher) {
238
- return isFunction(matcher) ? matcher : function (e) {
288
+ return isFunction(matcher) ? matcher : (e) => {
239
289
  return e === matcher;
240
290
  };
241
291
  }
242
292
 
293
+
243
294
  function identity$1(arg) {
244
295
  return arg;
245
296
  }
@@ -261,20 +312,26 @@
261
312
  * @return {Function} debounced function
262
313
  */
263
314
  function debounce(fn, timeout) {
264
- var timer;
265
- var lastArgs;
266
- var lastThis;
267
- var lastNow;
315
+
316
+ let timer;
317
+
318
+ let lastArgs;
319
+ let lastThis;
320
+
321
+ let lastNow;
268
322
 
269
323
  function fire(force) {
270
- var now = Date.now();
271
- var scheduledDiff = force ? 0 : lastNow + timeout - now;
324
+
325
+ let now = Date.now();
326
+
327
+ let scheduledDiff = force ? 0 : (lastNow + timeout) - now;
272
328
 
273
329
  if (scheduledDiff > 0) {
274
330
  return schedule(scheduledDiff);
275
331
  }
276
332
 
277
333
  fn.apply(lastThis, lastArgs);
334
+
278
335
  clear();
279
336
  }
280
337
 
@@ -298,16 +355,13 @@
298
355
  clear();
299
356
  }
300
357
 
301
- function callback() {
358
+ function callback(...args) {
302
359
  lastNow = Date.now();
303
360
 
304
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
305
- args[_key] = arguments[_key];
306
- }
307
-
308
361
  lastArgs = args;
309
- lastThis = this; // ensure an execution is scheduled
362
+ lastThis = this;
310
363
 
364
+ // ensure an execution is scheduled
311
365
  if (!timer) {
312
366
  schedule(timeout);
313
367
  }
@@ -315,8 +369,10 @@
315
369
 
316
370
  callback.flush = flush;
317
371
  callback.cancel = clear;
372
+
318
373
  return callback;
319
374
  }
375
+
320
376
  /**
321
377
  * Bind function against target <this>.
322
378
  *
@@ -325,29 +381,10 @@
325
381
  *
326
382
  * @return {Function} bound function
327
383
  */
328
-
329
- function bind(fn, target) {
384
+ function bind$2(fn, target) {
330
385
  return fn.bind(target);
331
386
  }
332
387
 
333
- function _extends() {
334
- _extends = Object.assign || function (target) {
335
- for (var i = 1; i < arguments.length; i++) {
336
- var source = arguments[i];
337
-
338
- for (var key in source) {
339
- if (Object.prototype.hasOwnProperty.call(source, key)) {
340
- target[key] = source[key];
341
- }
342
- }
343
- }
344
-
345
- return target;
346
- };
347
-
348
- return _extends.apply(this, arguments);
349
- }
350
-
351
388
  /**
352
389
  * Convenience wrapper for `Object.assign`.
353
390
  *
@@ -356,14 +393,10 @@
356
393
  *
357
394
  * @return {Object} the target
358
395
  */
359
-
360
- function assign(target) {
361
- for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
362
- others[_key - 1] = arguments[_key];
363
- }
364
-
365
- return _extends.apply(void 0, [target].concat(others));
396
+ function assign$1(target, ...others) {
397
+ return Object.assign(target, ...others);
366
398
  }
399
+
367
400
  /**
368
401
  * Pick given properties from the target object.
369
402
  *
@@ -372,17 +405,22 @@
372
405
  *
373
406
  * @return {Object} target
374
407
  */
375
-
376
408
  function pick(target, properties) {
377
- var result = {};
378
- var obj = Object(target);
379
- forEach$1(properties, function (prop) {
409
+
410
+ let result = {};
411
+
412
+ let obj = Object(target);
413
+
414
+ forEach$1(properties, function(prop) {
415
+
380
416
  if (prop in obj) {
381
417
  result[prop] = target[prop];
382
418
  }
383
419
  });
420
+
384
421
  return result;
385
422
  }
423
+
386
424
  /**
387
425
  * Pick all target properties, excluding the given ones.
388
426
  *
@@ -391,15 +429,19 @@
391
429
  *
392
430
  * @return {Object} target
393
431
  */
394
-
395
432
  function omit(target, properties) {
396
- var result = {};
397
- var obj = Object(target);
398
- forEach$1(obj, function (prop, key) {
433
+
434
+ let result = {};
435
+
436
+ let obj = Object(target);
437
+
438
+ forEach$1(obj, function(prop, key) {
439
+
399
440
  if (properties.indexOf(key) === -1) {
400
441
  result[key] = prop;
401
442
  }
402
443
  });
444
+
403
445
  return result;
404
446
  }
405
447
 
@@ -620,9 +662,11 @@
620
662
 
621
663
  if (element.ownerDocument !== target.ownerDocument) {
622
664
  try {
665
+
623
666
  // may fail on webkit
624
667
  return target.ownerDocument.importNode(element, true);
625
668
  } catch (e) {
669
+
626
670
  // ignore
627
671
  }
628
672
  }
@@ -748,6 +792,7 @@
748
792
  var type = CSS_PROPERTIES[hyphenated];
749
793
 
750
794
  if (type) {
795
+
751
796
  // append pixel unit, unless present
752
797
  if (type === LENGTH_ATTR && typeof value === 'number') {
753
798
  value = String(value) + 'px';
@@ -793,38 +838,24 @@
793
838
  }
794
839
 
795
840
  /**
796
- * Clear utility
841
+ * Taken from https://github.com/component/classes
842
+ *
843
+ * Without the component bits.
797
844
  */
798
- function index(arr, obj) {
799
- if (arr.indexOf) {
800
- return arr.indexOf(obj);
801
- }
802
-
803
845
 
804
- for (var i = 0; i < arr.length; ++i) {
805
- if (arr[i] === obj) {
806
- return i;
807
- }
808
- }
809
-
810
- return -1;
811
- }
812
-
813
- var re$1 = /\s+/;
814
-
815
- var toString$1 = Object.prototype.toString;
846
+ /**
847
+ * toString reference.
848
+ */
816
849
 
817
- function defined(o) {
818
- return typeof o !== 'undefined';
819
- }
850
+ const toString$1 = Object.prototype.toString;
820
851
 
821
852
  /**
822
- * Wrap `el` in a `ClassList`.
823
- *
824
- * @param {Element} el
825
- * @return {ClassList}
826
- * @api public
827
- */
853
+ * Wrap `el` in a `ClassList`.
854
+ *
855
+ * @param {Element} el
856
+ * @return {ClassList}
857
+ * @api public
858
+ */
828
859
 
829
860
  function classes$1(el) {
830
861
  return new ClassList$1(el);
@@ -839,79 +870,48 @@
839
870
  }
840
871
 
841
872
  /**
842
- * Add class `name` if not already present.
843
- *
844
- * @param {String} name
845
- * @return {ClassList}
846
- * @api public
847
- */
873
+ * Add class `name` if not already present.
874
+ *
875
+ * @param {String} name
876
+ * @return {ClassList}
877
+ * @api public
878
+ */
848
879
 
849
880
  ClassList$1.prototype.add = function(name) {
850
-
851
- // classList
852
- if (this.list) {
853
- this.list.add(name);
854
- return this;
855
- }
856
-
857
- // fallback
858
- var arr = this.array();
859
- var i = index(arr, name);
860
- if (!~i) {
861
- arr.push(name);
862
- }
863
-
864
- if (defined(this.el.className.baseVal)) {
865
- this.el.className.baseVal = arr.join(' ');
866
- } else {
867
- this.el.className = arr.join(' ');
868
- }
869
-
881
+ this.list.add(name);
870
882
  return this;
871
883
  };
872
884
 
873
885
  /**
874
- * Remove class `name` when present, or
875
- * pass a regular expression to remove
876
- * any which match.
877
- *
878
- * @param {String|RegExp} name
879
- * @return {ClassList}
880
- * @api public
881
- */
886
+ * Remove class `name` when present, or
887
+ * pass a regular expression to remove
888
+ * any which match.
889
+ *
890
+ * @param {String|RegExp} name
891
+ * @return {ClassList}
892
+ * @api public
893
+ */
882
894
 
883
895
  ClassList$1.prototype.remove = function(name) {
884
- if ('[object RegExp]' === toString$1.call(name)) {
896
+ if ('[object RegExp]' == toString$1.call(name)) {
885
897
  return this.removeMatching(name);
886
898
  }
887
899
 
888
- // classList
889
- if (this.list) {
890
- this.list.remove(name);
891
- return this;
892
- }
893
-
894
- // fallback
895
- var arr = this.array();
896
- var i = index(arr, name);
897
- if (~i) {
898
- arr.splice(i, 1);
899
- }
900
- this.el.className.baseVal = arr.join(' ');
900
+ this.list.remove(name);
901
901
  return this;
902
902
  };
903
903
 
904
904
  /**
905
- * Remove all classes matching `re`.
906
- *
907
- * @param {RegExp} re
908
- * @return {ClassList}
909
- * @api private
910
- */
905
+ * Remove all classes matching `re`.
906
+ *
907
+ * @param {RegExp} re
908
+ * @return {ClassList}
909
+ * @api private
910
+ */
911
911
 
912
912
  ClassList$1.prototype.removeMatching = function(re) {
913
- var arr = this.array();
914
- for (var i = 0; i < arr.length; i++) {
913
+ const arr = this.array();
914
+ for (let i = 0; i < arr.length; i++) {
915
915
  if (re.test(arr[i])) {
916
916
  this.remove(arr[i]);
917
917
  }
@@ -920,81 +920,51 @@
920
920
  };
921
921
 
922
922
  /**
923
- * Toggle class `name`, can force state via `force`.
924
- *
925
- * For browsers that support classList, but do not support `force` yet,
926
- * the mistake will be detected and corrected.
927
- *
928
- * @param {String} name
929
- * @param {Boolean} force
930
- * @return {ClassList}
931
- * @api public
932
- */
923
+ * Toggle class `name`, can force state via `force`.
924
+ *
925
+ * For browsers that support classList, but do not support `force` yet,
926
+ * the mistake will be detected and corrected.
927
+ *
928
+ * @param {String} name
929
+ * @param {Boolean} force
930
+ * @return {ClassList}
931
+ * @api public
932
+ */
933
933
 
934
934
  ClassList$1.prototype.toggle = function(name, force) {
935
- // classList
936
- if (this.list) {
937
- if (defined(force)) {
938
- if (force !== this.list.toggle(name, force)) {
939
- this.list.toggle(name); // toggle again to correct
940
- }
941
- } else {
942
- this.list.toggle(name);
943
- }
944
- return this;
945
- }
946
-
947
- // fallback
948
- if (defined(force)) {
949
- if (!force) {
950
- this.remove(name);
951
- } else {
952
- this.add(name);
935
+ if ('undefined' !== typeof force) {
936
+ if (force !== this.list.toggle(name, force)) {
937
+ this.list.toggle(name); // toggle again to correct
953
938
  }
954
939
  } else {
955
- if (this.has(name)) {
956
- this.remove(name);
957
- } else {
958
- this.add(name);
959
- }
940
+ this.list.toggle(name);
960
941
  }
961
-
962
942
  return this;
963
943
  };
964
944
 
965
945
  /**
966
- * Return an array of classes.
967
- *
968
- * @return {Array}
969
- * @api public
970
- */
946
+ * Return an array of classes.
947
+ *
948
+ * @return {Array}
949
+ * @api public
950
+ */
971
951
 
972
952
  ClassList$1.prototype.array = function() {
973
- var className = this.el.getAttribute('class') || '';
974
- var str = className.replace(/^\s+|\s+$/g, '');
975
- var arr = str.split(re$1);
976
- if ('' === arr[0]) {
977
- arr.shift();
978
- }
979
- return arr;
953
+ return Array.from(this.list);
980
954
  };
981
955
 
982
956
  /**
983
- * Check if class `name` is present.
984
- *
985
- * @param {String} name
986
- * @return {ClassList}
987
- * @api public
988
- */
957
+ * Check if class `name` is present.
958
+ *
959
+ * @param {String} name
960
+ * @return {ClassList}
961
+ * @api public
962
+ */
989
963
 
990
964
  ClassList$1.prototype.has =
991
- ClassList$1.prototype.contains = function(name) {
992
- return (
993
- this.list ?
994
- this.list.contains(name) :
995
- !! ~index(this.array(), name)
996
- );
997
- };
965
+ ClassList$1.prototype.contains = function(name) {
966
+ return this.list.contains(name);
967
+ };
998
968
 
999
969
  function remove$2(element) {
1000
970
  var parent = element.parentNode;
@@ -1046,6 +1016,7 @@
1046
1016
  svg = SVG_START + svg.substring(4);
1047
1017
  }
1048
1018
  } else {
1019
+
1049
1020
  // namespace svg
1050
1021
  svg = SVG_START + '>' + svg + '</svg>';
1051
1022
  unwrap = true;
@@ -1201,8 +1172,10 @@
1201
1172
  var i, len, attrMap, attrNode, childNodes;
1202
1173
 
1203
1174
  switch (node.nodeType) {
1175
+
1204
1176
  // TEXT
1205
1177
  case 3:
1178
+
1206
1179
  // replace special XML characters
1207
1180
  output.push(escape$1(node.textContent, TEXT_ENTITIES));
1208
1181
  break;
@@ -1266,6 +1239,7 @@
1266
1239
  }
1267
1240
 
1268
1241
  if (!isFragment(parsed)) {
1242
+
1269
1243
  // extract <svg> from parsed document
1270
1244
  parsed = parsed.documentElement;
1271
1245
  }
@@ -1536,6 +1510,21 @@
1536
1510
  return componentsToPath(rectPath);
1537
1511
  }
1538
1512
 
1513
+ function _mergeNamespaces$1(n, m) {
1514
+ m.forEach(function (e) {
1515
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
1516
+ if (k !== 'default' && !(k in n)) {
1517
+ var d = Object.getOwnPropertyDescriptor(e, k);
1518
+ Object.defineProperty(n, k, d.get ? d : {
1519
+ enumerable: true,
1520
+ get: function () { return e[k]; }
1521
+ });
1522
+ }
1523
+ });
1524
+ });
1525
+ return Object.freeze(n);
1526
+ }
1527
+
1539
1528
  /**
1540
1529
  * Flatten array, one level deep.
1541
1530
  *
@@ -1611,19 +1600,15 @@
1611
1600
  *
1612
1601
  * @return {Element} the element
1613
1602
  */
1614
- function assign$1(element) {
1615
- var target = element.style;
1616
-
1617
- for (var _len = arguments.length, styleSources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1618
- styleSources[_key - 1] = arguments[_key];
1619
- }
1603
+ function assign(element, ...styleSources) {
1604
+ const target = element.style;
1620
1605
 
1621
- forEach(styleSources, function (style) {
1606
+ forEach(styleSources, function(style) {
1622
1607
  if (!style) {
1623
1608
  return;
1624
1609
  }
1625
1610
 
1626
- forEach(style, function (value, key) {
1611
+ forEach(style, function(value, key) {
1627
1612
  target[key] = value;
1628
1613
  });
1629
1614
  });
@@ -1640,6 +1625,7 @@
1640
1625
  * @api public
1641
1626
  */
1642
1627
  function attr(el, name, val) {
1628
+
1643
1629
  // get
1644
1630
  if (arguments.length == 2) {
1645
1631
  return el.getAttribute(name);
@@ -1656,33 +1642,17 @@
1656
1642
  return el;
1657
1643
  }
1658
1644
 
1659
- var indexOf = [].indexOf;
1660
-
1661
- var indexof = function(arr, obj){
1662
- if (indexOf) return arr.indexOf(obj);
1663
- for (var i = 0; i < arr.length; ++i) {
1664
- if (arr[i] === obj) return i;
1665
- }
1666
- return -1;
1667
- };
1668
-
1669
1645
  /**
1670
1646
  * Taken from https://github.com/component/classes
1671
1647
  *
1672
1648
  * Without the component bits.
1673
1649
  */
1674
1650
 
1675
- /**
1676
- * Whitespace regexp.
1677
- */
1678
-
1679
- var re = /\s+/;
1680
-
1681
1651
  /**
1682
1652
  * toString reference.
1683
1653
  */
1684
1654
 
1685
- var toString = Object.prototype.toString;
1655
+ const toString = Object.prototype.toString;
1686
1656
 
1687
1657
  /**
1688
1658
  * Wrap `el` in a `ClassList`.
@@ -1719,18 +1689,8 @@
1719
1689
  * @api public
1720
1690
  */
1721
1691
 
1722
- ClassList.prototype.add = function (name) {
1723
- // classList
1724
- if (this.list) {
1725
- this.list.add(name);
1726
- return this;
1727
- }
1728
-
1729
- // fallback
1730
- var arr = this.array();
1731
- var i = indexof(arr, name);
1732
- if (!~i) arr.push(name);
1733
- this.el.className = arr.join(' ');
1692
+ ClassList.prototype.add = function(name) {
1693
+ this.list.add(name);
1734
1694
  return this;
1735
1695
  };
1736
1696
 
@@ -1744,22 +1704,12 @@
1744
1704
  * @api public
1745
1705
  */
1746
1706
 
1747
- ClassList.prototype.remove = function (name) {
1707
+ ClassList.prototype.remove = function(name) {
1748
1708
  if ('[object RegExp]' == toString.call(name)) {
1749
1709
  return this.removeMatching(name);
1750
1710
  }
1751
1711
 
1752
- // classList
1753
- if (this.list) {
1754
- this.list.remove(name);
1755
- return this;
1756
- }
1757
-
1758
- // fallback
1759
- var arr = this.array();
1760
- var i = indexof(arr, name);
1761
- if (~i) arr.splice(i, 1);
1762
- this.el.className = arr.join(' ');
1712
+ this.list.remove(name);
1763
1713
  return this;
1764
1714
  };
1765
1715
 
@@ -1771,9 +1721,9 @@
1771
1721
  * @api private
1772
1722
  */
1773
1723
 
1774
- ClassList.prototype.removeMatching = function (re) {
1775
- var arr = this.array();
1776
- for (var i = 0; i < arr.length; i++) {
1724
+ ClassList.prototype.removeMatching = function(re) {
1725
+ const arr = this.array();
1726
+ for (let i = 0; i < arr.length; i++) {
1777
1727
  if (re.test(arr[i])) {
1778
1728
  this.remove(arr[i]);
1779
1729
  }
@@ -1793,34 +1743,14 @@
1793
1743
  * @api public
1794
1744
  */
1795
1745
 
1796
- ClassList.prototype.toggle = function (name, force) {
1797
- // classList
1798
- if (this.list) {
1799
- if ('undefined' !== typeof force) {
1800
- if (force !== this.list.toggle(name, force)) {
1801
- this.list.toggle(name); // toggle again to correct
1802
- }
1803
- } else {
1804
- this.list.toggle(name);
1805
- }
1806
- return this;
1807
- }
1808
-
1809
- // fallback
1746
+ ClassList.prototype.toggle = function(name, force) {
1810
1747
  if ('undefined' !== typeof force) {
1811
- if (!force) {
1812
- this.remove(name);
1813
- } else {
1814
- this.add(name);
1748
+ if (force !== this.list.toggle(name, force)) {
1749
+ this.list.toggle(name); // toggle again to correct
1815
1750
  }
1816
1751
  } else {
1817
- if (this.has(name)) {
1818
- this.remove(name);
1819
- } else {
1820
- this.add(name);
1821
- }
1752
+ this.list.toggle(name);
1822
1753
  }
1823
-
1824
1754
  return this;
1825
1755
  };
1826
1756
 
@@ -1831,12 +1761,8 @@
1831
1761
  * @api public
1832
1762
  */
1833
1763
 
1834
- ClassList.prototype.array = function () {
1835
- var className = this.el.getAttribute('class') || '';
1836
- var str = className.replace(/^\s+|\s+$/g, '');
1837
- var arr = str.split(re);
1838
- if ('' === arr[0]) arr.shift();
1839
- return arr;
1764
+ ClassList.prototype.array = function() {
1765
+ return Array.from(this.list);
1840
1766
  };
1841
1767
 
1842
1768
  /**
@@ -1847,8 +1773,9 @@
1847
1773
  * @api public
1848
1774
  */
1849
1775
 
1850
- ClassList.prototype.has = ClassList.prototype.contains = function (name) {
1851
- return this.list ? this.list.contains(name) : !!~indexof(this.array(), name);
1776
+ ClassList.prototype.has =
1777
+ ClassList.prototype.contains = function(name) {
1778
+ return this.list.contains(name);
1852
1779
  };
1853
1780
 
1854
1781
  /**
@@ -1866,33 +1793,14 @@
1866
1793
  return el;
1867
1794
  }
1868
1795
 
1869
- var proto = typeof Element !== 'undefined' ? Element.prototype : {};
1870
- var vendor = proto.matches
1871
- || proto.matchesSelector
1872
- || proto.webkitMatchesSelector
1873
- || proto.mozMatchesSelector
1874
- || proto.msMatchesSelector
1875
- || proto.oMatchesSelector;
1876
-
1877
- var matchesSelector = match;
1878
-
1879
1796
  /**
1880
- * Match `el` to `selector`.
1797
+ * @param { HTMLElement } element
1798
+ * @param { String } selector
1881
1799
  *
1882
- * @param {Element} el
1883
- * @param {String} selector
1884
- * @return {Boolean}
1885
- * @api public
1800
+ * @return { boolean }
1886
1801
  */
1887
-
1888
- function match(el, selector) {
1889
- if (!el || el.nodeType !== 1) return false;
1890
- if (vendor) return vendor.call(el, selector);
1891
- var nodes = el.parentNode.querySelectorAll(selector);
1892
- for (var i = 0; i < nodes.length; i++) {
1893
- if (nodes[i] == el) return true;
1894
- }
1895
- return false;
1802
+ function matches(element, selector) {
1803
+ return element && typeof element.matches === 'function' && element.matches(selector);
1896
1804
  }
1897
1805
 
1898
1806
  /**
@@ -1902,23 +1810,26 @@
1902
1810
  * @param {String} selector
1903
1811
  * @param {Boolean} checkYourSelf (optional)
1904
1812
  */
1905
- function closest (element, selector, checkYourSelf) {
1813
+ function closest(element, selector, checkYourSelf) {
1906
1814
  var currentElem = checkYourSelf ? element : element.parentNode;
1907
1815
 
1908
- while (currentElem && currentElem.nodeType !== document.DOCUMENT_NODE && currentElem.nodeType !== document.DOCUMENT_FRAGMENT_NODE) {
1816
+ while (currentElem && currentElem.nodeType !== document.DOCUMENT_NODE &&
1817
+ currentElem.nodeType !== document.DOCUMENT_FRAGMENT_NODE) {
1909
1818
 
1910
- if (matchesSelector(currentElem, selector)) {
1819
+ if (matches(currentElem, selector)) {
1911
1820
  return currentElem;
1912
1821
  }
1913
1822
 
1914
1823
  currentElem = currentElem.parentNode;
1915
1824
  }
1916
1825
 
1917
- return matchesSelector(currentElem, selector) ? currentElem : null;
1826
+ return matches(currentElem, selector) ? currentElem : null;
1918
1827
  }
1919
1828
 
1829
+ var componentEvent = {};
1830
+
1920
1831
  var bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent',
1921
- unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
1832
+ unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
1922
1833
  prefix$6 = bind$1 !== 'addEventListener' ? 'on' : '';
1923
1834
 
1924
1835
  /**
@@ -1932,7 +1843,7 @@
1932
1843
  * @api public
1933
1844
  */
1934
1845
 
1935
- var bind_1 = function(el, type, fn, capture){
1846
+ var bind_1 = componentEvent.bind = function(el, type, fn, capture){
1936
1847
  el[bind$1](prefix$6 + type, fn, capture || false);
1937
1848
  return fn;
1938
1849
  };
@@ -1948,15 +1859,17 @@
1948
1859
  * @api public
1949
1860
  */
1950
1861
 
1951
- var unbind_1 = function(el, type, fn, capture){
1952
- el[unbind](prefix$6 + type, fn, capture || false);
1862
+ var unbind_1 = componentEvent.unbind = function(el, type, fn, capture){
1863
+ el[unbind$1](prefix$6 + type, fn, capture || false);
1953
1864
  return fn;
1954
1865
  };
1955
1866
 
1956
- var componentEvent = {
1957
- bind: bind_1,
1958
- unbind: unbind_1
1959
- };
1867
+ var event = /*#__PURE__*/_mergeNamespaces$1({
1868
+ __proto__: null,
1869
+ bind: bind_1,
1870
+ unbind: unbind_1,
1871
+ 'default': componentEvent
1872
+ }, [componentEvent]);
1960
1873
 
1961
1874
  /**
1962
1875
  * Module dependencies.
@@ -1978,14 +1891,14 @@
1978
1891
 
1979
1892
  // Some events don't bubble, so we want to bind to the capture phase instead
1980
1893
  // when delegating.
1981
- var forceCaptureEvents = ['focus', 'blur'];
1894
+ var forceCaptureEvents = [ 'focus', 'blur' ];
1982
1895
 
1983
- function bind$2(el, selector, type, fn, capture) {
1896
+ function bind(el, selector, type, fn, capture) {
1984
1897
  if (forceCaptureEvents.indexOf(type) !== -1) {
1985
1898
  capture = true;
1986
1899
  }
1987
1900
 
1988
- return componentEvent.bind(el, type, function (e) {
1901
+ return event.bind(el, type, function(e) {
1989
1902
  var target = e.target || e.srcElement;
1990
1903
  e.delegateTarget = closest(target, selector, true);
1991
1904
  if (e.delegateTarget) {
@@ -2003,17 +1916,17 @@
2003
1916
  * @param {Boolean} capture
2004
1917
  * @api public
2005
1918
  */
2006
- function unbind$1(el, type, fn, capture) {
1919
+ function unbind(el, type, fn, capture) {
2007
1920
  if (forceCaptureEvents.indexOf(type) !== -1) {
2008
1921
  capture = true;
2009
1922
  }
2010
1923
 
2011
- return componentEvent.unbind(el, type, fn, capture);
1924
+ return event.unbind(el, type, fn, capture);
2012
1925
  }
2013
1926
 
2014
1927
  var delegate = {
2015
- bind: bind$2,
2016
- unbind: unbind$1
1928
+ bind,
1929
+ unbind
2017
1930
  };
2018
1931
 
2019
1932
  /**
@@ -2042,7 +1955,7 @@
2042
1955
  * Wrap map from jquery.
2043
1956
  */
2044
1957
 
2045
- var map$1 = {
1958
+ var map = {
2046
1959
  legend: [1, '<fieldset>', '</fieldset>'],
2047
1960
  tr: [2, '<table><tbody>', '</tbody></table>'],
2048
1961
  col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
@@ -2051,27 +1964,27 @@
2051
1964
  _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
2052
1965
  };
2053
1966
 
2054
- map$1.td =
2055
- map$1.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
1967
+ map.td =
1968
+ map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
2056
1969
 
2057
- map$1.option =
2058
- map$1.optgroup = [1, '<select multiple="multiple">', '</select>'];
1970
+ map.option =
1971
+ map.optgroup = [1, '<select multiple="multiple">', '</select>'];
2059
1972
 
2060
- map$1.thead =
2061
- map$1.tbody =
2062
- map$1.colgroup =
2063
- map$1.caption =
2064
- map$1.tfoot = [1, '<table>', '</table>'];
1973
+ map.thead =
1974
+ map.tbody =
1975
+ map.colgroup =
1976
+ map.caption =
1977
+ map.tfoot = [1, '<table>', '</table>'];
2065
1978
 
2066
- map$1.polyline =
2067
- map$1.ellipse =
2068
- map$1.polygon =
2069
- map$1.circle =
2070
- map$1.text =
2071
- map$1.line =
2072
- map$1.path =
2073
- map$1.rect =
2074
- map$1.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
1979
+ map.polyline =
1980
+ map.ellipse =
1981
+ map.polygon =
1982
+ map.circle =
1983
+ map.text =
1984
+ map.line =
1985
+ map.path =
1986
+ map.rect =
1987
+ map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
2075
1988
 
2076
1989
  /**
2077
1990
  * Parse `html` and return a DOM Node instance, which could be a TextNode,
@@ -2106,7 +2019,7 @@
2106
2019
  }
2107
2020
 
2108
2021
  // wrap map
2109
- var wrap = map$1[tag] || map$1._default;
2022
+ var wrap = Object.prototype.hasOwnProperty.call(map, tag) ? map[tag] : map._default;
2110
2023
  var depth = wrap[0];
2111
2024
  var prefix = wrap[1];
2112
2025
  var suffix = wrap[2];
@@ -2128,6 +2041,8 @@
2128
2041
  return fragment;
2129
2042
  }
2130
2043
 
2044
+ var domify$1 = domify;
2045
+
2131
2046
  function query(selector, el) {
2132
2047
  el = el || document;
2133
2048
 
@@ -2379,7 +2294,7 @@
2379
2294
  var computeStyle = styles.computeStyle;
2380
2295
 
2381
2296
  function addMarker(id, options) {
2382
- var attrs = assign({
2297
+ var attrs = assign$1({
2383
2298
  fill: black,
2384
2299
  strokeWidth: 1,
2385
2300
  strokeLinecap: 'round',
@@ -2674,7 +2589,7 @@
2674
2589
  }
2675
2590
 
2676
2591
  function drawMarker(type, parentGfx, path, attrs) {
2677
- return drawPath(parentGfx, path, assign({ 'data-marker': type }, attrs));
2592
+ return drawPath(parentGfx, path, assign$1({ 'data-marker': type }, attrs));
2678
2593
  }
2679
2594
 
2680
2595
  function renderer(type) {
@@ -2746,7 +2661,7 @@
2746
2661
 
2747
2662
  function renderLabel(parentGfx, label, options) {
2748
2663
 
2749
- options = assign({
2664
+ options = assign$1({
2750
2665
  size: {
2751
2666
  width: 100
2752
2667
  }
@@ -2786,7 +2701,7 @@
2786
2701
  return renderLabel(parentGfx, getLabel(element), {
2787
2702
  box: box,
2788
2703
  fitBox: true,
2789
- style: assign(
2704
+ style: assign$1(
2790
2705
  {},
2791
2706
  textRenderer.getExternalStyle(),
2792
2707
  {
@@ -3388,7 +3303,7 @@
3388
3303
  return task;
3389
3304
  },
3390
3305
  'bpmn:SubProcess': function(parentGfx, element, attrs) {
3391
- attrs = assign({
3306
+ attrs = assign$1({
3392
3307
  fill: getFillColor(element, defaultFillColor),
3393
3308
  stroke: getStrokeColor(element, defaultStrokeColor)
3394
3309
  }, attrs);
@@ -3474,7 +3389,7 @@
3474
3389
  return lane;
3475
3390
  },
3476
3391
  'bpmn:Lane': function(parentGfx, element, attrs) {
3477
- var rect = drawRect(parentGfx, element.width, element.height, 0, assign({
3392
+ var rect = drawRect(parentGfx, element.width, element.height, 0, assign$1({
3478
3393
  fill: getFillColor(element, defaultFillColor),
3479
3394
  fillOpacity: HIGH_FILL_OPACITY,
3480
3395
  stroke: getStrokeColor(element, defaultStrokeColor)
@@ -3696,7 +3611,7 @@
3696
3611
  var fill = getFillColor(element, defaultFillColor),
3697
3612
  stroke = getStrokeColor(element, defaultStrokeColor);
3698
3613
 
3699
- attrs = assign({
3614
+ attrs = assign$1({
3700
3615
  strokeDasharray: '0.5, 5',
3701
3616
  strokeLinecap: 'round',
3702
3617
  strokeLinejoin: 'round',
@@ -3884,12 +3799,12 @@
3884
3799
  }
3885
3800
 
3886
3801
  // apply fillOpacity
3887
- var outerAttrs = assign({}, attrs, {
3802
+ var outerAttrs = assign$1({}, attrs, {
3888
3803
  fillOpacity: 1
3889
3804
  });
3890
3805
 
3891
3806
  // apply no-fill
3892
- var innerAttrs = assign({}, attrs, {
3807
+ var innerAttrs = assign$1({}, attrs, {
3893
3808
  fill: 'none'
3894
3809
  });
3895
3810
 
@@ -4241,7 +4156,7 @@
4241
4156
  function parsePadding(padding) {
4242
4157
 
4243
4158
  if (isObject(padding)) {
4244
- return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
4159
+ return assign$1({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
4245
4160
  } else {
4246
4161
  return {
4247
4162
  top: padding,
@@ -4405,7 +4320,7 @@
4405
4320
  id: 'helper-svg'
4406
4321
  });
4407
4322
 
4408
- assign$1(helperSvg, {
4323
+ assign(helperSvg, {
4409
4324
  visibility: 'hidden',
4410
4325
  position: 'fixed',
4411
4326
  width: 0,
@@ -4430,7 +4345,7 @@
4430
4345
  */
4431
4346
  function Text(config) {
4432
4347
 
4433
- this._config = assign({}, {
4348
+ this._config = assign$1({}, {
4434
4349
  size: DEFAULT_LABEL_SIZE$1,
4435
4350
  padding: DEFAULT_BOX_PADDING,
4436
4351
  style: {},
@@ -4479,8 +4394,8 @@
4479
4394
  * @return {Object} { element, dimensions }
4480
4395
  */
4481
4396
  Text.prototype.layoutText = function(text, options) {
4482
- var box = assign({}, this._config.size, options.box),
4483
- style = assign({}, this._config.style, options.style),
4397
+ var box = assign$1({}, this._config.size, options.box),
4398
+ style = assign$1({}, this._config.style, options.style),
4484
4399
  align = parseAlign(options.align || this._config.align),
4485
4400
  padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding),
4486
4401
  fitBox = options.fitBox || false;
@@ -4595,7 +4510,7 @@
4595
4510
 
4596
4511
  function TextRenderer(config) {
4597
4512
 
4598
- var defaultStyle = assign({
4513
+ var defaultStyle = assign$1({
4599
4514
  fontFamily: 'Arial, sans-serif',
4600
4515
  fontSize: DEFAULT_FONT_SIZE,
4601
4516
  fontWeight: 'normal',
@@ -4604,7 +4519,7 @@
4604
4519
 
4605
4520
  var fontSize = parseInt(defaultStyle.fontSize, 10) - 1;
4606
4521
 
4607
- var externalStyle = assign({}, defaultStyle, {
4522
+ var externalStyle = assign$1({}, defaultStyle, {
4608
4523
  fontSize: fontSize
4609
4524
  }, config && config.externalStyle || {});
4610
4525
 
@@ -5340,7 +5255,7 @@
5340
5255
  size = DEFAULT_LABEL_SIZE;
5341
5256
  }
5342
5257
 
5343
- return assign({
5258
+ return assign$1({
5344
5259
  x: mid.x - size.width / 2,
5345
5260
  y: mid.y - size.height / 2
5346
5261
  }, size);
@@ -5510,7 +5425,7 @@
5510
5425
  * @return {Object}
5511
5426
  */
5512
5427
  function elementData(semantic, di, attrs) {
5513
- return assign({
5428
+ return assign$1({
5514
5429
  id: semantic.id,
5515
5430
  type: semantic.$type,
5516
5431
  businessObject: semantic,
@@ -6142,7 +6057,7 @@
6142
6057
 
6143
6058
  function createHitStyle(classNames, attrs) {
6144
6059
 
6145
- attrs = assign({
6060
+ attrs = assign$1({
6146
6061
  stroke: 'white',
6147
6062
  strokeWidth: 15
6148
6063
  }, attrs || {});
@@ -6240,7 +6155,7 @@
6240
6155
  */
6241
6156
  this.createBoxHit = function(gfx, type, attrs) {
6242
6157
 
6243
- attrs = assign({
6158
+ attrs = assign$1({
6244
6159
  x: 0,
6245
6160
  y: 0
6246
6161
  }, attrs);
@@ -6485,7 +6400,7 @@
6485
6400
  function createOutline(gfx, bounds) {
6486
6401
  var outline = create$1('rect');
6487
6402
 
6488
- attr$1(outline, assign({
6403
+ attr$1(outline, assign$1({
6489
6404
  x: 10,
6490
6405
  y: 10,
6491
6406
  rx: 3,
@@ -6778,7 +6693,7 @@
6778
6693
 
6779
6694
  var rect = create$1('rect');
6780
6695
 
6781
- attr$1(rect, assign({
6696
+ attr$1(rect, assign$1({
6782
6697
  rx: 3
6783
6698
  }, bBox));
6784
6699
 
@@ -7021,7 +6936,7 @@
7021
6936
 
7022
6937
  this._ids = ids;
7023
6938
 
7024
- this._overlayDefaults = assign({
6939
+ this._overlayDefaults = assign$1({
7025
6940
 
7026
6941
  // no show constraints
7027
6942
  show: null,
@@ -7158,7 +7073,7 @@
7158
7073
 
7159
7074
  var id = this._ids.next();
7160
7075
 
7161
- overlay = assign({}, this._overlayDefaults, overlay, {
7076
+ overlay = assign$1({}, this._overlayDefaults, overlay, {
7162
7077
  id: id,
7163
7078
  type: type,
7164
7079
  element: element,
@@ -7297,8 +7212,8 @@
7297
7212
 
7298
7213
 
7299
7214
  Overlays.prototype._createOverlayContainer = function(element) {
7300
- var html = domify('<div class="djs-overlays" />');
7301
- assign$1(html, { position: 'absolute' });
7215
+ var html = domify$1('<div class="djs-overlays" />');
7216
+ assign(html, { position: 'absolute' });
7302
7217
 
7303
7218
  this._overlayRoot.appendChild(html);
7304
7219
 
@@ -7364,13 +7279,13 @@
7364
7279
  // create proper html elements from
7365
7280
  // overlay HTML strings
7366
7281
  if (isString(html)) {
7367
- html = domify(html);
7282
+ html = domify$1(html);
7368
7283
  }
7369
7284
 
7370
7285
  overlayContainer = this._getOverlayContainer(element);
7371
7286
 
7372
- htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '">');
7373
- assign$1(htmlContainer, { position: 'absolute' });
7287
+ htmlContainer = domify$1('<div class="djs-overlay" data-overlay-id="' + id + '">');
7288
+ assign(htmlContainer, { position: 'absolute' });
7374
7289
 
7375
7290
  htmlContainer.appendChild(html);
7376
7291
 
@@ -7554,11 +7469,11 @@
7554
7469
  // helpers /////////////////////////////
7555
7470
 
7556
7471
  function createRoot(parentNode) {
7557
- var root = domify(
7472
+ var root = domify$1(
7558
7473
  '<div class="djs-overlay-container" />'
7559
7474
  );
7560
7475
 
7561
- assign$1(root, {
7476
+ assign(root, {
7562
7477
  position: 'absolute',
7563
7478
  width: 0,
7564
7479
  height: 0
@@ -7570,7 +7485,7 @@
7570
7485
  }
7571
7486
 
7572
7487
  function setPosition(el, x, y) {
7573
- assign$1(el, { left: x + 'px', top: y + 'px' });
7488
+ assign(el, { left: x + 'px', top: y + 'px' });
7574
7489
  }
7575
7490
 
7576
7491
  /**
@@ -7998,7 +7913,7 @@
7998
7913
  * @param {canvas} canvas
7999
7914
  */
8000
7915
  function DrilldownBreadcrumbs(eventBus, elementRegistry, overlays, canvas) {
8001
- var breadcrumbs = domify('<ul class="bjs-breadcrumbs"></ul>');
7916
+ var breadcrumbs = domify$1('<ul class="bjs-breadcrumbs"></ul>');
8002
7917
  var container = canvas.getContainer();
8003
7918
  var containerClasses = classes(container);
8004
7919
  container.appendChild(breadcrumbs);
@@ -8034,7 +7949,7 @@
8034
7949
 
8035
7950
  var path = boParents.map(function(parent) {
8036
7951
  var title = escapeHTML(parent.name || parent.id);
8037
- var link = domify('<li><span class="bjs-crumb"><a title="' + title + '">' + title + '</a></span></li>');
7952
+ var link = domify$1('<li><span class="bjs-crumb"><a title="' + title + '">' + title + '</a></span></li>');
8038
7953
 
8039
7954
  var parentPlane = canvas.findRoot(getPlaneIdFromShape(parent)) || canvas.findRoot(parent.id);
8040
7955
 
@@ -8574,7 +8489,7 @@
8574
8489
  this.removeOverlay(element);
8575
8490
  }
8576
8491
 
8577
- var button = domify('<button class="bjs-drilldown">' + ARROW_DOWN_SVG + '</button>');
8492
+ var button = domify$1('<button class="bjs-drilldown">' + ARROW_DOWN_SVG + '</button>');
8578
8493
 
8579
8494
  button.addEventListener('click', function() {
8580
8495
  canvas.setRootElement(canvas.findRoot(getPlaneIdFromShape(element)));
@@ -8616,7 +8531,7 @@
8616
8531
  subprocessCompatibility: [ 'type', SubprocessCompatibility ]
8617
8532
  };
8618
8533
 
8619
- var CLASS_PATTERN = /^class /;
8534
+ const CLASS_PATTERN = /^class[ {]/;
8620
8535
 
8621
8536
 
8622
8537
  /**
@@ -8634,7 +8549,7 @@
8634
8549
  * @return {boolean}
8635
8550
  */
8636
8551
  function isArray(obj) {
8637
- return Object.prototype.toString.call(obj) === '[object Array]';
8552
+ return Array.isArray(obj);
8638
8553
  }
8639
8554
 
8640
8555
  /**
@@ -8658,14 +8573,15 @@
8658
8573
  *
8659
8574
  * @return {T & InjectAnnotated}
8660
8575
  */
8661
- function annotate() {
8662
- var args = Array.prototype.slice.call(arguments);
8576
+ function annotate(...args) {
8663
8577
 
8664
8578
  if (args.length === 1 && isArray(args[0])) {
8665
8579
  args = args[0];
8666
8580
  }
8667
8581
 
8668
- var fn = args.pop();
8582
+ args = [ ...args ];
8583
+
8584
+ const fn = args.pop();
8669
8585
 
8670
8586
  fn.$inject = args;
8671
8587
 
@@ -8686,9 +8602,9 @@
8686
8602
  // first constructor(...) pattern found which may be the one
8687
8603
  // of a nested class, too.
8688
8604
 
8689
- var CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m;
8690
- var FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m;
8691
- var FN_ARG = /\/\*([^*]*)\*\//m;
8605
+ const CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m;
8606
+ const FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m;
8607
+ const FN_ARG = /\/\*([^*]*)\*\//m;
8692
8608
 
8693
8609
  /**
8694
8610
  * @param {unknown} fn
@@ -8698,20 +8614,20 @@
8698
8614
  function parseAnnotations(fn) {
8699
8615
 
8700
8616
  if (typeof fn !== 'function') {
8701
- throw new Error('Cannot annotate "' + fn + '". Expected a function!');
8617
+ throw new Error(`Cannot annotate "${fn}". Expected a function!`);
8702
8618
  }
8703
8619
 
8704
- var match = fn.toString().match(isClass(fn) ? CONSTRUCTOR_ARGS : FN_ARGS);
8620
+ const match = fn.toString().match(isClass(fn) ? CONSTRUCTOR_ARGS : FN_ARGS);
8705
8621
 
8706
8622
  // may parse class without constructor
8707
8623
  if (!match) {
8708
8624
  return [];
8709
8625
  }
8710
8626
 
8711
- var args = match[1] || match[2];
8627
+ const args = match[1] || match[2];
8712
8628
 
8713
- return args && args.split(',').map(function(arg) {
8714
- var argMatch = arg.match(FN_ARG);
8629
+ return args && args.split(',').map(arg => {
8630
+ const argMatch = arg.match(FN_ARG);
8715
8631
  return (argMatch && argMatch[1] || arg).trim();
8716
8632
  }) || [];
8717
8633
  }
@@ -8736,21 +8652,21 @@
8736
8652
  if (strict === false) {
8737
8653
  return null;
8738
8654
  } else {
8739
- throw error('No provider for "' + name + '"!');
8655
+ throw error(`No provider for "${ name }"!`);
8740
8656
  }
8741
8657
  }
8742
8658
  };
8743
8659
 
8744
- var currentlyResolving = [];
8745
- var providers = this._providers = Object.create(parent._providers || null);
8746
- var instances = this._instances = Object.create(null);
8660
+ const currentlyResolving = [];
8661
+ const providers = this._providers = Object.create(parent._providers || null);
8662
+ const instances = this._instances = Object.create(null);
8747
8663
 
8748
- var self = instances.injector = this;
8664
+ const self = instances.injector = this;
8749
8665
 
8750
- var error = function(msg) {
8751
- var stack = currentlyResolving.join(' -> ');
8666
+ const error = function(msg) {
8667
+ const stack = currentlyResolving.join(' -> ');
8752
8668
  currentlyResolving.length = 0;
8753
- return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
8669
+ return new Error(stack ? `${ msg } (Resolving: ${ stack })` : msg);
8754
8670
  };
8755
8671
 
8756
8672
  /**
@@ -8763,8 +8679,8 @@
8763
8679
  */
8764
8680
  function get(name, strict) {
8765
8681
  if (!providers[name] && name.indexOf('.') !== -1) {
8766
- var parts = name.split('.');
8767
- var pivot = get(parts.shift());
8682
+ const parts = name.split('.');
8683
+ let pivot = get(parts.shift());
8768
8684
 
8769
8685
  while (parts.length) {
8770
8686
  pivot = pivot[parts.shift()];
@@ -8803,12 +8719,12 @@
8803
8719
  if (isArray(fn)) {
8804
8720
  fn = annotate(fn.slice());
8805
8721
  } else {
8806
- throw new Error('Cannot invoke "' + fn + '". Expected a function!');
8722
+ throw error(`Cannot invoke "${ fn }". Expected a function!`);
8807
8723
  }
8808
8724
  }
8809
8725
 
8810
- var inject = fn.$inject || parseAnnotations(fn);
8811
- var dependencies = inject.map(function(dep) {
8726
+ const inject = fn.$inject || parseAnnotations(fn);
8727
+ const dependencies = inject.map(dep => {
8812
8728
  if (hasOwnProp(locals, dep)) {
8813
8729
  return locals[dep];
8814
8730
  } else {
@@ -8823,22 +8739,22 @@
8823
8739
  }
8824
8740
 
8825
8741
  function instantiate(Type) {
8826
- var def = fnDef(Type);
8827
-
8828
- var fn = def.fn,
8829
- dependencies = def.dependencies;
8742
+ const {
8743
+ fn,
8744
+ dependencies
8745
+ } = fnDef(Type);
8830
8746
 
8831
8747
  // instantiate var args constructor
8832
- var Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
8748
+ const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
8833
8749
 
8834
8750
  return new Constructor();
8835
8751
  }
8836
8752
 
8837
8753
  function invoke(func, context, locals) {
8838
- var def = fnDef(func, locals);
8839
-
8840
- var fn = def.fn,
8841
- dependencies = def.dependencies;
8754
+ const {
8755
+ fn,
8756
+ dependencies
8757
+ } = fnDef(func, locals);
8842
8758
 
8843
8759
  return fn.apply(context, dependencies);
8844
8760
  }
@@ -8849,9 +8765,7 @@
8849
8765
  * @return {Function}
8850
8766
  */
8851
8767
  function createPrivateInjectorFactory(childInjector) {
8852
- return annotate(function(key) {
8853
- return childInjector.get(key);
8854
- });
8768
+ return annotate(key => childInjector.get(key));
8855
8769
  }
8856
8770
 
8857
8771
  /**
@@ -8862,18 +8776,19 @@
8862
8776
  */
8863
8777
  function createChild(modules, forceNewInstances) {
8864
8778
  if (forceNewInstances && forceNewInstances.length) {
8865
- var fromParentModule = Object.create(null);
8866
- var matchedScopes = Object.create(null);
8867
-
8868
- var privateInjectorsCache = [];
8869
- var privateChildInjectors = [];
8870
- var privateChildFactories = [];
8871
-
8872
- var provider;
8873
- var cacheIdx;
8874
- var privateChildInjector;
8875
- var privateChildInjectorFactory;
8876
- for (var name in providers) {
8779
+ const fromParentModule = Object.create(null);
8780
+ const matchedScopes = Object.create(null);
8781
+
8782
+ const privateInjectorsCache = [];
8783
+ const privateChildInjectors = [];
8784
+ const privateChildFactories = [];
8785
+
8786
+ let provider;
8787
+ let cacheIdx;
8788
+ let privateChildInjector;
8789
+ let privateChildInjectorFactory;
8790
+
8791
+ for (let name in providers) {
8877
8792
  provider = providers[name];
8878
8793
 
8879
8794
  if (forceNewInstances.indexOf(name) !== -1) {
@@ -8897,7 +8812,7 @@
8897
8812
 
8898
8813
  if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
8899
8814
  /* jshint -W083 */
8900
- forceNewInstances.forEach(function(scope) {
8815
+ forceNewInstances.forEach(scope => {
8901
8816
  if (provider[1].$scope.indexOf(scope) !== -1) {
8902
8817
  fromParentModule[name] = [ provider[2], provider[1] ];
8903
8818
  matchedScopes[scope] = true;
@@ -8906,7 +8821,7 @@
8906
8821
  }
8907
8822
  }
8908
8823
 
8909
- forceNewInstances.forEach(function(scope) {
8824
+ forceNewInstances.forEach(scope => {
8910
8825
  if (!matchedScopes[scope]) {
8911
8826
  throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
8912
8827
  }
@@ -8918,7 +8833,7 @@
8918
8833
  return new Injector(modules, self);
8919
8834
  }
8920
8835
 
8921
- var factoryMap = {
8836
+ const factoryMap = {
8922
8837
  factory: invoke,
8923
8838
  type: instantiate,
8924
8839
  value: function(value) {
@@ -8932,10 +8847,10 @@
8932
8847
  */
8933
8848
  function createInitializer(moduleDefinition, injector) {
8934
8849
 
8935
- var initializers = moduleDefinition.__init__ || [];
8850
+ const initializers = moduleDefinition.__init__ || [];
8936
8851
 
8937
8852
  return function() {
8938
- initializers.forEach(function(initializer) {
8853
+ initializers.forEach(initializer => {
8939
8854
 
8940
8855
  // eagerly resolve component (fn or string)
8941
8856
  if (typeof initializer === 'string') {
@@ -8952,13 +8867,13 @@
8952
8867
  */
8953
8868
  function loadModule(moduleDefinition) {
8954
8869
 
8955
- var moduleExports = moduleDefinition.__exports__;
8870
+ const moduleExports = moduleDefinition.__exports__;
8956
8871
 
8957
8872
  // private module
8958
8873
  if (moduleExports) {
8959
- var nestedModules = moduleDefinition.__modules__;
8874
+ const nestedModules = moduleDefinition.__modules__;
8960
8875
 
8961
- var clonedModule = Object.keys(moduleDefinition).reduce(function(clonedModule, key) {
8876
+ const clonedModule = Object.keys(moduleDefinition).reduce((clonedModule, key) => {
8962
8877
 
8963
8878
  if (key !== '__exports__' && key !== '__modules__' && key !== '__init__' && key !== '__depends__') {
8964
8879
  clonedModule[key] = moduleDefinition[key];
@@ -8967,10 +8882,10 @@
8967
8882
  return clonedModule;
8968
8883
  }, Object.create(null));
8969
8884
 
8970
- var childModules = (nestedModules || []).concat(clonedModule);
8885
+ const childModules = (nestedModules || []).concat(clonedModule);
8971
8886
 
8972
- var privateInjector = createChild(childModules);
8973
- var getFromPrivateInjector = annotate(function(key) {
8887
+ const privateInjector = createChild(childModules);
8888
+ const getFromPrivateInjector = annotate(function(key) {
8974
8889
  return privateInjector.get(key);
8975
8890
  });
8976
8891
 
@@ -8979,7 +8894,7 @@
8979
8894
  });
8980
8895
 
8981
8896
  // ensure child injector initializes
8982
- var initializers = (moduleDefinition.__init__ || []).slice();
8897
+ const initializers = (moduleDefinition.__init__ || []).slice();
8983
8898
 
8984
8899
  initializers.unshift(function() {
8985
8900
  privateInjector.init();
@@ -9004,8 +8919,8 @@
9004
8919
  return;
9005
8920
  }
9006
8921
 
9007
- var type = moduleDefinition[key][0];
9008
- var value = moduleDefinition[key][1];
8922
+ const type = moduleDefinition[key][0];
8923
+ const value = moduleDefinition[key][1];
9009
8924
 
9010
8925
  providers[key] = [ factoryMap[type], arrayUnwrap(type, value), type ];
9011
8926
  });
@@ -9041,11 +8956,11 @@
9041
8956
  */
9042
8957
  function bootstrap(moduleDefinitions) {
9043
8958
 
9044
- var initializers = moduleDefinitions
8959
+ const initializers = moduleDefinitions
9045
8960
  .reduce(resolveDependencies, [])
9046
8961
  .map(loadModule);
9047
8962
 
9048
- var initialized = false;
8963
+ let initialized = false;
9049
8964
 
9050
8965
  return function() {
9051
8966
 
@@ -9055,9 +8970,7 @@
9055
8970
 
9056
8971
  initialized = true;
9057
8972
 
9058
- initializers.forEach(function(initializer) {
9059
- return initializer();
9060
- });
8973
+ initializers.forEach(initializer => initializer());
9061
8974
  };
9062
8975
  }
9063
8976
 
@@ -9120,9 +9033,9 @@
9120
9033
  });
9121
9034
 
9122
9035
  if (isFrameElement(element)) {
9123
- attr$1(rect, assign({}, this.FRAME_STYLE, attrs || {}));
9036
+ attr$1(rect, assign$1({}, this.FRAME_STYLE, attrs || {}));
9124
9037
  } else {
9125
- attr$1(rect, assign({}, this.SHAPE_STYLE, attrs || {}));
9038
+ attr$1(rect, assign$1({}, this.SHAPE_STYLE, attrs || {}));
9126
9039
  }
9127
9040
 
9128
9041
  append(visuals, rect);
@@ -9132,7 +9045,7 @@
9132
9045
 
9133
9046
  DefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {
9134
9047
 
9135
- var line = createLine(connection.waypoints, assign({}, this.CONNECTION_STYLE, attrs || {}));
9048
+ var line = createLine(connection.waypoints, assign$1({}, this.CONNECTION_STYLE, attrs || {}));
9136
9049
  append(visuals, line);
9137
9050
 
9138
9051
  return line;
@@ -9208,7 +9121,7 @@
9208
9121
  this.cls = function(className, traits, additionalAttrs) {
9209
9122
  var attrs = this.style(traits, additionalAttrs);
9210
9123
 
9211
- return assign(attrs, { 'class': className });
9124
+ return assign$1(attrs, { 'class': className });
9212
9125
  };
9213
9126
 
9214
9127
  /**
@@ -9227,10 +9140,10 @@
9227
9140
  }
9228
9141
 
9229
9142
  var attrs = reduce(traits, function(attrs, t) {
9230
- return assign(attrs, defaultTraits[t] || {});
9143
+ return assign$1(attrs, defaultTraits[t] || {});
9231
9144
  }, {});
9232
9145
 
9233
- return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
9146
+ return additionalAttrs ? assign$1(attrs, additionalAttrs) : attrs;
9234
9147
  };
9235
9148
 
9236
9149
  this.computeStyle = function(custom, traits, defaultStyles) {
@@ -9239,7 +9152,7 @@
9239
9152
  traits = [];
9240
9153
  }
9241
9154
 
9242
- return self.style(traits || [], assign({}, defaultStyles, custom || {}));
9155
+ return self.style(traits || [], assign$1({}, defaultStyles, custom || {}));
9243
9156
  };
9244
9157
  }
9245
9158
 
@@ -9348,17 +9261,17 @@
9348
9261
  */
9349
9262
  function createContainer(options) {
9350
9263
 
9351
- options = assign({}, { width: '100%', height: '100%' }, options);
9264
+ options = assign$1({}, { width: '100%', height: '100%' }, options);
9352
9265
 
9353
- var container = options.container || document.body;
9266
+ const container = options.container || document.body;
9354
9267
 
9355
9268
  // create a <div> around the svg element with the respective size
9356
9269
  // this way we can always get the correct container size
9357
9270
  // (this is impossible for <svg> elements at the moment)
9358
- var parent = document.createElement('div');
9271
+ const parent = document.createElement('div');
9359
9272
  parent.setAttribute('class', 'djs-container');
9360
9273
 
9361
- assign$1(parent, {
9274
+ assign(parent, {
9362
9275
  position: 'relative',
9363
9276
  overflow: 'hidden',
9364
9277
  width: ensurePx(options.width),
@@ -9371,10 +9284,10 @@
9371
9284
  }
9372
9285
 
9373
9286
  function createGroup(parent, cls, childIndex) {
9374
- var group = create$1('g');
9287
+ const group = create$1('g');
9375
9288
  classes$1(group).add(cls);
9376
9289
 
9377
- var index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
9290
+ const index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
9378
9291
 
9379
9292
  // must ensure second argument is node or _null_
9380
9293
  // cf. https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore
@@ -9383,14 +9296,14 @@
9383
9296
  return group;
9384
9297
  }
9385
9298
 
9386
- var BASE_LAYER = 'base';
9299
+ const BASE_LAYER = 'base';
9387
9300
 
9388
9301
  // render plane contents behind utility layers
9389
- var PLANE_LAYER_INDEX = 0;
9390
- var UTILITY_LAYER_INDEX = 1;
9302
+ const PLANE_LAYER_INDEX = 0;
9303
+ const UTILITY_LAYER_INDEX = 1;
9391
9304
 
9392
9305
 
9393
- var REQUIRED_MODEL_ATTRS = {
9306
+ const REQUIRED_MODEL_ATTRS = {
9394
9307
  shape: [ 'x', 'y', 'width', 'height' ],
9395
9308
  connection: [ 'waypoints' ]
9396
9309
  };
@@ -9445,22 +9358,22 @@
9445
9358
  */
9446
9359
  Canvas.prototype._init = function(config) {
9447
9360
 
9448
- var eventBus = this._eventBus;
9361
+ const eventBus = this._eventBus;
9449
9362
 
9450
9363
  // html container
9451
- var container = this._container = createContainer(config);
9364
+ const container = this._container = createContainer(config);
9452
9365
 
9453
- var svg = this._svg = create$1('svg');
9366
+ const svg = this._svg = create$1('svg');
9454
9367
  attr$1(svg, { width: '100%', height: '100%' });
9455
9368
 
9456
9369
  append(container, svg);
9457
9370
 
9458
- var viewport = this._viewport = createGroup(svg, 'viewport');
9371
+ const viewport = this._viewport = createGroup(svg, 'viewport');
9459
9372
 
9460
9373
  // debounce canvas.viewbox.changed events
9461
9374
  // for smoother diagram interaction
9462
9375
  if (config.deferUpdate !== false) {
9463
- this._viewboxChanged = debounce(bind(this._viewboxChanged, this), 300);
9376
+ this._viewboxChanged = debounce(bind$2(this._viewboxChanged, this), 300);
9464
9377
  }
9465
9378
 
9466
9379
  eventBus.on('diagram.init', function() {
@@ -9506,7 +9419,7 @@
9506
9419
  viewport: this._viewport
9507
9420
  });
9508
9421
 
9509
- var parent = this._container.parentNode;
9422
+ const parent = this._container.parentNode;
9510
9423
 
9511
9424
  if (parent) {
9512
9425
  parent.removeChild(this._container);
@@ -9522,18 +9435,16 @@
9522
9435
 
9523
9436
  Canvas.prototype._clear = function() {
9524
9437
 
9525
- var self = this;
9526
-
9527
- var allElements = this._elementRegistry.getAll();
9438
+ const allElements = this._elementRegistry.getAll();
9528
9439
 
9529
9440
  // remove all elements
9530
- allElements.forEach(function(element) {
9531
- var type = getType(element);
9441
+ allElements.forEach(element => {
9442
+ const type = getType(element);
9532
9443
 
9533
9444
  if (type === 'root') {
9534
- self.removeRootElement(element);
9445
+ this.removeRootElement(element);
9535
9446
  } else {
9536
- self._removeElement(element, type);
9447
+ this._removeElement(element, type);
9537
9448
  }
9538
9449
  });
9539
9450
 
@@ -9576,7 +9487,7 @@
9576
9487
  throw new Error('must specify a name');
9577
9488
  }
9578
9489
 
9579
- var layer = this._layers[name];
9490
+ let layer = this._layers[name];
9580
9491
 
9581
9492
  if (!layer) {
9582
9493
  layer = this._layers[name] = this._createLayer(name, index);
@@ -9624,7 +9535,7 @@
9624
9535
  index = UTILITY_LAYER_INDEX;
9625
9536
  }
9626
9537
 
9627
- var childIndex = this._getChildIndex(index);
9538
+ const childIndex = this._getChildIndex(index);
9628
9539
 
9629
9540
  return {
9630
9541
  group: createGroup(this._viewport, 'layer-' + name, childIndex),
@@ -9646,21 +9557,21 @@
9646
9557
  throw new Error('must specify a name');
9647
9558
  }
9648
9559
 
9649
- var layer = this._layers[name];
9560
+ const layer = this._layers[name];
9650
9561
 
9651
9562
  if (!layer) {
9652
9563
  throw new Error('layer <' + name + '> does not exist');
9653
9564
  }
9654
9565
 
9655
- var viewport = this._viewport;
9656
- var group = layer.group;
9657
- var index = layer.index;
9566
+ const viewport = this._viewport;
9567
+ const group = layer.group;
9568
+ const index = layer.index;
9658
9569
 
9659
9570
  if (layer.visible) {
9660
9571
  return group;
9661
9572
  }
9662
9573
 
9663
- var childIndex = this._getChildIndex(index);
9574
+ const childIndex = this._getChildIndex(index);
9664
9575
 
9665
9576
  viewport.insertBefore(group, viewport.childNodes[childIndex] || null);
9666
9577
 
@@ -9681,13 +9592,13 @@
9681
9592
  throw new Error('must specify a name');
9682
9593
  }
9683
9594
 
9684
- var layer = this._layers[name];
9595
+ const layer = this._layers[name];
9685
9596
 
9686
9597
  if (!layer) {
9687
9598
  throw new Error('layer <' + name + '> does not exist');
9688
9599
  }
9689
9600
 
9690
- var group = layer.group;
9601
+ const group = layer.group;
9691
9602
 
9692
9603
  if (!layer.visible) {
9693
9604
  return group;
@@ -9703,7 +9614,7 @@
9703
9614
 
9704
9615
  Canvas.prototype._removeLayer = function(name) {
9705
9616
 
9706
- var layer = this._layers[name];
9617
+ const layer = this._layers[name];
9707
9618
 
9708
9619
  if (layer) {
9709
9620
  delete this._layers[name];
@@ -9718,7 +9629,7 @@
9718
9629
  * @returns {SVGElement|null}
9719
9630
  */
9720
9631
  Canvas.prototype.getActiveLayer = function() {
9721
- var plane = this._findPlaneForRoot(this.getRootElement());
9632
+ const plane = this._findPlaneForRoot(this.getRootElement());
9722
9633
 
9723
9634
  if (!plane) {
9724
9635
  return null;
@@ -9744,7 +9655,7 @@
9744
9655
  return;
9745
9656
  }
9746
9657
 
9747
- var plane = this._findPlaneForRoot(
9658
+ const plane = this._findPlaneForRoot(
9748
9659
  findRoot(element)
9749
9660
  ) || {};
9750
9661
 
@@ -9783,7 +9694,7 @@
9783
9694
  // markers //////////////////////
9784
9695
 
9785
9696
  Canvas.prototype._updateMarker = function(element, marker, add) {
9786
- var container;
9697
+ let container;
9787
9698
 
9788
9699
  if (!element.id) {
9789
9700
  element = this._elementRegistry.get(element);
@@ -9831,7 +9742,7 @@
9831
9742
  * @example
9832
9743
  * canvas.addMarker('foo', 'some-marker');
9833
9744
  *
9834
- * var fooGfx = canvas.getGraphics('foo');
9745
+ * const fooGfx = canvas.getGraphics('foo');
9835
9746
  *
9836
9747
  * fooGfx; // <g class="... some-marker"> ... </g>
9837
9748
  *
@@ -9867,7 +9778,7 @@
9867
9778
  element = this._elementRegistry.get(element);
9868
9779
  }
9869
9780
 
9870
- var gfx = this.getGraphics(element);
9781
+ const gfx = this.getGraphics(element);
9871
9782
 
9872
9783
  return classes$1(gfx).has(marker);
9873
9784
  };
@@ -9905,7 +9816,7 @@
9905
9816
  * @returns {Object|djs.model.Root|null} rootElement.
9906
9817
  */
9907
9818
  Canvas.prototype.getRootElement = function() {
9908
- var rootElement = this._rootElement;
9819
+ const rootElement = this._rootElement;
9909
9820
 
9910
9821
  // can return null if root elements are present but none was set yet
9911
9822
  if (rootElement || this._planes.length) {
@@ -9924,7 +9835,7 @@
9924
9835
  */
9925
9836
 
9926
9837
  Canvas.prototype.addRootElement = function(rootElement) {
9927
- var idx = this._rootsIdx++;
9838
+ const idx = this._rootsIdx++;
9928
9839
 
9929
9840
  if (!rootElement) {
9930
9841
  rootElement = {
@@ -9934,11 +9845,11 @@
9934
9845
  };
9935
9846
  }
9936
9847
 
9937
- var layerName = rootElement.layer = 'root-' + idx;
9848
+ const layerName = rootElement.layer = 'root-' + idx;
9938
9849
 
9939
9850
  this._ensureValid('root', rootElement);
9940
9851
 
9941
- var layer = this.getLayer(layerName, PLANE_LAYER_INDEX);
9852
+ const layer = this.getLayer(layerName, PLANE_LAYER_INDEX);
9942
9853
 
9943
9854
  this.hideLayer(layerName);
9944
9855
 
@@ -9965,7 +9876,7 @@
9965
9876
  rootElement = this._elementRegistry.get(rootElement);
9966
9877
  }
9967
9878
 
9968
- var plane = this._findPlaneForRoot(rootElement);
9879
+ const plane = this._findPlaneForRoot(rootElement);
9969
9880
 
9970
9881
  if (!plane) {
9971
9882
  return;
@@ -10011,7 +9922,7 @@
10011
9922
  return;
10012
9923
  }
10013
9924
 
10014
- var plane;
9925
+ let plane;
10015
9926
 
10016
9927
  if (!rootElement) {
10017
9928
  throw new Error('rootElement required');
@@ -10031,8 +9942,8 @@
10031
9942
 
10032
9943
 
10033
9944
  Canvas.prototype._removeRoot = function(element) {
10034
- var elementRegistry = this._elementRegistry,
10035
- eventBus = this._eventBus;
9945
+ const elementRegistry = this._elementRegistry,
9946
+ eventBus = this._eventBus;
10036
9947
 
10037
9948
  // simulate element remove event sequence
10038
9949
  eventBus.fire('root.remove', { element: element });
@@ -10043,8 +9954,8 @@
10043
9954
 
10044
9955
 
10045
9956
  Canvas.prototype._addRoot = function(element, gfx) {
10046
- var elementRegistry = this._elementRegistry,
10047
- eventBus = this._eventBus;
9957
+ const elementRegistry = this._elementRegistry,
9958
+ eventBus = this._eventBus;
10048
9959
 
10049
9960
  // resemble element add event sequence
10050
9961
  eventBus.fire('root.add', { element: element });
@@ -10057,7 +9968,7 @@
10057
9968
 
10058
9969
  Canvas.prototype._setRoot = function(rootElement, layer) {
10059
9970
 
10060
- var currentRoot = this._rootElement;
9971
+ const currentRoot = this._rootElement;
10061
9972
 
10062
9973
  if (currentRoot) {
10063
9974
 
@@ -10097,9 +10008,9 @@
10097
10008
  throw new Error('element <' + element.id + '> already exists');
10098
10009
  }
10099
10010
 
10100
- var requiredAttrs = REQUIRED_MODEL_ATTRS[type];
10011
+ const requiredAttrs = REQUIRED_MODEL_ATTRS[type];
10101
10012
 
10102
- var valid = every(requiredAttrs, function(attr) {
10013
+ const valid = every(requiredAttrs, function(attr) {
10103
10014
  return typeof element[attr] !== 'undefined';
10104
10015
  });
10105
10016
 
@@ -10138,8 +10049,8 @@
10138
10049
 
10139
10050
  parent = parent || this.getRootElement();
10140
10051
 
10141
- var eventBus = this._eventBus,
10142
- graphicsFactory = this._graphicsFactory;
10052
+ const eventBus = this._eventBus,
10053
+ graphicsFactory = this._graphicsFactory;
10143
10054
 
10144
10055
  this._ensureValid(type, element);
10145
10056
 
@@ -10148,7 +10059,7 @@
10148
10059
  this._setParent(element, parent, parentIndex);
10149
10060
 
10150
10061
  // create graphics
10151
- var gfx = graphicsFactory.create(type, element, parentIndex);
10062
+ const gfx = graphicsFactory.create(type, element, parentIndex);
10152
10063
 
10153
10064
  this._elementRegistry.add(element, gfx);
10154
10065
 
@@ -10192,9 +10103,9 @@
10192
10103
  */
10193
10104
  Canvas.prototype._removeElement = function(element, type) {
10194
10105
 
10195
- var elementRegistry = this._elementRegistry,
10196
- graphicsFactory = this._graphicsFactory,
10197
- eventBus = this._eventBus;
10106
+ const elementRegistry = this._elementRegistry,
10107
+ graphicsFactory = this._graphicsFactory,
10108
+ eventBus = this._eventBus;
10198
10109
 
10199
10110
  element = elementRegistry.get(element.id || element);
10200
10111
 
@@ -10343,7 +10254,7 @@
10343
10254
  * // sets the visible area of the diagram to (100|100) -> (600|100)
10344
10255
  * // and and scales it according to the diagram width
10345
10256
  *
10346
- * var viewbox = canvas.viewbox(); // pass `false` to force recomputing the box.
10257
+ * const viewbox = canvas.viewbox(); // pass `false` to force recomputing the box.
10347
10258
  *
10348
10259
  * console.log(viewbox);
10349
10260
  * // {
@@ -10357,7 +10268,7 @@
10357
10268
  * // if the current diagram is zoomed and scrolled, you may reset it to the
10358
10269
  * // default zoom via this method, too:
10359
10270
  *
10360
- * var zoomedAndScrolledViewbox = canvas.viewbox();
10271
+ * const zoomedAndScrolledViewbox = canvas.viewbox();
10361
10272
  *
10362
10273
  * canvas.viewbox({
10363
10274
  * x: 0,
@@ -10380,9 +10291,9 @@
10380
10291
  return this._cachedViewbox;
10381
10292
  }
10382
10293
 
10383
- var viewport = this._viewport,
10384
- innerBox,
10385
- outerBox = this.getSize(),
10294
+ const viewport = this._viewport,
10295
+ outerBox = this.getSize();
10296
+ let innerBox,
10386
10297
  matrix,
10387
10298
  activeLayer,
10388
10299
  transform,
@@ -10426,7 +10337,7 @@
10426
10337
  this._changeViewbox(function() {
10427
10338
  scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
10428
10339
 
10429
- var matrix = this._svg.createSVGMatrix()
10340
+ const matrix = this._svg.createSVGMatrix()
10430
10341
  .scale(scale)
10431
10342
  .translate(-box.x, -box.y);
10432
10343
 
@@ -10448,12 +10359,12 @@
10448
10359
  */
10449
10360
  Canvas.prototype.scroll = function(delta) {
10450
10361
 
10451
- var node = this._viewport;
10452
- var matrix = node.getCTM();
10362
+ const node = this._viewport;
10363
+ let matrix = node.getCTM();
10453
10364
 
10454
10365
  if (delta) {
10455
10366
  this._changeViewbox(function() {
10456
- delta = assign({ dx: 0, dy: 0 }, delta || {});
10367
+ delta = assign$1({ dx: 0, dy: 0 }, delta || {});
10457
10368
 
10458
10369
  matrix = this._svg.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
10459
10370
 
@@ -10473,14 +10384,14 @@
10473
10384
  *
10474
10385
  */
10475
10386
  Canvas.prototype.scrollToElement = function(element, padding) {
10476
- var defaultPadding = 100;
10387
+ let defaultPadding = 100;
10477
10388
 
10478
10389
  if (typeof element === 'string') {
10479
10390
  element = this._elementRegistry.get(element);
10480
10391
  }
10481
10392
 
10482
10393
  // set to correct rootElement
10483
- var rootElement = this.findRoot(element);
10394
+ const rootElement = this.findRoot(element);
10484
10395
 
10485
10396
  if (rootElement !== this.getRootElement()) {
10486
10397
  this.setRootElement(rootElement);
@@ -10500,11 +10411,11 @@
10500
10411
  left: padding.left || defaultPadding
10501
10412
  };
10502
10413
 
10503
- var elementBounds = getBBox(element),
10504
- elementTrbl = asTRBL(elementBounds),
10505
- viewboxBounds = this.viewbox(),
10506
- zoom = this.zoom(),
10507
- dx, dy;
10414
+ const elementBounds = getBBox(element),
10415
+ elementTrbl = asTRBL(elementBounds),
10416
+ viewboxBounds = this.viewbox(),
10417
+ zoom = this.zoom();
10418
+ let dx, dy;
10508
10419
 
10509
10420
  // shrink viewboxBounds with padding
10510
10421
  viewboxBounds.y += padding.top / zoom;
@@ -10512,9 +10423,9 @@
10512
10423
  viewboxBounds.width -= (padding.right + padding.left) / zoom;
10513
10424
  viewboxBounds.height -= (padding.bottom + padding.top) / zoom;
10514
10425
 
10515
- var viewboxTrbl = asTRBL(viewboxBounds);
10426
+ const viewboxTrbl = asTRBL(viewboxBounds);
10516
10427
 
10517
- var canFit = elementBounds.width < viewboxBounds.width && elementBounds.height < viewboxBounds.height;
10428
+ const canFit = elementBounds.width < viewboxBounds.width && elementBounds.height < viewboxBounds.height;
10518
10429
 
10519
10430
  if (!canFit) {
10520
10431
 
@@ -10524,10 +10435,10 @@
10524
10435
 
10525
10436
  } else {
10526
10437
 
10527
- var dRight = Math.max(0, elementTrbl.right - viewboxTrbl.right),
10528
- dLeft = Math.min(0, elementTrbl.left - viewboxTrbl.left),
10529
- dBottom = Math.max(0, elementTrbl.bottom - viewboxTrbl.bottom),
10530
- dTop = Math.min(0, elementTrbl.top - viewboxTrbl.top);
10438
+ const dRight = Math.max(0, elementTrbl.right - viewboxTrbl.right),
10439
+ dLeft = Math.min(0, elementTrbl.left - viewboxTrbl.left),
10440
+ dBottom = Math.max(0, elementTrbl.bottom - viewboxTrbl.bottom),
10441
+ dTop = Math.min(0, elementTrbl.top - viewboxTrbl.top);
10531
10442
 
10532
10443
  dx = dRight || dLeft;
10533
10444
  dy = dBottom || dTop;
@@ -10560,7 +10471,7 @@
10560
10471
  return this._fitViewport(center);
10561
10472
  }
10562
10473
 
10563
- var outer,
10474
+ let outer,
10564
10475
  matrix;
10565
10476
 
10566
10477
  this._changeViewbox(function() {
@@ -10581,16 +10492,16 @@
10581
10492
  };
10582
10493
 
10583
10494
  function setCTM(node, m) {
10584
- var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
10495
+ const mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
10585
10496
  node.setAttribute('transform', mstr);
10586
10497
  }
10587
10498
 
10588
10499
  Canvas.prototype._fitViewport = function(center) {
10589
10500
 
10590
- var vbox = this.viewbox(),
10591
- outer = vbox.outer,
10592
- inner = vbox.inner,
10593
- newScale,
10501
+ const vbox = this.viewbox(),
10502
+ outer = vbox.outer,
10503
+ inner = vbox.inner;
10504
+ let newScale,
10594
10505
  newViewbox;
10595
10506
 
10596
10507
  // display the complete diagram without zooming in.
@@ -10631,13 +10542,13 @@
10631
10542
 
10632
10543
  Canvas.prototype._setZoom = function(scale, center) {
10633
10544
 
10634
- var svg = this._svg,
10635
- viewport = this._viewport;
10545
+ const svg = this._svg,
10546
+ viewport = this._viewport;
10636
10547
 
10637
- var matrix = svg.createSVGMatrix();
10638
- var point = svg.createSVGPoint();
10548
+ const matrix = svg.createSVGMatrix();
10549
+ const point = svg.createSVGPoint();
10639
10550
 
10640
- var centerPoint,
10551
+ let centerPoint,
10641
10552
  originalPoint,
10642
10553
  currentMatrix,
10643
10554
  scaleMatrix,
@@ -10645,10 +10556,10 @@
10645
10556
 
10646
10557
  currentMatrix = viewport.getCTM();
10647
10558
 
10648
- var currentScale = currentMatrix.a;
10559
+ const currentScale = currentMatrix.a;
10649
10560
 
10650
10561
  if (center) {
10651
- centerPoint = assign(point, center);
10562
+ centerPoint = assign$1(point, center);
10652
10563
 
10653
10564
  // revert applied viewport transformations
10654
10565
  originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
@@ -10694,13 +10605,13 @@
10694
10605
  * @return {Bounds} the absolute bounding box
10695
10606
  */
10696
10607
  Canvas.prototype.getAbsoluteBBox = function(element) {
10697
- var vbox = this.viewbox();
10698
- var bbox;
10608
+ const vbox = this.viewbox();
10609
+ let bbox;
10699
10610
 
10700
10611
  // connection
10701
10612
  // use svg bbox
10702
10613
  if (element.waypoints) {
10703
- var gfx = this.getGraphics(element);
10614
+ const gfx = this.getGraphics(element);
10704
10615
 
10705
10616
  bbox = gfx.getBBox();
10706
10617
  }
@@ -10711,11 +10622,11 @@
10711
10622
  bbox = element;
10712
10623
  }
10713
10624
 
10714
- var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
10715
- var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
10625
+ const x = bbox.x * vbox.scale - vbox.x * vbox.scale;
10626
+ const y = bbox.y * vbox.scale - vbox.y * vbox.scale;
10716
10627
 
10717
- var width = bbox.width * vbox.scale;
10718
- var height = bbox.height * vbox.scale;
10628
+ const width = bbox.width * vbox.scale;
10629
+ const height = bbox.height * vbox.scale;
10719
10630
 
10720
10631
  return {
10721
10632
  x: x,
@@ -11542,7 +11453,7 @@
11542
11453
  if (!Type) {
11543
11454
  throw new Error('unknown type: <' + type + '>');
11544
11455
  }
11545
- return assign(new Type(), attrs);
11456
+ return assign$1(new Type(), attrs);
11546
11457
  }
11547
11458
 
11548
11459
  /**
@@ -11579,7 +11490,7 @@
11579
11490
  */
11580
11491
  ElementFactory.prototype.create = function(type, attrs) {
11581
11492
 
11582
- attrs = assign({}, attrs || {});
11493
+ attrs = assign$1({}, attrs || {});
11583
11494
 
11584
11495
  if (!attrs.id) {
11585
11496
  attrs.id = type + '_' + (this._uid++);
@@ -11720,7 +11631,7 @@
11720
11631
  var actualCallback = callback;
11721
11632
 
11722
11633
  if (that) {
11723
- actualCallback = bind(callback, that);
11634
+ actualCallback = bind$2(callback, that);
11724
11635
 
11725
11636
  // make sure we remember and are able to remove
11726
11637
  // bound callbacks via {@link #off} using the original
@@ -12085,7 +11996,7 @@
12085
11996
  };
12086
11997
 
12087
11998
  InternalEvent.prototype.init = function(data) {
12088
- assign(this, data || {});
11999
+ assign$1(this, data || {});
12089
12000
  };
12090
12001
 
12091
12002
 
@@ -12570,7 +12481,7 @@
12570
12481
  props.define(this, '$attrs', { value: {} });
12571
12482
  props.define(this, '$parent', { writable: true });
12572
12483
 
12573
- forEach$1(attrs, bind(function(val, key) {
12484
+ forEach$1(attrs, bind$2(function(val, key) {
12574
12485
  this.set(key, val);
12575
12486
  }, this));
12576
12487
  }
@@ -12653,6 +12564,7 @@
12653
12564
  localName = name;
12654
12565
  prefix = defaultPrefix;
12655
12566
  } else
12567
+
12656
12568
  // prefix + local name
12657
12569
  if (parts.length === 2) {
12658
12570
  localName = parts[1];
@@ -12859,10 +12771,10 @@
12859
12771
  return;
12860
12772
  }
12861
12773
 
12862
- forEach$1(t.properties, bind(function(p) {
12774
+ forEach$1(t.properties, bind$2(function(p) {
12863
12775
 
12864
12776
  // clone property to allow extensions
12865
- p = assign({}, p, {
12777
+ p = assign$1({}, p, {
12866
12778
  name: p.ns.localName,
12867
12779
  inherited: inherited
12868
12780
  });
@@ -12906,7 +12818,7 @@
12906
12818
 
12907
12819
  this.properties = properties;
12908
12820
 
12909
- forEach$1(packages, bind(this.registerPackage, this));
12821
+ forEach$1(packages, bind$2(this.registerPackage, this));
12910
12822
  }
12911
12823
 
12912
12824
 
@@ -12922,7 +12834,7 @@
12922
12834
  Registry.prototype.registerPackage = function(pkg) {
12923
12835
 
12924
12836
  // copy package
12925
- pkg = assign({}, pkg);
12837
+ pkg = assign$1({}, pkg);
12926
12838
 
12927
12839
  var pkgMap = this.packageMap;
12928
12840
 
@@ -12930,7 +12842,7 @@
12930
12842
  ensureAvailable(pkgMap, pkg, 'uri');
12931
12843
 
12932
12844
  // register types
12933
- forEach$1(pkg.types, bind(function(descriptor) {
12845
+ forEach$1(pkg.types, bind$2(function(descriptor) {
12934
12846
  this.registerType(descriptor, pkg);
12935
12847
  }, this));
12936
12848
 
@@ -12944,11 +12856,11 @@
12944
12856
  */
12945
12857
  Registry.prototype.registerType = function(type, pkg) {
12946
12858
 
12947
- type = assign({}, type, {
12859
+ type = assign$1({}, type, {
12948
12860
  superClass: (type.superClass || []).slice(),
12949
12861
  extends: (type.extends || []).slice(),
12950
12862
  properties: (type.properties || []).slice(),
12951
- meta: assign((type.meta || {}))
12863
+ meta: assign$1((type.meta || {}))
12952
12864
  });
12953
12865
 
12954
12866
  var ns = parseName(type.name, pkg.prefix),
@@ -12956,7 +12868,7 @@
12956
12868
  propertiesByName = {};
12957
12869
 
12958
12870
  // parse properties
12959
- forEach$1(type.properties, bind(function(p) {
12871
+ forEach$1(type.properties, bind$2(function(p) {
12960
12872
 
12961
12873
  // namespace property names
12962
12874
  var propertyNs = parseName(p.name, ns.prefix),
@@ -12967,7 +12879,7 @@
12967
12879
  p.type = parseName(p.type, propertyNs.prefix).name;
12968
12880
  }
12969
12881
 
12970
- assign(p, {
12882
+ assign$1(p, {
12971
12883
  ns: propertyNs,
12972
12884
  name: propertyName
12973
12885
  });
@@ -12976,13 +12888,13 @@
12976
12888
  }, this));
12977
12889
 
12978
12890
  // update ns + name
12979
- assign(type, {
12891
+ assign$1(type, {
12980
12892
  ns: ns,
12981
12893
  name: name,
12982
12894
  propertiesByName: propertiesByName
12983
12895
  });
12984
12896
 
12985
- forEach$1(type.extends, bind(function(extendsName) {
12897
+ forEach$1(type.extends, bind$2(function(extendsName) {
12986
12898
  var extended = this.typeMap[extendsName];
12987
12899
 
12988
12900
  extended.traits = extended.traits || [];
@@ -13077,7 +12989,7 @@
13077
12989
 
13078
12990
 
13079
12991
 
13080
- ///////// helpers ////////////////////////////
12992
+ // helpers ////////////////////////////
13081
12993
 
13082
12994
  function ensureAvailable(packageMap, pkg, identifierKey) {
13083
12995
 
@@ -13108,11 +13020,16 @@
13108
13020
  */
13109
13021
  Properties.prototype.set = function(target, name, value) {
13110
13022
 
13023
+ if (!isString(name) || !name.length) {
13024
+ throw new TypeError('property name must be a non-empty string');
13025
+ }
13026
+
13111
13027
  var property = this.model.getPropertyDescriptor(target, name);
13112
13028
 
13113
13029
  var propertyName = property && property.name;
13114
13030
 
13115
13031
  if (isUndefined(value)) {
13032
+
13116
13033
  // unset the property, if the specified value is undefined;
13117
13034
  // delete from $attrs (for extensions) or the target itself
13118
13035
  if (property) {
@@ -13121,6 +13038,7 @@
13121
13038
  delete target.$attrs[name];
13122
13039
  }
13123
13040
  } else {
13041
+
13124
13042
  // set the property, defining well defined properties on the fly
13125
13043
  // or simply updating them in target.$attrs (for extensions)
13126
13044
  if (property) {
@@ -13177,7 +13095,7 @@
13177
13095
 
13178
13096
  // use getters for read-only variables to support ES6 proxies
13179
13097
  // cf. https://github.com/bpmn-io/internal-docs/issues/386
13180
- options = assign({}, options, {
13098
+ options = assign$1({}, options, {
13181
13099
  get: function() { return value; }
13182
13100
  });
13183
13101
 
@@ -13216,7 +13134,7 @@
13216
13134
  });
13217
13135
  }
13218
13136
 
13219
- //// Moddle implementation /////////////////////////////////////////////////
13137
+ // Moddle implementation /////////////////////////////////////////////////
13220
13138
 
13221
13139
  /**
13222
13140
  * @class Moddle
@@ -14599,7 +14517,7 @@
14599
14517
  * @property {Boolean} lax
14600
14518
  */
14601
14519
 
14602
- assign(this, options);
14520
+ assign$1(this, options);
14603
14521
 
14604
14522
  this.elementsById = {};
14605
14523
  this.references = [];
@@ -14905,7 +14823,7 @@
14905
14823
 
14906
14824
  elementType = model.getType(elementTypeName);
14907
14825
 
14908
- return assign({}, property, {
14826
+ return assign$1({}, property, {
14909
14827
  effectiveType: getModdleDescriptor(elementType).name
14910
14828
  });
14911
14829
  }
@@ -14927,7 +14845,7 @@
14927
14845
  });
14928
14846
 
14929
14847
  if (property) {
14930
- return assign({}, property, {
14848
+ return assign$1({}, property, {
14931
14849
  effectiveType: getModdleDescriptor(elementType).name
14932
14850
  });
14933
14851
  }
@@ -15002,7 +14920,7 @@
15002
14920
  }
15003
14921
 
15004
14922
  if (propertyDesc.isReference) {
15005
- assign(newElement, {
14923
+ assign$1(newElement, {
15006
14924
  element: element
15007
14925
  });
15008
14926
 
@@ -15111,7 +15029,7 @@
15111
15029
  };
15112
15030
  }
15113
15031
 
15114
- assign(this, { lax: false }, options);
15032
+ assign$1(this, { lax: false }, options);
15115
15033
  }
15116
15034
 
15117
15035
  /**
@@ -15166,7 +15084,7 @@
15166
15084
  var model = this.model,
15167
15085
  lax = this.lax;
15168
15086
 
15169
- var context = new Context(assign({}, options, { rootHandler: rootHandler })),
15087
+ var context = new Context(assign$1({}, options, { rootHandler: rootHandler })),
15170
15088
  parser = new Parser({ proxy: true }),
15171
15089
  stack = createStack();
15172
15090
 
@@ -15561,14 +15479,14 @@
15561
15479
 
15562
15480
  function getElementNs(ns, descriptor) {
15563
15481
  if (descriptor.isGeneric) {
15564
- return assign({ localName: descriptor.ns.localName }, ns);
15482
+ return assign$1({ localName: descriptor.ns.localName }, ns);
15565
15483
  } else {
15566
- return assign({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);
15484
+ return assign$1({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);
15567
15485
  }
15568
15486
  }
15569
15487
 
15570
15488
  function getPropertyNs(ns, descriptor) {
15571
- return assign({ localName: descriptor.ns.localName }, ns);
15489
+ return assign$1({ localName: descriptor.ns.localName }, ns);
15572
15490
  }
15573
15491
 
15574
15492
  function getSerializableProperties(element) {
@@ -15800,7 +15718,7 @@
15800
15718
  if (this.isLocalNs(effectiveNs)) {
15801
15719
  return { localName: ns.localName };
15802
15720
  } else {
15803
- return assign({ localName: ns.localName }, effectiveNs);
15721
+ return assign$1({ localName: ns.localName }, effectiveNs);
15804
15722
  }
15805
15723
  };
15806
15724
 
@@ -15916,6 +15834,8 @@
15916
15834
  try {
15917
15835
  self.addAttribute(self.nsAttributeName(attr.name), attr.value);
15918
15836
  } catch (e) {
15837
+ /* global console */
15838
+
15919
15839
  console.warn(
15920
15840
  'missing namespace information for ',
15921
15841
  attr.name, '=', attr.value, 'on', element,
@@ -16228,7 +16148,7 @@
16228
16148
 
16229
16149
  function FormatingWriter(out, format) {
16230
16150
 
16231
- var indent = [''];
16151
+ var indent = [ '' ];
16232
16152
 
16233
16153
  this.append = function(str) {
16234
16154
  out.write(str);
@@ -16270,7 +16190,7 @@
16270
16190
  */
16271
16191
  function Writer(options) {
16272
16192
 
16273
- options = assign({ format: false, preamble: true }, options || {});
16193
+ options = assign$1({ format: false, preamble: true }, options || {});
16274
16194
 
16275
16195
  function toXML(tree, writer) {
16276
16196
  var internalWriter = writer || new SavingWriter();
@@ -16342,7 +16262,7 @@
16342
16262
  typeName = 'bpmn:Definitions';
16343
16263
  }
16344
16264
 
16345
- var reader = new Reader(assign({ model: this, lax: true }, options));
16265
+ var reader = new Reader(assign$1({ model: this, lax: true }, options));
16346
16266
  var rootHandler = reader.handler(typeName);
16347
16267
 
16348
16268
  return reader.fromXML(xmlStr, rootHandler);
@@ -20029,7 +19949,7 @@
20029
19949
  };
20030
19950
 
20031
19951
  function simple(additionalPackages, options) {
20032
- var pks = assign({}, packages, additionalPackages);
19952
+ var pks = assign$1({}, packages, additionalPackages);
20033
19953
 
20034
19954
  return new BpmnModdle(pks, options);
20035
19955
  }
@@ -20709,7 +20629,7 @@
20709
20629
 
20710
20630
  // all collaboration processes can contain sub-diagrams
20711
20631
  if (collaboration) {
20712
- rootElements = map(collaboration.participants, function(participant) {
20632
+ rootElements = map$1(collaboration.participants, function(participant) {
20713
20633
  return participant.processRef;
20714
20634
  });
20715
20635
 
@@ -20835,13 +20755,13 @@
20835
20755
  var lightbox;
20836
20756
 
20837
20757
  function createLightbox() {
20838
- lightbox = domify(LIGHTBOX_MARKUP);
20758
+ lightbox = domify$1(LIGHTBOX_MARKUP);
20839
20759
 
20840
- assign$1(lightbox, LIGHTBOX_STYLES);
20841
- assign$1(query('svg', lightbox), LOGO_STYLES);
20842
- assign$1(query('.backdrop', lightbox), BACKDROP_STYLES);
20843
- assign$1(query('.notice', lightbox), NOTICE_STYLES);
20844
- assign$1(query('.link', lightbox), LINK_STYLES, {
20760
+ assign(lightbox, LIGHTBOX_STYLES);
20761
+ assign(query('svg', lightbox), LOGO_STYLES);
20762
+ assign(query('.backdrop', lightbox), BACKDROP_STYLES);
20763
+ assign(query('.notice', lightbox), NOTICE_STYLES);
20764
+ assign(query('.link', lightbox), LINK_STYLES, {
20845
20765
  'margin': '15px 20px 15px 10px',
20846
20766
  'alignSelf': 'center'
20847
20767
  });
@@ -20883,7 +20803,7 @@
20883
20803
  */
20884
20804
  function BaseViewer(options) {
20885
20805
 
20886
- options = assign({}, DEFAULT_OPTIONS, options);
20806
+ options = assign$1({}, DEFAULT_OPTIONS, options);
20887
20807
 
20888
20808
  this._moddle = this._createModdle(options);
20889
20809
 
@@ -21425,8 +21345,8 @@
21425
21345
 
21426
21346
  const diagramModules = [].concat(staticModules, baseModules, additionalModules);
21427
21347
 
21428
- const diagramOptions = assign(omit(options, [ 'additionalModules' ]), {
21429
- canvas: assign({}, options.canvas, { container: container }),
21348
+ const diagramOptions = assign$1(omit(options, [ 'additionalModules' ]), {
21349
+ canvas: assign$1({}, options.canvas, { container: container }),
21430
21350
  modules: diagramModules
21431
21351
  });
21432
21352
 
@@ -21452,9 +21372,9 @@
21452
21372
 
21453
21373
  BaseViewer.prototype._createContainer = function(options) {
21454
21374
 
21455
- const container = domify('<div class="bjs-container"></div>');
21375
+ const container = domify$1('<div class="bjs-container"></div>');
21456
21376
 
21457
- assign$1(container, {
21377
+ assign(container, {
21458
21378
  width: ensureUnit(options.width),
21459
21379
  height: ensureUnit(options.height),
21460
21380
  position: options.position
@@ -21464,7 +21384,7 @@
21464
21384
  };
21465
21385
 
21466
21386
  BaseViewer.prototype._createModdle = function(options) {
21467
- const moddleOptions = assign({}, this._moddleExtensions, options.moddleExtensions);
21387
+ const moddleOptions = assign$1({}, this._moddleExtensions, options.moddleExtensions);
21468
21388
 
21469
21389
  return new simple(moddleOptions);
21470
21390
  };
@@ -21548,10 +21468,10 @@
21548
21468
  img +
21549
21469
  '</a>';
21550
21470
 
21551
- const linkElement = domify(linkMarkup);
21471
+ const linkElement = domify$1(linkMarkup);
21552
21472
 
21553
- assign$1(query('svg', linkElement), LOGO_STYLES);
21554
- assign$1(linkElement, LINK_STYLES, {
21473
+ assign(query('svg', linkElement), LOGO_STYLES);
21474
+ assign(linkElement, LINK_STYLES, {
21555
21475
  position: 'absolute',
21556
21476
  bottom: '15px',
21557
21477
  right: '15px',
@@ -21560,7 +21480,7 @@
21560
21480
 
21561
21481
  container.appendChild(linkElement);
21562
21482
 
21563
- componentEvent.bind(linkElement, 'click', function(event) {
21483
+ event.bind(linkElement, 'click', function(event) {
21564
21484
  open();
21565
21485
 
21566
21486
  event.preventDefault();
@@ -21829,8 +21749,8 @@
21829
21749
  this._node = node;
21830
21750
 
21831
21751
  // bind key events
21832
- componentEvent.bind(node, 'keydown', this._keydownHandler, true);
21833
- componentEvent.bind(node, 'keyup', this._keyupHandler, true);
21752
+ event.bind(node, 'keydown', this._keydownHandler, true);
21753
+ event.bind(node, 'keyup', this._keyupHandler, true);
21834
21754
 
21835
21755
  this._fire('bind');
21836
21756
  };
@@ -21846,8 +21766,8 @@
21846
21766
  this._fire('unbind');
21847
21767
 
21848
21768
  // unbind key events
21849
- componentEvent.unbind(node, 'keydown', this._keydownHandler, true);
21850
- componentEvent.unbind(node, 'keyup', this._keyupHandler, true);
21769
+ event.unbind(node, 'keydown', this._keydownHandler, true);
21770
+ event.unbind(node, 'keyup', this._keyupHandler, true);
21851
21771
  }
21852
21772
 
21853
21773
  this._node = null;
@@ -21890,7 +21810,7 @@
21890
21810
  // helpers ///////
21891
21811
 
21892
21812
  function isInput(target) {
21893
- return target && (matchesSelector(target, 'input, textarea') || target.contentEditable === 'true');
21813
+ return target && (matches(target, 'input, textarea') || target.contentEditable === 'true');
21894
21814
  }
21895
21815
 
21896
21816
  var LOW_PRIORITY = 500;
@@ -22083,7 +22003,7 @@
22083
22003
 
22084
22004
  var self = this;
22085
22005
 
22086
- this._config = assign({}, DEFAULT_CONFIG, config || {});
22006
+ this._config = assign$1({}, DEFAULT_CONFIG, config || {});
22087
22007
 
22088
22008
  keyboard.addListener(arrowsListener);
22089
22009
 
@@ -22290,36 +22210,36 @@
22290
22210
  }
22291
22211
 
22292
22212
 
22293
- function handleEnd(event) {
22294
- componentEvent.unbind(document, 'mousemove', handleMove);
22295
- componentEvent.unbind(document, 'mouseup', handleEnd);
22213
+ function handleEnd(event$1) {
22214
+ event.unbind(document, 'mousemove', handleMove);
22215
+ event.unbind(document, 'mouseup', handleEnd);
22296
22216
 
22297
22217
  context = null;
22298
22218
 
22299
22219
  unset();
22300
22220
  }
22301
22221
 
22302
- function handleStart(event) {
22222
+ function handleStart(event$1) {
22303
22223
 
22304
22224
  // event is already handled by '.djs-draggable'
22305
- if (closest(event.target, '.djs-draggable')) {
22225
+ if (closest(event$1.target, '.djs-draggable')) {
22306
22226
  return;
22307
22227
  }
22308
22228
 
22309
- var button = event.button;
22229
+ var button = event$1.button;
22310
22230
 
22311
22231
  // reject right mouse button or modifier key
22312
- if (button >= 2 || event.ctrlKey || event.shiftKey || event.altKey) {
22232
+ if (button >= 2 || event$1.ctrlKey || event$1.shiftKey || event$1.altKey) {
22313
22233
  return;
22314
22234
  }
22315
22235
 
22316
22236
  context = {
22317
22237
  button: button,
22318
- start: toPoint(event)
22238
+ start: toPoint(event$1)
22319
22239
  };
22320
22240
 
22321
- componentEvent.bind(document, 'mousemove', handleMove);
22322
- componentEvent.bind(document, 'mouseup', handleEnd);
22241
+ event.bind(document, 'mousemove', handleMove);
22242
+ event.bind(document, 'mouseup', handleEnd);
22323
22243
 
22324
22244
  // we've handled the event
22325
22245
  return true;
@@ -22412,7 +22332,7 @@
22412
22332
  this._canvas = canvas;
22413
22333
  this._container = canvas._container;
22414
22334
 
22415
- this._handleWheel = bind(this._handleWheel, this);
22335
+ this._handleWheel = bind$2(this._handleWheel, this);
22416
22336
 
22417
22337
  this._totalDelta = 0;
22418
22338
  this._scale = config.scale || DEFAULT_SCALE;
@@ -22587,7 +22507,7 @@
22587
22507
 
22588
22508
  // add or remove wheel listener based on
22589
22509
  // changed enabled state
22590
- componentEvent[newEnabled ? 'bind' : 'unbind'](element, 'wheel', handleWheel, false);
22510
+ event[newEnabled ? 'bind' : 'unbind'](element, 'wheel', handleWheel, false);
22591
22511
  }
22592
22512
 
22593
22513
  this._enabled = newEnabled;