@tsparticles/plugin-polygon-mask 4.0.0-beta.0 → 4.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/423.min.js +1 -0
  2. package/{319.min.js → 832.min.js} +2 -2
  3. package/browser/Options/Classes/PolygonMask.js +2 -2
  4. package/browser/Options/Classes/PolygonMaskDraw.js +2 -2
  5. package/browser/Options/Classes/PolygonMaskDrawStroke.js +4 -4
  6. package/browser/PolygonMaskInstance.js +6 -8
  7. package/browser/PolygonMaskPlugin.js +5 -5
  8. package/browser/index.js +4 -3
  9. package/browser/utils.js +4 -4
  10. package/cjs/Options/Classes/PolygonMask.js +2 -2
  11. package/cjs/Options/Classes/PolygonMaskDraw.js +2 -2
  12. package/cjs/Options/Classes/PolygonMaskDrawStroke.js +4 -4
  13. package/cjs/PolygonMaskInstance.js +6 -8
  14. package/cjs/PolygonMaskPlugin.js +5 -5
  15. package/cjs/index.js +4 -3
  16. package/cjs/utils.js +4 -4
  17. package/dist_browser_PolygonMaskInstance_js.js +3 -3
  18. package/dist_browser_PolygonMaskPlugin_js.js +5 -5
  19. package/esm/Options/Classes/PolygonMask.js +2 -2
  20. package/esm/Options/Classes/PolygonMaskDraw.js +2 -2
  21. package/esm/Options/Classes/PolygonMaskDrawStroke.js +4 -4
  22. package/esm/PolygonMaskInstance.js +6 -8
  23. package/esm/PolygonMaskPlugin.js +5 -5
  24. package/esm/index.js +4 -3
  25. package/esm/utils.js +4 -4
  26. package/package.json +4 -5
  27. package/report.html +84 -29
  28. package/tsparticles.plugin.polygon-mask.js +2 -2
  29. package/tsparticles.plugin.polygon-mask.min.js +2 -2
  30. package/types/Options/Classes/PolygonMask.d.ts +2 -2
  31. package/types/Options/Classes/PolygonMaskDraw.d.ts +2 -2
  32. package/types/Options/Classes/PolygonMaskDrawStroke.d.ts +3 -3
  33. package/types/PolygonMaskInstance.d.ts +5 -5
  34. package/types/PolygonMaskPlugin.d.ts +3 -3
  35. package/types/utils.d.ts +3 -3
  36. package/99.min.js +0 -1
  37. package/umd/Enums/PolygonMaskInlineArrangement.js +0 -21
  38. package/umd/Enums/PolygonMaskMoveType.js +0 -18
  39. package/umd/Enums/PolygonMaskType.js +0 -20
  40. package/umd/Interfaces/ISvgPath.js +0 -12
  41. package/umd/Options/Classes/PolygonMask.js +0 -74
  42. package/umd/Options/Classes/PolygonMaskDraw.js +0 -34
  43. package/umd/Options/Classes/PolygonMaskDrawStroke.js +0 -42
  44. package/umd/Options/Classes/PolygonMaskInline.js +0 -30
  45. package/umd/Options/Classes/PolygonMaskLocalSvg.js +0 -42
  46. package/umd/Options/Classes/PolygonMaskMove.js +0 -35
  47. package/umd/Options/Interfaces/IPolygonMask.js +0 -12
  48. package/umd/Options/Interfaces/IPolygonMaskDraw.js +0 -12
  49. package/umd/Options/Interfaces/IPolygonMaskDrawStroke.js +0 -12
  50. package/umd/Options/Interfaces/IPolygonMaskInline.js +0 -12
  51. package/umd/Options/Interfaces/IPolygonMaskLocalSvg.js +0 -12
  52. package/umd/Options/Interfaces/IPolygonMaskMove.js +0 -12
  53. package/umd/PolygonMaskInstance.js +0 -425
  54. package/umd/PolygonMaskPlugin.js +0 -75
  55. package/umd/index.js +0 -60
  56. package/umd/pathseg.js +0 -1486
  57. package/umd/types.js +0 -12
  58. package/umd/utils.js +0 -139
package/umd/pathseg.js DELETED
@@ -1,1486 +0,0 @@
1
- "use strict";
2
- (function () {
3
- "use strict";
4
- try {
5
- if (typeof window === "undefined")
6
- return;
7
- if (!("SVGPathSeg" in window)) {
8
- window.SVGPathSeg = function (type, typeAsLetter, owningPathSegList) {
9
- this.pathSegType = type;
10
- this.pathSegTypeAsLetter = typeAsLetter;
11
- this._owningPathSegList = owningPathSegList;
12
- };
13
- window.SVGPathSeg.prototype.classname = "SVGPathSeg";
14
- window.SVGPathSeg.PATHSEG_UNKNOWN = 0;
15
- window.SVGPathSeg.PATHSEG_CLOSEPATH = 1;
16
- window.SVGPathSeg.PATHSEG_MOVETO_ABS = 2;
17
- window.SVGPathSeg.PATHSEG_MOVETO_REL = 3;
18
- window.SVGPathSeg.PATHSEG_LINETO_ABS = 4;
19
- window.SVGPathSeg.PATHSEG_LINETO_REL = 5;
20
- window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6;
21
- window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7;
22
- window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8;
23
- window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9;
24
- window.SVGPathSeg.PATHSEG_ARC_ABS = 10;
25
- window.SVGPathSeg.PATHSEG_ARC_REL = 11;
26
- window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12;
27
- window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13;
28
- window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14;
29
- window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15;
30
- window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16;
31
- window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17;
32
- window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;
33
- window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;
34
- window.SVGPathSeg.prototype._segmentChanged = function () {
35
- if (this._owningPathSegList)
36
- this._owningPathSegList.segmentChanged(this);
37
- };
38
- window.SVGPathSegClosePath = function (owningPathSegList) {
39
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CLOSEPATH, "z", owningPathSegList);
40
- };
41
- window.SVGPathSegClosePath.prototype = Object.create(window.SVGPathSeg.prototype);
42
- window.SVGPathSegClosePath.prototype.toString = function () {
43
- return "[object SVGPathSegClosePath]";
44
- };
45
- window.SVGPathSegClosePath.prototype._asPathString = function () {
46
- return this.pathSegTypeAsLetter;
47
- };
48
- window.SVGPathSegClosePath.prototype.clone = function () {
49
- return new window.SVGPathSegClosePath(undefined);
50
- };
51
- window.SVGPathSegMovetoAbs = function (owningPathSegList, x, y) {
52
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_ABS, "M", owningPathSegList);
53
- this._x = x;
54
- this._y = y;
55
- };
56
- window.SVGPathSegMovetoAbs.prototype = Object.create(window.SVGPathSeg.prototype);
57
- window.SVGPathSegMovetoAbs.prototype.toString = function () {
58
- return "[object SVGPathSegMovetoAbs]";
59
- };
60
- window.SVGPathSegMovetoAbs.prototype._asPathString = function () {
61
- return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
62
- };
63
- window.SVGPathSegMovetoAbs.prototype.clone = function () {
64
- return new window.SVGPathSegMovetoAbs(undefined, this._x, this._y);
65
- };
66
- Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "x", {
67
- get: function () {
68
- return this._x;
69
- },
70
- set: function (x) {
71
- this._x = x;
72
- this._segmentChanged();
73
- },
74
- enumerable: true,
75
- });
76
- Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "y", {
77
- get: function () {
78
- return this._y;
79
- },
80
- set: function (y) {
81
- this._y = y;
82
- this._segmentChanged();
83
- },
84
- enumerable: true,
85
- });
86
- window.SVGPathSegMovetoRel = function (owningPathSegList, x, y) {
87
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_REL, "m", owningPathSegList);
88
- this._x = x;
89
- this._y = y;
90
- };
91
- window.SVGPathSegMovetoRel.prototype = Object.create(window.SVGPathSeg.prototype);
92
- window.SVGPathSegMovetoRel.prototype.toString = function () {
93
- return "[object SVGPathSegMovetoRel]";
94
- };
95
- window.SVGPathSegMovetoRel.prototype._asPathString = function () {
96
- return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
97
- };
98
- window.SVGPathSegMovetoRel.prototype.clone = function () {
99
- return new window.SVGPathSegMovetoRel(undefined, this._x, this._y);
100
- };
101
- Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "x", {
102
- get: function () {
103
- return this._x;
104
- },
105
- set: function (x) {
106
- this._x = x;
107
- this._segmentChanged();
108
- },
109
- enumerable: true,
110
- });
111
- Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "y", {
112
- get: function () {
113
- return this._y;
114
- },
115
- set: function (y) {
116
- this._y = y;
117
- this._segmentChanged();
118
- },
119
- enumerable: true,
120
- });
121
- window.SVGPathSegLinetoAbs = function (owningPathSegList, x, y) {
122
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_ABS, "L", owningPathSegList);
123
- this._x = x;
124
- this._y = y;
125
- };
126
- window.SVGPathSegLinetoAbs.prototype = Object.create(window.SVGPathSeg.prototype);
127
- window.SVGPathSegLinetoAbs.prototype.toString = function () {
128
- return "[object SVGPathSegLinetoAbs]";
129
- };
130
- window.SVGPathSegLinetoAbs.prototype._asPathString = function () {
131
- return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
132
- };
133
- window.SVGPathSegLinetoAbs.prototype.clone = function () {
134
- return new window.SVGPathSegLinetoAbs(undefined, this._x, this._y);
135
- };
136
- Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "x", {
137
- get: function () {
138
- return this._x;
139
- },
140
- set: function (x) {
141
- this._x = x;
142
- this._segmentChanged();
143
- },
144
- enumerable: true,
145
- });
146
- Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "y", {
147
- get: function () {
148
- return this._y;
149
- },
150
- set: function (y) {
151
- this._y = y;
152
- this._segmentChanged();
153
- },
154
- enumerable: true,
155
- });
156
- window.SVGPathSegLinetoRel = function (owningPathSegList, x, y) {
157
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_REL, "l", owningPathSegList);
158
- this._x = x;
159
- this._y = y;
160
- };
161
- window.SVGPathSegLinetoRel.prototype = Object.create(window.SVGPathSeg.prototype);
162
- window.SVGPathSegLinetoRel.prototype.toString = function () {
163
- return "[object SVGPathSegLinetoRel]";
164
- };
165
- window.SVGPathSegLinetoRel.prototype._asPathString = function () {
166
- return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
167
- };
168
- window.SVGPathSegLinetoRel.prototype.clone = function () {
169
- return new window.SVGPathSegLinetoRel(undefined, this._x, this._y);
170
- };
171
- Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "x", {
172
- get: function () {
173
- return this._x;
174
- },
175
- set: function (x) {
176
- this._x = x;
177
- this._segmentChanged();
178
- },
179
- enumerable: true,
180
- });
181
- Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "y", {
182
- get: function () {
183
- return this._y;
184
- },
185
- set: function (y) {
186
- this._y = y;
187
- this._segmentChanged();
188
- },
189
- enumerable: true,
190
- });
191
- window.SVGPathSegCurvetoCubicAbs = function (owningPathSegList, x, y, x1, y1, x2, y2) {
192
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, "C", owningPathSegList);
193
- this._x = x;
194
- this._y = y;
195
- this._x1 = x1;
196
- this._y1 = y1;
197
- this._x2 = x2;
198
- this._y2 = y2;
199
- };
200
- window.SVGPathSegCurvetoCubicAbs.prototype = Object.create(window.SVGPathSeg.prototype);
201
- window.SVGPathSegCurvetoCubicAbs.prototype.toString = function () {
202
- return "[object SVGPathSegCurvetoCubicAbs]";
203
- };
204
- window.SVGPathSegCurvetoCubicAbs.prototype._asPathString = function () {
205
- return `${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x2} ${this._y2} ${this._x} ${this._y}`;
206
- };
207
- window.SVGPathSegCurvetoCubicAbs.prototype.clone = function () {
208
- return new window.SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2);
209
- };
210
- Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x", {
211
- get: function () {
212
- return this._x;
213
- },
214
- set: function (x) {
215
- this._x = x;
216
- this._segmentChanged();
217
- },
218
- enumerable: true,
219
- });
220
- Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y", {
221
- get: function () {
222
- return this._y;
223
- },
224
- set: function (y) {
225
- this._y = y;
226
- this._segmentChanged();
227
- },
228
- enumerable: true,
229
- });
230
- Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x1", {
231
- get: function () {
232
- return this._x1;
233
- },
234
- set: function (x1) {
235
- this._x1 = x1;
236
- this._segmentChanged();
237
- },
238
- enumerable: true,
239
- });
240
- Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y1", {
241
- get: function () {
242
- return this._y1;
243
- },
244
- set: function (y1) {
245
- this._y1 = y1;
246
- this._segmentChanged();
247
- },
248
- enumerable: true,
249
- });
250
- Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x2", {
251
- get: function () {
252
- return this._x2;
253
- },
254
- set: function (x2) {
255
- this._x2 = x2;
256
- this._segmentChanged();
257
- },
258
- enumerable: true,
259
- });
260
- Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y2", {
261
- get: function () {
262
- return this._y2;
263
- },
264
- set: function (y2) {
265
- this._y2 = y2;
266
- this._segmentChanged();
267
- },
268
- enumerable: true,
269
- });
270
- window.SVGPathSegCurvetoCubicRel = function (owningPathSegList, x, y, x1, y1, x2, y2) {
271
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, "c", owningPathSegList);
272
- this._x = x;
273
- this._y = y;
274
- this._x1 = x1;
275
- this._y1 = y1;
276
- this._x2 = x2;
277
- this._y2 = y2;
278
- };
279
- window.SVGPathSegCurvetoCubicRel.prototype = Object.create(window.SVGPathSeg.prototype);
280
- window.SVGPathSegCurvetoCubicRel.prototype.toString = function () {
281
- return "[object SVGPathSegCurvetoCubicRel]";
282
- };
283
- window.SVGPathSegCurvetoCubicRel.prototype._asPathString = function () {
284
- return `${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x2} ${this._y2} ${this._x} ${this._y}`;
285
- };
286
- window.SVGPathSegCurvetoCubicRel.prototype.clone = function () {
287
- return new window.SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2);
288
- };
289
- Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x", {
290
- get: function () {
291
- return this._x;
292
- },
293
- set: function (x) {
294
- this._x = x;
295
- this._segmentChanged();
296
- },
297
- enumerable: true,
298
- });
299
- Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y", {
300
- get: function () {
301
- return this._y;
302
- },
303
- set: function (y) {
304
- this._y = y;
305
- this._segmentChanged();
306
- },
307
- enumerable: true,
308
- });
309
- Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x1", {
310
- get: function () {
311
- return this._x1;
312
- },
313
- set: function (x1) {
314
- this._x1 = x1;
315
- this._segmentChanged();
316
- },
317
- enumerable: true,
318
- });
319
- Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y1", {
320
- get: function () {
321
- return this._y1;
322
- },
323
- set: function (y1) {
324
- this._y1 = y1;
325
- this._segmentChanged();
326
- },
327
- enumerable: true,
328
- });
329
- Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x2", {
330
- get: function () {
331
- return this._x2;
332
- },
333
- set: function (x2) {
334
- this._x2 = x2;
335
- this._segmentChanged();
336
- },
337
- enumerable: true,
338
- });
339
- Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y2", {
340
- get: function () {
341
- return this._y2;
342
- },
343
- set: function (y2) {
344
- this._y2 = y2;
345
- this._segmentChanged();
346
- },
347
- enumerable: true,
348
- });
349
- window.SVGPathSegCurvetoQuadraticAbs = function (owningPathSegList, x, y, x1, y1) {
350
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, "Q", owningPathSegList);
351
- this._x = x;
352
- this._y = y;
353
- this._x1 = x1;
354
- this._y1 = y1;
355
- };
356
- window.SVGPathSegCurvetoQuadraticAbs.prototype = Object.create(window.SVGPathSeg.prototype);
357
- window.SVGPathSegCurvetoQuadraticAbs.prototype.toString = function () {
358
- return "[object SVGPathSegCurvetoQuadraticAbs]";
359
- };
360
- window.SVGPathSegCurvetoQuadraticAbs.prototype._asPathString = function () {
361
- return `${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x} ${this._y}`;
362
- };
363
- window.SVGPathSegCurvetoQuadraticAbs.prototype.clone = function () {
364
- return new window.SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1);
365
- };
366
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x", {
367
- get: function () {
368
- return this._x;
369
- },
370
- set: function (x) {
371
- this._x = x;
372
- this._segmentChanged();
373
- },
374
- enumerable: true,
375
- });
376
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y", {
377
- get: function () {
378
- return this._y;
379
- },
380
- set: function (y) {
381
- this._y = y;
382
- this._segmentChanged();
383
- },
384
- enumerable: true,
385
- });
386
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x1", {
387
- get: function () {
388
- return this._x1;
389
- },
390
- set: function (x1) {
391
- this._x1 = x1;
392
- this._segmentChanged();
393
- },
394
- enumerable: true,
395
- });
396
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y1", {
397
- get: function () {
398
- return this._y1;
399
- },
400
- set: function (y1) {
401
- this._y1 = y1;
402
- this._segmentChanged();
403
- },
404
- enumerable: true,
405
- });
406
- window.SVGPathSegCurvetoQuadraticRel = function (owningPathSegList, x, y, x1, y1) {
407
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, "q", owningPathSegList);
408
- this._x = x;
409
- this._y = y;
410
- this._x1 = x1;
411
- this._y1 = y1;
412
- };
413
- window.SVGPathSegCurvetoQuadraticRel.prototype = Object.create(window.SVGPathSeg.prototype);
414
- window.SVGPathSegCurvetoQuadraticRel.prototype.toString = function () {
415
- return "[object SVGPathSegCurvetoQuadraticRel]";
416
- };
417
- window.SVGPathSegCurvetoQuadraticRel.prototype._asPathString = function () {
418
- return `${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x} ${this._y}`;
419
- };
420
- window.SVGPathSegCurvetoQuadraticRel.prototype.clone = function () {
421
- return new window.SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1);
422
- };
423
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x", {
424
- get: function () {
425
- return this._x;
426
- },
427
- set: function (x) {
428
- this._x = x;
429
- this._segmentChanged();
430
- },
431
- enumerable: true,
432
- });
433
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y", {
434
- get: function () {
435
- return this._y;
436
- },
437
- set: function (y) {
438
- this._y = y;
439
- this._segmentChanged();
440
- },
441
- enumerable: true,
442
- });
443
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x1", {
444
- get: function () {
445
- return this._x1;
446
- },
447
- set: function (x1) {
448
- this._x1 = x1;
449
- this._segmentChanged();
450
- },
451
- enumerable: true,
452
- });
453
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y1", {
454
- get: function () {
455
- return this._y1;
456
- },
457
- set: function (y1) {
458
- this._y1 = y1;
459
- this._segmentChanged();
460
- },
461
- enumerable: true,
462
- });
463
- window.SVGPathSegArcAbs = function (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
464
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_ABS, "A", owningPathSegList);
465
- this._x = x;
466
- this._y = y;
467
- this._r1 = r1;
468
- this._r2 = r2;
469
- this._angle = angle;
470
- this._largeArcFlag = largeArcFlag;
471
- this._sweepFlag = sweepFlag;
472
- };
473
- window.SVGPathSegArcAbs.prototype = Object.create(window.SVGPathSeg.prototype);
474
- window.SVGPathSegArcAbs.prototype.toString = function () {
475
- return "[object SVGPathSegArcAbs]";
476
- };
477
- window.SVGPathSegArcAbs.prototype._asPathString = function () {
478
- return `${this.pathSegTypeAsLetter} ${this._r1} ${this._r2} ${this._angle} ${this._largeArcFlag ? "1" : "0"} ${this._sweepFlag ? "1" : "0"} ${this._x} ${this._y}`;
479
- };
480
- window.SVGPathSegArcAbs.prototype.clone = function () {
481
- return new window.SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag);
482
- };
483
- Object.defineProperty(window.SVGPathSegArcAbs.prototype, "x", {
484
- get: function () {
485
- return this._x;
486
- },
487
- set: function (x) {
488
- this._x = x;
489
- this._segmentChanged();
490
- },
491
- enumerable: true,
492
- });
493
- Object.defineProperty(window.SVGPathSegArcAbs.prototype, "y", {
494
- get: function () {
495
- return this._y;
496
- },
497
- set: function (y) {
498
- this._y = y;
499
- this._segmentChanged();
500
- },
501
- enumerable: true,
502
- });
503
- Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r1", {
504
- get: function () {
505
- return this._r1;
506
- },
507
- set: function (r1) {
508
- this._r1 = r1;
509
- this._segmentChanged();
510
- },
511
- enumerable: true,
512
- });
513
- Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r2", {
514
- get: function () {
515
- return this._r2;
516
- },
517
- set: function (r2) {
518
- this._r2 = r2;
519
- this._segmentChanged();
520
- },
521
- enumerable: true,
522
- });
523
- Object.defineProperty(window.SVGPathSegArcAbs.prototype, "angle", {
524
- get: function () {
525
- return this._angle;
526
- },
527
- set: function (angle) {
528
- this._angle = angle;
529
- this._segmentChanged();
530
- },
531
- enumerable: true,
532
- });
533
- Object.defineProperty(window.SVGPathSegArcAbs.prototype, "largeArcFlag", {
534
- get: function () {
535
- return this._largeArcFlag;
536
- },
537
- set: function (largeArcFlag) {
538
- this._largeArcFlag = largeArcFlag;
539
- this._segmentChanged();
540
- },
541
- enumerable: true,
542
- });
543
- Object.defineProperty(window.SVGPathSegArcAbs.prototype, "sweepFlag", {
544
- get: function () {
545
- return this._sweepFlag;
546
- },
547
- set: function (sweepFlag) {
548
- this._sweepFlag = sweepFlag;
549
- this._segmentChanged();
550
- },
551
- enumerable: true,
552
- });
553
- window.SVGPathSegArcRel = function (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
554
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_REL, "a", owningPathSegList);
555
- this._x = x;
556
- this._y = y;
557
- this._r1 = r1;
558
- this._r2 = r2;
559
- this._angle = angle;
560
- this._largeArcFlag = largeArcFlag;
561
- this._sweepFlag = sweepFlag;
562
- };
563
- window.SVGPathSegArcRel.prototype = Object.create(window.SVGPathSeg.prototype);
564
- window.SVGPathSegArcRel.prototype.toString = function () {
565
- return "[object SVGPathSegArcRel]";
566
- };
567
- window.SVGPathSegArcRel.prototype._asPathString = function () {
568
- return `${this.pathSegTypeAsLetter} ${this._r1} ${this._r2} ${this._angle} ${this._largeArcFlag ? "1" : "0"} ${this._sweepFlag ? "1" : "0"} ${this._x} ${this._y}`;
569
- };
570
- window.SVGPathSegArcRel.prototype.clone = function () {
571
- return new window.SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag);
572
- };
573
- Object.defineProperty(window.SVGPathSegArcRel.prototype, "x", {
574
- get: function () {
575
- return this._x;
576
- },
577
- set: function (x) {
578
- this._x = x;
579
- this._segmentChanged();
580
- },
581
- enumerable: true,
582
- });
583
- Object.defineProperty(window.SVGPathSegArcRel.prototype, "y", {
584
- get: function () {
585
- return this._y;
586
- },
587
- set: function (y) {
588
- this._y = y;
589
- this._segmentChanged();
590
- },
591
- enumerable: true,
592
- });
593
- Object.defineProperty(window.SVGPathSegArcRel.prototype, "r1", {
594
- get: function () {
595
- return this._r1;
596
- },
597
- set: function (r1) {
598
- this._r1 = r1;
599
- this._segmentChanged();
600
- },
601
- enumerable: true,
602
- });
603
- Object.defineProperty(window.SVGPathSegArcRel.prototype, "r2", {
604
- get: function () {
605
- return this._r2;
606
- },
607
- set: function (r2) {
608
- this._r2 = r2;
609
- this._segmentChanged();
610
- },
611
- enumerable: true,
612
- });
613
- Object.defineProperty(window.SVGPathSegArcRel.prototype, "angle", {
614
- get: function () {
615
- return this._angle;
616
- },
617
- set: function (angle) {
618
- this._angle = angle;
619
- this._segmentChanged();
620
- },
621
- enumerable: true,
622
- });
623
- Object.defineProperty(window.SVGPathSegArcRel.prototype, "largeArcFlag", {
624
- get: function () {
625
- return this._largeArcFlag;
626
- },
627
- set: function (largeArcFlag) {
628
- this._largeArcFlag = largeArcFlag;
629
- this._segmentChanged();
630
- },
631
- enumerable: true,
632
- });
633
- Object.defineProperty(window.SVGPathSegArcRel.prototype, "sweepFlag", {
634
- get: function () {
635
- return this._sweepFlag;
636
- },
637
- set: function (sweepFlag) {
638
- this._sweepFlag = sweepFlag;
639
- this._segmentChanged();
640
- },
641
- enumerable: true,
642
- });
643
- window.SVGPathSegLinetoHorizontalAbs = function (owningPathSegList, x) {
644
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, "H", owningPathSegList);
645
- this._x = x;
646
- };
647
- window.SVGPathSegLinetoHorizontalAbs.prototype = Object.create(window.SVGPathSeg.prototype);
648
- window.SVGPathSegLinetoHorizontalAbs.prototype.toString = function () {
649
- return "[object SVGPathSegLinetoHorizontalAbs]";
650
- };
651
- window.SVGPathSegLinetoHorizontalAbs.prototype._asPathString = function () {
652
- return `${this.pathSegTypeAsLetter} ${this._x}`;
653
- };
654
- window.SVGPathSegLinetoHorizontalAbs.prototype.clone = function () {
655
- return new window.SVGPathSegLinetoHorizontalAbs(undefined, this._x);
656
- };
657
- Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype, "x", {
658
- get: function () {
659
- return this._x;
660
- },
661
- set: function (x) {
662
- this._x = x;
663
- this._segmentChanged();
664
- },
665
- enumerable: true,
666
- });
667
- window.SVGPathSegLinetoHorizontalRel = function (owningPathSegList, x) {
668
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, "h", owningPathSegList);
669
- this._x = x;
670
- };
671
- window.SVGPathSegLinetoHorizontalRel.prototype = Object.create(window.SVGPathSeg.prototype);
672
- window.SVGPathSegLinetoHorizontalRel.prototype.toString = function () {
673
- return "[object SVGPathSegLinetoHorizontalRel]";
674
- };
675
- window.SVGPathSegLinetoHorizontalRel.prototype._asPathString = function () {
676
- return `${this.pathSegTypeAsLetter} ${this._x}`;
677
- };
678
- window.SVGPathSegLinetoHorizontalRel.prototype.clone = function () {
679
- return new window.SVGPathSegLinetoHorizontalRel(undefined, this._x);
680
- };
681
- Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype, "x", {
682
- get: function () {
683
- return this._x;
684
- },
685
- set: function (x) {
686
- this._x = x;
687
- this._segmentChanged();
688
- },
689
- enumerable: true,
690
- });
691
- window.SVGPathSegLinetoVerticalAbs = function (owningPathSegList, y) {
692
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, "V", owningPathSegList);
693
- this._y = y;
694
- };
695
- window.SVGPathSegLinetoVerticalAbs.prototype = Object.create(window.SVGPathSeg.prototype);
696
- window.SVGPathSegLinetoVerticalAbs.prototype.toString = function () {
697
- return "[object SVGPathSegLinetoVerticalAbs]";
698
- };
699
- window.SVGPathSegLinetoVerticalAbs.prototype._asPathString = function () {
700
- return `${this.pathSegTypeAsLetter} ${this._y}`;
701
- };
702
- window.SVGPathSegLinetoVerticalAbs.prototype.clone = function () {
703
- return new window.SVGPathSegLinetoVerticalAbs(undefined, this._y);
704
- };
705
- Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype, "y", {
706
- get: function () {
707
- return this._y;
708
- },
709
- set: function (y) {
710
- this._y = y;
711
- this._segmentChanged();
712
- },
713
- enumerable: true,
714
- });
715
- window.SVGPathSegLinetoVerticalRel = function (owningPathSegList, y) {
716
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, "v", owningPathSegList);
717
- this._y = y;
718
- };
719
- window.SVGPathSegLinetoVerticalRel.prototype = Object.create(window.SVGPathSeg.prototype);
720
- window.SVGPathSegLinetoVerticalRel.prototype.toString = function () {
721
- return "[object SVGPathSegLinetoVerticalRel]";
722
- };
723
- window.SVGPathSegLinetoVerticalRel.prototype._asPathString = function () {
724
- return `${this.pathSegTypeAsLetter} ${this._y}`;
725
- };
726
- window.SVGPathSegLinetoVerticalRel.prototype.clone = function () {
727
- return new window.SVGPathSegLinetoVerticalRel(undefined, this._y);
728
- };
729
- Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype, "y", {
730
- get: function () {
731
- return this._y;
732
- },
733
- set: function (y) {
734
- this._y = y;
735
- this._segmentChanged();
736
- },
737
- enumerable: true,
738
- });
739
- window.SVGPathSegCurvetoCubicSmoothAbs = function (owningPathSegList, x, y, x2, y2) {
740
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, "S", owningPathSegList);
741
- this._x = x;
742
- this._y = y;
743
- this._x2 = x2;
744
- this._y2 = y2;
745
- };
746
- window.SVGPathSegCurvetoCubicSmoothAbs.prototype = Object.create(window.SVGPathSeg.prototype);
747
- window.SVGPathSegCurvetoCubicSmoothAbs.prototype.toString = function () {
748
- return "[object SVGPathSegCurvetoCubicSmoothAbs]";
749
- };
750
- window.SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString = function () {
751
- return `${this.pathSegTypeAsLetter} ${this._x2} ${this._y2} ${this._x} ${this._y}`;
752
- };
753
- window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone = function () {
754
- return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2);
755
- };
756
- Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x", {
757
- get: function () {
758
- return this._x;
759
- },
760
- set: function (x) {
761
- this._x = x;
762
- this._segmentChanged();
763
- },
764
- enumerable: true,
765
- });
766
- Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y", {
767
- get: function () {
768
- return this._y;
769
- },
770
- set: function (y) {
771
- this._y = y;
772
- this._segmentChanged();
773
- },
774
- enumerable: true,
775
- });
776
- Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x2", {
777
- get: function () {
778
- return this._x2;
779
- },
780
- set: function (x2) {
781
- this._x2 = x2;
782
- this._segmentChanged();
783
- },
784
- enumerable: true,
785
- });
786
- Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y2", {
787
- get: function () {
788
- return this._y2;
789
- },
790
- set: function (y2) {
791
- this._y2 = y2;
792
- this._segmentChanged();
793
- },
794
- enumerable: true,
795
- });
796
- window.SVGPathSegCurvetoCubicSmoothRel = function (owningPathSegList, x, y, x2, y2) {
797
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, "s", owningPathSegList);
798
- this._x = x;
799
- this._y = y;
800
- this._x2 = x2;
801
- this._y2 = y2;
802
- };
803
- window.SVGPathSegCurvetoCubicSmoothRel.prototype = Object.create(window.SVGPathSeg.prototype);
804
- window.SVGPathSegCurvetoCubicSmoothRel.prototype.toString = function () {
805
- return "[object SVGPathSegCurvetoCubicSmoothRel]";
806
- };
807
- window.SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString = function () {
808
- return `${this.pathSegTypeAsLetter} ${this._x2} ${this._y2} ${this._x} ${this._y}`;
809
- };
810
- window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone = function () {
811
- return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2);
812
- };
813
- Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x", {
814
- get: function () {
815
- return this._x;
816
- },
817
- set: function (x) {
818
- this._x = x;
819
- this._segmentChanged();
820
- },
821
- enumerable: true,
822
- });
823
- Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y", {
824
- get: function () {
825
- return this._y;
826
- },
827
- set: function (y) {
828
- this._y = y;
829
- this._segmentChanged();
830
- },
831
- enumerable: true,
832
- });
833
- Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x2", {
834
- get: function () {
835
- return this._x2;
836
- },
837
- set: function (x2) {
838
- this._x2 = x2;
839
- this._segmentChanged();
840
- },
841
- enumerable: true,
842
- });
843
- Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y2", {
844
- get: function () {
845
- return this._y2;
846
- },
847
- set: function (y2) {
848
- this._y2 = y2;
849
- this._segmentChanged();
850
- },
851
- enumerable: true,
852
- });
853
- window.SVGPathSegCurvetoQuadraticSmoothAbs = function (owningPathSegList, x, y) {
854
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, "T", owningPathSegList);
855
- this._x = x;
856
- this._y = y;
857
- };
858
- window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype = Object.create(window.SVGPathSeg.prototype);
859
- window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString = function () {
860
- return "[object SVGPathSegCurvetoQuadraticSmoothAbs]";
861
- };
862
- window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString = function () {
863
- return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
864
- };
865
- window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone = function () {
866
- return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y);
867
- };
868
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "x", {
869
- get: function () {
870
- return this._x;
871
- },
872
- set: function (x) {
873
- this._x = x;
874
- this._segmentChanged();
875
- },
876
- enumerable: true,
877
- });
878
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "y", {
879
- get: function () {
880
- return this._y;
881
- },
882
- set: function (y) {
883
- this._y = y;
884
- this._segmentChanged();
885
- },
886
- enumerable: true,
887
- });
888
- window.SVGPathSegCurvetoQuadraticSmoothRel = function (owningPathSegList, x, y) {
889
- window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, "t", owningPathSegList);
890
- this._x = x;
891
- this._y = y;
892
- };
893
- window.SVGPathSegCurvetoQuadraticSmoothRel.prototype = Object.create(window.SVGPathSeg.prototype);
894
- window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString = function () {
895
- return "[object SVGPathSegCurvetoQuadraticSmoothRel]";
896
- };
897
- window.SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString = function () {
898
- return `${this.pathSegTypeAsLetter} ${this._x} ${this._y}`;
899
- };
900
- window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone = function () {
901
- return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y);
902
- };
903
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "x", {
904
- get: function () {
905
- return this._x;
906
- },
907
- set: function (x) {
908
- this._x = x;
909
- this._segmentChanged();
910
- },
911
- enumerable: true,
912
- });
913
- Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "y", {
914
- get: function () {
915
- return this._y;
916
- },
917
- set: function (y) {
918
- this._y = y;
919
- this._segmentChanged();
920
- },
921
- enumerable: true,
922
- });
923
- window.SVGPathElement.prototype.createSVGPathSegClosePath = function () {
924
- return new window.SVGPathSegClosePath(undefined);
925
- };
926
- window.SVGPathElement.prototype.createSVGPathSegMovetoAbs = function (x, y) {
927
- return new window.SVGPathSegMovetoAbs(undefined, x, y);
928
- };
929
- window.SVGPathElement.prototype.createSVGPathSegMovetoRel = function (x, y) {
930
- return new window.SVGPathSegMovetoRel(undefined, x, y);
931
- };
932
- window.SVGPathElement.prototype.createSVGPathSegLinetoAbs = function (x, y) {
933
- return new window.SVGPathSegLinetoAbs(undefined, x, y);
934
- };
935
- window.SVGPathElement.prototype.createSVGPathSegLinetoRel = function (x, y) {
936
- return new window.SVGPathSegLinetoRel(undefined, x, y);
937
- };
938
- window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function (x, y, x1, y1, x2, y2) {
939
- return new window.SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2);
940
- };
941
- window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function (x, y, x1, y1, x2, y2) {
942
- return new window.SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2);
943
- };
944
- window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function (x, y, x1, y1) {
945
- return new window.SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1);
946
- };
947
- window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function (x, y, x1, y1) {
948
- return new window.SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1);
949
- };
950
- window.SVGPathElement.prototype.createSVGPathSegArcAbs = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
951
- return new window.SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
952
- };
953
- window.SVGPathElement.prototype.createSVGPathSegArcRel = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
954
- return new window.SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
955
- };
956
- window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function (x) {
957
- return new window.SVGPathSegLinetoHorizontalAbs(undefined, x);
958
- };
959
- window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function (x) {
960
- return new window.SVGPathSegLinetoHorizontalRel(undefined, x);
961
- };
962
- window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function (y) {
963
- return new window.SVGPathSegLinetoVerticalAbs(undefined, y);
964
- };
965
- window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function (y) {
966
- return new window.SVGPathSegLinetoVerticalRel(undefined, y);
967
- };
968
- window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function (x, y, x2, y2) {
969
- return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2);
970
- };
971
- window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function (x, y, x2, y2) {
972
- return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2);
973
- };
974
- window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function (x, y) {
975
- return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y);
976
- };
977
- window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function (x, y) {
978
- return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y);
979
- };
980
- if (!("getPathSegAtLength" in window.SVGPathElement.prototype)) {
981
- window.SVGPathElement.prototype.getPathSegAtLength = function (distance) {
982
- if (distance === undefined || !isFinite(distance))
983
- throw "Invalid arguments.";
984
- const measurementElement = document.createElementNS("http://www.w3.org/2000/svg", "path");
985
- measurementElement.setAttribute("d", this.getAttribute("d"));
986
- let lastPathSegment = measurementElement.pathSegList.numberOfItems - 1;
987
- if (lastPathSegment <= 0)
988
- return 0;
989
- do {
990
- measurementElement.pathSegList.removeItem(lastPathSegment);
991
- if (distance > measurementElement.getTotalLength())
992
- break;
993
- lastPathSegment--;
994
- } while (lastPathSegment > 0);
995
- return lastPathSegment;
996
- };
997
- }
998
- }
999
- if (!("SVGPathSegList" in window) || !("appendItem" in window.SVGPathSegList.prototype)) {
1000
- window.SVGPathSegList = function (pathElement) {
1001
- this._pathElement = pathElement;
1002
- this._list = this._parsePath(this._pathElement.getAttribute("d"));
1003
- this._mutationObserverConfig = { attributes: true, attributeFilter: ["d"] };
1004
- this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this));
1005
- this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
1006
- };
1007
- window.SVGPathSegList.prototype.classname = "SVGPathSegList";
1008
- Object.defineProperty(window.SVGPathSegList.prototype, "numberOfItems", {
1009
- get: function () {
1010
- this._checkPathSynchronizedToList();
1011
- return this._list.length;
1012
- },
1013
- enumerable: true,
1014
- });
1015
- Object.defineProperty(window.SVGPathSegList.prototype, "length", {
1016
- get: function () {
1017
- this._checkPathSynchronizedToList();
1018
- return this._list.length;
1019
- },
1020
- enumerable: true,
1021
- });
1022
- Object.defineProperty(window.SVGPathElement.prototype, "pathSegList", {
1023
- get: function () {
1024
- if (!this._pathSegList)
1025
- this._pathSegList = new window.SVGPathSegList(this);
1026
- return this._pathSegList;
1027
- },
1028
- enumerable: true,
1029
- });
1030
- Object.defineProperty(window.SVGPathElement.prototype, "normalizedPathSegList", {
1031
- get: function () {
1032
- return this.pathSegList;
1033
- },
1034
- enumerable: true,
1035
- });
1036
- Object.defineProperty(window.SVGPathElement.prototype, "animatedPathSegList", {
1037
- get: function () {
1038
- return this.pathSegList;
1039
- },
1040
- enumerable: true,
1041
- });
1042
- Object.defineProperty(window.SVGPathElement.prototype, "animatedNormalizedPathSegList", {
1043
- get: function () {
1044
- return this.pathSegList;
1045
- },
1046
- enumerable: true,
1047
- });
1048
- window.SVGPathSegList.prototype._checkPathSynchronizedToList = function () {
1049
- this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());
1050
- };
1051
- window.SVGPathSegList.prototype._updateListFromPathMutations = function (mutationRecords) {
1052
- if (!this._pathElement)
1053
- return;
1054
- let hasPathMutations = false;
1055
- mutationRecords.forEach(function (record) {
1056
- if (record.attributeName == "d")
1057
- hasPathMutations = true;
1058
- });
1059
- if (hasPathMutations)
1060
- this._list = this._parsePath(this._pathElement.getAttribute("d"));
1061
- };
1062
- window.SVGPathSegList.prototype._writeListToPath = function () {
1063
- this._pathElementMutationObserver.disconnect();
1064
- this._pathElement.setAttribute("d", window.SVGPathSegList._pathSegArrayAsString(this._list));
1065
- this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
1066
- };
1067
- window.SVGPathSegList.prototype.segmentChanged = function () {
1068
- this._writeListToPath();
1069
- };
1070
- window.SVGPathSegList.prototype.clear = function () {
1071
- this._checkPathSynchronizedToList();
1072
- this._list.forEach(function (pathSeg) {
1073
- pathSeg._owningPathSegList = null;
1074
- });
1075
- this._list = [];
1076
- this._writeListToPath();
1077
- };
1078
- window.SVGPathSegList.prototype.initialize = function (newItem) {
1079
- this._checkPathSynchronizedToList();
1080
- this._list = [newItem];
1081
- newItem._owningPathSegList = this;
1082
- this._writeListToPath();
1083
- return newItem;
1084
- };
1085
- window.SVGPathSegList.prototype._checkValidIndex = function (index) {
1086
- if (isNaN(index) || index < 0 || index >= this.numberOfItems)
1087
- throw "INDEX_SIZE_ERR";
1088
- };
1089
- window.SVGPathSegList.prototype.getItem = function (index) {
1090
- this._checkPathSynchronizedToList();
1091
- this._checkValidIndex(index);
1092
- return this._list[index];
1093
- };
1094
- window.SVGPathSegList.prototype.insertItemBefore = function (newItem, index) {
1095
- this._checkPathSynchronizedToList();
1096
- if (index > this.numberOfItems)
1097
- index = this.numberOfItems;
1098
- if (newItem._owningPathSegList) {
1099
- newItem = newItem.clone();
1100
- }
1101
- this._list.splice(index, 0, newItem);
1102
- newItem._owningPathSegList = this;
1103
- this._writeListToPath();
1104
- return newItem;
1105
- };
1106
- window.SVGPathSegList.prototype.replaceItem = function (newItem, index) {
1107
- this._checkPathSynchronizedToList();
1108
- if (newItem._owningPathSegList) {
1109
- newItem = newItem.clone();
1110
- }
1111
- this._checkValidIndex(index);
1112
- this._list[index] = newItem;
1113
- newItem._owningPathSegList = this;
1114
- this._writeListToPath();
1115
- return newItem;
1116
- };
1117
- window.SVGPathSegList.prototype.removeItem = function (index) {
1118
- this._checkPathSynchronizedToList();
1119
- this._checkValidIndex(index);
1120
- const item = this._list[index];
1121
- this._list.splice(index, 1);
1122
- this._writeListToPath();
1123
- return item;
1124
- };
1125
- window.SVGPathSegList.prototype.appendItem = function (newItem) {
1126
- this._checkPathSynchronizedToList();
1127
- if (newItem._owningPathSegList) {
1128
- newItem = newItem.clone();
1129
- }
1130
- this._list.push(newItem);
1131
- newItem._owningPathSegList = this;
1132
- this._writeListToPath();
1133
- return newItem;
1134
- };
1135
- window.SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
1136
- let string = "";
1137
- let first = true;
1138
- pathSegArray.forEach(function (pathSeg) {
1139
- if (first) {
1140
- first = false;
1141
- string += pathSeg._asPathString();
1142
- }
1143
- else {
1144
- string += ` ${pathSeg._asPathString()}`;
1145
- }
1146
- });
1147
- return string;
1148
- };
1149
- window.SVGPathSegList.prototype._parsePath = function (string) {
1150
- if (!string?.length)
1151
- return [];
1152
- const owningPathSegList = this;
1153
- const Builder = function () {
1154
- this.pathSegList = [];
1155
- };
1156
- Builder.prototype.appendSegment = function (pathSeg) {
1157
- this.pathSegList.push(pathSeg);
1158
- };
1159
- const Source = function (string) {
1160
- this._string = string;
1161
- this._currentIndex = 0;
1162
- this._endIndex = this._string.length;
1163
- this._previousCommand = window.SVGPathSeg.PATHSEG_UNKNOWN;
1164
- this._skipOptionalSpaces();
1165
- };
1166
- Source.prototype._isCurrentSpace = function () {
1167
- const character = this._string[this._currentIndex];
1168
- return (character <= " " &&
1169
- (character == " " || character == "\n" || character == "\t" || character == "\r" || character == "\f"));
1170
- };
1171
- Source.prototype._skipOptionalSpaces = function () {
1172
- while (this._currentIndex < this._endIndex && this._isCurrentSpace())
1173
- this._currentIndex++;
1174
- return this._currentIndex < this._endIndex;
1175
- };
1176
- Source.prototype._skipOptionalSpacesOrDelimiter = function () {
1177
- if (this._currentIndex < this._endIndex &&
1178
- !this._isCurrentSpace() &&
1179
- this._string.charAt(this._currentIndex) != ",")
1180
- return false;
1181
- if (this._skipOptionalSpaces()) {
1182
- if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == ",") {
1183
- this._currentIndex++;
1184
- this._skipOptionalSpaces();
1185
- }
1186
- }
1187
- return this._currentIndex < this._endIndex;
1188
- };
1189
- Source.prototype.hasMoreData = function () {
1190
- return this._currentIndex < this._endIndex;
1191
- };
1192
- Source.prototype.peekSegmentType = function () {
1193
- const lookahead = this._string[this._currentIndex];
1194
- return this._pathSegTypeFromChar(lookahead);
1195
- };
1196
- Source.prototype._pathSegTypeFromChar = function (lookahead) {
1197
- switch (lookahead) {
1198
- case "Z":
1199
- case "z":
1200
- return window.SVGPathSeg.PATHSEG_CLOSEPATH;
1201
- case "M":
1202
- return window.SVGPathSeg.PATHSEG_MOVETO_ABS;
1203
- case "m":
1204
- return window.SVGPathSeg.PATHSEG_MOVETO_REL;
1205
- case "L":
1206
- return window.SVGPathSeg.PATHSEG_LINETO_ABS;
1207
- case "l":
1208
- return window.SVGPathSeg.PATHSEG_LINETO_REL;
1209
- case "C":
1210
- return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;
1211
- case "c":
1212
- return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;
1213
- case "Q":
1214
- return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;
1215
- case "q":
1216
- return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;
1217
- case "A":
1218
- return window.SVGPathSeg.PATHSEG_ARC_ABS;
1219
- case "a":
1220
- return window.SVGPathSeg.PATHSEG_ARC_REL;
1221
- case "H":
1222
- return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;
1223
- case "h":
1224
- return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;
1225
- case "V":
1226
- return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;
1227
- case "v":
1228
- return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;
1229
- case "S":
1230
- return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
1231
- case "s":
1232
- return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
1233
- case "T":
1234
- return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
1235
- case "t":
1236
- return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
1237
- default:
1238
- return window.SVGPathSeg.PATHSEG_UNKNOWN;
1239
- }
1240
- };
1241
- Source.prototype._nextCommandHelper = function (lookahead, previousCommand) {
1242
- if ((lookahead == "+" || lookahead == "-" || lookahead == "." || (lookahead >= "0" && lookahead <= "9")) &&
1243
- previousCommand != window.SVGPathSeg.PATHSEG_CLOSEPATH) {
1244
- if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_ABS)
1245
- return window.SVGPathSeg.PATHSEG_LINETO_ABS;
1246
- if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_REL)
1247
- return window.SVGPathSeg.PATHSEG_LINETO_REL;
1248
- return previousCommand;
1249
- }
1250
- return window.SVGPathSeg.PATHSEG_UNKNOWN;
1251
- };
1252
- Source.prototype.initialCommandIsMoveTo = function () {
1253
- if (!this.hasMoreData())
1254
- return true;
1255
- const command = this.peekSegmentType();
1256
- return command == window.SVGPathSeg.PATHSEG_MOVETO_ABS || command == window.SVGPathSeg.PATHSEG_MOVETO_REL;
1257
- };
1258
- Source.prototype._parseNumber = function () {
1259
- let exponent = 0;
1260
- let integer = 0;
1261
- let frac = 1;
1262
- let decimal = 0;
1263
- let sign = 1;
1264
- let expsign = 1;
1265
- const startIndex = this._currentIndex;
1266
- this._skipOptionalSpaces();
1267
- if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == "+")
1268
- this._currentIndex++;
1269
- else if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == "-") {
1270
- this._currentIndex++;
1271
- sign = -1;
1272
- }
1273
- if (this._currentIndex == this._endIndex ||
1274
- ((this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") &&
1275
- this._string.charAt(this._currentIndex) != "."))
1276
- return undefined;
1277
- const startIntPartIndex = this._currentIndex;
1278
- while (this._currentIndex < this._endIndex &&
1279
- this._string.charAt(this._currentIndex) >= "0" &&
1280
- this._string.charAt(this._currentIndex) <= "9")
1281
- this._currentIndex++;
1282
- if (this._currentIndex != startIntPartIndex) {
1283
- let scanIntPartIndex = this._currentIndex - 1;
1284
- let multiplier = 1;
1285
- while (scanIntPartIndex >= startIntPartIndex) {
1286
- integer += multiplier * (this._string.charAt(scanIntPartIndex--) - "0");
1287
- multiplier *= 10;
1288
- }
1289
- }
1290
- if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == ".") {
1291
- this._currentIndex++;
1292
- if (this._currentIndex >= this._endIndex ||
1293
- this._string.charAt(this._currentIndex) < "0" ||
1294
- this._string.charAt(this._currentIndex) > "9")
1295
- return undefined;
1296
- while (this._currentIndex < this._endIndex &&
1297
- this._string.charAt(this._currentIndex) >= "0" &&
1298
- this._string.charAt(this._currentIndex) <= "9") {
1299
- frac *= 10;
1300
- decimal += (this._string.charAt(this._currentIndex) - "0") / frac;
1301
- this._currentIndex += 1;
1302
- }
1303
- }
1304
- if (this._currentIndex != startIndex &&
1305
- this._currentIndex + 1 < this._endIndex &&
1306
- (this._string.charAt(this._currentIndex) == "e" || this._string.charAt(this._currentIndex) == "E") &&
1307
- this._string.charAt(this._currentIndex + 1) != "x" &&
1308
- this._string.charAt(this._currentIndex + 1) != "m") {
1309
- this._currentIndex++;
1310
- if (this._string.charAt(this._currentIndex) == "+") {
1311
- this._currentIndex++;
1312
- }
1313
- else if (this._string.charAt(this._currentIndex) == "-") {
1314
- this._currentIndex++;
1315
- expsign = -1;
1316
- }
1317
- if (this._currentIndex >= this._endIndex ||
1318
- this._string.charAt(this._currentIndex) < "0" ||
1319
- this._string.charAt(this._currentIndex) > "9")
1320
- return undefined;
1321
- while (this._currentIndex < this._endIndex &&
1322
- this._string.charAt(this._currentIndex) >= "0" &&
1323
- this._string.charAt(this._currentIndex) <= "9") {
1324
- exponent *= 10;
1325
- exponent += this._string.charAt(this._currentIndex) - "0";
1326
- this._currentIndex++;
1327
- }
1328
- }
1329
- let number = integer + decimal;
1330
- number *= sign;
1331
- if (exponent)
1332
- number *= Math.pow(10, expsign * exponent);
1333
- if (startIndex == this._currentIndex)
1334
- return undefined;
1335
- this._skipOptionalSpacesOrDelimiter();
1336
- return number;
1337
- };
1338
- Source.prototype._parseArcFlag = function () {
1339
- if (this._currentIndex >= this._endIndex)
1340
- return undefined;
1341
- let flag = false;
1342
- const flagChar = this._string.charAt(this._currentIndex++);
1343
- if (flagChar == "0")
1344
- flag = false;
1345
- else if (flagChar == "1")
1346
- flag = true;
1347
- else
1348
- return undefined;
1349
- this._skipOptionalSpacesOrDelimiter();
1350
- return flag;
1351
- };
1352
- Source.prototype.parseSegment = function () {
1353
- const lookahead = this._string[this._currentIndex];
1354
- let command = this._pathSegTypeFromChar(lookahead);
1355
- if (command == window.SVGPathSeg.PATHSEG_UNKNOWN) {
1356
- if (this._previousCommand == window.SVGPathSeg.PATHSEG_UNKNOWN)
1357
- return null;
1358
- command = this._nextCommandHelper(lookahead, this._previousCommand);
1359
- if (command == window.SVGPathSeg.PATHSEG_UNKNOWN)
1360
- return null;
1361
- }
1362
- else {
1363
- this._currentIndex++;
1364
- }
1365
- this._previousCommand = command;
1366
- let points;
1367
- switch (command) {
1368
- case window.SVGPathSeg.PATHSEG_MOVETO_REL:
1369
- return new window.SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());
1370
- case window.SVGPathSeg.PATHSEG_MOVETO_ABS:
1371
- return new window.SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
1372
- case window.SVGPathSeg.PATHSEG_LINETO_REL:
1373
- return new window.SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());
1374
- case window.SVGPathSeg.PATHSEG_LINETO_ABS:
1375
- return new window.SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
1376
- case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:
1377
- return new window.SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber());
1378
- case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:
1379
- return new window.SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber());
1380
- case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:
1381
- return new window.SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber());
1382
- case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:
1383
- return new window.SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber());
1384
- case window.SVGPathSeg.PATHSEG_CLOSEPATH:
1385
- this._skipOptionalSpaces();
1386
- return new window.SVGPathSegClosePath(owningPathSegList);
1387
- case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:
1388
- points = {
1389
- x1: this._parseNumber(),
1390
- y1: this._parseNumber(),
1391
- x2: this._parseNumber(),
1392
- y2: this._parseNumber(),
1393
- x: this._parseNumber(),
1394
- y: this._parseNumber(),
1395
- };
1396
- return new window.SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);
1397
- case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:
1398
- points = {
1399
- x1: this._parseNumber(),
1400
- y1: this._parseNumber(),
1401
- x2: this._parseNumber(),
1402
- y2: this._parseNumber(),
1403
- x: this._parseNumber(),
1404
- y: this._parseNumber(),
1405
- };
1406
- return new window.SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);
1407
- case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
1408
- points = {
1409
- x2: this._parseNumber(),
1410
- y2: this._parseNumber(),
1411
- x: this._parseNumber(),
1412
- y: this._parseNumber(),
1413
- };
1414
- return new window.SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2);
1415
- case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
1416
- points = {
1417
- x2: this._parseNumber(),
1418
- y2: this._parseNumber(),
1419
- x: this._parseNumber(),
1420
- y: this._parseNumber(),
1421
- };
1422
- return new window.SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2);
1423
- case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:
1424
- points = {
1425
- x1: this._parseNumber(),
1426
- y1: this._parseNumber(),
1427
- x: this._parseNumber(),
1428
- y: this._parseNumber(),
1429
- };
1430
- return new window.SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1);
1431
- case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:
1432
- points = {
1433
- x1: this._parseNumber(),
1434
- y1: this._parseNumber(),
1435
- x: this._parseNumber(),
1436
- y: this._parseNumber(),
1437
- };
1438
- return new window.SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1);
1439
- case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
1440
- return new window.SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber());
1441
- case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
1442
- return new window.SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
1443
- case window.SVGPathSeg.PATHSEG_ARC_REL:
1444
- points = {
1445
- x1: this._parseNumber(),
1446
- y1: this._parseNumber(),
1447
- arcAngle: this._parseNumber(),
1448
- arcLarge: this._parseArcFlag(),
1449
- arcSweep: this._parseArcFlag(),
1450
- x: this._parseNumber(),
1451
- y: this._parseNumber(),
1452
- };
1453
- return new window.SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);
1454
- case window.SVGPathSeg.PATHSEG_ARC_ABS:
1455
- points = {
1456
- x1: this._parseNumber(),
1457
- y1: this._parseNumber(),
1458
- arcAngle: this._parseNumber(),
1459
- arcLarge: this._parseArcFlag(),
1460
- arcSweep: this._parseArcFlag(),
1461
- x: this._parseNumber(),
1462
- y: this._parseNumber(),
1463
- };
1464
- return new window.SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);
1465
- default:
1466
- throw "Unknown path seg type.";
1467
- }
1468
- };
1469
- const builder = new Builder();
1470
- const source = new Source(string);
1471
- if (!source.initialCommandIsMoveTo())
1472
- return [];
1473
- while (source.hasMoreData()) {
1474
- const pathSeg = source.parseSegment();
1475
- if (!pathSeg)
1476
- return [];
1477
- builder.appendSegment(pathSeg);
1478
- }
1479
- return builder.pathSegList;
1480
- };
1481
- }
1482
- }
1483
- catch (e) {
1484
- console.warn("An error occurred in tsParticles pathseg polyfill. If the Polygon Mask is not working, please open an issue here: https://github.com/tsparticles/tsparticles", e);
1485
- }
1486
- })();