svg-path-commander 2.1.5 → 2.1.6
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/README.md +2 -2
- package/dist/svg-path-commander.cjs +1 -1
- package/dist/svg-path-commander.cjs.map +1 -1
- package/dist/svg-path-commander.d.ts +1 -1
- package/dist/svg-path-commander.js +1 -1
- package/dist/svg-path-commander.js.map +1 -1
- package/dist/svg-path-commander.mjs +452 -408
- package/dist/svg-path-commander.mjs.map +1 -1
- package/package.json +9 -9
- package/.lgtm.yml +0 -9
- package/tsconfig.json +0 -34
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
const
|
|
1
|
+
var Qe = Object.defineProperty;
|
|
2
|
+
var Ze = (e, t, s) => t in e ? Qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var b = (e, t, s) => Ze(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
+
var De = Object.defineProperty, Oe = (e, t, s) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, j = (e, t, s) => Oe(e, typeof t != "symbol" ? t + "" : t, s);
|
|
5
|
+
const Be = {
|
|
6
6
|
a: 1,
|
|
7
7
|
b: 0,
|
|
8
8
|
c: 0,
|
|
@@ -27,13 +27,32 @@ const Oe = {
|
|
|
27
27
|
m44: 1,
|
|
28
28
|
is2D: !0,
|
|
29
29
|
isIdentity: !0
|
|
30
|
-
}, Gt = (e) => (e instanceof Float64Array || e instanceof Float32Array || Array.isArray(e) && e.every((t) => typeof t == "number")) && [6, 16].some((t) => e.length === t), te = (e) => e instanceof DOMMatrix || e instanceof
|
|
31
|
-
const t = new
|
|
30
|
+
}, Gt = (e) => (e instanceof Float64Array || e instanceof Float32Array || Array.isArray(e) && e.every((t) => typeof t == "number")) && [6, 16].some((t) => e.length === t), te = (e) => e instanceof DOMMatrix || e instanceof C || typeof e == "object" && Object.keys(Be).every((t) => e && t in e), lt = (e) => {
|
|
31
|
+
const t = new C(), s = Array.from(e);
|
|
32
32
|
if (!Gt(s))
|
|
33
|
-
throw TypeError(
|
|
33
|
+
throw TypeError(
|
|
34
|
+
`CSSMatrix: "${s.join(",")}" must be an array with 6/16 numbers.`
|
|
35
|
+
);
|
|
34
36
|
if (s.length === 16) {
|
|
35
|
-
const [
|
|
36
|
-
|
|
37
|
+
const [
|
|
38
|
+
r,
|
|
39
|
+
n,
|
|
40
|
+
i,
|
|
41
|
+
o,
|
|
42
|
+
l,
|
|
43
|
+
c,
|
|
44
|
+
a,
|
|
45
|
+
u,
|
|
46
|
+
f,
|
|
47
|
+
h,
|
|
48
|
+
y,
|
|
49
|
+
m,
|
|
50
|
+
g,
|
|
51
|
+
d,
|
|
52
|
+
M,
|
|
53
|
+
w
|
|
54
|
+
] = s;
|
|
55
|
+
t.m11 = r, t.a = r, t.m21 = l, t.c = l, t.m31 = f, t.m41 = g, t.e = g, t.m12 = n, t.b = n, t.m22 = c, t.d = c, t.m32 = h, t.m42 = d, t.f = d, t.m13 = i, t.m23 = a, t.m33 = y, t.m43 = M, t.m14 = o, t.m24 = u, t.m34 = m, t.m44 = w;
|
|
37
56
|
} else if (s.length === 6) {
|
|
38
57
|
const [r, n, i, o, l, c] = s;
|
|
39
58
|
t.m11 = r, t.a = r, t.m12 = n, t.b = n, t.m21 = i, t.c = i, t.m22 = o, t.d = o, t.m41 = l, t.e = l, t.m42 = c, t.f = c;
|
|
@@ -59,43 +78,53 @@ const Oe = {
|
|
|
59
78
|
e.m43,
|
|
60
79
|
e.m44
|
|
61
80
|
]);
|
|
62
|
-
throw TypeError(
|
|
81
|
+
throw TypeError(
|
|
82
|
+
`CSSMatrix: "${JSON.stringify(e)}" is not a DOMMatrix / CSSMatrix / JSON compatible object.`
|
|
83
|
+
);
|
|
63
84
|
}, ne = (e) => {
|
|
64
85
|
if (typeof e != "string")
|
|
65
86
|
throw TypeError(`CSSMatrix: "${JSON.stringify(e)}" is not a string.`);
|
|
66
87
|
const t = String(e).replace(/\s/g, "");
|
|
67
|
-
let s = new
|
|
88
|
+
let s = new C();
|
|
68
89
|
const r = `CSSMatrix: invalid transform string "${e}"`;
|
|
69
90
|
return t.split(")").filter((n) => n).forEach((n) => {
|
|
70
91
|
const [i, o] = n.split("(");
|
|
71
92
|
if (!o) throw TypeError(r);
|
|
72
|
-
const l = o.split(",").map(
|
|
73
|
-
|
|
93
|
+
const l = o.split(",").map(
|
|
94
|
+
(m) => m.includes("rad") ? parseFloat(m) * (180 / Math.PI) : parseFloat(m)
|
|
95
|
+
), [c, a, u, f] = l, h = [c, a, u], y = [c, a, u, f];
|
|
96
|
+
if (i === "perspective" && c && [a, u].every((m) => m === void 0))
|
|
74
97
|
s.m34 = -1 / c;
|
|
75
|
-
else if (i.includes("matrix") && [6, 16].includes(l.length) && l.every((
|
|
76
|
-
const
|
|
77
|
-
s = s.multiply(lt(
|
|
78
|
-
} else if (i === "translate3d" && h.every((
|
|
98
|
+
else if (i.includes("matrix") && [6, 16].includes(l.length) && l.every((m) => !Number.isNaN(+m))) {
|
|
99
|
+
const m = l.map((g) => Math.abs(g) < 1e-6 ? 0 : g);
|
|
100
|
+
s = s.multiply(lt(m));
|
|
101
|
+
} else if (i === "translate3d" && h.every((m) => !Number.isNaN(+m)))
|
|
79
102
|
s = s.translate(c, a, u);
|
|
80
103
|
else if (i === "translate" && c && u === void 0)
|
|
81
104
|
s = s.translate(c, a || 0, 0);
|
|
82
|
-
else if (i === "rotate3d" &&
|
|
83
|
-
s = s.rotateAxisAngle(c, a, u,
|
|
84
|
-
else if (i === "rotate" && c && [a, u].every((
|
|
105
|
+
else if (i === "rotate3d" && y.every((m) => !Number.isNaN(+m)) && f)
|
|
106
|
+
s = s.rotateAxisAngle(c, a, u, f);
|
|
107
|
+
else if (i === "rotate" && c && [a, u].every((m) => m === void 0))
|
|
85
108
|
s = s.rotate(0, 0, c);
|
|
86
|
-
else if (i === "scale3d" && h.every((
|
|
109
|
+
else if (i === "scale3d" && h.every((m) => !Number.isNaN(+m)) && h.some((m) => m !== 1))
|
|
87
110
|
s = s.scale(c, a, u);
|
|
88
111
|
else if (i === "scale" && !Number.isNaN(c) && c !== 1 && u === void 0) {
|
|
89
|
-
const
|
|
90
|
-
s = s.scale(c,
|
|
112
|
+
const m = Number.isNaN(+a) ? c : a;
|
|
113
|
+
s = s.scale(c, m, 1);
|
|
91
114
|
} else if (i === "skew" && (c || !Number.isNaN(c) && a) && u === void 0)
|
|
92
115
|
s = s.skew(c, a || 0);
|
|
93
|
-
else if (["translate", "rotate", "scale", "skew"].some(
|
|
116
|
+
else if (["translate", "rotate", "scale", "skew"].some(
|
|
117
|
+
(m) => i.includes(m)
|
|
118
|
+
) && /[XYZ]/.test(i) && c && [a, u].every((m) => m === void 0))
|
|
94
119
|
if (i === "skewX" || i === "skewY")
|
|
95
120
|
s = s[i](c);
|
|
96
121
|
else {
|
|
97
|
-
const
|
|
98
|
-
|
|
122
|
+
const m = i.replace(/[XYZ]/, ""), g = i.replace(m, ""), d = ["X", "Y", "Z"].indexOf(g), M = m === "scale" ? 1 : 0, w = [
|
|
123
|
+
d === 0 ? c : M,
|
|
124
|
+
d === 1 ? c : M,
|
|
125
|
+
d === 2 ? c : M
|
|
126
|
+
];
|
|
127
|
+
s = s[m](...w);
|
|
99
128
|
}
|
|
100
129
|
else
|
|
101
130
|
throw TypeError(r);
|
|
@@ -118,32 +147,32 @@ const Oe = {
|
|
|
118
147
|
e.m43,
|
|
119
148
|
e.m44
|
|
120
149
|
], se = (e, t, s) => {
|
|
121
|
-
const r = new
|
|
150
|
+
const r = new C();
|
|
122
151
|
return r.m41 = e, r.e = e, r.m42 = t, r.f = t, r.m43 = s, r;
|
|
123
152
|
}, re = (e, t, s) => {
|
|
124
|
-
const r = new
|
|
125
|
-
r.m11 =
|
|
126
|
-
const
|
|
127
|
-
r.m21 =
|
|
128
|
-
const M = c * h - a *
|
|
129
|
-
return r.m22 = M, r.d = M, r.m23 = -a * u, r.m31 = a *
|
|
153
|
+
const r = new C(), n = Math.PI / 180, i = e * n, o = t * n, l = s * n, c = Math.cos(i), a = -Math.sin(i), u = Math.cos(o), f = -Math.sin(o), h = Math.cos(l), y = -Math.sin(l), m = u * h, g = -u * y;
|
|
154
|
+
r.m11 = m, r.a = m, r.m12 = g, r.b = g, r.m13 = f;
|
|
155
|
+
const d = a * f * h + c * y;
|
|
156
|
+
r.m21 = d, r.c = d;
|
|
157
|
+
const M = c * h - a * f * y;
|
|
158
|
+
return r.m22 = M, r.d = M, r.m23 = -a * u, r.m31 = a * y - c * f * h, r.m32 = a * h + c * f * y, r.m33 = c * u, r;
|
|
130
159
|
}, ie = (e, t, s, r) => {
|
|
131
|
-
const n = new
|
|
160
|
+
const n = new C(), i = Math.sqrt(e * e + t * t + s * s);
|
|
132
161
|
if (i === 0)
|
|
133
162
|
return n;
|
|
134
|
-
const o = e / i, l = t / i, c = s / i, a = r * (Math.PI / 360), u = Math.sin(a),
|
|
135
|
-
n.m11 =
|
|
136
|
-
const M = 2 * (o * l * h + c * u *
|
|
137
|
-
n.m12 = M, n.b = M, n.m13 = 2 * (o * c * h - l * u *
|
|
138
|
-
const
|
|
139
|
-
n.m21 =
|
|
140
|
-
const x = 1 - 2 * (
|
|
141
|
-
return n.m22 = x, n.d = x, n.m23 = 2 * (l * c * h + o * u *
|
|
163
|
+
const o = e / i, l = t / i, c = s / i, a = r * (Math.PI / 360), u = Math.sin(a), f = Math.cos(a), h = u * u, y = o * o, m = l * l, g = c * c, d = 1 - 2 * (m + g) * h;
|
|
164
|
+
n.m11 = d, n.a = d;
|
|
165
|
+
const M = 2 * (o * l * h + c * u * f);
|
|
166
|
+
n.m12 = M, n.b = M, n.m13 = 2 * (o * c * h - l * u * f);
|
|
167
|
+
const w = 2 * (l * o * h - c * u * f);
|
|
168
|
+
n.m21 = w, n.c = w;
|
|
169
|
+
const x = 1 - 2 * (g + y) * h;
|
|
170
|
+
return n.m22 = x, n.d = x, n.m23 = 2 * (l * c * h + o * u * f), n.m31 = 2 * (c * o * h + l * u * f), n.m32 = 2 * (c * l * h - o * u * f), n.m33 = 1 - 2 * (y + m) * h, n;
|
|
142
171
|
}, oe = (e, t, s) => {
|
|
143
|
-
const r = new
|
|
172
|
+
const r = new C();
|
|
144
173
|
return r.m11 = e, r.a = e, r.m22 = t, r.d = t, r.m33 = s, r;
|
|
145
174
|
}, At = (e, t) => {
|
|
146
|
-
const s = new
|
|
175
|
+
const s = new C();
|
|
147
176
|
if (e) {
|
|
148
177
|
const r = e * Math.PI / 180, n = Math.tan(r);
|
|
149
178
|
s.m21 = n, s.c = n;
|
|
@@ -154,10 +183,27 @@ const Oe = {
|
|
|
154
183
|
}
|
|
155
184
|
return s;
|
|
156
185
|
}, ce = (e) => At(e, 0), le = (e) => At(0, e), _ = (e, t) => {
|
|
157
|
-
const s = t.m11 * e.m11 + t.m12 * e.m21 + t.m13 * e.m31 + t.m14 * e.m41, r = t.m11 * e.m12 + t.m12 * e.m22 + t.m13 * e.m32 + t.m14 * e.m42, n = t.m11 * e.m13 + t.m12 * e.m23 + t.m13 * e.m33 + t.m14 * e.m43, i = t.m11 * e.m14 + t.m12 * e.m24 + t.m13 * e.m34 + t.m14 * e.m44, o = t.m21 * e.m11 + t.m22 * e.m21 + t.m23 * e.m31 + t.m24 * e.m41, l = t.m21 * e.m12 + t.m22 * e.m22 + t.m23 * e.m32 + t.m24 * e.m42, c = t.m21 * e.m13 + t.m22 * e.m23 + t.m23 * e.m33 + t.m24 * e.m43, a = t.m21 * e.m14 + t.m22 * e.m24 + t.m23 * e.m34 + t.m24 * e.m44, u = t.m31 * e.m11 + t.m32 * e.m21 + t.m33 * e.m31 + t.m34 * e.m41,
|
|
158
|
-
return lt([
|
|
186
|
+
const s = t.m11 * e.m11 + t.m12 * e.m21 + t.m13 * e.m31 + t.m14 * e.m41, r = t.m11 * e.m12 + t.m12 * e.m22 + t.m13 * e.m32 + t.m14 * e.m42, n = t.m11 * e.m13 + t.m12 * e.m23 + t.m13 * e.m33 + t.m14 * e.m43, i = t.m11 * e.m14 + t.m12 * e.m24 + t.m13 * e.m34 + t.m14 * e.m44, o = t.m21 * e.m11 + t.m22 * e.m21 + t.m23 * e.m31 + t.m24 * e.m41, l = t.m21 * e.m12 + t.m22 * e.m22 + t.m23 * e.m32 + t.m24 * e.m42, c = t.m21 * e.m13 + t.m22 * e.m23 + t.m23 * e.m33 + t.m24 * e.m43, a = t.m21 * e.m14 + t.m22 * e.m24 + t.m23 * e.m34 + t.m24 * e.m44, u = t.m31 * e.m11 + t.m32 * e.m21 + t.m33 * e.m31 + t.m34 * e.m41, f = t.m31 * e.m12 + t.m32 * e.m22 + t.m33 * e.m32 + t.m34 * e.m42, h = t.m31 * e.m13 + t.m32 * e.m23 + t.m33 * e.m33 + t.m34 * e.m43, y = t.m31 * e.m14 + t.m32 * e.m24 + t.m33 * e.m34 + t.m34 * e.m44, m = t.m41 * e.m11 + t.m42 * e.m21 + t.m43 * e.m31 + t.m44 * e.m41, g = t.m41 * e.m12 + t.m42 * e.m22 + t.m43 * e.m32 + t.m44 * e.m42, d = t.m41 * e.m13 + t.m42 * e.m23 + t.m43 * e.m33 + t.m44 * e.m43, M = t.m41 * e.m14 + t.m42 * e.m24 + t.m43 * e.m34 + t.m44 * e.m44;
|
|
187
|
+
return lt([
|
|
188
|
+
s,
|
|
189
|
+
r,
|
|
190
|
+
n,
|
|
191
|
+
i,
|
|
192
|
+
o,
|
|
193
|
+
l,
|
|
194
|
+
c,
|
|
195
|
+
a,
|
|
196
|
+
u,
|
|
197
|
+
f,
|
|
198
|
+
h,
|
|
199
|
+
y,
|
|
200
|
+
m,
|
|
201
|
+
g,
|
|
202
|
+
d,
|
|
203
|
+
M
|
|
204
|
+
]);
|
|
159
205
|
};
|
|
160
|
-
class
|
|
206
|
+
class C {
|
|
161
207
|
/**
|
|
162
208
|
* @constructor
|
|
163
209
|
* @param init accepts all parameter configurations:
|
|
@@ -381,7 +427,7 @@ class T {
|
|
|
381
427
|
};
|
|
382
428
|
}
|
|
383
429
|
}
|
|
384
|
-
|
|
430
|
+
j(C, "Translate", se), j(C, "Rotate", re), j(C, "RotateAxisAngle", ie), j(C, "Scale", oe), j(C, "SkewX", ce), j(C, "SkewY", le), j(C, "Skew", At), j(C, "Multiply", _), j(C, "fromArray", lt), j(C, "fromMatrix", ee), j(C, "fromString", ne), j(C, "toArray", zt), j(C, "isCompatibleArray", Gt), j(C, "isCompatibleObject", te);
|
|
385
431
|
const V = {
|
|
386
432
|
origin: [0, 0, 0],
|
|
387
433
|
round: 4
|
|
@@ -410,7 +456,7 @@ const V = {
|
|
|
410
456
|
)
|
|
411
457
|
), !!tt[s]); )
|
|
412
458
|
;
|
|
413
|
-
},
|
|
459
|
+
}, S = "SVGPathCommander Error", ae = (e) => {
|
|
414
460
|
const { index: t, pathValue: s } = e, r = s.charCodeAt(t);
|
|
415
461
|
if (r === 48) {
|
|
416
462
|
e.param = 0, e.index += 1;
|
|
@@ -420,21 +466,21 @@ const V = {
|
|
|
420
466
|
e.param = 1, e.index += 1;
|
|
421
467
|
return;
|
|
422
468
|
}
|
|
423
|
-
e.err = `${
|
|
469
|
+
e.err = `${S}: invalid Arc flag "${s[t]}", expecting 0 or 1 at index ${t}`;
|
|
424
470
|
}, U = (e) => e >= 48 && e <= 57, J = "Invalid path value", ue = (e) => {
|
|
425
471
|
const { max: t, pathValue: s, index: r } = e;
|
|
426
472
|
let n = r, i = !1, o = !1, l = !1, c = !1, a;
|
|
427
473
|
if (n >= t) {
|
|
428
|
-
e.err = `${
|
|
474
|
+
e.err = `${S}: ${J} at index ${n}, "pathValue" is missing param`;
|
|
429
475
|
return;
|
|
430
476
|
}
|
|
431
477
|
if (a = s.charCodeAt(n), (a === 43 || a === 45) && (n += 1, a = s.charCodeAt(n)), !U(a) && a !== 46) {
|
|
432
|
-
e.err = `${
|
|
478
|
+
e.err = `${S}: ${J} at index ${n}, "${s[n]}" is not a number`;
|
|
433
479
|
return;
|
|
434
480
|
}
|
|
435
481
|
if (a !== 46) {
|
|
436
482
|
if (i = a === 48, n += 1, a = s.charCodeAt(n), i && n < t && a && U(a)) {
|
|
437
|
-
e.err = `${
|
|
483
|
+
e.err = `${S}: ${J} at index ${r}, "${s[r]}" illegal number`;
|
|
438
484
|
return;
|
|
439
485
|
}
|
|
440
486
|
for (; n < t && U(s.charCodeAt(n)); )
|
|
@@ -448,14 +494,14 @@ const V = {
|
|
|
448
494
|
}
|
|
449
495
|
if (a === 101 || a === 69) {
|
|
450
496
|
if (c && !o && !l) {
|
|
451
|
-
e.err = `${
|
|
497
|
+
e.err = `${S}: ${J} at index ${n}, "${s[n]}" invalid float exponent`;
|
|
452
498
|
return;
|
|
453
499
|
}
|
|
454
500
|
if (n += 1, a = s.charCodeAt(n), (a === 43 || a === 45) && (n += 1), n < t && U(s.charCodeAt(n)))
|
|
455
501
|
for (; n < t && U(s.charCodeAt(n)); )
|
|
456
502
|
n += 1;
|
|
457
503
|
else {
|
|
458
|
-
e.err = `${
|
|
504
|
+
e.err = `${S}: ${J} at index ${n}, "${s[n]}" invalid integer exponent`;
|
|
459
505
|
return;
|
|
460
506
|
}
|
|
461
507
|
}
|
|
@@ -522,12 +568,12 @@ const V = {
|
|
|
522
568
|
var c;
|
|
523
569
|
const { max: t, pathValue: s, index: r, segments: n } = e, i = s.charCodeAt(r), o = tt[s[r].toLowerCase()];
|
|
524
570
|
if (e.segmentStart = r, !fe(i)) {
|
|
525
|
-
e.err = `${
|
|
571
|
+
e.err = `${S}: ${J} "${s[r]}" is not a path command at index ${r}`;
|
|
526
572
|
return;
|
|
527
573
|
}
|
|
528
574
|
const l = n[n.length - 1];
|
|
529
575
|
if (!ge(i) && ((c = l == null ? void 0 : l[0]) == null ? void 0 : c.toLocaleLowerCase()) === "z") {
|
|
530
|
-
e.err = `${
|
|
576
|
+
e.err = `${S}: ${J} "${s[r]}" is not a MoveTo path command at index ${r}`;
|
|
531
577
|
return;
|
|
532
578
|
}
|
|
533
579
|
if (e.index += 1, et(e), e.data = [], !o) {
|
|
@@ -590,13 +636,13 @@ const Q = (e) => {
|
|
|
590
636
|
return [i].concat(l);
|
|
591
637
|
}
|
|
592
638
|
}, Z = (e, t) => {
|
|
593
|
-
let s = e.length, r, n = "M", i = "M", o = !1, l = 0, c = 0, a = 0, u = 0,
|
|
639
|
+
let s = e.length, r, n = "M", i = "M", o = !1, l = 0, c = 0, a = 0, u = 0, f = 0;
|
|
594
640
|
for (let h = 0; h < s; h += 1) {
|
|
595
|
-
r = e[h], [n] = r,
|
|
596
|
-
const
|
|
597
|
-
if (
|
|
641
|
+
r = e[h], [n] = r, f = r.length, i = n.toUpperCase(), o = i !== n;
|
|
642
|
+
const y = t(r, h, l, c);
|
|
643
|
+
if (y === !1)
|
|
598
644
|
break;
|
|
599
|
-
i === "Z" ? (l = a, c = u) : i === "H" ? l = r[1] + (o ? l : 0) : i === "V" ? c = r[1] + (o ? c : 0) : (l = r[
|
|
645
|
+
i === "Z" ? (l = a, c = u) : i === "H" ? l = r[1] + (o ? l : 0) : i === "V" ? c = r[1] + (o ? c : 0) : (l = r[f - 2] + (o ? l : 0), c = r[f - 1] + (o ? c : 0), i === "M" && (a = l, u = c)), y && (e[h] = y, y[0] === "C" && (s = e.length));
|
|
600
646
|
}
|
|
601
647
|
return e;
|
|
602
648
|
}, ht = (e) => {
|
|
@@ -639,41 +685,41 @@ const Q = (e) => {
|
|
|
639
685
|
const { sin: r, cos: n } = Math, i = e * n(s) - t * r(s), o = e * r(s) + t * n(s);
|
|
640
686
|
return { x: i, y: o };
|
|
641
687
|
}, Mt = (e, t, s, r, n, i, o, l, c, a) => {
|
|
642
|
-
let u = e,
|
|
643
|
-
const
|
|
644
|
-
let
|
|
688
|
+
let u = e, f = t, h = s, y = r, m = l, g = c;
|
|
689
|
+
const d = Math.PI * 120 / 180, M = Math.PI / 180 * (+n || 0);
|
|
690
|
+
let w = [], x, p, L, T, I;
|
|
645
691
|
if (a)
|
|
646
|
-
[
|
|
692
|
+
[p, L, T, I] = a;
|
|
647
693
|
else {
|
|
648
|
-
x = st(u,
|
|
649
|
-
const v = (u -
|
|
650
|
-
let X = v * v / (h * h) + O * O / (
|
|
651
|
-
X > 1 && (X = Math.sqrt(X), h *= X,
|
|
652
|
-
const
|
|
694
|
+
x = st(u, f, -M), u = x.x, f = x.y, x = st(m, g, -M), m = x.x, g = x.y;
|
|
695
|
+
const v = (u - m) / 2, O = (f - g) / 2;
|
|
696
|
+
let X = v * v / (h * h) + O * O / (y * y);
|
|
697
|
+
X > 1 && (X = Math.sqrt(X), h *= X, y *= X);
|
|
698
|
+
const Ct = h * h, $t = y * y, Jt = (i === o ? -1 : 1) * Math.sqrt(
|
|
653
699
|
Math.abs(
|
|
654
|
-
(
|
|
700
|
+
(Ct * $t - Ct * O * O - $t * v * v) / (Ct * O * O + $t * v * v)
|
|
655
701
|
)
|
|
656
702
|
);
|
|
657
|
-
|
|
703
|
+
T = Jt * h * O / y + (u + m) / 2, I = Jt * -y * v / h + (f + g) / 2, p = Math.asin(((f - I) / y * 10 ** 9 >> 0) / 10 ** 9), L = Math.asin(((g - I) / y * 10 ** 9 >> 0) / 10 ** 9), p = u < T ? Math.PI - p : p, L = m < T ? Math.PI - L : L, p < 0 && (p = Math.PI * 2 + p), L < 0 && (L = Math.PI * 2 + L), o && p > L && (p -= Math.PI * 2), !o && L > p && (L -= Math.PI * 2);
|
|
658
704
|
}
|
|
659
|
-
let R = L -
|
|
660
|
-
if (Math.abs(R) >
|
|
661
|
-
const v = L, O =
|
|
662
|
-
L =
|
|
705
|
+
let R = L - p;
|
|
706
|
+
if (Math.abs(R) > d) {
|
|
707
|
+
const v = L, O = m, X = g;
|
|
708
|
+
L = p + d * (o && L > p ? 1 : -1), m = T + h * Math.cos(L), g = I + y * Math.sin(L), w = Mt(m, g, h, y, n, 0, o, O, X, [
|
|
663
709
|
L,
|
|
664
710
|
v,
|
|
665
|
-
|
|
711
|
+
T,
|
|
666
712
|
I
|
|
667
713
|
]);
|
|
668
714
|
}
|
|
669
|
-
R = L -
|
|
670
|
-
const P = Math.cos(
|
|
715
|
+
R = L - p;
|
|
716
|
+
const P = Math.cos(p), z = Math.sin(p), D = Math.cos(L), K = Math.sin(L), q = Math.tan(R / 4), N = 4 / 3 * h * q, $ = 4 / 3 * y * q, E = [u, f], B = [u + N * z, f - $ * P], F = [m + N * K, g - $ * D], G = [m, g];
|
|
671
717
|
if (B[0] = 2 * E[0] - B[0], B[1] = 2 * E[1] - B[1], a)
|
|
672
|
-
return [B[0], B[1], F[0], F[1], G[0], G[1]].concat(
|
|
673
|
-
|
|
718
|
+
return [B[0], B[1], F[0], F[1], G[0], G[1]].concat(w);
|
|
719
|
+
w = [B[0], B[1], F[0], F[1], G[0], G[1]].concat(w);
|
|
674
720
|
const W = [];
|
|
675
|
-
for (let v = 0, O =
|
|
676
|
-
W[v] = v % 2 ? st(
|
|
721
|
+
for (let v = 0, O = w.length; v < O; v += 1)
|
|
722
|
+
W[v] = v % 2 ? st(w[v - 1], w[v], M).y : st(w[v], w[v + 1], M).x;
|
|
677
723
|
return W;
|
|
678
724
|
}, xe = (e, t, s, r, n, i) => {
|
|
679
725
|
const o = 0.3333333333333333, l = 2 / 3;
|
|
@@ -717,13 +763,13 @@ const Q = (e) => {
|
|
|
717
763
|
) : s === "Z" ? ["C"].concat(
|
|
718
764
|
Pt(o, l, c, a)
|
|
719
765
|
) : e;
|
|
720
|
-
},
|
|
721
|
-
const [s] = e, r = s.toUpperCase(), n = s !== r, { x1: i, y1: o, x2: l, y2: c, x: a, y: u } = t,
|
|
722
|
-
let h =
|
|
766
|
+
}, Nt = (e, t) => {
|
|
767
|
+
const [s] = e, r = s.toUpperCase(), n = s !== r, { x1: i, y1: o, x2: l, y2: c, x: a, y: u } = t, f = e.slice(1);
|
|
768
|
+
let h = f.map((y, m) => y + (n ? m % 2 ? u : a : 0));
|
|
723
769
|
if ("TQ".includes(r) || (t.qx = null, t.qy = null), r === "A")
|
|
724
|
-
return h =
|
|
725
|
-
|
|
726
|
-
|
|
770
|
+
return h = f.slice(0, -2).concat(
|
|
771
|
+
f[5] + (n ? a : 0),
|
|
772
|
+
f[6] + (n ? u : 0)
|
|
727
773
|
), ["A"].concat(h);
|
|
728
774
|
if (r === "H")
|
|
729
775
|
return [
|
|
@@ -752,20 +798,20 @@ const Q = (e) => {
|
|
|
752
798
|
if (r === "C")
|
|
753
799
|
return ["C"].concat(h);
|
|
754
800
|
if (r === "S") {
|
|
755
|
-
const
|
|
756
|
-
return t.x1 =
|
|
801
|
+
const y = i * 2 - l, m = o * 2 - c;
|
|
802
|
+
return t.x1 = y, t.y1 = m, ["C", y, m].concat(h);
|
|
757
803
|
} else if (r === "T") {
|
|
758
|
-
const
|
|
804
|
+
const y = i * 2 - (t.qx ? t.qx : (
|
|
759
805
|
/* istanbul ignore next */
|
|
760
806
|
0
|
|
761
|
-
)),
|
|
807
|
+
)), m = o * 2 - (t.qy ? t.qy : (
|
|
762
808
|
/* istanbul ignore next */
|
|
763
809
|
0
|
|
764
810
|
));
|
|
765
|
-
return t.qx =
|
|
811
|
+
return t.qx = y, t.qy = m, ["Q", y, m].concat(h);
|
|
766
812
|
} else if (r === "Q") {
|
|
767
|
-
const [
|
|
768
|
-
return t.qx =
|
|
813
|
+
const [y, m] = h;
|
|
814
|
+
return t.qx = y, t.qy = m, ["Q"].concat(h);
|
|
769
815
|
} else if (r === "Z")
|
|
770
816
|
return ["Z"];
|
|
771
817
|
return e;
|
|
@@ -782,7 +828,7 @@ const Q = (e) => {
|
|
|
782
828
|
const t = { ...ut }, s = Q(e);
|
|
783
829
|
return Z(s, (r, n, i, o) => {
|
|
784
830
|
t.x = i, t.y = o;
|
|
785
|
-
const l =
|
|
831
|
+
const l = Nt(r, t);
|
|
786
832
|
let c = pe(l, t);
|
|
787
833
|
c[0] === "C" && c.length > 7 && (s.splice(
|
|
788
834
|
n + 1,
|
|
@@ -815,12 +861,12 @@ const Q = (e) => {
|
|
|
815
861
|
}
|
|
816
862
|
}
|
|
817
863
|
return i;
|
|
818
|
-
},
|
|
864
|
+
}, wt = (e, t) => Math.sqrt(
|
|
819
865
|
(e[0] - t[0]) * (e[0] - t[0]) + (e[1] - t[1]) * (e[1] - t[1])
|
|
820
|
-
), it = (e, t, s, r) =>
|
|
866
|
+
), it = (e, t, s, r) => wt([e, t], [s, r]), Ht = (e, t, s, r, n) => {
|
|
821
867
|
let i = { x: e, y: t };
|
|
822
868
|
if (typeof n == "number") {
|
|
823
|
-
const o =
|
|
869
|
+
const o = wt([e, t], [s, r]);
|
|
824
870
|
if (n <= 0)
|
|
825
871
|
i = { x: e, y: t };
|
|
826
872
|
else if (n >= o)
|
|
@@ -838,64 +884,64 @@ const Q = (e) => {
|
|
|
838
884
|
const r = s / 2, n = Math.sin(r), i = Math.cos(r), o = e ** 2 * n ** 2, l = t ** 2 * i ** 2, c = Math.sqrt(o + l) * s;
|
|
839
885
|
return Math.abs(c);
|
|
840
886
|
}, Y = (e, t, s, r, n, i) => {
|
|
841
|
-
const { sin: o, cos: l } = Math, c = l(n), a = o(n), u = s * l(i),
|
|
842
|
-
return [e + c * u - a *
|
|
887
|
+
const { sin: o, cos: l } = Math, c = l(n), a = o(n), u = s * l(i), f = r * o(i);
|
|
888
|
+
return [e + c * u - a * f, t + a * u + c * f];
|
|
843
889
|
}, Et = (e, t) => {
|
|
844
890
|
const { x: s, y: r } = e, { x: n, y: i } = t, o = s * n + r * i, l = Math.sqrt((s ** 2 + r ** 2) * (n ** 2 + i ** 2));
|
|
845
891
|
return (s * i - r * n < 0 ? -1 : 1) * Math.acos(o / l);
|
|
846
892
|
}, Lt = (e, t, s, r, n, i, o, l, c) => {
|
|
847
|
-
const { abs: a, sin: u, cos:
|
|
848
|
-
let
|
|
849
|
-
const M = (n % 360 + 360) % 360 * (
|
|
893
|
+
const { abs: a, sin: u, cos: f, sqrt: h, PI: y } = Math;
|
|
894
|
+
let m = a(s), g = a(r);
|
|
895
|
+
const M = (n % 360 + 360) % 360 * (y / 180);
|
|
850
896
|
if (e === l && t === c)
|
|
851
897
|
return {
|
|
852
|
-
rx:
|
|
853
|
-
ry:
|
|
898
|
+
rx: m,
|
|
899
|
+
ry: g,
|
|
854
900
|
startAngle: 0,
|
|
855
901
|
endAngle: 0,
|
|
856
902
|
center: { x: l, y: c }
|
|
857
903
|
};
|
|
858
|
-
if (
|
|
904
|
+
if (m === 0 || g === 0)
|
|
859
905
|
return {
|
|
860
|
-
rx:
|
|
861
|
-
ry:
|
|
906
|
+
rx: m,
|
|
907
|
+
ry: g,
|
|
862
908
|
startAngle: 0,
|
|
863
909
|
endAngle: 0,
|
|
864
910
|
center: { x: (l + e) / 2, y: (c + t) / 2 }
|
|
865
911
|
};
|
|
866
|
-
const
|
|
867
|
-
x:
|
|
868
|
-
y: -u(M) *
|
|
869
|
-
}, L =
|
|
870
|
-
L > 1 && (
|
|
871
|
-
const
|
|
872
|
-
let R =
|
|
912
|
+
const w = (e - l) / 2, x = (t - c) / 2, p = {
|
|
913
|
+
x: f(M) * w + u(M) * x,
|
|
914
|
+
y: -u(M) * w + f(M) * x
|
|
915
|
+
}, L = p.x ** 2 / m ** 2 + p.y ** 2 / g ** 2;
|
|
916
|
+
L > 1 && (m *= h(L), g *= h(L));
|
|
917
|
+
const T = m ** 2 * g ** 2 - m ** 2 * p.y ** 2 - g ** 2 * p.x ** 2, I = m ** 2 * p.y ** 2 + g ** 2 * p.x ** 2;
|
|
918
|
+
let R = T / I;
|
|
873
919
|
R = R < 0 ? 0 : R;
|
|
874
920
|
const P = (i !== o ? 1 : -1) * h(R), z = {
|
|
875
|
-
x: P * (
|
|
876
|
-
y: P * (-(
|
|
921
|
+
x: P * (m * p.y / g),
|
|
922
|
+
y: P * (-(g * p.x) / m)
|
|
877
923
|
}, D = {
|
|
878
|
-
x:
|
|
879
|
-
y: u(M) * z.x +
|
|
924
|
+
x: f(M) * z.x - u(M) * z.y + (e + l) / 2,
|
|
925
|
+
y: u(M) * z.x + f(M) * z.y + (t + c) / 2
|
|
880
926
|
}, K = {
|
|
881
|
-
x: (
|
|
882
|
-
y: (
|
|
883
|
-
}, q = Et({ x: 1, y: 0 }, K),
|
|
884
|
-
x: (-
|
|
885
|
-
y: (-
|
|
927
|
+
x: (p.x - z.x) / m,
|
|
928
|
+
y: (p.y - z.y) / g
|
|
929
|
+
}, q = Et({ x: 1, y: 0 }, K), N = {
|
|
930
|
+
x: (-p.x - z.x) / m,
|
|
931
|
+
y: (-p.y - z.y) / g
|
|
886
932
|
};
|
|
887
|
-
let $ = Et(K,
|
|
888
|
-
!o && $ > 0 ? $ -= 2 *
|
|
933
|
+
let $ = Et(K, N);
|
|
934
|
+
!o && $ > 0 ? $ -= 2 * y : o && $ < 0 && ($ += 2 * y), $ %= 2 * y;
|
|
889
935
|
const E = q + $;
|
|
890
936
|
return {
|
|
891
937
|
center: D,
|
|
892
938
|
startAngle: q,
|
|
893
939
|
endAngle: E,
|
|
894
|
-
rx:
|
|
895
|
-
ry:
|
|
940
|
+
rx: m,
|
|
941
|
+
ry: g
|
|
896
942
|
};
|
|
897
943
|
}, _t = (e, t, s, r, n, i, o, l, c) => {
|
|
898
|
-
const { rx: a, ry: u, startAngle:
|
|
944
|
+
const { rx: a, ry: u, startAngle: f, endAngle: h } = Lt(
|
|
899
945
|
e,
|
|
900
946
|
t,
|
|
901
947
|
s,
|
|
@@ -906,10 +952,10 @@ const Q = (e) => {
|
|
|
906
952
|
l,
|
|
907
953
|
c
|
|
908
954
|
);
|
|
909
|
-
return Ft(a, u, h -
|
|
955
|
+
return Ft(a, u, h - f);
|
|
910
956
|
}, be = (e, t, s, r, n, i, o, l, c, a) => {
|
|
911
957
|
let u = { x: e, y: t };
|
|
912
|
-
const { center:
|
|
958
|
+
const { center: f, rx: h, ry: y, startAngle: m, endAngle: g } = Lt(
|
|
913
959
|
e,
|
|
914
960
|
t,
|
|
915
961
|
s,
|
|
@@ -921,26 +967,26 @@ const Q = (e) => {
|
|
|
921
967
|
c
|
|
922
968
|
);
|
|
923
969
|
if (typeof a == "number") {
|
|
924
|
-
const
|
|
970
|
+
const d = Ft(h, y, g - m);
|
|
925
971
|
if (a <= 0)
|
|
926
972
|
u = { x: e, y: t };
|
|
927
|
-
else if (a >=
|
|
973
|
+
else if (a >= d)
|
|
928
974
|
u = { x: l, y: c };
|
|
929
975
|
else {
|
|
930
976
|
if (e === l && t === c)
|
|
931
977
|
return { x: l, y: c };
|
|
932
|
-
if (h === 0 ||
|
|
978
|
+
if (h === 0 || y === 0)
|
|
933
979
|
return Ht(e, t, l, c, a);
|
|
934
|
-
const { PI: M, cos:
|
|
980
|
+
const { PI: M, cos: w, sin: x } = Math, p = g - m, T = (n % 360 + 360) % 360 * (M / 180), I = m + p * (a / d), R = h * w(I), P = y * x(I);
|
|
935
981
|
u = {
|
|
936
|
-
x:
|
|
937
|
-
y: x(
|
|
982
|
+
x: w(T) * R - x(T) * P + f.x,
|
|
983
|
+
y: x(T) * R + w(T) * P + f.y
|
|
938
984
|
};
|
|
939
985
|
}
|
|
940
986
|
}
|
|
941
987
|
return u;
|
|
942
988
|
}, de = (e, t, s, r, n, i, o, l, c) => {
|
|
943
|
-
const { center: a, rx: u, ry:
|
|
989
|
+
const { center: a, rx: u, ry: f, startAngle: h, endAngle: y } = Lt(
|
|
944
990
|
e,
|
|
945
991
|
t,
|
|
946
992
|
s,
|
|
@@ -950,27 +996,27 @@ const Q = (e) => {
|
|
|
950
996
|
o,
|
|
951
997
|
l,
|
|
952
998
|
c
|
|
953
|
-
),
|
|
954
|
-
let q =
|
|
955
|
-
const B =
|
|
956
|
-
if (F[0] >
|
|
957
|
-
const v = Y(
|
|
958
|
-
q =
|
|
999
|
+
), m = y - h, { min: g, max: d, tan: M, atan2: w, PI: x } = Math, { x: p, y: L } = a, T = n * x / 180, I = M(T), R = w(-f * I, u), P = R, z = R + x, D = w(f, u * I), K = D + x;
|
|
1000
|
+
let q = g(e, l), N = d(e, l), $ = g(t, c), E = d(t, c);
|
|
1001
|
+
const B = y - m * 1e-3, F = Y(p, L, u, f, T, B), G = y - m * 0.999, W = Y(p, L, u, f, T, G);
|
|
1002
|
+
if (F[0] > N || W[0] > N) {
|
|
1003
|
+
const v = Y(p, L, u, f, T, P);
|
|
1004
|
+
q = g(q, v[0]), $ = g($, v[1]), N = d(N, v[0]), E = d(E, v[1]);
|
|
959
1005
|
}
|
|
960
1006
|
if (F[0] < q || W[0] < q) {
|
|
961
|
-
const v = Y(
|
|
962
|
-
q =
|
|
1007
|
+
const v = Y(p, L, u, f, T, z);
|
|
1008
|
+
q = g(q, v[0]), $ = g($, v[1]), N = d(N, v[0]), E = d(E, v[1]);
|
|
963
1009
|
}
|
|
964
1010
|
if (F[1] < $ || W[1] < $) {
|
|
965
|
-
const v = Y(
|
|
966
|
-
q =
|
|
1011
|
+
const v = Y(p, L, u, f, T, K);
|
|
1012
|
+
q = g(q, v[0]), $ = g($, v[1]), N = d(N, v[0]), E = d(E, v[1]);
|
|
967
1013
|
}
|
|
968
1014
|
if (F[1] > E || W[1] > E) {
|
|
969
|
-
const v = Y(
|
|
970
|
-
q =
|
|
1015
|
+
const v = Y(p, L, u, f, T, D);
|
|
1016
|
+
q = g(q, v[0]), $ = g($, v[1]), N = d(N, v[0]), E = d(E, v[1]);
|
|
971
1017
|
}
|
|
972
|
-
return [q, $,
|
|
973
|
-
},
|
|
1018
|
+
return [q, $, N, E];
|
|
1019
|
+
}, He = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
974
1020
|
__proto__: null,
|
|
975
1021
|
angleBetween: Et,
|
|
976
1022
|
arcLength: Ft,
|
|
@@ -1042,7 +1088,7 @@ const Q = (e) => {
|
|
|
1042
1088
|
t.push(i), s = i;
|
|
1043
1089
|
}
|
|
1044
1090
|
return t;
|
|
1045
|
-
},
|
|
1091
|
+
}, Ne = (e, t) => {
|
|
1046
1092
|
if (t === 0)
|
|
1047
1093
|
return e[0].t = 0, e[0];
|
|
1048
1094
|
const s = e.length - 1;
|
|
@@ -1065,14 +1111,14 @@ const Q = (e) => {
|
|
|
1065
1111
|
y: l * n[0].y + c * n[1].y + a * n[2].y + u * n[3].y,
|
|
1066
1112
|
t
|
|
1067
1113
|
};
|
|
1068
|
-
},
|
|
1114
|
+
}, we = (e, t) => {
|
|
1069
1115
|
const s = e(t), r = s.x * s.x + s.y * s.y;
|
|
1070
1116
|
return Math.sqrt(r);
|
|
1071
1117
|
}, Le = (e) => {
|
|
1072
1118
|
const s = Rt.length;
|
|
1073
1119
|
let r = 0;
|
|
1074
1120
|
for (let n = 0, i; n < s; n++)
|
|
1075
|
-
i = 0.5 * Rt[n] + 0.5, r += Ae[n] *
|
|
1121
|
+
i = 0.5 * Rt[n] + 0.5, r += Ae[n] * we(e, i);
|
|
1076
1122
|
return 0.5 * r;
|
|
1077
1123
|
}, mt = (e) => {
|
|
1078
1124
|
const t = [];
|
|
@@ -1082,14 +1128,14 @@ const Q = (e) => {
|
|
|
1082
1128
|
y: e[r + 1]
|
|
1083
1129
|
});
|
|
1084
1130
|
const s = Me(t);
|
|
1085
|
-
return Le((r) =>
|
|
1131
|
+
return Le((r) => Ne(s[0], r));
|
|
1086
1132
|
}, ve = 1e-8, gt = ([e, t, s]) => {
|
|
1087
1133
|
const r = Math.min(e, s), n = Math.max(e, s);
|
|
1088
1134
|
if (t >= e ? s >= t : s <= t)
|
|
1089
1135
|
return [r, n];
|
|
1090
1136
|
const i = (e * s - t * t) / (e - 2 * t + s);
|
|
1091
1137
|
return i < r ? [i, n] : [r, i];
|
|
1092
|
-
},
|
|
1138
|
+
}, jt = ([e, t, s, r]) => {
|
|
1093
1139
|
const n = e - 3 * t + 3 * s - r;
|
|
1094
1140
|
if (Math.abs(n) < ve)
|
|
1095
1141
|
return e === r && e === t ? [e, r] : gt([e, -0.5 * e + 1.5 * t, e - 3 * t + 3 * s]);
|
|
@@ -1099,31 +1145,31 @@ const Q = (e) => {
|
|
|
1099
1145
|
const o = Math.sqrt(i);
|
|
1100
1146
|
let l = Math.min(e, r), c = Math.max(e, r);
|
|
1101
1147
|
const a = e - 2 * t + s;
|
|
1102
|
-
for (let u = (a + o) / n,
|
|
1148
|
+
for (let u = (a + o) / n, f = 1; f <= 2; u = (a - o) / n, f++)
|
|
1103
1149
|
if (u > 0 && u < 1) {
|
|
1104
1150
|
const h = e * (1 - u) * (1 - u) * (1 - u) + t * 3 * (1 - u) * (1 - u) * u + s * 3 * (1 - u) * u * u + r * u * u * u;
|
|
1105
1151
|
h < l && (l = h), h > c && (c = h);
|
|
1106
1152
|
}
|
|
1107
1153
|
return [l, c];
|
|
1108
|
-
},
|
|
1154
|
+
}, Te = ([e, t, s, r, n, i, o, l], c) => {
|
|
1109
1155
|
const a = 1 - c;
|
|
1110
1156
|
return {
|
|
1111
1157
|
x: a ** 3 * e + 3 * a ** 2 * c * s + 3 * a * c ** 2 * n + c ** 3 * o,
|
|
1112
1158
|
y: a ** 3 * t + 3 * a ** 2 * c * r + 3 * a * c ** 2 * i + c ** 3 * l
|
|
1113
1159
|
};
|
|
1114
|
-
}, xt = (e, t, s, r, n, i, o, l) => mt([e, t, s, r, n, i, o, l]),
|
|
1160
|
+
}, xt = (e, t, s, r, n, i, o, l) => mt([e, t, s, r, n, i, o, l]), Ce = (e, t, s, r, n, i, o, l, c) => {
|
|
1115
1161
|
const a = typeof c == "number";
|
|
1116
1162
|
let u = { x: e, y: t };
|
|
1117
1163
|
if (a) {
|
|
1118
|
-
const
|
|
1119
|
-
c <= 0 || (c >=
|
|
1164
|
+
const f = mt([e, t, s, r, n, i, o, l]);
|
|
1165
|
+
c <= 0 || (c >= f ? u = { x: o, y: l } : u = Te(
|
|
1120
1166
|
[e, t, s, r, n, i, o, l],
|
|
1121
|
-
c /
|
|
1167
|
+
c / f
|
|
1122
1168
|
));
|
|
1123
1169
|
}
|
|
1124
1170
|
return u;
|
|
1125
|
-
},
|
|
1126
|
-
const c =
|
|
1171
|
+
}, St = (e, t, s, r, n, i, o, l) => {
|
|
1172
|
+
const c = jt([e, s, n, o]), a = jt([t, r, i, l]);
|
|
1127
1173
|
return [c[0], a[0], c[1], a[1]];
|
|
1128
1174
|
}, $e = ([e, t, s, r, n, i], o) => {
|
|
1129
1175
|
const l = 1 - o;
|
|
@@ -1145,32 +1191,32 @@ const Q = (e) => {
|
|
|
1145
1191
|
}, Qt = (e, t, s, r, n, i) => {
|
|
1146
1192
|
const o = gt([e, s, n]), l = gt([t, r, i]);
|
|
1147
1193
|
return [o[0], l[0], o[1], l[1]];
|
|
1148
|
-
},
|
|
1194
|
+
}, Fe = (e) => {
|
|
1149
1195
|
const t = e.length;
|
|
1150
1196
|
let s = -1, r, n = e[t - 1], i = 0;
|
|
1151
1197
|
for (; ++s < t; )
|
|
1152
1198
|
r = n, n = e[s], i += r[1] * n[0] - r[0] * n[1];
|
|
1153
1199
|
return i / 2;
|
|
1154
|
-
},
|
|
1200
|
+
}, _e = (e) => e.reduce((t, s, r) => r ? t + wt(e[r - 1], s) : 0, 0), bt = 1e-5, ot = (e) => {
|
|
1155
1201
|
const t = Q(e), s = { ...ut };
|
|
1156
1202
|
return Z(t, (r, n, i, o) => {
|
|
1157
1203
|
s.x = i, s.y = o;
|
|
1158
|
-
const l =
|
|
1204
|
+
const l = Nt(r, s), c = l.length;
|
|
1159
1205
|
return s.x1 = +l[c - 2], s.y1 = +l[c - 1], s.x2 = +l[c - 4] || s.x1, s.y2 = +l[c - 3] || s.y1, l;
|
|
1160
1206
|
});
|
|
1161
1207
|
}, rt = (e, t) => {
|
|
1162
1208
|
const s = ot(e);
|
|
1163
1209
|
let r = !1, n = [], i = "M", o = 0, l = 0, [c, a] = s[0].slice(1);
|
|
1164
1210
|
const u = typeof t == "number";
|
|
1165
|
-
let
|
|
1166
|
-
return !u || t < bt ?
|
|
1167
|
-
if ([i] =
|
|
1211
|
+
let f = { x: c, y: a }, h = 0, y = f, m = 0;
|
|
1212
|
+
return !u || t < bt ? f : (Z(s, (g, d, M, w) => {
|
|
1213
|
+
if ([i] = g, r = i === "M", n = r ? n : [M, w].concat(g.slice(1)), r ? ([, c, a] = g, f = { x: c, y: a }, h = 0) : i === "L" ? (f = Ht(
|
|
1168
1214
|
n[0],
|
|
1169
1215
|
n[1],
|
|
1170
1216
|
n[2],
|
|
1171
1217
|
n[3],
|
|
1172
|
-
t -
|
|
1173
|
-
), h = it(n[0], n[1], n[2], n[3])) : i === "A" ? (
|
|
1218
|
+
t - m
|
|
1219
|
+
), h = it(n[0], n[1], n[2], n[3])) : i === "A" ? (f = be(
|
|
1174
1220
|
n[0],
|
|
1175
1221
|
n[1],
|
|
1176
1222
|
n[2],
|
|
@@ -1180,7 +1226,7 @@ const Q = (e) => {
|
|
|
1180
1226
|
n[6],
|
|
1181
1227
|
n[7],
|
|
1182
1228
|
n[8],
|
|
1183
|
-
t -
|
|
1229
|
+
t - m
|
|
1184
1230
|
), h = _t(
|
|
1185
1231
|
n[0],
|
|
1186
1232
|
n[1],
|
|
@@ -1191,7 +1237,7 @@ const Q = (e) => {
|
|
|
1191
1237
|
n[6],
|
|
1192
1238
|
n[7],
|
|
1193
1239
|
n[8]
|
|
1194
|
-
)) : i === "C" ? (
|
|
1240
|
+
)) : i === "C" ? (f = Ce(
|
|
1195
1241
|
n[0],
|
|
1196
1242
|
n[1],
|
|
1197
1243
|
n[2],
|
|
@@ -1200,7 +1246,7 @@ const Q = (e) => {
|
|
|
1200
1246
|
n[5],
|
|
1201
1247
|
n[6],
|
|
1202
1248
|
n[7],
|
|
1203
|
-
t -
|
|
1249
|
+
t - m
|
|
1204
1250
|
), h = xt(
|
|
1205
1251
|
n[0],
|
|
1206
1252
|
n[1],
|
|
@@ -1210,14 +1256,14 @@ const Q = (e) => {
|
|
|
1210
1256
|
n[5],
|
|
1211
1257
|
n[6],
|
|
1212
1258
|
n[7]
|
|
1213
|
-
)) : i === "Q" ? (
|
|
1259
|
+
)) : i === "Q" ? (f = ze(
|
|
1214
1260
|
n[0],
|
|
1215
1261
|
n[1],
|
|
1216
1262
|
n[2],
|
|
1217
1263
|
n[3],
|
|
1218
1264
|
n[4],
|
|
1219
1265
|
n[5],
|
|
1220
|
-
t -
|
|
1266
|
+
t - m
|
|
1221
1267
|
), h = pt(
|
|
1222
1268
|
n[0],
|
|
1223
1269
|
n[1],
|
|
@@ -1225,31 +1271,31 @@ const Q = (e) => {
|
|
|
1225
1271
|
n[3],
|
|
1226
1272
|
n[4],
|
|
1227
1273
|
n[5]
|
|
1228
|
-
)) : i === "Z" && (n = [M,
|
|
1229
|
-
|
|
1274
|
+
)) : i === "Z" && (n = [M, w, c, a], f = { x: c, y: a }, h = it(n[0], n[1], n[2], n[3])), [o, l] = n.slice(-2), m < t)
|
|
1275
|
+
y = f;
|
|
1230
1276
|
else
|
|
1231
1277
|
return !1;
|
|
1232
|
-
|
|
1233
|
-
}), t >
|
|
1278
|
+
m += h;
|
|
1279
|
+
}), t > m - bt ? { x: o, y: l } : y);
|
|
1234
1280
|
}, nt = (e) => {
|
|
1235
1281
|
const t = Q(e);
|
|
1236
|
-
let s = 0, r = 0, n = 0, i = 0, o = 0, l = 0, c = "M", a = 0, u = 0,
|
|
1237
|
-
return Z(t, (h,
|
|
1282
|
+
let s = 0, r = 0, n = 0, i = 0, o = 0, l = 0, c = "M", a = 0, u = 0, f = 0;
|
|
1283
|
+
return Z(t, (h, y, m, g) => {
|
|
1238
1284
|
[c] = h;
|
|
1239
|
-
const
|
|
1240
|
-
if ([c] = x, "TQ".includes(
|
|
1285
|
+
const d = c.toUpperCase(), w = d !== c ? at(h, y, m, g) : h.slice(0), x = d === "V" ? ["L", m, w[1]] : d === "H" ? ["L", w[1], g] : w;
|
|
1286
|
+
if ([c] = x, "TQ".includes(d) || (o = 0, l = 0), c === "M")
|
|
1241
1287
|
[, a, u] = x;
|
|
1242
1288
|
else if (c === "L")
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1289
|
+
f += it(
|
|
1290
|
+
m,
|
|
1291
|
+
g,
|
|
1246
1292
|
x[1],
|
|
1247
1293
|
x[2]
|
|
1248
1294
|
);
|
|
1249
1295
|
else if (c === "A")
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1296
|
+
f += _t(
|
|
1297
|
+
m,
|
|
1298
|
+
g,
|
|
1253
1299
|
x[1],
|
|
1254
1300
|
x[2],
|
|
1255
1301
|
x[3],
|
|
@@ -1259,43 +1305,43 @@ const Q = (e) => {
|
|
|
1259
1305
|
x[7]
|
|
1260
1306
|
);
|
|
1261
1307
|
else if (c === "S") {
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1308
|
+
const p = s * 2 - n, L = r * 2 - i;
|
|
1309
|
+
f += xt(
|
|
1310
|
+
m,
|
|
1311
|
+
g,
|
|
1312
|
+
p,
|
|
1267
1313
|
L,
|
|
1268
1314
|
x[1],
|
|
1269
1315
|
x[2],
|
|
1270
1316
|
x[3],
|
|
1271
1317
|
x[4]
|
|
1272
1318
|
);
|
|
1273
|
-
} else c === "C" ?
|
|
1274
|
-
|
|
1275
|
-
|
|
1319
|
+
} else c === "C" ? f += xt(
|
|
1320
|
+
m,
|
|
1321
|
+
g,
|
|
1276
1322
|
x[1],
|
|
1277
1323
|
x[2],
|
|
1278
1324
|
x[3],
|
|
1279
1325
|
x[4],
|
|
1280
1326
|
x[5],
|
|
1281
1327
|
x[6]
|
|
1282
|
-
) : c === "T" ? (o = s * 2 - o, l = r * 2 - l,
|
|
1283
|
-
|
|
1284
|
-
|
|
1328
|
+
) : c === "T" ? (o = s * 2 - o, l = r * 2 - l, f += pt(
|
|
1329
|
+
m,
|
|
1330
|
+
g,
|
|
1285
1331
|
o,
|
|
1286
1332
|
l,
|
|
1287
1333
|
x[1],
|
|
1288
1334
|
x[2]
|
|
1289
|
-
)) : c === "Q" ? (o = x[1], l = x[2],
|
|
1290
|
-
|
|
1291
|
-
|
|
1335
|
+
)) : c === "Q" ? (o = x[1], l = x[2], f += pt(
|
|
1336
|
+
m,
|
|
1337
|
+
g,
|
|
1292
1338
|
x[1],
|
|
1293
1339
|
x[2],
|
|
1294
1340
|
x[3],
|
|
1295
1341
|
x[4]
|
|
1296
|
-
)) : c === "Z" && (
|
|
1342
|
+
)) : c === "Z" && (f += it(m, g, a, u));
|
|
1297
1343
|
[s, r] = c === "Z" ? [a, u] : x.slice(-2), [n, i] = c === "C" ? [x[3], x[4]] : c === "S" ? [x[1], x[2]] : [s, r];
|
|
1298
|
-
}),
|
|
1344
|
+
}), f;
|
|
1299
1345
|
}, Ut = (e, t) => {
|
|
1300
1346
|
const s = Q(e);
|
|
1301
1347
|
let r = s.slice(0), n = nt(r), i = r.length - 1, o = 0, l = 0, c = s[0];
|
|
@@ -1325,27 +1371,27 @@ const Q = (e) => {
|
|
|
1325
1371
|
({ lengthAtSegment: u }) => u <= t
|
|
1326
1372
|
);
|
|
1327
1373
|
}, vt = (e, t) => {
|
|
1328
|
-
const s = Q(e), r = ot(s), n = nt(r), i = (
|
|
1329
|
-
const L =
|
|
1330
|
-
return L * L +
|
|
1374
|
+
const s = Q(e), r = ot(s), n = nt(r), i = (p) => {
|
|
1375
|
+
const L = p.x - t.x, T = p.y - t.y;
|
|
1376
|
+
return L * L + T * T;
|
|
1331
1377
|
};
|
|
1332
|
-
let o = 8, l, c = { x: 0, y: 0 }, a = 0, u = 0,
|
|
1333
|
-
for (let
|
|
1334
|
-
l = rt(r,
|
|
1378
|
+
let o = 8, l, c = { x: 0, y: 0 }, a = 0, u = 0, f = 1 / 0;
|
|
1379
|
+
for (let p = 0; p <= n; p += o)
|
|
1380
|
+
l = rt(r, p), a = i(l), a < f && (c = l, u = p, f = a);
|
|
1335
1381
|
o /= 2;
|
|
1336
|
-
let h,
|
|
1337
|
-
for (; o > 1e-6 && (
|
|
1382
|
+
let h, y, m = 0, g = 0, d = 0, M = 0;
|
|
1383
|
+
for (; o > 1e-6 && (m = u - o, h = rt(r, m), d = i(h), g = u + o, y = rt(r, g), M = i(y), m >= 0 && d < f ? (c = h, u = m, f = d) : g <= n && M < f ? (c = y, u = g, f = M) : o /= 2, !(o < 1e-5)); )
|
|
1338
1384
|
;
|
|
1339
|
-
const
|
|
1340
|
-
return { closest: c, distance: x, segment:
|
|
1341
|
-
},
|
|
1385
|
+
const w = Ut(s, u), x = Math.sqrt(f);
|
|
1386
|
+
return { closest: c, distance: x, segment: w };
|
|
1387
|
+
}, Ue = (e, t) => vt(e, t).closest, Je = (e, t, s, r, n, i, o, l) => 3 * ((l - t) * (s + n) - (o - e) * (r + i) + r * (e - n) - s * (t - i) + l * (n + e / 3) - o * (i + t / 3)) / 20, qe = (e) => {
|
|
1342
1388
|
let t = 0, s = 0, r = 0;
|
|
1343
1389
|
return yt(e).map((n) => {
|
|
1344
1390
|
switch (n[0]) {
|
|
1345
1391
|
case "M":
|
|
1346
1392
|
return [, t, s] = n, 0;
|
|
1347
1393
|
default:
|
|
1348
|
-
return r =
|
|
1394
|
+
return r = Je(
|
|
1349
1395
|
t,
|
|
1350
1396
|
s,
|
|
1351
1397
|
n[1],
|
|
@@ -1357,7 +1403,7 @@ const Q = (e) => {
|
|
|
1357
1403
|
), [t, s] = n.slice(-2), r;
|
|
1358
1404
|
}
|
|
1359
1405
|
}).reduce((n, i) => n + i, 0);
|
|
1360
|
-
},
|
|
1406
|
+
}, Ke = (e) => qe(yt(e)) >= 0, Wt = (e) => {
|
|
1361
1407
|
if (!e)
|
|
1362
1408
|
return {
|
|
1363
1409
|
x: 0,
|
|
@@ -1373,90 +1419,90 @@ const Q = (e) => {
|
|
|
1373
1419
|
const t = Q(e);
|
|
1374
1420
|
let s = "M", r = 0, n = 0;
|
|
1375
1421
|
const { max: i, min: o } = Math;
|
|
1376
|
-
let l = 1 / 0, c = 1 / 0, a = -1 / 0, u = -1 / 0,
|
|
1422
|
+
let l = 1 / 0, c = 1 / 0, a = -1 / 0, u = -1 / 0, f = 0, h = 0, y = 0, m = 0, g = 0, d = 0, M = 0, w = 0, x = 0, p = 0;
|
|
1377
1423
|
Z(t, (I, R, P, z) => {
|
|
1378
1424
|
[s] = I;
|
|
1379
|
-
const D = s.toUpperCase(), q = D !== s ? at(I, R, P, z) : I.slice(0),
|
|
1380
|
-
if ([s] =
|
|
1381
|
-
[, r, n] =
|
|
1425
|
+
const D = s.toUpperCase(), q = D !== s ? at(I, R, P, z) : I.slice(0), N = D === "V" ? ["L", P, q[1]] : D === "H" ? ["L", q[1], z] : q;
|
|
1426
|
+
if ([s] = N, "TQ".includes(D) || (x = 0, p = 0), s === "M")
|
|
1427
|
+
[, r, n] = N, f = r, h = n, y = r, m = n;
|
|
1382
1428
|
else if (s === "L")
|
|
1383
|
-
[
|
|
1429
|
+
[f, h, y, m] = It(
|
|
1384
1430
|
P,
|
|
1385
1431
|
z,
|
|
1386
|
-
|
|
1387
|
-
|
|
1432
|
+
N[1],
|
|
1433
|
+
N[2]
|
|
1388
1434
|
);
|
|
1389
1435
|
else if (s === "A")
|
|
1390
|
-
[
|
|
1436
|
+
[f, h, y, m] = de(
|
|
1391
1437
|
P,
|
|
1392
1438
|
z,
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1439
|
+
N[1],
|
|
1440
|
+
N[2],
|
|
1441
|
+
N[3],
|
|
1442
|
+
N[4],
|
|
1443
|
+
N[5],
|
|
1444
|
+
N[6],
|
|
1445
|
+
N[7]
|
|
1400
1446
|
);
|
|
1401
1447
|
else if (s === "S") {
|
|
1402
|
-
const $ =
|
|
1403
|
-
[
|
|
1448
|
+
const $ = g * 2 - M, E = d * 2 - w;
|
|
1449
|
+
[f, h, y, m] = St(
|
|
1404
1450
|
P,
|
|
1405
1451
|
z,
|
|
1406
1452
|
$,
|
|
1407
1453
|
E,
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1454
|
+
N[1],
|
|
1455
|
+
N[2],
|
|
1456
|
+
N[3],
|
|
1457
|
+
N[4]
|
|
1412
1458
|
);
|
|
1413
|
-
} else s === "C" ? [
|
|
1459
|
+
} else s === "C" ? [f, h, y, m] = St(
|
|
1414
1460
|
P,
|
|
1415
1461
|
z,
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
) : s === "T" ? (x =
|
|
1462
|
+
N[1],
|
|
1463
|
+
N[2],
|
|
1464
|
+
N[3],
|
|
1465
|
+
N[4],
|
|
1466
|
+
N[5],
|
|
1467
|
+
N[6]
|
|
1468
|
+
) : s === "T" ? (x = g * 2 - x, p = d * 2 - p, [f, h, y, m] = Qt(
|
|
1423
1469
|
P,
|
|
1424
1470
|
z,
|
|
1425
1471
|
x,
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
)) : s === "Q" ? (x =
|
|
1472
|
+
p,
|
|
1473
|
+
N[1],
|
|
1474
|
+
N[2]
|
|
1475
|
+
)) : s === "Q" ? (x = N[1], p = N[2], [f, h, y, m] = Qt(
|
|
1430
1476
|
P,
|
|
1431
1477
|
z,
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
)) : s === "Z" && ([
|
|
1437
|
-
l = o(
|
|
1478
|
+
N[1],
|
|
1479
|
+
N[2],
|
|
1480
|
+
N[3],
|
|
1481
|
+
N[4]
|
|
1482
|
+
)) : s === "Z" && ([f, h, y, m] = It(P, z, r, n));
|
|
1483
|
+
l = o(f, l), c = o(h, c), a = i(y, a), u = i(m, u), [g, d] = s === "Z" ? [r, n] : N.slice(-2), [M, w] = s === "C" ? [N[3], N[4]] : s === "S" ? [N[1], N[2]] : [g, d];
|
|
1438
1484
|
});
|
|
1439
|
-
const L = a - l,
|
|
1485
|
+
const L = a - l, T = u - c;
|
|
1440
1486
|
return {
|
|
1441
1487
|
width: L,
|
|
1442
|
-
height:
|
|
1488
|
+
height: T,
|
|
1443
1489
|
x: l,
|
|
1444
1490
|
y: c,
|
|
1445
1491
|
x2: a,
|
|
1446
1492
|
y2: u,
|
|
1447
1493
|
cx: l + L / 2,
|
|
1448
|
-
cy: c +
|
|
1494
|
+
cy: c + T / 2,
|
|
1449
1495
|
// an estimated guess
|
|
1450
|
-
cz: Math.max(L,
|
|
1496
|
+
cz: Math.max(L, T) + Math.min(L, T) / 2
|
|
1451
1497
|
};
|
|
1452
|
-
},
|
|
1498
|
+
}, We = (e, t) => Ut(e, t).segment, Xe = (e, t) => vt(e, t).segment, Tt = (e) => Array.isArray(e) && e.every((t) => {
|
|
1453
1499
|
const s = t[0].toLowerCase();
|
|
1454
1500
|
return tt[s] === t.length - 1 && "achlmqstvz".includes(s) && t.slice(1).every(Number.isFinite);
|
|
1455
|
-
}) && e.length > 0, Pe = (e) =>
|
|
1456
|
-
e.every(([t]) => t === t.toUpperCase()), ke = (e) => Pe(e) && e.every(([t]) => "ACLMQZ".includes(t)),
|
|
1501
|
+
}) && e.length > 0, Pe = (e) => Tt(e) && // `isPathArray` also checks if it's `Array`
|
|
1502
|
+
e.every(([t]) => t === t.toUpperCase()), ke = (e) => Pe(e) && e.every(([t]) => "ACLMQZ".includes(t)), Ye = (e) => ke(e) && e.every(([t]) => "MC".includes(t)), Ve = (e, t) => {
|
|
1457
1503
|
const { distance: s } = vt(e, t);
|
|
1458
1504
|
return Math.abs(s) < bt;
|
|
1459
|
-
},
|
|
1505
|
+
}, Ge = (e) => Tt(e) && // `isPathArray` checks if it's `Array`
|
|
1460
1506
|
e.slice(1).every(([t]) => t === t.toLowerCase()), Ie = (e) => {
|
|
1461
1507
|
if (typeof e != "string" || !e.length)
|
|
1462
1508
|
return !1;
|
|
@@ -1472,33 +1518,33 @@ e.slice(1).every(([t]) => t === t.toLowerCase()), Ie = (e) => {
|
|
|
1472
1518
|
polygon: ["points"],
|
|
1473
1519
|
polyline: ["points"],
|
|
1474
1520
|
glyph: ["d"]
|
|
1475
|
-
},
|
|
1521
|
+
}, Ee = (e) => e != null && typeof e == "object" && e.nodeType === 1, tn = (e) => {
|
|
1476
1522
|
let { x1: t, y1: s, x2: r, y2: n } = e;
|
|
1477
1523
|
return [t, s, r, n] = [t, s, r, n].map((i) => +i), [
|
|
1478
1524
|
["M", t, s],
|
|
1479
1525
|
["L", r, n]
|
|
1480
1526
|
];
|
|
1481
|
-
},
|
|
1527
|
+
}, en = (e) => {
|
|
1482
1528
|
const t = [], s = (e.points || "").trim().split(/[\s|,]/).map((n) => +n);
|
|
1483
1529
|
let r = 0;
|
|
1484
1530
|
for (; r < s.length; )
|
|
1485
1531
|
t.push([r ? "L" : "M", s[r], s[r + 1]]), r += 2;
|
|
1486
1532
|
return e.type === "polygon" ? [...t, ["z"]] : t;
|
|
1487
|
-
},
|
|
1533
|
+
}, nn = (e) => {
|
|
1488
1534
|
let { cx: t, cy: s, r } = e;
|
|
1489
1535
|
return [t, s, r] = [t, s, r].map((n) => +n), [
|
|
1490
1536
|
["M", t - r, s],
|
|
1491
1537
|
["a", r, r, 0, 1, 0, 2 * r, 0],
|
|
1492
1538
|
["a", r, r, 0, 1, 0, -2 * r, 0]
|
|
1493
1539
|
];
|
|
1494
|
-
},
|
|
1540
|
+
}, sn = (e) => {
|
|
1495
1541
|
let { cx: t, cy: s } = e, r = e.rx || 0, n = e.ry || r;
|
|
1496
1542
|
return [t, s, r, n] = [t, s, r, n].map((i) => +i), [
|
|
1497
1543
|
["M", t - r, s],
|
|
1498
1544
|
["a", r, n, 0, 1, 0, 2 * r, 0],
|
|
1499
1545
|
["a", r, n, 0, 1, 0, -2 * r, 0]
|
|
1500
1546
|
];
|
|
1501
|
-
},
|
|
1547
|
+
}, rn = (e) => {
|
|
1502
1548
|
const t = +e.x || 0, s = +e.y || 0, r = +e.width, n = +e.height;
|
|
1503
1549
|
let i = +(e.rx || 0), o = +(e.ry || i);
|
|
1504
1550
|
return i || o ? (i * 2 > r && (i -= (i * 2 - r) / 2), o * 2 > n && (o -= (o * 2 - n) / 2), [
|
|
@@ -1512,40 +1558,38 @@ e.slice(1).every(([t]) => t === t.toLowerCase()), Ie = (e) => {
|
|
|
1512
1558
|
["v", -n + o * 2],
|
|
1513
1559
|
["s", 0, -o, i, -o]
|
|
1514
1560
|
]) : [["M", t, s], ["h", r], ["v", n], ["H", t], ["Z"]];
|
|
1515
|
-
},
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
i ? e.getAttribute("d") || /* istanbul ignore next @preserve */
|
|
1561
|
+
}, Re = (e) => {
|
|
1562
|
+
const t = Object.keys(ct), s = Ee(e), r = s ? e.tagName : null;
|
|
1563
|
+
if (r && [...t, "path"].every((c) => r !== c))
|
|
1564
|
+
throw TypeError(`${S}: "${r}" is not SVGElement`);
|
|
1565
|
+
const n = s ? r : e.type, i = ct[n], o = { type: n };
|
|
1566
|
+
s ? i.forEach((c) => {
|
|
1567
|
+
o[c] = e.getAttribute(c);
|
|
1568
|
+
}) : Object.assign(o, e);
|
|
1569
|
+
let l = [];
|
|
1570
|
+
return n === "circle" ? l = nn(o) : n === "ellipse" ? l = sn(o) : ["polyline", "polygon"].includes(n) ? l = en(o) : n === "rect" ? l = rn(o) : n === "line" ? l = tn(o) : ["glyph", "path"].includes(n) && (l = Q(
|
|
1571
|
+
s ? e.getAttribute("d") || /* istanbul ignore next @preserve */
|
|
1527
1572
|
"" : e.d || ""
|
|
1528
|
-
)),
|
|
1529
|
-
},
|
|
1530
|
-
const r = s || document, n =
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
m[y]
|
|
1573
|
+
)), Tt(l) && l.length ? l : !1;
|
|
1574
|
+
}, on = (e, t, s) => {
|
|
1575
|
+
const r = s || document, n = Object.keys(ct), i = Ee(e), o = i ? e.tagName : null;
|
|
1576
|
+
if (o === "path")
|
|
1577
|
+
throw TypeError(`${S}: "${o}" is already SVGPathElement`);
|
|
1578
|
+
if (o && n.every((m) => o !== m))
|
|
1579
|
+
throw TypeError(`${S}: "${o}" is not SVGElement`);
|
|
1580
|
+
const l = r.createElementNS("http://www.w3.org/2000/svg", "path"), c = i ? o : e.type, a = ct[c], u = { type: c }, f = V.round, h = Re(e), y = h && h.length ? kt(h, f) : "";
|
|
1581
|
+
return i ? (a.forEach((m) => {
|
|
1582
|
+
u[m] = e.getAttribute(m);
|
|
1583
|
+
}), Object.values(e.attributes).forEach(({ name: m, value: g }) => {
|
|
1584
|
+
a.includes(m) || l.setAttribute(m, g);
|
|
1585
|
+
})) : (Object.assign(u, e), Object.keys(u).forEach((m) => {
|
|
1586
|
+
!a.includes(m) && m !== "type" && l.setAttribute(
|
|
1587
|
+
m.replace(/[A-Z]/g, (g) => `-${g.toLowerCase()}`),
|
|
1588
|
+
u[m]
|
|
1545
1589
|
);
|
|
1546
|
-
})), Ie(
|
|
1547
|
-
},
|
|
1548
|
-
let t = new
|
|
1590
|
+
})), Ie(y) ? (l.setAttribute("d", y), t && i && (e.before(l, e), e.remove()), l) : !1;
|
|
1591
|
+
}, je = (e) => {
|
|
1592
|
+
let t = new C();
|
|
1549
1593
|
const { origin: s } = e, [r, n] = s, { translate: i } = e, { rotate: o } = e, { skew: l } = e, { scale: c } = e;
|
|
1550
1594
|
return Array.isArray(i) && i.length >= 2 && i.every((a) => !Number.isNaN(+a)) && i.some((a) => a !== 0) ? t = t.translate(...i) : typeof i == "number" && !Number.isNaN(i) && (t = t.translate(i)), (o || l || c) && (t = t.translate(r, n), Array.isArray(o) && o.length >= 2 && o.every((a) => !Number.isNaN(+a)) && o.some((a) => a !== 0) ? t = t.rotate(...o) : typeof o == "number" && !Number.isNaN(o) && (t = t.rotate(o)), Array.isArray(l) && l.length === 2 && l.every(
|
|
1551
1595
|
(a) => !Number.isNaN(+a)
|
|
@@ -1556,15 +1600,15 @@ e.slice(1).every(([t]) => t === t.toLowerCase()), Ie = (e) => {
|
|
|
1556
1600
|
const [n] = e, { round: i } = V, o = typeof i == "number" ? i : (
|
|
1557
1601
|
/* istanbul ignore next */
|
|
1558
1602
|
4
|
|
1559
|
-
), l = t.slice(1), { x1: c, y1: a, x2: u, y2:
|
|
1603
|
+
), l = t.slice(1), { x1: c, y1: a, x2: u, y2: f, x: h, y } = s, [m, g] = l.slice(-2), d = e;
|
|
1560
1604
|
if ("TQ".includes(n) || (s.qx = null, s.qy = null), n === "L") {
|
|
1561
|
-
if (k(h, o) === k(
|
|
1562
|
-
return ["V",
|
|
1563
|
-
if (k(
|
|
1564
|
-
return ["H",
|
|
1605
|
+
if (k(h, o) === k(m, o))
|
|
1606
|
+
return ["V", g];
|
|
1607
|
+
if (k(y, o) === k(g, o))
|
|
1608
|
+
return ["H", m];
|
|
1565
1609
|
} else if (n === "C") {
|
|
1566
|
-
const [M,
|
|
1567
|
-
if (s.x1 = M, s.y1 =
|
|
1610
|
+
const [M, w] = l;
|
|
1611
|
+
if (s.x1 = M, s.y1 = w, "CS".includes(r) && (k(M, o) === k(c * 2 - u, o) && k(w, o) === k(a * 2 - f, o) || k(c, o) === k(u * 2 - h, o) && k(a, o) === k(f * 2 - y, o)))
|
|
1568
1612
|
return [
|
|
1569
1613
|
"S",
|
|
1570
1614
|
l[2],
|
|
@@ -1573,11 +1617,11 @@ e.slice(1).every(([t]) => t === t.toLowerCase()), Ie = (e) => {
|
|
|
1573
1617
|
l[5]
|
|
1574
1618
|
];
|
|
1575
1619
|
} else if (n === "Q") {
|
|
1576
|
-
const [M,
|
|
1577
|
-
if (s.qx = M, s.qy =
|
|
1620
|
+
const [M, w] = l;
|
|
1621
|
+
if (s.qx = M, s.qy = w, "QT".includes(r) && k(M, o) === k(c * 2 - u, o) && k(w, o) === k(a * 2 - f, o))
|
|
1578
1622
|
return ["T", l[2], l[3]];
|
|
1579
1623
|
}
|
|
1580
|
-
return
|
|
1624
|
+
return d;
|
|
1581
1625
|
}, dt = (e, t) => {
|
|
1582
1626
|
const s = e.slice(1).map(
|
|
1583
1627
|
(r) => k(r, t)
|
|
@@ -1589,34 +1633,34 @@ e.slice(1).every(([t]) => t === t.toLowerCase()), Ie = (e) => {
|
|
|
1589
1633
|
2
|
|
1590
1634
|
), n = { ...ut }, i = [];
|
|
1591
1635
|
let o = "M", l = "Z";
|
|
1592
|
-
return Z(s, (c, a, u,
|
|
1593
|
-
n.x = u, n.y =
|
|
1594
|
-
const h =
|
|
1595
|
-
let
|
|
1636
|
+
return Z(s, (c, a, u, f) => {
|
|
1637
|
+
n.x = u, n.y = f;
|
|
1638
|
+
const h = Nt(c, n);
|
|
1639
|
+
let y = c;
|
|
1596
1640
|
if ([o] = c, i[a] = o, a) {
|
|
1597
1641
|
l = i[a - 1];
|
|
1598
|
-
const
|
|
1642
|
+
const g = Se(
|
|
1599
1643
|
c,
|
|
1600
1644
|
h,
|
|
1601
1645
|
n,
|
|
1602
1646
|
l
|
|
1603
|
-
),
|
|
1604
|
-
|
|
1647
|
+
), d = dt(g, r), M = d.join(""), w = Bt(g, a, u, f), x = dt(w, r), p = x.join("");
|
|
1648
|
+
y = M.length < p.length ? d : x;
|
|
1605
1649
|
}
|
|
1606
|
-
const
|
|
1607
|
-
return n.x1 = +h[
|
|
1650
|
+
const m = h.length;
|
|
1651
|
+
return n.x1 = +h[m - 2], n.y1 = +h[m - 1], n.x2 = +h[m - 4] || n.x1, n.y2 = +h[m - 3] || n.y1, y;
|
|
1608
1652
|
});
|
|
1609
|
-
},
|
|
1610
|
-
let s =
|
|
1653
|
+
}, cn = (e, t) => {
|
|
1654
|
+
let s = C.Translate(t[0], t[1], t[2]);
|
|
1611
1655
|
return [, , , s.m44] = t, s = e.multiply(s), [s.m41, s.m42, s.m43, s.m44];
|
|
1612
1656
|
}, Zt = (e, t, s) => {
|
|
1613
|
-
const [r, n, i] = s, [o, l, c] =
|
|
1657
|
+
const [r, n, i] = s, [o, l, c] = cn(e, [t[0], t[1], 0, 1]), a = o - r, u = l - n, f = c - i;
|
|
1614
1658
|
return [
|
|
1615
1659
|
// protect against division by ZERO
|
|
1616
|
-
a * (Math.abs(i) / Math.abs(
|
|
1617
|
-
u * (Math.abs(i) / Math.abs(
|
|
1660
|
+
a * (Math.abs(i) / Math.abs(f) || 1) + r,
|
|
1661
|
+
u * (Math.abs(i) / Math.abs(f) || 1) + n
|
|
1618
1662
|
];
|
|
1619
|
-
},
|
|
1663
|
+
}, ln = (e) => {
|
|
1620
1664
|
const t = e.slice(1).map(
|
|
1621
1665
|
(s, r, n) => r ? n[r - 1].slice(-2).concat(s.slice(1)) : e[0].slice(1).concat(s.slice(1))
|
|
1622
1666
|
).map((s) => s.map((r, n) => s[s.length - n - 2 * (1 - n % 2)])).reverse();
|
|
@@ -1625,108 +1669,108 @@ e.slice(1).every(([t]) => t === t.toLowerCase()), Ie = (e) => {
|
|
|
1625
1669
|
);
|
|
1626
1670
|
}, ft = (e) => {
|
|
1627
1671
|
const t = ht(e), s = ot(t), r = t.length, n = t[r - 1][0] === "Z", i = Z(t, (o, l) => {
|
|
1628
|
-
const c = s[l], a = l && t[l - 1], u = a && a[0],
|
|
1629
|
-
let
|
|
1630
|
-
switch (
|
|
1672
|
+
const c = s[l], a = l && t[l - 1], u = a && a[0], f = t[l + 1], h = f && f[0], [y] = o, [m, g] = s[l ? l - 1 : r - 1].slice(-2);
|
|
1673
|
+
let d = o;
|
|
1674
|
+
switch (y) {
|
|
1631
1675
|
case "M":
|
|
1632
|
-
|
|
1676
|
+
d = n ? ["Z"] : [y, m, g];
|
|
1633
1677
|
break;
|
|
1634
1678
|
case "A":
|
|
1635
|
-
|
|
1636
|
-
|
|
1679
|
+
d = [
|
|
1680
|
+
y,
|
|
1637
1681
|
o[1],
|
|
1638
1682
|
o[2],
|
|
1639
1683
|
o[3],
|
|
1640
1684
|
o[4],
|
|
1641
1685
|
o[5] === 1 ? 0 : 1,
|
|
1642
|
-
|
|
1643
|
-
|
|
1686
|
+
m,
|
|
1687
|
+
g
|
|
1644
1688
|
];
|
|
1645
1689
|
break;
|
|
1646
1690
|
case "C":
|
|
1647
|
-
|
|
1648
|
-
|
|
1691
|
+
f && h === "S" ? d = ["S", o[1], o[2], m, g] : d = [
|
|
1692
|
+
y,
|
|
1649
1693
|
o[3],
|
|
1650
1694
|
o[4],
|
|
1651
1695
|
o[1],
|
|
1652
1696
|
o[2],
|
|
1653
|
-
|
|
1654
|
-
|
|
1697
|
+
m,
|
|
1698
|
+
g
|
|
1655
1699
|
];
|
|
1656
1700
|
break;
|
|
1657
1701
|
case "S":
|
|
1658
|
-
u && "CS".includes(u) && (!
|
|
1702
|
+
u && "CS".includes(u) && (!f || h !== "S") ? d = [
|
|
1659
1703
|
"C",
|
|
1660
1704
|
c[3],
|
|
1661
1705
|
c[4],
|
|
1662
1706
|
c[1],
|
|
1663
1707
|
c[2],
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
] :
|
|
1667
|
-
|
|
1708
|
+
m,
|
|
1709
|
+
g
|
|
1710
|
+
] : d = [
|
|
1711
|
+
y,
|
|
1668
1712
|
c[1],
|
|
1669
1713
|
c[2],
|
|
1670
|
-
|
|
1671
|
-
|
|
1714
|
+
m,
|
|
1715
|
+
g
|
|
1672
1716
|
];
|
|
1673
1717
|
break;
|
|
1674
1718
|
case "Q":
|
|
1675
|
-
|
|
1719
|
+
f && h === "T" ? d = ["T", m, g] : d = [y, o[1], o[2], m, g];
|
|
1676
1720
|
break;
|
|
1677
1721
|
case "T":
|
|
1678
|
-
u && "QT".includes(u) && (!
|
|
1722
|
+
u && "QT".includes(u) && (!f || h !== "T") ? d = [
|
|
1679
1723
|
"Q",
|
|
1680
1724
|
c[1],
|
|
1681
1725
|
c[2],
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
] :
|
|
1726
|
+
m,
|
|
1727
|
+
g
|
|
1728
|
+
] : d = [y, m, g];
|
|
1685
1729
|
break;
|
|
1686
1730
|
case "Z":
|
|
1687
|
-
|
|
1731
|
+
d = ["M", m, g];
|
|
1688
1732
|
break;
|
|
1689
1733
|
case "H":
|
|
1690
|
-
|
|
1734
|
+
d = [y, m];
|
|
1691
1735
|
break;
|
|
1692
1736
|
case "V":
|
|
1693
|
-
|
|
1737
|
+
d = [y, g];
|
|
1694
1738
|
break;
|
|
1695
1739
|
default:
|
|
1696
|
-
|
|
1740
|
+
d = [y].concat(
|
|
1697
1741
|
o.slice(1, -2),
|
|
1698
|
-
|
|
1699
|
-
|
|
1742
|
+
m,
|
|
1743
|
+
g
|
|
1700
1744
|
);
|
|
1701
1745
|
}
|
|
1702
|
-
return
|
|
1746
|
+
return d;
|
|
1703
1747
|
});
|
|
1704
1748
|
return n ? i.reverse() : [i[0]].concat(i.slice(1).reverse());
|
|
1705
|
-
},
|
|
1749
|
+
}, an = (e, t) => {
|
|
1706
1750
|
let { round: s } = V;
|
|
1707
1751
|
return s = t === "off" || typeof t == "number" && t >= 0 ? t : typeof s == "number" && s >= 0 ? s : (
|
|
1708
1752
|
/* istanbul ignore next @preserve */
|
|
1709
1753
|
"off"
|
|
1710
1754
|
), s === "off" ? e.slice(0) : Z(e, (r) => dt(r, s));
|
|
1711
|
-
},
|
|
1712
|
-
const s = t, r = e.slice(0, 2), n = e.slice(2, 4), i = e.slice(4, 6), o = e.slice(6, 8), l = H(r, n, s), c = H(n, i, s), a = H(i, o, s), u = H(l, c, s),
|
|
1755
|
+
}, un = (e, t = 0.5) => {
|
|
1756
|
+
const s = t, r = e.slice(0, 2), n = e.slice(2, 4), i = e.slice(4, 6), o = e.slice(6, 8), l = H(r, n, s), c = H(n, i, s), a = H(i, o, s), u = H(l, c, s), f = H(c, a, s), h = H(u, f, s);
|
|
1713
1757
|
return [
|
|
1714
1758
|
["C", l[0], l[1], u[0], u[1], h[0], h[1]],
|
|
1715
|
-
["C",
|
|
1759
|
+
["C", f[0], f[1], a[0], a[1], o[0], o[1]]
|
|
1716
1760
|
];
|
|
1717
1761
|
}, Yt = (e) => {
|
|
1718
1762
|
const t = [];
|
|
1719
1763
|
let s, r = -1, n = 0, i = 0, o = 0, l = 0;
|
|
1720
1764
|
const c = { ...ut };
|
|
1721
1765
|
return e.forEach((a) => {
|
|
1722
|
-
const [u] = a,
|
|
1723
|
-
|
|
1766
|
+
const [u] = a, f = u.toUpperCase(), h = u.toLowerCase(), y = u === h, m = a.slice(1);
|
|
1767
|
+
f === "M" ? (r += 1, [n, i] = m, n += y ? c.x : 0, i += y ? c.y : 0, o = n, l = i, s = [y ? [f, o, l] : a]) : (f === "Z" ? (n = o, i = l) : f === "H" ? ([, n] = a, n += y ? c.x : (
|
|
1724
1768
|
/* istanbul ignore next @preserve */
|
|
1725
1769
|
0
|
|
1726
|
-
)) :
|
|
1770
|
+
)) : f === "V" ? ([, i] = a, i += y ? c.y : (
|
|
1727
1771
|
/* istanbul ignore next @preserve */
|
|
1728
1772
|
0
|
|
1729
|
-
)) : ([n, i] = a.slice(-2), n +=
|
|
1773
|
+
)) : ([n, i] = a.slice(-2), n += y ? c.x : 0, i += y ? c.y : 0), s.push(a)), c.x = n, c.y = i, t[r] = s;
|
|
1730
1774
|
}), t;
|
|
1731
1775
|
}, Vt = (e, t) => {
|
|
1732
1776
|
let s = 0, r = 0, n = 0, i = 0, o = 0, l = 0, c = "M";
|
|
@@ -1734,14 +1778,14 @@ e.slice(1).every(([t]) => t === t.toLowerCase()), Ie = (e) => {
|
|
|
1734
1778
|
if (!t || u && !u.length)
|
|
1735
1779
|
return a.slice(0);
|
|
1736
1780
|
t.origin || Object.assign(t, { origin: V.origin });
|
|
1737
|
-
const
|
|
1738
|
-
return h.isIdentity ? a.slice(0) : Z(a, (
|
|
1739
|
-
[c] =
|
|
1740
|
-
const M = c.toUpperCase(), x = M !== c ? at(
|
|
1741
|
-
let
|
|
1781
|
+
const f = t.origin, h = je(t);
|
|
1782
|
+
return h.isIdentity ? a.slice(0) : Z(a, (y, m, g, d) => {
|
|
1783
|
+
[c] = y;
|
|
1784
|
+
const M = c.toUpperCase(), x = M !== c ? at(y, m, g, d) : y.slice(0);
|
|
1785
|
+
let p = M === "A" ? ["C"].concat(
|
|
1742
1786
|
Mt(
|
|
1743
|
-
|
|
1744
|
-
|
|
1787
|
+
g,
|
|
1788
|
+
d,
|
|
1745
1789
|
x[1],
|
|
1746
1790
|
x[2],
|
|
1747
1791
|
x[3],
|
|
@@ -1750,28 +1794,28 @@ e.slice(1).every(([t]) => t === t.toLowerCase()), Ie = (e) => {
|
|
|
1750
1794
|
x[6],
|
|
1751
1795
|
x[7]
|
|
1752
1796
|
)
|
|
1753
|
-
) : M === "V" ? ["L",
|
|
1754
|
-
c =
|
|
1755
|
-
const L = c === "C" &&
|
|
1797
|
+
) : M === "V" ? ["L", g, x[1]] : M === "H" ? ["L", x[1], d] : x;
|
|
1798
|
+
c = p[0];
|
|
1799
|
+
const L = c === "C" && p.length > 7, T = L ? p.slice(0, 7) : p.slice(0);
|
|
1756
1800
|
if (L && (a.splice(
|
|
1757
|
-
|
|
1801
|
+
m + 1,
|
|
1758
1802
|
0,
|
|
1759
1803
|
["C"].concat(
|
|
1760
|
-
|
|
1804
|
+
p.slice(7)
|
|
1761
1805
|
)
|
|
1762
|
-
),
|
|
1806
|
+
), p = T), c === "L")
|
|
1763
1807
|
[n, i] = Zt(h, [
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
],
|
|
1808
|
+
p[1],
|
|
1809
|
+
p[2]
|
|
1810
|
+
], f), s !== n && r !== i ? p = ["L", n, i] : r === i ? p = ["H", n] : s === n && (p = ["V", i]);
|
|
1767
1811
|
else
|
|
1768
|
-
for (o = 1, l =
|
|
1812
|
+
for (o = 1, l = p.length; o < l; o += 2)
|
|
1769
1813
|
[n, i] = Zt(
|
|
1770
1814
|
h,
|
|
1771
|
-
[+
|
|
1772
|
-
|
|
1773
|
-
),
|
|
1774
|
-
return s = n, r = i,
|
|
1815
|
+
[+p[o], +p[o + 1]],
|
|
1816
|
+
f
|
|
1817
|
+
), p[o] = n, p[o + 1] = i;
|
|
1818
|
+
return s = n, r = i, p;
|
|
1775
1819
|
});
|
|
1776
1820
|
};
|
|
1777
1821
|
class A {
|
|
@@ -1784,7 +1828,7 @@ class A {
|
|
|
1784
1828
|
const r = s || {}, n = typeof t > "u";
|
|
1785
1829
|
if (n || !t.length)
|
|
1786
1830
|
throw TypeError(
|
|
1787
|
-
`${
|
|
1831
|
+
`${S}: "pathValue" is ${n ? "undefined" : "empty"}`
|
|
1788
1832
|
);
|
|
1789
1833
|
this.segments = Q(t);
|
|
1790
1834
|
const { round: i, origin: o } = r;
|
|
@@ -1792,11 +1836,11 @@ class A {
|
|
|
1792
1836
|
Number.isInteger(i) || i === "off" ? l = i : l = V.round;
|
|
1793
1837
|
let c = V.origin;
|
|
1794
1838
|
if (Array.isArray(o) && o.length >= 2) {
|
|
1795
|
-
const [a, u,
|
|
1839
|
+
const [a, u, f] = o.map(Number);
|
|
1796
1840
|
c = [
|
|
1797
1841
|
Number.isNaN(a) ? 0 : a,
|
|
1798
1842
|
Number.isNaN(u) ? 0 : u,
|
|
1799
|
-
Number.isNaN(
|
|
1843
|
+
Number.isNaN(f) ? 0 : f
|
|
1800
1844
|
];
|
|
1801
1845
|
}
|
|
1802
1846
|
return this.round = l, this.origin = c, this;
|
|
@@ -1965,32 +2009,32 @@ class A {
|
|
|
1965
2009
|
Object.keys(this).forEach((t) => delete this[t]);
|
|
1966
2010
|
}
|
|
1967
2011
|
}
|
|
1968
|
-
|
|
2012
|
+
b(A, "CSSMatrix", C), b(A, "pathToAbsolute", ht), b(A, "pathToRelative", Kt), b(A, "pathToCurve", yt), b(A, "pathToString", kt), b(A, "arcTools", He), b(A, "bezierTools", {
|
|
1969
2013
|
Cvalues: Ae,
|
|
1970
2014
|
Tvalues: Rt,
|
|
1971
|
-
minmaxC:
|
|
2015
|
+
minmaxC: jt,
|
|
1972
2016
|
minmaxQ: gt,
|
|
1973
2017
|
getBezierLength: mt,
|
|
1974
2018
|
bezierLength: Le,
|
|
1975
|
-
calculateBezier:
|
|
1976
|
-
computeBezier:
|
|
2019
|
+
calculateBezier: we,
|
|
2020
|
+
computeBezier: Ne,
|
|
1977
2021
|
deriveBezier: Me,
|
|
1978
2022
|
CBEZIER_MINMAX_EPSILON: ve
|
|
1979
|
-
}),
|
|
2023
|
+
}), b(A, "cubicTools", {
|
|
1980
2024
|
getCubicLength: xt,
|
|
1981
|
-
getCubicBBox:
|
|
1982
|
-
getPointAtCubicLength:
|
|
1983
|
-
getPointAtCubicSegmentLength:
|
|
1984
|
-
}),
|
|
2025
|
+
getCubicBBox: St,
|
|
2026
|
+
getPointAtCubicLength: Ce,
|
|
2027
|
+
getPointAtCubicSegmentLength: Te
|
|
2028
|
+
}), b(A, "lineTools", {
|
|
1985
2029
|
getPointAtLineLength: Ht,
|
|
1986
2030
|
getLineBBox: It,
|
|
1987
2031
|
getLineLength: it
|
|
1988
|
-
}),
|
|
2032
|
+
}), b(A, "quadTools", {
|
|
1989
2033
|
getPointAtQuadSegmentLength: $e,
|
|
1990
2034
|
getQuadLength: pt,
|
|
1991
2035
|
getQuadBBox: Qt,
|
|
1992
2036
|
getPointAtQuadLength: ze
|
|
1993
|
-
}),
|
|
2037
|
+
}), b(A, "polygonTools", { polygonArea: Fe, polygonLength: _e }), b(A, "distanceSquareRoot", wt), b(A, "distanceEpsilon", bt), b(A, "midPoint", H), b(A, "rotateVector", st), b(A, "roundTo", k), b(A, "finalizeSegment", qt), b(A, "invalidPathValue", J), b(A, "isArcCommand", ye), b(A, "isDigit", U), b(A, "isDigitStart", he), b(A, "isMoveCommand", ge), b(A, "isPathCommand", fe), b(A, "isSpace", me), b(A, "paramsCount", tt), b(A, "paramsParser", ut), b(A, "pathParser", Ot), b(A, "scanFlag", ae), b(A, "scanParam", ue), b(A, "scanSegment", Dt), b(A, "skipSpaces", et), b(A, "getPathBBox", Wt), b(A, "getPathArea", qe), b(A, "getTotalLength", nt), b(A, "getDrawDirection", Ke), b(A, "getPointAtLength", rt), b(A, "getPropertiesAtLength", Ut), b(A, "getPropertiesAtPoint", vt), b(A, "getClosestPoint", Ue), b(A, "getSegmentOfPoint", Xe), b(A, "getSegmentAtLength", We), b(A, "isPointInStroke", Ve), b(A, "isValidPath", Ie), b(A, "isPathArray", Tt), b(A, "isAbsoluteArray", Pe), b(A, "isRelativeArray", Ge), b(A, "isCurveArray", Ye), b(A, "isNormalizedArray", ke), b(A, "shapeToPath", on), b(A, "shapeToPathArray", Re), b(A, "shapeParams", ct), b(A, "parsePathString", Q), b(A, "absolutizeSegment", at), b(A, "arcToCubic", Mt), b(A, "getSVGMatrix", je), b(A, "iterate", Z), b(A, "lineToCubic", Pt), b(A, "normalizePath", ot), b(A, "normalizeSegment", Nt), b(A, "optimizePath", Xt), b(A, "projection2d", Zt), b(A, "quadToCubic", xe), b(A, "relativizeSegment", Bt), b(A, "reverseCurve", ln), b(A, "reversePath", ft), b(A, "roundPath", an), b(A, "roundSegment", dt), b(A, "segmentToCubic", pe), b(A, "shortenSegment", Se), b(A, "splitCubic", un), b(A, "splitPath", Yt), b(A, "transformPath", Vt);
|
|
1994
2038
|
export {
|
|
1995
2039
|
A as default
|
|
1996
2040
|
};
|