@linkurious/ogma-annotations 1.0.8 → 1.0.11

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.mjs CHANGED
@@ -1,45 +1,45 @@
1
- var En = Object.defineProperty;
2
- var kn = (u, l, t) => l in u ? En(u, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[l] = t;
3
- var v = (u, l, t) => (kn(u, typeof l != "symbol" ? l + "" : l, t), t);
4
- var Tn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
- function oe(u) {
6
- return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
1
+ var kn = Object.defineProperty;
2
+ var Tn = (c, l, t) => l in c ? kn(c, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[l] = t;
3
+ var v = (c, l, t) => (Tn(c, typeof l != "symbol" ? l + "" : l, t), t);
4
+ var In = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
+ function le(c) {
6
+ return c && c.__esModule && Object.prototype.hasOwnProperty.call(c, "default") ? c.default : c;
7
7
  }
8
- var Ce = { exports: {} };
9
- (function(u) {
8
+ var $e = { exports: {} };
9
+ (function(c) {
10
10
  (function(l, t) {
11
- u.exports = t();
11
+ c.exports = t();
12
12
  })("Vector", function() {
13
13
  var l = function() {
14
- var t = Math.PI * 2, s = 180 / Math.PI, a = Math.PI / 180;
15
- function c(r) {
16
- return Math.round(r * 1e8) / 1e8;
14
+ var t = Math.PI * 2, r = 180 / Math.PI, a = Math.PI / 180;
15
+ function u(s) {
16
+ return Math.round(s * 1e8) / 1e8;
17
17
  }
18
- function g(r, d) {
19
- var m = d.x - r.x, T = d.y - r.y;
20
- return Math.sqrt(m * m + T * T);
18
+ function p(s, d) {
19
+ var m = d.x - s.x, A = d.y - s.y;
20
+ return Math.sqrt(m * m + A * A);
21
21
  }
22
- function y(r, d, m) {
23
- var T = d.y - r.y, _ = d.x - r.x, E = Math.atan2(T, _);
22
+ function y(s, d, m) {
23
+ var A = d.y - s.y, I = d.x - s.x, k = Math.atan2(A, I);
24
24
  if (m)
25
- for (; E < 0; )
26
- E += t;
27
- return E;
25
+ for (; k < 0; )
26
+ k += t;
27
+ return k;
28
28
  }
29
- function f(r, d) {
30
- this.x = r !== void 0 ? r : 0, this.y = d !== void 0 ? d : 0;
29
+ function f(s, d) {
30
+ this.x = s !== void 0 ? s : 0, this.y = d !== void 0 ? d : 0;
31
31
  }
32
- return f.fromRadians = function(r) {
33
- var d = Math.cos(r), m = Math.sin(r);
32
+ return f.fromRadians = function(s) {
33
+ var d = Math.cos(s), m = Math.sin(s);
34
34
  return new f(d, m);
35
- }, f.fromDegrees = function(r) {
36
- var d = r * (Math.PI / 180);
35
+ }, f.fromDegrees = function(s) {
36
+ var d = s * (Math.PI / 180);
37
37
  return f.fromRadians(d);
38
- }, f.fromString = function(r) {
39
- var d = r.split(",");
38
+ }, f.fromString = function(s) {
39
+ var d = s.split(",");
40
40
  return new f(parseFloat(d[0]), parseFloat(d[1]));
41
- }, f.fromArray = function(r) {
42
- return new f(r[0], r[1]);
41
+ }, f.fromArray = function(s) {
42
+ return new f(s[0], s[1]);
43
43
  }, f.prototype = {
44
44
  // version
45
45
  version: "2.0.1",
@@ -55,30 +55,30 @@ var Ce = { exports: {} };
55
55
  // Get if equal to another vector
56
56
  // @param vector - other vector to compare with.
57
57
  // @return if vectors are equal.
58
- equals: function(r) {
59
- return this.prototype === r.prototype && this.x === r.x && this.y === r.y;
58
+ equals: function(s) {
59
+ return this.prototype === s.prototype && this.x === s.x && this.y === s.y;
60
60
  },
61
61
  // [API]
62
62
  // [chainable, changeSelf]
63
63
  // set values from another vector. this changes value of self.
64
64
  // @param vector - other vector to get values from.
65
65
  // @return self.
66
- copy: function(r) {
67
- return this.x = r.x, this.y = r.y, this;
66
+ copy: function(s) {
67
+ return this.x = s.x, this.y = s.y, this;
68
68
  },
69
69
  // [API]
70
70
  // [chainable, changeSelf]
71
71
  // set only the x component from another vector.
72
72
  // @return self.
73
- copyX: function(r) {
74
- return this.x = r.x, this;
73
+ copyX: function(s) {
74
+ return this.x = s.x, this;
75
75
  },
76
76
  // [API]
77
77
  // [chainable, changeSelf]
78
78
  // set only the y component from another vector.
79
79
  // @return self.
80
- copyY: function(r) {
81
- return this.y = r.y, this;
80
+ copyY: function(s) {
81
+ return this.y = s.y, this;
82
82
  },
83
83
  // [API]
84
84
  // []
@@ -100,8 +100,8 @@ var Ce = { exports: {} };
100
100
  // @param x - optional x component to set.
101
101
  // @param y - optional y component to set.
102
102
  // @return self.
103
- set: function(r, d) {
104
- return r !== void 0 && (this.x = r), d !== void 0 && (this.y = d), this;
103
+ set: function(s, d) {
104
+ return s !== void 0 && (this.x = s), d !== void 0 && (this.y = d), this;
105
105
  },
106
106
  // [API]
107
107
  // [chainable, clone]
@@ -136,29 +136,29 @@ var Ce = { exports: {} };
136
136
  // get the distance from another vector.
137
137
  // @param other - vector to get distance from.
138
138
  // @return distance between vectors.
139
- distanceFrom: function(r) {
140
- return g(this, r);
139
+ distanceFrom: function(s) {
140
+ return p(this, s);
141
141
  },
142
142
  // [API]
143
143
  // []
144
144
  // get angle from another vector in radians.
145
145
  // @return angle in radians from this to other.
146
- radiansTo: function(r) {
147
- return y(this, r, !0);
146
+ radiansTo: function(s) {
147
+ return y(this, s, !0);
148
148
  },
149
149
  // [API]
150
150
  // []
151
151
  // get degrees from another vector in degrees.
152
152
  // @return angle in degrees from this to other.
153
- degreesTo: function(r) {
154
- return y(this, r, !0) * s;
153
+ degreesTo: function(s) {
154
+ return y(this, s, !0) * r;
155
155
  },
156
156
  // [API]
157
157
  // []
158
158
  // convert this vector to a radian angle.
159
159
  // this is equivalent to doing Vector.zero.radiansTo(this).
160
160
  // @return angle in radians.
161
- toRadians: function(r) {
161
+ toRadians: function(s) {
162
162
  return y(f.zero, this, !0);
163
163
  },
164
164
  // [API]
@@ -166,41 +166,41 @@ var Ce = { exports: {} };
166
166
  // convert this vector to degree.
167
167
  // this is equivalent to doing Vector.zero.degreeTo(this).
168
168
  // @return angle in degrees (0-360).
169
- toDegrees: function(r) {
170
- return this.toRadians() * s;
169
+ toDegrees: function(s) {
170
+ return this.toRadians() * r;
171
171
  },
172
172
  // [API]
173
173
  // [chainable, changeSelf]
174
174
  // rotate this vector by a given degree.
175
175
  // @param degrees - degrees to rotate this vector by (can be positive or negative).
176
176
  // @return self.
177
- rotateDegreesSelf: function(r) {
178
- return this.rotateRadiansSelf(r * a);
177
+ rotateDegreesSelf: function(s) {
178
+ return this.rotateRadiansSelf(s * a);
179
179
  },
180
180
  // [API]
181
181
  // [chainable]
182
182
  // clone and rotate the vector by a given degree.
183
183
  // @param degrees - degree to rotate this vector by (can be positive or negative).
184
184
  // @return cloned rotated vector.
185
- rotateDegrees: function(r) {
186
- return this.clone().rotateDegreesSelf(r);
185
+ rotateDegrees: function(s) {
186
+ return this.clone().rotateDegreesSelf(s);
187
187
  },
188
188
  // [API]
189
189
  // [chainable, changeSelf]
190
190
  // rotate this vector by a given radian.
191
191
  // @param radians - radians to rotate this vector by (can be positive or negative).
192
192
  // @return self.
193
- rotateRadiansSelf: function(r) {
194
- var d = Math.cos(r), m = Math.sin(r), T = this.x * d - this.y * m, _ = this.x * m + this.y * d;
195
- return this.x = c(T), this.y = c(_), this;
193
+ rotateRadiansSelf: function(s) {
194
+ var d = Math.cos(s), m = Math.sin(s), A = this.x * d - this.y * m, I = this.x * m + this.y * d;
195
+ return this.x = u(A), this.y = u(I), this;
196
196
  },
197
197
  // [API]
198
198
  // [chainable]
199
199
  // clone and rotate the vector by a given degree.
200
200
  // @param radians - radians to rotate this vector by (can be positive or negative).
201
201
  // @return cloned rotated vector.
202
- rotateRadians: function(r) {
203
- return this.clone().rotateRadiansSelf(r);
202
+ rotateRadians: function(s) {
203
+ return this.clone().rotateRadiansSelf(s);
204
204
  },
205
205
  // [API]
206
206
  // []
@@ -214,8 +214,8 @@ var Ce = { exports: {} };
214
214
  // normalize this vector, eg make length equal 1.
215
215
  // @return self.
216
216
  normalizeSelf: function() {
217
- var r = Math.sqrt(this.x * this.x + this.y * this.y);
218
- return r === 0 ? this : (this.x /= r, this.y /= r, this);
217
+ var s = Math.sqrt(this.x * this.x + this.y * this.y);
218
+ return s === 0 ? this : (this.x /= s, this.y /= s, this);
219
219
  },
220
220
  // [API]
221
221
  // [chainable, clone]
@@ -230,8 +230,8 @@ var Ce = { exports: {} };
230
230
  // for example, v(10, 11) + v(5, 6) = v(15, 17).
231
231
  // @param other - vector to add components to self.
232
232
  // @return self.
233
- addSelf: function(r) {
234
- return typeof r == "number" ? this.addScalarSelf(r) : (this.x += r.x, this.y += r.y, this);
233
+ addSelf: function(s) {
234
+ return typeof s == "number" ? this.addScalarSelf(s) : (this.x += s.x, this.y += s.y, this);
235
235
  },
236
236
  // [API]
237
237
  // [chainable, changeSelf]
@@ -239,8 +239,8 @@ var Ce = { exports: {} };
239
239
  // for example, v(10, 10) - v(2, 3) = v(8, 7).
240
240
  // @param other - vector to subtract components from self.
241
241
  // @return self.
242
- subSelf: function(r) {
243
- return typeof r == "number" ? this.subScalarSelf(r) : (this.x -= r.x, this.y -= r.y, this);
242
+ subSelf: function(s) {
243
+ return typeof s == "number" ? this.subScalarSelf(s) : (this.x -= s.x, this.y -= s.y, this);
244
244
  },
245
245
  // [API]
246
246
  // [chainable, changeSelf]
@@ -248,8 +248,8 @@ var Ce = { exports: {} };
248
248
  // for example, v(10, 20) / v(2, 5) = v(5, 4).
249
249
  // @param other - vector to divide components from self.
250
250
  // @return self.
251
- divSelf: function(r) {
252
- return typeof r == "number" ? this.divScalarSelf(r) : (this.x /= r.x, this.y /= r.y, this);
251
+ divSelf: function(s) {
252
+ return typeof s == "number" ? this.divScalarSelf(s) : (this.x /= s.x, this.y /= s.y, this);
253
253
  },
254
254
  // [API]
255
255
  // [chainable, changeSelf]
@@ -257,8 +257,8 @@ var Ce = { exports: {} };
257
257
  // for example, v(2, 3) * v(3, 4) = v(6, 12).
258
258
  // @param other - vector to multiply components with self.
259
259
  // @return self.
260
- mulSelf: function(r) {
261
- return typeof r == "number" ? this.mulScalarSelf(r) : (this.x *= r.x, this.y *= r.y, this);
260
+ mulSelf: function(s) {
261
+ return typeof s == "number" ? this.mulScalarSelf(s) : (this.x *= s.x, this.y *= s.y, this);
262
262
  },
263
263
  // [API]
264
264
  // [chainable, changeSelf]
@@ -266,8 +266,8 @@ var Ce = { exports: {} };
266
266
  // for example, v(2, 3) + 5 = v(7, 8).
267
267
  // @param val - value to add to components.
268
268
  // @return self.
269
- addScalarSelf: function(r) {
270
- return this.x += r, this.y += r, this;
269
+ addScalarSelf: function(s) {
270
+ return this.x += s, this.y += s, this;
271
271
  },
272
272
  // [API]
273
273
  // [chainable, changeSelf]
@@ -275,8 +275,8 @@ var Ce = { exports: {} };
275
275
  // for example, v(7, 9) - 5 = v(3, 4).
276
276
  // @param val - value to subtract from components.
277
277
  // @return self.
278
- subScalarSelf: function(r) {
279
- return this.x -= r, this.y -= r, this;
278
+ subScalarSelf: function(s) {
279
+ return this.x -= s, this.y -= s, this;
280
280
  },
281
281
  // [API]
282
282
  // [chainable, changeSelf]
@@ -284,8 +284,8 @@ var Ce = { exports: {} };
284
284
  // for example, v(6, 8) / 5 = v(3, 4).
285
285
  // @param val - value to divide components by.
286
286
  // @return self.
287
- divScalarSelf: function(r) {
288
- return this.x /= r, this.y /= r, this;
287
+ divScalarSelf: function(s) {
288
+ return this.x /= s, this.y /= s, this;
289
289
  },
290
290
  // [API]
291
291
  // [chainable, changeSelf]
@@ -293,32 +293,32 @@ var Ce = { exports: {} };
293
293
  // for example, v(2, 3) * 2 = v(4, 6).
294
294
  // @param val - value to multiply components with.
295
295
  // @return self.
296
- mulScalarSelf: function(r) {
297
- return this.x *= r, this.y *= r, this;
296
+ mulScalarSelf: function(s) {
297
+ return this.x *= s, this.y *= s, this;
298
298
  },
299
299
  // [API]
300
300
  // [chainable, clone]
301
301
  // clone self and add other vector to it.
302
302
  // @param other - vector to add with.
303
303
  // @return cloned vector.
304
- add: function(r) {
305
- return this.clone().addSelf(r);
304
+ add: function(s) {
305
+ return this.clone().addSelf(s);
306
306
  },
307
307
  // [API]
308
308
  // [chainable, clone]
309
309
  // clone self and subtract other vector from it.
310
310
  // @param other - vector to subtract with.
311
311
  // @return cloned vector.
312
- sub: function(r) {
313
- return this.clone().subSelf(r);
312
+ sub: function(s) {
313
+ return this.clone().subSelf(s);
314
314
  },
315
315
  // [API]
316
316
  // [chainable, clone]
317
317
  // clone self and multiply by other vector.
318
318
  // @param other - vector to multiply with.
319
319
  // @return cloned vector.
320
- mul: function(r) {
321
- return this.clone().mulSelf(r);
320
+ mul: function(s) {
321
+ return this.clone().mulSelf(s);
322
322
  },
323
323
  // [API]
324
324
  // [chainable, clone]
@@ -326,40 +326,40 @@ var Ce = { exports: {} };
326
326
  // @param other - vector to divide with.
327
327
  // @param scalar - value to divide by.
328
328
  // @return cloned vector.
329
- div: function(r) {
330
- return this.clone().divSelf(r);
329
+ div: function(s) {
330
+ return this.clone().divSelf(s);
331
331
  },
332
332
  // [API]
333
333
  // [chainable, clone]
334
334
  // clone self and add scalar to it.
335
335
  // @param scalar - value to add.
336
336
  // @return cloned vector.
337
- addScalar: function(r) {
338
- return this.clone().addScalarSelf(r);
337
+ addScalar: function(s) {
338
+ return this.clone().addScalarSelf(s);
339
339
  },
340
340
  // [API]
341
341
  // [chainable, clone]
342
342
  // clone self and substract scalar from it.
343
343
  // @param scalar - value to subtract.
344
344
  // @return cloned vector.
345
- subScalar: function(r) {
346
- return this.clone().subScalarSelf(r);
345
+ subScalar: function(s) {
346
+ return this.clone().subScalarSelf(s);
347
347
  },
348
348
  // [API]
349
349
  // [chainable, clone]
350
350
  // clone self and multiply by scalar.
351
351
  // @param scalar - value to multiply with.
352
352
  // @return cloned vector.
353
- mulScalar: function(r) {
354
- return this.clone().mulScalarSelf(r);
353
+ mulScalar: function(s) {
354
+ return this.clone().mulScalarSelf(s);
355
355
  },
356
356
  // [API]
357
357
  // [chainable, clone]
358
358
  // clone self and divide by scalar.
359
359
  // @param scalar - value to divide by.
360
360
  // @return cloned vector.
361
- divScalar: function(r) {
362
- return this.clone().divScalarSelf(r);
361
+ divScalar: function(s) {
362
+ return this.clone().divScalarSelf(s);
363
363
  },
364
364
  // [API]
365
365
  // [chainable, changeSelf]
@@ -368,8 +368,8 @@ var Ce = { exports: {} };
368
368
  // @param min - min value for x, y components.
369
369
  // @param max - max value for x, y components.
370
370
  // @return self.
371
- clampSelf: function(r, d) {
372
- return this.x < r.x && (this.x = r.x), this.y < r.y && (this.y = r.y), this.x > d.x && (this.x = d.x), this.y > d.y && (this.y = d.y), this;
371
+ clampSelf: function(s, d) {
372
+ return this.x < s.x && (this.x = s.x), this.y < s.y && (this.y = s.y), this.x > d.x && (this.x = d.x), this.y > d.y && (this.y = d.y), this;
373
373
  },
374
374
  // [API]
375
375
  // [chainable, clone]
@@ -378,8 +378,8 @@ var Ce = { exports: {} };
378
378
  // @param min - min value for x, y components.
379
379
  // @param max - max value for x, y components.
380
380
  // @return cloned vector in range.
381
- clamp: function(r, d) {
382
- return this.clone().clampSelf(r, d);
381
+ clamp: function(s, d) {
382
+ return this.clone().clampSelf(s, d);
383
383
  },
384
384
  // [API]
385
385
  // [chainable, changeSelf]
@@ -387,8 +387,8 @@ var Ce = { exports: {} };
387
387
  // for example, you can use Math.round to round the vector x, y values.
388
388
  // @param func - function to apply on components.
389
389
  // @return self.
390
- applySelf: function(r) {
391
- return this.x = r(this.x), this.y = r(this.y), this;
390
+ applySelf: function(s) {
391
+ return this.x = s(this.x), this.y = s(this.y), this;
392
392
  },
393
393
  // [API]
394
394
  // [chainable, clone]
@@ -396,8 +396,8 @@ var Ce = { exports: {} };
396
396
  // for example, you can use Math.round to round the vector x, y values.
397
397
  // @param func - function to apply on components.
398
398
  // @return cloned vector.
399
- apply: function(r) {
400
- return this.clone().applySelf(r);
399
+ apply: function(s) {
400
+ return this.clone().applySelf(s);
401
401
  },
402
402
  // [API]
403
403
  // [chainable, changeSelf]
@@ -432,16 +432,16 @@ var Ce = { exports: {} };
432
432
  // calculate dot-product of this vector with another vector.
433
433
  // @param other - other vector to calculate dot-product with.
434
434
  // @return dot product.
435
- dot: function(r) {
436
- return this.x * r.x + this.y * r.y;
435
+ dot: function(s) {
436
+ return this.x * s.x + this.y * s.y;
437
437
  },
438
438
  // [API]
439
439
  // []
440
440
  // calculate cross-product of this vector with another vector.
441
441
  // @param other - other vector to calculate cross-product with.
442
442
  // @return dot product.
443
- cross: function(r) {
444
- return this.x * r.y - this.y * r.x;
443
+ cross: function(s) {
444
+ return this.x * s.y - this.y * s.x;
445
445
  },
446
446
  // [API]
447
447
  // [chainable, changeSelf]
@@ -450,8 +450,8 @@ var Ce = { exports: {} };
450
450
  // @param x - default value for x if undefined (0 if not defined).
451
451
  // @param y - default value for y if undefined (0 if not defined).
452
452
  // @return self.
453
- repairSelf: function(r, d) {
454
- return (typeof this.x != "number" || isNaN(this.x + 1)) && (this.x = r || 0), (typeof this.y != "number" || isNaN(this.y + 1)) && (this.y = d || 0), this;
453
+ repairSelf: function(s, d) {
454
+ return (typeof this.x != "number" || isNaN(this.x + 1)) && (this.x = s || 0), (typeof this.y != "number" || isNaN(this.y + 1)) && (this.y = d || 0), this;
455
455
  },
456
456
  // [API]
457
457
  // [chainable, clone]
@@ -460,8 +460,8 @@ var Ce = { exports: {} };
460
460
  // @param x - default value for x if undefined (0 if not defined).
461
461
  // @param y - default value for y if undefined (0 if not defined).
462
462
  // @return repaired clone.
463
- repair: function(r, d) {
464
- return this.clone().repairSelf(r, d);
463
+ repair: function(s, d) {
464
+ return this.clone().repairSelf(s, d);
465
465
  },
466
466
  // [API]
467
467
  // []
@@ -475,24 +475,24 @@ var Ce = { exports: {} };
475
475
  // convert to a string with a given format.
476
476
  // @param format - a string in which %x and %y will be replaced with the vector values.
477
477
  // @return formatted string representing the vector.
478
- format: function(r) {
479
- return r = r || "%x,%y", r = r.replace(new RegExp("%x", "g"), this.x), r = r.replace(new RegExp("%y", "g"), this.y), r;
478
+ format: function(s) {
479
+ return s = s || "%x,%y", s = s.replace(new RegExp("%x", "g"), this.x), s = s.replace(new RegExp("%y", "g"), this.y), s;
480
480
  }
481
481
  }, f;
482
482
  }();
483
483
  return l.zero = new l(0, 0), l.one = new l(1, 1), l.up = new l(0, -1), l.down = new l(0, 1), l.left = new l(-1, 0), l.right = new l(1, 0), l.upLeft = new l(-1, -1), l.downLeft = new l(-1, 1), l.upRight = new l(1, -1), l.downRight = new l(1, 1), l.prototype.magnitude = l.prototype.length, Object.freeze && (Object.freeze(l.zero), Object.freeze(l.one), Object.freeze(l.up), Object.freeze(l.down), Object.freeze(l.left), Object.freeze(l.right), Object.freeze(l.upLeft), Object.freeze(l.downLeft), Object.freeze(l.upRight), Object.freeze(l.downRight)), l;
484
484
  });
485
- })(Ce);
486
- var In = Ce.exports;
487
- const rt = /* @__PURE__ */ oe(In);
488
- let jt = (u = 21) => crypto.getRandomValues(new Uint8Array(u)).reduce((l, t) => (t &= 63, t < 36 ? l += t.toString(36) : t < 62 ? l += (t - 26).toString(36).toUpperCase() : t > 62 ? l += "-" : l += "_", l), "");
485
+ })($e);
486
+ var _n = $e.exports;
487
+ const rt = /* @__PURE__ */ le(_n);
488
+ let jt = (c = 21) => crypto.getRandomValues(new Uint8Array(c)).reduce((l, t) => (t &= 63, t < 36 ? l += t.toString(36) : t < 62 ? l += (t - 26).toString(36).toUpperCase() : t > 62 ? l += "-" : l += "_", l), "");
489
489
  const Dt = {
490
490
  strokeType: "plain",
491
491
  strokeColor: "black",
492
492
  strokeWidth: 1,
493
493
  head: "none",
494
494
  tail: "none"
495
- }, Se = {
495
+ }, Ee = {
496
496
  id: 0,
497
497
  type: "Feature",
498
498
  properties: {
@@ -518,7 +518,7 @@ const Dt = {
518
518
  // tail: 'arrow-plain',
519
519
  // start: { x: 0, y: 0 },
520
520
  // end: { x: 100, y: 100 }
521
- }, _n = (u = 0, l = 0, t = 0, s = 0, a = { ...Dt }) => ({
521
+ }, Dn = (c = 0, l = 0, t = 0, r = 0, a = { ...Dt }) => ({
522
522
  id: jt(),
523
523
  type: "Feature",
524
524
  properties: {
@@ -531,70 +531,70 @@ const Dt = {
531
531
  geometry: {
532
532
  type: "LineString",
533
533
  coordinates: [
534
- [u, l],
535
- [t, s]
534
+ [c, l],
535
+ [t, r]
536
536
  ]
537
537
  }
538
- }), Dn = "http://www.w3.org/2000/svg";
539
- function It(u) {
540
- return document.createElementNS(Dn, u);
538
+ }), Mn = "http://www.w3.org/2000/svg";
539
+ function It(c) {
540
+ return document.createElementNS(Mn, c);
541
541
  }
542
- function Pe(u) {
543
- return u.geometry.bbox || On(u), u.geometry.bbox;
542
+ function Pe(c) {
543
+ return c.geometry.bbox || On(c), c.geometry.bbox;
544
544
  }
545
- function dt(u) {
546
- const l = Pe(u);
545
+ function dt(c) {
546
+ const l = Pe(c);
547
547
  return {
548
548
  width: l[2] - l[0],
549
549
  height: l[3] - l[1]
550
550
  };
551
551
  }
552
- function yt(u) {
553
- const l = Pe(u);
552
+ function yt(c) {
553
+ const l = Pe(c);
554
554
  return { x: l[0], y: l[1] };
555
555
  }
556
- function On(u) {
557
- const [l, t] = u.geometry.coordinates[0][0], [s, a] = u.geometry.coordinates[0][2];
558
- u.geometry.bbox = [l, t, s, a];
556
+ function On(c) {
557
+ const [l, t] = c.geometry.coordinates[0][0], [r, a] = c.geometry.coordinates[0][2];
558
+ c.geometry.bbox = [l, t, r, a];
559
559
  }
560
- function Mn(u, l, t, s, a) {
561
- u.geometry.bbox = [l, t, l + s, t + a], u.geometry.coordinates = [
560
+ function zn(c, l, t, r, a) {
561
+ c.geometry.bbox = [l, t, l + r, t + a], c.geometry.coordinates = [
562
562
  [
563
563
  [l, t],
564
- [l + s, t],
565
- [l + s, t + a],
564
+ [l + r, t],
565
+ [l + r, t + a],
566
566
  [l, t + a],
567
567
  [l, t]
568
568
  ]
569
569
  ];
570
570
  }
571
- function _t(u) {
572
- const [l, t] = u.geometry.coordinates[0];
571
+ function _t(c) {
572
+ const [l, t] = c.geometry.coordinates[0];
573
573
  return { x: l, y: t };
574
574
  }
575
- function Ae(u, l) {
576
- const [t, s] = u.geometry.coordinates[l === "start" ? 0 : 1];
577
- return { x: t, y: s };
575
+ function te(c, l) {
576
+ const [t, r] = c.geometry.coordinates[l === "start" ? 0 : 1];
577
+ return { x: t, y: r };
578
578
  }
579
- function Ht(u) {
580
- const [l, t] = u.geometry.coordinates[1];
579
+ function Rt(c) {
580
+ const [l, t] = c.geometry.coordinates[1];
581
581
  return { x: l, y: t };
582
582
  }
583
- function Ne(u, l, t) {
584
- u.geometry.coordinates[0] = [l, t];
583
+ function Ne(c, l, t) {
584
+ c.geometry.coordinates[0] = [l, t];
585
585
  }
586
- function $e(u, l, t) {
587
- u.geometry.coordinates[1] = [l, t];
586
+ function He(c, l, t) {
587
+ c.geometry.coordinates[1] = [l, t];
588
588
  }
589
- function Rt(u) {
590
- return { start: _t(u), end: Ht(u) };
589
+ function Ft(c) {
590
+ return { start: _t(c), end: Rt(c) };
591
591
  }
592
- function Qt(u, l, t, s) {
593
- l === "start" ? Ne(u, t, s) : $e(u, t, s);
592
+ function Nt(c, l, t, r) {
593
+ l === "start" ? Ne(c, t, r) : He(c, t, r);
594
594
  }
595
- const He = (u) => parseInt(u.getAttribute("data-handle-id") || "-1");
596
- function Xn(u) {
597
- return $t(u).reduce(
595
+ const Re = (c) => parseInt(c.getAttribute("data-handle-id") || "-1");
596
+ function Xn(c) {
597
+ return Ht(c).reduce(
598
598
  (l, t) => (l[0] = Math.min(t[0], l[0]), l[1] = Math.min(t[1], l[1]), l[2] = Math.max(t[0], l[2]), l[3] = Math.max(t[1], l[3]), l),
599
599
  [
600
600
  Number.POSITIVE_INFINITY,
@@ -604,164 +604,164 @@ function Xn(u) {
604
604
  ]
605
605
  );
606
606
  }
607
- function $t(u) {
607
+ function Ht(c) {
608
608
  let l = [];
609
- return u.type == "Point" ? l = [u.coordinates] : u.type == "LineString" || u.type == "MultiPoint" ? l = u.coordinates : u.type == "Polygon" || u.type == "MultiLineString" ? l = u.coordinates.reduce(function(t, s) {
610
- return t.concat(s);
611
- }, []) : u.type == "MultiPolygon" ? l = u.coordinates.reduce(
612
- (t, s) => t.concat(s.reduce((a, c) => a.concat(c), [])),
609
+ return c.type == "Point" ? l = [c.coordinates] : c.type == "LineString" || c.type == "MultiPoint" ? l = c.coordinates : c.type == "Polygon" || c.type == "MultiLineString" ? l = c.coordinates.reduce(function(t, r) {
610
+ return t.concat(r);
611
+ }, []) : c.type == "MultiPolygon" ? l = c.coordinates.reduce(
612
+ (t, r) => t.concat(r.reduce((a, u) => a.concat(u), [])),
613
613
  []
614
- ) : u.type == "Feature" ? l = $t(u.geometry) : u.type == "GeometryCollection" ? l = u.geometries.reduce(
615
- (t, s) => t.concat($t(s)),
614
+ ) : c.type == "Feature" ? l = Ht(c.geometry) : c.type == "GeometryCollection" ? l = c.geometries.reduce(
615
+ (t, r) => t.concat(Ht(r)),
616
616
  []
617
- ) : u.type == "FeatureCollection" && (l = u.features.reduce(
618
- (t, s) => t.concat($t(s)),
617
+ ) : c.type == "FeatureCollection" && (l = c.features.reduce(
618
+ (t, r) => t.concat(Ht(r)),
619
619
  []
620
620
  )), l;
621
621
  }
622
- function Ee(u, l, t) {
623
- const s = Math.atan2(u.y - l.y, u.x - l.x);
622
+ function ee(c, l, t) {
623
+ const r = Math.atan2(c.y - l.y, c.x - l.x);
624
624
  return {
625
- x: l.x + t * Math.cos(s),
626
- y: l.y + t * Math.sin(s)
625
+ x: l.x + t * Math.cos(r),
626
+ y: l.y + t * Math.sin(r)
627
627
  };
628
628
  }
629
- function Re(u, l = 5, t = 30) {
630
- var r;
631
- const { start: s, end: a } = Rt(u), c = new rt(s.x, s.y), y = new rt(a.x, a.y).sub(c), f = u.properties.style && u.properties.style.strokeWidth ? (r = u.properties.style) == null ? void 0 : r.strokeWidth : 0;
629
+ function Fe(c, l = 5, t = 30) {
630
+ var s;
631
+ const { start: r, end: a } = Ft(c), u = new rt(r.x, r.y), y = new rt(a.x, a.y).sub(u), f = c.properties.style && c.properties.style.strokeWidth ? (s = c.properties.style) == null ? void 0 : s.strokeWidth : 0;
632
632
  return Math.min(t, Math.max(3 * f, y.length() * 0.1, l));
633
633
  }
634
- function ke(u, l, t, s) {
635
- const a = l.clone().normalize().invert().mul(s);
634
+ function ke(c, l, t, r) {
635
+ const a = l.clone().normalize().invert().mul(r);
636
636
  if (!t || t === "none")
637
637
  return "";
638
- const c = u.clone().add(a.rotateRadians(Math.PI / 8)), g = u.clone().add(a.rotateRadians(-Math.PI / 8)), y = `${u.x} ${u.y}`;
639
- return `M ${c.x} ${c.y} L ${y} ${g.x} ${g.y} ${t === "arrow" ? "" : `${c.x} ${c.y}`}`;
638
+ const u = c.clone().add(a.rotateRadians(Math.PI / 8)), p = c.clone().add(a.rotateRadians(-Math.PI / 8)), y = `${c.x} ${c.y}`;
639
+ return `M ${u.x} ${u.y} L ${y} ${p.x} ${p.y} ${t === "arrow" ? "" : `${u.x} ${u.y}`}`;
640
640
  }
641
- function zn(u, l, t, s, a) {
642
- const { start: c, end: g } = Rt(u), { tail: y, head: f, strokeColor: r, strokeWidth: d } = u.properties.style || t, m = new rt(c.x, c.y), T = new rt(g.x, g.y), _ = T.clone().sub(m), E = Re(u, s, a), C = It("path");
643
- C.setAttribute("data-annotation", `${u.id}`), C.setAttribute("data-annotation-type", "arrow");
644
- const A = f === "arrow-plain" || y === "arrow";
645
- C.setAttribute("stroke", r || "none"), C.setAttribute("stroke-width", `${d}`), C.setAttribute("fill", A ? r || "" : "none"), C.setAttribute("stroke-linecap", "round"), C.setAttribute("stroke-linejoin", "round");
646
- const U = ke(m, _.clone().invert(), y, E), N = ke(T, _, f, E), z = U + `M ${m.x} ${m.y} ${T.x} ${T.y}` + N;
641
+ function Ln(c, l, t, r, a) {
642
+ const { start: u, end: p } = Ft(c), { tail: y, head: f, strokeColor: s, strokeWidth: d } = c.properties.style || t, m = new rt(u.x, u.y), A = new rt(p.x, p.y), I = A.clone().sub(m), k = Fe(c, r, a), C = It("path");
643
+ C.setAttribute("data-annotation", `${c.id}`), C.setAttribute("data-annotation-type", "arrow");
644
+ const E = f === "arrow-plain" || y === "arrow";
645
+ C.setAttribute("stroke", s || "none"), C.setAttribute("stroke-width", `${d}`), C.setAttribute("fill", E ? s || "" : "none"), C.setAttribute("stroke-linecap", "round"), C.setAttribute("stroke-linejoin", "round");
646
+ const U = ke(m, I.clone().invert(), y, k), P = ke(A, I, f, k), z = U + `M ${m.x} ${m.y} ${A.x} ${A.y}` + P;
647
647
  C.setAttribute("d", z), l.appendChild(C);
648
648
  }
649
- const B = -1, ae = "dragging", le = "dragstart", Ot = "dragend", ee = "select", ne = "unselect", Ln = "hover", Cn = "unhover", ie = "remove", re = "add", Pn = "cancelDrawing", se = "update", Nn = "link";
649
+ const B = -1, he = "dragging", ce = "dragstart", Mt = "dragend", ie = "select", re = "unselect", Cn = "hover", $n = "unhover", se = "remove", oe = "add", Pn = "cancelDrawing", ae = "update", Nn = "link";
650
650
  var je = { exports: {} };
651
- (function(u) {
651
+ (function(c) {
652
652
  var l = Object.prototype.hasOwnProperty, t = "~";
653
- function s() {
653
+ function r() {
654
654
  }
655
- Object.create && (s.prototype = /* @__PURE__ */ Object.create(null), new s().__proto__ || (t = !1));
656
- function a(f, r, d) {
657
- this.fn = f, this.context = r, this.once = d || !1;
655
+ Object.create && (r.prototype = /* @__PURE__ */ Object.create(null), new r().__proto__ || (t = !1));
656
+ function a(f, s, d) {
657
+ this.fn = f, this.context = s, this.once = d || !1;
658
658
  }
659
- function c(f, r, d, m, T) {
659
+ function u(f, s, d, m, A) {
660
660
  if (typeof d != "function")
661
661
  throw new TypeError("The listener must be a function");
662
- var _ = new a(d, m || f, T), E = t ? t + r : r;
663
- return f._events[E] ? f._events[E].fn ? f._events[E] = [f._events[E], _] : f._events[E].push(_) : (f._events[E] = _, f._eventsCount++), f;
662
+ var I = new a(d, m || f, A), k = t ? t + s : s;
663
+ return f._events[k] ? f._events[k].fn ? f._events[k] = [f._events[k], I] : f._events[k].push(I) : (f._events[k] = I, f._eventsCount++), f;
664
664
  }
665
- function g(f, r) {
666
- --f._eventsCount === 0 ? f._events = new s() : delete f._events[r];
665
+ function p(f, s) {
666
+ --f._eventsCount === 0 ? f._events = new r() : delete f._events[s];
667
667
  }
668
668
  function y() {
669
- this._events = new s(), this._eventsCount = 0;
669
+ this._events = new r(), this._eventsCount = 0;
670
670
  }
671
671
  y.prototype.eventNames = function() {
672
- var r = [], d, m;
672
+ var s = [], d, m;
673
673
  if (this._eventsCount === 0)
674
- return r;
674
+ return s;
675
675
  for (m in d = this._events)
676
- l.call(d, m) && r.push(t ? m.slice(1) : m);
677
- return Object.getOwnPropertySymbols ? r.concat(Object.getOwnPropertySymbols(d)) : r;
678
- }, y.prototype.listeners = function(r) {
679
- var d = t ? t + r : r, m = this._events[d];
676
+ l.call(d, m) && s.push(t ? m.slice(1) : m);
677
+ return Object.getOwnPropertySymbols ? s.concat(Object.getOwnPropertySymbols(d)) : s;
678
+ }, y.prototype.listeners = function(s) {
679
+ var d = t ? t + s : s, m = this._events[d];
680
680
  if (!m)
681
681
  return [];
682
682
  if (m.fn)
683
683
  return [m.fn];
684
- for (var T = 0, _ = m.length, E = new Array(_); T < _; T++)
685
- E[T] = m[T].fn;
686
- return E;
687
- }, y.prototype.listenerCount = function(r) {
688
- var d = t ? t + r : r, m = this._events[d];
684
+ for (var A = 0, I = m.length, k = new Array(I); A < I; A++)
685
+ k[A] = m[A].fn;
686
+ return k;
687
+ }, y.prototype.listenerCount = function(s) {
688
+ var d = t ? t + s : s, m = this._events[d];
689
689
  return m ? m.fn ? 1 : m.length : 0;
690
- }, y.prototype.emit = function(r, d, m, T, _, E) {
691
- var C = t ? t + r : r;
690
+ }, y.prototype.emit = function(s, d, m, A, I, k) {
691
+ var C = t ? t + s : s;
692
692
  if (!this._events[C])
693
693
  return !1;
694
- var A = this._events[C], U = arguments.length, N, z;
695
- if (A.fn) {
696
- switch (A.once && this.removeListener(r, A.fn, void 0, !0), U) {
694
+ var E = this._events[C], U = arguments.length, P, z;
695
+ if (E.fn) {
696
+ switch (E.once && this.removeListener(s, E.fn, void 0, !0), U) {
697
697
  case 1:
698
- return A.fn.call(A.context), !0;
698
+ return E.fn.call(E.context), !0;
699
699
  case 2:
700
- return A.fn.call(A.context, d), !0;
700
+ return E.fn.call(E.context, d), !0;
701
701
  case 3:
702
- return A.fn.call(A.context, d, m), !0;
702
+ return E.fn.call(E.context, d, m), !0;
703
703
  case 4:
704
- return A.fn.call(A.context, d, m, T), !0;
704
+ return E.fn.call(E.context, d, m, A), !0;
705
705
  case 5:
706
- return A.fn.call(A.context, d, m, T, _), !0;
706
+ return E.fn.call(E.context, d, m, A, I), !0;
707
707
  case 6:
708
- return A.fn.call(A.context, d, m, T, _, E), !0;
708
+ return E.fn.call(E.context, d, m, A, I, k), !0;
709
709
  }
710
- for (z = 1, N = new Array(U - 1); z < U; z++)
711
- N[z - 1] = arguments[z];
712
- A.fn.apply(A.context, N);
710
+ for (z = 1, P = new Array(U - 1); z < U; z++)
711
+ P[z - 1] = arguments[z];
712
+ E.fn.apply(E.context, P);
713
713
  } else {
714
- var W = A.length, nt;
715
- for (z = 0; z < W; z++)
716
- switch (A[z].once && this.removeListener(r, A[z].fn, void 0, !0), U) {
714
+ var Z = E.length, nt;
715
+ for (z = 0; z < Z; z++)
716
+ switch (E[z].once && this.removeListener(s, E[z].fn, void 0, !0), U) {
717
717
  case 1:
718
- A[z].fn.call(A[z].context);
718
+ E[z].fn.call(E[z].context);
719
719
  break;
720
720
  case 2:
721
- A[z].fn.call(A[z].context, d);
721
+ E[z].fn.call(E[z].context, d);
722
722
  break;
723
723
  case 3:
724
- A[z].fn.call(A[z].context, d, m);
724
+ E[z].fn.call(E[z].context, d, m);
725
725
  break;
726
726
  case 4:
727
- A[z].fn.call(A[z].context, d, m, T);
727
+ E[z].fn.call(E[z].context, d, m, A);
728
728
  break;
729
729
  default:
730
- if (!N)
731
- for (nt = 1, N = new Array(U - 1); nt < U; nt++)
732
- N[nt - 1] = arguments[nt];
733
- A[z].fn.apply(A[z].context, N);
730
+ if (!P)
731
+ for (nt = 1, P = new Array(U - 1); nt < U; nt++)
732
+ P[nt - 1] = arguments[nt];
733
+ E[z].fn.apply(E[z].context, P);
734
734
  }
735
735
  }
736
736
  return !0;
737
- }, y.prototype.on = function(r, d, m) {
738
- return c(this, r, d, m, !1);
739
- }, y.prototype.once = function(r, d, m) {
740
- return c(this, r, d, m, !0);
741
- }, y.prototype.removeListener = function(r, d, m, T) {
742
- var _ = t ? t + r : r;
743
- if (!this._events[_])
737
+ }, y.prototype.on = function(s, d, m) {
738
+ return u(this, s, d, m, !1);
739
+ }, y.prototype.once = function(s, d, m) {
740
+ return u(this, s, d, m, !0);
741
+ }, y.prototype.removeListener = function(s, d, m, A) {
742
+ var I = t ? t + s : s;
743
+ if (!this._events[I])
744
744
  return this;
745
745
  if (!d)
746
- return g(this, _), this;
747
- var E = this._events[_];
748
- if (E.fn)
749
- E.fn === d && (!T || E.once) && (!m || E.context === m) && g(this, _);
746
+ return p(this, I), this;
747
+ var k = this._events[I];
748
+ if (k.fn)
749
+ k.fn === d && (!A || k.once) && (!m || k.context === m) && p(this, I);
750
750
  else {
751
- for (var C = 0, A = [], U = E.length; C < U; C++)
752
- (E[C].fn !== d || T && !E[C].once || m && E[C].context !== m) && A.push(E[C]);
753
- A.length ? this._events[_] = A.length === 1 ? A[0] : A : g(this, _);
751
+ for (var C = 0, E = [], U = k.length; C < U; C++)
752
+ (k[C].fn !== d || A && !k[C].once || m && k[C].context !== m) && E.push(k[C]);
753
+ E.length ? this._events[I] = E.length === 1 ? E[0] : E : p(this, I);
754
754
  }
755
755
  return this;
756
- }, y.prototype.removeAllListeners = function(r) {
756
+ }, y.prototype.removeAllListeners = function(s) {
757
757
  var d;
758
- return r ? (d = t ? t + r : r, this._events[d] && g(this, d)) : (this._events = new s(), this._eventsCount = 0), this;
759
- }, y.prototype.off = y.prototype.removeListener, y.prototype.addListener = y.prototype.on, y.prefixed = t, y.EventEmitter = y, u.exports = y;
758
+ return s ? (d = t ? t + s : s, this._events[d] && p(this, d)) : (this._events = new r(), this._eventsCount = 0), this;
759
+ }, y.prototype.off = y.prototype.removeListener, y.prototype.addListener = y.prototype.on, y.prefixed = t, y.EventEmitter = y, c.exports = y;
760
760
  })(je);
761
- var $n = je.exports;
762
- const Fe = /* @__PURE__ */ oe($n);
763
- class qe extends Fe {
764
- constructor(t, s) {
761
+ var Hn = je.exports;
762
+ const qe = /* @__PURE__ */ le(Hn);
763
+ class Be extends qe {
764
+ constructor(t, r) {
765
765
  super();
766
766
  v(this, "ogma");
767
767
  v(this, "elements");
@@ -774,22 +774,21 @@ class qe extends Fe {
774
774
  v(this, "ogmaOptions");
775
775
  v(this, "shouldDetect");
776
776
  v(this, "isDragging");
777
+ v(this, "maxHandleScale", 1.5);
777
778
  v(this, "_onKeyUp", (t) => {
778
779
  t.code === 27 && this.selectedId !== B ? this.unselect() : (t.code === 46 || t.code === 8) && this.selectedId !== B && this._canRemove() && this.remove(this.selectedId);
779
780
  });
780
781
  v(this, "_onClickMouseMove", (t) => {
781
782
  if (!t.domEvent || this.isDragging || !this.shouldDetect)
782
783
  return;
783
- const s = this.ogma.view.screenToGraphCoordinates(t), a = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(s, 0) : void 0;
784
+ const r = this.ogma.view.screenToGraphCoordinates(t), a = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(r, 0) : void 0;
784
785
  t.domEvent.type === "mousemove" ? a ? this.hover(a.id) : this.hoveredId !== B && this.unhover() : a ? this.select(a.id) : this.selectedId !== B && this.unselect();
785
786
  });
786
- this.ogma = t, this.elements = [], this.shouldDetect = !0, this.isDragging = !1, this.ogmaOptions = t.getOptions(), t.events.on(["click", "mousemove"], this._onClickMouseMove).on("keyup", this._onKeyUp), this.layer = t.layers.addSVGLayer({
787
+ this.ogma = t, this.elements = [], this.shouldDetect = !0, this.isDragging = !1, this.ogmaOptions = t.getOptions(), t.events.on(["click", "mousemove"], this._onClickMouseMove).on("keyup", this._onKeyUp).on("newFrame", () => {
788
+ this.refreshEditor();
789
+ }), this.layer = t.layers.addSVGLayer({
787
790
  draw: (a) => this.draw(a)
788
- }), this.layer.moveToTop(), this.editor = t.layers.addOverlay({
789
- element: s,
790
- position: { x: 0, y: 0 },
791
- size: { width: 0, height: 0 }
792
- }), this.editor.hide();
791
+ }), this.layer.moveToTop(), this.editor = t.layers.addLayer(r), this.editor.hide();
793
792
  }
794
793
  _canRemove() {
795
794
  return !0;
@@ -800,32 +799,32 @@ class qe extends Fe {
800
799
  * @returns the added annotation
801
800
  */
802
801
  add(t) {
803
- const s = this.getDefaultOptions(), a = Object.assign(t, {
802
+ const r = this.getDefaultOptions(), a = Object.assign(t, {
804
803
  id: t.id === void 0 ? jt() : t.id,
805
804
  type: t.type,
806
805
  properties: {
807
- ...s.properties,
806
+ ...r.properties,
808
807
  ...t.properties || {},
809
808
  // styles need to be merged
810
- style: { ...s.properties.style, ...t.properties.style || {} }
809
+ style: { ...r.properties.style, ...t.properties.style || {} }
811
810
  },
812
811
  geometry: {
813
- ...s.geometry,
812
+ ...r.geometry,
814
813
  ...t.geometry
815
814
  }
816
815
  });
817
- return this.elements.push(a), this.layer.refresh(), this.emit(re, a), a;
816
+ return this.elements.push(a), this.layer.refresh(), this.emit(oe, a), a;
818
817
  }
819
- updateStyle(t, s) {
818
+ updateStyle(t, r) {
820
819
  this.updateAnnotation(t, {
821
820
  properties: {
822
- style: s
821
+ style: r
823
822
  }
824
823
  });
825
824
  }
826
- updateGeometry(t, s) {
825
+ updateGeometry(t, r) {
827
826
  this.updateAnnotation(t, {
828
- geometry: s
827
+ geometry: r
829
828
  });
830
829
  }
831
830
  /**
@@ -834,36 +833,36 @@ class qe extends Fe {
834
833
  * @param id Id of the annotation to update
835
834
  * @param new params of the annotation
836
835
  */
837
- update(t, s) {
836
+ update(t, r) {
838
837
  const a = this.getById(t);
839
- this.updateAnnotation(a, s);
838
+ this.updateAnnotation(a, r);
840
839
  }
841
- updateAnnotation(t, s) {
840
+ updateAnnotation(t, r) {
842
841
  if (!t)
843
842
  return;
844
843
  const a = t.id;
845
- Object.keys(s).forEach((c) => {
846
- if (c !== "id")
847
- if (c === "properties") {
848
- const g = s.properties || { style: {} };
844
+ Object.keys(r).forEach((u) => {
845
+ if (u !== "id")
846
+ if (u === "properties") {
847
+ const p = r.properties || { style: {} };
849
848
  t.properties = {
850
849
  ...t.properties || {},
851
- ...g || {},
850
+ ...p || {},
852
851
  style: {
853
852
  ...t.properties.style || {},
854
- ...g.style || {}
853
+ ...p.style || {}
855
854
  }
856
855
  };
857
856
  } else
858
- c === "geometry" ? t.geometry = {
857
+ u === "geometry" ? t.geometry = {
859
858
  ...t.geometry,
860
- ...s.geometry
861
- } : t[c] = s[c];
859
+ ...r.geometry
860
+ } : t[u] = r[u];
862
861
  }), a === this.selectedId && this.refreshEditor(), this.layer.refresh();
863
862
  }
864
863
  getById(t) {
865
- for (let s = 0; s < this.elements.length; s++) {
866
- const a = this.elements[s];
864
+ for (let r = 0; r < this.elements.length; r++) {
865
+ const a = this.elements[r];
867
866
  if (a.id === t)
868
867
  return a;
869
868
  }
@@ -874,23 +873,23 @@ class qe extends Fe {
874
873
  * Select element, show editor, disable Ogma dragging and fire event
875
874
  */
876
875
  select(t) {
877
- const s = this.getById(t);
878
- s && (this.editor.show(), this.selectedId = t, this.refreshEditor(), this.layer.refresh(), this.emit(ee, s));
876
+ const r = this.getById(t);
877
+ r && (this.editor.show(), this.selectedId = t, this.refreshEditor(), this.layer.refresh(), this.emit(ie, r));
879
878
  }
880
879
  hover(t) {
881
- const s = this.getById(t);
882
- s && (this.editor.show(), this.hoveredId = t, this.refreshEditor(), this.layer.refresh(), this.emit(Ln, s));
880
+ const r = this.getById(t);
881
+ r && (this.editor.show(), this.hoveredId = t, this.refreshEditor(), this.layer.refresh(), this.emit(Cn, r));
883
882
  }
884
883
  getSelectedFeature() {
885
884
  return this.selectedId === B ? null : this.getById(this.selectedId);
886
885
  }
887
886
  unselect() {
888
887
  const t = this.getById(this.selectedId);
889
- return t && this.emit(ne, t), this.selectedId = B, this.hoveredId === B && this.editor.hide(), this.layer.refresh(), this;
888
+ return t && this.emit(re, t), this.selectedId = B, this.hoveredId === B && this.editor.hide(), this.layer.refresh(), this;
890
889
  }
891
890
  unhover() {
892
891
  const t = this.getById(this.hoveredId);
893
- return this.emit(Cn, t), this.hoveredId = B, this.selectedId === B && this.editor.hide(), this.layer.refresh(), this;
892
+ return this.emit($n, t), this.hoveredId = B, this.selectedId === B && this.editor.hide(), this.layer.refresh(), this;
894
893
  }
895
894
  /**
896
895
  * @method remove
@@ -898,8 +897,8 @@ class qe extends Fe {
898
897
  * Removes annotation with the given id
899
898
  */
900
899
  remove(t) {
901
- const s = this.getById(t);
902
- t === this.hoveredId && this.unhover(), t === this.selectedId && this.unselect(), this.elements = this.elements.filter((a) => a.id !== t), s && this.emit(ie, s), this.layer.refresh();
900
+ const r = this.getById(t);
901
+ t === this.hoveredId && this.unhover(), t === this.selectedId && this.unselect(), this.elements = this.elements.filter((a) => a.id !== t), r && this.emit(se, r), this.layer.refresh();
903
902
  }
904
903
  /**
905
904
  * @method disableDragging
@@ -948,8 +947,8 @@ class qe extends Fe {
948
947
  }
949
948
  }
950
949
  const Te = "handle-line", Ie = "handle-start", _e = "handle-end";
951
- class Hn extends qe {
952
- constructor(t, s = {}) {
950
+ class Rn extends Be {
951
+ constructor(t, r = {}) {
953
952
  super(
954
953
  t,
955
954
  `
@@ -964,31 +963,30 @@ class Hn extends qe {
964
963
  v(this, "draggedHandle", B);
965
964
  v(this, "start", { x: 0, y: 0 });
966
965
  v(this, "end", { x: 0, y: 0 });
967
- v(this, "arrow", { ...Se });
966
+ v(this, "arrow", { ...Ee });
968
967
  v(this, "startX", 0);
969
968
  v(this, "startY", 0);
970
969
  v(this, "minArrowHeight", 0);
971
970
  v(this, "maxArrowHeight", 0);
972
971
  v(this, "handles", []);
973
972
  v(this, "onHandleMouseDown", (t) => {
974
- const s = this.getById(this.selectedId) || this.getById(this.hoveredId);
975
- s && (this.startDragging(s, t.clientX, t.clientY), this.draggedHandle = He(t.target));
973
+ const r = this.getById(this.selectedId) || this.getById(this.hoveredId);
974
+ r && (this.startDragging(r, t.clientX, t.clientY), this.draggedHandle = Re(t.target));
976
975
  });
977
976
  v(this, "onMouseUp", () => {
978
- this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = B, this.emit(Ot, this.arrow));
977
+ this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = B, this.emit(Mt, this.arrow));
979
978
  });
980
979
  v(this, "onMouseMove", (t) => {
981
- var m;
982
980
  if (!this.isDragging || this.draggedHandle === B)
983
981
  return;
984
- const s = this.handles[this.draggedHandle], a = this.ogma.view.getZoom(), c = (m = this.ogma.getContainer()) == null ? void 0 : m.getBoundingClientRect(), g = (t.clientX - this.startX - c.left) / a, y = (t.clientY - this.startY - c.top) / a, f = s.id === Te, r = s.id === Ie, d = s.id === _e;
985
- (f || r) && Ne(this.arrow, this.start.x + g, this.start.y + y), (f || d) && $e(this.arrow, this.end.x + g, this.end.y + y), this.emit(
986
- ae,
982
+ const r = this.handles[this.draggedHandle], a = this.ogma.view.getZoom(), u = (t.clientX - this.startX) / a, p = (t.clientY - this.startY) / a, y = r.id === Te, f = r.id === Ie, s = r.id === _e;
983
+ (y || f) && Ne(this.arrow, this.start.x + u, this.start.y + p), (y || s) && He(this.arrow, this.end.x + u, this.end.y + p), this.emit(
984
+ he,
987
985
  this.arrow,
988
- f ? "line" : r ? "start" : "end"
986
+ y ? "line" : f ? "start" : "end"
989
987
  ), this.refreshEditor(), this.layer.refresh();
990
988
  });
991
- this.minArrowHeight = s.minArrowHeight || 0, this.maxArrowHeight = s.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
989
+ this.minArrowHeight = r.minArrowHeight || 0, this.maxArrowHeight = r.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
992
990
  this.editor.element.querySelectorAll(".arrow-handle>.handle")
993
991
  ), this.handles.forEach(
994
992
  (a) => a.addEventListener("mousedown", this.onHandleMouseDown)
@@ -1000,49 +998,48 @@ class Hn extends qe {
1000
998
  * @param y
1001
999
  * @param arrow
1002
1000
  */
1003
- startDrawing(t, s, a = _n(t, s, t, s, Dt)) {
1001
+ startDrawing(t, r, a = Dn(t, r, t, r, Dt)) {
1002
+ var y;
1004
1003
  this.add(a), this.hoveredId = a.id;
1005
- const c = this.ogma.view.graphToScreenCoordinates({ x: t, y: s });
1006
- this.startDragging(this.getById(a.id), c.x, c.y), this.draggedHandle = 2;
1004
+ const u = this.ogma.view.graphToScreenCoordinates({ x: t, y: r }), p = ((y = this.ogma.getContainer()) == null ? void 0 : y.getBoundingClientRect()) || { left: 0, top: 0 };
1005
+ this.startDragging(this.getById(a.id), u.x + (p == null ? void 0 : p.left), u.y + p.top), this.draggedHandle = 2;
1007
1006
  }
1008
1007
  cancelDrawing() {
1009
- this.isDragging && (this.remove(this.arrow.id), this.emit(Ot, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = B);
1008
+ this.isDragging && (this.remove(this.arrow.id), this.emit(Mt, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = B);
1010
1009
  }
1011
- startDragging(t, s, a) {
1012
- this.selectedId !== t.id && this.select(this.hoveredId), this.arrow = t, this.startX = s, this.startY = a, this.start = _t(this.arrow), this.end = Ht(this.arrow), this.disableDragging(), this.emit(le, this.arrow), this.isDragging = !0;
1010
+ startDragging(t, r, a) {
1011
+ this.selectedId !== t.id && this.select(this.hoveredId), this.arrow = t, this.startX = r, this.startY = a, this.start = _t(this.arrow), this.end = Rt(this.arrow), this.disableDragging(), this.emit(ce, this.arrow), this.isDragging = !0;
1013
1012
  }
1014
- detect(t, s = 0) {
1013
+ detect(t, r = 0) {
1015
1014
  return this.elements.find((a) => {
1016
- const { start: c, end: g } = Rt(a), y = new rt(t.x, t.y).sub(
1017
- new rt((c.x + g.x) / 2, (c.y + g.y) / 2)
1018
- ), f = new rt(g.x, g.y).sub(new rt(c.x, c.y)), r = f.length(), d = f.normalize(), m = Re(a);
1019
- return Math.abs(d.dot(y)) < r / 2 + s && Math.abs(d.rotateRadians(Math.PI / 2).dot(y)) < m / 2 + s;
1015
+ const { start: u, end: p } = Ft(a), y = new rt(t.x, t.y).sub(
1016
+ new rt((u.x + p.x) / 2, (u.y + p.y) / 2)
1017
+ ), f = new rt(p.x, p.y).sub(new rt(u.x, u.y)), s = f.length(), d = f.normalize(), m = Fe(a);
1018
+ return Math.abs(d.dot(y)) < s / 2 + r && Math.abs(d.rotateRadians(Math.PI / 2).dot(y)) < m / 2 + r;
1020
1019
  });
1021
1020
  }
1022
1021
  refreshEditor() {
1023
1022
  if (+this.selectedId < 0 && +this.hoveredId < 0)
1024
1023
  return;
1025
- const t = this.selectedId !== B ? this.getById(this.selectedId) : this.getById(this.hoveredId), { start: s, end: a } = Rt(t);
1026
- this.editor.setPosition({ x: 0, y: 0 }).setSize({ width: "100%", height: "100%" });
1027
- const [c, g, y] = Array.prototype.slice.call(
1024
+ const t = this.selectedId !== B ? this.getById(this.selectedId) : this.getById(this.hoveredId), r = Ft(t), a = this.ogma.view.graphToScreenCoordinates(r.start), u = this.ogma.view.graphToScreenCoordinates(r.end), p = Math.min(this.ogma.view.getZoom(), this.maxHandleScale), [y, f, s] = Array.prototype.slice.call(
1028
1025
  this.editor.element.querySelectorAll(".handle")
1029
1026
  );
1030
- g.style.left = `${s.x}px`, g.style.top = `${s.y}px`, y.style.left = `${a.x}px`, y.style.top = `${a.y}px`;
1031
- const f = {
1032
- x: (a.x + s.x) / 2,
1033
- y: (a.y + s.y) / 2
1034
- }, r = new rt(a.x - s.x, a.y - s.y), d = r.mul(1 / r.length()), m = Math.atan2(d.y, d.x);
1035
- c.style.width = `${r.length()}px`, c.style.left = `${f.x}px`, c.style.top = `${f.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${m}rad)`;
1027
+ f.style.transform = `translate(${a.x}px, ${a.y}px) translate(-50%, -50%) scale(${p})`, s.style.transform = `translate(${u.x}px, ${u.y}px) translate(-50%, -50%) scale(${p}`;
1028
+ const d = {
1029
+ x: (u.x + a.x) / 2,
1030
+ y: (u.y + a.y) / 2
1031
+ }, m = new rt(u.x - a.x, u.y - a.y), A = m.mul(1 / m.length()), I = Math.atan2(A.y, A.x);
1032
+ y.style.width = `${m.length() / p}px`, y.style.left = `${d.x}px`, y.style.top = `${d.y}px`, y.style.transform = `translate(-50%, -50%) rotate(${I}rad) scale(${p}) `;
1036
1033
  }
1037
1034
  getDefaultOptions() {
1038
- return Se;
1035
+ return Ee;
1039
1036
  }
1040
1037
  draw(t) {
1041
1038
  t.innerHTML = "";
1042
- const s = It("g");
1039
+ const r = It("g");
1043
1040
  this.elements.forEach(
1044
- (a) => zn(a, s, Dt, this.minArrowHeight, this.maxArrowHeight)
1045
- ), t.appendChild(s);
1041
+ (a) => Ln(a, r, Dt, this.minArrowHeight, this.maxArrowHeight)
1042
+ ), t.appendChild(r);
1046
1043
  }
1047
1044
  destroy() {
1048
1045
  super.destroy(), document.removeEventListener("mousemove", this.onMouseMove, !0), document.removeEventListener("mouseup", this.onMouseUp);
@@ -1056,7 +1053,7 @@ const bt = {
1056
1053
  strokeWidth: 1,
1057
1054
  strokeColor: "#000",
1058
1055
  strokeType: "plain"
1059
- }, te = {
1056
+ }, ne = {
1060
1057
  id: 0,
1061
1058
  type: "Feature",
1062
1059
  properties: {
@@ -1081,36 +1078,36 @@ const bt = {
1081
1078
  }, De = {
1082
1079
  handleSize: 3.5,
1083
1080
  placeholder: "Your text..."
1084
- }, Rn = (u = 0, l = 0, t = 100, s = 50, a = "", c = { ...bt }) => ({
1081
+ }, Fn = (c = 0, l = 0, t = 100, r = 50, a = "", u = { ...bt }) => ({
1085
1082
  id: jt(),
1086
1083
  type: "Feature",
1087
1084
  properties: {
1088
1085
  type: "text",
1089
1086
  content: a,
1090
- style: { ...bt, ...c }
1087
+ style: { ...bt, ...u }
1091
1088
  },
1092
1089
  geometry: {
1093
1090
  type: "Polygon",
1094
1091
  coordinates: [
1095
1092
  [
1096
- [u, l],
1097
- [u + t, l],
1098
- [u + t, l + s],
1099
- [u, l + s],
1100
- [u, l]
1093
+ [c, l],
1094
+ [c + t, l],
1095
+ [c + t, l + r],
1096
+ [c, l + r],
1097
+ [c, l]
1101
1098
  ]
1102
1099
  ]
1103
1100
  }
1104
1101
  });
1105
- var Be = { exports: {} };
1106
- (function(u, l) {
1107
- (function(t, s) {
1108
- u.exports = s();
1109
- })(Tn, () => (() => {
1102
+ var Ve = { exports: {} };
1103
+ (function(c, l) {
1104
+ (function(t, r) {
1105
+ c.exports = r();
1106
+ })(In, () => (() => {
1110
1107
  var t = { d: (e, n) => {
1111
1108
  for (var o in n)
1112
1109
  t.o(n, o) && !t.o(e, o) && Object.defineProperty(e, o, { enumerable: !0, get: n[o] });
1113
- }, o: (e, n) => Object.prototype.hasOwnProperty.call(e, n) }, s = {};
1110
+ }, o: (e, n) => Object.prototype.hasOwnProperty.call(e, n) }, r = {};
1114
1111
  function a(e) {
1115
1112
  return a = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1116
1113
  return typeof n;
@@ -1118,43 +1115,43 @@ var Be = { exports: {} };
1118
1115
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1119
1116
  }, a(e);
1120
1117
  }
1121
- t.d(s, { default: () => Sn });
1122
- var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, g = /\bsmall-caps\b/, y = /\b(?:italic|oblique)\b/, f = /\bbold(?:er)?\b/, r = 13.3333333, d = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1118
+ t.d(r, { default: () => An });
1119
+ var u = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, p = /\bsmall-caps\b/, y = /\b(?:italic|oblique)\b/, f = /\bbold(?:er)?\b/, s = 13.3333333, d = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1123
1120
  function m(e) {
1124
1121
  var n = "", o = this;
1125
1122
  return o.style && o.style !== "normal" && (n += o.style), o.variant && o.variant !== "normal" && (n += (n ? " " : "") + o.variant), o.weight && o.weight !== "normal" && (n += (n ? " " : "") + o.weight), o.size && (n += (n ? " " : "") + o.size + "px", o.height !== o.size && (n += "/" + o.height + "px")), o.family && (n += (n ? " " : "") + o.family), e && (n += "::" + o.baseline), e && (n += "::" + o.color), n;
1126
1123
  }
1127
- var T = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: m, valueOf: m };
1128
- function _(e) {
1129
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = c.exec(e);
1124
+ var A = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: m, valueOf: m };
1125
+ function I(e) {
1126
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = u.exec(e);
1130
1127
  n.family = (o[6] || "").trim();
1131
1128
  var i = d[o[2]] || parseFloat(o[2]);
1132
- o[3] === "%" ? i *= 0.16 : o[3] === "em" ? i *= 16 : o[3] === "pt" && (i *= r), n.size = i;
1129
+ o[3] === "%" ? i *= 0.16 : o[3] === "em" ? i *= 16 : o[3] === "pt" && (i *= s), n.size = i;
1133
1130
  var h = parseFloat(o[4]);
1134
- if (h !== "normal" && h !== "inherit" && h ? o[5] && o[5] !== "em" ? o[5] === "pt" ? n.height = h * r : o[5] === "%" ? n.height = 0.01 * i : n.height = h : n.height = h * i : n.height = Math.round(i * (7 / 6)), g.test(o[1]) && (n.variant = "small-caps"), y.test(o[1]) && (n.style = "italic"), f.test(o[1]))
1131
+ if (h !== "normal" && h !== "inherit" && h ? o[5] && o[5] !== "em" ? o[5] === "pt" ? n.height = h * s : o[5] === "%" ? n.height = 0.01 * i : n.height = h : n.height = h * i : n.height = Math.round(i * (7 / 6)), p.test(o[1]) && (n.variant = "small-caps"), y.test(o[1]) && (n.style = "italic"), f.test(o[1]))
1135
1132
  n.weight = "bold";
1136
1133
  else {
1137
- var p = parseInt(/\b(\d+)\b/.exec(o[1]), 10);
1138
- p >= 100 && p !== 400 && (n.weight = p);
1134
+ var g = parseInt(/\b(\d+)\b/.exec(o[1]), 10);
1135
+ g >= 100 && g !== 400 && (n.weight = g);
1139
1136
  }
1140
1137
  return n;
1141
1138
  }
1142
- function E() {
1143
- var e, n, o, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, p = 14, w = 12, x = null, b = null, S = "";
1139
+ function k() {
1140
+ var e, n, o, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, g = 14, w = 12, x = null, b = null, S = "";
1144
1141
  if (i && i.nodeType) {
1145
- var D = i && (i.ownerDocument && i.ownerDocument.defaultView || i.document && i || i.defaultView), O = D.getComputedStyle(i, null);
1146
- e = O.getPropertyValue("font-family") || "", w = parseFloat(O.getPropertyValue("font-size")), p = O.getPropertyValue("line-height"), x = O.getPropertyValue("font-weight"), b = O.getPropertyValue("font-style"), S = O.getPropertyValue("font-variant") || "";
1142
+ var D = i && (i.ownerDocument && i.ownerDocument.defaultView || i.document && i || i.defaultView), M = D.getComputedStyle(i, null);
1143
+ e = M.getPropertyValue("font-family") || "", w = parseFloat(M.getPropertyValue("font-size")), g = M.getPropertyValue("line-height"), x = M.getPropertyValue("font-weight"), b = M.getPropertyValue("font-style"), S = M.getPropertyValue("font-variant") || "";
1147
1144
  } else if (typeof i == "string") {
1148
- var k = _(i);
1149
- e = k.family, w = k.size, p = k.height, S = k.variant, b = k.style, x = k.weight;
1145
+ var T = I(i);
1146
+ e = T.family, w = T.size, g = T.height, S = T.variant, b = T.style, x = T.weight;
1150
1147
  } else
1151
- a(i) === "object" && (e = i.family, w = i.size, p = i.height, S = i.variant, x = i.weight, b = i.style, n = i.baseline, o = i.color);
1152
- h.size && h.size < 3 && (w *= h.size), p = p !== "normal" && p ? parseFloat(p) : w * (7 / 6), h.height && h.height < 3 && (p *= h.height);
1153
- var M = Object.create(T);
1154
- return M.family = h.family || e || "sans-serif", M.height = p ?? 14, M.size = w ?? 12, M.variant = h.variant || S || "", M.style = h.style || b || "", M.weight = h.weight || x || "", M.baseline = n || 0, h.baseline != null && (M.baseline = h.baseline), M.color = h.color || o || "", M.id = m.call(M, !0), M;
1148
+ a(i) === "object" && (e = i.family, w = i.size, g = i.height, S = i.variant, x = i.weight, b = i.style, n = i.baseline, o = i.color);
1149
+ h.size && h.size < 3 && (w *= h.size), g = g !== "normal" && g ? parseFloat(g) : w * (7 / 6), h.height && h.height < 3 && (g *= h.height);
1150
+ var O = Object.create(A);
1151
+ return O.family = h.family || e || "sans-serif", O.height = g ?? 14, O.size = w ?? 12, O.variant = h.variant || S || "", O.style = h.style || b || "", O.weight = h.weight || x || "", O.baseline = n || 0, h.baseline != null && (O.baseline = h.baseline), O.color = h.color || o || "", O.id = m.call(O, !0), O;
1155
1152
  }
1156
1153
  const C = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "᠎": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "​": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
1157
- var A, U = function(e) {
1154
+ var E, U = function(e) {
1158
1155
  var n = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || e && e.createElement("canvas");
1159
1156
  if (n && n.getContext) {
1160
1157
  var o = n.getContext("2d");
@@ -1163,20 +1160,20 @@ var Be = { exports: {} };
1163
1160
  return o.font = String(h), o.measureText(i).width;
1164
1161
  };
1165
1162
  }
1166
- }(typeof document < "u" ? document : null) || (A = {}, function(e, n) {
1167
- if (!A[n]) {
1168
- var o = E(n);
1169
- A[n] = o, /\bmonospace\b/.test(o.family) ? o.size *= 0.6 : (o.size *= 0.45, o.weight && (o.size *= 1.18));
1163
+ }(typeof document < "u" ? document : null) || (E = {}, function(e, n) {
1164
+ if (!E[n]) {
1165
+ var o = k(n);
1166
+ E[n] = o, /\bmonospace\b/.test(o.family) ? o.size *= 0.6 : (o.size *= 0.45, o.weight && (o.size *= 1.18));
1170
1167
  }
1171
- return e.length * A[n].size;
1172
- }), N = {}, z = { trim: !0, collapse: !0 };
1173
- function W(e, n, o) {
1168
+ return e.length * E[n].size;
1169
+ }), P = {}, z = { trim: !0, collapse: !0 };
1170
+ function Z(e, n, o) {
1174
1171
  var i = Object.assign({}, z, o), h = String(e);
1175
1172
  if (!h)
1176
1173
  return 0;
1177
1174
  if (h in C) {
1178
- var p = n.id + "/" + h;
1179
- return p in N || (N[p] = U("_".concat(h, "_"), n) - U("__", n)), N[p];
1175
+ var g = n.id + "/" + h;
1176
+ return g in P || (P[g] = U("_".concat(h, "_"), n) - U("__", n)), P[g];
1180
1177
  }
1181
1178
  return i.trim && i.collapse ? i.trim ? h = h.trim() : i.collapse && (h = h.replace(/\s+/g, " ")) : h = h.replace(/\n/g, " "), U(h, n) + n.size * (e.tracking || 0);
1182
1179
  }
@@ -1187,17 +1184,17 @@ var Be = { exports: {} };
1187
1184
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1188
1185
  }, nt(e);
1189
1186
  }
1190
- function Ft(e, n) {
1187
+ function qt(e, n) {
1191
1188
  if (typeof n != "function" && n !== null)
1192
1189
  throw new TypeError("Super expression must either be null or a function");
1193
- e.prototype = Object.create(n && n.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), n && qt(e, n);
1190
+ e.prototype = Object.create(n && n.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), n && Bt(e, n);
1194
1191
  }
1195
- function qt(e, n) {
1196
- return qt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, i) {
1192
+ function Bt(e, n) {
1193
+ return Bt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, i) {
1197
1194
  return o.__proto__ = i, o;
1198
- }, qt(e, n);
1195
+ }, Bt(e, n);
1199
1196
  }
1200
- function Bt(e) {
1197
+ function Vt(e) {
1201
1198
  var n = function() {
1202
1199
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
1203
1200
  return !1;
@@ -1211,16 +1208,16 @@ var Be = { exports: {} };
1211
1208
  }
1212
1209
  }();
1213
1210
  return function() {
1214
- var o, i = Mt(e);
1211
+ var o, i = Ot(e);
1215
1212
  if (n) {
1216
- var h = Mt(this).constructor;
1213
+ var h = Ot(this).constructor;
1217
1214
  o = Reflect.construct(i, arguments, h);
1218
1215
  } else
1219
1216
  o = i.apply(this, arguments);
1220
- return Ve(this, o);
1217
+ return Ue(this, o);
1221
1218
  };
1222
1219
  }
1223
- function Ve(e, n) {
1220
+ function Ue(e, n) {
1224
1221
  if (n && (nt(n) === "object" || typeof n == "function"))
1225
1222
  return n;
1226
1223
  if (n !== void 0)
@@ -1231,35 +1228,35 @@ var Be = { exports: {} };
1231
1228
  return o;
1232
1229
  }(e);
1233
1230
  }
1234
- function Mt(e) {
1235
- return Mt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
1231
+ function Ot(e) {
1232
+ return Ot = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
1236
1233
  return n.__proto__ || Object.getPrototypeOf(n);
1237
- }, Mt(e);
1234
+ }, Ot(e);
1238
1235
  }
1239
1236
  function zt(e, n) {
1240
1237
  if (!(e instanceof n))
1241
1238
  throw new TypeError("Cannot call a class as a function");
1242
1239
  }
1243
- function he(e, n) {
1240
+ function ue(e, n) {
1244
1241
  for (var o = 0; o < n.length; o++) {
1245
1242
  var i = n[o];
1246
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(p, w) {
1247
- if (nt(p) !== "object" || p === null)
1248
- return p;
1249
- var x = p[Symbol.toPrimitive];
1243
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(g, w) {
1244
+ if (nt(g) !== "object" || g === null)
1245
+ return g;
1246
+ var x = g[Symbol.toPrimitive];
1250
1247
  if (x !== void 0) {
1251
- var b = x.call(p, w);
1248
+ var b = x.call(g, w);
1252
1249
  if (nt(b) !== "object")
1253
1250
  return b;
1254
1251
  throw new TypeError("@@toPrimitive must return a primitive value.");
1255
1252
  }
1256
- return String(p);
1253
+ return String(g);
1257
1254
  }(i.key, "string"), nt(h) === "symbol" ? h : String(h)), i);
1258
1255
  }
1259
1256
  var h;
1260
1257
  }
1261
1258
  function Lt(e, n, o) {
1262
- return n && he(e.prototype, n), o && he(e, o), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1259
+ return n && ue(e.prototype, n), o && ue(e, o), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1263
1260
  }
1264
1261
  var H = function() {
1265
1262
  function e() {
@@ -1275,42 +1272,42 @@ var Be = { exports: {} };
1275
1272
  return this.value;
1276
1273
  } }]), e;
1277
1274
  }(), St = function(e) {
1278
- Ft(o, e);
1279
- var n = Bt(o);
1275
+ qt(o, e);
1276
+ var n = Vt(o);
1280
1277
  function o() {
1281
1278
  return zt(this, o), n.apply(this, arguments);
1282
1279
  }
1283
1280
  return Lt(o);
1284
1281
  }(H), tt = function(e) {
1285
- Ft(o, e);
1286
- var n = Bt(o);
1282
+ qt(o, e);
1283
+ var n = Vt(o);
1287
1284
  function o() {
1288
1285
  return zt(this, o), n.apply(this, arguments);
1289
1286
  }
1290
1287
  return Lt(o);
1291
1288
  }(H), ft = function(e) {
1292
- Ft(o, e);
1293
- var n = Bt(o);
1289
+ qt(o, e);
1290
+ var n = Vt(o);
1294
1291
  function o() {
1295
1292
  return zt(this, o), n.apply(this, arguments);
1296
1293
  }
1297
1294
  return Lt(o);
1298
- }(H), Vt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, Ue = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, ue = /^[\xA0\u2011\u202F\u2060\uFEFF]/, Ye = /^(?:[;\xAD%?…]|,(?!\d))/, Xe = /^[´±°¢£¤$¥\u2212]/;
1295
+ }(H), Ut = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, Ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, de = /^[\xA0\u2011\u202F\u2060\uFEFF]/, Xe = /^(?:[;\xAD%?…]|,(?!\d))/, Ge = /^[´±°¢£¤$¥\u2212]/;
1299
1296
  function Ct(e, n) {
1300
1297
  n !== !1 && (e = e.trim());
1301
- for (var o, i, h = [], p = e.charAt(0), w = 0, x = 1, b = e.length; x < b; x++) {
1298
+ for (var o, i, h = [], g = e.charAt(0), w = 0, x = 1, b = e.length; x < b; x++) {
1302
1299
  o = e.charAt(x), i = e.charAt(x + 1);
1303
- var S = Vt.test(p), D = Vt.test(o), O = D || S, k = void 0;
1304
- if ((Xe.test(o) && !ue.test(p) || Ye.test(p + i) && !ue.test(o)) && (O = !0), p !== "-" && p !== "‐" && p !== "–" && p !== "—" || ((k = Vt.test(e.charAt(x - 2))) && !D && (O = !1), !k && Ue.test(o + i) && (O = !0)), O) {
1305
- var M = e.slice(w, x);
1306
- /\u00AD$/.test(M) ? (h.push(new H(M.slice(0, -1))), h.push(new ft())) : (h.push(new H(M)), h.push(new St())), w = x;
1300
+ var S = Ut.test(g), D = Ut.test(o), M = D || S, T = void 0;
1301
+ if ((Ge.test(o) && !de.test(g) || Xe.test(g + i) && !de.test(o)) && (M = !0), g !== "-" && g !== "‐" && g !== "–" && g !== "—" || ((T = Ut.test(e.charAt(x - 2))) && !D && (M = !1), !T && Ye.test(o + i) && (M = !0)), M) {
1302
+ var O = e.slice(w, x);
1303
+ /\u00AD$/.test(O) ? (h.push(new H(O.slice(0, -1))), h.push(new ft())) : (h.push(new H(O)), h.push(new St())), w = x;
1307
1304
  }
1308
- p = o;
1305
+ g = o;
1309
1306
  }
1310
1307
  return h.push(new H(e.slice(w))), h;
1311
1308
  }
1312
- const ce = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "­", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "‌", zwj: "‍", lrm: "‎", rlm: "‏", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
1313
- var Ge = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, We = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Ze = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, Ke = /^<!--(.+?)-->/, Je = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, de = { b: function(e) {
1309
+ const fe = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "­", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "‌", zwj: "‍", lrm: "‎", rlm: "‏", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
1310
+ var Ze = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, We = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Ke = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, Je = /^<!--(.+?)-->/, Qe = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, pe = { b: function(e) {
1314
1311
  e.weight = "bold";
1315
1312
  }, strong: function(e) {
1316
1313
  e.weight = "bold";
@@ -1336,26 +1333,26 @@ var Be = { exports: {} };
1336
1333
  e.sub = !0;
1337
1334
  }, sup: function(e) {
1338
1335
  e.sup = !0;
1339
- } }, Qe = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
1340
- function fe(e) {
1341
- return e.replace(Je, function(n, o, i, h) {
1336
+ } }, tn = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
1337
+ function ge(e) {
1338
+ return e.replace(Qe, function(n, o, i, h) {
1342
1339
  if (o || i) {
1343
- var p = o ? 10 : 16;
1344
- return String.fromCharCode(parseInt(o || i, p));
1340
+ var g = o ? 10 : 16;
1341
+ return String.fromCharCode(parseInt(o || i, g));
1345
1342
  }
1346
- return h in ce ? ce[h] : n;
1343
+ return h in fe ? fe[h] : n;
1347
1344
  });
1348
1345
  }
1349
- function tn(e) {
1346
+ function en(e) {
1350
1347
  return e && e.length > 1 && (e[0] === '"' && e[e.length - 1] === '"' || e[0] === "'" && e[e.length - 1] === "'") ? e.slice(1, -1) : e;
1351
1348
  }
1352
- var en = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1353
- function nn(e) {
1349
+ var nn = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1350
+ function rn(e) {
1354
1351
  var n, o = {};
1355
1352
  if (e) {
1356
1353
  do
1357
- if (n = en.exec(e)) {
1358
- var i = fe(tn(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1354
+ if (n = nn.exec(e)) {
1355
+ var i = ge(en(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1359
1356
  if (o[n[1]] = i, (e = e.slice(n[0].length)).length && /^\S/.test(e[0]))
1360
1357
  throw new Error("Attribute error");
1361
1358
  }
@@ -1365,8 +1362,8 @@ var Be = { exports: {} };
1365
1362
  }
1366
1363
  return o;
1367
1364
  }
1368
- const pe = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
1369
- var rn = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, sn = /^%[^\n]+(?:\n|$)/, on = /^[^#$%&~_^\\{}]+/, an = /^\\([&{}$%#_])/, ln = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, hn = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, V = { bf: function(e) {
1365
+ const ye = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
1366
+ var sn = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, on = /^%[^\n]+(?:\n|$)/, an = /^[^#$%&~_^\\{}]+/, ln = /^\\([&{}$%#_])/, hn = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, cn = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, V = { bf: function(e) {
1370
1367
  e.weight = "bold";
1371
1368
  }, it: function(e) {
1372
1369
  e.style = "italic";
@@ -1389,126 +1386,126 @@ var Be = { exports: {} };
1389
1386
  } };
1390
1387
  V.textsuperscript = V["^"], V.textsubscript = V._, V.textsl = V.sl, V.mathbf = V.bf, V.mathit = V.it, V.textbf = V.bf, V.textit = V.it, V.textcolor = V.color;
1391
1388
  var un = /[\r\n\xA0]+/g;
1392
- function cn(e, n) {
1389
+ function dn(e, n) {
1393
1390
  e.sup && (e.baseline = 0.45, e.size = 0.7), e.sub && (e.baseline = -0.3, e.size = 0.7);
1394
1391
  var o = n;
1395
- return (e.style || e.weight || e.baseline || e.color || e.size || e.family) && (o = E(n, e)), o;
1392
+ return (e.style || e.weight || e.baseline || e.color || e.size || e.family) && (o = k(n, e)), o;
1396
1393
  }
1397
- function ge(e, n, o) {
1398
- for (var i, h, p = e.width; p + o.width > n && e.length; )
1399
- h = (i = e[e.length - 1]).width, i.width > o.width ? (i.value = i.value.slice(0, -1), i.width = W(i, i.font), p += i.width) : e.pop(), p -= h;
1400
- e[e.length - 1] instanceof ft && e.pop(), i = e[e.length - 1] || i || {}, o.font = E(o.font, i.bold, i.italic, ""), o.href = e.length ? i.href : null, o.rel = e.length ? i.rel : null, o.target = e.length ? i.target : null, e.push(o);
1394
+ function me(e, n, o) {
1395
+ for (var i, h, g = e.width; g + o.width > n && e.length; )
1396
+ h = (i = e[e.length - 1]).width, i.width > o.width ? (i.value = i.value.slice(0, -1), i.width = Z(i, i.font), g += i.width) : e.pop(), g -= h;
1397
+ e[e.length - 1] instanceof ft && e.pop(), i = e[e.length - 1] || i || {}, o.font = k(o.font, i.bold, i.italic, ""), o.href = e.length ? i.href : null, o.rel = e.length ? i.rel : null, o.target = e.length ? i.target : null, e.push(o);
1401
1398
  }
1402
1399
  function mt(e) {
1403
1400
  return Math.round(1e6 * e) / 1e6;
1404
1401
  }
1405
- function ye(e) {
1402
+ function ve(e) {
1406
1403
  return function(n) {
1407
1404
  if (Array.isArray(n))
1408
- return Ut(n);
1405
+ return Yt(n);
1409
1406
  }(e) || function(n) {
1410
1407
  if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
1411
1408
  return Array.from(n);
1412
1409
  }(e) || function(n, o) {
1413
1410
  if (n) {
1414
1411
  if (typeof n == "string")
1415
- return Ut(n, o);
1412
+ return Yt(n, o);
1416
1413
  var i = Object.prototype.toString.call(n).slice(8, -1);
1417
- return i === "Object" && n.constructor && (i = n.constructor.name), i === "Map" || i === "Set" ? Array.from(n) : i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? Ut(n, o) : void 0;
1414
+ return i === "Object" && n.constructor && (i = n.constructor.name), i === "Map" || i === "Set" ? Array.from(n) : i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? Yt(n, o) : void 0;
1418
1415
  }
1419
1416
  }(e) || function() {
1420
1417
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1421
1418
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1422
1419
  }();
1423
1420
  }
1424
- function Ut(e, n) {
1421
+ function Yt(e, n) {
1425
1422
  (n == null || n > e.length) && (n = e.length);
1426
1423
  for (var o = 0, i = new Array(n); o < n; o++)
1427
1424
  i[o] = e[o];
1428
1425
  return i;
1429
1426
  }
1430
- var dn = { center: "middle", right: "end" }, fn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, Yt = function(e, n) {
1427
+ var fn = { center: "middle", right: "end" }, pn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, Xt = function(e, n) {
1431
1428
  return !e && !n || e === n;
1432
1429
  };
1433
- function pn(e, n) {
1434
- var o = [], i = n.font(), h = i.size, p = i.family, w = n.align(), x = n.createElement();
1430
+ function gn(e, n) {
1431
+ var o = [], i = n.font(), h = i.size, g = i.family, w = n.align(), x = n.createElement();
1435
1432
  if (e.length) {
1436
- var b = i.height, S = n.valign(), D = n.height()(), O = n.width()(0), k = !isFinite(O) && e.length === 1, M = k ? null : n.x(), R = mt(b / h), K = k ? null : mt(b / (1.15 * h + (b - h) / 2));
1437
- if (fn[S] && isFinite(D)) {
1438
- var P = S === "bottom" ? 1 : 0.5;
1439
- K += (D * P - b * e.length * P) / h;
1433
+ var b = i.height, S = n.valign(), D = n.height()(), M = n.width()(0), T = !isFinite(M) && e.length === 1, O = T ? null : n.x(), R = mt(b / h), K = T ? null : mt(b / (1.15 * h + (b - h) / 2));
1434
+ if (pn[S] && isFinite(D)) {
1435
+ var $ = S === "bottom" ? 1 : 0.5;
1436
+ K += (D * $ - b * e.length * $) / h;
1440
1437
  }
1441
- var L = w === "justify", j = 0;
1442
- w === "right" ? j = O : w === "center" && (j = O / 2);
1443
- for (var $ = [], J = "tspan", Y = null, F = "", I = function() {
1444
- if (F) {
1445
- var pt = x(J, Y, F);
1446
- $.push(pt);
1438
+ var L = w === "justify", F = 0;
1439
+ w === "right" ? F = M : w === "center" && (F = M / 2);
1440
+ for (var N = [], J = "tspan", Y = null, j = "", _ = function() {
1441
+ if (j) {
1442
+ var pt = x(J, Y, j);
1443
+ N.push(pt);
1447
1444
  }
1448
- J = "tspan", Y = null, F = "";
1445
+ J = "tspan", Y = null, j = "";
1449
1446
  }, et = 0, Q = e.length; et < Q; et++) {
1450
- var ot = "", ht = "", st = 0, at = e[et];
1447
+ var ot = "", ct = "", st = 0, at = e[et];
1451
1448
  if (at.length) {
1452
- $ = [];
1453
- for (var vt = 0, kt = 0, lt = void 0, X = 0, Pt = at.length; X < Pt; X++) {
1449
+ N = [];
1450
+ for (var vt = 0, kt = 0, lt = void 0, X = 0, $t = at.length; X < $t; X++) {
1454
1451
  var q = at[X], G = q.font;
1455
- q.whitespace && vt++, kt += q.width, X && !q.tracking && !st && Yt(G.id, ot) && Yt(q.class, ht) && Yt(lt, q.href) ? F += q.value : (I(), F = q.value, Y = { fontFamily: G.family !== p ? G.family : null, fontSize: G.size !== h ? G.size : null, fontWeight: G.weight || null, fontStyle: G.style || null, fontVariant: G.variant !== "normal" && G.variant || null, fill: G.color || null, baselineShift: G.baseline ? 100 * G.baseline + "%" : null, className: q.class || null }, st && (Y.dx = mt(st), st = 0), q.tracking && (st = G.size * q.tracking), q.href && !lt ? (lt = q.href, J = "a", Y.href = lt, Y.rel = q.rel, Y.target = q.target) : lt = null, ot = G.id, ht = q.class);
1452
+ q.whitespace && vt++, kt += q.width, X && !q.tracking && !st && Xt(G.id, ot) && Xt(q.class, ct) && Xt(lt, q.href) ? j += q.value : (_(), j = q.value, Y = { fontFamily: G.family !== g ? G.family : null, fontSize: G.size !== h ? G.size : null, fontWeight: G.weight || null, fontStyle: G.style || null, fontVariant: G.variant !== "normal" && G.variant || null, fill: G.color || null, baselineShift: G.baseline ? 100 * G.baseline + "%" : null, className: q.class || null }, st && (Y.dx = mt(st), st = 0), q.tracking && (st = G.size * q.tracking), q.href && !lt ? (lt = q.href, J = "a", Y.href = lt, Y.rel = q.rel, Y.target = q.target) : lt = null, ot = G.id, ct = q.class);
1456
1453
  }
1457
- if (I(), k)
1458
- o.push.apply(o, ye($));
1454
+ if (_(), T)
1455
+ o.push.apply(o, ve(N));
1459
1456
  else {
1460
- var Nt = null, Tt = et === Q - 1 || at[at.length - 1] instanceof tt;
1461
- L && at.length > 1 && !Tt && (Nt = mt((O - kt) / vt)), o.push(x.apply(void 0, ["tspan", { wordSpacing: Nt, x: M(et) + j, dy: mt(et ? R : K) + "em" }].concat(ye($))));
1457
+ var Pt = null, Tt = et === Q - 1 || at[at.length - 1] instanceof tt;
1458
+ L && at.length > 1 && !Tt && (Pt = mt((M - kt) / vt)), o.push(x.apply(void 0, ["tspan", { wordSpacing: Pt, x: O(et) + F, dy: mt(et ? R : K) + "em" }].concat(ve(N))));
1462
1459
  }
1463
1460
  } else
1464
- o.push(x("tspan", { x: M(et), dy: mt(et ? R : K) + "em" }, " "));
1461
+ o.push(x("tspan", { x: O(et), dy: mt(et ? R : K) + "em" }, " "));
1465
1462
  }
1466
1463
  }
1467
- return x.apply(void 0, ["text", { fontFamily: p, fontSize: h, textAnchor: dn[w] || "start" }].concat(o));
1464
+ return x.apply(void 0, ["text", { fontFamily: g, fontSize: h, textAnchor: fn[w] || "start" }].concat(o));
1468
1465
  }
1469
- var gn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1470
- function yn(e, n, o) {
1466
+ var yn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1467
+ function mn(e, n, o) {
1471
1468
  if (e.length) {
1472
1469
  o.textBaseline = "middle";
1473
- var i = n.font(), h = i.height, p = i.size, w = n.valign(), x = n.height()(), b = n.width()(0), S = n.align(), D = S === "justify", O = 0.5 * h, k = gn[w];
1474
- if (k && isFinite(x)) {
1475
- var M = e.length * h;
1476
- O += x * k - M * k;
1470
+ var i = n.font(), h = i.height, g = i.size, w = n.valign(), x = n.height()(), b = n.width()(0), S = n.align(), D = S === "justify", M = 0.5 * h, T = yn[w];
1471
+ if (T && isFinite(x)) {
1472
+ var O = e.length * h;
1473
+ M += x * T - O * T;
1477
1474
  }
1478
1475
  e.forEach(function(R, K) {
1479
- var P = n.x()(K), L = K * h + O, j = 0, $ = 0;
1480
- R.forEach(function(F) {
1481
- F.whitespace && j++, $ += F.width;
1476
+ var $ = n.x()(K), L = K * h + M, F = 0, N = 0;
1477
+ R.forEach(function(j) {
1478
+ j.whitespace && F++, N += j.width;
1482
1479
  });
1483
1480
  var J = 0, Y = K === e.length - 1 || R[R.length - 1] instanceof tt;
1484
- D && R.length > 1 && !Y && (J = (b - $) / j), R.forEach(function(F) {
1485
- o.font = F.font;
1486
- var I = F.font, et = I.baseline ? p * -I.baseline + 0.15 * p : 0;
1487
- o.fillStyle = function(ht, st) {
1488
- return ht.color ? ht.color : st.href ? "#00C" : "#000";
1489
- }(I, F);
1481
+ D && R.length > 1 && !Y && (J = (b - N) / F), R.forEach(function(j) {
1482
+ o.font = j.font;
1483
+ var _ = j.font, et = _.baseline ? g * -_.baseline + 0.15 * g : 0;
1484
+ o.fillStyle = function(ct, st) {
1485
+ return ct.color ? ct.color : st.href ? "#00C" : "#000";
1486
+ }(_, j);
1490
1487
  var Q = 0;
1491
- if (S === "right" ? Q += b - $ : S === "center" ? Q += b / 2 - $ / 2 : S === "justify" && (F.whitespace || F instanceof tt) && (P += J), o.fillText(F.value, P + Q, L + et), F.href) {
1488
+ if (S === "right" ? Q += b - N : S === "center" ? Q += b / 2 - N / 2 : S === "justify" && (j.whitespace || j instanceof tt) && ($ += J), o.fillText(j.value, $ + Q, L + et), j.href) {
1492
1489
  o.beginPath(), o.strokeStyle = o.fillStyle;
1493
- var ot = Math.floor(L + 0.45 * p) + 0.5;
1494
- o.moveTo(P + Q, ot), o.lineTo(P + Q + F.width, ot), o.stroke();
1490
+ var ot = Math.floor(L + 0.45 * g) + 0.5;
1491
+ o.moveTo($ + Q, ot), o.lineTo($ + Q + j.width, ot), o.stroke();
1495
1492
  }
1496
- P += F.width;
1493
+ $ += j.width;
1497
1494
  });
1498
1495
  });
1499
1496
  }
1500
1497
  }
1501
- function Xt(e) {
1502
- return Xt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1498
+ function Gt(e) {
1499
+ return Gt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1503
1500
  return typeof n;
1504
1501
  } : function(n) {
1505
1502
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1506
- }, Xt(e);
1503
+ }, Gt(e);
1507
1504
  }
1508
- function me(e) {
1505
+ function xe(e) {
1509
1506
  for (var n = {}, o = 0; o < e.length; o++) {
1510
1507
  var i = e[o];
1511
- typeof i != "number" && i != null && (typeof i == "string" ? n.text = i : typeof i == "function" ? n.fn = i : Xt(i) === "object" && i._groups ? n.d3 = i : i && i.nodeType && i.getContext ? n.ctx = i.getContext("2d") : i && i.fillText && i.beginPath ? n.ctx = i : i && (n.text = i));
1508
+ typeof i != "number" && i != null && (typeof i == "string" ? n.text = i : typeof i == "function" ? n.fn = i : Gt(i) === "object" && i._groups ? n.d3 = i : i && i.nodeType && i.getContext ? n.ctx = i.getContext("2d") : i && i.fillText && i.beginPath ? n.ctx = i : i && (n.text = i));
1512
1509
  }
1513
1510
  return n;
1514
1511
  }
@@ -1519,32 +1516,32 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1519
1516
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1520
1517
  }, At(e);
1521
1518
  }
1522
- function mn(e, n) {
1519
+ function vn(e, n) {
1523
1520
  for (var o = 0; o < n.length; o++) {
1524
1521
  var i = n[o];
1525
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(p, w) {
1526
- if (At(p) !== "object" || p === null)
1527
- return p;
1528
- var x = p[Symbol.toPrimitive];
1522
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(g, w) {
1523
+ if (At(g) !== "object" || g === null)
1524
+ return g;
1525
+ var x = g[Symbol.toPrimitive];
1529
1526
  if (x !== void 0) {
1530
- var b = x.call(p, w);
1527
+ var b = x.call(g, w);
1531
1528
  if (At(b) !== "object")
1532
1529
  return b;
1533
1530
  throw new TypeError("@@toPrimitive must return a primitive value.");
1534
1531
  }
1535
- return String(p);
1532
+ return String(g);
1536
1533
  }(i.key, "string"), At(h) === "symbol" ? h : String(h)), i);
1537
1534
  }
1538
1535
  var h;
1539
1536
  }
1540
- var vn = E(), Gt = function(e) {
1537
+ var xn = k(), Zt = function(e) {
1541
1538
  return typeof e == "function" ? e : function() {
1542
1539
  return e;
1543
1540
  };
1544
1541
  }, it = function() {
1545
1542
  function e(i) {
1546
- if (function(p, w) {
1547
- if (!(p instanceof w))
1543
+ if (function(g, w) {
1544
+ if (!(g instanceof w))
1548
1545
  throw new TypeError("Cannot call a class as a function");
1549
1546
  }(this, e), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
1550
1547
  return 1 / 0;
@@ -1558,80 +1555,80 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1558
1555
  }
1559
1556
  var n, o;
1560
1557
  return n = e, o = [{ key: "linebreak", value: function(i) {
1561
- var h = this, p = this.props.parser(String(i)), w = this.font(), x = function(b, S, D) {
1558
+ var h = this, g = this.props.parser(String(i)), w = this.font(), x = function(b, S, D) {
1562
1559
  if (!b.length)
1563
1560
  return [];
1564
- var O = S.height(), k = S.width(), M = S.overflowLine(), R = S.overflowWrap(), K = E(D, !0, !1), P = isFinite(O()) ? Math.floor(O() / D.height) : 1 / 0;
1565
- if (!O() && !k(0) || !P)
1561
+ var M = S.height(), T = S.width(), O = S.overflowLine(), R = S.overflowWrap(), K = k(D, !0, !1), $ = isFinite(M()) ? Math.floor(M() / D.height) : 1 / 0;
1562
+ if (!M() && !T(0) || !$)
1566
1563
  return [];
1567
- for (var L = 0, j = 0, $ = 0, J = [], Y = [], F = !1; L < b.length && j < P; ) {
1568
- var I = b[L], et = cn(I, D);
1569
- if (I.width = W(I, et), I.font = et, I.line = j, I.whitespace = I.value in C, I.value && (I.value = I.value.replace(un, " ")), !(!$ && I.whitespace || F && I.whitespace))
1570
- if (I instanceof tt)
1571
- $ = 0, Y = [], J.push(L + 1), j++;
1572
- else if (I instanceof St || I instanceof ft)
1573
- Y.push({ index: L, width: $ });
1574
- else if (I.whitespace || $ + I.width < k(j))
1575
- $ += I.width;
1564
+ for (var L = 0, F = 0, N = 0, J = [], Y = [], j = !1; L < b.length && F < $; ) {
1565
+ var _ = b[L], et = dn(_, D);
1566
+ if (_.width = Z(_, et), _.font = et, _.line = F, _.whitespace = _.value in C, _.value && (_.value = _.value.replace(un, " ")), !(!N && _.whitespace || j && _.whitespace))
1567
+ if (_ instanceof tt)
1568
+ N = 0, Y = [], J.push(L + 1), F++;
1569
+ else if (_ instanceof St || _ instanceof ft)
1570
+ Y.push({ index: L, width: N });
1571
+ else if (_.whitespace || N + _.width < T(F))
1572
+ N += _.width;
1576
1573
  else if (Y.length) {
1577
1574
  var Q = void 0, ot = void 0;
1578
1575
  do {
1579
1576
  ot = !0, Q = Y.pop();
1580
- var ht = b[Q.index], st = void 0;
1581
- ht instanceof ft && (st = W("-", ht.font), Q.width + st > k(j) && (ot = !Y.length));
1577
+ var ct = b[Q.index], st = void 0;
1578
+ ct instanceof ft && (st = Z("-", ct.font), Q.width + st > T(F) && (ot = !Y.length));
1582
1579
  } while (!ot);
1583
- J.push(Q.index + 1), $ = 0, j++, L = Q.index, Y = [];
1580
+ J.push(Q.index + 1), N = 0, F++, L = Q.index, Y = [];
1584
1581
  } else if (R === "break-word") {
1585
- var at = k(j);
1586
- if ($ + I.width > at) {
1587
- var vt = I.clone();
1582
+ var at = T(F);
1583
+ if (N + _.width > at) {
1584
+ var vt = _.clone();
1588
1585
  do
1589
- I.value = I.value.slice(0, -1), I.width = W(I, I.font), $ += I.width;
1590
- while (I.value && I.width > at);
1591
- vt.value = vt.value.slice(I.value.length), b.splice(L + 1, 0, new St(), vt);
1586
+ _.value = _.value.slice(0, -1), _.width = Z(_, _.font), N += _.width;
1587
+ while (_.value && _.width > at);
1588
+ vt.value = vt.value.slice(_.value.length), b.splice(L + 1, 0, new St(), vt);
1592
1589
  }
1593
- J.push(L + 1), $ = 0, j++;
1590
+ J.push(L + 1), N = 0, F++;
1594
1591
  } else
1595
- $ += I.width;
1596
- L++, F = I.whitespace;
1592
+ N += _.width;
1593
+ L++, j = _.whitespace;
1597
1594
  }
1598
1595
  L !== J[J.length - 1] && J.push(L);
1599
1596
  var kt = 0, lt = 0, X = J.map(function(pt) {
1600
- for (var Z, gt = kt; (Z = b[gt]) && (Z.whitespace || !Z.value); )
1597
+ for (var W, gt = kt; (W = b[gt]) && (W.whitespace || !W.value); )
1601
1598
  gt++;
1602
- for (var ut = pt, Kt = null; ut > gt && (Z = b[ut - 1]) && (Z.whitespace || !(Z.value || Z instanceof ft)); )
1603
- Z instanceof tt && (Kt = Z), ut--;
1604
- Z instanceof ft && (Z.value = "-", Z.width = W("-", Z.font)), kt = pt;
1605
- var xt = b.slice(gt, ut).filter(function(Jt) {
1606
- return Jt.value;
1599
+ for (var ut = pt, Jt = null; ut > gt && (W = b[ut - 1]) && (W.whitespace || !(W.value || W instanceof ft)); )
1600
+ W instanceof tt && (Jt = W), ut--;
1601
+ W instanceof ft && (W.value = "-", W.width = Z("-", W.font)), kt = pt;
1602
+ var xt = b.slice(gt, ut).filter(function(Qt) {
1603
+ return Qt.value;
1607
1604
  });
1608
- return Kt && xt.push(Kt), xt.width = xt.reduce(function(Jt, An) {
1609
- return Jt + An.width;
1605
+ return Jt && xt.push(Jt), xt.width = xt.reduce(function(Qt, En) {
1606
+ return Qt + En.width;
1610
1607
  }, 0), xt.width > lt && (lt = xt.width), xt;
1611
1608
  });
1612
- if (X.hasLineOverflow = !1, M) {
1613
- var Pt = M === "ellipsis" ? "…" : M;
1614
- X.forEach(function(pt, Z) {
1615
- var gt = k(Z);
1609
+ if (X.hasLineOverflow = !1, O) {
1610
+ var $t = O === "ellipsis" ? "…" : O;
1611
+ X.forEach(function(pt, W) {
1612
+ var gt = T(W);
1616
1613
  if (pt.width > gt) {
1617
- var ut = new H(Pt);
1618
- ut.font = D, ut.width = W(Pt, K), ge(pt, gt, ut), X.hasLineOverflow = !0;
1614
+ var ut = new H($t);
1615
+ ut.font = D, ut.width = Z($t, K), me(pt, gt, ut), X.hasLineOverflow = !0;
1619
1616
  }
1620
1617
  });
1621
1618
  }
1622
1619
  var q = S.overflow() === "ellipsis" ? "…" : S.overflow();
1623
1620
  if (q && L !== b.length) {
1624
- var G = k(X.length - 1), Nt = X[X.length - 1], Tt = new H(q);
1625
- Tt.font = D, Tt.width = W(q, K), ge(Nt, G, Tt), X.hasOverflow = !0;
1621
+ var G = T(X.length - 1), Pt = X[X.length - 1], Tt = new H(q);
1622
+ Tt.font = D, Tt.width = Z(q, K), me(Pt, G, Tt), X.hasOverflow = !0;
1626
1623
  } else
1627
1624
  X.hasOverflow = !1;
1628
1625
  return X.font = D, X.width = lt, X;
1629
- }(p, this, w);
1626
+ }(g, this, w);
1630
1627
  return x.height = x.length * w.height, x.render = function(b) {
1631
1628
  return h.render(x, b);
1632
1629
  }, x.svg = x.render, x.draw = x.render, x;
1633
1630
  } }, { key: "font", value: function(i) {
1634
- return arguments.length ? (this.props.font = E(i), this) : this.props.font || E(vn);
1631
+ return arguments.length ? (this.props.font = k(i), this) : this.props.font || k(xn);
1635
1632
  } }, { key: "overflow", value: function(i) {
1636
1633
  return arguments.length ? (this.props.overflow = String(i), this) : this.props.overflow;
1637
1634
  } }, { key: "overflowLine", value: function(i) {
@@ -1649,11 +1646,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1649
1646
  var h = String(i).toLowerCase();
1650
1647
  return h === "break-word" ? this.props.overflowWrap = "break-word" : h !== "normal" && i != null || (this.props.overflowWrap = null), this;
1651
1648
  } }, { key: "width", value: function(i) {
1652
- return arguments.length ? (this.props.width = Gt(i), this) : this.props.width;
1649
+ return arguments.length ? (this.props.width = Zt(i), this) : this.props.width;
1653
1650
  } }, { key: "height", value: function(i) {
1654
- return arguments.length ? (this.props.height = Gt(i), this) : this.props.height;
1651
+ return arguments.length ? (this.props.height = Zt(i), this) : this.props.height;
1655
1652
  } }, { key: "x", value: function(i) {
1656
- return arguments.length ? (this.props.x = Gt(i), this) : this.props.x;
1653
+ return arguments.length ? (this.props.x = Zt(i), this) : this.props.x;
1657
1654
  } }, { key: "parser", value: function(i) {
1658
1655
  if (!arguments.length)
1659
1656
  return this.props.parser;
@@ -1667,9 +1664,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1667
1664
  } }, { key: "createElement", value: function(i) {
1668
1665
  return arguments.length ? (this.props.createElement = i, this) : this.props.createElement || e.createElement;
1669
1666
  } }, { key: "render", value: function() {
1670
- var i = me(arguments);
1671
- return typeof i.text == "string" && (i.text = this.linebreak(i.text)), i.ctx ? yn(i.text, this, i.ctx) : pn(i.text, this);
1672
- } }], o && mn(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1667
+ var i = xe(arguments);
1668
+ return typeof i.text == "string" && (i.text = this.linebreak(i.text)), i.ctx ? mn(i.text, this, i.ctx) : gn(i.text, this);
1669
+ } }], o && vn(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1673
1670
  }();
1674
1671
  function Et(e) {
1675
1672
  return Et = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
@@ -1684,32 +1681,32 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1684
1681
  i[o] = e[o];
1685
1682
  return i;
1686
1683
  }
1687
- function xn(e, n) {
1684
+ function wn(e, n) {
1688
1685
  for (var o = 0; o < n.length; o++) {
1689
1686
  var i = n[o];
1690
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(p, w) {
1691
- if (Et(p) !== "object" || p === null)
1692
- return p;
1693
- var x = p[Symbol.toPrimitive];
1687
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(g, w) {
1688
+ if (Et(g) !== "object" || g === null)
1689
+ return g;
1690
+ var x = g[Symbol.toPrimitive];
1694
1691
  if (x !== void 0) {
1695
- var b = x.call(p, w);
1692
+ var b = x.call(g, w);
1696
1693
  if (Et(b) !== "object")
1697
1694
  return b;
1698
1695
  throw new TypeError("@@toPrimitive must return a primitive value.");
1699
1696
  }
1700
- return String(p);
1697
+ return String(g);
1701
1698
  }(i.key, "string"), Et(h) === "symbol" ? h : String(h)), i);
1702
1699
  }
1703
1700
  var h;
1704
1701
  }
1705
- var ve = function(e) {
1702
+ var we = function(e) {
1706
1703
  return typeof e == "function" ? e : function() {
1707
1704
  return e;
1708
1705
  };
1709
- }, xe = function() {
1706
+ }, be = function() {
1710
1707
  function e(i) {
1711
- if (function(p, w) {
1712
- if (!(p instanceof w))
1708
+ if (function(g, w) {
1709
+ if (!(g instanceof w))
1713
1710
  throw new TypeError("Cannot call a class as a function");
1714
1711
  }(this, e), this.props = { width: function() {
1715
1712
  return 1 / 0;
@@ -1722,9 +1719,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1722
1719
  }
1723
1720
  var n, o;
1724
1721
  return n = e, o = [{ key: "anchor", value: function(i) {
1725
- var h = this.props, p = h.hAnchor, w = h.vAnchor, x = h.width, b = h.height;
1722
+ var h = this.props, g = h.hAnchor, w = h.vAnchor, x = h.width, b = h.height;
1726
1723
  if (!arguments.length)
1727
- return [p * x(0), w * b(0)];
1724
+ return [g * x(0), w * b(0)];
1728
1725
  if (typeof i == "string") {
1729
1726
  var S = this.props;
1730
1727
  i.toLowerCase().trim().split(/\s+/).forEach(function(D) {
@@ -1733,34 +1730,34 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1733
1730
  }
1734
1731
  return this;
1735
1732
  } }, { key: "width", value: function(i) {
1736
- return arguments.length ? (this.props.width = ve(i), this) : this.props.width;
1733
+ return arguments.length ? (this.props.width = we(i), this) : this.props.width;
1737
1734
  } }, { key: "height", value: function(i) {
1738
- return arguments.length ? (this.props.height = ve(i), this) : this.props.height;
1735
+ return arguments.length ? (this.props.height = we(i), this) : this.props.height;
1739
1736
  } }, { key: "rotate", value: function(i) {
1740
1737
  return arguments.length ? (this.props.rotation = i, this) : this.props.rotation;
1741
1738
  } }, { key: "createElement", value: function(i) {
1742
1739
  return arguments.length ? (this.props.createElement = i, this) : this.props.createElement || e.createElement;
1743
1740
  } }, { key: "canvas", value: function(i, h) {
1744
- var p, w = i.getContext ? i.getContext("2d") : i;
1741
+ var g, w = i.getContext ? i.getContext("2d") : i;
1745
1742
  return w.save(), w.rotate(this.rotate() * Math.PI / 180), w.translate.apply(w, function(x) {
1746
1743
  if (Array.isArray(x))
1747
1744
  return Wt(x);
1748
- }(p = this.anchor()) || function(x) {
1745
+ }(g = this.anchor()) || function(x) {
1749
1746
  if (typeof Symbol < "u" && x[Symbol.iterator] != null || x["@@iterator"] != null)
1750
1747
  return Array.from(x);
1751
- }(p) || function(x, b) {
1748
+ }(g) || function(x, b) {
1752
1749
  if (x) {
1753
1750
  if (typeof x == "string")
1754
1751
  return Wt(x, b);
1755
1752
  var S = Object.prototype.toString.call(x).slice(8, -1);
1756
1753
  return S === "Object" && x.constructor && (S = x.constructor.name), S === "Map" || S === "Set" ? Array.from(x) : S === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S) ? Wt(x, b) : void 0;
1757
1754
  }
1758
- }(p) || function() {
1755
+ }(g) || function() {
1759
1756
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1760
1757
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1761
1758
  }()), h(w), w.restore(), w;
1762
1759
  } }, { key: "render", value: function() {
1763
- var i = me(arguments);
1760
+ var i = xe(arguments);
1764
1761
  if (i.d3)
1765
1762
  return i.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
1766
1763
  if (i.ctx)
@@ -1769,59 +1766,59 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1769
1766
  var h = typeof i.text.render == "function" ? i.text.render() : i.text;
1770
1767
  return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, h);
1771
1768
  }
1772
- } }], o && xn(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1773
- }(), wn = Object.prototype.hasOwnProperty, Zt = {};
1774
- function bn(e) {
1775
- return Zt[e] || (Zt[e] = e.replace(/([a-z])([A-Z])/g, function(n, o, i) {
1769
+ } }], o && wn(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1770
+ }(), bn = Object.prototype.hasOwnProperty, Kt = {};
1771
+ function Sn(e) {
1772
+ return Kt[e] || (Kt[e] = e.replace(/([a-z])([A-Z])/g, function(n, o, i) {
1776
1773
  return o + "-" + i.toLowerCase();
1777
- })), Zt[e];
1774
+ })), Kt[e];
1778
1775
  }
1779
- function we(e, n) {
1776
+ function Se(e, n) {
1780
1777
  if (Array.isArray(n))
1781
1778
  return n.forEach(function(o) {
1782
- return we(e, o);
1779
+ return Se(e, o);
1783
1780
  });
1784
1781
  typeof n == "string" && (n = document.createTextNode(n)), e.appendChild(n);
1785
1782
  }
1786
- function be(e, n) {
1783
+ function Ae(e, n) {
1787
1784
  if (typeof document < "u") {
1788
1785
  var o = typeof e == "string" ? document.createElementNS("http://www.w3.org/2000/svg", e) : e;
1789
1786
  if (n && o.setAttribute)
1790
1787
  for (var i in n)
1791
- wn.call(n, i) && n[i] != null && o.setAttribute(i === "className" ? "class" : bn(i), n[i]);
1792
- for (var h = arguments.length, p = new Array(h > 2 ? h - 2 : 0), w = 2; w < h; w++)
1793
- p[w - 2] = arguments[w];
1794
- return p != null && p.length && p.forEach(function(x) {
1795
- we(o, x);
1788
+ bn.call(n, i) && n[i] != null && o.setAttribute(i === "className" ? "class" : Sn(i), n[i]);
1789
+ for (var h = arguments.length, g = new Array(h > 2 ? h - 2 : 0), w = 2; w < h; w++)
1790
+ g[w - 2] = arguments[w];
1791
+ return g != null && g.length && g.forEach(function(x) {
1792
+ Se(o, x);
1796
1793
  }), o;
1797
1794
  }
1798
1795
  }
1799
- it.createElement = be, it.textparser = Ct, it.defaultparser = Ct, it.htmlparser = function(e) {
1796
+ it.createElement = Ae, it.textparser = Ct, it.defaultparser = Ct, it.htmlparser = function(e) {
1800
1797
  e = String(e || "").trim();
1801
- for (var n, o, i = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, h = [], p = [], w = function(O) {
1802
- for (var k in i)
1803
- i[k] && (O[k] = i[k]);
1804
- h.push(O);
1805
- }, x = function(O) {
1806
- var k = h.length, M = Qe[O];
1807
- if (k && M) {
1808
- for (var R = k - 1; h[R] && (h[R] instanceof St || Ge.test(h[R].value)); )
1798
+ for (var n, o, i = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, h = [], g = [], w = function(M) {
1799
+ for (var T in i)
1800
+ i[T] && (M[T] = i[T]);
1801
+ h.push(M);
1802
+ }, x = function(M) {
1803
+ var T = h.length, O = tn[M];
1804
+ if (T && O) {
1805
+ for (var R = T - 1; h[R] && (h[R] instanceof St || Ze.test(h[R].value)); )
1809
1806
  R--;
1810
- for (; M && h[R] && h[R] instanceof tt; )
1811
- R--, M--;
1812
- for (; M-- > 0; )
1807
+ for (; O && h[R] && h[R] instanceof tt; )
1808
+ R--, O--;
1809
+ for (; O-- > 0; )
1813
1810
  h.push(new tt());
1814
1811
  }
1815
1812
  }; e.length; ) {
1816
1813
  if (n = /^[^<]+/.exec(e))
1817
- Ct(fe(n[0]), !1).forEach(w);
1818
- else if (!(n = Ke.exec(e)))
1814
+ Ct(ge(n[0]), !1).forEach(w);
1815
+ else if (!(n = Je.exec(e)))
1819
1816
  if (n = We.exec(e))
1820
- p.length && (i = p.pop()), x(n[1]);
1821
- else if (n = Ze.exec(e)) {
1817
+ g.length && (i = g.pop()), x(n[1]);
1818
+ else if (n = Ke.exec(e)) {
1822
1819
  var b = n[1];
1823
- x(b), p.push(i), i = Object.create(i), de[b] && de[b](i, "");
1824
- var S = nn(n[2]);
1820
+ x(b), g.push(i), i = Object.create(i), pe[b] && pe[b](i, "");
1821
+ var S = rn(n[2]);
1825
1822
  b === "a" && (S.href && (i.href = S.href), S.rel && (i.rel = S.rel), S.target && (i.target = S.target)), S.class && (i.class = i.class ? i.class + " " + S.class : S.class), S.style && (o = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(S.style)) && o[1] && (i.color = o[1]), b === "br" && h.push(new tt());
1826
1823
  } else
1827
1824
  n = [e.slice(0, 1)], w(new H(n[0]));
@@ -1833,37 +1830,37 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1833
1830
  }, it.latexparser = function(e) {
1834
1831
  e = String(e || "").trim();
1835
1832
  var n = [0];
1836
- e = e.replace(/\\verb,(.*?),/, function(P, L) {
1833
+ e = e.replace(/\\verb,(.*?),/, function($, L) {
1837
1834
  return n.push(L), "\\verb," + (n.length - 1) + ",";
1838
1835
  }).replace(/\\\\\n/g, function() {
1839
1836
  return "\\\\";
1840
- }).replace(ln, function(P, L, j) {
1841
- return j.charAt(L - 1) === "\\" ? P : hn[P];
1842
- }).replace(/\n\s+/g, function(P) {
1843
- return /\n/.test(P.slice(1)) ? "\\par " : P;
1844
- }).replace(/\\symbol\{(\d+)\}/, function(P, L, j, $) {
1845
- return $.charAt(j - 1) === "\\" ? P : String.fromCharCode(1 * L);
1846
- }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(P, L, j, $) {
1847
- return L + j + "{" + $ + "}";
1848
- }).replace(/\\verb,(.*?),/, function(P, L) {
1837
+ }).replace(hn, function($, L, F) {
1838
+ return F.charAt(L - 1) === "\\" ? $ : cn[$];
1839
+ }).replace(/\n\s+/g, function($) {
1840
+ return /\n/.test($.slice(1)) ? "\\par " : $;
1841
+ }).replace(/\\symbol\{(\d+)\}/, function($, L, F, N) {
1842
+ return N.charAt(F - 1) === "\\" ? $ : String.fromCharCode(1 * L);
1843
+ }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function($, L, F, N) {
1844
+ return L + F + "{" + N + "}";
1845
+ }).replace(/\\verb,(.*?),/, function($, L) {
1849
1846
  return "\\verb,".concat(n[+L], ",");
1850
1847
  });
1851
- for (var o, i = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, h = [], p = [], w = function(P) {
1848
+ for (var o, i = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, h = [], g = [], w = function($) {
1852
1849
  for (var L in i)
1853
- i[L] && (P[L] = i[L]);
1854
- return h.push(P), P;
1850
+ i[L] && ($[L] = i[L]);
1851
+ return h.push($), $;
1855
1852
  }, x = function() {
1856
- p.push(i), i = Object.create(i);
1853
+ g.push(i), i = Object.create(i);
1857
1854
  }, b = function() {
1858
- if (!p.length)
1855
+ if (!g.length)
1859
1856
  throw new Error("Unexpected }");
1860
- i = p.pop();
1857
+ i = g.pop();
1861
1858
  }, S = { tokens: h, open_context: x, close_context: b, add_token: w }; e.length; ) {
1862
- if (o = on.exec(e))
1859
+ if (o = an.exec(e))
1863
1860
  Ct(o[0], !1).forEach(w);
1864
- else if (o = an.exec(e))
1861
+ else if (o = ln.exec(e))
1865
1862
  w(new H(o[1]));
1866
- else if (!(o = sn.exec(e))) {
1863
+ else if (!(o = on.exec(e))) {
1867
1864
  if (o = /^\{/.exec(e))
1868
1865
  x();
1869
1866
  else if (o = /^\}/.exec(e))
@@ -1871,27 +1868,27 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1871
1868
  else if (!(o = /^\$/.exec(e)))
1872
1869
  if (o = /^\\verb,([^,]+),/.exec(e))
1873
1870
  w(new H(o[1]));
1874
- else if (o = rn.exec(e)) {
1875
- var D = o[1].slice(1) || o[1], O = !!o[2];
1871
+ else if (o = sn.exec(e)) {
1872
+ var D = o[1].slice(1) || o[1], M = !!o[2];
1876
1873
  if (/^(La)?TeX$/i.test(D)) {
1877
1874
  x(), i.family = "serif";
1878
- var k = void 0;
1879
- D === "LaTeX" && ((k = w(new H("L"))).tracking = -0.25, (k = w(new H("A"))).size = 0.7, k.baseline = 0.3, k.tracking = -0.1), (k = w(new H("T"))).tracking = -0.17, (k = w(new H("E"))).baseline = -0.22, k.tracking = -0.13, k = w(new H("X")), b();
1880
- } else if (D in pe)
1881
- w(new H(pe[D])), O && x();
1875
+ var T = void 0;
1876
+ D === "LaTeX" && ((T = w(new H("L"))).tracking = -0.25, (T = w(new H("A"))).size = 0.7, T.baseline = 0.3, T.tracking = -0.1), (T = w(new H("T"))).tracking = -0.17, (T = w(new H("E"))).baseline = -0.22, T.tracking = -0.13, T = w(new H("X")), b();
1877
+ } else if (D in ye)
1878
+ w(new H(ye[D])), M && x();
1882
1879
  else if (D in V) {
1883
- var M = [], R = V[D].length - 1, K = void 0;
1880
+ var O = [], R = V[D].length - 1, K = void 0;
1884
1881
  if (R) {
1885
- for (O = !1, e = e.slice(o[0].length - 1); R--; ) {
1882
+ for (M = !1, e = e.slice(o[0].length - 1); R--; ) {
1886
1883
  if (!(K = /^\{([^}]+)\}/.exec(e)))
1887
1884
  throw new Error(D + " is missing an argument");
1888
- M.push(K[1]), e = e.slice(K[0].length);
1885
+ O.push(K[1]), e = e.slice(K[0].length);
1889
1886
  }
1890
- o[0] = /^\{/.exec(e) ? "{" : "", O = !!o[0];
1887
+ o[0] = /^\{/.exec(e) ? "{" : "", M = !!o[0];
1891
1888
  }
1892
- O && x(), V[D].apply(S, [i].concat(M));
1889
+ M && x(), V[D].apply(S, [i].concat(O));
1893
1890
  } else
1894
- console.warn("unknown latex command", D), w(new H(o[1])), O && x();
1891
+ console.warn("unknown latex command", D), w(new H(o[1])), M && x();
1895
1892
  } else
1896
1893
  o = [e.slice(0, 1)], w(new H(o[0]));
1897
1894
  }
@@ -1899,57 +1896,57 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1899
1896
  }
1900
1897
  return h;
1901
1898
  }, it.measureText = function(e, n, o) {
1902
- return W(e, E(n), o);
1903
- }, it.Token = H, it.Break = St, it.LineBreak = tt, it.SoftHyphen = ft, it.Rotator = xe, xe.createElement = be;
1904
- const Sn = it;
1905
- return s.default;
1899
+ return Z(e, k(n), o);
1900
+ }, it.Token = H, it.Break = St, it.LineBreak = tt, it.SoftHyphen = ft, it.Rotator = be, be.createElement = Ae;
1901
+ const An = it;
1902
+ return r.default;
1906
1903
  })());
1907
- })(Be);
1908
- var jn = Be.exports;
1909
- const Oe = /* @__PURE__ */ oe(jn);
1910
- function Fn(u, l) {
1911
- const t = dt(u), { fontSize: s, font: a, padding: c = 0 } = u.properties.style || {};
1904
+ })(Ve);
1905
+ var jn = Ve.exports;
1906
+ const Me = /* @__PURE__ */ le(jn);
1907
+ function qn(c, l) {
1908
+ const t = dt(c), { fontSize: r, font: a, padding: u = 0 } = c.properties.style || {};
1912
1909
  if (t.width === t.height && t.width === 0)
1913
1910
  return;
1914
- const f = new Oe({
1915
- font: `${s}px/${s}px ${a}`.replace(/(px)+/g, "px"),
1916
- width: t.width - c * 2,
1917
- height: t.height - c * 2,
1911
+ const f = new Me({
1912
+ font: `${r}px/${r}px ${a}`.replace(/(px)+/g, "px"),
1913
+ width: t.width - u * 2,
1914
+ height: t.height - u * 2,
1918
1915
  align: "left",
1919
1916
  valign: "top",
1920
1917
  x: 0,
1921
1918
  overflow: "ellipsis",
1922
1919
  parser: "html",
1923
- createElement: Oe.createElement
1920
+ createElement: Me.createElement
1924
1921
  }).linebreak(
1925
- u.properties.content.replaceAll(`
1922
+ c.properties.content.replaceAll(`
1926
1923
  `, "<br>")
1927
1924
  ).render();
1928
- f.setAttribute("transform", `translate(${c}, ${c})`), l.appendChild(f);
1925
+ f.setAttribute("transform", `translate(${u}, ${u})`), l.appendChild(f);
1929
1926
  }
1930
- const Me = 20;
1931
- class qn extends qe {
1932
- constructor(t, s = {}) {
1927
+ const Oe = 20;
1928
+ class Bn extends Be {
1929
+ constructor(t, r = {}) {
1933
1930
  super(
1934
1931
  t,
1935
1932
  `
1936
1933
  <div class="annotation-text-handle">
1937
- <span class="handle line-handle top" data-handle-id="0"></span>
1938
- <span class="handle line-handle bottom" data-handle-id="1"></span>
1939
- <span class="handle line-handle left" data-handle-id="2"></span>
1940
- <span class="handle line-handle right" data-handle-id="3"></span>
1941
- <span class="handle top right point-handle top-right" data-handle-id="4"></span>
1942
- <span class="handle left top point-handle top-left" data-handle-id="5"></span>
1943
- <span class="handle bottom right point-handle bottom-right" data-handle-id="6"></span>
1944
- <span class="handle left bottom left-handle point-handle bottom-left" data-handle-id="7"></span>
1945
- <textarea wrap="off"></textarea>
1934
+ <span class="handle line-handle top" data-handle-id="0"></span>
1935
+ <span class="handle line-handle bottom" data-handle-id="1"></span>
1936
+ <span class="handle line-handle left" data-handle-id="2"></span>
1937
+ <span class="handle line-handle right" data-handle-id="3"></span>
1938
+ <span class="handle top right point-handle top-right" data-handle-id="4"></span>
1939
+ <span class="handle left top point-handle top-left" data-handle-id="5"></span>
1940
+ <span class="handle bottom right point-handle bottom-right" data-handle-id="6"></span>
1941
+ <span class="handle left bottom left-handle point-handle bottom-left" data-handle-id="7"></span>
1942
+ <textarea wrap="off"></textarea>
1946
1943
  </div>
1947
1944
  `
1948
1945
  );
1949
1946
  v(this, "textArea");
1950
1947
  v(this, "handleSize");
1951
1948
  v(this, "rect", { x: 0, y: 0, width: 0, height: 0 });
1952
- v(this, "annotation", { ...te });
1949
+ v(this, "annotation", { ...ne });
1953
1950
  v(this, "startX", 0);
1954
1951
  v(this, "startY", 0);
1955
1952
  v(this, "handles", []);
@@ -1962,22 +1959,22 @@ class qn extends qe {
1962
1959
  v(this, "_onBlur", () => {
1963
1960
  this.isFocused = !1;
1964
1961
  });
1965
- v(this, "startDrawing", (t, s, a = Rn(t, s, 0, 0, "", bt)) => {
1962
+ v(this, "startDrawing", (t, r, a = Fn(t, r, 0, 0, "", bt)) => {
1966
1963
  this.add(a);
1967
- const c = this.ogma.view.graphToScreenCoordinates({ x: t, y: s });
1968
- this.select(a.id), this.startDragging(this.getById(a.id), c.x, c.y), this.draggedHandle = 6;
1964
+ const u = this.ogma.view.graphToScreenCoordinates({ x: t, y: r });
1965
+ this.select(a.id), this.startDragging(this.getById(a.id), u.x, u.y), this.draggedHandle = 6;
1969
1966
  });
1970
1967
  v(this, "cancelDrawing", () => {
1971
- this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...te }, this.draggedHandle = B, this.isDragging = !1, this.emit(Ot, this.annotation));
1968
+ this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...ne }, this.draggedHandle = B, this.isDragging = !1, this.emit(Mt, this.annotation));
1972
1969
  });
1973
- v(this, "startDragging", (t, s, a) => {
1970
+ v(this, "startDragging", (t, r, a) => {
1974
1971
  this.annotation = t;
1975
- const c = yt(this.annotation), g = dt(this.annotation);
1976
- this.rect.x = c.x, this.rect.y = c.y, this.rect.width = g.width, this.rect.height = g.height, this.startX = s, this.startY = a, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(le, this.annotation), this.isDragging = !0;
1972
+ const u = yt(this.annotation), p = dt(this.annotation);
1973
+ this.rect.x = u.x, this.rect.y = u.y, this.rect.width = p.width, this.rect.height = p.height, this.startX = r, this.startY = a, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(ce, this.annotation), this.isDragging = !0;
1977
1974
  });
1978
1975
  v(this, "onHandleMouseDown", (t) => {
1979
- const s = this.getById(this.selectedId) || this.getById(this.hoveredId);
1980
- s && (this.selectedId !== s.id && this.select(this.hoveredId), this.startDragging(s, t.clientX, t.clientY), this.draggedHandle = He(t.target));
1976
+ const r = this.getById(this.selectedId) || this.getById(this.hoveredId);
1977
+ r && (this.selectedId !== r.id && this.select(this.hoveredId), this.startDragging(r, t.clientX, t.clientY), this.draggedHandle = Re(t.target));
1981
1978
  });
1982
1979
  v(this, "onMouseMove", (t) => {
1983
1980
  requestAnimationFrame(() => this._onMouseMove(t));
@@ -1986,17 +1983,17 @@ class qn extends qe {
1986
1983
  if (!this.isDragging)
1987
1984
  return;
1988
1985
  t.stopPropagation(), t.preventDefault();
1989
- const s = this.handles[this.draggedHandle], a = s.classList.contains("top"), c = s.classList.contains("left"), g = s.classList.contains("right"), y = s.classList.contains("bottom"), f = s.classList.contains("line-handle"), r = this.ogma.view.getZoom(), d = (t.clientX - this.startX) / r, m = (t.clientY - this.startY) / r, T = c || f ? this.rect.x + d : this.rect.x, _ = a || f ? this.rect.y + m : this.rect.y, E = Math.max(
1990
- this.rect.width + d * (f ? 0 : c ? -1 : g ? 1 : 0),
1991
- Me
1986
+ const r = this.handles[this.draggedHandle], a = r.classList.contains("top"), u = r.classList.contains("left"), p = r.classList.contains("right"), y = r.classList.contains("bottom"), f = r.classList.contains("line-handle"), s = this.ogma.view.getZoom(), d = (t.clientX - this.startX) / s, m = (t.clientY - this.startY) / s, A = u || f ? this.rect.x + d : this.rect.x, I = a || f ? this.rect.y + m : this.rect.y, k = Math.max(
1987
+ this.rect.width + d * (f ? 0 : u ? -1 : p ? 1 : 0),
1988
+ Oe
1992
1989
  ), C = Math.max(
1993
1990
  this.rect.height + m * (f ? 0 : a ? -1 : y ? 1 : 0),
1994
- Me
1991
+ Oe
1995
1992
  );
1996
- Mn(this.annotation, T, _, E, C), this.emit(ae, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
1993
+ zn(this.annotation, A, I, k, C), this.emit(he, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
1997
1994
  });
1998
1995
  v(this, "onMouseUp", () => {
1999
- !this.isDragging || this.draggedHandle === B || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Ot, this.annotation), this.isDragging = !1, this.draggedHandle = B);
1996
+ !this.isDragging || this.draggedHandle === B || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Mt, this.annotation), this.isDragging = !1, this.draggedHandle = B);
2000
1997
  });
2001
1998
  v(this, "onViewChanged", () => {
2002
1999
  const t = Math.max(2, this.handleSize / this.ogma.view.getZoom());
@@ -2004,63 +2001,63 @@ class qn extends qe {
2004
2001
  });
2005
2002
  v(this, "_onInput", () => {
2006
2003
  const t = this.getById(this.selectedId);
2007
- t && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), t.properties.content = this.textArea.value, this.emit(se, t), this.layer.refresh());
2004
+ t && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), t.properties.content = this.textArea.value, this.emit(ae, t), this.layer.refresh());
2008
2005
  });
2009
- this.handleSize = De.handleSize || s.textHandleSize, this.placeholder = De.placeholder || s.textPlaceholder || "";
2006
+ this.handleSize = De.handleSize || r.textHandleSize, this.placeholder = De.placeholder || r.textPlaceholder || "";
2010
2007
  const a = this.textArea = this.editor.element.querySelector("textarea");
2011
2008
  a.addEventListener("input", this._onInput), a.addEventListener("focus", this._onFocus), a.addEventListener("blur", this._onBlur), a.spellcheck = !1, this.handles = Array.prototype.slice.call(
2012
2009
  this.editor.element.querySelectorAll(".annotation-text-handle > .handle")
2013
2010
  ), this.handles.forEach(
2014
- (c) => c.addEventListener("mousedown", this.onHandleMouseDown)
2011
+ (u) => u.addEventListener("mousedown", this.onHandleMouseDown)
2015
2012
  ), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0), t.events.on(["viewChanged", "zoom"], this.onViewChanged);
2016
2013
  }
2017
2014
  _canRemove() {
2018
2015
  return !this.isFocused;
2019
2016
  }
2020
- detect({ x: t, y: s }, a = 0) {
2021
- return this.elements.find((c) => {
2022
- const { x: g, y } = yt(c), { width: f, height: r } = dt(c);
2023
- return g - a < t && y - a < s && g + f + a > t && y + r + a > s;
2017
+ detect({ x: t, y: r }, a = 0) {
2018
+ return this.elements.find((u) => {
2019
+ const { x: p, y } = yt(u), { width: f, height: s } = dt(u);
2020
+ return p - a < t && y - a < r && p + f + a > t && y + s + a > r;
2024
2021
  });
2025
2022
  }
2026
2023
  draw(t) {
2027
2024
  t.innerHTML = "";
2028
- const s = "";
2029
- this.elements.forEach((c, g) => {
2030
- const y = `class${g}`, f = dt(c), r = yt(c), d = c.id, {
2025
+ const r = "";
2026
+ this.elements.forEach((u, p) => {
2027
+ const y = `class${p}`, f = dt(u), s = yt(u), d = u.id, {
2031
2028
  color: m,
2032
- fontSize: T,
2033
- font: _,
2034
- strokeColor: E,
2029
+ fontSize: A,
2030
+ font: I,
2031
+ strokeColor: k,
2035
2032
  strokeWidth: C,
2036
- strokeType: A,
2033
+ strokeType: E,
2037
2034
  background: U
2038
- } = c.properties.style || bt;
2035
+ } = u.properties.style || bt;
2039
2036
  if (d === this.selectedId || this.selectedId === -1 && d === this.hoveredId)
2040
2037
  return;
2041
- const N = It("g");
2042
- N.setAttribute("fill", `${m}`), N.setAttribute("font-size", `${T}`), N.setAttribute("font-family", `${_}`);
2038
+ const P = It("g");
2039
+ P.setAttribute("fill", `${m}`), P.setAttribute("font-size", `${A}`), P.setAttribute("font-family", `${I}`);
2043
2040
  const z = It("rect");
2044
- let W = !1;
2045
- A && A !== "none" && (W = !0, z.setAttribute("stroke", E || "black"), z.setAttribute("stroke-width", `${C}`), A === "dashed" && z.setAttribute("stroke-dasharray", "5,5")), (U && U.length || W) && (W = !0, z.setAttribute("fill", U || "transparent")), W && (z.setAttribute("width", `${f.width}`), z.setAttribute("height", `${f.height}`)), N.appendChild(z), Fn(c, N), N.setAttribute("transform", `translate(${r.x},${r.y})`), N.classList.add(y), N.setAttribute("data-annotation", `${c.id}`), N.setAttribute("data-annotation-type", "text"), t.appendChild(N);
2041
+ let Z = !1;
2042
+ E && E !== "none" && (Z = !0, z.setAttribute("stroke", k || "black"), z.setAttribute("stroke-width", `${C}`), E === "dashed" && z.setAttribute("stroke-dasharray", "5,5")), (U && U.length || Z) && (Z = !0, z.setAttribute("fill", U || "transparent")), Z && (z.setAttribute("width", `${f.width}`), z.setAttribute("height", `${f.height}`)), P.appendChild(z), qn(u, P), P.setAttribute("transform", `translate(${s.x},${s.y})`), P.classList.add(y), P.setAttribute("data-annotation", `${u.id}`), P.setAttribute("data-annotation-type", "text"), t.appendChild(P);
2046
2043
  });
2047
2044
  const a = It("style");
2048
- a.innerHTML = s, t.firstChild && t.insertBefore(a, t.firstChild);
2045
+ a.innerHTML = r, t.firstChild && t.insertBefore(a, t.firstChild);
2049
2046
  }
2050
2047
  getDefaultOptions() {
2051
- return te;
2048
+ return ne;
2052
2049
  }
2053
2050
  refreshEditor() {
2054
2051
  if (+this.selectedId < 0 && +this.hoveredId < 0)
2055
2052
  return;
2056
- const t = this.getById(this.selectedId) || this.getById(this.hoveredId), s = dt(t), a = yt(t), {
2057
- font: c,
2058
- fontSize: g,
2059
- color: y,
2060
- background: f,
2061
- padding: r = 0
2062
- } = t.properties.style || bt;
2063
- this.textArea.value = t.properties.content, this.editor.setPosition({ x: a.x, y: a.y }), this.editor.setSize(s), this.textArea.style.fontFamily = c || "sans-serif", this.textArea.style.fontSize = `${g}px`, this.textArea.style.padding = `${r}px`, this.textArea.style.lineHeight = `${g}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = y || "black", this.textArea.style.background = f || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2053
+ const t = this.getById(this.selectedId) || this.getById(this.hoveredId), r = dt(t), a = this.ogma.view.graphToScreenCoordinates(yt(t)), u = this.ogma.view.getZoom(), p = Math.min(u, this.maxHandleScale), {
2054
+ font: y,
2055
+ fontSize: f,
2056
+ color: s,
2057
+ background: d,
2058
+ padding: m = 0
2059
+ } = t.properties.style || bt, A = f;
2060
+ this.textArea.value = t.properties.content, this.editor.element.style.transform = `translate(${a.x}px, ${a.y}px)translate(-50%, -50%)translate(${r.width / 2 * u}px, ${r.height / 2 * u}px)scale(${p})`, this.editor.element.style.width = `${r.width}px`, this.editor.element.style.height = `${r.height}px`, this.textArea.style.font = `${A} ${y}`, this.textArea.style.fontFamily = y || "sans-serif", this.textArea.style.fontSize = `${A}px`, this.textArea.style.padding = `${m}px`, this.textArea.style.lineHeight = `${A}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = s || "black", this.textArea.style.background = d || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2064
2061
  }
2065
2062
  select(t) {
2066
2063
  super.select(t), this.textArea.focus();
@@ -2069,59 +2066,59 @@ class qn extends qe {
2069
2066
  super.destroy(), document.removeEventListener("mouseup", this.onMouseUp), document.removeEventListener("mousemove", this.onMouseMove, !0), this.ogma.events.off(this.onViewChanged);
2070
2067
  }
2071
2068
  }
2072
- class Bn {
2069
+ class Vn {
2073
2070
  constructor() {
2074
2071
  v(this, "links", {});
2075
2072
  v(this, "linksByTargetId", {});
2076
2073
  v(this, "linksByArrowId", {});
2077
2074
  }
2078
- add(l, t, s, a, c) {
2079
- const g = jt(), y = l.id, f = {
2080
- id: g,
2075
+ add(l, t, r, a, u) {
2076
+ const p = jt(), y = l.id, f = {
2077
+ id: p,
2081
2078
  arrow: y,
2082
- target: s,
2079
+ target: r,
2083
2080
  targetType: a,
2084
- connectionPoint: c,
2081
+ connectionPoint: u,
2085
2082
  side: t
2086
2083
  };
2087
- return this.links[g] = f, this.linksByTargetId[s] || (this.linksByTargetId[s] = []), this.linksByTargetId[s].push(g), this.linksByArrowId[y] || (this.linksByArrowId[y] = {}), this.linksByArrowId[y][t] = g, l.properties.link = l.properties.link || {}, l.properties.link[t] = {
2088
- id: s,
2084
+ return this.links[p] = f, this.linksByTargetId[r] || (this.linksByTargetId[r] = []), this.linksByTargetId[r].push(p), this.linksByArrowId[y] || (this.linksByArrowId[y] = {}), this.linksByArrowId[y][t] = p, l.properties.link = l.properties.link || {}, l.properties.link[t] = {
2085
+ id: r,
2089
2086
  side: t,
2090
2087
  type: a,
2091
- magnet: c
2088
+ magnet: u
2092
2089
  }, this;
2093
2090
  }
2094
2091
  arrowIsLinked(l, t) {
2095
- var s;
2096
- return !!((s = this.linksByArrowId[l]) != null && s[t]);
2092
+ var r;
2093
+ return !!((r = this.linksByArrowId[l]) != null && r[t]);
2097
2094
  }
2098
2095
  // remove the link between the arrow and the target by arrow id and side
2099
2096
  remove(l, t) {
2100
2097
  var y, f;
2101
- const s = l.id, a = (y = this.linksByArrowId[s]) == null ? void 0 : y[t];
2098
+ const r = l.id, a = (y = this.linksByArrowId[r]) == null ? void 0 : y[t];
2102
2099
  if ((f = l.properties.link) == null || delete f[t], !a)
2103
2100
  return this;
2104
- const c = this.links[a];
2101
+ const u = this.links[a];
2105
2102
  delete this.links[a];
2106
- const g = this.linksByTargetId[c.target];
2107
- for (let r = 0; r < g.length; r++)
2108
- if (g[r] === a) {
2109
- g.splice(r, 1);
2103
+ const p = this.linksByTargetId[u.target];
2104
+ for (let s = 0; s < p.length; s++)
2105
+ if (p[s] === a) {
2106
+ p.splice(s, 1);
2110
2107
  break;
2111
2108
  }
2112
- return delete this.linksByArrowId[s][t], this;
2109
+ return delete this.linksByArrowId[r][t], this;
2113
2110
  }
2114
2111
  getArrowLink(l, t) {
2115
2112
  var a;
2116
- const s = (a = this.linksByArrowId[l]) == null ? void 0 : a[t];
2117
- return s ? this.links[s] : null;
2113
+ const r = (a = this.linksByArrowId[l]) == null ? void 0 : a[t];
2114
+ return r ? this.links[r] : null;
2118
2115
  }
2119
2116
  getTargetLinks(l) {
2120
2117
  var t;
2121
- return ((t = this.linksByTargetId[l]) == null ? void 0 : t.map((s) => this.links[s])) ?? [];
2118
+ return ((t = this.linksByTargetId[l]) == null ? void 0 : t.map((r) => this.links[r])) ?? [];
2122
2119
  }
2123
2120
  }
2124
- const ct = (u) => u.properties.type === "arrow", wt = (u) => u.properties.type === "text", Vn = (u) => u.type === "FeatureCollection", Un = {
2121
+ const ht = (c) => c.properties.type === "arrow", wt = (c) => c.properties.type === "text", ze = (c) => c.type === "FeatureCollection", Un = {
2125
2122
  magnetColor: "#3e8",
2126
2123
  detectMargin: 20,
2127
2124
  magnetHandleRadius: 5,
@@ -2131,7 +2128,7 @@ const ct = (u) => u.properties.type === "arrow", wt = (u) => u.properties.type =
2131
2128
  textHandleSize: 3.5,
2132
2129
  minArrowHeight: 20,
2133
2130
  maxArrowHeight: 30
2134
- }, ze = ["start", "end"], Le = [
2131
+ }, Le = ["start", "end"], Ce = [
2135
2132
  { x: 0, y: 0 },
2136
2133
  { x: 0.5, y: 0 },
2137
2134
  { x: 1, y: 0 },
@@ -2141,12 +2138,12 @@ const ct = (u) => u.properties.type === "arrow", wt = (u) => u.properties.type =
2141
2138
  { x: 0.5, y: 1 },
2142
2139
  { x: 1, y: 1 }
2143
2140
  ];
2144
- class Gn extends Fe {
2145
- constructor(t, s = {}) {
2141
+ class Gn extends qe {
2142
+ constructor(t, r = {}) {
2146
2143
  super();
2147
2144
  v(this, "arrows");
2148
2145
  v(this, "texts");
2149
- v(this, "links", new Bn());
2146
+ v(this, "links", new Vn());
2150
2147
  v(this, "layer");
2151
2148
  v(this, "annotations");
2152
2149
  v(this, "ogma");
@@ -2161,63 +2158,74 @@ class Gn extends Fe {
2161
2158
  if (!this.dragged || this.textToMagnet === void 0)
2162
2159
  return;
2163
2160
  t.beginPath(), t.fillStyle = "green";
2164
- const s = this.ogma.view.getZoom();
2165
- Le.forEach((a) => {
2161
+ const r = this.ogma.view.getZoom();
2162
+ Ce.forEach((a) => {
2166
2163
  if (!this.textToMagnet)
2167
2164
  return;
2168
- const c = dt(this.textToMagnet), g = yt(this.textToMagnet), { x: y, y: f } = new rt(a.x, a.y).mul({ x: c.width, y: c.height }).add(g);
2169
- t.moveTo(y, f), t.arc(y, f, this.options.magnetHandleRadius / s, 0, Math.PI * 2);
2165
+ const u = dt(this.textToMagnet), p = yt(this.textToMagnet), { x: y, y: f } = new rt(a.x, a.y).mul({ x: u.width, y: u.height }).add(p);
2166
+ t.moveTo(y, f), t.arc(y, f, this.options.magnetHandleRadius / r, 0, Math.PI * 2);
2170
2167
  }), t.fill(), t.closePath();
2171
2168
  });
2172
- v(this, "_onFeatureDrag", (t, s) => {
2173
- const a = s;
2174
- if (ct(t) && a === "line")
2175
- ["start", "end"].find((c) => {
2176
- const g = c === "start" ? _t(t) : Ht(t);
2177
- return this._snapToText(t, a, g) || this._findAndSnapToNode(t, c, g);
2169
+ v(this, "_onFeatureDrag", (t, r) => {
2170
+ const a = r;
2171
+ if (ht(t) && a === "line")
2172
+ ["start", "end"].find((u) => {
2173
+ const p = u === "start" ? _t(t) : Rt(t);
2174
+ return this._snapToText(t, a, p) || this._findAndSnapToNode(t, u, p);
2178
2175
  });
2179
- else if (ct(t) && a !== "line") {
2180
- const c = a === "start" ? _t(t) : Ht(t);
2181
- this._snapToText(t, a, c) || this._findAndSnapToNode(t, a, c);
2176
+ else if (ht(t) && a !== "line") {
2177
+ const u = a === "start" ? _t(t) : Rt(t);
2178
+ this._snapToText(t, a, u) || this._findAndSnapToNode(t, a, u);
2182
2179
  } else
2183
- wt(t) && (this.activeLinks.forEach(({ arrow: c, side: g, connectionPoint: y }) => {
2184
- const f = this.getAnnotation(c), r = dt(t), d = yt(t), m = new rt(y.x, y.y).mul({ x: r.width, y: r.height }).add(d);
2185
- f.geometry.coordinates[g === "start" ? 0 : 1] = [m.x, m.y];
2180
+ wt(t) && (this.activeLinks.forEach(({ arrow: u, side: p, connectionPoint: y }) => {
2181
+ const f = this.getAnnotation(u), s = dt(t), d = yt(t), m = new rt(y.x, y.y).mul({ x: s.width, y: s.height }).add(d);
2182
+ f.geometry.coordinates[p === "start" ? 0 : 1] = [m.x, m.y];
2186
2183
  }), this.activeLinks.length && this.arrows.refreshLayer());
2187
2184
  this.layer.refresh();
2188
2185
  });
2189
2186
  v(this, "_onFeatureDragEnd", (t) => {
2190
- this.dragged !== null && ct(t) && _t(this.dragged) && ze.forEach((s) => {
2191
- this.links.getArrowLink(t.id, s) && this.emit(Nn, {
2187
+ this.dragged !== null && ht(t) && _t(this.dragged) && Le.forEach((r) => {
2188
+ this.links.getArrowLink(t.id, r) && this.emit(Nn, {
2192
2189
  arrow: t,
2193
- link: this.links.getArrowLink(t.id, s)
2190
+ link: this.links.getArrowLink(t.id, r)
2194
2191
  });
2195
- }), (wt(t) || ct(t)) && this.onUpdate(t), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((s) => s.enableDetection()), this.layer.refresh();
2192
+ }), (wt(t) || ht(t)) && this.onUpdate(t), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((r) => r.enableDetection()), this.layer.refresh();
2196
2193
  });
2197
2194
  v(this, "_onFeatureDragStart", (t) => {
2198
- this.textToMagnet = void 0, ct(t) ? this.dragged = t : wt(t) && this.activeLinks.push(...this.links.getTargetLinks(t.id)), this.annotations.forEach((s) => {
2199
- const a = s.getSelectedFeature();
2200
- a && a !== t && s.unhover().unselect(), s.disableDetection();
2195
+ this.textToMagnet = void 0, ht(t) ? this.dragged = t : wt(t) && this.activeLinks.push(...this.links.getTargetLinks(t.id)), this.annotations.forEach((r) => {
2196
+ const a = r.getSelectedFeature();
2197
+ a && a !== t && r.unhover().unselect(), r.disableDetection();
2201
2198
  });
2202
2199
  });
2203
2200
  v(this, "_onNodesDragStart", () => {
2204
2201
  this.arrows.unhover().unselect(), this.texts.unhover().unselect();
2205
2202
  });
2206
2203
  v(this, "_onNodesDrag", (t) => {
2207
- const { dx: s, dy: a } = t;
2208
- this._moveNodes(t.nodes, s, a);
2204
+ const { dx: r, dy: a } = t;
2205
+ this._moveNodes(t.nodes, r, a);
2206
+ });
2207
+ v(this, "_onLayoutEnd", (t) => {
2208
+ t.ids.forEach((r, a) => {
2209
+ this.links.getTargetLinks(r).forEach((p) => {
2210
+ const y = this.getAnnotation(p.arrow), f = p.side, s = te(
2211
+ y,
2212
+ f === "start" ? "end" : "start"
2213
+ ), d = t.positions.current[a], m = this.ogma.getNode(r).getAttribute("radius"), A = ee(s, d, +m);
2214
+ Nt(y, f, A.x, A.y);
2215
+ });
2216
+ }), this.arrows.refreshLayer(), this.texts.refreshLayer();
2209
2217
  });
2210
2218
  v(this, "_onAdded", (t) => {
2211
- this.emit(re, t);
2219
+ this.emit(oe, t);
2212
2220
  });
2213
2221
  v(this, "_onRemoved", (t) => {
2214
- this.emit(ie, t);
2222
+ this.emit(se, t);
2215
2223
  });
2216
2224
  v(this, "_onUnselect", (t) => {
2217
- this.selected = null, this.emit(ne, t);
2225
+ this.selected = null, this.emit(re, t);
2218
2226
  });
2219
2227
  v(this, "_onSelect", (t) => {
2220
- this.selected !== t && (this.selected = t, this.emit(ee, this.selected));
2228
+ this.selected !== t && (this.selected = t, this.emit(ie, this.selected));
2221
2229
  });
2222
2230
  /**
2223
2231
  * Triggers the update event on the annotation
@@ -2229,47 +2237,47 @@ class Gn extends Fe {
2229
2237
  );
2230
2238
  });
2231
2239
  v(this, "_onUpdate", (t) => {
2232
- this.emit(se, t);
2240
+ this.emit(ae, t);
2233
2241
  });
2234
- this.options = this.setOptions({ ...Un, ...s }), this.ogma = t, this.arrows = new Hn(t, this.options), this.texts = new qn(t, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((a) => {
2235
- a.on(le, this._onFeatureDragStart).on(ae, this._onFeatureDrag).on(Ot, this._onFeatureDragEnd).on(se, this.onUpdate).on(ne, this._onUnselect).on(ee, this._onSelect).on(re, this._onAdded).on(ie, this._onRemoved);
2236
- }), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag), this.layer = t.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
2237
- }
2238
- _moveNodes(t, s, a) {
2239
- t.forEach((c) => {
2240
- const g = this.links.getTargetLinks(c.getId()), y = c.getPosition();
2241
- g.forEach((f) => {
2242
- const r = this.getAnnotation(f.arrow), d = f.side, m = Ae(
2243
- r,
2242
+ this.options = this.setOptions({ ...Un, ...r }), this.ogma = t, this.arrows = new Rn(t, this.options), this.texts = new Bn(t, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((a) => {
2243
+ a.on(ce, this._onFeatureDragStart).on(he, this._onFeatureDrag).on(Mt, this._onFeatureDragEnd).on(ae, this.onUpdate).on(re, this._onUnselect).on(ie, this._onSelect).on(oe, this._onAdded).on(se, this._onRemoved);
2244
+ }), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd), this.layer = t.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
2245
+ }
2246
+ _moveNodes(t, r, a) {
2247
+ t.forEach((u) => {
2248
+ const p = this.links.getTargetLinks(u.getId()), y = u.getPosition();
2249
+ p.forEach((f) => {
2250
+ const s = this.getAnnotation(f.arrow), d = f.side, m = te(
2251
+ s,
2244
2252
  d === "start" ? "end" : "start"
2245
2253
  );
2246
- let T = y;
2247
- const _ = +c.getAttribute("radius"), E = 1e-6;
2248
- (f.connectionPoint.x - (y.x - s) > E || f.connectionPoint.y - (y.y - a) > E) && (T = Ee(m, y, _)), Qt(r, d, T.x, T.y);
2254
+ let A = y;
2255
+ const I = +u.getAttribute("radius"), k = 1e-6;
2256
+ (f.connectionPoint.x - (y.x - r) > k || f.connectionPoint.y - (y.y - a) > k) && (A = ee(m, y, I)), Nt(s, d, A.x, A.y);
2249
2257
  });
2250
2258
  }), this.arrows.refreshLayer();
2251
2259
  }
2252
- _snapToText(t, s, a) {
2253
- const c = this.texts.detect(a, this.options.detectMargin);
2254
- if (this.links.remove(t, s), !c)
2260
+ _snapToText(t, r, a) {
2261
+ const u = this.texts.detect(a, this.options.detectMargin);
2262
+ if (this.links.remove(t, r), !u)
2255
2263
  return !1;
2256
- this.textToMagnet = c;
2257
- const g = this.findMagnetPoint(Le, c, a);
2258
- return g ? (Qt(t, s, g.point.x, g.point.y), this.links.add(t, s, c.id, "text", g.magnet), !0) : !1;
2264
+ this.textToMagnet = u;
2265
+ const p = this.findMagnetPoint(Ce, u, a);
2266
+ return p ? (Nt(t, r, p.point.x, p.point.y), this.links.add(t, r, u.id, "text", p.magnet), !0) : !1;
2259
2267
  }
2260
- _findAndSnapToNode(t, s, a) {
2261
- const c = this.ogma.view.graphToScreenCoordinates(a), g = this.ogma.view.getElementAt(c);
2262
- this.links.remove(t, s), g && g.isNode ? (this.hoveredNode = g, this.hoveredNode.setSelected(!0), this._snapToNode(t, s, g, c)) : (this.hoveredNode && this.hoveredNode.setSelected(!1), this.hoveredNode = null);
2268
+ _findAndSnapToNode(t, r, a) {
2269
+ const u = this.ogma.view.graphToScreenCoordinates(a), p = this.ogma.view.getElementAt(u);
2270
+ this.links.remove(t, r), p && p.isNode ? (this.hoveredNode = p, this.hoveredNode.setSelected(!0), this._snapToNode(t, r, p, u)) : (this.hoveredNode && this.hoveredNode.setSelected(!1), this.hoveredNode = null);
2263
2271
  }
2264
- _snapToNode(t, s, a, c) {
2265
- const g = a.getPositionOnScreen(), y = +a.getAttribute("radius"), f = y * this.ogma.view.getZoom(), r = c.x - g.x, d = c.y - g.y, m = Math.sqrt(r * r + d * d), T = a.getPosition();
2272
+ _snapToNode(t, r, a, u) {
2273
+ const p = a.getPositionOnScreen(), y = +a.getAttribute("radius"), f = y * this.ogma.view.getZoom(), s = u.x - p.x, d = u.y - p.y, m = Math.sqrt(s * s + d * d), A = a.getPosition();
2266
2274
  if (m < f + this.options.detectMargin) {
2267
- let _ = T;
2275
+ let I = A;
2268
2276
  if (m > f / 2) {
2269
- const E = Ae(t, s === "end" ? "start" : "end");
2270
- _ = Ee(E, _, y);
2277
+ const k = te(t, r === "end" ? "start" : "end");
2278
+ I = ee(k, I, y);
2271
2279
  }
2272
- Qt(t, s, _.x, _.y), this.links.add(t, s, a.getId(), "node", _);
2280
+ Nt(t, r, I.x, I.y), this.links.add(t, r, a.getId(), "node", I);
2273
2281
  }
2274
2282
  }
2275
2283
  /**
@@ -2278,19 +2286,19 @@ class Gn extends Fe {
2278
2286
  getSelected() {
2279
2287
  return this.selected;
2280
2288
  }
2281
- findMagnetPoint(t, s, a) {
2282
- let c;
2283
- for (const g of t) {
2284
- const y = dt(s), f = yt(s), r = new rt(g.x, g.y).mul({ x: y.width, y: y.height }).add(f), d = r.sub(a).length(), m = this.options.magnetRadius * this.ogma.view.getZoom();
2289
+ findMagnetPoint(t, r, a) {
2290
+ let u;
2291
+ for (const p of t) {
2292
+ const y = dt(r), f = yt(r), s = new rt(p.x, p.y).mul({ x: y.width, y: y.height }).add(f), d = s.sub(a).length(), m = this.options.magnetRadius * this.ogma.view.getZoom();
2285
2293
  if (d < Math.max(m, this.options.magnetHandleRadius)) {
2286
- c = {
2287
- point: r,
2288
- magnet: g
2294
+ u = {
2295
+ point: s,
2296
+ magnet: p
2289
2297
  };
2290
2298
  break;
2291
2299
  }
2292
2300
  }
2293
- return c;
2301
+ return u;
2294
2302
  }
2295
2303
  /**
2296
2304
  * Set the options for the controller
@@ -2308,23 +2316,23 @@ class Gn extends Fe {
2308
2316
  * @param id the id of the annotation to select
2309
2317
  */
2310
2318
  select(t) {
2311
- const s = this.getAnnotations().features.find((a) => a.id === t);
2312
- return s ? (ct(s) ? this.arrows.select(s.id) : wt(s) && this.texts.select(s.id), this) : this;
2319
+ const r = this.getAnnotations().features.find((a) => a.id === t);
2320
+ return r ? (ht(r) ? this.arrows.select(r.id) : wt(r) && this.texts.select(r.id), this) : this;
2313
2321
  }
2314
2322
  /**
2315
2323
  * Unselects the currently selected annotation
2316
2324
  */
2317
2325
  unselect() {
2318
- return this.selected ? (ct(this.selected) ? this.arrows.unselect() : wt(this.selected) && this.texts.unselect(), this) : this;
2326
+ return this.selected ? (ht(this.selected) ? this.arrows.unselect() : wt(this.selected) && this.texts.unselect(), this) : this;
2319
2327
  }
2320
2328
  /**
2321
2329
  * Add an annotation to the controller
2322
2330
  * @param annotation The annotation to add
2323
2331
  */
2324
2332
  add(t) {
2325
- if (Vn(t))
2333
+ if (ze(t))
2326
2334
  return t.features.forEach(
2327
- (s) => this.add(s)
2335
+ (r) => this.add(r)
2328
2336
  ), this;
2329
2337
  switch (t.properties.type) {
2330
2338
  case "text":
@@ -2336,18 +2344,27 @@ class Gn extends Fe {
2336
2344
  }
2337
2345
  return this;
2338
2346
  }
2347
+ /**
2348
+ * Remove an annotation or an array of annotations from the controller
2349
+ * @param annotation The annotation(s) to remove
2350
+ */
2351
+ remove(t) {
2352
+ return ze(t) ? (t.features.forEach(
2353
+ (r) => this.remove(r)
2354
+ ), this) : (ht(t) ? (this.links.remove(t, "start"), this.links.remove(t, "end"), this.arrows.remove(t.id)) : this.texts.remove(t.id), this);
2355
+ }
2339
2356
  loadLink(t) {
2340
2357
  if (t.properties.link)
2341
- for (const s of ze) {
2342
- const a = t.properties.link[s];
2358
+ for (const r of Le) {
2359
+ const a = t.properties.link[r];
2343
2360
  if (!a)
2344
2361
  continue;
2345
2362
  if (this.getAnnotation(a.id))
2346
- this.links.add(t, s, a.id, a.type, a.magnet);
2363
+ this.links.add(t, r, a.id, a.type, a.magnet);
2347
2364
  else {
2348
2365
  if (!this.ogma.getNode(a.id))
2349
2366
  continue;
2350
- this.links.add(t, s, a.id, a.type, a.magnet);
2367
+ this.links.add(t, r, a.id, a.type, a.magnet);
2351
2368
  }
2352
2369
  }
2353
2370
  }
@@ -2357,8 +2374,8 @@ class Gn extends Fe {
2357
2374
  * @param y coord of the first point
2358
2375
  * @param arrow The arrow to add
2359
2376
  */
2360
- startArrow(t, s, a) {
2361
- this.cancelDrawing(), this.arrows.startDrawing(t, s, a);
2377
+ startArrow(t, r, a) {
2378
+ this.cancelDrawing(), this.arrows.startDrawing(t, r, a);
2362
2379
  }
2363
2380
  /**
2364
2381
  * Start adding a text (add it, and give control to the user)
@@ -2366,8 +2383,8 @@ class Gn extends Fe {
2366
2383
  * @param y coord of the top left point
2367
2384
  * @param text The text to add
2368
2385
  */
2369
- startText(t, s, a) {
2370
- this.cancelDrawing(), this.texts.startDrawing(t, s, a);
2386
+ startText(t, r, a) {
2387
+ this.cancelDrawing(), this.texts.startDrawing(t, r, a);
2371
2388
  }
2372
2389
  /**
2373
2390
  * Cancel drawing on the current frame
@@ -2380,9 +2397,9 @@ class Gn extends Fe {
2380
2397
  * @param id The id of the annotation to update
2381
2398
  * @param style The new style
2382
2399
  */
2383
- updateStyle(t, s) {
2384
- const a = this.getAnnotations().features.find((c) => c.id === t);
2385
- return a ? (ct(a) ? this.arrows.updateStyle(a, s) : wt(a) && this.texts.updateStyle(a, s), this.onUpdate(a), this) : this;
2400
+ updateStyle(t, r) {
2401
+ const a = this.getAnnotations().features.find((u) => u.id === t);
2402
+ return a ? (ht(a) ? this.arrows.updateStyle(a, r) : wt(a) && this.texts.updateStyle(a, r), this.onUpdate(a), this) : this;
2386
2403
  }
2387
2404
  /**
2388
2405
  *
@@ -2393,8 +2410,8 @@ class Gn extends Fe {
2393
2410
  type: "FeatureCollection",
2394
2411
  features: []
2395
2412
  };
2396
- return this.annotations.forEach((s) => {
2397
- t.features = [...t.features, ...s.getElements()];
2413
+ return this.annotations.forEach((r) => {
2414
+ t.features = [...t.features, ...r.getElements()];
2398
2415
  }), t;
2399
2416
  }
2400
2417
  /**
@@ -2403,7 +2420,7 @@ class Gn extends Fe {
2403
2420
  * @returns The annotation with the given id
2404
2421
  */
2405
2422
  getAnnotation(t) {
2406
- return this.getAnnotations().features.find((s) => s.id === t);
2423
+ return this.getAnnotations().features.find((r) => r.id === t);
2407
2424
  }
2408
2425
  /**
2409
2426
  * Destroy the controller and its elements
@@ -2413,34 +2430,34 @@ class Gn extends Fe {
2413
2430
  }
2414
2431
  }
2415
2432
  export {
2416
- Hn as Arrows,
2433
+ Rn as Arrows,
2417
2434
  Gn as Control,
2418
- qn as Texts,
2419
- _n as createArrow,
2435
+ Bn as Texts,
2436
+ Dn as createArrow,
2420
2437
  It as createSVGElement,
2421
- Rn as createText,
2422
- Se as defaultArrowOptions,
2438
+ Fn as createText,
2439
+ Ee as defaultArrowOptions,
2423
2440
  Dt as defaultArrowStyle,
2424
2441
  De as defaultControllerOptions,
2425
- te as defaultTextOptions,
2442
+ ne as defaultTextOptions,
2426
2443
  bt as defaultTextStyle,
2427
2444
  Xn as getAnnotationsBounds,
2428
- Ht as getArrowEnd,
2429
- Rt as getArrowEndPoints,
2430
- Ae as getArrowSide,
2445
+ Rt as getArrowEnd,
2446
+ Ft as getArrowEndPoints,
2447
+ te as getArrowSide,
2431
2448
  _t as getArrowStart,
2432
- Ee as getAttachmentPointOnNode,
2433
- He as getHandleId,
2449
+ ee as getAttachmentPointOnNode,
2450
+ Re as getHandleId,
2434
2451
  Pe as getTextBbox,
2435
2452
  yt as getTextPosition,
2436
2453
  dt as getTextSize,
2437
- Vn as isAnnotationCollection,
2438
- ct as isArrow,
2454
+ ze as isAnnotationCollection,
2455
+ ht as isArrow,
2439
2456
  wt as isText,
2440
- $e as setArrowEnd,
2441
- Qt as setArrowEndPoint,
2457
+ He as setArrowEnd,
2458
+ Nt as setArrowEndPoint,
2442
2459
  Ne as setArrowStart,
2443
- Mn as setTextBbox,
2460
+ zn as setTextBbox,
2444
2461
  On as updateTextBbox
2445
2462
  };
2446
2463
  //# sourceMappingURL=index.mjs.map