@antv/g-svg 1.8.24 → 1.8.26

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.
package/dist/index.umd.js CHANGED
@@ -5,20 +5,19 @@
5
5
  }(this, (function (exports, gLite) { 'use strict';
6
6
 
7
7
  function _regeneratorRuntime() {
8
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
9
-
10
8
  _regeneratorRuntime = function () {
11
9
  return exports;
12
10
  };
13
-
14
11
  var exports = {},
15
- Op = Object.prototype,
16
- hasOwn = Op.hasOwnProperty,
17
- $Symbol = "function" == typeof Symbol ? Symbol : {},
18
- iteratorSymbol = $Symbol.iterator || "@@iterator",
19
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
20
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
21
-
12
+ Op = Object.prototype,
13
+ hasOwn = Op.hasOwnProperty,
14
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
15
+ obj[key] = desc.value;
16
+ },
17
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
18
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
19
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
20
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
22
21
  function define(obj, key, value) {
23
22
  return Object.defineProperty(obj, key, {
24
23
  value: value,
@@ -27,7 +26,6 @@
27
26
  writable: !0
28
27
  }), obj[key];
29
28
  }
30
-
31
29
  try {
32
30
  define({}, "");
33
31
  } catch (err) {
@@ -35,54 +33,14 @@
35
33
  return obj[key] = value;
36
34
  };
37
35
  }
38
-
39
36
  function wrap(innerFn, outerFn, self, tryLocsList) {
40
37
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
41
- generator = Object.create(protoGenerator.prototype),
42
- context = new Context(tryLocsList || []);
43
- return generator._invoke = function (innerFn, self, context) {
44
- var state = "suspendedStart";
45
- return function (method, arg) {
46
- if ("executing" === state) throw new Error("Generator is already running");
47
-
48
- if ("completed" === state) {
49
- if ("throw" === method) throw arg;
50
- return doneResult();
51
- }
52
-
53
- for (context.method = method, context.arg = arg;;) {
54
- var delegate = context.delegate;
55
-
56
- if (delegate) {
57
- var delegateResult = maybeInvokeDelegate(delegate, context);
58
-
59
- if (delegateResult) {
60
- if (delegateResult === ContinueSentinel) continue;
61
- return delegateResult;
62
- }
63
- }
64
-
65
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
66
- if ("suspendedStart" === state) throw state = "completed", context.arg;
67
- context.dispatchException(context.arg);
68
- } else "return" === context.method && context.abrupt("return", context.arg);
69
- state = "executing";
70
- var record = tryCatch(innerFn, self, context);
71
-
72
- if ("normal" === record.type) {
73
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
74
- return {
75
- value: record.arg,
76
- done: context.done
77
- };
78
- }
79
-
80
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
81
- }
82
- };
83
- }(innerFn, self, context), generator;
38
+ generator = Object.create(protoGenerator.prototype),
39
+ context = new Context(tryLocsList || []);
40
+ return defineProperty(generator, "_invoke", {
41
+ value: makeInvokeMethod(innerFn, self, context)
42
+ }), generator;
84
43
  }
85
-
86
44
  function tryCatch(fn, obj, arg) {
87
45
  try {
88
46
  return {
@@ -96,25 +54,19 @@
96
54
  };
97
55
  }
98
56
  }
99
-
100
57
  exports.wrap = wrap;
101
58
  var ContinueSentinel = {};
102
-
103
59
  function Generator() {}
104
-
105
60
  function GeneratorFunction() {}
106
-
107
61
  function GeneratorFunctionPrototype() {}
108
-
109
62
  var IteratorPrototype = {};
110
63
  define(IteratorPrototype, iteratorSymbol, function () {
111
64
  return this;
112
65
  });
113
66
  var getProto = Object.getPrototypeOf,
114
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
67
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
115
68
  NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
116
69
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
117
-
118
70
  function defineIteratorMethods(prototype) {
119
71
  ["next", "throw", "return"].forEach(function (method) {
120
72
  define(prototype, method, function (arg) {
@@ -122,14 +74,12 @@
122
74
  });
123
75
  });
124
76
  }
125
-
126
77
  function AsyncIterator(generator, PromiseImpl) {
127
78
  function invoke(method, arg, resolve, reject) {
128
79
  var record = tryCatch(generator[method], generator, arg);
129
-
130
80
  if ("throw" !== record.type) {
131
81
  var result = record.arg,
132
- value = result.value;
82
+ value = result.value;
133
83
  return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
134
84
  invoke("next", value, resolve, reject);
135
85
  }, function (err) {
@@ -140,90 +90,114 @@
140
90
  return invoke("throw", error, resolve, reject);
141
91
  });
142
92
  }
143
-
144
93
  reject(record.arg);
145
94
  }
146
-
147
95
  var previousPromise;
148
-
149
- this._invoke = function (method, arg) {
150
- function callInvokeWithMethodAndArg() {
151
- return new PromiseImpl(function (resolve, reject) {
152
- invoke(method, arg, resolve, reject);
153
- });
96
+ defineProperty(this, "_invoke", {
97
+ value: function (method, arg) {
98
+ function callInvokeWithMethodAndArg() {
99
+ return new PromiseImpl(function (resolve, reject) {
100
+ invoke(method, arg, resolve, reject);
101
+ });
102
+ }
103
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
104
+ }
105
+ });
106
+ }
107
+ function makeInvokeMethod(innerFn, self, context) {
108
+ var state = "suspendedStart";
109
+ return function (method, arg) {
110
+ if ("executing" === state) throw new Error("Generator is already running");
111
+ if ("completed" === state) {
112
+ if ("throw" === method) throw arg;
113
+ return doneResult();
114
+ }
115
+ for (context.method = method, context.arg = arg;;) {
116
+ var delegate = context.delegate;
117
+ if (delegate) {
118
+ var delegateResult = maybeInvokeDelegate(delegate, context);
119
+ if (delegateResult) {
120
+ if (delegateResult === ContinueSentinel) continue;
121
+ return delegateResult;
122
+ }
123
+ }
124
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
125
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
126
+ context.dispatchException(context.arg);
127
+ } else "return" === context.method && context.abrupt("return", context.arg);
128
+ state = "executing";
129
+ var record = tryCatch(innerFn, self, context);
130
+ if ("normal" === record.type) {
131
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
132
+ return {
133
+ value: record.arg,
134
+ done: context.done
135
+ };
136
+ }
137
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
154
138
  }
155
-
156
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
157
139
  };
158
140
  }
159
-
160
141
  function maybeInvokeDelegate(delegate, context) {
161
142
  var method = delegate.iterator[context.method];
162
-
163
143
  if (undefined === method) {
164
144
  if (context.delegate = null, "throw" === context.method) {
165
145
  if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
166
146
  context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
167
147
  }
168
-
169
148
  return ContinueSentinel;
170
149
  }
171
-
172
150
  var record = tryCatch(method, delegate.iterator, context.arg);
173
151
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
174
152
  var info = record.arg;
175
153
  return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
176
154
  }
177
-
178
155
  function pushTryEntry(locs) {
179
156
  var entry = {
180
157
  tryLoc: locs[0]
181
158
  };
182
159
  1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
183
160
  }
184
-
185
161
  function resetTryEntry(entry) {
186
162
  var record = entry.completion || {};
187
163
  record.type = "normal", delete record.arg, entry.completion = record;
188
164
  }
189
-
190
165
  function Context(tryLocsList) {
191
166
  this.tryEntries = [{
192
167
  tryLoc: "root"
193
168
  }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
194
169
  }
195
-
196
170
  function values(iterable) {
197
171
  if (iterable) {
198
172
  var iteratorMethod = iterable[iteratorSymbol];
199
173
  if (iteratorMethod) return iteratorMethod.call(iterable);
200
174
  if ("function" == typeof iterable.next) return iterable;
201
-
202
175
  if (!isNaN(iterable.length)) {
203
176
  var i = -1,
204
- next = function next() {
205
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
206
-
207
- return next.value = undefined, next.done = !0, next;
208
- };
209
-
177
+ next = function next() {
178
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
179
+ return next.value = undefined, next.done = !0, next;
180
+ };
210
181
  return next.next = next;
211
182
  }
212
183
  }
213
-
214
184
  return {
215
185
  next: doneResult
216
186
  };
217
187
  }
218
-
219
188
  function doneResult() {
220
189
  return {
221
190
  value: undefined,
222
191
  done: !0
223
192
  };
224
193
  }
225
-
226
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
194
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
195
+ value: GeneratorFunctionPrototype,
196
+ configurable: !0
197
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
198
+ value: GeneratorFunction,
199
+ configurable: !0
200
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
227
201
  var ctor = "function" == typeof genFun && genFun.constructor;
228
202
  return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
229
203
  }, exports.mark = function (genFun) {
@@ -244,17 +218,15 @@
244
218
  return this;
245
219
  }), define(Gp, "toString", function () {
246
220
  return "[object Generator]";
247
- }), exports.keys = function (object) {
248
- var keys = [];
249
-
221
+ }), exports.keys = function (val) {
222
+ var object = Object(val),
223
+ keys = [];
250
224
  for (var key in object) keys.push(key);
251
-
252
225
  return keys.reverse(), function next() {
253
226
  for (; keys.length;) {
254
227
  var key = keys.pop();
255
228
  if (key in object) return next.value = key, next.done = !1, next;
256
229
  }
257
-
258
230
  return next.done = !0, next;
259
231
  };
260
232
  }, exports.values = values, Context.prototype = {
@@ -271,20 +243,16 @@
271
243
  dispatchException: function (exception) {
272
244
  if (this.done) throw exception;
273
245
  var context = this;
274
-
275
246
  function handle(loc, caught) {
276
247
  return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
277
248
  }
278
-
279
249
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
280
250
  var entry = this.tryEntries[i],
281
- record = entry.completion;
251
+ record = entry.completion;
282
252
  if ("root" === entry.tryLoc) return handle("end");
283
-
284
253
  if (entry.tryLoc <= this.prev) {
285
254
  var hasCatch = hasOwn.call(entry, "catchLoc"),
286
- hasFinally = hasOwn.call(entry, "finallyLoc");
287
-
255
+ hasFinally = hasOwn.call(entry, "finallyLoc");
288
256
  if (hasCatch && hasFinally) {
289
257
  if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
290
258
  if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
@@ -300,13 +268,11 @@
300
268
  abrupt: function (type, arg) {
301
269
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
302
270
  var entry = this.tryEntries[i];
303
-
304
271
  if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
305
272
  var finallyEntry = entry;
306
273
  break;
307
274
  }
308
275
  }
309
-
310
276
  finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
311
277
  var record = finallyEntry ? finallyEntry.completion : {};
312
278
  return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
@@ -324,19 +290,15 @@
324
290
  catch: function (tryLoc) {
325
291
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
326
292
  var entry = this.tryEntries[i];
327
-
328
293
  if (entry.tryLoc === tryLoc) {
329
294
  var record = entry.completion;
330
-
331
295
  if ("throw" === record.type) {
332
296
  var thrown = record.arg;
333
297
  resetTryEntry(entry);
334
298
  }
335
-
336
299
  return thrown;
337
300
  }
338
301
  }
339
-
340
302
  throw new Error("illegal catch attempt");
341
303
  },
342
304
  delegateYield: function (iterable, resultName, nextLoc) {
@@ -348,7 +310,6 @@
348
310
  }
349
311
  }, exports;
350
312
  }
351
-
352
313
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
353
314
  try {
354
315
  var info = gen[key](arg);
@@ -357,41 +318,33 @@
357
318
  reject(error);
358
319
  return;
359
320
  }
360
-
361
321
  if (info.done) {
362
322
  resolve(value);
363
323
  } else {
364
324
  Promise.resolve(value).then(_next, _throw);
365
325
  }
366
326
  }
367
-
368
327
  function _asyncToGenerator(fn) {
369
328
  return function () {
370
329
  var self = this,
371
- args = arguments;
330
+ args = arguments;
372
331
  return new Promise(function (resolve, reject) {
373
332
  var gen = fn.apply(self, args);
374
-
375
333
  function _next(value) {
376
334
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
377
335
  }
378
-
379
336
  function _throw(err) {
380
337
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
381
338
  }
382
-
383
339
  _next(undefined);
384
340
  });
385
341
  };
386
342
  }
387
-
388
343
  function _inheritsLoose(subClass, superClass) {
389
344
  subClass.prototype = Object.create(superClass.prototype);
390
345
  subClass.prototype.constructor = subClass;
391
-
392
346
  _setPrototypeOf(subClass, superClass);
393
347
  }
394
-
395
348
  function _setPrototypeOf(o, p) {
396
349
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
397
350
  o.__proto__ = p;
@@ -401,19 +354,19 @@
401
354
  }
402
355
 
403
356
  function _regeneratorRuntime$1() {
404
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
405
357
  _regeneratorRuntime$1 = function _regeneratorRuntime() {
406
358
  return exports;
407
359
  };
408
-
409
360
  var exports = {},
410
- Op = Object.prototype,
411
- hasOwn = Op.hasOwnProperty,
412
- $Symbol = "function" == typeof Symbol ? Symbol : {},
413
- iteratorSymbol = $Symbol.iterator || "@@iterator",
414
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
415
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
416
-
361
+ Op = Object.prototype,
362
+ hasOwn = Op.hasOwnProperty,
363
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
364
+ obj[key] = desc.value;
365
+ },
366
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
367
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
368
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
369
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
417
370
  function define(obj, key, value) {
418
371
  return Object.defineProperty(obj, key, {
419
372
  value: value,
@@ -422,7 +375,6 @@
422
375
  writable: !0
423
376
  }), obj[key];
424
377
  }
425
-
426
378
  try {
427
379
  define({}, "");
428
380
  } catch (err) {
@@ -430,54 +382,14 @@
430
382
  return obj[key] = value;
431
383
  };
432
384
  }
433
-
434
385
  function wrap(innerFn, outerFn, self, tryLocsList) {
435
386
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
436
- generator = Object.create(protoGenerator.prototype),
437
- context = new Context(tryLocsList || []);
438
- return generator._invoke = function (innerFn, self, context) {
439
- var state = "suspendedStart";
440
- return function (method, arg) {
441
- if ("executing" === state) throw new Error("Generator is already running");
442
-
443
- if ("completed" === state) {
444
- if ("throw" === method) throw arg;
445
- return doneResult();
446
- }
447
-
448
- for (context.method = method, context.arg = arg;;) {
449
- var delegate = context.delegate;
450
-
451
- if (delegate) {
452
- var delegateResult = maybeInvokeDelegate(delegate, context);
453
-
454
- if (delegateResult) {
455
- if (delegateResult === ContinueSentinel) continue;
456
- return delegateResult;
457
- }
458
- }
459
-
460
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
461
- if ("suspendedStart" === state) throw state = "completed", context.arg;
462
- context.dispatchException(context.arg);
463
- } else "return" === context.method && context.abrupt("return", context.arg);
464
- state = "executing";
465
- var record = tryCatch(innerFn, self, context);
466
-
467
- if ("normal" === record.type) {
468
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
469
- return {
470
- value: record.arg,
471
- done: context.done
472
- };
473
- }
474
-
475
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
476
- }
477
- };
478
- }(innerFn, self, context), generator;
387
+ generator = Object.create(protoGenerator.prototype),
388
+ context = new Context(tryLocsList || []);
389
+ return defineProperty(generator, "_invoke", {
390
+ value: makeInvokeMethod(innerFn, self, context)
391
+ }), generator;
479
392
  }
480
-
481
393
  function tryCatch(fn, obj, arg) {
482
394
  try {
483
395
  return {
@@ -491,25 +403,19 @@
491
403
  };
492
404
  }
493
405
  }
494
-
495
406
  exports.wrap = wrap;
496
407
  var ContinueSentinel = {};
497
-
498
408
  function Generator() {}
499
-
500
409
  function GeneratorFunction() {}
501
-
502
410
  function GeneratorFunctionPrototype() {}
503
-
504
411
  var IteratorPrototype = {};
505
412
  define(IteratorPrototype, iteratorSymbol, function () {
506
413
  return this;
507
414
  });
508
415
  var getProto = Object.getPrototypeOf,
509
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
416
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
510
417
  NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
511
418
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
512
-
513
419
  function defineIteratorMethods(prototype) {
514
420
  ["next", "throw", "return"].forEach(function (method) {
515
421
  define(prototype, method, function (arg) {
@@ -517,14 +423,12 @@
517
423
  });
518
424
  });
519
425
  }
520
-
521
426
  function AsyncIterator(generator, PromiseImpl) {
522
427
  function invoke(method, arg, resolve, reject) {
523
428
  var record = tryCatch(generator[method], generator, arg);
524
-
525
429
  if ("throw" !== record.type) {
526
430
  var result = record.arg,
527
- value = result.value;
431
+ value = result.value;
528
432
  return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
529
433
  invoke("next", value, resolve, reject);
530
434
  }, function (err) {
@@ -535,92 +439,116 @@
535
439
  return invoke("throw", error, resolve, reject);
536
440
  });
537
441
  }
538
-
539
442
  reject(record.arg);
540
443
  }
541
-
542
444
  var previousPromise;
543
-
544
- this._invoke = function (method, arg) {
545
- function callInvokeWithMethodAndArg() {
546
- return new PromiseImpl(function (resolve, reject) {
547
- invoke(method, arg, resolve, reject);
548
- });
445
+ defineProperty(this, "_invoke", {
446
+ value: function value(method, arg) {
447
+ function callInvokeWithMethodAndArg() {
448
+ return new PromiseImpl(function (resolve, reject) {
449
+ invoke(method, arg, resolve, reject);
450
+ });
451
+ }
452
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
453
+ }
454
+ });
455
+ }
456
+ function makeInvokeMethod(innerFn, self, context) {
457
+ var state = "suspendedStart";
458
+ return function (method, arg) {
459
+ if ("executing" === state) throw new Error("Generator is already running");
460
+ if ("completed" === state) {
461
+ if ("throw" === method) throw arg;
462
+ return doneResult();
463
+ }
464
+ for (context.method = method, context.arg = arg;;) {
465
+ var delegate = context.delegate;
466
+ if (delegate) {
467
+ var delegateResult = maybeInvokeDelegate(delegate, context);
468
+ if (delegateResult) {
469
+ if (delegateResult === ContinueSentinel) continue;
470
+ return delegateResult;
471
+ }
472
+ }
473
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
474
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
475
+ context.dispatchException(context.arg);
476
+ } else "return" === context.method && context.abrupt("return", context.arg);
477
+ state = "executing";
478
+ var record = tryCatch(innerFn, self, context);
479
+ if ("normal" === record.type) {
480
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
481
+ return {
482
+ value: record.arg,
483
+ done: context.done
484
+ };
485
+ }
486
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
549
487
  }
550
-
551
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
552
488
  };
553
489
  }
554
-
555
490
  function maybeInvokeDelegate(delegate, context) {
556
491
  var method = delegate.iterator[context.method];
557
-
558
492
  if (undefined === method) {
559
493
  if (context.delegate = null, "throw" === context.method) {
560
494
  if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
561
495
  context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
562
496
  }
563
-
564
497
  return ContinueSentinel;
565
498
  }
566
-
567
499
  var record = tryCatch(method, delegate.iterator, context.arg);
568
500
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
569
501
  var info = record.arg;
570
502
  return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
571
503
  }
572
-
573
504
  function pushTryEntry(locs) {
574
505
  var entry = {
575
506
  tryLoc: locs[0]
576
507
  };
577
508
  1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
578
509
  }
579
-
580
510
  function resetTryEntry(entry) {
581
511
  var record = entry.completion || {};
582
512
  record.type = "normal", delete record.arg, entry.completion = record;
583
513
  }
584
-
585
514
  function Context(tryLocsList) {
586
515
  this.tryEntries = [{
587
516
  tryLoc: "root"
588
517
  }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
589
518
  }
590
-
591
519
  function values(iterable) {
592
520
  if (iterable) {
593
521
  var iteratorMethod = iterable[iteratorSymbol];
594
522
  if (iteratorMethod) return iteratorMethod.call(iterable);
595
523
  if ("function" == typeof iterable.next) return iterable;
596
-
597
524
  if (!isNaN(iterable.length)) {
598
525
  var i = -1,
599
- next = function next() {
600
- for (; ++i < iterable.length;) {
601
- if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
602
- }
603
-
604
- return next.value = undefined, next.done = !0, next;
605
- };
606
-
526
+ next = function next() {
527
+ for (; ++i < iterable.length;) {
528
+ if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
529
+ }
530
+ return next.value = undefined, next.done = !0, next;
531
+ };
607
532
  return next.next = next;
608
533
  }
609
534
  }
610
-
611
535
  return {
612
536
  next: doneResult
613
537
  };
614
538
  }
615
-
616
539
  function doneResult() {
617
540
  return {
618
541
  value: undefined,
619
542
  done: !0
620
543
  };
621
544
  }
622
-
623
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
545
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
546
+ value: GeneratorFunctionPrototype,
547
+ configurable: !0
548
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
549
+ value: GeneratorFunction,
550
+ configurable: !0
551
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
624
552
  var ctor = "function" == typeof genFun && genFun.constructor;
625
553
  return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
626
554
  }, exports.mark = function (genFun) {
@@ -641,19 +569,17 @@
641
569
  return this;
642
570
  }), define(Gp, "toString", function () {
643
571
  return "[object Generator]";
644
- }), exports.keys = function (object) {
645
- var keys = [];
646
-
572
+ }), exports.keys = function (val) {
573
+ var object = Object(val),
574
+ keys = [];
647
575
  for (var key in object) {
648
576
  keys.push(key);
649
577
  }
650
-
651
578
  return keys.reverse(), function next() {
652
579
  for (; keys.length;) {
653
580
  var key = keys.pop();
654
581
  if (key in object) return next.value = key, next.done = !1, next;
655
582
  }
656
-
657
583
  return next.done = !0, next;
658
584
  };
659
585
  }, exports.values = values, Context.prototype = {
@@ -672,20 +598,16 @@
672
598
  dispatchException: function dispatchException(exception) {
673
599
  if (this.done) throw exception;
674
600
  var context = this;
675
-
676
601
  function handle(loc, caught) {
677
602
  return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
678
603
  }
679
-
680
604
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
681
605
  var entry = this.tryEntries[i],
682
- record = entry.completion;
606
+ record = entry.completion;
683
607
  if ("root" === entry.tryLoc) return handle("end");
684
-
685
608
  if (entry.tryLoc <= this.prev) {
686
609
  var hasCatch = hasOwn.call(entry, "catchLoc"),
687
- hasFinally = hasOwn.call(entry, "finallyLoc");
688
-
610
+ hasFinally = hasOwn.call(entry, "finallyLoc");
689
611
  if (hasCatch && hasFinally) {
690
612
  if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
691
613
  if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
@@ -701,13 +623,11 @@
701
623
  abrupt: function abrupt(type, arg) {
702
624
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
703
625
  var entry = this.tryEntries[i];
704
-
705
626
  if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
706
627
  var finallyEntry = entry;
707
628
  break;
708
629
  }
709
630
  }
710
-
711
631
  finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
712
632
  var record = finallyEntry ? finallyEntry.completion : {};
713
633
  return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
@@ -725,19 +645,15 @@
725
645
  catch: function _catch(tryLoc) {
726
646
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
727
647
  var entry = this.tryEntries[i];
728
-
729
648
  if (entry.tryLoc === tryLoc) {
730
649
  var record = entry.completion;
731
-
732
650
  if ("throw" === record.type) {
733
651
  var thrown = record.arg;
734
652
  resetTryEntry(entry);
735
653
  }
736
-
737
654
  return thrown;
738
655
  }
739
656
  }
740
-
741
657
  throw new Error("illegal catch attempt");
742
658
  },
743
659
  delegateYield: function delegateYield(iterable, resultName, nextLoc) {
@@ -749,7 +665,6 @@
749
665
  }
750
666
  }, exports;
751
667
  }
752
-
753
668
  function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
754
669
  try {
755
670
  var info = gen[key](arg);
@@ -758,97 +673,78 @@
758
673
  reject(error);
759
674
  return;
760
675
  }
761
-
762
676
  if (info.done) {
763
677
  resolve(value);
764
678
  } else {
765
679
  Promise.resolve(value).then(_next, _throw);
766
680
  }
767
681
  }
768
-
769
682
  function _asyncToGenerator$1(fn) {
770
683
  return function () {
771
684
  var self = this,
772
- args = arguments;
685
+ args = arguments;
773
686
  return new Promise(function (resolve, reject) {
774
687
  var gen = fn.apply(self, args);
775
-
776
688
  function _next(value) {
777
689
  asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
778
690
  }
779
-
780
691
  function _throw(err) {
781
692
  asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
782
693
  }
783
-
784
694
  _next(undefined);
785
695
  });
786
696
  };
787
697
  }
788
-
789
698
  function _inheritsLoose$1(subClass, superClass) {
790
699
  subClass.prototype = Object.create(superClass.prototype);
791
700
  subClass.prototype.constructor = subClass;
792
-
793
701
  _setPrototypeOf$1(subClass, superClass);
794
702
  }
795
-
796
703
  function _setPrototypeOf$1(o, p) {
797
704
  _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
798
705
  o.__proto__ = p;
799
706
  return o;
800
707
  };
801
708
  return _setPrototypeOf$1(o, p);
802
- } // const MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
709
+ }
803
710
 
711
+ // const MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
804
712
  /**
805
713
  * listen to mouse/touch/pointer events on DOM wrapper, trigger pointer events
806
714
  */
807
-
808
-
809
715
  var DOMInteractionPlugin = /*#__PURE__*/function () {
810
716
  function DOMInteractionPlugin() {
811
717
  this.context = void 0;
812
718
  }
813
-
814
719
  var _proto = DOMInteractionPlugin.prototype;
815
-
816
720
  _proto.apply = function apply(context) {
817
721
  var _this = this;
818
-
819
722
  var renderingService = context.renderingService,
820
- renderingContext = context.renderingContext;
723
+ renderingContext = context.renderingContext;
821
724
  this.context = context;
822
- var canvas = renderingContext.root.ownerDocument.defaultView; // const SUPPORT_ONLY_TOUCH = canvas.supportsTouchEvents && MOBILE_REGEX.test(navigator.userAgent);
823
-
725
+ var canvas = renderingContext.root.ownerDocument.defaultView;
726
+ // const SUPPORT_ONLY_TOUCH = canvas.supportsTouchEvents && MOBILE_REGEX.test(navigator.userAgent);
824
727
  var onPointerMove = function onPointerMove(ev) {
825
728
  renderingService.hooks.pointerMove.call(ev);
826
729
  };
827
-
828
730
  var onPointerUp = function onPointerUp(ev) {
829
731
  renderingService.hooks.pointerUp.call(ev);
830
732
  };
831
-
832
733
  var onPointerDown = function onPointerDown(ev) {
833
734
  renderingService.hooks.pointerDown.call(ev);
834
735
  };
835
-
836
736
  var onPointerOver = function onPointerOver(ev) {
837
737
  renderingService.hooks.pointerOver.call(ev);
838
738
  };
839
-
840
739
  var onPointerOut = function onPointerOut(ev) {
841
740
  renderingService.hooks.pointerOut.call(ev);
842
741
  };
843
-
844
742
  var onPointerCancel = function onPointerCancel(ev) {
845
743
  renderingService.hooks.pointerCancel.call(ev);
846
744
  };
847
-
848
745
  var onPointerWheel = function onPointerWheel(ev) {
849
746
  renderingService.hooks.pointerWheel.call(ev);
850
747
  };
851
-
852
748
  var addPointerEventListener = function addPointerEventListener($el) {
853
749
  globalThis.document.addEventListener('pointermove', onPointerMove, true);
854
750
  $el.addEventListener('pointerdown', onPointerDown, true);
@@ -856,14 +752,12 @@
856
752
  $el.addEventListener('pointerover', onPointerOver, true);
857
753
  globalThis.addEventListener('pointerup', onPointerUp, true);
858
754
  };
859
-
860
755
  var addTouchEventListener = function addTouchEventListener($el) {
861
756
  $el.addEventListener('touchstart', onPointerDown, true);
862
757
  $el.addEventListener('touchend', onPointerUp, true);
863
758
  $el.addEventListener('touchmove', onPointerMove, true);
864
759
  $el.addEventListener('touchcancel', onPointerCancel, true);
865
760
  };
866
-
867
761
  var addMouseEventListener = function addMouseEventListener($el) {
868
762
  globalThis.document.addEventListener('mousemove', onPointerMove, true);
869
763
  $el.addEventListener('mousedown', onPointerDown, true);
@@ -871,7 +765,6 @@
871
765
  $el.addEventListener('mouseover', onPointerOver, true);
872
766
  globalThis.addEventListener('mouseup', onPointerUp, true);
873
767
  };
874
-
875
768
  var removePointerEventListener = function removePointerEventListener($el) {
876
769
  globalThis.document.removeEventListener('pointermove', onPointerMove, true);
877
770
  $el.removeEventListener('pointerdown', onPointerDown, true);
@@ -879,14 +772,12 @@
879
772
  $el.removeEventListener('pointerover', onPointerOver, true);
880
773
  globalThis.removeEventListener('pointerup', onPointerUp, true);
881
774
  };
882
-
883
775
  var removeTouchEventListener = function removeTouchEventListener($el) {
884
776
  $el.removeEventListener('touchstart', onPointerDown, true);
885
777
  $el.removeEventListener('touchend', onPointerUp, true);
886
778
  $el.removeEventListener('touchmove', onPointerMove, true);
887
779
  $el.removeEventListener('touchcancel', onPointerCancel, true);
888
780
  };
889
-
890
781
  var removeMouseEventListener = function removeMouseEventListener($el) {
891
782
  globalThis.document.removeEventListener('mousemove', onPointerMove, true);
892
783
  $el.removeEventListener('mousedown', onPointerDown, true);
@@ -894,7 +785,6 @@
894
785
  $el.removeEventListener('mouseover', onPointerOver, true);
895
786
  globalThis.removeEventListener('mouseup', onPointerUp, true);
896
787
  };
897
-
898
788
  renderingService.hooks.init.tapPromise(DOMInteractionPlugin.tag, /*#__PURE__*/_asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee() {
899
789
  var $el;
900
790
  return _regeneratorRuntime$1().wrap(function _callee$(_context) {
@@ -902,33 +792,28 @@
902
792
  switch (_context.prev = _context.next) {
903
793
  case 0:
904
794
  $el = _this.context.contextService.getDomElement(); // @ts-ignore
905
-
906
795
  if (globalThis.navigator.msPointerEnabled) {
907
796
  // @ts-ignore
908
- $el.style.msContentZooming = 'none'; // @ts-ignore
909
-
797
+ $el.style.msContentZooming = 'none';
798
+ // @ts-ignore
910
799
  $el.style.msTouchAction = 'none';
911
800
  } else if (canvas.supportsPointerEvents) {
912
801
  $el.style.touchAction = 'none';
913
802
  }
914
-
915
803
  if (canvas.supportsPointerEvents) {
916
804
  addPointerEventListener($el);
917
805
  } else {
918
806
  addMouseEventListener($el);
919
807
  }
920
-
921
808
  if (canvas.supportsTouchEvents) {
922
809
  addTouchEventListener($el);
923
- } // use passive event listeners
810
+ }
811
+ // use passive event listeners
924
812
  // @see https://zhuanlan.zhihu.com/p/24555031
925
-
926
-
927
813
  $el.addEventListener('wheel', onPointerWheel, {
928
814
  passive: true,
929
815
  capture: true
930
816
  });
931
-
932
817
  case 5:
933
818
  case "end":
934
819
  return _context.stop();
@@ -937,62 +822,48 @@
937
822
  }, _callee);
938
823
  })));
939
824
  renderingService.hooks.destroy.tap(DOMInteractionPlugin.tag, function () {
940
- var $el = _this.context.contextService.getDomElement(); // @ts-ignore
941
-
942
-
825
+ var $el = _this.context.contextService.getDomElement();
826
+ // @ts-ignore
943
827
  if (globalThis.navigator.msPointerEnabled) {
944
828
  // @ts-ignore
945
- $el.style.msContentZooming = ''; // @ts-ignore
946
-
829
+ $el.style.msContentZooming = '';
830
+ // @ts-ignore
947
831
  $el.style.msTouchAction = '';
948
832
  } else if (canvas.supportsPointerEvents) {
949
833
  $el.style.touchAction = '';
950
834
  }
951
-
952
835
  if (canvas.supportsPointerEvents) {
953
836
  removePointerEventListener($el);
954
837
  } else {
955
838
  removeMouseEventListener($el);
956
839
  }
957
-
958
840
  if (canvas.supportsTouchEvents) {
959
841
  removeTouchEventListener($el);
960
842
  }
961
-
962
843
  $el.removeEventListener('wheel', onPointerWheel, true);
963
844
  });
964
845
  };
965
-
966
846
  return DOMInteractionPlugin;
967
847
  }();
968
-
969
848
  DOMInteractionPlugin.tag = 'DOMInteraction';
970
-
971
849
  var Plugin = /*#__PURE__*/function (_AbstractRendererPlug) {
972
850
  _inheritsLoose$1(Plugin, _AbstractRendererPlug);
973
-
974
851
  function Plugin() {
975
852
  var _this;
976
-
977
853
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
978
854
  args[_key] = arguments[_key];
979
855
  }
980
-
981
856
  _this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
982
857
  _this.name = 'dom-interaction';
983
858
  return _this;
984
859
  }
985
-
986
860
  var _proto = Plugin.prototype;
987
-
988
861
  _proto.init = function init() {
989
862
  this.addRenderingPlugin(new DOMInteractionPlugin());
990
863
  };
991
-
992
864
  _proto.destroy = function destroy() {
993
865
  this.removeAllRenderingPlugins();
994
866
  };
995
-
996
867
  return Plugin;
997
868
  }(gLite.AbstractRendererPlugin);
998
869
 
@@ -1116,9 +987,6 @@
1116
987
  return out;
1117
988
  }
1118
989
 
1119
- var toString = {}.toString;
1120
- var isType = function (value, type) { return toString.call(value) === '[object ' + type + ']'; };
1121
-
1122
990
  // isFinite,
1123
991
  var isNil = function (value) {
1124
992
  /**
@@ -1128,6 +996,9 @@
1128
996
  return value === null || value === undefined;
1129
997
  };
1130
998
 
999
+ var toString = {}.toString;
1000
+ var isType = function (value, type) { return toString.call(value) === '[object ' + type + ']'; };
1001
+
1131
1002
  var isString = (function (str) {
1132
1003
  return isType(str, 'String');
1133
1004
  });
@@ -1349,19 +1220,19 @@
1349
1220
  }
1350
1221
 
1351
1222
  function _regeneratorRuntime$2() {
1352
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
1353
1223
  _regeneratorRuntime$2 = function _regeneratorRuntime() {
1354
1224
  return exports;
1355
1225
  };
1356
-
1357
1226
  var exports = {},
1358
- Op = Object.prototype,
1359
- hasOwn = Op.hasOwnProperty,
1360
- $Symbol = "function" == typeof Symbol ? Symbol : {},
1361
- iteratorSymbol = $Symbol.iterator || "@@iterator",
1362
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
1363
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1364
-
1227
+ Op = Object.prototype,
1228
+ hasOwn = Op.hasOwnProperty,
1229
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
1230
+ obj[key] = desc.value;
1231
+ },
1232
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
1233
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
1234
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
1235
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1365
1236
  function define(obj, key, value) {
1366
1237
  return Object.defineProperty(obj, key, {
1367
1238
  value: value,
@@ -1370,7 +1241,6 @@
1370
1241
  writable: !0
1371
1242
  }), obj[key];
1372
1243
  }
1373
-
1374
1244
  try {
1375
1245
  define({}, "");
1376
1246
  } catch (err) {
@@ -1378,54 +1248,14 @@
1378
1248
  return obj[key] = value;
1379
1249
  };
1380
1250
  }
1381
-
1382
1251
  function wrap(innerFn, outerFn, self, tryLocsList) {
1383
1252
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
1384
- generator = Object.create(protoGenerator.prototype),
1385
- context = new Context(tryLocsList || []);
1386
- return generator._invoke = function (innerFn, self, context) {
1387
- var state = "suspendedStart";
1388
- return function (method, arg) {
1389
- if ("executing" === state) throw new Error("Generator is already running");
1390
-
1391
- if ("completed" === state) {
1392
- if ("throw" === method) throw arg;
1393
- return doneResult();
1394
- }
1395
-
1396
- for (context.method = method, context.arg = arg;;) {
1397
- var delegate = context.delegate;
1398
-
1399
- if (delegate) {
1400
- var delegateResult = maybeInvokeDelegate(delegate, context);
1401
-
1402
- if (delegateResult) {
1403
- if (delegateResult === ContinueSentinel) continue;
1404
- return delegateResult;
1405
- }
1406
- }
1407
-
1408
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
1409
- if ("suspendedStart" === state) throw state = "completed", context.arg;
1410
- context.dispatchException(context.arg);
1411
- } else "return" === context.method && context.abrupt("return", context.arg);
1412
- state = "executing";
1413
- var record = tryCatch(innerFn, self, context);
1414
-
1415
- if ("normal" === record.type) {
1416
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
1417
- return {
1418
- value: record.arg,
1419
- done: context.done
1420
- };
1421
- }
1422
-
1423
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
1424
- }
1425
- };
1426
- }(innerFn, self, context), generator;
1253
+ generator = Object.create(protoGenerator.prototype),
1254
+ context = new Context(tryLocsList || []);
1255
+ return defineProperty(generator, "_invoke", {
1256
+ value: makeInvokeMethod(innerFn, self, context)
1257
+ }), generator;
1427
1258
  }
1428
-
1429
1259
  function tryCatch(fn, obj, arg) {
1430
1260
  try {
1431
1261
  return {
@@ -1439,25 +1269,19 @@
1439
1269
  };
1440
1270
  }
1441
1271
  }
1442
-
1443
1272
  exports.wrap = wrap;
1444
1273
  var ContinueSentinel = {};
1445
-
1446
1274
  function Generator() {}
1447
-
1448
1275
  function GeneratorFunction() {}
1449
-
1450
1276
  function GeneratorFunctionPrototype() {}
1451
-
1452
1277
  var IteratorPrototype = {};
1453
1278
  define(IteratorPrototype, iteratorSymbol, function () {
1454
1279
  return this;
1455
1280
  });
1456
1281
  var getProto = Object.getPrototypeOf,
1457
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1282
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1458
1283
  NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
1459
1284
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
1460
-
1461
1285
  function defineIteratorMethods(prototype) {
1462
1286
  ["next", "throw", "return"].forEach(function (method) {
1463
1287
  define(prototype, method, function (arg) {
@@ -1465,14 +1289,12 @@
1465
1289
  });
1466
1290
  });
1467
1291
  }
1468
-
1469
1292
  function AsyncIterator(generator, PromiseImpl) {
1470
1293
  function invoke(method, arg, resolve, reject) {
1471
1294
  var record = tryCatch(generator[method], generator, arg);
1472
-
1473
1295
  if ("throw" !== record.type) {
1474
1296
  var result = record.arg,
1475
- value = result.value;
1297
+ value = result.value;
1476
1298
  return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
1477
1299
  invoke("next", value, resolve, reject);
1478
1300
  }, function (err) {
@@ -1483,92 +1305,116 @@
1483
1305
  return invoke("throw", error, resolve, reject);
1484
1306
  });
1485
1307
  }
1486
-
1487
1308
  reject(record.arg);
1488
1309
  }
1489
-
1490
1310
  var previousPromise;
1491
-
1492
- this._invoke = function (method, arg) {
1493
- function callInvokeWithMethodAndArg() {
1494
- return new PromiseImpl(function (resolve, reject) {
1495
- invoke(method, arg, resolve, reject);
1496
- });
1311
+ defineProperty(this, "_invoke", {
1312
+ value: function value(method, arg) {
1313
+ function callInvokeWithMethodAndArg() {
1314
+ return new PromiseImpl(function (resolve, reject) {
1315
+ invoke(method, arg, resolve, reject);
1316
+ });
1317
+ }
1318
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
1319
+ }
1320
+ });
1321
+ }
1322
+ function makeInvokeMethod(innerFn, self, context) {
1323
+ var state = "suspendedStart";
1324
+ return function (method, arg) {
1325
+ if ("executing" === state) throw new Error("Generator is already running");
1326
+ if ("completed" === state) {
1327
+ if ("throw" === method) throw arg;
1328
+ return doneResult();
1329
+ }
1330
+ for (context.method = method, context.arg = arg;;) {
1331
+ var delegate = context.delegate;
1332
+ if (delegate) {
1333
+ var delegateResult = maybeInvokeDelegate(delegate, context);
1334
+ if (delegateResult) {
1335
+ if (delegateResult === ContinueSentinel) continue;
1336
+ return delegateResult;
1337
+ }
1338
+ }
1339
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
1340
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
1341
+ context.dispatchException(context.arg);
1342
+ } else "return" === context.method && context.abrupt("return", context.arg);
1343
+ state = "executing";
1344
+ var record = tryCatch(innerFn, self, context);
1345
+ if ("normal" === record.type) {
1346
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
1347
+ return {
1348
+ value: record.arg,
1349
+ done: context.done
1350
+ };
1351
+ }
1352
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
1497
1353
  }
1498
-
1499
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
1500
1354
  };
1501
1355
  }
1502
-
1503
1356
  function maybeInvokeDelegate(delegate, context) {
1504
1357
  var method = delegate.iterator[context.method];
1505
-
1506
1358
  if (undefined === method) {
1507
1359
  if (context.delegate = null, "throw" === context.method) {
1508
1360
  if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
1509
1361
  context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
1510
1362
  }
1511
-
1512
1363
  return ContinueSentinel;
1513
1364
  }
1514
-
1515
1365
  var record = tryCatch(method, delegate.iterator, context.arg);
1516
1366
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
1517
1367
  var info = record.arg;
1518
1368
  return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
1519
1369
  }
1520
-
1521
1370
  function pushTryEntry(locs) {
1522
1371
  var entry = {
1523
1372
  tryLoc: locs[0]
1524
1373
  };
1525
1374
  1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
1526
1375
  }
1527
-
1528
1376
  function resetTryEntry(entry) {
1529
1377
  var record = entry.completion || {};
1530
1378
  record.type = "normal", delete record.arg, entry.completion = record;
1531
1379
  }
1532
-
1533
1380
  function Context(tryLocsList) {
1534
1381
  this.tryEntries = [{
1535
1382
  tryLoc: "root"
1536
1383
  }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
1537
1384
  }
1538
-
1539
1385
  function values(iterable) {
1540
1386
  if (iterable) {
1541
1387
  var iteratorMethod = iterable[iteratorSymbol];
1542
1388
  if (iteratorMethod) return iteratorMethod.call(iterable);
1543
1389
  if ("function" == typeof iterable.next) return iterable;
1544
-
1545
1390
  if (!isNaN(iterable.length)) {
1546
1391
  var i = -1,
1547
- next = function next() {
1548
- for (; ++i < iterable.length;) {
1549
- if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
1550
- }
1551
-
1552
- return next.value = undefined, next.done = !0, next;
1553
- };
1554
-
1392
+ next = function next() {
1393
+ for (; ++i < iterable.length;) {
1394
+ if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
1395
+ }
1396
+ return next.value = undefined, next.done = !0, next;
1397
+ };
1555
1398
  return next.next = next;
1556
1399
  }
1557
1400
  }
1558
-
1559
1401
  return {
1560
1402
  next: doneResult
1561
1403
  };
1562
1404
  }
1563
-
1564
1405
  function doneResult() {
1565
1406
  return {
1566
1407
  value: undefined,
1567
1408
  done: !0
1568
1409
  };
1569
1410
  }
1570
-
1571
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
1411
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
1412
+ value: GeneratorFunctionPrototype,
1413
+ configurable: !0
1414
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
1415
+ value: GeneratorFunction,
1416
+ configurable: !0
1417
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
1572
1418
  var ctor = "function" == typeof genFun && genFun.constructor;
1573
1419
  return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
1574
1420
  }, exports.mark = function (genFun) {
@@ -1589,19 +1435,17 @@
1589
1435
  return this;
1590
1436
  }), define(Gp, "toString", function () {
1591
1437
  return "[object Generator]";
1592
- }), exports.keys = function (object) {
1593
- var keys = [];
1594
-
1438
+ }), exports.keys = function (val) {
1439
+ var object = Object(val),
1440
+ keys = [];
1595
1441
  for (var key in object) {
1596
1442
  keys.push(key);
1597
1443
  }
1598
-
1599
1444
  return keys.reverse(), function next() {
1600
1445
  for (; keys.length;) {
1601
1446
  var key = keys.pop();
1602
1447
  if (key in object) return next.value = key, next.done = !1, next;
1603
1448
  }
1604
-
1605
1449
  return next.done = !0, next;
1606
1450
  };
1607
1451
  }, exports.values = values, Context.prototype = {
@@ -1620,20 +1464,16 @@
1620
1464
  dispatchException: function dispatchException(exception) {
1621
1465
  if (this.done) throw exception;
1622
1466
  var context = this;
1623
-
1624
1467
  function handle(loc, caught) {
1625
1468
  return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
1626
1469
  }
1627
-
1628
1470
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1629
1471
  var entry = this.tryEntries[i],
1630
- record = entry.completion;
1472
+ record = entry.completion;
1631
1473
  if ("root" === entry.tryLoc) return handle("end");
1632
-
1633
1474
  if (entry.tryLoc <= this.prev) {
1634
1475
  var hasCatch = hasOwn.call(entry, "catchLoc"),
1635
- hasFinally = hasOwn.call(entry, "finallyLoc");
1636
-
1476
+ hasFinally = hasOwn.call(entry, "finallyLoc");
1637
1477
  if (hasCatch && hasFinally) {
1638
1478
  if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
1639
1479
  if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
@@ -1649,13 +1489,11 @@
1649
1489
  abrupt: function abrupt(type, arg) {
1650
1490
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1651
1491
  var entry = this.tryEntries[i];
1652
-
1653
1492
  if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
1654
1493
  var finallyEntry = entry;
1655
1494
  break;
1656
1495
  }
1657
1496
  }
1658
-
1659
1497
  finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
1660
1498
  var record = finallyEntry ? finallyEntry.completion : {};
1661
1499
  return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
@@ -1673,19 +1511,15 @@
1673
1511
  catch: function _catch(tryLoc) {
1674
1512
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1675
1513
  var entry = this.tryEntries[i];
1676
-
1677
1514
  if (entry.tryLoc === tryLoc) {
1678
1515
  var record = entry.completion;
1679
-
1680
1516
  if ("throw" === record.type) {
1681
1517
  var thrown = record.arg;
1682
1518
  resetTryEntry(entry);
1683
1519
  }
1684
-
1685
1520
  return thrown;
1686
1521
  }
1687
1522
  }
1688
-
1689
1523
  throw new Error("illegal catch attempt");
1690
1524
  },
1691
1525
  delegateYield: function delegateYield(iterable, resultName, nextLoc) {
@@ -1697,7 +1531,6 @@
1697
1531
  }
1698
1532
  }, exports;
1699
1533
  }
1700
-
1701
1534
  function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
1702
1535
  try {
1703
1536
  var info = gen[key](arg);
@@ -1706,58 +1539,47 @@
1706
1539
  reject(error);
1707
1540
  return;
1708
1541
  }
1709
-
1710
1542
  if (info.done) {
1711
1543
  resolve(value);
1712
1544
  } else {
1713
1545
  Promise.resolve(value).then(_next, _throw);
1714
1546
  }
1715
1547
  }
1716
-
1717
1548
  function _asyncToGenerator$2(fn) {
1718
1549
  return function () {
1719
1550
  var self = this,
1720
- args = arguments;
1551
+ args = arguments;
1721
1552
  return new Promise(function (resolve, reject) {
1722
1553
  var gen = fn.apply(self, args);
1723
-
1724
1554
  function _next(value) {
1725
1555
  asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
1726
1556
  }
1727
-
1728
1557
  function _throw(err) {
1729
1558
  asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
1730
1559
  }
1731
-
1732
1560
  _next(undefined);
1733
1561
  });
1734
1562
  };
1735
1563
  }
1736
-
1737
1564
  function _extends() {
1738
1565
  _extends = Object.assign ? Object.assign.bind() : function (target) {
1739
1566
  for (var i = 1; i < arguments.length; i++) {
1740
1567
  var source = arguments[i];
1741
-
1742
1568
  for (var key in source) {
1743
1569
  if (Object.prototype.hasOwnProperty.call(source, key)) {
1744
1570
  target[key] = source[key];
1745
1571
  }
1746
1572
  }
1747
1573
  }
1748
-
1749
1574
  return target;
1750
1575
  };
1751
1576
  return _extends.apply(this, arguments);
1752
1577
  }
1753
-
1754
1578
  function _inheritsLoose$2(subClass, superClass) {
1755
1579
  subClass.prototype = Object.create(superClass.prototype);
1756
1580
  subClass.prototype.constructor = subClass;
1757
-
1758
1581
  _setPrototypeOf$2(subClass, superClass);
1759
1582
  }
1760
-
1761
1583
  function _setPrototypeOf$2(o, p) {
1762
1584
  _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
1763
1585
  o.__proto__ = p;
@@ -1765,78 +1587,77 @@
1765
1587
  };
1766
1588
  return _setPrototypeOf$2(o, p);
1767
1589
  }
1768
-
1769
1590
  var ElementSVG = function ElementSVG() {
1770
1591
  this.$el = void 0;
1771
1592
  this.$groupEl = void 0;
1772
1593
  this.$hitTestingEl = void 0;
1773
1594
  };
1774
-
1775
1595
  ElementSVG.tag = 'c-svg-element';
1776
-
1777
1596
  function updateImageElementAttribute($el, parsedStyle) {
1778
1597
  var _parsedStyle$img = parsedStyle.img,
1779
- img = _parsedStyle$img === void 0 ? '' : _parsedStyle$img,
1780
- width = parsedStyle.width,
1781
- height = parsedStyle.height;
1598
+ img = _parsedStyle$img === void 0 ? '' : _parsedStyle$img,
1599
+ width = parsedStyle.width,
1600
+ height = parsedStyle.height;
1782
1601
  $el.setAttribute('x', '0');
1783
1602
  $el.setAttribute('y', '0');
1784
-
1785
1603
  if (isString(img)) {
1786
1604
  $el.setAttribute('href', img);
1787
1605
  } else if (img instanceof Image) {
1788
1606
  if (!width) {
1789
- $el.setAttribute('width', "" + img.width); // TODO: set renderable.boundsDirty
1607
+ $el.setAttribute('width', "" + img.width);
1608
+ // TODO: set renderable.boundsDirty
1790
1609
  // this.attr('width', img.width);
1791
1610
  }
1792
1611
 
1793
1612
  if (!height) {
1794
- $el.setAttribute('height', "" + img.height); // this.attr('height', img.height);
1613
+ $el.setAttribute('height', "" + img.height);
1614
+ // this.attr('height', img.height);
1795
1615
  }
1796
1616
 
1797
1617
  $el.setAttribute('href', img.src);
1798
- } else if ( // @ts-ignore
1618
+ } else if (
1619
+ // @ts-ignore
1799
1620
  img instanceof HTMLElement && isString(img.nodeName) && img.nodeName.toUpperCase() === 'CANVAS') {
1800
- $el.setAttribute('href', img.toDataURL()); // @ts-ignore
1621
+ $el.setAttribute('href', img.toDataURL());
1622
+ // @ts-ignore
1801
1623
  } else if (img instanceof ImageData) {
1802
- var canvas = document.createElement('canvas'); // @ts-ignore
1803
-
1804
- canvas.setAttribute('width', "" + img.width); // @ts-ignore
1805
-
1624
+ var canvas = document.createElement('canvas');
1625
+ // @ts-ignore
1626
+ canvas.setAttribute('width', "" + img.width);
1627
+ // @ts-ignore
1806
1628
  canvas.setAttribute('height', "" + img.height);
1807
1629
  var context = canvas.getContext('2d');
1808
-
1809
1630
  if (context) {
1810
1631
  context.putImageData(img, 0, 0);
1811
-
1812
1632
  if (!width) {
1813
1633
  // @ts-ignore
1814
- $el.setAttribute('width', "" + img.width); // this.attr('width', img.width);
1634
+ $el.setAttribute('width', "" + img.width);
1635
+ // this.attr('width', img.width);
1815
1636
  }
1816
1637
 
1817
1638
  if (!height) {
1818
1639
  // @ts-ignore
1819
- $el.setAttribute('height', "" + img.height); // this.attr('height', img.height);
1640
+ $el.setAttribute('height', "" + img.height);
1641
+ // this.attr('height', img.height);
1820
1642
  }
1821
1643
 
1822
1644
  $el.setAttribute('href', canvas.toDataURL());
1823
1645
  }
1824
1646
  }
1825
1647
  }
1826
-
1827
1648
  function updateLineElementAttribute($el, parsedStyle) {
1828
1649
  var x1 = parsedStyle.x1,
1829
- y1 = parsedStyle.y1,
1830
- x2 = parsedStyle.x2,
1831
- y2 = parsedStyle.y2,
1832
- _parsedStyle$defX = parsedStyle.defX,
1833
- defX = _parsedStyle$defX === void 0 ? 0 : _parsedStyle$defX,
1834
- _parsedStyle$defY = parsedStyle.defY,
1835
- defY = _parsedStyle$defY === void 0 ? 0 : _parsedStyle$defY,
1836
- markerStart = parsedStyle.markerStart,
1837
- markerEnd = parsedStyle.markerEnd,
1838
- markerStartOffset = parsedStyle.markerStartOffset,
1839
- markerEndOffset = parsedStyle.markerEndOffset;
1650
+ y1 = parsedStyle.y1,
1651
+ x2 = parsedStyle.x2,
1652
+ y2 = parsedStyle.y2,
1653
+ _parsedStyle$defX = parsedStyle.defX,
1654
+ defX = _parsedStyle$defX === void 0 ? 0 : _parsedStyle$defX,
1655
+ _parsedStyle$defY = parsedStyle.defY,
1656
+ defY = _parsedStyle$defY === void 0 ? 0 : _parsedStyle$defY,
1657
+ markerStart = parsedStyle.markerStart,
1658
+ markerEnd = parsedStyle.markerEnd,
1659
+ markerStartOffset = parsedStyle.markerStartOffset,
1660
+ markerEndOffset = parsedStyle.markerEndOffset;
1840
1661
  var startOffsetX = 0;
1841
1662
  var startOffsetY = 0;
1842
1663
  var endOffsetX = 0;
@@ -1844,7 +1665,6 @@
1844
1665
  var rad = 0;
1845
1666
  var x;
1846
1667
  var y;
1847
-
1848
1668
  if (markerStart && markerStart instanceof gLite.DisplayObject && markerStartOffset) {
1849
1669
  x = x2 - x1;
1850
1670
  y = y2 - y1;
@@ -1852,32 +1672,29 @@
1852
1672
  startOffsetX = Math.cos(rad) * (markerStartOffset || 0);
1853
1673
  startOffsetY = Math.sin(rad) * (markerStartOffset || 0);
1854
1674
  }
1855
-
1856
1675
  if (markerEnd && markerEnd instanceof gLite.DisplayObject && markerEndOffset) {
1857
1676
  x = x1 - x2;
1858
1677
  y = y1 - y2;
1859
1678
  rad = Math.atan2(y, x);
1860
1679
  endOffsetX = Math.cos(rad) * (markerEndOffset || 0);
1861
1680
  endOffsetY = Math.sin(rad) * (markerEndOffset || 0);
1862
- } // @see https://github.com/antvis/g/issues/1038
1863
-
1864
-
1681
+ }
1682
+ // @see https://github.com/antvis/g/issues/1038
1865
1683
  $el.setAttribute('x1', "" + (x1 - defX + startOffsetX));
1866
1684
  $el.setAttribute('y1', "" + (y1 - defY + startOffsetY));
1867
1685
  $el.setAttribute('x2', "" + (x2 - defX + endOffsetX));
1868
1686
  $el.setAttribute('y2', "" + (y2 - defY + endOffsetY));
1869
1687
  }
1870
-
1871
1688
  function updatePathElementAttribute($el, parsedStyle) {
1872
1689
  var path = parsedStyle.path,
1873
- _parsedStyle$defX = parsedStyle.defX,
1874
- defX = _parsedStyle$defX === void 0 ? 0 : _parsedStyle$defX,
1875
- _parsedStyle$defY = parsedStyle.defY,
1876
- defY = _parsedStyle$defY === void 0 ? 0 : _parsedStyle$defY,
1877
- markerStart = parsedStyle.markerStart,
1878
- markerEnd = parsedStyle.markerEnd,
1879
- markerStartOffset = parsedStyle.markerStartOffset,
1880
- markerEndOffset = parsedStyle.markerEndOffset;
1690
+ _parsedStyle$defX = parsedStyle.defX,
1691
+ defX = _parsedStyle$defX === void 0 ? 0 : _parsedStyle$defX,
1692
+ _parsedStyle$defY = parsedStyle.defY,
1693
+ defY = _parsedStyle$defY === void 0 ? 0 : _parsedStyle$defY,
1694
+ markerStart = parsedStyle.markerStart,
1695
+ markerEnd = parsedStyle.markerEnd,
1696
+ markerStartOffset = parsedStyle.markerStartOffset,
1697
+ markerEndOffset = parsedStyle.markerEndOffset;
1881
1698
  var startOffsetX = 0;
1882
1699
  var startOffsetY = 0;
1883
1700
  var endOffsetX = 0;
@@ -1885,46 +1702,39 @@
1885
1702
  var rad = 0;
1886
1703
  var x;
1887
1704
  var y;
1888
-
1889
1705
  if (markerStart && markerStart instanceof gLite.DisplayObject && markerStartOffset) {
1890
1706
  var _markerStart$parentNo = markerStart.parentNode.getStartTangent(),
1891
- p1 = _markerStart$parentNo[0],
1892
- p2 = _markerStart$parentNo[1];
1893
-
1707
+ p1 = _markerStart$parentNo[0],
1708
+ p2 = _markerStart$parentNo[1];
1894
1709
  x = p1[0] - p2[0];
1895
1710
  y = p1[1] - p2[1];
1896
1711
  rad = Math.atan2(y, x);
1897
1712
  startOffsetX = Math.cos(rad) * (markerStartOffset || 0);
1898
1713
  startOffsetY = Math.sin(rad) * (markerStartOffset || 0);
1899
1714
  }
1900
-
1901
1715
  if (markerEnd && markerEnd instanceof gLite.DisplayObject && markerEndOffset) {
1902
1716
  var _markerEnd$parentNode = markerEnd.parentNode.getEndTangent(),
1903
- _p = _markerEnd$parentNode[0],
1904
- _p2 = _markerEnd$parentNode[1];
1905
-
1717
+ _p = _markerEnd$parentNode[0],
1718
+ _p2 = _markerEnd$parentNode[1];
1906
1719
  x = _p[0] - _p2[0];
1907
1720
  y = _p[1] - _p2[1];
1908
1721
  rad = Math.atan2(y, x);
1909
1722
  endOffsetX = Math.cos(rad) * (markerEndOffset || 0);
1910
1723
  endOffsetY = Math.sin(rad) * (markerEndOffset || 0);
1911
1724
  }
1912
-
1913
1725
  $el.setAttribute('d', gLite.translatePathToString(path.absolutePath, defX, defY, startOffsetX, startOffsetY, endOffsetX, endOffsetY));
1914
1726
  }
1915
-
1916
1727
  function updatePolylineElementAttribute($el, parsedStyle) {
1917
1728
  var points = parsedStyle.points.points,
1918
- _parsedStyle$defX = parsedStyle.defX,
1919
- defX = _parsedStyle$defX === void 0 ? 0 : _parsedStyle$defX,
1920
- _parsedStyle$defY = parsedStyle.defY,
1921
- defY = _parsedStyle$defY === void 0 ? 0 : _parsedStyle$defY,
1922
- markerStart = parsedStyle.markerStart,
1923
- markerStartOffset = parsedStyle.markerStartOffset,
1924
- markerEnd = parsedStyle.markerEnd,
1925
- markerEndOffset = parsedStyle.markerEndOffset;
1729
+ _parsedStyle$defX = parsedStyle.defX,
1730
+ defX = _parsedStyle$defX === void 0 ? 0 : _parsedStyle$defX,
1731
+ _parsedStyle$defY = parsedStyle.defY,
1732
+ defY = _parsedStyle$defY === void 0 ? 0 : _parsedStyle$defY,
1733
+ markerStart = parsedStyle.markerStart,
1734
+ markerStartOffset = parsedStyle.markerStartOffset,
1735
+ markerEnd = parsedStyle.markerEnd,
1736
+ markerEndOffset = parsedStyle.markerEndOffset;
1926
1737
  var length = points.length;
1927
-
1928
1738
  if (points && length >= 2) {
1929
1739
  var startOffsetX = 0;
1930
1740
  var startOffsetY = 0;
@@ -1933,7 +1743,6 @@
1933
1743
  var rad = 0;
1934
1744
  var x;
1935
1745
  var y;
1936
-
1937
1746
  if (markerStart && markerStart instanceof gLite.DisplayObject && markerStartOffset) {
1938
1747
  x = points[1][0] - points[0][0];
1939
1748
  y = points[1][1] - points[0][1];
@@ -1941,7 +1750,6 @@
1941
1750
  startOffsetX = Math.cos(rad) * (markerStartOffset || 0);
1942
1751
  startOffsetY = Math.sin(rad) * (markerStartOffset || 0);
1943
1752
  }
1944
-
1945
1753
  if (markerEnd && markerEnd instanceof gLite.DisplayObject && markerEndOffset) {
1946
1754
  x = points[length - 2][0] - points[length - 1][0];
1947
1755
  y = points[length - 2][1] - points[length - 1][1];
@@ -1949,11 +1757,9 @@
1949
1757
  endOffsetX = Math.cos(rad) * (markerEndOffset || 0);
1950
1758
  endOffsetY = Math.sin(rad) * (markerEndOffset || 0);
1951
1759
  }
1952
-
1953
1760
  $el.setAttribute('points', points.map(function (point, i) {
1954
1761
  var offsetX = 0;
1955
1762
  var offsetY = 0;
1956
-
1957
1763
  if (i === 0) {
1958
1764
  offsetX = startOffsetX;
1959
1765
  offsetY = startOffsetY;
@@ -1961,55 +1767,46 @@
1961
1767
  offsetX = endOffsetX;
1962
1768
  offsetY = endOffsetY;
1963
1769
  }
1964
-
1965
1770
  return point[0] - defX + offsetX + "," + (point[1] - defY + offsetY);
1966
1771
  }).join(' '));
1967
1772
  }
1968
1773
  }
1969
-
1970
1774
  function updateRectElementAttribute($el, parsedStyle) {
1971
1775
  var radius = parsedStyle.radius,
1972
- width = parsedStyle.width,
1973
- height = parsedStyle.height; // CSSKeyword: auto
1974
-
1776
+ width = parsedStyle.width,
1777
+ height = parsedStyle.height;
1778
+ // CSSKeyword: auto
1975
1779
  if (!isFinite(width) || !isFinite(height)) {
1976
1780
  return;
1977
1781
  }
1978
-
1979
1782
  var hasRadius = radius && radius.some(function (r) {
1980
1783
  return r !== 0;
1981
1784
  });
1982
1785
  var d = '';
1983
-
1984
1786
  if (!hasRadius) {
1985
1787
  d = "M 0,0 l " + width + ",0 l 0," + height + " l" + -width + " 0 z";
1986
1788
  } else {
1987
1789
  var _radius$map = radius.map(function (r) {
1988
- return clamp(r, 0, Math.min(Math.abs(width) / 2, Math.abs(height) / 2));
1989
- }),
1990
- tlr = _radius$map[0],
1991
- trr = _radius$map[1],
1992
- brr = _radius$map[2],
1993
- blr = _radius$map[3];
1994
-
1790
+ return clamp(r, 0, Math.min(Math.abs(width) / 2, Math.abs(height) / 2));
1791
+ }),
1792
+ tlr = _radius$map[0],
1793
+ trr = _radius$map[1],
1794
+ brr = _radius$map[2],
1795
+ blr = _radius$map[3];
1995
1796
  var signX = width > 0 ? 1 : -1;
1996
- var signY = height > 0 ? 1 : -1; // sweep-flag @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Tutorial/Paths#arcs
1997
-
1797
+ var signY = height > 0 ? 1 : -1;
1798
+ // sweep-flag @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Tutorial/Paths#arcs
1998
1799
  var sweepFlag = signX + signY !== 0 ? 1 : 0;
1999
1800
  d = [["M " + signX * tlr + ",0"], ["l " + (width - signX * (tlr + trr)) + ",0"], ["a " + trr + "," + trr + ",0,0," + sweepFlag + "," + signX * trr + "," + signY * trr], ["l 0," + (height - signY * (trr + brr))], ["a " + brr + "," + brr + ",0,0," + sweepFlag + "," + -signX * brr + "," + signY * brr], ["l " + (signX * (brr + blr) - width) + ",0"], ["a " + blr + "," + blr + ",0,0," + sweepFlag + "," + -signX * blr + "," + -signY * blr], ["l 0," + (signY * (blr + tlr) - height)], ["a " + tlr + "," + tlr + ",0,0," + sweepFlag + "," + signX * tlr + "," + -signY * tlr], ['z']].join(' ');
2000
1801
  }
2001
-
2002
1802
  $el.setAttribute('d', d);
2003
1803
  }
2004
-
2005
1804
  function createSVGElement(type, doc) {
2006
1805
  return (doc || document).createElementNS('http://www.w3.org/2000/svg', type);
2007
1806
  }
2008
-
2009
1807
  function numberToLongString(x) {
2010
1808
  return x.toFixed(6).replace('.000000', '');
2011
1809
  }
2012
-
2013
1810
  function convertHTML(str) {
2014
1811
  var regex = /[&|<|>|"|']/g;
2015
1812
  return str.replace(regex, function (match) {
@@ -2026,7 +1823,6 @@
2026
1823
  }
2027
1824
  });
2028
1825
  }
2029
-
2030
1826
  var SVG_ATTR_MAP = {
2031
1827
  opacity: 'opacity',
2032
1828
  fillStyle: 'fill',
@@ -2108,11 +1904,9 @@
2108
1904
  *
2109
1905
  * eg. g_svg_circle_345
2110
1906
  */
2111
-
2112
1907
  var G_SVG_PREFIX = 'g-svg';
2113
1908
  var CLIP_PATH_PREFIX = 'clip-path-';
2114
1909
  var TEXT_PATH_PREFIX = 'text-path-';
2115
-
2116
1910
  var SVGRendererPlugin = /*#__PURE__*/function () {
2117
1911
  function SVGRendererPlugin(pluginOptions, defElementManager, context) {
2118
1912
  this.pluginOptions = void 0;
@@ -2130,105 +1924,77 @@
2130
1924
  /**
2131
1925
  * <camera>
2132
1926
  */
2133
-
2134
-
2135
1927
  var _proto = SVGRendererPlugin.prototype;
2136
-
2137
1928
  _proto.apply = function apply(context) {
2138
1929
  var _this = this;
2139
-
2140
1930
  var renderingService = context.renderingService,
2141
- renderingContext = context.renderingContext;
1931
+ renderingContext = context.renderingContext;
2142
1932
  this.context = context;
2143
1933
  var canvas = renderingContext.root.ownerDocument.defaultView;
2144
1934
  var document = this.context.config.document;
2145
-
2146
1935
  var handleMounted = function handleMounted(e) {
2147
- var object = e.target; // create SVG DOM Node
2148
-
1936
+ var object = e.target;
1937
+ // create SVG DOM Node
2149
1938
  _this.createSVGDom(document, object, _this.$camera);
2150
1939
  };
2151
-
2152
1940
  var handleUnmounted = function handleUnmounted(e) {
2153
1941
  var object = e.target;
2154
-
2155
1942
  _this.defElementManager.clear(object.entity);
2156
-
2157
1943
  _this.clipPathUseMap.delete(object);
2158
-
2159
1944
  _this.removeSVGDom(object);
2160
1945
  };
2161
-
2162
1946
  var handleAttributeChanged = function handleAttributeChanged(e) {
2163
- var object = e.target; // @see https://github.com/antvis/g/issues/994
1947
+ var object = e.target;
1948
+ // @see https://github.com/antvis/g/issues/994
2164
1949
  // @ts-ignore
2165
-
2166
1950
  if (!object.elementSVG) {
2167
1951
  return;
2168
1952
  }
2169
-
2170
1953
  var attrName = e.attrName;
2171
-
2172
1954
  var attribtues = _this.dirtyAttributes.get(object);
2173
-
2174
1955
  if (!attribtues) {
2175
1956
  _this.dirtyAttributes.set(object, []);
2176
-
2177
1957
  attribtues = _this.dirtyAttributes.get(object);
2178
1958
  }
2179
-
2180
1959
  attribtues.push(attrName);
2181
1960
  };
2182
-
2183
1961
  var handleGeometryBoundsChanged = function handleGeometryBoundsChanged(e) {
2184
1962
  var _object$elementSVG;
2185
-
2186
- var object = e.target; // @ts-ignore
2187
-
1963
+ var object = e.target;
1964
+ // @ts-ignore
2188
1965
  var $el = (_object$elementSVG = object.elementSVG) === null || _object$elementSVG === void 0 ? void 0 : _object$elementSVG.$el;
2189
1966
  var _object$parsedStyle = object.parsedStyle,
2190
- fill = _object$parsedStyle.fill,
2191
- stroke = _object$parsedStyle.stroke;
2192
-
1967
+ fill = _object$parsedStyle.fill,
1968
+ stroke = _object$parsedStyle.stroke;
2193
1969
  if (fill && !(fill instanceof gLite.CSSRGB)) {
2194
1970
  _this.defElementManager.createOrUpdateGradientAndPattern(object, $el, fill, 'fill');
2195
1971
  }
2196
-
2197
1972
  if (stroke && !(stroke instanceof gLite.CSSRGB)) {
2198
1973
  _this.defElementManager.createOrUpdateGradientAndPattern(object, $el, stroke, 'stroke');
2199
1974
  }
2200
1975
  };
2201
-
2202
1976
  renderingService.hooks.init.tapPromise(SVGRendererPlugin.tag, /*#__PURE__*/_asyncToGenerator$2( /*#__PURE__*/_regeneratorRuntime$2().mark(function _callee() {
2203
1977
  var _this$context$config, background, document, $svg;
2204
-
2205
1978
  return _regeneratorRuntime$2().wrap(function _callee$(_context) {
2206
1979
  while (1) {
2207
1980
  switch (_context.prev = _context.next) {
2208
1981
  case 0:
2209
1982
  _this$context$config = _this.context.config, background = _this$context$config.background, document = _this$context$config.document; // <defs>
2210
-
2211
1983
  _this.defElementManager.init();
2212
-
2213
1984
  $svg = _this.context.contextService.getContext();
2214
-
2215
1985
  if (background) {
2216
1986
  $svg.style.background = background;
2217
- } // @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/color-interpolation-filters
2218
-
2219
-
1987
+ }
1988
+ // @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/color-interpolation-filters
2220
1989
  $svg.setAttribute('color-interpolation-filters', 'sRGB');
2221
1990
  _this.$camera = createSVGElement('g', document);
2222
1991
  _this.$camera.id = G_SVG_PREFIX + "-camera";
2223
-
2224
1992
  _this.applyTransform(_this.$camera, _this.context.camera.getOrthoMatrix());
2225
-
2226
1993
  $svg.appendChild(_this.$camera);
2227
1994
  canvas.addEventListener(gLite.ElementEvent.MOUNTED, handleMounted);
2228
1995
  canvas.addEventListener(gLite.ElementEvent.UNMOUNTED, handleUnmounted);
2229
1996
  canvas.addEventListener(gLite.ElementEvent.ATTR_MODIFIED, handleAttributeChanged);
2230
1997
  canvas.addEventListener(gLite.ElementEvent.BOUNDS_CHANGED, handleGeometryBoundsChanged);
2231
-
2232
1998
  case 13:
2233
1999
  case "end":
2234
2000
  return _context.stop();
@@ -2244,25 +2010,23 @@
2244
2010
  });
2245
2011
  renderingService.hooks.render.tap(SVGRendererPlugin.tag, function (object) {
2246
2012
  // if (!object.isCulled()) {
2247
- _this.renderQueue.push(object); // }
2248
-
2013
+ _this.renderQueue.push(object);
2014
+ // }
2249
2015
  });
2016
+
2250
2017
  renderingService.hooks.beginFrame.tap(SVGRendererPlugin.tag, function () {
2251
2018
  var doc = _this.context.config.document;
2252
-
2253
2019
  if (_this.pendingReorderQueue.size) {
2254
2020
  _this.pendingReorderQueue.forEach(function (object) {
2255
2021
  var _object$elementSVG2;
2256
-
2257
2022
  var children = ((object === null || object === void 0 ? void 0 : object.children) || []).slice();
2258
- var $parentGroupEl = // @ts-ignore
2023
+ var $parentGroupEl =
2024
+ // @ts-ignore
2259
2025
  object === null || object === void 0 ? void 0 : (_object$elementSVG2 = object.elementSVG) === null || _object$elementSVG2 === void 0 ? void 0 : _object$elementSVG2.$groupEl;
2260
-
2261
2026
  if ($parentGroupEl) {
2262
2027
  _this.reorderChildren(doc || document, $parentGroupEl, children || []);
2263
2028
  }
2264
2029
  });
2265
-
2266
2030
  _this.pendingReorderQueue.clear();
2267
2031
  }
2268
2032
  });
@@ -2270,83 +2034,65 @@
2270
2034
  if (renderingContext.renderReasons.has(gLite.RenderReason.CAMERA_CHANGED)) {
2271
2035
  _this.applyTransform(_this.$camera, _this.context.camera.getOrthoMatrix());
2272
2036
  }
2273
-
2274
2037
  _this.renderQueue.forEach(function (object) {
2275
- var _object$elementSVG3, _object$elementSVG4; // @ts-ignore
2276
-
2277
-
2278
- var $el = (_object$elementSVG3 = object.elementSVG) === null || _object$elementSVG3 === void 0 ? void 0 : _object$elementSVG3.$el; // @ts-ignore
2279
-
2038
+ var _object$elementSVG3, _object$elementSVG4;
2039
+ // @ts-ignore
2040
+ var $el = (_object$elementSVG3 = object.elementSVG) === null || _object$elementSVG3 === void 0 ? void 0 : _object$elementSVG3.$el;
2041
+ // @ts-ignore
2280
2042
  var $groupEl = (_object$elementSVG4 = object.elementSVG) === null || _object$elementSVG4 === void 0 ? void 0 : _object$elementSVG4.$groupEl;
2281
-
2282
2043
  if ($el && $groupEl) {
2283
2044
  // apply local RTS transformation to <group> wrapper
2284
2045
  // account for anchor
2285
2046
  var localTransform = object.getLocalTransform();
2286
-
2287
- _this.applyTransform($groupEl, localTransform); // clipped shapes should also be informed
2288
-
2289
-
2047
+ _this.applyTransform($groupEl, localTransform);
2048
+ // clipped shapes should also be informed
2290
2049
  var $useRefs = _this.clipPathUseMap.get(object);
2291
-
2292
2050
  if ($useRefs && $useRefs.length) {
2293
2051
  $useRefs.forEach(function ($use) {
2294
2052
  // <clipPath transform="matrix()"><circle /></clipPath>
2295
- _this.applyTransform($use, object.getWorldTransform()); // const parentInvert = mat4.invert(
2053
+ _this.applyTransform($use, object.getWorldTransform());
2054
+ // const parentInvert = mat4.invert(
2296
2055
  // mat4.create(),
2297
2056
  // (object as DisplayObject).getWorldTransform(),
2298
2057
  // );
2299
2058
  // this.applyTransform($clipPath, parentInvert);
2300
-
2301
2059
  });
2302
- } // finish rendering, clear dirty flag
2303
-
2304
-
2060
+ }
2061
+ // finish rendering, clear dirty flag
2305
2062
  object.renderable.dirty = false;
2306
- } // update dirty attributes
2307
-
2308
-
2063
+ }
2064
+ // update dirty attributes
2309
2065
  var attributes = _this.dirtyAttributes.get(object);
2310
-
2311
2066
  if (attributes) {
2312
2067
  attributes.forEach(function (attrName) {
2313
2068
  if (attrName === 'zIndex') {
2314
2069
  var _object$parentNode, _object$parentNode$el;
2315
-
2316
- var parent = object.parentNode; // @ts-ignore
2317
-
2070
+ var parent = object.parentNode;
2071
+ // @ts-ignore
2318
2072
  var _$groupEl = (_object$parentNode = object.parentNode) === null || _object$parentNode === void 0 ? void 0 : (_object$parentNode$el = _object$parentNode.elementSVG) === null || _object$parentNode$el === void 0 ? void 0 : _object$parentNode$el.$groupEl;
2319
-
2320
2073
  var children = ((parent === null || parent === void 0 ? void 0 : parent.children) || []).slice();
2321
-
2322
2074
  if (_$groupEl) {
2323
2075
  _this.reorderChildren(document, _$groupEl, children);
2324
2076
  }
2325
2077
  } else if (attrName === 'increasedLineWidthForHitTesting') {
2326
2078
  _this.createOrUpdateHitArea(object, $el, $groupEl);
2327
2079
  }
2328
-
2329
2080
  _this.updateAttribute(object, [attrName]);
2330
2081
  });
2331
-
2332
2082
  _this.dirtyAttributes.delete(object);
2333
2083
  }
2334
2084
  });
2335
-
2336
2085
  _this.renderQueue = [];
2337
2086
  });
2338
2087
  };
2339
-
2340
2088
  _proto.getId = function getId(object) {
2341
2089
  return G_SVG_PREFIX + "-" + object.nodeName + "-" + object.entity;
2342
2090
  };
2343
-
2344
2091
  _proto.reorderChildren = function reorderChildren(doc, $groupEl, children) {
2345
2092
  // need to reorder parent's children
2346
2093
  children.sort(function (a, b) {
2347
2094
  return a.sortable.renderOrder - b.sortable.renderOrder;
2348
2095
  });
2349
-
2350
2096
  if (children.length) {
2351
2097
  // create empty fragment
2352
2098
  var fragment = (doc || document).createDocumentFragment();
@@ -2354,7 +2100,6 @@
2354
2100
  if (child.isConnected) {
2355
2101
  // @ts-ignore
2356
2102
  var $el = child.elementSVG.$groupEl;
2357
-
2358
2103
  if ($el) {
2359
2104
  fragment.appendChild($el);
2360
2105
  }
@@ -2363,79 +2108,68 @@
2363
2108
  $groupEl.appendChild(fragment);
2364
2109
  }
2365
2110
  };
2366
-
2367
2111
  _proto.applyTransform = function applyTransform($el, rts) {
2368
2112
  // use proper precision avoiding too long string in `transform`
2369
2113
  // @see https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Transformations
2370
2114
  $el.setAttribute('transform', "matrix(" + numberToLongString(rts[0]) + "," + numberToLongString(rts[1]) + "," + numberToLongString(rts[4]) + "," + numberToLongString(rts[5]) + "," + numberToLongString(rts[12]) + "," + numberToLongString(rts[13]) + ")");
2371
2115
  };
2372
-
2373
2116
  _proto.applyAttributes = function applyAttributes(object) {
2374
2117
  // @ts-ignore
2375
2118
  var elementSVG = object.elementSVG;
2376
2119
  var $el = elementSVG === null || elementSVG === void 0 ? void 0 : elementSVG.$el;
2377
2120
  var $groupEl = elementSVG === null || elementSVG === void 0 ? void 0 : elementSVG.$groupEl;
2378
-
2379
2121
  if ($el && $groupEl) {
2380
2122
  var nodeName = object.nodeName,
2381
- attributes = object.attributes;
2123
+ attributes = object.attributes;
2382
2124
  $el.setAttribute('fill', 'none');
2383
-
2384
2125
  if (nodeName === gLite.Shape.IMAGE) {
2385
2126
  $el.setAttribute('preserveAspectRatio', 'none');
2386
- } // apply attributes
2387
-
2388
-
2127
+ }
2128
+ // apply attributes
2389
2129
  this.updateAttribute(object, Object.keys(attributes));
2390
2130
  }
2391
2131
  };
2392
-
2393
2132
  _proto.updateAttribute = function updateAttribute(object, attributes) {
2394
2133
  var _this2 = this;
2395
-
2396
- var document = this.context.config.document; // @ts-ignore
2397
-
2134
+ var document = this.context.config.document;
2135
+ // @ts-ignore
2398
2136
  var _object$elementSVG5 = object.elementSVG,
2399
- $el = _object$elementSVG5.$el,
2400
- $groupEl = _object$elementSVG5.$groupEl,
2401
- $hitTestingEl = _object$elementSVG5.$hitTestingEl;
2137
+ $el = _object$elementSVG5.$el,
2138
+ $groupEl = _object$elementSVG5.$groupEl,
2139
+ $hitTestingEl = _object$elementSVG5.$hitTestingEl;
2402
2140
  var parsedStyle = object.parsedStyle,
2403
- computedStyle = object.computedStyle;
2141
+ computedStyle = object.computedStyle;
2404
2142
  var shouldUpdateElementAttribute = attributes.some(function (name) {
2405
- return (// @ts-ignore
2143
+ return (
2144
+ // @ts-ignore
2406
2145
  _this2.context.SVGElementLifeCycleContribution.shouldUpdateElementAttribute(object, name)
2407
2146
  );
2408
- }); // need re-generate path
2409
-
2147
+ });
2148
+ // need re-generate path
2410
2149
  if (shouldUpdateElementAttribute && $el) {
2411
2150
  [$el, $hitTestingEl].forEach(function ($el) {
2412
2151
  if ($el) {
2413
2152
  // @ts-ignore
2414
2153
  _this2.context.SVGElementLifeCycleContribution.updateElementAttribute(object, $el);
2415
-
2416
2154
  if (object.nodeName !== gLite.Shape.TEXT) {
2417
2155
  _this2.updateAnchorWithTransform(object);
2418
2156
  }
2419
2157
  }
2420
2158
  });
2421
- } // update common attributes
2422
-
2423
-
2159
+ }
2160
+ // update common attributes
2424
2161
  attributes.forEach(function (name) {
2425
2162
  var _FORMAT_VALUE_MAP$nam, _propertyMetadataCach;
2426
-
2427
2163
  var usedName = SVG_ATTR_MAP[name];
2428
2164
  var computedValue = computedStyle[name];
2429
2165
  var computedValueStr = computedValue && computedValue.toString();
2430
2166
  var formattedValueStr = ((_FORMAT_VALUE_MAP$nam = FORMAT_VALUE_MAP[name]) === null || _FORMAT_VALUE_MAP$nam === void 0 ? void 0 : _FORMAT_VALUE_MAP$nam[computedValueStr]) || computedValueStr;
2431
2167
  var usedValue = parsedStyle[name];
2432
2168
  var inherited = !!((_propertyMetadataCach = gLite.propertyMetadataCache[name]) === null || _propertyMetadataCach === void 0 ? void 0 : _propertyMetadataCach.inh);
2433
-
2434
2169
  if (!usedName) {
2435
2170
  return;
2436
- } // <foreignObject>
2437
-
2438
-
2171
+ }
2172
+ // <foreignObject>
2439
2173
  if (object.nodeName === gLite.Shape.HTML) {
2440
2174
  if (name === 'lineWidth') {
2441
2175
  $el.style['border-width'] = (usedValue || 0) + "px";
@@ -2443,7 +2177,6 @@
2443
2177
  $el.style['border-style'] = 'dashed';
2444
2178
  }
2445
2179
  }
2446
-
2447
2180
  if (name === 'fill') {
2448
2181
  if (object.nodeName === gLite.Shape.HTML) {
2449
2182
  $el.style.background = usedValue.toString();
@@ -2497,72 +2230,62 @@
2497
2230
  }
2498
2231
  });
2499
2232
  };
2500
-
2501
2233
  _proto.createSVGDom = function createSVGDom(document, object, root, noWrapWithGroup) {
2502
2234
  if (noWrapWithGroup === void 0) {
2503
2235
  noWrapWithGroup = false;
2504
- } // create svg element
2236
+ }
2237
+ // create svg element
2505
2238
  // @ts-ignore
2506
-
2507
-
2508
- object.elementSVG = new ElementSVG(); // @ts-ignore
2509
-
2510
- var svgElement = object.elementSVG; // use <group> as default, eg. CustomElement
2239
+ object.elementSVG = new ElementSVG();
2240
+ // @ts-ignore
2241
+ var svgElement = object.elementSVG;
2242
+ // use <group> as default, eg. CustomElement
2511
2243
  // @ts-ignore
2512
-
2513
2244
  var $el = this.context.SVGElementLifeCycleContribution.createElement(object);
2514
-
2515
2245
  if ($el) {
2516
2246
  var _object$parentNode$el2;
2517
-
2518
- var $groupEl; // save $el on parsedStyle, which will be returned in getDomElement()
2519
-
2247
+ var $groupEl;
2248
+ // save $el on parsedStyle, which will be returned in getDomElement()
2520
2249
  if (object.nodeName === gLite.Shape.HTML) {
2521
2250
  object.parsedStyle.$el = $el;
2522
2251
  }
2523
-
2524
2252
  if (this.pluginOptions.outputSVGElementId) {
2525
2253
  $el.id = this.getId(object);
2526
2254
  }
2527
-
2528
2255
  if (this.pluginOptions.outputSVGElementName && object.name) {
2529
2256
  $el.setAttribute('name', object.name);
2530
2257
  }
2531
-
2532
2258
  if (($el.hasAttribute('data-wrapgroup') || $el.nodeName !== 'g') && !noWrapWithGroup) {
2533
2259
  $groupEl = createSVGElement('g', document);
2534
2260
  $groupEl.appendChild($el);
2535
2261
  } else {
2536
2262
  $groupEl = $el;
2537
2263
  }
2538
-
2539
2264
  svgElement.$el = $el;
2540
- svgElement.$groupEl = $groupEl; // apply attributes at first time
2541
-
2542
- this.applyAttributes(object); // create hitArea if necessary
2543
-
2265
+ svgElement.$groupEl = $groupEl;
2266
+ // apply attributes at first time
2267
+ this.applyAttributes(object);
2268
+ // create hitArea if necessary
2544
2269
  this.createOrUpdateHitArea(object, $el, $groupEl);
2545
- var $parentGroupEl = // @ts-ignore
2270
+ var $parentGroupEl =
2271
+ // @ts-ignore
2546
2272
  object.parentNode && ((_object$parentNode$el2 = object.parentNode.elementSVG) === null || _object$parentNode$el2 === void 0 ? void 0 : _object$parentNode$el2.$groupEl) || root;
2547
-
2548
2273
  if ($parentGroupEl) {
2549
- $parentGroupEl.appendChild($groupEl); // need reorder children later
2550
-
2274
+ $parentGroupEl.appendChild($groupEl);
2275
+ // need reorder children later
2551
2276
  this.pendingReorderQueue.add(object.parentNode);
2552
2277
  }
2553
2278
  }
2554
2279
  };
2555
-
2556
2280
  _proto.removeSVGDom = function removeSVGDom(object) {
2557
- var _object$elementSVG6; // @ts-ignore
2558
-
2559
-
2281
+ var _object$elementSVG6;
2282
+ // @ts-ignore
2560
2283
  var $groupEl = (_object$elementSVG6 = object.elementSVG) === null || _object$elementSVG6 === void 0 ? void 0 : _object$elementSVG6.$groupEl;
2561
-
2562
2284
  if ($groupEl && $groupEl.parentNode) {
2563
- $groupEl.parentNode.removeChild($groupEl); // @ts-ignore
2564
-
2565
- this.context.SVGElementLifeCycleContribution.destroyElement(object, $groupEl); // object.entity.removeComponent(ElementSVG, true);
2285
+ $groupEl.parentNode.removeChild($groupEl);
2286
+ // @ts-ignore
2287
+ this.context.SVGElementLifeCycleContribution.destroyElement(object, $groupEl);
2288
+ // object.entity.removeComponent(ElementSVG, true);
2566
2289
  }
2567
2290
  };
2568
2291
 
@@ -2570,30 +2293,27 @@
2570
2293
  // @ts-ignore
2571
2294
  var svgElement = object.elementSVG;
2572
2295
  var $hitTestingEl = svgElement.$hitTestingEl;
2573
- var increasedLineWidthForHitTesting = object.parsedStyle.increasedLineWidthForHitTesting; // account for hitArea
2574
-
2296
+ var increasedLineWidthForHitTesting = object.parsedStyle.increasedLineWidthForHitTesting;
2297
+ // account for hitArea
2575
2298
  if (increasedLineWidthForHitTesting) {
2576
2299
  if (!$hitTestingEl) {
2577
2300
  $hitTestingEl = $el.cloneNode();
2578
-
2579
2301
  if (this.pluginOptions.outputSVGElementId) {
2580
2302
  // use the entity suffix, so that `g-plugin-svg-picker` can extract
2581
2303
  $hitTestingEl.id = G_SVG_PREFIX + "-" + object.nodeName + "-hittesting-" + object.entity;
2582
- } // clear attributes like `filter` `font-size`
2583
-
2584
-
2304
+ }
2305
+ // clear attributes like `filter` `font-size`
2585
2306
  ['filter'].forEach(function (attribute) {
2586
2307
  $hitTestingEl.removeAttribute(attribute);
2587
- }); // hitArea should be 'transparent' but not 'none'
2588
-
2308
+ });
2309
+ // hitArea should be 'transparent' but not 'none'
2589
2310
  var hasFill = $el.getAttribute('fill') !== 'none';
2590
2311
  $hitTestingEl.setAttribute('fill', hasFill ? 'transparent' : 'none');
2591
2312
  $hitTestingEl.setAttribute('stroke', 'transparent');
2592
2313
  $groupEl.appendChild($hitTestingEl);
2593
2314
  svgElement.$hitTestingEl = $hitTestingEl;
2594
- } // increase interactive line width
2595
-
2596
-
2315
+ }
2316
+ // increase interactive line width
2597
2317
  $hitTestingEl.setAttribute('stroke-width', "" + (increasedLineWidthForHitTesting + object.parsedStyle.lineWidth));
2598
2318
  } else {
2599
2319
  if ($hitTestingEl) {
@@ -2602,82 +2322,67 @@
2602
2322
  }
2603
2323
  }
2604
2324
  };
2605
-
2606
2325
  _proto.createOrUpdateInnerHTML = function createOrUpdateInnerHTML(doc, $el, usedValue) {
2607
2326
  var $div = (doc || document).createElement('div');
2608
-
2609
2327
  if (typeof usedValue === 'string') {
2610
2328
  $div.innerHTML = usedValue;
2611
2329
  } else {
2612
2330
  $div.appendChild(usedValue);
2613
2331
  }
2614
-
2615
2332
  $el.innerHTML = '';
2616
2333
  $el.appendChild($div);
2617
2334
  };
2618
-
2619
2335
  _proto.createOrUpdateClipOrTextPath = function createOrUpdateClipOrTextPath(document, clipPath, object, isTextPath) {
2620
2336
  if (isTextPath === void 0) {
2621
2337
  isTextPath = false;
2622
- } // @ts-ignore
2623
-
2624
-
2338
+ }
2339
+ // @ts-ignore
2625
2340
  var $groupEl = object.elementSVG.$groupEl;
2626
2341
  var PREFIX = isTextPath ? TEXT_PATH_PREFIX : CLIP_PATH_PREFIX;
2627
2342
  var attributeNameCamel = isTextPath ? 'g' : 'clipPath';
2628
2343
  var attributeNameHyphen = isTextPath ? 'text-path' : 'clip-path';
2629
-
2630
2344
  if (clipPath) {
2631
2345
  var clipPathId = PREFIX + clipPath.entity + '-' + object.entity;
2632
2346
  var $def = this.defElementManager.getDefElement();
2633
2347
  var existed = $def.querySelector("#" + clipPathId);
2634
-
2635
2348
  if (!existed) {
2636
2349
  var $clipPath;
2637
-
2638
2350
  if (isTextPath) {
2639
2351
  // use <path> directly instead of wrapping with <g>
2640
- this.createSVGDom(document, clipPath, null, true); // @ts-ignore
2641
-
2352
+ this.createSVGDom(document, clipPath, null, true);
2353
+ // @ts-ignore
2642
2354
  $clipPath = clipPath.elementSVG.$el;
2643
2355
  } else {
2644
2356
  // the clipPath is allowed to be detached from canvas
2645
2357
  if (!clipPath.isConnected) {
2646
2358
  var $existedClipPath = $def.querySelector("#" + this.getId(clipPath));
2647
-
2648
2359
  if (!$existedClipPath) {
2649
2360
  this.createSVGDom(document, clipPath, $def, true);
2650
2361
  }
2651
- } // create <clipPath> dom node
2652
-
2653
-
2362
+ }
2363
+ // create <clipPath> dom node
2654
2364
  $clipPath = createSVGElement(attributeNameCamel, document);
2655
- var $use = createSVGElement('use', document); // @ts-ignore
2656
-
2365
+ var $use = createSVGElement('use', document);
2366
+ // @ts-ignore
2657
2367
  $use.setAttribute('href', "#" + clipPath.elementSVG.$el.id);
2658
2368
  $clipPath.appendChild($use);
2659
2369
  var $useRefs = this.clipPathUseMap.get(clipPath);
2660
-
2661
2370
  if (!$useRefs) {
2662
2371
  this.clipPathUseMap.set(clipPath, []);
2663
2372
  $useRefs = this.clipPathUseMap.get(clipPath);
2664
2373
  }
2665
-
2666
- $useRefs.push($use); // <clipPath transform="matrix()"><circle /></clipPath>
2667
-
2374
+ $useRefs.push($use);
2375
+ // <clipPath transform="matrix()"><circle /></clipPath>
2668
2376
  this.applyTransform($use, clipPath.getWorldTransform());
2669
2377
  var parentInvert = invert(create(), object.getWorldTransform());
2670
2378
  this.applyTransform($clipPath, parentInvert);
2671
2379
  }
2672
-
2673
- $clipPath.id = clipPathId; // append it to <defs>
2674
-
2380
+ $clipPath.id = clipPathId;
2381
+ // append it to <defs>
2675
2382
  $def.appendChild($clipPath);
2676
- } // apply attributes
2677
-
2678
-
2383
+ }
2384
+ // apply attributes
2679
2385
  this.applyAttributes(clipPath);
2680
-
2681
2386
  if (!isTextPath) {
2682
2387
  // apply clipPath to $group
2683
2388
  // @see https://github.com/antvis/g/issues/961
@@ -2692,32 +2397,26 @@
2692
2397
  }
2693
2398
  /**
2694
2399
  * the origin is bounding box's top left corner
2695
- */
2696
- ;
2697
-
2400
+ */;
2698
2401
  _proto.updateAnchorWithTransform = function updateAnchorWithTransform(object) {
2699
2402
  var _object$elementSVG7, _object$elementSVG8;
2700
-
2701
2403
  var bounds = object.getGeometryBounds();
2702
2404
  var width = bounds && bounds.halfExtents[0] * 2 || 0;
2703
2405
  var height = bounds && bounds.halfExtents[1] * 2 || 0;
2704
-
2705
2406
  var _ref2 = object.parsedStyle || {},
2706
- anchor = _ref2.anchor; // @ts-ignore
2707
-
2708
-
2407
+ anchor = _ref2.anchor;
2408
+ // @ts-ignore
2709
2409
  [(_object$elementSVG7 = object.elementSVG) === null || _object$elementSVG7 === void 0 ? void 0 : _object$elementSVG7.$el, (_object$elementSVG8 = object.elementSVG) === null || _object$elementSVG8 === void 0 ? void 0 : _object$elementSVG8.$hitTestingEl].forEach(function ($el) {
2710
2410
  if ($el) {
2711
2411
  var tx = -(anchor[0] * width);
2712
2412
  var ty = -(anchor[1] * height);
2713
-
2714
2413
  if (tx !== 0 || ty !== 0) {
2715
2414
  // apply anchor to element's `transform` property
2716
- $el.setAttribute('transform', // can't use percent unit like translate(-50%, -50%)
2415
+ $el.setAttribute('transform',
2416
+ // can't use percent unit like translate(-50%, -50%)
2717
2417
  // @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute/transform#translate
2718
2418
  "translate(" + tx + "," + ty + ")");
2719
2419
  }
2720
-
2721
2420
  if (object.nodeName === gLite.Shape.CIRCLE || object.nodeName === gLite.Shape.ELLIPSE) {
2722
2421
  $el.setAttribute('cx', "" + width / 2);
2723
2422
  $el.setAttribute('cy', "" + height / 2);
@@ -2725,11 +2424,11 @@
2725
2424
  }
2726
2425
  });
2727
2426
  };
2728
-
2729
2427
  return SVGRendererPlugin;
2730
2428
  }();
2731
-
2732
2429
  SVGRendererPlugin.tag = 'SVGRenderer';
2430
+
2431
+ // @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute/alignment-baseline
2733
2432
  var BASELINE_MAP = {
2734
2433
  top: 'before-edge',
2735
2434
  middle: 'central',
@@ -2737,9 +2436,9 @@
2737
2436
  alphabetic: 'alphabetic',
2738
2437
  ideographic: 'ideographic',
2739
2438
  hanging: 'hanging'
2740
- }; // for FireFox
2439
+ };
2440
+ // for FireFox
2741
2441
  // @see https://github.com/plouc/nivo/issues/164
2742
-
2743
2442
  var BASELINE_MAP_FOR_FIREFOX = {
2744
2443
  top: 'text-before-edge',
2745
2444
  middle: 'central',
@@ -2748,26 +2447,24 @@
2748
2447
  ideographic: 'ideographic',
2749
2448
  hanging: 'hanging'
2750
2449
  };
2751
-
2752
2450
  function updateTextElementAttribute($el, parsedStyle) {
2753
2451
  var textBaseline = parsedStyle.textBaseline,
2754
- lineWidth = parsedStyle.lineWidth,
2755
- metrics = parsedStyle.metrics,
2756
- dx = parsedStyle.dx,
2757
- dy = parsedStyle.dy,
2758
- textPath = parsedStyle.textPath,
2759
- _parsedStyle$textPath = parsedStyle.textPathSide,
2760
- textPathSide = _parsedStyle$textPath === void 0 ? 'left' : _parsedStyle$textPath,
2761
- _parsedStyle$textPath2 = parsedStyle.textPathStartOffset,
2762
- textPathStartOffset = _parsedStyle$textPath2 === void 0 ? 0 : _parsedStyle$textPath2,
2763
- _parsedStyle$textDeco = parsedStyle.textDecorationLine,
2764
- textDecorationLine = _parsedStyle$textDeco === void 0 ? '' : _parsedStyle$textDeco,
2765
- _parsedStyle$textDeco2 = parsedStyle.textDecorationColor,
2766
- textDecorationColor = _parsedStyle$textDeco2 === void 0 ? '' : _parsedStyle$textDeco2,
2767
- _parsedStyle$textDeco3 = parsedStyle.textDecorationStyle,
2768
- textDecorationStyle = _parsedStyle$textDeco3 === void 0 ? '' : _parsedStyle$textDeco3;
2452
+ lineWidth = parsedStyle.lineWidth,
2453
+ metrics = parsedStyle.metrics,
2454
+ dx = parsedStyle.dx,
2455
+ dy = parsedStyle.dy,
2456
+ textPath = parsedStyle.textPath,
2457
+ _parsedStyle$textPath = parsedStyle.textPathSide,
2458
+ textPathSide = _parsedStyle$textPath === void 0 ? 'left' : _parsedStyle$textPath,
2459
+ _parsedStyle$textPath2 = parsedStyle.textPathStartOffset,
2460
+ textPathStartOffset = _parsedStyle$textPath2 === void 0 ? 0 : _parsedStyle$textPath2,
2461
+ _parsedStyle$textDeco = parsedStyle.textDecorationLine,
2462
+ textDecorationLine = _parsedStyle$textDeco === void 0 ? '' : _parsedStyle$textDeco,
2463
+ _parsedStyle$textDeco2 = parsedStyle.textDecorationColor,
2464
+ textDecorationColor = _parsedStyle$textDeco2 === void 0 ? '' : _parsedStyle$textDeco2,
2465
+ _parsedStyle$textDeco3 = parsedStyle.textDecorationStyle,
2466
+ textDecorationStyle = _parsedStyle$textDeco3 === void 0 ? '' : _parsedStyle$textDeco3;
2769
2467
  var browser = detect();
2770
-
2771
2468
  if (browser && browser.name === 'firefox') {
2772
2469
  // compatible with FireFox browser, ref: https://github.com/antvis/g/issues/119
2773
2470
  $el.setAttribute('dominant-baseline', BASELINE_MAP_FOR_FIREFOX[textBaseline] || 'alphabetic');
@@ -2775,47 +2472,39 @@
2775
2472
  $el.setAttribute('dominant-baseline', BASELINE_MAP_FOR_FIREFOX[textBaseline]);
2776
2473
  $el.setAttribute('alignment-baseline', BASELINE_MAP[textBaseline]);
2777
2474
  }
2778
-
2779
2475
  $el.setAttribute('paint-order', 'stroke');
2780
2476
  var lines = metrics.lines,
2781
- lineHeight = metrics.lineHeight,
2782
- height = metrics.height;
2477
+ lineHeight = metrics.lineHeight,
2478
+ height = metrics.height;
2783
2479
  var lineNum = lines.length;
2784
2480
  var styleCSSText = '';
2785
-
2786
2481
  if (dx !== 0 || dy !== 0) {
2787
2482
  styleCSSText += "transform:translate(" + dx + "px, " + dy + "px);";
2788
2483
  }
2789
-
2790
2484
  if (textDecorationLine && textDecorationLine !== 'none') {
2791
2485
  // use CSS text-decoration since the implementation in SVG is not good enough
2792
2486
  styleCSSText += "text-decoration:" + textDecorationLine + " " + textDecorationStyle + " " + textDecorationColor + ";";
2793
2487
  }
2794
-
2795
2488
  if (styleCSSText) {
2796
2489
  $el.setAttribute('style', styleCSSText);
2797
2490
  }
2798
-
2799
2491
  if (lineNum === 1) {
2800
2492
  var textContent = convertHTML(lines[0]);
2801
- $el.setAttribute('dx', "" + lineWidth / 2); // <textPath> only support one line
2493
+ $el.setAttribute('dx', "" + lineWidth / 2);
2494
+ // <textPath> only support one line
2802
2495
  // @see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/textPath
2803
-
2804
2496
  if (textPath) {
2805
2497
  // clear existed text content first
2806
- $el.innerHTML = ''; // append <textPath href="#MyPath">text</textPath>
2807
-
2498
+ $el.innerHTML = '';
2499
+ // append <textPath href="#MyPath">text</textPath>
2808
2500
  var $textPath = createSVGElement('textPath', $el.ownerDocument);
2809
2501
  $textPath.setAttribute('href', "#" + (TEXT_PATH_PREFIX + textPath.entity));
2810
-
2811
2502
  if (textPathSide !== 'left') {
2812
2503
  $textPath.setAttribute('side', textPathSide);
2813
2504
  }
2814
-
2815
2505
  if (textPathStartOffset !== 0) {
2816
2506
  $textPath.setAttribute('startOffset', "" + textPathStartOffset);
2817
2507
  }
2818
-
2819
2508
  $textPath.innerHTML = textContent;
2820
2509
  $el.appendChild($textPath);
2821
2510
  } else {
@@ -2825,7 +2514,6 @@
2825
2514
  $el.innerHTML = lines.map(function (line, i) {
2826
2515
  var dx = lineWidth / 2;
2827
2516
  var dy = 0;
2828
-
2829
2517
  if (i === 0) {
2830
2518
  // TODO: handle other textBaseline values
2831
2519
  if (textBaseline === 'middle') {
@@ -2838,77 +2526,63 @@
2838
2526
  } else {
2839
2527
  dy = lineHeight;
2840
2528
  }
2841
-
2842
2529
  return "<tspan x=\"0\" dx=\"" + dx + "\" dy=\"" + dy + "\">" + convertHTML(line) + "</tspan>";
2843
2530
  }).join('');
2844
2531
  }
2845
2532
  }
2846
-
2847
2533
  var _SHAPE2TAGS, _SHAPE_UPDATE_DEPS;
2848
-
2849
2534
  var SHAPE2TAGS = (_SHAPE2TAGS = {}, _SHAPE2TAGS[gLite.Shape.RECT] = 'path', _SHAPE2TAGS[gLite.Shape.CIRCLE] = 'circle', _SHAPE2TAGS[gLite.Shape.ELLIPSE] = 'ellipse', _SHAPE2TAGS[gLite.Shape.IMAGE] = 'image', _SHAPE2TAGS[gLite.Shape.GROUP] = 'g', _SHAPE2TAGS[gLite.Shape.LINE] = 'line', _SHAPE2TAGS[gLite.Shape.POLYLINE] = 'polyline', _SHAPE2TAGS[gLite.Shape.POLYGON] = 'polygon', _SHAPE2TAGS[gLite.Shape.TEXT] = 'text', _SHAPE2TAGS[gLite.Shape.PATH] = 'path', _SHAPE2TAGS[gLite.Shape.HTML] = 'foreignObject', _SHAPE2TAGS);
2850
- var SHAPE_UPDATE_DEPS = (_SHAPE_UPDATE_DEPS = {}, _SHAPE_UPDATE_DEPS[gLite.Shape.CIRCLE] = ['r'], _SHAPE_UPDATE_DEPS[gLite.Shape.ELLIPSE] = ['rx', 'ry'], _SHAPE_UPDATE_DEPS[gLite.Shape.RECT] = ['width', 'height', 'radius'], _SHAPE_UPDATE_DEPS[gLite.Shape.IMAGE] = ['img', 'width', 'height'], _SHAPE_UPDATE_DEPS[gLite.Shape.LINE] = ['x1', 'y1', 'x2', 'y2', 'markerStart', 'markerEnd', 'markerStartOffset', 'markerEndOffset'], _SHAPE_UPDATE_DEPS[gLite.Shape.POLYLINE] = ['points', 'markerStart', 'markerEnd', 'markerMid', 'markerStartOffset', 'markerEndOffset'], _SHAPE_UPDATE_DEPS[gLite.Shape.POLYGON] = ['points', 'markerStart', 'markerEnd', 'markerMid', 'markerStartOffset', 'markerEndOffset'], _SHAPE_UPDATE_DEPS[gLite.Shape.PATH] = ['path', 'markerStart', 'markerEnd', 'markerMid', 'markerStartOffset', 'markerEndOffset'], _SHAPE_UPDATE_DEPS[gLite.Shape.TEXT] = ['text', 'font', 'fontSize', 'fontFamily', 'fontStyle', 'fontWeight', 'fontVariant', 'lineHeight', 'letterSpacing', 'wordWrap', 'wordWrapWidth', 'maxLines', 'leading', 'textBaseline', 'textAlign', 'textTransform', 'textOverflow', 'textPath', 'textPathSide', 'textPathStartOffset', 'textDecorationLine', 'textDecorationColor', 'textDecorationStyle', // 'whiteSpace',
2535
+ var SHAPE_UPDATE_DEPS = (_SHAPE_UPDATE_DEPS = {}, _SHAPE_UPDATE_DEPS[gLite.Shape.CIRCLE] = ['r'], _SHAPE_UPDATE_DEPS[gLite.Shape.ELLIPSE] = ['rx', 'ry'], _SHAPE_UPDATE_DEPS[gLite.Shape.RECT] = ['width', 'height', 'radius'], _SHAPE_UPDATE_DEPS[gLite.Shape.IMAGE] = ['img', 'width', 'height'], _SHAPE_UPDATE_DEPS[gLite.Shape.LINE] = ['x1', 'y1', 'x2', 'y2', 'markerStart', 'markerEnd', 'markerStartOffset', 'markerEndOffset'], _SHAPE_UPDATE_DEPS[gLite.Shape.POLYLINE] = ['points', 'markerStart', 'markerEnd', 'markerMid', 'markerStartOffset', 'markerEndOffset'], _SHAPE_UPDATE_DEPS[gLite.Shape.POLYGON] = ['points', 'markerStart', 'markerEnd', 'markerMid', 'markerStartOffset', 'markerEndOffset'], _SHAPE_UPDATE_DEPS[gLite.Shape.PATH] = ['path', 'markerStart', 'markerEnd', 'markerMid', 'markerStartOffset', 'markerEndOffset'], _SHAPE_UPDATE_DEPS[gLite.Shape.TEXT] = ['text', 'font', 'fontSize', 'fontFamily', 'fontStyle', 'fontWeight', 'fontVariant', 'lineHeight', 'letterSpacing', 'wordWrap', 'wordWrapWidth', 'maxLines', 'leading', 'textBaseline', 'textAlign', 'textTransform', 'textOverflow', 'textPath', 'textPathSide', 'textPathStartOffset', 'textDecorationLine', 'textDecorationColor', 'textDecorationStyle',
2536
+ // 'whiteSpace',
2851
2537
  'dx', 'dy'], _SHAPE_UPDATE_DEPS);
2852
-
2853
2538
  var DefaultElementLifeCycleContribution = /*#__PURE__*/function () {
2854
2539
  function DefaultElementLifeCycleContribution(context) {
2855
2540
  this.context = void 0;
2856
2541
  this.context = context;
2857
2542
  }
2858
-
2859
2543
  var _proto = DefaultElementLifeCycleContribution.prototype;
2860
-
2861
2544
  _proto.createElement = function createElement(object) {
2862
2545
  var doc = this.context.config.document;
2863
2546
  var type = SHAPE2TAGS[object.nodeName] || 'g';
2864
2547
  return createSVGElement(type, doc || document);
2865
2548
  };
2866
-
2867
2549
  _proto.destroyElement = function destroyElement(object, $el) {};
2868
-
2869
2550
  _proto.shouldUpdateElementAttribute = function shouldUpdateElementAttribute(object, attributeName) {
2870
2551
  var nodeName = object.nodeName;
2871
2552
  return (SHAPE_UPDATE_DEPS[nodeName] || []).indexOf(attributeName) > -1;
2872
2553
  };
2873
-
2874
2554
  _proto.updateElementAttribute = function updateElementAttribute(object) {
2875
2555
  // @ts-ignore
2876
2556
  var $el = object.elementSVG.$el;
2877
2557
  var nodeName = object.nodeName,
2878
- parsedStyle = object.parsedStyle;
2879
-
2558
+ parsedStyle = object.parsedStyle;
2880
2559
  switch (nodeName) {
2881
2560
  case gLite.Shape.IMAGE:
2882
2561
  {
2883
2562
  updateImageElementAttribute($el, parsedStyle);
2884
2563
  break;
2885
2564
  }
2886
-
2887
2565
  case gLite.Shape.RECT:
2888
2566
  {
2889
2567
  updateRectElementAttribute($el, parsedStyle);
2890
2568
  break;
2891
2569
  }
2892
-
2893
2570
  case gLite.Shape.LINE:
2894
2571
  {
2895
2572
  updateLineElementAttribute($el, parsedStyle);
2896
2573
  break;
2897
2574
  }
2898
-
2899
2575
  case gLite.Shape.POLYGON:
2900
2576
  case gLite.Shape.POLYLINE:
2901
2577
  {
2902
2578
  updatePolylineElementAttribute($el, parsedStyle);
2903
2579
  break;
2904
2580
  }
2905
-
2906
2581
  case gLite.Shape.PATH:
2907
2582
  {
2908
2583
  updatePathElementAttribute($el, parsedStyle);
2909
2584
  break;
2910
2585
  }
2911
-
2912
2586
  case gLite.Shape.TEXT:
2913
2587
  {
2914
2588
  updateTextElementAttribute($el, parsedStyle);
@@ -2916,38 +2590,32 @@
2916
2590
  }
2917
2591
  }
2918
2592
  };
2919
-
2920
2593
  return DefaultElementLifeCycleContribution;
2921
2594
  }();
2922
-
2923
2595
  var FILTER_PREFIX = 'g-filter-';
2924
2596
  /**
2925
2597
  * use SVG filters, eg. blur, brightness, contrast...
2926
2598
  * @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Element/filter
2927
2599
  */
2928
-
2929
2600
  function createOrUpdateFilter(document, $def, object, $el, filters) {
2930
2601
  // eg. filter="url(#f1) url(#f2)"
2931
2602
  var filterName = FILTER_PREFIX + object.entity;
2932
2603
  var $existedFilters = $def.querySelectorAll("[name=" + filterName + "]");
2933
-
2934
2604
  if ($existedFilters.length) {
2935
2605
  $existedFilters.forEach(function ($filter) {
2936
2606
  $def.removeChild($filter);
2937
2607
  });
2938
2608
  }
2939
-
2940
2609
  if (filters.length === 0) {
2941
2610
  // 'none'
2942
2611
  $el === null || $el === void 0 ? void 0 : $el.removeAttribute('filter');
2943
2612
  } else {
2944
2613
  var filterIds = filters.map(function (_ref, i) {
2945
2614
  var name = _ref.name,
2946
- params = _ref.params;
2947
- var $filter = createSVGElement('filter', document); // @see https://github.com/antvis/g/issues/1025
2948
-
2615
+ params = _ref.params;
2616
+ var $filter = createSVGElement('filter', document);
2617
+ // @see https://github.com/antvis/g/issues/1025
2949
2618
  $filter.setAttribute('filterUnits', 'userSpaceOnUse');
2950
-
2951
2619
  if (name === 'blur') {
2952
2620
  createBlur(document, $filter, params);
2953
2621
  } else if (name === 'brightness') {
@@ -2967,13 +2635,12 @@
2967
2635
  } else if (name === 'invert') {
2968
2636
  createInvert(document, $filter, params);
2969
2637
  }
2970
-
2971
2638
  $filter.id = filterName + "-" + i;
2972
2639
  $filter.setAttribute('name', filterName);
2973
2640
  $def.appendChild($filter);
2974
2641
  return $filter.id;
2975
- }); // @see https://github.com/antvis/G/issues/1114
2976
-
2642
+ });
2643
+ // @see https://github.com/antvis/G/issues/1114
2977
2644
  setTimeout(function () {
2978
2645
  $el === null || $el === void 0 ? void 0 : $el.setAttribute('filter', filterIds.map(function (filterId) {
2979
2646
  return "url(#" + filterId + ")";
@@ -2981,43 +2648,36 @@
2981
2648
  });
2982
2649
  }
2983
2650
  }
2984
-
2985
2651
  function convertToAbsoluteValue(param) {
2986
2652
  return param.unit === gLite.UnitType.kPercentage ? param.value / 100 : param.value;
2987
2653
  }
2988
2654
  /**
2989
2655
  * @see https://drafts.fxtf.org/filter-effects/#blurEquivalent
2990
2656
  */
2991
-
2992
-
2993
2657
  function createBlur(document, $filter, params) {
2994
2658
  var $feGaussianBlur = createSVGElement('feGaussianBlur', document);
2995
2659
  $feGaussianBlur.setAttribute('in', 'SourceGraphic');
2996
2660
  $feGaussianBlur.setAttribute('stdDeviation', "" + params[0].value);
2997
2661
  $filter.appendChild($feGaussianBlur);
2998
2662
  }
2999
-
3000
2663
  function createFeComponentTransfer(document, $filter, _ref2) {
3001
2664
  var type = _ref2.type,
3002
- slope = _ref2.slope,
3003
- intercept = _ref2.intercept,
3004
- tableValues = _ref2.tableValues;
2665
+ slope = _ref2.slope,
2666
+ intercept = _ref2.intercept,
2667
+ tableValues = _ref2.tableValues;
3005
2668
  var $feComponentTransfer = createSVGElement('feComponentTransfer', document);
3006
2669
  [createSVGElement('feFuncR', document), createSVGElement('feFuncG', document), createSVGElement('feFuncB', document)].forEach(function ($feFunc) {
3007
2670
  $feFunc.setAttribute('type', type);
3008
-
3009
2671
  if (type === 'table') {
3010
2672
  $feFunc.setAttribute('tableValues', "" + tableValues);
3011
2673
  } else {
3012
2674
  $feFunc.setAttribute('slope', "" + slope);
3013
2675
  $feFunc.setAttribute('intercept', "" + intercept);
3014
2676
  }
3015
-
3016
2677
  $feComponentTransfer.appendChild($feFunc);
3017
2678
  });
3018
2679
  $filter.appendChild($feComponentTransfer);
3019
2680
  }
3020
-
3021
2681
  function createContrast(document, $filter, params) {
3022
2682
  var slope = convertToAbsoluteValue(params[0]);
3023
2683
  createFeComponentTransfer(document, $filter, {
@@ -3026,7 +2686,6 @@
3026
2686
  intercept: -(0.5 * slope) + 0.5
3027
2687
  });
3028
2688
  }
3029
-
3030
2689
  function createInvert(document, $filter, params) {
3031
2690
  var amount = convertToAbsoluteValue(params[0]);
3032
2691
  createFeComponentTransfer(document, $filter, {
@@ -3034,7 +2693,6 @@
3034
2693
  tableValues: amount + " " + (1 - amount)
3035
2694
  });
3036
2695
  }
3037
-
3038
2696
  function createBrightness(document, $filter, params) {
3039
2697
  var slope = convertToAbsoluteValue(params[0]);
3040
2698
  createFeComponentTransfer(document, $filter, {
@@ -3043,7 +2701,6 @@
3043
2701
  intercept: 0
3044
2702
  });
3045
2703
  }
3046
-
3047
2704
  function createSaturate(document, $filter, params) {
3048
2705
  var amount = convertToAbsoluteValue(params[0]);
3049
2706
  var $feColorMatrix = createSVGElement('feColorMatrix', document);
@@ -3051,19 +2708,17 @@
3051
2708
  $feColorMatrix.setAttribute('values', "" + amount);
3052
2709
  $filter.appendChild($feColorMatrix);
3053
2710
  }
3054
-
3055
2711
  function createHueRotate(document, $filter, params) {
3056
2712
  var $feColorMatrix = createSVGElement('feColorMatrix', document);
3057
2713
  $feColorMatrix.setAttribute('type', 'hueRotate');
3058
2714
  $feColorMatrix.setAttribute('values', "" + params[0].to(gLite.UnitType.kDegrees).value);
3059
2715
  $filter.appendChild($feColorMatrix);
3060
2716
  }
3061
-
3062
2717
  function createDropShadow(document, $filter, params) {
3063
2718
  var shadowOffsetX = params[0].value;
3064
2719
  var shadowOffsetY = params[1].value;
3065
- var shadowBlur = params[2].value; // @ts-ignore
3066
-
2720
+ var shadowBlur = params[2].value;
2721
+ // @ts-ignore
3067
2722
  var shadowColor = params[3].formatted;
3068
2723
  var $feGaussianBlur = createSVGElement('feGaussianBlur', document);
3069
2724
  $feGaussianBlur.setAttribute('in', 'SourceAlpha');
@@ -3089,7 +2744,6 @@
3089
2744
  $feMerge.appendChild($feMergeNode1);
3090
2745
  $feMerge.appendChild($feMergeNode2);
3091
2746
  }
3092
-
3093
2747
  function createFeColorMatrix(document, $filter, matrix) {
3094
2748
  var $feColorMatrix = createSVGElement('feColorMatrix', document);
3095
2749
  $feColorMatrix.setAttribute('type', 'matrix');
@@ -3099,8 +2753,6 @@
3099
2753
  /**
3100
2754
  * @see https://drafts.fxtf.org/filter-effects/#grayscaleEquivalent
3101
2755
  */
3102
-
3103
-
3104
2756
  function createGrayscale(document, $filter, params) {
3105
2757
  var amount = convertToAbsoluteValue(params[0]);
3106
2758
  createFeColorMatrix(document, $filter, [0.2126 + 0.7874 * (1 - amount), 0.7152 - 0.7152 * (1 - amount), 0.0722 - 0.0722 * (1 - amount), 0, 0, 0.2126 - 0.2126 * (1 - amount), 0.7152 + 0.2848 * (1 - amount), 0.0722 - 0.0722 * (1 - amount), 0, 0, 0.2126 - 0.2126 * (1 - amount), 0.7152 - 0.7152 * (1 - amount), 0.0722 + 0.9278 * (1 - amount), 0, 0, 0, 0, 0, 1, 0]);
@@ -3108,23 +2760,18 @@
3108
2760
  /**
3109
2761
  * @see https://drafts.fxtf.org/filter-effects/#sepiaEquivalent
3110
2762
  */
3111
-
3112
-
3113
2763
  function createSepia(document, $filter, params) {
3114
2764
  var amount = convertToAbsoluteValue(params[0]);
3115
2765
  createFeColorMatrix(document, $filter, [0.393 + 0.607 * (1 - amount), 0.769 - 0.769 * (1 - amount), 0.189 - 0.189 * (1 - amount), 0, 0, 0.349 - 0.349 * (1 - amount), 0.686 + 0.314 * (1 - amount), 0.168 - 0.168 * (1 - amount), 0, 0, 0.272 - 0.272 * (1 - amount), 0.534 - 0.534 * (1 - amount), 0.131 + 0.869 * (1 - amount), 0, 0, 0, 0, 0, 1, 0]);
3116
2766
  }
3117
-
3118
2767
  var PATTERN_PREFIX = 'g-pattern-';
3119
2768
  var cacheKey2IDMap = {};
3120
2769
  var counter = 0;
3121
-
3122
2770
  function createOrUpdateGradientAndPattern(document, $def, object, $el, parsedColor, name, createImage) {
3123
2771
  // eg. clipPath don't have fill/stroke
3124
2772
  if (!parsedColor) {
3125
2773
  return '';
3126
2774
  }
3127
-
3128
2775
  if (parsedColor instanceof gLite.CSSRGB) {
3129
2776
  // keep using currentColor @see https://github.com/d3/d3-axis/issues/49
3130
2777
  if (object.style[name] === 'currentColor') {
@@ -3134,9 +2781,9 @@
3134
2781
  $el === null || $el === void 0 ? void 0 : $el.setAttribute(name, parsedColor.isNone ? 'none' : parsedColor.toString());
3135
2782
  }
3136
2783
  } else if (gLite.isPattern(parsedColor)) {
3137
- var patternId = createOrUpdatePattern(document, $def, object, parsedColor, createImage); // use style instead of attribute when applying <pattern>
2784
+ var patternId = createOrUpdatePattern(document, $def, object, parsedColor, createImage);
2785
+ // use style instead of attribute when applying <pattern>
3138
2786
  // @see https://stackoverflow.com/a/7723115
3139
-
3140
2787
  $el.style[name] = "url(#" + patternId + ")";
3141
2788
  return patternId;
3142
2789
  } else {
@@ -3152,36 +2799,30 @@
3152
2799
  return filterId;
3153
2800
  }
3154
2801
  }
3155
-
3156
2802
  return '';
3157
2803
  }
3158
-
3159
2804
  function generateCacheKey(src, options) {
3160
2805
  if (options === void 0) {
3161
2806
  options = {};
3162
2807
  }
3163
-
3164
2808
  var cacheKey = '';
3165
-
3166
2809
  if (src instanceof gLite.CSSGradientValue) {
3167
2810
  var type = src.type,
3168
- value = src.value;
3169
-
2811
+ value = src.value;
3170
2812
  if (type === gLite.GradientType.LinearGradient || type === gLite.GradientType.RadialGradient) {
3171
2813
  // @ts-ignore
3172
2814
  var _value$options = _extends({}, value, options),
3173
- _type = _value$options.type,
3174
- width = _value$options.width,
3175
- height = _value$options.height,
3176
- steps = _value$options.steps,
3177
- angle = _value$options.angle,
3178
- cx = _value$options.cx,
3179
- cy = _value$options.cy,
3180
- size = _value$options.size;
3181
-
2815
+ _type = _value$options.type,
2816
+ width = _value$options.width,
2817
+ height = _value$options.height,
2818
+ steps = _value$options.steps,
2819
+ angle = _value$options.angle,
2820
+ cx = _value$options.cx,
2821
+ cy = _value$options.cy,
2822
+ size = _value$options.size;
3182
2823
  cacheKey = "gradient-" + _type + "-" + ((angle === null || angle === void 0 ? void 0 : angle.toString()) || 0) + "-" + ((cx === null || cx === void 0 ? void 0 : cx.toString()) || 0) + "-" + ((cy === null || cy === void 0 ? void 0 : cy.toString()) || 0) + "-" + ((size === null || size === void 0 ? void 0 : size.toString()) || 0) + "-" + width + "-" + height + "-" + steps.map(function (_ref) {
3183
2824
  var offset = _ref.offset,
3184
- color = _ref.color;
2825
+ color = _ref.color;
3185
2826
  return "" + offset + color;
3186
2827
  }).join('-');
3187
2828
  }
@@ -3192,25 +2833,20 @@
3192
2833
  cacheKey = "pattern-" + counter;
3193
2834
  }
3194
2835
  }
3195
-
3196
2836
  if (cacheKey) {
3197
2837
  if (!cacheKey2IDMap[cacheKey]) {
3198
2838
  cacheKey2IDMap[cacheKey] = PATTERN_PREFIX + ("" + counter++);
3199
2839
  }
3200
2840
  }
3201
-
3202
2841
  return cacheKey2IDMap[cacheKey];
3203
2842
  }
3204
-
3205
2843
  function createOrUpdatePattern(document, $def, object, pattern, createImage) {
3206
2844
  var patternId = generateCacheKey(pattern);
3207
2845
  var $existed = $def.querySelector("#" + patternId);
3208
-
3209
2846
  if (!$existed) {
3210
2847
  var image = pattern.image,
3211
- repetition = pattern.repetition;
2848
+ repetition = pattern.repetition;
3212
2849
  var imageURL = '';
3213
-
3214
2850
  if (isString(image)) {
3215
2851
  imageURL = image;
3216
2852
  } else {
@@ -3222,7 +2858,6 @@
3222
2858
  } else ;
3223
2859
  }
3224
2860
  }
3225
-
3226
2861
  if (imageURL) {
3227
2862
  // @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Element/pattern
3228
2863
  var $pattern = createSVGElement('pattern', document);
@@ -3230,37 +2865,30 @@
3230
2865
  var $image = createSVGElement('image', document);
3231
2866
  $pattern.appendChild($image);
3232
2867
  $pattern.id = patternId;
3233
- $def.appendChild($pattern); // use href instead of xlink:href
2868
+ $def.appendChild($pattern);
2869
+ // use href instead of xlink:href
3234
2870
  // @see https://stackoverflow.com/a/13379007
3235
-
3236
2871
  $image.setAttribute('href', imageURL);
3237
2872
  var img;
3238
-
3239
2873
  if (createImage) {
3240
2874
  img = createImage(imageURL);
3241
2875
  } else if (gLite.isBrowser) {
3242
2876
  img = new window.Image();
3243
2877
  }
3244
-
3245
2878
  if (!imageURL.match(/^data:/i)) {
3246
2879
  img.crossOrigin = 'Anonymous';
3247
2880
  $image.setAttribute('crossorigin', 'anonymous');
3248
2881
  }
3249
-
3250
2882
  img.src = imageURL;
3251
-
3252
2883
  var onload = function onload() {
3253
2884
  $pattern.setAttribute('x', '0');
3254
2885
  $pattern.setAttribute('y', '0');
3255
-
3256
2886
  var _object$getGeometryBo = object.getGeometryBounds(),
3257
- halfExtents = _object$getGeometryBo.halfExtents; // There is no equivalent to CSS no-repeat for SVG patterns
2887
+ halfExtents = _object$getGeometryBo.halfExtents;
2888
+ // There is no equivalent to CSS no-repeat for SVG patterns
3258
2889
  // @see https://stackoverflow.com/a/33481956
3259
-
3260
-
3261
2890
  var patternWidth = img.width;
3262
2891
  var patternHeight = img.height;
3263
-
3264
2892
  if (repetition === 'repeat-x') {
3265
2893
  patternHeight = halfExtents[1] * 2;
3266
2894
  } else if (repetition === 'repeat-y') {
@@ -3269,7 +2897,6 @@
3269
2897
  patternWidth = halfExtents[0] * 2;
3270
2898
  patternHeight = halfExtents[1] * 2;
3271
2899
  }
3272
-
3273
2900
  $pattern.setAttribute('width', "" + patternWidth);
3274
2901
  $pattern.setAttribute('height', "" + patternHeight);
3275
2902
  $image.setAttribute('x', '0');
@@ -3277,20 +2904,18 @@
3277
2904
  $image.setAttribute('width', "" + img.width);
3278
2905
  $image.setAttribute('height', "" + img.height);
3279
2906
  };
3280
-
3281
2907
  if (img.complete) {
3282
2908
  onload();
3283
2909
  } else {
3284
- img.onload = onload; // Fix onload() bug in IE9
3285
-
3286
- img.src = img.src;
2910
+ img.onload = onload;
2911
+ // Fix onload() bug in IE9
2912
+ // img.src = img.src;
3287
2913
  }
3288
2914
  }
3289
2915
  }
3290
2916
 
3291
2917
  return patternId;
3292
2918
  }
3293
-
3294
2919
  function createOrUpdateGradient(document, object, $def, $el, parsedColor) {
3295
2920
  var bounds = object.getGeometryBounds();
3296
2921
  var width = bounds && bounds.halfExtents[0] * 2 || 0;
@@ -3300,70 +2925,63 @@
3300
2925
  height: height
3301
2926
  });
3302
2927
  var $existed = $def.querySelector("#" + gradientId);
3303
-
3304
2928
  if (!$existed) {
3305
2929
  // <linearGradient> <radialGradient>
3306
2930
  // @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Element/linearGradient
3307
2931
  // @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Element/radialGradient
3308
- $existed = createSVGElement(parsedColor.type === gLite.GradientType.LinearGradient ? 'linearGradient' : 'radialGradient', document); // @see https://github.com/antvis/g/issues/1025
3309
-
3310
- $existed.setAttribute('gradientUnits', 'userSpaceOnUse'); // add stops
3311
-
2932
+ $existed = createSVGElement(parsedColor.type === gLite.GradientType.LinearGradient ? 'linearGradient' : 'radialGradient', document);
2933
+ // @see https://github.com/antvis/g/issues/1025
2934
+ $existed.setAttribute('gradientUnits', 'userSpaceOnUse');
2935
+ // add stops
3312
2936
  var innerHTML = '';
3313
- parsedColor.value.steps // sort by offset @see https://github.com/antvis/G/issues/1171
2937
+ parsedColor.value.steps
2938
+ // sort by offset @see https://github.com/antvis/G/issues/1171
3314
2939
  .sort(function (a, b) {
3315
2940
  return a.offset.value - b.offset.value;
3316
2941
  }).forEach(function (_ref2) {
3317
2942
  var offset = _ref2.offset,
3318
- color = _ref2.color; // TODO: support absolute unit like `px`
3319
-
2943
+ color = _ref2.color;
2944
+ // TODO: support absolute unit like `px`
3320
2945
  innerHTML += "<stop offset=\"" + offset.value / 100 + "\" stop-color=\"" + color + "\"></stop>";
3321
2946
  });
3322
2947
  $existed.innerHTML = innerHTML;
3323
2948
  $existed.id = gradientId;
3324
2949
  $def.appendChild($existed);
3325
2950
  }
3326
-
3327
2951
  if (parsedColor.type === gLite.GradientType.LinearGradient) {
3328
2952
  var angle = parsedColor.value.angle;
3329
-
3330
2953
  var _computeLinearGradien = gLite.computeLinearGradient(width, height, angle),
3331
- x1 = _computeLinearGradien.x1,
3332
- y1 = _computeLinearGradien.y1,
3333
- x2 = _computeLinearGradien.x2,
3334
- y2 = _computeLinearGradien.y2;
3335
-
2954
+ x1 = _computeLinearGradien.x1,
2955
+ y1 = _computeLinearGradien.y1,
2956
+ x2 = _computeLinearGradien.x2,
2957
+ y2 = _computeLinearGradien.y2;
3336
2958
  $existed.setAttribute('x1', "" + x1);
3337
2959
  $existed.setAttribute('y1', "" + y1);
3338
2960
  $existed.setAttribute('x2', "" + x2);
3339
- $existed.setAttribute('y2', "" + y2); // $existed.setAttribute('gradientTransform', `rotate(${angle})`);
2961
+ $existed.setAttribute('y2', "" + y2);
2962
+ // $existed.setAttribute('gradientTransform', `rotate(${angle})`);
3340
2963
  } else {
3341
2964
  var _parsedColor$value = parsedColor.value,
3342
- cx = _parsedColor$value.cx,
3343
- cy = _parsedColor$value.cy,
3344
- size = _parsedColor$value.size;
3345
-
2965
+ cx = _parsedColor$value.cx,
2966
+ cy = _parsedColor$value.cy,
2967
+ size = _parsedColor$value.size;
3346
2968
  var _computeRadialGradien = gLite.computeRadialGradient(width, height, cx, cy, size),
3347
- x = _computeRadialGradien.x,
3348
- y = _computeRadialGradien.y,
3349
- r = _computeRadialGradien.r;
3350
-
2969
+ x = _computeRadialGradien.x,
2970
+ y = _computeRadialGradien.y,
2971
+ r = _computeRadialGradien.r;
3351
2972
  $existed.setAttribute('cx', "" + x);
3352
2973
  $existed.setAttribute('cy', "" + y);
3353
2974
  $existed.setAttribute('r', "" + r);
3354
2975
  }
3355
-
3356
2976
  return gradientId;
3357
2977
  }
3358
-
3359
2978
  function createOrUpdateMultiGradient(document, object, $def, $el, gradients) {
3360
2979
  var filterId = FILTER_PREFIX + object.entity + '-gradient';
3361
2980
  var $existed = $def.querySelector("#" + filterId);
3362
-
3363
2981
  if (!$existed) {
3364
2982
  $existed = createSVGElement('filter', document);
3365
- $existed.setAttribute('filterUnits', 'userSpaceOnUse'); // @see https://github.com/antvis/g/issues/1025
3366
-
2983
+ $existed.setAttribute('filterUnits', 'userSpaceOnUse');
2984
+ // @see https://github.com/antvis/g/issues/1025
3367
2985
  $existed.setAttribute('x', '0%');
3368
2986
  $existed.setAttribute('y', '0%');
3369
2987
  $existed.setAttribute('width', '100%');
@@ -3380,8 +2998,6 @@
3380
2998
  <feComposite in="blendedGrad" in2="SourceGraphic" operator="in"/>
3381
2999
  </filter>
3382
3000
  */
3383
-
3384
-
3385
3001
  var blended = 0;
3386
3002
  gradients.forEach(function (gradient, i) {
3387
3003
  var gradientId = createOrUpdateGradient(document, object, $def, $el, gradient);
@@ -3398,13 +3014,12 @@
3398
3014
  $feImage.setAttribute('href', "#" + rectId);
3399
3015
  $feImage.setAttribute('result', filterId + "-" + i);
3400
3016
  $existed.appendChild($feImage);
3401
-
3402
3017
  if (i > 0) {
3403
3018
  var $feBlend = createSVGElement('feBlend', document);
3404
3019
  $feBlend.setAttribute('in', i === 1 ? filterId + "-" + (i - 1) : filterId + "-blended-" + (blended - 1));
3405
3020
  $feBlend.setAttribute('in2', filterId + "-" + i);
3406
- $feBlend.setAttribute('result', filterId + "-blended-" + blended++); // @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/blend-mode
3407
-
3021
+ $feBlend.setAttribute('result', filterId + "-blended-" + blended++);
3022
+ // @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/blend-mode
3408
3023
  $feBlend.setAttribute('mode', 'multiply');
3409
3024
  $existed.appendChild($feBlend);
3410
3025
  }
@@ -3416,36 +3031,31 @@
3416
3031
  $existed.appendChild($feComposite);
3417
3032
  return filterId;
3418
3033
  }
3419
-
3420
3034
  var FILTER_DROPSHADOW_PREFIX = 'g-filter-dropshadow-';
3421
3035
  /**
3422
3036
  * use SVG filters
3423
3037
  * @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Element/filter
3424
3038
  */
3425
-
3426
3039
  function createOrUpdateShadow(document, $def, object, $el, name) {
3427
3040
  var _object$parsedStyle = object.parsedStyle,
3428
- shadowType = _object$parsedStyle.shadowType,
3429
- shadowBlur = _object$parsedStyle.shadowBlur,
3430
- shadowColor = _object$parsedStyle.shadowColor,
3431
- shadowOffsetX = _object$parsedStyle.shadowOffsetX,
3432
- shadowOffsetY = _object$parsedStyle.shadowOffsetY;
3041
+ shadowType = _object$parsedStyle.shadowType,
3042
+ shadowBlur = _object$parsedStyle.shadowBlur,
3043
+ shadowColor = _object$parsedStyle.shadowColor,
3044
+ shadowOffsetX = _object$parsedStyle.shadowOffsetX,
3045
+ shadowOffsetY = _object$parsedStyle.shadowOffsetY;
3433
3046
  var hasShadow = !isNil(shadowColor) && shadowBlur > 0;
3434
3047
  var shadowId = FILTER_DROPSHADOW_PREFIX + object.entity;
3435
3048
  var $existedFilter = $def.querySelector("#" + shadowId);
3436
-
3437
3049
  if ($existedFilter) {
3438
3050
  var existedShadowType = $existedFilter.getAttribute('data-type');
3439
-
3440
3051
  if (existedShadowType !== shadowType || !hasShadow) {
3441
3052
  // remove existed shadow
3442
3053
  $existedFilter.remove();
3443
3054
  $existedFilter = null;
3444
3055
  }
3445
- } // <Group> also has shadowType as its default value
3056
+ }
3057
+ // <Group> also has shadowType as its default value
3446
3058
  // only apply shadow when blur > 0
3447
-
3448
-
3449
3059
  if (hasShadow) {
3450
3060
  // use filter <feDropShadow>
3451
3061
  // @see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feDropShadow
@@ -3454,11 +3064,9 @@
3454
3064
  $el === null || $el === void 0 ? void 0 : $el.removeAttribute('filter');
3455
3065
  return;
3456
3066
  }
3457
-
3458
3067
  if (!$existedFilter) {
3459
3068
  $existedFilter = createSVGElement('filter', document);
3460
3069
  $existedFilter.setAttribute('data-type', shadowType);
3461
-
3462
3070
  if (shadowType === 'outer') {
3463
3071
  var $feDropShadow = createSVGElement('feDropShadow', document);
3464
3072
  $feDropShadow.setAttribute('dx', "" + (shadowOffsetX || 0) / 2);
@@ -3502,19 +3110,16 @@
3502
3110
  $feMerge.appendChild($feMergeNode);
3503
3111
  $feMerge.appendChild($feMergeNode2);
3504
3112
  }
3505
-
3506
- $existedFilter.id = shadowId; // @see https://github.com/antvis/g/issues/1025
3507
-
3113
+ $existedFilter.id = shadowId;
3114
+ // @see https://github.com/antvis/g/issues/1025
3508
3115
  $existedFilter.setAttribute('filterUnits', 'userSpaceOnUse');
3509
3116
  $def.appendChild($existedFilter);
3510
3117
  return;
3511
3118
  }
3512
-
3513
3119
  if (shadowType === 'inner') {
3514
3120
  var _$feGaussianBlur = $existedFilter.children[1];
3515
3121
  var _$feOffset = $existedFilter.children[2];
3516
3122
  var _$feFlood = $existedFilter.children[3];
3517
-
3518
3123
  if (name === 'shadowColor') {
3519
3124
  _$feFlood.setAttribute('flood-color', shadowColor.toString());
3520
3125
  } else if (name === 'shadowBlur') {
@@ -3529,7 +3134,6 @@
3529
3134
  }
3530
3135
  } else if (shadowType === 'outer') {
3531
3136
  var _$feDropShadow = $existedFilter.children[0];
3532
-
3533
3137
  if (name === 'shadowColor') {
3534
3138
  _$feDropShadow.setAttribute('flood-color', shadowColor.toString());
3535
3139
  } else if (name === 'shadowBlur') {
@@ -3544,9 +3148,7 @@
3544
3148
  }
3545
3149
  }
3546
3150
  }
3547
-
3548
3151
  var urlRegexp = /url\(#(.*)\)/;
3549
-
3550
3152
  var DefElementManager = /*#__PURE__*/function () {
3551
3153
  function DefElementManager(context) {
3552
3154
  this.context = void 0;
@@ -3557,123 +3159,98 @@
3557
3159
  /**
3558
3160
  * container for <gradient> <clipPath>...
3559
3161
  */
3560
-
3561
-
3562
3162
  var _proto = DefElementManager.prototype;
3563
-
3564
3163
  _proto.getDefElement = function getDefElement() {
3565
3164
  return this.$def;
3566
3165
  };
3567
-
3568
3166
  _proto.init = function init() {
3569
3167
  var document = this.context.config.document;
3570
3168
  var $svg = this.context.contextService.getContext();
3571
3169
  this.$def = createSVGElement('defs', document);
3572
3170
  $svg.appendChild(this.$def);
3573
3171
  };
3574
-
3575
3172
  _proto.clear = function clear(entity) {
3576
3173
  var _this = this;
3577
-
3578
3174
  Object.keys(this.gradientCache).forEach(function (id) {
3579
3175
  _this.clearUnusedDefElement(_this.gradientCache, id, entity);
3580
3176
  });
3581
3177
  };
3582
-
3583
3178
  _proto.clearUnusedDefElement = function clearUnusedDefElement(cache, id, entity) {
3584
3179
  if (cache[id] && cache[id].size === 1 && cache[id].has(entity)) {
3585
3180
  var targetElement = this.$def.querySelector("#" + id);
3586
-
3587
3181
  if (targetElement) {
3588
3182
  this.$def.removeChild(targetElement);
3589
3183
  }
3590
3184
  }
3591
3185
  };
3592
-
3593
3186
  _proto.createOrUpdateGradientAndPattern = function createOrUpdateGradientAndPattern$1(object, $el, parsedColor, name) {
3594
3187
  var _this$context$config = this.context.config,
3595
- doc = _this$context$config.document,
3596
- createImage = _this$context$config.createImage;
3597
-
3188
+ doc = _this$context$config.document,
3189
+ createImage = _this$context$config.createImage;
3598
3190
  if ($el) {
3599
- var _$el$getAttribute; // `url(#${gradientId})`
3600
-
3601
-
3191
+ var _$el$getAttribute;
3192
+ // `url(#${gradientId})`
3602
3193
  var matches = (_$el$getAttribute = $el.getAttribute(name)) === null || _$el$getAttribute === void 0 ? void 0 : _$el$getAttribute.match(urlRegexp);
3603
-
3604
3194
  if (matches && matches.length > 1) {
3605
3195
  this.clearUnusedDefElement(this.gradientCache, matches[1], object.entity);
3606
3196
  }
3607
-
3608
3197
  var newDefElementId = createOrUpdateGradientAndPattern(doc || document, this.$def, object, $el, parsedColor, name, createImage);
3609
-
3610
3198
  if (!this.gradientCache[newDefElementId]) {
3611
3199
  this.gradientCache[newDefElementId] = new Set();
3612
3200
  }
3613
-
3614
3201
  this.gradientCache[newDefElementId].add(object.entity);
3615
3202
  }
3616
3203
  };
3617
-
3618
3204
  _proto.createOrUpdateShadow = function createOrUpdateShadow$1(object, $el, name) {
3619
3205
  var doc = this.context.config.document;
3620
3206
  createOrUpdateShadow(doc || document, this.$def, object, $el, name);
3621
3207
  };
3622
-
3623
3208
  _proto.createOrUpdateFilter = function createOrUpdateFilter$1(object, $el, filters) {
3624
3209
  var doc = this.context.config.document;
3625
3210
  createOrUpdateFilter(doc || document, this.$def, object, $el, filters);
3626
3211
  };
3627
-
3628
3212
  return DefElementManager;
3629
3213
  }();
3630
-
3631
3214
  var Plugin$1 = /*#__PURE__*/function (_AbstractRendererPlug) {
3632
3215
  _inheritsLoose$2(Plugin, _AbstractRendererPlug);
3633
-
3634
3216
  function Plugin(options) {
3635
3217
  var _this;
3636
-
3637
3218
  if (options === void 0) {
3638
3219
  options = {};
3639
3220
  }
3640
-
3641
3221
  _this = _AbstractRendererPlug.call(this) || this;
3642
3222
  _this.options = void 0;
3643
3223
  _this.name = 'svg-renderer';
3644
3224
  _this.options = options;
3645
3225
  return _this;
3646
3226
  }
3647
-
3648
3227
  var _proto = Plugin.prototype;
3649
-
3650
3228
  _proto.init = function init() {
3651
3229
  var _this$options = this.options,
3652
- outputSVGElementId = _this$options.outputSVGElementId,
3653
- outputSVGElementName = _this$options.outputSVGElementName;
3654
- var defElementManager = new DefElementManager(this.context); // default implementation
3655
-
3656
- var defaultElementLifeCycleContribution = new DefaultElementLifeCycleContribution(this.context); // @ts-ignore
3657
-
3658
- this.context.defaultElementLifeCycleContribution = defaultElementLifeCycleContribution; // @ts-ignore
3659
-
3230
+ outputSVGElementId = _this$options.outputSVGElementId,
3231
+ outputSVGElementName = _this$options.outputSVGElementName;
3232
+ var defElementManager = new DefElementManager(this.context);
3233
+ // default implementation
3234
+ var defaultElementLifeCycleContribution = new DefaultElementLifeCycleContribution(this.context);
3235
+ // @ts-ignore
3236
+ this.context.defaultElementLifeCycleContribution = defaultElementLifeCycleContribution;
3237
+ // @ts-ignore
3660
3238
  this.context.SVGElementLifeCycleContribution = defaultElementLifeCycleContribution;
3661
3239
  var SVGRendererPluginOptions = {
3662
3240
  outputSVGElementId: !isNil(outputSVGElementId) ? !!outputSVGElementId : true,
3663
3241
  outputSVGElementName: !isNil(outputSVGElementName) ? !!outputSVGElementName : true
3664
3242
  };
3665
- this.addRenderingPlugin( // @ts-ignore
3243
+ this.addRenderingPlugin(
3244
+ // @ts-ignore
3666
3245
  new SVGRendererPlugin(SVGRendererPluginOptions, defElementManager, this.context));
3667
3246
  };
3668
-
3669
3247
  _proto.destroy = function destroy() {
3670
- this.removeAllRenderingPlugins(); // @ts-ignore
3671
-
3672
- delete this.context.defaultElementLifeCycleContribution; // @ts-ignore
3673
-
3248
+ this.removeAllRenderingPlugins();
3249
+ // @ts-ignore
3250
+ delete this.context.defaultElementLifeCycleContribution;
3251
+ // @ts-ignore
3674
3252
  delete this.context.SVGElementLifeCycleContribution;
3675
3253
  };
3676
-
3677
3254
  return Plugin;
3678
3255
  }(gLite.AbstractRendererPlugin);
3679
3256
 
@@ -3700,19 +3277,19 @@
3700
3277
  });
3701
3278
 
3702
3279
  function _regeneratorRuntime$3() {
3703
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3704
3280
  _regeneratorRuntime$3 = function _regeneratorRuntime() {
3705
3281
  return exports;
3706
3282
  };
3707
-
3708
3283
  var exports = {},
3709
- Op = Object.prototype,
3710
- hasOwn = Op.hasOwnProperty,
3711
- $Symbol = "function" == typeof Symbol ? Symbol : {},
3712
- iteratorSymbol = $Symbol.iterator || "@@iterator",
3713
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
3714
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
3715
-
3284
+ Op = Object.prototype,
3285
+ hasOwn = Op.hasOwnProperty,
3286
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
3287
+ obj[key] = desc.value;
3288
+ },
3289
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
3290
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
3291
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
3292
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
3716
3293
  function define(obj, key, value) {
3717
3294
  return Object.defineProperty(obj, key, {
3718
3295
  value: value,
@@ -3721,7 +3298,6 @@
3721
3298
  writable: !0
3722
3299
  }), obj[key];
3723
3300
  }
3724
-
3725
3301
  try {
3726
3302
  define({}, "");
3727
3303
  } catch (err) {
@@ -3729,54 +3305,14 @@
3729
3305
  return obj[key] = value;
3730
3306
  };
3731
3307
  }
3732
-
3733
3308
  function wrap(innerFn, outerFn, self, tryLocsList) {
3734
3309
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
3735
- generator = Object.create(protoGenerator.prototype),
3736
- context = new Context(tryLocsList || []);
3737
- return generator._invoke = function (innerFn, self, context) {
3738
- var state = "suspendedStart";
3739
- return function (method, arg) {
3740
- if ("executing" === state) throw new Error("Generator is already running");
3741
-
3742
- if ("completed" === state) {
3743
- if ("throw" === method) throw arg;
3744
- return doneResult();
3745
- }
3746
-
3747
- for (context.method = method, context.arg = arg;;) {
3748
- var delegate = context.delegate;
3749
-
3750
- if (delegate) {
3751
- var delegateResult = maybeInvokeDelegate(delegate, context);
3752
-
3753
- if (delegateResult) {
3754
- if (delegateResult === ContinueSentinel) continue;
3755
- return delegateResult;
3756
- }
3757
- }
3758
-
3759
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
3760
- if ("suspendedStart" === state) throw state = "completed", context.arg;
3761
- context.dispatchException(context.arg);
3762
- } else "return" === context.method && context.abrupt("return", context.arg);
3763
- state = "executing";
3764
- var record = tryCatch(innerFn, self, context);
3765
-
3766
- if ("normal" === record.type) {
3767
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
3768
- return {
3769
- value: record.arg,
3770
- done: context.done
3771
- };
3772
- }
3773
-
3774
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
3775
- }
3776
- };
3777
- }(innerFn, self, context), generator;
3310
+ generator = Object.create(protoGenerator.prototype),
3311
+ context = new Context(tryLocsList || []);
3312
+ return defineProperty(generator, "_invoke", {
3313
+ value: makeInvokeMethod(innerFn, self, context)
3314
+ }), generator;
3778
3315
  }
3779
-
3780
3316
  function tryCatch(fn, obj, arg) {
3781
3317
  try {
3782
3318
  return {
@@ -3790,25 +3326,19 @@
3790
3326
  };
3791
3327
  }
3792
3328
  }
3793
-
3794
3329
  exports.wrap = wrap;
3795
3330
  var ContinueSentinel = {};
3796
-
3797
3331
  function Generator() {}
3798
-
3799
3332
  function GeneratorFunction() {}
3800
-
3801
3333
  function GeneratorFunctionPrototype() {}
3802
-
3803
3334
  var IteratorPrototype = {};
3804
3335
  define(IteratorPrototype, iteratorSymbol, function () {
3805
3336
  return this;
3806
3337
  });
3807
3338
  var getProto = Object.getPrototypeOf,
3808
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
3339
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
3809
3340
  NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
3810
3341
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
3811
-
3812
3342
  function defineIteratorMethods(prototype) {
3813
3343
  ["next", "throw", "return"].forEach(function (method) {
3814
3344
  define(prototype, method, function (arg) {
@@ -3816,14 +3346,12 @@
3816
3346
  });
3817
3347
  });
3818
3348
  }
3819
-
3820
3349
  function AsyncIterator(generator, PromiseImpl) {
3821
3350
  function invoke(method, arg, resolve, reject) {
3822
3351
  var record = tryCatch(generator[method], generator, arg);
3823
-
3824
3352
  if ("throw" !== record.type) {
3825
3353
  var result = record.arg,
3826
- value = result.value;
3354
+ value = result.value;
3827
3355
  return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
3828
3356
  invoke("next", value, resolve, reject);
3829
3357
  }, function (err) {
@@ -3834,92 +3362,116 @@
3834
3362
  return invoke("throw", error, resolve, reject);
3835
3363
  });
3836
3364
  }
3837
-
3838
3365
  reject(record.arg);
3839
3366
  }
3840
-
3841
3367
  var previousPromise;
3842
-
3843
- this._invoke = function (method, arg) {
3844
- function callInvokeWithMethodAndArg() {
3845
- return new PromiseImpl(function (resolve, reject) {
3846
- invoke(method, arg, resolve, reject);
3847
- });
3368
+ defineProperty(this, "_invoke", {
3369
+ value: function value(method, arg) {
3370
+ function callInvokeWithMethodAndArg() {
3371
+ return new PromiseImpl(function (resolve, reject) {
3372
+ invoke(method, arg, resolve, reject);
3373
+ });
3374
+ }
3375
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
3376
+ }
3377
+ });
3378
+ }
3379
+ function makeInvokeMethod(innerFn, self, context) {
3380
+ var state = "suspendedStart";
3381
+ return function (method, arg) {
3382
+ if ("executing" === state) throw new Error("Generator is already running");
3383
+ if ("completed" === state) {
3384
+ if ("throw" === method) throw arg;
3385
+ return doneResult();
3386
+ }
3387
+ for (context.method = method, context.arg = arg;;) {
3388
+ var delegate = context.delegate;
3389
+ if (delegate) {
3390
+ var delegateResult = maybeInvokeDelegate(delegate, context);
3391
+ if (delegateResult) {
3392
+ if (delegateResult === ContinueSentinel) continue;
3393
+ return delegateResult;
3394
+ }
3395
+ }
3396
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
3397
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
3398
+ context.dispatchException(context.arg);
3399
+ } else "return" === context.method && context.abrupt("return", context.arg);
3400
+ state = "executing";
3401
+ var record = tryCatch(innerFn, self, context);
3402
+ if ("normal" === record.type) {
3403
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
3404
+ return {
3405
+ value: record.arg,
3406
+ done: context.done
3407
+ };
3408
+ }
3409
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
3848
3410
  }
3849
-
3850
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
3851
3411
  };
3852
3412
  }
3853
-
3854
3413
  function maybeInvokeDelegate(delegate, context) {
3855
3414
  var method = delegate.iterator[context.method];
3856
-
3857
3415
  if (undefined === method) {
3858
3416
  if (context.delegate = null, "throw" === context.method) {
3859
3417
  if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
3860
3418
  context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
3861
3419
  }
3862
-
3863
3420
  return ContinueSentinel;
3864
3421
  }
3865
-
3866
3422
  var record = tryCatch(method, delegate.iterator, context.arg);
3867
3423
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
3868
3424
  var info = record.arg;
3869
3425
  return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
3870
3426
  }
3871
-
3872
3427
  function pushTryEntry(locs) {
3873
3428
  var entry = {
3874
3429
  tryLoc: locs[0]
3875
3430
  };
3876
3431
  1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
3877
3432
  }
3878
-
3879
3433
  function resetTryEntry(entry) {
3880
3434
  var record = entry.completion || {};
3881
3435
  record.type = "normal", delete record.arg, entry.completion = record;
3882
3436
  }
3883
-
3884
3437
  function Context(tryLocsList) {
3885
3438
  this.tryEntries = [{
3886
3439
  tryLoc: "root"
3887
3440
  }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
3888
3441
  }
3889
-
3890
3442
  function values(iterable) {
3891
3443
  if (iterable) {
3892
3444
  var iteratorMethod = iterable[iteratorSymbol];
3893
3445
  if (iteratorMethod) return iteratorMethod.call(iterable);
3894
3446
  if ("function" == typeof iterable.next) return iterable;
3895
-
3896
3447
  if (!isNaN(iterable.length)) {
3897
3448
  var i = -1,
3898
- next = function next() {
3899
- for (; ++i < iterable.length;) {
3900
- if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
3901
- }
3902
-
3903
- return next.value = undefined, next.done = !0, next;
3904
- };
3905
-
3449
+ next = function next() {
3450
+ for (; ++i < iterable.length;) {
3451
+ if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
3452
+ }
3453
+ return next.value = undefined, next.done = !0, next;
3454
+ };
3906
3455
  return next.next = next;
3907
3456
  }
3908
3457
  }
3909
-
3910
3458
  return {
3911
3459
  next: doneResult
3912
3460
  };
3913
3461
  }
3914
-
3915
3462
  function doneResult() {
3916
3463
  return {
3917
3464
  value: undefined,
3918
3465
  done: !0
3919
3466
  };
3920
3467
  }
3921
-
3922
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
3468
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
3469
+ value: GeneratorFunctionPrototype,
3470
+ configurable: !0
3471
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
3472
+ value: GeneratorFunction,
3473
+ configurable: !0
3474
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
3923
3475
  var ctor = "function" == typeof genFun && genFun.constructor;
3924
3476
  return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
3925
3477
  }, exports.mark = function (genFun) {
@@ -3940,19 +3492,17 @@
3940
3492
  return this;
3941
3493
  }), define(Gp, "toString", function () {
3942
3494
  return "[object Generator]";
3943
- }), exports.keys = function (object) {
3944
- var keys = [];
3945
-
3495
+ }), exports.keys = function (val) {
3496
+ var object = Object(val),
3497
+ keys = [];
3946
3498
  for (var key in object) {
3947
3499
  keys.push(key);
3948
3500
  }
3949
-
3950
3501
  return keys.reverse(), function next() {
3951
3502
  for (; keys.length;) {
3952
3503
  var key = keys.pop();
3953
3504
  if (key in object) return next.value = key, next.done = !1, next;
3954
3505
  }
3955
-
3956
3506
  return next.done = !0, next;
3957
3507
  };
3958
3508
  }, exports.values = values, Context.prototype = {
@@ -3971,20 +3521,16 @@
3971
3521
  dispatchException: function dispatchException(exception) {
3972
3522
  if (this.done) throw exception;
3973
3523
  var context = this;
3974
-
3975
3524
  function handle(loc, caught) {
3976
3525
  return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
3977
3526
  }
3978
-
3979
3527
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3980
3528
  var entry = this.tryEntries[i],
3981
- record = entry.completion;
3529
+ record = entry.completion;
3982
3530
  if ("root" === entry.tryLoc) return handle("end");
3983
-
3984
3531
  if (entry.tryLoc <= this.prev) {
3985
3532
  var hasCatch = hasOwn.call(entry, "catchLoc"),
3986
- hasFinally = hasOwn.call(entry, "finallyLoc");
3987
-
3533
+ hasFinally = hasOwn.call(entry, "finallyLoc");
3988
3534
  if (hasCatch && hasFinally) {
3989
3535
  if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
3990
3536
  if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
@@ -4000,13 +3546,11 @@
4000
3546
  abrupt: function abrupt(type, arg) {
4001
3547
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
4002
3548
  var entry = this.tryEntries[i];
4003
-
4004
3549
  if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
4005
3550
  var finallyEntry = entry;
4006
3551
  break;
4007
3552
  }
4008
3553
  }
4009
-
4010
3554
  finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
4011
3555
  var record = finallyEntry ? finallyEntry.completion : {};
4012
3556
  return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
@@ -4024,19 +3568,15 @@
4024
3568
  catch: function _catch(tryLoc) {
4025
3569
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
4026
3570
  var entry = this.tryEntries[i];
4027
-
4028
3571
  if (entry.tryLoc === tryLoc) {
4029
3572
  var record = entry.completion;
4030
-
4031
3573
  if ("throw" === record.type) {
4032
3574
  var thrown = record.arg;
4033
3575
  resetTryEntry(entry);
4034
3576
  }
4035
-
4036
3577
  return thrown;
4037
3578
  }
4038
3579
  }
4039
-
4040
3580
  throw new Error("illegal catch attempt");
4041
3581
  },
4042
3582
  delegateYield: function delegateYield(iterable, resultName, nextLoc) {
@@ -4048,7 +3588,6 @@
4048
3588
  }
4049
3589
  }, exports;
4050
3590
  }
4051
-
4052
3591
  function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
4053
3592
  try {
4054
3593
  var info = gen[key](arg);
@@ -4057,41 +3596,33 @@
4057
3596
  reject(error);
4058
3597
  return;
4059
3598
  }
4060
-
4061
3599
  if (info.done) {
4062
3600
  resolve(value);
4063
3601
  } else {
4064
3602
  Promise.resolve(value).then(_next, _throw);
4065
3603
  }
4066
3604
  }
4067
-
4068
3605
  function _asyncToGenerator$3(fn) {
4069
3606
  return function () {
4070
3607
  var self = this,
4071
- args = arguments;
3608
+ args = arguments;
4072
3609
  return new Promise(function (resolve, reject) {
4073
3610
  var gen = fn.apply(self, args);
4074
-
4075
3611
  function _next(value) {
4076
3612
  asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
4077
3613
  }
4078
-
4079
3614
  function _throw(err) {
4080
3615
  asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
4081
3616
  }
4082
-
4083
3617
  _next(undefined);
4084
3618
  });
4085
3619
  };
4086
3620
  }
4087
-
4088
3621
  function _inheritsLoose$3(subClass, superClass) {
4089
3622
  subClass.prototype = Object.create(superClass.prototype);
4090
3623
  subClass.prototype.constructor = subClass;
4091
-
4092
3624
  _setPrototypeOf$3(subClass, superClass);
4093
3625
  }
4094
-
4095
3626
  function _setPrototypeOf$3(o, p) {
4096
3627
  _setPrototypeOf$3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
4097
3628
  o.__proto__ = p;
@@ -4099,7 +3630,6 @@
4099
3630
  };
4100
3631
  return _setPrototypeOf$3(o, p);
4101
3632
  }
4102
-
4103
3633
  function _unsupportedIterableToArray(o, minLen) {
4104
3634
  if (!o) return;
4105
3635
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -4108,21 +3638,16 @@
4108
3638
  if (n === "Map" || n === "Set") return Array.from(o);
4109
3639
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
4110
3640
  }
4111
-
4112
3641
  function _arrayLikeToArray(arr, len) {
4113
3642
  if (len == null || len > arr.length) len = arr.length;
4114
-
4115
3643
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
4116
3644
  arr2[i] = arr[i];
4117
3645
  }
4118
-
4119
3646
  return arr2;
4120
3647
  }
4121
-
4122
3648
  function _createForOfIteratorHelperLoose(o, allowArrayLike) {
4123
3649
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
4124
3650
  if (it) return (it = it.call(o)).next.bind(it);
4125
-
4126
3651
  if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
4127
3652
  if (it) o = it;
4128
3653
  var i = 0;
@@ -4136,27 +3661,22 @@
4136
3661
  };
4137
3662
  };
4138
3663
  }
4139
-
4140
3664
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4141
3665
  }
3666
+
4142
3667
  /**
4143
3668
  * pick shape(s) with Mouse/Touch event
4144
3669
  *
4145
3670
  * 1. find AABB with r-tree
4146
3671
  * 2. use elementFromPoint
4147
3672
  */
4148
-
4149
-
4150
3673
  var SVGPickerPlugin = /*#__PURE__*/function () {
4151
3674
  function SVGPickerPlugin() {}
4152
-
4153
3675
  var _proto = SVGPickerPlugin.prototype;
4154
-
4155
3676
  _proto.apply = function apply(context) {
4156
3677
  var _this = this;
4157
-
4158
3678
  var doc = context.config.document,
4159
- renderingService = context.renderingService;
3679
+ renderingService = context.renderingService;
4160
3680
  renderingService.hooks.pick.tapPromise(SVGPickerPlugin.tag, /*#__PURE__*/function () {
4161
3681
  var _ref = _asyncToGenerator$3( /*#__PURE__*/_regeneratorRuntime$3().mark(function _callee(result) {
4162
3682
  return _regeneratorRuntime$3().wrap(function _callee$(_context) {
@@ -4164,7 +3684,6 @@
4164
3684
  switch (_context.prev = _context.next) {
4165
3685
  case 0:
4166
3686
  return _context.abrupt("return", _this.pick(doc, result));
4167
-
4168
3687
  case 1:
4169
3688
  case "end":
4170
3689
  return _context.stop();
@@ -4172,7 +3691,6 @@
4172
3691
  }
4173
3692
  }, _callee);
4174
3693
  }));
4175
-
4176
3694
  return function (_x) {
4177
3695
  return _ref.apply(this, arguments);
4178
3696
  };
@@ -4181,28 +3699,24 @@
4181
3699
  return _this.pick(doc, result);
4182
3700
  });
4183
3701
  };
4184
-
4185
3702
  _proto.pick = function pick(doc, result) {
4186
3703
  var topmost = result.topmost,
4187
- _result$position = result.position,
4188
- clientX = _result$position.clientX,
4189
- clientY = _result$position.clientY;
4190
-
3704
+ _result$position = result.position,
3705
+ clientX = _result$position.clientX,
3706
+ clientY = _result$position.clientY;
4191
3707
  try {
4192
- var targets = []; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/Document/elementsFromPoint
4193
-
3708
+ var targets = [];
3709
+ // @see https://developer.mozilla.org/zh-CN/docs/Web/API/Document/elementsFromPoint
4194
3710
  for (var _iterator = _createForOfIteratorHelperLoose((doc || document).elementsFromPoint(clientX, clientY)), _step; !(_step = _iterator()).done;) {
4195
- var element = _step.value; // eg. g_svg_circle_345
4196
-
3711
+ var element = _step.value;
3712
+ // eg. g_svg_circle_345
4197
3713
  var id = element && element.getAttribute('id');
4198
-
4199
3714
  if (id && id.startsWith(G_SVG_PREFIX)) {
4200
3715
  var index = id.lastIndexOf('-');
4201
- var target = gLite.runtime.displayObjectPool.getByEntity(id.substring(index + 1)); // don't need to account for `visibility` since DOM API already does
4202
-
3716
+ var target = gLite.runtime.displayObjectPool.getByEntity(id.substring(index + 1));
3717
+ // don't need to account for `visibility` since DOM API already does
4203
3718
  if (target && target.isInteractive()) {
4204
3719
  targets.push(target);
4205
-
4206
3720
  if (topmost) {
4207
3721
  result.picked = targets;
4208
3722
  return result;
@@ -4210,45 +3724,33 @@
4210
3724
  }
4211
3725
  }
4212
3726
  }
4213
-
4214
3727
  result.picked = targets;
4215
3728
  } catch (e) {
4216
3729
  result.picked = [];
4217
3730
  }
4218
-
4219
3731
  return result;
4220
3732
  };
4221
-
4222
3733
  return SVGPickerPlugin;
4223
3734
  }();
4224
-
4225
3735
  SVGPickerPlugin.tag = 'SVGPicker';
4226
-
4227
3736
  var Plugin$2 = /*#__PURE__*/function (_AbstractRendererPlug) {
4228
3737
  _inheritsLoose$3(Plugin, _AbstractRendererPlug);
4229
-
4230
3738
  function Plugin() {
4231
3739
  var _this;
4232
-
4233
3740
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4234
3741
  args[_key] = arguments[_key];
4235
3742
  }
4236
-
4237
3743
  _this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
4238
3744
  _this.name = 'svg-picker';
4239
3745
  return _this;
4240
3746
  }
4241
-
4242
3747
  var _proto = Plugin.prototype;
4243
-
4244
3748
  _proto.init = function init() {
4245
3749
  this.addRenderingPlugin(new SVGPickerPlugin());
4246
3750
  };
4247
-
4248
3751
  _proto.destroy = function destroy() {
4249
3752
  this.removeAllRenderingPlugins();
4250
3753
  };
4251
-
4252
3754
  return Plugin;
4253
3755
  }(gLite.AbstractRendererPlugin);
4254
3756
 
@@ -4265,38 +3767,30 @@
4265
3767
  this.canvasConfig = void 0;
4266
3768
  this.canvasConfig = context.config;
4267
3769
  }
4268
-
4269
3770
  var _proto = SVGContextService.prototype;
4270
-
4271
3771
  _proto.init = /*#__PURE__*/function () {
4272
3772
  var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
4273
3773
  var _this$canvasConfig, container, doc, devicePixelRatio, $namespace, dpr;
4274
-
4275
3774
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4276
3775
  while (1) {
4277
3776
  switch (_context.prev = _context.next) {
4278
3777
  case 0:
4279
3778
  _this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, doc = _this$canvasConfig.document, devicePixelRatio = _this$canvasConfig.devicePixelRatio; // create container
4280
-
4281
3779
  this.$container = isString(container) ? (doc || document).getElementById(container) : container;
4282
-
4283
3780
  if (this.$container) {
4284
3781
  if (!this.$container.style.position) {
4285
3782
  this.$container.style.position = 'relative';
4286
3783
  }
4287
-
4288
3784
  $namespace = createSVGElement('svg', doc);
4289
3785
  $namespace.setAttribute('width', "" + this.canvasConfig.width);
4290
3786
  $namespace.setAttribute('height', "" + this.canvasConfig.height);
4291
3787
  this.$container.appendChild($namespace);
4292
3788
  this.$namespace = $namespace;
4293
- } // use user-defined dpr first
4294
-
4295
-
3789
+ }
3790
+ // use user-defined dpr first
4296
3791
  dpr = devicePixelRatio || gLite.isBrowser && window.devicePixelRatio || 1;
4297
3792
  dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
4298
3793
  this.dpr = dpr;
4299
-
4300
3794
  case 6:
4301
3795
  case "end":
4302
3796
  return _context.stop();
@@ -4304,40 +3798,31 @@
4304
3798
  }
4305
3799
  }, _callee, this);
4306
3800
  }));
4307
-
4308
3801
  function init() {
4309
3802
  return _init.apply(this, arguments);
4310
3803
  }
4311
-
4312
3804
  return init;
4313
3805
  }() // @ts-ignore
4314
3806
  ;
4315
-
4316
3807
  _proto.getDomElement = function getDomElement() {
4317
3808
  return this.$namespace;
4318
3809
  };
4319
-
4320
3810
  _proto.getContext = function getContext() {
4321
3811
  return this.$namespace;
4322
3812
  };
4323
-
4324
3813
  _proto.getDPR = function getDPR() {
4325
3814
  return this.dpr;
4326
3815
  };
4327
-
4328
3816
  _proto.getBoundingClientRect = function getBoundingClientRect() {
4329
3817
  var _this$$namespace;
4330
-
4331
3818
  return (_this$$namespace = this.$namespace) === null || _this$$namespace === void 0 ? void 0 : _this$$namespace.getBoundingClientRect();
4332
3819
  };
4333
-
4334
3820
  _proto.destroy = function destroy() {
4335
3821
  // destroy context
4336
3822
  if (this.$container && this.$namespace && this.$namespace.parentNode) {
4337
3823
  this.$container.removeChild(this.$namespace);
4338
3824
  }
4339
3825
  };
4340
-
4341
3826
  _proto.resize = function resize(width, height) {
4342
3827
  // SVG should ignore DPR
4343
3828
  if (this.$namespace) {
@@ -4345,13 +3830,11 @@
4345
3830
  this.$namespace.setAttribute('height', "" + height);
4346
3831
  }
4347
3832
  };
4348
-
4349
3833
  _proto.applyCursorStyle = function applyCursorStyle(cursor) {
4350
3834
  if (this.$container) {
4351
3835
  this.$container.style.cursor = cursor;
4352
3836
  }
4353
3837
  };
4354
-
4355
3838
  _proto.toDataURL = /*#__PURE__*/function () {
4356
3839
  var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
4357
3840
  var cloneNode, svgDocType, svgDoc;
@@ -4359,13 +3842,11 @@
4359
3842
  while (1) {
4360
3843
  switch (_context2.prev = _context2.next) {
4361
3844
  case 0:
4362
-
4363
3845
  cloneNode = this.$namespace.cloneNode(true);
4364
3846
  svgDocType = document.implementation.createDocumentType('svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');
4365
3847
  svgDoc = document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg', svgDocType);
4366
3848
  svgDoc.replaceChild(cloneNode, svgDoc.documentElement);
4367
3849
  return _context2.abrupt("return", "data:image/svg+xml;charset=utf8," + encodeURIComponent(new XMLSerializer().serializeToString(svgDoc)));
4368
-
4369
3850
  case 6:
4370
3851
  case "end":
4371
3852
  return _context2.stop();
@@ -4373,71 +3854,52 @@
4373
3854
  }
4374
3855
  }, _callee2, this);
4375
3856
  }));
4376
-
4377
3857
  function toDataURL(_x) {
4378
3858
  return _toDataURL.apply(this, arguments);
4379
3859
  }
4380
-
4381
3860
  return toDataURL;
4382
3861
  }();
4383
-
4384
3862
  return SVGContextService;
4385
3863
  }();
4386
3864
 
4387
3865
  var ContextRegisterPlugin = /*#__PURE__*/function (_AbstractRendererPlug) {
4388
3866
  _inheritsLoose(ContextRegisterPlugin, _AbstractRendererPlug);
4389
-
4390
3867
  function ContextRegisterPlugin() {
4391
3868
  var _this;
4392
-
4393
3869
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4394
3870
  args[_key] = arguments[_key];
4395
3871
  }
4396
-
4397
3872
  _this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
4398
3873
  _this.name = 'svg-context-register';
4399
3874
  return _this;
4400
3875
  }
4401
-
4402
3876
  var _proto = ContextRegisterPlugin.prototype;
4403
-
4404
3877
  _proto.init = function init() {
4405
3878
  // @ts-ignore
4406
3879
  this.context.ContextService = SVGContextService;
4407
3880
  };
4408
-
4409
3881
  _proto.destroy = function destroy() {
4410
3882
  delete this.context.ContextService;
4411
3883
  };
4412
-
4413
3884
  return ContextRegisterPlugin;
4414
3885
  }(gLite.AbstractRendererPlugin);
4415
3886
 
4416
3887
  var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
4417
3888
  _inheritsLoose(Renderer, _AbstractRenderer);
4418
-
4419
3889
  function Renderer(config) {
4420
3890
  var _this;
4421
-
4422
3891
  if (config === void 0) {
4423
3892
  config = {};
4424
3893
  }
4425
-
4426
3894
  _this = _AbstractRenderer.call(this, config) || this;
4427
-
4428
3895
  _this.registerPlugin(new ContextRegisterPlugin());
4429
-
4430
3896
  _this.registerPlugin(new Plugin$1({
4431
3897
  outputSVGElementId: config.outputSVGElementId
4432
3898
  }));
4433
-
4434
3899
  _this.registerPlugin(new Plugin());
4435
-
4436
3900
  _this.registerPlugin(new Plugin$2());
4437
-
4438
3901
  return _this;
4439
3902
  }
4440
-
4441
3903
  return Renderer;
4442
3904
  }(gLite.AbstractRenderer);
4443
3905