presenter 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/export/powerpoint-renderer/objects/renderSvg.d.ts +3 -0
- package/dist/export.js +32 -31
- package/dist/export.js.map +1 -0
- package/dist/export.mjs +1087 -964
- package/dist/export.mjs.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/objects/SVG.d.ts +13 -0
- package/dist/presenter.js +3 -2
- package/dist/presenter.js.map +1 -0
- package/dist/presenter.mjs +961 -845
- package/dist/presenter.mjs.map +1 -0
- package/dist/renderer/browser-canvas/objects/renderSvg.d.ts +3 -0
- package/dist/renderer/browser-canvas/utils/clipToPath.d.ts +7 -0
- package/dist/types/ObjectType.d.ts +1 -0
- package/dist/utils/objects/circle/getCircleInsetFillPath.d.ts +7 -0
- package/dist/utils/objects/rectangle/getRectangleInsetFillPath.d.ts +7 -0
- package/dist/utils/presentation/getSvgImageUrlById.d.ts +7 -0
- package/package.json +3 -2
package/dist/presenter.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var jt = Object.defineProperty;
|
|
2
|
+
var zt = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var I = (n, e, t) => zt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const u0 = {
|
|
5
5
|
/** Represents an animated change in an object's properties. */
|
|
6
6
|
ANIMATE: "Animate",
|
|
7
7
|
/** Represents a pause in the animation timeline. */
|
|
@@ -9,13 +9,13 @@ const l0 = {
|
|
|
9
9
|
/** Represents an immediate update to an object's properties without animation. */
|
|
10
10
|
UPDATE: "Update"
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function Ut(n) {
|
|
13
13
|
return n * n * n;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Ht(n) {
|
|
16
16
|
return --n * n * n + 1;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Gt(n) {
|
|
19
19
|
return ((n *= 2) <= 1 ? n * n * n : (n -= 2) * n * n + 2) / 2;
|
|
20
20
|
}
|
|
21
21
|
var J0 = 1.70158;
|
|
@@ -33,7 +33,7 @@ var J0 = 1.70158;
|
|
|
33
33
|
}
|
|
34
34
|
return t.overshoot = n, t;
|
|
35
35
|
})(J0);
|
|
36
|
-
var
|
|
36
|
+
var $t = (function n(e) {
|
|
37
37
|
e = +e;
|
|
38
38
|
function t(o) {
|
|
39
39
|
return ((o *= 2) < 1 ? o * o * ((e + 1) * o - e) : (o -= 2) * o * ((e + 1) * o + e) + 2) / 2;
|
|
@@ -42,19 +42,19 @@ var Ht = (function n(e) {
|
|
|
42
42
|
})(J0);
|
|
43
43
|
const tt = {
|
|
44
44
|
LINEAR: (n) => n,
|
|
45
|
-
CUBIC:
|
|
46
|
-
CUBIC_IN:
|
|
47
|
-
CUBIC_OUT:
|
|
48
|
-
BACK_IN_OUT:
|
|
49
|
-
},
|
|
45
|
+
CUBIC: Gt,
|
|
46
|
+
CUBIC_IN: Ut,
|
|
47
|
+
CUBIC_OUT: Ht,
|
|
48
|
+
BACK_IN_OUT: $t.overshoot(0.8)
|
|
49
|
+
}, Wt = tt.LINEAR;
|
|
50
50
|
function et(n, e, t = {}) {
|
|
51
51
|
return {
|
|
52
|
-
type:
|
|
52
|
+
type: u0.ANIMATE,
|
|
53
53
|
object: n,
|
|
54
54
|
props: e,
|
|
55
55
|
delay: 0,
|
|
56
56
|
duration: 1e3,
|
|
57
|
-
easing:
|
|
57
|
+
easing: Wt,
|
|
58
58
|
block: !1,
|
|
59
59
|
interpolators: null,
|
|
60
60
|
isKey: !1,
|
|
@@ -62,36 +62,36 @@ function et(n, e, t = {}) {
|
|
|
62
62
|
...typeof t == "number" ? { duration: t } : t
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function cn(n, e = {}) {
|
|
66
66
|
return et(n, { opacity: 1 }, {
|
|
67
67
|
duration: 500,
|
|
68
68
|
easing: tt.CUBIC,
|
|
69
69
|
...typeof e == "number" ? { duration: e } : e
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function un(n, e = {}) {
|
|
73
73
|
return et(n, { opacity: 0 }, {
|
|
74
74
|
duration: 500,
|
|
75
75
|
easing: tt.CUBIC,
|
|
76
76
|
...typeof e == "number" ? { duration: e } : e
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Ct(n, e) {
|
|
80
80
|
return {
|
|
81
|
-
type:
|
|
81
|
+
type: u0.UPDATE,
|
|
82
82
|
isKey: !1,
|
|
83
83
|
object: n,
|
|
84
84
|
props: e,
|
|
85
85
|
shortcut: null
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
88
|
+
function fn(n) {
|
|
89
|
+
return Ct(n, { opacity: 0 });
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return
|
|
91
|
+
function gn(n) {
|
|
92
|
+
return Ct(n, { opacity: 1 });
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const n0 = {
|
|
95
95
|
TOP_LEFT: "TopLeft",
|
|
96
96
|
TOP: "Top",
|
|
97
97
|
TOP_RIGHT: "TopRight",
|
|
@@ -101,8 +101,8 @@ const e0 = {
|
|
|
101
101
|
BOTTOM_LEFT: "BottomLeft",
|
|
102
102
|
BOTTOM: "Bottom",
|
|
103
103
|
BOTTOM_RIGHT: "BottomRight"
|
|
104
|
-
},
|
|
105
|
-
function
|
|
104
|
+
}, o0 = n0.TOP_LEFT;
|
|
105
|
+
function W(n, e = 0, t = 0, o = 1) {
|
|
106
106
|
if (typeof n == "string") {
|
|
107
107
|
const i = n.replace("#", ""), a = parseInt(i, 16);
|
|
108
108
|
return isNaN(a) ? (console.warn("Invalid hex color format:", n), K) : i.length === 6 ? {
|
|
@@ -131,18 +131,18 @@ function X(n, e = 0, t = 0, o = 1) {
|
|
|
131
131
|
...n
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
W.BLACK = W(0, 0, 0);
|
|
135
|
+
W.BLUE = W(0, 0, 255);
|
|
136
|
+
W.GREEN = W(0, 255, 0);
|
|
137
|
+
W.RED = W(255, 0, 0);
|
|
138
|
+
W.TRANSPARENT = W(0, 0, 0, 0);
|
|
139
|
+
W.WHITE = W(255, 255, 255);
|
|
140
140
|
const K = { red: 0, green: 0, blue: 0, alpha: 1 };
|
|
141
|
-
function
|
|
141
|
+
function Et(n = null) {
|
|
142
142
|
return {
|
|
143
143
|
content: null,
|
|
144
144
|
setup: null,
|
|
145
|
-
anchor:
|
|
145
|
+
anchor: n0.TOP_LEFT,
|
|
146
146
|
height: 0,
|
|
147
147
|
width: 0,
|
|
148
148
|
x: 0,
|
|
@@ -150,22 +150,22 @@ function Ct(n = null) {
|
|
|
150
150
|
...n
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function St(n, e = null) {
|
|
154
154
|
return n.alpha * (e ?? 1);
|
|
155
155
|
}
|
|
156
156
|
function E0(n, e = null) {
|
|
157
|
-
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(
|
|
157
|
+
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(St(n, e) * 255);
|
|
158
158
|
return `#${a.toString(16).padStart(6, "0")}${s !== 255 ? s.toString(16).padStart(2, "0") : ""}`;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function pn(n = null) {
|
|
161
161
|
const {
|
|
162
162
|
url: e = "https://wikipedia.org/",
|
|
163
|
-
backgroundColor: t =
|
|
163
|
+
backgroundColor: t = W.TRANSPARENT,
|
|
164
164
|
borderColor: o = K,
|
|
165
165
|
borderWidth: i = 0,
|
|
166
166
|
pointerEvents: a = "auto",
|
|
167
167
|
scale: s = 1,
|
|
168
|
-
anchor: r =
|
|
168
|
+
anchor: r = o0,
|
|
169
169
|
height: h = 1e3,
|
|
170
170
|
width: c = 1e3,
|
|
171
171
|
x: f = 0,
|
|
@@ -173,7 +173,7 @@ function ln(n = null) {
|
|
|
173
173
|
} = n || {}, l = document.createElement("iframe");
|
|
174
174
|
l.src = e, l.style.backgroundColor = E0(t), l.style.border = i > 0 ? `${i}px solid ${E0(o)}` : "none", l.style.pointerEvents = a;
|
|
175
175
|
const u = (100 / s).toFixed(3) + "%";
|
|
176
|
-
return l.style.height = i === 0 ? u : `calc(${u} - ${i * 2}px)`, l.style.width = i === 0 ? u : `calc(${u} - ${i * 2}px)`, l.style.transform = `scale(${s})`, l.style.transformOrigin = "top left",
|
|
176
|
+
return l.style.height = i === 0 ? u : `calc(${u} - ${i * 2}px)`, l.style.width = i === 0 ? u : `calc(${u} - ${i * 2}px)`, l.style.transform = `scale(${s})`, l.style.transformOrigin = "top left", Et({
|
|
177
177
|
content: l,
|
|
178
178
|
anchor: r,
|
|
179
179
|
height: h,
|
|
@@ -182,19 +182,19 @@ function ln(n = null) {
|
|
|
182
182
|
y: x
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const x0 = {
|
|
186
186
|
LEFT: "left",
|
|
187
187
|
CENTER: "center",
|
|
188
188
|
RIGHT: "right"
|
|
189
|
-
}, Yt =
|
|
190
|
-
function
|
|
189
|
+
}, Yt = x0.LEFT;
|
|
190
|
+
function r0(n, e) {
|
|
191
191
|
throw new Error("Unexpected value: " + n);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function dn(n = null) {
|
|
194
194
|
const {
|
|
195
|
-
alignment: e =
|
|
195
|
+
alignment: e = x0.LEFT,
|
|
196
196
|
scale: t = 1,
|
|
197
|
-
anchor: o =
|
|
197
|
+
anchor: o = o0,
|
|
198
198
|
height: i = 1e3,
|
|
199
199
|
width: a = 1e3,
|
|
200
200
|
x: s = 0,
|
|
@@ -203,17 +203,17 @@ function cn(n = null) {
|
|
|
203
203
|
function h(c) {
|
|
204
204
|
const f = document.createElement("video");
|
|
205
205
|
switch (f.autoplay = !0, f.style.transform = `scale(${t})`, e) {
|
|
206
|
-
case
|
|
206
|
+
case x0.LEFT:
|
|
207
207
|
f.style.transformOrigin = "top left";
|
|
208
208
|
break;
|
|
209
|
-
case
|
|
209
|
+
case x0.CENTER:
|
|
210
210
|
f.style.transformOrigin = "top center";
|
|
211
211
|
break;
|
|
212
|
-
case
|
|
212
|
+
case x0.RIGHT:
|
|
213
213
|
f.style.transformOrigin = "top right";
|
|
214
214
|
break;
|
|
215
215
|
default:
|
|
216
|
-
|
|
216
|
+
r0(e);
|
|
217
217
|
}
|
|
218
218
|
c.appendChild(f);
|
|
219
219
|
const x = {
|
|
@@ -233,7 +233,7 @@ function cn(n = null) {
|
|
|
233
233
|
f.srcObject.getTracks().forEach((u) => u.stop()), f.style.display = "none", f.srcObject = null;
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
|
-
return
|
|
236
|
+
return Et({
|
|
237
237
|
content: null,
|
|
238
238
|
setup: h,
|
|
239
239
|
anchor: o,
|
|
@@ -243,7 +243,7 @@ function cn(n = null) {
|
|
|
243
243
|
y: r
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
-
const
|
|
246
|
+
const j = {
|
|
247
247
|
ARROW: "Arrow",
|
|
248
248
|
CIRCLE: "Circle",
|
|
249
249
|
GROUP: "Group",
|
|
@@ -254,19 +254,20 @@ const H = {
|
|
|
254
254
|
POLYGON: "Polygon",
|
|
255
255
|
RECTANGLE: "Rectangle",
|
|
256
256
|
SLIDE_OBJECT: "SlideObject",
|
|
257
|
+
SVG: "SVG",
|
|
257
258
|
TEXT: "Text"
|
|
258
259
|
};
|
|
259
|
-
function
|
|
260
|
+
function s0(n) {
|
|
260
261
|
return {
|
|
261
|
-
objectType:
|
|
262
|
+
objectType: j.SLIDE_OBJECT,
|
|
262
263
|
opacity: 1,
|
|
263
264
|
...n
|
|
264
265
|
};
|
|
265
266
|
}
|
|
266
|
-
function
|
|
267
|
+
function xn(n = null) {
|
|
267
268
|
const { arrowheadSize: e, width: t = 10, ...o } = n || {}, i = e ?? t * 4;
|
|
268
|
-
return
|
|
269
|
-
objectType:
|
|
269
|
+
return s0({
|
|
270
|
+
objectType: j.ARROW,
|
|
270
271
|
arrowheadSize: i,
|
|
271
272
|
color: K,
|
|
272
273
|
drawn: 1,
|
|
@@ -282,10 +283,10 @@ function un(n = null) {
|
|
|
282
283
|
});
|
|
283
284
|
}
|
|
284
285
|
const Xt = 50;
|
|
285
|
-
function
|
|
286
|
-
return
|
|
287
|
-
objectType:
|
|
288
|
-
anchor:
|
|
286
|
+
function yn(n = null) {
|
|
287
|
+
return s0({
|
|
288
|
+
objectType: j.CIRCLE,
|
|
289
|
+
anchor: o0,
|
|
289
290
|
borderColor: K,
|
|
290
291
|
borderWidth: 0,
|
|
291
292
|
drawn: 1,
|
|
@@ -296,10 +297,10 @@ function fn(n = null) {
|
|
|
296
297
|
...n
|
|
297
298
|
});
|
|
298
299
|
}
|
|
299
|
-
function
|
|
300
|
-
return
|
|
301
|
-
objectType:
|
|
302
|
-
anchor:
|
|
300
|
+
function st(n, e = null) {
|
|
301
|
+
return s0({
|
|
302
|
+
objectType: j.GROUP,
|
|
303
|
+
anchor: o0,
|
|
303
304
|
height: 0,
|
|
304
305
|
objects: n,
|
|
305
306
|
previewColor: null,
|
|
@@ -314,9 +315,9 @@ function ot(n, e = null) {
|
|
|
314
315
|
...e
|
|
315
316
|
});
|
|
316
317
|
}
|
|
317
|
-
function
|
|
318
|
+
function vn(n) {
|
|
318
319
|
const {
|
|
319
|
-
anchor: e =
|
|
320
|
+
anchor: e = o0,
|
|
320
321
|
cols: t = 1,
|
|
321
322
|
rows: o = 1,
|
|
322
323
|
gapX: i = 0,
|
|
@@ -327,7 +328,7 @@ function gn(n) {
|
|
|
327
328
|
y: c = 0,
|
|
328
329
|
objects: f = () => null
|
|
329
330
|
} = n, x = [], l = [];
|
|
330
|
-
let u = 0,
|
|
331
|
+
let u = 0, m = 0;
|
|
331
332
|
for (let M = 0; M < o; M++) {
|
|
332
333
|
const C = [];
|
|
333
334
|
u = 0;
|
|
@@ -335,29 +336,29 @@ function gn(n) {
|
|
|
335
336
|
for (let L = 0; L < t; L++) {
|
|
336
337
|
const S = f(M, L), P = typeof s == "function" ? s(M, L) : s, F = typeof r == "function" ? r(M, L) : r;
|
|
337
338
|
C.push(S), S != null && l.push(
|
|
338
|
-
|
|
339
|
+
st([S], {
|
|
339
340
|
x: u,
|
|
340
|
-
y:
|
|
341
|
+
y: m
|
|
341
342
|
})
|
|
342
343
|
), u += P + i, E = Math.max(E, F);
|
|
343
344
|
}
|
|
344
|
-
x.push(C),
|
|
345
|
+
x.push(C), m += E + a;
|
|
345
346
|
}
|
|
346
347
|
return {
|
|
347
|
-
grid:
|
|
348
|
+
grid: st(l, {
|
|
348
349
|
x: h,
|
|
349
350
|
y: c,
|
|
350
|
-
height:
|
|
351
|
+
height: m - a,
|
|
351
352
|
width: u - i,
|
|
352
353
|
anchor: e
|
|
353
354
|
}),
|
|
354
355
|
objects: x
|
|
355
356
|
};
|
|
356
357
|
}
|
|
357
|
-
function
|
|
358
|
-
return
|
|
359
|
-
objectType:
|
|
360
|
-
anchor:
|
|
358
|
+
function wn(n = null) {
|
|
359
|
+
return s0({
|
|
360
|
+
objectType: j.IMAGE,
|
|
361
|
+
anchor: o0,
|
|
361
362
|
height: 100,
|
|
362
363
|
imageId: "",
|
|
363
364
|
rounding: 0,
|
|
@@ -368,9 +369,9 @@ function pn(n = null) {
|
|
|
368
369
|
...n
|
|
369
370
|
});
|
|
370
371
|
}
|
|
371
|
-
function
|
|
372
|
-
return
|
|
373
|
-
objectType:
|
|
372
|
+
function mn(n = null) {
|
|
373
|
+
return s0({
|
|
374
|
+
objectType: j.LINE,
|
|
374
375
|
color: K,
|
|
375
376
|
drawn: 1,
|
|
376
377
|
endX: 100,
|
|
@@ -383,10 +384,10 @@ function dn(n = null) {
|
|
|
383
384
|
...n
|
|
384
385
|
});
|
|
385
386
|
}
|
|
386
|
-
function
|
|
387
|
-
return
|
|
388
|
-
objectType:
|
|
389
|
-
anchor:
|
|
387
|
+
function An(n, e = null) {
|
|
388
|
+
return s0({
|
|
389
|
+
objectType: j.MASK,
|
|
390
|
+
anchor: o0,
|
|
390
391
|
height: 100,
|
|
391
392
|
objects: n,
|
|
392
393
|
preview: !1,
|
|
@@ -396,11 +397,11 @@ function xn(n, e = null) {
|
|
|
396
397
|
...e
|
|
397
398
|
});
|
|
398
399
|
}
|
|
399
|
-
var
|
|
400
|
-
const e = (n && n.length > 0 ? n : "M0,0").match(
|
|
400
|
+
var Zt = Object.defineProperty, k = (n, e) => Zt(n, "name", { value: e, configurable: !0 }), P0 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Vt = /([astvzqmhlc])([^astvzqmhlc]*)/gi, Kt = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, Qt = k((n) => {
|
|
401
|
+
const e = (n && n.length > 0 ? n : "M0,0").match(Vt);
|
|
401
402
|
if (!e) throw new Error(`No path elements found in string ${n}`);
|
|
402
403
|
return e.reduce((t, o) => {
|
|
403
|
-
let i = o.charAt(0), a = i.toLowerCase(), s =
|
|
404
|
+
let i = o.charAt(0), a = i.toLowerCase(), s = Jt(o.substring(1));
|
|
404
405
|
if (a === "m" && s.length > 2 && (t.push([i, ...s.splice(0, 2)]), a = "l", i = i === "m" ? "l" : "L"), a.toLowerCase() === "a" && (s.length === 5 || s.length === 6)) {
|
|
405
406
|
const r = o.substring(1).trim().split(" ");
|
|
406
407
|
s = [Number(r[0]), Number(r[1]), Number(r[2]), Number(r[3].charAt(0)), Number(r[3].charAt(1)), Number(r[3].substring(2)), Number(r[4])];
|
|
@@ -415,51 +416,51 @@ var Gt = Object.defineProperty, O = (n, e) => Gt(n, "name", { value: e, configur
|
|
|
415
416
|
}
|
|
416
417
|
return t;
|
|
417
418
|
}, []);
|
|
418
|
-
}, "default"),
|
|
419
|
-
const e = n.match(
|
|
419
|
+
}, "default"), Jt = k((n) => {
|
|
420
|
+
const e = n.match(Kt);
|
|
420
421
|
return e ? e.map(Number) : [];
|
|
421
|
-
}, "parseValues"),
|
|
422
|
+
}, "parseValues"), w0, Q = (w0 = class {
|
|
422
423
|
constructor(e, t, o, i) {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
424
|
+
I(this, "x0");
|
|
425
|
+
I(this, "x1");
|
|
426
|
+
I(this, "y0");
|
|
427
|
+
I(this, "y1");
|
|
428
|
+
I(this, "getTotalLength", k(() => Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2)), "getTotalLength"));
|
|
429
|
+
I(this, "getPointAtLength", k((e) => {
|
|
429
430
|
let t = e / Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
|
|
430
431
|
t = Number.isNaN(t) ? 1 : t;
|
|
431
432
|
const o = (this.x1 - this.x0) * t, i = (this.y1 - this.y0) * t;
|
|
432
433
|
return { x: this.x0 + o, y: this.y0 + i };
|
|
433
434
|
}, "getPointAtLength"));
|
|
434
|
-
|
|
435
|
+
I(this, "getTangentAtLength", k((e) => {
|
|
435
436
|
const t = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
|
|
436
437
|
return { x: (this.x1 - this.x0) / t, y: (this.y1 - this.y0) / t };
|
|
437
438
|
}, "getTangentAtLength"));
|
|
438
|
-
|
|
439
|
+
I(this, "getPropertiesAtLength", k((e) => {
|
|
439
440
|
const t = this.getPointAtLength(e), o = this.getTangentAtLength(e);
|
|
440
441
|
return { x: t.x, y: t.y, tangentX: o.x, tangentY: o.y };
|
|
441
442
|
}, "getPropertiesAtLength"));
|
|
442
443
|
this.x0 = e, this.x1 = t, this.y0 = o, this.y1 = i;
|
|
443
444
|
}
|
|
444
|
-
},
|
|
445
|
+
}, k(w0, "LinearPosition"), w0), m0, at = (m0 = class {
|
|
445
446
|
constructor(e, t, o, i, a, s, r, h, c) {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
447
|
+
I(this, "x0");
|
|
448
|
+
I(this, "y0");
|
|
449
|
+
I(this, "rx");
|
|
450
|
+
I(this, "ry");
|
|
451
|
+
I(this, "xAxisRotate");
|
|
452
|
+
I(this, "LargeArcFlag");
|
|
453
|
+
I(this, "SweepFlag");
|
|
454
|
+
I(this, "x1");
|
|
455
|
+
I(this, "y1");
|
|
456
|
+
I(this, "length");
|
|
457
|
+
I(this, "getTotalLength", k(() => this.length, "getTotalLength"));
|
|
458
|
+
I(this, "getPointAtLength", k((e) => {
|
|
458
459
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
459
|
-
const t =
|
|
460
|
+
const t = ht({ x: this.x0, y: this.y0 }, this.rx, this.ry, this.xAxisRotate, this.LargeArcFlag, this.SweepFlag, { x: this.x1, y: this.y1 }, e / this.length);
|
|
460
461
|
return { x: t.x, y: t.y };
|
|
461
462
|
}, "getPointAtLength"));
|
|
462
|
-
|
|
463
|
+
I(this, "getTangentAtLength", k((e) => {
|
|
463
464
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
464
465
|
const t = 0.05, o = this.getPointAtLength(e);
|
|
465
466
|
let i;
|
|
@@ -467,74 +468,74 @@ var Gt = Object.defineProperty, O = (n, e) => Gt(n, "name", { value: e, configur
|
|
|
467
468
|
const a = i.x - o.x, s = i.y - o.y, r = Math.sqrt(a * a + s * s);
|
|
468
469
|
return e < this.length - t ? { x: -a / r, y: -s / r } : { x: a / r, y: s / r };
|
|
469
470
|
}, "getTangentAtLength"));
|
|
470
|
-
|
|
471
|
+
I(this, "getPropertiesAtLength", k((e) => {
|
|
471
472
|
const t = this.getTangentAtLength(e), o = this.getPointAtLength(e);
|
|
472
473
|
return { x: o.x, y: o.y, tangentX: t.x, tangentY: t.y };
|
|
473
474
|
}, "getPropertiesAtLength"));
|
|
474
475
|
this.x0 = e, this.y0 = t, this.rx = o, this.ry = i, this.xAxisRotate = a, this.LargeArcFlag = s, this.SweepFlag = r, this.x1 = h, this.y1 = c;
|
|
475
|
-
const f =
|
|
476
|
-
return
|
|
476
|
+
const f = t1(300, function(x) {
|
|
477
|
+
return ht({ x: e, y: t }, o, i, a, s, r, { x: h, y: c }, x);
|
|
477
478
|
});
|
|
478
479
|
this.length = f.arcLength;
|
|
479
480
|
}
|
|
480
|
-
},
|
|
481
|
-
e = Math.abs(e), t = Math.abs(t), o =
|
|
482
|
-
const h =
|
|
481
|
+
}, k(m0, "Arc"), m0), ht = k((n, e, t, o, i, a, s, r) => {
|
|
482
|
+
e = Math.abs(e), t = Math.abs(t), o = e1(o, 360);
|
|
483
|
+
const h = n1(o);
|
|
483
484
|
if (n.x === s.x && n.y === s.y) return { x: n.x, y: n.y, ellipticalArcAngle: 0 };
|
|
484
485
|
if (e === 0 || t === 0) return { x: 0, y: 0, ellipticalArcAngle: 0 };
|
|
485
486
|
const c = (n.x - s.x) / 2, f = (n.y - s.y) / 2, x = { x: Math.cos(h) * c + Math.sin(h) * f, y: -Math.sin(h) * c + Math.cos(h) * f }, l = Math.pow(x.x, 2) / Math.pow(e, 2) + Math.pow(x.y, 2) / Math.pow(t, 2);
|
|
486
487
|
l > 1 && (e = Math.sqrt(l) * e, t = Math.sqrt(l) * t);
|
|
487
488
|
let u = (Math.pow(e, 2) * Math.pow(t, 2) - Math.pow(e, 2) * Math.pow(x.y, 2) - Math.pow(t, 2) * Math.pow(x.x, 2)) / (Math.pow(e, 2) * Math.pow(x.y, 2) + Math.pow(t, 2) * Math.pow(x.x, 2));
|
|
488
489
|
u = u < 0 ? 0 : u;
|
|
489
|
-
const
|
|
490
|
-
let S =
|
|
490
|
+
const m = (i !== a ? 1 : -1) * Math.sqrt(u), y = m * (e * x.y / t), M = m * (-t * x.x / e), C = { x: Math.cos(h) * y - Math.sin(h) * M + (n.x + s.x) / 2, y: Math.sin(h) * y + Math.cos(h) * M + (n.y + s.y) / 2 }, E = { x: (x.x - y) / e, y: (x.y - M) / t }, L = ct({ x: 1, y: 0 }, E);
|
|
491
|
+
let S = ct(E, { x: (-x.x - y) / e, y: (-x.y - M) / t });
|
|
491
492
|
!a && S > 0 ? S -= 2 * Math.PI : a && S < 0 && (S += 2 * Math.PI), S %= 2 * Math.PI;
|
|
492
|
-
const P = L + S * r, F = e * Math.cos(P),
|
|
493
|
-
return { x: Math.cos(h) * F - Math.sin(h) *
|
|
494
|
-
}, "pointOnEllipticalArc"),
|
|
493
|
+
const P = L + S * r, F = e * Math.cos(P), H = t * Math.sin(P);
|
|
494
|
+
return { x: Math.cos(h) * F - Math.sin(h) * H + C.x, y: Math.sin(h) * F + Math.cos(h) * H + C.y, ellipticalArcStartAngle: L, ellipticalArcEndAngle: L + S, ellipticalArcAngle: P, ellipticalArcCenter: C, resultantRx: e, resultantRy: t };
|
|
495
|
+
}, "pointOnEllipticalArc"), t1 = k((n, e) => {
|
|
495
496
|
n = n ?? 500;
|
|
496
497
|
let t = 0;
|
|
497
498
|
const o = [], i = [];
|
|
498
499
|
let a, s = e(0);
|
|
499
500
|
for (let r = 0; r < n; r++) {
|
|
500
|
-
const h =
|
|
501
|
-
a = e(h), t +=
|
|
501
|
+
const h = r1(r * (1 / n), 0, 1);
|
|
502
|
+
a = e(h), t += lt(s, a), i.push([s, a]), o.push({ t: h, arcLength: t }), s = a;
|
|
502
503
|
}
|
|
503
|
-
return a = e(1), i.push([s, a]), t +=
|
|
504
|
-
}, "approximateArcLengthOfCurve"),
|
|
504
|
+
return a = e(1), i.push([s, a]), t += lt(s, a), o.push({ t: 1, arcLength: t }), { arcLength: t, arcLengthMap: o, approximationLines: i };
|
|
505
|
+
}, "approximateArcLengthOfCurve"), e1 = k((n, e) => (n % e + e) % e, "mod"), n1 = k((n) => n * (Math.PI / 180), "toRadians"), lt = k((n, e) => Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2)), "distance"), r1 = k((n, e, t) => Math.min(Math.max(n, e), t), "clamp"), ct = k((n, e) => {
|
|
505
506
|
const t = n.x * e.x + n.y * e.y, o = Math.sqrt((Math.pow(n.x, 2) + Math.pow(n.y, 2)) * (Math.pow(e.x, 2) + Math.pow(e.y, 2)));
|
|
506
507
|
return (n.x * e.y - n.y * e.x < 0 ? -1 : 1) * Math.acos(t / o);
|
|
507
|
-
}, "angleBetween"), n1 = [[], [], [-0.5773502691896257, 0.5773502691896258], [0, -0.7745966692414833, 0.7745966692414833], [-0.33998104358485626, 0.33998104358485626, -0.8611363115940526, 0.8611363115940526], [0, -0.5384693101056831, 0.5384693101056831, -0.906179845938664, 0.906179845938664], [0.6612093864662645, -0.6612093864662645, -0.2386191860831969, 0.2386191860831969, -0.932469514203152, 0.932469514203152], [0, 0.4058451513773972, -0.4058451513773972, -0.7415311855993945, 0.7415311855993945, -0.9491079123427585, 0.9491079123427585], [-0.1834346424956498, 0.1834346424956498, -0.525532409916329, 0.525532409916329, -0.7966664774136267, 0.7966664774136267, -0.9602898564975363, 0.9602898564975363], [0, -0.8360311073266358, 0.8360311073266358, -0.9681602395076261, 0.9681602395076261, -0.3242534234038089, 0.3242534234038089, -0.6133714327005904, 0.6133714327005904], [-0.14887433898163122, 0.14887433898163122, -0.4333953941292472, 0.4333953941292472, -0.6794095682990244, 0.6794095682990244, -0.8650633666889845, 0.8650633666889845, -0.9739065285171717, 0.9739065285171717], [0, -0.26954315595234496, 0.26954315595234496, -0.5190961292068118, 0.5190961292068118, -0.7301520055740494, 0.7301520055740494, -0.8870625997680953, 0.8870625997680953, -0.978228658146057, 0.978228658146057], [-0.1252334085114689, 0.1252334085114689, -0.3678314989981802, 0.3678314989981802, -0.5873179542866175, 0.5873179542866175, -0.7699026741943047, 0.7699026741943047, -0.9041172563704749, 0.9041172563704749, -0.9815606342467192, 0.9815606342467192], [0, -0.2304583159551348, 0.2304583159551348, -0.44849275103644687, 0.44849275103644687, -0.6423493394403402, 0.6423493394403402, -0.8015780907333099, 0.8015780907333099, -0.9175983992229779, 0.9175983992229779, -0.9841830547185881, 0.9841830547185881], [-0.10805494870734367, 0.10805494870734367, -0.31911236892788974, 0.31911236892788974, -0.5152486363581541, 0.5152486363581541, -0.6872929048116855, 0.6872929048116855, -0.827201315069765, 0.827201315069765, -0.9284348836635735, 0.9284348836635735, -0.9862838086968123, 0.9862838086968123], [0, -0.20119409399743451, 0.20119409399743451, -0.3941513470775634, 0.3941513470775634, -0.5709721726085388, 0.5709721726085388, -0.7244177313601701, 0.7244177313601701, -0.8482065834104272, 0.8482065834104272, -0.937273392400706, 0.937273392400706, -0.9879925180204854, 0.9879925180204854], [-0.09501250983763744, 0.09501250983763744, -0.2816035507792589, 0.2816035507792589, -0.45801677765722737, 0.45801677765722737, -0.6178762444026438, 0.6178762444026438, -0.755404408355003, 0.755404408355003, -0.8656312023878318, 0.8656312023878318, -0.9445750230732326, 0.9445750230732326, -0.9894009349916499, 0.9894009349916499], [0, -0.17848418149584785, 0.17848418149584785, -0.3512317634538763, 0.3512317634538763, -0.5126905370864769, 0.5126905370864769, -0.6576711592166907, 0.6576711592166907, -0.7815140038968014, 0.7815140038968014, -0.8802391537269859, 0.8802391537269859, -0.9506755217687678, 0.9506755217687678, -0.9905754753144174, 0.9905754753144174], [-0.0847750130417353, 0.0847750130417353, -0.2518862256915055, 0.2518862256915055, -0.41175116146284263, 0.41175116146284263, -0.5597708310739475, 0.5597708310739475, -0.6916870430603532, 0.6916870430603532, -0.8037049589725231, 0.8037049589725231, -0.8926024664975557, 0.8926024664975557, -0.9558239495713977, 0.9558239495713977, -0.9915651684209309, 0.9915651684209309], [0, -0.16035864564022537, 0.16035864564022537, -0.31656409996362983, 0.31656409996362983, -0.46457074137596094, 0.46457074137596094, -0.600545304661681, 0.600545304661681, -0.7209661773352294, 0.7209661773352294, -0.8227146565371428, 0.8227146565371428, -0.9031559036148179, 0.9031559036148179, -0.96020815213483, 0.96020815213483, -0.9924068438435844, 0.9924068438435844], [-0.07652652113349734, 0.07652652113349734, -0.22778585114164507, 0.22778585114164507, -0.37370608871541955, 0.37370608871541955, -0.5108670019508271, 0.5108670019508271, -0.636053680726515, 0.636053680726515, -0.7463319064601508, 0.7463319064601508, -0.8391169718222188, 0.8391169718222188, -0.912234428251326, 0.912234428251326, -0.9639719272779138, 0.9639719272779138, -0.9931285991850949, 0.9931285991850949], [0, -0.1455618541608951, 0.1455618541608951, -0.2880213168024011, 0.2880213168024011, -0.4243421202074388, 0.4243421202074388, -0.5516188358872198, 0.5516188358872198, -0.6671388041974123, 0.6671388041974123, -0.7684399634756779, 0.7684399634756779, -0.8533633645833173, 0.8533633645833173, -0.9200993341504008, 0.9200993341504008, -0.9672268385663063, 0.9672268385663063, -0.9937521706203895, 0.9937521706203895], [-0.06973927331972223, 0.06973927331972223, -0.20786042668822127, 0.20786042668822127, -0.34193582089208424, 0.34193582089208424, -0.469355837986757, 0.469355837986757, -0.5876404035069116, 0.5876404035069116, -0.6944872631866827, 0.6944872631866827, -0.7878168059792081, 0.7878168059792081, -0.8658125777203002, 0.8658125777203002, -0.926956772187174, 0.926956772187174, -0.9700604978354287, 0.9700604978354287, -0.9942945854823992, 0.9942945854823992], [0, -0.1332568242984661, 0.1332568242984661, -0.26413568097034495, 0.26413568097034495, -0.3903010380302908, 0.3903010380302908, -0.5095014778460075, 0.5095014778460075, -0.6196098757636461, 0.6196098757636461, -0.7186613631319502, 0.7186613631319502, -0.8048884016188399, 0.8048884016188399, -0.8767523582704416, 0.8767523582704416, -0.9329710868260161, 0.9329710868260161, -0.9725424712181152, 0.9725424712181152, -0.9947693349975522, 0.9947693349975522], [-0.06405689286260563, 0.06405689286260563, -0.1911188674736163, 0.1911188674736163, -0.3150426796961634, 0.3150426796961634, -0.4337935076260451, 0.4337935076260451, -0.5454214713888396, 0.5454214713888396, -0.6480936519369755, 0.6480936519369755, -0.7401241915785544, 0.7401241915785544, -0.820001985973903, 0.820001985973903, -0.8864155270044011, 0.8864155270044011, -0.9382745520027328, 0.9382745520027328, -0.9747285559713095, 0.9747285559713095, -0.9951872199970213, 0.9951872199970213]], r1 = [[], [], [1, 1], [0.8888888888888888, 0.5555555555555556, 0.5555555555555556], [0.6521451548625461, 0.6521451548625461, 0.34785484513745385, 0.34785484513745385], [0.5688888888888889, 0.47862867049936647, 0.47862867049936647, 0.23692688505618908, 0.23692688505618908], [0.3607615730481386, 0.3607615730481386, 0.46791393457269104, 0.46791393457269104, 0.17132449237917036, 0.17132449237917036], [0.4179591836734694, 0.3818300505051189, 0.3818300505051189, 0.27970539148927664, 0.27970539148927664, 0.1294849661688697, 0.1294849661688697], [0.362683783378362, 0.362683783378362, 0.31370664587788727, 0.31370664587788727, 0.22238103445337448, 0.22238103445337448, 0.10122853629037626, 0.10122853629037626], [0.3302393550012598, 0.1806481606948574, 0.1806481606948574, 0.08127438836157441, 0.08127438836157441, 0.31234707704000286, 0.31234707704000286, 0.26061069640293544, 0.26061069640293544], [0.29552422471475287, 0.29552422471475287, 0.26926671930999635, 0.26926671930999635, 0.21908636251598204, 0.21908636251598204, 0.1494513491505806, 0.1494513491505806, 0.06667134430868814, 0.06667134430868814], [0.2729250867779006, 0.26280454451024665, 0.26280454451024665, 0.23319376459199048, 0.23319376459199048, 0.18629021092773426, 0.18629021092773426, 0.1255803694649046, 0.1255803694649046, 0.05566856711617366, 0.05566856711617366], [0.24914704581340277, 0.24914704581340277, 0.2334925365383548, 0.2334925365383548, 0.20316742672306592, 0.20316742672306592, 0.16007832854334622, 0.16007832854334622, 0.10693932599531843, 0.10693932599531843, 0.04717533638651183, 0.04717533638651183], [0.2325515532308739, 0.22628318026289723, 0.22628318026289723, 0.2078160475368885, 0.2078160475368885, 0.17814598076194574, 0.17814598076194574, 0.13887351021978725, 0.13887351021978725, 0.09212149983772845, 0.09212149983772845, 0.04048400476531588, 0.04048400476531588], [0.2152638534631578, 0.2152638534631578, 0.2051984637212956, 0.2051984637212956, 0.18553839747793782, 0.18553839747793782, 0.15720316715819355, 0.15720316715819355, 0.12151857068790319, 0.12151857068790319, 0.08015808715976021, 0.08015808715976021, 0.03511946033175186, 0.03511946033175186], [0.2025782419255613, 0.19843148532711158, 0.19843148532711158, 0.1861610000155622, 0.1861610000155622, 0.16626920581699392, 0.16626920581699392, 0.13957067792615432, 0.13957067792615432, 0.10715922046717194, 0.10715922046717194, 0.07036604748810812, 0.07036604748810812, 0.03075324199611727, 0.03075324199611727], [0.1894506104550685, 0.1894506104550685, 0.18260341504492358, 0.18260341504492358, 0.16915651939500254, 0.16915651939500254, 0.14959598881657674, 0.14959598881657674, 0.12462897125553388, 0.12462897125553388, 0.09515851168249279, 0.09515851168249279, 0.062253523938647894, 0.062253523938647894, 0.027152459411754096, 0.027152459411754096], [0.17944647035620653, 0.17656270536699264, 0.17656270536699264, 0.16800410215645004, 0.16800410215645004, 0.15404576107681028, 0.15404576107681028, 0.13513636846852548, 0.13513636846852548, 0.11188384719340397, 0.11188384719340397, 0.08503614831717918, 0.08503614831717918, 0.0554595293739872, 0.0554595293739872, 0.02414830286854793, 0.02414830286854793], [0.1691423829631436, 0.1691423829631436, 0.16427648374583273, 0.16427648374583273, 0.15468467512626524, 0.15468467512626524, 0.14064291467065065, 0.14064291467065065, 0.12255520671147846, 0.12255520671147846, 0.10094204410628717, 0.10094204410628717, 0.07642573025488905, 0.07642573025488905, 0.0497145488949698, 0.0497145488949698, 0.02161601352648331, 0.02161601352648331], [0.1610544498487837, 0.15896884339395434, 0.15896884339395434, 0.15276604206585967, 0.15276604206585967, 0.1426067021736066, 0.1426067021736066, 0.12875396253933621, 0.12875396253933621, 0.11156664554733399, 0.11156664554733399, 0.09149002162245, 0.09149002162245, 0.06904454273764123, 0.06904454273764123, 0.0448142267656996, 0.0448142267656996, 0.019461788229726478, 0.019461788229726478], [0.15275338713072584, 0.15275338713072584, 0.14917298647260374, 0.14917298647260374, 0.14209610931838204, 0.14209610931838204, 0.13168863844917664, 0.13168863844917664, 0.11819453196151841, 0.11819453196151841, 0.10193011981724044, 0.10193011981724044, 0.08327674157670475, 0.08327674157670475, 0.06267204833410907, 0.06267204833410907, 0.04060142980038694, 0.04060142980038694, 0.017614007139152118, 0.017614007139152118], [0.14608113364969041, 0.14452440398997005, 0.14452440398997005, 0.13988739479107315, 0.13988739479107315, 0.13226893863333747, 0.13226893863333747, 0.12183141605372853, 0.12183141605372853, 0.10879729916714838, 0.10879729916714838, 0.09344442345603386, 0.09344442345603386, 0.0761001136283793, 0.0761001136283793, 0.057134425426857205, 0.057134425426857205, 0.036953789770852494, 0.036953789770852494, 0.016017228257774335, 0.016017228257774335], [0.13925187285563198, 0.13925187285563198, 0.13654149834601517, 0.13654149834601517, 0.13117350478706238, 0.13117350478706238, 0.12325237681051242, 0.12325237681051242, 0.11293229608053922, 0.11293229608053922, 0.10041414444288096, 0.10041414444288096, 0.08594160621706773, 0.08594160621706773, 0.06979646842452049, 0.06979646842452049, 0.052293335152683286, 0.052293335152683286, 0.03377490158481415, 0.03377490158481415, 0.0146279952982722, 0.0146279952982722], [0.13365457218610619, 0.1324620394046966, 0.1324620394046966, 0.12890572218808216, 0.12890572218808216, 0.12304908430672953, 0.12304908430672953, 0.11499664022241136, 0.11499664022241136, 0.10489209146454141, 0.10489209146454141, 0.09291576606003515, 0.09291576606003515, 0.07928141177671895, 0.07928141177671895, 0.06423242140852585, 0.06423242140852585, 0.04803767173108467, 0.04803767173108467, 0.030988005856979445, 0.030988005856979445, 0.013411859487141771, 0.013411859487141771], [0.12793819534675216, 0.12793819534675216, 0.1258374563468283, 0.1258374563468283, 0.12167047292780339, 0.12167047292780339, 0.1155056680537256, 0.1155056680537256, 0.10744427011596563, 0.10744427011596563, 0.09761865210411388, 0.09761865210411388, 0.08619016153195327, 0.08619016153195327, 0.0733464814110803, 0.0733464814110803, 0.05929858491543678, 0.05929858491543678, 0.04427743881741981, 0.04427743881741981, 0.028531388628933663, 0.028531388628933663, 0.0123412297999872, 0.0123412297999872]], i1 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], o1 = O((n, e, t) => ({ x: (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], y: (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3] }), "cubicPoint"), s1 = O((n, e, t) => St([3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])], [3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])], t), "cubicDerivative"), a1 = O((n, e, t) => {
|
|
508
|
+
}, "angleBetween"), i1 = [[], [], [-0.5773502691896257, 0.5773502691896258], [0, -0.7745966692414833, 0.7745966692414833], [-0.33998104358485626, 0.33998104358485626, -0.8611363115940526, 0.8611363115940526], [0, -0.5384693101056831, 0.5384693101056831, -0.906179845938664, 0.906179845938664], [0.6612093864662645, -0.6612093864662645, -0.2386191860831969, 0.2386191860831969, -0.932469514203152, 0.932469514203152], [0, 0.4058451513773972, -0.4058451513773972, -0.7415311855993945, 0.7415311855993945, -0.9491079123427585, 0.9491079123427585], [-0.1834346424956498, 0.1834346424956498, -0.525532409916329, 0.525532409916329, -0.7966664774136267, 0.7966664774136267, -0.9602898564975363, 0.9602898564975363], [0, -0.8360311073266358, 0.8360311073266358, -0.9681602395076261, 0.9681602395076261, -0.3242534234038089, 0.3242534234038089, -0.6133714327005904, 0.6133714327005904], [-0.14887433898163122, 0.14887433898163122, -0.4333953941292472, 0.4333953941292472, -0.6794095682990244, 0.6794095682990244, -0.8650633666889845, 0.8650633666889845, -0.9739065285171717, 0.9739065285171717], [0, -0.26954315595234496, 0.26954315595234496, -0.5190961292068118, 0.5190961292068118, -0.7301520055740494, 0.7301520055740494, -0.8870625997680953, 0.8870625997680953, -0.978228658146057, 0.978228658146057], [-0.1252334085114689, 0.1252334085114689, -0.3678314989981802, 0.3678314989981802, -0.5873179542866175, 0.5873179542866175, -0.7699026741943047, 0.7699026741943047, -0.9041172563704749, 0.9041172563704749, -0.9815606342467192, 0.9815606342467192], [0, -0.2304583159551348, 0.2304583159551348, -0.44849275103644687, 0.44849275103644687, -0.6423493394403402, 0.6423493394403402, -0.8015780907333099, 0.8015780907333099, -0.9175983992229779, 0.9175983992229779, -0.9841830547185881, 0.9841830547185881], [-0.10805494870734367, 0.10805494870734367, -0.31911236892788974, 0.31911236892788974, -0.5152486363581541, 0.5152486363581541, -0.6872929048116855, 0.6872929048116855, -0.827201315069765, 0.827201315069765, -0.9284348836635735, 0.9284348836635735, -0.9862838086968123, 0.9862838086968123], [0, -0.20119409399743451, 0.20119409399743451, -0.3941513470775634, 0.3941513470775634, -0.5709721726085388, 0.5709721726085388, -0.7244177313601701, 0.7244177313601701, -0.8482065834104272, 0.8482065834104272, -0.937273392400706, 0.937273392400706, -0.9879925180204854, 0.9879925180204854], [-0.09501250983763744, 0.09501250983763744, -0.2816035507792589, 0.2816035507792589, -0.45801677765722737, 0.45801677765722737, -0.6178762444026438, 0.6178762444026438, -0.755404408355003, 0.755404408355003, -0.8656312023878318, 0.8656312023878318, -0.9445750230732326, 0.9445750230732326, -0.9894009349916499, 0.9894009349916499], [0, -0.17848418149584785, 0.17848418149584785, -0.3512317634538763, 0.3512317634538763, -0.5126905370864769, 0.5126905370864769, -0.6576711592166907, 0.6576711592166907, -0.7815140038968014, 0.7815140038968014, -0.8802391537269859, 0.8802391537269859, -0.9506755217687678, 0.9506755217687678, -0.9905754753144174, 0.9905754753144174], [-0.0847750130417353, 0.0847750130417353, -0.2518862256915055, 0.2518862256915055, -0.41175116146284263, 0.41175116146284263, -0.5597708310739475, 0.5597708310739475, -0.6916870430603532, 0.6916870430603532, -0.8037049589725231, 0.8037049589725231, -0.8926024664975557, 0.8926024664975557, -0.9558239495713977, 0.9558239495713977, -0.9915651684209309, 0.9915651684209309], [0, -0.16035864564022537, 0.16035864564022537, -0.31656409996362983, 0.31656409996362983, -0.46457074137596094, 0.46457074137596094, -0.600545304661681, 0.600545304661681, -0.7209661773352294, 0.7209661773352294, -0.8227146565371428, 0.8227146565371428, -0.9031559036148179, 0.9031559036148179, -0.96020815213483, 0.96020815213483, -0.9924068438435844, 0.9924068438435844], [-0.07652652113349734, 0.07652652113349734, -0.22778585114164507, 0.22778585114164507, -0.37370608871541955, 0.37370608871541955, -0.5108670019508271, 0.5108670019508271, -0.636053680726515, 0.636053680726515, -0.7463319064601508, 0.7463319064601508, -0.8391169718222188, 0.8391169718222188, -0.912234428251326, 0.912234428251326, -0.9639719272779138, 0.9639719272779138, -0.9931285991850949, 0.9931285991850949], [0, -0.1455618541608951, 0.1455618541608951, -0.2880213168024011, 0.2880213168024011, -0.4243421202074388, 0.4243421202074388, -0.5516188358872198, 0.5516188358872198, -0.6671388041974123, 0.6671388041974123, -0.7684399634756779, 0.7684399634756779, -0.8533633645833173, 0.8533633645833173, -0.9200993341504008, 0.9200993341504008, -0.9672268385663063, 0.9672268385663063, -0.9937521706203895, 0.9937521706203895], [-0.06973927331972223, 0.06973927331972223, -0.20786042668822127, 0.20786042668822127, -0.34193582089208424, 0.34193582089208424, -0.469355837986757, 0.469355837986757, -0.5876404035069116, 0.5876404035069116, -0.6944872631866827, 0.6944872631866827, -0.7878168059792081, 0.7878168059792081, -0.8658125777203002, 0.8658125777203002, -0.926956772187174, 0.926956772187174, -0.9700604978354287, 0.9700604978354287, -0.9942945854823992, 0.9942945854823992], [0, -0.1332568242984661, 0.1332568242984661, -0.26413568097034495, 0.26413568097034495, -0.3903010380302908, 0.3903010380302908, -0.5095014778460075, 0.5095014778460075, -0.6196098757636461, 0.6196098757636461, -0.7186613631319502, 0.7186613631319502, -0.8048884016188399, 0.8048884016188399, -0.8767523582704416, 0.8767523582704416, -0.9329710868260161, 0.9329710868260161, -0.9725424712181152, 0.9725424712181152, -0.9947693349975522, 0.9947693349975522], [-0.06405689286260563, 0.06405689286260563, -0.1911188674736163, 0.1911188674736163, -0.3150426796961634, 0.3150426796961634, -0.4337935076260451, 0.4337935076260451, -0.5454214713888396, 0.5454214713888396, -0.6480936519369755, 0.6480936519369755, -0.7401241915785544, 0.7401241915785544, -0.820001985973903, 0.820001985973903, -0.8864155270044011, 0.8864155270044011, -0.9382745520027328, 0.9382745520027328, -0.9747285559713095, 0.9747285559713095, -0.9951872199970213, 0.9951872199970213]], o1 = [[], [], [1, 1], [0.8888888888888888, 0.5555555555555556, 0.5555555555555556], [0.6521451548625461, 0.6521451548625461, 0.34785484513745385, 0.34785484513745385], [0.5688888888888889, 0.47862867049936647, 0.47862867049936647, 0.23692688505618908, 0.23692688505618908], [0.3607615730481386, 0.3607615730481386, 0.46791393457269104, 0.46791393457269104, 0.17132449237917036, 0.17132449237917036], [0.4179591836734694, 0.3818300505051189, 0.3818300505051189, 0.27970539148927664, 0.27970539148927664, 0.1294849661688697, 0.1294849661688697], [0.362683783378362, 0.362683783378362, 0.31370664587788727, 0.31370664587788727, 0.22238103445337448, 0.22238103445337448, 0.10122853629037626, 0.10122853629037626], [0.3302393550012598, 0.1806481606948574, 0.1806481606948574, 0.08127438836157441, 0.08127438836157441, 0.31234707704000286, 0.31234707704000286, 0.26061069640293544, 0.26061069640293544], [0.29552422471475287, 0.29552422471475287, 0.26926671930999635, 0.26926671930999635, 0.21908636251598204, 0.21908636251598204, 0.1494513491505806, 0.1494513491505806, 0.06667134430868814, 0.06667134430868814], [0.2729250867779006, 0.26280454451024665, 0.26280454451024665, 0.23319376459199048, 0.23319376459199048, 0.18629021092773426, 0.18629021092773426, 0.1255803694649046, 0.1255803694649046, 0.05566856711617366, 0.05566856711617366], [0.24914704581340277, 0.24914704581340277, 0.2334925365383548, 0.2334925365383548, 0.20316742672306592, 0.20316742672306592, 0.16007832854334622, 0.16007832854334622, 0.10693932599531843, 0.10693932599531843, 0.04717533638651183, 0.04717533638651183], [0.2325515532308739, 0.22628318026289723, 0.22628318026289723, 0.2078160475368885, 0.2078160475368885, 0.17814598076194574, 0.17814598076194574, 0.13887351021978725, 0.13887351021978725, 0.09212149983772845, 0.09212149983772845, 0.04048400476531588, 0.04048400476531588], [0.2152638534631578, 0.2152638534631578, 0.2051984637212956, 0.2051984637212956, 0.18553839747793782, 0.18553839747793782, 0.15720316715819355, 0.15720316715819355, 0.12151857068790319, 0.12151857068790319, 0.08015808715976021, 0.08015808715976021, 0.03511946033175186, 0.03511946033175186], [0.2025782419255613, 0.19843148532711158, 0.19843148532711158, 0.1861610000155622, 0.1861610000155622, 0.16626920581699392, 0.16626920581699392, 0.13957067792615432, 0.13957067792615432, 0.10715922046717194, 0.10715922046717194, 0.07036604748810812, 0.07036604748810812, 0.03075324199611727, 0.03075324199611727], [0.1894506104550685, 0.1894506104550685, 0.18260341504492358, 0.18260341504492358, 0.16915651939500254, 0.16915651939500254, 0.14959598881657674, 0.14959598881657674, 0.12462897125553388, 0.12462897125553388, 0.09515851168249279, 0.09515851168249279, 0.062253523938647894, 0.062253523938647894, 0.027152459411754096, 0.027152459411754096], [0.17944647035620653, 0.17656270536699264, 0.17656270536699264, 0.16800410215645004, 0.16800410215645004, 0.15404576107681028, 0.15404576107681028, 0.13513636846852548, 0.13513636846852548, 0.11188384719340397, 0.11188384719340397, 0.08503614831717918, 0.08503614831717918, 0.0554595293739872, 0.0554595293739872, 0.02414830286854793, 0.02414830286854793], [0.1691423829631436, 0.1691423829631436, 0.16427648374583273, 0.16427648374583273, 0.15468467512626524, 0.15468467512626524, 0.14064291467065065, 0.14064291467065065, 0.12255520671147846, 0.12255520671147846, 0.10094204410628717, 0.10094204410628717, 0.07642573025488905, 0.07642573025488905, 0.0497145488949698, 0.0497145488949698, 0.02161601352648331, 0.02161601352648331], [0.1610544498487837, 0.15896884339395434, 0.15896884339395434, 0.15276604206585967, 0.15276604206585967, 0.1426067021736066, 0.1426067021736066, 0.12875396253933621, 0.12875396253933621, 0.11156664554733399, 0.11156664554733399, 0.09149002162245, 0.09149002162245, 0.06904454273764123, 0.06904454273764123, 0.0448142267656996, 0.0448142267656996, 0.019461788229726478, 0.019461788229726478], [0.15275338713072584, 0.15275338713072584, 0.14917298647260374, 0.14917298647260374, 0.14209610931838204, 0.14209610931838204, 0.13168863844917664, 0.13168863844917664, 0.11819453196151841, 0.11819453196151841, 0.10193011981724044, 0.10193011981724044, 0.08327674157670475, 0.08327674157670475, 0.06267204833410907, 0.06267204833410907, 0.04060142980038694, 0.04060142980038694, 0.017614007139152118, 0.017614007139152118], [0.14608113364969041, 0.14452440398997005, 0.14452440398997005, 0.13988739479107315, 0.13988739479107315, 0.13226893863333747, 0.13226893863333747, 0.12183141605372853, 0.12183141605372853, 0.10879729916714838, 0.10879729916714838, 0.09344442345603386, 0.09344442345603386, 0.0761001136283793, 0.0761001136283793, 0.057134425426857205, 0.057134425426857205, 0.036953789770852494, 0.036953789770852494, 0.016017228257774335, 0.016017228257774335], [0.13925187285563198, 0.13925187285563198, 0.13654149834601517, 0.13654149834601517, 0.13117350478706238, 0.13117350478706238, 0.12325237681051242, 0.12325237681051242, 0.11293229608053922, 0.11293229608053922, 0.10041414444288096, 0.10041414444288096, 0.08594160621706773, 0.08594160621706773, 0.06979646842452049, 0.06979646842452049, 0.052293335152683286, 0.052293335152683286, 0.03377490158481415, 0.03377490158481415, 0.0146279952982722, 0.0146279952982722], [0.13365457218610619, 0.1324620394046966, 0.1324620394046966, 0.12890572218808216, 0.12890572218808216, 0.12304908430672953, 0.12304908430672953, 0.11499664022241136, 0.11499664022241136, 0.10489209146454141, 0.10489209146454141, 0.09291576606003515, 0.09291576606003515, 0.07928141177671895, 0.07928141177671895, 0.06423242140852585, 0.06423242140852585, 0.04803767173108467, 0.04803767173108467, 0.030988005856979445, 0.030988005856979445, 0.013411859487141771, 0.013411859487141771], [0.12793819534675216, 0.12793819534675216, 0.1258374563468283, 0.1258374563468283, 0.12167047292780339, 0.12167047292780339, 0.1155056680537256, 0.1155056680537256, 0.10744427011596563, 0.10744427011596563, 0.09761865210411388, 0.09761865210411388, 0.08619016153195327, 0.08619016153195327, 0.0733464814110803, 0.0733464814110803, 0.05929858491543678, 0.05929858491543678, 0.04427743881741981, 0.04427743881741981, 0.028531388628933663, 0.028531388628933663, 0.0123412297999872, 0.0123412297999872]], s1 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], a1 = k((n, e, t) => ({ x: (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], y: (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3] }), "cubicPoint"), h1 = k((n, e, t) => It([3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])], [3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])], t), "cubicDerivative"), l1 = k((n, e, t) => {
|
|
508
509
|
let o, i;
|
|
509
510
|
const a = t / 2;
|
|
510
511
|
o = 0;
|
|
511
|
-
for (let s = 0; s < 20; s++) i = a *
|
|
512
|
+
for (let s = 0; s < 20; s++) i = a * i1[20][s] + a, o += o1[20][s] * _t(n, e, i);
|
|
512
513
|
return a * o;
|
|
513
|
-
}, "getCubicArcLength"),
|
|
514
|
+
}, "getCubicArcLength"), It = k((n, e, t) => ({ x: (1 - t) * (1 - t) * n[0] + 2 * (1 - t) * t * n[1] + t * t * n[2], y: (1 - t) * (1 - t) * e[0] + 2 * (1 - t) * t * e[1] + t * t * e[2] }), "quadraticPoint"), c1 = k((n, e, t) => {
|
|
514
515
|
t === void 0 && (t = 1);
|
|
515
516
|
const o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i), h = 4 * (o * a + i * s), c = a * a + s * s;
|
|
516
517
|
if (r === 0) return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
|
|
517
|
-
const f = h / (2 * r), x = t + f, l = c / r - f * f, u = x * x + l > 0 ? Math.sqrt(x * x + l) : 0,
|
|
518
|
-
return Math.sqrt(r) / 2 * (x * u - f *
|
|
519
|
-
}, "getQuadraticArcLength"),
|
|
518
|
+
const f = h / (2 * r), x = t + f, l = c / r - f * f, u = x * x + l > 0 ? Math.sqrt(x * x + l) : 0, m = f * f + l > 0 ? Math.sqrt(f * f + l) : 0, y = f + Math.sqrt(f * f + l) !== 0 && (x + u) / (f + m) !== 0 ? l * Math.log(Math.abs((x + u) / (f + m))) : 0;
|
|
519
|
+
return Math.sqrt(r) / 2 * (x * u - f * m + y);
|
|
520
|
+
}, "getQuadraticArcLength"), u1 = k((n, e, t) => ({ x: 2 * (1 - t) * (n[1] - n[0]) + 2 * t * (n[2] - n[1]), y: 2 * (1 - t) * (e[1] - e[0]) + 2 * t * (e[2] - e[1]) }), "quadraticDerivative");
|
|
520
521
|
function _t(n, e, t) {
|
|
521
|
-
const o =
|
|
522
|
+
const o = Y0(1, t, n), i = Y0(1, t, e), a = o * o + i * i;
|
|
522
523
|
return Math.sqrt(a);
|
|
523
524
|
}
|
|
524
|
-
|
|
525
|
-
var
|
|
525
|
+
k(_t, "BFunc");
|
|
526
|
+
var Y0 = k((n, e, t) => {
|
|
526
527
|
const o = t.length - 1;
|
|
527
528
|
let i, a;
|
|
528
529
|
if (o === 0) return 0;
|
|
529
530
|
if (n === 0) {
|
|
530
531
|
a = 0;
|
|
531
|
-
for (let s = 0; s <= o; s++) a +=
|
|
532
|
+
for (let s = 0; s <= o; s++) a += s1[o][s] * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
532
533
|
return a;
|
|
533
534
|
}
|
|
534
535
|
i = new Array(o);
|
|
535
536
|
for (let s = 0; s < o; s++) i[s] = o * (t[s + 1] - t[s]);
|
|
536
|
-
return
|
|
537
|
-
}, "getDerivative"),
|
|
537
|
+
return Y0(n - 1, e, i);
|
|
538
|
+
}, "getDerivative"), R0 = k((n, e, t) => {
|
|
538
539
|
let o = 1, i = n / e, a = (n - t(i)) / e, s = 0;
|
|
539
540
|
for (; o > 1e-3; ) {
|
|
540
541
|
const r = t(i + a), h = Math.abs(n - r) / e;
|
|
@@ -546,69 +547,69 @@ var X0 = O((n, e, t) => {
|
|
|
546
547
|
if (s++, s > 500) break;
|
|
547
548
|
}
|
|
548
549
|
return i;
|
|
549
|
-
}, "t2length"), A0,
|
|
550
|
+
}, "t2length"), A0, h0 = (A0 = class {
|
|
550
551
|
constructor(e, t, o, i, a, s, r, h) {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
552
|
+
I(this, "a");
|
|
553
|
+
I(this, "b");
|
|
554
|
+
I(this, "c");
|
|
555
|
+
I(this, "d");
|
|
556
|
+
I(this, "length");
|
|
557
|
+
I(this, "getArcLength");
|
|
558
|
+
I(this, "getPoint");
|
|
559
|
+
I(this, "getDerivative");
|
|
560
|
+
I(this, "getTotalLength", k(() => this.length, "getTotalLength"));
|
|
561
|
+
I(this, "getPointAtLength", k((e) => {
|
|
562
|
+
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i = R0(e, this.length, (a) => this.getArcLength(t, o, a));
|
|
562
563
|
return this.getPoint(t, o, i);
|
|
563
564
|
}, "getPointAtLength"));
|
|
564
|
-
|
|
565
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
565
|
+
I(this, "getTangentAtLength", k((e) => {
|
|
566
|
+
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i = R0(e, this.length, (h) => this.getArcLength(t, o, h)), a = this.getDerivative(t, o, i), s = Math.sqrt(a.x * a.x + a.y * a.y);
|
|
566
567
|
let r;
|
|
567
568
|
return r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 }, r;
|
|
568
569
|
}, "getTangentAtLength"));
|
|
569
|
-
|
|
570
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
570
|
+
I(this, "getPropertiesAtLength", k((e) => {
|
|
571
|
+
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i = R0(e, this.length, (c) => this.getArcLength(t, o, c)), a = this.getDerivative(t, o, i), s = Math.sqrt(a.x * a.x + a.y * a.y);
|
|
571
572
|
let r;
|
|
572
573
|
r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 };
|
|
573
574
|
const h = this.getPoint(t, o, i);
|
|
574
575
|
return { x: h.x, y: h.y, tangentX: r.x, tangentY: r.y };
|
|
575
576
|
}, "getPropertiesAtLength"));
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
this.a = { x: e, y: t }, this.b = { x: o, y: i }, this.c = { x: a, y: s }, r !== void 0 && h !== void 0 ? (this.getArcLength =
|
|
577
|
+
I(this, "getC", k(() => this.c, "getC"));
|
|
578
|
+
I(this, "getD", k(() => this.d, "getD"));
|
|
579
|
+
this.a = { x: e, y: t }, this.b = { x: o, y: i }, this.c = { x: a, y: s }, r !== void 0 && h !== void 0 ? (this.getArcLength = l1, this.getPoint = a1, this.getDerivative = h1, this.d = { x: r, y: h }) : (this.getArcLength = c1, this.getPoint = It, this.getDerivative = u1, this.d = { x: 0, y: 0 }), this.length = this.getArcLength([this.a.x, this.b.x, this.c.x, this.d.x], [this.a.y, this.b.y, this.c.y, this.d.y], 1);
|
|
579
580
|
}
|
|
580
|
-
},
|
|
581
|
+
}, k(A0, "Bezier"), A0), b0, f1 = (b0 = class {
|
|
581
582
|
constructor(e) {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
583
|
+
I(this, "length", 0);
|
|
584
|
+
I(this, "partial_lengths", []);
|
|
585
|
+
I(this, "functions", []);
|
|
586
|
+
I(this, "initial_point", null);
|
|
587
|
+
I(this, "getPartAtLength", k((e) => {
|
|
587
588
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
588
589
|
let t = this.partial_lengths.length - 1;
|
|
589
590
|
for (; this.partial_lengths[t] >= e && t > 0; ) t--;
|
|
590
591
|
return t++, { fraction: e - this.partial_lengths[t - 1], i: t };
|
|
591
592
|
}, "getPartAtLength"));
|
|
592
|
-
|
|
593
|
-
|
|
593
|
+
I(this, "getTotalLength", k(() => this.length, "getTotalLength"));
|
|
594
|
+
I(this, "getPointAtLength", k((e) => {
|
|
594
595
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
595
596
|
if (o) return o.getPointAtLength(t.fraction);
|
|
596
597
|
if (this.initial_point) return this.initial_point;
|
|
597
598
|
throw new Error("Wrong function at this part.");
|
|
598
599
|
}, "getPointAtLength"));
|
|
599
|
-
|
|
600
|
+
I(this, "getTangentAtLength", k((e) => {
|
|
600
601
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
601
602
|
if (o) return o.getTangentAtLength(t.fraction);
|
|
602
603
|
if (this.initial_point) return { x: 0, y: 0 };
|
|
603
604
|
throw new Error("Wrong function at this part.");
|
|
604
605
|
}, "getTangentAtLength"));
|
|
605
|
-
|
|
606
|
+
I(this, "getPropertiesAtLength", k((e) => {
|
|
606
607
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
607
608
|
if (o) return o.getPropertiesAtLength(t.fraction);
|
|
608
609
|
if (this.initial_point) return { x: this.initial_point.x, y: this.initial_point.y, tangentX: 0, tangentY: 0 };
|
|
609
610
|
throw new Error("Wrong function at this part.");
|
|
610
611
|
}, "getPropertiesAtLength"));
|
|
611
|
-
|
|
612
|
+
I(this, "getParts", k(() => {
|
|
612
613
|
const e = [];
|
|
613
614
|
for (let t = 0; t < this.functions.length; t++) if (this.functions[t] !== null) {
|
|
614
615
|
this.functions[t] = this.functions[t];
|
|
@@ -617,95 +618,95 @@ var X0 = O((n, e, t) => {
|
|
|
617
618
|
}
|
|
618
619
|
return e;
|
|
619
620
|
}, "getParts"));
|
|
620
|
-
const t = Array.isArray(e) ? e :
|
|
621
|
+
const t = Array.isArray(e) ? e : Qt(e);
|
|
621
622
|
let o, i = [0, 0], a = [0, 0], s = [0, 0];
|
|
622
623
|
for (let r = 0; r < t.length; r++) {
|
|
623
624
|
if (t[r][0] === "M") i = [t[r][1], t[r][2]], s = [i[0], i[1]], this.functions.push(null), r === 0 && (this.initial_point = { x: t[r][1], y: t[r][2] });
|
|
624
625
|
else if (t[r][0] === "m") i = [t[r][1] + i[0], t[r][2] + i[1]], s = [i[0], i[1]], this.functions.push(null);
|
|
625
|
-
else if (t[r][0] === "L") this.length += Math.sqrt(Math.pow(i[0] - t[r][1], 2) + Math.pow(i[1] - t[r][2], 2)), this.functions.push(new
|
|
626
|
-
else if (t[r][0] === "l") this.length += Math.sqrt(Math.pow(t[r][1], 2) + Math.pow(t[r][2], 2)), this.functions.push(new
|
|
627
|
-
else if (t[r][0] === "H") this.length += Math.abs(i[0] - t[r][1]), this.functions.push(new
|
|
628
|
-
else if (t[r][0] === "h") this.length += Math.abs(t[r][1]), this.functions.push(new
|
|
629
|
-
else if (t[r][0] === "V") this.length += Math.abs(i[1] - t[r][1]), this.functions.push(new
|
|
630
|
-
else if (t[r][0] === "v") this.length += Math.abs(t[r][1]), this.functions.push(new
|
|
631
|
-
else if (t[r][0] === "z" || t[r][0] === "Z") this.length += Math.sqrt(Math.pow(s[0] - i[0], 2) + Math.pow(s[1] - i[1], 2)), this.functions.push(new
|
|
632
|
-
else if (t[r][0] === "C") o = new
|
|
633
|
-
else if (t[r][0] === "c") o = new
|
|
626
|
+
else if (t[r][0] === "L") this.length += Math.sqrt(Math.pow(i[0] - t[r][1], 2) + Math.pow(i[1] - t[r][2], 2)), this.functions.push(new Q(i[0], t[r][1], i[1], t[r][2])), i = [t[r][1], t[r][2]];
|
|
627
|
+
else if (t[r][0] === "l") this.length += Math.sqrt(Math.pow(t[r][1], 2) + Math.pow(t[r][2], 2)), this.functions.push(new Q(i[0], t[r][1] + i[0], i[1], t[r][2] + i[1])), i = [t[r][1] + i[0], t[r][2] + i[1]];
|
|
628
|
+
else if (t[r][0] === "H") this.length += Math.abs(i[0] - t[r][1]), this.functions.push(new Q(i[0], t[r][1], i[1], i[1])), i[0] = t[r][1];
|
|
629
|
+
else if (t[r][0] === "h") this.length += Math.abs(t[r][1]), this.functions.push(new Q(i[0], i[0] + t[r][1], i[1], i[1])), i[0] = t[r][1] + i[0];
|
|
630
|
+
else if (t[r][0] === "V") this.length += Math.abs(i[1] - t[r][1]), this.functions.push(new Q(i[0], i[0], i[1], t[r][1])), i[1] = t[r][1];
|
|
631
|
+
else if (t[r][0] === "v") this.length += Math.abs(t[r][1]), this.functions.push(new Q(i[0], i[0], i[1], i[1] + t[r][1])), i[1] = t[r][1] + i[1];
|
|
632
|
+
else if (t[r][0] === "z" || t[r][0] === "Z") this.length += Math.sqrt(Math.pow(s[0] - i[0], 2) + Math.pow(s[1] - i[1], 2)), this.functions.push(new Q(i[0], s[0], i[1], s[1])), i = [s[0], s[1]];
|
|
633
|
+
else if (t[r][0] === "C") o = new h0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4], t[r][5], t[r][6]), this.length += o.getTotalLength(), i = [t[r][5], t[r][6]], this.functions.push(o);
|
|
634
|
+
else if (t[r][0] === "c") o = new h0(i[0], i[1], i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4], i[0] + t[r][5], i[1] + t[r][6]), o.getTotalLength() > 0 ? (this.length += o.getTotalLength(), this.functions.push(o), i = [t[r][5] + i[0], t[r][6] + i[1]]) : this.functions.push(new Q(i[0], i[0], i[1], i[1]));
|
|
634
635
|
else if (t[r][0] === "S") {
|
|
635
636
|
if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
|
|
636
637
|
if (o) {
|
|
637
638
|
const h = o.getC();
|
|
638
|
-
o = new
|
|
639
|
+
o = new h0(i[0], i[1], 2 * i[0] - h.x, 2 * i[1] - h.y, t[r][1], t[r][2], t[r][3], t[r][4]);
|
|
639
640
|
}
|
|
640
|
-
} else o = new
|
|
641
|
+
} else o = new h0(i[0], i[1], i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4]);
|
|
641
642
|
o && (this.length += o.getTotalLength(), i = [t[r][3], t[r][4]], this.functions.push(o));
|
|
642
643
|
} else if (t[r][0] === "s") {
|
|
643
644
|
if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
|
|
644
645
|
if (o) {
|
|
645
646
|
const h = o.getC(), c = o.getD();
|
|
646
|
-
o = new
|
|
647
|
+
o = new h0(i[0], i[1], i[0] + c.x - h.x, i[1] + c.y - h.y, i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4]);
|
|
647
648
|
}
|
|
648
|
-
} else o = new
|
|
649
|
+
} else o = new h0(i[0], i[1], i[0], i[1], i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4]);
|
|
649
650
|
o && (this.length += o.getTotalLength(), i = [t[r][3] + i[0], t[r][4] + i[1]], this.functions.push(o));
|
|
650
651
|
} else if (t[r][0] === "Q") {
|
|
651
652
|
if (i[0] === t[r][1] && i[1] === t[r][2]) {
|
|
652
|
-
const h = new
|
|
653
|
+
const h = new Q(t[r][1], t[r][3], t[r][2], t[r][4]);
|
|
653
654
|
this.length += h.getTotalLength(), this.functions.push(h);
|
|
654
|
-
} else o = new
|
|
655
|
+
} else o = new h0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4], void 0, void 0), this.length += o.getTotalLength(), this.functions.push(o);
|
|
655
656
|
i = [t[r][3], t[r][4]], a = [t[r][1], t[r][2]];
|
|
656
657
|
} else if (t[r][0] === "q") {
|
|
657
|
-
if (t[r][1] !== 0 || t[r][2] !== 0) o = new
|
|
658
|
+
if (t[r][1] !== 0 || t[r][2] !== 0) o = new h0(i[0], i[1], i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4], void 0, void 0), this.length += o.getTotalLength(), this.functions.push(o);
|
|
658
659
|
else {
|
|
659
|
-
const h = new
|
|
660
|
+
const h = new Q(i[0] + t[r][1], i[0] + t[r][3], i[1] + t[r][2], i[1] + t[r][4]);
|
|
660
661
|
this.length += h.getTotalLength(), this.functions.push(h);
|
|
661
662
|
}
|
|
662
663
|
a = [i[0] + t[r][1], i[1] + t[r][2]], i = [t[r][3] + i[0], t[r][4] + i[1]];
|
|
663
664
|
} else if (t[r][0] === "T") {
|
|
664
|
-
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new
|
|
665
|
+
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new h0(i[0], i[1], 2 * i[0] - a[0], 2 * i[1] - a[1], t[r][1], t[r][2], void 0, void 0), this.functions.push(o), this.length += o.getTotalLength();
|
|
665
666
|
else {
|
|
666
|
-
const h = new
|
|
667
|
+
const h = new Q(i[0], t[r][1], i[1], t[r][2]);
|
|
667
668
|
this.functions.push(h), this.length += h.getTotalLength();
|
|
668
669
|
}
|
|
669
670
|
a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1], t[r][2]];
|
|
670
671
|
} else if (t[r][0] === "t") {
|
|
671
|
-
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new
|
|
672
|
+
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new h0(i[0], i[1], 2 * i[0] - a[0], 2 * i[1] - a[1], i[0] + t[r][1], i[1] + t[r][2], void 0, void 0), this.length += o.getTotalLength(), this.functions.push(o);
|
|
672
673
|
else {
|
|
673
|
-
const h = new
|
|
674
|
+
const h = new Q(i[0], i[0] + t[r][1], i[1], i[1] + t[r][2]);
|
|
674
675
|
this.length += h.getTotalLength(), this.functions.push(h);
|
|
675
676
|
}
|
|
676
677
|
a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1] + i[0], t[r][2] + i[1]];
|
|
677
678
|
} else if (t[r][0] === "A") {
|
|
678
|
-
const h = new
|
|
679
|
+
const h = new at(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, t[r][6], t[r][7]);
|
|
679
680
|
this.length += h.getTotalLength(), i = [t[r][6], t[r][7]], this.functions.push(h);
|
|
680
681
|
} else if (t[r][0] === "a") {
|
|
681
|
-
const h = new
|
|
682
|
+
const h = new at(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, i[0] + t[r][6], i[1] + t[r][7]);
|
|
682
683
|
this.length += h.getTotalLength(), i = [i[0] + t[r][6], i[1] + t[r][7]], this.functions.push(h);
|
|
683
684
|
}
|
|
684
685
|
this.partial_lengths.push(this.length);
|
|
685
686
|
}
|
|
686
687
|
}
|
|
687
|
-
},
|
|
688
|
+
}, k(b0, "SVGPathProperties"), b0), M0, X0 = (M0 = class {
|
|
688
689
|
constructor(e) {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
if (this.inst = new
|
|
696
|
-
}
|
|
697
|
-
},
|
|
698
|
-
function
|
|
690
|
+
I(this, "inst");
|
|
691
|
+
I(this, "getTotalLength", k(() => this.inst.getTotalLength(), "getTotalLength"));
|
|
692
|
+
I(this, "getPointAtLength", k((e) => this.inst.getPointAtLength(e), "getPointAtLength"));
|
|
693
|
+
I(this, "getTangentAtLength", k((e) => this.inst.getTangentAtLength(e), "getTangentAtLength"));
|
|
694
|
+
I(this, "getPropertiesAtLength", k((e) => this.inst.getPropertiesAtLength(e), "getPropertiesAtLength"));
|
|
695
|
+
I(this, "getParts", k(() => this.inst.getParts(), "getParts"));
|
|
696
|
+
if (this.inst = new f1(e), !(this instanceof X0)) return new X0(e);
|
|
697
|
+
}
|
|
698
|
+
}, k(M0, "_svgPathProperties"), M0);
|
|
699
|
+
function g1(n = W.BLACK) {
|
|
699
700
|
return { ...n, alpha: 0 };
|
|
700
701
|
}
|
|
701
|
-
function
|
|
702
|
-
const { path: e, height: t = 100, width: o = 100, viewboxHeight: i, viewboxWidth: a, ...s } = n ?? {}, r = e ?? "M 0 0 L 100 100", c = new
|
|
703
|
-
return
|
|
704
|
-
objectType:
|
|
705
|
-
anchor:
|
|
702
|
+
function bn(n = null) {
|
|
703
|
+
const { path: e, height: t = 100, width: o = 100, viewboxHeight: i, viewboxWidth: a, ...s } = n ?? {}, r = e ?? "M 0 0 L 100 100", c = new X0(r).getTotalLength();
|
|
704
|
+
return s0({
|
|
705
|
+
objectType: j.PATH,
|
|
706
|
+
anchor: o0,
|
|
706
707
|
color: K,
|
|
707
708
|
drawn: 1,
|
|
708
|
-
fill:
|
|
709
|
+
fill: g1(),
|
|
709
710
|
isRounded: !1,
|
|
710
711
|
height: t,
|
|
711
712
|
path: r,
|
|
@@ -719,9 +720,9 @@ function yn(n = null) {
|
|
|
719
720
|
...s
|
|
720
721
|
});
|
|
721
722
|
}
|
|
722
|
-
function
|
|
723
|
-
return
|
|
724
|
-
objectType:
|
|
723
|
+
function Mn(n = null) {
|
|
724
|
+
return s0({
|
|
725
|
+
objectType: j.POLYGON,
|
|
725
726
|
borderColor: K,
|
|
726
727
|
borderWidth: 0,
|
|
727
728
|
drawn: 1,
|
|
@@ -734,10 +735,10 @@ function vn(n = null) {
|
|
|
734
735
|
...n
|
|
735
736
|
});
|
|
736
737
|
}
|
|
737
|
-
function
|
|
738
|
-
return
|
|
739
|
-
objectType:
|
|
740
|
-
anchor:
|
|
738
|
+
function Ln(n = null) {
|
|
739
|
+
return s0({
|
|
740
|
+
objectType: j.RECTANGLE,
|
|
741
|
+
anchor: o0,
|
|
741
742
|
borderColor: K,
|
|
742
743
|
borderWidth: 0,
|
|
743
744
|
drawn: 1,
|
|
@@ -750,11 +751,23 @@ function wn(n = null) {
|
|
|
750
751
|
...n
|
|
751
752
|
});
|
|
752
753
|
}
|
|
753
|
-
|
|
754
|
+
function Tn(n = null) {
|
|
755
|
+
return s0({
|
|
756
|
+
objectType: j.SVG,
|
|
757
|
+
anchor: o0,
|
|
758
|
+
height: 100,
|
|
759
|
+
svg: "",
|
|
760
|
+
width: 100,
|
|
761
|
+
x: 0,
|
|
762
|
+
y: 0,
|
|
763
|
+
...n
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
const p1 = {
|
|
754
767
|
NORMAL: "normal",
|
|
755
768
|
ITALIC: "italic",
|
|
756
769
|
OBLIQUE: "oblique"
|
|
757
|
-
},
|
|
770
|
+
}, d1 = p1.NORMAL, x1 = {
|
|
758
771
|
THIN: 100,
|
|
759
772
|
EXTRA_LIGHT: 200,
|
|
760
773
|
LIGHT: 300,
|
|
@@ -764,130 +777,130 @@ const f1 = {
|
|
|
764
777
|
BOLD: 700,
|
|
765
778
|
EXTRA_BOLD: 800,
|
|
766
779
|
BLACK: 900
|
|
767
|
-
},
|
|
780
|
+
}, y1 = x1.NORMAL, v1 = {
|
|
768
781
|
color: K,
|
|
769
782
|
fontFamily: "sans-serif",
|
|
770
783
|
fontSize: 100,
|
|
771
|
-
fontStyle:
|
|
772
|
-
fontWeight:
|
|
784
|
+
fontStyle: d1,
|
|
785
|
+
fontWeight: y1,
|
|
773
786
|
ligatures: !1
|
|
774
787
|
};
|
|
775
|
-
function
|
|
788
|
+
function kt(n) {
|
|
776
789
|
return typeof n == "string" ? [[{ text: n }]] : n.map((e) => e.map((t) => typeof t == "string" ? { text: t } : t));
|
|
777
790
|
}
|
|
778
|
-
function
|
|
779
|
-
return
|
|
791
|
+
function w1(n) {
|
|
792
|
+
return kt(n).reduce(
|
|
780
793
|
(t, o) => t + o.reduce((i, a) => i + a.text.length, 0),
|
|
781
794
|
0
|
|
782
795
|
);
|
|
783
796
|
}
|
|
784
|
-
function
|
|
785
|
-
return
|
|
786
|
-
objectType:
|
|
797
|
+
function m1(n = "", e = null) {
|
|
798
|
+
return s0({
|
|
799
|
+
objectType: j.TEXT,
|
|
787
800
|
alignment: Yt,
|
|
788
|
-
anchor:
|
|
801
|
+
anchor: o0,
|
|
789
802
|
length: null,
|
|
790
803
|
lineSpacing: 1,
|
|
791
804
|
text: n,
|
|
792
805
|
x: 0,
|
|
793
806
|
y: 0,
|
|
794
|
-
...
|
|
807
|
+
...v1,
|
|
795
808
|
...e
|
|
796
809
|
});
|
|
797
810
|
}
|
|
798
|
-
|
|
811
|
+
m1.writeOn = (n, e = {}) => et(
|
|
799
812
|
n,
|
|
800
813
|
{
|
|
801
|
-
length:
|
|
814
|
+
length: w1(n.text)
|
|
802
815
|
},
|
|
803
816
|
e
|
|
804
817
|
);
|
|
805
|
-
let
|
|
806
|
-
function
|
|
807
|
-
if (
|
|
808
|
-
|
|
818
|
+
let Z = null;
|
|
819
|
+
function A1({ presentation: n, onNavigateToSlide: e }) {
|
|
820
|
+
if (Z !== null && !Z.closed) {
|
|
821
|
+
Z.focus();
|
|
809
822
|
return;
|
|
810
823
|
}
|
|
811
|
-
if (
|
|
824
|
+
if (Z = window.open("", "Navigator", "width=300,height=500,left=20,top=50"), Z === null) {
|
|
812
825
|
console.error("Failed to open navigator window.");
|
|
813
826
|
return;
|
|
814
827
|
}
|
|
815
|
-
const t =
|
|
816
|
-
|
|
817
|
-
(o.key === "Escape" || o.key === "`") && (
|
|
828
|
+
const t = b1(n, e);
|
|
829
|
+
Z.document.title = n.title, Z.document.body.appendChild(t), Z.addEventListener("keyup", (o) => {
|
|
830
|
+
(o.key === "Escape" || o.key === "`") && (Z == null || Z.close(), Z = null);
|
|
818
831
|
});
|
|
819
832
|
}
|
|
820
|
-
function
|
|
833
|
+
function b1(n, e) {
|
|
821
834
|
const t = document.createElement("div");
|
|
822
835
|
return t.style.fontFamily = "Arial, sans-serif", n.slides.forEach((o, i) => {
|
|
823
|
-
const a =
|
|
836
|
+
const a = M1(o, i);
|
|
824
837
|
a.style.cursor = "pointer", a.addEventListener("click", (s) => {
|
|
825
|
-
s.shiftKey && (
|
|
838
|
+
s.shiftKey && (Z == null || Z.close()), e(i);
|
|
826
839
|
}), t.appendChild(a);
|
|
827
840
|
}), t;
|
|
828
841
|
}
|
|
829
|
-
function
|
|
842
|
+
function M1(n, e) {
|
|
830
843
|
const t = document.createElement("div");
|
|
831
844
|
return t.style.marginBottom = "8px", t.style.padding = "8px", t.style.backgroundColor = "#eceed7", t.style.borderRadius = "4px", t.style.userSelect = "none", t.innerHTML = `${e + 1}: ` + (n.title.length > 0 ? n.title : `Slide ${e + 1}`), t;
|
|
832
845
|
}
|
|
833
|
-
function
|
|
846
|
+
function i0(n = null) {
|
|
834
847
|
return {
|
|
835
848
|
height: 0,
|
|
836
849
|
width: 0,
|
|
837
850
|
...n
|
|
838
851
|
};
|
|
839
852
|
}
|
|
840
|
-
const
|
|
841
|
-
function
|
|
853
|
+
const L1 = i0({ width: 0, height: 0 });
|
|
854
|
+
function T1(n = null) {
|
|
842
855
|
return {
|
|
843
|
-
backgroundColor:
|
|
856
|
+
backgroundColor: W.WHITE,
|
|
844
857
|
slides: [],
|
|
845
858
|
title: "Presentation",
|
|
846
|
-
size:
|
|
859
|
+
size: i0({ width: 3840, height: 2160 }),
|
|
847
860
|
resources: {
|
|
848
861
|
images: {}
|
|
849
862
|
},
|
|
850
863
|
...n
|
|
851
864
|
};
|
|
852
865
|
}
|
|
853
|
-
function
|
|
866
|
+
function P1(n) {
|
|
854
867
|
const e = Array.isArray(n) ? n : [n];
|
|
855
868
|
let t = 0, o = 0;
|
|
856
869
|
for (const i of e)
|
|
857
870
|
switch (i.type) {
|
|
858
|
-
case
|
|
871
|
+
case u0.PAUSE:
|
|
859
872
|
t += i.duration;
|
|
860
873
|
break;
|
|
861
|
-
case
|
|
874
|
+
case u0.ANIMATE:
|
|
862
875
|
o = Math.max(o, t + i.delay + i.duration), i.block && (t += i.delay + i.duration);
|
|
863
876
|
break;
|
|
864
|
-
case
|
|
877
|
+
case u0.UPDATE:
|
|
865
878
|
break;
|
|
866
879
|
default:
|
|
867
|
-
|
|
880
|
+
r0(i);
|
|
868
881
|
}
|
|
869
882
|
return o;
|
|
870
883
|
}
|
|
871
884
|
function nt(n, e = null) {
|
|
872
|
-
const { red: t, green: o, blue: i } = n, a =
|
|
885
|
+
const { red: t, green: o, blue: i } = n, a = St(n, e);
|
|
873
886
|
return `rgba(${t}, ${o}, ${i}, ${a})`;
|
|
874
887
|
}
|
|
875
|
-
function
|
|
888
|
+
function C1(n) {
|
|
876
889
|
return n === document.body;
|
|
877
890
|
}
|
|
878
|
-
function
|
|
891
|
+
function E1(n, e) {
|
|
879
892
|
const t = document.createElement("div");
|
|
880
|
-
if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative", t.style.top = "50%", t.style.transform = "translateY(-50%)", t.style.marginLeft = "auto", t.style.marginRight = "auto",
|
|
893
|
+
if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative", t.style.top = "50%", t.style.transform = "translateY(-50%)", t.style.marginLeft = "auto", t.style.marginRight = "auto", C1(e)) {
|
|
881
894
|
t.style.overflowY = "clip", document.title = n.title, document.documentElement.style.height = "100%", document.body.style.margin = "0", document.body.style.height = "100%", document.body.style.width = "100%", document.body.style.backgroundColor = "#000000";
|
|
882
895
|
const o = n.size.height / n.size.width;
|
|
883
|
-
|
|
896
|
+
ut(t, o), window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change", () => ut(t, o));
|
|
884
897
|
}
|
|
885
898
|
return t;
|
|
886
899
|
}
|
|
887
|
-
function
|
|
900
|
+
function ut(n, e) {
|
|
888
901
|
window.innerHeight / window.innerWidth > e ? (n.style.width = "100%", n.style.height = "auto") : (n.style.width = "auto", n.style.height = "100%");
|
|
889
902
|
}
|
|
890
|
-
const
|
|
903
|
+
const S1 = {
|
|
891
904
|
check: (n) => typeof n == "object" && n !== null && typeof n.red == "number" && typeof n.green == "number" && typeof n.blue == "number" && typeof n.alpha == "number",
|
|
892
905
|
interpolate: (n, e, t) => ({
|
|
893
906
|
red: Math.round(n.red + (e.red - n.red) * t),
|
|
@@ -895,23 +908,23 @@ const C1 = {
|
|
|
895
908
|
blue: Math.round(n.blue + (e.blue - n.blue) * t),
|
|
896
909
|
alpha: n.alpha + (e.alpha - n.alpha) * t
|
|
897
910
|
})
|
|
898
|
-
},
|
|
911
|
+
}, I1 = {
|
|
899
912
|
check: (n) => !0,
|
|
900
913
|
interpolate: (n, e) => e
|
|
901
|
-
},
|
|
914
|
+
}, _1 = {
|
|
902
915
|
check: (n) => typeof n == "number",
|
|
903
916
|
interpolate: (n, e, t) => n + (e - n) * t
|
|
904
|
-
},
|
|
917
|
+
}, ft = [
|
|
918
|
+
_1,
|
|
905
919
|
S1,
|
|
906
|
-
|
|
907
|
-
E1
|
|
920
|
+
I1
|
|
908
921
|
];
|
|
909
|
-
function
|
|
922
|
+
function k1(n, e, t, o = null) {
|
|
910
923
|
if (t === 0)
|
|
911
924
|
return n;
|
|
912
925
|
if (t === 1)
|
|
913
926
|
return { ...n, ...e };
|
|
914
|
-
const i = o != null ? [...o, ...
|
|
927
|
+
const i = o != null ? [...o, ...ft] : ft, a = {};
|
|
915
928
|
for (const s in e) {
|
|
916
929
|
const r = n[s], h = e[s];
|
|
917
930
|
for (const c of i)
|
|
@@ -926,7 +939,7 @@ function _1(n, e, t, o = null) {
|
|
|
926
939
|
}
|
|
927
940
|
return { ...n, ...a };
|
|
928
941
|
}
|
|
929
|
-
function
|
|
942
|
+
function gt(n, e, t = null) {
|
|
930
943
|
if (e === null)
|
|
931
944
|
return;
|
|
932
945
|
const o = Array.isArray(e) ? e : [e];
|
|
@@ -935,7 +948,7 @@ function ft(n, e, t = null) {
|
|
|
935
948
|
if (t !== null && i > t)
|
|
936
949
|
break;
|
|
937
950
|
switch (a.type) {
|
|
938
|
-
case
|
|
951
|
+
case u0.ANIMATE: {
|
|
939
952
|
const s = n.get(a.object);
|
|
940
953
|
if (s === void 0)
|
|
941
954
|
break;
|
|
@@ -948,7 +961,7 @@ function ft(n, e, t = null) {
|
|
|
948
961
|
);
|
|
949
962
|
n.set(a.object, {
|
|
950
963
|
...s,
|
|
951
|
-
...
|
|
964
|
+
...k1(
|
|
952
965
|
s,
|
|
953
966
|
a.props,
|
|
954
967
|
a.easing(h),
|
|
@@ -957,7 +970,7 @@ function ft(n, e, t = null) {
|
|
|
957
970
|
}), a.block && (i += a.delay + a.duration);
|
|
958
971
|
break;
|
|
959
972
|
}
|
|
960
|
-
case
|
|
973
|
+
case u0.UPDATE: {
|
|
961
974
|
const s = n.get(a.object);
|
|
962
975
|
if (s === void 0)
|
|
963
976
|
break;
|
|
@@ -967,15 +980,15 @@ function ft(n, e, t = null) {
|
|
|
967
980
|
});
|
|
968
981
|
break;
|
|
969
982
|
}
|
|
970
|
-
case
|
|
983
|
+
case u0.PAUSE:
|
|
971
984
|
i += a.duration;
|
|
972
985
|
break;
|
|
973
986
|
default:
|
|
974
|
-
|
|
987
|
+
r0(a);
|
|
975
988
|
}
|
|
976
989
|
}
|
|
977
990
|
}
|
|
978
|
-
function
|
|
991
|
+
function Ot(n) {
|
|
979
992
|
return "objects" in n ? n.objects.filter((e) => "objectType" in e) : [];
|
|
980
993
|
}
|
|
981
994
|
function O1({
|
|
@@ -986,7 +999,7 @@ function O1({
|
|
|
986
999
|
const o = /* @__PURE__ */ new Map();
|
|
987
1000
|
function i(s) {
|
|
988
1001
|
o.set(s, s);
|
|
989
|
-
for (const r of
|
|
1002
|
+
for (const r of Ot(s))
|
|
990
1003
|
i(r);
|
|
991
1004
|
}
|
|
992
1005
|
for (const s of n.objects)
|
|
@@ -994,15 +1007,31 @@ function O1({
|
|
|
994
1007
|
const a = t === null ? e : e - 1;
|
|
995
1008
|
for (let s = 0; s < a; s++) {
|
|
996
1009
|
const r = n.animations[s] ?? null;
|
|
997
|
-
|
|
1010
|
+
gt(o, r);
|
|
998
1011
|
}
|
|
999
1012
|
if (t !== null && e > 0) {
|
|
1000
1013
|
const s = n.animations[e - 1] ?? null;
|
|
1001
|
-
|
|
1014
|
+
gt(o, s, t);
|
|
1002
1015
|
}
|
|
1003
1016
|
return o;
|
|
1004
1017
|
}
|
|
1005
|
-
function
|
|
1018
|
+
function F1(n) {
|
|
1019
|
+
const e = {};
|
|
1020
|
+
function t(o) {
|
|
1021
|
+
if (o.objectType === j.SVG) {
|
|
1022
|
+
const a = o.svg;
|
|
1023
|
+
a !== void 0 && a.length > 0 && (e[a] = a);
|
|
1024
|
+
}
|
|
1025
|
+
const i = Ot(o);
|
|
1026
|
+
for (const a of i)
|
|
1027
|
+
t(a);
|
|
1028
|
+
}
|
|
1029
|
+
for (const o of n.slides)
|
|
1030
|
+
for (const i of o.objects)
|
|
1031
|
+
t(i);
|
|
1032
|
+
return e;
|
|
1033
|
+
}
|
|
1034
|
+
function R1(n) {
|
|
1006
1035
|
var o;
|
|
1007
1036
|
const { slides: e } = n, t = {
|
|
1008
1037
|
// First build of first slide
|
|
@@ -1020,20 +1049,20 @@ function k1(n) {
|
|
|
1020
1049
|
if (a === void 0)
|
|
1021
1050
|
continue;
|
|
1022
1051
|
const s = a.shortcut;
|
|
1023
|
-
|
|
1052
|
+
N0(t, s, i, 0);
|
|
1024
1053
|
for (let r = 0; r < a.animations.length; r++) {
|
|
1025
1054
|
const h = a.animations[r];
|
|
1026
1055
|
if (h !== void 0)
|
|
1027
1056
|
if (Array.isArray(h))
|
|
1028
1057
|
for (const c of h)
|
|
1029
|
-
|
|
1058
|
+
N0(t, c.shortcut, i, r + 1);
|
|
1030
1059
|
else
|
|
1031
|
-
|
|
1060
|
+
N0(t, h.shortcut, i, r + 1);
|
|
1032
1061
|
}
|
|
1033
1062
|
}
|
|
1034
1063
|
return t;
|
|
1035
1064
|
}
|
|
1036
|
-
function
|
|
1065
|
+
function N0(n, e, t, o) {
|
|
1037
1066
|
if (e !== null)
|
|
1038
1067
|
if (Array.isArray(e))
|
|
1039
1068
|
for (const i of e)
|
|
@@ -1041,8 +1070,8 @@ function R0(n, e, t, o) {
|
|
|
1041
1070
|
else
|
|
1042
1071
|
n[e] = { slideIndex: t, buildIndex: o };
|
|
1043
1072
|
}
|
|
1044
|
-
function
|
|
1045
|
-
t.shortcuts =
|
|
1073
|
+
function N1(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigator: s }) {
|
|
1074
|
+
t.shortcuts = R1(n), e.addEventListener("mousemove", () => {
|
|
1046
1075
|
e.style.cursor = "auto";
|
|
1047
1076
|
}), e.addEventListener("keyup", (r) => {
|
|
1048
1077
|
if (r.code === "Escape") {
|
|
@@ -1077,38 +1106,38 @@ function F1(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigat
|
|
|
1077
1106
|
}
|
|
1078
1107
|
});
|
|
1079
1108
|
}
|
|
1080
|
-
const
|
|
1081
|
-
function
|
|
1082
|
-
const t = localStorage.getItem(
|
|
1109
|
+
const d0 = "presenterState";
|
|
1110
|
+
function q1(n, e) {
|
|
1111
|
+
const t = localStorage.getItem(d0);
|
|
1083
1112
|
if (t === null)
|
|
1084
1113
|
return null;
|
|
1085
1114
|
if (e === null)
|
|
1086
|
-
return localStorage.removeItem(
|
|
1115
|
+
return localStorage.removeItem(d0), null;
|
|
1087
1116
|
let o;
|
|
1088
1117
|
try {
|
|
1089
1118
|
o = JSON.parse(t);
|
|
1090
1119
|
} catch (c) {
|
|
1091
|
-
return console.error("Failed to parse presentation state from localStorage:", c), localStorage.removeItem(
|
|
1120
|
+
return console.error("Failed to parse presentation state from localStorage:", c), localStorage.removeItem(d0), null;
|
|
1092
1121
|
}
|
|
1093
1122
|
const { title: i, timestamp: a } = o;
|
|
1094
1123
|
let { slideIndex: s, buildIndex: r } = o;
|
|
1095
1124
|
if (typeof i != "string" || typeof s != "number" || typeof r != "number" || typeof a != "number" || i !== n.title || Date.now() - a > 1e3 * 60 * e)
|
|
1096
|
-
return localStorage.removeItem(
|
|
1125
|
+
return localStorage.removeItem(d0), null;
|
|
1097
1126
|
s > n.slides.length - 1 && (s = n.slides.length - 1, r = 0);
|
|
1098
1127
|
const h = n.slides[s];
|
|
1099
|
-
return h === void 0 ? (localStorage.removeItem(
|
|
1128
|
+
return h === void 0 ? (localStorage.removeItem(d0), null) : (r > h.animations.length && (r = h.animations.length), {
|
|
1100
1129
|
title: i,
|
|
1101
1130
|
slideIndex: s,
|
|
1102
1131
|
buildIndex: r
|
|
1103
1132
|
});
|
|
1104
1133
|
}
|
|
1105
|
-
function
|
|
1134
|
+
function B1({ title: n, slideIndex: e, buildIndex: t }) {
|
|
1106
1135
|
localStorage.setItem(
|
|
1107
|
-
|
|
1136
|
+
d0,
|
|
1108
1137
|
JSON.stringify({ title: n, slideIndex: e, buildIndex: t, timestamp: Date.now() })
|
|
1109
1138
|
);
|
|
1110
1139
|
}
|
|
1111
|
-
const
|
|
1140
|
+
const pt = Object.freeze({
|
|
1112
1141
|
canvas: null,
|
|
1113
1142
|
extrasContainer: null,
|
|
1114
1143
|
mountedExtrasCleanups: [],
|
|
@@ -1121,49 +1150,49 @@ const gt = Object.freeze({
|
|
|
1121
1150
|
textCommand: null,
|
|
1122
1151
|
shortcuts: {}
|
|
1123
1152
|
}
|
|
1124
|
-
}),
|
|
1153
|
+
}), V = {
|
|
1125
1154
|
Browser: "browser",
|
|
1126
1155
|
Node: "node"
|
|
1127
1156
|
};
|
|
1128
|
-
function
|
|
1157
|
+
function D1(n, e) {
|
|
1129
1158
|
e.context.clearRect(0, 0, n.width, n.height);
|
|
1130
1159
|
}
|
|
1131
|
-
function
|
|
1160
|
+
function j1(n) {
|
|
1132
1161
|
const e = document.createElement("canvas");
|
|
1133
1162
|
return e.setAttribute("width", n.width.toString()), e.setAttribute("height", n.height.toString()), e.style.position = "absolute", e.style.width = "100%", e;
|
|
1134
1163
|
}
|
|
1135
|
-
const
|
|
1164
|
+
const f0 = {
|
|
1136
1165
|
Browser: "browser",
|
|
1137
1166
|
Node: "node"
|
|
1138
1167
|
};
|
|
1139
|
-
function
|
|
1168
|
+
function z1(n) {
|
|
1140
1169
|
const e = new Path2D(n);
|
|
1141
1170
|
return {
|
|
1142
|
-
type:
|
|
1171
|
+
type: f0.Browser,
|
|
1143
1172
|
path: e
|
|
1144
1173
|
};
|
|
1145
1174
|
}
|
|
1146
|
-
function
|
|
1147
|
-
const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: h } = n, c = { x: t, y: o }, f = { x: i, y: a }, x = Math.atan2(f.y - c.y, f.x - c.x), l = { x: c.x + (f.x - c.x) / 2, y: c.y + (f.y - c.y) / 2 }, u = f.x - c.x,
|
|
1175
|
+
function U1(n) {
|
|
1176
|
+
const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: h } = n, c = { x: t, y: o }, f = { x: i, y: a }, x = Math.atan2(f.y - c.y, f.x - c.x), l = { x: c.x + (f.x - c.x) / 2, y: c.y + (f.y - c.y) / 2 }, u = f.x - c.x, m = f.y - c.y, M = Math.hypot(u, m) * e, C = Math.cos(x), E = Math.sin(x), L = h ? { x: l.x - C * M / 2, y: l.y - E * M / 2 } : c, S = h ? { x: l.x + C * M / 2, y: l.y + E * M / 2 } : { x: c.x + C * M, y: c.y + E * M }, P = r ? Math.PI / 6 : Math.PI / 4.5, F = M < s * 2 ? M / 2 : s, H = {
|
|
1148
1177
|
x: S.x - F * Math.cos(x - P),
|
|
1149
1178
|
y: S.y - F * Math.sin(x - P)
|
|
1150
|
-
},
|
|
1179
|
+
}, X = {
|
|
1151
1180
|
x: S.x - F * Math.cos(x + P),
|
|
1152
1181
|
y: S.y - F * Math.sin(x + P)
|
|
1153
|
-
},
|
|
1182
|
+
}, z = {
|
|
1154
1183
|
x: L.x + F * Math.cos(x - P),
|
|
1155
1184
|
y: L.y + F * Math.sin(x - P)
|
|
1156
|
-
},
|
|
1185
|
+
}, G = {
|
|
1157
1186
|
x: L.x + F * Math.cos(x + P),
|
|
1158
1187
|
y: L.y + F * Math.sin(x + P)
|
|
1159
1188
|
};
|
|
1160
1189
|
return {
|
|
1161
1190
|
arrowPoints: [L, S],
|
|
1162
|
-
arrowheadPoints: [
|
|
1163
|
-
doubledArrowheadPoints: [
|
|
1191
|
+
arrowheadPoints: [H, S, X],
|
|
1192
|
+
doubledArrowheadPoints: [z, L, G]
|
|
1164
1193
|
};
|
|
1165
1194
|
}
|
|
1166
|
-
function
|
|
1195
|
+
function y0({
|
|
1167
1196
|
ctx: n,
|
|
1168
1197
|
color: e,
|
|
1169
1198
|
drawn: t = null,
|
|
@@ -1190,31 +1219,31 @@ function p0({
|
|
|
1190
1219
|
return;
|
|
1191
1220
|
}
|
|
1192
1221
|
switch (n.type) {
|
|
1193
|
-
case
|
|
1194
|
-
s.type ===
|
|
1222
|
+
case V.Browser:
|
|
1223
|
+
s.type === f0.Browser ? n.context.stroke(s.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1195
1224
|
break;
|
|
1196
|
-
case
|
|
1197
|
-
s.type ===
|
|
1225
|
+
case V.Node:
|
|
1226
|
+
s.type === f0.Node ? n.context.stroke(s.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1198
1227
|
break;
|
|
1199
1228
|
default:
|
|
1200
|
-
|
|
1229
|
+
r0(n);
|
|
1201
1230
|
}
|
|
1202
1231
|
}
|
|
1203
1232
|
}
|
|
1204
|
-
function
|
|
1233
|
+
function v0({ ctx: n, path: e, color: t, opacity: o = null }) {
|
|
1205
1234
|
if (n.context.fillStyle = nt(t, o), e === void 0) {
|
|
1206
1235
|
n.context.fill();
|
|
1207
1236
|
return;
|
|
1208
1237
|
}
|
|
1209
1238
|
switch (n.type) {
|
|
1210
|
-
case
|
|
1211
|
-
e.type ===
|
|
1239
|
+
case V.Browser:
|
|
1240
|
+
e.type === f0.Browser ? n.context.fill(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1212
1241
|
break;
|
|
1213
|
-
case
|
|
1214
|
-
e.type ===
|
|
1242
|
+
case V.Node:
|
|
1243
|
+
e.type === f0.Node ? n.context.fill(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1215
1244
|
break;
|
|
1216
1245
|
default:
|
|
1217
|
-
|
|
1246
|
+
r0(n);
|
|
1218
1247
|
}
|
|
1219
1248
|
}
|
|
1220
1249
|
function q0(n, e) {
|
|
@@ -1232,7 +1261,7 @@ function q0(n, e) {
|
|
|
1232
1261
|
}
|
|
1233
1262
|
return { path: t, length: i };
|
|
1234
1263
|
}
|
|
1235
|
-
const
|
|
1264
|
+
const H1 = ({
|
|
1236
1265
|
ctx: n,
|
|
1237
1266
|
object: e,
|
|
1238
1267
|
opacity: t,
|
|
@@ -1241,19 +1270,19 @@ const U1 = ({
|
|
|
1241
1270
|
const i = e.opacity * t;
|
|
1242
1271
|
if (i === 0 || e.drawn === 0)
|
|
1243
1272
|
return;
|
|
1244
|
-
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } =
|
|
1245
|
-
if (
|
|
1273
|
+
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } = U1(e), { path: h } = q0(a, o), { path: c } = q0(s, o);
|
|
1274
|
+
if (y0({
|
|
1246
1275
|
color: e.color,
|
|
1247
1276
|
ctx: n,
|
|
1248
1277
|
path: h,
|
|
1249
1278
|
opacity: i,
|
|
1250
1279
|
width: e.width
|
|
1251
|
-
}), e.isArrowheadFilled && (c.path.closePath(),
|
|
1280
|
+
}), e.isArrowheadFilled && (c.path.closePath(), v0({
|
|
1252
1281
|
ctx: n,
|
|
1253
1282
|
path: c,
|
|
1254
1283
|
color: e.color,
|
|
1255
1284
|
opacity: i
|
|
1256
|
-
})),
|
|
1285
|
+
})), y0({
|
|
1257
1286
|
color: e.color,
|
|
1258
1287
|
ctx: n,
|
|
1259
1288
|
path: c,
|
|
@@ -1264,12 +1293,12 @@ const U1 = ({
|
|
|
1264
1293
|
r,
|
|
1265
1294
|
o
|
|
1266
1295
|
);
|
|
1267
|
-
e.isArrowheadFilled && (f.path.closePath(),
|
|
1296
|
+
e.isArrowheadFilled && (f.path.closePath(), v0({
|
|
1268
1297
|
ctx: n,
|
|
1269
1298
|
path: f,
|
|
1270
1299
|
color: e.color,
|
|
1271
1300
|
opacity: i
|
|
1272
|
-
})),
|
|
1301
|
+
})), y0({
|
|
1273
1302
|
color: e.color,
|
|
1274
1303
|
ctx: n,
|
|
1275
1304
|
path: f,
|
|
@@ -1278,13 +1307,32 @@ const U1 = ({
|
|
|
1278
1307
|
});
|
|
1279
1308
|
}
|
|
1280
1309
|
};
|
|
1281
|
-
function
|
|
1310
|
+
function G1(n, e) {
|
|
1311
|
+
const t = n.radius - n.borderWidth / 2;
|
|
1312
|
+
if (t <= 0)
|
|
1313
|
+
return;
|
|
1314
|
+
const o = e(), i = -Math.PI / 2;
|
|
1315
|
+
return o.path.arc(n.x, n.y, t, i, i + 2 * Math.PI), o;
|
|
1316
|
+
}
|
|
1317
|
+
function $1(n, e) {
|
|
1282
1318
|
const t = e(), o = -Math.PI / 2;
|
|
1283
1319
|
t.path.arc(n.x, n.y, n.radius, o, o + 2 * Math.PI);
|
|
1284
1320
|
const i = 2 * Math.PI * n.radius;
|
|
1285
1321
|
return { path: t, length: i };
|
|
1286
1322
|
}
|
|
1287
|
-
|
|
1323
|
+
function Ft(n, e) {
|
|
1324
|
+
switch (n.type) {
|
|
1325
|
+
case V.Browser:
|
|
1326
|
+
e.type === f0.Browser ? n.context.clip(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1327
|
+
break;
|
|
1328
|
+
case V.Node:
|
|
1329
|
+
e.type === f0.Node ? n.context.clip(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1330
|
+
break;
|
|
1331
|
+
default:
|
|
1332
|
+
r0(n);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
const W1 = ({
|
|
1288
1336
|
ctx: n,
|
|
1289
1337
|
object: e,
|
|
1290
1338
|
opacity: t,
|
|
@@ -1293,13 +1341,13 @@ const H1 = ({
|
|
|
1293
1341
|
const i = e.opacity * t;
|
|
1294
1342
|
if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
|
|
1295
1343
|
return;
|
|
1296
|
-
const { path: a, length: s } =
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
path: a,
|
|
1300
|
-
|
|
1301
|
-
opacity: i
|
|
1302
|
-
|
|
1344
|
+
const { path: a, length: s } = $1(e, o);
|
|
1345
|
+
if (i < 1 && e.borderWidth > 0) {
|
|
1346
|
+
const r = G1(e, o);
|
|
1347
|
+
r !== void 0 && (n.context.save(), Ft(n, r), v0({ ctx: n, path: a, color: e.fill, opacity: i }), n.context.restore());
|
|
1348
|
+
} else
|
|
1349
|
+
v0({ ctx: n, path: a, color: e.fill, opacity: i });
|
|
1350
|
+
y0({
|
|
1303
1351
|
color: e.borderColor,
|
|
1304
1352
|
ctx: n,
|
|
1305
1353
|
drawn: e.drawn,
|
|
@@ -1309,84 +1357,84 @@ const H1 = ({
|
|
|
1309
1357
|
width: e.borderWidth
|
|
1310
1358
|
});
|
|
1311
1359
|
};
|
|
1312
|
-
function
|
|
1360
|
+
function $(n = null) {
|
|
1313
1361
|
return {
|
|
1314
1362
|
x: 0,
|
|
1315
1363
|
y: 0,
|
|
1316
1364
|
...n
|
|
1317
1365
|
};
|
|
1318
1366
|
}
|
|
1319
|
-
const
|
|
1320
|
-
function
|
|
1367
|
+
const Y1 = $();
|
|
1368
|
+
function l0(n = null) {
|
|
1321
1369
|
return {
|
|
1322
|
-
origin:
|
|
1323
|
-
size:
|
|
1370
|
+
origin: Y1,
|
|
1371
|
+
size: L1,
|
|
1324
1372
|
...n
|
|
1325
1373
|
};
|
|
1326
1374
|
}
|
|
1327
|
-
|
|
1328
|
-
function
|
|
1375
|
+
l0();
|
|
1376
|
+
function g0(n, e, t) {
|
|
1329
1377
|
const { x: o, y: i } = n, { width: a, height: s } = t;
|
|
1330
1378
|
switch (e) {
|
|
1331
|
-
case
|
|
1332
|
-
return
|
|
1333
|
-
origin:
|
|
1379
|
+
case n0.TOP_LEFT:
|
|
1380
|
+
return l0({
|
|
1381
|
+
origin: $({ x: o, y: i }),
|
|
1334
1382
|
size: t
|
|
1335
1383
|
});
|
|
1336
|
-
case
|
|
1337
|
-
return
|
|
1338
|
-
origin:
|
|
1384
|
+
case n0.TOP:
|
|
1385
|
+
return l0({
|
|
1386
|
+
origin: $({ x: o - a / 2, y: i }),
|
|
1339
1387
|
size: t
|
|
1340
1388
|
});
|
|
1341
|
-
case
|
|
1342
|
-
return
|
|
1343
|
-
origin:
|
|
1389
|
+
case n0.TOP_RIGHT:
|
|
1390
|
+
return l0({
|
|
1391
|
+
origin: $({ x: o - a, y: i }),
|
|
1344
1392
|
size: t
|
|
1345
1393
|
});
|
|
1346
|
-
case
|
|
1347
|
-
return
|
|
1348
|
-
origin:
|
|
1394
|
+
case n0.LEFT:
|
|
1395
|
+
return l0({
|
|
1396
|
+
origin: $({ x: o, y: i - s / 2 }),
|
|
1349
1397
|
size: t
|
|
1350
1398
|
});
|
|
1351
|
-
case
|
|
1352
|
-
return
|
|
1353
|
-
origin:
|
|
1399
|
+
case n0.CENTER:
|
|
1400
|
+
return l0({
|
|
1401
|
+
origin: $({ x: o - a / 2, y: i - s / 2 }),
|
|
1354
1402
|
size: t
|
|
1355
1403
|
});
|
|
1356
|
-
case
|
|
1357
|
-
return
|
|
1358
|
-
origin:
|
|
1404
|
+
case n0.RIGHT:
|
|
1405
|
+
return l0({
|
|
1406
|
+
origin: $({ x: o - a, y: i - s / 2 }),
|
|
1359
1407
|
size: t
|
|
1360
1408
|
});
|
|
1361
|
-
case
|
|
1362
|
-
return
|
|
1363
|
-
origin:
|
|
1409
|
+
case n0.BOTTOM_LEFT:
|
|
1410
|
+
return l0({
|
|
1411
|
+
origin: $({ x: o, y: i - s }),
|
|
1364
1412
|
size: t
|
|
1365
1413
|
});
|
|
1366
|
-
case
|
|
1367
|
-
return
|
|
1368
|
-
origin:
|
|
1414
|
+
case n0.BOTTOM:
|
|
1415
|
+
return l0({
|
|
1416
|
+
origin: $({ x: o - a / 2, y: i - s }),
|
|
1369
1417
|
size: t
|
|
1370
1418
|
});
|
|
1371
|
-
case
|
|
1372
|
-
return
|
|
1373
|
-
origin:
|
|
1419
|
+
case n0.BOTTOM_RIGHT:
|
|
1420
|
+
return l0({
|
|
1421
|
+
origin: $({ x: o - a, y: i - s }),
|
|
1374
1422
|
size: t
|
|
1375
1423
|
});
|
|
1376
1424
|
default:
|
|
1377
|
-
|
|
1425
|
+
r0(e);
|
|
1378
1426
|
}
|
|
1379
1427
|
}
|
|
1380
|
-
const
|
|
1428
|
+
const X1 = ({
|
|
1381
1429
|
ctx: n,
|
|
1382
1430
|
object: e,
|
|
1383
1431
|
renderObject: t,
|
|
1384
1432
|
opacity: o
|
|
1385
1433
|
}) => {
|
|
1386
|
-
const i =
|
|
1387
|
-
|
|
1434
|
+
const i = g0(
|
|
1435
|
+
$({ x: e.x, y: e.y }),
|
|
1388
1436
|
e.anchor,
|
|
1389
|
-
|
|
1437
|
+
i0({
|
|
1390
1438
|
width: e.width * e.scale,
|
|
1391
1439
|
height: e.height * e.scale
|
|
1392
1440
|
})
|
|
@@ -1398,7 +1446,7 @@ const Y1 = ({
|
|
|
1398
1446
|
e.previewColor !== null && (n.context.fillStyle = E0(e.previewColor), n.context.fillRect(0, 0, e.width, e.height)), n.context.translate(s, r), n.context.rotate(-a * Math.PI / 180), n.context.translate(-s, -r), e.rotateOriginPreviewSize > 0 && (n.context.fillStyle = "red", n.context.beginPath(), n.context.arc(s, r, e.rotateOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), n.context.scale(1 / e.scale, 1 / e.scale), n.context.translate(-i.origin.x, -i.origin.y);
|
|
1399
1447
|
}
|
|
1400
1448
|
};
|
|
1401
|
-
function
|
|
1449
|
+
function rt(n, e, t, o, i = 0) {
|
|
1402
1450
|
const a = o();
|
|
1403
1451
|
a.path.moveTo(n.x + t, n.y), a.path.lineTo(n.x + e.width - t, n.y), a.path.arcTo(
|
|
1404
1452
|
n.x + e.width,
|
|
@@ -1422,43 +1470,43 @@ function Ot(n, e, t, o, i = 0) {
|
|
|
1422
1470
|
const s = 2 * (e.width + e.height - 4 * t) + 2 * Math.PI * t + i;
|
|
1423
1471
|
return { path: a, length: s };
|
|
1424
1472
|
}
|
|
1425
|
-
const
|
|
1473
|
+
const S0 = {
|
|
1426
1474
|
Browser: "browser",
|
|
1427
1475
|
Node: "node"
|
|
1428
|
-
},
|
|
1476
|
+
}, Z1 = ({
|
|
1429
1477
|
ctx: n,
|
|
1430
1478
|
imageById: e,
|
|
1431
1479
|
object: t,
|
|
1432
1480
|
opacity: o,
|
|
1433
1481
|
createPath2D: i
|
|
1434
1482
|
}) => {
|
|
1435
|
-
const a =
|
|
1436
|
-
|
|
1483
|
+
const a = g0(
|
|
1484
|
+
$({ x: t.x, y: t.y }),
|
|
1437
1485
|
t.anchor,
|
|
1438
|
-
|
|
1486
|
+
i0({ width: t.width, height: t.height })
|
|
1439
1487
|
), s = e[t.imageId];
|
|
1440
1488
|
if (s !== void 0) {
|
|
1441
1489
|
if (n.context.save(), t.rounding > 0) {
|
|
1442
|
-
const r =
|
|
1490
|
+
const r = rt(
|
|
1443
1491
|
a.origin,
|
|
1444
1492
|
a.size,
|
|
1445
1493
|
t.rounding,
|
|
1446
1494
|
i
|
|
1447
1495
|
);
|
|
1448
1496
|
switch (n.type) {
|
|
1449
|
-
case
|
|
1450
|
-
r.path.type ===
|
|
1497
|
+
case V.Browser:
|
|
1498
|
+
r.path.type === f0.Browser ? n.context.clip(r.path.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1451
1499
|
break;
|
|
1452
|
-
case
|
|
1453
|
-
r.path.type ===
|
|
1500
|
+
case V.Node:
|
|
1501
|
+
r.path.type === f0.Node ? n.context.clip(r.path.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1454
1502
|
break;
|
|
1455
1503
|
default:
|
|
1456
|
-
|
|
1504
|
+
r0(n);
|
|
1457
1505
|
}
|
|
1458
1506
|
}
|
|
1459
1507
|
switch (n.context.globalAlpha = o * t.opacity, n.context.imageSmoothingEnabled = t.smooth, n.type) {
|
|
1460
|
-
case
|
|
1461
|
-
s.type ===
|
|
1508
|
+
case V.Browser:
|
|
1509
|
+
s.type === S0.Browser ? n.context.drawImage(
|
|
1462
1510
|
s.image,
|
|
1463
1511
|
a.origin.x,
|
|
1464
1512
|
a.origin.y,
|
|
@@ -1466,8 +1514,8 @@ const Z0 = {
|
|
|
1466
1514
|
a.size.height
|
|
1467
1515
|
) : console.warn("Attempted to use Node Image in Browser Canvas context");
|
|
1468
1516
|
break;
|
|
1469
|
-
case
|
|
1470
|
-
s.type ===
|
|
1517
|
+
case V.Node:
|
|
1518
|
+
s.type === S0.Node ? n.context.drawImage(
|
|
1471
1519
|
s.image,
|
|
1472
1520
|
a.origin.x,
|
|
1473
1521
|
a.origin.y,
|
|
@@ -1476,18 +1524,18 @@ const Z0 = {
|
|
|
1476
1524
|
) : console.warn("Attempted to use Browser Image in Node Canvas context");
|
|
1477
1525
|
break;
|
|
1478
1526
|
default:
|
|
1479
|
-
|
|
1527
|
+
r0(n);
|
|
1480
1528
|
}
|
|
1481
1529
|
n.context.restore();
|
|
1482
1530
|
}
|
|
1483
1531
|
};
|
|
1484
|
-
function
|
|
1532
|
+
function V1(n, e) {
|
|
1485
1533
|
const t = e();
|
|
1486
1534
|
t.path.moveTo(n.startX, n.startY), t.path.lineTo(n.endX, n.endY);
|
|
1487
1535
|
const o = Math.hypot(n.endX - n.startX, n.endY - n.startY);
|
|
1488
1536
|
return { path: t, length: o };
|
|
1489
1537
|
}
|
|
1490
|
-
const
|
|
1538
|
+
const K1 = ({
|
|
1491
1539
|
ctx: n,
|
|
1492
1540
|
object: e,
|
|
1493
1541
|
opacity: t,
|
|
@@ -1496,8 +1544,8 @@ const Z1 = ({
|
|
|
1496
1544
|
const i = e.opacity * t;
|
|
1497
1545
|
if (i === 0 || e.drawn === 0)
|
|
1498
1546
|
return;
|
|
1499
|
-
const { path: a, length: s } =
|
|
1500
|
-
|
|
1547
|
+
const { path: a, length: s } = V1(e, o);
|
|
1548
|
+
y0({
|
|
1501
1549
|
color: e.color,
|
|
1502
1550
|
ctx: n,
|
|
1503
1551
|
drawn: e.drawn,
|
|
@@ -1508,23 +1556,23 @@ const Z1 = ({
|
|
|
1508
1556
|
opacity: i,
|
|
1509
1557
|
width: e.width
|
|
1510
1558
|
});
|
|
1511
|
-
},
|
|
1559
|
+
}, Q1 = ({
|
|
1512
1560
|
ctx: n,
|
|
1513
1561
|
object: e,
|
|
1514
1562
|
opacity: t,
|
|
1515
1563
|
renderObject: o
|
|
1516
1564
|
}) => {
|
|
1517
1565
|
n.context.save();
|
|
1518
|
-
const i =
|
|
1519
|
-
|
|
1566
|
+
const i = g0(
|
|
1567
|
+
$({ x: e.x, y: e.y }),
|
|
1520
1568
|
e.anchor,
|
|
1521
|
-
|
|
1569
|
+
i0({ width: e.width, height: e.height })
|
|
1522
1570
|
);
|
|
1523
|
-
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = E0(
|
|
1571
|
+
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = E0(W.RED), n.context.rect(i.origin.x, i.origin.y, i.size.width, i.size.height), n.context.stroke()), n.context.beginPath(), n.context.rect(i.origin.x, i.origin.y, i.size.width, i.size.height), n.context.closePath(), n.context.clip();
|
|
1524
1572
|
for (const a of e.objects)
|
|
1525
1573
|
o(a, t * e.opacity);
|
|
1526
1574
|
n.context.restore();
|
|
1527
|
-
},
|
|
1575
|
+
}, J1 = ({
|
|
1528
1576
|
ctx: n,
|
|
1529
1577
|
object: e,
|
|
1530
1578
|
opacity: t,
|
|
@@ -1533,17 +1581,17 @@ const Z1 = ({
|
|
|
1533
1581
|
const i = e.opacity * t;
|
|
1534
1582
|
if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
|
|
1535
1583
|
return;
|
|
1536
|
-
const { origin: a } =
|
|
1537
|
-
|
|
1584
|
+
const { origin: a } = g0(
|
|
1585
|
+
$({ x: e.x, y: e.y }),
|
|
1538
1586
|
e.anchor,
|
|
1539
|
-
|
|
1587
|
+
i0({ width: e.width, height: e.height })
|
|
1540
1588
|
), s = o(e.path);
|
|
1541
|
-
n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight),
|
|
1589
|
+
n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight), v0({
|
|
1542
1590
|
ctx: n,
|
|
1543
1591
|
path: s,
|
|
1544
1592
|
color: e.fill,
|
|
1545
1593
|
opacity: i
|
|
1546
|
-
}),
|
|
1594
|
+
}), y0({
|
|
1547
1595
|
color: e.color,
|
|
1548
1596
|
ctx: n,
|
|
1549
1597
|
drawn: e.drawn,
|
|
@@ -1554,7 +1602,7 @@ const Z1 = ({
|
|
|
1554
1602
|
width: e.strokeWidth
|
|
1555
1603
|
}), n.context.restore();
|
|
1556
1604
|
};
|
|
1557
|
-
function
|
|
1605
|
+
function te(n, e) {
|
|
1558
1606
|
const t = e(), o = n.points, i = o[0];
|
|
1559
1607
|
if (i === void 0)
|
|
1560
1608
|
return { path: t, length: 0 };
|
|
@@ -1575,7 +1623,7 @@ function V1(n, e) {
|
|
|
1575
1623
|
);
|
|
1576
1624
|
return a += r, { path: t, length: a };
|
|
1577
1625
|
}
|
|
1578
|
-
const
|
|
1626
|
+
const ee = ({
|
|
1579
1627
|
ctx: n,
|
|
1580
1628
|
object: e,
|
|
1581
1629
|
opacity: t,
|
|
@@ -1584,13 +1632,13 @@ const Q1 = ({
|
|
|
1584
1632
|
const i = e.opacity * t;
|
|
1585
1633
|
if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
|
|
1586
1634
|
return;
|
|
1587
|
-
const { path: a, length: s } =
|
|
1588
|
-
|
|
1635
|
+
const { path: a, length: s } = te(e, o);
|
|
1636
|
+
v0({
|
|
1589
1637
|
ctx: n,
|
|
1590
1638
|
path: a,
|
|
1591
1639
|
color: e.fill,
|
|
1592
1640
|
opacity: i
|
|
1593
|
-
}),
|
|
1641
|
+
}), y0({
|
|
1594
1642
|
color: e.borderColor,
|
|
1595
1643
|
ctx: n,
|
|
1596
1644
|
drawn: e.drawn,
|
|
@@ -1600,14 +1648,31 @@ const Q1 = ({
|
|
|
1600
1648
|
width: e.borderWidth
|
|
1601
1649
|
});
|
|
1602
1650
|
};
|
|
1603
|
-
function
|
|
1604
|
-
const { origin:
|
|
1605
|
-
|
|
1651
|
+
function ne(n, e) {
|
|
1652
|
+
const t = n.borderWidth / 2, { origin: o, size: i } = g0(
|
|
1653
|
+
$({ x: n.x, y: n.y }),
|
|
1606
1654
|
n.anchor,
|
|
1607
|
-
|
|
1655
|
+
i0({ width: n.width, height: n.height })
|
|
1656
|
+
), a = i.width - n.borderWidth, s = i.height - n.borderWidth;
|
|
1657
|
+
if (a <= 0 || s <= 0)
|
|
1658
|
+
return;
|
|
1659
|
+
const r = $({ x: o.x + t, y: o.y + t }), h = i0({ width: a, height: s }), c = Math.max(
|
|
1660
|
+
0,
|
|
1661
|
+
Math.min(n.rounding - t, Math.min(a, s) / 2)
|
|
1662
|
+
);
|
|
1663
|
+
if (c > 0)
|
|
1664
|
+
return rt(r, h, c, e).path;
|
|
1665
|
+
const f = e();
|
|
1666
|
+
return f.path.moveTo(r.x, r.y), f.path.lineTo(r.x + a, r.y), f.path.lineTo(r.x + a, r.y + s), f.path.lineTo(r.x, r.y + s), f.path.closePath(), f;
|
|
1667
|
+
}
|
|
1668
|
+
function re(n, e) {
|
|
1669
|
+
const { origin: t, size: o } = g0(
|
|
1670
|
+
$({ x: n.x, y: n.y }),
|
|
1671
|
+
n.anchor,
|
|
1672
|
+
i0({ width: n.width, height: n.height })
|
|
1608
1673
|
), i = Math.max(0, Math.min(n.rounding, Math.min(o.width, o.height) / 2)), a = Math.min(n.borderWidth * 2, o.width - i);
|
|
1609
1674
|
if (i > 0)
|
|
1610
|
-
return
|
|
1675
|
+
return rt(t, o, i, e, a);
|
|
1611
1676
|
{
|
|
1612
1677
|
const s = e();
|
|
1613
1678
|
s.path.moveTo(t.x, t.y), s.path.lineTo(t.x + o.width, t.y), s.path.lineTo(t.x + o.width, t.y + o.height), s.path.lineTo(t.x, t.y + o.height), s.path.lineTo(t.x, t.y), s.path.lineTo(t.x + a, t.y);
|
|
@@ -1615,7 +1680,7 @@ function J1(n, e) {
|
|
|
1615
1680
|
return { path: s, length: r };
|
|
1616
1681
|
}
|
|
1617
1682
|
}
|
|
1618
|
-
const
|
|
1683
|
+
const ie = ({
|
|
1619
1684
|
ctx: n,
|
|
1620
1685
|
object: e,
|
|
1621
1686
|
opacity: t,
|
|
@@ -1624,13 +1689,13 @@ const te = ({
|
|
|
1624
1689
|
const i = e.opacity * t;
|
|
1625
1690
|
if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
|
|
1626
1691
|
return;
|
|
1627
|
-
const { path: a, length: s } =
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
path: a,
|
|
1631
|
-
|
|
1632
|
-
opacity: i
|
|
1633
|
-
|
|
1692
|
+
const { path: a, length: s } = re(e, o);
|
|
1693
|
+
if (i < 1 && e.borderWidth > 0) {
|
|
1694
|
+
const r = ne(e, o);
|
|
1695
|
+
r !== void 0 && (n.context.save(), Ft(n, r), v0({ ctx: n, path: a, color: e.fill, opacity: i }), n.context.restore());
|
|
1696
|
+
} else
|
|
1697
|
+
v0({ ctx: n, path: a, color: e.fill, opacity: i });
|
|
1698
|
+
y0({
|
|
1634
1699
|
color: e.borderColor,
|
|
1635
1700
|
ctx: n,
|
|
1636
1701
|
drawn: e.drawn,
|
|
@@ -1639,8 +1704,48 @@ const te = ({
|
|
|
1639
1704
|
opacity: i,
|
|
1640
1705
|
width: e.borderWidth
|
|
1641
1706
|
});
|
|
1707
|
+
}, oe = ({
|
|
1708
|
+
ctx: n,
|
|
1709
|
+
imageById: e,
|
|
1710
|
+
object: t,
|
|
1711
|
+
opacity: o
|
|
1712
|
+
}) => {
|
|
1713
|
+
const i = t.opacity * o;
|
|
1714
|
+
if (i === 0 || !t.svg)
|
|
1715
|
+
return;
|
|
1716
|
+
const a = e[t.svg];
|
|
1717
|
+
if (a === void 0)
|
|
1718
|
+
return;
|
|
1719
|
+
const s = g0(
|
|
1720
|
+
$({ x: t.x, y: t.y }),
|
|
1721
|
+
t.anchor,
|
|
1722
|
+
i0({ width: t.width, height: t.height })
|
|
1723
|
+
);
|
|
1724
|
+
switch (n.context.save(), n.context.globalAlpha = i, n.type) {
|
|
1725
|
+
case V.Browser:
|
|
1726
|
+
a.type === S0.Browser && n.context.drawImage(
|
|
1727
|
+
a.image,
|
|
1728
|
+
s.origin.x,
|
|
1729
|
+
s.origin.y,
|
|
1730
|
+
s.size.width,
|
|
1731
|
+
s.size.height
|
|
1732
|
+
);
|
|
1733
|
+
break;
|
|
1734
|
+
case V.Node:
|
|
1735
|
+
a.type === S0.Node && n.context.drawImage(
|
|
1736
|
+
a.image,
|
|
1737
|
+
s.origin.x,
|
|
1738
|
+
s.origin.y,
|
|
1739
|
+
s.size.width,
|
|
1740
|
+
s.size.height
|
|
1741
|
+
);
|
|
1742
|
+
break;
|
|
1743
|
+
default:
|
|
1744
|
+
r0(n);
|
|
1745
|
+
}
|
|
1746
|
+
n.context.restore();
|
|
1642
1747
|
};
|
|
1643
|
-
function
|
|
1748
|
+
function se(n) {
|
|
1644
1749
|
return {
|
|
1645
1750
|
color: n.color,
|
|
1646
1751
|
fontFamily: n.fontFamily,
|
|
@@ -1650,7 +1755,7 @@ function ee(n) {
|
|
|
1650
1755
|
ligatures: n.ligatures
|
|
1651
1756
|
};
|
|
1652
1757
|
}
|
|
1653
|
-
function
|
|
1758
|
+
function ae(n, e = 1) {
|
|
1654
1759
|
const t = Math.max(...n.map((a) => a.reduce((s, r) => s + r.width, 0)));
|
|
1655
1760
|
let o = 0, i = 0;
|
|
1656
1761
|
for (let a = 0; a < n.length; a++) {
|
|
@@ -1665,54 +1770,54 @@ function ne(n, e = 1) {
|
|
|
1665
1770
|
width: t
|
|
1666
1771
|
};
|
|
1667
1772
|
}
|
|
1668
|
-
function
|
|
1773
|
+
function he(n) {
|
|
1669
1774
|
return {
|
|
1670
1775
|
width: n.width,
|
|
1671
1776
|
height: n.fontBoundingBoxAscent
|
|
1672
1777
|
};
|
|
1673
1778
|
}
|
|
1674
|
-
function
|
|
1675
|
-
n.context.fillStyle = nt(e.color, t), n.context.font = `${e.fontStyle} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`, n.type ===
|
|
1779
|
+
function Rt(n, e, t = 1) {
|
|
1780
|
+
n.context.fillStyle = nt(e.color, t), n.context.font = `${e.fontStyle} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`, n.type === V.Browser ? n.context.textRendering = e.ligatures ? "optimizeLegibility" : "optimizeSpeed" : n.context.fontVariant = e.ligatures ? "common-ligatures" : "no-common-ligatures";
|
|
1676
1781
|
}
|
|
1677
|
-
function
|
|
1782
|
+
function le(n, e, t) {
|
|
1678
1783
|
const o = [];
|
|
1679
1784
|
for (const i of n) {
|
|
1680
1785
|
const a = [];
|
|
1681
1786
|
for (const s of i) {
|
|
1682
1787
|
const { text: r, ...h } = s, c = { ...e, ...h };
|
|
1683
|
-
|
|
1788
|
+
Rt(t, c);
|
|
1684
1789
|
const f = t.context.measureText(r);
|
|
1685
|
-
a.push(
|
|
1790
|
+
a.push(he(f));
|
|
1686
1791
|
}
|
|
1687
1792
|
o.push(a);
|
|
1688
1793
|
}
|
|
1689
1794
|
return o;
|
|
1690
1795
|
}
|
|
1691
|
-
const
|
|
1796
|
+
const ce = ({ ctx: n, object: e, opacity: t }) => {
|
|
1692
1797
|
const o = e.opacity * t;
|
|
1693
1798
|
if (o === 0)
|
|
1694
1799
|
return;
|
|
1695
|
-
const { length: i } = e, a =
|
|
1800
|
+
const { length: i } = e, a = kt(e.text), s = se(e), r = le(a, s, n), h = ae(r, e.lineSpacing), c = g0($({ x: e.x, y: e.y }), e.anchor, h);
|
|
1696
1801
|
let f = c.origin.x, x = c.origin.y, l = 0, u = 0;
|
|
1697
|
-
for (let
|
|
1698
|
-
const y = a[
|
|
1802
|
+
for (let m = 0; m < a.length; m++) {
|
|
1803
|
+
const y = a[m], M = r[m];
|
|
1699
1804
|
if (y == null || M == null) {
|
|
1700
1805
|
console.error("Could not determine text units or sizes for line");
|
|
1701
1806
|
continue;
|
|
1702
1807
|
}
|
|
1703
1808
|
const C = M.reduce((L, S) => L + S.width, 0), E = M.length === 0 ? u : M.reduce((L, S) => Math.max(L, S.height), 0);
|
|
1704
1809
|
switch (e.alignment) {
|
|
1705
|
-
case
|
|
1810
|
+
case x0.LEFT:
|
|
1706
1811
|
f = c.origin.x;
|
|
1707
1812
|
break;
|
|
1708
|
-
case
|
|
1813
|
+
case x0.CENTER:
|
|
1709
1814
|
f = c.origin.x + (c.size.width - C) / 2;
|
|
1710
1815
|
break;
|
|
1711
|
-
case
|
|
1816
|
+
case x0.RIGHT:
|
|
1712
1817
|
f = c.origin.x + (c.size.width - C);
|
|
1713
1818
|
break;
|
|
1714
1819
|
default:
|
|
1715
|
-
|
|
1820
|
+
r0(e.alignment);
|
|
1716
1821
|
break;
|
|
1717
1822
|
}
|
|
1718
1823
|
x += E + u * (e.lineSpacing - 1), u = E;
|
|
@@ -1722,43 +1827,44 @@ const oe = ({ ctx: n, object: e, opacity: t }) => {
|
|
|
1722
1827
|
console.error("Could not determine text unit or size for unit");
|
|
1723
1828
|
continue;
|
|
1724
1829
|
}
|
|
1725
|
-
const { text: F, ...
|
|
1726
|
-
let
|
|
1830
|
+
const { text: F, ...H } = S;
|
|
1831
|
+
let X;
|
|
1727
1832
|
if (i !== null && l + F.length > i) {
|
|
1728
|
-
const
|
|
1729
|
-
|
|
1833
|
+
const a0 = i - l;
|
|
1834
|
+
X = F.slice(0, a0);
|
|
1730
1835
|
}
|
|
1731
|
-
const
|
|
1732
|
-
l +=
|
|
1733
|
-
const
|
|
1734
|
-
|
|
1836
|
+
const z = X ?? F;
|
|
1837
|
+
l += z.length;
|
|
1838
|
+
const G = { ...s, ...H };
|
|
1839
|
+
Rt(n, G, o), n.context.fillText(z, f, x), f += P.width;
|
|
1735
1840
|
}
|
|
1736
1841
|
}
|
|
1737
|
-
},
|
|
1738
|
-
[
|
|
1739
|
-
[
|
|
1740
|
-
[
|
|
1741
|
-
[
|
|
1742
|
-
[
|
|
1743
|
-
[
|
|
1744
|
-
[
|
|
1745
|
-
[
|
|
1746
|
-
[
|
|
1747
|
-
[
|
|
1842
|
+
}, ue = {
|
|
1843
|
+
[j.ARROW]: H1,
|
|
1844
|
+
[j.CIRCLE]: W1,
|
|
1845
|
+
[j.GROUP]: X1,
|
|
1846
|
+
[j.IMAGE]: Z1,
|
|
1847
|
+
[j.LINE]: K1,
|
|
1848
|
+
[j.MASK]: Q1,
|
|
1849
|
+
[j.PATH]: J1,
|
|
1850
|
+
[j.POLYGON]: ee,
|
|
1851
|
+
[j.RECTANGLE]: ie,
|
|
1852
|
+
[j.SLIDE_OBJECT]: () => {
|
|
1748
1853
|
},
|
|
1749
|
-
[
|
|
1854
|
+
[j.SVG]: oe,
|
|
1855
|
+
[j.TEXT]: ce
|
|
1750
1856
|
};
|
|
1751
|
-
function
|
|
1857
|
+
function fe(n) {
|
|
1752
1858
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1753
1859
|
return e.setAttribute("viewBox", `0 0 ${n.width} ${n.height}`), e.style.backgroundColor = "transparent", e.style.position = "absolute", e.style.width = "100%", e;
|
|
1754
1860
|
}
|
|
1755
|
-
function
|
|
1861
|
+
function ge(n, e) {
|
|
1756
1862
|
if (n === null)
|
|
1757
1863
|
return null;
|
|
1758
|
-
const t =
|
|
1759
|
-
|
|
1864
|
+
const t = g0(
|
|
1865
|
+
$({ x: e.x, y: e.y }),
|
|
1760
1866
|
e.anchor,
|
|
1761
|
-
|
|
1867
|
+
i0({ width: e.width, height: e.height })
|
|
1762
1868
|
), o = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
|
|
1763
1869
|
o.setAttribute("x", t.origin.x.toString()), o.setAttribute("y", t.origin.y.toString()), o.setAttribute("width", e.width.toString()), o.setAttribute("height", e.height.toString());
|
|
1764
1870
|
const i = e.content;
|
|
@@ -1772,50 +1878,58 @@ function he(n, e) {
|
|
|
1772
1878
|
a !== null && a(), n.removeChild(o);
|
|
1773
1879
|
};
|
|
1774
1880
|
}
|
|
1775
|
-
async function
|
|
1881
|
+
async function pe(n) {
|
|
1776
1882
|
if (Object.keys(n).length === 0)
|
|
1777
1883
|
return {};
|
|
1778
1884
|
const e = {}, t = (i) => new Promise((a, s) => {
|
|
1779
1885
|
const r = new Image();
|
|
1780
1886
|
if (r.onload = () => a(r), r.onerror = (c) => s(c), i.includes("</svg>")) {
|
|
1781
|
-
const c = new Blob([
|
|
1782
|
-
r.src =
|
|
1887
|
+
const c = i.replace(/<\?xml[^?]*\?>\s*/g, ""), f = new Blob([c], { type: "image/svg+xml;charset=utf-8" }), x = URL.createObjectURL(f);
|
|
1888
|
+
r.src = x;
|
|
1783
1889
|
} else
|
|
1784
1890
|
r.src = i;
|
|
1785
1891
|
}), o = Object.entries(n).map(async ([i, a]) => {
|
|
1786
1892
|
const s = await t(a);
|
|
1787
1893
|
e[i] = {
|
|
1788
|
-
type:
|
|
1894
|
+
type: S0.Browser,
|
|
1789
1895
|
image: s
|
|
1790
1896
|
};
|
|
1791
1897
|
});
|
|
1792
|
-
|
|
1898
|
+
try {
|
|
1899
|
+
await Promise.all(o);
|
|
1900
|
+
} catch (i) {
|
|
1901
|
+
console.error("Error loading images:", i);
|
|
1902
|
+
}
|
|
1903
|
+
return e;
|
|
1793
1904
|
}
|
|
1794
|
-
class
|
|
1905
|
+
class Pn {
|
|
1795
1906
|
constructor(e) {
|
|
1796
1907
|
const { objectRenderers: t, ...o } = e;
|
|
1797
1908
|
this.props = {
|
|
1798
|
-
presentation:
|
|
1909
|
+
presentation: T1(),
|
|
1799
1910
|
element: document.body,
|
|
1800
1911
|
objectRenderers: {
|
|
1801
|
-
...
|
|
1912
|
+
...ue,
|
|
1802
1913
|
...t
|
|
1803
1914
|
},
|
|
1804
1915
|
cacheDurationMinutes: 15,
|
|
1805
1916
|
...o
|
|
1806
|
-
}, this.state = { ...
|
|
1917
|
+
}, this.state = { ...pt };
|
|
1807
1918
|
}
|
|
1808
1919
|
/** Starts the presentation. */
|
|
1809
1920
|
async present() {
|
|
1810
|
-
const { presentation: e, element: t } = this.props, o =
|
|
1921
|
+
const { presentation: e, element: t } = this.props, o = j1(e.size), i = fe(e.size);
|
|
1811
1922
|
this.state = {
|
|
1812
|
-
...
|
|
1813
|
-
imageById: await
|
|
1923
|
+
...pt,
|
|
1924
|
+
imageById: await pe({
|
|
1925
|
+
...e.resources.images,
|
|
1926
|
+
...F1(e)
|
|
1927
|
+
}),
|
|
1814
1928
|
canvas: o,
|
|
1815
1929
|
extrasContainer: i
|
|
1816
1930
|
};
|
|
1817
|
-
const a =
|
|
1818
|
-
|
|
1931
|
+
const a = E1(e, t);
|
|
1932
|
+
N1(e, t, this.state.shortcutState, {
|
|
1819
1933
|
onNext: (r) => this.next(r),
|
|
1820
1934
|
onPrevious: (r) => this.previous(r),
|
|
1821
1935
|
onRenderSlide: (r, h) => {
|
|
@@ -1824,26 +1938,26 @@ class An {
|
|
|
1824
1938
|
buildIndex: this.state.buildIndex
|
|
1825
1939
|
}, this.renderSlide(r ?? this.state.slideIndex, h);
|
|
1826
1940
|
},
|
|
1827
|
-
onShowNavigator: () =>
|
|
1941
|
+
onShowNavigator: () => A1({
|
|
1828
1942
|
presentation: e,
|
|
1829
1943
|
onNavigateToSlide: (r) => this.renderSlide(r)
|
|
1830
1944
|
})
|
|
1831
1945
|
}), t.replaceChildren(), a.appendChild(o), a.appendChild(i), t.appendChild(a);
|
|
1832
|
-
const s =
|
|
1946
|
+
const s = q1(e, this.props.cacheDurationMinutes);
|
|
1833
1947
|
s !== null ? this.renderSlide(s.slideIndex, s.buildIndex) : this.renderSlide(0);
|
|
1834
1948
|
}
|
|
1835
1949
|
renderSlide(e, t = 0, o = null) {
|
|
1836
1950
|
const { objectRenderers: i, presentation: a } = this.props, { canvas: s, imageById: r } = this.state, h = this.state.slideIndex !== e;
|
|
1837
|
-
this.state.slideIndex = e, this.state.buildIndex = t, o === null &&
|
|
1951
|
+
this.state.slideIndex = e, this.state.buildIndex = t, o === null && B1({ title: a.title, slideIndex: e, buildIndex: t });
|
|
1838
1952
|
const c = a.slides[e];
|
|
1839
1953
|
if (c === void 0 || s === null)
|
|
1840
1954
|
return;
|
|
1841
1955
|
if (h || this.state.mountedExtrasCleanups.length === 0 && c.extras.length > 0) {
|
|
1842
|
-
for (const
|
|
1843
|
-
|
|
1956
|
+
for (const m of this.state.mountedExtrasCleanups)
|
|
1957
|
+
m();
|
|
1844
1958
|
this.state.mountedExtrasCleanups = [];
|
|
1845
|
-
for (const
|
|
1846
|
-
const y =
|
|
1959
|
+
for (const m of c.extras) {
|
|
1960
|
+
const y = ge(this.state.extrasContainer, m);
|
|
1847
1961
|
y !== null && this.state.mountedExtrasCleanups.push(y);
|
|
1848
1962
|
}
|
|
1849
1963
|
}
|
|
@@ -1851,29 +1965,29 @@ class An {
|
|
|
1851
1965
|
if (f === null)
|
|
1852
1966
|
return;
|
|
1853
1967
|
const x = {
|
|
1854
|
-
type:
|
|
1968
|
+
type: V.Browser,
|
|
1855
1969
|
context: f
|
|
1856
1970
|
};
|
|
1857
|
-
|
|
1971
|
+
D1(s, x);
|
|
1858
1972
|
const l = O1({
|
|
1859
1973
|
slide: c,
|
|
1860
1974
|
buildIndex: t,
|
|
1861
1975
|
buildTime: o
|
|
1862
1976
|
});
|
|
1863
1977
|
x.context.fillStyle = nt(a.backgroundColor), x.context.fillRect(0, 0, s.width, s.height);
|
|
1864
|
-
function u(
|
|
1865
|
-
const M = i[
|
|
1978
|
+
function u(m, y) {
|
|
1979
|
+
const M = i[m.objectType], C = l.get(m);
|
|
1866
1980
|
M === void 0 || C === void 0 || M({
|
|
1867
1981
|
ctx: x,
|
|
1868
1982
|
imageById: r,
|
|
1869
1983
|
object: C,
|
|
1870
1984
|
opacity: y,
|
|
1871
1985
|
renderObject: u,
|
|
1872
|
-
createPath2D:
|
|
1986
|
+
createPath2D: z1
|
|
1873
1987
|
});
|
|
1874
1988
|
}
|
|
1875
|
-
for (const
|
|
1876
|
-
u(
|
|
1989
|
+
for (const m of c.objects)
|
|
1990
|
+
u(m, 1);
|
|
1877
1991
|
}
|
|
1878
1992
|
next(e = !1) {
|
|
1879
1993
|
const { presentation: t } = this.props, { currentAnimationId: o, slideIndex: i, buildIndex: a } = this.state;
|
|
@@ -1883,7 +1997,7 @@ class An {
|
|
|
1883
1997
|
return;
|
|
1884
1998
|
const r = s.animations[a];
|
|
1885
1999
|
if (r !== void 0 && !e) {
|
|
1886
|
-
const h = performance.now(), c =
|
|
2000
|
+
const h = performance.now(), c = P1(r), f = (x) => {
|
|
1887
2001
|
const l = x - h;
|
|
1888
2002
|
l < c ? (this.renderSlide(i, a + 1, l), this.state.currentAnimationId = requestAnimationFrame(f)) : this.renderSlide(i, a + 1, null);
|
|
1889
2003
|
};
|
|
@@ -1901,15 +2015,15 @@ class An {
|
|
|
1901
2015
|
this.renderSlide(0, 0);
|
|
1902
2016
|
}
|
|
1903
2017
|
}
|
|
1904
|
-
function
|
|
2018
|
+
function Cn(n = 1e3) {
|
|
1905
2019
|
return {
|
|
1906
|
-
type:
|
|
2020
|
+
type: u0.PAUSE,
|
|
1907
2021
|
isKey: !1,
|
|
1908
2022
|
duration: n,
|
|
1909
2023
|
shortcut: null
|
|
1910
2024
|
};
|
|
1911
2025
|
}
|
|
1912
|
-
function
|
|
2026
|
+
function En(n = null) {
|
|
1913
2027
|
return {
|
|
1914
2028
|
objects: [],
|
|
1915
2029
|
animations: [],
|
|
@@ -1922,32 +2036,32 @@ function bn(n = null) {
|
|
|
1922
2036
|
...n
|
|
1923
2037
|
};
|
|
1924
2038
|
}
|
|
1925
|
-
function
|
|
2039
|
+
function Sn(n, e = {}) {
|
|
1926
2040
|
return {
|
|
1927
2041
|
...e,
|
|
1928
2042
|
text: n
|
|
1929
2043
|
};
|
|
1930
2044
|
}
|
|
1931
|
-
function
|
|
2045
|
+
function In(n = W.BLACK) {
|
|
1932
2046
|
return { ...n, alpha: 1 };
|
|
1933
2047
|
}
|
|
1934
|
-
function
|
|
2048
|
+
function de(n) {
|
|
1935
2049
|
for (var e = -1, t = n.length, o, i = n[t - 1], a = 0; ++e < t; )
|
|
1936
2050
|
o = i, i = n[e], a += o[1] * i[0] - o[0] * i[1];
|
|
1937
2051
|
return a / 2;
|
|
1938
2052
|
}
|
|
1939
|
-
function
|
|
2053
|
+
function xe(n) {
|
|
1940
2054
|
for (var e = -1, t = n.length, o = n[t - 1], i, a, s = o[0], r = o[1], h = 0; ++e < t; )
|
|
1941
2055
|
i = s, a = r, o = n[e], s = o[0], r = o[1], i -= s, a -= r, h += Math.sqrt(i * i + a * a);
|
|
1942
2056
|
return h;
|
|
1943
2057
|
}
|
|
1944
|
-
function
|
|
2058
|
+
function ye(n) {
|
|
1945
2059
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
1946
2060
|
}
|
|
1947
|
-
var
|
|
1948
|
-
function
|
|
1949
|
-
if (
|
|
1950
|
-
|
|
2061
|
+
var B0, dt;
|
|
2062
|
+
function ve() {
|
|
2063
|
+
if (dt) return B0;
|
|
2064
|
+
dt = 1;
|
|
1951
2065
|
var n = { a: 7, c: 6, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, z: 0 }, e = [
|
|
1952
2066
|
5760,
|
|
1953
2067
|
6158,
|
|
@@ -2009,19 +2123,19 @@ function ge() {
|
|
|
2009
2123
|
u.index++;
|
|
2010
2124
|
}
|
|
2011
2125
|
function c(u) {
|
|
2012
|
-
var
|
|
2013
|
-
if (
|
|
2126
|
+
var m = u.path.charCodeAt(u.index);
|
|
2127
|
+
if (m === 48) {
|
|
2014
2128
|
u.param = 0, u.index++;
|
|
2015
2129
|
return;
|
|
2016
2130
|
}
|
|
2017
|
-
if (
|
|
2131
|
+
if (m === 49) {
|
|
2018
2132
|
u.param = 1, u.index++;
|
|
2019
2133
|
return;
|
|
2020
2134
|
}
|
|
2021
2135
|
u.err = "SvgPath: arc flag can be 0 or 1 only (at pos " + u.index + ")";
|
|
2022
2136
|
}
|
|
2023
2137
|
function f(u) {
|
|
2024
|
-
var
|
|
2138
|
+
var m = u.index, y = m, M = u.max, C = !1, E = !1, L = !1, S = !1, P;
|
|
2025
2139
|
if (y >= M) {
|
|
2026
2140
|
u.err = "SvgPath: missed param (at pos " + y + ")";
|
|
2027
2141
|
return;
|
|
@@ -2032,7 +2146,7 @@ function ge() {
|
|
|
2032
2146
|
}
|
|
2033
2147
|
if (P !== 46) {
|
|
2034
2148
|
if (C = P === 48, y++, P = y < M ? u.path.charCodeAt(y) : 0, C && y < M && P && a(P)) {
|
|
2035
|
-
u.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " +
|
|
2149
|
+
u.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " + m + ")";
|
|
2036
2150
|
return;
|
|
2037
2151
|
}
|
|
2038
2152
|
for (; y < M && a(u.path.charCodeAt(y)); )
|
|
@@ -2057,20 +2171,20 @@ function ge() {
|
|
|
2057
2171
|
return;
|
|
2058
2172
|
}
|
|
2059
2173
|
}
|
|
2060
|
-
u.index = y, u.param = parseFloat(u.path.slice(
|
|
2174
|
+
u.index = y, u.param = parseFloat(u.path.slice(m, y)) + 0;
|
|
2061
2175
|
}
|
|
2062
2176
|
function x(u) {
|
|
2063
|
-
var
|
|
2064
|
-
|
|
2177
|
+
var m, y;
|
|
2178
|
+
m = u.path[u.segmentStart], y = m.toLowerCase();
|
|
2065
2179
|
var M = u.data;
|
|
2066
|
-
if (y === "m" && M.length > 2 && (u.result.push([
|
|
2067
|
-
u.result.push([
|
|
2180
|
+
if (y === "m" && M.length > 2 && (u.result.push([m, M[0], M[1]]), M = M.slice(2), y = "l", m = m === "m" ? "l" : "L"), y === "r")
|
|
2181
|
+
u.result.push([m].concat(M));
|
|
2068
2182
|
else
|
|
2069
|
-
for (; M.length >= n[y] && (u.result.push([
|
|
2183
|
+
for (; M.length >= n[y] && (u.result.push([m].concat(M.splice(0, n[y]))), !!n[y]); )
|
|
2070
2184
|
;
|
|
2071
2185
|
}
|
|
2072
2186
|
function l(u) {
|
|
2073
|
-
var
|
|
2187
|
+
var m = u.max, y, M, C, E, L;
|
|
2074
2188
|
if (u.segmentStart = u.index, y = u.path.charCodeAt(u.index), M = i(y), !o(y)) {
|
|
2075
2189
|
u.err = "SvgPath: bad command " + u.path[u.index] + " (at pos " + u.index + ")";
|
|
2076
2190
|
return;
|
|
@@ -2085,27 +2199,27 @@ function ge() {
|
|
|
2085
2199
|
x(u);
|
|
2086
2200
|
return;
|
|
2087
2201
|
}
|
|
2088
|
-
u.data.push(u.param), h(u), C = !1, u.index <
|
|
2202
|
+
u.data.push(u.param), h(u), C = !1, u.index < m && u.path.charCodeAt(u.index) === 44 && (u.index++, h(u), C = !0);
|
|
2089
2203
|
}
|
|
2090
2204
|
if (!C && (u.index >= u.max || !s(u.path.charCodeAt(u.index))))
|
|
2091
2205
|
break;
|
|
2092
2206
|
}
|
|
2093
2207
|
x(u);
|
|
2094
2208
|
}
|
|
2095
|
-
return
|
|
2096
|
-
var y = new r(
|
|
2209
|
+
return B0 = function(m) {
|
|
2210
|
+
var y = new r(m), M = y.max;
|
|
2097
2211
|
for (h(y); y.index < M && !y.err.length; )
|
|
2098
2212
|
l(y);
|
|
2099
2213
|
return y.result.length && ("mM".indexOf(y.result[0][0]) < 0 ? (y.err = "SvgPath: string should start with `M` or `m`", y.result = []) : y.result[0][0] = "M"), {
|
|
2100
2214
|
err: y.err,
|
|
2101
2215
|
segments: y.result
|
|
2102
2216
|
};
|
|
2103
|
-
},
|
|
2217
|
+
}, B0;
|
|
2104
2218
|
}
|
|
2105
|
-
var D0,
|
|
2106
|
-
function
|
|
2107
|
-
if (
|
|
2108
|
-
|
|
2219
|
+
var D0, xt;
|
|
2220
|
+
function Nt() {
|
|
2221
|
+
if (xt) return D0;
|
|
2222
|
+
xt = 1;
|
|
2109
2223
|
function n(t, o) {
|
|
2110
2224
|
return [
|
|
2111
2225
|
t[0] * o[0] + t[2] * o[1],
|
|
@@ -2152,11 +2266,11 @@ function Ft() {
|
|
|
2152
2266
|
]) : [t, o];
|
|
2153
2267
|
}, D0 = e, D0;
|
|
2154
2268
|
}
|
|
2155
|
-
var
|
|
2156
|
-
function
|
|
2157
|
-
if (
|
|
2158
|
-
|
|
2159
|
-
var n =
|
|
2269
|
+
var j0, yt;
|
|
2270
|
+
function we() {
|
|
2271
|
+
if (yt) return j0;
|
|
2272
|
+
yt = 1;
|
|
2273
|
+
var n = Nt(), e = {
|
|
2160
2274
|
matrix: !0,
|
|
2161
2275
|
scale: !0,
|
|
2162
2276
|
rotate: !0,
|
|
@@ -2164,7 +2278,7 @@ function pe() {
|
|
|
2164
2278
|
skewX: !0,
|
|
2165
2279
|
skewY: !0
|
|
2166
2280
|
}, t = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, o = /[\s,]+/;
|
|
2167
|
-
return
|
|
2281
|
+
return j0 = function(a) {
|
|
2168
2282
|
var s = new n(), r, h;
|
|
2169
2283
|
return a.split(t).forEach(function(c) {
|
|
2170
2284
|
if (c.length) {
|
|
@@ -2196,29 +2310,29 @@ function pe() {
|
|
|
2196
2310
|
}
|
|
2197
2311
|
}
|
|
2198
2312
|
}), s;
|
|
2199
|
-
},
|
|
2313
|
+
}, j0;
|
|
2200
2314
|
}
|
|
2201
|
-
var
|
|
2202
|
-
function
|
|
2203
|
-
if (
|
|
2204
|
-
|
|
2315
|
+
var z0, vt;
|
|
2316
|
+
function me() {
|
|
2317
|
+
if (vt) return z0;
|
|
2318
|
+
vt = 1;
|
|
2205
2319
|
var n = Math.PI * 2;
|
|
2206
2320
|
function e(i, a, s, r) {
|
|
2207
2321
|
var h = i * r - a * s < 0 ? -1 : 1, c = i * s + a * r;
|
|
2208
2322
|
return c > 1 && (c = 1), c < -1 && (c = -1), h * Math.acos(c);
|
|
2209
2323
|
}
|
|
2210
2324
|
function t(i, a, s, r, h, c, f, x, l, u) {
|
|
2211
|
-
var
|
|
2325
|
+
var m = u * (i - s) / 2 + l * (a - r) / 2, y = -l * (i - s) / 2 + u * (a - r) / 2, M = f * f, C = x * x, E = m * m, L = y * y, S = M * C - M * L - C * E;
|
|
2212
2326
|
S < 0 && (S = 0), S /= M * L + C * E, S = Math.sqrt(S) * (h === c ? -1 : 1);
|
|
2213
|
-
var P = S * f / x * y, F = S * -x / f *
|
|
2214
|
-
return c === 0 &&
|
|
2327
|
+
var P = S * f / x * y, F = S * -x / f * m, H = u * P - l * F + (i + s) / 2, X = l * P + u * F + (a + r) / 2, z = (m - P) / f, G = (y - F) / x, a0 = (-m - P) / f, p0 = (-y - F) / x, c0 = e(1, 0, z, G), J = e(z, G, a0, p0);
|
|
2328
|
+
return c === 0 && J > 0 && (J -= n), c === 1 && J < 0 && (J += n), [H, X, c0, J];
|
|
2215
2329
|
}
|
|
2216
2330
|
function o(i, a) {
|
|
2217
2331
|
var s = 1.3333333333333333 * Math.tan(a / 4), r = Math.cos(i), h = Math.sin(i), c = Math.cos(i + a), f = Math.sin(i + a);
|
|
2218
2332
|
return [r, h, r - h * s, h + r * s, c + f * s, f - c * s, c, f];
|
|
2219
2333
|
}
|
|
2220
|
-
return
|
|
2221
|
-
var
|
|
2334
|
+
return z0 = function(a, s, r, h, c, f, x, l, u) {
|
|
2335
|
+
var m = Math.sin(u * n / 360), y = Math.cos(u * n / 360), M = y * (a - r) / 2 + m * (s - h) / 2, C = -m * (a - r) / 2 + y * (s - h) / 2;
|
|
2222
2336
|
if (M === 0 && C === 0)
|
|
2223
2337
|
return [];
|
|
2224
2338
|
if (x === 0 || l === 0)
|
|
@@ -2226,25 +2340,25 @@ function de() {
|
|
|
2226
2340
|
x = Math.abs(x), l = Math.abs(l);
|
|
2227
2341
|
var E = M * M / (x * x) + C * C / (l * l);
|
|
2228
2342
|
E > 1 && (x *= Math.sqrt(E), l *= Math.sqrt(E));
|
|
2229
|
-
var L = t(a, s, r, h, c, f, x, l,
|
|
2230
|
-
F /=
|
|
2231
|
-
for (var
|
|
2343
|
+
var L = t(a, s, r, h, c, f, x, l, m, y), S = [], P = L[2], F = L[3], H = Math.max(Math.ceil(Math.abs(F) / (n / 4)), 1);
|
|
2344
|
+
F /= H;
|
|
2345
|
+
for (var X = 0; X < H; X++)
|
|
2232
2346
|
S.push(o(P, F)), P += F;
|
|
2233
|
-
return S.map(function(
|
|
2234
|
-
for (var
|
|
2235
|
-
var
|
|
2236
|
-
|
|
2237
|
-
var
|
|
2238
|
-
|
|
2347
|
+
return S.map(function(z) {
|
|
2348
|
+
for (var G = 0; G < z.length; G += 2) {
|
|
2349
|
+
var a0 = z[G + 0], p0 = z[G + 1];
|
|
2350
|
+
a0 *= x, p0 *= l;
|
|
2351
|
+
var c0 = y * a0 - m * p0, J = m * a0 + y * p0;
|
|
2352
|
+
z[G + 0] = c0 + L[0], z[G + 1] = J + L[1];
|
|
2239
2353
|
}
|
|
2240
|
-
return
|
|
2354
|
+
return z;
|
|
2241
2355
|
});
|
|
2242
|
-
},
|
|
2356
|
+
}, z0;
|
|
2243
2357
|
}
|
|
2244
|
-
var U0,
|
|
2245
|
-
function
|
|
2246
|
-
if (
|
|
2247
|
-
|
|
2358
|
+
var U0, wt;
|
|
2359
|
+
function Ae() {
|
|
2360
|
+
if (wt) return U0;
|
|
2361
|
+
wt = 1;
|
|
2248
2362
|
var n = 1e-10, e = Math.PI / 180;
|
|
2249
2363
|
function t(o, i, a) {
|
|
2250
2364
|
if (!(this instanceof t))
|
|
@@ -2270,11 +2384,11 @@ function xe() {
|
|
|
2270
2384
|
return this.rx < n * this.ry || this.ry < n * this.rx;
|
|
2271
2385
|
}, U0 = t, U0;
|
|
2272
2386
|
}
|
|
2273
|
-
var
|
|
2274
|
-
function
|
|
2275
|
-
if (
|
|
2276
|
-
|
|
2277
|
-
var n =
|
|
2387
|
+
var H0, mt;
|
|
2388
|
+
function be() {
|
|
2389
|
+
if (mt) return H0;
|
|
2390
|
+
mt = 1;
|
|
2391
|
+
var n = ve(), e = we(), t = Nt(), o = me(), i = Ae();
|
|
2278
2392
|
function a(s) {
|
|
2279
2393
|
if (!(this instanceof a))
|
|
2280
2394
|
return new a(s);
|
|
@@ -2295,38 +2409,38 @@ function ye() {
|
|
|
2295
2409
|
}, a.prototype.__matrix = function(s) {
|
|
2296
2410
|
var r = this, h;
|
|
2297
2411
|
s.queue.length && this.iterate(function(c, f, x, l) {
|
|
2298
|
-
var u,
|
|
2412
|
+
var u, m, y, M;
|
|
2299
2413
|
switch (c[0]) {
|
|
2300
2414
|
// Process 'assymetric' commands separately
|
|
2301
2415
|
case "v":
|
|
2302
|
-
u = s.calc(0, c[1], !0),
|
|
2416
|
+
u = s.calc(0, c[1], !0), m = u[0] === 0 ? ["v", u[1]] : ["l", u[0], u[1]];
|
|
2303
2417
|
break;
|
|
2304
2418
|
case "V":
|
|
2305
|
-
u = s.calc(x, c[1], !1),
|
|
2419
|
+
u = s.calc(x, c[1], !1), m = u[0] === s.calc(x, l, !1)[0] ? ["V", u[1]] : ["L", u[0], u[1]];
|
|
2306
2420
|
break;
|
|
2307
2421
|
case "h":
|
|
2308
|
-
u = s.calc(c[1], 0, !0),
|
|
2422
|
+
u = s.calc(c[1], 0, !0), m = u[1] === 0 ? ["h", u[0]] : ["l", u[0], u[1]];
|
|
2309
2423
|
break;
|
|
2310
2424
|
case "H":
|
|
2311
|
-
u = s.calc(c[1], l, !1),
|
|
2425
|
+
u = s.calc(c[1], l, !1), m = u[1] === s.calc(x, l, !1)[1] ? ["H", u[0]] : ["L", u[0], u[1]];
|
|
2312
2426
|
break;
|
|
2313
2427
|
case "a":
|
|
2314
2428
|
case "A":
|
|
2315
2429
|
var C = s.toArray(), E = i(c[1], c[2], c[3]).transform(C);
|
|
2316
2430
|
if (C[0] * C[3] - C[1] * C[2] < 0 && (c[5] = c[5] ? "0" : "1"), u = s.calc(c[6], c[7], c[0] === "a"), c[0] === "A" && c[6] === x && c[7] === l || c[0] === "a" && c[6] === 0 && c[7] === 0) {
|
|
2317
|
-
|
|
2431
|
+
m = [c[0] === "a" ? "l" : "L", u[0], u[1]];
|
|
2318
2432
|
break;
|
|
2319
2433
|
}
|
|
2320
|
-
E.isDegenerate() ?
|
|
2434
|
+
E.isDegenerate() ? m = [c[0] === "a" ? "l" : "L", u[0], u[1]] : m = [c[0], E.rx, E.ry, E.ax, c[4], c[5], u[0], u[1]];
|
|
2321
2435
|
break;
|
|
2322
2436
|
case "m":
|
|
2323
|
-
M = f > 0, u = s.calc(c[1], c[2], M),
|
|
2437
|
+
M = f > 0, u = s.calc(c[1], c[2], M), m = ["m", u[0], u[1]];
|
|
2324
2438
|
break;
|
|
2325
2439
|
default:
|
|
2326
|
-
for (y = c[0],
|
|
2327
|
-
u = s.calc(c[h], c[h + 1], M),
|
|
2440
|
+
for (y = c[0], m = [y], M = y.toLowerCase() === y, h = 1; h < c.length; h += 2)
|
|
2441
|
+
u = s.calc(c[h], c[h + 1], M), m.push(u[0], u[1]);
|
|
2328
2442
|
}
|
|
2329
|
-
r.segments[f] =
|
|
2443
|
+
r.segments[f] = m;
|
|
2330
2444
|
}, !0);
|
|
2331
2445
|
}, a.prototype.__evaluateStack = function() {
|
|
2332
2446
|
var s, r;
|
|
@@ -2346,8 +2460,8 @@ function ye() {
|
|
|
2346
2460
|
var x = this.segments[c], l = x[0];
|
|
2347
2461
|
l !== r || l === "m" || l === "M" ? (l === "m" && r === "z" && (s += " "), s += l, h = !1) : h = !0;
|
|
2348
2462
|
for (var u = 1; u < x.length; u++) {
|
|
2349
|
-
var
|
|
2350
|
-
u === 1 ? h &&
|
|
2463
|
+
var m = x[u];
|
|
2464
|
+
u === 1 ? h && m >= 0 && (s += " ") : m >= 0 && (s += " "), s += m;
|
|
2351
2465
|
}
|
|
2352
2466
|
r = l;
|
|
2353
2467
|
}
|
|
@@ -2392,14 +2506,14 @@ function ye() {
|
|
|
2392
2506
|
u && (l[6] += c, l[7] += f), c = l[6] - l[6].toFixed(s), f = l[7] - l[7].toFixed(s), l[1] = +l[1].toFixed(s), l[2] = +l[2].toFixed(s), l[3] = +l[3].toFixed(s + 2), l[6] = +l[6].toFixed(s), l[7] = +l[7].toFixed(s);
|
|
2393
2507
|
return;
|
|
2394
2508
|
default:
|
|
2395
|
-
x = l.length, u && (l[x - 2] += c, l[x - 1] += f), c = l[x - 2] - l[x - 2].toFixed(s), f = l[x - 1] - l[x - 1].toFixed(s), l.forEach(function(
|
|
2509
|
+
x = l.length, u && (l[x - 2] += c, l[x - 1] += f), c = l[x - 2] - l[x - 2].toFixed(s), f = l[x - 1] - l[x - 1].toFixed(s), l.forEach(function(m, y) {
|
|
2396
2510
|
y && (l[y] = +l[y].toFixed(s));
|
|
2397
2511
|
});
|
|
2398
2512
|
return;
|
|
2399
2513
|
}
|
|
2400
2514
|
}), this;
|
|
2401
2515
|
}, a.prototype.iterate = function(s, r) {
|
|
2402
|
-
var h = this.segments, c = {}, f = !1, x = 0, l = 0, u = 0,
|
|
2516
|
+
var h = this.segments, c = {}, f = !1, x = 0, l = 0, u = 0, m = 0, y, M, C;
|
|
2403
2517
|
if (r || this.__evaluateStack(), h.forEach(function(E, L) {
|
|
2404
2518
|
var S = s(E, L, x, l);
|
|
2405
2519
|
Array.isArray(S) && (c[L] = S, f = !0);
|
|
@@ -2407,7 +2521,7 @@ function ye() {
|
|
|
2407
2521
|
switch (E[0]) {
|
|
2408
2522
|
case "m":
|
|
2409
2523
|
case "M":
|
|
2410
|
-
x = E[1] + (P ? x : 0), l = E[2] + (P ? l : 0), u = x,
|
|
2524
|
+
x = E[1] + (P ? x : 0), l = E[2] + (P ? l : 0), u = x, m = l;
|
|
2411
2525
|
return;
|
|
2412
2526
|
case "h":
|
|
2413
2527
|
case "H":
|
|
@@ -2419,7 +2533,7 @@ function ye() {
|
|
|
2419
2533
|
return;
|
|
2420
2534
|
case "z":
|
|
2421
2535
|
case "Z":
|
|
2422
|
-
x = u, l =
|
|
2536
|
+
x = u, l = m;
|
|
2423
2537
|
return;
|
|
2424
2538
|
default:
|
|
2425
2539
|
x = E[E.length - 2] + (P ? x : 0), l = E[E.length - 1] + (P ? l : 0);
|
|
@@ -2467,22 +2581,22 @@ function ye() {
|
|
|
2467
2581
|
}, !0), this;
|
|
2468
2582
|
}, a.prototype.unarc = function() {
|
|
2469
2583
|
return this.iterate(function(s, r, h, c) {
|
|
2470
|
-
var f, x, l, u = [],
|
|
2471
|
-
return
|
|
2584
|
+
var f, x, l, u = [], m = s[0];
|
|
2585
|
+
return m !== "A" && m !== "a" ? null : (m === "a" ? (x = h + s[6], l = c + s[7]) : (x = s[6], l = s[7]), f = o(h, c, x, l, s[4], s[5], s[1], s[2], s[3]), f.length === 0 ? [[s[0] === "a" ? "l" : "L", s[6], s[7]]] : (f.forEach(function(y) {
|
|
2472
2586
|
u.push(["C", y[2], y[3], y[4], y[5], y[6], y[7]]);
|
|
2473
2587
|
}), u));
|
|
2474
2588
|
}), this;
|
|
2475
2589
|
}, a.prototype.unshort = function() {
|
|
2476
2590
|
var s = this.segments, r, h, c, f, x;
|
|
2477
|
-
return this.iterate(function(l, u,
|
|
2591
|
+
return this.iterate(function(l, u, m, y) {
|
|
2478
2592
|
var M = l[0], C = M.toUpperCase(), E;
|
|
2479
|
-
u && (C === "T" ? (E = M === "t", c = s[u - 1], c[0] === "Q" ? (r = c[1] -
|
|
2593
|
+
u && (C === "T" ? (E = M === "t", c = s[u - 1], c[0] === "Q" ? (r = c[1] - m, h = c[2] - y) : c[0] === "q" ? (r = c[1] - c[3], h = c[2] - c[4]) : (r = 0, h = 0), f = -r, x = -h, E || (f += m, x += y), s[u] = [
|
|
2480
2594
|
E ? "q" : "Q",
|
|
2481
2595
|
f,
|
|
2482
2596
|
x,
|
|
2483
2597
|
l[1],
|
|
2484
2598
|
l[2]
|
|
2485
|
-
]) : C === "S" && (E = M === "s", c = s[u - 1], c[0] === "C" ? (r = c[3] -
|
|
2599
|
+
]) : C === "S" && (E = M === "s", c = s[u - 1], c[0] === "C" ? (r = c[3] - m, h = c[4] - y) : c[0] === "c" ? (r = c[3] - c[5], h = c[4] - c[6]) : (r = 0, h = 0), f = -r, x = -h, E || (f += m, x += y), s[u] = [
|
|
2486
2600
|
E ? "c" : "C",
|
|
2487
2601
|
f,
|
|
2488
2602
|
x,
|
|
@@ -2492,20 +2606,20 @@ function ye() {
|
|
|
2492
2606
|
l[4]
|
|
2493
2607
|
]));
|
|
2494
2608
|
}), this;
|
|
2495
|
-
},
|
|
2609
|
+
}, H0 = a, H0;
|
|
2496
2610
|
}
|
|
2497
|
-
var
|
|
2498
|
-
function
|
|
2499
|
-
return At || (At = 1,
|
|
2611
|
+
var G0, At;
|
|
2612
|
+
function Me() {
|
|
2613
|
+
return At || (At = 1, G0 = be()), G0;
|
|
2500
2614
|
}
|
|
2501
|
-
var
|
|
2502
|
-
const
|
|
2503
|
-
var $0 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 },
|
|
2504
|
-
function
|
|
2615
|
+
var Le = Me();
|
|
2616
|
+
const Te = /* @__PURE__ */ ye(Le);
|
|
2617
|
+
var $0 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Pe = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
|
|
2618
|
+
function Ce(n) {
|
|
2505
2619
|
var e = [];
|
|
2506
|
-
return n.replace(
|
|
2620
|
+
return n.replace(Pe, function(t, o, i) {
|
|
2507
2621
|
var a = o.toLowerCase();
|
|
2508
|
-
for (i =
|
|
2622
|
+
for (i = Se(i), a === "m" && i.length > 2 && (e.push([o].concat(i.splice(0, 2))), a = "l", o = o === "m" ? "l" : "L"); i.length >= 0; ) {
|
|
2509
2623
|
if (i.length === $0[a])
|
|
2510
2624
|
return i.unshift(o), e.push(i);
|
|
2511
2625
|
if (i.length < $0[a])
|
|
@@ -2514,19 +2628,19 @@ function be(n) {
|
|
|
2514
2628
|
}
|
|
2515
2629
|
}), e;
|
|
2516
2630
|
}
|
|
2517
|
-
var
|
|
2518
|
-
function
|
|
2519
|
-
var e = n.match(
|
|
2631
|
+
var Ee = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
|
|
2632
|
+
function Se(n) {
|
|
2633
|
+
var e = n.match(Ee);
|
|
2520
2634
|
return e ? e.map(Number) : [];
|
|
2521
2635
|
}
|
|
2522
|
-
function
|
|
2523
|
-
return new
|
|
2636
|
+
function e0(n, e, t, o, i, a, s, r) {
|
|
2637
|
+
return new Z0(n, e, t, o, i, a, s, r);
|
|
2524
2638
|
}
|
|
2525
|
-
function
|
|
2526
|
-
this.a = { x: n, y: e }, this.b = { x: t, y: o }, this.c = { x: i, y: a }, this.d = { x: s, y: r }, s != null && r !== null && r !== void 0 ? (this.getArcLength =
|
|
2639
|
+
function Z0(n, e, t, o, i, a, s, r) {
|
|
2640
|
+
this.a = { x: n, y: e }, this.b = { x: t, y: o }, this.c = { x: i, y: a }, this.d = { x: s, y: r }, s != null && r !== null && r !== void 0 ? (this.getArcLength = De, this.getPoint = ke, this.getDerivative = _e) : (this.getArcLength = Oe, this.getPoint = qt, this.getDerivative = Ie), this.init();
|
|
2527
2641
|
}
|
|
2528
|
-
|
|
2529
|
-
constructor:
|
|
2642
|
+
Z0.prototype = {
|
|
2643
|
+
constructor: Z0,
|
|
2530
2644
|
init: function() {
|
|
2531
2645
|
this.length = this.getArcLength(
|
|
2532
2646
|
[this.a.x, this.b.x, this.c.x, this.d.x],
|
|
@@ -2537,7 +2651,7 @@ W0.prototype = {
|
|
|
2537
2651
|
return this.length;
|
|
2538
2652
|
},
|
|
2539
2653
|
getPointAtLength: function(n) {
|
|
2540
|
-
var e =
|
|
2654
|
+
var e = W0(
|
|
2541
2655
|
n,
|
|
2542
2656
|
this.length,
|
|
2543
2657
|
this.getArcLength,
|
|
@@ -2551,7 +2665,7 @@ W0.prototype = {
|
|
|
2551
2665
|
);
|
|
2552
2666
|
},
|
|
2553
2667
|
getTangentAtLength: function(n) {
|
|
2554
|
-
var e =
|
|
2668
|
+
var e = W0(
|
|
2555
2669
|
n,
|
|
2556
2670
|
this.length,
|
|
2557
2671
|
this.getArcLength,
|
|
@@ -2565,7 +2679,7 @@ W0.prototype = {
|
|
|
2565
2679
|
return o > 0 ? i = { x: t.x / o, y: t.y / o } : i = { x: 0, y: 0 }, i;
|
|
2566
2680
|
},
|
|
2567
2681
|
getPropertiesAtLength: function(n) {
|
|
2568
|
-
var e =
|
|
2682
|
+
var e = W0(
|
|
2569
2683
|
n,
|
|
2570
2684
|
this.length,
|
|
2571
2685
|
this.getArcLength,
|
|
@@ -2585,36 +2699,36 @@ W0.prototype = {
|
|
|
2585
2699
|
return { x: a.x, y: a.y, tangentX: i.x, tangentY: i.y };
|
|
2586
2700
|
}
|
|
2587
2701
|
};
|
|
2588
|
-
function
|
|
2702
|
+
function Ie(n, e, t) {
|
|
2589
2703
|
return {
|
|
2590
2704
|
x: (1 - t) * 2 * (n[1] - n[0]) + t * 2 * (n[2] - n[1]),
|
|
2591
2705
|
y: (1 - t) * 2 * (e[1] - e[0]) + t * 2 * (e[2] - e[1])
|
|
2592
2706
|
};
|
|
2593
2707
|
}
|
|
2594
|
-
function
|
|
2595
|
-
var o =
|
|
2708
|
+
function _e(n, e, t) {
|
|
2709
|
+
var o = qt(
|
|
2596
2710
|
[3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])],
|
|
2597
2711
|
[3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])],
|
|
2598
2712
|
t
|
|
2599
2713
|
);
|
|
2600
2714
|
return o;
|
|
2601
2715
|
}
|
|
2602
|
-
function
|
|
2716
|
+
function W0(n, e, t, o, i) {
|
|
2603
2717
|
for (var a = 1, s = n / e, r = (n - t(o, i, s)) / e; a > 1e-3; ) {
|
|
2604
2718
|
var h = t(o, i, s + r), c = t(o, i, s - r), f = Math.abs(n - h) / e, x = Math.abs(n - c) / e;
|
|
2605
2719
|
f < a ? (a = f, s += r) : x < a ? (a = x, s -= r) : r /= 2;
|
|
2606
2720
|
}
|
|
2607
2721
|
return s;
|
|
2608
2722
|
}
|
|
2609
|
-
function
|
|
2723
|
+
function qt(n, e, t) {
|
|
2610
2724
|
var o = (1 - t) * (1 - t) * n[0] + 2 * (1 - t) * t * n[1] + t * t * n[2], i = (1 - t) * (1 - t) * e[0] + 2 * (1 - t) * t * e[1] + t * t * e[2];
|
|
2611
2725
|
return { x: o, y: i };
|
|
2612
2726
|
}
|
|
2613
|
-
function
|
|
2727
|
+
function ke(n, e, t) {
|
|
2614
2728
|
var o = (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], i = (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3];
|
|
2615
2729
|
return { x: o, y: i };
|
|
2616
2730
|
}
|
|
2617
|
-
function
|
|
2731
|
+
function Oe(n, e, t) {
|
|
2618
2732
|
t === void 0 && (t = 1);
|
|
2619
2733
|
var o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i), h = 4 * (o * a + i * s), c = a * a + s * s;
|
|
2620
2734
|
if (r === 0)
|
|
@@ -2624,7 +2738,7 @@ function Ee(n, e, t) {
|
|
|
2624
2738
|
(l + Math.sqrt(l * l + u)) / (f + Math.sqrt(f * f + u))
|
|
2625
2739
|
)));
|
|
2626
2740
|
}
|
|
2627
|
-
var
|
|
2741
|
+
var Fe = [
|
|
2628
2742
|
[],
|
|
2629
2743
|
[],
|
|
2630
2744
|
[-0.5773502691896257, 0.5773502691896257],
|
|
@@ -2650,7 +2764,7 @@ var Se = [
|
|
|
2650
2764
|
[-0.06973927331972223, 0.06973927331972223, -0.20786042668822127, 0.20786042668822127, -0.34193582089208424, 0.34193582089208424, -0.469355837986757, 0.469355837986757, -0.5876404035069116, 0.5876404035069116, -0.6944872631866827, 0.6944872631866827, -0.7878168059792081, 0.7878168059792081, -0.8658125777203002, 0.8658125777203002, -0.926956772187174, 0.926956772187174, -0.9700604978354287, 0.9700604978354287, -0.9942945854823992, 0.9942945854823992],
|
|
2651
2765
|
[0, -0.1332568242984661, 0.1332568242984661, -0.26413568097034495, 0.26413568097034495, -0.3903010380302908, 0.3903010380302908, -0.5095014778460075, 0.5095014778460075, -0.6196098757636461, 0.6196098757636461, -0.7186613631319502, 0.7186613631319502, -0.8048884016188399, 0.8048884016188399, -0.8767523582704416, 0.8767523582704416, -0.9329710868260161, 0.9329710868260161, -0.9725424712181152, 0.9725424712181152, -0.9947693349975522, 0.9947693349975522],
|
|
2652
2766
|
[-0.06405689286260563, 0.06405689286260563, -0.1911188674736163, 0.1911188674736163, -0.3150426796961634, 0.3150426796961634, -0.4337935076260451, 0.4337935076260451, -0.5454214713888396, 0.5454214713888396, -0.6480936519369755, 0.6480936519369755, -0.7401241915785544, 0.7401241915785544, -0.820001985973903, 0.820001985973903, -0.8864155270044011, 0.8864155270044011, -0.9382745520027328, 0.9382745520027328, -0.9747285559713095, 0.9747285559713095, -0.9951872199970213, 0.9951872199970213]
|
|
2653
|
-
],
|
|
2767
|
+
], Re = [
|
|
2654
2768
|
[],
|
|
2655
2769
|
[],
|
|
2656
2770
|
[1, 1],
|
|
@@ -2676,52 +2790,52 @@ var Se = [
|
|
|
2676
2790
|
[0.13925187285563198, 0.13925187285563198, 0.13654149834601517, 0.13654149834601517, 0.13117350478706238, 0.13117350478706238, 0.12325237681051242, 0.12325237681051242, 0.11293229608053922, 0.11293229608053922, 0.10041414444288096, 0.10041414444288096, 0.08594160621706773, 0.08594160621706773, 0.06979646842452049, 0.06979646842452049, 0.052293335152683286, 0.052293335152683286, 0.03377490158481415, 0.03377490158481415, 0.0146279952982722, 0.0146279952982722],
|
|
2677
2791
|
[0.13365457218610619, 0.1324620394046966, 0.1324620394046966, 0.12890572218808216, 0.12890572218808216, 0.12304908430672953, 0.12304908430672953, 0.11499664022241136, 0.11499664022241136, 0.10489209146454141, 0.10489209146454141, 0.09291576606003515, 0.09291576606003515, 0.07928141177671895, 0.07928141177671895, 0.06423242140852585, 0.06423242140852585, 0.04803767173108467, 0.04803767173108467, 0.030988005856979445, 0.030988005856979445, 0.013411859487141771, 0.013411859487141771],
|
|
2678
2792
|
[0.12793819534675216, 0.12793819534675216, 0.1258374563468283, 0.1258374563468283, 0.12167047292780339, 0.12167047292780339, 0.1155056680537256, 0.1155056680537256, 0.10744427011596563, 0.10744427011596563, 0.09761865210411388, 0.09761865210411388, 0.08619016153195327, 0.08619016153195327, 0.0733464814110803, 0.0733464814110803, 0.05929858491543678, 0.05929858491543678, 0.04427743881741981, 0.04427743881741981, 0.028531388628933663, 0.028531388628933663, 0.0123412297999872, 0.0123412297999872]
|
|
2679
|
-
],
|
|
2680
|
-
function
|
|
2681
|
-
return
|
|
2793
|
+
], Ne = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
|
|
2794
|
+
function qe(n, e) {
|
|
2795
|
+
return Ne[n][e];
|
|
2682
2796
|
}
|
|
2683
|
-
function
|
|
2797
|
+
function V0(n, e, t) {
|
|
2684
2798
|
var o = t.length - 1, i, a, s;
|
|
2685
2799
|
if (o === 0)
|
|
2686
2800
|
return 0;
|
|
2687
2801
|
if (n === 0) {
|
|
2688
2802
|
for (a = 0, s = 0; s <= o; s++)
|
|
2689
|
-
a +=
|
|
2803
|
+
a += qe(o, s) * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
2690
2804
|
return a;
|
|
2691
2805
|
} else {
|
|
2692
2806
|
for (i = new Array(o), s = 0; s < o; s++)
|
|
2693
2807
|
i[s] = o * (t[s + 1] - t[s]);
|
|
2694
|
-
return
|
|
2808
|
+
return V0(n - 1, e, i);
|
|
2695
2809
|
}
|
|
2696
2810
|
}
|
|
2697
|
-
function
|
|
2698
|
-
var o =
|
|
2811
|
+
function Be(n, e, t) {
|
|
2812
|
+
var o = V0(1, t, n), i = V0(1, t, e), a = o * o + i * i;
|
|
2699
2813
|
return Math.sqrt(a);
|
|
2700
2814
|
}
|
|
2701
|
-
function
|
|
2815
|
+
function De(n, e, t) {
|
|
2702
2816
|
var o, i, a, s;
|
|
2703
2817
|
t === void 0 && (t = 1);
|
|
2704
2818
|
var r = 20;
|
|
2705
2819
|
for (o = t / 2, i = 0, a = 0; a < r; a++)
|
|
2706
|
-
s = o *
|
|
2820
|
+
s = o * Fe[r][a] + o, i += Re[r][a] * Be(n, e, s);
|
|
2707
2821
|
return o * i;
|
|
2708
2822
|
}
|
|
2709
2823
|
var C0 = Math.PI * 2;
|
|
2710
|
-
function
|
|
2824
|
+
function bt(n, e, t, o) {
|
|
2711
2825
|
var i = n * o - e * t < 0 ? -1 : 1, a = n * t + e * o;
|
|
2712
2826
|
return a > 1 && (a = 1), a < -1 && (a = -1), i * Math.acos(a);
|
|
2713
2827
|
}
|
|
2714
|
-
function
|
|
2715
|
-
var f = c * (n - t) / 2 + h * (e - o) / 2, x = -h * (n - t) / 2 + c * (e - o) / 2, l = s * s, u = r * r,
|
|
2716
|
-
M < 0 && (M = 0), M /= l * y + u *
|
|
2717
|
-
var C = M * s / r * x, E = M * -r / s * f, L = c * C - h * E + (n + t) / 2, S = h * C + c * E + (e + o) / 2, P = (f - C) / s, F = (x - E) / r,
|
|
2718
|
-
return a === 0 &&
|
|
2828
|
+
function je(n, e, t, o, i, a, s, r, h, c) {
|
|
2829
|
+
var f = c * (n - t) / 2 + h * (e - o) / 2, x = -h * (n - t) / 2 + c * (e - o) / 2, l = s * s, u = r * r, m = f * f, y = x * x, M = l * u - l * y - u * m;
|
|
2830
|
+
M < 0 && (M = 0), M /= l * y + u * m, M = Math.sqrt(M) * (i === a ? -1 : 1);
|
|
2831
|
+
var C = M * s / r * x, E = M * -r / s * f, L = c * C - h * E + (n + t) / 2, S = h * C + c * E + (e + o) / 2, P = (f - C) / s, F = (x - E) / r, H = (-f - C) / s, X = (-x - E) / r, z = bt(1, 0, P, F), G = bt(P, F, H, X);
|
|
2832
|
+
return a === 0 && G > 0 && (G -= C0), a === 1 && G < 0 && (G += C0), [L, S, z, G];
|
|
2719
2833
|
}
|
|
2720
|
-
function
|
|
2834
|
+
function ze(n, e) {
|
|
2721
2835
|
var t = 1.3333333333333333 * Math.tan(e / 4), o = Math.cos(n), i = Math.sin(n), a = Math.cos(n + e), s = Math.sin(n + e);
|
|
2722
2836
|
return [o, i, o - i * t, i + o * t, a + s * t, s - a * t, a, s];
|
|
2723
2837
|
}
|
|
2724
|
-
function
|
|
2838
|
+
function Ue(n, e, t, o, i, a, s, r, h) {
|
|
2725
2839
|
var c = Math.sin(i * C0 / 360), f = Math.cos(i * C0 / 360), x = f * (n - r) / 2 + c * (e - h) / 2, l = -c * (n - r) / 2 + f * (e - h) / 2;
|
|
2726
2840
|
if (x === 0 && l === 0)
|
|
2727
2841
|
return [];
|
|
@@ -2730,32 +2844,32 @@ function Ne(n, e, t, o, i, a, s, r, h) {
|
|
|
2730
2844
|
t = Math.abs(t), o = Math.abs(o);
|
|
2731
2845
|
var u = x * x / (t * t) + l * l / (o * o);
|
|
2732
2846
|
u > 1 && (t *= Math.sqrt(u), o *= Math.sqrt(u));
|
|
2733
|
-
var
|
|
2847
|
+
var m = je(n, e, r, h, a, s, t, o, c, f), y = [], M = m[2], C = m[3], E = Math.max(Math.ceil(Math.abs(C) / (C0 / 4)), 1);
|
|
2734
2848
|
C /= E;
|
|
2735
2849
|
for (var L = 0; L < E; L++)
|
|
2736
|
-
y.push(
|
|
2850
|
+
y.push(ze(M, C)), M += C;
|
|
2737
2851
|
return y.map(function(S) {
|
|
2738
2852
|
for (var P = 0; P < S.length; P += 2) {
|
|
2739
|
-
var F = S[P + 0],
|
|
2740
|
-
F *= t,
|
|
2741
|
-
var
|
|
2742
|
-
S[P + 0] =
|
|
2853
|
+
var F = S[P + 0], H = S[P + 1];
|
|
2854
|
+
F *= t, H *= o;
|
|
2855
|
+
var X = f * F - c * H, z = c * F + f * H;
|
|
2856
|
+
S[P + 0] = X + m[0], S[P + 1] = z + m[1];
|
|
2743
2857
|
}
|
|
2744
2858
|
return S;
|
|
2745
2859
|
});
|
|
2746
2860
|
}
|
|
2747
|
-
function
|
|
2748
|
-
return new
|
|
2861
|
+
function Mt(n, e, t, o, i, a, s, r, h) {
|
|
2862
|
+
return new K0(n, e, t, o, i, a, s, r, h);
|
|
2749
2863
|
}
|
|
2750
|
-
function
|
|
2751
|
-
var c = 0, f = [], x = [], l =
|
|
2864
|
+
function K0(n, e, t, o, i, a, s, r, h) {
|
|
2865
|
+
var c = 0, f = [], x = [], l = Ue(n, e, t, o, i, a, s, r, h);
|
|
2752
2866
|
l.forEach(function(u) {
|
|
2753
|
-
var
|
|
2754
|
-
c += y, f.push(y), x.push(
|
|
2867
|
+
var m = new e0(u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]), y = m.getTotalLength();
|
|
2868
|
+
c += y, f.push(y), x.push(m);
|
|
2755
2869
|
}), this.length = c, this.partialLengths = f, this.curves = x;
|
|
2756
2870
|
}
|
|
2757
|
-
|
|
2758
|
-
constructor:
|
|
2871
|
+
K0.prototype = {
|
|
2872
|
+
constructor: K0,
|
|
2759
2873
|
init: function() {
|
|
2760
2874
|
},
|
|
2761
2875
|
getTotalLength: function() {
|
|
@@ -2784,34 +2898,34 @@ V0.prototype = {
|
|
|
2784
2898
|
return { x: t.x, y: t.y, tangentX: e.x, tangentY: e.y };
|
|
2785
2899
|
}
|
|
2786
2900
|
};
|
|
2787
|
-
function
|
|
2788
|
-
return new
|
|
2901
|
+
function t0(n, e, t, o) {
|
|
2902
|
+
return new I0(n, e, t, o);
|
|
2789
2903
|
}
|
|
2790
|
-
function
|
|
2904
|
+
function I0(n, e, t, o) {
|
|
2791
2905
|
this.x0 = n, this.x1 = e, this.y0 = t, this.y1 = o;
|
|
2792
2906
|
}
|
|
2793
|
-
|
|
2907
|
+
I0.prototype.getTotalLength = function() {
|
|
2794
2908
|
return Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
|
|
2795
2909
|
};
|
|
2796
|
-
|
|
2910
|
+
I0.prototype.getPointAtLength = function(n) {
|
|
2797
2911
|
var e = n / Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2)), t = (this.x1 - this.x0) * e, o = (this.y1 - this.y0) * e;
|
|
2798
2912
|
return { x: this.x0 + t, y: this.y0 + o };
|
|
2799
2913
|
};
|
|
2800
|
-
|
|
2914
|
+
I0.prototype.getTangentAtLength = function() {
|
|
2801
2915
|
var n = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
|
|
2802
2916
|
return { x: (this.x1 - this.x0) / n, y: (this.y1 - this.y0) / n };
|
|
2803
2917
|
};
|
|
2804
|
-
|
|
2918
|
+
I0.prototype.getPropertiesAtLength = function(n) {
|
|
2805
2919
|
var e = this.getPointAtLength(n), t = this.getTangentAtLength();
|
|
2806
2920
|
return { x: e.x, y: e.y, tangentX: t.x, tangentY: t.y };
|
|
2807
2921
|
};
|
|
2808
|
-
function
|
|
2922
|
+
function He(n) {
|
|
2809
2923
|
var e = 0, t = [], o = [];
|
|
2810
2924
|
function i(s) {
|
|
2811
2925
|
if (!s)
|
|
2812
2926
|
return null;
|
|
2813
|
-
for (var r =
|
|
2814
|
-
r[l][0] === "M" ? (h = [r[l][1], r[l][2]], x = [h[0], h[1]], o.push(null)) : r[l][0] === "m" ? (h = [r[l][1] + h[0], r[l][2] + h[1]], x = [h[0], h[1]], o.push(null)) : r[l][0] === "L" ? (e = e + Math.sqrt(Math.pow(h[0] - r[l][1], 2) + Math.pow(h[1] - r[l][2], 2)), o.push(new
|
|
2927
|
+
for (var r = Ce(s), h = [0, 0], c = [0, 0], f, x, l = 0; l < r.length; l++)
|
|
2928
|
+
r[l][0] === "M" ? (h = [r[l][1], r[l][2]], x = [h[0], h[1]], o.push(null)) : r[l][0] === "m" ? (h = [r[l][1] + h[0], r[l][2] + h[1]], x = [h[0], h[1]], o.push(null)) : r[l][0] === "L" ? (e = e + Math.sqrt(Math.pow(h[0] - r[l][1], 2) + Math.pow(h[1] - r[l][2], 2)), o.push(new t0(h[0], r[l][1], h[1], r[l][2])), h = [r[l][1], r[l][2]]) : r[l][0] === "l" ? (e = e + Math.sqrt(Math.pow(r[l][1], 2) + Math.pow(r[l][2], 2)), o.push(new t0(h[0], r[l][1] + h[0], h[1], r[l][2] + h[1])), h = [r[l][1] + h[0], r[l][2] + h[1]]) : r[l][0] === "H" ? (e = e + Math.abs(h[0] - r[l][1]), o.push(new t0(h[0], r[l][1], h[1], h[1])), h[0] = r[l][1]) : r[l][0] === "h" ? (e = e + Math.abs(r[l][1]), o.push(new t0(h[0], h[0] + r[l][1], h[1], h[1])), h[0] = r[l][1] + h[0]) : r[l][0] === "V" ? (e = e + Math.abs(h[1] - r[l][1]), o.push(new t0(h[0], h[0], h[1], r[l][1])), h[1] = r[l][1]) : r[l][0] === "v" ? (e = e + Math.abs(r[l][1]), o.push(new t0(h[0], h[0], h[1], h[1] + r[l][1])), h[1] = r[l][1] + h[1]) : r[l][0] === "z" || r[l][0] === "Z" ? (e = e + Math.sqrt(Math.pow(x[0] - h[0], 2) + Math.pow(x[1] - h[1], 2)), o.push(new t0(h[0], x[0], h[1], x[1])), h = [x[0], x[1]]) : r[l][0] === "C" ? (f = new e0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], r[l][6]), e = e + f.getTotalLength(), h = [r[l][5], r[l][6]], o.push(f)) : r[l][0] === "c" ? (f = new e0(h[0], h[1], h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4], h[0] + r[l][5], h[1] + r[l][6]), e = e + f.getTotalLength(), h = [r[l][5] + h[0], r[l][6] + h[1]], o.push(f)) : r[l][0] === "S" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? f = new e0(h[0], h[1], 2 * h[0] - r[l - 1][r[l - 1].length - 4], 2 * h[1] - r[l - 1][r[l - 1].length - 3], r[l][1], r[l][2], r[l][3], r[l][4]) : f = new e0(h[0], h[1], h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]), e = e + f.getTotalLength(), h = [r[l][3], r[l][4]], o.push(f)) : r[l][0] === "s" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? f = new e0(h[0], h[1], h[0] + f.d.x - f.c.x, h[1] + f.d.y - f.c.y, h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]) : f = new e0(h[0], h[1], h[0], h[1], h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]), e = e + f.getTotalLength(), h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(f)) : r[l][0] === "Q" ? (h[0] != r[l][1] && h[1] != r[l][2] ? f = new e0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]) : f = new t0(r[l][1], r[l][3], r[l][2], r[l][4]), e = e + f.getTotalLength(), o.push(f), h = [r[l][3], r[l][4]], c = [r[l][1], r[l][2]]) : r[l][0] === "q" ? (r[l][1] == 0 && r[l][2] == 0 ? f = new t0(h[0] + r[l][1], h[0] + r[l][3], h[1] + r[l][2], h[1] + r[l][4]) : f = new e0(h[0], h[1], h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]), e = e + f.getTotalLength(), c = [h[0] + r[l][1], h[1] + r[l][2]], h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(f)) : r[l][0] === "T" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? f = new e0(h[0], h[1], 2 * h[0] - c[0], 2 * h[1] - c[1], r[l][1], r[l][2]) : f = new t0(h[0], r[l][1], h[1], r[l][2]), o.push(f), e = e + f.getTotalLength(), c = [2 * h[0] - c[0], 2 * h[1] - c[1]], h = [r[l][1], r[l][2]]) : r[l][0] === "t" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? f = new e0(h[0], h[1], 2 * h[0] - c[0], 2 * h[1] - c[1], h[0] + r[l][1], h[1] + r[l][2]) : f = new t0(h[0], h[0] + r[l][1], h[1], h[1] + r[l][2]), e = e + f.getTotalLength(), c = [2 * h[0] - c[0], 2 * h[1] - c[1]], h = [r[l][1] + h[0], r[l][2] + h[0]], o.push(f)) : r[l][0] === "A" ? (f = new Mt(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], r[l][6], r[l][7]), e = e + f.getTotalLength(), h = [r[l][6], r[l][7]], o.push(f)) : r[l][0] === "a" && (f = new Mt(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], h[0] + r[l][6], h[1] + r[l][7]), e = e + f.getTotalLength(), h = [h[0] + r[l][6], h[1] + r[l][7]], o.push(f)), t.push(e);
|
|
2815
2929
|
return i;
|
|
2816
2930
|
}
|
|
2817
2931
|
i.getTotalLength = function() {
|
|
@@ -2837,25 +2951,25 @@ function De(n) {
|
|
|
2837
2951
|
function O0(n, e) {
|
|
2838
2952
|
return Math.sqrt((n[0] - e[0]) * (n[0] - e[0]) + (n[1] - e[1]) * (n[1] - e[1]));
|
|
2839
2953
|
}
|
|
2840
|
-
function
|
|
2954
|
+
function Bt(n, e, t) {
|
|
2841
2955
|
return [n[0] + (e[0] - n[0]) * t, n[1] + (e[1] - n[1]) * t];
|
|
2842
2956
|
}
|
|
2843
|
-
function
|
|
2957
|
+
function Ge(n, e) {
|
|
2844
2958
|
return O0(n, e) < 1e-9;
|
|
2845
2959
|
}
|
|
2846
|
-
function
|
|
2847
|
-
let o = n.map((i, a) =>
|
|
2960
|
+
function $e(n, e, t) {
|
|
2961
|
+
let o = n.map((i, a) => We(i, e[a]));
|
|
2848
2962
|
return function(i) {
|
|
2849
2963
|
let a = o.map((s) => s(i));
|
|
2850
|
-
return t ?
|
|
2964
|
+
return t ? Ze(a) : a;
|
|
2851
2965
|
};
|
|
2852
2966
|
}
|
|
2853
|
-
function
|
|
2967
|
+
function We(n, e) {
|
|
2854
2968
|
return function(t) {
|
|
2855
2969
|
return n.map((o, i) => o + t * (e[i] - o));
|
|
2856
2970
|
};
|
|
2857
2971
|
}
|
|
2858
|
-
function
|
|
2972
|
+
function k0(n) {
|
|
2859
2973
|
return typeof n == "number" && isFinite(n);
|
|
2860
2974
|
}
|
|
2861
2975
|
const Q0 = `All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).
|
|
@@ -2863,20 +2977,20 @@ Example valid ways of supplying a shape would be:
|
|
|
2863
2977
|
[[0, 0], [10, 0], [10, 10]]
|
|
2864
2978
|
"M0,0 L10,0 L10,10Z"
|
|
2865
2979
|
`;
|
|
2866
|
-
function
|
|
2867
|
-
return new
|
|
2980
|
+
function Ye(n) {
|
|
2981
|
+
return new Te(n).abs();
|
|
2868
2982
|
}
|
|
2869
|
-
function
|
|
2983
|
+
function Xe(n) {
|
|
2870
2984
|
return n.toString().split("M").map((e, t) => (e = e.trim(), t && e ? "M" + e : e)).filter((e) => e);
|
|
2871
2985
|
}
|
|
2872
|
-
function
|
|
2986
|
+
function Ze(n) {
|
|
2873
2987
|
return "M" + n.join("L") + "Z";
|
|
2874
2988
|
}
|
|
2875
|
-
function
|
|
2876
|
-
let t =
|
|
2877
|
-
return
|
|
2989
|
+
function Ve(n, e) {
|
|
2990
|
+
let t = Ye(n);
|
|
2991
|
+
return Ke(t) || Qe(t, e);
|
|
2878
2992
|
}
|
|
2879
|
-
function
|
|
2993
|
+
function Ke(n) {
|
|
2880
2994
|
let e = n.segments || [], t = [];
|
|
2881
2995
|
if (!e.length || e[0][0] !== "M")
|
|
2882
2996
|
return !1;
|
|
@@ -2895,11 +3009,11 @@ function Xe(n) {
|
|
|
2895
3009
|
}
|
|
2896
3010
|
return t.length ? { ring: t } : !1;
|
|
2897
3011
|
}
|
|
2898
|
-
function
|
|
2899
|
-
let t =
|
|
3012
|
+
function Qe(n, e) {
|
|
3013
|
+
let t = Xe(n)[0], o = [], i, a, s = 3;
|
|
2900
3014
|
if (!t)
|
|
2901
3015
|
throw new TypeError(Q0);
|
|
2902
|
-
a =
|
|
3016
|
+
a = Je(t), i = a.getTotalLength(), e && k0(e) && e > 0 && (s = Math.max(s, Math.ceil(i / e)));
|
|
2903
3017
|
for (let r = 0; r < s; r++) {
|
|
2904
3018
|
let h = a.getPointAtLength(i * r / s);
|
|
2905
3019
|
o.push([h.x, h.y]);
|
|
@@ -2909,51 +3023,51 @@ function Ge(n, e) {
|
|
|
2909
3023
|
skipBisect: !0
|
|
2910
3024
|
};
|
|
2911
3025
|
}
|
|
2912
|
-
function
|
|
3026
|
+
function Je(n) {
|
|
2913
3027
|
if (typeof window < "u" && window && window.document)
|
|
2914
3028
|
try {
|
|
2915
3029
|
let e = window.document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2916
3030
|
return e.setAttributeNS(null, "d", n), e;
|
|
2917
3031
|
} catch {
|
|
2918
3032
|
}
|
|
2919
|
-
return
|
|
3033
|
+
return He(n);
|
|
2920
3034
|
}
|
|
2921
|
-
function
|
|
2922
|
-
const t = n.length + e, o =
|
|
3035
|
+
function Lt(n, e) {
|
|
3036
|
+
const t = n.length + e, o = xe(n) / e;
|
|
2923
3037
|
let i = 0, a = 0, s = o / 2;
|
|
2924
3038
|
for (; n.length < t; ) {
|
|
2925
3039
|
let r = n[i], h = n[(i + 1) % n.length], c = O0(r, h);
|
|
2926
3040
|
if (s <= a + c) {
|
|
2927
|
-
n.splice(i + 1, 0, c ?
|
|
3041
|
+
n.splice(i + 1, 0, c ? Bt(r, h, (s - a) / c) : r.slice(0)), s += o;
|
|
2928
3042
|
continue;
|
|
2929
3043
|
}
|
|
2930
3044
|
a += c, i++;
|
|
2931
3045
|
}
|
|
2932
3046
|
}
|
|
2933
|
-
function
|
|
3047
|
+
function tn(n, e = 1 / 0) {
|
|
2934
3048
|
for (let t = 0; t < n.length; t++) {
|
|
2935
3049
|
let o = n[t], i = t === n.length - 1 ? n[0] : n[t + 1];
|
|
2936
3050
|
for (; O0(o, i) > e; )
|
|
2937
|
-
i =
|
|
3051
|
+
i = Bt(o, i, 0.5), n.splice(t + 1, 0, i);
|
|
2938
3052
|
}
|
|
2939
3053
|
}
|
|
2940
|
-
function
|
|
3054
|
+
function Tt(n, e) {
|
|
2941
3055
|
let t, o, i;
|
|
2942
3056
|
if (typeof n == "string") {
|
|
2943
|
-
let a =
|
|
3057
|
+
let a = Ve(n, e);
|
|
2944
3058
|
n = a.ring, i = a.skipBisect;
|
|
2945
3059
|
} else if (!Array.isArray(n))
|
|
2946
3060
|
throw new TypeError(Q0);
|
|
2947
|
-
if (t = n.slice(0), !
|
|
3061
|
+
if (t = n.slice(0), !en(t))
|
|
2948
3062
|
throw new TypeError(Q0);
|
|
2949
|
-
return t.length > 1 &&
|
|
3063
|
+
return t.length > 1 && Ge(t[0], t[t.length - 1]) && t.pop(), o = de(t), o > 0 && t.reverse(), !i && e && k0(e) && e > 0 && tn(t, e), t;
|
|
2950
3064
|
}
|
|
2951
|
-
function
|
|
3065
|
+
function en(n) {
|
|
2952
3066
|
return n.every(function(e) {
|
|
2953
|
-
return Array.isArray(e) && e.length >= 2 &&
|
|
3067
|
+
return Array.isArray(e) && e.length >= 2 && k0(e[0]) && k0(e[1]);
|
|
2954
3068
|
});
|
|
2955
3069
|
}
|
|
2956
|
-
function
|
|
3070
|
+
function nn(n, e) {
|
|
2957
3071
|
let t = n.length, o = 1 / 0, i, a, s;
|
|
2958
3072
|
for (let r = 0; r < t; r++)
|
|
2959
3073
|
a = 0, e.forEach(function(h, c) {
|
|
@@ -2962,38 +3076,38 @@ function Ve(n, e) {
|
|
|
2962
3076
|
}), a < o && (o = a, i = r);
|
|
2963
3077
|
i && (s = n.splice(0, i), n.splice(n.length, 0, ...s));
|
|
2964
3078
|
}
|
|
2965
|
-
function
|
|
2966
|
-
let i =
|
|
3079
|
+
function rn(n, e, { maxSegmentLength: t = 10, string: o = !0 } = {}) {
|
|
3080
|
+
let i = Tt(n, t), a = Tt(e, t), s = on(i, a, o);
|
|
2967
3081
|
return !o || typeof n != "string" && typeof e != "string" ? s : (r) => r < 1e-4 && typeof n == "string" ? n : 1 - r < 1e-4 && typeof e == "string" ? e : s(r);
|
|
2968
3082
|
}
|
|
2969
|
-
function
|
|
3083
|
+
function on(n, e, t) {
|
|
2970
3084
|
let o;
|
|
2971
|
-
return o = n.length - e.length,
|
|
3085
|
+
return o = n.length - e.length, Lt(n, o < 0 ? o * -1 : 0), Lt(e, o > 0 ? o : 0), nn(n, e), $e(n, e, t);
|
|
2972
3086
|
}
|
|
2973
|
-
var _0 = { exports: {} },
|
|
2974
|
-
function
|
|
2975
|
-
if (
|
|
2976
|
-
|
|
3087
|
+
var _0 = { exports: {} }, Pt;
|
|
3088
|
+
function sn() {
|
|
3089
|
+
if (Pt) return _0.exports;
|
|
3090
|
+
Pt = 1, _0.exports = n, _0.exports.default = n;
|
|
2977
3091
|
function n(g, d, p) {
|
|
2978
3092
|
p = p || 2;
|
|
2979
|
-
var v = d && d.length, w = v ? d[0] * p : g.length,
|
|
2980
|
-
if (!
|
|
2981
|
-
var T,
|
|
2982
|
-
if (v && (
|
|
2983
|
-
T =
|
|
2984
|
-
for (var
|
|
2985
|
-
|
|
2986
|
-
|
|
3093
|
+
var v = d && d.length, w = v ? d[0] * p : g.length, A = e(g, 0, w, p, !0), b = [];
|
|
3094
|
+
if (!A || A.next === A.prev) return b;
|
|
3095
|
+
var T, O, _, U, B, R, Y;
|
|
3096
|
+
if (v && (A = h(g, d, A, p)), g.length > 80 * p) {
|
|
3097
|
+
T = _ = g[0], O = U = g[1];
|
|
3098
|
+
for (var D = p; D < w; D += p)
|
|
3099
|
+
B = g[D], R = g[D + 1], B < T && (T = B), R < O && (O = R), B > _ && (_ = B), R > U && (U = R);
|
|
3100
|
+
Y = Math.max(_ - T, U - O), Y = Y !== 0 ? 32767 / Y : 0;
|
|
2987
3101
|
}
|
|
2988
|
-
return o(
|
|
3102
|
+
return o(A, b, p, T, O, Y, 0), b;
|
|
2989
3103
|
}
|
|
2990
3104
|
function e(g, d, p, v, w) {
|
|
2991
|
-
var
|
|
2992
|
-
if (w ===
|
|
2993
|
-
for (
|
|
3105
|
+
var A, b;
|
|
3106
|
+
if (w === F0(g, d, p, v) > 0)
|
|
3107
|
+
for (A = d; A < p; A += v) b = p0(A, g[A], g[A + 1], b);
|
|
2994
3108
|
else
|
|
2995
|
-
for (
|
|
2996
|
-
return b && S(b, b.next) && (
|
|
3109
|
+
for (A = p - v; A >= d; A -= v) b = p0(A, g[A], g[A + 1], b);
|
|
3110
|
+
return b && S(b, b.next) && (c0(b), b = b.next), b;
|
|
2997
3111
|
}
|
|
2998
3112
|
function t(g, d) {
|
|
2999
3113
|
if (!g) return g;
|
|
@@ -3001,23 +3115,23 @@ function tn() {
|
|
|
3001
3115
|
var p = g, v;
|
|
3002
3116
|
do
|
|
3003
3117
|
if (v = !1, !p.steiner && (S(p, p.next) || L(p.prev, p, p.next) === 0)) {
|
|
3004
|
-
if (
|
|
3118
|
+
if (c0(p), p = d = p.prev, p === p.next) break;
|
|
3005
3119
|
v = !0;
|
|
3006
3120
|
} else
|
|
3007
3121
|
p = p.next;
|
|
3008
3122
|
while (v || p !== d);
|
|
3009
3123
|
return d;
|
|
3010
3124
|
}
|
|
3011
|
-
function o(g, d, p, v, w,
|
|
3125
|
+
function o(g, d, p, v, w, A, b) {
|
|
3012
3126
|
if (g) {
|
|
3013
|
-
!b &&
|
|
3014
|
-
for (var T = g,
|
|
3015
|
-
if (
|
|
3016
|
-
d.push(
|
|
3127
|
+
!b && A && u(g, v, w, A);
|
|
3128
|
+
for (var T = g, O, _; g.prev !== g.next; ) {
|
|
3129
|
+
if (O = g.prev, _ = g.next, A ? a(g, v, w, A) : i(g)) {
|
|
3130
|
+
d.push(O.i / p | 0), d.push(g.i / p | 0), d.push(_.i / p | 0), c0(g), g = _.next, T = _.next;
|
|
3017
3131
|
continue;
|
|
3018
3132
|
}
|
|
3019
|
-
if (g =
|
|
3020
|
-
b ? b === 1 ? (g = s(t(g), d, p), o(g, d, p, v, w,
|
|
3133
|
+
if (g = _, g === T) {
|
|
3134
|
+
b ? b === 1 ? (g = s(t(g), d, p), o(g, d, p, v, w, A, 2)) : b === 2 && r(g, d, p, v, w, A) : o(t(g), d, p, v, w, A, 1);
|
|
3021
3135
|
break;
|
|
3022
3136
|
}
|
|
3023
3137
|
}
|
|
@@ -3026,44 +3140,44 @@ function tn() {
|
|
|
3026
3140
|
function i(g) {
|
|
3027
3141
|
var d = g.prev, p = g, v = g.next;
|
|
3028
3142
|
if (L(d, p, v) >= 0) return !1;
|
|
3029
|
-
for (var w = d.x,
|
|
3030
|
-
if (
|
|
3031
|
-
|
|
3143
|
+
for (var w = d.x, A = p.x, b = v.x, T = d.y, O = p.y, _ = v.y, U = w < A ? w < b ? w : b : A < b ? A : b, B = T < O ? T < _ ? T : _ : O < _ ? O : _, R = w > A ? w > b ? w : b : A > b ? A : b, Y = T > O ? T > _ ? T : _ : O > _ ? O : _, D = v.next; D !== d; ) {
|
|
3144
|
+
if (D.x >= U && D.x <= R && D.y >= B && D.y <= Y && C(w, T, A, O, b, _, D.x, D.y) && L(D.prev, D, D.next) >= 0) return !1;
|
|
3145
|
+
D = D.next;
|
|
3032
3146
|
}
|
|
3033
3147
|
return !0;
|
|
3034
3148
|
}
|
|
3035
3149
|
function a(g, d, p, v) {
|
|
3036
|
-
var w = g.prev,
|
|
3037
|
-
if (L(w,
|
|
3038
|
-
for (var T = w.x,
|
|
3039
|
-
if (
|
|
3040
|
-
|
|
3150
|
+
var w = g.prev, A = g, b = g.next;
|
|
3151
|
+
if (L(w, A, b) >= 0) return !1;
|
|
3152
|
+
for (var T = w.x, O = A.x, _ = b.x, U = w.y, B = A.y, R = b.y, Y = T < O ? T < _ ? T : _ : O < _ ? O : _, D = U < B ? U < R ? U : R : B < R ? B : R, L0 = T > O ? T > _ ? T : _ : O > _ ? O : _, T0 = U > B ? U > R ? U : R : B > R ? B : R, it = y(Y, D, d, p, v), ot = y(L0, T0, d, p, v), N = g.prevZ, q = g.nextZ; N && N.z >= it && q && q.z <= ot; ) {
|
|
3153
|
+
if (N.x >= Y && N.x <= L0 && N.y >= D && N.y <= T0 && N !== w && N !== b && C(T, U, O, B, _, R, N.x, N.y) && L(N.prev, N, N.next) >= 0 || (N = N.prevZ, q.x >= Y && q.x <= L0 && q.y >= D && q.y <= T0 && q !== w && q !== b && C(T, U, O, B, _, R, q.x, q.y) && L(q.prev, q, q.next) >= 0)) return !1;
|
|
3154
|
+
q = q.nextZ;
|
|
3041
3155
|
}
|
|
3042
|
-
for (;
|
|
3043
|
-
if (
|
|
3044
|
-
|
|
3156
|
+
for (; N && N.z >= it; ) {
|
|
3157
|
+
if (N.x >= Y && N.x <= L0 && N.y >= D && N.y <= T0 && N !== w && N !== b && C(T, U, O, B, _, R, N.x, N.y) && L(N.prev, N, N.next) >= 0) return !1;
|
|
3158
|
+
N = N.prevZ;
|
|
3045
3159
|
}
|
|
3046
|
-
for (;
|
|
3047
|
-
if (
|
|
3048
|
-
|
|
3160
|
+
for (; q && q.z <= ot; ) {
|
|
3161
|
+
if (q.x >= Y && q.x <= L0 && q.y >= D && q.y <= T0 && q !== w && q !== b && C(T, U, O, B, _, R, q.x, q.y) && L(q.prev, q, q.next) >= 0) return !1;
|
|
3162
|
+
q = q.nextZ;
|
|
3049
3163
|
}
|
|
3050
3164
|
return !0;
|
|
3051
3165
|
}
|
|
3052
3166
|
function s(g, d, p) {
|
|
3053
3167
|
var v = g;
|
|
3054
3168
|
do {
|
|
3055
|
-
var w = v.prev,
|
|
3056
|
-
!S(w,
|
|
3169
|
+
var w = v.prev, A = v.next.next;
|
|
3170
|
+
!S(w, A) && P(w, v, v.next, A) && z(w, A) && z(A, w) && (d.push(w.i / p | 0), d.push(v.i / p | 0), d.push(A.i / p | 0), c0(v), c0(v.next), v = g = A), v = v.next;
|
|
3057
3171
|
} while (v !== g);
|
|
3058
3172
|
return t(v);
|
|
3059
3173
|
}
|
|
3060
|
-
function r(g, d, p, v, w,
|
|
3174
|
+
function r(g, d, p, v, w, A) {
|
|
3061
3175
|
var b = g;
|
|
3062
3176
|
do {
|
|
3063
3177
|
for (var T = b.next.next; T !== b.prev; ) {
|
|
3064
3178
|
if (b.i !== T.i && E(b, T)) {
|
|
3065
|
-
var
|
|
3066
|
-
b = t(b, b.next),
|
|
3179
|
+
var O = a0(b, T);
|
|
3180
|
+
b = t(b, b.next), O = t(O, O.next), o(b, d, p, v, w, A, 0), o(O, d, p, v, w, A, 0);
|
|
3067
3181
|
return;
|
|
3068
3182
|
}
|
|
3069
3183
|
T = T.next;
|
|
@@ -3072,11 +3186,11 @@ function tn() {
|
|
|
3072
3186
|
} while (b !== g);
|
|
3073
3187
|
}
|
|
3074
3188
|
function h(g, d, p, v) {
|
|
3075
|
-
var w = [],
|
|
3076
|
-
for (
|
|
3077
|
-
T = d[
|
|
3078
|
-
for (w.sort(c),
|
|
3079
|
-
p = f(w[
|
|
3189
|
+
var w = [], A, b, T, O, _;
|
|
3190
|
+
for (A = 0, b = d.length; A < b; A++)
|
|
3191
|
+
T = d[A] * v, O = A < b - 1 ? d[A + 1] * v : g.length, _ = e(g, T, O, v, !1), _ === _.next && (_.steiner = !0), w.push(M(_));
|
|
3192
|
+
for (w.sort(c), A = 0; A < w.length; A++)
|
|
3193
|
+
p = f(w[A], p);
|
|
3080
3194
|
return p;
|
|
3081
3195
|
}
|
|
3082
3196
|
function c(g, d) {
|
|
@@ -3086,25 +3200,25 @@ function tn() {
|
|
|
3086
3200
|
var p = x(g, d);
|
|
3087
3201
|
if (!p)
|
|
3088
3202
|
return d;
|
|
3089
|
-
var v =
|
|
3203
|
+
var v = a0(p, g);
|
|
3090
3204
|
return t(v, v.next), t(p, p.next);
|
|
3091
3205
|
}
|
|
3092
3206
|
function x(g, d) {
|
|
3093
|
-
var p = d, v = g.x, w = g.y,
|
|
3207
|
+
var p = d, v = g.x, w = g.y, A = -1 / 0, b;
|
|
3094
3208
|
do {
|
|
3095
3209
|
if (w <= p.y && w >= p.next.y && p.next.y !== p.y) {
|
|
3096
3210
|
var T = p.x + (w - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
|
|
3097
|
-
if (T <= v && T >
|
|
3211
|
+
if (T <= v && T > A && (A = T, b = p.x < p.next.x ? p : p.next, T === v))
|
|
3098
3212
|
return b;
|
|
3099
3213
|
}
|
|
3100
3214
|
p = p.next;
|
|
3101
3215
|
} while (p !== d);
|
|
3102
3216
|
if (!b) return null;
|
|
3103
|
-
var
|
|
3217
|
+
var O = b, _ = b.x, U = b.y, B = 1 / 0, R;
|
|
3104
3218
|
p = b;
|
|
3105
3219
|
do
|
|
3106
|
-
v >= p.x && p.x >=
|
|
3107
|
-
while (p !==
|
|
3220
|
+
v >= p.x && p.x >= _ && v !== p.x && C(w < U ? v : A, w, _, U, w < U ? A : v, w, p.x, p.y) && (R = Math.abs(w - p.y) / (v - p.x), z(p, g) && (R < B || R === B && (p.x > b.x || p.x === b.x && l(b, p))) && (b = p, B = R)), p = p.next;
|
|
3221
|
+
while (p !== O);
|
|
3108
3222
|
return b;
|
|
3109
3223
|
}
|
|
3110
3224
|
function l(g, d) {
|
|
@@ -3115,19 +3229,19 @@ function tn() {
|
|
|
3115
3229
|
do
|
|
3116
3230
|
w.z === 0 && (w.z = y(w.x, w.y, d, p, v)), w.prevZ = w.prev, w.nextZ = w.next, w = w.next;
|
|
3117
3231
|
while (w !== g);
|
|
3118
|
-
w.prevZ.nextZ = null, w.prevZ = null,
|
|
3232
|
+
w.prevZ.nextZ = null, w.prevZ = null, m(w);
|
|
3119
3233
|
}
|
|
3120
|
-
function
|
|
3121
|
-
var d, p, v, w,
|
|
3234
|
+
function m(g) {
|
|
3235
|
+
var d, p, v, w, A, b, T, O, _ = 1;
|
|
3122
3236
|
do {
|
|
3123
|
-
for (p = g, g = null,
|
|
3124
|
-
for (b++, v = p, T = 0, d = 0; d <
|
|
3237
|
+
for (p = g, g = null, A = null, b = 0; p; ) {
|
|
3238
|
+
for (b++, v = p, T = 0, d = 0; d < _ && (T++, v = v.nextZ, !!v); d++)
|
|
3125
3239
|
;
|
|
3126
|
-
for (
|
|
3127
|
-
T !== 0 && (
|
|
3240
|
+
for (O = _; T > 0 || O > 0 && v; )
|
|
3241
|
+
T !== 0 && (O === 0 || !v || p.z <= v.z) ? (w = p, p = p.nextZ, T--) : (w = v, v = v.nextZ, O--), A ? A.nextZ = w : g = w, w.prevZ = A, A = w;
|
|
3128
3242
|
p = v;
|
|
3129
3243
|
}
|
|
3130
|
-
|
|
3244
|
+
A.nextZ = null, _ *= 2;
|
|
3131
3245
|
} while (b > 1);
|
|
3132
3246
|
return g;
|
|
3133
3247
|
}
|
|
@@ -3141,12 +3255,12 @@ function tn() {
|
|
|
3141
3255
|
while (d !== g);
|
|
3142
3256
|
return p;
|
|
3143
3257
|
}
|
|
3144
|
-
function C(g, d, p, v, w,
|
|
3145
|
-
return (w - b) * (d - T) >= (g - b) * (
|
|
3258
|
+
function C(g, d, p, v, w, A, b, T) {
|
|
3259
|
+
return (w - b) * (d - T) >= (g - b) * (A - T) && (g - b) * (v - T) >= (p - b) * (d - T) && (p - b) * (A - T) >= (w - b) * (v - T);
|
|
3146
3260
|
}
|
|
3147
3261
|
function E(g, d) {
|
|
3148
|
-
return g.next.i !== d.i && g.prev.i !== d.i && !
|
|
3149
|
-
(
|
|
3262
|
+
return g.next.i !== d.i && g.prev.i !== d.i && !X(g, d) && // dones't intersect other edges
|
|
3263
|
+
(z(g, d) && z(d, g) && G(g, d) && // locally visible
|
|
3150
3264
|
(L(g.prev, g, d.prev) || L(g, d.prev, d)) || // does not create opposite-facing sectors
|
|
3151
3265
|
S(g, d) && L(g.prev, g, g.next) > 0 && L(d.prev, d, d.next) > 0);
|
|
3152
3266
|
}
|
|
@@ -3157,16 +3271,16 @@ function tn() {
|
|
|
3157
3271
|
return g.x === d.x && g.y === d.y;
|
|
3158
3272
|
}
|
|
3159
3273
|
function P(g, d, p, v) {
|
|
3160
|
-
var w =
|
|
3161
|
-
return !!(w !==
|
|
3274
|
+
var w = H(L(g, d, p)), A = H(L(g, d, v)), b = H(L(p, v, g)), T = H(L(p, v, d));
|
|
3275
|
+
return !!(w !== A && b !== T || w === 0 && F(g, p, d) || A === 0 && F(g, v, d) || b === 0 && F(p, g, v) || T === 0 && F(p, d, v));
|
|
3162
3276
|
}
|
|
3163
3277
|
function F(g, d, p) {
|
|
3164
3278
|
return d.x <= Math.max(g.x, p.x) && d.x >= Math.min(g.x, p.x) && d.y <= Math.max(g.y, p.y) && d.y >= Math.min(g.y, p.y);
|
|
3165
3279
|
}
|
|
3166
|
-
function
|
|
3280
|
+
function H(g) {
|
|
3167
3281
|
return g > 0 ? 1 : g < 0 ? -1 : 0;
|
|
3168
3282
|
}
|
|
3169
|
-
function
|
|
3283
|
+
function X(g, d) {
|
|
3170
3284
|
var p = g;
|
|
3171
3285
|
do {
|
|
3172
3286
|
if (p.i !== g.i && p.next.i !== g.i && p.i !== d.i && p.next.i !== d.i && P(p, p.next, g, d)) return !0;
|
|
@@ -3174,66 +3288,66 @@ function tn() {
|
|
|
3174
3288
|
} while (p !== g);
|
|
3175
3289
|
return !1;
|
|
3176
3290
|
}
|
|
3177
|
-
function
|
|
3291
|
+
function z(g, d) {
|
|
3178
3292
|
return L(g.prev, g, g.next) < 0 ? L(g, d, g.next) >= 0 && L(g, g.prev, d) >= 0 : L(g, d, g.prev) < 0 || L(g, g.next, d) < 0;
|
|
3179
3293
|
}
|
|
3180
|
-
function
|
|
3181
|
-
var p = g, v = !1, w = (g.x + d.x) / 2,
|
|
3294
|
+
function G(g, d) {
|
|
3295
|
+
var p = g, v = !1, w = (g.x + d.x) / 2, A = (g.y + d.y) / 2;
|
|
3182
3296
|
do
|
|
3183
|
-
p.y >
|
|
3297
|
+
p.y > A != p.next.y > A && p.next.y !== p.y && w < (p.next.x - p.x) * (A - p.y) / (p.next.y - p.y) + p.x && (v = !v), p = p.next;
|
|
3184
3298
|
while (p !== g);
|
|
3185
3299
|
return v;
|
|
3186
3300
|
}
|
|
3187
|
-
function
|
|
3188
|
-
var p = new
|
|
3189
|
-
return g.next = d, d.prev = g, p.next = w, w.prev = p, v.next = p, p.prev = v,
|
|
3301
|
+
function a0(g, d) {
|
|
3302
|
+
var p = new J(g.i, g.x, g.y), v = new J(d.i, d.x, d.y), w = g.next, A = d.prev;
|
|
3303
|
+
return g.next = d, d.prev = g, p.next = w, w.prev = p, v.next = p, p.prev = v, A.next = v, v.prev = A, v;
|
|
3190
3304
|
}
|
|
3191
|
-
function
|
|
3192
|
-
var w = new
|
|
3305
|
+
function p0(g, d, p, v) {
|
|
3306
|
+
var w = new J(g, d, p);
|
|
3193
3307
|
return v ? (w.next = v.next, w.prev = v, v.next.prev = w, v.next = w) : (w.prev = w, w.next = w), w;
|
|
3194
3308
|
}
|
|
3195
|
-
function
|
|
3309
|
+
function c0(g) {
|
|
3196
3310
|
g.next.prev = g.prev, g.prev.next = g.next, g.prevZ && (g.prevZ.nextZ = g.nextZ), g.nextZ && (g.nextZ.prevZ = g.prevZ);
|
|
3197
3311
|
}
|
|
3198
|
-
function
|
|
3312
|
+
function J(g, d, p) {
|
|
3199
3313
|
this.i = g, this.x = d, this.y = p, this.prev = null, this.next = null, this.z = 0, this.prevZ = null, this.nextZ = null, this.steiner = !1;
|
|
3200
3314
|
}
|
|
3201
3315
|
n.deviation = function(g, d, p, v) {
|
|
3202
|
-
var w = d && d.length,
|
|
3316
|
+
var w = d && d.length, A = w ? d[0] * p : g.length, b = Math.abs(F0(g, 0, A, p));
|
|
3203
3317
|
if (w)
|
|
3204
|
-
for (var T = 0,
|
|
3205
|
-
var
|
|
3206
|
-
b -= Math.abs(
|
|
3318
|
+
for (var T = 0, O = d.length; T < O; T++) {
|
|
3319
|
+
var _ = d[T] * p, U = T < O - 1 ? d[T + 1] * p : g.length;
|
|
3320
|
+
b -= Math.abs(F0(g, _, U, p));
|
|
3207
3321
|
}
|
|
3208
|
-
var
|
|
3322
|
+
var B = 0;
|
|
3209
3323
|
for (T = 0; T < v.length; T += 3) {
|
|
3210
|
-
var R = v[T] * p,
|
|
3211
|
-
|
|
3212
|
-
(g[R] - g[
|
|
3324
|
+
var R = v[T] * p, Y = v[T + 1] * p, D = v[T + 2] * p;
|
|
3325
|
+
B += Math.abs(
|
|
3326
|
+
(g[R] - g[D]) * (g[Y + 1] - g[R + 1]) - (g[R] - g[Y]) * (g[D + 1] - g[R + 1])
|
|
3213
3327
|
);
|
|
3214
3328
|
}
|
|
3215
|
-
return b === 0 &&
|
|
3329
|
+
return b === 0 && B === 0 ? 0 : Math.abs((B - b) / b);
|
|
3216
3330
|
};
|
|
3217
|
-
function
|
|
3218
|
-
for (var w = 0,
|
|
3219
|
-
w += (g[b] - g[
|
|
3331
|
+
function F0(g, d, p, v) {
|
|
3332
|
+
for (var w = 0, A = d, b = p - v; A < p; A += v)
|
|
3333
|
+
w += (g[b] - g[A]) * (g[A + 1] + g[b + 1]), b = A;
|
|
3220
3334
|
return w;
|
|
3221
3335
|
}
|
|
3222
3336
|
return n.flatten = function(g) {
|
|
3223
3337
|
for (var d = g[0][0].length, p = { vertices: [], holes: [], dimensions: d }, v = 0, w = 0; w < g.length; w++) {
|
|
3224
|
-
for (var
|
|
3225
|
-
for (var b = 0; b < d; b++) p.vertices.push(g[w][
|
|
3338
|
+
for (var A = 0; A < g[w].length; A++)
|
|
3339
|
+
for (var b = 0; b < d; b++) p.vertices.push(g[w][A][b]);
|
|
3226
3340
|
w > 0 && (v += g[w - 1].length, p.holes.push(v));
|
|
3227
3341
|
}
|
|
3228
3342
|
return p;
|
|
3229
3343
|
}, _0.exports;
|
|
3230
3344
|
}
|
|
3231
|
-
|
|
3232
|
-
function
|
|
3345
|
+
sn();
|
|
3346
|
+
function Dt(n, e) {
|
|
3233
3347
|
return n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
|
|
3234
3348
|
}
|
|
3235
|
-
function
|
|
3236
|
-
return n.length === 1 && (n =
|
|
3349
|
+
function an(n) {
|
|
3350
|
+
return n.length === 1 && (n = hn(n)), {
|
|
3237
3351
|
left: function(e, t, o, i) {
|
|
3238
3352
|
for (o == null && (o = 0), i == null && (i = e.length); o < i; ) {
|
|
3239
3353
|
var a = o + i >>> 1;
|
|
@@ -3250,31 +3364,31 @@ function en(n) {
|
|
|
3250
3364
|
}
|
|
3251
3365
|
};
|
|
3252
3366
|
}
|
|
3253
|
-
function
|
|
3367
|
+
function hn(n) {
|
|
3254
3368
|
return function(e, t) {
|
|
3255
|
-
return
|
|
3369
|
+
return Dt(n(e), t);
|
|
3256
3370
|
};
|
|
3257
3371
|
}
|
|
3258
|
-
|
|
3259
|
-
function
|
|
3260
|
-
const o =
|
|
3372
|
+
an(Dt);
|
|
3373
|
+
function _n(n, e, t = 3) {
|
|
3374
|
+
const o = rn(n, e, { maxSegmentLength: t });
|
|
3261
3375
|
return {
|
|
3262
3376
|
check: (i) => typeof i == "string",
|
|
3263
3377
|
interpolate: (i, a, s) => o(s)
|
|
3264
3378
|
};
|
|
3265
3379
|
}
|
|
3266
|
-
function
|
|
3380
|
+
function kn(n) {
|
|
3267
3381
|
const e = (o) => n.width * o, t = (o) => n.height * o;
|
|
3268
3382
|
return {
|
|
3269
3383
|
scaleX: e,
|
|
3270
3384
|
scaleY: t,
|
|
3271
|
-
position: (o, i) =>
|
|
3385
|
+
position: (o, i) => $({
|
|
3272
3386
|
x: e(o),
|
|
3273
3387
|
y: t(i)
|
|
3274
3388
|
})
|
|
3275
3389
|
};
|
|
3276
3390
|
}
|
|
3277
|
-
function
|
|
3391
|
+
function On(n) {
|
|
3278
3392
|
const e = [];
|
|
3279
3393
|
if (n.isAllKey) {
|
|
3280
3394
|
for (let t = 0; t <= n.animations.length; t++)
|
|
@@ -3286,47 +3400,49 @@ function Cn(n) {
|
|
|
3286
3400
|
}), n.isEndKey && e[e.length - 1] !== n.animations.length && e.push(n.animations.length), e;
|
|
3287
3401
|
}
|
|
3288
3402
|
export {
|
|
3289
|
-
|
|
3290
|
-
|
|
3403
|
+
x0 as Alignment,
|
|
3404
|
+
n0 as Anchor,
|
|
3291
3405
|
et as Animate,
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3406
|
+
xn as Arrow,
|
|
3407
|
+
Pn as BrowserCanvasRenderer,
|
|
3408
|
+
yn as Circle,
|
|
3409
|
+
W as Color,
|
|
3296
3410
|
tt as Easing,
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
S1 as
|
|
3411
|
+
cn as FadeIn,
|
|
3412
|
+
un as FadeOut,
|
|
3413
|
+
p1 as FontStyle,
|
|
3414
|
+
x1 as FontWeight,
|
|
3415
|
+
vn as Grid,
|
|
3416
|
+
st as Group,
|
|
3417
|
+
fn as Hide,
|
|
3418
|
+
pn as IFrame,
|
|
3419
|
+
wn as Image,
|
|
3420
|
+
mn as Line,
|
|
3421
|
+
An as Mask,
|
|
3422
|
+
j as ObjectType,
|
|
3423
|
+
In as Opaque,
|
|
3424
|
+
bn as Path,
|
|
3425
|
+
Cn as Pause,
|
|
3426
|
+
Mn as Polygon,
|
|
3427
|
+
$ as Position,
|
|
3428
|
+
T1 as Presentation,
|
|
3429
|
+
Ln as Rectangle,
|
|
3430
|
+
Tn as SVG,
|
|
3431
|
+
dn as ScreenCapture,
|
|
3432
|
+
gn as Show,
|
|
3433
|
+
i0 as Size,
|
|
3434
|
+
En as Slide,
|
|
3435
|
+
s0 as SlideObject,
|
|
3436
|
+
Et as SlideWebExtra,
|
|
3437
|
+
m1 as Text,
|
|
3438
|
+
Sn as TextUnit,
|
|
3439
|
+
g1 as Transparent,
|
|
3440
|
+
Ct as Update,
|
|
3441
|
+
On as getKeySlideBuildIndices,
|
|
3442
|
+
kn as getSizingFunctions,
|
|
3443
|
+
_n as getSmoothPathInterpolator,
|
|
3444
|
+
w1 as getTextContentLength,
|
|
3445
|
+
S1 as interpolateColor,
|
|
3446
|
+
_1 as interpolateNumber
|
|
3332
3447
|
};
|
|
3448
|
+
//# sourceMappingURL=presenter.mjs.map
|