presenter 0.7.5 → 0.8.1
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.js +26 -26
- package/dist/export.js.map +1 -1
- package/dist/export.mjs +2599 -2566
- package/dist/export.mjs.map +1 -1
- package/dist/extras/IFrame.d.ts +2 -2
- package/dist/objects/Circle.d.ts +3 -3
- package/dist/objects/Image.d.ts +1 -1
- package/dist/objects/Path.d.ts +2 -2
- package/dist/objects/Polygon.d.ts +3 -3
- package/dist/objects/Rectangle.d.ts +4 -4
- package/dist/presenter.js +2 -2
- package/dist/presenter.js.map +1 -1
- package/dist/presenter.mjs +971 -939
- package/dist/presenter.mjs.map +1 -1
- package/dist/renderer/browser-canvas/utils/text/getTextUnitMeasurements.d.ts +6 -1
- package/dist/types/TextStyle.d.ts +2 -0
- package/dist/utils/objects/circle/getCircleInsetFillPath.d.ts +1 -1
- package/dist/utils/objects/rectangle/getRectangleInsetFillPath.d.ts +1 -1
- package/dist/utils/objects/rectangle/getRoundedRectanglePath.d.ts +1 -1
- package/dist/utils/objects/text/getTextScriptVariant.d.ts +8 -0
- package/package.json +1 -1
package/dist/presenter.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var zt = Object.defineProperty;
|
|
2
|
+
var Ut = (n, e, t) => e in n ? zt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var k = (n, e, t) => Ut(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const f0 = {
|
|
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,10 +9,10 @@ const u0 = {
|
|
|
9
9
|
/** Represents an immediate update to an object's properties without animation. */
|
|
10
10
|
UPDATE: "Update"
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function Yt(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
18
|
function Xt(n) {
|
|
@@ -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;
|
|
@@ -43,18 +43,18 @@ var Ht = (function n(e) {
|
|
|
43
43
|
const tt = {
|
|
44
44
|
LINEAR: (n) => n,
|
|
45
45
|
CUBIC: Xt,
|
|
46
|
-
CUBIC_IN:
|
|
47
|
-
CUBIC_OUT:
|
|
48
|
-
BACK_IN_OUT:
|
|
49
|
-
},
|
|
46
|
+
CUBIC_IN: Yt,
|
|
47
|
+
CUBIC_OUT: Ht,
|
|
48
|
+
BACK_IN_OUT: $t.overshoot(0.8)
|
|
49
|
+
}, Gt = tt.LINEAR;
|
|
50
50
|
function et(n, e, t = {}) {
|
|
51
51
|
return {
|
|
52
|
-
type:
|
|
52
|
+
type: f0.ANIMATE,
|
|
53
53
|
object: n,
|
|
54
54
|
props: e,
|
|
55
55
|
delay: 0,
|
|
56
56
|
duration: 1e3,
|
|
57
|
-
easing:
|
|
57
|
+
easing: Gt,
|
|
58
58
|
block: !1,
|
|
59
59
|
interpolators: null,
|
|
60
60
|
isKey: !1,
|
|
@@ -62,14 +62,14 @@ function et(n, e, t = {}) {
|
|
|
62
62
|
...typeof t == "number" ? { duration: t } : t
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function pn(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 dn(n, e = {}) {
|
|
73
73
|
return et(n, { opacity: 0 }, {
|
|
74
74
|
duration: 500,
|
|
75
75
|
easing: tt.CUBIC,
|
|
@@ -78,7 +78,7 @@ function fn(n, e = {}) {
|
|
|
78
78
|
}
|
|
79
79
|
function Ct(n, e, t = {}) {
|
|
80
80
|
return {
|
|
81
|
-
type:
|
|
81
|
+
type: f0.UPDATE,
|
|
82
82
|
isKey: !1,
|
|
83
83
|
object: n,
|
|
84
84
|
props: e,
|
|
@@ -86,13 +86,13 @@ function Ct(n, e, t = {}) {
|
|
|
86
86
|
...t
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function xn(n) {
|
|
90
90
|
return Ct(n, { opacity: 0 });
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function yn(n) {
|
|
93
93
|
return Ct(n, { opacity: 1 });
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const o0 = {
|
|
96
96
|
TOP_LEFT: "TopLeft",
|
|
97
97
|
TOP: "Top",
|
|
98
98
|
TOP_RIGHT: "TopRight",
|
|
@@ -102,11 +102,11 @@ const n0 = {
|
|
|
102
102
|
BOTTOM_LEFT: "BottomLeft",
|
|
103
103
|
BOTTOM: "Bottom",
|
|
104
104
|
BOTTOM_RIGHT: "BottomRight"
|
|
105
|
-
},
|
|
105
|
+
}, h0 = o0.TOP_LEFT;
|
|
106
106
|
function $(n, e = 0, t = 0, o = 1) {
|
|
107
107
|
if (typeof n == "string") {
|
|
108
108
|
const i = n.replace("#", ""), a = parseInt(i, 16);
|
|
109
|
-
return isNaN(a) ? (console.warn("Invalid hex color format:", n),
|
|
109
|
+
return isNaN(a) ? (console.warn("Invalid hex color format:", n), Q) : i.length === 6 ? {
|
|
110
110
|
red: a >> 16 & 255,
|
|
111
111
|
green: a >> 8 & 255,
|
|
112
112
|
blue: a & 255,
|
|
@@ -116,7 +116,7 @@ function $(n, e = 0, t = 0, o = 1) {
|
|
|
116
116
|
green: a >> 16 & 255,
|
|
117
117
|
blue: a >> 8 & 255,
|
|
118
118
|
alpha: (a & 255) / 255
|
|
119
|
-
} : (console.warn("Invalid hex color format:", n),
|
|
119
|
+
} : (console.warn("Invalid hex color format:", n), Q);
|
|
120
120
|
} else if (typeof n == "number")
|
|
121
121
|
return {
|
|
122
122
|
red: n,
|
|
@@ -138,12 +138,12 @@ $.GREEN = $(0, 255, 0);
|
|
|
138
138
|
$.RED = $(255, 0, 0);
|
|
139
139
|
$.TRANSPARENT = $(0, 0, 0, 0);
|
|
140
140
|
$.WHITE = $(255, 255, 255);
|
|
141
|
-
const
|
|
142
|
-
function
|
|
141
|
+
const Q = { red: 0, green: 0, blue: 0, alpha: 1 };
|
|
142
|
+
function St(n = null) {
|
|
143
143
|
return {
|
|
144
144
|
content: null,
|
|
145
145
|
setup: null,
|
|
146
|
-
anchor:
|
|
146
|
+
anchor: o0.TOP_LEFT,
|
|
147
147
|
height: 0,
|
|
148
148
|
width: 0,
|
|
149
149
|
x: 0,
|
|
@@ -151,51 +151,51 @@ function Et(n = null) {
|
|
|
151
151
|
...n
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function Et(n, e = null) {
|
|
155
155
|
return n.alpha * (e ?? 1);
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(
|
|
157
|
+
function S0(n, e = null) {
|
|
158
|
+
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(Et(n, e) * 255);
|
|
159
159
|
return `#${a.toString(16).padStart(6, "0")}${s !== 255 ? s.toString(16).padStart(2, "0") : ""}`;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function vn(n = null) {
|
|
162
162
|
const {
|
|
163
163
|
url: e = "https://wikipedia.org/",
|
|
164
164
|
backgroundColor: t = $.TRANSPARENT,
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
strokeColor: o = Q,
|
|
166
|
+
strokeWidth: i = 0,
|
|
167
167
|
pointerEvents: a = "auto",
|
|
168
168
|
scale: s = 1,
|
|
169
|
-
anchor: r =
|
|
169
|
+
anchor: r = h0,
|
|
170
170
|
height: h = 1e3,
|
|
171
171
|
width: c = 1e3,
|
|
172
172
|
x: f = 0,
|
|
173
|
-
y:
|
|
173
|
+
y: d = 0
|
|
174
174
|
} = n || {}, l = document.createElement("iframe");
|
|
175
|
-
l.src = e, l.style.backgroundColor =
|
|
175
|
+
l.src = e, l.style.backgroundColor = S0(t), l.style.border = i > 0 ? `${i}px solid ${S0(o)}` : "none", l.style.pointerEvents = a;
|
|
176
176
|
const u = (100 / s).toFixed(3) + "%";
|
|
177
|
-
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",
|
|
177
|
+
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", St({
|
|
178
178
|
content: l,
|
|
179
179
|
anchor: r,
|
|
180
180
|
height: h,
|
|
181
181
|
width: c,
|
|
182
182
|
x: f,
|
|
183
|
-
y:
|
|
183
|
+
y: d
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
const x0 = {
|
|
187
187
|
LEFT: "left",
|
|
188
188
|
CENTER: "center",
|
|
189
189
|
RIGHT: "right"
|
|
190
|
-
},
|
|
191
|
-
function
|
|
190
|
+
}, Wt = x0.LEFT;
|
|
191
|
+
function s0(n, e) {
|
|
192
192
|
throw new Error("Unexpected value: " + n);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function wn(n = null) {
|
|
195
195
|
const {
|
|
196
196
|
alignment: e = x0.LEFT,
|
|
197
197
|
scale: t = 1,
|
|
198
|
-
anchor: o =
|
|
198
|
+
anchor: o = h0,
|
|
199
199
|
height: i = 1e3,
|
|
200
200
|
width: a = 1e3,
|
|
201
201
|
x: s = 0,
|
|
@@ -214,16 +214,16 @@ function xn(n = null) {
|
|
|
214
214
|
f.style.transformOrigin = "top right";
|
|
215
215
|
break;
|
|
216
216
|
default:
|
|
217
|
-
|
|
217
|
+
s0(e);
|
|
218
218
|
}
|
|
219
219
|
c.appendChild(f);
|
|
220
|
-
const
|
|
220
|
+
const d = {
|
|
221
221
|
video: {
|
|
222
222
|
displaySurface: "window"
|
|
223
223
|
},
|
|
224
224
|
audio: !1
|
|
225
225
|
};
|
|
226
|
-
return navigator.mediaDevices.getDisplayMedia(
|
|
226
|
+
return navigator.mediaDevices.getDisplayMedia(d).then((l) => {
|
|
227
227
|
const u = l.getVideoTracks()[0];
|
|
228
228
|
u !== void 0 && (u.onended = function() {
|
|
229
229
|
f.style.display = "none";
|
|
@@ -234,7 +234,7 @@ function xn(n = null) {
|
|
|
234
234
|
f.srcObject.getTracks().forEach((u) => u.stop()), f.style.display = "none", f.srcObject = null;
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
return
|
|
237
|
+
return St({
|
|
238
238
|
content: null,
|
|
239
239
|
setup: h,
|
|
240
240
|
anchor: o,
|
|
@@ -244,7 +244,7 @@ function xn(n = null) {
|
|
|
244
244
|
y: r
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
|
-
const
|
|
247
|
+
const U = {
|
|
248
248
|
ARROW: "Arrow",
|
|
249
249
|
CIRCLE: "Circle",
|
|
250
250
|
GROUP: "Group",
|
|
@@ -258,19 +258,19 @@ const j = {
|
|
|
258
258
|
SVG: "SVG",
|
|
259
259
|
TEXT: "Text"
|
|
260
260
|
};
|
|
261
|
-
function
|
|
261
|
+
function l0(n) {
|
|
262
262
|
return {
|
|
263
|
-
objectType:
|
|
263
|
+
objectType: U.SLIDE_OBJECT,
|
|
264
264
|
opacity: 1,
|
|
265
265
|
...n
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function mn(n = null) {
|
|
269
269
|
const { arrowheadSize: e, width: t = 10, ...o } = n || {}, i = e ?? t * 4;
|
|
270
|
-
return
|
|
271
|
-
objectType:
|
|
270
|
+
return l0({
|
|
271
|
+
objectType: U.ARROW,
|
|
272
272
|
arrowheadSize: i,
|
|
273
|
-
color:
|
|
273
|
+
color: Q,
|
|
274
274
|
drawn: 1,
|
|
275
275
|
endX: 100,
|
|
276
276
|
endY: 100,
|
|
@@ -283,25 +283,25 @@ function yn(n = null) {
|
|
|
283
283
|
...o
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
|
-
const
|
|
287
|
-
function
|
|
288
|
-
return
|
|
289
|
-
objectType:
|
|
290
|
-
anchor:
|
|
291
|
-
|
|
292
|
-
|
|
286
|
+
const Zt = 50;
|
|
287
|
+
function An(n = null) {
|
|
288
|
+
return l0({
|
|
289
|
+
objectType: U.CIRCLE,
|
|
290
|
+
anchor: h0,
|
|
291
|
+
strokeColor: Q,
|
|
292
|
+
strokeWidth: 0,
|
|
293
293
|
drawn: 1,
|
|
294
|
-
|
|
295
|
-
radius:
|
|
294
|
+
fillColor: Q,
|
|
295
|
+
radius: Zt,
|
|
296
296
|
x: 0,
|
|
297
297
|
y: 0,
|
|
298
298
|
...n
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
function st(n, e = null) {
|
|
302
|
-
return
|
|
303
|
-
objectType:
|
|
304
|
-
anchor:
|
|
302
|
+
return l0({
|
|
303
|
+
objectType: U.GROUP,
|
|
304
|
+
anchor: h0,
|
|
305
305
|
height: 0,
|
|
306
306
|
objects: n,
|
|
307
307
|
previewColor: null,
|
|
@@ -323,9 +323,9 @@ function st(n, e = null) {
|
|
|
323
323
|
...e
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function bn(n) {
|
|
327
327
|
const {
|
|
328
|
-
anchor: e =
|
|
328
|
+
anchor: e = h0,
|
|
329
329
|
cols: t = 1,
|
|
330
330
|
rows: o = 1,
|
|
331
331
|
gapX: i = 0,
|
|
@@ -335,43 +335,43 @@ function wn(n) {
|
|
|
335
335
|
height: h = 0,
|
|
336
336
|
x: c = 0,
|
|
337
337
|
y: f = 0,
|
|
338
|
-
objects:
|
|
338
|
+
objects: d = () => null
|
|
339
339
|
} = n, l = [], u = [];
|
|
340
|
-
let
|
|
341
|
-
for (let
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
let
|
|
345
|
-
for (let
|
|
346
|
-
const C =
|
|
347
|
-
|
|
340
|
+
let m = 0, y = 0;
|
|
341
|
+
for (let T = 0; T < o; T++) {
|
|
342
|
+
const S = [];
|
|
343
|
+
m = 0;
|
|
344
|
+
let P = 0;
|
|
345
|
+
for (let E = 0; E < t; E++) {
|
|
346
|
+
const C = d(T, E), O = typeof r == "function" ? r(T, E) : r, R = typeof h == "function" ? h(T, E) : h;
|
|
347
|
+
S.push(C), C != null && u.push(
|
|
348
348
|
st([C], {
|
|
349
|
-
x:
|
|
349
|
+
x: m,
|
|
350
350
|
y
|
|
351
351
|
})
|
|
352
|
-
),
|
|
352
|
+
), m += O + i, P = Math.max(P, R);
|
|
353
353
|
}
|
|
354
|
-
l.push(
|
|
354
|
+
l.push(S), y += P + a;
|
|
355
355
|
}
|
|
356
356
|
return {
|
|
357
357
|
grid: st(u, {
|
|
358
358
|
x: c,
|
|
359
359
|
y: f,
|
|
360
360
|
height: y - a,
|
|
361
|
-
width:
|
|
361
|
+
width: m - i,
|
|
362
362
|
anchor: e,
|
|
363
363
|
...s
|
|
364
364
|
}),
|
|
365
365
|
objects: l
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
return
|
|
370
|
-
objectType:
|
|
371
|
-
anchor:
|
|
368
|
+
function Mn(n = null) {
|
|
369
|
+
return l0({
|
|
370
|
+
objectType: U.IMAGE,
|
|
371
|
+
anchor: h0,
|
|
372
|
+
cornerRadius: 0,
|
|
372
373
|
height: 100,
|
|
373
374
|
imageId: "",
|
|
374
|
-
rounding: 0,
|
|
375
375
|
smooth: !0,
|
|
376
376
|
width: 100,
|
|
377
377
|
x: 0,
|
|
@@ -379,10 +379,10 @@ function mn(n = null) {
|
|
|
379
379
|
...n
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
return
|
|
384
|
-
objectType:
|
|
385
|
-
color:
|
|
382
|
+
function Ln(n = null) {
|
|
383
|
+
return l0({
|
|
384
|
+
objectType: U.LINE,
|
|
385
|
+
color: Q,
|
|
386
386
|
drawn: 1,
|
|
387
387
|
endX: 100,
|
|
388
388
|
endY: 100,
|
|
@@ -394,10 +394,10 @@ function bn(n = null) {
|
|
|
394
394
|
...n
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
function
|
|
398
|
-
return
|
|
399
|
-
objectType:
|
|
400
|
-
anchor:
|
|
397
|
+
function Tn(n, e = null) {
|
|
398
|
+
return l0({
|
|
399
|
+
objectType: U.MASK,
|
|
400
|
+
anchor: h0,
|
|
401
401
|
height: 100,
|
|
402
402
|
objects: n,
|
|
403
403
|
preview: !1,
|
|
@@ -407,11 +407,11 @@ function An(n, e = null) {
|
|
|
407
407
|
...e
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
|
-
var
|
|
411
|
-
const e = (n && n.length > 0 ? n : "M0,0").match(
|
|
410
|
+
var Vt = Object.defineProperty, _ = (n, e) => Vt(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 }, Kt = /([astvzqmhlc])([^astvzqmhlc]*)/gi, Qt = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, Jt = _((n) => {
|
|
411
|
+
const e = (n && n.length > 0 ? n : "M0,0").match(Kt);
|
|
412
412
|
if (!e) throw new Error(`No path elements found in string ${n}`);
|
|
413
413
|
return e.reduce((t, o) => {
|
|
414
|
-
let i = o.charAt(0), a = i.toLowerCase(), s =
|
|
414
|
+
let i = o.charAt(0), a = i.toLowerCase(), s = t1(o.substring(1));
|
|
415
415
|
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)) {
|
|
416
416
|
const r = o.substring(1).trim().split(" ");
|
|
417
417
|
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])];
|
|
@@ -426,27 +426,27 @@ var Zt = Object.defineProperty, _ = (n, e) => Zt(n, "name", { value: e, configur
|
|
|
426
426
|
}
|
|
427
427
|
return t;
|
|
428
428
|
}, []);
|
|
429
|
-
}, "default"),
|
|
430
|
-
const e = n.match(
|
|
429
|
+
}, "default"), t1 = _((n) => {
|
|
430
|
+
const e = n.match(Qt);
|
|
431
431
|
return e ? e.map(Number) : [];
|
|
432
|
-
}, "parseValues"), w0,
|
|
432
|
+
}, "parseValues"), w0, J = (w0 = class {
|
|
433
433
|
constructor(e, t, o, i) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
434
|
+
k(this, "x0");
|
|
435
|
+
k(this, "x1");
|
|
436
|
+
k(this, "y0");
|
|
437
|
+
k(this, "y1");
|
|
438
|
+
k(this, "getTotalLength", _(() => Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2)), "getTotalLength"));
|
|
439
|
+
k(this, "getPointAtLength", _((e) => {
|
|
440
440
|
let t = e / Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
|
|
441
441
|
t = Number.isNaN(t) ? 1 : t;
|
|
442
442
|
const o = (this.x1 - this.x0) * t, i = (this.y1 - this.y0) * t;
|
|
443
443
|
return { x: this.x0 + o, y: this.y0 + i };
|
|
444
444
|
}, "getPointAtLength"));
|
|
445
|
-
|
|
445
|
+
k(this, "getTangentAtLength", _((e) => {
|
|
446
446
|
const t = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
|
|
447
447
|
return { x: (this.x1 - this.x0) / t, y: (this.y1 - this.y0) / t };
|
|
448
448
|
}, "getTangentAtLength"));
|
|
449
|
-
|
|
449
|
+
k(this, "getPropertiesAtLength", _((e) => {
|
|
450
450
|
const t = this.getPointAtLength(e), o = this.getTangentAtLength(e);
|
|
451
451
|
return { x: t.x, y: t.y, tangentX: o.x, tangentY: o.y };
|
|
452
452
|
}, "getPropertiesAtLength"));
|
|
@@ -454,23 +454,23 @@ var Zt = Object.defineProperty, _ = (n, e) => Zt(n, "name", { value: e, configur
|
|
|
454
454
|
}
|
|
455
455
|
}, _(w0, "LinearPosition"), w0), m0, at = (m0 = class {
|
|
456
456
|
constructor(e, t, o, i, a, s, r, h, c) {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
457
|
+
k(this, "x0");
|
|
458
|
+
k(this, "y0");
|
|
459
|
+
k(this, "rx");
|
|
460
|
+
k(this, "ry");
|
|
461
|
+
k(this, "xAxisRotate");
|
|
462
|
+
k(this, "LargeArcFlag");
|
|
463
|
+
k(this, "SweepFlag");
|
|
464
|
+
k(this, "x1");
|
|
465
|
+
k(this, "y1");
|
|
466
|
+
k(this, "length");
|
|
467
|
+
k(this, "getTotalLength", _(() => this.length, "getTotalLength"));
|
|
468
|
+
k(this, "getPointAtLength", _((e) => {
|
|
469
469
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
470
470
|
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);
|
|
471
471
|
return { x: t.x, y: t.y };
|
|
472
472
|
}, "getPointAtLength"));
|
|
473
|
-
|
|
473
|
+
k(this, "getTangentAtLength", _((e) => {
|
|
474
474
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
475
475
|
const t = 0.05, o = this.getPointAtLength(e);
|
|
476
476
|
let i;
|
|
@@ -478,74 +478,74 @@ var Zt = Object.defineProperty, _ = (n, e) => Zt(n, "name", { value: e, configur
|
|
|
478
478
|
const a = i.x - o.x, s = i.y - o.y, r = Math.sqrt(a * a + s * s);
|
|
479
479
|
return e < this.length - t ? { x: -a / r, y: -s / r } : { x: a / r, y: s / r };
|
|
480
480
|
}, "getTangentAtLength"));
|
|
481
|
-
|
|
481
|
+
k(this, "getPropertiesAtLength", _((e) => {
|
|
482
482
|
const t = this.getTangentAtLength(e), o = this.getPointAtLength(e);
|
|
483
483
|
return { x: o.x, y: o.y, tangentX: t.x, tangentY: t.y };
|
|
484
484
|
}, "getPropertiesAtLength"));
|
|
485
485
|
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;
|
|
486
|
-
const f =
|
|
487
|
-
return ht({ x: e, y: t }, o, i, a, s, r, { x: h, y: c },
|
|
486
|
+
const f = e1(300, function(d) {
|
|
487
|
+
return ht({ x: e, y: t }, o, i, a, s, r, { x: h, y: c }, d);
|
|
488
488
|
});
|
|
489
489
|
this.length = f.arcLength;
|
|
490
490
|
}
|
|
491
491
|
}, _(m0, "Arc"), m0), ht = _((n, e, t, o, i, a, s, r) => {
|
|
492
|
-
e = Math.abs(e), t = Math.abs(t), o =
|
|
493
|
-
const h =
|
|
492
|
+
e = Math.abs(e), t = Math.abs(t), o = n1(o, 360);
|
|
493
|
+
const h = r1(o);
|
|
494
494
|
if (n.x === s.x && n.y === s.y) return { x: n.x, y: n.y, ellipticalArcAngle: 0 };
|
|
495
495
|
if (e === 0 || t === 0) return { x: 0, y: 0, ellipticalArcAngle: 0 };
|
|
496
|
-
const c = (n.x - s.x) / 2, f = (n.y - s.y) / 2,
|
|
496
|
+
const c = (n.x - s.x) / 2, f = (n.y - s.y) / 2, d = { x: Math.cos(h) * c + Math.sin(h) * f, y: -Math.sin(h) * c + Math.cos(h) * f }, l = Math.pow(d.x, 2) / Math.pow(e, 2) + Math.pow(d.y, 2) / Math.pow(t, 2);
|
|
497
497
|
l > 1 && (e = Math.sqrt(l) * e, t = Math.sqrt(l) * t);
|
|
498
|
-
let u = (Math.pow(e, 2) * Math.pow(t, 2) - Math.pow(e, 2) * Math.pow(
|
|
498
|
+
let u = (Math.pow(e, 2) * Math.pow(t, 2) - Math.pow(e, 2) * Math.pow(d.y, 2) - Math.pow(t, 2) * Math.pow(d.x, 2)) / (Math.pow(e, 2) * Math.pow(d.y, 2) + Math.pow(t, 2) * Math.pow(d.x, 2));
|
|
499
499
|
u = u < 0 ? 0 : u;
|
|
500
|
-
const
|
|
501
|
-
let
|
|
502
|
-
!a &&
|
|
503
|
-
const C =
|
|
504
|
-
return { x: Math.cos(h) *
|
|
505
|
-
}, "pointOnEllipticalArc"),
|
|
500
|
+
const m = (i !== a ? 1 : -1) * Math.sqrt(u), y = m * (e * d.y / t), M = m * (-t * d.x / e), T = { 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 }, S = { x: (d.x - y) / e, y: (d.y - M) / t }, P = ct({ x: 1, y: 0 }, S);
|
|
501
|
+
let E = ct(S, { x: (-d.x - y) / e, y: (-d.y - M) / t });
|
|
502
|
+
!a && E > 0 ? E -= 2 * Math.PI : a && E < 0 && (E += 2 * Math.PI), E %= 2 * Math.PI;
|
|
503
|
+
const C = P + E * r, O = e * Math.cos(C), R = t * Math.sin(C);
|
|
504
|
+
return { x: Math.cos(h) * O - Math.sin(h) * R + T.x, y: Math.sin(h) * O + Math.cos(h) * R + T.y, ellipticalArcStartAngle: P, ellipticalArcEndAngle: P + E, ellipticalArcAngle: C, ellipticalArcCenter: T, resultantRx: e, resultantRy: t };
|
|
505
|
+
}, "pointOnEllipticalArc"), e1 = _((n, e) => {
|
|
506
506
|
n = n ?? 500;
|
|
507
507
|
let t = 0;
|
|
508
508
|
const o = [], i = [];
|
|
509
509
|
let a, s = e(0);
|
|
510
510
|
for (let r = 0; r < n; r++) {
|
|
511
|
-
const h =
|
|
511
|
+
const h = i1(r * (1 / n), 0, 1);
|
|
512
512
|
a = e(h), t += lt(s, a), i.push([s, a]), o.push({ t: h, arcLength: t }), s = a;
|
|
513
513
|
}
|
|
514
514
|
return a = e(1), i.push([s, a]), t += lt(s, a), o.push({ t: 1, arcLength: t }), { arcLength: t, arcLengthMap: o, approximationLines: i };
|
|
515
|
-
}, "approximateArcLengthOfCurve"),
|
|
515
|
+
}, "approximateArcLengthOfCurve"), n1 = _((n, e) => (n % e + e) % e, "mod"), r1 = _((n) => n * (Math.PI / 180), "toRadians"), lt = _((n, e) => Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2)), "distance"), i1 = _((n, e, t) => Math.min(Math.max(n, e), t), "clamp"), ct = _((n, e) => {
|
|
516
516
|
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)));
|
|
517
517
|
return (n.x * e.y - n.y * e.x < 0 ? -1 : 1) * Math.acos(t / o);
|
|
518
|
-
}, "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 = _((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 = _((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 = _((n, e, t) => {
|
|
518
|
+
}, "angleBetween"), o1 = [[], [], [-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]], s1 = [[], [], [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]], a1 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], h1 = _((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"), l1 = _((n, e, t) => kt([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"), c1 = _((n, e, t) => {
|
|
519
519
|
let o, i;
|
|
520
520
|
const a = t / 2;
|
|
521
521
|
o = 0;
|
|
522
|
-
for (let s = 0; s < 20; s++) i = a *
|
|
522
|
+
for (let s = 0; s < 20; s++) i = a * o1[20][s] + a, o += s1[20][s] * It(n, e, i);
|
|
523
523
|
return a * o;
|
|
524
|
-
}, "getCubicArcLength"),
|
|
524
|
+
}, "getCubicArcLength"), kt = _((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"), u1 = _((n, e, t) => {
|
|
525
525
|
t === void 0 && (t = 1);
|
|
526
526
|
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;
|
|
527
527
|
if (r === 0) return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
|
|
528
|
-
const f = h / (2 * r),
|
|
529
|
-
return Math.sqrt(r) / 2 * (
|
|
530
|
-
}, "getQuadraticArcLength"),
|
|
531
|
-
function
|
|
528
|
+
const f = h / (2 * r), d = t + f, l = c / r - f * f, u = d * d + l > 0 ? Math.sqrt(d * d + l) : 0, m = f * f + l > 0 ? Math.sqrt(f * f + l) : 0, y = f + Math.sqrt(f * f + l) !== 0 && (d + u) / (f + m) !== 0 ? l * Math.log(Math.abs((d + u) / (f + m))) : 0;
|
|
529
|
+
return Math.sqrt(r) / 2 * (d * u - f * m + y);
|
|
530
|
+
}, "getQuadraticArcLength"), f1 = _((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");
|
|
531
|
+
function It(n, e, t) {
|
|
532
532
|
const o = G0(1, t, n), i = G0(1, t, e), a = o * o + i * i;
|
|
533
533
|
return Math.sqrt(a);
|
|
534
534
|
}
|
|
535
|
-
_(
|
|
535
|
+
_(It, "BFunc");
|
|
536
536
|
var G0 = _((n, e, t) => {
|
|
537
537
|
const o = t.length - 1;
|
|
538
538
|
let i, a;
|
|
539
539
|
if (o === 0) return 0;
|
|
540
540
|
if (n === 0) {
|
|
541
541
|
a = 0;
|
|
542
|
-
for (let s = 0; s <= o; s++) a +=
|
|
542
|
+
for (let s = 0; s <= o; s++) a += a1[o][s] * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
543
543
|
return a;
|
|
544
544
|
}
|
|
545
545
|
i = new Array(o);
|
|
546
546
|
for (let s = 0; s < o; s++) i[s] = o * (t[s + 1] - t[s]);
|
|
547
547
|
return G0(n - 1, e, i);
|
|
548
|
-
}, "getDerivative"),
|
|
548
|
+
}, "getDerivative"), R0 = _((n, e, t) => {
|
|
549
549
|
let o = 1, i = n / e, a = (n - t(i)) / e, s = 0;
|
|
550
550
|
for (; o > 1e-3; ) {
|
|
551
551
|
const r = t(i + a), h = Math.abs(n - r) / e;
|
|
@@ -557,69 +557,69 @@ var G0 = _((n, e, t) => {
|
|
|
557
557
|
if (s++, s > 500) break;
|
|
558
558
|
}
|
|
559
559
|
return i;
|
|
560
|
-
}, "t2length"),
|
|
560
|
+
}, "t2length"), A0, c0 = (A0 = class {
|
|
561
561
|
constructor(e, t, o, i, a, s, r, h) {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
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 =
|
|
562
|
+
k(this, "a");
|
|
563
|
+
k(this, "b");
|
|
564
|
+
k(this, "c");
|
|
565
|
+
k(this, "d");
|
|
566
|
+
k(this, "length");
|
|
567
|
+
k(this, "getArcLength");
|
|
568
|
+
k(this, "getPoint");
|
|
569
|
+
k(this, "getDerivative");
|
|
570
|
+
k(this, "getTotalLength", _(() => this.length, "getTotalLength"));
|
|
571
|
+
k(this, "getPointAtLength", _((e) => {
|
|
572
|
+
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));
|
|
573
573
|
return this.getPoint(t, o, i);
|
|
574
574
|
}, "getPointAtLength"));
|
|
575
|
-
|
|
576
|
-
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 =
|
|
575
|
+
k(this, "getTangentAtLength", _((e) => {
|
|
576
|
+
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);
|
|
577
577
|
let r;
|
|
578
578
|
return r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 }, r;
|
|
579
579
|
}, "getTangentAtLength"));
|
|
580
|
-
|
|
581
|
-
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 =
|
|
580
|
+
k(this, "getPropertiesAtLength", _((e) => {
|
|
581
|
+
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);
|
|
582
582
|
let r;
|
|
583
583
|
r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 };
|
|
584
584
|
const h = this.getPoint(t, o, i);
|
|
585
585
|
return { x: h.x, y: h.y, tangentX: r.x, tangentY: r.y };
|
|
586
586
|
}, "getPropertiesAtLength"));
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
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 =
|
|
587
|
+
k(this, "getC", _(() => this.c, "getC"));
|
|
588
|
+
k(this, "getD", _(() => this.d, "getD"));
|
|
589
|
+
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 = c1, this.getPoint = h1, this.getDerivative = l1, this.d = { x: r, y: h }) : (this.getArcLength = u1, this.getPoint = kt, this.getDerivative = f1, 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);
|
|
590
590
|
}
|
|
591
|
-
}, _(
|
|
591
|
+
}, _(A0, "Bezier"), A0), b0, g1 = (b0 = class {
|
|
592
592
|
constructor(e) {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
593
|
+
k(this, "length", 0);
|
|
594
|
+
k(this, "partial_lengths", []);
|
|
595
|
+
k(this, "functions", []);
|
|
596
|
+
k(this, "initial_point", null);
|
|
597
|
+
k(this, "getPartAtLength", _((e) => {
|
|
598
598
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
599
599
|
let t = this.partial_lengths.length - 1;
|
|
600
600
|
for (; this.partial_lengths[t] >= e && t > 0; ) t--;
|
|
601
601
|
return t++, { fraction: e - this.partial_lengths[t - 1], i: t };
|
|
602
602
|
}, "getPartAtLength"));
|
|
603
|
-
|
|
604
|
-
|
|
603
|
+
k(this, "getTotalLength", _(() => this.length, "getTotalLength"));
|
|
604
|
+
k(this, "getPointAtLength", _((e) => {
|
|
605
605
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
606
606
|
if (o) return o.getPointAtLength(t.fraction);
|
|
607
607
|
if (this.initial_point) return this.initial_point;
|
|
608
608
|
throw new Error("Wrong function at this part.");
|
|
609
609
|
}, "getPointAtLength"));
|
|
610
|
-
|
|
610
|
+
k(this, "getTangentAtLength", _((e) => {
|
|
611
611
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
612
612
|
if (o) return o.getTangentAtLength(t.fraction);
|
|
613
613
|
if (this.initial_point) return { x: 0, y: 0 };
|
|
614
614
|
throw new Error("Wrong function at this part.");
|
|
615
615
|
}, "getTangentAtLength"));
|
|
616
|
-
|
|
616
|
+
k(this, "getPropertiesAtLength", _((e) => {
|
|
617
617
|
const t = this.getPartAtLength(e), o = this.functions[t.i];
|
|
618
618
|
if (o) return o.getPropertiesAtLength(t.fraction);
|
|
619
619
|
if (this.initial_point) return { x: this.initial_point.x, y: this.initial_point.y, tangentX: 0, tangentY: 0 };
|
|
620
620
|
throw new Error("Wrong function at this part.");
|
|
621
621
|
}, "getPropertiesAtLength"));
|
|
622
|
-
|
|
622
|
+
k(this, "getParts", _(() => {
|
|
623
623
|
const e = [];
|
|
624
624
|
for (let t = 0; t < this.functions.length; t++) if (this.functions[t] !== null) {
|
|
625
625
|
this.functions[t] = this.functions[t];
|
|
@@ -628,60 +628,60 @@ var G0 = _((n, e, t) => {
|
|
|
628
628
|
}
|
|
629
629
|
return e;
|
|
630
630
|
}, "getParts"));
|
|
631
|
-
const t = Array.isArray(e) ? e :
|
|
631
|
+
const t = Array.isArray(e) ? e : Jt(e);
|
|
632
632
|
let o, i = [0, 0], a = [0, 0], s = [0, 0];
|
|
633
633
|
for (let r = 0; r < t.length; r++) {
|
|
634
634
|
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] });
|
|
635
635
|
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);
|
|
636
|
-
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
|
|
637
|
-
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
|
|
638
|
-
else if (t[r][0] === "H") this.length += Math.abs(i[0] - t[r][1]), this.functions.push(new
|
|
639
|
-
else if (t[r][0] === "h") this.length += Math.abs(t[r][1]), this.functions.push(new
|
|
640
|
-
else if (t[r][0] === "V") this.length += Math.abs(i[1] - t[r][1]), this.functions.push(new
|
|
641
|
-
else if (t[r][0] === "v") this.length += Math.abs(t[r][1]), this.functions.push(new
|
|
642
|
-
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
|
|
643
|
-
else if (t[r][0] === "C") o = new
|
|
644
|
-
else if (t[r][0] === "c") o = new
|
|
636
|
+
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 J(i[0], t[r][1], i[1], t[r][2])), i = [t[r][1], t[r][2]];
|
|
637
|
+
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 J(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]];
|
|
638
|
+
else if (t[r][0] === "H") this.length += Math.abs(i[0] - t[r][1]), this.functions.push(new J(i[0], t[r][1], i[1], i[1])), i[0] = t[r][1];
|
|
639
|
+
else if (t[r][0] === "h") this.length += Math.abs(t[r][1]), this.functions.push(new J(i[0], i[0] + t[r][1], i[1], i[1])), i[0] = t[r][1] + i[0];
|
|
640
|
+
else if (t[r][0] === "V") this.length += Math.abs(i[1] - t[r][1]), this.functions.push(new J(i[0], i[0], i[1], t[r][1])), i[1] = t[r][1];
|
|
641
|
+
else if (t[r][0] === "v") this.length += Math.abs(t[r][1]), this.functions.push(new J(i[0], i[0], i[1], i[1] + t[r][1])), i[1] = t[r][1] + i[1];
|
|
642
|
+
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 J(i[0], s[0], i[1], s[1])), i = [s[0], s[1]];
|
|
643
|
+
else if (t[r][0] === "C") o = new c0(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);
|
|
644
|
+
else if (t[r][0] === "c") o = new c0(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 J(i[0], i[0], i[1], i[1]));
|
|
645
645
|
else if (t[r][0] === "S") {
|
|
646
646
|
if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
|
|
647
647
|
if (o) {
|
|
648
648
|
const h = o.getC();
|
|
649
|
-
o = new
|
|
649
|
+
o = new c0(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]);
|
|
650
650
|
}
|
|
651
|
-
} else o = new
|
|
651
|
+
} else o = new c0(i[0], i[1], i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4]);
|
|
652
652
|
o && (this.length += o.getTotalLength(), i = [t[r][3], t[r][4]], this.functions.push(o));
|
|
653
653
|
} else if (t[r][0] === "s") {
|
|
654
654
|
if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
|
|
655
655
|
if (o) {
|
|
656
656
|
const h = o.getC(), c = o.getD();
|
|
657
|
-
o = new
|
|
657
|
+
o = new c0(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]);
|
|
658
658
|
}
|
|
659
|
-
} else o = new
|
|
659
|
+
} else o = new c0(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]);
|
|
660
660
|
o && (this.length += o.getTotalLength(), i = [t[r][3] + i[0], t[r][4] + i[1]], this.functions.push(o));
|
|
661
661
|
} else if (t[r][0] === "Q") {
|
|
662
662
|
if (i[0] === t[r][1] && i[1] === t[r][2]) {
|
|
663
|
-
const h = new
|
|
663
|
+
const h = new J(t[r][1], t[r][3], t[r][2], t[r][4]);
|
|
664
664
|
this.length += h.getTotalLength(), this.functions.push(h);
|
|
665
|
-
} else o = new
|
|
665
|
+
} else o = new c0(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);
|
|
666
666
|
i = [t[r][3], t[r][4]], a = [t[r][1], t[r][2]];
|
|
667
667
|
} else if (t[r][0] === "q") {
|
|
668
|
-
if (t[r][1] !== 0 || t[r][2] !== 0) o = new
|
|
668
|
+
if (t[r][1] !== 0 || t[r][2] !== 0) o = new c0(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);
|
|
669
669
|
else {
|
|
670
|
-
const h = new
|
|
670
|
+
const h = new J(i[0] + t[r][1], i[0] + t[r][3], i[1] + t[r][2], i[1] + t[r][4]);
|
|
671
671
|
this.length += h.getTotalLength(), this.functions.push(h);
|
|
672
672
|
}
|
|
673
673
|
a = [i[0] + t[r][1], i[1] + t[r][2]], i = [t[r][3] + i[0], t[r][4] + i[1]];
|
|
674
674
|
} else if (t[r][0] === "T") {
|
|
675
|
-
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new
|
|
675
|
+
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new c0(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();
|
|
676
676
|
else {
|
|
677
|
-
const h = new
|
|
677
|
+
const h = new J(i[0], t[r][1], i[1], t[r][2]);
|
|
678
678
|
this.functions.push(h), this.length += h.getTotalLength();
|
|
679
679
|
}
|
|
680
680
|
a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1], t[r][2]];
|
|
681
681
|
} else if (t[r][0] === "t") {
|
|
682
|
-
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new
|
|
682
|
+
if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new c0(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);
|
|
683
683
|
else {
|
|
684
|
-
const h = new
|
|
684
|
+
const h = new J(i[0], i[0] + t[r][1], i[1], i[1] + t[r][2]);
|
|
685
685
|
this.length += h.getTotalLength(), this.functions.push(h);
|
|
686
686
|
}
|
|
687
687
|
a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1] + i[0], t[r][2] + i[1]];
|
|
@@ -695,28 +695,28 @@ var G0 = _((n, e, t) => {
|
|
|
695
695
|
this.partial_lengths.push(this.length);
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
}, _(
|
|
698
|
+
}, _(b0, "SVGPathProperties"), b0), M0, W0 = (M0 = class {
|
|
699
699
|
constructor(e) {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
if (this.inst = new
|
|
700
|
+
k(this, "inst");
|
|
701
|
+
k(this, "getTotalLength", _(() => this.inst.getTotalLength(), "getTotalLength"));
|
|
702
|
+
k(this, "getPointAtLength", _((e) => this.inst.getPointAtLength(e), "getPointAtLength"));
|
|
703
|
+
k(this, "getTangentAtLength", _((e) => this.inst.getTangentAtLength(e), "getTangentAtLength"));
|
|
704
|
+
k(this, "getPropertiesAtLength", _((e) => this.inst.getPropertiesAtLength(e), "getPropertiesAtLength"));
|
|
705
|
+
k(this, "getParts", _(() => this.inst.getParts(), "getParts"));
|
|
706
|
+
if (this.inst = new g1(e), !(this instanceof W0)) return new W0(e);
|
|
707
707
|
}
|
|
708
708
|
}, _(M0, "_svgPathProperties"), M0);
|
|
709
|
-
function
|
|
709
|
+
function p1(n = $.BLACK) {
|
|
710
710
|
return { ...n, alpha: 0 };
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function Pn(n = null) {
|
|
713
713
|
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 W0(r).getTotalLength();
|
|
714
|
-
return
|
|
715
|
-
objectType:
|
|
716
|
-
anchor:
|
|
717
|
-
|
|
714
|
+
return l0({
|
|
715
|
+
objectType: U.PATH,
|
|
716
|
+
anchor: h0,
|
|
717
|
+
strokeColor: Q,
|
|
718
718
|
drawn: 1,
|
|
719
|
-
|
|
719
|
+
fillColor: p1(),
|
|
720
720
|
isRounded: !1,
|
|
721
721
|
height: t,
|
|
722
722
|
path: r,
|
|
@@ -730,41 +730,41 @@ function Mn(n = null) {
|
|
|
730
730
|
...s
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
|
-
function
|
|
734
|
-
return
|
|
735
|
-
objectType:
|
|
736
|
-
|
|
737
|
-
|
|
733
|
+
function Cn(n = null) {
|
|
734
|
+
return l0({
|
|
735
|
+
objectType: U.POLYGON,
|
|
736
|
+
strokeColor: Q,
|
|
737
|
+
strokeWidth: 0,
|
|
738
738
|
drawn: 1,
|
|
739
739
|
points: [
|
|
740
740
|
{ x: 0, y: 0 },
|
|
741
741
|
{ x: 100, y: 0 },
|
|
742
742
|
{ x: 100, y: 100 }
|
|
743
743
|
],
|
|
744
|
-
|
|
744
|
+
fillColor: Q,
|
|
745
745
|
...n
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
|
-
function
|
|
749
|
-
return
|
|
750
|
-
objectType:
|
|
751
|
-
anchor:
|
|
752
|
-
|
|
753
|
-
|
|
748
|
+
function Sn(n = null) {
|
|
749
|
+
return l0({
|
|
750
|
+
objectType: U.RECTANGLE,
|
|
751
|
+
anchor: h0,
|
|
752
|
+
strokeColor: Q,
|
|
753
|
+
strokeWidth: 0,
|
|
754
754
|
drawn: 1,
|
|
755
|
-
|
|
755
|
+
fillColor: Q,
|
|
756
756
|
height: 100,
|
|
757
|
-
|
|
757
|
+
cornerRadius: 0,
|
|
758
758
|
width: 100,
|
|
759
759
|
x: 0,
|
|
760
760
|
y: 0,
|
|
761
761
|
...n
|
|
762
762
|
});
|
|
763
763
|
}
|
|
764
|
-
function
|
|
765
|
-
return
|
|
766
|
-
objectType:
|
|
767
|
-
anchor:
|
|
764
|
+
function En(n = null) {
|
|
765
|
+
return l0({
|
|
766
|
+
objectType: U.SVG,
|
|
767
|
+
anchor: h0,
|
|
768
768
|
height: 100,
|
|
769
769
|
svg: "",
|
|
770
770
|
width: 100,
|
|
@@ -773,11 +773,11 @@ function Pn(n = null) {
|
|
|
773
773
|
...n
|
|
774
774
|
});
|
|
775
775
|
}
|
|
776
|
-
const
|
|
776
|
+
const d1 = {
|
|
777
777
|
NORMAL: "normal",
|
|
778
778
|
ITALIC: "italic",
|
|
779
779
|
OBLIQUE: "oblique"
|
|
780
|
-
},
|
|
780
|
+
}, x1 = d1.NORMAL, y1 = {
|
|
781
781
|
THIN: 100,
|
|
782
782
|
EXTRA_LIGHT: 200,
|
|
783
783
|
LIGHT: 300,
|
|
@@ -787,41 +787,43 @@ const p1 = {
|
|
|
787
787
|
BOLD: 700,
|
|
788
788
|
EXTRA_BOLD: 800,
|
|
789
789
|
BLACK: 900
|
|
790
|
-
},
|
|
791
|
-
color:
|
|
790
|
+
}, v1 = y1.NORMAL, w1 = {
|
|
791
|
+
color: Q,
|
|
792
792
|
fontFamily: "sans-serif",
|
|
793
793
|
fontSize: 100,
|
|
794
|
-
fontStyle:
|
|
795
|
-
fontWeight:
|
|
796
|
-
ligatures: !1
|
|
794
|
+
fontStyle: x1,
|
|
795
|
+
fontWeight: v1,
|
|
796
|
+
ligatures: !1,
|
|
797
|
+
subscript: !1,
|
|
798
|
+
superscript: !1
|
|
797
799
|
};
|
|
798
800
|
function _t(n) {
|
|
799
801
|
return typeof n == "string" ? [[{ text: n }]] : n.map((e) => e.map((t) => typeof t == "string" ? { text: t } : t));
|
|
800
802
|
}
|
|
801
|
-
function
|
|
803
|
+
function m1(n) {
|
|
802
804
|
return _t(n).reduce(
|
|
803
805
|
(t, o) => t + o.reduce((i, a) => i + a.text.length, 0),
|
|
804
806
|
0
|
|
805
807
|
);
|
|
806
808
|
}
|
|
807
|
-
function
|
|
808
|
-
return
|
|
809
|
-
objectType:
|
|
810
|
-
alignment:
|
|
811
|
-
anchor:
|
|
809
|
+
function A1(n = "", e = null) {
|
|
810
|
+
return l0({
|
|
811
|
+
objectType: U.TEXT,
|
|
812
|
+
alignment: Wt,
|
|
813
|
+
anchor: h0,
|
|
812
814
|
length: null,
|
|
813
815
|
lineSpacing: 1,
|
|
814
816
|
text: n,
|
|
815
817
|
x: 0,
|
|
816
818
|
y: 0,
|
|
817
|
-
...
|
|
819
|
+
...w1,
|
|
818
820
|
...e
|
|
819
821
|
});
|
|
820
822
|
}
|
|
821
|
-
|
|
823
|
+
A1.writeOn = (n, e = {}) => et(
|
|
822
824
|
n,
|
|
823
825
|
{
|
|
824
|
-
length:
|
|
826
|
+
length: m1(n.text)
|
|
825
827
|
},
|
|
826
828
|
e
|
|
827
829
|
);
|
|
@@ -835,72 +837,72 @@ function b1({ presentation: n, onNavigateToSlide: e }) {
|
|
|
835
837
|
console.error("Failed to open navigator window.");
|
|
836
838
|
return;
|
|
837
839
|
}
|
|
838
|
-
const t =
|
|
840
|
+
const t = M1(n, e);
|
|
839
841
|
Z.document.title = n.title, Z.document.body.appendChild(t), Z.addEventListener("keyup", (o) => {
|
|
840
842
|
(o.key === "Escape" || o.key === "`") && (Z == null || Z.close(), Z = null);
|
|
841
843
|
});
|
|
842
844
|
}
|
|
843
|
-
function
|
|
845
|
+
function M1(n, e) {
|
|
844
846
|
const t = document.createElement("div");
|
|
845
847
|
return t.style.fontFamily = "Arial, sans-serif", n.slides.forEach((o, i) => {
|
|
846
|
-
const a =
|
|
848
|
+
const a = L1(o, i);
|
|
847
849
|
a.style.cursor = "pointer", a.addEventListener("click", (s) => {
|
|
848
850
|
s.shiftKey && (Z == null || Z.close()), e(i);
|
|
849
851
|
}), t.appendChild(a);
|
|
850
852
|
}), t;
|
|
851
853
|
}
|
|
852
|
-
function
|
|
854
|
+
function L1(n, e) {
|
|
853
855
|
const t = document.createElement("div");
|
|
854
856
|
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;
|
|
855
857
|
}
|
|
856
|
-
function
|
|
858
|
+
function a0(n = null) {
|
|
857
859
|
return {
|
|
858
860
|
height: 0,
|
|
859
861
|
width: 0,
|
|
860
862
|
...n
|
|
861
863
|
};
|
|
862
864
|
}
|
|
863
|
-
const
|
|
864
|
-
function
|
|
865
|
+
const T1 = a0({ width: 0, height: 0 });
|
|
866
|
+
function P1(n = null) {
|
|
865
867
|
return {
|
|
866
868
|
backgroundColor: $.WHITE,
|
|
867
869
|
slides: [],
|
|
868
870
|
title: "Presentation",
|
|
869
|
-
size:
|
|
871
|
+
size: a0({ width: 3840, height: 2160 }),
|
|
870
872
|
resources: {
|
|
871
873
|
images: {}
|
|
872
874
|
},
|
|
873
875
|
...n
|
|
874
876
|
};
|
|
875
877
|
}
|
|
876
|
-
function
|
|
878
|
+
function C1(n) {
|
|
877
879
|
const e = Array.isArray(n) ? n : [n];
|
|
878
880
|
let t = 0, o = 0;
|
|
879
881
|
for (const i of e)
|
|
880
882
|
switch (i.type) {
|
|
881
|
-
case
|
|
883
|
+
case f0.PAUSE:
|
|
882
884
|
t += i.duration;
|
|
883
885
|
break;
|
|
884
|
-
case
|
|
886
|
+
case f0.ANIMATE:
|
|
885
887
|
o = Math.max(o, t + i.delay + i.duration), i.block && (t += i.delay + i.duration);
|
|
886
888
|
break;
|
|
887
|
-
case
|
|
889
|
+
case f0.UPDATE:
|
|
888
890
|
break;
|
|
889
891
|
default:
|
|
890
|
-
|
|
892
|
+
s0(i);
|
|
891
893
|
}
|
|
892
894
|
return o;
|
|
893
895
|
}
|
|
894
896
|
function nt(n, e = null) {
|
|
895
|
-
const { red: t, green: o, blue: i } = n, a =
|
|
897
|
+
const { red: t, green: o, blue: i } = n, a = Et(n, e);
|
|
896
898
|
return `rgba(${t}, ${o}, ${i}, ${a})`;
|
|
897
899
|
}
|
|
898
|
-
function
|
|
900
|
+
function S1(n) {
|
|
899
901
|
return n === document.body;
|
|
900
902
|
}
|
|
901
903
|
function E1(n, e) {
|
|
902
904
|
const t = document.createElement("div");
|
|
903
|
-
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",
|
|
905
|
+
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", S1(e)) {
|
|
904
906
|
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";
|
|
905
907
|
const o = n.size.height / n.size.width;
|
|
906
908
|
ut(t, o), window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change", () => ut(t, o));
|
|
@@ -910,7 +912,7 @@ function E1(n, e) {
|
|
|
910
912
|
function ut(n, e) {
|
|
911
913
|
window.innerHeight / window.innerWidth > e ? (n.style.width = "100%", n.style.height = "auto") : (n.style.width = "auto", n.style.height = "100%");
|
|
912
914
|
}
|
|
913
|
-
const
|
|
915
|
+
const k1 = {
|
|
914
916
|
check: (n) => typeof n == "object" && n !== null && typeof n.red == "number" && typeof n.green == "number" && typeof n.blue == "number" && typeof n.alpha == "number",
|
|
915
917
|
interpolate: (n, e, t) => ({
|
|
916
918
|
red: Math.round(n.red + (e.red - n.red) * t),
|
|
@@ -921,15 +923,15 @@ const S1 = {
|
|
|
921
923
|
}, I1 = {
|
|
922
924
|
check: (n) => !0,
|
|
923
925
|
interpolate: (n, e) => e
|
|
924
|
-
},
|
|
926
|
+
}, _1 = {
|
|
925
927
|
check: (n) => typeof n == "number",
|
|
926
928
|
interpolate: (n, e, t) => n + (e - n) * t
|
|
927
929
|
}, ft = [
|
|
930
|
+
_1,
|
|
928
931
|
k1,
|
|
929
|
-
S1,
|
|
930
932
|
I1
|
|
931
933
|
];
|
|
932
|
-
function
|
|
934
|
+
function O1(n, e, t, o = null) {
|
|
933
935
|
if (t === 0)
|
|
934
936
|
return n;
|
|
935
937
|
if (t === 1)
|
|
@@ -958,7 +960,7 @@ function gt(n, e, t = null) {
|
|
|
958
960
|
if (t !== null && i > t)
|
|
959
961
|
break;
|
|
960
962
|
switch (a.type) {
|
|
961
|
-
case
|
|
963
|
+
case f0.ANIMATE: {
|
|
962
964
|
const s = n.get(a.object);
|
|
963
965
|
if (s === void 0)
|
|
964
966
|
break;
|
|
@@ -971,7 +973,7 @@ function gt(n, e, t = null) {
|
|
|
971
973
|
);
|
|
972
974
|
n.set(a.object, {
|
|
973
975
|
...s,
|
|
974
|
-
...
|
|
976
|
+
...O1(
|
|
975
977
|
s,
|
|
976
978
|
a.props,
|
|
977
979
|
a.easing(h),
|
|
@@ -980,7 +982,7 @@ function gt(n, e, t = null) {
|
|
|
980
982
|
}), a.block && (i += a.delay + a.duration);
|
|
981
983
|
break;
|
|
982
984
|
}
|
|
983
|
-
case
|
|
985
|
+
case f0.UPDATE: {
|
|
984
986
|
const s = n.get(a.object);
|
|
985
987
|
if (s === void 0)
|
|
986
988
|
break;
|
|
@@ -990,18 +992,18 @@ function gt(n, e, t = null) {
|
|
|
990
992
|
});
|
|
991
993
|
break;
|
|
992
994
|
}
|
|
993
|
-
case
|
|
995
|
+
case f0.PAUSE:
|
|
994
996
|
i += a.duration;
|
|
995
997
|
break;
|
|
996
998
|
default:
|
|
997
|
-
|
|
999
|
+
s0(a);
|
|
998
1000
|
}
|
|
999
1001
|
}
|
|
1000
1002
|
}
|
|
1001
1003
|
function Ot(n) {
|
|
1002
1004
|
return "objects" in n ? n.objects.filter((e) => "objectType" in e) : [];
|
|
1003
1005
|
}
|
|
1004
|
-
function
|
|
1006
|
+
function F1({
|
|
1005
1007
|
slide: n,
|
|
1006
1008
|
buildIndex: e,
|
|
1007
1009
|
buildTime: t
|
|
@@ -1028,7 +1030,7 @@ function O1({
|
|
|
1028
1030
|
function R1(n) {
|
|
1029
1031
|
const e = {};
|
|
1030
1032
|
function t(o) {
|
|
1031
|
-
if (o.objectType ===
|
|
1033
|
+
if (o.objectType === U.SVG) {
|
|
1032
1034
|
const a = o.svg;
|
|
1033
1035
|
a !== void 0 && a.length > 0 && (e[a] = a);
|
|
1034
1036
|
}
|
|
@@ -1041,7 +1043,7 @@ function R1(n) {
|
|
|
1041
1043
|
t(i);
|
|
1042
1044
|
return e;
|
|
1043
1045
|
}
|
|
1044
|
-
function
|
|
1046
|
+
function N1(n) {
|
|
1045
1047
|
var o;
|
|
1046
1048
|
const { slides: e } = n, t = {
|
|
1047
1049
|
// First build of first slide
|
|
@@ -1080,8 +1082,8 @@ function N0(n, e, t, o) {
|
|
|
1080
1082
|
else
|
|
1081
1083
|
n[e] = { slideIndex: t, buildIndex: o };
|
|
1082
1084
|
}
|
|
1083
|
-
function
|
|
1084
|
-
t.shortcuts =
|
|
1085
|
+
function B1(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigator: s }) {
|
|
1086
|
+
t.shortcuts = N1(n), e.addEventListener("mousemove", () => {
|
|
1085
1087
|
e.style.cursor = "auto";
|
|
1086
1088
|
}), e.addEventListener("keyup", (r) => {
|
|
1087
1089
|
if (r.code === "Escape") {
|
|
@@ -1141,7 +1143,7 @@ function q1(n, e) {
|
|
|
1141
1143
|
buildIndex: r
|
|
1142
1144
|
});
|
|
1143
1145
|
}
|
|
1144
|
-
function
|
|
1146
|
+
function D1({ title: n, slideIndex: e, buildIndex: t }) {
|
|
1145
1147
|
localStorage.setItem(
|
|
1146
1148
|
d0,
|
|
1147
1149
|
JSON.stringify({ title: n, slideIndex: e, buildIndex: t, timestamp: Date.now() })
|
|
@@ -1164,42 +1166,42 @@ const pt = Object.freeze({
|
|
|
1164
1166
|
Browser: "browser",
|
|
1165
1167
|
Node: "node"
|
|
1166
1168
|
};
|
|
1167
|
-
function
|
|
1169
|
+
function j1(n, e) {
|
|
1168
1170
|
e.context.clearRect(0, 0, n.width, n.height);
|
|
1169
1171
|
}
|
|
1170
|
-
function
|
|
1172
|
+
function z1(n) {
|
|
1171
1173
|
const e = document.createElement("canvas");
|
|
1172
1174
|
return e.setAttribute("width", n.width.toString()), e.setAttribute("height", n.height.toString()), e.style.position = "absolute", e.style.width = "100%", e;
|
|
1173
1175
|
}
|
|
1174
|
-
const
|
|
1176
|
+
const g0 = {
|
|
1175
1177
|
Browser: "browser",
|
|
1176
1178
|
Node: "node"
|
|
1177
1179
|
};
|
|
1178
|
-
function
|
|
1180
|
+
function U1(n) {
|
|
1179
1181
|
const e = new Path2D(n);
|
|
1180
1182
|
return {
|
|
1181
|
-
type:
|
|
1183
|
+
type: g0.Browser,
|
|
1182
1184
|
path: e
|
|
1183
1185
|
};
|
|
1184
1186
|
}
|
|
1185
|
-
function
|
|
1186
|
-
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 },
|
|
1187
|
-
x:
|
|
1188
|
-
y:
|
|
1189
|
-
},
|
|
1190
|
-
x:
|
|
1191
|
-
y:
|
|
1192
|
-
},
|
|
1193
|
-
x:
|
|
1194
|
-
y:
|
|
1195
|
-
},
|
|
1196
|
-
x:
|
|
1197
|
-
y:
|
|
1187
|
+
function Y1(n) {
|
|
1188
|
+
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 }, d = 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, T = Math.cos(d), S = Math.sin(d), P = h ? { x: l.x - T * M / 2, y: l.y - S * M / 2 } : c, E = h ? { x: l.x + T * M / 2, y: l.y + S * M / 2 } : { x: c.x + T * M, y: c.y + S * M }, C = r ? Math.PI / 6 : Math.PI / 4.5, O = M < s * 2 ? M / 2 : s, R = {
|
|
1189
|
+
x: E.x - O * Math.cos(d - C),
|
|
1190
|
+
y: E.y - O * Math.sin(d - C)
|
|
1191
|
+
}, G = {
|
|
1192
|
+
x: E.x - O * Math.cos(d + C),
|
|
1193
|
+
y: E.y - O * Math.sin(d + C)
|
|
1194
|
+
}, z = {
|
|
1195
|
+
x: P.x + O * Math.cos(d - C),
|
|
1196
|
+
y: P.y + O * Math.sin(d - C)
|
|
1197
|
+
}, H = {
|
|
1198
|
+
x: P.x + O * Math.cos(d + C),
|
|
1199
|
+
y: P.y + O * Math.sin(d + C)
|
|
1198
1200
|
};
|
|
1199
1201
|
return {
|
|
1200
|
-
arrowPoints: [
|
|
1201
|
-
arrowheadPoints: [
|
|
1202
|
-
doubledArrowheadPoints: [
|
|
1202
|
+
arrowPoints: [P, E],
|
|
1203
|
+
arrowheadPoints: [R, E, G],
|
|
1204
|
+
doubledArrowheadPoints: [z, P, H]
|
|
1203
1205
|
};
|
|
1204
1206
|
}
|
|
1205
1207
|
function y0({
|
|
@@ -1224,19 +1226,19 @@ function y0({
|
|
|
1224
1226
|
]) : n.context.setLineDash([f, c - f]);
|
|
1225
1227
|
} else
|
|
1226
1228
|
n.context.setLineDash([]);
|
|
1227
|
-
if (n.context.lineWidth = h, n.context.strokeStyle =
|
|
1229
|
+
if (n.context.lineWidth = h, n.context.strokeStyle = S0(e, a), n.context.lineCap = i ? "round" : "butt", s === void 0) {
|
|
1228
1230
|
n.context.stroke();
|
|
1229
1231
|
return;
|
|
1230
1232
|
}
|
|
1231
1233
|
switch (n.type) {
|
|
1232
1234
|
case V.Browser:
|
|
1233
|
-
s.type ===
|
|
1235
|
+
s.type === g0.Browser ? n.context.stroke(s.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1234
1236
|
break;
|
|
1235
1237
|
case V.Node:
|
|
1236
|
-
s.type ===
|
|
1238
|
+
s.type === g0.Node ? n.context.stroke(s.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1237
1239
|
break;
|
|
1238
1240
|
default:
|
|
1239
|
-
|
|
1241
|
+
s0(n);
|
|
1240
1242
|
}
|
|
1241
1243
|
}
|
|
1242
1244
|
}
|
|
@@ -1247,16 +1249,16 @@ function v0({ ctx: n, path: e, color: t, opacity: o = null }) {
|
|
|
1247
1249
|
}
|
|
1248
1250
|
switch (n.type) {
|
|
1249
1251
|
case V.Browser:
|
|
1250
|
-
e.type ===
|
|
1252
|
+
e.type === g0.Browser ? n.context.fill(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1251
1253
|
break;
|
|
1252
1254
|
case V.Node:
|
|
1253
|
-
e.type ===
|
|
1255
|
+
e.type === g0.Node ? n.context.fill(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1254
1256
|
break;
|
|
1255
1257
|
default:
|
|
1256
|
-
|
|
1258
|
+
s0(n);
|
|
1257
1259
|
}
|
|
1258
1260
|
}
|
|
1259
|
-
function
|
|
1261
|
+
function B0(n, e) {
|
|
1260
1262
|
const t = e(), o = n[0];
|
|
1261
1263
|
if (o === void 0)
|
|
1262
1264
|
return { path: t, length: 0 };
|
|
@@ -1271,7 +1273,7 @@ function q0(n, e) {
|
|
|
1271
1273
|
}
|
|
1272
1274
|
return { path: t, length: i };
|
|
1273
1275
|
}
|
|
1274
|
-
const
|
|
1276
|
+
const H1 = ({
|
|
1275
1277
|
ctx: n,
|
|
1276
1278
|
object: e,
|
|
1277
1279
|
opacity: t,
|
|
@@ -1280,7 +1282,7 @@ const Y1 = ({
|
|
|
1280
1282
|
const i = e.opacity * t;
|
|
1281
1283
|
if (i === 0 || e.drawn === 0)
|
|
1282
1284
|
return;
|
|
1283
|
-
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } =
|
|
1285
|
+
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } = Y1(e), { path: h } = B0(a, o), { path: c } = B0(s, o);
|
|
1284
1286
|
if (y0({
|
|
1285
1287
|
color: e.color,
|
|
1286
1288
|
ctx: n,
|
|
@@ -1299,7 +1301,7 @@ const Y1 = ({
|
|
|
1299
1301
|
opacity: i,
|
|
1300
1302
|
width: e.width
|
|
1301
1303
|
}), e.isArrowheadDoubled) {
|
|
1302
|
-
const { path: f } =
|
|
1304
|
+
const { path: f } = B0(
|
|
1303
1305
|
r,
|
|
1304
1306
|
o
|
|
1305
1307
|
);
|
|
@@ -1318,149 +1320,149 @@ const Y1 = ({
|
|
|
1318
1320
|
}
|
|
1319
1321
|
};
|
|
1320
1322
|
function X1(n, e) {
|
|
1321
|
-
const t = n.radius - n.
|
|
1323
|
+
const t = n.radius - n.strokeWidth / 2;
|
|
1322
1324
|
if (t <= 0)
|
|
1323
1325
|
return;
|
|
1324
1326
|
const o = e(), i = -Math.PI / 2;
|
|
1325
1327
|
return o.path.arc(n.x, n.y, t, i, i + 2 * Math.PI), o;
|
|
1326
1328
|
}
|
|
1327
|
-
function
|
|
1329
|
+
function $1(n, e) {
|
|
1328
1330
|
const t = e(), o = -Math.PI / 2;
|
|
1329
1331
|
t.path.arc(n.x, n.y, n.radius, o, o + 2 * Math.PI);
|
|
1330
1332
|
const i = 2 * Math.PI * n.radius;
|
|
1331
1333
|
return { path: t, length: i };
|
|
1332
1334
|
}
|
|
1333
|
-
function
|
|
1335
|
+
function Ft(n, e) {
|
|
1334
1336
|
switch (n.type) {
|
|
1335
1337
|
case V.Browser:
|
|
1336
|
-
e.type ===
|
|
1338
|
+
e.type === g0.Browser ? n.context.clip(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1337
1339
|
break;
|
|
1338
1340
|
case V.Node:
|
|
1339
|
-
e.type ===
|
|
1341
|
+
e.type === g0.Node ? n.context.clip(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1340
1342
|
break;
|
|
1341
1343
|
default:
|
|
1342
|
-
|
|
1344
|
+
s0(n);
|
|
1343
1345
|
}
|
|
1344
1346
|
}
|
|
1345
|
-
const
|
|
1347
|
+
const G1 = ({
|
|
1346
1348
|
ctx: n,
|
|
1347
1349
|
object: e,
|
|
1348
1350
|
opacity: t,
|
|
1349
1351
|
createPath2D: o
|
|
1350
1352
|
}) => {
|
|
1351
1353
|
const i = e.opacity * t;
|
|
1352
|
-
if (i === 0 || e.drawn === 0 && e.
|
|
1354
|
+
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1353
1355
|
return;
|
|
1354
|
-
const { path: a, length: s } =
|
|
1355
|
-
if (i < 1 && e.
|
|
1356
|
+
const { path: a, length: s } = $1(e, o);
|
|
1357
|
+
if (i < 1 && e.strokeWidth > 0) {
|
|
1356
1358
|
const r = X1(e, o);
|
|
1357
|
-
r !== void 0 && (n.context.save(),
|
|
1359
|
+
r !== void 0 && (n.context.save(), Ft(n, r), v0({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
|
|
1358
1360
|
} else
|
|
1359
|
-
v0({ ctx: n, path: a, color: e.
|
|
1361
|
+
v0({ ctx: n, path: a, color: e.fillColor, opacity: i });
|
|
1360
1362
|
y0({
|
|
1361
|
-
color: e.
|
|
1363
|
+
color: e.strokeColor,
|
|
1362
1364
|
ctx: n,
|
|
1363
1365
|
drawn: e.drawn,
|
|
1364
1366
|
path: a,
|
|
1365
1367
|
pathLength: s,
|
|
1366
1368
|
opacity: i,
|
|
1367
|
-
width: e.
|
|
1369
|
+
width: e.strokeWidth
|
|
1368
1370
|
});
|
|
1369
1371
|
};
|
|
1370
|
-
function
|
|
1372
|
+
function X(n = null) {
|
|
1371
1373
|
return {
|
|
1372
1374
|
x: 0,
|
|
1373
1375
|
y: 0,
|
|
1374
1376
|
...n
|
|
1375
1377
|
};
|
|
1376
1378
|
}
|
|
1377
|
-
const
|
|
1378
|
-
function
|
|
1379
|
+
const W1 = X();
|
|
1380
|
+
function u0(n = null) {
|
|
1379
1381
|
return {
|
|
1380
|
-
origin:
|
|
1381
|
-
size:
|
|
1382
|
+
origin: W1,
|
|
1383
|
+
size: T1,
|
|
1382
1384
|
...n
|
|
1383
1385
|
};
|
|
1384
1386
|
}
|
|
1385
|
-
|
|
1386
|
-
function
|
|
1387
|
+
u0();
|
|
1388
|
+
function p0(n, e, t) {
|
|
1387
1389
|
const { x: o, y: i } = n, { width: a, height: s } = t;
|
|
1388
1390
|
switch (e) {
|
|
1389
|
-
case
|
|
1390
|
-
return
|
|
1391
|
-
origin:
|
|
1391
|
+
case o0.TOP_LEFT:
|
|
1392
|
+
return u0({
|
|
1393
|
+
origin: X({ x: o, y: i }),
|
|
1392
1394
|
size: t
|
|
1393
1395
|
});
|
|
1394
|
-
case
|
|
1395
|
-
return
|
|
1396
|
-
origin:
|
|
1396
|
+
case o0.TOP:
|
|
1397
|
+
return u0({
|
|
1398
|
+
origin: X({ x: o - a / 2, y: i }),
|
|
1397
1399
|
size: t
|
|
1398
1400
|
});
|
|
1399
|
-
case
|
|
1400
|
-
return
|
|
1401
|
-
origin:
|
|
1401
|
+
case o0.TOP_RIGHT:
|
|
1402
|
+
return u0({
|
|
1403
|
+
origin: X({ x: o - a, y: i }),
|
|
1402
1404
|
size: t
|
|
1403
1405
|
});
|
|
1404
|
-
case
|
|
1405
|
-
return
|
|
1406
|
-
origin:
|
|
1406
|
+
case o0.LEFT:
|
|
1407
|
+
return u0({
|
|
1408
|
+
origin: X({ x: o, y: i - s / 2 }),
|
|
1407
1409
|
size: t
|
|
1408
1410
|
});
|
|
1409
|
-
case
|
|
1410
|
-
return
|
|
1411
|
-
origin:
|
|
1411
|
+
case o0.CENTER:
|
|
1412
|
+
return u0({
|
|
1413
|
+
origin: X({ x: o - a / 2, y: i - s / 2 }),
|
|
1412
1414
|
size: t
|
|
1413
1415
|
});
|
|
1414
|
-
case
|
|
1415
|
-
return
|
|
1416
|
-
origin:
|
|
1416
|
+
case o0.RIGHT:
|
|
1417
|
+
return u0({
|
|
1418
|
+
origin: X({ x: o - a, y: i - s / 2 }),
|
|
1417
1419
|
size: t
|
|
1418
1420
|
});
|
|
1419
|
-
case
|
|
1420
|
-
return
|
|
1421
|
-
origin:
|
|
1421
|
+
case o0.BOTTOM_LEFT:
|
|
1422
|
+
return u0({
|
|
1423
|
+
origin: X({ x: o, y: i - s }),
|
|
1422
1424
|
size: t
|
|
1423
1425
|
});
|
|
1424
|
-
case
|
|
1425
|
-
return
|
|
1426
|
-
origin:
|
|
1426
|
+
case o0.BOTTOM:
|
|
1427
|
+
return u0({
|
|
1428
|
+
origin: X({ x: o - a / 2, y: i - s }),
|
|
1427
1429
|
size: t
|
|
1428
1430
|
});
|
|
1429
|
-
case
|
|
1430
|
-
return
|
|
1431
|
-
origin:
|
|
1431
|
+
case o0.BOTTOM_RIGHT:
|
|
1432
|
+
return u0({
|
|
1433
|
+
origin: X({ x: o - a, y: i - s }),
|
|
1432
1434
|
size: t
|
|
1433
1435
|
});
|
|
1434
1436
|
default:
|
|
1435
|
-
|
|
1437
|
+
s0(e);
|
|
1436
1438
|
}
|
|
1437
1439
|
}
|
|
1438
|
-
const
|
|
1440
|
+
const Z1 = ({
|
|
1439
1441
|
ctx: n,
|
|
1440
1442
|
object: e,
|
|
1441
1443
|
renderObject: t,
|
|
1442
1444
|
opacity: o
|
|
1443
1445
|
}) => {
|
|
1444
|
-
const i = e.scale * e.scaleX, a = e.scale * e.scaleY, s =
|
|
1445
|
-
|
|
1446
|
+
const i = e.scale * e.scaleX, a = e.scale * e.scaleY, s = p0(
|
|
1447
|
+
X({ x: e.x, y: e.y }),
|
|
1446
1448
|
e.anchor,
|
|
1447
|
-
|
|
1449
|
+
a0({
|
|
1448
1450
|
width: e.width * Math.abs(i),
|
|
1449
1451
|
height: e.height * Math.abs(a)
|
|
1450
1452
|
})
|
|
1451
|
-
), { rotation: r, rotateOriginX: h, rotateOriginY: c, skewOriginX: f, skewOriginY:
|
|
1453
|
+
), { rotation: r, rotateOriginX: h, rotateOriginY: c, skewOriginX: f, skewOriginY: d, skewX: l, skewY: u } = e;
|
|
1452
1454
|
if (!(i === 0 || a === 0)) {
|
|
1453
|
-
n.context.save(), n.context.translate(s.origin.x, s.origin.y), n.context.scale(i, a), n.context.translate(h, c), n.context.rotate(r * Math.PI / 180), n.context.translate(-h, -c), n.context.translate(f,
|
|
1455
|
+
n.context.save(), n.context.translate(s.origin.x, s.origin.y), n.context.scale(i, a), n.context.translate(h, c), n.context.rotate(r * Math.PI / 180), n.context.translate(-h, -c), n.context.translate(f, d), n.context.transform(
|
|
1454
1456
|
1,
|
|
1455
1457
|
Math.tan(u * Math.PI / 180),
|
|
1456
1458
|
Math.tan(l * Math.PI / 180),
|
|
1457
1459
|
1,
|
|
1458
1460
|
0,
|
|
1459
1461
|
0
|
|
1460
|
-
), n.context.translate(-f, -
|
|
1461
|
-
for (const
|
|
1462
|
-
t(
|
|
1463
|
-
e.previewColor !== null && (n.context.fillStyle =
|
|
1462
|
+
), n.context.translate(-f, -d);
|
|
1463
|
+
for (const m of e.objects)
|
|
1464
|
+
t(m, o * e.opacity);
|
|
1465
|
+
e.previewColor !== null && (n.context.fillStyle = S0(e.previewColor), n.context.fillRect(0, 0, e.width, e.height)), e.rotateOriginPreviewSize > 0 && (n.context.fillStyle = "red", n.context.beginPath(), n.context.arc(h, c, e.rotateOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), e.skewOriginPreviewSize > 0 && (n.context.fillStyle = "blue", n.context.beginPath(), n.context.arc(f, d, e.skewOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), n.context.restore();
|
|
1464
1466
|
}
|
|
1465
1467
|
};
|
|
1466
1468
|
function rt(n, e, t, o, i = 0) {
|
|
@@ -1487,43 +1489,43 @@ function rt(n, e, t, o, i = 0) {
|
|
|
1487
1489
|
const s = 2 * (e.width + e.height - 4 * t) + 2 * Math.PI * t + i;
|
|
1488
1490
|
return { path: a, length: s };
|
|
1489
1491
|
}
|
|
1490
|
-
const
|
|
1492
|
+
const E0 = {
|
|
1491
1493
|
Browser: "browser",
|
|
1492
1494
|
Node: "node"
|
|
1493
|
-
},
|
|
1495
|
+
}, V1 = ({
|
|
1494
1496
|
ctx: n,
|
|
1495
1497
|
imageById: e,
|
|
1496
1498
|
object: t,
|
|
1497
1499
|
opacity: o,
|
|
1498
1500
|
createPath2D: i
|
|
1499
1501
|
}) => {
|
|
1500
|
-
const a =
|
|
1501
|
-
|
|
1502
|
+
const a = p0(
|
|
1503
|
+
X({ x: t.x, y: t.y }),
|
|
1502
1504
|
t.anchor,
|
|
1503
|
-
|
|
1505
|
+
a0({ width: t.width, height: t.height })
|
|
1504
1506
|
), s = e[t.imageId];
|
|
1505
1507
|
if (s !== void 0) {
|
|
1506
|
-
if (n.context.save(), t.
|
|
1508
|
+
if (n.context.save(), t.cornerRadius > 0) {
|
|
1507
1509
|
const r = rt(
|
|
1508
1510
|
a.origin,
|
|
1509
1511
|
a.size,
|
|
1510
|
-
t.
|
|
1512
|
+
t.cornerRadius,
|
|
1511
1513
|
i
|
|
1512
1514
|
);
|
|
1513
1515
|
switch (n.type) {
|
|
1514
1516
|
case V.Browser:
|
|
1515
|
-
r.path.type ===
|
|
1517
|
+
r.path.type === g0.Browser ? n.context.clip(r.path.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
1516
1518
|
break;
|
|
1517
1519
|
case V.Node:
|
|
1518
|
-
r.path.type ===
|
|
1520
|
+
r.path.type === g0.Node ? n.context.clip(r.path.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
|
|
1519
1521
|
break;
|
|
1520
1522
|
default:
|
|
1521
|
-
|
|
1523
|
+
s0(n);
|
|
1522
1524
|
}
|
|
1523
1525
|
}
|
|
1524
1526
|
switch (n.context.globalAlpha = o * t.opacity, n.context.imageSmoothingEnabled = t.smooth, n.type) {
|
|
1525
1527
|
case V.Browser:
|
|
1526
|
-
s.type ===
|
|
1528
|
+
s.type === E0.Browser ? n.context.drawImage(
|
|
1527
1529
|
s.image,
|
|
1528
1530
|
a.origin.x,
|
|
1529
1531
|
a.origin.y,
|
|
@@ -1532,7 +1534,7 @@ const S0 = {
|
|
|
1532
1534
|
) : console.warn("Attempted to use Node Image in Browser Canvas context");
|
|
1533
1535
|
break;
|
|
1534
1536
|
case V.Node:
|
|
1535
|
-
s.type ===
|
|
1537
|
+
s.type === E0.Node ? n.context.drawImage(
|
|
1536
1538
|
s.image,
|
|
1537
1539
|
a.origin.x,
|
|
1538
1540
|
a.origin.y,
|
|
@@ -1541,18 +1543,18 @@ const S0 = {
|
|
|
1541
1543
|
) : console.warn("Attempted to use Browser Image in Node Canvas context");
|
|
1542
1544
|
break;
|
|
1543
1545
|
default:
|
|
1544
|
-
|
|
1546
|
+
s0(n);
|
|
1545
1547
|
}
|
|
1546
1548
|
n.context.restore();
|
|
1547
1549
|
}
|
|
1548
1550
|
};
|
|
1549
|
-
function
|
|
1551
|
+
function K1(n, e) {
|
|
1550
1552
|
const t = e();
|
|
1551
1553
|
t.path.moveTo(n.startX, n.startY), t.path.lineTo(n.endX, n.endY);
|
|
1552
1554
|
const o = Math.hypot(n.endX - n.startX, n.endY - n.startY);
|
|
1553
1555
|
return { path: t, length: o };
|
|
1554
1556
|
}
|
|
1555
|
-
const
|
|
1557
|
+
const Q1 = ({
|
|
1556
1558
|
ctx: n,
|
|
1557
1559
|
object: e,
|
|
1558
1560
|
opacity: t,
|
|
@@ -1561,7 +1563,7 @@ const K1 = ({
|
|
|
1561
1563
|
const i = e.opacity * t;
|
|
1562
1564
|
if (i === 0 || e.drawn === 0)
|
|
1563
1565
|
return;
|
|
1564
|
-
const { path: a, length: s } =
|
|
1566
|
+
const { path: a, length: s } = K1(e, o);
|
|
1565
1567
|
y0({
|
|
1566
1568
|
color: e.color,
|
|
1567
1569
|
ctx: n,
|
|
@@ -1573,43 +1575,43 @@ const K1 = ({
|
|
|
1573
1575
|
opacity: i,
|
|
1574
1576
|
width: e.width
|
|
1575
1577
|
});
|
|
1576
|
-
},
|
|
1578
|
+
}, J1 = ({
|
|
1577
1579
|
ctx: n,
|
|
1578
1580
|
object: e,
|
|
1579
1581
|
opacity: t,
|
|
1580
1582
|
renderObject: o
|
|
1581
1583
|
}) => {
|
|
1582
1584
|
n.context.save();
|
|
1583
|
-
const i =
|
|
1584
|
-
|
|
1585
|
+
const i = p0(
|
|
1586
|
+
X({ x: e.x, y: e.y }),
|
|
1585
1587
|
e.anchor,
|
|
1586
|
-
|
|
1588
|
+
a0({ width: e.width, height: e.height })
|
|
1587
1589
|
);
|
|
1588
|
-
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle =
|
|
1590
|
+
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = S0($.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();
|
|
1589
1591
|
for (const a of e.objects)
|
|
1590
1592
|
o(a, t * e.opacity);
|
|
1591
1593
|
n.context.restore();
|
|
1592
|
-
},
|
|
1594
|
+
}, te = ({
|
|
1593
1595
|
ctx: n,
|
|
1594
1596
|
object: e,
|
|
1595
1597
|
opacity: t,
|
|
1596
1598
|
createPath2D: o
|
|
1597
1599
|
}) => {
|
|
1598
1600
|
const i = e.opacity * t;
|
|
1599
|
-
if (i === 0 || e.drawn === 0 && e.
|
|
1601
|
+
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1600
1602
|
return;
|
|
1601
|
-
const { origin: a } =
|
|
1602
|
-
|
|
1603
|
+
const { origin: a } = p0(
|
|
1604
|
+
X({ x: e.x, y: e.y }),
|
|
1603
1605
|
e.anchor,
|
|
1604
|
-
|
|
1606
|
+
a0({ width: e.width, height: e.height })
|
|
1605
1607
|
), s = o(e.path);
|
|
1606
1608
|
n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight), v0({
|
|
1607
1609
|
ctx: n,
|
|
1608
1610
|
path: s,
|
|
1609
|
-
color: e.
|
|
1611
|
+
color: e.fillColor,
|
|
1610
1612
|
opacity: i
|
|
1611
1613
|
}), y0({
|
|
1612
|
-
color: e.
|
|
1614
|
+
color: e.strokeColor,
|
|
1613
1615
|
ctx: n,
|
|
1614
1616
|
drawn: e.drawn,
|
|
1615
1617
|
isRounded: e.isRounded,
|
|
@@ -1619,7 +1621,7 @@ const K1 = ({
|
|
|
1619
1621
|
width: e.strokeWidth
|
|
1620
1622
|
}), n.context.restore();
|
|
1621
1623
|
};
|
|
1622
|
-
function
|
|
1624
|
+
function ee(n, e) {
|
|
1623
1625
|
const t = e(), o = n.points, i = o[0];
|
|
1624
1626
|
if (i === void 0)
|
|
1625
1627
|
return { path: t, length: 0 };
|
|
@@ -1640,54 +1642,57 @@ function te(n, e) {
|
|
|
1640
1642
|
);
|
|
1641
1643
|
return a += r, { path: t, length: a };
|
|
1642
1644
|
}
|
|
1643
|
-
const
|
|
1645
|
+
const ne = ({
|
|
1644
1646
|
ctx: n,
|
|
1645
1647
|
object: e,
|
|
1646
1648
|
opacity: t,
|
|
1647
1649
|
createPath2D: o
|
|
1648
1650
|
}) => {
|
|
1649
1651
|
const i = e.opacity * t;
|
|
1650
|
-
if (i === 0 || e.drawn === 0 && e.
|
|
1652
|
+
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1651
1653
|
return;
|
|
1652
|
-
const { path: a, length: s } =
|
|
1654
|
+
const { path: a, length: s } = ee(e, o);
|
|
1653
1655
|
v0({
|
|
1654
1656
|
ctx: n,
|
|
1655
1657
|
path: a,
|
|
1656
|
-
color: e.
|
|
1658
|
+
color: e.fillColor,
|
|
1657
1659
|
opacity: i
|
|
1658
1660
|
}), y0({
|
|
1659
|
-
color: e.
|
|
1661
|
+
color: e.strokeColor,
|
|
1660
1662
|
ctx: n,
|
|
1661
1663
|
drawn: e.drawn,
|
|
1662
1664
|
path: a,
|
|
1663
1665
|
pathLength: s,
|
|
1664
1666
|
opacity: i,
|
|
1665
|
-
width: e.
|
|
1667
|
+
width: e.strokeWidth
|
|
1666
1668
|
});
|
|
1667
1669
|
};
|
|
1668
|
-
function
|
|
1669
|
-
const t = n.
|
|
1670
|
-
|
|
1670
|
+
function re(n, e) {
|
|
1671
|
+
const t = n.strokeWidth / 2, { origin: o, size: i } = p0(
|
|
1672
|
+
X({ x: n.x, y: n.y }),
|
|
1671
1673
|
n.anchor,
|
|
1672
|
-
|
|
1673
|
-
), a = i.width - n.
|
|
1674
|
+
a0({ width: n.width, height: n.height })
|
|
1675
|
+
), a = i.width - n.strokeWidth, s = i.height - n.strokeWidth;
|
|
1674
1676
|
if (a <= 0 || s <= 0)
|
|
1675
1677
|
return;
|
|
1676
|
-
const r =
|
|
1678
|
+
const r = X({ x: o.x + t, y: o.y + t }), h = a0({ width: a, height: s }), c = Math.max(
|
|
1677
1679
|
0,
|
|
1678
|
-
Math.min(n.
|
|
1680
|
+
Math.min(n.cornerRadius - t, Math.min(a, s) / 2)
|
|
1679
1681
|
);
|
|
1680
1682
|
if (c > 0)
|
|
1681
1683
|
return rt(r, h, c, e).path;
|
|
1682
1684
|
const f = e();
|
|
1683
1685
|
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;
|
|
1684
1686
|
}
|
|
1685
|
-
function
|
|
1686
|
-
const { origin: t, size: o } =
|
|
1687
|
-
|
|
1687
|
+
function ie(n, e) {
|
|
1688
|
+
const { origin: t, size: o } = p0(
|
|
1689
|
+
X({ x: n.x, y: n.y }),
|
|
1688
1690
|
n.anchor,
|
|
1689
|
-
|
|
1690
|
-
), i = Math.max(
|
|
1691
|
+
a0({ width: n.width, height: n.height })
|
|
1692
|
+
), i = Math.max(
|
|
1693
|
+
0,
|
|
1694
|
+
Math.min(n.cornerRadius, Math.min(o.width, o.height) / 2)
|
|
1695
|
+
), a = Math.min(n.strokeWidth * 2, o.width - i);
|
|
1691
1696
|
if (i > 0)
|
|
1692
1697
|
return rt(t, o, i, e, a);
|
|
1693
1698
|
{
|
|
@@ -1697,31 +1702,31 @@ function re(n, e) {
|
|
|
1697
1702
|
return { path: s, length: r };
|
|
1698
1703
|
}
|
|
1699
1704
|
}
|
|
1700
|
-
const
|
|
1705
|
+
const oe = ({
|
|
1701
1706
|
ctx: n,
|
|
1702
1707
|
object: e,
|
|
1703
1708
|
opacity: t,
|
|
1704
1709
|
createPath2D: o
|
|
1705
1710
|
}) => {
|
|
1706
1711
|
const i = e.opacity * t;
|
|
1707
|
-
if (i === 0 || e.drawn === 0 && e.
|
|
1712
|
+
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1708
1713
|
return;
|
|
1709
|
-
const { path: a, length: s } =
|
|
1710
|
-
if (i < 1 && e.
|
|
1711
|
-
const r =
|
|
1712
|
-
r !== void 0 && (n.context.save(),
|
|
1714
|
+
const { path: a, length: s } = ie(e, o);
|
|
1715
|
+
if (i < 1 && e.strokeWidth > 0) {
|
|
1716
|
+
const r = re(e, o);
|
|
1717
|
+
r !== void 0 && (n.context.save(), Ft(n, r), v0({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
|
|
1713
1718
|
} else
|
|
1714
|
-
v0({ ctx: n, path: a, color: e.
|
|
1719
|
+
v0({ ctx: n, path: a, color: e.fillColor, opacity: i });
|
|
1715
1720
|
y0({
|
|
1716
|
-
color: e.
|
|
1721
|
+
color: e.strokeColor,
|
|
1717
1722
|
ctx: n,
|
|
1718
1723
|
drawn: e.drawn,
|
|
1719
1724
|
path: a,
|
|
1720
1725
|
pathLength: s,
|
|
1721
1726
|
opacity: i,
|
|
1722
|
-
width: e.
|
|
1727
|
+
width: e.strokeWidth
|
|
1723
1728
|
});
|
|
1724
|
-
},
|
|
1729
|
+
}, se = ({
|
|
1725
1730
|
ctx: n,
|
|
1726
1731
|
imageById: e,
|
|
1727
1732
|
object: t,
|
|
@@ -1733,14 +1738,14 @@ const ie = ({
|
|
|
1733
1738
|
const a = e[t.svg];
|
|
1734
1739
|
if (a === void 0)
|
|
1735
1740
|
return;
|
|
1736
|
-
const s =
|
|
1737
|
-
|
|
1741
|
+
const s = p0(
|
|
1742
|
+
X({ x: t.x, y: t.y }),
|
|
1738
1743
|
t.anchor,
|
|
1739
|
-
|
|
1744
|
+
a0({ width: t.width, height: t.height })
|
|
1740
1745
|
);
|
|
1741
1746
|
switch (n.context.save(), n.context.globalAlpha = i, n.type) {
|
|
1742
1747
|
case V.Browser:
|
|
1743
|
-
a.type ===
|
|
1748
|
+
a.type === E0.Browser && n.context.drawImage(
|
|
1744
1749
|
a.image,
|
|
1745
1750
|
s.origin.x,
|
|
1746
1751
|
s.origin.y,
|
|
@@ -1749,7 +1754,7 @@ const ie = ({
|
|
|
1749
1754
|
);
|
|
1750
1755
|
break;
|
|
1751
1756
|
case V.Node:
|
|
1752
|
-
a.type ===
|
|
1757
|
+
a.type === E0.Node && n.context.drawImage(
|
|
1753
1758
|
a.image,
|
|
1754
1759
|
s.origin.x,
|
|
1755
1760
|
s.origin.y,
|
|
@@ -1758,21 +1763,23 @@ const ie = ({
|
|
|
1758
1763
|
);
|
|
1759
1764
|
break;
|
|
1760
1765
|
default:
|
|
1761
|
-
|
|
1766
|
+
s0(n);
|
|
1762
1767
|
}
|
|
1763
1768
|
n.context.restore();
|
|
1764
1769
|
};
|
|
1765
|
-
function
|
|
1770
|
+
function ae(n) {
|
|
1766
1771
|
return {
|
|
1767
1772
|
color: n.color,
|
|
1768
1773
|
fontFamily: n.fontFamily,
|
|
1769
1774
|
fontSize: n.fontSize,
|
|
1770
1775
|
fontStyle: n.fontStyle,
|
|
1771
1776
|
fontWeight: n.fontWeight,
|
|
1772
|
-
ligatures: n.ligatures
|
|
1777
|
+
ligatures: n.ligatures,
|
|
1778
|
+
subscript: n.subscript,
|
|
1779
|
+
superscript: n.superscript
|
|
1773
1780
|
};
|
|
1774
1781
|
}
|
|
1775
|
-
function
|
|
1782
|
+
function he(n, e = 1) {
|
|
1776
1783
|
const t = Math.max(...n.map((a) => a.reduce((s, r) => s + r.width, 0)));
|
|
1777
1784
|
let o = 0, i = 0;
|
|
1778
1785
|
for (let a = 0; a < n.length; a++) {
|
|
@@ -1787,101 +1794,126 @@ function ae(n, e = 1) {
|
|
|
1787
1794
|
width: t
|
|
1788
1795
|
};
|
|
1789
1796
|
}
|
|
1790
|
-
|
|
1797
|
+
const le = 0.7, ce = 0.3;
|
|
1798
|
+
function Rt(n) {
|
|
1799
|
+
const e = n.superscript, t = n.subscript && !e;
|
|
1800
|
+
return !e && !t ? {
|
|
1801
|
+
baselineShift: 0,
|
|
1802
|
+
fontSize: n.fontSize,
|
|
1803
|
+
isSubscript: !1,
|
|
1804
|
+
isSuperscript: !1
|
|
1805
|
+
} : {
|
|
1806
|
+
baselineShift: n.fontSize * ce * (e ? -1 : 1),
|
|
1807
|
+
fontSize: n.fontSize * le,
|
|
1808
|
+
isSubscript: t,
|
|
1809
|
+
isSuperscript: e
|
|
1810
|
+
};
|
|
1811
|
+
}
|
|
1812
|
+
function ue(n) {
|
|
1791
1813
|
return {
|
|
1792
1814
|
width: n.width,
|
|
1793
1815
|
height: n.fontBoundingBoxAscent
|
|
1794
1816
|
};
|
|
1795
1817
|
}
|
|
1796
|
-
function
|
|
1797
|
-
|
|
1818
|
+
function Nt(n, e, t = 1) {
|
|
1819
|
+
const o = Rt(e);
|
|
1820
|
+
n.context.fillStyle = nt(e.color, t), n.context.font = `${e.fontStyle} ${e.fontWeight} ${o.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";
|
|
1798
1821
|
}
|
|
1799
|
-
function
|
|
1822
|
+
function fe(n, e, t) {
|
|
1800
1823
|
const o = [];
|
|
1801
1824
|
for (const i of n) {
|
|
1802
1825
|
const a = [];
|
|
1803
1826
|
for (const s of i) {
|
|
1804
1827
|
const { text: r, ...h } = s, c = { ...e, ...h };
|
|
1805
|
-
|
|
1806
|
-
const f = t.context.measureText(r);
|
|
1807
|
-
a.push(
|
|
1828
|
+
Nt(t, c);
|
|
1829
|
+
const f = t.context.measureText(r), d = ue(f), { baselineShift: l } = Rt(c), u = d.height + Math.max(0, -l), m = Math.max(0, l);
|
|
1830
|
+
a.push({
|
|
1831
|
+
...d,
|
|
1832
|
+
baselineShift: l,
|
|
1833
|
+
bottom: m,
|
|
1834
|
+
height: u + m,
|
|
1835
|
+
top: u
|
|
1836
|
+
});
|
|
1808
1837
|
}
|
|
1809
1838
|
o.push(a);
|
|
1810
1839
|
}
|
|
1811
1840
|
return o;
|
|
1812
1841
|
}
|
|
1813
|
-
const
|
|
1842
|
+
const ge = ({ ctx: n, object: e, opacity: t }) => {
|
|
1814
1843
|
const o = e.opacity * t;
|
|
1815
1844
|
if (o === 0)
|
|
1816
1845
|
return;
|
|
1817
|
-
const { length: i } = e, a = _t(e.text), s =
|
|
1818
|
-
let f = c.origin.x,
|
|
1819
|
-
for (let
|
|
1820
|
-
const y = a[
|
|
1846
|
+
const { length: i } = e, a = _t(e.text), s = ae(e), r = fe(a, s, n), h = he(r, e.lineSpacing), c = p0(X({ x: e.x, y: e.y }), e.anchor, h);
|
|
1847
|
+
let f = c.origin.x, d = c.origin.y, l = 0, u = 0;
|
|
1848
|
+
for (let m = 0; m < a.length; m++) {
|
|
1849
|
+
const y = a[m], M = r[m];
|
|
1821
1850
|
if (y == null || M == null) {
|
|
1822
1851
|
console.error("Could not determine text units or sizes for line");
|
|
1823
1852
|
continue;
|
|
1824
1853
|
}
|
|
1825
|
-
const
|
|
1854
|
+
const T = M.reduce((O, R) => O + R.width, 0), S = M.length === 0 ? u : M.reduce((O, R) => Math.max(O, R.top), 0), P = M.length === 0 ? 0 : M.reduce((O, R) => Math.max(O, R.bottom), 0), E = S + P;
|
|
1826
1855
|
switch (e.alignment) {
|
|
1827
1856
|
case x0.LEFT:
|
|
1828
1857
|
f = c.origin.x;
|
|
1829
1858
|
break;
|
|
1830
1859
|
case x0.CENTER:
|
|
1831
|
-
f = c.origin.x + (c.size.width -
|
|
1860
|
+
f = c.origin.x + (c.size.width - T) / 2;
|
|
1832
1861
|
break;
|
|
1833
1862
|
case x0.RIGHT:
|
|
1834
|
-
f = c.origin.x + (c.size.width -
|
|
1863
|
+
f = c.origin.x + (c.size.width - T);
|
|
1835
1864
|
break;
|
|
1836
1865
|
default:
|
|
1837
|
-
|
|
1866
|
+
s0(e.alignment);
|
|
1838
1867
|
break;
|
|
1839
1868
|
}
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1869
|
+
d += u * (e.lineSpacing - 1);
|
|
1870
|
+
const C = d + S;
|
|
1871
|
+
u = E;
|
|
1872
|
+
for (let O = 0; O < y.length && !(i !== null && l >= i); O++) {
|
|
1873
|
+
const R = y[O], G = M[O];
|
|
1874
|
+
if (R == null || G == null) {
|
|
1844
1875
|
console.error("Could not determine text unit or size for unit");
|
|
1845
1876
|
continue;
|
|
1846
1877
|
}
|
|
1847
|
-
const { text:
|
|
1848
|
-
let
|
|
1849
|
-
if (i !== null && l +
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1878
|
+
const { text: z, ...H } = R;
|
|
1879
|
+
let t0;
|
|
1880
|
+
if (i !== null && l + z.length > i) {
|
|
1881
|
+
const K = i - l;
|
|
1882
|
+
t0 = z.slice(0, K);
|
|
1852
1883
|
}
|
|
1853
|
-
const
|
|
1854
|
-
l +=
|
|
1855
|
-
const
|
|
1856
|
-
|
|
1884
|
+
const e0 = t0 ?? z;
|
|
1885
|
+
l += e0.length;
|
|
1886
|
+
const n0 = { ...s, ...H };
|
|
1887
|
+
Nt(n, n0, o), n.context.fillText(e0, f, C + G.baselineShift), f += G.width;
|
|
1857
1888
|
}
|
|
1858
|
-
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
[
|
|
1862
|
-
[
|
|
1863
|
-
[
|
|
1864
|
-
[
|
|
1865
|
-
[
|
|
1866
|
-
[
|
|
1867
|
-
[
|
|
1868
|
-
[
|
|
1869
|
-
[
|
|
1889
|
+
d += E;
|
|
1890
|
+
}
|
|
1891
|
+
}, pe = {
|
|
1892
|
+
[U.ARROW]: H1,
|
|
1893
|
+
[U.CIRCLE]: G1,
|
|
1894
|
+
[U.GROUP]: Z1,
|
|
1895
|
+
[U.IMAGE]: V1,
|
|
1896
|
+
[U.LINE]: Q1,
|
|
1897
|
+
[U.MASK]: J1,
|
|
1898
|
+
[U.PATH]: te,
|
|
1899
|
+
[U.POLYGON]: ne,
|
|
1900
|
+
[U.RECTANGLE]: oe,
|
|
1901
|
+
[U.SLIDE_OBJECT]: () => {
|
|
1870
1902
|
},
|
|
1871
|
-
[
|
|
1872
|
-
[
|
|
1903
|
+
[U.SVG]: se,
|
|
1904
|
+
[U.TEXT]: ge
|
|
1873
1905
|
};
|
|
1874
|
-
function
|
|
1906
|
+
function de(n) {
|
|
1875
1907
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1876
1908
|
return e.setAttribute("viewBox", `0 0 ${n.width} ${n.height}`), e.style.backgroundColor = "transparent", e.style.position = "absolute", e.style.width = "100%", e;
|
|
1877
1909
|
}
|
|
1878
|
-
function
|
|
1910
|
+
function xe(n, e) {
|
|
1879
1911
|
if (n === null)
|
|
1880
1912
|
return null;
|
|
1881
|
-
const t =
|
|
1882
|
-
|
|
1913
|
+
const t = p0(
|
|
1914
|
+
X({ x: e.x, y: e.y }),
|
|
1883
1915
|
e.anchor,
|
|
1884
|
-
|
|
1916
|
+
a0({ width: e.width, height: e.height })
|
|
1885
1917
|
), o = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
|
|
1886
1918
|
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());
|
|
1887
1919
|
const i = e.content;
|
|
@@ -1895,20 +1927,20 @@ function ge(n, e) {
|
|
|
1895
1927
|
a !== null && a(), n.removeChild(o);
|
|
1896
1928
|
};
|
|
1897
1929
|
}
|
|
1898
|
-
async function
|
|
1930
|
+
async function ye(n) {
|
|
1899
1931
|
if (Object.keys(n).length === 0)
|
|
1900
1932
|
return {};
|
|
1901
1933
|
const e = {}, t = (i) => new Promise((a, s) => {
|
|
1902
1934
|
const r = new Image();
|
|
1903
1935
|
if (r.onload = () => a(r), r.onerror = (c) => s(c), i.includes("</svg>")) {
|
|
1904
|
-
const c = i.replace(/<\?xml[^?]*\?>\s*/g, ""), f = new Blob([c], { type: "image/svg+xml;charset=utf-8" }),
|
|
1905
|
-
r.src =
|
|
1936
|
+
const c = i.replace(/<\?xml[^?]*\?>\s*/g, ""), f = new Blob([c], { type: "image/svg+xml;charset=utf-8" }), d = URL.createObjectURL(f);
|
|
1937
|
+
r.src = d;
|
|
1906
1938
|
} else
|
|
1907
1939
|
r.src = i;
|
|
1908
1940
|
}), o = Object.entries(n).map(async ([i, a]) => {
|
|
1909
1941
|
const s = await t(a);
|
|
1910
1942
|
e[i] = {
|
|
1911
|
-
type:
|
|
1943
|
+
type: E0.Browser,
|
|
1912
1944
|
image: s
|
|
1913
1945
|
};
|
|
1914
1946
|
});
|
|
@@ -1919,27 +1951,27 @@ async function pe(n) {
|
|
|
1919
1951
|
}
|
|
1920
1952
|
return e;
|
|
1921
1953
|
}
|
|
1922
|
-
class
|
|
1954
|
+
class kn {
|
|
1923
1955
|
constructor(e) {
|
|
1924
1956
|
const { objectRenderers: t, scale: o = 1, ...i } = e;
|
|
1925
1957
|
this.props = {
|
|
1926
|
-
presentation:
|
|
1958
|
+
presentation: P1(),
|
|
1927
1959
|
element: document.body,
|
|
1928
1960
|
objectRenderers: {
|
|
1929
|
-
...
|
|
1961
|
+
...pe,
|
|
1930
1962
|
...t
|
|
1931
1963
|
},
|
|
1932
1964
|
cacheDurationMinutes: 15,
|
|
1933
|
-
scale:
|
|
1965
|
+
scale: ve(o),
|
|
1934
1966
|
...i
|
|
1935
1967
|
}, this.state = { ...pt };
|
|
1936
1968
|
}
|
|
1937
1969
|
/** Starts the presentation. */
|
|
1938
1970
|
async present() {
|
|
1939
|
-
const { presentation: e, element: t, scale: o } = this.props, i =
|
|
1971
|
+
const { presentation: e, element: t, scale: o } = this.props, i = z1(e.size), a = de(e.size);
|
|
1940
1972
|
a.style.transformOrigin = "center center", a.style.transform = `scale(${o})`, this.state = {
|
|
1941
1973
|
...pt,
|
|
1942
|
-
imageById: await
|
|
1974
|
+
imageById: await ye({
|
|
1943
1975
|
...e.resources.images,
|
|
1944
1976
|
...R1(e)
|
|
1945
1977
|
}),
|
|
@@ -1947,7 +1979,7 @@ class Cn {
|
|
|
1947
1979
|
extrasContainer: a
|
|
1948
1980
|
};
|
|
1949
1981
|
const s = E1(e, t);
|
|
1950
|
-
|
|
1982
|
+
B1(e, t, this.state.shortcutState, {
|
|
1951
1983
|
onNext: (h) => this.next(h),
|
|
1952
1984
|
onPrevious: (h) => this.previous(h),
|
|
1953
1985
|
onRenderSlide: (h, c) => {
|
|
@@ -1966,7 +1998,7 @@ class Cn {
|
|
|
1966
1998
|
}
|
|
1967
1999
|
renderSlide(e, t = 0, o = null) {
|
|
1968
2000
|
const { objectRenderers: i, presentation: a, scale: s } = this.props, { canvas: r, imageById: h } = this.state, c = this.state.slideIndex !== e;
|
|
1969
|
-
this.state.slideIndex = e, this.state.buildIndex = t, o === null &&
|
|
2001
|
+
this.state.slideIndex = e, this.state.buildIndex = t, o === null && D1({ title: a.title, slideIndex: e, buildIndex: t });
|
|
1970
2002
|
const f = a.slides[e];
|
|
1971
2003
|
if (f === void 0 || r === null)
|
|
1972
2004
|
return;
|
|
@@ -1975,33 +2007,33 @@ class Cn {
|
|
|
1975
2007
|
M();
|
|
1976
2008
|
this.state.mountedExtrasCleanups = [];
|
|
1977
2009
|
for (const M of f.extras) {
|
|
1978
|
-
const
|
|
1979
|
-
|
|
2010
|
+
const T = xe(this.state.extrasContainer, M);
|
|
2011
|
+
T !== null && this.state.mountedExtrasCleanups.push(T);
|
|
1980
2012
|
}
|
|
1981
2013
|
}
|
|
1982
|
-
const
|
|
1983
|
-
if (
|
|
2014
|
+
const d = r.getContext("2d");
|
|
2015
|
+
if (d === null)
|
|
1984
2016
|
return;
|
|
1985
2017
|
const l = {
|
|
1986
2018
|
type: V.Browser,
|
|
1987
|
-
context:
|
|
2019
|
+
context: d
|
|
1988
2020
|
};
|
|
1989
|
-
|
|
1990
|
-
const u =
|
|
2021
|
+
j1(r, l);
|
|
2022
|
+
const u = F1({
|
|
1991
2023
|
slide: f,
|
|
1992
2024
|
buildIndex: t,
|
|
1993
2025
|
buildTime: o
|
|
1994
2026
|
});
|
|
1995
2027
|
l.context.fillStyle = nt(a.backgroundColor), l.context.fillRect(0, 0, r.width, r.height);
|
|
1996
|
-
function
|
|
1997
|
-
const
|
|
1998
|
-
|
|
2028
|
+
function m(M, T) {
|
|
2029
|
+
const S = i[M.objectType], P = u.get(M);
|
|
2030
|
+
S === void 0 || P === void 0 || S({
|
|
1999
2031
|
ctx: l,
|
|
2000
2032
|
imageById: h,
|
|
2001
|
-
object:
|
|
2002
|
-
opacity:
|
|
2003
|
-
renderObject:
|
|
2004
|
-
createPath2D:
|
|
2033
|
+
object: P,
|
|
2034
|
+
opacity: T,
|
|
2035
|
+
renderObject: m,
|
|
2036
|
+
createPath2D: U1
|
|
2005
2037
|
});
|
|
2006
2038
|
}
|
|
2007
2039
|
const y = s !== 1;
|
|
@@ -2010,7 +2042,7 @@ class Cn {
|
|
|
2010
2042
|
r.height * (1 - s) / 2
|
|
2011
2043
|
), l.context.scale(s, s));
|
|
2012
2044
|
for (const M of f.objects)
|
|
2013
|
-
|
|
2045
|
+
m(M, 1);
|
|
2014
2046
|
y && l.context.restore();
|
|
2015
2047
|
}
|
|
2016
2048
|
next(e = !1) {
|
|
@@ -2021,8 +2053,8 @@ class Cn {
|
|
|
2021
2053
|
return;
|
|
2022
2054
|
const r = s.animations[a];
|
|
2023
2055
|
if (r !== void 0 && !e) {
|
|
2024
|
-
const h = performance.now(), c =
|
|
2025
|
-
const l =
|
|
2056
|
+
const h = performance.now(), c = C1(r), f = (d) => {
|
|
2057
|
+
const l = d - h;
|
|
2026
2058
|
l < c ? (this.renderSlide(i, a + 1, l), this.state.currentAnimationId = requestAnimationFrame(f)) : this.renderSlide(i, a + 1, null);
|
|
2027
2059
|
};
|
|
2028
2060
|
this.state.currentAnimationId = requestAnimationFrame(f);
|
|
@@ -2039,20 +2071,20 @@ class Cn {
|
|
|
2039
2071
|
this.renderSlide(0, 0);
|
|
2040
2072
|
}
|
|
2041
2073
|
}
|
|
2042
|
-
function
|
|
2074
|
+
function ve(n) {
|
|
2043
2075
|
return n <= 0 || n > 1 ? (console.warn(
|
|
2044
2076
|
`BrowserCanvasRenderer scale must be positive and no greater than 1. Received ${n}; using 1 instead.`
|
|
2045
2077
|
), 1) : n;
|
|
2046
2078
|
}
|
|
2047
|
-
function
|
|
2079
|
+
function In(n = 1e3) {
|
|
2048
2080
|
return {
|
|
2049
|
-
type:
|
|
2081
|
+
type: f0.PAUSE,
|
|
2050
2082
|
isKey: !1,
|
|
2051
2083
|
duration: n,
|
|
2052
2084
|
shortcut: null
|
|
2053
2085
|
};
|
|
2054
2086
|
}
|
|
2055
|
-
function
|
|
2087
|
+
function _n(n = null) {
|
|
2056
2088
|
return {
|
|
2057
2089
|
objects: [],
|
|
2058
2090
|
animations: [],
|
|
@@ -2065,31 +2097,31 @@ function Sn(n = null) {
|
|
|
2065
2097
|
...n
|
|
2066
2098
|
};
|
|
2067
2099
|
}
|
|
2068
|
-
function
|
|
2100
|
+
function On(n, e = {}) {
|
|
2069
2101
|
return {
|
|
2070
2102
|
...e,
|
|
2071
2103
|
text: n
|
|
2072
2104
|
};
|
|
2073
2105
|
}
|
|
2074
|
-
function
|
|
2106
|
+
function Fn(n = $.BLACK) {
|
|
2075
2107
|
return { ...n, alpha: 1 };
|
|
2076
2108
|
}
|
|
2077
|
-
function
|
|
2109
|
+
function we(n) {
|
|
2078
2110
|
for (var e = -1, t = n.length, o, i = n[t - 1], a = 0; ++e < t; )
|
|
2079
2111
|
o = i, i = n[e], a += o[1] * i[0] - o[0] * i[1];
|
|
2080
2112
|
return a / 2;
|
|
2081
2113
|
}
|
|
2082
|
-
function
|
|
2114
|
+
function me(n) {
|
|
2083
2115
|
for (var e = -1, t = n.length, o = n[t - 1], i, a, s = o[0], r = o[1], h = 0; ++e < t; )
|
|
2084
2116
|
i = s, a = r, o = n[e], s = o[0], r = o[1], i -= s, a -= r, h += Math.sqrt(i * i + a * a);
|
|
2085
2117
|
return h;
|
|
2086
2118
|
}
|
|
2087
|
-
function
|
|
2119
|
+
function Ae(n) {
|
|
2088
2120
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
2089
2121
|
}
|
|
2090
|
-
var
|
|
2091
|
-
function
|
|
2092
|
-
if (dt) return
|
|
2122
|
+
var q0, dt;
|
|
2123
|
+
function be() {
|
|
2124
|
+
if (dt) return q0;
|
|
2093
2125
|
dt = 1;
|
|
2094
2126
|
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 = [
|
|
2095
2127
|
5760,
|
|
@@ -2152,19 +2184,19 @@ function we() {
|
|
|
2152
2184
|
u.index++;
|
|
2153
2185
|
}
|
|
2154
2186
|
function c(u) {
|
|
2155
|
-
var
|
|
2156
|
-
if (
|
|
2187
|
+
var m = u.path.charCodeAt(u.index);
|
|
2188
|
+
if (m === 48) {
|
|
2157
2189
|
u.param = 0, u.index++;
|
|
2158
2190
|
return;
|
|
2159
2191
|
}
|
|
2160
|
-
if (
|
|
2192
|
+
if (m === 49) {
|
|
2161
2193
|
u.param = 1, u.index++;
|
|
2162
2194
|
return;
|
|
2163
2195
|
}
|
|
2164
2196
|
u.err = "SvgPath: arc flag can be 0 or 1 only (at pos " + u.index + ")";
|
|
2165
2197
|
}
|
|
2166
2198
|
function f(u) {
|
|
2167
|
-
var
|
|
2199
|
+
var m = u.index, y = m, M = u.max, T = !1, S = !1, P = !1, E = !1, C;
|
|
2168
2200
|
if (y >= M) {
|
|
2169
2201
|
u.err = "SvgPath: missed param (at pos " + y + ")";
|
|
2170
2202
|
return;
|
|
@@ -2174,21 +2206,21 @@ function we() {
|
|
|
2174
2206
|
return;
|
|
2175
2207
|
}
|
|
2176
2208
|
if (C !== 46) {
|
|
2177
|
-
if (
|
|
2178
|
-
u.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " +
|
|
2209
|
+
if (T = C === 48, y++, C = y < M ? u.path.charCodeAt(y) : 0, T && y < M && C && a(C)) {
|
|
2210
|
+
u.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " + m + ")";
|
|
2179
2211
|
return;
|
|
2180
2212
|
}
|
|
2181
2213
|
for (; y < M && a(u.path.charCodeAt(y)); )
|
|
2182
|
-
y++,
|
|
2214
|
+
y++, S = !0;
|
|
2183
2215
|
C = y < M ? u.path.charCodeAt(y) : 0;
|
|
2184
2216
|
}
|
|
2185
2217
|
if (C === 46) {
|
|
2186
|
-
for (
|
|
2187
|
-
y++,
|
|
2218
|
+
for (E = !0, y++; a(u.path.charCodeAt(y)); )
|
|
2219
|
+
y++, P = !0;
|
|
2188
2220
|
C = y < M ? u.path.charCodeAt(y) : 0;
|
|
2189
2221
|
}
|
|
2190
2222
|
if (C === 101 || C === 69) {
|
|
2191
|
-
if (
|
|
2223
|
+
if (E && !S && !P) {
|
|
2192
2224
|
u.err = "SvgPath: invalid float exponent (at pos " + y + ")";
|
|
2193
2225
|
return;
|
|
2194
2226
|
}
|
|
@@ -2200,53 +2232,53 @@ function we() {
|
|
|
2200
2232
|
return;
|
|
2201
2233
|
}
|
|
2202
2234
|
}
|
|
2203
|
-
u.index = y, u.param = parseFloat(u.path.slice(
|
|
2235
|
+
u.index = y, u.param = parseFloat(u.path.slice(m, y)) + 0;
|
|
2204
2236
|
}
|
|
2205
|
-
function
|
|
2206
|
-
var
|
|
2207
|
-
|
|
2237
|
+
function d(u) {
|
|
2238
|
+
var m, y;
|
|
2239
|
+
m = u.path[u.segmentStart], y = m.toLowerCase();
|
|
2208
2240
|
var M = u.data;
|
|
2209
|
-
if (y === "m" && M.length > 2 && (u.result.push([
|
|
2210
|
-
u.result.push([
|
|
2241
|
+
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")
|
|
2242
|
+
u.result.push([m].concat(M));
|
|
2211
2243
|
else
|
|
2212
|
-
for (; M.length >= n[y] && (u.result.push([
|
|
2244
|
+
for (; M.length >= n[y] && (u.result.push([m].concat(M.splice(0, n[y]))), !!n[y]); )
|
|
2213
2245
|
;
|
|
2214
2246
|
}
|
|
2215
2247
|
function l(u) {
|
|
2216
|
-
var
|
|
2248
|
+
var m = u.max, y, M, T, S, P;
|
|
2217
2249
|
if (u.segmentStart = u.index, y = u.path.charCodeAt(u.index), M = i(y), !o(y)) {
|
|
2218
2250
|
u.err = "SvgPath: bad command " + u.path[u.index] + " (at pos " + u.index + ")";
|
|
2219
2251
|
return;
|
|
2220
2252
|
}
|
|
2221
|
-
if (
|
|
2222
|
-
|
|
2253
|
+
if (S = n[u.path[u.index].toLowerCase()], u.index++, h(u), u.data = [], !S) {
|
|
2254
|
+
d(u);
|
|
2223
2255
|
return;
|
|
2224
2256
|
}
|
|
2225
|
-
for (
|
|
2226
|
-
for (
|
|
2227
|
-
if (M && (
|
|
2228
|
-
|
|
2257
|
+
for (T = !1; ; ) {
|
|
2258
|
+
for (P = S; P > 0; P--) {
|
|
2259
|
+
if (M && (P === 3 || P === 4) ? c(u) : f(u), u.err.length) {
|
|
2260
|
+
d(u);
|
|
2229
2261
|
return;
|
|
2230
2262
|
}
|
|
2231
|
-
u.data.push(u.param), h(u),
|
|
2263
|
+
u.data.push(u.param), h(u), T = !1, u.index < m && u.path.charCodeAt(u.index) === 44 && (u.index++, h(u), T = !0);
|
|
2232
2264
|
}
|
|
2233
|
-
if (!
|
|
2265
|
+
if (!T && (u.index >= u.max || !s(u.path.charCodeAt(u.index))))
|
|
2234
2266
|
break;
|
|
2235
2267
|
}
|
|
2236
|
-
|
|
2268
|
+
d(u);
|
|
2237
2269
|
}
|
|
2238
|
-
return
|
|
2239
|
-
var y = new r(
|
|
2270
|
+
return q0 = function(m) {
|
|
2271
|
+
var y = new r(m), M = y.max;
|
|
2240
2272
|
for (h(y); y.index < M && !y.err.length; )
|
|
2241
2273
|
l(y);
|
|
2242
2274
|
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"), {
|
|
2243
2275
|
err: y.err,
|
|
2244
2276
|
segments: y.result
|
|
2245
2277
|
};
|
|
2246
|
-
},
|
|
2278
|
+
}, q0;
|
|
2247
2279
|
}
|
|
2248
2280
|
var D0, xt;
|
|
2249
|
-
function
|
|
2281
|
+
function Bt() {
|
|
2250
2282
|
if (xt) return D0;
|
|
2251
2283
|
xt = 1;
|
|
2252
2284
|
function n(t, o) {
|
|
@@ -2296,10 +2328,10 @@ function Nt() {
|
|
|
2296
2328
|
}, D0 = e, D0;
|
|
2297
2329
|
}
|
|
2298
2330
|
var j0, yt;
|
|
2299
|
-
function
|
|
2331
|
+
function Me() {
|
|
2300
2332
|
if (yt) return j0;
|
|
2301
2333
|
yt = 1;
|
|
2302
|
-
var n =
|
|
2334
|
+
var n = Bt(), e = {
|
|
2303
2335
|
matrix: !0,
|
|
2304
2336
|
scale: !0,
|
|
2305
2337
|
rotate: !0,
|
|
@@ -2342,7 +2374,7 @@ function me() {
|
|
|
2342
2374
|
}, j0;
|
|
2343
2375
|
}
|
|
2344
2376
|
var z0, vt;
|
|
2345
|
-
function
|
|
2377
|
+
function Le() {
|
|
2346
2378
|
if (vt) return z0;
|
|
2347
2379
|
vt = 1;
|
|
2348
2380
|
var n = Math.PI * 2;
|
|
@@ -2350,42 +2382,42 @@ function be() {
|
|
|
2350
2382
|
var h = i * r - a * s < 0 ? -1 : 1, c = i * s + a * r;
|
|
2351
2383
|
return c > 1 && (c = 1), c < -1 && (c = -1), h * Math.acos(c);
|
|
2352
2384
|
}
|
|
2353
|
-
function t(i, a, s, r, h, c, f,
|
|
2354
|
-
var
|
|
2355
|
-
|
|
2356
|
-
var C =
|
|
2357
|
-
return c === 0 &&
|
|
2385
|
+
function t(i, a, s, r, h, c, f, d, l, u) {
|
|
2386
|
+
var m = u * (i - s) / 2 + l * (a - r) / 2, y = -l * (i - s) / 2 + u * (a - r) / 2, M = f * f, T = d * d, S = m * m, P = y * y, E = M * T - M * P - T * S;
|
|
2387
|
+
E < 0 && (E = 0), E /= M * P + T * S, E = Math.sqrt(E) * (h === c ? -1 : 1);
|
|
2388
|
+
var C = E * f / d * y, O = E * -d / f * m, R = u * C - l * O + (i + s) / 2, G = l * C + u * O + (a + r) / 2, z = (m - C) / f, H = (y - O) / d, t0 = (-m - C) / f, e0 = (-y - O) / d, n0 = e(1, 0, z, H), K = e(z, H, t0, e0);
|
|
2389
|
+
return c === 0 && K > 0 && (K -= n), c === 1 && K < 0 && (K += n), [R, G, n0, K];
|
|
2358
2390
|
}
|
|
2359
2391
|
function o(i, a) {
|
|
2360
2392
|
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);
|
|
2361
2393
|
return [r, h, r - h * s, h + r * s, c + f * s, f - c * s, c, f];
|
|
2362
2394
|
}
|
|
2363
|
-
return z0 = function(a, s, r, h, c, f,
|
|
2364
|
-
var
|
|
2365
|
-
if (M === 0 &&
|
|
2395
|
+
return z0 = function(a, s, r, h, c, f, d, l, u) {
|
|
2396
|
+
var m = Math.sin(u * n / 360), y = Math.cos(u * n / 360), M = y * (a - r) / 2 + m * (s - h) / 2, T = -m * (a - r) / 2 + y * (s - h) / 2;
|
|
2397
|
+
if (M === 0 && T === 0)
|
|
2366
2398
|
return [];
|
|
2367
|
-
if (
|
|
2399
|
+
if (d === 0 || l === 0)
|
|
2368
2400
|
return [];
|
|
2369
|
-
|
|
2370
|
-
var
|
|
2371
|
-
|
|
2372
|
-
var
|
|
2373
|
-
|
|
2374
|
-
for (var
|
|
2375
|
-
|
|
2376
|
-
return
|
|
2377
|
-
for (var
|
|
2378
|
-
var
|
|
2379
|
-
|
|
2380
|
-
var
|
|
2381
|
-
|
|
2401
|
+
d = Math.abs(d), l = Math.abs(l);
|
|
2402
|
+
var S = M * M / (d * d) + T * T / (l * l);
|
|
2403
|
+
S > 1 && (d *= Math.sqrt(S), l *= Math.sqrt(S));
|
|
2404
|
+
var P = t(a, s, r, h, c, f, d, l, m, y), E = [], C = P[2], O = P[3], R = Math.max(Math.ceil(Math.abs(O) / (n / 4)), 1);
|
|
2405
|
+
O /= R;
|
|
2406
|
+
for (var G = 0; G < R; G++)
|
|
2407
|
+
E.push(o(C, O)), C += O;
|
|
2408
|
+
return E.map(function(z) {
|
|
2409
|
+
for (var H = 0; H < z.length; H += 2) {
|
|
2410
|
+
var t0 = z[H + 0], e0 = z[H + 1];
|
|
2411
|
+
t0 *= d, e0 *= l;
|
|
2412
|
+
var n0 = y * t0 - m * e0, K = m * t0 + y * e0;
|
|
2413
|
+
z[H + 0] = n0 + P[0], z[H + 1] = K + P[1];
|
|
2382
2414
|
}
|
|
2383
|
-
return
|
|
2415
|
+
return z;
|
|
2384
2416
|
});
|
|
2385
2417
|
}, z0;
|
|
2386
2418
|
}
|
|
2387
2419
|
var U0, wt;
|
|
2388
|
-
function
|
|
2420
|
+
function Te() {
|
|
2389
2421
|
if (wt) return U0;
|
|
2390
2422
|
wt = 1;
|
|
2391
2423
|
var n = 1e-10, e = Math.PI / 180;
|
|
@@ -2403,21 +2435,21 @@ function Ae() {
|
|
|
2403
2435
|
], r = s[0] * s[0] + s[2] * s[2], h = s[1] * s[1] + s[3] * s[3], c = ((s[0] - s[3]) * (s[0] - s[3]) + (s[2] + s[1]) * (s[2] + s[1])) * ((s[0] + s[3]) * (s[0] + s[3]) + (s[2] - s[1]) * (s[2] - s[1])), f = (r + h) / 2;
|
|
2404
2436
|
if (c < n * f)
|
|
2405
2437
|
return this.rx = this.ry = Math.sqrt(f), this.ax = 0, this;
|
|
2406
|
-
var
|
|
2438
|
+
var d = s[0] * s[1] + s[2] * s[3];
|
|
2407
2439
|
c = Math.sqrt(c);
|
|
2408
2440
|
var l = f + c / 2, u = f - c / 2;
|
|
2409
|
-
return this.ax = Math.abs(
|
|
2410
|
-
Math.abs(
|
|
2441
|
+
return this.ax = Math.abs(d) < n && Math.abs(l - h) < n ? 90 : Math.atan(
|
|
2442
|
+
Math.abs(d) > Math.abs(l - h) ? (l - r) / d : d / (l - h)
|
|
2411
2443
|
) * 180 / Math.PI, this.ax >= 0 ? (this.rx = Math.sqrt(l), this.ry = Math.sqrt(u)) : (this.ax += 90, this.rx = Math.sqrt(u), this.ry = Math.sqrt(l)), this;
|
|
2412
2444
|
}, t.prototype.isDegenerate = function() {
|
|
2413
2445
|
return this.rx < n * this.ry || this.ry < n * this.rx;
|
|
2414
2446
|
}, U0 = t, U0;
|
|
2415
2447
|
}
|
|
2416
2448
|
var Y0, mt;
|
|
2417
|
-
function
|
|
2449
|
+
function Pe() {
|
|
2418
2450
|
if (mt) return Y0;
|
|
2419
2451
|
mt = 1;
|
|
2420
|
-
var n =
|
|
2452
|
+
var n = be(), e = Me(), t = Bt(), o = Le(), i = Te();
|
|
2421
2453
|
function a(s) {
|
|
2422
2454
|
if (!(this instanceof a))
|
|
2423
2455
|
return new a(s);
|
|
@@ -2437,39 +2469,39 @@ function Me() {
|
|
|
2437
2469
|
throw new Error("SvgPath.from: invalid param type " + s);
|
|
2438
2470
|
}, a.prototype.__matrix = function(s) {
|
|
2439
2471
|
var r = this, h;
|
|
2440
|
-
s.queue.length && this.iterate(function(c, f,
|
|
2441
|
-
var u,
|
|
2472
|
+
s.queue.length && this.iterate(function(c, f, d, l) {
|
|
2473
|
+
var u, m, y, M;
|
|
2442
2474
|
switch (c[0]) {
|
|
2443
2475
|
// Process 'assymetric' commands separately
|
|
2444
2476
|
case "v":
|
|
2445
|
-
u = s.calc(0, c[1], !0),
|
|
2477
|
+
u = s.calc(0, c[1], !0), m = u[0] === 0 ? ["v", u[1]] : ["l", u[0], u[1]];
|
|
2446
2478
|
break;
|
|
2447
2479
|
case "V":
|
|
2448
|
-
u = s.calc(
|
|
2480
|
+
u = s.calc(d, c[1], !1), m = u[0] === s.calc(d, l, !1)[0] ? ["V", u[1]] : ["L", u[0], u[1]];
|
|
2449
2481
|
break;
|
|
2450
2482
|
case "h":
|
|
2451
|
-
u = s.calc(c[1], 0, !0),
|
|
2483
|
+
u = s.calc(c[1], 0, !0), m = u[1] === 0 ? ["h", u[0]] : ["l", u[0], u[1]];
|
|
2452
2484
|
break;
|
|
2453
2485
|
case "H":
|
|
2454
|
-
u = s.calc(c[1], l, !1),
|
|
2486
|
+
u = s.calc(c[1], l, !1), m = u[1] === s.calc(d, l, !1)[1] ? ["H", u[0]] : ["L", u[0], u[1]];
|
|
2455
2487
|
break;
|
|
2456
2488
|
case "a":
|
|
2457
2489
|
case "A":
|
|
2458
|
-
var
|
|
2459
|
-
if (
|
|
2460
|
-
|
|
2490
|
+
var T = s.toArray(), S = i(c[1], c[2], c[3]).transform(T);
|
|
2491
|
+
if (T[0] * T[3] - T[1] * T[2] < 0 && (c[5] = c[5] ? "0" : "1"), u = s.calc(c[6], c[7], c[0] === "a"), c[0] === "A" && c[6] === d && c[7] === l || c[0] === "a" && c[6] === 0 && c[7] === 0) {
|
|
2492
|
+
m = [c[0] === "a" ? "l" : "L", u[0], u[1]];
|
|
2461
2493
|
break;
|
|
2462
2494
|
}
|
|
2463
|
-
|
|
2495
|
+
S.isDegenerate() ? m = [c[0] === "a" ? "l" : "L", u[0], u[1]] : m = [c[0], S.rx, S.ry, S.ax, c[4], c[5], u[0], u[1]];
|
|
2464
2496
|
break;
|
|
2465
2497
|
case "m":
|
|
2466
|
-
M = f > 0, u = s.calc(c[1], c[2], M),
|
|
2498
|
+
M = f > 0, u = s.calc(c[1], c[2], M), m = ["m", u[0], u[1]];
|
|
2467
2499
|
break;
|
|
2468
2500
|
default:
|
|
2469
|
-
for (y = c[0],
|
|
2470
|
-
u = s.calc(c[h], c[h + 1], M),
|
|
2501
|
+
for (y = c[0], m = [y], M = y.toLowerCase() === y, h = 1; h < c.length; h += 2)
|
|
2502
|
+
u = s.calc(c[h], c[h + 1], M), m.push(u[0], u[1]);
|
|
2471
2503
|
}
|
|
2472
|
-
r.segments[f] =
|
|
2504
|
+
r.segments[f] = m;
|
|
2473
2505
|
}, !0);
|
|
2474
2506
|
}, a.prototype.__evaluateStack = function() {
|
|
2475
2507
|
var s, r;
|
|
@@ -2486,11 +2518,11 @@ function Me() {
|
|
|
2486
2518
|
var s = "", r = "", h = !1;
|
|
2487
2519
|
this.__evaluateStack();
|
|
2488
2520
|
for (var c = 0, f = this.segments.length; c < f; c++) {
|
|
2489
|
-
var
|
|
2521
|
+
var d = this.segments[c], l = d[0];
|
|
2490
2522
|
l !== r || l === "m" || l === "M" ? (l === "m" && r === "z" && (s += " "), s += l, h = !1) : h = !0;
|
|
2491
|
-
for (var u = 1; u <
|
|
2492
|
-
var
|
|
2493
|
-
u === 1 ? h &&
|
|
2523
|
+
for (var u = 1; u < d.length; u++) {
|
|
2524
|
+
var m = d[u];
|
|
2525
|
+
u === 1 ? h && m >= 0 && (s += " ") : m >= 0 && (s += " "), s += m;
|
|
2494
2526
|
}
|
|
2495
2527
|
r = l;
|
|
2496
2528
|
}
|
|
@@ -2510,7 +2542,7 @@ function Me() {
|
|
|
2510
2542
|
}, a.prototype.transform = function(s) {
|
|
2511
2543
|
return s.trim() ? (this.__stack.push(e(s)), this) : this;
|
|
2512
2544
|
}, a.prototype.round = function(s) {
|
|
2513
|
-
var r = 0, h = 0, c = 0, f = 0,
|
|
2545
|
+
var r = 0, h = 0, c = 0, f = 0, d;
|
|
2514
2546
|
return s = s || 0, this.__evaluateStack(), this.segments.forEach(function(l) {
|
|
2515
2547
|
var u = l[0].toLowerCase() === l[0];
|
|
2516
2548
|
switch (l[0]) {
|
|
@@ -2535,52 +2567,52 @@ function Me() {
|
|
|
2535
2567
|
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);
|
|
2536
2568
|
return;
|
|
2537
2569
|
default:
|
|
2538
|
-
|
|
2570
|
+
d = l.length, u && (l[d - 2] += c, l[d - 1] += f), c = l[d - 2] - l[d - 2].toFixed(s), f = l[d - 1] - l[d - 1].toFixed(s), l.forEach(function(m, y) {
|
|
2539
2571
|
y && (l[y] = +l[y].toFixed(s));
|
|
2540
2572
|
});
|
|
2541
2573
|
return;
|
|
2542
2574
|
}
|
|
2543
2575
|
}), this;
|
|
2544
2576
|
}, a.prototype.iterate = function(s, r) {
|
|
2545
|
-
var h = this.segments, c = {}, f = !1,
|
|
2546
|
-
if (r || this.__evaluateStack(), h.forEach(function(
|
|
2547
|
-
var
|
|
2548
|
-
Array.isArray(
|
|
2549
|
-
var C =
|
|
2550
|
-
switch (
|
|
2577
|
+
var h = this.segments, c = {}, f = !1, d = 0, l = 0, u = 0, m = 0, y, M, T;
|
|
2578
|
+
if (r || this.__evaluateStack(), h.forEach(function(S, P) {
|
|
2579
|
+
var E = s(S, P, d, l);
|
|
2580
|
+
Array.isArray(E) && (c[P] = E, f = !0);
|
|
2581
|
+
var C = S[0] === S[0].toLowerCase();
|
|
2582
|
+
switch (S[0]) {
|
|
2551
2583
|
case "m":
|
|
2552
2584
|
case "M":
|
|
2553
|
-
|
|
2585
|
+
d = S[1] + (C ? d : 0), l = S[2] + (C ? l : 0), u = d, m = l;
|
|
2554
2586
|
return;
|
|
2555
2587
|
case "h":
|
|
2556
2588
|
case "H":
|
|
2557
|
-
|
|
2589
|
+
d = S[1] + (C ? d : 0);
|
|
2558
2590
|
return;
|
|
2559
2591
|
case "v":
|
|
2560
2592
|
case "V":
|
|
2561
|
-
l =
|
|
2593
|
+
l = S[1] + (C ? l : 0);
|
|
2562
2594
|
return;
|
|
2563
2595
|
case "z":
|
|
2564
2596
|
case "Z":
|
|
2565
|
-
|
|
2597
|
+
d = u, l = m;
|
|
2566
2598
|
return;
|
|
2567
2599
|
default:
|
|
2568
|
-
|
|
2600
|
+
d = S[S.length - 2] + (C ? d : 0), l = S[S.length - 1] + (C ? l : 0);
|
|
2569
2601
|
}
|
|
2570
2602
|
}), !f)
|
|
2571
2603
|
return this;
|
|
2572
|
-
for (
|
|
2604
|
+
for (T = [], y = 0; y < h.length; y++)
|
|
2573
2605
|
if (typeof c[y] < "u")
|
|
2574
2606
|
for (M = 0; M < c[y].length; M++)
|
|
2575
|
-
|
|
2607
|
+
T.push(c[y][M]);
|
|
2576
2608
|
else
|
|
2577
|
-
|
|
2578
|
-
return this.segments =
|
|
2609
|
+
T.push(h[y]);
|
|
2610
|
+
return this.segments = T, this;
|
|
2579
2611
|
}, a.prototype.abs = function() {
|
|
2580
2612
|
return this.iterate(function(s, r, h, c) {
|
|
2581
|
-
var f = s[0],
|
|
2582
|
-
if (f !==
|
|
2583
|
-
switch (s[0] =
|
|
2613
|
+
var f = s[0], d = f.toUpperCase(), l;
|
|
2614
|
+
if (f !== d)
|
|
2615
|
+
switch (s[0] = d, f) {
|
|
2584
2616
|
case "v":
|
|
2585
2617
|
s[1] += c;
|
|
2586
2618
|
return;
|
|
@@ -2594,9 +2626,9 @@ function Me() {
|
|
|
2594
2626
|
}, !0), this;
|
|
2595
2627
|
}, a.prototype.rel = function() {
|
|
2596
2628
|
return this.iterate(function(s, r, h, c) {
|
|
2597
|
-
var f = s[0],
|
|
2598
|
-
if (f !==
|
|
2599
|
-
switch (s[0] =
|
|
2629
|
+
var f = s[0], d = f.toLowerCase(), l;
|
|
2630
|
+
if (f !== d && !(r === 0 && f === "M"))
|
|
2631
|
+
switch (s[0] = d, f) {
|
|
2600
2632
|
case "V":
|
|
2601
2633
|
s[1] -= c;
|
|
2602
2634
|
return;
|
|
@@ -2610,25 +2642,25 @@ function Me() {
|
|
|
2610
2642
|
}, !0), this;
|
|
2611
2643
|
}, a.prototype.unarc = function() {
|
|
2612
2644
|
return this.iterate(function(s, r, h, c) {
|
|
2613
|
-
var f,
|
|
2614
|
-
return
|
|
2645
|
+
var f, d, l, u = [], m = s[0];
|
|
2646
|
+
return m !== "A" && m !== "a" ? null : (m === "a" ? (d = h + s[6], l = c + s[7]) : (d = s[6], l = s[7]), f = o(h, c, d, 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) {
|
|
2615
2647
|
u.push(["C", y[2], y[3], y[4], y[5], y[6], y[7]]);
|
|
2616
2648
|
}), u));
|
|
2617
2649
|
}), this;
|
|
2618
2650
|
}, a.prototype.unshort = function() {
|
|
2619
|
-
var s = this.segments, r, h, c, f,
|
|
2620
|
-
return this.iterate(function(l, u,
|
|
2621
|
-
var M = l[0],
|
|
2622
|
-
u && (
|
|
2623
|
-
|
|
2651
|
+
var s = this.segments, r, h, c, f, d;
|
|
2652
|
+
return this.iterate(function(l, u, m, y) {
|
|
2653
|
+
var M = l[0], T = M.toUpperCase(), S;
|
|
2654
|
+
u && (T === "T" ? (S = 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, d = -h, S || (f += m, d += y), s[u] = [
|
|
2655
|
+
S ? "q" : "Q",
|
|
2624
2656
|
f,
|
|
2625
|
-
|
|
2657
|
+
d,
|
|
2626
2658
|
l[1],
|
|
2627
2659
|
l[2]
|
|
2628
|
-
]) :
|
|
2629
|
-
|
|
2660
|
+
]) : T === "S" && (S = 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, d = -h, S || (f += m, d += y), s[u] = [
|
|
2661
|
+
S ? "c" : "C",
|
|
2630
2662
|
f,
|
|
2631
|
-
|
|
2663
|
+
d,
|
|
2632
2664
|
l[1],
|
|
2633
2665
|
l[2],
|
|
2634
2666
|
l[3],
|
|
@@ -2637,36 +2669,36 @@ function Me() {
|
|
|
2637
2669
|
}), this;
|
|
2638
2670
|
}, Y0 = a, Y0;
|
|
2639
2671
|
}
|
|
2640
|
-
var
|
|
2641
|
-
function
|
|
2642
|
-
return
|
|
2672
|
+
var H0, At;
|
|
2673
|
+
function Ce() {
|
|
2674
|
+
return At || (At = 1, H0 = Pe()), H0;
|
|
2643
2675
|
}
|
|
2644
|
-
var
|
|
2645
|
-
const
|
|
2646
|
-
var
|
|
2647
|
-
function
|
|
2676
|
+
var Se = Ce();
|
|
2677
|
+
const Ee = /* @__PURE__ */ Ae(Se);
|
|
2678
|
+
var X0 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, ke = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
|
|
2679
|
+
function Ie(n) {
|
|
2648
2680
|
var e = [];
|
|
2649
|
-
return n.replace(
|
|
2681
|
+
return n.replace(ke, function(t, o, i) {
|
|
2650
2682
|
var a = o.toLowerCase();
|
|
2651
|
-
for (i =
|
|
2652
|
-
if (i.length ===
|
|
2683
|
+
for (i = Oe(i), a === "m" && i.length > 2 && (e.push([o].concat(i.splice(0, 2))), a = "l", o = o === "m" ? "l" : "L"); i.length >= 0; ) {
|
|
2684
|
+
if (i.length === X0[a])
|
|
2653
2685
|
return i.unshift(o), e.push(i);
|
|
2654
|
-
if (i.length <
|
|
2686
|
+
if (i.length < X0[a])
|
|
2655
2687
|
throw new Error("malformed path data");
|
|
2656
|
-
e.push([o].concat(i.splice(0,
|
|
2688
|
+
e.push([o].concat(i.splice(0, X0[a])));
|
|
2657
2689
|
}
|
|
2658
2690
|
}), e;
|
|
2659
2691
|
}
|
|
2660
|
-
var
|
|
2661
|
-
function
|
|
2662
|
-
var e = n.match(
|
|
2692
|
+
var _e = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
|
|
2693
|
+
function Oe(n) {
|
|
2694
|
+
var e = n.match(_e);
|
|
2663
2695
|
return e ? e.map(Number) : [];
|
|
2664
2696
|
}
|
|
2665
|
-
function
|
|
2697
|
+
function i0(n, e, t, o, i, a, s, r) {
|
|
2666
2698
|
return new Z0(n, e, t, o, i, a, s, r);
|
|
2667
2699
|
}
|
|
2668
2700
|
function Z0(n, e, t, o, i, a, s, r) {
|
|
2669
|
-
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 =
|
|
2701
|
+
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 = Ye, this.getPoint = Ne, this.getDerivative = Re) : (this.getArcLength = Be, this.getPoint = qt, this.getDerivative = Fe), this.init();
|
|
2670
2702
|
}
|
|
2671
2703
|
Z0.prototype = {
|
|
2672
2704
|
constructor: Z0,
|
|
@@ -2728,13 +2760,13 @@ Z0.prototype = {
|
|
|
2728
2760
|
return { x: a.x, y: a.y, tangentX: i.x, tangentY: i.y };
|
|
2729
2761
|
}
|
|
2730
2762
|
};
|
|
2731
|
-
function
|
|
2763
|
+
function Fe(n, e, t) {
|
|
2732
2764
|
return {
|
|
2733
2765
|
x: (1 - t) * 2 * (n[1] - n[0]) + t * 2 * (n[2] - n[1]),
|
|
2734
2766
|
y: (1 - t) * 2 * (e[1] - e[0]) + t * 2 * (e[2] - e[1])
|
|
2735
2767
|
};
|
|
2736
2768
|
}
|
|
2737
|
-
function
|
|
2769
|
+
function Re(n, e, t) {
|
|
2738
2770
|
var o = qt(
|
|
2739
2771
|
[3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])],
|
|
2740
2772
|
[3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])],
|
|
@@ -2744,8 +2776,8 @@ function _e(n, e, t) {
|
|
|
2744
2776
|
}
|
|
2745
2777
|
function $0(n, e, t, o, i) {
|
|
2746
2778
|
for (var a = 1, s = n / e, r = (n - t(o, i, s)) / e; a > 1e-3; ) {
|
|
2747
|
-
var h = t(o, i, s + r), c = t(o, i, s - r), f = Math.abs(n - h) / e,
|
|
2748
|
-
f < a ? (a = f, s += r) :
|
|
2779
|
+
var h = t(o, i, s + r), c = t(o, i, s - r), f = Math.abs(n - h) / e, d = Math.abs(n - c) / e;
|
|
2780
|
+
f < a ? (a = f, s += r) : d < a ? (a = d, s -= r) : r /= 2;
|
|
2749
2781
|
}
|
|
2750
2782
|
return s;
|
|
2751
2783
|
}
|
|
@@ -2753,21 +2785,21 @@ function qt(n, e, t) {
|
|
|
2753
2785
|
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];
|
|
2754
2786
|
return { x: o, y: i };
|
|
2755
2787
|
}
|
|
2756
|
-
function
|
|
2788
|
+
function Ne(n, e, t) {
|
|
2757
2789
|
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];
|
|
2758
2790
|
return { x: o, y: i };
|
|
2759
2791
|
}
|
|
2760
|
-
function
|
|
2792
|
+
function Be(n, e, t) {
|
|
2761
2793
|
t === void 0 && (t = 1);
|
|
2762
2794
|
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;
|
|
2763
2795
|
if (r === 0)
|
|
2764
2796
|
return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
|
|
2765
|
-
var f = h / (2 * r),
|
|
2797
|
+
var f = h / (2 * r), d = c / r, l = t + f, u = d - f * f;
|
|
2766
2798
|
return Math.sqrt(r) / 2 * (l * Math.sqrt(l * l + u) - f * Math.sqrt(f * f + u) + u * Math.log(Math.abs(
|
|
2767
2799
|
(l + Math.sqrt(l * l + u)) / (f + Math.sqrt(f * f + u))
|
|
2768
2800
|
)));
|
|
2769
2801
|
}
|
|
2770
|
-
var
|
|
2802
|
+
var qe = [
|
|
2771
2803
|
[],
|
|
2772
2804
|
[],
|
|
2773
2805
|
[-0.5773502691896257, 0.5773502691896257],
|
|
@@ -2793,7 +2825,7 @@ var Fe = [
|
|
|
2793
2825
|
[-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],
|
|
2794
2826
|
[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],
|
|
2795
2827
|
[-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]
|
|
2796
|
-
],
|
|
2828
|
+
], De = [
|
|
2797
2829
|
[],
|
|
2798
2830
|
[],
|
|
2799
2831
|
[1, 1],
|
|
@@ -2819,9 +2851,9 @@ var Fe = [
|
|
|
2819
2851
|
[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],
|
|
2820
2852
|
[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],
|
|
2821
2853
|
[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]
|
|
2822
|
-
],
|
|
2823
|
-
function
|
|
2824
|
-
return
|
|
2854
|
+
], je = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
|
|
2855
|
+
function ze(n, e) {
|
|
2856
|
+
return je[n][e];
|
|
2825
2857
|
}
|
|
2826
2858
|
function V0(n, e, t) {
|
|
2827
2859
|
var o = t.length - 1, i, a, s;
|
|
@@ -2829,7 +2861,7 @@ function V0(n, e, t) {
|
|
|
2829
2861
|
return 0;
|
|
2830
2862
|
if (n === 0) {
|
|
2831
2863
|
for (a = 0, s = 0; s <= o; s++)
|
|
2832
|
-
a +=
|
|
2864
|
+
a += ze(o, s) * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
2833
2865
|
return a;
|
|
2834
2866
|
} else {
|
|
2835
2867
|
for (i = new Array(o), s = 0; s < o; s++)
|
|
@@ -2837,65 +2869,65 @@ function V0(n, e, t) {
|
|
|
2837
2869
|
return V0(n - 1, e, i);
|
|
2838
2870
|
}
|
|
2839
2871
|
}
|
|
2840
|
-
function
|
|
2872
|
+
function Ue(n, e, t) {
|
|
2841
2873
|
var o = V0(1, t, n), i = V0(1, t, e), a = o * o + i * i;
|
|
2842
2874
|
return Math.sqrt(a);
|
|
2843
2875
|
}
|
|
2844
|
-
function
|
|
2876
|
+
function Ye(n, e, t) {
|
|
2845
2877
|
var o, i, a, s;
|
|
2846
2878
|
t === void 0 && (t = 1);
|
|
2847
2879
|
var r = 20;
|
|
2848
2880
|
for (o = t / 2, i = 0, a = 0; a < r; a++)
|
|
2849
|
-
s = o *
|
|
2881
|
+
s = o * qe[r][a] + o, i += De[r][a] * Ue(n, e, s);
|
|
2850
2882
|
return o * i;
|
|
2851
2883
|
}
|
|
2852
2884
|
var C0 = Math.PI * 2;
|
|
2853
|
-
function
|
|
2885
|
+
function bt(n, e, t, o) {
|
|
2854
2886
|
var i = n * o - e * t < 0 ? -1 : 1, a = n * t + e * o;
|
|
2855
2887
|
return a > 1 && (a = 1), a < -1 && (a = -1), i * Math.acos(a);
|
|
2856
2888
|
}
|
|
2857
|
-
function
|
|
2858
|
-
var f = c * (n - t) / 2 + h * (e - o) / 2,
|
|
2859
|
-
M < 0 && (M = 0), M /= l * y + u *
|
|
2860
|
-
var
|
|
2861
|
-
return a === 0 &&
|
|
2889
|
+
function He(n, e, t, o, i, a, s, r, h, c) {
|
|
2890
|
+
var f = c * (n - t) / 2 + h * (e - o) / 2, d = -h * (n - t) / 2 + c * (e - o) / 2, l = s * s, u = r * r, m = f * f, y = d * d, M = l * u - l * y - u * m;
|
|
2891
|
+
M < 0 && (M = 0), M /= l * y + u * m, M = Math.sqrt(M) * (i === a ? -1 : 1);
|
|
2892
|
+
var T = M * s / r * d, S = M * -r / s * f, P = c * T - h * S + (n + t) / 2, E = h * T + c * S + (e + o) / 2, C = (f - T) / s, O = (d - S) / r, R = (-f - T) / s, G = (-d - S) / r, z = bt(1, 0, C, O), H = bt(C, O, R, G);
|
|
2893
|
+
return a === 0 && H > 0 && (H -= C0), a === 1 && H < 0 && (H += C0), [P, E, z, H];
|
|
2862
2894
|
}
|
|
2863
|
-
function
|
|
2895
|
+
function Xe(n, e) {
|
|
2864
2896
|
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);
|
|
2865
2897
|
return [o, i, o - i * t, i + o * t, a + s * t, s - a * t, a, s];
|
|
2866
2898
|
}
|
|
2867
|
-
function
|
|
2868
|
-
var c = Math.sin(i * C0 / 360), f = Math.cos(i * C0 / 360),
|
|
2869
|
-
if (
|
|
2899
|
+
function $e(n, e, t, o, i, a, s, r, h) {
|
|
2900
|
+
var c = Math.sin(i * C0 / 360), f = Math.cos(i * C0 / 360), d = f * (n - r) / 2 + c * (e - h) / 2, l = -c * (n - r) / 2 + f * (e - h) / 2;
|
|
2901
|
+
if (d === 0 && l === 0)
|
|
2870
2902
|
return [];
|
|
2871
2903
|
if (t === 0 || o === 0)
|
|
2872
2904
|
return [];
|
|
2873
2905
|
t = Math.abs(t), o = Math.abs(o);
|
|
2874
|
-
var u =
|
|
2906
|
+
var u = d * d / (t * t) + l * l / (o * o);
|
|
2875
2907
|
u > 1 && (t *= Math.sqrt(u), o *= Math.sqrt(u));
|
|
2876
|
-
var
|
|
2877
|
-
|
|
2878
|
-
for (var
|
|
2879
|
-
y.push(
|
|
2880
|
-
return y.map(function(
|
|
2881
|
-
for (var C = 0; C <
|
|
2882
|
-
var
|
|
2883
|
-
|
|
2884
|
-
var
|
|
2885
|
-
|
|
2908
|
+
var m = He(n, e, r, h, a, s, t, o, c, f), y = [], M = m[2], T = m[3], S = Math.max(Math.ceil(Math.abs(T) / (C0 / 4)), 1);
|
|
2909
|
+
T /= S;
|
|
2910
|
+
for (var P = 0; P < S; P++)
|
|
2911
|
+
y.push(Xe(M, T)), M += T;
|
|
2912
|
+
return y.map(function(E) {
|
|
2913
|
+
for (var C = 0; C < E.length; C += 2) {
|
|
2914
|
+
var O = E[C + 0], R = E[C + 1];
|
|
2915
|
+
O *= t, R *= o;
|
|
2916
|
+
var G = f * O - c * R, z = c * O + f * R;
|
|
2917
|
+
E[C + 0] = G + m[0], E[C + 1] = z + m[1];
|
|
2886
2918
|
}
|
|
2887
|
-
return
|
|
2919
|
+
return E;
|
|
2888
2920
|
});
|
|
2889
2921
|
}
|
|
2890
2922
|
function Mt(n, e, t, o, i, a, s, r, h) {
|
|
2891
2923
|
return new K0(n, e, t, o, i, a, s, r, h);
|
|
2892
2924
|
}
|
|
2893
2925
|
function K0(n, e, t, o, i, a, s, r, h) {
|
|
2894
|
-
var c = 0, f = [],
|
|
2926
|
+
var c = 0, f = [], d = [], l = $e(n, e, t, o, i, a, s, r, h);
|
|
2895
2927
|
l.forEach(function(u) {
|
|
2896
|
-
var
|
|
2897
|
-
c += y, f.push(y),
|
|
2898
|
-
}), this.length = c, this.partialLengths = f, this.curves =
|
|
2928
|
+
var m = new i0(u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]), y = m.getTotalLength();
|
|
2929
|
+
c += y, f.push(y), d.push(m);
|
|
2930
|
+
}), this.length = c, this.partialLengths = f, this.curves = d;
|
|
2899
2931
|
}
|
|
2900
2932
|
K0.prototype = {
|
|
2901
2933
|
constructor: K0,
|
|
@@ -2927,34 +2959,34 @@ K0.prototype = {
|
|
|
2927
2959
|
return { x: t.x, y: t.y, tangentX: e.x, tangentY: e.y };
|
|
2928
2960
|
}
|
|
2929
2961
|
};
|
|
2930
|
-
function
|
|
2931
|
-
return new
|
|
2962
|
+
function r0(n, e, t, o) {
|
|
2963
|
+
return new k0(n, e, t, o);
|
|
2932
2964
|
}
|
|
2933
|
-
function
|
|
2965
|
+
function k0(n, e, t, o) {
|
|
2934
2966
|
this.x0 = n, this.x1 = e, this.y0 = t, this.y1 = o;
|
|
2935
2967
|
}
|
|
2936
|
-
|
|
2968
|
+
k0.prototype.getTotalLength = function() {
|
|
2937
2969
|
return Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
|
|
2938
2970
|
};
|
|
2939
|
-
|
|
2971
|
+
k0.prototype.getPointAtLength = function(n) {
|
|
2940
2972
|
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;
|
|
2941
2973
|
return { x: this.x0 + t, y: this.y0 + o };
|
|
2942
2974
|
};
|
|
2943
|
-
|
|
2975
|
+
k0.prototype.getTangentAtLength = function() {
|
|
2944
2976
|
var n = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
|
|
2945
2977
|
return { x: (this.x1 - this.x0) / n, y: (this.y1 - this.y0) / n };
|
|
2946
2978
|
};
|
|
2947
|
-
|
|
2979
|
+
k0.prototype.getPropertiesAtLength = function(n) {
|
|
2948
2980
|
var e = this.getPointAtLength(n), t = this.getTangentAtLength();
|
|
2949
2981
|
return { x: e.x, y: e.y, tangentX: t.x, tangentY: t.y };
|
|
2950
2982
|
};
|
|
2951
|
-
function
|
|
2983
|
+
function Ge(n) {
|
|
2952
2984
|
var e = 0, t = [], o = [];
|
|
2953
2985
|
function i(s) {
|
|
2954
2986
|
if (!s)
|
|
2955
2987
|
return null;
|
|
2956
|
-
for (var r =
|
|
2957
|
-
r[l][0] === "M" ? (h = [r[l][1], r[l][2]],
|
|
2988
|
+
for (var r = Ie(s), h = [0, 0], c = [0, 0], f, d, l = 0; l < r.length; l++)
|
|
2989
|
+
r[l][0] === "M" ? (h = [r[l][1], r[l][2]], d = [h[0], h[1]], o.push(null)) : r[l][0] === "m" ? (h = [r[l][1] + h[0], r[l][2] + h[1]], d = [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 r0(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 r0(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 r0(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 r0(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 r0(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 r0(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(d[0] - h[0], 2) + Math.pow(d[1] - h[1], 2)), o.push(new r0(h[0], d[0], h[1], d[1])), h = [d[0], d[1]]) : r[l][0] === "C" ? (f = new i0(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 i0(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 i0(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 i0(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 i0(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 i0(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 i0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]) : f = new r0(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 r0(h[0] + r[l][1], h[0] + r[l][3], h[1] + r[l][2], h[1] + r[l][4]) : f = new i0(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 i0(h[0], h[1], 2 * h[0] - c[0], 2 * h[1] - c[1], r[l][1], r[l][2]) : f = new r0(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 i0(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 r0(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);
|
|
2958
2990
|
return i;
|
|
2959
2991
|
}
|
|
2960
2992
|
i.getTotalLength = function() {
|
|
@@ -2980,20 +3012,20 @@ function Xe(n) {
|
|
|
2980
3012
|
function O0(n, e) {
|
|
2981
3013
|
return Math.sqrt((n[0] - e[0]) * (n[0] - e[0]) + (n[1] - e[1]) * (n[1] - e[1]));
|
|
2982
3014
|
}
|
|
2983
|
-
function
|
|
3015
|
+
function Dt(n, e, t) {
|
|
2984
3016
|
return [n[0] + (e[0] - n[0]) * t, n[1] + (e[1] - n[1]) * t];
|
|
2985
3017
|
}
|
|
2986
|
-
function
|
|
3018
|
+
function We(n, e) {
|
|
2987
3019
|
return O0(n, e) < 1e-9;
|
|
2988
3020
|
}
|
|
2989
|
-
function
|
|
2990
|
-
let o = n.map((i, a) =>
|
|
3021
|
+
function Ze(n, e, t) {
|
|
3022
|
+
let o = n.map((i, a) => Ve(i, e[a]));
|
|
2991
3023
|
return function(i) {
|
|
2992
3024
|
let a = o.map((s) => s(i));
|
|
2993
|
-
return t ?
|
|
3025
|
+
return t ? Je(a) : a;
|
|
2994
3026
|
};
|
|
2995
3027
|
}
|
|
2996
|
-
function
|
|
3028
|
+
function Ve(n, e) {
|
|
2997
3029
|
return function(t) {
|
|
2998
3030
|
return n.map((o, i) => o + t * (e[i] - o));
|
|
2999
3031
|
};
|
|
@@ -3006,20 +3038,20 @@ Example valid ways of supplying a shape would be:
|
|
|
3006
3038
|
[[0, 0], [10, 0], [10, 10]]
|
|
3007
3039
|
"M0,0 L10,0 L10,10Z"
|
|
3008
3040
|
`;
|
|
3009
|
-
function
|
|
3010
|
-
return new
|
|
3041
|
+
function Ke(n) {
|
|
3042
|
+
return new Ee(n).abs();
|
|
3011
3043
|
}
|
|
3012
|
-
function
|
|
3044
|
+
function Qe(n) {
|
|
3013
3045
|
return n.toString().split("M").map((e, t) => (e = e.trim(), t && e ? "M" + e : e)).filter((e) => e);
|
|
3014
3046
|
}
|
|
3015
|
-
function
|
|
3047
|
+
function Je(n) {
|
|
3016
3048
|
return "M" + n.join("L") + "Z";
|
|
3017
3049
|
}
|
|
3018
|
-
function
|
|
3019
|
-
let t =
|
|
3020
|
-
return
|
|
3050
|
+
function tn(n, e) {
|
|
3051
|
+
let t = Ke(n);
|
|
3052
|
+
return en(t) || nn(t, e);
|
|
3021
3053
|
}
|
|
3022
|
-
function
|
|
3054
|
+
function en(n) {
|
|
3023
3055
|
let e = n.segments || [], t = [];
|
|
3024
3056
|
if (!e.length || e[0][0] !== "M")
|
|
3025
3057
|
return !1;
|
|
@@ -3038,11 +3070,11 @@ function Qe(n) {
|
|
|
3038
3070
|
}
|
|
3039
3071
|
return t.length ? { ring: t } : !1;
|
|
3040
3072
|
}
|
|
3041
|
-
function
|
|
3042
|
-
let t =
|
|
3073
|
+
function nn(n, e) {
|
|
3074
|
+
let t = Qe(n)[0], o = [], i, a, s = 3;
|
|
3043
3075
|
if (!t)
|
|
3044
3076
|
throw new TypeError(Q0);
|
|
3045
|
-
a =
|
|
3077
|
+
a = rn(t), i = a.getTotalLength(), e && _0(e) && e > 0 && (s = Math.max(s, Math.ceil(i / e)));
|
|
3046
3078
|
for (let r = 0; r < s; r++) {
|
|
3047
3079
|
let h = a.getPointAtLength(i * r / s);
|
|
3048
3080
|
o.push([h.x, h.y]);
|
|
@@ -3052,51 +3084,51 @@ function Je(n, e) {
|
|
|
3052
3084
|
skipBisect: !0
|
|
3053
3085
|
};
|
|
3054
3086
|
}
|
|
3055
|
-
function
|
|
3087
|
+
function rn(n) {
|
|
3056
3088
|
if (typeof window < "u" && window && window.document)
|
|
3057
3089
|
try {
|
|
3058
3090
|
let e = window.document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3059
3091
|
return e.setAttributeNS(null, "d", n), e;
|
|
3060
3092
|
} catch {
|
|
3061
3093
|
}
|
|
3062
|
-
return
|
|
3094
|
+
return Ge(n);
|
|
3063
3095
|
}
|
|
3064
3096
|
function Lt(n, e) {
|
|
3065
|
-
const t = n.length + e, o =
|
|
3097
|
+
const t = n.length + e, o = me(n) / e;
|
|
3066
3098
|
let i = 0, a = 0, s = o / 2;
|
|
3067
3099
|
for (; n.length < t; ) {
|
|
3068
3100
|
let r = n[i], h = n[(i + 1) % n.length], c = O0(r, h);
|
|
3069
3101
|
if (s <= a + c) {
|
|
3070
|
-
n.splice(i + 1, 0, c ?
|
|
3102
|
+
n.splice(i + 1, 0, c ? Dt(r, h, (s - a) / c) : r.slice(0)), s += o;
|
|
3071
3103
|
continue;
|
|
3072
3104
|
}
|
|
3073
3105
|
a += c, i++;
|
|
3074
3106
|
}
|
|
3075
3107
|
}
|
|
3076
|
-
function
|
|
3108
|
+
function on(n, e = 1 / 0) {
|
|
3077
3109
|
for (let t = 0; t < n.length; t++) {
|
|
3078
3110
|
let o = n[t], i = t === n.length - 1 ? n[0] : n[t + 1];
|
|
3079
3111
|
for (; O0(o, i) > e; )
|
|
3080
|
-
i =
|
|
3112
|
+
i = Dt(o, i, 0.5), n.splice(t + 1, 0, i);
|
|
3081
3113
|
}
|
|
3082
3114
|
}
|
|
3083
3115
|
function Tt(n, e) {
|
|
3084
3116
|
let t, o, i;
|
|
3085
3117
|
if (typeof n == "string") {
|
|
3086
|
-
let a =
|
|
3118
|
+
let a = tn(n, e);
|
|
3087
3119
|
n = a.ring, i = a.skipBisect;
|
|
3088
3120
|
} else if (!Array.isArray(n))
|
|
3089
3121
|
throw new TypeError(Q0);
|
|
3090
|
-
if (t = n.slice(0), !
|
|
3122
|
+
if (t = n.slice(0), !sn(t))
|
|
3091
3123
|
throw new TypeError(Q0);
|
|
3092
|
-
return t.length > 1 &&
|
|
3124
|
+
return t.length > 1 && We(t[0], t[t.length - 1]) && t.pop(), o = we(t), o > 0 && t.reverse(), !i && e && _0(e) && e > 0 && on(t, e), t;
|
|
3093
3125
|
}
|
|
3094
|
-
function
|
|
3126
|
+
function sn(n) {
|
|
3095
3127
|
return n.every(function(e) {
|
|
3096
3128
|
return Array.isArray(e) && e.length >= 2 && _0(e[0]) && _0(e[1]);
|
|
3097
3129
|
});
|
|
3098
3130
|
}
|
|
3099
|
-
function
|
|
3131
|
+
function an(n, e) {
|
|
3100
3132
|
let t = n.length, o = 1 / 0, i, a, s;
|
|
3101
3133
|
for (let r = 0; r < t; r++)
|
|
3102
3134
|
a = 0, e.forEach(function(h, c) {
|
|
@@ -3105,278 +3137,278 @@ function rn(n, e) {
|
|
|
3105
3137
|
}), a < o && (o = a, i = r);
|
|
3106
3138
|
i && (s = n.splice(0, i), n.splice(n.length, 0, ...s));
|
|
3107
3139
|
}
|
|
3108
|
-
function
|
|
3109
|
-
let i = Tt(n, t), a = Tt(e, t), s =
|
|
3140
|
+
function hn(n, e, { maxSegmentLength: t = 10, string: o = !0 } = {}) {
|
|
3141
|
+
let i = Tt(n, t), a = Tt(e, t), s = ln(i, a, o);
|
|
3110
3142
|
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);
|
|
3111
3143
|
}
|
|
3112
|
-
function
|
|
3144
|
+
function ln(n, e, t) {
|
|
3113
3145
|
let o;
|
|
3114
|
-
return o = n.length - e.length, Lt(n, o < 0 ? o * -1 : 0), Lt(e, o > 0 ? o : 0),
|
|
3146
|
+
return o = n.length - e.length, Lt(n, o < 0 ? o * -1 : 0), Lt(e, o > 0 ? o : 0), an(n, e), Ze(n, e, t);
|
|
3115
3147
|
}
|
|
3116
|
-
var
|
|
3117
|
-
function
|
|
3118
|
-
if (Pt) return
|
|
3119
|
-
Pt = 1,
|
|
3120
|
-
function n(g,
|
|
3148
|
+
var I0 = { exports: {} }, Pt;
|
|
3149
|
+
function cn() {
|
|
3150
|
+
if (Pt) return I0.exports;
|
|
3151
|
+
Pt = 1, I0.exports = n, I0.exports.default = n;
|
|
3152
|
+
function n(g, x, p) {
|
|
3121
3153
|
p = p || 2;
|
|
3122
|
-
var v =
|
|
3123
|
-
if (!
|
|
3124
|
-
var
|
|
3125
|
-
if (v && (
|
|
3126
|
-
|
|
3127
|
-
for (var
|
|
3128
|
-
|
|
3129
|
-
|
|
3154
|
+
var v = x && x.length, w = v ? x[0] * p : g.length, A = e(g, 0, w, p, !0), b = [];
|
|
3155
|
+
if (!A || A.next === A.prev) return b;
|
|
3156
|
+
var L, F, I, Y, D, N, W;
|
|
3157
|
+
if (v && (A = h(g, x, A, p)), g.length > 80 * p) {
|
|
3158
|
+
L = I = g[0], F = Y = g[1];
|
|
3159
|
+
for (var j = p; j < w; j += p)
|
|
3160
|
+
D = g[j], N = g[j + 1], D < L && (L = D), N < F && (F = N), D > I && (I = D), N > Y && (Y = N);
|
|
3161
|
+
W = Math.max(I - L, Y - F), W = W !== 0 ? 32767 / W : 0;
|
|
3130
3162
|
}
|
|
3131
|
-
return o(
|
|
3163
|
+
return o(A, b, p, L, F, W, 0), b;
|
|
3132
3164
|
}
|
|
3133
|
-
function e(g,
|
|
3134
|
-
var
|
|
3135
|
-
if (w ===
|
|
3136
|
-
for (
|
|
3165
|
+
function e(g, x, p, v, w) {
|
|
3166
|
+
var A, b;
|
|
3167
|
+
if (w === F0(g, x, p, v) > 0)
|
|
3168
|
+
for (A = x; A < p; A += v) b = e0(A, g[A], g[A + 1], b);
|
|
3137
3169
|
else
|
|
3138
|
-
for (
|
|
3139
|
-
return
|
|
3170
|
+
for (A = p - v; A >= x; A -= v) b = e0(A, g[A], g[A + 1], b);
|
|
3171
|
+
return b && E(b, b.next) && (n0(b), b = b.next), b;
|
|
3140
3172
|
}
|
|
3141
|
-
function t(g,
|
|
3173
|
+
function t(g, x) {
|
|
3142
3174
|
if (!g) return g;
|
|
3143
|
-
|
|
3175
|
+
x || (x = g);
|
|
3144
3176
|
var p = g, v;
|
|
3145
3177
|
do
|
|
3146
|
-
if (v = !1, !p.steiner && (
|
|
3147
|
-
if (
|
|
3178
|
+
if (v = !1, !p.steiner && (E(p, p.next) || P(p.prev, p, p.next) === 0)) {
|
|
3179
|
+
if (n0(p), p = x = p.prev, p === p.next) break;
|
|
3148
3180
|
v = !0;
|
|
3149
3181
|
} else
|
|
3150
3182
|
p = p.next;
|
|
3151
|
-
while (v || p !==
|
|
3152
|
-
return
|
|
3183
|
+
while (v || p !== x);
|
|
3184
|
+
return x;
|
|
3153
3185
|
}
|
|
3154
|
-
function o(g,
|
|
3186
|
+
function o(g, x, p, v, w, A, b) {
|
|
3155
3187
|
if (g) {
|
|
3156
|
-
!
|
|
3157
|
-
for (var
|
|
3158
|
-
if (
|
|
3159
|
-
|
|
3188
|
+
!b && A && u(g, v, w, A);
|
|
3189
|
+
for (var L = g, F, I; g.prev !== g.next; ) {
|
|
3190
|
+
if (F = g.prev, I = g.next, A ? a(g, v, w, A) : i(g)) {
|
|
3191
|
+
x.push(F.i / p | 0), x.push(g.i / p | 0), x.push(I.i / p | 0), n0(g), g = I.next, L = I.next;
|
|
3160
3192
|
continue;
|
|
3161
3193
|
}
|
|
3162
|
-
if (g =
|
|
3163
|
-
|
|
3194
|
+
if (g = I, g === L) {
|
|
3195
|
+
b ? b === 1 ? (g = s(t(g), x, p), o(g, x, p, v, w, A, 2)) : b === 2 && r(g, x, p, v, w, A) : o(t(g), x, p, v, w, A, 1);
|
|
3164
3196
|
break;
|
|
3165
3197
|
}
|
|
3166
3198
|
}
|
|
3167
3199
|
}
|
|
3168
3200
|
}
|
|
3169
3201
|
function i(g) {
|
|
3170
|
-
var
|
|
3171
|
-
if (
|
|
3172
|
-
for (var w =
|
|
3173
|
-
if (
|
|
3174
|
-
|
|
3202
|
+
var x = g.prev, p = g, v = g.next;
|
|
3203
|
+
if (P(x, p, v) >= 0) return !1;
|
|
3204
|
+
for (var w = x.x, A = p.x, b = v.x, L = x.y, F = p.y, I = v.y, Y = w < A ? w < b ? w : b : A < b ? A : b, D = L < F ? L < I ? L : I : F < I ? F : I, N = w > A ? w > b ? w : b : A > b ? A : b, W = L > F ? L > I ? L : I : F > I ? F : I, j = v.next; j !== x; ) {
|
|
3205
|
+
if (j.x >= Y && j.x <= N && j.y >= D && j.y <= W && T(w, L, A, F, b, I, j.x, j.y) && P(j.prev, j, j.next) >= 0) return !1;
|
|
3206
|
+
j = j.next;
|
|
3175
3207
|
}
|
|
3176
3208
|
return !0;
|
|
3177
3209
|
}
|
|
3178
|
-
function a(g,
|
|
3179
|
-
var w = g.prev,
|
|
3180
|
-
if (
|
|
3181
|
-
for (var
|
|
3182
|
-
if (
|
|
3210
|
+
function a(g, x, p, v) {
|
|
3211
|
+
var w = g.prev, A = g, b = g.next;
|
|
3212
|
+
if (P(w, A, b) >= 0) return !1;
|
|
3213
|
+
for (var L = w.x, F = A.x, I = b.x, Y = w.y, D = A.y, N = b.y, W = L < F ? L < I ? L : I : F < I ? F : I, j = Y < D ? Y < N ? Y : N : D < N ? D : N, L0 = L > F ? L > I ? L : I : F > I ? F : I, T0 = Y > D ? Y > N ? Y : N : D > N ? D : N, it = y(W, j, x, p, v), ot = y(L0, T0, x, p, v), B = g.prevZ, q = g.nextZ; B && B.z >= it && q && q.z <= ot; ) {
|
|
3214
|
+
if (B.x >= W && B.x <= L0 && B.y >= j && B.y <= T0 && B !== w && B !== b && T(L, Y, F, D, I, N, B.x, B.y) && P(B.prev, B, B.next) >= 0 || (B = B.prevZ, q.x >= W && q.x <= L0 && q.y >= j && q.y <= T0 && q !== w && q !== b && T(L, Y, F, D, I, N, q.x, q.y) && P(q.prev, q, q.next) >= 0)) return !1;
|
|
3183
3215
|
q = q.nextZ;
|
|
3184
3216
|
}
|
|
3185
|
-
for (;
|
|
3186
|
-
if (
|
|
3187
|
-
|
|
3217
|
+
for (; B && B.z >= it; ) {
|
|
3218
|
+
if (B.x >= W && B.x <= L0 && B.y >= j && B.y <= T0 && B !== w && B !== b && T(L, Y, F, D, I, N, B.x, B.y) && P(B.prev, B, B.next) >= 0) return !1;
|
|
3219
|
+
B = B.prevZ;
|
|
3188
3220
|
}
|
|
3189
3221
|
for (; q && q.z <= ot; ) {
|
|
3190
|
-
if (q.x >=
|
|
3222
|
+
if (q.x >= W && q.x <= L0 && q.y >= j && q.y <= T0 && q !== w && q !== b && T(L, Y, F, D, I, N, q.x, q.y) && P(q.prev, q, q.next) >= 0) return !1;
|
|
3191
3223
|
q = q.nextZ;
|
|
3192
3224
|
}
|
|
3193
3225
|
return !0;
|
|
3194
3226
|
}
|
|
3195
|
-
function s(g,
|
|
3227
|
+
function s(g, x, p) {
|
|
3196
3228
|
var v = g;
|
|
3197
3229
|
do {
|
|
3198
|
-
var w = v.prev,
|
|
3199
|
-
!
|
|
3230
|
+
var w = v.prev, A = v.next.next;
|
|
3231
|
+
!E(w, A) && C(w, v, v.next, A) && z(w, A) && z(A, w) && (x.push(w.i / p | 0), x.push(v.i / p | 0), x.push(A.i / p | 0), n0(v), n0(v.next), v = g = A), v = v.next;
|
|
3200
3232
|
} while (v !== g);
|
|
3201
3233
|
return t(v);
|
|
3202
3234
|
}
|
|
3203
|
-
function r(g,
|
|
3204
|
-
var
|
|
3235
|
+
function r(g, x, p, v, w, A) {
|
|
3236
|
+
var b = g;
|
|
3205
3237
|
do {
|
|
3206
|
-
for (var
|
|
3207
|
-
if (
|
|
3208
|
-
var
|
|
3209
|
-
|
|
3238
|
+
for (var L = b.next.next; L !== b.prev; ) {
|
|
3239
|
+
if (b.i !== L.i && S(b, L)) {
|
|
3240
|
+
var F = t0(b, L);
|
|
3241
|
+
b = t(b, b.next), F = t(F, F.next), o(b, x, p, v, w, A, 0), o(F, x, p, v, w, A, 0);
|
|
3210
3242
|
return;
|
|
3211
3243
|
}
|
|
3212
|
-
|
|
3244
|
+
L = L.next;
|
|
3213
3245
|
}
|
|
3214
|
-
|
|
3215
|
-
} while (
|
|
3216
|
-
}
|
|
3217
|
-
function h(g,
|
|
3218
|
-
var w = [],
|
|
3219
|
-
for (
|
|
3220
|
-
|
|
3221
|
-
for (w.sort(c),
|
|
3222
|
-
p = f(w[
|
|
3246
|
+
b = b.next;
|
|
3247
|
+
} while (b !== g);
|
|
3248
|
+
}
|
|
3249
|
+
function h(g, x, p, v) {
|
|
3250
|
+
var w = [], A, b, L, F, I;
|
|
3251
|
+
for (A = 0, b = x.length; A < b; A++)
|
|
3252
|
+
L = x[A] * v, F = A < b - 1 ? x[A + 1] * v : g.length, I = e(g, L, F, v, !1), I === I.next && (I.steiner = !0), w.push(M(I));
|
|
3253
|
+
for (w.sort(c), A = 0; A < w.length; A++)
|
|
3254
|
+
p = f(w[A], p);
|
|
3223
3255
|
return p;
|
|
3224
3256
|
}
|
|
3225
|
-
function c(g,
|
|
3226
|
-
return g.x -
|
|
3257
|
+
function c(g, x) {
|
|
3258
|
+
return g.x - x.x;
|
|
3227
3259
|
}
|
|
3228
|
-
function f(g,
|
|
3229
|
-
var p =
|
|
3260
|
+
function f(g, x) {
|
|
3261
|
+
var p = d(g, x);
|
|
3230
3262
|
if (!p)
|
|
3231
|
-
return
|
|
3232
|
-
var v =
|
|
3263
|
+
return x;
|
|
3264
|
+
var v = t0(p, g);
|
|
3233
3265
|
return t(v, v.next), t(p, p.next);
|
|
3234
3266
|
}
|
|
3235
|
-
function
|
|
3236
|
-
var p =
|
|
3267
|
+
function d(g, x) {
|
|
3268
|
+
var p = x, v = g.x, w = g.y, A = -1 / 0, b;
|
|
3237
3269
|
do {
|
|
3238
3270
|
if (w <= p.y && w >= p.next.y && p.next.y !== p.y) {
|
|
3239
|
-
var
|
|
3240
|
-
if (
|
|
3241
|
-
return
|
|
3271
|
+
var L = p.x + (w - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
|
|
3272
|
+
if (L <= v && L > A && (A = L, b = p.x < p.next.x ? p : p.next, L === v))
|
|
3273
|
+
return b;
|
|
3242
3274
|
}
|
|
3243
3275
|
p = p.next;
|
|
3244
|
-
} while (p !==
|
|
3245
|
-
if (!
|
|
3246
|
-
var
|
|
3247
|
-
p =
|
|
3276
|
+
} while (p !== x);
|
|
3277
|
+
if (!b) return null;
|
|
3278
|
+
var F = b, I = b.x, Y = b.y, D = 1 / 0, N;
|
|
3279
|
+
p = b;
|
|
3248
3280
|
do
|
|
3249
|
-
v >= p.x && p.x >=
|
|
3250
|
-
while (p !==
|
|
3251
|
-
return
|
|
3281
|
+
v >= p.x && p.x >= I && v !== p.x && T(w < Y ? v : A, w, I, Y, w < Y ? A : v, w, p.x, p.y) && (N = Math.abs(w - p.y) / (v - p.x), z(p, g) && (N < D || N === D && (p.x > b.x || p.x === b.x && l(b, p))) && (b = p, D = N)), p = p.next;
|
|
3282
|
+
while (p !== F);
|
|
3283
|
+
return b;
|
|
3252
3284
|
}
|
|
3253
|
-
function l(g,
|
|
3254
|
-
return
|
|
3285
|
+
function l(g, x) {
|
|
3286
|
+
return P(g.prev, g, x.prev) < 0 && P(x.next, g, g.next) < 0;
|
|
3255
3287
|
}
|
|
3256
|
-
function u(g,
|
|
3288
|
+
function u(g, x, p, v) {
|
|
3257
3289
|
var w = g;
|
|
3258
3290
|
do
|
|
3259
|
-
w.z === 0 && (w.z = y(w.x, w.y,
|
|
3291
|
+
w.z === 0 && (w.z = y(w.x, w.y, x, p, v)), w.prevZ = w.prev, w.nextZ = w.next, w = w.next;
|
|
3260
3292
|
while (w !== g);
|
|
3261
|
-
w.prevZ.nextZ = null, w.prevZ = null,
|
|
3293
|
+
w.prevZ.nextZ = null, w.prevZ = null, m(w);
|
|
3262
3294
|
}
|
|
3263
|
-
function
|
|
3264
|
-
var
|
|
3295
|
+
function m(g) {
|
|
3296
|
+
var x, p, v, w, A, b, L, F, I = 1;
|
|
3265
3297
|
do {
|
|
3266
|
-
for (p = g, g = null,
|
|
3267
|
-
for (
|
|
3298
|
+
for (p = g, g = null, A = null, b = 0; p; ) {
|
|
3299
|
+
for (b++, v = p, L = 0, x = 0; x < I && (L++, v = v.nextZ, !!v); x++)
|
|
3268
3300
|
;
|
|
3269
|
-
for (
|
|
3270
|
-
|
|
3301
|
+
for (F = I; L > 0 || F > 0 && v; )
|
|
3302
|
+
L !== 0 && (F === 0 || !v || p.z <= v.z) ? (w = p, p = p.nextZ, L--) : (w = v, v = v.nextZ, F--), A ? A.nextZ = w : g = w, w.prevZ = A, A = w;
|
|
3271
3303
|
p = v;
|
|
3272
3304
|
}
|
|
3273
|
-
|
|
3274
|
-
} while (
|
|
3305
|
+
A.nextZ = null, I *= 2;
|
|
3306
|
+
} while (b > 1);
|
|
3275
3307
|
return g;
|
|
3276
3308
|
}
|
|
3277
|
-
function y(g,
|
|
3278
|
-
return g = (g - p) * w | 0,
|
|
3309
|
+
function y(g, x, p, v, w) {
|
|
3310
|
+
return g = (g - p) * w | 0, x = (x - v) * w | 0, g = (g | g << 8) & 16711935, g = (g | g << 4) & 252645135, g = (g | g << 2) & 858993459, g = (g | g << 1) & 1431655765, x = (x | x << 8) & 16711935, x = (x | x << 4) & 252645135, x = (x | x << 2) & 858993459, x = (x | x << 1) & 1431655765, g | x << 1;
|
|
3279
3311
|
}
|
|
3280
3312
|
function M(g) {
|
|
3281
|
-
var
|
|
3313
|
+
var x = g, p = g;
|
|
3282
3314
|
do
|
|
3283
|
-
(
|
|
3284
|
-
while (
|
|
3315
|
+
(x.x < p.x || x.x === p.x && x.y < p.y) && (p = x), x = x.next;
|
|
3316
|
+
while (x !== g);
|
|
3285
3317
|
return p;
|
|
3286
3318
|
}
|
|
3287
|
-
function
|
|
3288
|
-
return (w -
|
|
3319
|
+
function T(g, x, p, v, w, A, b, L) {
|
|
3320
|
+
return (w - b) * (x - L) >= (g - b) * (A - L) && (g - b) * (v - L) >= (p - b) * (x - L) && (p - b) * (A - L) >= (w - b) * (v - L);
|
|
3289
3321
|
}
|
|
3290
|
-
function
|
|
3291
|
-
return g.next.i !==
|
|
3292
|
-
(
|
|
3293
|
-
(
|
|
3294
|
-
|
|
3322
|
+
function S(g, x) {
|
|
3323
|
+
return g.next.i !== x.i && g.prev.i !== x.i && !G(g, x) && // dones't intersect other edges
|
|
3324
|
+
(z(g, x) && z(x, g) && H(g, x) && // locally visible
|
|
3325
|
+
(P(g.prev, g, x.prev) || P(g, x.prev, x)) || // does not create opposite-facing sectors
|
|
3326
|
+
E(g, x) && P(g.prev, g, g.next) > 0 && P(x.prev, x, x.next) > 0);
|
|
3295
3327
|
}
|
|
3296
|
-
function
|
|
3297
|
-
return (
|
|
3328
|
+
function P(g, x, p) {
|
|
3329
|
+
return (x.y - g.y) * (p.x - x.x) - (x.x - g.x) * (p.y - x.y);
|
|
3298
3330
|
}
|
|
3299
|
-
function
|
|
3300
|
-
return g.x ===
|
|
3331
|
+
function E(g, x) {
|
|
3332
|
+
return g.x === x.x && g.y === x.y;
|
|
3301
3333
|
}
|
|
3302
|
-
function C(g,
|
|
3303
|
-
var w =
|
|
3304
|
-
return !!(w !==
|
|
3334
|
+
function C(g, x, p, v) {
|
|
3335
|
+
var w = R(P(g, x, p)), A = R(P(g, x, v)), b = R(P(p, v, g)), L = R(P(p, v, x));
|
|
3336
|
+
return !!(w !== A && b !== L || w === 0 && O(g, p, x) || A === 0 && O(g, v, x) || b === 0 && O(p, g, v) || L === 0 && O(p, x, v));
|
|
3305
3337
|
}
|
|
3306
|
-
function
|
|
3307
|
-
return
|
|
3338
|
+
function O(g, x, p) {
|
|
3339
|
+
return x.x <= Math.max(g.x, p.x) && x.x >= Math.min(g.x, p.x) && x.y <= Math.max(g.y, p.y) && x.y >= Math.min(g.y, p.y);
|
|
3308
3340
|
}
|
|
3309
|
-
function
|
|
3341
|
+
function R(g) {
|
|
3310
3342
|
return g > 0 ? 1 : g < 0 ? -1 : 0;
|
|
3311
3343
|
}
|
|
3312
|
-
function
|
|
3344
|
+
function G(g, x) {
|
|
3313
3345
|
var p = g;
|
|
3314
3346
|
do {
|
|
3315
|
-
if (p.i !== g.i && p.next.i !== g.i && p.i !==
|
|
3347
|
+
if (p.i !== g.i && p.next.i !== g.i && p.i !== x.i && p.next.i !== x.i && C(p, p.next, g, x)) return !0;
|
|
3316
3348
|
p = p.next;
|
|
3317
3349
|
} while (p !== g);
|
|
3318
3350
|
return !1;
|
|
3319
3351
|
}
|
|
3320
|
-
function
|
|
3321
|
-
return
|
|
3352
|
+
function z(g, x) {
|
|
3353
|
+
return P(g.prev, g, g.next) < 0 ? P(g, x, g.next) >= 0 && P(g, g.prev, x) >= 0 : P(g, x, g.prev) < 0 || P(g, g.next, x) < 0;
|
|
3322
3354
|
}
|
|
3323
|
-
function
|
|
3324
|
-
var p = g, v = !1, w = (g.x +
|
|
3355
|
+
function H(g, x) {
|
|
3356
|
+
var p = g, v = !1, w = (g.x + x.x) / 2, A = (g.y + x.y) / 2;
|
|
3325
3357
|
do
|
|
3326
|
-
p.y >
|
|
3358
|
+
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;
|
|
3327
3359
|
while (p !== g);
|
|
3328
3360
|
return v;
|
|
3329
3361
|
}
|
|
3330
|
-
function
|
|
3331
|
-
var p = new
|
|
3332
|
-
return g.next =
|
|
3362
|
+
function t0(g, x) {
|
|
3363
|
+
var p = new K(g.i, g.x, g.y), v = new K(x.i, x.x, x.y), w = g.next, A = x.prev;
|
|
3364
|
+
return g.next = x, x.prev = g, p.next = w, w.prev = p, v.next = p, p.prev = v, A.next = v, v.prev = A, v;
|
|
3333
3365
|
}
|
|
3334
|
-
function
|
|
3335
|
-
var w = new
|
|
3366
|
+
function e0(g, x, p, v) {
|
|
3367
|
+
var w = new K(g, x, p);
|
|
3336
3368
|
return v ? (w.next = v.next, w.prev = v, v.next.prev = w, v.next = w) : (w.prev = w, w.next = w), w;
|
|
3337
3369
|
}
|
|
3338
|
-
function
|
|
3370
|
+
function n0(g) {
|
|
3339
3371
|
g.next.prev = g.prev, g.prev.next = g.next, g.prevZ && (g.prevZ.nextZ = g.nextZ), g.nextZ && (g.nextZ.prevZ = g.prevZ);
|
|
3340
3372
|
}
|
|
3341
|
-
function
|
|
3342
|
-
this.i = g, this.x =
|
|
3373
|
+
function K(g, x, p) {
|
|
3374
|
+
this.i = g, this.x = x, this.y = p, this.prev = null, this.next = null, this.z = 0, this.prevZ = null, this.nextZ = null, this.steiner = !1;
|
|
3343
3375
|
}
|
|
3344
|
-
n.deviation = function(g,
|
|
3345
|
-
var w =
|
|
3376
|
+
n.deviation = function(g, x, p, v) {
|
|
3377
|
+
var w = x && x.length, A = w ? x[0] * p : g.length, b = Math.abs(F0(g, 0, A, p));
|
|
3346
3378
|
if (w)
|
|
3347
|
-
for (var
|
|
3348
|
-
var
|
|
3349
|
-
|
|
3379
|
+
for (var L = 0, F = x.length; L < F; L++) {
|
|
3380
|
+
var I = x[L] * p, Y = L < F - 1 ? x[L + 1] * p : g.length;
|
|
3381
|
+
b -= Math.abs(F0(g, I, Y, p));
|
|
3350
3382
|
}
|
|
3351
|
-
var
|
|
3352
|
-
for (
|
|
3353
|
-
var
|
|
3354
|
-
|
|
3355
|
-
(g[
|
|
3383
|
+
var D = 0;
|
|
3384
|
+
for (L = 0; L < v.length; L += 3) {
|
|
3385
|
+
var N = v[L] * p, W = v[L + 1] * p, j = v[L + 2] * p;
|
|
3386
|
+
D += Math.abs(
|
|
3387
|
+
(g[N] - g[j]) * (g[W + 1] - g[N + 1]) - (g[N] - g[W]) * (g[j + 1] - g[N + 1])
|
|
3356
3388
|
);
|
|
3357
3389
|
}
|
|
3358
|
-
return
|
|
3390
|
+
return b === 0 && D === 0 ? 0 : Math.abs((D - b) / b);
|
|
3359
3391
|
};
|
|
3360
|
-
function
|
|
3361
|
-
for (var w = 0,
|
|
3362
|
-
w += (g[
|
|
3392
|
+
function F0(g, x, p, v) {
|
|
3393
|
+
for (var w = 0, A = x, b = p - v; A < p; A += v)
|
|
3394
|
+
w += (g[b] - g[A]) * (g[A + 1] + g[b + 1]), b = A;
|
|
3363
3395
|
return w;
|
|
3364
3396
|
}
|
|
3365
3397
|
return n.flatten = function(g) {
|
|
3366
|
-
for (var
|
|
3367
|
-
for (var
|
|
3368
|
-
for (var
|
|
3398
|
+
for (var x = g[0][0].length, p = { vertices: [], holes: [], dimensions: x }, v = 0, w = 0; w < g.length; w++) {
|
|
3399
|
+
for (var A = 0; A < g[w].length; A++)
|
|
3400
|
+
for (var b = 0; b < x; b++) p.vertices.push(g[w][A][b]);
|
|
3369
3401
|
w > 0 && (v += g[w - 1].length, p.holes.push(v));
|
|
3370
3402
|
}
|
|
3371
3403
|
return p;
|
|
3372
|
-
},
|
|
3404
|
+
}, I0.exports;
|
|
3373
3405
|
}
|
|
3374
|
-
|
|
3375
|
-
function
|
|
3406
|
+
cn();
|
|
3407
|
+
function jt(n, e) {
|
|
3376
3408
|
return n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
|
|
3377
3409
|
}
|
|
3378
|
-
function
|
|
3379
|
-
return n.length === 1 && (n =
|
|
3410
|
+
function un(n) {
|
|
3411
|
+
return n.length === 1 && (n = fn(n)), {
|
|
3380
3412
|
left: function(e, t, o, i) {
|
|
3381
3413
|
for (o == null && (o = 0), i == null && (i = e.length); o < i; ) {
|
|
3382
3414
|
var a = o + i >>> 1;
|
|
@@ -3393,31 +3425,31 @@ function hn(n) {
|
|
|
3393
3425
|
}
|
|
3394
3426
|
};
|
|
3395
3427
|
}
|
|
3396
|
-
function
|
|
3428
|
+
function fn(n) {
|
|
3397
3429
|
return function(e, t) {
|
|
3398
|
-
return
|
|
3430
|
+
return jt(n(e), t);
|
|
3399
3431
|
};
|
|
3400
3432
|
}
|
|
3401
|
-
|
|
3402
|
-
function
|
|
3403
|
-
const o =
|
|
3433
|
+
un(jt);
|
|
3434
|
+
function Rn(n, e, t = 3) {
|
|
3435
|
+
const o = hn(n, e, { maxSegmentLength: t });
|
|
3404
3436
|
return {
|
|
3405
3437
|
check: (i) => typeof i == "string",
|
|
3406
3438
|
interpolate: (i, a, s) => o(s)
|
|
3407
3439
|
};
|
|
3408
3440
|
}
|
|
3409
|
-
function
|
|
3441
|
+
function Nn(n) {
|
|
3410
3442
|
const e = (o) => n.width * o, t = (o) => n.height * o;
|
|
3411
3443
|
return {
|
|
3412
3444
|
scaleX: e,
|
|
3413
3445
|
scaleY: t,
|
|
3414
|
-
position: (o, i) =>
|
|
3446
|
+
position: (o, i) => X({
|
|
3415
3447
|
x: e(o),
|
|
3416
3448
|
y: t(i)
|
|
3417
3449
|
})
|
|
3418
3450
|
};
|
|
3419
3451
|
}
|
|
3420
|
-
function
|
|
3452
|
+
function Bn(n) {
|
|
3421
3453
|
const e = [];
|
|
3422
3454
|
if (n.isAllKey) {
|
|
3423
3455
|
for (let t = 0; t <= n.animations.length; t++)
|
|
@@ -3430,48 +3462,48 @@ function Rn(n) {
|
|
|
3430
3462
|
}
|
|
3431
3463
|
export {
|
|
3432
3464
|
x0 as Alignment,
|
|
3433
|
-
|
|
3465
|
+
o0 as Anchor,
|
|
3434
3466
|
et as Animate,
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3467
|
+
mn as Arrow,
|
|
3468
|
+
kn as BrowserCanvasRenderer,
|
|
3469
|
+
An as Circle,
|
|
3438
3470
|
$ as Color,
|
|
3439
3471
|
tt as Easing,
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3472
|
+
pn as FadeIn,
|
|
3473
|
+
dn as FadeOut,
|
|
3474
|
+
d1 as FontStyle,
|
|
3475
|
+
y1 as FontWeight,
|
|
3476
|
+
bn as Grid,
|
|
3445
3477
|
st as Group,
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3478
|
+
xn as Hide,
|
|
3479
|
+
vn as IFrame,
|
|
3480
|
+
Mn as Image,
|
|
3481
|
+
Ln as Line,
|
|
3482
|
+
Tn as Mask,
|
|
3483
|
+
U as ObjectType,
|
|
3484
|
+
Fn as Opaque,
|
|
3485
|
+
Pn as Path,
|
|
3486
|
+
In as Pause,
|
|
3487
|
+
Cn as Polygon,
|
|
3488
|
+
X as Position,
|
|
3489
|
+
P1 as Presentation,
|
|
3490
|
+
Sn as Rectangle,
|
|
3491
|
+
En as SVG,
|
|
3492
|
+
wn as ScreenCapture,
|
|
3493
|
+
yn as Show,
|
|
3494
|
+
a0 as Size,
|
|
3495
|
+
_n as Slide,
|
|
3496
|
+
l0 as SlideObject,
|
|
3497
|
+
St as SlideWebExtra,
|
|
3498
|
+
A1 as Text,
|
|
3499
|
+
On as TextUnit,
|
|
3500
|
+
p1 as Transparent,
|
|
3469
3501
|
Ct as Update,
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3502
|
+
Bn as getKeySlideBuildIndices,
|
|
3503
|
+
Nn as getSizingFunctions,
|
|
3504
|
+
Rn as getSmoothPathInterpolator,
|
|
3505
|
+
m1 as getTextContentLength,
|
|
3506
|
+
k1 as interpolateColor,
|
|
3507
|
+
_1 as interpolateNumber
|
|
3476
3508
|
};
|
|
3477
3509
|
//# sourceMappingURL=presenter.mjs.map
|