modern-path2d 0.0.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -1
- package/dist/index.cjs +1567 -84
- package/dist/index.d.cts +171 -124
- package/dist/index.d.mts +171 -124
- package/dist/index.d.ts +171 -124
- package/dist/index.js +1 -1
- package/dist/index.mjs +1566 -82
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,37 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
x: number;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
x: number;
|
|
22
|
-
y: number;
|
|
23
|
-
} | {
|
|
24
|
-
type: 'A';
|
|
25
|
-
rx: number;
|
|
26
|
-
ry: number;
|
|
27
|
-
xAxisRotation: number;
|
|
28
|
-
largeArcFlag: number;
|
|
29
|
-
sweepFlag: number;
|
|
30
|
-
x: number;
|
|
31
|
-
y: number;
|
|
32
|
-
} | {
|
|
33
|
-
type: 'Z';
|
|
34
|
-
};
|
|
1
|
+
declare class Matrix3 {
|
|
2
|
+
elements: number[];
|
|
3
|
+
constructor(n11?: number, n12?: number, n13?: number, n21?: number, n22?: number, n23?: number, n31?: number, n32?: number, n33?: number);
|
|
4
|
+
set(n11: number, n12: number, n13: number, n21: number, n22: number, n23: number, n31: number, n32: number, n33: number): this;
|
|
5
|
+
identity(): this;
|
|
6
|
+
copy(m: Matrix3): this;
|
|
7
|
+
multiply(m: Matrix3): this;
|
|
8
|
+
premultiply(m: Matrix3): this;
|
|
9
|
+
multiplyMatrices(a: Matrix3, b: Matrix3): this;
|
|
10
|
+
invert(): this;
|
|
11
|
+
transpose(): this;
|
|
12
|
+
scale(sx: number, sy: number): this;
|
|
13
|
+
rotate(theta: number): this;
|
|
14
|
+
translate(tx: number, ty: number): this;
|
|
15
|
+
makeTranslation(x: number, y: number): this;
|
|
16
|
+
makeRotation(theta: number): this;
|
|
17
|
+
makeScale(x: number, y: number): this;
|
|
18
|
+
fromArray(array: number[], offset?: number): this;
|
|
19
|
+
clone(): Matrix3;
|
|
20
|
+
}
|
|
35
21
|
|
|
36
22
|
declare class Point2D {
|
|
37
23
|
x: number;
|
|
@@ -51,36 +37,11 @@ declare class Point2D {
|
|
|
51
37
|
normalize(): this;
|
|
52
38
|
lerpVectors(v1: Point2D, v2: Point2D, alpha: number): this;
|
|
53
39
|
equals(point: Point2D): boolean;
|
|
40
|
+
applyMatrix3(matrix3: Matrix3): this;
|
|
54
41
|
copy(point: Point2D): this;
|
|
55
42
|
clone(): Point2D;
|
|
56
43
|
}
|
|
57
44
|
|
|
58
|
-
declare abstract class Curve {
|
|
59
|
-
arcLengthDivisions: number;
|
|
60
|
-
protected _cacheArcLengths?: number[];
|
|
61
|
-
protected _needsUpdate: boolean;
|
|
62
|
-
abstract getPoint(t: number, output?: Point2D): Point2D;
|
|
63
|
-
abstract getCommands(): PathCommand[];
|
|
64
|
-
abstract drawTo(ctx: CanvasRenderingContext2D): void;
|
|
65
|
-
getMinMax(min?: Point2D, max?: Point2D): {
|
|
66
|
-
min: Point2D;
|
|
67
|
-
max: Point2D;
|
|
68
|
-
};
|
|
69
|
-
getDivisions(divisions: number): number;
|
|
70
|
-
getPointAt(u: number, output?: Point2D): Point2D;
|
|
71
|
-
getPoints(divisions?: number): Point2D[];
|
|
72
|
-
getSpacedPoints(divisions?: number): Point2D[];
|
|
73
|
-
getLength(): number;
|
|
74
|
-
getLengths(divisions?: number): number[];
|
|
75
|
-
updateArcLengths(): void;
|
|
76
|
-
getUtoTmapping(u: number, distance?: number): number;
|
|
77
|
-
getTangent(t: number, output?: Point2D): Point2D;
|
|
78
|
-
getTangentAt(u: number, output?: Point2D): Point2D;
|
|
79
|
-
getData(): string;
|
|
80
|
-
clone(): this;
|
|
81
|
-
copy(source: Curve): this;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
45
|
declare class CurvePath extends Curve {
|
|
85
46
|
curves: Curve[];
|
|
86
47
|
currentPoint: Point2D;
|
|
@@ -104,32 +65,158 @@ declare class CurvePath extends Curve {
|
|
|
104
65
|
splineThru(points: Point2D[]): this;
|
|
105
66
|
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, clockwise?: boolean): this;
|
|
106
67
|
absarc(x: number, y: number, radius: number, startAngle: number, endAngle: number, clockwise?: boolean): this;
|
|
107
|
-
ellipse(x: number, y: number,
|
|
108
|
-
absellipse(x: number, y: number,
|
|
68
|
+
ellipse(x: number, y: number, radiusX: number, radiusY: number, startAngle: number, endAngle: number, clockwise?: boolean, rotation?: number): this;
|
|
69
|
+
absellipse(x: number, y: number, radiusX: number, radiusY: number, startAngle: number, endAngle: number, clockwise?: boolean, rotation?: number): this;
|
|
109
70
|
getCommands(): PathCommand[];
|
|
110
71
|
getMinMax(min?: Point2D, max?: Point2D): {
|
|
111
72
|
min: Point2D;
|
|
112
73
|
max: Point2D;
|
|
113
74
|
};
|
|
114
|
-
drawTo(ctx: CanvasRenderingContext2D):
|
|
75
|
+
drawTo(ctx: CanvasRenderingContext2D): this;
|
|
115
76
|
copy(source: CurvePath): this;
|
|
116
77
|
}
|
|
117
78
|
|
|
79
|
+
/**
|
|
80
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Path2D
|
|
81
|
+
*/
|
|
82
|
+
declare class Path2D<T = any> {
|
|
83
|
+
currentPath: CurvePath;
|
|
84
|
+
paths: CurvePath[];
|
|
85
|
+
userData?: T;
|
|
86
|
+
constructor(path?: Path2D | PathCommand[] | string);
|
|
87
|
+
addPath(path: Path2D | CurvePath): this;
|
|
88
|
+
closePath(): this;
|
|
89
|
+
moveTo(x: number, y: number): this;
|
|
90
|
+
lineTo(x: number, y: number): this;
|
|
91
|
+
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): this;
|
|
92
|
+
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): this;
|
|
93
|
+
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): this;
|
|
94
|
+
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): this;
|
|
95
|
+
ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise?: boolean): this;
|
|
96
|
+
rect(x: number, y: number, w: number, h: number): this;
|
|
97
|
+
addCommands(commands: PathCommand[]): this;
|
|
98
|
+
addData(data: string): this;
|
|
99
|
+
splineThru(points: Point2D[]): this;
|
|
100
|
+
forEachCurve(cb: (curve: Curve) => void): this;
|
|
101
|
+
transform(matrix: Matrix3): this;
|
|
102
|
+
getMinMax(min?: Point2D, max?: Point2D): {
|
|
103
|
+
min: Point2D;
|
|
104
|
+
max: Point2D;
|
|
105
|
+
};
|
|
106
|
+
getCommands(): PathCommand[];
|
|
107
|
+
getData(): string;
|
|
108
|
+
getBoundingBox(): {
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
width: number;
|
|
112
|
+
height: number;
|
|
113
|
+
};
|
|
114
|
+
getSvgString(): string;
|
|
115
|
+
getSvgDataUri(): string;
|
|
116
|
+
drawTo(ctx: CanvasRenderingContext2D): void;
|
|
117
|
+
strokeTo(ctx: CanvasRenderingContext2D): void;
|
|
118
|
+
fillTo(ctx: CanvasRenderingContext2D): void;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @link https://developer.mozilla.org/docs/Web/SVG/Attribute/d
|
|
123
|
+
*/
|
|
124
|
+
type PathCommand = {
|
|
125
|
+
type: 'm' | 'M';
|
|
126
|
+
x: number;
|
|
127
|
+
y: number;
|
|
128
|
+
} | {
|
|
129
|
+
type: 'h' | 'H';
|
|
130
|
+
x: number;
|
|
131
|
+
} | {
|
|
132
|
+
type: 'v' | 'V';
|
|
133
|
+
y: number;
|
|
134
|
+
} | {
|
|
135
|
+
type: 'l' | 'L';
|
|
136
|
+
x: number;
|
|
137
|
+
y: number;
|
|
138
|
+
} | {
|
|
139
|
+
type: 'c' | 'C';
|
|
140
|
+
x1: number;
|
|
141
|
+
y1: number;
|
|
142
|
+
x2: number;
|
|
143
|
+
y2: number;
|
|
144
|
+
x: number;
|
|
145
|
+
y: number;
|
|
146
|
+
} | {
|
|
147
|
+
type: 's' | 'S';
|
|
148
|
+
x2: number;
|
|
149
|
+
y2: number;
|
|
150
|
+
x: number;
|
|
151
|
+
y: number;
|
|
152
|
+
} | {
|
|
153
|
+
type: 'q' | 'Q';
|
|
154
|
+
x1: number;
|
|
155
|
+
y1: number;
|
|
156
|
+
x: number;
|
|
157
|
+
y: number;
|
|
158
|
+
} | {
|
|
159
|
+
type: 't' | 'T';
|
|
160
|
+
x: number;
|
|
161
|
+
y: number;
|
|
162
|
+
} | {
|
|
163
|
+
type: 'a' | 'A';
|
|
164
|
+
rx: number;
|
|
165
|
+
ry: number;
|
|
166
|
+
angle: number;
|
|
167
|
+
largeArcFlag: number;
|
|
168
|
+
sweepFlag: number;
|
|
169
|
+
x: number;
|
|
170
|
+
y: number;
|
|
171
|
+
} | {
|
|
172
|
+
type: 'z' | 'Z';
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
declare abstract class Curve {
|
|
176
|
+
arcLengthDivisions: number;
|
|
177
|
+
protected _cacheArcLengths?: number[];
|
|
178
|
+
protected _needsUpdate: boolean;
|
|
179
|
+
abstract getPoint(t: number, output?: Point2D): Point2D;
|
|
180
|
+
getPointAt(u: number, output?: Point2D): Point2D;
|
|
181
|
+
getPoints(divisions?: number): Point2D[];
|
|
182
|
+
getSpacedPoints(divisions?: number): Point2D[];
|
|
183
|
+
getLength(): number;
|
|
184
|
+
getLengths(divisions?: number): number[];
|
|
185
|
+
updateArcLengths(): void;
|
|
186
|
+
getUtoTmapping(u: number, distance?: number): number;
|
|
187
|
+
getTangent(t: number, output?: Point2D): Point2D;
|
|
188
|
+
getTangentAt(u: number, output?: Point2D): Point2D;
|
|
189
|
+
/** overrideable */
|
|
190
|
+
transform(matrix: Matrix3): this;
|
|
191
|
+
/** overrideable */
|
|
192
|
+
getDivisions(divisions: number): number;
|
|
193
|
+
/** overrideable */
|
|
194
|
+
getMinMax(min?: Point2D, max?: Point2D): {
|
|
195
|
+
min: Point2D;
|
|
196
|
+
max: Point2D;
|
|
197
|
+
};
|
|
198
|
+
/** overrideable */
|
|
199
|
+
getCommands(): PathCommand[];
|
|
200
|
+
getData(): string;
|
|
201
|
+
/** overrideable */
|
|
202
|
+
drawTo(ctx: CanvasRenderingContext2D): this;
|
|
203
|
+
clone(): this;
|
|
204
|
+
copy(source: Curve): this;
|
|
205
|
+
}
|
|
206
|
+
|
|
118
207
|
declare class CircleCurve extends Curve {
|
|
119
208
|
center: Point2D;
|
|
120
209
|
radius: number;
|
|
121
210
|
start: number;
|
|
122
211
|
end: number;
|
|
123
212
|
constructor(center: Point2D, radius: number, start?: number, end?: number);
|
|
213
|
+
getPoint(t: number): Point2D;
|
|
214
|
+
getTangent(t: number): Point2D;
|
|
215
|
+
getNormal(t: number): Point2D;
|
|
124
216
|
getMinMax(min?: Point2D, max?: Point2D): {
|
|
125
217
|
min: Point2D;
|
|
126
218
|
max: Point2D;
|
|
127
219
|
};
|
|
128
|
-
getPoint(t: number): Point2D;
|
|
129
|
-
getTangent(t: number): Point2D;
|
|
130
|
-
getNormal(t: number): Point2D;
|
|
131
|
-
getCommands(): PathCommand[];
|
|
132
|
-
drawTo(_ctx: CanvasRenderingContext2D): void;
|
|
133
220
|
}
|
|
134
221
|
|
|
135
222
|
declare class CubicBezierCurve extends Curve {
|
|
@@ -143,25 +230,27 @@ declare class CubicBezierCurve extends Curve {
|
|
|
143
230
|
min: Point2D;
|
|
144
231
|
max: Point2D;
|
|
145
232
|
};
|
|
233
|
+
transform(matrix: Matrix3): this;
|
|
146
234
|
getCommands(): PathCommand[];
|
|
147
|
-
drawTo(ctx: CanvasRenderingContext2D):
|
|
235
|
+
drawTo(ctx: CanvasRenderingContext2D): this;
|
|
148
236
|
copy(source: CubicBezierCurve): this;
|
|
149
237
|
}
|
|
150
238
|
|
|
151
239
|
declare class EllipseCurve extends Curve {
|
|
152
240
|
x: number;
|
|
153
241
|
y: number;
|
|
154
|
-
|
|
155
|
-
|
|
242
|
+
radiusX: number;
|
|
243
|
+
radiusY: number;
|
|
156
244
|
startAngle: number;
|
|
157
245
|
endAngle: number;
|
|
158
246
|
clockwise: boolean;
|
|
159
247
|
rotation: number;
|
|
160
|
-
constructor(x?: number, y?: number,
|
|
248
|
+
constructor(x?: number, y?: number, radiusX?: number, radiusY?: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number);
|
|
161
249
|
getDivisions(divisions?: number): number;
|
|
162
250
|
getPoint(t: number, output?: Point2D): Point2D;
|
|
163
251
|
getCommands(): PathCommand[];
|
|
164
|
-
drawTo(ctx: CanvasRenderingContext2D):
|
|
252
|
+
drawTo(ctx: CanvasRenderingContext2D): this;
|
|
253
|
+
transform(matrix: Matrix3): this;
|
|
165
254
|
copy(source: EllipseCurve): this;
|
|
166
255
|
}
|
|
167
256
|
|
|
@@ -179,7 +268,7 @@ declare class HeartCurve extends Curve {
|
|
|
179
268
|
getTangent(value: number): Point2D;
|
|
180
269
|
getNormal(value: number): Point2D;
|
|
181
270
|
getCommands(): PathCommand[];
|
|
182
|
-
drawTo(ctx: CanvasRenderingContext2D):
|
|
271
|
+
drawTo(ctx: CanvasRenderingContext2D): this;
|
|
183
272
|
}
|
|
184
273
|
|
|
185
274
|
declare class LineCurve extends Curve {
|
|
@@ -196,7 +285,8 @@ declare class LineCurve extends Curve {
|
|
|
196
285
|
min: Point2D;
|
|
197
286
|
max: Point2D;
|
|
198
287
|
};
|
|
199
|
-
|
|
288
|
+
transform(matrix: Matrix3): this;
|
|
289
|
+
drawTo(ctx: CanvasRenderingContext2D): this;
|
|
200
290
|
copy(source: LineCurve): this;
|
|
201
291
|
}
|
|
202
292
|
|
|
@@ -221,7 +311,7 @@ declare class PloygonCurve extends Curve {
|
|
|
221
311
|
min: Point2D;
|
|
222
312
|
max: Point2D;
|
|
223
313
|
};
|
|
224
|
-
drawTo(ctx: CanvasRenderingContext2D):
|
|
314
|
+
drawTo(ctx: CanvasRenderingContext2D): this;
|
|
225
315
|
}
|
|
226
316
|
|
|
227
317
|
declare class QuadraticBezierCurve extends Curve {
|
|
@@ -235,7 +325,8 @@ declare class QuadraticBezierCurve extends Curve {
|
|
|
235
325
|
min: Point2D;
|
|
236
326
|
max: Point2D;
|
|
237
327
|
};
|
|
238
|
-
|
|
328
|
+
transform(matrix: Matrix3): this;
|
|
329
|
+
drawTo(ctx: CanvasRenderingContext2D): this;
|
|
239
330
|
copy(source: QuadraticBezierCurve): this;
|
|
240
331
|
}
|
|
241
332
|
|
|
@@ -262,7 +353,7 @@ declare class RectangularCurve extends Curve {
|
|
|
262
353
|
min: Point2D;
|
|
263
354
|
max: Point2D;
|
|
264
355
|
};
|
|
265
|
-
drawTo(ctx: CanvasRenderingContext2D):
|
|
356
|
+
drawTo(ctx: CanvasRenderingContext2D): this;
|
|
266
357
|
}
|
|
267
358
|
|
|
268
359
|
declare class SplineCurve extends Curve {
|
|
@@ -270,53 +361,9 @@ declare class SplineCurve extends Curve {
|
|
|
270
361
|
constructor(points?: Point2D[]);
|
|
271
362
|
getDivisions(divisions?: number): number;
|
|
272
363
|
getPoint(t: number, output?: Point2D): Point2D;
|
|
273
|
-
getCommands(): PathCommand[];
|
|
274
|
-
drawTo(_ctx: CanvasRenderingContext2D): void;
|
|
275
364
|
copy(source: SplineCurve): this;
|
|
276
365
|
}
|
|
277
366
|
|
|
278
|
-
|
|
279
|
-
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Path2D
|
|
280
|
-
*/
|
|
281
|
-
declare class Path2D {
|
|
282
|
-
currentPath: CurvePath;
|
|
283
|
-
paths: CurvePath[];
|
|
284
|
-
addPath(path: Path2D): this;
|
|
285
|
-
closePath(): this;
|
|
286
|
-
moveTo(x: number, y: number): this;
|
|
287
|
-
lineTo(x: number, y: number): this;
|
|
288
|
-
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): this;
|
|
289
|
-
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): this;
|
|
290
|
-
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): this;
|
|
291
|
-
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): this;
|
|
292
|
-
ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise: number): this;
|
|
293
|
-
rect(x: number, y: number, w: number, h: number): this;
|
|
294
|
-
splineThru(points: Point2D[]): this;
|
|
295
|
-
getMinMax(min?: Point2D, max?: Point2D): {
|
|
296
|
-
min: Point2D;
|
|
297
|
-
max: Point2D;
|
|
298
|
-
};
|
|
299
|
-
getCommands(): PathCommand[];
|
|
300
|
-
getData(): string;
|
|
301
|
-
getBoundingBox(): {
|
|
302
|
-
x: number;
|
|
303
|
-
y: number;
|
|
304
|
-
width: number;
|
|
305
|
-
height: number;
|
|
306
|
-
};
|
|
307
|
-
getSvgString(): string;
|
|
308
|
-
getSvgDataUri(): string;
|
|
309
|
-
drawTo(ctx: CanvasRenderingContext2D): void;
|
|
310
|
-
strokeTo(ctx: CanvasRenderingContext2D): void;
|
|
311
|
-
fillTo(ctx: CanvasRenderingContext2D): void;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Bezier Curves formulas obtained from
|
|
316
|
-
* https://en.wikipedia.org/wiki/B%C3%A9zier_curve
|
|
317
|
-
*/
|
|
318
|
-
declare function catmullRom(t: number, p0: number, p1: number, p2: number, p3: number): number;
|
|
319
|
-
declare function quadraticBezier(t: number, p0: number, p1: number, p2: number): number;
|
|
320
|
-
declare function cubicBezier(t: number, p0: number, p1: number, p2: number, p3: number): number;
|
|
367
|
+
declare function parseSvg(svg: string | SVGElement): Path2D[];
|
|
321
368
|
|
|
322
|
-
export { CircleCurve, CubicBezierCurve, Curve, CurvePath, EllipseCurve, HeartCurve, LineCurve,
|
|
369
|
+
export { CircleCurve, CubicBezierCurve, Curve, CurvePath, EllipseCurve, HeartCurve, LineCurve, Matrix3, Path2D, PloygonCurve, Point2D, QuadraticBezierCurve, RectangularCurve, SplineCurve, parseSvg };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(g,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(g=typeof globalThis<"u"?globalThis:g||self,r(g.modernPath2d={}))})(this,function(g){"use strict";var O=Object.defineProperty;var H=(g,r,x)=>r in g?O(g,r,{enumerable:!0,configurable:!0,writable:!0,value:x}):g[r]=x;var p=(g,r,x)=>H(g,typeof r!="symbol"?r+"":r,x);class r{constructor(e=0,t=0){this.x=e,this.y=t}static get MAX(){return new r(1/0,1/0)}static get MIN(){return new r(-1/0,-1/0)}set(e,t){return this.x=e,this.y=t,this}add(e){return this.x+=e.x,this.y+=e.y,this}sub(e){return this.x-=e.x,this.y-=e.y,this}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y;return t*t+s*s}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}multiplyScalar(e){return this.x*=e,this.y*=e,this}divideScalar(e){return this.multiplyScalar(1/e)}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}normalize(){return this.divideScalar(this.length()||1)}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this}equals(e){return this.x===e.x&&this.y===e.y}copy(e){return this.x=e.x,this.y=e.y,this}clone(){return new r(this.x,this.y)}}class x{constructor(){p(this,"arcLengthDivisions",200);p(this,"_cacheArcLengths");p(this,"_needsUpdate",!1)}getMinMax(e=r.MAX,t=r.MIN){return{min:e,max:t}}getDivisions(e){return e}getPointAt(e,t=new r){return this.getPoint(this.getUtoTmapping(e),t)}getPoints(e=5){const t=[];for(let s=0;s<=e;s++)t.push(this.getPoint(s/e));return t}getSpacedPoints(e=5){const t=[];for(let s=0;s<=e;s++)t.push(this.getPointAt(s/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this._cacheArcLengths&&this._cacheArcLengths.length===e+1&&!this._needsUpdate)return this._cacheArcLengths;this._needsUpdate=!1;const t=[];let s,n=this.getPoint(0),i=0;t.push(0);for(let h=1;h<=e;h++)s=this.getPoint(h/e),i+=s.distanceTo(n),t.push(i),n=s;return this._cacheArcLengths=t,t}updateArcLengths(){this._needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const s=this.getLengths();let n=0;const i=s.length;let h;t?h=t:h=e*s[i-1];let o=0,c=i-1,u;for(;o<=c;)if(n=Math.floor(o+(c-o)/2),u=s[n]-h,u<0)o=n+1;else if(u>0)c=n-1;else{c=n;break}if(n=c,s[n]===h)return n/(i-1);const l=s[n],v=s[n+1]-l,d=(h-l)/v;return(n+d)/(i-1)}getTangent(e,t=new r){let n=e-1e-4,i=e+1e-4;return n<0&&(n=0),i>1&&(i=1),t.copy(this.getPoint(i)).sub(this.getPoint(n)).normalize()}getTangentAt(e,t=new r){return this.getTangent(this.getUtoTmapping(e),t)}getData(){return this.getCommands().map(e=>{switch(e.type){case"M":return`M ${e.x} ${e.y}`;case"L":return`L ${e.x} ${e.y}`;case"C":return`C ${e.x1} ${e.y1} ${e.x2} ${e.y2} ${e.x} ${e.y}`;case"Q":return`Q ${e.x1} ${e.y1} ${e.x} ${e.y}`;case"A":return`A ${e.rx} ${e.ry} ${e.xAxisRotation} ${e.largeArcFlag} ${e.sweepFlag} ${e.x} ${e.y}`;case"Z":return"Z";default:return""}}).join(" ")}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class L extends x{constructor(e,t,s=0,n=Math.PI*2){super(),this.center=e,this.radius=t,this.start=s,this.end=n}getMinMax(e=r.MAX,t=r.MIN){return e.x=Math.min(e.x,this.center.x-this.radius),e.y=Math.min(e.y,this.center.y-this.radius),t.x=Math.max(t.x,this.center.x+this.radius),t.y=Math.max(t.y,this.center.y+this.radius),{min:e,max:t}}getPoint(e){const{radius:t,center:s}=this;return s.clone().add(this.getNormal(e).clone().multiplyScalar(t))}getTangent(e){const{x:t,y:s}=this.getNormal(e);return new r(-s,t)}getNormal(e){const{start:t,end:s}=this,n=e*(s-t)+t-.5*Math.PI;return new r(Math.cos(n),Math.sin(n))}getCommands(){return[]}drawTo(e){}}function m(a,e,t,s,n){const i=(s-e)*.5,h=(n-t)*.5,o=a*a,c=a*o;return(2*t-2*s+i+h)*c+(-3*t+3*s-2*i-h)*o+i*a+t}function D(a,e){const t=1-a;return t*t*e}function X(a,e){return 2*(1-a)*a*e}function E(a,e){return a*a*e}function I(a,e,t,s){return D(a,e)+X(a,t)+E(a,s)}function k(a,e){const t=1-a;return t*t*t*e}function F(a,e){const t=1-a;return 3*t*t*a*e}function Q(a,e){return 3*(1-a)*a*a*e}function U(a,e){return a*a*a*e}function z(a,e,t,s,n){return k(a,e)+F(a,t)+Q(a,s)+U(a,n)}class R extends x{constructor(e=new r,t=new r,s=new r,n=new r){super(),this.v0=e,this.v1=t,this.v2=s,this.v3=n}getPoint(e,t=new r){const{v0:s,v1:n,v2:i,v3:h}=this;return t.set(z(e,s.x,n.x,i.x,h.x),z(e,s.y,n.y,i.y,h.y)),t}getMinMax(e=r.MAX,t=r.MIN){const{v0:s,v1:n,v2:i,v3:h}=this;return e.x=Math.min(e.x,s.x,n.x,i.x,h.x),e.y=Math.min(e.y,s.y,n.y,i.y,h.y),t.x=Math.max(t.x,s.x,n.x,i.x,h.x),t.y=Math.max(t.y,s.y,n.y,i.y,h.y),{min:e,max:t}}getCommands(){const{v0:e,v1:t,v2:s,v3:n}=this;return[{type:"M",x:e.x,y:e.y},{type:"C",x1:t.x,y1:t.y,x2:s.x,y2:s.y,x:n.x,y:n.y}]}drawTo(e){const{v0:t,v1:s,v2:n,v3:i}=this;e.moveTo(t.x,t.y),e.bezierCurveTo(s.x,s.y,n.x,n.y,i.x,i.y)}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}}class S extends x{constructor(e=0,t=0,s=1,n=1,i=0,h=Math.PI*2,o=!1,c=0){super(),this.x=e,this.y=t,this.rx=s,this.ry=n,this.startAngle=i,this.endAngle=h,this.clockwise=o,this.rotation=c}getDivisions(e=12){return e*2}getPoint(e,t=new r){const s=Math.PI*2;let n=this.endAngle-this.startAngle;const i=Math.abs(n)<Number.EPSILON;for(;n<0;)n+=s;for(;n>s;)n-=s;n<Number.EPSILON&&(i?n=0:n=s),this.clockwise&&!i&&(n===s?n=-s:n=n-s);const h=this.startAngle+e*n;let o=this.x+this.rx*Math.cos(h),c=this.y+this.ry*Math.sin(h);if(this.rotation!==0){const u=Math.cos(this.rotation),l=Math.sin(this.rotation),y=o-this.x,v=c-this.y;o=y*u-v*l+this.x,c=y*l+v*u+this.y}return t.set(o,c)}getCommands(){const{x:e,y:t,rx:s,ry:n,startAngle:i,endAngle:h,clockwise:o}=this,c=!o,u=e+s*Math.cos(i),l=t+n*Math.sin(i),y=e+s*Math.cos(h),v=t+n*Math.sin(h),d=Math.abs(i-h),P=d>Math.PI?1:0,M=c?0:1,w=e+s*Math.cos(i+(h-i)/2),T=t+n*Math.sin(i+(h-i)/2);return d>=2*Math.PI?[{type:"M",x:u,y:l},{type:"A",rx:s,ry:n,xAxisRotation:0,largeArcFlag:1,sweepFlag:M,x:w,y:T},{type:"A",rx:s,ry:n,xAxisRotation:0,largeArcFlag:1,sweepFlag:M,x:u,y:l}]:[{type:"M",x:u,y:l},{type:"A",rx:s,ry:n,xAxisRotation:0,largeArcFlag:P,sweepFlag:M,x:y,y:v}]}drawTo(e){const{x:t,y:s,rx:n,ry:i,startAngle:h}=this,o=t+n*Math.cos(h),c=s+i*Math.sin(h);e.moveTo(o,c),e.arc(this.x,this.y,this.rx,this.startAngle,this.endAngle,!this.clockwise)}copy(e){return super.copy(e),this.x=e.x,this.y=e.y,this.rx=e.rx,this.ry=e.ry,this.startAngle=e.startAngle,this.endAngle=e.endAngle,this.clockwise=e.clockwise,this.rotation=e.rotation,this}}class f extends x{constructor(e=new r,t=new r){super(),this.v1=e,this.v2=t}getDivisions(){return 1}getPoint(e,t=new r){return e===1?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t=new r){return this.getPoint(e,t)}getTangent(e,t=new r){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t=new r){return this.getTangent(e,t)}getCommands(){const{v1:e,v2:t}=this;return[{type:"M",x:e.x,y:e.y},{type:"L",x:t.x,y:t.y}]}getMinMax(e=r.MAX,t=r.MIN){const{v1:s,v2:n}=this;return e.x=Math.min(e.x,s.x,n.x),e.y=Math.min(e.y,s.y,n.y),t.x=Math.max(t.x,s.x,n.x),t.y=Math.max(t.y,s.y,n.y),{min:e,max:t}}drawTo(e){const{v1:t,v2:s}=this;e.moveTo(t.x,t.y),e.lineTo(s.x,s.y)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}}class V extends x{constructor(t,s,n=0,i=1){super();p(this,"curves");p(this,"pointT",0);this.center=t,this.size=s,this.start=n,this.end=i;const{x:h,y:o}=this.center,c=new r(h+.5*this.size,o-.5*this.size),u=new r(h-.5*this.size,o-.5*this.size),l=new r(h,o+.5*this.size),y=new L(c,Math.SQRT1_2*this.size,-.25*Math.PI,.75*Math.PI),v=new L(u,Math.SQRT1_2*this.size,-.75*Math.PI,.25*Math.PI),d=new L(l,.5*Math.SQRT1_2*this.size,.75*Math.PI,1.25*Math.PI),P=new r(h,o+this.size),M=new r(h+this.size,o),w=new r().lerpVectors(M,P,.75),T=new r(h-this.size,o),$=new r().lerpVectors(T,P,.75),C=new f(M,w),_=new f($,T);this.curves=[y,C,d,_,v]}getPoint(t){return this.getCurrentLine(t).getPoint(this.pointT)}getPointAt(t){return this.getPoint(t)}getCurrentLine(t){let s=(t*(this.end-this.start)+this.start)%1;s<0&&(s+=1),s*=9*Math.PI/8+1.5;let n;const i=.5*Math.PI;return s<i?(n=0,this.pointT=s/i):s<i+.75?(n=1,this.pointT=(s-i)/.75):s<5*Math.PI/8+.75?(n=2,this.pointT=(s-i-.75)/(Math.PI/8)):s<5*Math.PI/8+1.5?(n=3,this.pointT=(s-5*Math.PI/8-.75)/.75):(n=4,this.pointT=(s-5*Math.PI/8-1.5)/i),this.curves[n]}getTangent(t){return this.getCurrentLine(t).getTangent(this.pointT).normalize()}getNormal(t){const s=this.getCurrentLine(t);return new r(s.v2.y-s.v1.y,-(s.v2.x-s.v1.x)).normalize()}getCommands(){return this.curves.flatMap(t=>t.getCommands())}drawTo(t){this.curves.forEach(s=>s.drawTo(t))}}class Y extends x{constructor(t,s=0,n=0,i=0,h=1){super();p(this,"curves",[]);p(this,"points",[]);this.center=t,this.radius=s,this.num=n,this.start=i,this.end=h;for(let o=0;o<this.num;o++){let c=o*2*Math.PI/this.num;c-=.5*Math.PI;const u=new r(this.radius*Math.cos(c),this.radius*Math.sin(c));u.add(this.center),this.points.push(u)}for(let o=0;o<this.num;o++)this.curves.push(new f(this.points[o],this.points[(o+1)%this.num]))}getPoint(t){return this.getCurrentLine(t),this.currentLine.getPoint(this.pointK)}getPointAt(t){return this.getPoint(t)}getCurrentLine(t){let s=(t*(this.end-this.start)+this.start)%1;s<0&&(s+=1);const n=s*this.num,i=Math.floor(n);return this.pointK=n-i,this.currentLine=this.curves[i],this.currentLine}getTangent(t){return this.getCurrentLine(t).getTangent(0).normalize()}getNormal(t){const s=this.getCurrentLine(t);return new r(s.v2.y-s.v1.y,-(s.v2.x-s.v1.x)).normalize()}getCommands(){return this.curves.flatMap(t=>t.getCommands())}getMinMax(t=r.MAX,s=r.MIN){return this.curves.forEach(n=>n.getMinMax(t,s)),{min:t,max:s}}drawTo(t){this.curves.forEach(s=>s.drawTo(t))}}class B extends x{constructor(e=new r,t=new r,s=new r){super(),this.v0=e,this.v1=t,this.v2=s}getPoint(e,t=new r){const{v0:s,v1:n,v2:i}=this;return t.set(I(e,s.x,n.x,i.x),I(e,s.y,n.y,i.y)),t}getCommands(){const{v0:e,v1:t,v2:s}=this;return[{type:"M",x:e.x,y:e.y},{type:"Q",x1:t.x,y1:t.y,x:s.x,y:s.y}]}getMinMax(e=r.MAX,t=r.MIN){const{v0:s,v1:n,v2:i}=this,h=.5*(s.x+n.x),o=.5*(s.y+n.y),c=.5*(s.x+i.x),u=.5*(s.y+i.y);return e.x=Math.min(e.x,s.x,i.x,h,c),e.y=Math.min(e.y,s.y,i.y,o,u),t.x=Math.max(t.x,s.x,i.x,h,c),t.y=Math.max(t.y,s.y,i.y,o,u),{min:e,max:t}}drawTo(e){const{v0:t,v1:s,v2:n}=this;e.moveTo(t.x,t.y),e.quadraticCurveTo(s.x,s.y,n.x,n.y)}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}}class q extends x{constructor(t,s,n=1,i=0,h=1){super();p(this,"curves",[]);p(this,"pointT",0);this.center=t,this.rx=s,this.aspectRatio=n,this.start=i,this.end=h;const{x:o,y:c}=this.center,u=this.rx,l=this.rx/this.aspectRatio,y=[new r(o-u,c-l),new r(o+u,c-l),new r(o+u,c+l),new r(o-u,c+l)];for(let v=0;v<4;v++)this.curves.push(new f(y[v],y[(v+1)%4]))}get x(){return this.center.x-this.rx}get y(){return this.center.y-this.rx/this.aspectRatio}get width(){return this.rx*2}get height(){return this.rx/this.aspectRatio*2}getPoint(t){return this.getCurrentLine(t).getPoint(this.pointT)}getPointAt(t){return this.getPoint(t)}getCurrentLine(t){let s=(t*(this.end-this.start)+this.start)%1;s<0&&(s+=1),s*=(1+this.aspectRatio)*2;let n;return s<this.aspectRatio?(n=0,this.pointT=s/this.aspectRatio):s<this.aspectRatio+1?(n=1,this.pointT=(s-this.aspectRatio)/1):s<2*this.aspectRatio+1?(n=2,this.pointT=(s-this.aspectRatio-1)/this.aspectRatio):(n=3,this.pointT=(s-2*this.aspectRatio-1)/1),this.curves[n]}getTangent(t){return this.getCurrentLine(t).getTangent(0).normalize()}getNormal(t){const{v1:s,v2:n}=this.getCurrentLine(t);return new r(n.y-s.y,-(n.x-s.x)).normalize()}getCommands(){return this.curves.flatMap(t=>t.getCommands())}getMinMax(t=r.MAX,s=r.MIN){return this.curves.forEach(n=>n.getMinMax(t,s)),{min:t,max:s}}drawTo(t){this.curves.forEach(s=>s.drawTo(t))}}class N extends x{constructor(e=[]){super(),this.points=e}getDivisions(e=12){return e*this.points.length}getPoint(e,t=new r){const{points:s}=this,n=(s.length-1)*e,i=Math.floor(n),h=n-i,o=s[i===0?i:i-1],c=s[i],u=s[i>s.length-2?s.length-1:i+1],l=s[i>s.length-3?s.length-1:i+2];return t.set(m(h,o.x,c.x,u.x,l.x),m(h,o.y,c.y,u.y,l.y)),t}getCommands(){return[]}drawTo(e){}copy(e){super.copy(e),this.points=[];for(let t=0,s=e.points.length;t<s;t++)this.points.push(e.points[t].clone());return this}}class b extends x{constructor(t){super();p(this,"curves",[]);p(this,"currentPoint",new r);p(this,"autoClose",!1);p(this,"_cacheLengths",[]);t&&this.setFromPoints(t)}addCurve(t){return this.curves.push(t),this}closePath(){const t=this.curves[0].getPoint(0),s=this.curves[this.curves.length-1].getPoint(1);return t.equals(s)||this.curves.push(new f(s,t)),this}getPoint(t,s=new r){const n=t*this.getLength(),i=this.getCurveLengths();let h=0;for(;h<i.length;){if(i[h]>=n){const o=i[h]-n,c=this.curves[h],u=c.getLength();return c.getPointAt(u===0?0:1-o/u,s)}h++}return s}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){super.updateArcLengths(),this._cacheLengths=[],this.getCurveLengths()}getCurveLengths(){if(this._cacheLengths.length===this.curves.length)return this._cacheLengths;const t=[];let s=0;for(let n=0,i=this.curves.length;n<i;n++)s+=this.curves[n].getLength(),t.push(s);return this._cacheLengths=t,t}getSpacedPoints(t=40){const s=[];for(let n=0;n<=t;n++)s.push(this.getPoint(n/t));return this.autoClose&&s.push(s[0]),s}getPoints(t=12){const s=[];let n;for(let i=0,h=this.curves;i<h.length;i++){const o=h[i],c=o.getPoints(o.getDivisions(t));for(let u=0;u<c.length;u++){const l=c[u];n&&n.equals(l)||(s.push(l),n=l)}}return this.autoClose&&s.length>1&&!s[s.length-1].equals(s[0])&&s.push(s[0]),s}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let s=1,n=t.length;s<n;s++)this.lineTo(t[s].x,t[s].y);return this}bezierCurveTo(t,s,n,i,h,o){return this.curves.push(new R(this.currentPoint.clone(),new r(t,s),new r(n,i),new r(h,o))),this.currentPoint.set(h,o),this}lineTo(t,s){const n=new f(this.currentPoint.clone(),new r(t,s));return this.curves.push(n),this.currentPoint.set(t,s),this}moveTo(t,s){return this.currentPoint.set(t,s),this}quadraticCurveTo(t,s,n,i){return this.curves.push(new B(this.currentPoint.clone(),new r(t,s),new r(n,i))),this.currentPoint.set(n,i),this}rect(t,s,n,i){return this.curves.push(new q(new r(t+n/2,s+i/2),n/2,n/i)),this.currentPoint.set(t,s),this}splineThru(t){const s=[this.currentPoint.clone()].concat(t);return this.curves.push(new N(s)),this.currentPoint.copy(t[t.length-1]),this}arc(t,s,n,i,h,o=!1){const c=this.currentPoint;return this.absarc(t+c.x,s+c.y,n,i,h,o),this}absarc(t,s,n,i,h,o=!1){return this.absellipse(t,s,n,n,i,h,o),this}ellipse(t,s,n,i,h,o,c=!1,u=0){const l=this.currentPoint;return this.absellipse(t+l.x,s+l.y,n,i,h,o,c,u),this}absellipse(t,s,n,i,h,o,c=!1,u=0){const l=new S(t,s,n,i,h,o,c,u);if(this.curves.length>0){const y=l.getPoint(0);y.equals(this.currentPoint)||this.lineTo(y.x,y.y)}return this.curves.push(l),this.currentPoint.copy(l.getPoint(1)),this}getCommands(){return this.curves.flatMap(t=>t.getCommands())}getMinMax(t=r.MAX,s=r.MIN){return this.curves.forEach(n=>n.getMinMax(t,s)),{min:t,max:s}}drawTo(t){this.curves.forEach(s=>s.drawTo(t))}copy(t){super.copy(t),this.curves=[];for(let s=0,n=t.curves.length;s<n;s++){const i=t.curves[s];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this.currentPoint.copy(t.currentPoint),this}}class j{constructor(){p(this,"currentPath",new b);p(this,"paths",[this.currentPath])}addPath(e){return this.paths.push(...e.paths.map(t=>t.clone())),this}closePath(){return this.currentPath.closePath(),this}moveTo(e,t){return this.currentPath=new b,this.paths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}bezierCurveTo(e,t,s,n,i,h){return this.currentPath.bezierCurveTo(e,t,s,n,i,h),this}quadraticCurveTo(e,t,s,n){return this.currentPath.quadraticCurveTo(e,t,s,n),this}arc(e,t,s,n,i,h){return this.currentPath.absarc(e,t,s,n,i,!h),this}arcTo(e,t,s,n,i){const h=this.currentPath.currentPoint,o=h.x,c=h.y,u=e-o,l=t-c,y=s-e,v=n-t,d=Math.sqrt(u*u+l*l),P=Math.sqrt(y*y+v*v);if(d<i||P<i)return this.lineTo(s,n),this;const M={x:u/d,y:l/d},w={x:y/P,y:v/P},T=e-M.y*i,$=t+M.x*i,C=Math.atan2(M.y,M.x);let A=Math.atan2(w.y,w.x)-C;return A>Math.PI?A-=2*Math.PI:A<-Math.PI&&(A+=2*Math.PI),this.arc(T,$,i,C,C+A,!1),this.lineTo(s,n),this}ellipse(e,t,s,n,i,h,o,c){return this.currentPath.absellipse(e,t,s,n,h,o,!c,i),this}rect(e,t,s,n){return this.currentPath.rect(e,t,s,n),this}splineThru(e){return this.currentPath.splineThru(e),this}getMinMax(e=new r,t=new r){return this.paths.forEach(s=>s.curves.forEach(n=>n.getMinMax(e,t))),{min:e,max:t}}getCommands(){return this.paths.flatMap(e=>e.curves.flatMap(t=>t.getCommands()))}getData(){return this.paths.map(e=>e.getData()).join(" ")}getBoundingBox(){const e=r.MAX,t=r.MIN;return this.paths.forEach(s=>s.getMinMax(e,t)),{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}}getSvgString(){const{x:e,y:t,width:s,height:n}=this.getBoundingBox();return`<svg viewBox="${e} ${t} ${s} ${n}" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="currentColor" d="${this.getData()}"></path></svg>`}getSvgDataUri(){return`data:image/svg+xml;base64,${btoa(this.getSvgString())}`}drawTo(e){this.paths.forEach(t=>{t.curves.forEach(s=>{s.drawTo(e)})})}strokeTo(e){this.drawTo(e),e.stroke()}fillTo(e){this.drawTo(e),e.fill()}}g.CircleCurve=L,g.CubicBezierCurve=R,g.Curve=x,g.CurvePath=b,g.EllipseCurve=S,g.HeartCurve=V,g.LineCurve=f,g.Path2D=j,g.PloygonCurve=Y,g.Point2D=r,g.QuadraticBezierCurve=B,g.RectangularCurve=q,g.SplineCurve=N,g.catmullRom=m,g.cubicBezier=z,g.quadraticBezier=I,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(v,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(v=typeof globalThis<"u"?globalThis:v||self,d(v.modernPath2d={}))})(this,function(v){"use strict";var Qt=Object.defineProperty;var Ut=(v,d,$)=>d in v?Qt(v,d,{enumerable:!0,configurable:!0,writable:!0,value:$}):v[d]=$;var b=(v,d,$)=>Ut(v,typeof d!="symbol"?d+"":d,$);class d{constructor(e=1,t=0,s=0,i=0,o=1,c=0,a=0,h=0,n=1){b(this,"elements",[]);this.set(e,t,s,i,o,c,a,h,n)}set(e,t,s,i,o,c,a,h,n){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=o,u[5]=h,u[6]=s,u[7]=c,u[8]=n,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,i=t.elements,o=this.elements,c=s[0],a=s[3],h=s[6],n=s[1],u=s[4],y=s[7],p=s[2],x=s[5],g=s[8],f=i[0],M=i[3],w=i[6],I=i[1],T=i[4],C=i[7],A=i[2],E=i[5],z=i[8];return o[0]=c*f+a*I+h*A,o[3]=c*M+a*T+h*E,o[6]=c*w+a*C+h*z,o[1]=n*f+u*I+y*A,o[4]=n*M+u*T+y*E,o[7]=n*w+u*C+y*z,o[2]=p*f+x*I+g*A,o[5]=p*M+x*T+g*E,o[8]=p*w+x*C+g*z,this}invert(){const e=this.elements,t=e[0],s=e[1],i=e[2],o=e[3],c=e[4],a=e[5],h=e[6],n=e[7],u=e[8],y=u*c-a*n,p=a*h-u*o,x=n*o-c*h,g=t*y+s*p+i*x;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const f=1/g;return e[0]=y*f,e[1]=(i*n-u*s)*f,e[2]=(a*s-i*c)*f,e[3]=p*f,e[4]=(u*t-i*h)*f,e[5]=(i*o-a*t)*f,e[6]=x*f,e[7]=(s*h-n*t)*f,e[8]=(c*t-s*o)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}scale(e,t){return this.premultiply($.makeScale(e,t)),this}rotate(e){return this.premultiply($.makeRotation(-e)),this}translate(e,t){return this.premultiply($.makeTranslation(e,t)),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,s,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}fromArray(e,t=0){for(let s=0;s<9;s++)this.elements[s]=e[s+t];return this}clone(){return new this.constructor().fromArray(this.elements)}}const $=new d;class l{constructor(e=0,t=0){this.x=e,this.y=t}static get MAX(){return new l(1/0,1/0)}static get MIN(){return new l(-1/0,-1/0)}set(e,t){return this.x=e,this.y=t,this}add(e){return this.x+=e.x,this.y+=e.y,this}sub(e){return this.x-=e.x,this.y-=e.y,this}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y;return t*t+s*s}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}multiplyScalar(e){return this.x*=e,this.y*=e,this}divideScalar(e){return this.multiplyScalar(1/e)}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}normalize(){return this.divideScalar(this.length()||1)}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this}equals(e){return this.x===e.x&&this.y===e.y}applyMatrix3(e){const[t,s,i,o,c,a]=e.elements,{x:h,y:n}=this;return this.set(t*h+s*n+i,o*h+c*n+a),this}copy(e){return this.x=e.x,this.y=e.y,this}clone(){return new l(this.x,this.y)}}function U(r,e,t,s){const i=r*t+e*s,o=Math.sqrt(r*r+e*e)*Math.sqrt(t*t+s*s);let c=Math.acos(Math.max(-1,Math.min(1,i/o)));return r*s-e*t<0&&(c=-c),c}function lt(r,e,t,s,i,o,c,a){if(e===0||t===0){r.lineTo(a.x,a.y);return}s=s*Math.PI/180,e=Math.abs(e),t=Math.abs(t);const h=(c.x-a.x)/2,n=(c.y-a.y)/2,u=Math.cos(s)*h+Math.sin(s)*n,y=-Math.sin(s)*h+Math.cos(s)*n;let p=e*e,x=t*t;const g=u*u,f=y*y,M=g/p+f/x;if(M>1){const ut=Math.sqrt(M);e=ut*e,t=ut*t,p=e*e,x=t*t}const w=p*f+x*g,I=(p*x-w)/w;let T=Math.sqrt(Math.max(0,I));i===o&&(T=-T);const C=T*e*y/t,A=-T*t*u/e,E=Math.cos(s)*C-Math.sin(s)*A+(c.x+a.x)/2,z=Math.sin(s)*C+Math.cos(s)*A+(c.y+a.y)/2,Y=U(1,0,(u-C)/e,(y-A)/t),Q=U((u-C)/e,(y-A)/t,(-u-C)/e,(-y-A)/t)%(Math.PI*2);r.currentPath.absellipse(E,z,e,t,Y,Y+Q,o===0,s)}function D(r,e){return r-(e-r)}function yt(r,e){const t=new l,s=new l,i=new l;let o=!0,c=!1;for(let a=0,h=r.length;a<h;a++){const n=r[a];if(o&&(c=!0,o=!1),n.type==="m"||n.type==="M")n.type==="m"?(t.x+=n.x,t.y+=n.y):(t.x=n.x,t.y=n.y),s.x=t.x,s.y=t.y,e.moveTo(t.x,t.y),a===0&&i.copy(t);else if(n.type==="h"||n.type==="H")n.type==="h"?t.x+=n.x:t.x=n.x,s.x=t.x,s.y=t.y,e.lineTo(t.x,t.y),c&&i.copy(t);else if(n.type==="v"||n.type==="V")n.type==="v"?t.y+=n.y:t.y=n.y,s.x=t.x,s.y=t.y,e.lineTo(t.x,t.y),c&&i.copy(t);else if(n.type==="l"||n.type==="L")n.type==="l"?(t.x+=n.x,t.y+=n.y):(t.x=n.x,t.y=n.y),s.x=t.x,s.y=t.y,e.lineTo(t.x,t.y),c&&i.copy(t);else if(n.type==="c"||n.type==="C")n.type==="c"?(e.bezierCurveTo(t.x+n.x1,t.y+n.y1,t.x+n.x2,t.y+n.y2,t.x+n.x,t.y+n.y),s.x=t.x+n.x2,s.y=t.y+n.y2,t.x+=n.x,t.y+=n.y):(e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y),s.x=n.x2,s.y=n.y2,t.x=n.x,t.y=n.y),c&&i.copy(t);else if(n.type==="s"||n.type==="S")n.type==="s"?(e.bezierCurveTo(D(t.x,s.x),D(t.y,s.y),t.x+n.x2,t.y+n.y2,t.x+n.x,t.y+n.y),s.x=t.x+n.x2,s.y=t.y+n.y2,t.x+=n.x,t.y+=n.y):(e.bezierCurveTo(D(t.x,s.x),D(t.y,s.y),n.x2,n.y2,n.x,n.y),s.x=n.x2,s.y=n.y2,t.x=n.x,t.y=n.y),c&&i.copy(t);else if(n.type==="q"||n.type==="Q")n.type==="q"?(e.quadraticCurveTo(t.x+n.x1,t.y+n.y1,t.x+n.x,t.y+n.y),s.x=t.x+n.x1,s.y=t.y+n.y1,t.x+=n.x,t.y+=n.y):(e.quadraticCurveTo(n.x1,n.y1,n.x,n.y),s.x=n.x1,s.y=n.y1,t.x=n.x,t.y=n.y),c&&i.copy(t);else if(n.type==="t"||n.type==="T"){const u=D(t.x,s.x),y=D(t.y,s.y);s.x=u,s.y=y,n.type==="t"?(e.quadraticCurveTo(u,y,t.x+n.x,t.y+n.y),t.x+=n.x,t.y+=n.y):(e.quadraticCurveTo(u,y,n.x,n.y),t.x=n.x,t.y=n.y),c&&i.copy(t)}else if(n.type==="a"||n.type==="A"){if(n.type==="a"){if(n.x===0&&n.y===0)continue;t.x+=n.x,t.y+=n.y}else{if(n.x===t.x&&n.y===t.y)continue;t.x=n.x,t.y=n.y}const u=t.clone();s.x=t.x,s.y=t.y,lt(e,n.rx,n.ry,n.angle,n.largeArcFlag,n.sweepFlag,u,t),c&&i.copy(t)}else n.type==="z"||n.type==="Z"?(e.currentPath.autoClose=!0,e.currentPath.curves.length>0&&(t.copy(i),e.currentPath.currentPoint.copy(t),o=!0)):console.warn(n);c=!1}}const P={SEPARATOR:/[ \t\r\n,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function S(r,e,t=0){let a=0,h=!0,n="",u="";const y=[];function p(M,w,I){const T=new SyntaxError(`Unexpected character "${M}" at index ${w}.`);throw T.partial=I,T}function x(){n!==""&&(u===""?y.push(Number(n)):y.push(Number(n)*10**Number(u))),n="",u=""}let g;const f=r.length;for(let M=0;M<f;M++){if(g=r[M],Array.isArray(e)&&e.includes(y.length%t)&&P.FLAGS.test(g)){a=1,n=g,x();continue}if(a===0){if(P.WHITESPACE.test(g))continue;if(P.DIGIT.test(g)||P.SIGN.test(g)){a=1,n=g;continue}if(P.POINT.test(g)){a=2,n=g;continue}P.COMMA.test(g)&&(h&&p(g,M,y),h=!0)}if(a===1){if(P.DIGIT.test(g)){n+=g;continue}if(P.POINT.test(g)){n+=g,a=2;continue}if(P.EXP.test(g)){a=3;continue}P.SIGN.test(g)&&n.length===1&&P.SIGN.test(n[0])&&p(g,M,y)}if(a===2){if(P.DIGIT.test(g)){n+=g;continue}if(P.EXP.test(g)){a=3;continue}P.POINT.test(g)&&n[n.length-1]==="."&&p(g,M,y)}if(a===3){if(P.DIGIT.test(g)){u+=g;continue}if(P.SIGN.test(g)){if(u===""){u+=g;continue}u.length===1&&P.SIGN.test(u)&&p(g,M,y)}}P.WHITESPACE.test(g)?(x(),a=0,h=!1):P.COMMA.test(g)?(x(),a=0,h=!0):P.SIGN.test(g)?(x(),a=1,n=g):P.POINT.test(g)?(x(),a=2,n=g):p(g,M,y)}return x(),y}function gt(r){switch(r.type){case"m":case"M":return`${r.type} ${r.x} ${r.y}`;case"h":case"H":return`${r.type} ${r.x}`;case"v":case"V":return`${r.type} ${r.y}`;case"l":case"L":return`${r.type} ${r.x} ${r.y}`;case"c":case"C":return`${r.type} ${r.x1} ${r.y1} ${r.x2} ${r.y2} ${r.x} ${r.y}`;case"s":case"S":return`${r.type} ${r.x2} ${r.y2} ${r.x} ${r.y}`;case"q":case"Q":return`${r.type} ${r.x1} ${r.y1} ${r.x} ${r.y}`;case"t":case"T":return`${r.type} ${r.x} ${r.y}`;case"a":case"A":return`${r.type} ${r.rx} ${r.ry} ${r.angle} ${r.largeArcFlag} ${r.sweepFlag} ${r.x} ${r.y}`;case"z":case"Z":return r.type;default:return""}}function pt(r){let e="";for(let t=0,s=r.length;t<s;t++)e+=`${gt(r[t])} `;return e}const ft=/[a-df-z][^a-df-z]*/gi;function xt(r){const e=[],t=r.match(ft);if(!t)return e;for(let s=0,i=t.length;s<i;s++){const o=t[s],c=o.charAt(0),a=o.slice(1).trim();let h;switch(c){case"m":case"M":h=S(a);for(let n=0,u=h.length;n<u;n+=2)n===0?e.push({type:c,x:h[n],y:h[n+1]}):e.push({type:c==="m"?"l":"L",x:h[n],y:h[n+1]});break;case"h":case"H":h=S(a);for(let n=0,u=h.length;n<u;n++)e.push({type:c,x:h[n]});break;case"v":case"V":h=S(a);for(let n=0,u=h.length;n<u;n++)e.push({type:c,y:h[n]});break;case"l":case"L":h=S(a);for(let n=0,u=h.length;n<u;n+=2)e.push({type:c,x:h[n],y:h[n+1]});break;case"c":case"C":h=S(a);for(let n=0,u=h.length;n<u;n+=6)e.push({type:c,x1:h[n],y1:h[n+1],x2:h[n+2],y2:h[n+3],x:h[n+4],y:h[n+5]});break;case"s":case"S":h=S(a);for(let n=0,u=h.length;n<u;n+=4)e.push({type:c,x2:h[n],y2:h[n+1],x:h[n+2],y:h[n+3]});break;case"q":case"Q":h=S(a);for(let n=0,u=h.length;n<u;n+=4)e.push({type:c,x1:h[n],y1:h[n+1],x:h[n+2],y:h[n+3]});break;case"t":case"T":h=S(a);for(let n=0,u=h.length;n<u;n+=2)e.push({type:c,x:h[n],y:h[n+1]});break;case"a":case"A":h=S(a,[3,4],7);for(let n=0,u=h.length;n<u;n+=7)e.push({type:c,rx:h[n],ry:h[n+1],angle:h[n+2],largeArcFlag:h[n+3],sweepFlag:h[n+4],x:h[n+5],y:h[n+6]});break;case"z":case"Z":e.push({type:c});break;default:console.warn(o)}}return e}class k{constructor(){b(this,"arcLengthDivisions",200);b(this,"_cacheArcLengths");b(this,"_needsUpdate",!1)}getPointAt(e,t=new l){return this.getPoint(this.getUtoTmapping(e),t)}getPoints(e=5){const t=[];for(let s=0;s<=e;s++)t.push(this.getPoint(s/e));return t}getSpacedPoints(e=5){const t=[];for(let s=0;s<=e;s++)t.push(this.getPointAt(s/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this._cacheArcLengths&&this._cacheArcLengths.length===e+1&&!this._needsUpdate)return this._cacheArcLengths;this._needsUpdate=!1;const t=[];let s,i=this.getPoint(0),o=0;t.push(0);for(let c=1;c<=e;c++)s=this.getPoint(c/e),o+=s.distanceTo(i),t.push(o),i=s;return this._cacheArcLengths=t,t}updateArcLengths(){this._needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const s=this.getLengths();let i=0;const o=s.length;let c;t?c=t:c=e*s[o-1];let a=0,h=o-1,n;for(;a<=h;)if(i=Math.floor(a+(h-a)/2),n=s[i]-c,n<0)a=i+1;else if(n>0)h=i-1;else{h=i;break}if(i=h,s[i]===c)return i/(o-1);const u=s[i],p=s[i+1]-u,x=(c-u)/p;return(i+x)/(o-1)}getTangent(e,t=new l){let i=e-1e-4,o=e+1e-4;return i<0&&(i=0),o>1&&(o=1),t.copy(this.getPoint(o)).sub(this.getPoint(i)).normalize()}getTangentAt(e,t=new l){return this.getTangent(this.getUtoTmapping(e),t)}transform(e){return this}getDivisions(e){return e}getMinMax(e=l.MAX,t=l.MIN){return{min:e,max:t}}getCommands(){return[]}getData(){return pt(this.getCommands())}drawTo(e){return this}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class O extends k{constructor(e,t,s=0,i=Math.PI*2){super(),this.center=e,this.radius=t,this.start=s,this.end=i}getPoint(e){const{radius:t,center:s}=this;return s.clone().add(this.getNormal(e).clone().multiplyScalar(t))}getTangent(e){const{x:t,y:s}=this.getNormal(e);return new l(-s,t)}getNormal(e){const{start:t,end:s}=this,i=e*(s-t)+t-.5*Math.PI;return new l(Math.cos(i),Math.sin(i))}getMinMax(e=l.MAX,t=l.MIN){return e.x=Math.min(e.x,this.center.x-this.radius),e.y=Math.min(e.y,this.center.y-this.radius),t.x=Math.max(t.x,this.center.x+this.radius),t.y=Math.max(t.y,this.center.y+this.radius),{min:e,max:t}}}function V(r,e,t,s,i){const o=(s-e)*.5,c=(i-t)*.5,a=r*r,h=r*a;return(2*t-2*s+o+c)*h+(-3*t+3*s-2*o-c)*a+o*r+t}function Mt(r,e){const t=1-r;return t*t*e}function vt(r,e){return 2*(1-r)*r*e}function mt(r,e){return r*r*e}function H(r,e,t,s){return Mt(r,e)+vt(r,t)+mt(r,s)}function dt(r,e){const t=1-r;return t*t*t*e}function Pt(r,e){const t=1-r;return 3*t*t*r*e}function Tt(r,e){return 3*(1-r)*r*r*e}function wt(r,e){return r*r*r*e}function W(r,e,t,s,i){return dt(r,e)+Pt(r,t)+Tt(r,s)+wt(r,i)}class j extends k{constructor(e=new l,t=new l,s=new l,i=new l){super(),this.v0=e,this.v1=t,this.v2=s,this.v3=i}getPoint(e,t=new l){const{v0:s,v1:i,v2:o,v3:c}=this;return t.set(W(e,s.x,i.x,o.x,c.x),W(e,s.y,i.y,o.y,c.y)),t}getMinMax(e=l.MAX,t=l.MIN){const{v0:s,v1:i,v2:o,v3:c}=this;return e.x=Math.min(e.x,s.x,i.x,o.x,c.x),e.y=Math.min(e.y,s.y,i.y,o.y,c.y),t.x=Math.max(t.x,s.x,i.x,o.x,c.x),t.y=Math.max(t.y,s.y,i.y,o.y,c.y),{min:e,max:t}}transform(e){return this.v0.applyMatrix3(e),this.v1.applyMatrix3(e),this.v2.applyMatrix3(e),this.v3.applyMatrix3(e),this}getCommands(){const{v0:e,v1:t,v2:s,v3:i}=this;return[{type:"M",x:e.x,y:e.y},{type:"C",x1:t.x,y1:t.y,x2:s.x,y2:s.y,x:i.x,y:i.y}]}drawTo(e){const{v0:t,v1:s,v2:i,v3:o}=this;return e.moveTo(t.x,t.y),e.bezierCurveTo(s.x,s.y,i.x,i.y,o.x,o.y),this}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}}const bt=new d,Z=new d,J=new d,R=new l;class K extends k{constructor(e=0,t=0,s=1,i=1,o=0,c=Math.PI*2,a=!1,h=0){super(),this.x=e,this.y=t,this.radiusX=s,this.radiusY=i,this.startAngle=o,this.endAngle=c,this.clockwise=a,this.rotation=h}getDivisions(e=12){return e*2}getPoint(e,t=new l){const s=Math.PI*2;let i=this.endAngle-this.startAngle;const o=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=s;for(;i>s;)i-=s;i<Number.EPSILON&&(o?i=0:i=s),this.clockwise&&!o&&(i===s?i=-s:i=i-s);const c=this.startAngle+e*i;let a=this.x+this.radiusX*Math.cos(c),h=this.y+this.radiusY*Math.sin(c);if(this.rotation!==0){const n=Math.cos(this.rotation),u=Math.sin(this.rotation),y=a-this.x,p=h-this.y;a=y*n-p*u+this.x,h=y*u+p*n+this.y}return t.set(a,h)}getCommands(){const{x:e,y:t,radiusX:s,radiusY:i,startAngle:o,endAngle:c,clockwise:a}=this,h=!a,n=e+s*Math.cos(o),u=t+i*Math.sin(o),y=e+s*Math.cos(c),p=t+i*Math.sin(c),x=Math.abs(o-c),g=x>Math.PI?1:0,f=h?0:1,M=e+s*Math.cos(o+(c-o)/2),w=t+i*Math.sin(o+(c-o)/2);return x>=2*Math.PI?[{type:"M",x:n,y:u},{type:"A",rx:s,ry:i,angle:0,largeArcFlag:1,sweepFlag:f,x:M,y:w},{type:"A",rx:s,ry:i,angle:0,largeArcFlag:1,sweepFlag:f,x:n,y:u}]:[{type:"M",x:n,y:u},{type:"A",rx:s,ry:i,angle:0,largeArcFlag:g,sweepFlag:f,x:y,y:p}]}drawTo(e){const{x:t,y:s,radiusX:i,radiusY:o,rotation:c,startAngle:a,endAngle:h,clockwise:n}=this,u=t+i*Math.cos(a),y=s+o*Math.sin(a);return e.moveTo(u,y),e.ellipse(t,s,i,o,c,a,h,!n),this}transform(e){return R.set(this.x,this.y),R.applyMatrix3(e),this.x=R.x,this.y=R.y,It(e)?At(this,e):Ct(this,e),this}copy(e){return super.copy(e),this.x=e.x,this.y=e.y,this.radiusX=e.radiusX,this.radiusY=e.radiusY,this.startAngle=e.startAngle,this.endAngle=e.endAngle,this.clockwise=e.clockwise,this.rotation=e.rotation,this}}function At(r,e){const t=r.radiusX,s=r.radiusY,i=Math.cos(r.rotation),o=Math.sin(r.rotation),c=new l(t*i,t*o),a=new l(-s*o,s*i),h=c.applyMatrix3(e),n=a.applyMatrix3(e),u=bt.set(h.x,n.x,0,h.y,n.y,0,0,0,1),y=Z.copy(u).invert(),g=J.copy(y).transpose().multiply(y).elements,f=kt(g[0],g[1],g[4]),M=Math.sqrt(f.rt1),w=Math.sqrt(f.rt2);if(r.radiusX=1/M,r.radiusY=1/w,r.rotation=Math.atan2(f.sn,f.cs),!((r.endAngle-r.startAngle)%(2*Math.PI)<Number.EPSILON)){const T=Z.set(M,0,0,0,w,0,0,0,1),C=J.set(f.cs,f.sn,0,-f.sn,f.cs,0,0,0,1),A=T.multiply(C).multiply(u),E=z=>{const{x:Y,y:Q}=new l(Math.cos(z),Math.sin(z)).applyMatrix3(A);return Math.atan2(Q,Y)};r.startAngle=E(r.startAngle),r.endAngle=E(r.endAngle),tt(e)&&(r.clockwise=!r.clockwise)}}function Ct(r,e){const t=et(e),s=st(e);r.radiusX*=t,r.radiusY*=s;const i=t>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);r.rotation+=i,tt(e)&&(r.startAngle*=-1,r.endAngle*=-1,r.clockwise=!r.clockwise)}function tt(r){const e=r.elements;return e[0]*e[4]-e[1]*e[3]<0}function It(r){const e=r.elements,t=e[0]*e[3]+e[1]*e[4];if(t===0)return!1;const s=et(r),i=st(r);return Math.abs(t/(s*i))>Number.EPSILON}function et(r){const e=r.elements;return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function st(r){const e=r.elements;return Math.sqrt(e[3]*e[3]+e[4]*e[4])}function kt(r,e,t){let s,i,o,c,a;const h=r+t,n=r-t,u=Math.sqrt(n*n+4*e*e);return h>0?(s=.5*(h+u),a=1/s,i=r*a*t-e*a*e):h<0?i=.5*(h-u):(s=.5*u,i=-.5*u),n>0?o=n+u:o=n-u,Math.abs(o)>2*Math.abs(e)?(a=-2*e/o,c=1/Math.sqrt(1+a*a),o=a*c):Math.abs(e)===0?(o=1,c=0):(a=-.5*o/e,o=1/Math.sqrt(1+a*a),c=a*o),n>0&&(a=o,o=-c,c=a),{rt1:s,rt2:i,cs:o,sn:c}}class q extends k{constructor(e=new l,t=new l){super(),this.v1=e,this.v2=t}getDivisions(){return 1}getPoint(e,t=new l){return e===1?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t=new l){return this.getPoint(e,t)}getTangent(e,t=new l){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t=new l){return this.getTangent(e,t)}getCommands(){const{v1:e,v2:t}=this;return[{type:"M",x:e.x,y:e.y},{type:"L",x:t.x,y:t.y}]}getMinMax(e=l.MAX,t=l.MIN){const{v1:s,v2:i}=this;return e.x=Math.min(e.x,s.x,i.x),e.y=Math.min(e.y,s.y,i.y),t.x=Math.max(t.x,s.x,i.x),t.y=Math.max(t.y,s.y,i.y),{min:e,max:t}}transform(e){return this.v1.applyMatrix3(e),this.v2.applyMatrix3(e),this}drawTo(e){const{v1:t,v2:s}=this;return e.moveTo(t.x,t.y),e.lineTo(s.x,s.y),this}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}}class Lt extends k{constructor(t,s,i=0,o=1){super();b(this,"curves");b(this,"pointT",0);this.center=t,this.size=s,this.start=i,this.end=o;const{x:c,y:a}=this.center,h=new l(c+.5*this.size,a-.5*this.size),n=new l(c-.5*this.size,a-.5*this.size),u=new l(c,a+.5*this.size),y=new O(h,Math.SQRT1_2*this.size,-.25*Math.PI,.75*Math.PI),p=new O(n,Math.SQRT1_2*this.size,-.75*Math.PI,.25*Math.PI),x=new O(u,.5*Math.SQRT1_2*this.size,.75*Math.PI,1.25*Math.PI),g=new l(c,a+this.size),f=new l(c+this.size,a),M=new l().lerpVectors(f,g,.75),w=new l(c-this.size,a),I=new l().lerpVectors(w,g,.75),T=new q(f,M),C=new q(I,w);this.curves=[y,T,x,C,p]}getPoint(t){return this.getCurrentLine(t).getPoint(this.pointT)}getPointAt(t){return this.getPoint(t)}getCurrentLine(t){let s=(t*(this.end-this.start)+this.start)%1;s<0&&(s+=1),s*=9*Math.PI/8+1.5;let i;const o=.5*Math.PI;return s<o?(i=0,this.pointT=s/o):s<o+.75?(i=1,this.pointT=(s-o)/.75):s<5*Math.PI/8+.75?(i=2,this.pointT=(s-o-.75)/(Math.PI/8)):s<5*Math.PI/8+1.5?(i=3,this.pointT=(s-5*Math.PI/8-.75)/.75):(i=4,this.pointT=(s-5*Math.PI/8-1.5)/o),this.curves[i]}getTangent(t){return this.getCurrentLine(t).getTangent(this.pointT).normalize()}getNormal(t){const s=this.getCurrentLine(t);return new l(s.v2.y-s.v1.y,-(s.v2.x-s.v1.x)).normalize()}getCommands(){return this.curves.flatMap(t=>t.getCommands())}drawTo(t){return this.curves.forEach(s=>s.drawTo(t)),this}}class St extends k{constructor(t,s=0,i=0,o=0,c=1){super();b(this,"curves",[]);b(this,"points",[]);this.center=t,this.radius=s,this.num=i,this.start=o,this.end=c;for(let a=0;a<this.num;a++){let h=a*2*Math.PI/this.num;h-=.5*Math.PI;const n=new l(this.radius*Math.cos(h),this.radius*Math.sin(h));n.add(this.center),this.points.push(n)}for(let a=0;a<this.num;a++)this.curves.push(new q(this.points[a],this.points[(a+1)%this.num]))}getPoint(t){return this.getCurrentLine(t),this.currentLine.getPoint(this.pointK)}getPointAt(t){return this.getPoint(t)}getCurrentLine(t){let s=(t*(this.end-this.start)+this.start)%1;s<0&&(s+=1);const i=s*this.num,o=Math.floor(i);return this.pointK=i-o,this.currentLine=this.curves[o],this.currentLine}getTangent(t){return this.getCurrentLine(t).getTangent(0).normalize()}getNormal(t){const s=this.getCurrentLine(t);return new l(s.v2.y-s.v1.y,-(s.v2.x-s.v1.x)).normalize()}getCommands(){return this.curves.flatMap(t=>t.getCommands())}getMinMax(t=l.MAX,s=l.MIN){return this.curves.forEach(i=>i.getMinMax(t,s)),{min:t,max:s}}drawTo(t){return this.curves.forEach(s=>s.drawTo(t)),this}}class nt extends k{constructor(e=new l,t=new l,s=new l){super(),this.v0=e,this.v1=t,this.v2=s}getPoint(e,t=new l){const{v0:s,v1:i,v2:o}=this;return t.set(H(e,s.x,i.x,o.x),H(e,s.y,i.y,o.y)),t}getCommands(){const{v0:e,v1:t,v2:s}=this;return[{type:"M",x:e.x,y:e.y},{type:"Q",x1:t.x,y1:t.y,x:s.x,y:s.y}]}getMinMax(e=l.MAX,t=l.MIN){const{v0:s,v1:i,v2:o}=this,c=.5*(s.x+i.x),a=.5*(s.y+i.y),h=.5*(s.x+o.x),n=.5*(s.y+o.y);return e.x=Math.min(e.x,s.x,o.x,c,h),e.y=Math.min(e.y,s.y,o.y,a,n),t.x=Math.max(t.x,s.x,o.x,c,h),t.y=Math.max(t.y,s.y,o.y,a,n),{min:e,max:t}}transform(e){return this.v0.applyMatrix3(e),this.v1.applyMatrix3(e),this.v2.applyMatrix3(e),this}drawTo(e){const{v0:t,v1:s,v2:i}=this;return e.moveTo(t.x,t.y),e.quadraticCurveTo(s.x,s.y,i.x,i.y),this}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}}class it extends k{constructor(t,s,i=1,o=0,c=1){super();b(this,"curves",[]);b(this,"pointT",0);this.center=t,this.rx=s,this.aspectRatio=i,this.start=o,this.end=c;const{x:a,y:h}=this.center,n=this.rx,u=this.rx/this.aspectRatio,y=[new l(a-n,h-u),new l(a+n,h-u),new l(a+n,h+u),new l(a-n,h+u)];for(let p=0;p<4;p++)this.curves.push(new q(y[p],y[(p+1)%4]))}get x(){return this.center.x-this.rx}get y(){return this.center.y-this.rx/this.aspectRatio}get width(){return this.rx*2}get height(){return this.rx/this.aspectRatio*2}getPoint(t){return this.getCurrentLine(t).getPoint(this.pointT)}getPointAt(t){return this.getPoint(t)}getCurrentLine(t){let s=(t*(this.end-this.start)+this.start)%1;s<0&&(s+=1),s*=(1+this.aspectRatio)*2;let i;return s<this.aspectRatio?(i=0,this.pointT=s/this.aspectRatio):s<this.aspectRatio+1?(i=1,this.pointT=(s-this.aspectRatio)/1):s<2*this.aspectRatio+1?(i=2,this.pointT=(s-this.aspectRatio-1)/this.aspectRatio):(i=3,this.pointT=(s-2*this.aspectRatio-1)/1),this.curves[i]}getTangent(t){return this.getCurrentLine(t).getTangent(0).normalize()}getNormal(t){const{v1:s,v2:i}=this.getCurrentLine(t);return new l(i.y-s.y,-(i.x-s.x)).normalize()}getCommands(){return this.curves.flatMap(t=>t.getCommands())}getMinMax(t=l.MAX,s=l.MIN){return this.curves.forEach(i=>i.getMinMax(t,s)),{min:t,max:s}}drawTo(t){return this.curves.forEach(s=>s.drawTo(t)),this}}class rt extends k{constructor(e=[]){super(),this.points=e}getDivisions(e=12){return e*this.points.length}getPoint(e,t=new l){const{points:s}=this,i=(s.length-1)*e,o=Math.floor(i),c=i-o,a=s[o===0?o:o-1],h=s[o],n=s[o>s.length-2?s.length-1:o+1],u=s[o>s.length-3?s.length-1:o+2];return t.set(V(c,a.x,h.x,n.x,u.x),V(c,a.y,h.y,n.y,u.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,s=e.points.length;t<s;t++)this.points.push(e.points[t].clone());return this}}class X extends k{constructor(t){super();b(this,"curves",[]);b(this,"currentPoint",new l);b(this,"autoClose",!1);b(this,"_cacheLengths",[]);t&&this.setFromPoints(t)}addCurve(t){return this.curves.push(t),this}closePath(){const t=this.curves[0].getPoint(0),s=this.curves[this.curves.length-1].getPoint(1);return t.equals(s)||this.curves.push(new q(s,t)),this}getPoint(t,s=new l){const i=t*this.getLength(),o=this.getCurveLengths();let c=0;for(;c<o.length;){if(o[c]>=i){const a=o[c]-i,h=this.curves[c],n=h.getLength();return h.getPointAt(n===0?0:1-a/n,s)}c++}return s}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){super.updateArcLengths(),this._cacheLengths=[],this.getCurveLengths()}getCurveLengths(){if(this._cacheLengths.length===this.curves.length)return this._cacheLengths;const t=[];let s=0;for(let i=0,o=this.curves.length;i<o;i++)s+=this.curves[i].getLength(),t.push(s);return this._cacheLengths=t,t}getSpacedPoints(t=40){const s=[];for(let i=0;i<=t;i++)s.push(this.getPoint(i/t));return this.autoClose&&s.push(s[0]),s}getPoints(t=12){const s=[];let i;for(let o=0,c=this.curves;o<c.length;o++){const a=c[o],h=a.getPoints(a.getDivisions(t));for(let n=0;n<h.length;n++){const u=h[n];i&&i.equals(u)||(s.push(u),i=u)}}return this.autoClose&&s.length>1&&!s[s.length-1].equals(s[0])&&s.push(s[0]),s}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let s=1,i=t.length;s<i;s++)this.lineTo(t[s].x,t[s].y);return this}bezierCurveTo(t,s,i,o,c,a){return this.curves.push(new j(this.currentPoint.clone(),new l(t,s),new l(i,o),new l(c,a))),this.currentPoint.set(c,a),this}lineTo(t,s){const i=new q(this.currentPoint.clone(),new l(t,s));return this.curves.push(i),this.currentPoint.set(t,s),this}moveTo(t,s){return this.currentPoint.set(t,s),this}quadraticCurveTo(t,s,i,o){return this.curves.push(new nt(this.currentPoint.clone(),new l(t,s),new l(i,o))),this.currentPoint.set(i,o),this}rect(t,s,i,o){return this.curves.push(new it(new l(t+i/2,s+o/2),i/2,i/o)),this.currentPoint.set(t,s),this}splineThru(t){const s=[this.currentPoint.clone()].concat(t);return this.curves.push(new rt(s)),this.currentPoint.copy(t[t.length-1]),this}arc(t,s,i,o,c,a=!1){const h=this.currentPoint;return this.absarc(t+h.x,s+h.y,i,o,c,a),this}absarc(t,s,i,o,c,a=!1){return this.absellipse(t,s,i,i,o,c,a),this}ellipse(t,s,i,o,c,a,h=!1,n=0){const u=this.currentPoint;return this.absellipse(t+u.x,s+u.y,i,o,c,a,h,n),this}absellipse(t,s,i,o,c,a,h=!1,n=0){const u=new K(t,s,i,o,c,a,h,n);if(this.curves.length>0){const y=u.getPoint(0);y.equals(this.currentPoint)||this.lineTo(y.x,y.y)}return this.curves.push(u),this.currentPoint.copy(u.getPoint(1)),this}getCommands(){return this.curves.flatMap(t=>t.getCommands())}getMinMax(t=l.MAX,s=l.MIN){return this.curves.forEach(i=>i.getMinMax(t,s)),{min:t,max:s}}drawTo(t){return this.curves.forEach(s=>s.drawTo(t)),this}copy(t){super.copy(t),this.curves=[];for(let s=0,i=t.curves.length;s<i;s++){const o=t.curves[s];this.curves.push(o.clone())}return this.autoClose=t.autoClose,this.currentPoint.copy(t.currentPoint),this}}class L{constructor(e){b(this,"currentPath",new X);b(this,"paths",[this.currentPath]);b(this,"userData");e&&(e instanceof L?this.addPath(e):Array.isArray(e)?this.addCommands(e):this.addData(e))}addPath(e){return e instanceof L?this.paths.push(...e.paths.map(t=>t.clone())):this.paths.push(e),this}closePath(){return this.currentPath.closePath(),this}moveTo(e,t){return this.currentPath=new X,this.paths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}bezierCurveTo(e,t,s,i,o,c){return this.currentPath.bezierCurveTo(e,t,s,i,o,c),this}quadraticCurveTo(e,t,s,i){return this.currentPath.quadraticCurveTo(e,t,s,i),this}arc(e,t,s,i,o,c){return this.currentPath.absarc(e,t,s,i,o,!c),this}arcTo(e,t,s,i,o){const c=this.currentPath.currentPoint,a=c.x,h=c.y,n=e-a,u=t-h,y=s-e,p=i-t,x=Math.sqrt(n*n+u*u),g=Math.sqrt(y*y+p*p);if(x<o||g<o)return this.lineTo(s,i),this;const f={x:n/x,y:u/x},M={x:y/g,y:p/g},w=e-f.y*o,I=t+f.x*o,T=Math.atan2(f.y,f.x);let A=Math.atan2(M.y,M.x)-T;return A>Math.PI?A-=2*Math.PI:A<-Math.PI&&(A+=2*Math.PI),this.arc(w,I,o,T,T+A,!1),this.lineTo(s,i),this}ellipse(e,t,s,i,o,c,a,h){return this.currentPath.absellipse(e,t,s,i,c,a,!h,o),this}rect(e,t,s,i){return this.currentPath.rect(e,t,s,i),this}addCommands(e){return yt(e,this),this}addData(e){return this.addCommands(xt(e)),this}splineThru(e){return this.currentPath.splineThru(e),this}forEachCurve(e){return this.paths.forEach(t=>t.curves.forEach(s=>e(s))),this}transform(e){return this.forEachCurve(t=>t.transform(e)),this}getMinMax(e=new l,t=new l){return this.forEachCurve(s=>s.getMinMax(e,t)),{min:e,max:t}}getCommands(){return this.paths.flatMap(e=>e.curves.flatMap(t=>t.getCommands()))}getData(){return this.paths.map(e=>e.getData()).join(" ")}getBoundingBox(){const{min:e,max:t}=this.getMinMax();return{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}}getSvgString(){const{x:e,y:t,width:s,height:i}=this.getBoundingBox();return`<svg viewBox="${e} ${t} ${s} ${i}" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="currentColor" d="${this.getData()}"></path></svg>`}getSvgDataUri(){return`data:image/svg+xml;base64,${btoa(this.getSvgString())}`}drawTo(e){this.forEachCurve(t=>{t.drawTo(e)})}strokeTo(e){this.drawTo(e),e.stroke()}fillTo(e){this.drawTo(e),e.fill()}}const _="px",ot=90,at=["mm","cm","in","pt","pc","px"],B={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function m(r){let e="px";if(typeof r=="string"||r instanceof String)for(let s=0,i=at.length;s<i;s++){const o=at[s];if(r.endsWith(o)){e=o,r=r.substring(0,r.length-o.length);break}}let t;return e==="px"&&_!=="px"?t=B.in[_]/ot:(t=B[e][_],t<0&&(t=B[e].in*ot)),t*Number.parseFloat(r)}const Nt=new d,F=new d,ct=new d,ht=new d;function $t(r,e,t){if(!(r.hasAttribute("transform")||r.nodeName==="use"&&(r.hasAttribute("x")||r.hasAttribute("y"))))return null;const s=Et(r);return t.length>0&&s.premultiply(t[t.length-1]),e.copy(s),t.push(s),s}function Et(r){const e=new d,t=Nt;if(r.nodeName==="use"&&(r.hasAttribute("x")||r.hasAttribute("y"))&&e.translate(m(r.getAttribute("x")),m(r.getAttribute("y"))),r.hasAttribute("transform")){const s=r.getAttribute("transform").split(")");for(let i=s.length-1;i>=0;i--){const o=s[i].trim();if(o==="")continue;const c=o.indexOf("("),a=o.length;if(c>0&&c<a){const h=o.slice(0,c),n=S(o.slice(c+1));switch(t.identity(),h){case"translate":if(n.length>=1){const u=n[0];let y=0;n.length>=2&&(y=n[1]),t.translate(u,y)}break;case"rotate":if(n.length>=1){let u=0,y=0,p=0;u=n[0]*Math.PI/180,n.length>=3&&(y=n[1],p=n[2]),F.makeTranslation(-y,-p),ct.makeRotation(u),ht.multiplyMatrices(ct,F),F.makeTranslation(y,p),t.multiplyMatrices(F,ht)}break;case"scale":n.length>=1&&t.scale(n[0],n[1]??n[0]);break;case"skewX":n.length===1&&t.set(1,Math.tan(n[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":n.length===1&&t.set(1,0,0,Math.tan(n[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":n.length===6&&t.set(n[0],n[2],n[4],n[1],n[3],n[5],0,0,1);break}}e.premultiply(t)}}return e}function zt(r){return new L().addPath(new X().absarc(m(r.getAttribute("cx")||0),m(r.getAttribute("cy")||0),m(r.getAttribute("r")||0),0,Math.PI*2))}function qt(r,e){if(!(!r.sheet||!r.sheet.cssRules||!r.sheet.cssRules.length))for(let t=0;t<r.sheet.cssRules.length;t++){const s=r.sheet.cssRules[t];if(s.type!==1)continue;const i=s.selectorText.split(/,/g).filter(Boolean).map(o=>o.trim());for(let o=0;o<i.length;o++){const c=Object.fromEntries(Object.entries(s.style).filter(([,a])=>a!==""));e[i[o]]=Object.assign(e[i[o]]||{},c)}}}function Dt(r){return new L().addPath(new X().absellipse(m(r.getAttribute("cx")||0),m(r.getAttribute("cy")||0),m(r.getAttribute("rx")||0),m(r.getAttribute("ry")||0),0,Math.PI*2))}function Xt(r){return new L().moveTo(m(r.getAttribute("x1")||0),m(r.getAttribute("y1")||0)).lineTo(m(r.getAttribute("x2")||0),m(r.getAttribute("y2")||0))}function Ot(r){const e=new L,t=r.getAttribute("d");return!t||t==="none"?null:(e.addData(t),e)}const Rt=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Ft(r){var s;const e=new L;let t=0;return(s=r.getAttribute("points"))==null||s.replace(Rt,(i,o,c)=>{const a=m(o),h=m(c);return t===0?e.moveTo(a,h):e.lineTo(a,h),t++,i}),e.currentPath.autoClose=!0,e}const Yt=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function _t(r){var s;const e=new L;let t=0;return(s=r.getAttribute("points"))==null||s.replace(Yt,(i,o,c)=>{const a=m(o),h=m(c);return t===0?e.moveTo(a,h):e.lineTo(a,h),t++,i}),e.currentPath.autoClose=!1,e}function Bt(r){const e=m(r.getAttribute("x")||0),t=m(r.getAttribute("y")||0),s=m(r.getAttribute("rx")||r.getAttribute("ry")||0),i=m(r.getAttribute("ry")||r.getAttribute("rx")||0),o=m(r.getAttribute("width")),c=m(r.getAttribute("height")),a=1-.551915024494,h=new L;return h.moveTo(e+s,t),h.lineTo(e+o-s,t),(s!==0||i!==0)&&h.bezierCurveTo(e+o-s*a,t,e+o,t+i*a,e+o,t+i),h.lineTo(e+o,t+c-i),(s!==0||i!==0)&&h.bezierCurveTo(e+o,t+c-i*a,e+o-s*a,t+c,e+o-s,t+c),h.lineTo(e+s,t+c),(s!==0||i!==0)&&h.bezierCurveTo(e+s*a,t+c,e,t+c-i*a,e,t+c-i),h.lineTo(e,t+i),(s!==0||i!==0)&&h.bezierCurveTo(e,t+i*a,e+s*a,t,e+s,t),h}function N(r,e,t){e=Object.assign({},e);let s={};if(r.hasAttribute("class")){const a=r.getAttribute("class").split(/\s/).filter(Boolean).map(h=>h.trim());for(let h=0;h<a.length;h++)s=Object.assign(s,t[`.${a[h]}`])}r.hasAttribute("id")&&(s=Object.assign(s,t[`#${r.getAttribute("id")}`]));function i(a,h,n){n===void 0&&(n=function(y){return y.startsWith("url")&&console.warn("url access in attributes is not implemented."),y}),r.hasAttribute(a)&&(e[h]=n(r.getAttribute(a))),s[a]&&(e[h]=n(s[a])),r.style&&r.style[a]!==""&&(e[h]=n(r.style[a]))}function o(a){return Math.max(0,Math.min(1,m(a)))}function c(a){return Math.max(0,m(a))}return i("fill","fill"),i("fill-opacity","fillOpacity",o),i("fill-rule","fillRule"),i("opacity","opacity",o),i("stroke","stroke"),i("stroke-dashoffset","strokeDashoffset"),i("stroke-dasharray","strokeDasharray"),i("stroke-linecap","strokeLineCap"),i("stroke-linejoin","strokeLineJoin"),i("stroke-miterlimit","strokeMiterLimit",c),i("stroke-opacity","strokeOpacity",o),i("stroke-width","strokeWidth",c),i("visibility","visibility"),e}function G(r,e,t=[]){var u;if(r.nodeType!==1)return t;let s=!1,i=null;const o={};switch(r.nodeName){case"svg":e=N(r,e,o);break;case"style":qt(r,o);break;case"g":e=N(r,e,o);break;case"path":e=N(r,e,o),r.hasAttribute("d")&&(i=Ot(r));break;case"rect":e=N(r,e,o),i=Bt(r);break;case"polygon":e=N(r,e,o),i=Ft(r);break;case"polyline":e=N(r,e,o),i=_t(r);break;case"circle":e=N(r,e,o),i=zt(r);break;case"ellipse":e=N(r,e,o),i=Dt(r);break;case"line":e=N(r,e,o),i=Xt(r);break;case"defs":s=!0;break;case"use":{e=N(r,e,o);const p=(r.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),x=(u=r.viewportElement)==null?void 0:u.getElementById(p);x?G(x,e,t):console.warn(`'use node' references non-existent node id: ${p}`);break}default:console.warn(r);break}const c=new d,a=[],h=$t(r,c,a);i&&(i.transform(c),t.push(i),i.userData={node:r,style:e});const n=r.childNodes;for(let y=0,p=n.length;y<p;y++){const x=n[y];s&&x.nodeName!=="style"&&x.nodeName!=="defs"||G(x,e,t)}return h&&(a.pop(),a.length>0?c.copy(a[a.length-1]):c.identity()),t}function Gt(r){let e;return typeof r=="string"?e=new DOMParser().parseFromString(r,"image/svg+xml").documentElement:e=r,G(e,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4})}v.CircleCurve=O,v.CubicBezierCurve=j,v.Curve=k,v.CurvePath=X,v.EllipseCurve=K,v.HeartCurve=Lt,v.LineCurve=q,v.Matrix3=d,v.Path2D=L,v.PloygonCurve=St,v.Point2D=l,v.QuadraticBezierCurve=nt,v.RectangularCurve=it,v.SplineCurve=rt,v.parseSvg=Gt,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|