bpmn-js 10.0.0 → 10.1.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-viewer v10.0.0
2
+ * bpmn-js - bpmn-viewer v10.1.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-09-30
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;
31
- function isUndefined$2(obj) {
29
+ const nativeToString$4 = Object.prototype.toString;
30
+ const nativeHasOwnProperty$3 = Object.prototype.hasOwnProperty;
31
+
32
+ function isUndefined$4(obj) {
32
33
  return obj === undefined;
33
34
  }
35
+
34
36
  function isDefined(obj) {
35
37
  return obj !== undefined;
36
38
  }
37
- function isArray$2(obj) {
38
- return nativeToString$1.call(obj) === '[object Array]';
39
+
40
+ function isArray$4(obj) {
41
+ return nativeToString$4.call(obj) === '[object Array]';
39
42
  }
40
- function isObject(obj) {
41
- return nativeToString$1.call(obj) === '[object Object]';
43
+
44
+ function isObject$1(obj) {
45
+ return nativeToString$4.call(obj) === '[object Object]';
42
46
  }
47
+
43
48
  function isNumber(obj) {
44
- return nativeToString$1.call(obj) === '[object Number]';
49
+ return nativeToString$4.call(obj) === '[object Number]';
45
50
  }
46
- 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]';
51
+
52
+ function isFunction$1(obj) {
53
+ const tag = nativeToString$4.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
  }
50
- function isString(obj) {
51
- return nativeToString$1.call(obj) === '[object String]';
63
+
64
+ function isString$3(obj) {
65
+ return nativeToString$4.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,9 +73,8 @@
58
73
  *
59
74
  * @return {Boolean}
60
75
  */
61
-
62
- function has$1(target, key) {
63
- return nativeHasOwnProperty$1.call(target, key);
76
+ function has$3(target, key) {
77
+ return nativeHasOwnProperty$3.call(target, key);
64
78
  }
65
79
 
66
80
  /**
@@ -71,38 +85,25 @@
71
85
  *
72
86
  * @return {Object}
73
87
  */
88
+ function find$1(collection, matcher) {
74
89
 
75
- function find(collection, matcher) {
76
- matcher = toMatcher(matcher);
77
- var match;
78
- forEach$1(collection, function (val, key) {
90
+ matcher = toMatcher$1(matcher);
91
+
92
+ let match;
93
+
94
+ forEach$3(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;
85
- }
86
- /**
87
- * Find element index in collection.
88
- *
89
- * @param {Array|Object} collection
90
- * @param {Function} matcher
91
- *
92
- * @return {Object}
93
- */
94
103
 
95
- function findIndex(collection, matcher) {
96
- matcher = toMatcher(matcher);
97
- var idx = isArray$2(collection) ? -1 : undefined;
98
- forEach$1(collection, function (val, key) {
99
- if (matcher(val, key)) {
100
- idx = key;
101
- return false;
102
- }
103
- });
104
- return idx;
105
104
  }
105
+
106
+
106
107
  /**
107
108
  * Find element in collection.
108
109
  *
@@ -111,16 +112,20 @@
111
112
  *
112
113
  * @return {Array} result
113
114
  */
115
+ function filter$1(collection, matcher) {
114
116
 
115
- function filter(collection, matcher) {
116
- var result = [];
117
- forEach$1(collection, function (val, key) {
117
+ let result = [];
118
+
119
+ forEach$3(collection, function(val, key) {
118
120
  if (matcher(val, key)) {
119
121
  result.push(val);
120
122
  }
121
123
  });
124
+
122
125
  return result;
123
126
  }
127
+
128
+
124
129
  /**
125
130
  * Iterate over collection; returning something
126
131
  * (non-undefined) will stop iteration.
@@ -130,19 +135,22 @@
130
135
  *
131
136
  * @return {Object} return result that stopped the iteration
132
137
  */
138
+ function forEach$3(collection, iterator) {
133
139
 
134
- function forEach$1(collection, iterator) {
135
- var val, result;
140
+ let val,
141
+ result;
136
142
 
137
- if (isUndefined$2(collection)) {
143
+ if (isUndefined$4(collection)) {
138
144
  return;
139
145
  }
140
146
 
141
- var convertKey = isArray$2(collection) ? toNum$1 : identity$1;
147
+ const convertKey = isArray$4(collection) ? toNum$3 : identity$3;
142
148
 
143
- for (var key in collection) {
144
- if (has$1(collection, key)) {
149
+ for (let key in collection) {
150
+
151
+ if (has$3(collection, key)) {
145
152
  val = collection[key];
153
+
146
154
  result = iterator(val, convertKey(key));
147
155
 
148
156
  if (result === false) {
@@ -151,6 +159,8 @@
151
159
  }
152
160
  }
153
161
  }
162
+
163
+
154
164
  /**
155
165
  * Reduce collection, returning a single result.
156
166
  *
@@ -160,13 +170,16 @@
160
170
  *
161
171
  * @return {Any} result returned from last iterator
162
172
  */
163
-
164
173
  function reduce(collection, iterator, result) {
165
- forEach$1(collection, function (value, idx) {
174
+
175
+ forEach$3(collection, function(value, idx) {
166
176
  result = iterator(result, value, idx);
167
177
  });
178
+
168
179
  return result;
169
180
  }
181
+
182
+
170
183
  /**
171
184
  * Return true if every element in the collection
172
185
  * matches the criteria.
@@ -176,12 +189,14 @@
176
189
  *
177
190
  * @return {Boolean}
178
191
  */
179
-
180
192
  function every(collection, matcher) {
181
- return !!reduce(collection, function (matches, val, key) {
193
+
194
+ return !!reduce(collection, function(matches, val, key) {
182
195
  return matches && matcher(val, key);
183
196
  }, true);
184
197
  }
198
+
199
+
185
200
  /**
186
201
  * Return true if some elements in the collection
187
202
  * match the criteria.
@@ -191,10 +206,12 @@
191
206
  *
192
207
  * @return {Boolean}
193
208
  */
194
-
195
209
  function some(collection, matcher) {
196
- return !!find(collection, matcher);
210
+
211
+ return !!find$1(collection, matcher);
197
212
  }
213
+
214
+
198
215
  /**
199
216
  * Transform a collection into another collection
200
217
  * by piping each member through the given fn.
@@ -204,14 +221,18 @@
204
221
  *
205
222
  * @return {Array} transformed collection
206
223
  */
224
+ function map$1(collection, fn) {
207
225
 
208
- function map(collection, fn) {
209
- var result = [];
210
- forEach$1(collection, function (val, key) {
226
+ let result = [];
227
+
228
+ forEach$3(collection, function(val, key) {
211
229
  result.push(fn(val, key));
212
230
  });
231
+
213
232
  return result;
214
233
  }
234
+
235
+
215
236
  /**
216
237
  * Create an object pattern matcher.
217
238
  *
@@ -225,26 +246,30 @@
225
246
  *
226
247
  * @return {Function} matcherFn
227
248
  */
228
-
229
249
  function matchPattern(pattern) {
230
- return function (el) {
231
- return every(pattern, function (val, key) {
250
+
251
+ return function(el) {
252
+
253
+ return every(pattern, function(val, key) {
232
254
  return el[key] === val;
233
255
  });
256
+
234
257
  };
235
258
  }
236
259
 
237
- function toMatcher(matcher) {
238
- return isFunction(matcher) ? matcher : function (e) {
260
+
261
+ function toMatcher$1(matcher) {
262
+ return isFunction$1(matcher) ? matcher : (e) => {
239
263
  return e === matcher;
240
264
  };
241
265
  }
242
266
 
243
- function identity$1(arg) {
267
+
268
+ function identity$3(arg) {
244
269
  return arg;
245
270
  }
246
271
 
247
- function toNum$1(arg) {
272
+ function toNum$3(arg) {
248
273
  return Number(arg);
249
274
  }
250
275
 
@@ -261,20 +286,26 @@
261
286
  * @return {Function} debounced function
262
287
  */
263
288
  function debounce(fn, timeout) {
264
- var timer;
265
- var lastArgs;
266
- var lastThis;
267
- var lastNow;
289
+
290
+ let timer;
291
+
292
+ let lastArgs;
293
+ let lastThis;
294
+
295
+ let lastNow;
268
296
 
269
297
  function fire(force) {
270
- var now = Date.now();
271
- var scheduledDiff = force ? 0 : lastNow + timeout - now;
298
+
299
+ let now = Date.now();
300
+
301
+ let scheduledDiff = force ? 0 : (lastNow + timeout) - now;
272
302
 
273
303
  if (scheduledDiff > 0) {
274
304
  return schedule(scheduledDiff);
275
305
  }
276
306
 
277
307
  fn.apply(lastThis, lastArgs);
308
+
278
309
  clear();
279
310
  }
280
311
 
@@ -298,16 +329,13 @@
298
329
  clear();
299
330
  }
300
331
 
301
- function callback() {
332
+ function callback(...args) {
302
333
  lastNow = Date.now();
303
334
 
304
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
305
- args[_key] = arguments[_key];
306
- }
307
-
308
335
  lastArgs = args;
309
- lastThis = this; // ensure an execution is scheduled
336
+ lastThis = this;
310
337
 
338
+ // ensure an execution is scheduled
311
339
  if (!timer) {
312
340
  schedule(timeout);
313
341
  }
@@ -315,8 +343,10 @@
315
343
 
316
344
  callback.flush = flush;
317
345
  callback.cancel = clear;
346
+
318
347
  return callback;
319
348
  }
349
+
320
350
  /**
321
351
  * Bind function against target <this>.
322
352
  *
@@ -325,29 +355,10 @@
325
355
  *
326
356
  * @return {Function} bound function
327
357
  */
328
-
329
- function bind(fn, target) {
358
+ function bind$3(fn, target) {
330
359
  return fn.bind(target);
331
360
  }
332
361
 
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
362
  /**
352
363
  * Convenience wrapper for `Object.assign`.
353
364
  *
@@ -356,33 +367,10 @@
356
367
  *
357
368
  * @return {Object} the target
358
369
  */
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));
370
+ function assign$4(target, ...others) {
371
+ return Object.assign(target, ...others);
366
372
  }
367
- /**
368
- * Pick given properties from the target object.
369
- *
370
- * @param {Object} target
371
- * @param {Array} properties
372
- *
373
- * @return {Object} target
374
- */
375
373
 
376
- function pick(target, properties) {
377
- var result = {};
378
- var obj = Object(target);
379
- forEach$1(properties, function (prop) {
380
- if (prop in obj) {
381
- result[prop] = target[prop];
382
- }
383
- });
384
- return result;
385
- }
386
374
  /**
387
375
  * Pick all target properties, excluding the given ones.
388
376
  *
@@ -391,15 +379,19 @@
391
379
  *
392
380
  * @return {Object} target
393
381
  */
394
-
395
382
  function omit(target, properties) {
396
- var result = {};
397
- var obj = Object(target);
398
- forEach$1(obj, function (prop, key) {
383
+
384
+ let result = {};
385
+
386
+ let obj = Object(target);
387
+
388
+ forEach$3(obj, function(prop, key) {
389
+
399
390
  if (properties.indexOf(key) === -1) {
400
391
  result[key] = prop;
401
392
  }
402
393
  });
394
+
403
395
  return result;
404
396
  }
405
397
 
@@ -620,9 +612,11 @@
620
612
 
621
613
  if (element.ownerDocument !== target.ownerDocument) {
622
614
  try {
615
+
623
616
  // may fail on webkit
624
617
  return target.ownerDocument.importNode(element, true);
625
618
  } catch (e) {
619
+
626
620
  // ignore
627
621
  }
628
622
  }
@@ -748,6 +742,7 @@
748
742
  var type = CSS_PROPERTIES[hyphenated];
749
743
 
750
744
  if (type) {
745
+
751
746
  // append pixel unit, unless present
752
747
  if (type === LENGTH_ATTR && typeof value === 'number') {
753
748
  value = String(value) + 'px';
@@ -793,38 +788,24 @@
793
788
  }
794
789
 
795
790
  /**
796
- * Clear utility
791
+ * Taken from https://github.com/component/classes
792
+ *
793
+ * Without the component bits.
797
794
  */
798
- function index(arr, obj) {
799
- if (arr.indexOf) {
800
- return arr.indexOf(obj);
801
- }
802
-
803
-
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
795
 
815
- var toString$1 = Object.prototype.toString;
796
+ /**
797
+ * toString reference.
798
+ */
816
799
 
817
- function defined(o) {
818
- return typeof o !== 'undefined';
819
- }
800
+ const toString$1 = Object.prototype.toString;
820
801
 
821
802
  /**
822
- * Wrap `el` in a `ClassList`.
823
- *
824
- * @param {Element} el
825
- * @return {ClassList}
826
- * @api public
827
- */
803
+ * Wrap `el` in a `ClassList`.
804
+ *
805
+ * @param {Element} el
806
+ * @return {ClassList}
807
+ * @api public
808
+ */
828
809
 
829
810
  function classes$1(el) {
830
811
  return new ClassList$1(el);
@@ -839,79 +820,48 @@
839
820
  }
840
821
 
841
822
  /**
842
- * Add class `name` if not already present.
843
- *
844
- * @param {String} name
845
- * @return {ClassList}
846
- * @api public
847
- */
823
+ * Add class `name` if not already present.
824
+ *
825
+ * @param {String} name
826
+ * @return {ClassList}
827
+ * @api public
828
+ */
848
829
 
849
830
  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
-
831
+ this.list.add(name);
870
832
  return this;
871
833
  };
872
834
 
873
835
  /**
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
- */
836
+ * Remove class `name` when present, or
837
+ * pass a regular expression to remove
838
+ * any which match.
839
+ *
840
+ * @param {String|RegExp} name
841
+ * @return {ClassList}
842
+ * @api public
843
+ */
882
844
 
883
845
  ClassList$1.prototype.remove = function(name) {
884
- if ('[object RegExp]' === toString$1.call(name)) {
846
+ if ('[object RegExp]' == toString$1.call(name)) {
885
847
  return this.removeMatching(name);
886
848
  }
887
849
 
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(' ');
850
+ this.list.remove(name);
901
851
  return this;
902
852
  };
903
853
 
904
854
  /**
905
- * Remove all classes matching `re`.
906
- *
907
- * @param {RegExp} re
908
- * @return {ClassList}
909
- * @api private
910
- */
855
+ * Remove all classes matching `re`.
856
+ *
857
+ * @param {RegExp} re
858
+ * @return {ClassList}
859
+ * @api private
860
+ */
911
861
 
912
862
  ClassList$1.prototype.removeMatching = function(re) {
913
- var arr = this.array();
914
- for (var i = 0; i < arr.length; i++) {
863
+ const arr = this.array();
864
+ for (let i = 0; i < arr.length; i++) {
915
865
  if (re.test(arr[i])) {
916
866
  this.remove(arr[i]);
917
867
  }
@@ -920,81 +870,51 @@
920
870
  };
921
871
 
922
872
  /**
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
- */
873
+ * Toggle class `name`, can force state via `force`.
874
+ *
875
+ * For browsers that support classList, but do not support `force` yet,
876
+ * the mistake will be detected and corrected.
877
+ *
878
+ * @param {String} name
879
+ * @param {Boolean} force
880
+ * @return {ClassList}
881
+ * @api public
882
+ */
933
883
 
934
884
  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);
885
+ if ('undefined' !== typeof force) {
886
+ if (force !== this.list.toggle(name, force)) {
887
+ this.list.toggle(name); // toggle again to correct
953
888
  }
954
889
  } else {
955
- if (this.has(name)) {
956
- this.remove(name);
957
- } else {
958
- this.add(name);
959
- }
890
+ this.list.toggle(name);
960
891
  }
961
-
962
892
  return this;
963
893
  };
964
894
 
965
895
  /**
966
- * Return an array of classes.
967
- *
968
- * @return {Array}
969
- * @api public
970
- */
896
+ * Return an array of classes.
897
+ *
898
+ * @return {Array}
899
+ * @api public
900
+ */
971
901
 
972
902
  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;
903
+ return Array.from(this.list);
980
904
  };
981
905
 
982
906
  /**
983
- * Check if class `name` is present.
984
- *
985
- * @param {String} name
986
- * @return {ClassList}
987
- * @api public
988
- */
907
+ * Check if class `name` is present.
908
+ *
909
+ * @param {String} name
910
+ * @return {ClassList}
911
+ * @api public
912
+ */
989
913
 
990
914
  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
- };
915
+ ClassList$1.prototype.contains = function(name) {
916
+ return this.list.contains(name);
917
+ };
998
918
 
999
919
  function remove$2(element) {
1000
920
  var parent = element.parentNode;
@@ -1046,6 +966,7 @@
1046
966
  svg = SVG_START + svg.substring(4);
1047
967
  }
1048
968
  } else {
969
+
1049
970
  // namespace svg
1050
971
  svg = SVG_START + '>' + svg + '</svg>';
1051
972
  unwrap = true;
@@ -1201,8 +1122,10 @@
1201
1122
  var i, len, attrMap, attrNode, childNodes;
1202
1123
 
1203
1124
  switch (node.nodeType) {
1125
+
1204
1126
  // TEXT
1205
1127
  case 3:
1128
+
1206
1129
  // replace special XML characters
1207
1130
  output.push(escape$1(node.textContent, TEXT_ENTITIES));
1208
1131
  break;
@@ -1266,6 +1189,7 @@
1266
1189
  }
1267
1190
 
1268
1191
  if (!isFragment(parsed)) {
1192
+
1269
1193
  // extract <svg> from parsed document
1270
1194
  parsed = parsed.documentElement;
1271
1195
  }
@@ -1536,6 +1460,21 @@
1536
1460
  return componentsToPath(rectPath);
1537
1461
  }
1538
1462
 
1463
+ function _mergeNamespaces$1(n, m) {
1464
+ m.forEach(function (e) {
1465
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
1466
+ if (k !== 'default' && !(k in n)) {
1467
+ var d = Object.getOwnPropertyDescriptor(e, k);
1468
+ Object.defineProperty(n, k, d.get ? d : {
1469
+ enumerable: true,
1470
+ get: function () { return e[k]; }
1471
+ });
1472
+ }
1473
+ });
1474
+ });
1475
+ return Object.freeze(n);
1476
+ }
1477
+
1539
1478
  /**
1540
1479
  * Flatten array, one level deep.
1541
1480
  *
@@ -1544,13 +1483,13 @@
1544
1483
  * @return {Array<?>}
1545
1484
  */
1546
1485
 
1547
- var nativeToString = Object.prototype.toString;
1548
- var nativeHasOwnProperty = Object.prototype.hasOwnProperty;
1549
- function isUndefined$1(obj) {
1486
+ var nativeToString$3 = Object.prototype.toString;
1487
+ var nativeHasOwnProperty$2 = Object.prototype.hasOwnProperty;
1488
+ function isUndefined$3(obj) {
1550
1489
  return obj === undefined;
1551
1490
  }
1552
- function isArray$1(obj) {
1553
- return nativeToString.call(obj) === '[object Array]';
1491
+ function isArray$3(obj) {
1492
+ return nativeToString$3.call(obj) === '[object Array]';
1554
1493
  }
1555
1494
  /**
1556
1495
  * Return true, if target owns a property with the given key.
@@ -1561,8 +1500,8 @@
1561
1500
  * @return {Boolean}
1562
1501
  */
1563
1502
 
1564
- function has(target, key) {
1565
- return nativeHasOwnProperty.call(target, key);
1503
+ function has$2(target, key) {
1504
+ return nativeHasOwnProperty$2.call(target, key);
1566
1505
  }
1567
1506
  /**
1568
1507
  * Iterate over collection; returning something
@@ -1574,17 +1513,17 @@
1574
1513
  * @return {Object} return result that stopped the iteration
1575
1514
  */
1576
1515
 
1577
- function forEach(collection, iterator) {
1516
+ function forEach$2(collection, iterator) {
1578
1517
  var val, result;
1579
1518
 
1580
- if (isUndefined$1(collection)) {
1519
+ if (isUndefined$3(collection)) {
1581
1520
  return;
1582
1521
  }
1583
1522
 
1584
- var convertKey = isArray$1(collection) ? toNum : identity;
1523
+ var convertKey = isArray$3(collection) ? toNum$2 : identity$2;
1585
1524
 
1586
1525
  for (var key in collection) {
1587
- if (has(collection, key)) {
1526
+ if (has$2(collection, key)) {
1588
1527
  val = collection[key];
1589
1528
  result = iterator(val, convertKey(key));
1590
1529
 
@@ -1595,11 +1534,11 @@
1595
1534
  }
1596
1535
  }
1597
1536
 
1598
- function identity(arg) {
1537
+ function identity$2(arg) {
1599
1538
  return arg;
1600
1539
  }
1601
1540
 
1602
- function toNum(arg) {
1541
+ function toNum$2(arg) {
1603
1542
  return Number(arg);
1604
1543
  }
1605
1544
 
@@ -1611,19 +1550,15 @@
1611
1550
  *
1612
1551
  * @return {Element} the element
1613
1552
  */
1614
- function assign$1(element) {
1615
- var target = element.style;
1553
+ function assign$3(element, ...styleSources) {
1554
+ const target = element.style;
1616
1555
 
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
- }
1620
-
1621
- forEach(styleSources, function (style) {
1556
+ forEach$2(styleSources, function(style) {
1622
1557
  if (!style) {
1623
1558
  return;
1624
1559
  }
1625
1560
 
1626
- forEach(style, function (value, key) {
1561
+ forEach$2(style, function(value, key) {
1627
1562
  target[key] = value;
1628
1563
  });
1629
1564
  });
@@ -1640,6 +1575,7 @@
1640
1575
  * @api public
1641
1576
  */
1642
1577
  function attr(el, name, val) {
1578
+
1643
1579
  // get
1644
1580
  if (arguments.length == 2) {
1645
1581
  return el.getAttribute(name);
@@ -1656,33 +1592,17 @@
1656
1592
  return el;
1657
1593
  }
1658
1594
 
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
1595
  /**
1670
1596
  * Taken from https://github.com/component/classes
1671
1597
  *
1672
1598
  * Without the component bits.
1673
1599
  */
1674
1600
 
1675
- /**
1676
- * Whitespace regexp.
1677
- */
1678
-
1679
- var re = /\s+/;
1680
-
1681
1601
  /**
1682
1602
  * toString reference.
1683
1603
  */
1684
1604
 
1685
- var toString = Object.prototype.toString;
1605
+ const toString = Object.prototype.toString;
1686
1606
 
1687
1607
  /**
1688
1608
  * Wrap `el` in a `ClassList`.
@@ -1719,18 +1639,8 @@
1719
1639
  * @api public
1720
1640
  */
1721
1641
 
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(' ');
1642
+ ClassList.prototype.add = function(name) {
1643
+ this.list.add(name);
1734
1644
  return this;
1735
1645
  };
1736
1646
 
@@ -1744,22 +1654,12 @@
1744
1654
  * @api public
1745
1655
  */
1746
1656
 
1747
- ClassList.prototype.remove = function (name) {
1657
+ ClassList.prototype.remove = function(name) {
1748
1658
  if ('[object RegExp]' == toString.call(name)) {
1749
1659
  return this.removeMatching(name);
1750
1660
  }
1751
1661
 
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(' ');
1662
+ this.list.remove(name);
1763
1663
  return this;
1764
1664
  };
1765
1665
 
@@ -1771,9 +1671,9 @@
1771
1671
  * @api private
1772
1672
  */
1773
1673
 
1774
- ClassList.prototype.removeMatching = function (re) {
1775
- var arr = this.array();
1776
- for (var i = 0; i < arr.length; i++) {
1674
+ ClassList.prototype.removeMatching = function(re) {
1675
+ const arr = this.array();
1676
+ for (let i = 0; i < arr.length; i++) {
1777
1677
  if (re.test(arr[i])) {
1778
1678
  this.remove(arr[i]);
1779
1679
  }
@@ -1793,34 +1693,14 @@
1793
1693
  * @api public
1794
1694
  */
1795
1695
 
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
1696
+ ClassList.prototype.toggle = function(name, force) {
1810
1697
  if ('undefined' !== typeof force) {
1811
- if (!force) {
1812
- this.remove(name);
1813
- } else {
1814
- this.add(name);
1698
+ if (force !== this.list.toggle(name, force)) {
1699
+ this.list.toggle(name); // toggle again to correct
1815
1700
  }
1816
1701
  } else {
1817
- if (this.has(name)) {
1818
- this.remove(name);
1819
- } else {
1820
- this.add(name);
1821
- }
1702
+ this.list.toggle(name);
1822
1703
  }
1823
-
1824
1704
  return this;
1825
1705
  };
1826
1706
 
@@ -1831,12 +1711,8 @@
1831
1711
  * @api public
1832
1712
  */
1833
1713
 
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;
1714
+ ClassList.prototype.array = function() {
1715
+ return Array.from(this.list);
1840
1716
  };
1841
1717
 
1842
1718
  /**
@@ -1847,8 +1723,9 @@
1847
1723
  * @api public
1848
1724
  */
1849
1725
 
1850
- ClassList.prototype.has = ClassList.prototype.contains = function (name) {
1851
- return this.list ? this.list.contains(name) : !!~indexof(this.array(), name);
1726
+ ClassList.prototype.has =
1727
+ ClassList.prototype.contains = function(name) {
1728
+ return this.list.contains(name);
1852
1729
  };
1853
1730
 
1854
1731
  /**
@@ -1866,33 +1743,14 @@
1866
1743
  return el;
1867
1744
  }
1868
1745
 
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
1746
  /**
1880
- * Match `el` to `selector`.
1747
+ * @param { HTMLElement } element
1748
+ * @param { String } selector
1881
1749
  *
1882
- * @param {Element} el
1883
- * @param {String} selector
1884
- * @return {Boolean}
1885
- * @api public
1750
+ * @return { boolean }
1886
1751
  */
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;
1752
+ function matches(element, selector) {
1753
+ return element && typeof element.matches === 'function' && element.matches(selector);
1896
1754
  }
1897
1755
 
1898
1756
  /**
@@ -1902,23 +1760,26 @@
1902
1760
  * @param {String} selector
1903
1761
  * @param {Boolean} checkYourSelf (optional)
1904
1762
  */
1905
- function closest (element, selector, checkYourSelf) {
1763
+ function closest(element, selector, checkYourSelf) {
1906
1764
  var currentElem = checkYourSelf ? element : element.parentNode;
1907
1765
 
1908
- while (currentElem && currentElem.nodeType !== document.DOCUMENT_NODE && currentElem.nodeType !== document.DOCUMENT_FRAGMENT_NODE) {
1766
+ while (currentElem && currentElem.nodeType !== document.DOCUMENT_NODE &&
1767
+ currentElem.nodeType !== document.DOCUMENT_FRAGMENT_NODE) {
1909
1768
 
1910
- if (matchesSelector(currentElem, selector)) {
1769
+ if (matches(currentElem, selector)) {
1911
1770
  return currentElem;
1912
1771
  }
1913
1772
 
1914
1773
  currentElem = currentElem.parentNode;
1915
1774
  }
1916
1775
 
1917
- return matchesSelector(currentElem, selector) ? currentElem : null;
1776
+ return matches(currentElem, selector) ? currentElem : null;
1918
1777
  }
1919
1778
 
1779
+ var componentEvent = {};
1780
+
1920
1781
  var bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent',
1921
- unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
1782
+ unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
1922
1783
  prefix$6 = bind$1 !== 'addEventListener' ? 'on' : '';
1923
1784
 
1924
1785
  /**
@@ -1932,7 +1793,7 @@
1932
1793
  * @api public
1933
1794
  */
1934
1795
 
1935
- var bind_1 = function(el, type, fn, capture){
1796
+ var bind_1 = componentEvent.bind = function(el, type, fn, capture){
1936
1797
  el[bind$1](prefix$6 + type, fn, capture || false);
1937
1798
  return fn;
1938
1799
  };
@@ -1948,15 +1809,17 @@
1948
1809
  * @api public
1949
1810
  */
1950
1811
 
1951
- var unbind_1 = function(el, type, fn, capture){
1952
- el[unbind](prefix$6 + type, fn, capture || false);
1812
+ var unbind_1 = componentEvent.unbind = function(el, type, fn, capture){
1813
+ el[unbind$1](prefix$6 + type, fn, capture || false);
1953
1814
  return fn;
1954
1815
  };
1955
1816
 
1956
- var componentEvent = {
1957
- bind: bind_1,
1958
- unbind: unbind_1
1959
- };
1817
+ var event = /*#__PURE__*/_mergeNamespaces$1({
1818
+ __proto__: null,
1819
+ bind: bind_1,
1820
+ unbind: unbind_1,
1821
+ 'default': componentEvent
1822
+ }, [componentEvent]);
1960
1823
 
1961
1824
  /**
1962
1825
  * Module dependencies.
@@ -1978,14 +1841,14 @@
1978
1841
 
1979
1842
  // Some events don't bubble, so we want to bind to the capture phase instead
1980
1843
  // when delegating.
1981
- var forceCaptureEvents = ['focus', 'blur'];
1844
+ var forceCaptureEvents = [ 'focus', 'blur' ];
1982
1845
 
1983
1846
  function bind$2(el, selector, type, fn, capture) {
1984
1847
  if (forceCaptureEvents.indexOf(type) !== -1) {
1985
1848
  capture = true;
1986
1849
  }
1987
1850
 
1988
- return componentEvent.bind(el, type, function (e) {
1851
+ return event.bind(el, type, function(e) {
1989
1852
  var target = e.target || e.srcElement;
1990
1853
  e.delegateTarget = closest(target, selector, true);
1991
1854
  if (e.delegateTarget) {
@@ -2003,17 +1866,17 @@
2003
1866
  * @param {Boolean} capture
2004
1867
  * @api public
2005
1868
  */
2006
- function unbind$1(el, type, fn, capture) {
1869
+ function unbind(el, type, fn, capture) {
2007
1870
  if (forceCaptureEvents.indexOf(type) !== -1) {
2008
1871
  capture = true;
2009
1872
  }
2010
1873
 
2011
- return componentEvent.unbind(el, type, fn, capture);
1874
+ return event.unbind(el, type, fn, capture);
2012
1875
  }
2013
1876
 
2014
1877
  var delegate = {
2015
1878
  bind: bind$2,
2016
- unbind: unbind$1
1879
+ unbind
2017
1880
  };
2018
1881
 
2019
1882
  /**
@@ -2042,7 +1905,7 @@
2042
1905
  * Wrap map from jquery.
2043
1906
  */
2044
1907
 
2045
- var map$1 = {
1908
+ var map = {
2046
1909
  legend: [1, '<fieldset>', '</fieldset>'],
2047
1910
  tr: [2, '<table><tbody>', '</tbody></table>'],
2048
1911
  col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
@@ -2051,27 +1914,27 @@
2051
1914
  _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
2052
1915
  };
2053
1916
 
2054
- map$1.td =
2055
- map$1.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
1917
+ map.td =
1918
+ map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
2056
1919
 
2057
- map$1.option =
2058
- map$1.optgroup = [1, '<select multiple="multiple">', '</select>'];
1920
+ map.option =
1921
+ map.optgroup = [1, '<select multiple="multiple">', '</select>'];
2059
1922
 
2060
- map$1.thead =
2061
- map$1.tbody =
2062
- map$1.colgroup =
2063
- map$1.caption =
2064
- map$1.tfoot = [1, '<table>', '</table>'];
1923
+ map.thead =
1924
+ map.tbody =
1925
+ map.colgroup =
1926
+ map.caption =
1927
+ map.tfoot = [1, '<table>', '</table>'];
2065
1928
 
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>'];
1929
+ map.polyline =
1930
+ map.ellipse =
1931
+ map.polygon =
1932
+ map.circle =
1933
+ map.text =
1934
+ map.line =
1935
+ map.path =
1936
+ map.rect =
1937
+ map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
2075
1938
 
2076
1939
  /**
2077
1940
  * Parse `html` and return a DOM Node instance, which could be a TextNode,
@@ -2106,7 +1969,7 @@
2106
1969
  }
2107
1970
 
2108
1971
  // wrap map
2109
- var wrap = map$1[tag] || map$1._default;
1972
+ var wrap = Object.prototype.hasOwnProperty.call(map, tag) ? map[tag] : map._default;
2110
1973
  var depth = wrap[0];
2111
1974
  var prefix = wrap[1];
2112
1975
  var suffix = wrap[2];
@@ -2128,6 +1991,8 @@
2128
1991
  return fragment;
2129
1992
  }
2130
1993
 
1994
+ var domify$1 = domify;
1995
+
2131
1996
  function query(selector, el) {
2132
1997
  el = el || document;
2133
1998
 
@@ -2379,7 +2244,7 @@
2379
2244
  var computeStyle = styles.computeStyle;
2380
2245
 
2381
2246
  function addMarker(id, options) {
2382
- var attrs = assign({
2247
+ var attrs = assign$4({
2383
2248
  fill: black,
2384
2249
  strokeWidth: 1,
2385
2250
  strokeLinecap: 'round',
@@ -2551,7 +2416,7 @@
2551
2416
 
2552
2417
  function drawCircle(parentGfx, width, height, offset, attrs) {
2553
2418
 
2554
- if (isObject(offset)) {
2419
+ if (isObject$1(offset)) {
2555
2420
  attrs = offset;
2556
2421
  offset = 0;
2557
2422
  }
@@ -2586,7 +2451,7 @@
2586
2451
 
2587
2452
  function drawRect(parentGfx, width, height, r, offset, attrs) {
2588
2453
 
2589
- if (isObject(offset)) {
2454
+ if (isObject$1(offset)) {
2590
2455
  attrs = offset;
2591
2456
  offset = 0;
2592
2457
  }
@@ -2674,7 +2539,7 @@
2674
2539
  }
2675
2540
 
2676
2541
  function drawMarker(type, parentGfx, path, attrs) {
2677
- return drawPath(parentGfx, path, assign({ 'data-marker': type }, attrs));
2542
+ return drawPath(parentGfx, path, assign$4({ 'data-marker': type }, attrs));
2678
2543
  }
2679
2544
 
2680
2545
  function renderer(type) {
@@ -2746,7 +2611,7 @@
2746
2611
 
2747
2612
  function renderLabel(parentGfx, label, options) {
2748
2613
 
2749
- options = assign({
2614
+ options = assign$4({
2750
2615
  size: {
2751
2616
  width: 100
2752
2617
  }
@@ -2786,7 +2651,7 @@
2786
2651
  return renderLabel(parentGfx, getLabel(element), {
2787
2652
  box: box,
2788
2653
  fitBox: true,
2789
- style: assign(
2654
+ style: assign$4(
2790
2655
  {},
2791
2656
  textRenderer.getExternalStyle(),
2792
2657
  {
@@ -3388,7 +3253,7 @@
3388
3253
  return task;
3389
3254
  },
3390
3255
  'bpmn:SubProcess': function(parentGfx, element, attrs) {
3391
- attrs = assign({
3256
+ attrs = assign$4({
3392
3257
  fill: getFillColor(element, defaultFillColor),
3393
3258
  stroke: getStrokeColor(element, defaultStrokeColor)
3394
3259
  }, attrs);
@@ -3474,7 +3339,7 @@
3474
3339
  return lane;
3475
3340
  },
3476
3341
  'bpmn:Lane': function(parentGfx, element, attrs) {
3477
- var rect = drawRect(parentGfx, element.width, element.height, 0, assign({
3342
+ var rect = drawRect(parentGfx, element.width, element.height, 0, assign$4({
3478
3343
  fill: getFillColor(element, defaultFillColor),
3479
3344
  fillOpacity: HIGH_FILL_OPACITY,
3480
3345
  stroke: getStrokeColor(element, defaultStrokeColor)
@@ -3696,7 +3561,7 @@
3696
3561
  var fill = getFillColor(element, defaultFillColor),
3697
3562
  stroke = getStrokeColor(element, defaultStrokeColor);
3698
3563
 
3699
- attrs = assign({
3564
+ attrs = assign$4({
3700
3565
  strokeDasharray: '0.5, 5',
3701
3566
  strokeLinecap: 'round',
3702
3567
  strokeLinejoin: 'round',
@@ -3884,12 +3749,12 @@
3884
3749
  }
3885
3750
 
3886
3751
  // apply fillOpacity
3887
- var outerAttrs = assign({}, attrs, {
3752
+ var outerAttrs = assign$4({}, attrs, {
3888
3753
  fillOpacity: 1
3889
3754
  });
3890
3755
 
3891
3756
  // apply no-fill
3892
- var innerAttrs = assign({}, attrs, {
3757
+ var innerAttrs = assign$4({}, attrs, {
3893
3758
  fill: 'none'
3894
3759
  });
3895
3760
 
@@ -4112,7 +3977,7 @@
4112
3977
  };
4113
3978
  }
4114
3979
 
4115
- forEach$1(taskMarkers, function(marker) {
3980
+ forEach$3(taskMarkers, function(marker) {
4116
3981
  renderer(marker)(parentGfx, element, position);
4117
3982
  });
4118
3983
 
@@ -4240,8 +4105,8 @@
4240
4105
 
4241
4106
  function parsePadding(padding) {
4242
4107
 
4243
- if (isObject(padding)) {
4244
- return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
4108
+ if (isObject$1(padding)) {
4109
+ return assign$4({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
4245
4110
  } else {
4246
4111
  return {
4247
4112
  top: padding,
@@ -4405,7 +4270,7 @@
4405
4270
  id: 'helper-svg'
4406
4271
  });
4407
4272
 
4408
- assign$1(helperSvg, {
4273
+ assign$3(helperSvg, {
4409
4274
  visibility: 'hidden',
4410
4275
  position: 'fixed',
4411
4276
  width: 0,
@@ -4430,7 +4295,7 @@
4430
4295
  */
4431
4296
  function Text(config) {
4432
4297
 
4433
- this._config = assign({}, {
4298
+ this._config = assign$4({}, {
4434
4299
  size: DEFAULT_LABEL_SIZE$1,
4435
4300
  padding: DEFAULT_BOX_PADDING,
4436
4301
  style: {},
@@ -4479,8 +4344,8 @@
4479
4344
  * @return {Object} { element, dimensions }
4480
4345
  */
4481
4346
  Text.prototype.layoutText = function(text, options) {
4482
- var box = assign({}, this._config.size, options.box),
4483
- style = assign({}, this._config.style, options.style),
4347
+ var box = assign$4({}, this._config.size, options.box),
4348
+ style = assign$4({}, this._config.style, options.style),
4484
4349
  align = parseAlign(options.align || this._config.align),
4485
4350
  padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding),
4486
4351
  fitBox = options.fitBox || false;
@@ -4536,7 +4401,7 @@
4536
4401
 
4537
4402
  // layout each line taking into account that parent
4538
4403
  // shape might resize to fit text size
4539
- forEach$1(layouted, function(line) {
4404
+ forEach$3(layouted, function(line) {
4540
4405
 
4541
4406
  var x;
4542
4407
 
@@ -4595,7 +4460,7 @@
4595
4460
 
4596
4461
  function TextRenderer(config) {
4597
4462
 
4598
- var defaultStyle = assign({
4463
+ var defaultStyle = assign$4({
4599
4464
  fontFamily: 'Arial, sans-serif',
4600
4465
  fontSize: DEFAULT_FONT_SIZE,
4601
4466
  fontWeight: 'normal',
@@ -4604,7 +4469,7 @@
4604
4469
 
4605
4470
  var fontSize = parseInt(defaultStyle.fontSize, 10) - 1;
4606
4471
 
4607
- var externalStyle = assign({}, defaultStyle, {
4472
+ var externalStyle = assign$4({}, defaultStyle, {
4608
4473
  fontSize: fontSize
4609
4474
  }, config && config.externalStyle || {});
4610
4475
 
@@ -5340,7 +5205,7 @@
5340
5205
  size = DEFAULT_LABEL_SIZE;
5341
5206
  }
5342
5207
 
5343
- return assign({
5208
+ return assign$4({
5344
5209
  x: mid.x - size.width / 2,
5345
5210
  y: mid.y - size.height / 2
5346
5211
  }, size);
@@ -5510,7 +5375,7 @@
5510
5375
  * @return {Object}
5511
5376
  */
5512
5377
  function elementData(semantic, di, attrs) {
5513
- return assign({
5378
+ return assign$4({
5514
5379
  id: semantic.id,
5515
5380
  type: semantic.$type,
5516
5381
  businessObject: semantic,
@@ -6048,13 +5913,13 @@
6048
5913
  }
6049
5914
 
6050
5915
  function registerEvents(svg) {
6051
- forEach$1(bindings, function(val, key) {
5916
+ forEach$3(bindings, function(val, key) {
6052
5917
  registerEvent(svg, key, val);
6053
5918
  });
6054
5919
  }
6055
5920
 
6056
5921
  function unregisterEvents(svg) {
6057
- forEach$1(bindings, function(val, key) {
5922
+ forEach$3(bindings, function(val, key) {
6058
5923
  unregisterEvent(svg, key, val);
6059
5924
  });
6060
5925
  }
@@ -6125,7 +5990,7 @@
6125
5990
 
6126
5991
  function createHitStyle(classNames, attrs) {
6127
5992
 
6128
- attrs = assign({
5993
+ attrs = assign$4({
6129
5994
  stroke: 'white',
6130
5995
  strokeWidth: 15
6131
5996
  }, attrs || {});
@@ -6164,7 +6029,7 @@
6164
6029
  this.removeHits = function(gfx) {
6165
6030
  var hits = all('.djs-hit', gfx);
6166
6031
 
6167
- forEach$1(hits, remove$2);
6032
+ forEach$3(hits, remove$2);
6168
6033
  };
6169
6034
 
6170
6035
  /**
@@ -6223,7 +6088,7 @@
6223
6088
  */
6224
6089
  this.createBoxHit = function(gfx, type, attrs) {
6225
6090
 
6226
- attrs = assign({
6091
+ attrs = assign$4({
6227
6092
  x: 0,
6228
6093
  y: 0
6229
6094
  }, attrs);
@@ -6380,7 +6245,7 @@
6380
6245
  function getBBox(elements, stopRecursion) {
6381
6246
 
6382
6247
  stopRecursion = !!stopRecursion;
6383
- if (!isArray$2(elements)) {
6248
+ if (!isArray$4(elements)) {
6384
6249
  elements = [ elements ];
6385
6250
  }
6386
6251
 
@@ -6389,7 +6254,7 @@
6389
6254
  maxX,
6390
6255
  maxY;
6391
6256
 
6392
- forEach$1(elements, function(element) {
6257
+ forEach$3(elements, function(element) {
6393
6258
 
6394
6259
  // If element is a connection the bbox must be computed first
6395
6260
  var bbox = element;
@@ -6468,7 +6333,7 @@
6468
6333
  function createOutline(gfx, bounds) {
6469
6334
  var outline = create$1('rect');
6470
6335
 
6471
- attr$1(outline, assign({
6336
+ attr$1(outline, assign$4({
6472
6337
  x: 10,
6473
6338
  y: 10,
6474
6339
  rx: 3,
@@ -6627,7 +6492,7 @@
6627
6492
  var selectedElements = this._selectedElements,
6628
6493
  oldSelection = selectedElements.slice();
6629
6494
 
6630
- if (!isArray$2(elements)) {
6495
+ if (!isArray$4(elements)) {
6631
6496
  elements = elements ? [ elements ] : [];
6632
6497
  }
6633
6498
 
@@ -6644,7 +6509,7 @@
6644
6509
  // selection may be cleared by passing an empty array or null
6645
6510
  // to the method
6646
6511
  if (add) {
6647
- forEach$1(elements, function(element) {
6512
+ forEach$3(elements, function(element) {
6648
6513
  if (selectedElements.indexOf(element) !== -1) {
6649
6514
 
6650
6515
  // already selected
@@ -6713,13 +6578,13 @@
6713
6578
  var oldSelection = event.oldSelection,
6714
6579
  newSelection = event.newSelection;
6715
6580
 
6716
- forEach$1(oldSelection, function(e) {
6581
+ forEach$3(oldSelection, function(e) {
6717
6582
  if (newSelection.indexOf(e) === -1) {
6718
6583
  deselect(e);
6719
6584
  }
6720
6585
  });
6721
6586
 
6722
- forEach$1(newSelection, function(e) {
6587
+ forEach$3(newSelection, function(e) {
6723
6588
  if (oldSelection.indexOf(e) === -1) {
6724
6589
  select(e);
6725
6590
  }
@@ -6761,7 +6626,7 @@
6761
6626
 
6762
6627
  var rect = create$1('rect');
6763
6628
 
6764
- attr$1(rect, assign({
6629
+ attr$1(rect, assign$4({
6765
6630
  rx: 3
6766
6631
  }, bBox));
6767
6632
 
@@ -6798,7 +6663,7 @@
6798
6663
  return;
6799
6664
  }
6800
6665
 
6801
- if (isArray$2(autoSelect)) {
6666
+ if (isArray$4(autoSelect)) {
6802
6667
  selection.select(autoSelect);
6803
6668
  } else {
6804
6669
 
@@ -6825,7 +6690,7 @@
6825
6690
  var shape = elementRegistry.get(event.context.shape.id);
6826
6691
 
6827
6692
  // Always select main shape on move
6828
- var isSelected = find(previousSelection, function(selectedShape) {
6693
+ var isSelected = find$1(previousSelection, function(selectedShape) {
6829
6694
  return shape.id === selectedShape.id;
6830
6695
  });
6831
6696
 
@@ -7004,7 +6869,7 @@
7004
6869
 
7005
6870
  this._ids = ids;
7006
6871
 
7007
- this._overlayDefaults = assign({
6872
+ this._overlayDefaults = assign$4({
7008
6873
 
7009
6874
  // no show constraints
7010
6875
  show: null,
@@ -7066,11 +6931,11 @@
7066
6931
  */
7067
6932
  Overlays.prototype.get = function(search) {
7068
6933
 
7069
- if (isString(search)) {
6934
+ if (isString$3(search)) {
7070
6935
  search = { id: search };
7071
6936
  }
7072
6937
 
7073
- if (isString(search.element)) {
6938
+ if (isString$3(search.element)) {
7074
6939
  search.element = this._elementRegistry.get(search.element);
7075
6940
  }
7076
6941
 
@@ -7079,13 +6944,13 @@
7079
6944
 
7080
6945
  // return a list of overlays when searching by element (+type)
7081
6946
  if (container) {
7082
- return search.type ? filter(container.overlays, matchPattern({ type: search.type })) : container.overlays.slice();
6947
+ return search.type ? filter$1(container.overlays, matchPattern({ type: search.type })) : container.overlays.slice();
7083
6948
  } else {
7084
6949
  return [];
7085
6950
  }
7086
6951
  } else
7087
6952
  if (search.type) {
7088
- return filter(this._overlays, matchPattern({ type: search.type }));
6953
+ return filter$1(this._overlays, matchPattern({ type: search.type }));
7089
6954
  } else {
7090
6955
 
7091
6956
  // return single element when searching by id
@@ -7118,7 +6983,7 @@
7118
6983
  */
7119
6984
  Overlays.prototype.add = function(element, type, overlay) {
7120
6985
 
7121
- if (isObject(type)) {
6986
+ if (isObject$1(type)) {
7122
6987
  overlay = type;
7123
6988
  type = null;
7124
6989
  }
@@ -7141,7 +7006,7 @@
7141
7006
 
7142
7007
  var id = this._ids.next();
7143
7008
 
7144
- overlay = assign({}, this._overlayDefaults, overlay, {
7009
+ overlay = assign$4({}, this._overlayDefaults, overlay, {
7145
7010
  id: id,
7146
7011
  type: type,
7147
7012
  element: element,
@@ -7165,13 +7030,13 @@
7165
7030
 
7166
7031
  var overlays = this.get(filter) || [];
7167
7032
 
7168
- if (!isArray$2(overlays)) {
7033
+ if (!isArray$4(overlays)) {
7169
7034
  overlays = [ overlays ];
7170
7035
  }
7171
7036
 
7172
7037
  var self = this;
7173
7038
 
7174
- forEach$1(overlays, function(overlay) {
7039
+ forEach$3(overlays, function(overlay) {
7175
7040
 
7176
7041
  var container = self._getOverlayContainer(overlay.element, true);
7177
7042
 
@@ -7280,8 +7145,8 @@
7280
7145
 
7281
7146
 
7282
7147
  Overlays.prototype._createOverlayContainer = function(element) {
7283
- var html = domify('<div class="djs-overlays" />');
7284
- assign$1(html, { position: 'absolute' });
7148
+ var html = domify$1('<div class="djs-overlays" />');
7149
+ assign$3(html, { position: 'absolute' });
7285
7150
 
7286
7151
  this._overlayRoot.appendChild(html);
7287
7152
 
@@ -7318,7 +7183,7 @@
7318
7183
 
7319
7184
 
7320
7185
  Overlays.prototype._getOverlayContainer = function(element, raw) {
7321
- var container = find(this._overlayContainers, function(c) {
7186
+ var container = find$1(this._overlayContainers, function(c) {
7322
7187
  return c.element === element;
7323
7188
  });
7324
7189
 
@@ -7346,14 +7211,14 @@
7346
7211
 
7347
7212
  // create proper html elements from
7348
7213
  // overlay HTML strings
7349
- if (isString(html)) {
7350
- html = domify(html);
7214
+ if (isString$3(html)) {
7215
+ html = domify$1(html);
7351
7216
  }
7352
7217
 
7353
7218
  overlayContainer = this._getOverlayContainer(element);
7354
7219
 
7355
- htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '">');
7356
- assign$1(htmlContainer, { position: 'absolute' });
7220
+ htmlContainer = domify$1('<div class="djs-overlay" data-overlay-id="' + id + '">');
7221
+ assign$3(htmlContainer, { position: 'absolute' });
7357
7222
 
7358
7223
  htmlContainer.appendChild(html);
7359
7224
 
@@ -7443,7 +7308,7 @@
7443
7308
 
7444
7309
  var self = this;
7445
7310
 
7446
- forEach$1(this._overlays, function(overlay) {
7311
+ forEach$3(this._overlays, function(overlay) {
7447
7312
  self._updateOverlayVisibilty(overlay, viewbox);
7448
7313
  });
7449
7314
  };
@@ -7480,7 +7345,7 @@
7480
7345
  var element = e.element;
7481
7346
  var overlays = self.get({ element: element });
7482
7347
 
7483
- forEach$1(overlays, function(o) {
7348
+ forEach$3(overlays, function(o) {
7484
7349
  self.remove(o.id);
7485
7350
  });
7486
7351
 
@@ -7504,7 +7369,7 @@
7504
7369
  var container = self._getOverlayContainer(element, true);
7505
7370
 
7506
7371
  if (container) {
7507
- forEach$1(container.overlays, function(overlay) {
7372
+ forEach$3(container.overlays, function(overlay) {
7508
7373
  self._updateOverlay(overlay);
7509
7374
  });
7510
7375
 
@@ -7537,11 +7402,11 @@
7537
7402
  // helpers /////////////////////////////
7538
7403
 
7539
7404
  function createRoot(parentNode) {
7540
- var root = domify(
7405
+ var root = domify$1(
7541
7406
  '<div class="djs-overlay-container" />'
7542
7407
  );
7543
7408
 
7544
- assign$1(root, {
7409
+ assign$3(root, {
7545
7410
  position: 'absolute',
7546
7411
  width: 0,
7547
7412
  height: 0
@@ -7553,7 +7418,7 @@
7553
7418
  }
7554
7419
 
7555
7420
  function setPosition(el, x, y) {
7556
- assign$1(el, { left: x + 'px', top: y + 'px' });
7421
+ assign$3(el, { left: x + 'px', top: y + 'px' });
7557
7422
  }
7558
7423
 
7559
7424
  /**
@@ -7699,7 +7564,7 @@
7699
7564
  */
7700
7565
  CommandInterceptor.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
7701
7566
 
7702
- if (isFunction(hook) || isNumber(hook)) {
7567
+ if (isFunction$1(hook) || isNumber(hook)) {
7703
7568
  that = unwrap;
7704
7569
  unwrap = handlerFn;
7705
7570
  handlerFn = priority;
@@ -7707,29 +7572,29 @@
7707
7572
  hook = null;
7708
7573
  }
7709
7574
 
7710
- if (isFunction(priority)) {
7575
+ if (isFunction$1(priority)) {
7711
7576
  that = unwrap;
7712
7577
  unwrap = handlerFn;
7713
7578
  handlerFn = priority;
7714
7579
  priority = DEFAULT_PRIORITY$1;
7715
7580
  }
7716
7581
 
7717
- if (isObject(unwrap)) {
7582
+ if (isObject$1(unwrap)) {
7718
7583
  that = unwrap;
7719
7584
  unwrap = false;
7720
7585
  }
7721
7586
 
7722
- if (!isFunction(handlerFn)) {
7587
+ if (!isFunction$1(handlerFn)) {
7723
7588
  throw new Error('handlerFn must be a function');
7724
7589
  }
7725
7590
 
7726
- if (!isArray$2(events)) {
7591
+ if (!isArray$4(events)) {
7727
7592
  events = [ events ];
7728
7593
  }
7729
7594
 
7730
7595
  var eventBus = this._eventBus;
7731
7596
 
7732
- forEach$1(events, function(event) {
7597
+ forEach$3(events, function(event) {
7733
7598
 
7734
7599
  // concat commandStack(.event)?(.hook)?
7735
7600
  var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
@@ -7757,7 +7622,7 @@
7757
7622
  * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
7758
7623
  * which will in term forward to CommandInterceptor#on.
7759
7624
  */
7760
- forEach$1(hooks, function(hook) {
7625
+ forEach$3(hooks, function(hook) {
7761
7626
 
7762
7627
  /**
7763
7628
  * {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}
@@ -7773,7 +7638,7 @@
7773
7638
  */
7774
7639
  CommandInterceptor.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {
7775
7640
 
7776
- if (isFunction(events) || isNumber(events)) {
7641
+ if (isFunction$1(events) || isNumber(events)) {
7777
7642
  that = unwrap;
7778
7643
  unwrap = handlerFn;
7779
7644
  handlerFn = priority;
@@ -7981,7 +7846,7 @@
7981
7846
  * @param {canvas} canvas
7982
7847
  */
7983
7848
  function DrilldownBreadcrumbs(eventBus, elementRegistry, overlays, canvas) {
7984
- var breadcrumbs = domify('<ul class="bjs-breadcrumbs"></ul>');
7849
+ var breadcrumbs = domify$1('<ul class="bjs-breadcrumbs"></ul>');
7985
7850
  var container = canvas.getContainer();
7986
7851
  var containerClasses = classes(container);
7987
7852
  container.appendChild(breadcrumbs);
@@ -7993,7 +7858,7 @@
7993
7858
  var shape = e.element,
7994
7859
  bo = getBusinessObject(shape);
7995
7860
 
7996
- var isPresent = find(boParents, function(el) {
7861
+ var isPresent = find$1(boParents, function(el) {
7997
7862
  return el === bo;
7998
7863
  });
7999
7864
 
@@ -8017,7 +7882,7 @@
8017
7882
 
8018
7883
  var path = boParents.map(function(parent) {
8019
7884
  var title = escapeHTML(parent.name || parent.id);
8020
- var link = domify('<li><span class="bjs-crumb"><a title="' + title + '">' + title + '</a></span></li>');
7885
+ var link = domify$1('<li><span class="bjs-crumb"><a title="' + title + '">' + title + '</a></span></li>');
8021
7886
 
8022
7887
  var parentPlane = canvas.findRoot(getPlaneIdFromShape(parent)) || canvas.findRoot(parent.id);
8023
7888
 
@@ -8557,7 +8422,7 @@
8557
8422
  this.removeOverlay(element);
8558
8423
  }
8559
8424
 
8560
- var button = domify('<button class="bjs-drilldown">' + ARROW_DOWN_SVG + '</button>');
8425
+ var button = domify$1('<button class="bjs-drilldown">' + ARROW_DOWN_SVG + '</button>');
8561
8426
 
8562
8427
  button.addEventListener('click', function() {
8563
8428
  canvas.setRootElement(canvas.findRoot(getPlaneIdFromShape(element)));
@@ -8599,7 +8464,7 @@
8599
8464
  subprocessCompatibility: [ 'type', SubprocessCompatibility ]
8600
8465
  };
8601
8466
 
8602
- var CLASS_PATTERN = /^class /;
8467
+ const CLASS_PATTERN = /^class[ {]/;
8603
8468
 
8604
8469
 
8605
8470
  /**
@@ -8616,8 +8481,8 @@
8616
8481
  *
8617
8482
  * @return {boolean}
8618
8483
  */
8619
- function isArray(obj) {
8620
- return Object.prototype.toString.call(obj) === '[object Array]';
8484
+ function isArray$2(obj) {
8485
+ return Array.isArray(obj);
8621
8486
  }
8622
8487
 
8623
8488
  /**
@@ -8641,14 +8506,15 @@
8641
8506
  *
8642
8507
  * @return {T & InjectAnnotated}
8643
8508
  */
8644
- function annotate() {
8645
- var args = Array.prototype.slice.call(arguments);
8509
+ function annotate(...args) {
8646
8510
 
8647
- if (args.length === 1 && isArray(args[0])) {
8511
+ if (args.length === 1 && isArray$2(args[0])) {
8648
8512
  args = args[0];
8649
8513
  }
8650
8514
 
8651
- var fn = args.pop();
8515
+ args = [ ...args ];
8516
+
8517
+ const fn = args.pop();
8652
8518
 
8653
8519
  fn.$inject = args;
8654
8520
 
@@ -8669,9 +8535,9 @@
8669
8535
  // first constructor(...) pattern found which may be the one
8670
8536
  // of a nested class, too.
8671
8537
 
8672
- var CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m;
8673
- var FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m;
8674
- var FN_ARG = /\/\*([^*]*)\*\//m;
8538
+ const CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m;
8539
+ const FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m;
8540
+ const FN_ARG = /\/\*([^*]*)\*\//m;
8675
8541
 
8676
8542
  /**
8677
8543
  * @param {unknown} fn
@@ -8681,20 +8547,20 @@
8681
8547
  function parseAnnotations(fn) {
8682
8548
 
8683
8549
  if (typeof fn !== 'function') {
8684
- throw new Error('Cannot annotate "' + fn + '". Expected a function!');
8550
+ throw new Error(`Cannot annotate "${fn}". Expected a function!`);
8685
8551
  }
8686
8552
 
8687
- var match = fn.toString().match(isClass(fn) ? CONSTRUCTOR_ARGS : FN_ARGS);
8553
+ const match = fn.toString().match(isClass(fn) ? CONSTRUCTOR_ARGS : FN_ARGS);
8688
8554
 
8689
8555
  // may parse class without constructor
8690
8556
  if (!match) {
8691
8557
  return [];
8692
8558
  }
8693
8559
 
8694
- var args = match[1] || match[2];
8560
+ const args = match[1] || match[2];
8695
8561
 
8696
- return args && args.split(',').map(function(arg) {
8697
- var argMatch = arg.match(FN_ARG);
8562
+ return args && args.split(',').map(arg => {
8563
+ const argMatch = arg.match(FN_ARG);
8698
8564
  return (argMatch && argMatch[1] || arg).trim();
8699
8565
  }) || [];
8700
8566
  }
@@ -8719,21 +8585,21 @@
8719
8585
  if (strict === false) {
8720
8586
  return null;
8721
8587
  } else {
8722
- throw error('No provider for "' + name + '"!');
8588
+ throw error(`No provider for "${ name }"!`);
8723
8589
  }
8724
8590
  }
8725
8591
  };
8726
8592
 
8727
- var currentlyResolving = [];
8728
- var providers = this._providers = Object.create(parent._providers || null);
8729
- var instances = this._instances = Object.create(null);
8593
+ const currentlyResolving = [];
8594
+ const providers = this._providers = Object.create(parent._providers || null);
8595
+ const instances = this._instances = Object.create(null);
8730
8596
 
8731
- var self = instances.injector = this;
8597
+ const self = instances.injector = this;
8732
8598
 
8733
- var error = function(msg) {
8734
- var stack = currentlyResolving.join(' -> ');
8599
+ const error = function(msg) {
8600
+ const stack = currentlyResolving.join(' -> ');
8735
8601
  currentlyResolving.length = 0;
8736
- return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
8602
+ return new Error(stack ? `${ msg } (Resolving: ${ stack })` : msg);
8737
8603
  };
8738
8604
 
8739
8605
  /**
@@ -8746,8 +8612,8 @@
8746
8612
  */
8747
8613
  function get(name, strict) {
8748
8614
  if (!providers[name] && name.indexOf('.') !== -1) {
8749
- var parts = name.split('.');
8750
- var pivot = get(parts.shift());
8615
+ const parts = name.split('.');
8616
+ let pivot = get(parts.shift());
8751
8617
 
8752
8618
  while (parts.length) {
8753
8619
  pivot = pivot[parts.shift()];
@@ -8783,15 +8649,15 @@
8783
8649
  }
8784
8650
 
8785
8651
  if (typeof fn !== 'function') {
8786
- if (isArray(fn)) {
8652
+ if (isArray$2(fn)) {
8787
8653
  fn = annotate(fn.slice());
8788
8654
  } else {
8789
- throw new Error('Cannot invoke "' + fn + '". Expected a function!');
8655
+ throw error(`Cannot invoke "${ fn }". Expected a function!`);
8790
8656
  }
8791
8657
  }
8792
8658
 
8793
- var inject = fn.$inject || parseAnnotations(fn);
8794
- var dependencies = inject.map(function(dep) {
8659
+ const inject = fn.$inject || parseAnnotations(fn);
8660
+ const dependencies = inject.map(dep => {
8795
8661
  if (hasOwnProp(locals, dep)) {
8796
8662
  return locals[dep];
8797
8663
  } else {
@@ -8806,22 +8672,22 @@
8806
8672
  }
8807
8673
 
8808
8674
  function instantiate(Type) {
8809
- var def = fnDef(Type);
8810
-
8811
- var fn = def.fn,
8812
- dependencies = def.dependencies;
8675
+ const {
8676
+ fn,
8677
+ dependencies
8678
+ } = fnDef(Type);
8813
8679
 
8814
8680
  // instantiate var args constructor
8815
- var Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
8681
+ const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
8816
8682
 
8817
8683
  return new Constructor();
8818
8684
  }
8819
8685
 
8820
8686
  function invoke(func, context, locals) {
8821
- var def = fnDef(func, locals);
8822
-
8823
- var fn = def.fn,
8824
- dependencies = def.dependencies;
8687
+ const {
8688
+ fn,
8689
+ dependencies
8690
+ } = fnDef(func, locals);
8825
8691
 
8826
8692
  return fn.apply(context, dependencies);
8827
8693
  }
@@ -8832,9 +8698,7 @@
8832
8698
  * @return {Function}
8833
8699
  */
8834
8700
  function createPrivateInjectorFactory(childInjector) {
8835
- return annotate(function(key) {
8836
- return childInjector.get(key);
8837
- });
8701
+ return annotate(key => childInjector.get(key));
8838
8702
  }
8839
8703
 
8840
8704
  /**
@@ -8845,18 +8709,19 @@
8845
8709
  */
8846
8710
  function createChild(modules, forceNewInstances) {
8847
8711
  if (forceNewInstances && forceNewInstances.length) {
8848
- var fromParentModule = Object.create(null);
8849
- var matchedScopes = Object.create(null);
8850
-
8851
- var privateInjectorsCache = [];
8852
- var privateChildInjectors = [];
8853
- var privateChildFactories = [];
8854
-
8855
- var provider;
8856
- var cacheIdx;
8857
- var privateChildInjector;
8858
- var privateChildInjectorFactory;
8859
- for (var name in providers) {
8712
+ const fromParentModule = Object.create(null);
8713
+ const matchedScopes = Object.create(null);
8714
+
8715
+ const privateInjectorsCache = [];
8716
+ const privateChildInjectors = [];
8717
+ const privateChildFactories = [];
8718
+
8719
+ let provider;
8720
+ let cacheIdx;
8721
+ let privateChildInjector;
8722
+ let privateChildInjectorFactory;
8723
+
8724
+ for (let name in providers) {
8860
8725
  provider = providers[name];
8861
8726
 
8862
8727
  if (forceNewInstances.indexOf(name) !== -1) {
@@ -8880,7 +8745,7 @@
8880
8745
 
8881
8746
  if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
8882
8747
  /* jshint -W083 */
8883
- forceNewInstances.forEach(function(scope) {
8748
+ forceNewInstances.forEach(scope => {
8884
8749
  if (provider[1].$scope.indexOf(scope) !== -1) {
8885
8750
  fromParentModule[name] = [ provider[2], provider[1] ];
8886
8751
  matchedScopes[scope] = true;
@@ -8889,7 +8754,7 @@
8889
8754
  }
8890
8755
  }
8891
8756
 
8892
- forceNewInstances.forEach(function(scope) {
8757
+ forceNewInstances.forEach(scope => {
8893
8758
  if (!matchedScopes[scope]) {
8894
8759
  throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
8895
8760
  }
@@ -8901,7 +8766,7 @@
8901
8766
  return new Injector(modules, self);
8902
8767
  }
8903
8768
 
8904
- var factoryMap = {
8769
+ const factoryMap = {
8905
8770
  factory: invoke,
8906
8771
  type: instantiate,
8907
8772
  value: function(value) {
@@ -8915,10 +8780,10 @@
8915
8780
  */
8916
8781
  function createInitializer(moduleDefinition, injector) {
8917
8782
 
8918
- var initializers = moduleDefinition.__init__ || [];
8783
+ const initializers = moduleDefinition.__init__ || [];
8919
8784
 
8920
8785
  return function() {
8921
- initializers.forEach(function(initializer) {
8786
+ initializers.forEach(initializer => {
8922
8787
 
8923
8788
  // eagerly resolve component (fn or string)
8924
8789
  if (typeof initializer === 'string') {
@@ -8935,13 +8800,13 @@
8935
8800
  */
8936
8801
  function loadModule(moduleDefinition) {
8937
8802
 
8938
- var moduleExports = moduleDefinition.__exports__;
8803
+ const moduleExports = moduleDefinition.__exports__;
8939
8804
 
8940
8805
  // private module
8941
8806
  if (moduleExports) {
8942
- var nestedModules = moduleDefinition.__modules__;
8807
+ const nestedModules = moduleDefinition.__modules__;
8943
8808
 
8944
- var clonedModule = Object.keys(moduleDefinition).reduce(function(clonedModule, key) {
8809
+ const clonedModule = Object.keys(moduleDefinition).reduce((clonedModule, key) => {
8945
8810
 
8946
8811
  if (key !== '__exports__' && key !== '__modules__' && key !== '__init__' && key !== '__depends__') {
8947
8812
  clonedModule[key] = moduleDefinition[key];
@@ -8950,10 +8815,10 @@
8950
8815
  return clonedModule;
8951
8816
  }, Object.create(null));
8952
8817
 
8953
- var childModules = (nestedModules || []).concat(clonedModule);
8818
+ const childModules = (nestedModules || []).concat(clonedModule);
8954
8819
 
8955
- var privateInjector = createChild(childModules);
8956
- var getFromPrivateInjector = annotate(function(key) {
8820
+ const privateInjector = createChild(childModules);
8821
+ const getFromPrivateInjector = annotate(function(key) {
8957
8822
  return privateInjector.get(key);
8958
8823
  });
8959
8824
 
@@ -8962,7 +8827,7 @@
8962
8827
  });
8963
8828
 
8964
8829
  // ensure child injector initializes
8965
- var initializers = (moduleDefinition.__init__ || []).slice();
8830
+ const initializers = (moduleDefinition.__init__ || []).slice();
8966
8831
 
8967
8832
  initializers.unshift(function() {
8968
8833
  privateInjector.init();
@@ -8987,8 +8852,8 @@
8987
8852
  return;
8988
8853
  }
8989
8854
 
8990
- var type = moduleDefinition[key][0];
8991
- var value = moduleDefinition[key][1];
8855
+ const type = moduleDefinition[key][0];
8856
+ const value = moduleDefinition[key][1];
8992
8857
 
8993
8858
  providers[key] = [ factoryMap[type], arrayUnwrap(type, value), type ];
8994
8859
  });
@@ -9024,11 +8889,11 @@
9024
8889
  */
9025
8890
  function bootstrap(moduleDefinitions) {
9026
8891
 
9027
- var initializers = moduleDefinitions
8892
+ const initializers = moduleDefinitions
9028
8893
  .reduce(resolveDependencies, [])
9029
8894
  .map(loadModule);
9030
8895
 
9031
- var initialized = false;
8896
+ let initialized = false;
9032
8897
 
9033
8898
  return function() {
9034
8899
 
@@ -9038,9 +8903,7 @@
9038
8903
 
9039
8904
  initialized = true;
9040
8905
 
9041
- initializers.forEach(function(initializer) {
9042
- return initializer();
9043
- });
8906
+ initializers.forEach(initializer => initializer());
9044
8907
  };
9045
8908
  }
9046
8909
 
@@ -9058,7 +8921,7 @@
9058
8921
  // helpers ///////////////
9059
8922
 
9060
8923
  function arrayUnwrap(type, value) {
9061
- if (type !== 'value' && isArray(value)) {
8924
+ if (type !== 'value' && isArray$2(value)) {
9062
8925
  value = annotate(value.slice());
9063
8926
  }
9064
8927
 
@@ -9103,9 +8966,9 @@
9103
8966
  });
9104
8967
 
9105
8968
  if (isFrameElement(element)) {
9106
- attr$1(rect, assign({}, this.FRAME_STYLE, attrs || {}));
8969
+ attr$1(rect, assign$4({}, this.FRAME_STYLE, attrs || {}));
9107
8970
  } else {
9108
- attr$1(rect, assign({}, this.SHAPE_STYLE, attrs || {}));
8971
+ attr$1(rect, assign$4({}, this.SHAPE_STYLE, attrs || {}));
9109
8972
  }
9110
8973
 
9111
8974
  append(visuals, rect);
@@ -9115,7 +8978,7 @@
9115
8978
 
9116
8979
  DefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {
9117
8980
 
9118
- var line = createLine(connection.waypoints, assign({}, this.CONNECTION_STYLE, attrs || {}));
8981
+ var line = createLine(connection.waypoints, assign$4({}, this.CONNECTION_STYLE, attrs || {}));
9119
8982
  append(visuals, line);
9120
8983
 
9121
8984
  return line;
@@ -9191,7 +9054,7 @@
9191
9054
  this.cls = function(className, traits, additionalAttrs) {
9192
9055
  var attrs = this.style(traits, additionalAttrs);
9193
9056
 
9194
- return assign(attrs, { 'class': className });
9057
+ return assign$4(attrs, { 'class': className });
9195
9058
  };
9196
9059
 
9197
9060
  /**
@@ -9204,25 +9067,25 @@
9204
9067
  */
9205
9068
  this.style = function(traits, additionalAttrs) {
9206
9069
 
9207
- if (!isArray$2(traits) && !additionalAttrs) {
9070
+ if (!isArray$4(traits) && !additionalAttrs) {
9208
9071
  additionalAttrs = traits;
9209
9072
  traits = [];
9210
9073
  }
9211
9074
 
9212
9075
  var attrs = reduce(traits, function(attrs, t) {
9213
- return assign(attrs, defaultTraits[t] || {});
9076
+ return assign$4(attrs, defaultTraits[t] || {});
9214
9077
  }, {});
9215
9078
 
9216
- return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
9079
+ return additionalAttrs ? assign$4(attrs, additionalAttrs) : attrs;
9217
9080
  };
9218
9081
 
9219
9082
  this.computeStyle = function(custom, traits, defaultStyles) {
9220
- if (!isArray$2(traits)) {
9083
+ if (!isArray$4(traits)) {
9221
9084
  defaultStyles = traits;
9222
9085
  traits = [];
9223
9086
  }
9224
9087
 
9225
- return self.style(traits || [], assign({}, defaultStyles, custom || {}));
9088
+ return self.style(traits || [], assign$4({}, defaultStyles, custom || {}));
9226
9089
  };
9227
9090
  }
9228
9091
 
@@ -9331,17 +9194,17 @@
9331
9194
  */
9332
9195
  function createContainer(options) {
9333
9196
 
9334
- options = assign({}, { width: '100%', height: '100%' }, options);
9197
+ options = assign$4({}, { width: '100%', height: '100%' }, options);
9335
9198
 
9336
- var container = options.container || document.body;
9199
+ const container = options.container || document.body;
9337
9200
 
9338
9201
  // create a <div> around the svg element with the respective size
9339
9202
  // this way we can always get the correct container size
9340
9203
  // (this is impossible for <svg> elements at the moment)
9341
- var parent = document.createElement('div');
9204
+ const parent = document.createElement('div');
9342
9205
  parent.setAttribute('class', 'djs-container');
9343
9206
 
9344
- assign$1(parent, {
9207
+ assign$3(parent, {
9345
9208
  position: 'relative',
9346
9209
  overflow: 'hidden',
9347
9210
  width: ensurePx(options.width),
@@ -9354,10 +9217,10 @@
9354
9217
  }
9355
9218
 
9356
9219
  function createGroup(parent, cls, childIndex) {
9357
- var group = create$1('g');
9220
+ const group = create$1('g');
9358
9221
  classes$1(group).add(cls);
9359
9222
 
9360
- var index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
9223
+ const index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
9361
9224
 
9362
9225
  // must ensure second argument is node or _null_
9363
9226
  // cf. https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore
@@ -9366,14 +9229,14 @@
9366
9229
  return group;
9367
9230
  }
9368
9231
 
9369
- var BASE_LAYER = 'base';
9232
+ const BASE_LAYER = 'base';
9370
9233
 
9371
9234
  // render plane contents behind utility layers
9372
- var PLANE_LAYER_INDEX = 0;
9373
- var UTILITY_LAYER_INDEX = 1;
9235
+ const PLANE_LAYER_INDEX = 0;
9236
+ const UTILITY_LAYER_INDEX = 1;
9374
9237
 
9375
9238
 
9376
- var REQUIRED_MODEL_ATTRS = {
9239
+ const REQUIRED_MODEL_ATTRS = {
9377
9240
  shape: [ 'x', 'y', 'width', 'height' ],
9378
9241
  connection: [ 'waypoints' ]
9379
9242
  };
@@ -9428,22 +9291,22 @@
9428
9291
  */
9429
9292
  Canvas.prototype._init = function(config) {
9430
9293
 
9431
- var eventBus = this._eventBus;
9294
+ const eventBus = this._eventBus;
9432
9295
 
9433
9296
  // html container
9434
- var container = this._container = createContainer(config);
9297
+ const container = this._container = createContainer(config);
9435
9298
 
9436
- var svg = this._svg = create$1('svg');
9299
+ const svg = this._svg = create$1('svg');
9437
9300
  attr$1(svg, { width: '100%', height: '100%' });
9438
9301
 
9439
9302
  append(container, svg);
9440
9303
 
9441
- var viewport = this._viewport = createGroup(svg, 'viewport');
9304
+ const viewport = this._viewport = createGroup(svg, 'viewport');
9442
9305
 
9443
9306
  // debounce canvas.viewbox.changed events
9444
9307
  // for smoother diagram interaction
9445
9308
  if (config.deferUpdate !== false) {
9446
- this._viewboxChanged = debounce(bind(this._viewboxChanged, this), 300);
9309
+ this._viewboxChanged = debounce(bind$3(this._viewboxChanged, this), 300);
9447
9310
  }
9448
9311
 
9449
9312
  eventBus.on('diagram.init', function() {
@@ -9489,7 +9352,7 @@
9489
9352
  viewport: this._viewport
9490
9353
  });
9491
9354
 
9492
- var parent = this._container.parentNode;
9355
+ const parent = this._container.parentNode;
9493
9356
 
9494
9357
  if (parent) {
9495
9358
  parent.removeChild(this._container);
@@ -9505,18 +9368,16 @@
9505
9368
 
9506
9369
  Canvas.prototype._clear = function() {
9507
9370
 
9508
- var self = this;
9509
-
9510
- var allElements = this._elementRegistry.getAll();
9371
+ const allElements = this._elementRegistry.getAll();
9511
9372
 
9512
9373
  // remove all elements
9513
- allElements.forEach(function(element) {
9514
- var type = getType(element);
9374
+ allElements.forEach(element => {
9375
+ const type = getType(element);
9515
9376
 
9516
9377
  if (type === 'root') {
9517
- self.removeRootElement(element);
9378
+ this.removeRootElement(element);
9518
9379
  } else {
9519
- self._removeElement(element, type);
9380
+ this._removeElement(element, type);
9520
9381
  }
9521
9382
  });
9522
9383
 
@@ -9559,7 +9420,7 @@
9559
9420
  throw new Error('must specify a name');
9560
9421
  }
9561
9422
 
9562
- var layer = this._layers[name];
9423
+ let layer = this._layers[name];
9563
9424
 
9564
9425
  if (!layer) {
9565
9426
  layer = this._layers[name] = this._createLayer(name, index);
@@ -9607,7 +9468,7 @@
9607
9468
  index = UTILITY_LAYER_INDEX;
9608
9469
  }
9609
9470
 
9610
- var childIndex = this._getChildIndex(index);
9471
+ const childIndex = this._getChildIndex(index);
9611
9472
 
9612
9473
  return {
9613
9474
  group: createGroup(this._viewport, 'layer-' + name, childIndex),
@@ -9629,21 +9490,21 @@
9629
9490
  throw new Error('must specify a name');
9630
9491
  }
9631
9492
 
9632
- var layer = this._layers[name];
9493
+ const layer = this._layers[name];
9633
9494
 
9634
9495
  if (!layer) {
9635
9496
  throw new Error('layer <' + name + '> does not exist');
9636
9497
  }
9637
9498
 
9638
- var viewport = this._viewport;
9639
- var group = layer.group;
9640
- var index = layer.index;
9499
+ const viewport = this._viewport;
9500
+ const group = layer.group;
9501
+ const index = layer.index;
9641
9502
 
9642
9503
  if (layer.visible) {
9643
9504
  return group;
9644
9505
  }
9645
9506
 
9646
- var childIndex = this._getChildIndex(index);
9507
+ const childIndex = this._getChildIndex(index);
9647
9508
 
9648
9509
  viewport.insertBefore(group, viewport.childNodes[childIndex] || null);
9649
9510
 
@@ -9664,13 +9525,13 @@
9664
9525
  throw new Error('must specify a name');
9665
9526
  }
9666
9527
 
9667
- var layer = this._layers[name];
9528
+ const layer = this._layers[name];
9668
9529
 
9669
9530
  if (!layer) {
9670
9531
  throw new Error('layer <' + name + '> does not exist');
9671
9532
  }
9672
9533
 
9673
- var group = layer.group;
9534
+ const group = layer.group;
9674
9535
 
9675
9536
  if (!layer.visible) {
9676
9537
  return group;
@@ -9686,7 +9547,7 @@
9686
9547
 
9687
9548
  Canvas.prototype._removeLayer = function(name) {
9688
9549
 
9689
- var layer = this._layers[name];
9550
+ const layer = this._layers[name];
9690
9551
 
9691
9552
  if (layer) {
9692
9553
  delete this._layers[name];
@@ -9701,7 +9562,7 @@
9701
9562
  * @returns {SVGElement|null}
9702
9563
  */
9703
9564
  Canvas.prototype.getActiveLayer = function() {
9704
- var plane = this._findPlaneForRoot(this.getRootElement());
9565
+ const plane = this._findPlaneForRoot(this.getRootElement());
9705
9566
 
9706
9567
  if (!plane) {
9707
9568
  return null;
@@ -9727,7 +9588,7 @@
9727
9588
  return;
9728
9589
  }
9729
9590
 
9730
- var plane = this._findPlaneForRoot(
9591
+ const plane = this._findPlaneForRoot(
9731
9592
  findRoot(element)
9732
9593
  ) || {};
9733
9594
 
@@ -9746,7 +9607,7 @@
9746
9607
  };
9747
9608
 
9748
9609
  Canvas.prototype._findPlaneForRoot = function(rootElement) {
9749
- return find(this._planes, function(plane) {
9610
+ return find$1(this._planes, function(plane) {
9750
9611
  return plane.rootElement === rootElement;
9751
9612
  });
9752
9613
  };
@@ -9766,7 +9627,7 @@
9766
9627
  // markers //////////////////////
9767
9628
 
9768
9629
  Canvas.prototype._updateMarker = function(element, marker, add) {
9769
- var container;
9630
+ let container;
9770
9631
 
9771
9632
  if (!element.id) {
9772
9633
  element = this._elementRegistry.get(element);
@@ -9779,7 +9640,7 @@
9779
9640
  return;
9780
9641
  }
9781
9642
 
9782
- forEach$1([ container.gfx, container.secondaryGfx ], function(gfx) {
9643
+ forEach$3([ container.gfx, container.secondaryGfx ], function(gfx) {
9783
9644
  if (gfx) {
9784
9645
 
9785
9646
  // invoke either addClass or removeClass based on mode
@@ -9814,7 +9675,7 @@
9814
9675
  * @example
9815
9676
  * canvas.addMarker('foo', 'some-marker');
9816
9677
  *
9817
- * var fooGfx = canvas.getGraphics('foo');
9678
+ * const fooGfx = canvas.getGraphics('foo');
9818
9679
  *
9819
9680
  * fooGfx; // <g class="... some-marker"> ... </g>
9820
9681
  *
@@ -9850,7 +9711,7 @@
9850
9711
  element = this._elementRegistry.get(element);
9851
9712
  }
9852
9713
 
9853
- var gfx = this.getGraphics(element);
9714
+ const gfx = this.getGraphics(element);
9854
9715
 
9855
9716
  return classes$1(gfx).has(marker);
9856
9717
  };
@@ -9888,7 +9749,7 @@
9888
9749
  * @returns {Object|djs.model.Root|null} rootElement.
9889
9750
  */
9890
9751
  Canvas.prototype.getRootElement = function() {
9891
- var rootElement = this._rootElement;
9752
+ const rootElement = this._rootElement;
9892
9753
 
9893
9754
  // can return null if root elements are present but none was set yet
9894
9755
  if (rootElement || this._planes.length) {
@@ -9907,7 +9768,7 @@
9907
9768
  */
9908
9769
 
9909
9770
  Canvas.prototype.addRootElement = function(rootElement) {
9910
- var idx = this._rootsIdx++;
9771
+ const idx = this._rootsIdx++;
9911
9772
 
9912
9773
  if (!rootElement) {
9913
9774
  rootElement = {
@@ -9917,11 +9778,11 @@
9917
9778
  };
9918
9779
  }
9919
9780
 
9920
- var layerName = rootElement.layer = 'root-' + idx;
9781
+ const layerName = rootElement.layer = 'root-' + idx;
9921
9782
 
9922
9783
  this._ensureValid('root', rootElement);
9923
9784
 
9924
- var layer = this.getLayer(layerName, PLANE_LAYER_INDEX);
9785
+ const layer = this.getLayer(layerName, PLANE_LAYER_INDEX);
9925
9786
 
9926
9787
  this.hideLayer(layerName);
9927
9788
 
@@ -9948,7 +9809,7 @@
9948
9809
  rootElement = this._elementRegistry.get(rootElement);
9949
9810
  }
9950
9811
 
9951
- var plane = this._findPlaneForRoot(rootElement);
9812
+ const plane = this._findPlaneForRoot(rootElement);
9952
9813
 
9953
9814
  if (!plane) {
9954
9815
  return;
@@ -9994,7 +9855,7 @@
9994
9855
  return;
9995
9856
  }
9996
9857
 
9997
- var plane;
9858
+ let plane;
9998
9859
 
9999
9860
  if (!rootElement) {
10000
9861
  throw new Error('rootElement required');
@@ -10014,8 +9875,8 @@
10014
9875
 
10015
9876
 
10016
9877
  Canvas.prototype._removeRoot = function(element) {
10017
- var elementRegistry = this._elementRegistry,
10018
- eventBus = this._eventBus;
9878
+ const elementRegistry = this._elementRegistry,
9879
+ eventBus = this._eventBus;
10019
9880
 
10020
9881
  // simulate element remove event sequence
10021
9882
  eventBus.fire('root.remove', { element: element });
@@ -10026,8 +9887,8 @@
10026
9887
 
10027
9888
 
10028
9889
  Canvas.prototype._addRoot = function(element, gfx) {
10029
- var elementRegistry = this._elementRegistry,
10030
- eventBus = this._eventBus;
9890
+ const elementRegistry = this._elementRegistry,
9891
+ eventBus = this._eventBus;
10031
9892
 
10032
9893
  // resemble element add event sequence
10033
9894
  eventBus.fire('root.add', { element: element });
@@ -10040,7 +9901,7 @@
10040
9901
 
10041
9902
  Canvas.prototype._setRoot = function(rootElement, layer) {
10042
9903
 
10043
- var currentRoot = this._rootElement;
9904
+ const currentRoot = this._rootElement;
10044
9905
 
10045
9906
  if (currentRoot) {
10046
9907
 
@@ -10080,9 +9941,9 @@
10080
9941
  throw new Error('element <' + element.id + '> already exists');
10081
9942
  }
10082
9943
 
10083
- var requiredAttrs = REQUIRED_MODEL_ATTRS[type];
9944
+ const requiredAttrs = REQUIRED_MODEL_ATTRS[type];
10084
9945
 
10085
- var valid = every(requiredAttrs, function(attr) {
9946
+ const valid = every(requiredAttrs, function(attr) {
10086
9947
  return typeof element[attr] !== 'undefined';
10087
9948
  });
10088
9949
 
@@ -10121,8 +9982,8 @@
10121
9982
 
10122
9983
  parent = parent || this.getRootElement();
10123
9984
 
10124
- var eventBus = this._eventBus,
10125
- graphicsFactory = this._graphicsFactory;
9985
+ const eventBus = this._eventBus,
9986
+ graphicsFactory = this._graphicsFactory;
10126
9987
 
10127
9988
  this._ensureValid(type, element);
10128
9989
 
@@ -10131,7 +9992,7 @@
10131
9992
  this._setParent(element, parent, parentIndex);
10132
9993
 
10133
9994
  // create graphics
10134
- var gfx = graphicsFactory.create(type, element, parentIndex);
9995
+ const gfx = graphicsFactory.create(type, element, parentIndex);
10135
9996
 
10136
9997
  this._elementRegistry.add(element, gfx);
10137
9998
 
@@ -10175,9 +10036,9 @@
10175
10036
  */
10176
10037
  Canvas.prototype._removeElement = function(element, type) {
10177
10038
 
10178
- var elementRegistry = this._elementRegistry,
10179
- graphicsFactory = this._graphicsFactory,
10180
- eventBus = this._eventBus;
10039
+ const elementRegistry = this._elementRegistry,
10040
+ graphicsFactory = this._graphicsFactory,
10041
+ eventBus = this._eventBus;
10181
10042
 
10182
10043
  element = elementRegistry.get(element.id || element);
10183
10044
 
@@ -10326,7 +10187,7 @@
10326
10187
  * // sets the visible area of the diagram to (100|100) -> (600|100)
10327
10188
  * // and and scales it according to the diagram width
10328
10189
  *
10329
- * var viewbox = canvas.viewbox(); // pass `false` to force recomputing the box.
10190
+ * const viewbox = canvas.viewbox(); // pass `false` to force recomputing the box.
10330
10191
  *
10331
10192
  * console.log(viewbox);
10332
10193
  * // {
@@ -10340,7 +10201,7 @@
10340
10201
  * // if the current diagram is zoomed and scrolled, you may reset it to the
10341
10202
  * // default zoom via this method, too:
10342
10203
  *
10343
- * var zoomedAndScrolledViewbox = canvas.viewbox();
10204
+ * const zoomedAndScrolledViewbox = canvas.viewbox();
10344
10205
  *
10345
10206
  * canvas.viewbox({
10346
10207
  * x: 0,
@@ -10363,9 +10224,9 @@
10363
10224
  return this._cachedViewbox;
10364
10225
  }
10365
10226
 
10366
- var viewport = this._viewport,
10367
- innerBox,
10368
- outerBox = this.getSize(),
10227
+ const viewport = this._viewport,
10228
+ outerBox = this.getSize();
10229
+ let innerBox,
10369
10230
  matrix,
10370
10231
  activeLayer,
10371
10232
  transform,
@@ -10409,7 +10270,7 @@
10409
10270
  this._changeViewbox(function() {
10410
10271
  scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
10411
10272
 
10412
- var matrix = this._svg.createSVGMatrix()
10273
+ const matrix = this._svg.createSVGMatrix()
10413
10274
  .scale(scale)
10414
10275
  .translate(-box.x, -box.y);
10415
10276
 
@@ -10431,12 +10292,12 @@
10431
10292
  */
10432
10293
  Canvas.prototype.scroll = function(delta) {
10433
10294
 
10434
- var node = this._viewport;
10435
- var matrix = node.getCTM();
10295
+ const node = this._viewport;
10296
+ let matrix = node.getCTM();
10436
10297
 
10437
10298
  if (delta) {
10438
10299
  this._changeViewbox(function() {
10439
- delta = assign({ dx: 0, dy: 0 }, delta || {});
10300
+ delta = assign$4({ dx: 0, dy: 0 }, delta || {});
10440
10301
 
10441
10302
  matrix = this._svg.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
10442
10303
 
@@ -10456,14 +10317,14 @@
10456
10317
  *
10457
10318
  */
10458
10319
  Canvas.prototype.scrollToElement = function(element, padding) {
10459
- var defaultPadding = 100;
10320
+ let defaultPadding = 100;
10460
10321
 
10461
10322
  if (typeof element === 'string') {
10462
10323
  element = this._elementRegistry.get(element);
10463
10324
  }
10464
10325
 
10465
10326
  // set to correct rootElement
10466
- var rootElement = this.findRoot(element);
10327
+ const rootElement = this.findRoot(element);
10467
10328
 
10468
10329
  if (rootElement !== this.getRootElement()) {
10469
10330
  this.setRootElement(rootElement);
@@ -10483,11 +10344,11 @@
10483
10344
  left: padding.left || defaultPadding
10484
10345
  };
10485
10346
 
10486
- var elementBounds = getBBox(element),
10487
- elementTrbl = asTRBL(elementBounds),
10488
- viewboxBounds = this.viewbox(),
10489
- zoom = this.zoom(),
10490
- dx, dy;
10347
+ const elementBounds = getBBox(element),
10348
+ elementTrbl = asTRBL(elementBounds),
10349
+ viewboxBounds = this.viewbox(),
10350
+ zoom = this.zoom();
10351
+ let dx, dy;
10491
10352
 
10492
10353
  // shrink viewboxBounds with padding
10493
10354
  viewboxBounds.y += padding.top / zoom;
@@ -10495,9 +10356,9 @@
10495
10356
  viewboxBounds.width -= (padding.right + padding.left) / zoom;
10496
10357
  viewboxBounds.height -= (padding.bottom + padding.top) / zoom;
10497
10358
 
10498
- var viewboxTrbl = asTRBL(viewboxBounds);
10359
+ const viewboxTrbl = asTRBL(viewboxBounds);
10499
10360
 
10500
- var canFit = elementBounds.width < viewboxBounds.width && elementBounds.height < viewboxBounds.height;
10361
+ const canFit = elementBounds.width < viewboxBounds.width && elementBounds.height < viewboxBounds.height;
10501
10362
 
10502
10363
  if (!canFit) {
10503
10364
 
@@ -10507,10 +10368,10 @@
10507
10368
 
10508
10369
  } else {
10509
10370
 
10510
- var dRight = Math.max(0, elementTrbl.right - viewboxTrbl.right),
10511
- dLeft = Math.min(0, elementTrbl.left - viewboxTrbl.left),
10512
- dBottom = Math.max(0, elementTrbl.bottom - viewboxTrbl.bottom),
10513
- dTop = Math.min(0, elementTrbl.top - viewboxTrbl.top);
10371
+ const dRight = Math.max(0, elementTrbl.right - viewboxTrbl.right),
10372
+ dLeft = Math.min(0, elementTrbl.left - viewboxTrbl.left),
10373
+ dBottom = Math.max(0, elementTrbl.bottom - viewboxTrbl.bottom),
10374
+ dTop = Math.min(0, elementTrbl.top - viewboxTrbl.top);
10514
10375
 
10515
10376
  dx = dRight || dLeft;
10516
10377
  dy = dBottom || dTop;
@@ -10543,7 +10404,7 @@
10543
10404
  return this._fitViewport(center);
10544
10405
  }
10545
10406
 
10546
- var outer,
10407
+ let outer,
10547
10408
  matrix;
10548
10409
 
10549
10410
  this._changeViewbox(function() {
@@ -10564,16 +10425,16 @@
10564
10425
  };
10565
10426
 
10566
10427
  function setCTM(node, m) {
10567
- var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
10428
+ const mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
10568
10429
  node.setAttribute('transform', mstr);
10569
10430
  }
10570
10431
 
10571
10432
  Canvas.prototype._fitViewport = function(center) {
10572
10433
 
10573
- var vbox = this.viewbox(),
10574
- outer = vbox.outer,
10575
- inner = vbox.inner,
10576
- newScale,
10434
+ const vbox = this.viewbox(),
10435
+ outer = vbox.outer,
10436
+ inner = vbox.inner;
10437
+ let newScale,
10577
10438
  newViewbox;
10578
10439
 
10579
10440
  // display the complete diagram without zooming in.
@@ -10614,13 +10475,13 @@
10614
10475
 
10615
10476
  Canvas.prototype._setZoom = function(scale, center) {
10616
10477
 
10617
- var svg = this._svg,
10618
- viewport = this._viewport;
10478
+ const svg = this._svg,
10479
+ viewport = this._viewport;
10619
10480
 
10620
- var matrix = svg.createSVGMatrix();
10621
- var point = svg.createSVGPoint();
10481
+ const matrix = svg.createSVGMatrix();
10482
+ const point = svg.createSVGPoint();
10622
10483
 
10623
- var centerPoint,
10484
+ let centerPoint,
10624
10485
  originalPoint,
10625
10486
  currentMatrix,
10626
10487
  scaleMatrix,
@@ -10628,10 +10489,10 @@
10628
10489
 
10629
10490
  currentMatrix = viewport.getCTM();
10630
10491
 
10631
- var currentScale = currentMatrix.a;
10492
+ const currentScale = currentMatrix.a;
10632
10493
 
10633
10494
  if (center) {
10634
- centerPoint = assign(point, center);
10495
+ centerPoint = assign$4(point, center);
10635
10496
 
10636
10497
  // revert applied viewport transformations
10637
10498
  originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
@@ -10677,13 +10538,13 @@
10677
10538
  * @return {Bounds} the absolute bounding box
10678
10539
  */
10679
10540
  Canvas.prototype.getAbsoluteBBox = function(element) {
10680
- var vbox = this.viewbox();
10681
- var bbox;
10541
+ const vbox = this.viewbox();
10542
+ let bbox;
10682
10543
 
10683
10544
  // connection
10684
10545
  // use svg bbox
10685
10546
  if (element.waypoints) {
10686
- var gfx = this.getGraphics(element);
10547
+ const gfx = this.getGraphics(element);
10687
10548
 
10688
10549
  bbox = gfx.getBBox();
10689
10550
  }
@@ -10694,11 +10555,11 @@
10694
10555
  bbox = element;
10695
10556
  }
10696
10557
 
10697
- var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
10698
- var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
10558
+ const x = bbox.x * vbox.scale - vbox.x * vbox.scale;
10559
+ const y = bbox.y * vbox.scale - vbox.y * vbox.scale;
10699
10560
 
10700
- var width = bbox.width * vbox.scale;
10701
- var height = bbox.height * vbox.scale;
10561
+ const width = bbox.width * vbox.scale;
10562
+ const height = bbox.height * vbox.scale;
10702
10563
 
10703
10564
  return {
10704
10565
  x: x,
@@ -11525,7 +11386,7 @@
11525
11386
  if (!Type) {
11526
11387
  throw new Error('unknown type: <' + type + '>');
11527
11388
  }
11528
- return assign(new Type(), attrs);
11389
+ return assign$4(new Type(), attrs);
11529
11390
  }
11530
11391
 
11531
11392
  /**
@@ -11562,7 +11423,7 @@
11562
11423
  */
11563
11424
  ElementFactory.prototype.create = function(type, attrs) {
11564
11425
 
11565
- attrs = assign({}, attrs || {});
11426
+ attrs = assign$4({}, attrs || {});
11566
11427
 
11567
11428
  if (!attrs.id) {
11568
11429
  attrs.id = type + '_' + (this._uid++);
@@ -11688,9 +11549,9 @@
11688
11549
  */
11689
11550
  EventBus.prototype.on = function(events, priority, callback, that) {
11690
11551
 
11691
- events = isArray$2(events) ? events : [ events ];
11552
+ events = isArray$4(events) ? events : [ events ];
11692
11553
 
11693
- if (isFunction(priority)) {
11554
+ if (isFunction$1(priority)) {
11694
11555
  that = callback;
11695
11556
  callback = priority;
11696
11557
  priority = DEFAULT_PRIORITY;
@@ -11703,7 +11564,7 @@
11703
11564
  var actualCallback = callback;
11704
11565
 
11705
11566
  if (that) {
11706
- actualCallback = bind(callback, that);
11567
+ actualCallback = bind$3(callback, that);
11707
11568
 
11708
11569
  // make sure we remember and are able to remove
11709
11570
  // bound callbacks via {@link #off} using the original
@@ -11734,7 +11595,7 @@
11734
11595
  EventBus.prototype.once = function(event, priority, callback, that) {
11735
11596
  var self = this;
11736
11597
 
11737
- if (isFunction(priority)) {
11598
+ if (isFunction$1(priority)) {
11738
11599
  that = callback;
11739
11600
  callback = priority;
11740
11601
  priority = DEFAULT_PRIORITY;
@@ -11773,7 +11634,7 @@
11773
11634
  */
11774
11635
  EventBus.prototype.off = function(events, callback) {
11775
11636
 
11776
- events = isArray$2(events) ? events : [ events ];
11637
+ events = isArray$4(events) ? events : [ events ];
11777
11638
 
11778
11639
  var self = this;
11779
11640
 
@@ -12068,7 +11929,7 @@
12068
11929
  };
12069
11930
 
12070
11931
  InternalEvent.prototype.init = function(data) {
12071
- assign(this, data || {});
11932
+ assign$4(this, data || {});
12072
11933
  };
12073
11934
 
12074
11935
 
@@ -12241,7 +12102,7 @@
12241
12102
 
12242
12103
  // update all parents of changed and reorganized their children
12243
12104
  // in the correct order (as indicated in our model)
12244
- forEach$1(parents, function(parent) {
12105
+ forEach$3(parents, function(parent) {
12245
12106
 
12246
12107
  var children = parent.children;
12247
12108
 
@@ -12251,7 +12112,7 @@
12251
12112
 
12252
12113
  var childrenGfx = self._getChildrenContainer(parent);
12253
12114
 
12254
- forEach$1(children.slice().reverse(), function(child) {
12115
+ forEach$3(children.slice().reverse(), function(child) {
12255
12116
  var childGfx = elementRegistry.getGraphics(child);
12256
12117
 
12257
12118
  prependTo(childGfx.parentNode, childrenGfx);
@@ -12501,6 +12362,193 @@
12501
12362
  this.get('eventBus').fire('diagram.clear');
12502
12363
  };
12503
12364
 
12365
+ /**
12366
+ * Flatten array, one level deep.
12367
+ *
12368
+ * @param {Array<?>} arr
12369
+ *
12370
+ * @return {Array<?>}
12371
+ */
12372
+
12373
+ var nativeToString$2 = Object.prototype.toString;
12374
+ function isString$2(obj) {
12375
+ return nativeToString$2.call(obj) === '[object String]';
12376
+ }
12377
+
12378
+ function _extends$2() {
12379
+ _extends$2 = Object.assign || function (target) {
12380
+ for (var i = 1; i < arguments.length; i++) {
12381
+ var source = arguments[i];
12382
+
12383
+ for (var key in source) {
12384
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
12385
+ target[key] = source[key];
12386
+ }
12387
+ }
12388
+ }
12389
+
12390
+ return target;
12391
+ };
12392
+
12393
+ return _extends$2.apply(this, arguments);
12394
+ }
12395
+
12396
+ /**
12397
+ * Convenience wrapper for `Object.assign`.
12398
+ *
12399
+ * @param {Object} target
12400
+ * @param {...Object} others
12401
+ *
12402
+ * @return {Object} the target
12403
+ */
12404
+
12405
+ function assign$2(target) {
12406
+ for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12407
+ others[_key - 1] = arguments[_key];
12408
+ }
12409
+
12410
+ return _extends$2.apply(void 0, [target].concat(others));
12411
+ }
12412
+
12413
+ /**
12414
+ * Flatten array, one level deep.
12415
+ *
12416
+ * @param {Array<?>} arr
12417
+ *
12418
+ * @return {Array<?>}
12419
+ */
12420
+
12421
+ var nativeToString$1 = Object.prototype.toString;
12422
+ var nativeHasOwnProperty$1 = Object.prototype.hasOwnProperty;
12423
+ function isUndefined$2(obj) {
12424
+ return obj === undefined;
12425
+ }
12426
+ function isArray$1(obj) {
12427
+ return nativeToString$1.call(obj) === '[object Array]';
12428
+ }
12429
+ function isObject(obj) {
12430
+ return nativeToString$1.call(obj) === '[object Object]';
12431
+ }
12432
+ function isString$1(obj) {
12433
+ return nativeToString$1.call(obj) === '[object String]';
12434
+ }
12435
+ /**
12436
+ * Return true, if target owns a property with the given key.
12437
+ *
12438
+ * @param {Object} target
12439
+ * @param {String} key
12440
+ *
12441
+ * @return {Boolean}
12442
+ */
12443
+
12444
+ function has$1(target, key) {
12445
+ return nativeHasOwnProperty$1.call(target, key);
12446
+ }
12447
+ /**
12448
+ * Iterate over collection; returning something
12449
+ * (non-undefined) will stop iteration.
12450
+ *
12451
+ * @param {Array|Object} collection
12452
+ * @param {Function} iterator
12453
+ *
12454
+ * @return {Object} return result that stopped the iteration
12455
+ */
12456
+
12457
+ function forEach$1(collection, iterator) {
12458
+ var val, result;
12459
+
12460
+ if (isUndefined$2(collection)) {
12461
+ return;
12462
+ }
12463
+
12464
+ var convertKey = isArray$1(collection) ? toNum$1 : identity$1;
12465
+
12466
+ for (var key in collection) {
12467
+ if (has$1(collection, key)) {
12468
+ val = collection[key];
12469
+ result = iterator(val, convertKey(key));
12470
+
12471
+ if (result === false) {
12472
+ return val;
12473
+ }
12474
+ }
12475
+ }
12476
+ }
12477
+
12478
+ function identity$1(arg) {
12479
+ return arg;
12480
+ }
12481
+
12482
+ function toNum$1(arg) {
12483
+ return Number(arg);
12484
+ }
12485
+ /**
12486
+ * Bind function against target <this>.
12487
+ *
12488
+ * @param {Function} fn
12489
+ * @param {Object} target
12490
+ *
12491
+ * @return {Function} bound function
12492
+ */
12493
+
12494
+ function bind(fn, target) {
12495
+ return fn.bind(target);
12496
+ }
12497
+
12498
+ function _extends$1() {
12499
+ _extends$1 = Object.assign || function (target) {
12500
+ for (var i = 1; i < arguments.length; i++) {
12501
+ var source = arguments[i];
12502
+
12503
+ for (var key in source) {
12504
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
12505
+ target[key] = source[key];
12506
+ }
12507
+ }
12508
+ }
12509
+
12510
+ return target;
12511
+ };
12512
+
12513
+ return _extends$1.apply(this, arguments);
12514
+ }
12515
+
12516
+ /**
12517
+ * Convenience wrapper for `Object.assign`.
12518
+ *
12519
+ * @param {Object} target
12520
+ * @param {...Object} others
12521
+ *
12522
+ * @return {Object} the target
12523
+ */
12524
+
12525
+ function assign$1(target) {
12526
+ for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12527
+ others[_key - 1] = arguments[_key];
12528
+ }
12529
+
12530
+ return _extends$1.apply(void 0, [target].concat(others));
12531
+ }
12532
+ /**
12533
+ * Pick given properties from the target object.
12534
+ *
12535
+ * @param {Object} target
12536
+ * @param {Array} properties
12537
+ *
12538
+ * @return {Object} target
12539
+ */
12540
+
12541
+ function pick(target, properties) {
12542
+ var result = {};
12543
+ var obj = Object(target);
12544
+ forEach$1(properties, function (prop) {
12545
+ if (prop in obj) {
12546
+ result[prop] = target[prop];
12547
+ }
12548
+ });
12549
+ return result;
12550
+ }
12551
+
12504
12552
  /**
12505
12553
  * Moddle base element.
12506
12554
  */
@@ -12845,7 +12893,7 @@
12845
12893
  forEach$1(t.properties, bind(function(p) {
12846
12894
 
12847
12895
  // clone property to allow extensions
12848
- p = assign({}, p, {
12896
+ p = assign$1({}, p, {
12849
12897
  name: p.ns.localName,
12850
12898
  inherited: inherited
12851
12899
  });
@@ -12905,7 +12953,7 @@
12905
12953
  Registry.prototype.registerPackage = function(pkg) {
12906
12954
 
12907
12955
  // copy package
12908
- pkg = assign({}, pkg);
12956
+ pkg = assign$1({}, pkg);
12909
12957
 
12910
12958
  var pkgMap = this.packageMap;
12911
12959
 
@@ -12927,11 +12975,11 @@
12927
12975
  */
12928
12976
  Registry.prototype.registerType = function(type, pkg) {
12929
12977
 
12930
- type = assign({}, type, {
12978
+ type = assign$1({}, type, {
12931
12979
  superClass: (type.superClass || []).slice(),
12932
12980
  extends: (type.extends || []).slice(),
12933
12981
  properties: (type.properties || []).slice(),
12934
- meta: assign((type.meta || {}))
12982
+ meta: assign$1((type.meta || {}))
12935
12983
  });
12936
12984
 
12937
12985
  var ns = parseName(type.name, pkg.prefix),
@@ -12950,7 +12998,7 @@
12950
12998
  p.type = parseName(p.type, propertyNs.prefix).name;
12951
12999
  }
12952
13000
 
12953
- assign(p, {
13001
+ assign$1(p, {
12954
13002
  ns: propertyNs,
12955
13003
  name: propertyName
12956
13004
  });
@@ -12959,7 +13007,7 @@
12959
13007
  }, this));
12960
13008
 
12961
13009
  // update ns + name
12962
- assign(type, {
13010
+ assign$1(type, {
12963
13011
  ns: ns,
12964
13012
  name: name,
12965
13013
  propertiesByName: propertiesByName
@@ -13095,7 +13143,7 @@
13095
13143
 
13096
13144
  var propertyName = property && property.name;
13097
13145
 
13098
- if (isUndefined(value)) {
13146
+ if (isUndefined$1(value)) {
13099
13147
  // unset the property, if the specified value is undefined;
13100
13148
  // delete from $attrs (for extensions) or the target itself
13101
13149
  if (property) {
@@ -13160,7 +13208,7 @@
13160
13208
 
13161
13209
  // use getters for read-only variables to support ES6 proxies
13162
13210
  // cf. https://github.com/bpmn-io/internal-docs/issues/386
13163
- options = assign({}, options, {
13211
+ options = assign$1({}, options, {
13164
13212
  get: function() { return value; }
13165
13213
  });
13166
13214
 
@@ -13186,7 +13234,7 @@
13186
13234
  };
13187
13235
 
13188
13236
 
13189
- function isUndefined(val) {
13237
+ function isUndefined$1(val) {
13190
13238
  return typeof val === 'undefined';
13191
13239
  }
13192
13240
 
@@ -13275,7 +13323,7 @@
13275
13323
 
13276
13324
  var cache = this.typeCache;
13277
13325
 
13278
- var name = isString(descriptor) ? descriptor : descriptor.ns.name;
13326
+ var name = isString$1(descriptor) ? descriptor : descriptor.ns.name;
13279
13327
 
13280
13328
  var type = cache[name];
13281
13329
 
@@ -13408,6 +13456,180 @@
13408
13456
  return this.registry.typeMap[type];
13409
13457
  };
13410
13458
 
13459
+ /**
13460
+ * Flatten array, one level deep.
13461
+ *
13462
+ * @param {Array<?>} arr
13463
+ *
13464
+ * @return {Array<?>}
13465
+ */
13466
+
13467
+ var nativeToString = Object.prototype.toString;
13468
+ var nativeHasOwnProperty = Object.prototype.hasOwnProperty;
13469
+ function isUndefined(obj) {
13470
+ return obj === undefined;
13471
+ }
13472
+ function isArray(obj) {
13473
+ return nativeToString.call(obj) === '[object Array]';
13474
+ }
13475
+ function isFunction(obj) {
13476
+ var tag = nativeToString.call(obj);
13477
+ return tag === '[object Function]' || tag === '[object AsyncFunction]' || tag === '[object GeneratorFunction]' || tag === '[object AsyncGeneratorFunction]' || tag === '[object Proxy]';
13478
+ }
13479
+ function isString(obj) {
13480
+ return nativeToString.call(obj) === '[object String]';
13481
+ }
13482
+ /**
13483
+ * Return true, if target owns a property with the given key.
13484
+ *
13485
+ * @param {Object} target
13486
+ * @param {String} key
13487
+ *
13488
+ * @return {Boolean}
13489
+ */
13490
+
13491
+ function has(target, key) {
13492
+ return nativeHasOwnProperty.call(target, key);
13493
+ }
13494
+
13495
+ /**
13496
+ * Find element in collection.
13497
+ *
13498
+ * @param {Array|Object} collection
13499
+ * @param {Function|Object} matcher
13500
+ *
13501
+ * @return {Object}
13502
+ */
13503
+
13504
+ function find(collection, matcher) {
13505
+ matcher = toMatcher(matcher);
13506
+ var match;
13507
+ forEach(collection, function (val, key) {
13508
+ if (matcher(val, key)) {
13509
+ match = val;
13510
+ return false;
13511
+ }
13512
+ });
13513
+ return match;
13514
+ }
13515
+ /**
13516
+ * Find element index in collection.
13517
+ *
13518
+ * @param {Array|Object} collection
13519
+ * @param {Function} matcher
13520
+ *
13521
+ * @return {Object}
13522
+ */
13523
+
13524
+ function findIndex(collection, matcher) {
13525
+ matcher = toMatcher(matcher);
13526
+ var idx = isArray(collection) ? -1 : undefined;
13527
+ forEach(collection, function (val, key) {
13528
+ if (matcher(val, key)) {
13529
+ idx = key;
13530
+ return false;
13531
+ }
13532
+ });
13533
+ return idx;
13534
+ }
13535
+ /**
13536
+ * Find element in collection.
13537
+ *
13538
+ * @param {Array|Object} collection
13539
+ * @param {Function} matcher
13540
+ *
13541
+ * @return {Array} result
13542
+ */
13543
+
13544
+ function filter(collection, matcher) {
13545
+ var result = [];
13546
+ forEach(collection, function (val, key) {
13547
+ if (matcher(val, key)) {
13548
+ result.push(val);
13549
+ }
13550
+ });
13551
+ return result;
13552
+ }
13553
+ /**
13554
+ * Iterate over collection; returning something
13555
+ * (non-undefined) will stop iteration.
13556
+ *
13557
+ * @param {Array|Object} collection
13558
+ * @param {Function} iterator
13559
+ *
13560
+ * @return {Object} return result that stopped the iteration
13561
+ */
13562
+
13563
+ function forEach(collection, iterator) {
13564
+ var val, result;
13565
+
13566
+ if (isUndefined(collection)) {
13567
+ return;
13568
+ }
13569
+
13570
+ var convertKey = isArray(collection) ? toNum : identity;
13571
+
13572
+ for (var key in collection) {
13573
+ if (has(collection, key)) {
13574
+ val = collection[key];
13575
+ result = iterator(val, convertKey(key));
13576
+
13577
+ if (result === false) {
13578
+ return val;
13579
+ }
13580
+ }
13581
+ }
13582
+ }
13583
+
13584
+ function toMatcher(matcher) {
13585
+ return isFunction(matcher) ? matcher : function (e) {
13586
+ return e === matcher;
13587
+ };
13588
+ }
13589
+
13590
+ function identity(arg) {
13591
+ return arg;
13592
+ }
13593
+
13594
+ function toNum(arg) {
13595
+ return Number(arg);
13596
+ }
13597
+
13598
+ function _extends() {
13599
+ _extends = Object.assign || function (target) {
13600
+ for (var i = 1; i < arguments.length; i++) {
13601
+ var source = arguments[i];
13602
+
13603
+ for (var key in source) {
13604
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
13605
+ target[key] = source[key];
13606
+ }
13607
+ }
13608
+ }
13609
+
13610
+ return target;
13611
+ };
13612
+
13613
+ return _extends.apply(this, arguments);
13614
+ }
13615
+
13616
+ /**
13617
+ * Convenience wrapper for `Object.assign`.
13618
+ *
13619
+ * @param {Object} target
13620
+ * @param {...Object} others
13621
+ *
13622
+ * @return {Object} the target
13623
+ */
13624
+
13625
+ function assign(target) {
13626
+ for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
13627
+ others[_key - 1] = arguments[_key];
13628
+ }
13629
+
13630
+ return _extends.apply(void 0, [target].concat(others));
13631
+ }
13632
+
13411
13633
  var fromCharCode = String.fromCharCode;
13412
13634
 
13413
13635
  var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -14803,7 +15025,7 @@
14803
15025
  model = this.model,
14804
15026
  propNameNs;
14805
15027
 
14806
- forEach$1(attributes, function(value, name) {
15028
+ forEach(attributes, function(value, name) {
14807
15029
 
14808
15030
  var prop = descriptor.propertiesByName[name],
14809
15031
  values;
@@ -14821,7 +15043,7 @@
14821
15043
  // IDREFS: parse references as whitespace-separated list
14822
15044
  values = value.split(' ');
14823
15045
 
14824
- forEach$1(values, function(v) {
15046
+ forEach(values, function(v) {
14825
15047
  context.addReference({
14826
15048
  element: instance,
14827
15049
  property: prop.ns.name,
@@ -15565,7 +15787,7 @@
15565
15787
  }
15566
15788
 
15567
15789
  // do not serialize defaults
15568
- if (!has$1(element, name)) {
15790
+ if (!has(element, name)) {
15569
15791
  return false;
15570
15792
  }
15571
15793
 
@@ -15794,7 +16016,7 @@
15794
16016
 
15795
16017
  var attributes = [];
15796
16018
 
15797
- forEach$1(element, function(val, key) {
16019
+ forEach(element, function(val, key) {
15798
16020
 
15799
16021
  var nonNsAttr;
15800
16022
 
@@ -15802,7 +16024,7 @@
15802
16024
  body.push(new BodySerializer().build({ type: 'String' }, val));
15803
16025
  } else
15804
16026
  if (key === '$children') {
15805
- forEach$1(val, function(child) {
16027
+ forEach(val, function(child) {
15806
16028
  body.push(new ElementSerializer(self).build(child));
15807
16029
  });
15808
16030
  } else
@@ -15872,7 +16094,7 @@
15872
16094
  // parse namespace attributes first
15873
16095
  // and log them. push non namespace attributes to a list
15874
16096
  // and process them later
15875
- forEach$1(genericAttrs, function(value, name) {
16097
+ forEach(genericAttrs, function(value, name) {
15876
16098
 
15877
16099
  var nonNsAttr = self.parseNsAttribute(element, name, value);
15878
16100
 
@@ -15888,7 +16110,7 @@
15888
16110
 
15889
16111
  var self = this;
15890
16112
 
15891
- forEach$1(attributes, function(attr) {
16113
+ forEach(attributes, function(attr) {
15892
16114
 
15893
16115
  // do not serialize xsi:type attribute
15894
16116
  // it is set manually based on the actual implementation type
@@ -15913,7 +16135,7 @@
15913
16135
  body = this.body,
15914
16136
  element = this.element;
15915
16137
 
15916
- forEach$1(properties, function(p) {
16138
+ forEach(properties, function(p) {
15917
16139
  var value = element.get(p.name),
15918
16140
  isReference = p.isReference,
15919
16141
  isMany = p.isMany;
@@ -15926,12 +16148,12 @@
15926
16148
  body.push(new BodySerializer().build(p, value[0]));
15927
16149
  } else
15928
16150
  if (isSimple(p.type)) {
15929
- forEach$1(value, function(v) {
16151
+ forEach(value, function(v) {
15930
16152
  body.push(new ValueSerializer(self.addTagName(self.nsPropertyTagName(p))).build(p, v));
15931
16153
  });
15932
16154
  } else
15933
16155
  if (isReference) {
15934
- forEach$1(value, function(v) {
16156
+ forEach(value, function(v) {
15935
16157
  body.push(new ReferenceSerializer(self.addTagName(self.nsPropertyTagName(p))).build(v));
15936
16158
  });
15937
16159
  } else {
@@ -15941,7 +16163,7 @@
15941
16163
  var asType = serializeAsType(p),
15942
16164
  asProperty = serializeAsProperty(p);
15943
16165
 
15944
- forEach$1(value, function(v) {
16166
+ forEach(value, function(v) {
15945
16167
  var serializer;
15946
16168
 
15947
16169
  if (asType) {
@@ -16049,7 +16271,7 @@
16049
16271
  var self = this,
16050
16272
  element = this.element;
16051
16273
 
16052
- forEach$1(properties, function(p) {
16274
+ forEach(properties, function(p) {
16053
16275
 
16054
16276
  var value = element.get(p.name);
16055
16277
 
@@ -16060,7 +16282,7 @@
16060
16282
  }
16061
16283
  else {
16062
16284
  var values = [];
16063
- forEach$1(value, function(v) {
16285
+ forEach(value, function(v) {
16064
16286
  values.push(v.id);
16065
16287
  });
16066
16288
 
@@ -16116,7 +16338,7 @@
16116
16338
  attrs = getNsAttrs(namespaces).concat(attrs);
16117
16339
  }
16118
16340
 
16119
- forEach$1(attrs, function(a) {
16341
+ forEach(attrs, function(a) {
16120
16342
  writer
16121
16343
  .append(' ')
16122
16344
  .append(nsName(a.name)).append('="').append(a.value).append('"');
@@ -16143,7 +16365,7 @@
16143
16365
  .indent();
16144
16366
  }
16145
16367
 
16146
- forEach$1(this.body, function(b) {
16368
+ forEach(this.body, function(b) {
16147
16369
  b.serializeTo(writer);
16148
16370
  });
16149
16371
 
@@ -16320,12 +16542,12 @@
16320
16542
  */
16321
16543
  BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options) {
16322
16544
 
16323
- if (!isString(typeName)) {
16545
+ if (!isString$2(typeName)) {
16324
16546
  options = typeName;
16325
16547
  typeName = 'bpmn:Definitions';
16326
16548
  }
16327
16549
 
16328
- var reader = new Reader(assign({ model: this, lax: true }, options));
16550
+ var reader = new Reader(assign$2({ model: this, lax: true }, options));
16329
16551
  var rootHandler = reader.handler(typeName);
16330
16552
 
16331
16553
  return reader.fromXML(xmlStr, rootHandler);
@@ -20012,7 +20234,7 @@
20012
20234
  };
20013
20235
 
20014
20236
  function simple(additionalPackages, options) {
20015
- var pks = assign({}, packages, additionalPackages);
20237
+ var pks = assign$2({}, packages, additionalPackages);
20016
20238
 
20017
20239
  return new BpmnModdle(pks, options);
20018
20240
  }
@@ -20036,7 +20258,7 @@
20036
20258
  }
20037
20259
 
20038
20260
  var argLen = arguments.length;
20039
- if (argLen >= 1 && isFunction(arguments[argLen - 1])) {
20261
+ if (argLen >= 1 && isFunction$1(arguments[argLen - 1])) {
20040
20262
 
20041
20263
  var callback = arguments[argLen - 1];
20042
20264
 
@@ -20077,7 +20299,7 @@
20077
20299
  function ensureCompatDiRef(businessObject) {
20078
20300
 
20079
20301
  // bpmnElement can have multiple independent DIs
20080
- if (!has$1(businessObject, 'di')) {
20302
+ if (!has$3(businessObject, 'di')) {
20081
20303
  Object.defineProperty(businessObject, 'di', {
20082
20304
  enumerable: false,
20083
20305
  get: function() {
@@ -20105,7 +20327,7 @@
20105
20327
  * correctly specify one.
20106
20328
  */
20107
20329
  function findDisplayCandidate(definitions) {
20108
- return find(definitions.rootElements, function(e) {
20330
+ return find$1(definitions.rootElements, function(e) {
20109
20331
  return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
20110
20332
  });
20111
20333
  }
@@ -20212,7 +20434,7 @@
20212
20434
  function handlePlane(plane) {
20213
20435
  registerDi(plane);
20214
20436
 
20215
- forEach$1(plane.planeElement, handlePlaneElement);
20437
+ forEach$3(plane.planeElement, handlePlaneElement);
20216
20438
  }
20217
20439
 
20218
20440
  function handlePlaneElement(planeElement) {
@@ -20337,7 +20559,7 @@
20337
20559
  // walk through all processes that have not yet been drawn and draw them
20338
20560
  // if they contain lanes with DI information.
20339
20561
  // we do this to pass the free-floating lane test cases in the MIWG test suite
20340
- var processes = filter(rootElements, function(e) {
20562
+ var processes = filter$1(rootElements, function(e) {
20341
20563
  return !isHandled(e) && is(e, 'bpmn:Process') && e.laneSets;
20342
20564
  });
20343
20565
 
@@ -20349,7 +20571,7 @@
20349
20571
  }
20350
20572
 
20351
20573
  function handleMessageFlows(messageFlows, context) {
20352
- forEach$1(messageFlows, contextual(handleMessageFlow, context));
20574
+ forEach$3(messageFlows, contextual(handleMessageFlow, context));
20353
20575
  }
20354
20576
 
20355
20577
  function handleDataAssociation(association, context) {
@@ -20375,7 +20597,7 @@
20375
20597
 
20376
20598
  function handleArtifacts(artifacts, context) {
20377
20599
 
20378
- forEach$1(artifacts, function(e) {
20600
+ forEach$3(artifacts, function(e) {
20379
20601
  if (is(e, 'bpmn:Association')) {
20380
20602
  deferred.push(function() {
20381
20603
  handleArtifact(e, context);
@@ -20392,8 +20614,8 @@
20392
20614
  return;
20393
20615
  }
20394
20616
 
20395
- forEach$1(ioSpecification.dataInputs, contextual(handleDataInput, context));
20396
- forEach$1(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
20617
+ forEach$3(ioSpecification.dataInputs, contextual(handleDataInput, context));
20618
+ forEach$3(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
20397
20619
  }
20398
20620
 
20399
20621
  function handleSubProcess(subProcess, context) {
@@ -20420,8 +20642,8 @@
20420
20642
  // * bpmn:CatchEvent
20421
20643
  //
20422
20644
  deferred.push(function() {
20423
- forEach$1(flowNode.dataInputAssociations, contextual(handleDataAssociation, context));
20424
- forEach$1(flowNode.dataOutputAssociations, contextual(handleDataAssociation, context));
20645
+ forEach$3(flowNode.dataInputAssociations, contextual(handleDataAssociation, context));
20646
+ forEach$3(flowNode.dataOutputAssociations, contextual(handleDataAssociation, context));
20425
20647
  });
20426
20648
  }
20427
20649
 
@@ -20448,11 +20670,11 @@
20448
20670
  }
20449
20671
 
20450
20672
  function handleLaneSet(laneSet, context) {
20451
- forEach$1(laneSet.lanes, contextual(handleLane, context));
20673
+ forEach$3(laneSet.lanes, contextual(handleLane, context));
20452
20674
  }
20453
20675
 
20454
20676
  function handleLaneSets(laneSets, context) {
20455
- forEach$1(laneSets, contextual(handleLaneSet, context));
20677
+ forEach$3(laneSets, contextual(handleLaneSet, context));
20456
20678
  }
20457
20679
 
20458
20680
  function handleFlowElementsContainer(container, context) {
@@ -20464,7 +20686,7 @@
20464
20686
  }
20465
20687
 
20466
20688
  function handleFlowElements(flowElements, context) {
20467
- forEach$1(flowElements, function(e) {
20689
+ forEach$3(flowElements, function(e) {
20468
20690
  if (is(e, 'bpmn:SequenceFlow')) {
20469
20691
  deferred.push(function() {
20470
20692
  handleSequenceFlow(e, context);
@@ -20502,7 +20724,7 @@
20502
20724
 
20503
20725
  function handleCollaboration(collaboration, context) {
20504
20726
 
20505
- forEach$1(collaboration.participants, contextual(handleParticipant, context));
20727
+ forEach$3(collaboration.participants, contextual(handleParticipant, context));
20506
20728
 
20507
20729
  handleArtifacts(collaboration.artifacts, context);
20508
20730
 
@@ -20516,7 +20738,7 @@
20516
20738
  function wireFlowNodeRefs(lane) {
20517
20739
 
20518
20740
  // wire the virtual flowNodeRefs <-> relationship
20519
- forEach$1(lane.flowNodeRef, function(flowNode) {
20741
+ forEach$3(lane.flowNodeRef, function(flowNode) {
20520
20742
  var lanes = flowNode.get('lanes');
20521
20743
 
20522
20744
  if (lanes) {
@@ -20610,7 +20832,7 @@
20610
20832
 
20611
20833
  // traverse BPMN 2.0 document model,
20612
20834
  // starting at definitions
20613
- forEach$1(diagramsToImport, function(diagram) {
20835
+ forEach$3(diagramsToImport, function(diagram) {
20614
20836
  walker.handleDefinitions(definitions, diagram);
20615
20837
  });
20616
20838
 
@@ -20677,12 +20899,12 @@
20677
20899
  if (is$1(rootElement, 'bpmn:Collaboration')) {
20678
20900
  collaboration = rootElement;
20679
20901
  } else {
20680
- collaboration = find(definitions.rootElements, function(element) {
20902
+ collaboration = find$1(definitions.rootElements, function(element) {
20681
20903
  if (!is$1(element, 'bpmn:Collaboration')) {
20682
20904
  return;
20683
20905
  }
20684
20906
 
20685
- return find(element.participants, function(participant) {
20907
+ return find$1(element.participants, function(participant) {
20686
20908
  return participant.processRef === rootElement;
20687
20909
  });
20688
20910
  });
@@ -20692,7 +20914,7 @@
20692
20914
 
20693
20915
  // all collaboration processes can contain sub-diagrams
20694
20916
  if (collaboration) {
20695
- rootElements = map(collaboration.participants, function(participant) {
20917
+ rootElements = map$1(collaboration.participants, function(participant) {
20696
20918
  return participant.processRef;
20697
20919
  });
20698
20920
 
@@ -20706,7 +20928,7 @@
20706
20928
  var diagramsToImport = [ bpmnDiagram ];
20707
20929
  var handledElements = [ bpmnElement ];
20708
20930
 
20709
- forEach$1(definitions.diagrams, function(diagram) {
20931
+ forEach$3(definitions.diagrams, function(diagram) {
20710
20932
  var businessObject = diagram.plane.bpmnElement;
20711
20933
 
20712
20934
  if (
@@ -20725,7 +20947,7 @@
20725
20947
  function selfAndAllFlowElements(elements) {
20726
20948
  var result = [];
20727
20949
 
20728
- forEach$1(elements, function(element) {
20950
+ forEach$3(elements, function(element) {
20729
20951
  if (!element) {
20730
20952
  return;
20731
20953
  }
@@ -20818,13 +21040,13 @@
20818
21040
  var lightbox;
20819
21041
 
20820
21042
  function createLightbox() {
20821
- lightbox = domify(LIGHTBOX_MARKUP);
21043
+ lightbox = domify$1(LIGHTBOX_MARKUP);
20822
21044
 
20823
- assign$1(lightbox, LIGHTBOX_STYLES);
20824
- assign$1(query('svg', lightbox), LOGO_STYLES);
20825
- assign$1(query('.backdrop', lightbox), BACKDROP_STYLES);
20826
- assign$1(query('.notice', lightbox), NOTICE_STYLES);
20827
- assign$1(query('.link', lightbox), LINK_STYLES, {
21045
+ assign$3(lightbox, LIGHTBOX_STYLES);
21046
+ assign$3(query('svg', lightbox), LOGO_STYLES);
21047
+ assign$3(query('.backdrop', lightbox), BACKDROP_STYLES);
21048
+ assign$3(query('.notice', lightbox), NOTICE_STYLES);
21049
+ assign$3(query('.link', lightbox), LINK_STYLES, {
20828
21050
  'margin': '15px 20px 15px 10px',
20829
21051
  'alignSelf': 'center'
20830
21052
  });
@@ -20866,7 +21088,7 @@
20866
21088
  */
20867
21089
  function BaseViewer(options) {
20868
21090
 
20869
- options = assign({}, DEFAULT_OPTIONS, options);
21091
+ options = assign$4({}, DEFAULT_OPTIONS, options);
20870
21092
 
20871
21093
  this._moddle = this._createModdle(options);
20872
21094
 
@@ -21408,8 +21630,8 @@
21408
21630
 
21409
21631
  const diagramModules = [].concat(staticModules, baseModules, additionalModules);
21410
21632
 
21411
- const diagramOptions = assign(omit(options, [ 'additionalModules' ]), {
21412
- canvas: assign({}, options.canvas, { container: container }),
21633
+ const diagramOptions = assign$4(omit(options, [ 'additionalModules' ]), {
21634
+ canvas: assign$4({}, options.canvas, { container: container }),
21413
21635
  modules: diagramModules
21414
21636
  });
21415
21637
 
@@ -21435,9 +21657,9 @@
21435
21657
 
21436
21658
  BaseViewer.prototype._createContainer = function(options) {
21437
21659
 
21438
- const container = domify('<div class="bjs-container"></div>');
21660
+ const container = domify$1('<div class="bjs-container"></div>');
21439
21661
 
21440
- assign$1(container, {
21662
+ assign$3(container, {
21441
21663
  width: ensureUnit(options.width),
21442
21664
  height: ensureUnit(options.height),
21443
21665
  position: options.position
@@ -21447,7 +21669,7 @@
21447
21669
  };
21448
21670
 
21449
21671
  BaseViewer.prototype._createModdle = function(options) {
21450
- const moddleOptions = assign({}, this._moddleExtensions, options.moddleExtensions);
21672
+ const moddleOptions = assign$4({}, this._moddleExtensions, options.moddleExtensions);
21451
21673
 
21452
21674
  return new simple(moddleOptions);
21453
21675
  };
@@ -21506,7 +21728,7 @@
21506
21728
  return null;
21507
21729
  }
21508
21730
 
21509
- return find(definitions.diagrams, function(element) {
21731
+ return find$1(definitions.diagrams, function(element) {
21510
21732
  return element.id === diagramId;
21511
21733
  }) || null;
21512
21734
  }
@@ -21531,10 +21753,10 @@
21531
21753
  img +
21532
21754
  '</a>';
21533
21755
 
21534
- const linkElement = domify(linkMarkup);
21756
+ const linkElement = domify$1(linkMarkup);
21535
21757
 
21536
- assign$1(query('svg', linkElement), LOGO_STYLES);
21537
- assign$1(linkElement, LINK_STYLES, {
21758
+ assign$3(query('svg', linkElement), LOGO_STYLES);
21759
+ assign$3(linkElement, LINK_STYLES, {
21538
21760
  position: 'absolute',
21539
21761
  bottom: '15px',
21540
21762
  right: '15px',
@@ -21543,7 +21765,7 @@
21543
21765
 
21544
21766
  container.appendChild(linkElement);
21545
21767
 
21546
- componentEvent.bind(linkElement, 'click', function(event) {
21768
+ event.bind(linkElement, 'click', function(event) {
21547
21769
  open();
21548
21770
 
21549
21771
  event.preventDefault();