presenter 0.8.2 → 0.8.4

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.
@@ -1,7 +1,7 @@
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 = {
1
+ var Q0 = Object.defineProperty;
2
+ var J0 = (n, e, t) => e in n ? Q0(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var k = (n, e, t) => J0(n, typeof e != "symbol" ? e + "" : e, t);
4
+ const ft = {
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,52 +9,52 @@ const f0 = {
9
9
  /** Represents an immediate update to an object's properties without animation. */
10
10
  UPDATE: "Update"
11
11
  };
12
- function Yt(n) {
12
+ function te(n) {
13
13
  return n * n * n;
14
14
  }
15
- function Ht(n) {
15
+ function ee(n) {
16
16
  return --n * n * n + 1;
17
17
  }
18
- function Xt(n) {
18
+ function ne(n) {
19
19
  return ((n *= 2) <= 1 ? n * n * n : (n -= 2) * n * n + 2) / 2;
20
20
  }
21
- var J0 = 1.70158;
21
+ var r0 = 1.70158;
22
22
  (function n(e) {
23
23
  e = +e;
24
24
  function t(o) {
25
25
  return (o = +o) * o * (e * (o - 1) + o);
26
26
  }
27
27
  return t.overshoot = n, t;
28
- })(J0);
28
+ })(r0);
29
29
  (function n(e) {
30
30
  e = +e;
31
31
  function t(o) {
32
32
  return --o * o * ((o + 1) * e + o) + 1;
33
33
  }
34
34
  return t.overshoot = n, t;
35
- })(J0);
36
- var $t = (function n(e) {
35
+ })(r0);
36
+ var re = (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;
40
40
  }
41
41
  return t.overshoot = n, t;
42
- })(J0);
43
- const tt = {
42
+ })(r0);
43
+ const i0 = {
44
44
  LINEAR: (n) => n,
45
- CUBIC: Xt,
46
- CUBIC_IN: Yt,
47
- CUBIC_OUT: Ht,
48
- BACK_IN_OUT: $t.overshoot(0.8)
49
- }, Gt = tt.LINEAR;
50
- function et(n, e, t = {}) {
45
+ CUBIC: ne,
46
+ CUBIC_IN: te,
47
+ CUBIC_OUT: ee,
48
+ BACK_IN_OUT: re.overshoot(0.8)
49
+ }, ie = i0.LINEAR;
50
+ function o0(n, e, t = {}) {
51
51
  return {
52
- type: f0.ANIMATE,
52
+ type: ft.ANIMATE,
53
53
  object: n,
54
54
  props: e,
55
55
  delay: 0,
56
56
  duration: 1e3,
57
- easing: Gt,
57
+ easing: ie,
58
58
  block: !1,
59
59
  interpolators: null,
60
60
  isKey: !1,
@@ -62,23 +62,23 @@ function et(n, e, t = {}) {
62
62
  ...typeof t == "number" ? { duration: t } : t
63
63
  };
64
64
  }
65
- function pn(n, e = {}) {
66
- return et(n, { opacity: 1 }, {
65
+ function Tn(n, e = {}) {
66
+ return o0(n, { opacity: 1 }, {
67
67
  duration: 500,
68
- easing: tt.CUBIC,
68
+ easing: i0.CUBIC,
69
69
  ...typeof e == "number" ? { duration: e } : e
70
70
  });
71
71
  }
72
- function dn(n, e = {}) {
73
- return et(n, { opacity: 0 }, {
72
+ function Cn(n, e = {}) {
73
+ return o0(n, { opacity: 0 }, {
74
74
  duration: 500,
75
- easing: tt.CUBIC,
75
+ easing: i0.CUBIC,
76
76
  ...typeof e == "number" ? { duration: e } : e
77
77
  });
78
78
  }
79
- function Ct(n, e, t = {}) {
79
+ function F0(n, e, t = {}) {
80
80
  return {
81
- type: f0.UPDATE,
81
+ type: ft.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 xn(n) {
90
- return Ct(n, { opacity: 0 });
89
+ function Pn(n) {
90
+ return F0(n, { opacity: 0 });
91
91
  }
92
- function yn(n) {
93
- return Ct(n, { opacity: 1 });
92
+ function En(n) {
93
+ return F0(n, { opacity: 1 });
94
94
  }
95
- const o0 = {
95
+ const ot = {
96
96
  TOP_LEFT: "TopLeft",
97
97
  TOP: "Top",
98
98
  TOP_RIGHT: "TopRight",
@@ -102,8 +102,8 @@ const o0 = {
102
102
  BOTTOM_LEFT: "BottomLeft",
103
103
  BOTTOM: "Bottom",
104
104
  BOTTOM_RIGHT: "BottomRight"
105
- }, h0 = o0.TOP_LEFT;
106
- function $(n, e = 0, t = 0, o = 1) {
105
+ }, ht = ot.TOP_LEFT;
106
+ function G(n, e = 0, t = 0, o = 1) {
107
107
  if (typeof n == "string") {
108
108
  const i = n.replace("#", ""), a = parseInt(i, 16);
109
109
  return isNaN(a) ? (console.warn("Invalid hex color format:", n), Q) : i.length === 6 ? {
@@ -132,18 +132,18 @@ function $(n, e = 0, t = 0, o = 1) {
132
132
  ...n
133
133
  };
134
134
  }
135
- $.BLACK = $(0, 0, 0);
136
- $.BLUE = $(0, 0, 255);
137
- $.GREEN = $(0, 255, 0);
138
- $.RED = $(255, 0, 0);
139
- $.TRANSPARENT = $(0, 0, 0, 0);
140
- $.WHITE = $(255, 255, 255);
135
+ G.BLACK = G(0, 0, 0);
136
+ G.BLUE = G(0, 0, 255);
137
+ G.GREEN = G(0, 255, 0);
138
+ G.RED = G(255, 0, 0);
139
+ G.TRANSPARENT = G(0, 0, 0, 0);
140
+ G.WHITE = G(255, 255, 255);
141
141
  const Q = { red: 0, green: 0, blue: 0, alpha: 1 };
142
- function St(n = null) {
142
+ function N0(n = null) {
143
143
  return {
144
144
  content: null,
145
145
  setup: null,
146
- anchor: o0.TOP_LEFT,
146
+ anchor: ot.TOP_LEFT,
147
147
  height: 0,
148
148
  width: 0,
149
149
  x: 0,
@@ -151,72 +151,72 @@ function St(n = null) {
151
151
  ...n
152
152
  };
153
153
  }
154
- function Et(n, e = null) {
154
+ function R0(n, e = null) {
155
155
  return n.alpha * (e ?? 1);
156
156
  }
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);
157
+ function Et(n, e = null) {
158
+ const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(R0(n, e) * 255);
159
159
  return `#${a.toString(16).padStart(6, "0")}${s !== 255 ? s.toString(16).padStart(2, "0") : ""}`;
160
160
  }
161
- function vn(n = null) {
161
+ function Sn(n = null) {
162
162
  const {
163
163
  url: e = "https://wikipedia.org/",
164
- backgroundColor: t = $.TRANSPARENT,
164
+ backgroundColor: t = G.TRANSPARENT,
165
165
  strokeColor: o = Q,
166
166
  strokeWidth: i = 0,
167
167
  pointerEvents: a = "auto",
168
168
  scale: s = 1,
169
- anchor: r = h0,
169
+ anchor: r = ht,
170
170
  height: h = 1e3,
171
- width: c = 1e3,
172
- x: f = 0,
171
+ width: u = 1e3,
172
+ x: c = 0,
173
173
  y: d = 0
174
174
  } = n || {}, l = document.createElement("iframe");
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
- 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", St({
175
+ l.src = e, l.style.backgroundColor = Et(t), l.style.border = i > 0 ? `${i}px solid ${Et(o)}` : "none", l.style.pointerEvents = a;
176
+ const f = (100 / s).toFixed(3) + "%";
177
+ return l.style.height = i === 0 ? f : `calc(${f} - ${i * 2}px)`, l.style.width = i === 0 ? f : `calc(${f} - ${i * 2}px)`, l.style.transform = `scale(${s})`, l.style.transformOrigin = "top left", N0({
178
178
  content: l,
179
179
  anchor: r,
180
180
  height: h,
181
- width: c,
182
- x: f,
181
+ width: u,
182
+ x: c,
183
183
  y: d
184
184
  });
185
185
  }
186
- const x0 = {
186
+ const xt = {
187
187
  LEFT: "left",
188
188
  CENTER: "center",
189
189
  RIGHT: "right"
190
- }, Wt = x0.LEFT;
191
- function s0(n, e) {
190
+ }, oe = xt.LEFT;
191
+ function st(n, e) {
192
192
  throw new Error("Unexpected value: " + n);
193
193
  }
194
- function wn(n = null) {
194
+ function kn(n = null) {
195
195
  const {
196
- alignment: e = x0.LEFT,
196
+ alignment: e = xt.LEFT,
197
197
  scale: t = 1,
198
- anchor: o = h0,
198
+ anchor: o = ht,
199
199
  height: i = 1e3,
200
200
  width: a = 1e3,
201
201
  x: s = 0,
202
202
  y: r = 0
203
203
  } = n || {};
204
- function h(c) {
205
- const f = document.createElement("video");
206
- switch (f.autoplay = !0, f.style.transform = `scale(${t})`, e) {
207
- case x0.LEFT:
208
- f.style.transformOrigin = "top left";
204
+ function h(u) {
205
+ const c = document.createElement("video");
206
+ switch (c.autoplay = !0, c.style.transform = `scale(${t})`, e) {
207
+ case xt.LEFT:
208
+ c.style.transformOrigin = "top left";
209
209
  break;
210
- case x0.CENTER:
211
- f.style.transformOrigin = "top center";
210
+ case xt.CENTER:
211
+ c.style.transformOrigin = "top center";
212
212
  break;
213
- case x0.RIGHT:
214
- f.style.transformOrigin = "top right";
213
+ case xt.RIGHT:
214
+ c.style.transformOrigin = "top right";
215
215
  break;
216
216
  default:
217
- s0(e);
217
+ st(e);
218
218
  }
219
- c.appendChild(f);
219
+ u.appendChild(c);
220
220
  const d = {
221
221
  video: {
222
222
  displaySurface: "window"
@@ -224,17 +224,17 @@ function wn(n = null) {
224
224
  audio: !1
225
225
  };
226
226
  return navigator.mediaDevices.getDisplayMedia(d).then((l) => {
227
- const u = l.getVideoTracks()[0];
228
- u !== void 0 && (u.onended = function() {
229
- f.style.display = "none";
230
- }), f.srcObject = l, f.play();
227
+ const f = l.getVideoTracks()[0];
228
+ f !== void 0 && (f.onended = function() {
229
+ c.style.display = "none";
230
+ }), c.srcObject = l, c.play();
231
231
  }).catch((l) => {
232
232
  console.error("Could not start screen capture -", l);
233
233
  }), () => {
234
- f.srcObject.getTracks().forEach((u) => u.stop()), f.style.display = "none", f.srcObject = null;
234
+ c.srcObject.getTracks().forEach((f) => f.stop()), c.style.display = "none", c.srcObject = null;
235
235
  };
236
236
  }
237
- return St({
237
+ return N0({
238
238
  content: null,
239
239
  setup: h,
240
240
  anchor: o,
@@ -258,16 +258,16 @@ const U = {
258
258
  SVG: "SVG",
259
259
  TEXT: "Text"
260
260
  };
261
- function l0(n) {
261
+ function lt(n) {
262
262
  return {
263
263
  objectType: U.SLIDE_OBJECT,
264
264
  opacity: 1,
265
265
  ...n
266
266
  };
267
267
  }
268
- function mn(n = null) {
268
+ function In(n = null) {
269
269
  const { arrowheadSize: e, width: t = 10, ...o } = n || {}, i = e ?? t * 4;
270
- return l0({
270
+ return lt({
271
271
  objectType: U.ARROW,
272
272
  arrowheadSize: i,
273
273
  color: Q,
@@ -283,25 +283,25 @@ function mn(n = null) {
283
283
  ...o
284
284
  });
285
285
  }
286
- const Zt = 50;
287
- function An(n = null) {
288
- return l0({
286
+ const se = 50;
287
+ function _n(n = null) {
288
+ return lt({
289
289
  objectType: U.CIRCLE,
290
- anchor: h0,
290
+ anchor: ht,
291
291
  strokeColor: Q,
292
292
  strokeWidth: 0,
293
293
  drawn: 1,
294
294
  fillColor: Q,
295
- radius: Zt,
295
+ radius: se,
296
296
  x: 0,
297
297
  y: 0,
298
298
  ...n
299
299
  });
300
300
  }
301
- function st(n, e = null) {
302
- return l0({
301
+ function c0(n, e = null) {
302
+ return lt({
303
303
  objectType: U.GROUP,
304
- anchor: h0,
304
+ anchor: ht,
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 bn(n) {
326
+ function On(n) {
327
327
  const {
328
- anchor: e = h0,
328
+ anchor: e = ht,
329
329
  cols: t = 1,
330
330
  rows: o = 1,
331
331
  gapX: i = 0,
@@ -333,30 +333,30 @@ function bn(n) {
333
333
  groupProps: s = {},
334
334
  width: r = 0,
335
335
  height: h = 0,
336
- x: c = 0,
337
- y: f = 0,
336
+ x: u = 0,
337
+ y: c = 0,
338
338
  objects: d = () => null
339
- } = n, l = [], u = [];
339
+ } = n, l = [], f = [];
340
340
  let m = 0, y = 0;
341
- for (let T = 0; T < o; T++) {
342
- const S = [];
341
+ for (let E = 0; E < o; E++) {
342
+ const L = [];
343
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
- st([C], {
344
+ let C = 0;
345
+ for (let S = 0; S < t; S++) {
346
+ const T = d(E, S), I = typeof r == "function" ? r(E, S) : r, R = typeof h == "function" ? h(E, S) : h;
347
+ L.push(T), T != null && f.push(
348
+ c0([T], {
349
349
  x: m,
350
350
  y
351
351
  })
352
- ), m += O + i, P = Math.max(P, R);
352
+ ), m += I + i, C = Math.max(C, R);
353
353
  }
354
- l.push(S), y += P + a;
354
+ l.push(L), y += C + a;
355
355
  }
356
356
  return {
357
- grid: st(u, {
358
- x: c,
359
- y: f,
357
+ grid: c0(f, {
358
+ x: u,
359
+ y: c,
360
360
  height: y - a,
361
361
  width: m - i,
362
362
  anchor: e,
@@ -365,10 +365,10 @@ function bn(n) {
365
365
  objects: l
366
366
  };
367
367
  }
368
- function Mn(n = null) {
369
- return l0({
368
+ function Fn(n = null) {
369
+ return lt({
370
370
  objectType: U.IMAGE,
371
- anchor: h0,
371
+ anchor: ht,
372
372
  cornerRadius: 0,
373
373
  height: 100,
374
374
  imageId: "",
@@ -379,8 +379,8 @@ function Mn(n = null) {
379
379
  ...n
380
380
  });
381
381
  }
382
- function Ln(n = null) {
383
- return l0({
382
+ function Nn(n = null) {
383
+ return lt({
384
384
  objectType: U.LINE,
385
385
  color: Q,
386
386
  drawn: 1,
@@ -394,10 +394,10 @@ function Ln(n = null) {
394
394
  ...n
395
395
  });
396
396
  }
397
- function Tn(n, e = null) {
398
- return l0({
397
+ function Rn(n, e = null) {
398
+ return lt({
399
399
  objectType: U.MASK,
400
- anchor: h0,
400
+ anchor: ht,
401
401
  height: 100,
402
402
  objects: n,
403
403
  preview: !1,
@@ -407,53 +407,53 @@ function Tn(n, e = null) {
407
407
  ...e
408
408
  });
409
409
  }
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);
410
+ var ae = Object.defineProperty, O = (n, e) => ae(n, "name", { value: e, configurable: !0 }), Ct = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, he = /([astvzqmhlc])([^astvzqmhlc]*)/gi, le = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, ce = O((n) => {
411
+ const e = (n && n.length > 0 ? n : "M0,0").match(he);
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 = te(o.substring(1));
414
+ let i = o.charAt(0), a = i.toLowerCase(), s = ue(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])];
418
418
  }
419
419
  for (; s.length >= 0; ) {
420
- if (s.length === P0[a]) {
421
- t.push([i, ...s.splice(0, P0[a])]);
420
+ if (s.length === Ct[a]) {
421
+ t.push([i, ...s.splice(0, Ct[a])]);
422
422
  break;
423
423
  }
424
- if (s.length < P0[a]) throw new Error(`Malformed path data: "${i}" must have ${P0[a]} elements and has ${s.length}: ${o}`);
425
- t.push([i, ...s.splice(0, P0[a])]);
424
+ if (s.length < Ct[a]) throw new Error(`Malformed path data: "${i}" must have ${Ct[a]} elements and has ${s.length}: ${o}`);
425
+ t.push([i, ...s.splice(0, Ct[a])]);
426
426
  }
427
427
  return t;
428
428
  }, []);
429
- }, "default"), te = _((n) => {
430
- const e = n.match(Qt);
429
+ }, "default"), ue = O((n) => {
430
+ const e = n.match(le);
431
431
  return e ? e.map(Number) : [];
432
- }, "parseValues"), w0, J = (w0 = class {
432
+ }, "parseValues"), wt, J = (wt = class {
433
433
  constructor(e, t, o, i) {
434
434
  k(this, "x0");
435
435
  k(this, "x1");
436
436
  k(this, "y0");
437
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) => {
438
+ k(this, "getTotalLength", O(() => Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2)), "getTotalLength"));
439
+ k(this, "getPointAtLength", O((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
- k(this, "getTangentAtLength", _((e) => {
445
+ k(this, "getTangentAtLength", O((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
- k(this, "getPropertiesAtLength", _((e) => {
449
+ k(this, "getPropertiesAtLength", O((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"));
453
453
  this.x0 = e, this.x1 = t, this.y0 = o, this.y1 = i;
454
454
  }
455
- }, _(w0, "LinearPosition"), w0), m0, at = (m0 = class {
456
- constructor(e, t, o, i, a, s, r, h, c) {
455
+ }, O(wt, "LinearPosition"), wt), mt, u0 = (mt = class {
456
+ constructor(e, t, o, i, a, s, r, h, u) {
457
457
  k(this, "x0");
458
458
  k(this, "y0");
459
459
  k(this, "rx");
@@ -464,13 +464,13 @@ var Vt = Object.defineProperty, _ = (n, e) => Vt(n, "name", { value: e, configur
464
464
  k(this, "x1");
465
465
  k(this, "y1");
466
466
  k(this, "length");
467
- k(this, "getTotalLength", _(() => this.length, "getTotalLength"));
468
- k(this, "getPointAtLength", _((e) => {
467
+ k(this, "getTotalLength", O(() => this.length, "getTotalLength"));
468
+ k(this, "getPointAtLength", O((e) => {
469
469
  e < 0 ? e = 0 : e > this.length && (e = this.length);
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);
470
+ const t = f0({ 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
- k(this, "getTangentAtLength", _((e) => {
473
+ k(this, "getTangentAtLength", O((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,86 +478,86 @@ var Vt = Object.defineProperty, _ = (n, e) => Vt(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
- k(this, "getPropertiesAtLength", _((e) => {
481
+ k(this, "getPropertiesAtLength", O((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
- 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 = ee(300, function(d) {
487
- return ht({ x: e, y: t }, o, i, a, s, r, { x: h, y: c }, d);
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 = u;
486
+ const c = fe(300, function(d) {
487
+ return f0({ x: e, y: t }, o, i, a, s, r, { x: h, y: u }, d);
488
488
  });
489
- this.length = f.arcLength;
489
+ this.length = c.arcLength;
490
490
  }
491
- }, _(m0, "Arc"), m0), ht = _((n, e, t, o, i, a, s, r) => {
492
- e = Math.abs(e), t = Math.abs(t), o = ne(o, 360);
493
- const h = re(o);
491
+ }, O(mt, "Arc"), mt), f0 = O((n, e, t, o, i, a, s, r) => {
492
+ e = Math.abs(e), t = Math.abs(t), o = ge(o, 360);
493
+ const h = pe(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, 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);
496
+ const u = (n.x - s.x) / 2, c = (n.y - s.y) / 2, d = { x: Math.cos(h) * u + Math.sin(h) * c, y: -Math.sin(h) * u + Math.cos(h) * c }, 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(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
- u = u < 0 ? 0 : u;
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"), ee = _((n, e) => {
498
+ let f = (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
+ f = f < 0 ? 0 : f;
500
+ const m = (i !== a ? 1 : -1) * Math.sqrt(f), y = m * (e * d.y / t), M = m * (-t * d.x / e), E = { 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 }, L = { x: (d.x - y) / e, y: (d.y - M) / t }, C = p0({ x: 1, y: 0 }, L);
501
+ let S = p0(L, { x: (-d.x - y) / e, y: (-d.y - M) / t });
502
+ !a && S > 0 ? S -= 2 * Math.PI : a && S < 0 && (S += 2 * Math.PI), S %= 2 * Math.PI;
503
+ const T = C + S * r, I = e * Math.cos(T), R = t * Math.sin(T);
504
+ return { x: Math.cos(h) * I - Math.sin(h) * R + E.x, y: Math.sin(h) * I + Math.cos(h) * R + E.y, ellipticalArcStartAngle: C, ellipticalArcEndAngle: C + S, ellipticalArcAngle: T, ellipticalArcCenter: E, resultantRx: e, resultantRy: t };
505
+ }, "pointOnEllipticalArc"), fe = O((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 = ie(r * (1 / n), 0, 1);
512
- a = e(h), t += lt(s, a), i.push([s, a]), o.push({ t: h, arcLength: t }), s = a;
511
+ const h = de(r * (1 / n), 0, 1);
512
+ a = e(h), t += g0(s, a), i.push([s, a]), o.push({ t: h, arcLength: t }), s = a;
513
513
  }
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"), ne = _((n, e) => (n % e + e) % e, "mod"), re = _((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"), ie = _((n, e, t) => Math.min(Math.max(n, e), t), "clamp"), ct = _((n, e) => {
514
+ return a = e(1), i.push([s, a]), t += g0(s, a), o.push({ t: 1, arcLength: t }), { arcLength: t, arcLengthMap: o, approximationLines: i };
515
+ }, "approximateArcLengthOfCurve"), ge = O((n, e) => (n % e + e) % e, "mod"), pe = O((n) => n * (Math.PI / 180), "toRadians"), g0 = O((n, e) => Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2)), "distance"), de = O((n, e, t) => Math.min(Math.max(n, e), t), "clamp"), p0 = O((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"), oe = [[], [], [-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]], se = [[], [], [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]], ae = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], he = _((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"), le = _((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"), ce = _((n, e, t) => {
518
+ }, "angleBetween"), xe = [[], [], [-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]], ye = [[], [], [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]], ve = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], we = O((n, e, t) => ({ x: (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], y: (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3] }), "cubicPoint"), me = O((n, e, t) => B0([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"), be = O((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 * oe[20][s] + a, o += se[20][s] * It(n, e, i);
522
+ for (let s = 0; s < 20; s++) i = a * xe[20][s] + a, o += ye[20][s] * D0(n, e, i);
523
523
  return a * o;
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"), ue = _((n, e, t) => {
524
+ }, "getCubicArcLength"), B0 = O((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"), Ae = O((n, e, t) => {
525
525
  t === void 0 && (t = 1);
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;
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), u = 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), 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"), fe = _((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
- const o = G0(1, t, n), i = G0(1, t, e), a = o * o + i * i;
528
+ const c = h / (2 * r), d = t + c, l = u / r - c * c, f = d * d + l > 0 ? Math.sqrt(d * d + l) : 0, m = c * c + l > 0 ? Math.sqrt(c * c + l) : 0, y = c + Math.sqrt(c * c + l) !== 0 && (d + f) / (c + m) !== 0 ? l * Math.log(Math.abs((d + f) / (c + m))) : 0;
529
+ return Math.sqrt(r) / 2 * (d * f - c * m + y);
530
+ }, "getQuadraticArcLength"), Me = O((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 D0(n, e, t) {
532
+ const o = Vt(1, t, n), i = Vt(1, t, e), a = o * o + i * i;
533
533
  return Math.sqrt(a);
534
534
  }
535
- _(It, "BFunc");
536
- var G0 = _((n, e, t) => {
535
+ O(D0, "BFunc");
536
+ var Vt = O((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 += ae[o][s] * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
542
+ for (let s = 0; s <= o; s++) a += ve[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
- return G0(n - 1, e, i);
548
- }, "getDerivative"), R0 = _((n, e, t) => {
547
+ return Vt(n - 1, e, i);
548
+ }, "getDerivative"), Bt = O((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;
552
552
  if (h < o) o = h, i += a;
553
553
  else {
554
- const c = t(i - a), f = Math.abs(n - c) / e;
555
- f < o ? (o = f, i -= a) : a /= 2;
554
+ const u = t(i - a), c = Math.abs(n - u) / e;
555
+ c < o ? (o = c, i -= a) : a /= 2;
556
556
  }
557
557
  if (s++, s > 500) break;
558
558
  }
559
559
  return i;
560
- }, "t2length"), A0, c0 = (A0 = class {
560
+ }, "t2length"), bt, ct = (bt = class {
561
561
  constructor(e, t, o, i, a, s, r, h) {
562
562
  k(this, "a");
563
563
  k(this, "b");
@@ -567,59 +567,59 @@ var G0 = _((n, e, t) => {
567
567
  k(this, "getArcLength");
568
568
  k(this, "getPoint");
569
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));
570
+ k(this, "getTotalLength", O(() => this.length, "getTotalLength"));
571
+ k(this, "getPointAtLength", O((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 = Bt(e, this.length, (a) => this.getArcLength(t, o, a));
573
573
  return this.getPoint(t, o, i);
574
574
  }, "getPointAtLength"));
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);
575
+ k(this, "getTangentAtLength", O((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 = Bt(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
- 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);
580
+ k(this, "getPropertiesAtLength", O((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 = Bt(e, this.length, (u) => this.getArcLength(t, o, u)), 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
- 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 = ce, this.getPoint = he, this.getDerivative = le, this.d = { x: r, y: h }) : (this.getArcLength = ue, this.getPoint = kt, this.getDerivative = fe, 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);
587
+ k(this, "getC", O(() => this.c, "getC"));
588
+ k(this, "getD", O(() => 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 = be, this.getPoint = we, this.getDerivative = me, this.d = { x: r, y: h }) : (this.getArcLength = Ae, this.getPoint = B0, this.getDerivative = Me, 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
- }, _(A0, "Bezier"), A0), b0, ge = (b0 = class {
591
+ }, O(bt, "Bezier"), bt), At, Le = (At = class {
592
592
  constructor(e) {
593
593
  k(this, "length", 0);
594
594
  k(this, "partial_lengths", []);
595
595
  k(this, "functions", []);
596
596
  k(this, "initial_point", null);
597
- k(this, "getPartAtLength", _((e) => {
597
+ k(this, "getPartAtLength", O((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
- k(this, "getTotalLength", _(() => this.length, "getTotalLength"));
604
- k(this, "getPointAtLength", _((e) => {
603
+ k(this, "getTotalLength", O(() => this.length, "getTotalLength"));
604
+ k(this, "getPointAtLength", O((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
- k(this, "getTangentAtLength", _((e) => {
610
+ k(this, "getTangentAtLength", O((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
- k(this, "getPropertiesAtLength", _((e) => {
616
+ k(this, "getPropertiesAtLength", O((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
- k(this, "getParts", _(() => {
622
+ k(this, "getParts", O(() => {
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,7 +628,7 @@ var G0 = _((n, e, t) => {
628
628
  }
629
629
  return e;
630
630
  }, "getParts"));
631
- const t = Array.isArray(e) ? e : Jt(e);
631
+ const t = Array.isArray(e) ? e : ce(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] });
@@ -640,87 +640,87 @@ var G0 = _((n, e, t) => {
640
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
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
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]));
643
+ else if (t[r][0] === "C") o = new ct(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 ct(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 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]);
649
+ o = new ct(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 c0(i[0], i[1], i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4]);
651
+ } else o = new ct(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
- const h = o.getC(), c = o.getD();
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]);
656
+ const h = o.getC(), u = o.getD();
657
+ o = new ct(i[0], i[1], i[0] + u.x - h.x, i[1] + u.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 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]);
659
+ } else o = new ct(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
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 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);
665
+ } else o = new ct(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 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);
668
+ if (t[r][1] !== 0 || t[r][2] !== 0) o = new ct(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
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 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();
675
+ if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new ct(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
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 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);
682
+ if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new ct(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
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]];
688
688
  } else if (t[r][0] === "A") {
689
- const h = new at(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, t[r][6], t[r][7]);
689
+ const h = new u0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, t[r][6], t[r][7]);
690
690
  this.length += h.getTotalLength(), i = [t[r][6], t[r][7]], this.functions.push(h);
691
691
  } else if (t[r][0] === "a") {
692
- const h = new at(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, i[0] + t[r][6], i[1] + t[r][7]);
692
+ const h = new u0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, i[0] + t[r][6], i[1] + t[r][7]);
693
693
  this.length += h.getTotalLength(), i = [i[0] + t[r][6], i[1] + t[r][7]], this.functions.push(h);
694
694
  }
695
695
  this.partial_lengths.push(this.length);
696
696
  }
697
697
  }
698
- }, _(b0, "SVGPathProperties"), b0), M0, W0 = (M0 = class {
698
+ }, O(At, "SVGPathProperties"), At), Mt, Kt = (Mt = class {
699
699
  constructor(e) {
700
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 ge(e), !(this instanceof W0)) return new W0(e);
707
- }
708
- }, _(M0, "_svgPathProperties"), M0);
709
- function pe(n = $.BLACK) {
701
+ k(this, "getTotalLength", O(() => this.inst.getTotalLength(), "getTotalLength"));
702
+ k(this, "getPointAtLength", O((e) => this.inst.getPointAtLength(e), "getPointAtLength"));
703
+ k(this, "getTangentAtLength", O((e) => this.inst.getTangentAtLength(e), "getTangentAtLength"));
704
+ k(this, "getPropertiesAtLength", O((e) => this.inst.getPropertiesAtLength(e), "getPropertiesAtLength"));
705
+ k(this, "getParts", O(() => this.inst.getParts(), "getParts"));
706
+ if (this.inst = new Le(e), !(this instanceof Kt)) return new Kt(e);
707
+ }
708
+ }, O(Mt, "_svgPathProperties"), Mt);
709
+ function Te(n = G.BLACK) {
710
710
  return { ...n, alpha: 0 };
711
711
  }
712
- function Pn(n = null) {
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 l0({
712
+ function Bn(n = null) {
713
+ const { path: e, height: t = 100, width: o = 100, viewboxHeight: i, viewboxWidth: a, ...s } = n ?? {}, r = e ?? "M 0 0 L 100 100", u = new Kt(r).getTotalLength();
714
+ return lt({
715
715
  objectType: U.PATH,
716
- anchor: h0,
716
+ anchor: ht,
717
717
  strokeColor: Q,
718
718
  drawn: 1,
719
- fillColor: pe(),
719
+ fillColor: Te(),
720
720
  isRounded: !1,
721
721
  height: t,
722
722
  path: r,
723
- pathLength: c,
723
+ pathLength: u,
724
724
  strokeWidth: 4,
725
725
  viewboxHeight: i ?? t,
726
726
  viewboxWidth: a ?? o,
@@ -730,8 +730,8 @@ function Pn(n = null) {
730
730
  ...s
731
731
  });
732
732
  }
733
- function Cn(n = null) {
734
- return l0({
733
+ function Dn(n = null) {
734
+ return lt({
735
735
  objectType: U.POLYGON,
736
736
  strokeColor: Q,
737
737
  strokeWidth: 0,
@@ -745,10 +745,10 @@ function Cn(n = null) {
745
745
  ...n
746
746
  });
747
747
  }
748
- function Sn(n = null) {
749
- return l0({
748
+ function qn(n = null) {
749
+ return lt({
750
750
  objectType: U.RECTANGLE,
751
- anchor: h0,
751
+ anchor: ht,
752
752
  strokeColor: Q,
753
753
  strokeWidth: 0,
754
754
  drawn: 1,
@@ -761,10 +761,10 @@ function Sn(n = null) {
761
761
  ...n
762
762
  });
763
763
  }
764
- function En(n = null) {
765
- return l0({
764
+ function zn(n = null) {
765
+ return lt({
766
766
  objectType: U.SVG,
767
- anchor: h0,
767
+ anchor: ht,
768
768
  height: 100,
769
769
  svg: "",
770
770
  width: 100,
@@ -773,11 +773,11 @@ function En(n = null) {
773
773
  ...n
774
774
  });
775
775
  }
776
- const de = {
776
+ const Ce = {
777
777
  NORMAL: "normal",
778
778
  ITALIC: "italic",
779
779
  OBLIQUE: "oblique"
780
- }, xe = de.NORMAL, ye = {
780
+ }, Pe = Ce.NORMAL, Ee = {
781
781
  THIN: 100,
782
782
  EXTRA_LIGHT: 200,
783
783
  LIGHT: 300,
@@ -787,132 +787,345 @@ const de = {
787
787
  BOLD: 700,
788
788
  EXTRA_BOLD: 800,
789
789
  BLACK: 900
790
- }, ve = ye.NORMAL, we = {
790
+ }, Se = Ee.NORMAL, ke = {
791
791
  color: Q,
792
792
  fontFamily: "sans-serif",
793
793
  fontSize: 100,
794
- fontStyle: xe,
795
- fontWeight: ve,
794
+ fontStyle: Pe,
795
+ fontWeight: Se,
796
796
  ligatures: !1,
797
797
  subscript: !1,
798
798
  superscript: !1
799
799
  };
800
- function _t(n) {
800
+ function q0(n) {
801
801
  return typeof n == "string" ? [[{ text: n }]] : n.map((e) => e.map((t) => typeof t == "string" ? { text: t } : t));
802
802
  }
803
- function me(n) {
804
- return _t(n).reduce(
803
+ function Ie(n) {
804
+ return q0(n).reduce(
805
805
  (t, o) => t + o.reduce((i, a) => i + a.text.length, 0),
806
806
  0
807
807
  );
808
808
  }
809
- function Ae(n = "", e = null) {
810
- return l0({
809
+ function _e(n = "", e = null) {
810
+ return lt({
811
811
  objectType: U.TEXT,
812
- alignment: Wt,
813
- anchor: h0,
812
+ alignment: oe,
813
+ anchor: ht,
814
814
  length: null,
815
815
  lineSpacing: 1,
816
816
  text: n,
817
817
  x: 0,
818
818
  y: 0,
819
- ...we,
819
+ ...ke,
820
820
  ...e
821
821
  });
822
822
  }
823
- Ae.writeOn = (n, e = {}) => et(
823
+ _e.writeOn = (n, e = {}) => o0(
824
824
  n,
825
825
  {
826
- length: me(n.text)
826
+ length: Ie(n.text)
827
827
  },
828
828
  e
829
829
  );
830
- let Z = null;
831
- function be({ presentation: n, onNavigateToSlide: e }) {
832
- if (Z !== null && !Z.closed) {
833
- Z.focus();
834
- return;
835
- }
836
- if (Z = window.open("", "Navigator", "width=300,height=500,left=20,top=50"), Z === null) {
837
- console.error("Failed to open navigator window.");
838
- return;
830
+ function z0(n) {
831
+ return n.altKey || n.ctrlKey || n.metaKey || n.shiftKey;
832
+ }
833
+ function d0(n) {
834
+ var o, i;
835
+ if (n === null)
836
+ return !1;
837
+ const e = n, t = (o = e.tagName) == null ? void 0 : o.toLowerCase();
838
+ return t === "input" || t === "textarea" || t === "select" || t === "button" || e.isContentEditable ? !0 : (((i = e.closest) == null ? void 0 : i.call(e, "[contenteditable=''], [contenteditable='true']")) ?? null) !== null;
839
+ }
840
+ function Oe(n) {
841
+ var o;
842
+ const { slides: e } = n, t = {
843
+ // First build of first slide
844
+ s: { slideIndex: 0, buildIndex: 0 },
845
+ // First build of current slide
846
+ c: { slideIndex: null, buildIndex: 0 },
847
+ // Last build of last slide
848
+ e: {
849
+ slideIndex: e.length - 1,
850
+ buildIndex: ((o = e[e.length - 1]) == null ? void 0 : o.animations.length) ?? 0
851
+ }
852
+ };
853
+ for (let i = 0; i < e.length; i++) {
854
+ const a = e[i];
855
+ if (a === void 0)
856
+ continue;
857
+ const s = a.shortcut;
858
+ Dt(t, s, i, 0);
859
+ for (let r = 0; r < a.animations.length; r++) {
860
+ const h = a.animations[r];
861
+ if (h !== void 0)
862
+ if (Array.isArray(h))
863
+ for (const u of h)
864
+ Dt(t, u.shortcut, i, r + 1);
865
+ else
866
+ Dt(t, h.shortcut, i, r + 1);
867
+ }
839
868
  }
840
- const t = Me(n, e);
841
- Z.document.title = n.title, Z.document.body.appendChild(t), Z.addEventListener("keyup", (o) => {
842
- (o.key === "Escape" || o.key === "`") && (Z == null || Z.close(), Z = null);
869
+ return t;
870
+ }
871
+ function Dt(n, e, t, o) {
872
+ if (e !== null)
873
+ if (Array.isArray(e))
874
+ for (const i of e)
875
+ n[i] = { slideIndex: t, buildIndex: o };
876
+ else
877
+ n[e] = { slideIndex: t, buildIndex: o };
878
+ }
879
+ function j0(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigator: s }, { focusOnPointerDown: r = !1, keyEventTarget: h = e } = {}) {
880
+ t.shortcuts = Oe(n), r && (e.hasAttribute("tabindex") || (e.tabIndex = -1), e.addEventListener("pointerdown", (u) => {
881
+ d0(u.target) || e.focus({ preventScroll: !0 });
882
+ })), e.addEventListener("mousemove", () => {
883
+ e.style.cursor = "auto";
884
+ }), h.addEventListener("keyup", (u) => {
885
+ const c = u;
886
+ if (!d0(c.target)) {
887
+ if (c.code === "Escape") {
888
+ t.textCommand = null;
889
+ return;
890
+ }
891
+ if (c.code === "ArrowRight" || c.code === "Space") {
892
+ o(c.shiftKey);
893
+ return;
894
+ }
895
+ if (c.code === "ArrowLeft") {
896
+ i(c.shiftKey);
897
+ return;
898
+ }
899
+ if (t.textCommand !== null) {
900
+ if (c.code === "Enter") {
901
+ const d = t.textCommand;
902
+ t.textCommand = null;
903
+ const l = t.shortcuts[d];
904
+ l !== void 0 ? a(l.slideIndex, l.buildIndex) : isNaN(Number(d)) || a(Number(d) - 1, 0);
905
+ return;
906
+ } else c.code === "Backspace" ? t.textCommand = t.textCommand.slice(0, -1) : t.textCommand += c.key;
907
+ return;
908
+ }
909
+ if (c.key === "g") {
910
+ t.textCommand = "";
911
+ return;
912
+ }
913
+ if (c.key === "`" && !z0(c)) {
914
+ s();
915
+ return;
916
+ }
917
+ }
843
918
  });
844
919
  }
845
- function Me(n, e) {
846
- const t = document.createElement("div");
847
- return t.style.fontFamily = "Arial, sans-serif", n.slides.forEach((o, i) => {
848
- const a = Le(o, i);
849
- a.style.cursor = "pointer", a.addEventListener("click", (s) => {
850
- s.shiftKey && (Z == null || Z.close()), e(i);
851
- }), t.appendChild(a);
852
- }), t;
853
- }
854
- function Le(n, e) {
855
- const t = document.createElement("div");
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;
920
+ let N = null, _t = null, H0 = {
921
+ width: 700,
922
+ height: 680,
923
+ left: 20,
924
+ top: 50
925
+ };
926
+ function Fe({
927
+ presentation: n,
928
+ shortcutState: e,
929
+ onNavigateToSlide: t,
930
+ onRenderSlide: o,
931
+ onNext: i,
932
+ onPrevious: a
933
+ }) {
934
+ if (N !== null && !N.closed)
935
+ return Ot(N), N.focus(), _t;
936
+ if (N = window.open("", "Navigator", De()), N === null)
937
+ return console.error("Failed to open navigator window."), null;
938
+ const s = Ne(n, t, i);
939
+ return _t = s, N.document.title = n.title, N.document.body.replaceChildren(s.element), j0(
940
+ n,
941
+ s.element,
942
+ e,
943
+ {
944
+ onNext: (r) => i(r),
945
+ onPrevious: a,
946
+ onRenderSlide: o,
947
+ onShowNavigator: () => Qt()
948
+ },
949
+ {
950
+ keyEventTarget: N
951
+ }
952
+ ), N.addEventListener("resize", () => Ot(N)), N.addEventListener("beforeunload", () => {
953
+ Ot(N);
954
+ }), N.addEventListener("keyup", (r) => {
955
+ (r.key === "Escape" || r.key === "`" && !z0(r)) && Qt();
956
+ }), _t;
957
+ }
958
+ function Ne(n, e, t) {
959
+ const o = (N == null ? void 0 : N.document) ?? document, i = o.createElement("div");
960
+ i.style.boxSizing = "border-box", i.style.display = "grid", i.style.gridTemplateColumns = "260px 1fr", i.style.gap = "18px", i.style.height = "100vh", i.style.overflow = "hidden", i.style.padding = "18px", i.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', i.style.backgroundColor = "#f5f6f8", i.style.color = "#1f2937", o.body.style.margin = "0", o.body.style.overflow = "hidden";
961
+ const a = o.createElement("div");
962
+ a.style.display = "flex", a.style.flexDirection = "column", a.style.gap = "8px", a.style.minHeight = "0", a.style.overflowY = "auto", a.style.paddingRight = "4px";
963
+ const s = o.createElement("div");
964
+ s.style.display = "flex", s.style.flexDirection = "column", s.style.gap = "14px", s.style.minHeight = "0", s.style.minWidth = "0", s.style.overflow = "hidden";
965
+ const r = o.createElement("div");
966
+ r.style.display = "flex", r.style.gap = "14px", r.style.alignItems = "center", r.style.flexWrap = "wrap", r.style.fontSize = "13px", r.style.color = "#4b5563";
967
+ const h = o.createElement("div");
968
+ h.style.display = "flex", h.style.gap = "14px", h.style.flex = "1 1 auto", h.style.minHeight = "0", h.style.minWidth = "0", h.style.overflow = "hidden";
969
+ const u = x0("Current", n), c = x0("Next", n);
970
+ c.container.style.cursor = "pointer", c.container.addEventListener("click", t);
971
+ const d = n.slides.map((L, C) => {
972
+ const S = Re(L, C);
973
+ return S.style.cursor = "pointer", S.addEventListener("click", (T) => {
974
+ T.shiftKey && Qt(), e(C);
975
+ }), a.appendChild(S), S;
976
+ }), l = qt("Slides", a, !0), f = qt("Current", u.container, !0), m = qt("Next", c.container, !0), y = () => {
977
+ const L = f.input.checked && m.input.checked && E();
978
+ i.style.gridTemplateColumns = l.input.checked ? "260px 1fr" : "1fr", h.style.flexDirection = L ? "column" : "row", u.container.style.flex = "1 1 0", c.container.style.flex = "1 1 0", requestAnimationFrame(() => {
979
+ u.resize(), c.resize();
980
+ });
981
+ };
982
+ l.input.addEventListener("change", y), f.input.addEventListener("change", y), m.input.addEventListener("change", y), N == null || N.addEventListener("resize", y), r.appendChild(l.element), r.appendChild(f.element), r.appendChild(m.element), h.appendChild(u.container), h.appendChild(c.container), s.appendChild(r), s.appendChild(h), i.appendChild(a), i.appendChild(s);
983
+ function M(L, C, S, T) {
984
+ d.forEach((I, R) => {
985
+ const X = R === L;
986
+ I.style.backgroundColor = X ? "#dbeafe" : "#ffffff", I.style.borderColor = X ? "#60a5fa" : "#e5e7eb", I.style.color = X ? "#1e3a8a" : "#1f2937";
987
+ }), u.label.textContent = y0(n, L, C), c.label.textContent = y0(n, S, T), Be(d[L], a), y();
988
+ }
989
+ function E() {
990
+ const L = N;
991
+ if (L === null)
992
+ return !1;
993
+ const C = l.input.checked ? 278 : 0, S = L.innerWidth - 36 - C, T = L.innerHeight - 36 - r.offsetHeight - 14;
994
+ return S <= 0 || T <= 0 ? !1 : S / T < 1.1;
995
+ }
996
+ return {
997
+ element: i,
998
+ currentCanvas: u.canvas,
999
+ nextCanvas: c.canvas,
1000
+ currentLabel: u.label,
1001
+ nextLabel: c.label,
1002
+ isOpen: () => N !== null && !N.closed,
1003
+ update: M
1004
+ };
1005
+ }
1006
+ function Re(n, e) {
1007
+ const t = (N == null ? void 0 : N.document) ?? document, o = t.createElement("div");
1008
+ o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "10px", o.style.padding = "8px 10px", o.style.backgroundColor = "#ffffff", o.style.border = "1px solid #e5e7eb", o.style.borderRadius = "6px", o.style.boxShadow = "0 1px 2px rgba(15, 23, 42, 0.06)", o.style.fontSize = "14px", o.style.lineHeight = "1", o.style.userSelect = "none";
1009
+ const i = t.createElement("div");
1010
+ i.textContent = `${e + 1}`, i.style.minWidth = "24px", i.style.fontWeight = "700", i.style.color = "#6b7280";
1011
+ const a = t.createElement("div");
1012
+ return a.textContent = n.title.length > 0 ? n.title : `Slide ${e + 1}`, a.style.overflow = "hidden", a.style.textOverflow = "ellipsis", a.style.whiteSpace = "nowrap", o.appendChild(i), o.appendChild(a), o;
1013
+ }
1014
+ function x0(n, e) {
1015
+ var c;
1016
+ const t = (N == null ? void 0 : N.document) ?? document, o = t.createElement("div");
1017
+ o.style.display = "flex", o.style.alignItems = "center", o.style.flexDirection = "column", o.style.minHeight = "0", o.style.minWidth = "0";
1018
+ const i = t.createElement("div");
1019
+ i.textContent = n, i.style.marginBottom = "4px", i.style.fontSize = "12px", i.style.fontWeight = "700", i.style.textAlign = "center", i.style.textTransform = "uppercase", i.style.color = "#6b7280";
1020
+ const a = t.createElement("div");
1021
+ a.style.marginBottom = "6px", a.style.fontSize = "14px", a.style.fontWeight = "600", a.style.textAlign = "center";
1022
+ const s = t.createElement("div");
1023
+ s.style.flex = "1 1 auto", s.style.display = "flex", s.style.alignItems = "flex-start", s.style.justifyContent = "center", s.style.minHeight = "0", s.style.width = "100%", s.style.overflow = "hidden";
1024
+ const r = t.createElement("canvas");
1025
+ r.style.display = "block", r.style.width = "0", r.style.height = "0";
1026
+ function h() {
1027
+ const d = s.clientWidth, l = s.clientHeight;
1028
+ if (d <= 0 || l <= 0)
1029
+ return;
1030
+ const f = e.size.width / e.size.height, m = Math.min(d, l * f), y = m / f;
1031
+ r.style.width = `${m}px`, r.style.height = `${y}px`;
1032
+ }
1033
+ const u = (c = t.defaultView) == null ? void 0 : c.ResizeObserver;
1034
+ return u !== void 0 && new u(h).observe(s), N == null || N.addEventListener("resize", h), s.appendChild(r), o.appendChild(i), o.appendChild(a), o.appendChild(s), { container: o, label: a, canvas: r, resize: h };
857
1035
  }
858
- function a0(n = null) {
1036
+ function qt(n, e, t) {
1037
+ const o = (N == null ? void 0 : N.document) ?? document, i = e.style.display || "block", a = o.createElement("label");
1038
+ a.style.display = "inline-flex", a.style.alignItems = "center", a.style.gap = "6px", a.style.userSelect = "none";
1039
+ const s = o.createElement("input");
1040
+ return s.type = "checkbox", s.checked = t, s.addEventListener("change", () => {
1041
+ e.style.display = s.checked ? i : "none";
1042
+ }), a.appendChild(s), a.appendChild(o.createTextNode(n)), { element: a, input: s };
1043
+ }
1044
+ function y0(n, e, t) {
1045
+ if (e === null)
1046
+ return "End of presentation";
1047
+ const o = n.slides[e];
1048
+ return o === void 0 ? "No slide" : `Slide ${e + 1} of ${n.slides.length}, Build ${t + 1} of ${o.animations.length + 1}`;
1049
+ }
1050
+ function Be(n, e) {
1051
+ if (n === void 0)
1052
+ return;
1053
+ const t = n.offsetTop, o = t + n.offsetHeight, i = e.scrollTop, a = i + e.clientHeight;
1054
+ (t < i || o > a) && n.scrollIntoView({ block: "nearest" });
1055
+ }
1056
+ function Qt() {
1057
+ Ot(N), N == null || N.close(), N = null, _t = null;
1058
+ }
1059
+ function De() {
1060
+ const { width: n, height: e, left: t, top: o } = H0;
1061
+ return `width=${n},height=${e},left=${t},top=${o}`;
1062
+ }
1063
+ function Ot(n) {
1064
+ n === null || n.closed || (H0 = {
1065
+ width: n.outerWidth,
1066
+ height: n.outerHeight,
1067
+ left: n.screenX,
1068
+ top: n.screenY
1069
+ });
1070
+ }
1071
+ function at(n = null) {
859
1072
  return {
860
1073
  height: 0,
861
1074
  width: 0,
862
1075
  ...n
863
1076
  };
864
1077
  }
865
- const Te = a0({ width: 0, height: 0 });
866
- function Pe(n = null) {
1078
+ const qe = at({ width: 0, height: 0 });
1079
+ function ze(n = null) {
867
1080
  return {
868
- backgroundColor: $.WHITE,
1081
+ backgroundColor: G.WHITE,
869
1082
  slides: [],
870
1083
  title: "Presentation",
871
- size: a0({ width: 3840, height: 2160 }),
1084
+ size: at({ width: 3840, height: 2160 }),
872
1085
  resources: {
873
1086
  images: {}
874
1087
  },
875
1088
  ...n
876
1089
  };
877
1090
  }
878
- function Ce(n) {
1091
+ function je(n) {
879
1092
  const e = Array.isArray(n) ? n : [n];
880
1093
  let t = 0, o = 0;
881
1094
  for (const i of e)
882
1095
  switch (i.type) {
883
- case f0.PAUSE:
1096
+ case ft.PAUSE:
884
1097
  t += i.duration;
885
1098
  break;
886
- case f0.ANIMATE:
1099
+ case ft.ANIMATE:
887
1100
  o = Math.max(o, t + i.delay + i.duration), i.block && (t += i.delay + i.duration);
888
1101
  break;
889
- case f0.UPDATE:
1102
+ case ft.UPDATE:
890
1103
  break;
891
1104
  default:
892
- s0(i);
1105
+ st(i);
893
1106
  }
894
1107
  return o;
895
1108
  }
896
- function nt(n, e = null) {
897
- const { red: t, green: o, blue: i } = n, a = Et(n, e);
1109
+ function s0(n, e = null) {
1110
+ const { red: t, green: o, blue: i } = n, a = R0(n, e);
898
1111
  return `rgba(${t}, ${o}, ${i}, ${a})`;
899
1112
  }
900
- function Se(n) {
1113
+ function U0(n) {
901
1114
  return n === document.body;
902
1115
  }
903
- function Ee(n, e) {
1116
+ function He(n, e) {
904
1117
  const t = document.createElement("div");
905
- if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative", Se(e)) {
1118
+ if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative", U0(e)) {
906
1119
  t.style.top = "50%", t.style.transform = "translateY(-50%)", t.style.marginLeft = "auto", t.style.marginRight = "auto", 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";
907
1120
  const o = n.size.height / n.size.width;
908
- ut(t, o), window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change", () => ut(t, o));
1121
+ v0(t, o), window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change", () => v0(t, o));
909
1122
  }
910
1123
  return t;
911
1124
  }
912
- function ut(n, e) {
1125
+ function v0(n, e) {
913
1126
  window.innerHeight / window.innerWidth > e ? (n.style.width = "100%", n.style.height = "auto") : (n.style.width = "auto", n.style.height = "100%");
914
1127
  }
915
- const ke = {
1128
+ const Ue = {
916
1129
  check: (n) => typeof n == "object" && n !== null && typeof n.red == "number" && typeof n.green == "number" && typeof n.blue == "number" && typeof n.alpha == "number",
917
1130
  interpolate: (n, e, t) => ({
918
1131
  red: Math.round(n.red + (e.red - n.red) * t),
@@ -920,28 +1133,28 @@ const ke = {
920
1133
  blue: Math.round(n.blue + (e.blue - n.blue) * t),
921
1134
  alpha: n.alpha + (e.alpha - n.alpha) * t
922
1135
  })
923
- }, Ie = {
1136
+ }, $e = {
924
1137
  check: (n) => !0,
925
1138
  interpolate: (n, e) => e
926
- }, _e = {
1139
+ }, Ye = {
927
1140
  check: (n) => typeof n == "number",
928
1141
  interpolate: (n, e, t) => n + (e - n) * t
929
- }, ft = [
930
- _e,
931
- ke,
932
- Ie
1142
+ }, w0 = [
1143
+ Ye,
1144
+ Ue,
1145
+ $e
933
1146
  ];
934
- function Oe(n, e, t, o = null) {
1147
+ function We(n, e, t, o = null) {
935
1148
  if (t === 0)
936
1149
  return n;
937
1150
  if (t === 1)
938
1151
  return { ...n, ...e };
939
- const i = o != null ? [...o, ...ft] : ft, a = {};
1152
+ const i = o != null ? [...o, ...w0] : w0, a = {};
940
1153
  for (const s in e) {
941
1154
  const r = n[s], h = e[s];
942
- for (const c of i)
943
- if (c.check(r, s) && c.check(h, s)) {
944
- a[s] = c.interpolate(
1155
+ for (const u of i)
1156
+ if (u.check(r, s) && u.check(h, s)) {
1157
+ a[s] = u.interpolate(
945
1158
  r,
946
1159
  h,
947
1160
  t
@@ -951,7 +1164,7 @@ function Oe(n, e, t, o = null) {
951
1164
  }
952
1165
  return { ...n, ...a };
953
1166
  }
954
- function gt(n, e, t = null) {
1167
+ function m0(n, e, t = null) {
955
1168
  if (e === null)
956
1169
  return;
957
1170
  const o = Array.isArray(e) ? e : [e];
@@ -960,7 +1173,7 @@ function gt(n, e, t = null) {
960
1173
  if (t !== null && i > t)
961
1174
  break;
962
1175
  switch (a.type) {
963
- case f0.ANIMATE: {
1176
+ case ft.ANIMATE: {
964
1177
  const s = n.get(a.object);
965
1178
  if (s === void 0)
966
1179
  break;
@@ -973,7 +1186,7 @@ function gt(n, e, t = null) {
973
1186
  );
974
1187
  n.set(a.object, {
975
1188
  ...s,
976
- ...Oe(
1189
+ ...We(
977
1190
  s,
978
1191
  a.props,
979
1192
  a.easing(h),
@@ -982,7 +1195,7 @@ function gt(n, e, t = null) {
982
1195
  }), a.block && (i += a.delay + a.duration);
983
1196
  break;
984
1197
  }
985
- case f0.UPDATE: {
1198
+ case ft.UPDATE: {
986
1199
  const s = n.get(a.object);
987
1200
  if (s === void 0)
988
1201
  break;
@@ -992,18 +1205,18 @@ function gt(n, e, t = null) {
992
1205
  });
993
1206
  break;
994
1207
  }
995
- case f0.PAUSE:
1208
+ case ft.PAUSE:
996
1209
  i += a.duration;
997
1210
  break;
998
1211
  default:
999
- s0(a);
1212
+ st(a);
1000
1213
  }
1001
1214
  }
1002
1215
  }
1003
- function Ot(n) {
1216
+ function $0(n) {
1004
1217
  return "objects" in n ? n.objects.filter((e) => "objectType" in e) : [];
1005
1218
  }
1006
- function Fe({
1219
+ function Xe({
1007
1220
  slide: n,
1008
1221
  buildIndex: e,
1009
1222
  buildTime: t
@@ -1011,7 +1224,7 @@ function Fe({
1011
1224
  const o = /* @__PURE__ */ new Map();
1012
1225
  function i(s) {
1013
1226
  o.set(s, s);
1014
- for (const r of Ot(s))
1227
+ for (const r of $0(s))
1015
1228
  i(r);
1016
1229
  }
1017
1230
  for (const s of n.objects)
@@ -1019,22 +1232,22 @@ function Fe({
1019
1232
  const a = t === null ? e : e - 1;
1020
1233
  for (let s = 0; s < a; s++) {
1021
1234
  const r = n.animations[s] ?? null;
1022
- gt(o, r);
1235
+ m0(o, r);
1023
1236
  }
1024
1237
  if (t !== null && e > 0) {
1025
1238
  const s = n.animations[e - 1] ?? null;
1026
- gt(o, s, t);
1239
+ m0(o, s, t);
1027
1240
  }
1028
1241
  return o;
1029
1242
  }
1030
- function Re(n) {
1243
+ function Ge(n) {
1031
1244
  const e = {};
1032
1245
  function t(o) {
1033
1246
  if (o.objectType === U.SVG) {
1034
1247
  const a = o.svg;
1035
1248
  a !== void 0 && a.length > 0 && (e[a] = a);
1036
1249
  }
1037
- const i = Ot(o);
1250
+ const i = $0(o);
1038
1251
  for (const a of i)
1039
1252
  t(a);
1040
1253
  }
@@ -1043,113 +1256,38 @@ function Re(n) {
1043
1256
  t(i);
1044
1257
  return e;
1045
1258
  }
1046
- function Ne(n) {
1047
- var o;
1048
- const { slides: e } = n, t = {
1049
- // First build of first slide
1050
- s: { slideIndex: 0, buildIndex: 0 },
1051
- // First build of current slide
1052
- c: { slideIndex: null, buildIndex: 0 },
1053
- // Last build of last slide
1054
- e: {
1055
- slideIndex: e.length - 1,
1056
- buildIndex: ((o = e[e.length - 1]) == null ? void 0 : o.animations.length) ?? 0
1057
- }
1058
- };
1059
- for (let i = 0; i < e.length; i++) {
1060
- const a = e[i];
1061
- if (a === void 0)
1062
- continue;
1063
- const s = a.shortcut;
1064
- N0(t, s, i, 0);
1065
- for (let r = 0; r < a.animations.length; r++) {
1066
- const h = a.animations[r];
1067
- if (h !== void 0)
1068
- if (Array.isArray(h))
1069
- for (const c of h)
1070
- N0(t, c.shortcut, i, r + 1);
1071
- else
1072
- N0(t, h.shortcut, i, r + 1);
1073
- }
1074
- }
1075
- return t;
1076
- }
1077
- function N0(n, e, t, o) {
1078
- if (e !== null)
1079
- if (Array.isArray(e))
1080
- for (const i of e)
1081
- n[i] = { slideIndex: t, buildIndex: o };
1082
- else
1083
- n[e] = { slideIndex: t, buildIndex: o };
1084
- }
1085
- function Be(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigator: s }) {
1086
- t.shortcuts = Ne(n), e.addEventListener("mousemove", () => {
1087
- e.style.cursor = "auto";
1088
- }), e.addEventListener("keyup", (r) => {
1089
- if (r.code === "Escape") {
1090
- t.textCommand = null;
1091
- return;
1092
- }
1093
- if (r.code === "ArrowRight" || r.code === "Space") {
1094
- o(r.shiftKey);
1095
- return;
1096
- }
1097
- if (r.code === "ArrowLeft") {
1098
- i(r.shiftKey);
1099
- return;
1100
- }
1101
- if (t.textCommand !== null) {
1102
- if (r.code === "Enter") {
1103
- const h = t.textCommand;
1104
- t.textCommand = null;
1105
- const c = t.shortcuts[h];
1106
- c !== void 0 ? a(c.slideIndex, c.buildIndex) : isNaN(Number(h)) || a(Number(h) - 1, 0);
1107
- return;
1108
- } else r.code === "Backspace" ? t.textCommand = t.textCommand.slice(0, -1) : t.textCommand += r.key;
1109
- return;
1110
- }
1111
- if (r.key === "g") {
1112
- t.textCommand = "";
1113
- return;
1114
- }
1115
- if (r.key === "`") {
1116
- s();
1117
- return;
1118
- }
1119
- });
1120
- }
1121
- const d0 = "presenterState";
1122
- function qe(n, e) {
1123
- const t = localStorage.getItem(d0);
1259
+ const dt = "presenterState";
1260
+ function Ze(n, e) {
1261
+ const t = localStorage.getItem(dt);
1124
1262
  if (t === null)
1125
1263
  return null;
1126
1264
  if (e === null)
1127
- return localStorage.removeItem(d0), null;
1265
+ return localStorage.removeItem(dt), null;
1128
1266
  let o;
1129
1267
  try {
1130
1268
  o = JSON.parse(t);
1131
- } catch (c) {
1132
- return console.error("Failed to parse presentation state from localStorage:", c), localStorage.removeItem(d0), null;
1269
+ } catch (u) {
1270
+ return console.error("Failed to parse presentation state from localStorage:", u), localStorage.removeItem(dt), null;
1133
1271
  }
1134
1272
  const { title: i, timestamp: a } = o;
1135
1273
  let { slideIndex: s, buildIndex: r } = o;
1136
1274
  if (typeof i != "string" || typeof s != "number" || typeof r != "number" || typeof a != "number" || i !== n.title || Date.now() - a > 1e3 * 60 * e)
1137
- return localStorage.removeItem(d0), null;
1275
+ return localStorage.removeItem(dt), null;
1138
1276
  s > n.slides.length - 1 && (s = n.slides.length - 1, r = 0);
1139
1277
  const h = n.slides[s];
1140
- return h === void 0 ? (localStorage.removeItem(d0), null) : (r > h.animations.length && (r = h.animations.length), {
1278
+ return h === void 0 ? (localStorage.removeItem(dt), null) : (r > h.animations.length && (r = h.animations.length), {
1141
1279
  title: i,
1142
1280
  slideIndex: s,
1143
1281
  buildIndex: r
1144
1282
  });
1145
1283
  }
1146
- function De({ title: n, slideIndex: e, buildIndex: t }) {
1284
+ function Ve({ title: n, slideIndex: e, buildIndex: t }) {
1147
1285
  localStorage.setItem(
1148
- d0,
1286
+ dt,
1149
1287
  JSON.stringify({ title: n, slideIndex: e, buildIndex: t, timestamp: Date.now() })
1150
1288
  );
1151
1289
  }
1152
- const pt = Object.freeze({
1290
+ const b0 = Object.freeze({
1153
1291
  canvas: null,
1154
1292
  extrasContainer: null,
1155
1293
  mountedExtrasCleanups: [],
@@ -1166,45 +1304,45 @@ const pt = Object.freeze({
1166
1304
  Browser: "browser",
1167
1305
  Node: "node"
1168
1306
  };
1169
- function je(n, e) {
1307
+ function Ke(n, e) {
1170
1308
  e.context.clearRect(0, 0, n.width, n.height);
1171
1309
  }
1172
- function ze(n) {
1310
+ function Qe(n) {
1173
1311
  const e = document.createElement("canvas");
1174
1312
  return e.setAttribute("width", n.width.toString()), e.setAttribute("height", n.height.toString()), e.style.position = "absolute", e.style.width = "100%", e;
1175
1313
  }
1176
- const g0 = {
1314
+ const gt = {
1177
1315
  Browser: "browser",
1178
1316
  Node: "node"
1179
1317
  };
1180
- function Ue(n) {
1318
+ function Je(n) {
1181
1319
  const e = new Path2D(n);
1182
1320
  return {
1183
- type: g0.Browser,
1321
+ type: gt.Browser,
1184
1322
  path: e
1185
1323
  };
1186
1324
  }
1187
- function Ye(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)
1325
+ function t1(n) {
1326
+ const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: h } = n, u = { x: t, y: o }, c = { x: i, y: a }, d = Math.atan2(c.y - u.y, c.x - u.x), l = { x: u.x + (c.x - u.x) / 2, y: u.y + (c.y - u.y) / 2 }, f = c.x - u.x, m = c.y - u.y, M = Math.hypot(f, m) * e, E = Math.cos(d), L = Math.sin(d), C = h ? { x: l.x - E * M / 2, y: l.y - L * M / 2 } : u, S = h ? { x: l.x + E * M / 2, y: l.y + L * M / 2 } : { x: u.x + E * M, y: u.y + L * M }, T = r ? Math.PI / 6 : Math.PI / 4.5, I = M < s * 2 ? M / 2 : s, R = {
1327
+ x: S.x - I * Math.cos(d - T),
1328
+ y: S.y - I * Math.sin(d - T)
1329
+ }, X = {
1330
+ x: S.x - I * Math.cos(d + T),
1331
+ y: S.y - I * Math.sin(d + T)
1197
1332
  }, H = {
1198
- x: P.x + O * Math.cos(d + C),
1199
- y: P.y + O * Math.sin(d + C)
1333
+ x: C.x + I * Math.cos(d - T),
1334
+ y: C.y + I * Math.sin(d - T)
1335
+ }, Y = {
1336
+ x: C.x + I * Math.cos(d + T),
1337
+ y: C.y + I * Math.sin(d + T)
1200
1338
  };
1201
1339
  return {
1202
- arrowPoints: [P, E],
1203
- arrowheadPoints: [R, E, G],
1204
- doubledArrowheadPoints: [z, P, H]
1340
+ arrowPoints: [C, S],
1341
+ arrowheadPoints: [R, S, X],
1342
+ doubledArrowheadPoints: [H, C, Y]
1205
1343
  };
1206
1344
  }
1207
- function y0({
1345
+ function yt({
1208
1346
  ctx: n,
1209
1347
  color: e,
1210
1348
  drawn: t = null,
@@ -1217,48 +1355,48 @@ function y0({
1217
1355
  }) {
1218
1356
  if (!(h === 0 || t === 0)) {
1219
1357
  if (t !== null && r !== null && t !== 1) {
1220
- const c = r + (i ? h : 0), f = r * t;
1358
+ const u = r + (i ? h : 0), c = r * t;
1221
1359
  o ? n.context.setLineDash([
1222
1360
  0,
1223
- (c - f) / 2,
1224
- f,
1225
- (c - f) / 2
1226
- ]) : n.context.setLineDash([f, c - f]);
1361
+ (u - c) / 2,
1362
+ c,
1363
+ (u - c) / 2
1364
+ ]) : n.context.setLineDash([c, u - c]);
1227
1365
  } else
1228
1366
  n.context.setLineDash([]);
1229
- if (n.context.lineWidth = h, n.context.strokeStyle = S0(e, a), n.context.lineCap = i ? "round" : "butt", s === void 0) {
1367
+ if (n.context.lineWidth = h, n.context.strokeStyle = Et(e, a), n.context.lineCap = i ? "round" : "butt", s === void 0) {
1230
1368
  n.context.stroke();
1231
1369
  return;
1232
1370
  }
1233
1371
  switch (n.type) {
1234
1372
  case V.Browser:
1235
- s.type === g0.Browser ? n.context.stroke(s.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1373
+ s.type === gt.Browser ? n.context.stroke(s.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1236
1374
  break;
1237
1375
  case V.Node:
1238
- s.type === g0.Node ? n.context.stroke(s.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1376
+ s.type === gt.Node ? n.context.stroke(s.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1239
1377
  break;
1240
1378
  default:
1241
- s0(n);
1379
+ st(n);
1242
1380
  }
1243
1381
  }
1244
1382
  }
1245
- function v0({ ctx: n, path: e, color: t, opacity: o = null }) {
1246
- if (n.context.fillStyle = nt(t, o), e === void 0) {
1383
+ function vt({ ctx: n, path: e, color: t, opacity: o = null }) {
1384
+ if (n.context.fillStyle = s0(t, o), e === void 0) {
1247
1385
  n.context.fill();
1248
1386
  return;
1249
1387
  }
1250
1388
  switch (n.type) {
1251
1389
  case V.Browser:
1252
- e.type === g0.Browser ? n.context.fill(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1390
+ e.type === gt.Browser ? n.context.fill(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1253
1391
  break;
1254
1392
  case V.Node:
1255
- e.type === g0.Node ? n.context.fill(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1393
+ e.type === gt.Node ? n.context.fill(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1256
1394
  break;
1257
1395
  default:
1258
- s0(n);
1396
+ st(n);
1259
1397
  }
1260
1398
  }
1261
- function B0(n, e) {
1399
+ function zt(n, e) {
1262
1400
  const t = e(), o = n[0];
1263
1401
  if (o === void 0)
1264
1402
  return { path: t, length: 0 };
@@ -1268,12 +1406,12 @@ function B0(n, e) {
1268
1406
  const s = n[a], r = n[a - 1];
1269
1407
  if (s === void 0 || r === void 0)
1270
1408
  continue;
1271
- const h = s.x - r.x, c = s.y - r.y;
1272
- i += Math.hypot(h, c), t.path.lineTo(s.x, s.y);
1409
+ const h = s.x - r.x, u = s.y - r.y;
1410
+ i += Math.hypot(h, u), t.path.lineTo(s.x, s.y);
1273
1411
  }
1274
1412
  return { path: t, length: i };
1275
1413
  }
1276
- const He = ({
1414
+ const e1 = ({
1277
1415
  ctx: n,
1278
1416
  object: e,
1279
1417
  opacity: t,
@@ -1282,69 +1420,69 @@ const He = ({
1282
1420
  const i = e.opacity * t;
1283
1421
  if (i === 0 || e.drawn === 0)
1284
1422
  return;
1285
- const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } = Ye(e), { path: h } = B0(a, o), { path: c } = B0(s, o);
1286
- if (y0({
1423
+ const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } = t1(e), { path: h } = zt(a, o), { path: u } = zt(s, o);
1424
+ if (yt({
1287
1425
  color: e.color,
1288
1426
  ctx: n,
1289
1427
  path: h,
1290
1428
  opacity: i,
1291
1429
  width: e.width
1292
- }), e.isArrowheadFilled && (c.path.closePath(), v0({
1430
+ }), e.isArrowheadFilled && (u.path.closePath(), vt({
1293
1431
  ctx: n,
1294
- path: c,
1432
+ path: u,
1295
1433
  color: e.color,
1296
1434
  opacity: i
1297
- })), y0({
1435
+ })), yt({
1298
1436
  color: e.color,
1299
1437
  ctx: n,
1300
- path: c,
1438
+ path: u,
1301
1439
  opacity: i,
1302
1440
  width: e.width
1303
1441
  }), e.isArrowheadDoubled) {
1304
- const { path: f } = B0(
1442
+ const { path: c } = zt(
1305
1443
  r,
1306
1444
  o
1307
1445
  );
1308
- e.isArrowheadFilled && (f.path.closePath(), v0({
1446
+ e.isArrowheadFilled && (c.path.closePath(), vt({
1309
1447
  ctx: n,
1310
- path: f,
1448
+ path: c,
1311
1449
  color: e.color,
1312
1450
  opacity: i
1313
- })), y0({
1451
+ })), yt({
1314
1452
  color: e.color,
1315
1453
  ctx: n,
1316
- path: f,
1454
+ path: c,
1317
1455
  opacity: i,
1318
1456
  width: e.width
1319
1457
  });
1320
1458
  }
1321
1459
  };
1322
- function Xe(n, e) {
1460
+ function n1(n, e) {
1323
1461
  const t = n.radius - n.strokeWidth / 2;
1324
1462
  if (t <= 0)
1325
1463
  return;
1326
1464
  const o = e(), i = -Math.PI / 2;
1327
1465
  return o.path.arc(n.x, n.y, t, i, i + 2 * Math.PI), o;
1328
1466
  }
1329
- function $e(n, e) {
1467
+ function r1(n, e) {
1330
1468
  const t = e(), o = -Math.PI / 2;
1331
1469
  t.path.arc(n.x, n.y, n.radius, o, o + 2 * Math.PI);
1332
1470
  const i = 2 * Math.PI * n.radius;
1333
1471
  return { path: t, length: i };
1334
1472
  }
1335
- function Ft(n, e) {
1473
+ function Y0(n, e) {
1336
1474
  switch (n.type) {
1337
1475
  case V.Browser:
1338
- e.type === g0.Browser ? n.context.clip(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1476
+ e.type === gt.Browser ? n.context.clip(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1339
1477
  break;
1340
1478
  case V.Node:
1341
- e.type === g0.Node ? n.context.clip(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1479
+ e.type === gt.Node ? n.context.clip(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1342
1480
  break;
1343
1481
  default:
1344
- s0(n);
1482
+ st(n);
1345
1483
  }
1346
1484
  }
1347
- const Ge = ({
1485
+ const i1 = ({
1348
1486
  ctx: n,
1349
1487
  object: e,
1350
1488
  opacity: t,
@@ -1353,13 +1491,13 @@ const Ge = ({
1353
1491
  const i = e.opacity * t;
1354
1492
  if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
1355
1493
  return;
1356
- const { path: a, length: s } = $e(e, o);
1494
+ const { path: a, length: s } = r1(e, o);
1357
1495
  if (i < 1 && e.strokeWidth > 0) {
1358
- const r = Xe(e, o);
1359
- r !== void 0 && (n.context.save(), Ft(n, r), v0({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
1496
+ const r = n1(e, o);
1497
+ r !== void 0 && (n.context.save(), Y0(n, r), vt({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
1360
1498
  } else
1361
- v0({ ctx: n, path: a, color: e.fillColor, opacity: i });
1362
- y0({
1499
+ vt({ ctx: n, path: a, color: e.fillColor, opacity: i });
1500
+ yt({
1363
1501
  color: e.strokeColor,
1364
1502
  ctx: n,
1365
1503
  drawn: e.drawn,
@@ -1369,103 +1507,103 @@ const Ge = ({
1369
1507
  width: e.strokeWidth
1370
1508
  });
1371
1509
  };
1372
- function X(n = null) {
1510
+ function W(n = null) {
1373
1511
  return {
1374
1512
  x: 0,
1375
1513
  y: 0,
1376
1514
  ...n
1377
1515
  };
1378
1516
  }
1379
- const We = X();
1380
- function u0(n = null) {
1517
+ const o1 = W();
1518
+ function ut(n = null) {
1381
1519
  return {
1382
- origin: We,
1383
- size: Te,
1520
+ origin: o1,
1521
+ size: qe,
1384
1522
  ...n
1385
1523
  };
1386
1524
  }
1387
- u0();
1388
- function p0(n, e, t) {
1525
+ ut();
1526
+ function pt(n, e, t) {
1389
1527
  const { x: o, y: i } = n, { width: a, height: s } = t;
1390
1528
  switch (e) {
1391
- case o0.TOP_LEFT:
1392
- return u0({
1393
- origin: X({ x: o, y: i }),
1529
+ case ot.TOP_LEFT:
1530
+ return ut({
1531
+ origin: W({ x: o, y: i }),
1394
1532
  size: t
1395
1533
  });
1396
- case o0.TOP:
1397
- return u0({
1398
- origin: X({ x: o - a / 2, y: i }),
1534
+ case ot.TOP:
1535
+ return ut({
1536
+ origin: W({ x: o - a / 2, y: i }),
1399
1537
  size: t
1400
1538
  });
1401
- case o0.TOP_RIGHT:
1402
- return u0({
1403
- origin: X({ x: o - a, y: i }),
1539
+ case ot.TOP_RIGHT:
1540
+ return ut({
1541
+ origin: W({ x: o - a, y: i }),
1404
1542
  size: t
1405
1543
  });
1406
- case o0.LEFT:
1407
- return u0({
1408
- origin: X({ x: o, y: i - s / 2 }),
1544
+ case ot.LEFT:
1545
+ return ut({
1546
+ origin: W({ x: o, y: i - s / 2 }),
1409
1547
  size: t
1410
1548
  });
1411
- case o0.CENTER:
1412
- return u0({
1413
- origin: X({ x: o - a / 2, y: i - s / 2 }),
1549
+ case ot.CENTER:
1550
+ return ut({
1551
+ origin: W({ x: o - a / 2, y: i - s / 2 }),
1414
1552
  size: t
1415
1553
  });
1416
- case o0.RIGHT:
1417
- return u0({
1418
- origin: X({ x: o - a, y: i - s / 2 }),
1554
+ case ot.RIGHT:
1555
+ return ut({
1556
+ origin: W({ x: o - a, y: i - s / 2 }),
1419
1557
  size: t
1420
1558
  });
1421
- case o0.BOTTOM_LEFT:
1422
- return u0({
1423
- origin: X({ x: o, y: i - s }),
1559
+ case ot.BOTTOM_LEFT:
1560
+ return ut({
1561
+ origin: W({ x: o, y: i - s }),
1424
1562
  size: t
1425
1563
  });
1426
- case o0.BOTTOM:
1427
- return u0({
1428
- origin: X({ x: o - a / 2, y: i - s }),
1564
+ case ot.BOTTOM:
1565
+ return ut({
1566
+ origin: W({ x: o - a / 2, y: i - s }),
1429
1567
  size: t
1430
1568
  });
1431
- case o0.BOTTOM_RIGHT:
1432
- return u0({
1433
- origin: X({ x: o - a, y: i - s }),
1569
+ case ot.BOTTOM_RIGHT:
1570
+ return ut({
1571
+ origin: W({ x: o - a, y: i - s }),
1434
1572
  size: t
1435
1573
  });
1436
1574
  default:
1437
- s0(e);
1575
+ st(e);
1438
1576
  }
1439
1577
  }
1440
- const Ze = ({
1578
+ const s1 = ({
1441
1579
  ctx: n,
1442
1580
  object: e,
1443
1581
  renderObject: t,
1444
1582
  opacity: o
1445
1583
  }) => {
1446
- const i = e.scale * e.scaleX, a = e.scale * e.scaleY, s = p0(
1447
- X({ x: e.x, y: e.y }),
1584
+ const i = e.scale * e.scaleX, a = e.scale * e.scaleY, s = pt(
1585
+ W({ x: e.x, y: e.y }),
1448
1586
  e.anchor,
1449
- a0({
1587
+ at({
1450
1588
  width: e.width * Math.abs(i),
1451
1589
  height: e.height * Math.abs(a)
1452
1590
  })
1453
- ), { rotation: r, rotateOriginX: h, rotateOriginY: c, skewOriginX: f, skewOriginY: d, skewX: l, skewY: u } = e;
1591
+ ), { rotation: r, rotateOriginX: h, rotateOriginY: u, skewOriginX: c, skewOriginY: d, skewX: l, skewY: f } = e;
1454
1592
  if (!(i === 0 || a === 0)) {
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(
1593
+ n.context.save(), n.context.translate(s.origin.x, s.origin.y), n.context.scale(i, a), n.context.translate(h, u), n.context.rotate(r * Math.PI / 180), n.context.translate(-h, -u), n.context.translate(c, d), n.context.transform(
1456
1594
  1,
1457
- Math.tan(u * Math.PI / 180),
1595
+ Math.tan(f * Math.PI / 180),
1458
1596
  Math.tan(l * Math.PI / 180),
1459
1597
  1,
1460
1598
  0,
1461
1599
  0
1462
- ), n.context.translate(-f, -d);
1600
+ ), n.context.translate(-c, -d);
1463
1601
  for (const m of e.objects)
1464
1602
  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();
1603
+ e.previewColor !== null && (n.context.fillStyle = Et(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, u, e.rotateOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), e.skewOriginPreviewSize > 0 && (n.context.fillStyle = "blue", n.context.beginPath(), n.context.arc(c, d, e.skewOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), n.context.restore();
1466
1604
  }
1467
1605
  };
1468
- function rt(n, e, t, o, i = 0) {
1606
+ function a0(n, e, t, o, i = 0) {
1469
1607
  const a = o();
1470
1608
  a.path.moveTo(n.x + t, n.y), a.path.lineTo(n.x + e.width - t, n.y), a.path.arcTo(
1471
1609
  n.x + e.width,
@@ -1489,24 +1627,24 @@ function rt(n, e, t, o, i = 0) {
1489
1627
  const s = 2 * (e.width + e.height - 4 * t) + 2 * Math.PI * t + i;
1490
1628
  return { path: a, length: s };
1491
1629
  }
1492
- const E0 = {
1630
+ const St = {
1493
1631
  Browser: "browser",
1494
1632
  Node: "node"
1495
- }, Ve = ({
1633
+ }, a1 = ({
1496
1634
  ctx: n,
1497
1635
  imageById: e,
1498
1636
  object: t,
1499
1637
  opacity: o,
1500
1638
  createPath2D: i
1501
1639
  }) => {
1502
- const a = p0(
1503
- X({ x: t.x, y: t.y }),
1640
+ const a = pt(
1641
+ W({ x: t.x, y: t.y }),
1504
1642
  t.anchor,
1505
- a0({ width: t.width, height: t.height })
1643
+ at({ width: t.width, height: t.height })
1506
1644
  ), s = e[t.imageId];
1507
1645
  if (s !== void 0) {
1508
1646
  if (n.context.save(), t.cornerRadius > 0) {
1509
- const r = rt(
1647
+ const r = a0(
1510
1648
  a.origin,
1511
1649
  a.size,
1512
1650
  t.cornerRadius,
@@ -1514,18 +1652,18 @@ const E0 = {
1514
1652
  );
1515
1653
  switch (n.type) {
1516
1654
  case V.Browser:
1517
- r.path.type === g0.Browser ? n.context.clip(r.path.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1655
+ r.path.type === gt.Browser ? n.context.clip(r.path.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1518
1656
  break;
1519
1657
  case V.Node:
1520
- r.path.type === g0.Node ? n.context.clip(r.path.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1658
+ r.path.type === gt.Node ? n.context.clip(r.path.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1521
1659
  break;
1522
1660
  default:
1523
- s0(n);
1661
+ st(n);
1524
1662
  }
1525
1663
  }
1526
1664
  switch (n.context.globalAlpha = o * t.opacity, n.context.imageSmoothingEnabled = t.smooth, n.type) {
1527
1665
  case V.Browser:
1528
- s.type === E0.Browser ? n.context.drawImage(
1666
+ s.type === St.Browser ? n.context.drawImage(
1529
1667
  s.image,
1530
1668
  a.origin.x,
1531
1669
  a.origin.y,
@@ -1534,7 +1672,7 @@ const E0 = {
1534
1672
  ) : console.warn("Attempted to use Node Image in Browser Canvas context");
1535
1673
  break;
1536
1674
  case V.Node:
1537
- s.type === E0.Node ? n.context.drawImage(
1675
+ s.type === St.Node ? n.context.drawImage(
1538
1676
  s.image,
1539
1677
  a.origin.x,
1540
1678
  a.origin.y,
@@ -1543,18 +1681,18 @@ const E0 = {
1543
1681
  ) : console.warn("Attempted to use Browser Image in Node Canvas context");
1544
1682
  break;
1545
1683
  default:
1546
- s0(n);
1684
+ st(n);
1547
1685
  }
1548
1686
  n.context.restore();
1549
1687
  }
1550
1688
  };
1551
- function Ke(n, e) {
1689
+ function h1(n, e) {
1552
1690
  const t = e();
1553
1691
  t.path.moveTo(n.startX, n.startY), t.path.lineTo(n.endX, n.endY);
1554
1692
  const o = Math.hypot(n.endX - n.startX, n.endY - n.startY);
1555
1693
  return { path: t, length: o };
1556
1694
  }
1557
- const Qe = ({
1695
+ const l1 = ({
1558
1696
  ctx: n,
1559
1697
  object: e,
1560
1698
  opacity: t,
@@ -1563,8 +1701,8 @@ const Qe = ({
1563
1701
  const i = e.opacity * t;
1564
1702
  if (i === 0 || e.drawn === 0)
1565
1703
  return;
1566
- const { path: a, length: s } = Ke(e, o);
1567
- y0({
1704
+ const { path: a, length: s } = h1(e, o);
1705
+ yt({
1568
1706
  color: e.color,
1569
1707
  ctx: n,
1570
1708
  drawn: e.drawn,
@@ -1575,23 +1713,23 @@ const Qe = ({
1575
1713
  opacity: i,
1576
1714
  width: e.width
1577
1715
  });
1578
- }, Je = ({
1716
+ }, c1 = ({
1579
1717
  ctx: n,
1580
1718
  object: e,
1581
1719
  opacity: t,
1582
1720
  renderObject: o
1583
1721
  }) => {
1584
1722
  n.context.save();
1585
- const i = p0(
1586
- X({ x: e.x, y: e.y }),
1723
+ const i = pt(
1724
+ W({ x: e.x, y: e.y }),
1587
1725
  e.anchor,
1588
- a0({ width: e.width, height: e.height })
1726
+ at({ width: e.width, height: e.height })
1589
1727
  );
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();
1728
+ e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = Et(G.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();
1591
1729
  for (const a of e.objects)
1592
1730
  o(a, t * e.opacity);
1593
1731
  n.context.restore();
1594
- }, t1 = ({
1732
+ }, u1 = ({
1595
1733
  ctx: n,
1596
1734
  object: e,
1597
1735
  opacity: t,
@@ -1600,17 +1738,17 @@ const Qe = ({
1600
1738
  const i = e.opacity * t;
1601
1739
  if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
1602
1740
  return;
1603
- const { origin: a } = p0(
1604
- X({ x: e.x, y: e.y }),
1741
+ const { origin: a } = pt(
1742
+ W({ x: e.x, y: e.y }),
1605
1743
  e.anchor,
1606
- a0({ width: e.width, height: e.height })
1744
+ at({ width: e.width, height: e.height })
1607
1745
  ), s = o(e.path);
1608
- n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight), v0({
1746
+ n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight), vt({
1609
1747
  ctx: n,
1610
1748
  path: s,
1611
1749
  color: e.fillColor,
1612
1750
  opacity: i
1613
- }), y0({
1751
+ }), yt({
1614
1752
  color: e.strokeColor,
1615
1753
  ctx: n,
1616
1754
  drawn: e.drawn,
@@ -1621,19 +1759,19 @@ const Qe = ({
1621
1759
  width: e.strokeWidth
1622
1760
  }), n.context.restore();
1623
1761
  };
1624
- function e1(n, e) {
1762
+ function f1(n, e) {
1625
1763
  const t = e(), o = n.points, i = o[0];
1626
1764
  if (i === void 0)
1627
1765
  return { path: t, length: 0 };
1628
1766
  t.path.moveTo(i.x, i.y);
1629
1767
  let a = 0, s = i;
1630
1768
  for (let h = 1; h < o.length; h++) {
1631
- const c = o[h];
1632
- if (c === void 0)
1769
+ const u = o[h];
1770
+ if (u === void 0)
1633
1771
  continue;
1634
- t.path.lineTo(c.x, c.y);
1635
- const f = Math.hypot(c.x - s.x, c.y - s.y);
1636
- a += f, s = c;
1772
+ t.path.lineTo(u.x, u.y);
1773
+ const c = Math.hypot(u.x - s.x, u.y - s.y);
1774
+ a += c, s = u;
1637
1775
  }
1638
1776
  t.path.closePath();
1639
1777
  const r = Math.hypot(
@@ -1642,7 +1780,7 @@ function e1(n, e) {
1642
1780
  );
1643
1781
  return a += r, { path: t, length: a };
1644
1782
  }
1645
- const n1 = ({
1783
+ const g1 = ({
1646
1784
  ctx: n,
1647
1785
  object: e,
1648
1786
  opacity: t,
@@ -1651,13 +1789,13 @@ const n1 = ({
1651
1789
  const i = e.opacity * t;
1652
1790
  if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
1653
1791
  return;
1654
- const { path: a, length: s } = e1(e, o);
1655
- v0({
1792
+ const { path: a, length: s } = f1(e, o);
1793
+ vt({
1656
1794
  ctx: n,
1657
1795
  path: a,
1658
1796
  color: e.fillColor,
1659
1797
  opacity: i
1660
- }), y0({
1798
+ }), yt({
1661
1799
  color: e.strokeColor,
1662
1800
  ctx: n,
1663
1801
  drawn: e.drawn,
@@ -1667,34 +1805,34 @@ const n1 = ({
1667
1805
  width: e.strokeWidth
1668
1806
  });
1669
1807
  };
1670
- function r1(n, e) {
1671
- const t = n.strokeWidth / 2, { origin: o, size: i } = p0(
1672
- X({ x: n.x, y: n.y }),
1808
+ function p1(n, e) {
1809
+ const t = n.strokeWidth / 2, { origin: o, size: i } = pt(
1810
+ W({ x: n.x, y: n.y }),
1673
1811
  n.anchor,
1674
- a0({ width: n.width, height: n.height })
1812
+ at({ width: n.width, height: n.height })
1675
1813
  ), a = i.width - n.strokeWidth, s = i.height - n.strokeWidth;
1676
1814
  if (a <= 0 || s <= 0)
1677
1815
  return;
1678
- const r = X({ x: o.x + t, y: o.y + t }), h = a0({ width: a, height: s }), c = Math.max(
1816
+ const r = W({ x: o.x + t, y: o.y + t }), h = at({ width: a, height: s }), u = Math.max(
1679
1817
  0,
1680
1818
  Math.min(n.cornerRadius - t, Math.min(a, s) / 2)
1681
1819
  );
1682
- if (c > 0)
1683
- return rt(r, h, c, e).path;
1684
- const f = e();
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;
1686
- }
1687
- function i1(n, e) {
1688
- const { origin: t, size: o } = p0(
1689
- X({ x: n.x, y: n.y }),
1820
+ if (u > 0)
1821
+ return a0(r, h, u, e).path;
1822
+ const c = e();
1823
+ return c.path.moveTo(r.x, r.y), c.path.lineTo(r.x + a, r.y), c.path.lineTo(r.x + a, r.y + s), c.path.lineTo(r.x, r.y + s), c.path.closePath(), c;
1824
+ }
1825
+ function d1(n, e) {
1826
+ const { origin: t, size: o } = pt(
1827
+ W({ x: n.x, y: n.y }),
1690
1828
  n.anchor,
1691
- a0({ width: n.width, height: n.height })
1829
+ at({ width: n.width, height: n.height })
1692
1830
  ), i = Math.max(
1693
1831
  0,
1694
1832
  Math.min(n.cornerRadius, Math.min(o.width, o.height) / 2)
1695
1833
  ), a = Math.min(n.strokeWidth * 2, o.width - i);
1696
1834
  if (i > 0)
1697
- return rt(t, o, i, e, a);
1835
+ return a0(t, o, i, e, a);
1698
1836
  {
1699
1837
  const s = e();
1700
1838
  s.path.moveTo(t.x, t.y), s.path.lineTo(t.x + o.width, t.y), s.path.lineTo(t.x + o.width, t.y + o.height), s.path.lineTo(t.x, t.y + o.height), s.path.lineTo(t.x, t.y), s.path.lineTo(t.x + a, t.y);
@@ -1702,7 +1840,7 @@ function i1(n, e) {
1702
1840
  return { path: s, length: r };
1703
1841
  }
1704
1842
  }
1705
- const o1 = ({
1843
+ const x1 = ({
1706
1844
  ctx: n,
1707
1845
  object: e,
1708
1846
  opacity: t,
@@ -1711,13 +1849,13 @@ const o1 = ({
1711
1849
  const i = e.opacity * t;
1712
1850
  if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
1713
1851
  return;
1714
- const { path: a, length: s } = i1(e, o);
1852
+ const { path: a, length: s } = d1(e, o);
1715
1853
  if (i < 1 && e.strokeWidth > 0) {
1716
- const r = r1(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());
1854
+ const r = p1(e, o);
1855
+ r !== void 0 && (n.context.save(), Y0(n, r), vt({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
1718
1856
  } else
1719
- v0({ ctx: n, path: a, color: e.fillColor, opacity: i });
1720
- y0({
1857
+ vt({ ctx: n, path: a, color: e.fillColor, opacity: i });
1858
+ yt({
1721
1859
  color: e.strokeColor,
1722
1860
  ctx: n,
1723
1861
  drawn: e.drawn,
@@ -1726,7 +1864,7 @@ const o1 = ({
1726
1864
  opacity: i,
1727
1865
  width: e.strokeWidth
1728
1866
  });
1729
- }, s1 = ({
1867
+ }, y1 = ({
1730
1868
  ctx: n,
1731
1869
  imageById: e,
1732
1870
  object: t,
@@ -1738,14 +1876,14 @@ const o1 = ({
1738
1876
  const a = e[t.svg];
1739
1877
  if (a === void 0)
1740
1878
  return;
1741
- const s = p0(
1742
- X({ x: t.x, y: t.y }),
1879
+ const s = pt(
1880
+ W({ x: t.x, y: t.y }),
1743
1881
  t.anchor,
1744
- a0({ width: t.width, height: t.height })
1882
+ at({ width: t.width, height: t.height })
1745
1883
  );
1746
1884
  switch (n.context.save(), n.context.globalAlpha = i, n.type) {
1747
1885
  case V.Browser:
1748
- a.type === E0.Browser && n.context.drawImage(
1886
+ a.type === St.Browser && n.context.drawImage(
1749
1887
  a.image,
1750
1888
  s.origin.x,
1751
1889
  s.origin.y,
@@ -1754,7 +1892,7 @@ const o1 = ({
1754
1892
  );
1755
1893
  break;
1756
1894
  case V.Node:
1757
- a.type === E0.Node && n.context.drawImage(
1895
+ a.type === St.Node && n.context.drawImage(
1758
1896
  a.image,
1759
1897
  s.origin.x,
1760
1898
  s.origin.y,
@@ -1763,11 +1901,11 @@ const o1 = ({
1763
1901
  );
1764
1902
  break;
1765
1903
  default:
1766
- s0(n);
1904
+ st(n);
1767
1905
  }
1768
1906
  n.context.restore();
1769
1907
  };
1770
- function a1(n) {
1908
+ function v1(n) {
1771
1909
  return {
1772
1910
  color: n.color,
1773
1911
  fontFamily: n.fontFamily,
@@ -1779,7 +1917,7 @@ function a1(n) {
1779
1917
  superscript: n.superscript
1780
1918
  };
1781
1919
  }
1782
- function h1(n, e = 1) {
1920
+ function w1(n, e = 1) {
1783
1921
  const t = Math.max(...n.map((a) => a.reduce((s, r) => s + r.width, 0)));
1784
1922
  let o = 0, i = 0;
1785
1923
  for (let a = 0; a < n.length; a++) {
@@ -1794,8 +1932,8 @@ function h1(n, e = 1) {
1794
1932
  width: t
1795
1933
  };
1796
1934
  }
1797
- const l1 = 0.7, c1 = 0.3;
1798
- function Rt(n) {
1935
+ const m1 = 0.7, b1 = 0.3;
1936
+ function W0(n) {
1799
1937
  const e = n.superscript, t = n.subscript && !e;
1800
1938
  return !e && !t ? {
1801
1939
  baselineShift: 0,
@@ -1803,117 +1941,117 @@ function Rt(n) {
1803
1941
  isSubscript: !1,
1804
1942
  isSuperscript: !1
1805
1943
  } : {
1806
- baselineShift: n.fontSize * c1 * (e ? -1 : 1),
1807
- fontSize: n.fontSize * l1,
1944
+ baselineShift: n.fontSize * b1 * (e ? -1 : 1),
1945
+ fontSize: n.fontSize * m1,
1808
1946
  isSubscript: t,
1809
1947
  isSuperscript: e
1810
1948
  };
1811
1949
  }
1812
- function u1(n) {
1950
+ function A1(n) {
1813
1951
  return {
1814
1952
  width: n.width,
1815
1953
  height: n.fontBoundingBoxAscent
1816
1954
  };
1817
1955
  }
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";
1956
+ function X0(n, e, t = 1) {
1957
+ const o = W0(e);
1958
+ n.context.fillStyle = s0(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";
1821
1959
  }
1822
- function f1(n, e, t) {
1960
+ function M1(n, e, t) {
1823
1961
  const o = [];
1824
1962
  for (const i of n) {
1825
1963
  const a = [];
1826
1964
  for (const s of i) {
1827
- const { text: r, ...h } = s, c = { ...e, ...h };
1828
- Nt(t, c);
1829
- const f = t.context.measureText(r), d = u1(f), { baselineShift: l } = Rt(c), u = d.height + Math.max(0, -l), m = Math.max(0, l);
1965
+ const { text: r, ...h } = s, u = { ...e, ...h };
1966
+ X0(t, u);
1967
+ const c = t.context.measureText(r), d = A1(c), { baselineShift: l } = W0(u), f = d.height + Math.max(0, -l), m = Math.max(0, l);
1830
1968
  a.push({
1831
1969
  ...d,
1832
1970
  baselineShift: l,
1833
1971
  bottom: m,
1834
- height: u + m,
1835
- top: u
1972
+ height: f + m,
1973
+ top: f
1836
1974
  });
1837
1975
  }
1838
1976
  o.push(a);
1839
1977
  }
1840
1978
  return o;
1841
1979
  }
1842
- const g1 = ({ ctx: n, object: e, opacity: t }) => {
1980
+ const L1 = ({ ctx: n, object: e, opacity: t }) => {
1843
1981
  const o = e.opacity * t;
1844
1982
  if (o === 0)
1845
1983
  return;
1846
- const { length: i } = e, a = _t(e.text), s = a1(e), r = f1(a, s, n), h = h1(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;
1984
+ const { length: i } = e, a = q0(e.text), s = v1(e), r = M1(a, s, n), h = w1(r, e.lineSpacing), u = pt(W({ x: e.x, y: e.y }), e.anchor, h);
1985
+ let c = u.origin.x, d = u.origin.y, l = 0, f = 0;
1848
1986
  for (let m = 0; m < a.length; m++) {
1849
1987
  const y = a[m], M = r[m];
1850
1988
  if (y == null || M == null) {
1851
1989
  console.error("Could not determine text units or sizes for line");
1852
1990
  continue;
1853
1991
  }
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;
1992
+ const E = M.reduce((I, R) => I + R.width, 0), L = M.length === 0 ? f : M.reduce((I, R) => Math.max(I, R.top), 0), C = M.length === 0 ? 0 : M.reduce((I, R) => Math.max(I, R.bottom), 0), S = L + C;
1855
1993
  switch (e.alignment) {
1856
- case x0.LEFT:
1857
- f = c.origin.x;
1994
+ case xt.LEFT:
1995
+ c = u.origin.x;
1858
1996
  break;
1859
- case x0.CENTER:
1860
- f = c.origin.x + (c.size.width - T) / 2;
1997
+ case xt.CENTER:
1998
+ c = u.origin.x + (u.size.width - E) / 2;
1861
1999
  break;
1862
- case x0.RIGHT:
1863
- f = c.origin.x + (c.size.width - T);
2000
+ case xt.RIGHT:
2001
+ c = u.origin.x + (u.size.width - E);
1864
2002
  break;
1865
2003
  default:
1866
- s0(e.alignment);
2004
+ st(e.alignment);
1867
2005
  break;
1868
2006
  }
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) {
2007
+ d += f * (e.lineSpacing - 1);
2008
+ const T = d + L;
2009
+ f = S;
2010
+ for (let I = 0; I < y.length && !(i !== null && l >= i); I++) {
2011
+ const R = y[I], X = M[I];
2012
+ if (R == null || X == null) {
1875
2013
  console.error("Could not determine text unit or size for unit");
1876
2014
  continue;
1877
2015
  }
1878
- const { text: z, ...H } = R;
1879
- let t0;
1880
- if (i !== null && l + z.length > i) {
2016
+ const { text: H, ...Y } = R;
2017
+ let tt;
2018
+ if (i !== null && l + H.length > i) {
1881
2019
  const K = i - l;
1882
- t0 = z.slice(0, K);
2020
+ tt = H.slice(0, K);
1883
2021
  }
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;
2022
+ const et = tt ?? H;
2023
+ l += et.length;
2024
+ const nt = { ...s, ...Y };
2025
+ X0(n, nt, o), n.context.fillText(et, c, T + X.baselineShift), c += X.width;
1888
2026
  }
1889
- d += E;
1890
- }
1891
- }, p1 = {
1892
- [U.ARROW]: He,
1893
- [U.CIRCLE]: Ge,
1894
- [U.GROUP]: Ze,
1895
- [U.IMAGE]: Ve,
1896
- [U.LINE]: Qe,
1897
- [U.MASK]: Je,
1898
- [U.PATH]: t1,
1899
- [U.POLYGON]: n1,
1900
- [U.RECTANGLE]: o1,
2027
+ d += S;
2028
+ }
2029
+ }, T1 = {
2030
+ [U.ARROW]: e1,
2031
+ [U.CIRCLE]: i1,
2032
+ [U.GROUP]: s1,
2033
+ [U.IMAGE]: a1,
2034
+ [U.LINE]: l1,
2035
+ [U.MASK]: c1,
2036
+ [U.PATH]: u1,
2037
+ [U.POLYGON]: g1,
2038
+ [U.RECTANGLE]: x1,
1901
2039
  [U.SLIDE_OBJECT]: () => {
1902
2040
  },
1903
- [U.SVG]: s1,
1904
- [U.TEXT]: g1
2041
+ [U.SVG]: y1,
2042
+ [U.TEXT]: L1
1905
2043
  };
1906
- function d1(n) {
2044
+ function C1(n) {
1907
2045
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1908
2046
  return e.setAttribute("viewBox", `0 0 ${n.width} ${n.height}`), e.style.backgroundColor = "transparent", e.style.position = "absolute", e.style.width = "100%", e;
1909
2047
  }
1910
- function x1(n, e) {
2048
+ function P1(n, e) {
1911
2049
  if (n === null)
1912
2050
  return null;
1913
- const t = p0(
1914
- X({ x: e.x, y: e.y }),
2051
+ const t = pt(
2052
+ W({ x: e.x, y: e.y }),
1915
2053
  e.anchor,
1916
- a0({ width: e.width, height: e.height })
2054
+ at({ width: e.width, height: e.height })
1917
2055
  ), o = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
1918
2056
  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());
1919
2057
  const i = e.content;
@@ -1927,20 +2065,20 @@ function x1(n, e) {
1927
2065
  a !== null && a(), n.removeChild(o);
1928
2066
  };
1929
2067
  }
1930
- async function y1(n) {
2068
+ async function E1(n) {
1931
2069
  if (Object.keys(n).length === 0)
1932
2070
  return {};
1933
2071
  const e = {}, t = (i) => new Promise((a, s) => {
1934
2072
  const r = new Image();
1935
- if (r.onload = () => a(r), r.onerror = (c) => s(c), i.includes("</svg>")) {
1936
- const c = i.replace(/<\?xml[^?]*\?>\s*/g, ""), f = new Blob([c], { type: "image/svg+xml;charset=utf-8" }), d = URL.createObjectURL(f);
2073
+ if (r.onload = () => a(r), r.onerror = (u) => s(u), i.includes("</svg>")) {
2074
+ const u = i.replace(/<\?xml[^?]*\?>\s*/g, ""), c = new Blob([u], { type: "image/svg+xml;charset=utf-8" }), d = URL.createObjectURL(c);
1937
2075
  r.src = d;
1938
2076
  } else
1939
2077
  r.src = i;
1940
2078
  }), o = Object.entries(n).map(async ([i, a]) => {
1941
2079
  const s = await t(a);
1942
2080
  e[i] = {
1943
- type: E0.Browser,
2081
+ type: St.Browser,
1944
2082
  image: s
1945
2083
  };
1946
2084
  });
@@ -1951,99 +2089,144 @@ async function y1(n) {
1951
2089
  }
1952
2090
  return e;
1953
2091
  }
1954
- class kn {
2092
+ class jn {
1955
2093
  constructor(e) {
2094
+ this.navigator = null;
1956
2095
  const { objectRenderers: t, scale: o = 1, ...i } = e;
1957
2096
  this.props = {
1958
- presentation: Pe(),
2097
+ presentation: ze(),
1959
2098
  element: document.body,
1960
2099
  objectRenderers: {
1961
- ...p1,
2100
+ ...T1,
1962
2101
  ...t
1963
2102
  },
1964
2103
  cacheDurationMinutes: 15,
1965
- scale: v1(o),
2104
+ scale: S1(o),
1966
2105
  ...i
1967
- }, this.state = { ...pt };
2106
+ }, this.state = { ...b0 };
1968
2107
  }
1969
2108
  /** Starts the presentation. */
1970
2109
  async present() {
1971
- const { presentation: e, element: t, scale: o } = this.props, i = ze(e.size), a = d1(e.size);
2110
+ const { presentation: e, element: t, scale: o } = this.props, i = Qe(e.size), a = C1(e.size);
1972
2111
  a.style.transformOrigin = "center center", a.style.transform = `scale(${o})`, this.state = {
1973
- ...pt,
1974
- imageById: await y1({
2112
+ ...b0,
2113
+ imageById: await E1({
1975
2114
  ...e.resources.images,
1976
- ...Re(e)
2115
+ ...Ge(e)
1977
2116
  }),
1978
2117
  canvas: i,
1979
2118
  extrasContainer: a
1980
2119
  };
1981
- const s = Ee(e, t);
1982
- Be(e, t, this.state.shortcutState, {
1983
- onNext: (h) => this.next(h),
1984
- onPrevious: (h) => this.previous(h),
1985
- onRenderSlide: (h, c) => {
1986
- this.state.shortcutState.shortcuts.b = {
1987
- slideIndex: this.state.slideIndex,
1988
- buildIndex: this.state.buildIndex
1989
- }, this.renderSlide(h ?? this.state.slideIndex, c);
2120
+ const s = He(e, t), r = U0(t), h = (c, d) => {
2121
+ this.state.shortcutState.shortcuts.b = {
2122
+ slideIndex: this.state.slideIndex,
2123
+ buildIndex: this.state.buildIndex
2124
+ }, this.renderSlide(c ?? this.state.slideIndex, d);
2125
+ };
2126
+ j0(
2127
+ e,
2128
+ s,
2129
+ this.state.shortcutState,
2130
+ {
2131
+ onNext: (c) => this.next(c),
2132
+ onPrevious: (c) => this.previous(c),
2133
+ onRenderSlide: h,
2134
+ onShowNavigator: () => {
2135
+ r && (this.navigator = Fe({
2136
+ presentation: e,
2137
+ shortcutState: this.state.shortcutState,
2138
+ onNavigateToSlide: (c) => this.renderSlide(c),
2139
+ onRenderSlide: h,
2140
+ onNext: (c) => this.next(c),
2141
+ onPrevious: (c) => this.previous(c)
2142
+ }), this.updateNavigator());
2143
+ }
1990
2144
  },
1991
- onShowNavigator: () => be({
1992
- presentation: e,
1993
- onNavigateToSlide: (h) => this.renderSlide(h)
1994
- })
1995
- }), t.replaceChildren(), s.appendChild(i), s.appendChild(a), t.appendChild(s);
1996
- const r = qe(e, this.props.cacheDurationMinutes);
1997
- r !== null ? this.renderSlide(r.slideIndex, r.buildIndex) : this.renderSlide(0);
2145
+ {
2146
+ focusOnPointerDown: !r,
2147
+ keyEventTarget: r ? window : s
2148
+ }
2149
+ ), t.replaceChildren(), s.appendChild(i), s.appendChild(a), t.appendChild(s);
2150
+ const u = Ze(e, this.props.cacheDurationMinutes);
2151
+ u !== null ? this.renderSlide(u.slideIndex, u.buildIndex) : this.renderSlide(0);
1998
2152
  }
1999
2153
  renderSlide(e, t = 0, o = null) {
2000
- const { objectRenderers: i, presentation: a, scale: s } = this.props, { canvas: r, imageById: h } = this.state, c = this.state.slideIndex !== e;
2001
- this.state.slideIndex = e, this.state.buildIndex = t, o === null && De({ title: a.title, slideIndex: e, buildIndex: t });
2002
- const f = a.slides[e];
2003
- if (f === void 0 || r === null)
2004
- return;
2005
- if (c || this.state.mountedExtrasCleanups.length === 0 && f.extras.length > 0) {
2006
- for (const M of this.state.mountedExtrasCleanups)
2007
- M();
2008
- this.state.mountedExtrasCleanups = [];
2009
- for (const M of f.extras) {
2010
- const T = x1(this.state.extrasContainer, M);
2011
- T !== null && this.state.mountedExtrasCleanups.push(T);
2154
+ const { presentation: i } = this.props, { canvas: a } = this.state, s = this.state.slideIndex !== e;
2155
+ this.state.slideIndex = e, this.state.buildIndex = t, o === null && Ve({ title: i.title, slideIndex: e, buildIndex: t });
2156
+ const r = i.slides[e];
2157
+ if (!(r === void 0 || a === null)) {
2158
+ if (s || this.state.mountedExtrasCleanups.length === 0 && r.extras.length > 0) {
2159
+ for (const h of this.state.mountedExtrasCleanups)
2160
+ h();
2161
+ this.state.mountedExtrasCleanups = [];
2162
+ for (const h of r.extras) {
2163
+ const u = P1(this.state.extrasContainer, h);
2164
+ u !== null && this.state.mountedExtrasCleanups.push(u);
2165
+ }
2012
2166
  }
2167
+ this.renderCanvas(a, e, t, o, this.props.scale), o === null && this.updateNavigator();
2013
2168
  }
2014
- const d = r.getContext("2d");
2015
- if (d === null)
2169
+ }
2170
+ renderCanvas(e, t, o = 0, i = null, a = 1) {
2171
+ const { objectRenderers: s, presentation: r } = this.props, { imageById: h } = this.state;
2172
+ e.width = r.size.width, e.height = r.size.height;
2173
+ const u = e.getContext("2d");
2174
+ if (u === null)
2016
2175
  return;
2017
- const l = {
2176
+ const c = {
2018
2177
  type: V.Browser,
2019
- context: d
2178
+ context: u
2020
2179
  };
2021
- je(r, l);
2022
- const u = Fe({
2023
- slide: f,
2024
- buildIndex: t,
2025
- buildTime: o
2180
+ Ke(e, c);
2181
+ const d = r.slides[t];
2182
+ if (d === void 0)
2183
+ return;
2184
+ const l = Xe({
2185
+ slide: d,
2186
+ buildIndex: o,
2187
+ buildTime: i
2026
2188
  });
2027
- l.context.fillStyle = nt(a.backgroundColor), l.context.fillRect(0, 0, r.width, r.height);
2028
- function m(M, T) {
2029
- const S = i[M.objectType], P = u.get(M);
2030
- S === void 0 || P === void 0 || S({
2031
- ctx: l,
2189
+ c.context.fillStyle = s0(r.backgroundColor), c.context.fillRect(0, 0, e.width, e.height);
2190
+ function f(y, M) {
2191
+ const E = s[y.objectType], L = l.get(y);
2192
+ E === void 0 || L === void 0 || E({
2193
+ ctx: c,
2032
2194
  imageById: h,
2033
- object: P,
2034
- opacity: T,
2035
- renderObject: m,
2036
- createPath2D: Ue
2195
+ object: L,
2196
+ opacity: M,
2197
+ renderObject: f,
2198
+ createPath2D: Je
2037
2199
  });
2038
2200
  }
2039
- const y = s !== 1;
2040
- y && (l.context.save(), l.context.translate(
2041
- r.width * (1 - s) / 2,
2042
- r.height * (1 - s) / 2
2043
- ), l.context.scale(s, s));
2044
- for (const M of f.objects)
2045
- m(M, 1);
2046
- y && l.context.restore();
2201
+ const m = a !== 1;
2202
+ m && (c.context.save(), c.context.translate(
2203
+ e.width * (1 - a) / 2,
2204
+ e.height * (1 - a) / 2
2205
+ ), c.context.scale(a, a));
2206
+ for (const y of d.objects)
2207
+ f(y, 1);
2208
+ m && c.context.restore();
2209
+ }
2210
+ updateNavigator() {
2211
+ const { navigator: e } = this;
2212
+ if (e === null)
2213
+ return;
2214
+ if (!e.isOpen()) {
2215
+ this.navigator = null;
2216
+ return;
2217
+ }
2218
+ const { slideIndex: t, buildIndex: o } = this.state, i = this.getNextSlideBuild(t, o);
2219
+ e.update(t, o, i.slideIndex, i.buildIndex), this.renderCanvas(e.currentCanvas, t, o), i.slideIndex === null ? this.renderEndCanvas(e.nextCanvas) : this.renderCanvas(e.nextCanvas, i.slideIndex, i.buildIndex);
2220
+ }
2221
+ getNextSlideBuild(e, t) {
2222
+ const { presentation: o } = this.props, i = o.slides[e];
2223
+ return i === void 0 ? { slideIndex: e, buildIndex: t } : t < i.animations.length ? { slideIndex: e, buildIndex: t + 1 } : e + 1 < o.slides.length ? { slideIndex: e + 1, buildIndex: 0 } : { slideIndex: null, buildIndex: 0 };
2224
+ }
2225
+ renderEndCanvas(e) {
2226
+ const { presentation: t } = this.props;
2227
+ e.width = t.size.width, e.height = t.size.height;
2228
+ const o = e.getContext("2d");
2229
+ o !== null && (o.fillStyle = "#000000", o.fillRect(0, 0, e.width, e.height));
2047
2230
  }
2048
2231
  next(e = !1) {
2049
2232
  const { presentation: t } = this.props, { currentAnimationId: o, slideIndex: i, buildIndex: a } = this.state;
@@ -2053,11 +2236,11 @@ class kn {
2053
2236
  return;
2054
2237
  const r = s.animations[a];
2055
2238
  if (r !== void 0 && !e) {
2056
- const h = performance.now(), c = Ce(r), f = (d) => {
2239
+ const h = performance.now(), u = je(r), c = (d) => {
2057
2240
  const l = d - h;
2058
- l < c ? (this.renderSlide(i, a + 1, l), this.state.currentAnimationId = requestAnimationFrame(f)) : this.renderSlide(i, a + 1, null);
2241
+ l < u ? (this.renderSlide(i, a + 1, l), this.state.currentAnimationId = requestAnimationFrame(c)) : this.renderSlide(i, a + 1, null);
2059
2242
  };
2060
- this.state.currentAnimationId = requestAnimationFrame(f);
2243
+ this.state.currentAnimationId = requestAnimationFrame(c);
2061
2244
  } else i + 1 < t.slides.length && this.renderSlide(i + 1);
2062
2245
  }
2063
2246
  previous(e = !1) {
@@ -2079,20 +2262,20 @@ class kn {
2079
2262
  return t > 0 || e > 0;
2080
2263
  }
2081
2264
  }
2082
- function v1(n) {
2265
+ function S1(n) {
2083
2266
  return n <= 0 || n > 1 ? (console.warn(
2084
2267
  `BrowserCanvasRenderer scale must be positive and no greater than 1. Received ${n}; using 1 instead.`
2085
2268
  ), 1) : n;
2086
2269
  }
2087
- function In(n = 1e3) {
2270
+ function Hn(n = 1e3) {
2088
2271
  return {
2089
- type: f0.PAUSE,
2272
+ type: ft.PAUSE,
2090
2273
  isKey: !1,
2091
2274
  duration: n,
2092
2275
  shortcut: null
2093
2276
  };
2094
2277
  }
2095
- function _n(n = null) {
2278
+ function Un(n = null) {
2096
2279
  return {
2097
2280
  objects: [],
2098
2281
  animations: [],
@@ -2105,32 +2288,32 @@ function _n(n = null) {
2105
2288
  ...n
2106
2289
  };
2107
2290
  }
2108
- function On(n, e = {}) {
2291
+ function $n(n, e = {}) {
2109
2292
  return {
2110
2293
  ...e,
2111
2294
  text: n
2112
2295
  };
2113
2296
  }
2114
- function Fn(n = $.BLACK) {
2297
+ function Yn(n = G.BLACK) {
2115
2298
  return { ...n, alpha: 1 };
2116
2299
  }
2117
- function w1(n) {
2300
+ function k1(n) {
2118
2301
  for (var e = -1, t = n.length, o, i = n[t - 1], a = 0; ++e < t; )
2119
2302
  o = i, i = n[e], a += o[1] * i[0] - o[0] * i[1];
2120
2303
  return a / 2;
2121
2304
  }
2122
- function m1(n) {
2305
+ function I1(n) {
2123
2306
  for (var e = -1, t = n.length, o = n[t - 1], i, a, s = o[0], r = o[1], h = 0; ++e < t; )
2124
2307
  i = s, a = r, o = n[e], s = o[0], r = o[1], i -= s, a -= r, h += Math.sqrt(i * i + a * a);
2125
2308
  return h;
2126
2309
  }
2127
- function A1(n) {
2310
+ function _1(n) {
2128
2311
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
2129
2312
  }
2130
- var q0, dt;
2131
- function b1() {
2132
- if (dt) return q0;
2133
- dt = 1;
2313
+ var jt, A0;
2314
+ function O1() {
2315
+ if (A0) return jt;
2316
+ A0 = 1;
2134
2317
  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 = [
2135
2318
  5760,
2136
2319
  6158,
@@ -2150,13 +2333,13 @@ function b1() {
2150
2333
  12288,
2151
2334
  65279
2152
2335
  ];
2153
- function t(u) {
2154
- return u === 10 || u === 13 || u === 8232 || u === 8233 || // Line terminators
2336
+ function t(f) {
2337
+ return f === 10 || f === 13 || f === 8232 || f === 8233 || // Line terminators
2155
2338
  // White spaces
2156
- u === 32 || u === 9 || u === 11 || u === 12 || u === 160 || u >= 5760 && e.indexOf(u) >= 0;
2339
+ f === 32 || f === 9 || f === 11 || f === 12 || f === 160 || f >= 5760 && e.indexOf(f) >= 0;
2157
2340
  }
2158
- function o(u) {
2159
- switch (u | 32) {
2341
+ function o(f) {
2342
+ switch (f | 32) {
2160
2343
  case 109:
2161
2344
  case 122:
2162
2345
  case 108:
@@ -2172,110 +2355,110 @@ function b1() {
2172
2355
  }
2173
2356
  return !1;
2174
2357
  }
2175
- function i(u) {
2176
- return (u | 32) === 97;
2358
+ function i(f) {
2359
+ return (f | 32) === 97;
2177
2360
  }
2178
- function a(u) {
2179
- return u >= 48 && u <= 57;
2361
+ function a(f) {
2362
+ return f >= 48 && f <= 57;
2180
2363
  }
2181
- function s(u) {
2182
- return u >= 48 && u <= 57 || /* 0..9 */
2183
- u === 43 || /* + */
2184
- u === 45 || /* - */
2185
- u === 46;
2364
+ function s(f) {
2365
+ return f >= 48 && f <= 57 || /* 0..9 */
2366
+ f === 43 || /* + */
2367
+ f === 45 || /* - */
2368
+ f === 46;
2186
2369
  }
2187
- function r(u) {
2188
- this.index = 0, this.path = u, this.max = u.length, this.result = [], this.param = 0, this.err = "", this.segmentStart = 0, this.data = [];
2370
+ function r(f) {
2371
+ this.index = 0, this.path = f, this.max = f.length, this.result = [], this.param = 0, this.err = "", this.segmentStart = 0, this.data = [];
2189
2372
  }
2190
- function h(u) {
2191
- for (; u.index < u.max && t(u.path.charCodeAt(u.index)); )
2192
- u.index++;
2373
+ function h(f) {
2374
+ for (; f.index < f.max && t(f.path.charCodeAt(f.index)); )
2375
+ f.index++;
2193
2376
  }
2194
- function c(u) {
2195
- var m = u.path.charCodeAt(u.index);
2377
+ function u(f) {
2378
+ var m = f.path.charCodeAt(f.index);
2196
2379
  if (m === 48) {
2197
- u.param = 0, u.index++;
2380
+ f.param = 0, f.index++;
2198
2381
  return;
2199
2382
  }
2200
2383
  if (m === 49) {
2201
- u.param = 1, u.index++;
2384
+ f.param = 1, f.index++;
2202
2385
  return;
2203
2386
  }
2204
- u.err = "SvgPath: arc flag can be 0 or 1 only (at pos " + u.index + ")";
2387
+ f.err = "SvgPath: arc flag can be 0 or 1 only (at pos " + f.index + ")";
2205
2388
  }
2206
- function f(u) {
2207
- var m = u.index, y = m, M = u.max, T = !1, S = !1, P = !1, E = !1, C;
2389
+ function c(f) {
2390
+ var m = f.index, y = m, M = f.max, E = !1, L = !1, C = !1, S = !1, T;
2208
2391
  if (y >= M) {
2209
- u.err = "SvgPath: missed param (at pos " + y + ")";
2392
+ f.err = "SvgPath: missed param (at pos " + y + ")";
2210
2393
  return;
2211
2394
  }
2212
- if (C = u.path.charCodeAt(y), (C === 43 || C === 45) && (y++, C = y < M ? u.path.charCodeAt(y) : 0), !a(C) && C !== 46) {
2213
- u.err = "SvgPath: param should start with 0..9 or `.` (at pos " + y + ")";
2395
+ if (T = f.path.charCodeAt(y), (T === 43 || T === 45) && (y++, T = y < M ? f.path.charCodeAt(y) : 0), !a(T) && T !== 46) {
2396
+ f.err = "SvgPath: param should start with 0..9 or `.` (at pos " + y + ")";
2214
2397
  return;
2215
2398
  }
2216
- if (C !== 46) {
2217
- if (T = C === 48, y++, C = y < M ? u.path.charCodeAt(y) : 0, T && y < M && C && a(C)) {
2218
- u.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " + m + ")";
2399
+ if (T !== 46) {
2400
+ if (E = T === 48, y++, T = y < M ? f.path.charCodeAt(y) : 0, E && y < M && T && a(T)) {
2401
+ f.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " + m + ")";
2219
2402
  return;
2220
2403
  }
2221
- for (; y < M && a(u.path.charCodeAt(y)); )
2222
- y++, S = !0;
2223
- C = y < M ? u.path.charCodeAt(y) : 0;
2404
+ for (; y < M && a(f.path.charCodeAt(y)); )
2405
+ y++, L = !0;
2406
+ T = y < M ? f.path.charCodeAt(y) : 0;
2224
2407
  }
2225
- if (C === 46) {
2226
- for (E = !0, y++; a(u.path.charCodeAt(y)); )
2227
- y++, P = !0;
2228
- C = y < M ? u.path.charCodeAt(y) : 0;
2408
+ if (T === 46) {
2409
+ for (S = !0, y++; a(f.path.charCodeAt(y)); )
2410
+ y++, C = !0;
2411
+ T = y < M ? f.path.charCodeAt(y) : 0;
2229
2412
  }
2230
- if (C === 101 || C === 69) {
2231
- if (E && !S && !P) {
2232
- u.err = "SvgPath: invalid float exponent (at pos " + y + ")";
2413
+ if (T === 101 || T === 69) {
2414
+ if (S && !L && !C) {
2415
+ f.err = "SvgPath: invalid float exponent (at pos " + y + ")";
2233
2416
  return;
2234
2417
  }
2235
- if (y++, C = y < M ? u.path.charCodeAt(y) : 0, (C === 43 || C === 45) && y++, y < M && a(u.path.charCodeAt(y)))
2236
- for (; y < M && a(u.path.charCodeAt(y)); )
2418
+ if (y++, T = y < M ? f.path.charCodeAt(y) : 0, (T === 43 || T === 45) && y++, y < M && a(f.path.charCodeAt(y)))
2419
+ for (; y < M && a(f.path.charCodeAt(y)); )
2237
2420
  y++;
2238
2421
  else {
2239
- u.err = "SvgPath: invalid float exponent (at pos " + y + ")";
2422
+ f.err = "SvgPath: invalid float exponent (at pos " + y + ")";
2240
2423
  return;
2241
2424
  }
2242
2425
  }
2243
- u.index = y, u.param = parseFloat(u.path.slice(m, y)) + 0;
2426
+ f.index = y, f.param = parseFloat(f.path.slice(m, y)) + 0;
2244
2427
  }
2245
- function d(u) {
2428
+ function d(f) {
2246
2429
  var m, y;
2247
- m = u.path[u.segmentStart], y = m.toLowerCase();
2248
- var M = u.data;
2249
- 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")
2250
- u.result.push([m].concat(M));
2430
+ m = f.path[f.segmentStart], y = m.toLowerCase();
2431
+ var M = f.data;
2432
+ if (y === "m" && M.length > 2 && (f.result.push([m, M[0], M[1]]), M = M.slice(2), y = "l", m = m === "m" ? "l" : "L"), y === "r")
2433
+ f.result.push([m].concat(M));
2251
2434
  else
2252
- for (; M.length >= n[y] && (u.result.push([m].concat(M.splice(0, n[y]))), !!n[y]); )
2435
+ for (; M.length >= n[y] && (f.result.push([m].concat(M.splice(0, n[y]))), !!n[y]); )
2253
2436
  ;
2254
2437
  }
2255
- function l(u) {
2256
- var m = u.max, y, M, T, S, P;
2257
- if (u.segmentStart = u.index, y = u.path.charCodeAt(u.index), M = i(y), !o(y)) {
2258
- u.err = "SvgPath: bad command " + u.path[u.index] + " (at pos " + u.index + ")";
2438
+ function l(f) {
2439
+ var m = f.max, y, M, E, L, C;
2440
+ if (f.segmentStart = f.index, y = f.path.charCodeAt(f.index), M = i(y), !o(y)) {
2441
+ f.err = "SvgPath: bad command " + f.path[f.index] + " (at pos " + f.index + ")";
2259
2442
  return;
2260
2443
  }
2261
- if (S = n[u.path[u.index].toLowerCase()], u.index++, h(u), u.data = [], !S) {
2262
- d(u);
2444
+ if (L = n[f.path[f.index].toLowerCase()], f.index++, h(f), f.data = [], !L) {
2445
+ d(f);
2263
2446
  return;
2264
2447
  }
2265
- for (T = !1; ; ) {
2266
- for (P = S; P > 0; P--) {
2267
- if (M && (P === 3 || P === 4) ? c(u) : f(u), u.err.length) {
2268
- d(u);
2448
+ for (E = !1; ; ) {
2449
+ for (C = L; C > 0; C--) {
2450
+ if (M && (C === 3 || C === 4) ? u(f) : c(f), f.err.length) {
2451
+ d(f);
2269
2452
  return;
2270
2453
  }
2271
- u.data.push(u.param), h(u), T = !1, u.index < m && u.path.charCodeAt(u.index) === 44 && (u.index++, h(u), T = !0);
2454
+ f.data.push(f.param), h(f), E = !1, f.index < m && f.path.charCodeAt(f.index) === 44 && (f.index++, h(f), E = !0);
2272
2455
  }
2273
- if (!T && (u.index >= u.max || !s(u.path.charCodeAt(u.index))))
2456
+ if (!E && (f.index >= f.max || !s(f.path.charCodeAt(f.index))))
2274
2457
  break;
2275
2458
  }
2276
- d(u);
2459
+ d(f);
2277
2460
  }
2278
- return q0 = function(m) {
2461
+ return jt = function(m) {
2279
2462
  var y = new r(m), M = y.max;
2280
2463
  for (h(y); y.index < M && !y.err.length; )
2281
2464
  l(y);
@@ -2283,12 +2466,12 @@ function b1() {
2283
2466
  err: y.err,
2284
2467
  segments: y.result
2285
2468
  };
2286
- }, q0;
2469
+ }, jt;
2287
2470
  }
2288
- var D0, xt;
2289
- function Bt() {
2290
- if (xt) return D0;
2291
- xt = 1;
2471
+ var Ht, M0;
2472
+ function G0() {
2473
+ if (M0) return Ht;
2474
+ M0 = 1;
2292
2475
  function n(t, o) {
2293
2476
  return [
2294
2477
  t[0] * o[0] + t[2] * o[1],
@@ -2333,13 +2516,13 @@ function Bt() {
2333
2516
  t * a[0] + o * a[2] + (i ? 0 : a[4]),
2334
2517
  t * a[1] + o * a[3] + (i ? 0 : a[5])
2335
2518
  ]) : [t, o];
2336
- }, D0 = e, D0;
2519
+ }, Ht = e, Ht;
2337
2520
  }
2338
- var j0, yt;
2339
- function M1() {
2340
- if (yt) return j0;
2341
- yt = 1;
2342
- var n = Bt(), e = {
2521
+ var Ut, L0;
2522
+ function F1() {
2523
+ if (L0) return Ut;
2524
+ L0 = 1;
2525
+ var n = G0(), e = {
2343
2526
  matrix: !0,
2344
2527
  scale: !0,
2345
2528
  rotate: !0,
@@ -2347,16 +2530,16 @@ function M1() {
2347
2530
  skewX: !0,
2348
2531
  skewY: !0
2349
2532
  }, t = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, o = /[\s,]+/;
2350
- return j0 = function(a) {
2533
+ return Ut = function(a) {
2351
2534
  var s = new n(), r, h;
2352
- return a.split(t).forEach(function(c) {
2353
- if (c.length) {
2354
- if (typeof e[c] < "u") {
2355
- r = c;
2535
+ return a.split(t).forEach(function(u) {
2536
+ if (u.length) {
2537
+ if (typeof e[u] < "u") {
2538
+ r = u;
2356
2539
  return;
2357
2540
  }
2358
- switch (h = c.split(o).map(function(f) {
2359
- return +f || 0;
2541
+ switch (h = u.split(o).map(function(c) {
2542
+ return +c || 0;
2360
2543
  }), r) {
2361
2544
  case "matrix":
2362
2545
  h.length === 6 && s.matrix(h);
@@ -2379,55 +2562,55 @@ function M1() {
2379
2562
  }
2380
2563
  }
2381
2564
  }), s;
2382
- }, j0;
2565
+ }, Ut;
2383
2566
  }
2384
- var z0, vt;
2385
- function L1() {
2386
- if (vt) return z0;
2387
- vt = 1;
2567
+ var $t, T0;
2568
+ function N1() {
2569
+ if (T0) return $t;
2570
+ T0 = 1;
2388
2571
  var n = Math.PI * 2;
2389
2572
  function e(i, a, s, r) {
2390
- var h = i * r - a * s < 0 ? -1 : 1, c = i * s + a * r;
2391
- return c > 1 && (c = 1), c < -1 && (c = -1), h * Math.acos(c);
2573
+ var h = i * r - a * s < 0 ? -1 : 1, u = i * s + a * r;
2574
+ return u > 1 && (u = 1), u < -1 && (u = -1), h * Math.acos(u);
2392
2575
  }
2393
- function t(i, a, s, r, h, c, f, d, l, u) {
2394
- 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;
2395
- E < 0 && (E = 0), E /= M * P + T * S, E = Math.sqrt(E) * (h === c ? -1 : 1);
2396
- 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);
2397
- return c === 0 && K > 0 && (K -= n), c === 1 && K < 0 && (K += n), [R, G, n0, K];
2576
+ function t(i, a, s, r, h, u, c, d, l, f) {
2577
+ var m = f * (i - s) / 2 + l * (a - r) / 2, y = -l * (i - s) / 2 + f * (a - r) / 2, M = c * c, E = d * d, L = m * m, C = y * y, S = M * E - M * C - E * L;
2578
+ S < 0 && (S = 0), S /= M * C + E * L, S = Math.sqrt(S) * (h === u ? -1 : 1);
2579
+ var T = S * c / d * y, I = S * -d / c * m, R = f * T - l * I + (i + s) / 2, X = l * T + f * I + (a + r) / 2, H = (m - T) / c, Y = (y - I) / d, tt = (-m - T) / c, et = (-y - I) / d, nt = e(1, 0, H, Y), K = e(H, Y, tt, et);
2580
+ return u === 0 && K > 0 && (K -= n), u === 1 && K < 0 && (K += n), [R, X, nt, K];
2398
2581
  }
2399
2582
  function o(i, a) {
2400
- 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);
2401
- return [r, h, r - h * s, h + r * s, c + f * s, f - c * s, c, f];
2583
+ var s = 1.3333333333333333 * Math.tan(a / 4), r = Math.cos(i), h = Math.sin(i), u = Math.cos(i + a), c = Math.sin(i + a);
2584
+ return [r, h, r - h * s, h + r * s, u + c * s, c - u * s, u, c];
2402
2585
  }
2403
- return z0 = function(a, s, r, h, c, f, d, l, u) {
2404
- 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;
2405
- if (M === 0 && T === 0)
2586
+ return $t = function(a, s, r, h, u, c, d, l, f) {
2587
+ var m = Math.sin(f * n / 360), y = Math.cos(f * n / 360), M = y * (a - r) / 2 + m * (s - h) / 2, E = -m * (a - r) / 2 + y * (s - h) / 2;
2588
+ if (M === 0 && E === 0)
2406
2589
  return [];
2407
2590
  if (d === 0 || l === 0)
2408
2591
  return [];
2409
2592
  d = Math.abs(d), l = Math.abs(l);
2410
- var S = M * M / (d * d) + T * T / (l * l);
2411
- S > 1 && (d *= Math.sqrt(S), l *= Math.sqrt(S));
2412
- 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);
2413
- O /= R;
2414
- for (var G = 0; G < R; G++)
2415
- E.push(o(C, O)), C += O;
2416
- return E.map(function(z) {
2417
- for (var H = 0; H < z.length; H += 2) {
2418
- var t0 = z[H + 0], e0 = z[H + 1];
2419
- t0 *= d, e0 *= l;
2420
- var n0 = y * t0 - m * e0, K = m * t0 + y * e0;
2421
- z[H + 0] = n0 + P[0], z[H + 1] = K + P[1];
2593
+ var L = M * M / (d * d) + E * E / (l * l);
2594
+ L > 1 && (d *= Math.sqrt(L), l *= Math.sqrt(L));
2595
+ var C = t(a, s, r, h, u, c, d, l, m, y), S = [], T = C[2], I = C[3], R = Math.max(Math.ceil(Math.abs(I) / (n / 4)), 1);
2596
+ I /= R;
2597
+ for (var X = 0; X < R; X++)
2598
+ S.push(o(T, I)), T += I;
2599
+ return S.map(function(H) {
2600
+ for (var Y = 0; Y < H.length; Y += 2) {
2601
+ var tt = H[Y + 0], et = H[Y + 1];
2602
+ tt *= d, et *= l;
2603
+ var nt = y * tt - m * et, K = m * tt + y * et;
2604
+ H[Y + 0] = nt + C[0], H[Y + 1] = K + C[1];
2422
2605
  }
2423
- return z;
2606
+ return H;
2424
2607
  });
2425
- }, z0;
2608
+ }, $t;
2426
2609
  }
2427
- var U0, wt;
2428
- function T1() {
2429
- if (wt) return U0;
2430
- wt = 1;
2610
+ var Yt, C0;
2611
+ function R1() {
2612
+ if (C0) return Yt;
2613
+ C0 = 1;
2431
2614
  var n = 1e-10, e = Math.PI / 180;
2432
2615
  function t(o, i, a) {
2433
2616
  if (!(this instanceof t))
@@ -2440,24 +2623,24 @@ function T1() {
2440
2623
  this.rx * (o[1] * i + o[3] * a),
2441
2624
  this.ry * (-o[0] * a + o[2] * i),
2442
2625
  this.ry * (-o[1] * a + o[3] * i)
2443
- ], 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;
2444
- if (c < n * f)
2445
- return this.rx = this.ry = Math.sqrt(f), this.ax = 0, this;
2626
+ ], r = s[0] * s[0] + s[2] * s[2], h = s[1] * s[1] + s[3] * s[3], u = ((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])), c = (r + h) / 2;
2627
+ if (u < n * c)
2628
+ return this.rx = this.ry = Math.sqrt(c), this.ax = 0, this;
2446
2629
  var d = s[0] * s[1] + s[2] * s[3];
2447
- c = Math.sqrt(c);
2448
- var l = f + c / 2, u = f - c / 2;
2630
+ u = Math.sqrt(u);
2631
+ var l = c + u / 2, f = c - u / 2;
2449
2632
  return this.ax = Math.abs(d) < n && Math.abs(l - h) < n ? 90 : Math.atan(
2450
2633
  Math.abs(d) > Math.abs(l - h) ? (l - r) / d : d / (l - h)
2451
- ) * 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;
2634
+ ) * 180 / Math.PI, this.ax >= 0 ? (this.rx = Math.sqrt(l), this.ry = Math.sqrt(f)) : (this.ax += 90, this.rx = Math.sqrt(f), this.ry = Math.sqrt(l)), this;
2452
2635
  }, t.prototype.isDegenerate = function() {
2453
2636
  return this.rx < n * this.ry || this.ry < n * this.rx;
2454
- }, U0 = t, U0;
2637
+ }, Yt = t, Yt;
2455
2638
  }
2456
- var Y0, mt;
2457
- function P1() {
2458
- if (mt) return Y0;
2459
- mt = 1;
2460
- var n = b1(), e = M1(), t = Bt(), o = L1(), i = T1();
2639
+ var Wt, P0;
2640
+ function B1() {
2641
+ if (P0) return Wt;
2642
+ P0 = 1;
2643
+ var n = O1(), e = F1(), t = G0(), o = N1(), i = R1();
2461
2644
  function a(s) {
2462
2645
  if (!(this instanceof a))
2463
2646
  return new a(s);
@@ -2477,39 +2660,39 @@ function P1() {
2477
2660
  throw new Error("SvgPath.from: invalid param type " + s);
2478
2661
  }, a.prototype.__matrix = function(s) {
2479
2662
  var r = this, h;
2480
- s.queue.length && this.iterate(function(c, f, d, l) {
2481
- var u, m, y, M;
2482
- switch (c[0]) {
2663
+ s.queue.length && this.iterate(function(u, c, d, l) {
2664
+ var f, m, y, M;
2665
+ switch (u[0]) {
2483
2666
  // Process 'assymetric' commands separately
2484
2667
  case "v":
2485
- u = s.calc(0, c[1], !0), m = u[0] === 0 ? ["v", u[1]] : ["l", u[0], u[1]];
2668
+ f = s.calc(0, u[1], !0), m = f[0] === 0 ? ["v", f[1]] : ["l", f[0], f[1]];
2486
2669
  break;
2487
2670
  case "V":
2488
- u = s.calc(d, c[1], !1), m = u[0] === s.calc(d, l, !1)[0] ? ["V", u[1]] : ["L", u[0], u[1]];
2671
+ f = s.calc(d, u[1], !1), m = f[0] === s.calc(d, l, !1)[0] ? ["V", f[1]] : ["L", f[0], f[1]];
2489
2672
  break;
2490
2673
  case "h":
2491
- u = s.calc(c[1], 0, !0), m = u[1] === 0 ? ["h", u[0]] : ["l", u[0], u[1]];
2674
+ f = s.calc(u[1], 0, !0), m = f[1] === 0 ? ["h", f[0]] : ["l", f[0], f[1]];
2492
2675
  break;
2493
2676
  case "H":
2494
- u = s.calc(c[1], l, !1), m = u[1] === s.calc(d, l, !1)[1] ? ["H", u[0]] : ["L", u[0], u[1]];
2677
+ f = s.calc(u[1], l, !1), m = f[1] === s.calc(d, l, !1)[1] ? ["H", f[0]] : ["L", f[0], f[1]];
2495
2678
  break;
2496
2679
  case "a":
2497
2680
  case "A":
2498
- var T = s.toArray(), S = i(c[1], c[2], c[3]).transform(T);
2499
- 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) {
2500
- m = [c[0] === "a" ? "l" : "L", u[0], u[1]];
2681
+ var E = s.toArray(), L = i(u[1], u[2], u[3]).transform(E);
2682
+ if (E[0] * E[3] - E[1] * E[2] < 0 && (u[5] = u[5] ? "0" : "1"), f = s.calc(u[6], u[7], u[0] === "a"), u[0] === "A" && u[6] === d && u[7] === l || u[0] === "a" && u[6] === 0 && u[7] === 0) {
2683
+ m = [u[0] === "a" ? "l" : "L", f[0], f[1]];
2501
2684
  break;
2502
2685
  }
2503
- 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]];
2686
+ L.isDegenerate() ? m = [u[0] === "a" ? "l" : "L", f[0], f[1]] : m = [u[0], L.rx, L.ry, L.ax, u[4], u[5], f[0], f[1]];
2504
2687
  break;
2505
2688
  case "m":
2506
- M = f > 0, u = s.calc(c[1], c[2], M), m = ["m", u[0], u[1]];
2689
+ M = c > 0, f = s.calc(u[1], u[2], M), m = ["m", f[0], f[1]];
2507
2690
  break;
2508
2691
  default:
2509
- for (y = c[0], m = [y], M = y.toLowerCase() === y, h = 1; h < c.length; h += 2)
2510
- u = s.calc(c[h], c[h + 1], M), m.push(u[0], u[1]);
2692
+ for (y = u[0], m = [y], M = y.toLowerCase() === y, h = 1; h < u.length; h += 2)
2693
+ f = s.calc(u[h], u[h + 1], M), m.push(f[0], f[1]);
2511
2694
  }
2512
- r.segments[f] = m;
2695
+ r.segments[c] = m;
2513
2696
  }, !0);
2514
2697
  }, a.prototype.__evaluateStack = function() {
2515
2698
  var s, r;
@@ -2525,12 +2708,12 @@ function P1() {
2525
2708
  }, a.prototype.toString = function() {
2526
2709
  var s = "", r = "", h = !1;
2527
2710
  this.__evaluateStack();
2528
- for (var c = 0, f = this.segments.length; c < f; c++) {
2529
- var d = this.segments[c], l = d[0];
2711
+ for (var u = 0, c = this.segments.length; u < c; u++) {
2712
+ var d = this.segments[u], l = d[0];
2530
2713
  l !== r || l === "m" || l === "M" ? (l === "m" && r === "z" && (s += " "), s += l, h = !1) : h = !0;
2531
- for (var u = 1; u < d.length; u++) {
2532
- var m = d[u];
2533
- u === 1 ? h && m >= 0 && (s += " ") : m >= 0 && (s += " "), s += m;
2714
+ for (var f = 1; f < d.length; f++) {
2715
+ var m = d[f];
2716
+ f === 1 ? h && m >= 0 && (s += " ") : m >= 0 && (s += " "), s += m;
2534
2717
  }
2535
2718
  r = l;
2536
2719
  }
@@ -2550,124 +2733,124 @@ function P1() {
2550
2733
  }, a.prototype.transform = function(s) {
2551
2734
  return s.trim() ? (this.__stack.push(e(s)), this) : this;
2552
2735
  }, a.prototype.round = function(s) {
2553
- var r = 0, h = 0, c = 0, f = 0, d;
2736
+ var r = 0, h = 0, u = 0, c = 0, d;
2554
2737
  return s = s || 0, this.__evaluateStack(), this.segments.forEach(function(l) {
2555
- var u = l[0].toLowerCase() === l[0];
2738
+ var f = l[0].toLowerCase() === l[0];
2556
2739
  switch (l[0]) {
2557
2740
  case "H":
2558
2741
  case "h":
2559
- u && (l[1] += c), c = l[1] - l[1].toFixed(s), l[1] = +l[1].toFixed(s);
2742
+ f && (l[1] += u), u = l[1] - l[1].toFixed(s), l[1] = +l[1].toFixed(s);
2560
2743
  return;
2561
2744
  case "V":
2562
2745
  case "v":
2563
- u && (l[1] += f), f = l[1] - l[1].toFixed(s), l[1] = +l[1].toFixed(s);
2746
+ f && (l[1] += c), c = l[1] - l[1].toFixed(s), l[1] = +l[1].toFixed(s);
2564
2747
  return;
2565
2748
  case "Z":
2566
2749
  case "z":
2567
- c = r, f = h;
2750
+ u = r, c = h;
2568
2751
  return;
2569
2752
  case "M":
2570
2753
  case "m":
2571
- u && (l[1] += c, l[2] += f), c = l[1] - l[1].toFixed(s), f = l[2] - l[2].toFixed(s), r = c, h = f, l[1] = +l[1].toFixed(s), l[2] = +l[2].toFixed(s);
2754
+ f && (l[1] += u, l[2] += c), u = l[1] - l[1].toFixed(s), c = l[2] - l[2].toFixed(s), r = u, h = c, l[1] = +l[1].toFixed(s), l[2] = +l[2].toFixed(s);
2572
2755
  return;
2573
2756
  case "A":
2574
2757
  case "a":
2575
- 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);
2758
+ f && (l[6] += u, l[7] += c), u = l[6] - l[6].toFixed(s), c = 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);
2576
2759
  return;
2577
2760
  default:
2578
- 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) {
2761
+ d = l.length, f && (l[d - 2] += u, l[d - 1] += c), u = l[d - 2] - l[d - 2].toFixed(s), c = l[d - 1] - l[d - 1].toFixed(s), l.forEach(function(m, y) {
2579
2762
  y && (l[y] = +l[y].toFixed(s));
2580
2763
  });
2581
2764
  return;
2582
2765
  }
2583
2766
  }), this;
2584
2767
  }, a.prototype.iterate = function(s, r) {
2585
- var h = this.segments, c = {}, f = !1, d = 0, l = 0, u = 0, m = 0, y, M, T;
2586
- if (r || this.__evaluateStack(), h.forEach(function(S, P) {
2587
- var E = s(S, P, d, l);
2588
- Array.isArray(E) && (c[P] = E, f = !0);
2589
- var C = S[0] === S[0].toLowerCase();
2590
- switch (S[0]) {
2768
+ var h = this.segments, u = {}, c = !1, d = 0, l = 0, f = 0, m = 0, y, M, E;
2769
+ if (r || this.__evaluateStack(), h.forEach(function(L, C) {
2770
+ var S = s(L, C, d, l);
2771
+ Array.isArray(S) && (u[C] = S, c = !0);
2772
+ var T = L[0] === L[0].toLowerCase();
2773
+ switch (L[0]) {
2591
2774
  case "m":
2592
2775
  case "M":
2593
- d = S[1] + (C ? d : 0), l = S[2] + (C ? l : 0), u = d, m = l;
2776
+ d = L[1] + (T ? d : 0), l = L[2] + (T ? l : 0), f = d, m = l;
2594
2777
  return;
2595
2778
  case "h":
2596
2779
  case "H":
2597
- d = S[1] + (C ? d : 0);
2780
+ d = L[1] + (T ? d : 0);
2598
2781
  return;
2599
2782
  case "v":
2600
2783
  case "V":
2601
- l = S[1] + (C ? l : 0);
2784
+ l = L[1] + (T ? l : 0);
2602
2785
  return;
2603
2786
  case "z":
2604
2787
  case "Z":
2605
- d = u, l = m;
2788
+ d = f, l = m;
2606
2789
  return;
2607
2790
  default:
2608
- d = S[S.length - 2] + (C ? d : 0), l = S[S.length - 1] + (C ? l : 0);
2791
+ d = L[L.length - 2] + (T ? d : 0), l = L[L.length - 1] + (T ? l : 0);
2609
2792
  }
2610
- }), !f)
2793
+ }), !c)
2611
2794
  return this;
2612
- for (T = [], y = 0; y < h.length; y++)
2613
- if (typeof c[y] < "u")
2614
- for (M = 0; M < c[y].length; M++)
2615
- T.push(c[y][M]);
2795
+ for (E = [], y = 0; y < h.length; y++)
2796
+ if (typeof u[y] < "u")
2797
+ for (M = 0; M < u[y].length; M++)
2798
+ E.push(u[y][M]);
2616
2799
  else
2617
- T.push(h[y]);
2618
- return this.segments = T, this;
2800
+ E.push(h[y]);
2801
+ return this.segments = E, this;
2619
2802
  }, a.prototype.abs = function() {
2620
- return this.iterate(function(s, r, h, c) {
2621
- var f = s[0], d = f.toUpperCase(), l;
2622
- if (f !== d)
2623
- switch (s[0] = d, f) {
2803
+ return this.iterate(function(s, r, h, u) {
2804
+ var c = s[0], d = c.toUpperCase(), l;
2805
+ if (c !== d)
2806
+ switch (s[0] = d, c) {
2624
2807
  case "v":
2625
- s[1] += c;
2808
+ s[1] += u;
2626
2809
  return;
2627
2810
  case "a":
2628
- s[6] += h, s[7] += c;
2811
+ s[6] += h, s[7] += u;
2629
2812
  return;
2630
2813
  default:
2631
2814
  for (l = 1; l < s.length; l++)
2632
- s[l] += l % 2 ? h : c;
2815
+ s[l] += l % 2 ? h : u;
2633
2816
  }
2634
2817
  }, !0), this;
2635
2818
  }, a.prototype.rel = function() {
2636
- return this.iterate(function(s, r, h, c) {
2637
- var f = s[0], d = f.toLowerCase(), l;
2638
- if (f !== d && !(r === 0 && f === "M"))
2639
- switch (s[0] = d, f) {
2819
+ return this.iterate(function(s, r, h, u) {
2820
+ var c = s[0], d = c.toLowerCase(), l;
2821
+ if (c !== d && !(r === 0 && c === "M"))
2822
+ switch (s[0] = d, c) {
2640
2823
  case "V":
2641
- s[1] -= c;
2824
+ s[1] -= u;
2642
2825
  return;
2643
2826
  case "A":
2644
- s[6] -= h, s[7] -= c;
2827
+ s[6] -= h, s[7] -= u;
2645
2828
  return;
2646
2829
  default:
2647
2830
  for (l = 1; l < s.length; l++)
2648
- s[l] -= l % 2 ? h : c;
2831
+ s[l] -= l % 2 ? h : u;
2649
2832
  }
2650
2833
  }, !0), this;
2651
2834
  }, a.prototype.unarc = function() {
2652
- return this.iterate(function(s, r, h, c) {
2653
- var f, d, l, u = [], m = s[0];
2654
- 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) {
2655
- u.push(["C", y[2], y[3], y[4], y[5], y[6], y[7]]);
2656
- }), u));
2835
+ return this.iterate(function(s, r, h, u) {
2836
+ var c, d, l, f = [], m = s[0];
2837
+ return m !== "A" && m !== "a" ? null : (m === "a" ? (d = h + s[6], l = u + s[7]) : (d = s[6], l = s[7]), c = o(h, u, d, l, s[4], s[5], s[1], s[2], s[3]), c.length === 0 ? [[s[0] === "a" ? "l" : "L", s[6], s[7]]] : (c.forEach(function(y) {
2838
+ f.push(["C", y[2], y[3], y[4], y[5], y[6], y[7]]);
2839
+ }), f));
2657
2840
  }), this;
2658
2841
  }, a.prototype.unshort = function() {
2659
- var s = this.segments, r, h, c, f, d;
2660
- return this.iterate(function(l, u, m, y) {
2661
- var M = l[0], T = M.toUpperCase(), S;
2662
- 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] = [
2663
- S ? "q" : "Q",
2664
- f,
2842
+ var s = this.segments, r, h, u, c, d;
2843
+ return this.iterate(function(l, f, m, y) {
2844
+ var M = l[0], E = M.toUpperCase(), L;
2845
+ f && (E === "T" ? (L = M === "t", u = s[f - 1], u[0] === "Q" ? (r = u[1] - m, h = u[2] - y) : u[0] === "q" ? (r = u[1] - u[3], h = u[2] - u[4]) : (r = 0, h = 0), c = -r, d = -h, L || (c += m, d += y), s[f] = [
2846
+ L ? "q" : "Q",
2847
+ c,
2665
2848
  d,
2666
2849
  l[1],
2667
2850
  l[2]
2668
- ]) : 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] = [
2669
- S ? "c" : "C",
2670
- f,
2851
+ ]) : E === "S" && (L = M === "s", u = s[f - 1], u[0] === "C" ? (r = u[3] - m, h = u[4] - y) : u[0] === "c" ? (r = u[3] - u[5], h = u[4] - u[6]) : (r = 0, h = 0), c = -r, d = -h, L || (c += m, d += y), s[f] = [
2852
+ L ? "c" : "C",
2853
+ c,
2671
2854
  d,
2672
2855
  l[1],
2673
2856
  l[2],
@@ -2675,41 +2858,41 @@ function P1() {
2675
2858
  l[4]
2676
2859
  ]));
2677
2860
  }), this;
2678
- }, Y0 = a, Y0;
2861
+ }, Wt = a, Wt;
2679
2862
  }
2680
- var H0, At;
2681
- function C1() {
2682
- return At || (At = 1, H0 = P1()), H0;
2863
+ var Xt, E0;
2864
+ function D1() {
2865
+ return E0 || (E0 = 1, Xt = B1()), Xt;
2683
2866
  }
2684
- var S1 = C1();
2685
- const E1 = /* @__PURE__ */ A1(S1);
2686
- var X0 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, k1 = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
2687
- function I1(n) {
2867
+ var q1 = D1();
2868
+ const z1 = /* @__PURE__ */ _1(q1);
2869
+ var Gt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, j1 = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
2870
+ function H1(n) {
2688
2871
  var e = [];
2689
- return n.replace(k1, function(t, o, i) {
2872
+ return n.replace(j1, function(t, o, i) {
2690
2873
  var a = o.toLowerCase();
2691
- for (i = O1(i), a === "m" && i.length > 2 && (e.push([o].concat(i.splice(0, 2))), a = "l", o = o === "m" ? "l" : "L"); i.length >= 0; ) {
2692
- if (i.length === X0[a])
2874
+ for (i = $1(i), a === "m" && i.length > 2 && (e.push([o].concat(i.splice(0, 2))), a = "l", o = o === "m" ? "l" : "L"); i.length >= 0; ) {
2875
+ if (i.length === Gt[a])
2693
2876
  return i.unshift(o), e.push(i);
2694
- if (i.length < X0[a])
2877
+ if (i.length < Gt[a])
2695
2878
  throw new Error("malformed path data");
2696
- e.push([o].concat(i.splice(0, X0[a])));
2879
+ e.push([o].concat(i.splice(0, Gt[a])));
2697
2880
  }
2698
2881
  }), e;
2699
2882
  }
2700
- var _1 = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
2701
- function O1(n) {
2702
- var e = n.match(_1);
2883
+ var U1 = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
2884
+ function $1(n) {
2885
+ var e = n.match(U1);
2703
2886
  return e ? e.map(Number) : [];
2704
2887
  }
2705
- function i0(n, e, t, o, i, a, s, r) {
2706
- return new Z0(n, e, t, o, i, a, s, r);
2888
+ function it(n, e, t, o, i, a, s, r) {
2889
+ return new Jt(n, e, t, o, i, a, s, r);
2707
2890
  }
2708
- function Z0(n, e, t, o, i, a, s, r) {
2709
- 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 = Y1, this.getPoint = N1, this.getDerivative = R1) : (this.getArcLength = B1, this.getPoint = qt, this.getDerivative = F1), this.init();
2891
+ function Jt(n, e, t, o, i, a, s, r) {
2892
+ 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 = tn, this.getPoint = X1, this.getDerivative = W1) : (this.getArcLength = G1, this.getPoint = Z0, this.getDerivative = Y1), this.init();
2710
2893
  }
2711
- Z0.prototype = {
2712
- constructor: Z0,
2894
+ Jt.prototype = {
2895
+ constructor: Jt,
2713
2896
  init: function() {
2714
2897
  this.length = this.getArcLength(
2715
2898
  [this.a.x, this.b.x, this.c.x, this.d.x],
@@ -2720,7 +2903,7 @@ Z0.prototype = {
2720
2903
  return this.length;
2721
2904
  },
2722
2905
  getPointAtLength: function(n) {
2723
- var e = $0(
2906
+ var e = Zt(
2724
2907
  n,
2725
2908
  this.length,
2726
2909
  this.getArcLength,
@@ -2734,7 +2917,7 @@ Z0.prototype = {
2734
2917
  );
2735
2918
  },
2736
2919
  getTangentAtLength: function(n) {
2737
- var e = $0(
2920
+ var e = Zt(
2738
2921
  n,
2739
2922
  this.length,
2740
2923
  this.getArcLength,
@@ -2748,7 +2931,7 @@ Z0.prototype = {
2748
2931
  return o > 0 ? i = { x: t.x / o, y: t.y / o } : i = { x: 0, y: 0 }, i;
2749
2932
  },
2750
2933
  getPropertiesAtLength: function(n) {
2751
- var e = $0(
2934
+ var e = Zt(
2752
2935
  n,
2753
2936
  this.length,
2754
2937
  this.getArcLength,
@@ -2768,46 +2951,46 @@ Z0.prototype = {
2768
2951
  return { x: a.x, y: a.y, tangentX: i.x, tangentY: i.y };
2769
2952
  }
2770
2953
  };
2771
- function F1(n, e, t) {
2954
+ function Y1(n, e, t) {
2772
2955
  return {
2773
2956
  x: (1 - t) * 2 * (n[1] - n[0]) + t * 2 * (n[2] - n[1]),
2774
2957
  y: (1 - t) * 2 * (e[1] - e[0]) + t * 2 * (e[2] - e[1])
2775
2958
  };
2776
2959
  }
2777
- function R1(n, e, t) {
2778
- var o = qt(
2960
+ function W1(n, e, t) {
2961
+ var o = Z0(
2779
2962
  [3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])],
2780
2963
  [3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])],
2781
2964
  t
2782
2965
  );
2783
2966
  return o;
2784
2967
  }
2785
- function $0(n, e, t, o, i) {
2968
+ function Zt(n, e, t, o, i) {
2786
2969
  for (var a = 1, s = n / e, r = (n - t(o, i, s)) / e; a > 1e-3; ) {
2787
- 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;
2788
- f < a ? (a = f, s += r) : d < a ? (a = d, s -= r) : r /= 2;
2970
+ var h = t(o, i, s + r), u = t(o, i, s - r), c = Math.abs(n - h) / e, d = Math.abs(n - u) / e;
2971
+ c < a ? (a = c, s += r) : d < a ? (a = d, s -= r) : r /= 2;
2789
2972
  }
2790
2973
  return s;
2791
2974
  }
2792
- function qt(n, e, t) {
2975
+ function Z0(n, e, t) {
2793
2976
  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];
2794
2977
  return { x: o, y: i };
2795
2978
  }
2796
- function N1(n, e, t) {
2979
+ function X1(n, e, t) {
2797
2980
  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];
2798
2981
  return { x: o, y: i };
2799
2982
  }
2800
- function B1(n, e, t) {
2983
+ function G1(n, e, t) {
2801
2984
  t === void 0 && (t = 1);
2802
- 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;
2985
+ 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), u = a * a + s * s;
2803
2986
  if (r === 0)
2804
2987
  return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
2805
- var f = h / (2 * r), d = c / r, l = t + f, u = d - f * f;
2806
- return Math.sqrt(r) / 2 * (l * Math.sqrt(l * l + u) - f * Math.sqrt(f * f + u) + u * Math.log(Math.abs(
2807
- (l + Math.sqrt(l * l + u)) / (f + Math.sqrt(f * f + u))
2988
+ var c = h / (2 * r), d = u / r, l = t + c, f = d - c * c;
2989
+ return Math.sqrt(r) / 2 * (l * Math.sqrt(l * l + f) - c * Math.sqrt(c * c + f) + f * Math.log(Math.abs(
2990
+ (l + Math.sqrt(l * l + f)) / (c + Math.sqrt(c * c + f))
2808
2991
  )));
2809
2992
  }
2810
- var q1 = [
2993
+ var Z1 = [
2811
2994
  [],
2812
2995
  [],
2813
2996
  [-0.5773502691896257, 0.5773502691896257],
@@ -2833,7 +3016,7 @@ var q1 = [
2833
3016
  [-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],
2834
3017
  [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],
2835
3018
  [-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]
2836
- ], D1 = [
3019
+ ], V1 = [
2837
3020
  [],
2838
3021
  [],
2839
3022
  [1, 1],
@@ -2859,86 +3042,86 @@ var q1 = [
2859
3042
  [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],
2860
3043
  [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],
2861
3044
  [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]
2862
- ], j1 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
2863
- function z1(n, e) {
2864
- return j1[n][e];
3045
+ ], K1 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
3046
+ function Q1(n, e) {
3047
+ return K1[n][e];
2865
3048
  }
2866
- function V0(n, e, t) {
3049
+ function t0(n, e, t) {
2867
3050
  var o = t.length - 1, i, a, s;
2868
3051
  if (o === 0)
2869
3052
  return 0;
2870
3053
  if (n === 0) {
2871
3054
  for (a = 0, s = 0; s <= o; s++)
2872
- a += z1(o, s) * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
3055
+ a += Q1(o, s) * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
2873
3056
  return a;
2874
3057
  } else {
2875
3058
  for (i = new Array(o), s = 0; s < o; s++)
2876
3059
  i[s] = o * (t[s + 1] - t[s]);
2877
- return V0(n - 1, e, i);
3060
+ return t0(n - 1, e, i);
2878
3061
  }
2879
3062
  }
2880
- function U1(n, e, t) {
2881
- var o = V0(1, t, n), i = V0(1, t, e), a = o * o + i * i;
3063
+ function J1(n, e, t) {
3064
+ var o = t0(1, t, n), i = t0(1, t, e), a = o * o + i * i;
2882
3065
  return Math.sqrt(a);
2883
3066
  }
2884
- function Y1(n, e, t) {
3067
+ function tn(n, e, t) {
2885
3068
  var o, i, a, s;
2886
3069
  t === void 0 && (t = 1);
2887
3070
  var r = 20;
2888
3071
  for (o = t / 2, i = 0, a = 0; a < r; a++)
2889
- s = o * q1[r][a] + o, i += D1[r][a] * U1(n, e, s);
3072
+ s = o * Z1[r][a] + o, i += V1[r][a] * J1(n, e, s);
2890
3073
  return o * i;
2891
3074
  }
2892
- var C0 = Math.PI * 2;
2893
- function bt(n, e, t, o) {
3075
+ var Pt = Math.PI * 2;
3076
+ function S0(n, e, t, o) {
2894
3077
  var i = n * o - e * t < 0 ? -1 : 1, a = n * t + e * o;
2895
3078
  return a > 1 && (a = 1), a < -1 && (a = -1), i * Math.acos(a);
2896
3079
  }
2897
- function H1(n, e, t, o, i, a, s, r, h, c) {
2898
- 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;
2899
- M < 0 && (M = 0), M /= l * y + u * m, M = Math.sqrt(M) * (i === a ? -1 : 1);
2900
- 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);
2901
- return a === 0 && H > 0 && (H -= C0), a === 1 && H < 0 && (H += C0), [P, E, z, H];
3080
+ function en(n, e, t, o, i, a, s, r, h, u) {
3081
+ var c = u * (n - t) / 2 + h * (e - o) / 2, d = -h * (n - t) / 2 + u * (e - o) / 2, l = s * s, f = r * r, m = c * c, y = d * d, M = l * f - l * y - f * m;
3082
+ M < 0 && (M = 0), M /= l * y + f * m, M = Math.sqrt(M) * (i === a ? -1 : 1);
3083
+ var E = M * s / r * d, L = M * -r / s * c, C = u * E - h * L + (n + t) / 2, S = h * E + u * L + (e + o) / 2, T = (c - E) / s, I = (d - L) / r, R = (-c - E) / s, X = (-d - L) / r, H = S0(1, 0, T, I), Y = S0(T, I, R, X);
3084
+ return a === 0 && Y > 0 && (Y -= Pt), a === 1 && Y < 0 && (Y += Pt), [C, S, H, Y];
2902
3085
  }
2903
- function X1(n, e) {
3086
+ function nn(n, e) {
2904
3087
  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);
2905
3088
  return [o, i, o - i * t, i + o * t, a + s * t, s - a * t, a, s];
2906
3089
  }
2907
- function $1(n, e, t, o, i, a, s, r, h) {
2908
- 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;
3090
+ function rn(n, e, t, o, i, a, s, r, h) {
3091
+ var u = Math.sin(i * Pt / 360), c = Math.cos(i * Pt / 360), d = c * (n - r) / 2 + u * (e - h) / 2, l = -u * (n - r) / 2 + c * (e - h) / 2;
2909
3092
  if (d === 0 && l === 0)
2910
3093
  return [];
2911
3094
  if (t === 0 || o === 0)
2912
3095
  return [];
2913
3096
  t = Math.abs(t), o = Math.abs(o);
2914
- var u = d * d / (t * t) + l * l / (o * o);
2915
- u > 1 && (t *= Math.sqrt(u), o *= Math.sqrt(u));
2916
- var m = H1(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);
2917
- T /= S;
2918
- for (var P = 0; P < S; P++)
2919
- y.push(X1(M, T)), M += T;
2920
- return y.map(function(E) {
2921
- for (var C = 0; C < E.length; C += 2) {
2922
- var O = E[C + 0], R = E[C + 1];
2923
- O *= t, R *= o;
2924
- var G = f * O - c * R, z = c * O + f * R;
2925
- E[C + 0] = G + m[0], E[C + 1] = z + m[1];
3097
+ var f = d * d / (t * t) + l * l / (o * o);
3098
+ f > 1 && (t *= Math.sqrt(f), o *= Math.sqrt(f));
3099
+ var m = en(n, e, r, h, a, s, t, o, u, c), y = [], M = m[2], E = m[3], L = Math.max(Math.ceil(Math.abs(E) / (Pt / 4)), 1);
3100
+ E /= L;
3101
+ for (var C = 0; C < L; C++)
3102
+ y.push(nn(M, E)), M += E;
3103
+ return y.map(function(S) {
3104
+ for (var T = 0; T < S.length; T += 2) {
3105
+ var I = S[T + 0], R = S[T + 1];
3106
+ I *= t, R *= o;
3107
+ var X = c * I - u * R, H = u * I + c * R;
3108
+ S[T + 0] = X + m[0], S[T + 1] = H + m[1];
2926
3109
  }
2927
- return E;
3110
+ return S;
2928
3111
  });
2929
3112
  }
2930
- function Mt(n, e, t, o, i, a, s, r, h) {
2931
- return new K0(n, e, t, o, i, a, s, r, h);
3113
+ function k0(n, e, t, o, i, a, s, r, h) {
3114
+ return new e0(n, e, t, o, i, a, s, r, h);
2932
3115
  }
2933
- function K0(n, e, t, o, i, a, s, r, h) {
2934
- var c = 0, f = [], d = [], l = $1(n, e, t, o, i, a, s, r, h);
2935
- l.forEach(function(u) {
2936
- var m = new i0(u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]), y = m.getTotalLength();
2937
- c += y, f.push(y), d.push(m);
2938
- }), this.length = c, this.partialLengths = f, this.curves = d;
3116
+ function e0(n, e, t, o, i, a, s, r, h) {
3117
+ var u = 0, c = [], d = [], l = rn(n, e, t, o, i, a, s, r, h);
3118
+ l.forEach(function(f) {
3119
+ var m = new it(f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]), y = m.getTotalLength();
3120
+ u += y, c.push(y), d.push(m);
3121
+ }), this.length = u, this.partialLengths = c, this.curves = d;
2939
3122
  }
2940
- K0.prototype = {
2941
- constructor: K0,
3123
+ e0.prototype = {
3124
+ constructor: e0,
2942
3125
  init: function() {
2943
3126
  },
2944
3127
  getTotalLength: function() {
@@ -2967,34 +3150,34 @@ K0.prototype = {
2967
3150
  return { x: t.x, y: t.y, tangentX: e.x, tangentY: e.y };
2968
3151
  }
2969
3152
  };
2970
- function r0(n, e, t, o) {
2971
- return new k0(n, e, t, o);
3153
+ function rt(n, e, t, o) {
3154
+ return new kt(n, e, t, o);
2972
3155
  }
2973
- function k0(n, e, t, o) {
3156
+ function kt(n, e, t, o) {
2974
3157
  this.x0 = n, this.x1 = e, this.y0 = t, this.y1 = o;
2975
3158
  }
2976
- k0.prototype.getTotalLength = function() {
3159
+ kt.prototype.getTotalLength = function() {
2977
3160
  return Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
2978
3161
  };
2979
- k0.prototype.getPointAtLength = function(n) {
3162
+ kt.prototype.getPointAtLength = function(n) {
2980
3163
  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;
2981
3164
  return { x: this.x0 + t, y: this.y0 + o };
2982
3165
  };
2983
- k0.prototype.getTangentAtLength = function() {
3166
+ kt.prototype.getTangentAtLength = function() {
2984
3167
  var n = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
2985
3168
  return { x: (this.x1 - this.x0) / n, y: (this.y1 - this.y0) / n };
2986
3169
  };
2987
- k0.prototype.getPropertiesAtLength = function(n) {
3170
+ kt.prototype.getPropertiesAtLength = function(n) {
2988
3171
  var e = this.getPointAtLength(n), t = this.getTangentAtLength();
2989
3172
  return { x: e.x, y: e.y, tangentX: t.x, tangentY: t.y };
2990
3173
  };
2991
- function G1(n) {
3174
+ function on(n) {
2992
3175
  var e = 0, t = [], o = [];
2993
3176
  function i(s) {
2994
3177
  if (!s)
2995
3178
  return null;
2996
- for (var r = I1(s), h = [0, 0], c = [0, 0], f, d, l = 0; l < r.length; l++)
2997
- 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);
3179
+ for (var r = H1(s), h = [0, 0], u = [0, 0], c, d, l = 0; l < r.length; l++)
3180
+ 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 rt(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 rt(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 rt(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 rt(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 rt(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 rt(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 rt(h[0], d[0], h[1], d[1])), h = [d[0], d[1]]) : r[l][0] === "C" ? (c = new it(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], r[l][6]), e = e + c.getTotalLength(), h = [r[l][5], r[l][6]], o.push(c)) : r[l][0] === "c" ? (c = new it(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 + c.getTotalLength(), h = [r[l][5] + h[0], r[l][6] + h[1]], o.push(c)) : r[l][0] === "S" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? c = new it(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]) : c = new it(h[0], h[1], h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]), e = e + c.getTotalLength(), h = [r[l][3], r[l][4]], o.push(c)) : r[l][0] === "s" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? c = new it(h[0], h[1], h[0] + c.d.x - c.c.x, h[1] + c.d.y - c.c.y, h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]) : c = new it(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 + c.getTotalLength(), h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(c)) : r[l][0] === "Q" ? (h[0] != r[l][1] && h[1] != r[l][2] ? c = new it(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]) : c = new rt(r[l][1], r[l][3], r[l][2], r[l][4]), e = e + c.getTotalLength(), o.push(c), h = [r[l][3], r[l][4]], u = [r[l][1], r[l][2]]) : r[l][0] === "q" ? (r[l][1] == 0 && r[l][2] == 0 ? c = new rt(h[0] + r[l][1], h[0] + r[l][3], h[1] + r[l][2], h[1] + r[l][4]) : c = new it(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 + c.getTotalLength(), u = [h[0] + r[l][1], h[1] + r[l][2]], h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(c)) : r[l][0] === "T" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? c = new it(h[0], h[1], 2 * h[0] - u[0], 2 * h[1] - u[1], r[l][1], r[l][2]) : c = new rt(h[0], r[l][1], h[1], r[l][2]), o.push(c), e = e + c.getTotalLength(), u = [2 * h[0] - u[0], 2 * h[1] - u[1]], h = [r[l][1], r[l][2]]) : r[l][0] === "t" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? c = new it(h[0], h[1], 2 * h[0] - u[0], 2 * h[1] - u[1], h[0] + r[l][1], h[1] + r[l][2]) : c = new rt(h[0], h[0] + r[l][1], h[1], h[1] + r[l][2]), e = e + c.getTotalLength(), u = [2 * h[0] - u[0], 2 * h[1] - u[1]], h = [r[l][1] + h[0], r[l][2] + h[0]], o.push(c)) : r[l][0] === "A" ? (c = new k0(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 + c.getTotalLength(), h = [r[l][6], r[l][7]], o.push(c)) : r[l][0] === "a" && (c = new k0(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 + c.getTotalLength(), h = [h[0] + r[l][6], h[1] + r[l][7]], o.push(c)), t.push(e);
2998
3181
  return i;
2999
3182
  }
3000
3183
  i.getTotalLength = function() {
@@ -3017,49 +3200,49 @@ function G1(n) {
3017
3200
  };
3018
3201
  return i(n);
3019
3202
  }
3020
- function O0(n, e) {
3203
+ function Nt(n, e) {
3021
3204
  return Math.sqrt((n[0] - e[0]) * (n[0] - e[0]) + (n[1] - e[1]) * (n[1] - e[1]));
3022
3205
  }
3023
- function Dt(n, e, t) {
3206
+ function V0(n, e, t) {
3024
3207
  return [n[0] + (e[0] - n[0]) * t, n[1] + (e[1] - n[1]) * t];
3025
3208
  }
3026
- function W1(n, e) {
3027
- return O0(n, e) < 1e-9;
3209
+ function sn(n, e) {
3210
+ return Nt(n, e) < 1e-9;
3028
3211
  }
3029
- function Z1(n, e, t) {
3030
- let o = n.map((i, a) => V1(i, e[a]));
3212
+ function an(n, e, t) {
3213
+ let o = n.map((i, a) => hn(i, e[a]));
3031
3214
  return function(i) {
3032
3215
  let a = o.map((s) => s(i));
3033
- return t ? J1(a) : a;
3216
+ return t ? un(a) : a;
3034
3217
  };
3035
3218
  }
3036
- function V1(n, e) {
3219
+ function hn(n, e) {
3037
3220
  return function(t) {
3038
3221
  return n.map((o, i) => o + t * (e[i] - o));
3039
3222
  };
3040
3223
  }
3041
- function _0(n) {
3224
+ function Ft(n) {
3042
3225
  return typeof n == "number" && isFinite(n);
3043
3226
  }
3044
- const Q0 = `All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).
3227
+ const n0 = `All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).
3045
3228
  Example valid ways of supplying a shape would be:
3046
3229
  [[0, 0], [10, 0], [10, 10]]
3047
3230
  "M0,0 L10,0 L10,10Z"
3048
3231
  `;
3049
- function K1(n) {
3050
- return new E1(n).abs();
3232
+ function ln(n) {
3233
+ return new z1(n).abs();
3051
3234
  }
3052
- function Q1(n) {
3235
+ function cn(n) {
3053
3236
  return n.toString().split("M").map((e, t) => (e = e.trim(), t && e ? "M" + e : e)).filter((e) => e);
3054
3237
  }
3055
- function J1(n) {
3238
+ function un(n) {
3056
3239
  return "M" + n.join("L") + "Z";
3057
3240
  }
3058
- function tn(n, e) {
3059
- let t = K1(n);
3060
- return en(t) || nn(t, e);
3241
+ function fn(n, e) {
3242
+ let t = ln(n);
3243
+ return gn(t) || pn(t, e);
3061
3244
  }
3062
- function en(n) {
3245
+ function gn(n) {
3063
3246
  let e = n.segments || [], t = [];
3064
3247
  if (!e.length || e[0][0] !== "M")
3065
3248
  return !1;
@@ -3078,11 +3261,11 @@ function en(n) {
3078
3261
  }
3079
3262
  return t.length ? { ring: t } : !1;
3080
3263
  }
3081
- function nn(n, e) {
3082
- let t = Q1(n)[0], o = [], i, a, s = 3;
3264
+ function pn(n, e) {
3265
+ let t = cn(n)[0], o = [], i, a, s = 3;
3083
3266
  if (!t)
3084
- throw new TypeError(Q0);
3085
- a = rn(t), i = a.getTotalLength(), e && _0(e) && e > 0 && (s = Math.max(s, Math.ceil(i / e)));
3267
+ throw new TypeError(n0);
3268
+ a = dn(t), i = a.getTotalLength(), e && Ft(e) && e > 0 && (s = Math.max(s, Math.ceil(i / e)));
3086
3269
  for (let r = 0; r < s; r++) {
3087
3270
  let h = a.getPointAtLength(i * r / s);
3088
3271
  o.push([h.x, h.y]);
@@ -3092,115 +3275,115 @@ function nn(n, e) {
3092
3275
  skipBisect: !0
3093
3276
  };
3094
3277
  }
3095
- function rn(n) {
3278
+ function dn(n) {
3096
3279
  if (typeof window < "u" && window && window.document)
3097
3280
  try {
3098
3281
  let e = window.document.createElementNS("http://www.w3.org/2000/svg", "path");
3099
3282
  return e.setAttributeNS(null, "d", n), e;
3100
3283
  } catch {
3101
3284
  }
3102
- return G1(n);
3285
+ return on(n);
3103
3286
  }
3104
- function Lt(n, e) {
3105
- const t = n.length + e, o = m1(n) / e;
3287
+ function I0(n, e) {
3288
+ const t = n.length + e, o = I1(n) / e;
3106
3289
  let i = 0, a = 0, s = o / 2;
3107
3290
  for (; n.length < t; ) {
3108
- let r = n[i], h = n[(i + 1) % n.length], c = O0(r, h);
3109
- if (s <= a + c) {
3110
- n.splice(i + 1, 0, c ? Dt(r, h, (s - a) / c) : r.slice(0)), s += o;
3291
+ let r = n[i], h = n[(i + 1) % n.length], u = Nt(r, h);
3292
+ if (s <= a + u) {
3293
+ n.splice(i + 1, 0, u ? V0(r, h, (s - a) / u) : r.slice(0)), s += o;
3111
3294
  continue;
3112
3295
  }
3113
- a += c, i++;
3296
+ a += u, i++;
3114
3297
  }
3115
3298
  }
3116
- function on(n, e = 1 / 0) {
3299
+ function xn(n, e = 1 / 0) {
3117
3300
  for (let t = 0; t < n.length; t++) {
3118
3301
  let o = n[t], i = t === n.length - 1 ? n[0] : n[t + 1];
3119
- for (; O0(o, i) > e; )
3120
- i = Dt(o, i, 0.5), n.splice(t + 1, 0, i);
3302
+ for (; Nt(o, i) > e; )
3303
+ i = V0(o, i, 0.5), n.splice(t + 1, 0, i);
3121
3304
  }
3122
3305
  }
3123
- function Tt(n, e) {
3306
+ function _0(n, e) {
3124
3307
  let t, o, i;
3125
3308
  if (typeof n == "string") {
3126
- let a = tn(n, e);
3309
+ let a = fn(n, e);
3127
3310
  n = a.ring, i = a.skipBisect;
3128
3311
  } else if (!Array.isArray(n))
3129
- throw new TypeError(Q0);
3130
- if (t = n.slice(0), !sn(t))
3131
- throw new TypeError(Q0);
3132
- return t.length > 1 && W1(t[0], t[t.length - 1]) && t.pop(), o = w1(t), o > 0 && t.reverse(), !i && e && _0(e) && e > 0 && on(t, e), t;
3312
+ throw new TypeError(n0);
3313
+ if (t = n.slice(0), !yn(t))
3314
+ throw new TypeError(n0);
3315
+ return t.length > 1 && sn(t[0], t[t.length - 1]) && t.pop(), o = k1(t), o > 0 && t.reverse(), !i && e && Ft(e) && e > 0 && xn(t, e), t;
3133
3316
  }
3134
- function sn(n) {
3317
+ function yn(n) {
3135
3318
  return n.every(function(e) {
3136
- return Array.isArray(e) && e.length >= 2 && _0(e[0]) && _0(e[1]);
3319
+ return Array.isArray(e) && e.length >= 2 && Ft(e[0]) && Ft(e[1]);
3137
3320
  });
3138
3321
  }
3139
- function an(n, e) {
3322
+ function vn(n, e) {
3140
3323
  let t = n.length, o = 1 / 0, i, a, s;
3141
3324
  for (let r = 0; r < t; r++)
3142
- a = 0, e.forEach(function(h, c) {
3143
- let f = O0(n[(r + c) % t], h);
3144
- a += f * f;
3325
+ a = 0, e.forEach(function(h, u) {
3326
+ let c = Nt(n[(r + u) % t], h);
3327
+ a += c * c;
3145
3328
  }), a < o && (o = a, i = r);
3146
3329
  i && (s = n.splice(0, i), n.splice(n.length, 0, ...s));
3147
3330
  }
3148
- function hn(n, e, { maxSegmentLength: t = 10, string: o = !0 } = {}) {
3149
- let i = Tt(n, t), a = Tt(e, t), s = ln(i, a, o);
3331
+ function wn(n, e, { maxSegmentLength: t = 10, string: o = !0 } = {}) {
3332
+ let i = _0(n, t), a = _0(e, t), s = mn(i, a, o);
3150
3333
  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);
3151
3334
  }
3152
- function ln(n, e, t) {
3335
+ function mn(n, e, t) {
3153
3336
  let o;
3154
- return o = n.length - e.length, Lt(n, o < 0 ? o * -1 : 0), Lt(e, o > 0 ? o : 0), an(n, e), Z1(n, e, t);
3337
+ return o = n.length - e.length, I0(n, o < 0 ? o * -1 : 0), I0(e, o > 0 ? o : 0), vn(n, e), an(n, e, t);
3155
3338
  }
3156
- var I0 = { exports: {} }, Pt;
3157
- function cn() {
3158
- if (Pt) return I0.exports;
3159
- Pt = 1, I0.exports = n, I0.exports.default = n;
3339
+ var It = { exports: {} }, O0;
3340
+ function bn() {
3341
+ if (O0) return It.exports;
3342
+ O0 = 1, It.exports = n, It.exports.default = n;
3160
3343
  function n(g, x, p) {
3161
3344
  p = p || 2;
3162
- var v = x && x.length, w = v ? x[0] * p : g.length, A = e(g, 0, w, p, !0), b = [];
3163
- if (!A || A.next === A.prev) return b;
3164
- var L, F, I, Y, D, N, W;
3165
- if (v && (A = h(g, x, A, p)), g.length > 80 * p) {
3166
- L = I = g[0], F = Y = g[1];
3345
+ var v = x && x.length, w = v ? x[0] * p : g.length, b = e(g, 0, w, p, !0), A = [];
3346
+ if (!b || b.next === b.prev) return A;
3347
+ var P, F, _, $, z, B, Z;
3348
+ if (v && (b = h(g, x, b, p)), g.length > 80 * p) {
3349
+ P = _ = g[0], F = $ = g[1];
3167
3350
  for (var j = p; j < w; j += p)
3168
- D = g[j], N = g[j + 1], D < L && (L = D), N < F && (F = N), D > I && (I = D), N > Y && (Y = N);
3169
- W = Math.max(I - L, Y - F), W = W !== 0 ? 32767 / W : 0;
3351
+ z = g[j], B = g[j + 1], z < P && (P = z), B < F && (F = B), z > _ && (_ = z), B > $ && ($ = B);
3352
+ Z = Math.max(_ - P, $ - F), Z = Z !== 0 ? 32767 / Z : 0;
3170
3353
  }
3171
- return o(A, b, p, L, F, W, 0), b;
3354
+ return o(b, A, p, P, F, Z, 0), A;
3172
3355
  }
3173
3356
  function e(g, x, p, v, w) {
3174
- var A, b;
3175
- if (w === F0(g, x, p, v) > 0)
3176
- for (A = x; A < p; A += v) b = e0(A, g[A], g[A + 1], b);
3357
+ var b, A;
3358
+ if (w === Rt(g, x, p, v) > 0)
3359
+ for (b = x; b < p; b += v) A = et(b, g[b], g[b + 1], A);
3177
3360
  else
3178
- for (A = p - v; A >= x; A -= v) b = e0(A, g[A], g[A + 1], b);
3179
- return b && E(b, b.next) && (n0(b), b = b.next), b;
3361
+ for (b = p - v; b >= x; b -= v) A = et(b, g[b], g[b + 1], A);
3362
+ return A && S(A, A.next) && (nt(A), A = A.next), A;
3180
3363
  }
3181
3364
  function t(g, x) {
3182
3365
  if (!g) return g;
3183
3366
  x || (x = g);
3184
3367
  var p = g, v;
3185
3368
  do
3186
- if (v = !1, !p.steiner && (E(p, p.next) || P(p.prev, p, p.next) === 0)) {
3187
- if (n0(p), p = x = p.prev, p === p.next) break;
3369
+ if (v = !1, !p.steiner && (S(p, p.next) || C(p.prev, p, p.next) === 0)) {
3370
+ if (nt(p), p = x = p.prev, p === p.next) break;
3188
3371
  v = !0;
3189
3372
  } else
3190
3373
  p = p.next;
3191
3374
  while (v || p !== x);
3192
3375
  return x;
3193
3376
  }
3194
- function o(g, x, p, v, w, A, b) {
3377
+ function o(g, x, p, v, w, b, A) {
3195
3378
  if (g) {
3196
- !b && A && u(g, v, w, A);
3197
- for (var L = g, F, I; g.prev !== g.next; ) {
3198
- if (F = g.prev, I = g.next, A ? a(g, v, w, A) : i(g)) {
3199
- 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;
3379
+ !A && b && f(g, v, w, b);
3380
+ for (var P = g, F, _; g.prev !== g.next; ) {
3381
+ if (F = g.prev, _ = g.next, b ? a(g, v, w, b) : i(g)) {
3382
+ x.push(F.i / p | 0), x.push(g.i / p | 0), x.push(_.i / p | 0), nt(g), g = _.next, P = _.next;
3200
3383
  continue;
3201
3384
  }
3202
- if (g = I, g === L) {
3203
- 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);
3385
+ if (g = _, g === P) {
3386
+ A ? A === 1 ? (g = s(t(g), x, p), o(g, x, p, v, w, b, 2)) : A === 2 && r(g, x, p, v, w, b) : o(t(g), x, p, v, w, b, 1);
3204
3387
  break;
3205
3388
  }
3206
3389
  }
@@ -3208,26 +3391,26 @@ function cn() {
3208
3391
  }
3209
3392
  function i(g) {
3210
3393
  var x = g.prev, p = g, v = g.next;
3211
- if (P(x, p, v) >= 0) return !1;
3212
- 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; ) {
3213
- 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;
3394
+ if (C(x, p, v) >= 0) return !1;
3395
+ for (var w = x.x, b = p.x, A = v.x, P = x.y, F = p.y, _ = v.y, $ = w < b ? w < A ? w : A : b < A ? b : A, z = P < F ? P < _ ? P : _ : F < _ ? F : _, B = w > b ? w > A ? w : A : b > A ? b : A, Z = P > F ? P > _ ? P : _ : F > _ ? F : _, j = v.next; j !== x; ) {
3396
+ if (j.x >= $ && j.x <= B && j.y >= z && j.y <= Z && E(w, P, b, F, A, _, j.x, j.y) && C(j.prev, j, j.next) >= 0) return !1;
3214
3397
  j = j.next;
3215
3398
  }
3216
3399
  return !0;
3217
3400
  }
3218
3401
  function a(g, x, p, v) {
3219
- var w = g.prev, A = g, b = g.next;
3220
- if (P(w, A, b) >= 0) return !1;
3221
- 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; ) {
3222
- 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;
3402
+ var w = g.prev, b = g, A = g.next;
3403
+ if (C(w, b, A) >= 0) return !1;
3404
+ for (var P = w.x, F = b.x, _ = A.x, $ = w.y, z = b.y, B = A.y, Z = P < F ? P < _ ? P : _ : F < _ ? F : _, j = $ < z ? $ < B ? $ : B : z < B ? z : B, Lt = P > F ? P > _ ? P : _ : F > _ ? F : _, Tt = $ > z ? $ > B ? $ : B : z > B ? z : B, h0 = y(Z, j, x, p, v), l0 = y(Lt, Tt, x, p, v), D = g.prevZ, q = g.nextZ; D && D.z >= h0 && q && q.z <= l0; ) {
3405
+ if (D.x >= Z && D.x <= Lt && D.y >= j && D.y <= Tt && D !== w && D !== A && E(P, $, F, z, _, B, D.x, D.y) && C(D.prev, D, D.next) >= 0 || (D = D.prevZ, q.x >= Z && q.x <= Lt && q.y >= j && q.y <= Tt && q !== w && q !== A && E(P, $, F, z, _, B, q.x, q.y) && C(q.prev, q, q.next) >= 0)) return !1;
3223
3406
  q = q.nextZ;
3224
3407
  }
3225
- for (; B && B.z >= it; ) {
3226
- 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;
3227
- B = B.prevZ;
3408
+ for (; D && D.z >= h0; ) {
3409
+ if (D.x >= Z && D.x <= Lt && D.y >= j && D.y <= Tt && D !== w && D !== A && E(P, $, F, z, _, B, D.x, D.y) && C(D.prev, D, D.next) >= 0) return !1;
3410
+ D = D.prevZ;
3228
3411
  }
3229
- for (; q && q.z <= ot; ) {
3230
- 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;
3412
+ for (; q && q.z <= l0; ) {
3413
+ if (q.x >= Z && q.x <= Lt && q.y >= j && q.y <= Tt && q !== w && q !== A && E(P, $, F, z, _, B, q.x, q.y) && C(q.prev, q, q.next) >= 0) return !1;
3231
3414
  q = q.nextZ;
3232
3415
  }
3233
3416
  return !0;
@@ -3235,65 +3418,65 @@ function cn() {
3235
3418
  function s(g, x, p) {
3236
3419
  var v = g;
3237
3420
  do {
3238
- var w = v.prev, A = v.next.next;
3239
- !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;
3421
+ var w = v.prev, b = v.next.next;
3422
+ !S(w, b) && T(w, v, v.next, b) && H(w, b) && H(b, w) && (x.push(w.i / p | 0), x.push(v.i / p | 0), x.push(b.i / p | 0), nt(v), nt(v.next), v = g = b), v = v.next;
3240
3423
  } while (v !== g);
3241
3424
  return t(v);
3242
3425
  }
3243
- function r(g, x, p, v, w, A) {
3244
- var b = g;
3426
+ function r(g, x, p, v, w, b) {
3427
+ var A = g;
3245
3428
  do {
3246
- for (var L = b.next.next; L !== b.prev; ) {
3247
- if (b.i !== L.i && S(b, L)) {
3248
- var F = t0(b, L);
3249
- 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);
3429
+ for (var P = A.next.next; P !== A.prev; ) {
3430
+ if (A.i !== P.i && L(A, P)) {
3431
+ var F = tt(A, P);
3432
+ A = t(A, A.next), F = t(F, F.next), o(A, x, p, v, w, b, 0), o(F, x, p, v, w, b, 0);
3250
3433
  return;
3251
3434
  }
3252
- L = L.next;
3435
+ P = P.next;
3253
3436
  }
3254
- b = b.next;
3255
- } while (b !== g);
3437
+ A = A.next;
3438
+ } while (A !== g);
3256
3439
  }
3257
3440
  function h(g, x, p, v) {
3258
- var w = [], A, b, L, F, I;
3259
- for (A = 0, b = x.length; A < b; A++)
3260
- 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));
3261
- for (w.sort(c), A = 0; A < w.length; A++)
3262
- p = f(w[A], p);
3441
+ var w = [], b, A, P, F, _;
3442
+ for (b = 0, A = x.length; b < A; b++)
3443
+ P = x[b] * v, F = b < A - 1 ? x[b + 1] * v : g.length, _ = e(g, P, F, v, !1), _ === _.next && (_.steiner = !0), w.push(M(_));
3444
+ for (w.sort(u), b = 0; b < w.length; b++)
3445
+ p = c(w[b], p);
3263
3446
  return p;
3264
3447
  }
3265
- function c(g, x) {
3448
+ function u(g, x) {
3266
3449
  return g.x - x.x;
3267
3450
  }
3268
- function f(g, x) {
3451
+ function c(g, x) {
3269
3452
  var p = d(g, x);
3270
3453
  if (!p)
3271
3454
  return x;
3272
- var v = t0(p, g);
3455
+ var v = tt(p, g);
3273
3456
  return t(v, v.next), t(p, p.next);
3274
3457
  }
3275
3458
  function d(g, x) {
3276
- var p = x, v = g.x, w = g.y, A = -1 / 0, b;
3459
+ var p = x, v = g.x, w = g.y, b = -1 / 0, A;
3277
3460
  do {
3278
3461
  if (w <= p.y && w >= p.next.y && p.next.y !== p.y) {
3279
- var L = p.x + (w - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
3280
- if (L <= v && L > A && (A = L, b = p.x < p.next.x ? p : p.next, L === v))
3281
- return b;
3462
+ var P = p.x + (w - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
3463
+ if (P <= v && P > b && (b = P, A = p.x < p.next.x ? p : p.next, P === v))
3464
+ return A;
3282
3465
  }
3283
3466
  p = p.next;
3284
3467
  } while (p !== x);
3285
- if (!b) return null;
3286
- var F = b, I = b.x, Y = b.y, D = 1 / 0, N;
3287
- p = b;
3468
+ if (!A) return null;
3469
+ var F = A, _ = A.x, $ = A.y, z = 1 / 0, B;
3470
+ p = A;
3288
3471
  do
3289
- 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;
3472
+ v >= p.x && p.x >= _ && v !== p.x && E(w < $ ? v : b, w, _, $, w < $ ? b : v, w, p.x, p.y) && (B = Math.abs(w - p.y) / (v - p.x), H(p, g) && (B < z || B === z && (p.x > A.x || p.x === A.x && l(A, p))) && (A = p, z = B)), p = p.next;
3290
3473
  while (p !== F);
3291
- return b;
3474
+ return A;
3292
3475
  }
3293
3476
  function l(g, x) {
3294
- return P(g.prev, g, x.prev) < 0 && P(x.next, g, g.next) < 0;
3477
+ return C(g.prev, g, x.prev) < 0 && C(x.next, g, g.next) < 0;
3295
3478
  }
3296
- function u(g, x, p, v) {
3479
+ function f(g, x, p, v) {
3297
3480
  var w = g;
3298
3481
  do
3299
3482
  w.z === 0 && (w.z = y(w.x, w.y, x, p, v)), w.prevZ = w.prev, w.nextZ = w.next, w = w.next;
@@ -3301,17 +3484,17 @@ function cn() {
3301
3484
  w.prevZ.nextZ = null, w.prevZ = null, m(w);
3302
3485
  }
3303
3486
  function m(g) {
3304
- var x, p, v, w, A, b, L, F, I = 1;
3487
+ var x, p, v, w, b, A, P, F, _ = 1;
3305
3488
  do {
3306
- for (p = g, g = null, A = null, b = 0; p; ) {
3307
- for (b++, v = p, L = 0, x = 0; x < I && (L++, v = v.nextZ, !!v); x++)
3489
+ for (p = g, g = null, b = null, A = 0; p; ) {
3490
+ for (A++, v = p, P = 0, x = 0; x < _ && (P++, v = v.nextZ, !!v); x++)
3308
3491
  ;
3309
- for (F = I; L > 0 || F > 0 && v; )
3310
- 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;
3492
+ for (F = _; P > 0 || F > 0 && v; )
3493
+ P !== 0 && (F === 0 || !v || p.z <= v.z) ? (w = p, p = p.nextZ, P--) : (w = v, v = v.nextZ, F--), b ? b.nextZ = w : g = w, w.prevZ = b, b = w;
3311
3494
  p = v;
3312
3495
  }
3313
- A.nextZ = null, I *= 2;
3314
- } while (b > 1);
3496
+ b.nextZ = null, _ *= 2;
3497
+ } while (A > 1);
3315
3498
  return g;
3316
3499
  }
3317
3500
  function y(g, x, p, v, w) {
@@ -3324,99 +3507,99 @@ function cn() {
3324
3507
  while (x !== g);
3325
3508
  return p;
3326
3509
  }
3327
- function T(g, x, p, v, w, A, b, L) {
3328
- 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);
3510
+ function E(g, x, p, v, w, b, A, P) {
3511
+ return (w - A) * (x - P) >= (g - A) * (b - P) && (g - A) * (v - P) >= (p - A) * (x - P) && (p - A) * (b - P) >= (w - A) * (v - P);
3329
3512
  }
3330
- function S(g, x) {
3331
- return g.next.i !== x.i && g.prev.i !== x.i && !G(g, x) && // dones't intersect other edges
3332
- (z(g, x) && z(x, g) && H(g, x) && // locally visible
3333
- (P(g.prev, g, x.prev) || P(g, x.prev, x)) || // does not create opposite-facing sectors
3334
- E(g, x) && P(g.prev, g, g.next) > 0 && P(x.prev, x, x.next) > 0);
3513
+ function L(g, x) {
3514
+ return g.next.i !== x.i && g.prev.i !== x.i && !X(g, x) && // dones't intersect other edges
3515
+ (H(g, x) && H(x, g) && Y(g, x) && // locally visible
3516
+ (C(g.prev, g, x.prev) || C(g, x.prev, x)) || // does not create opposite-facing sectors
3517
+ S(g, x) && C(g.prev, g, g.next) > 0 && C(x.prev, x, x.next) > 0);
3335
3518
  }
3336
- function P(g, x, p) {
3519
+ function C(g, x, p) {
3337
3520
  return (x.y - g.y) * (p.x - x.x) - (x.x - g.x) * (p.y - x.y);
3338
3521
  }
3339
- function E(g, x) {
3522
+ function S(g, x) {
3340
3523
  return g.x === x.x && g.y === x.y;
3341
3524
  }
3342
- function C(g, x, p, v) {
3343
- 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));
3344
- 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));
3525
+ function T(g, x, p, v) {
3526
+ var w = R(C(g, x, p)), b = R(C(g, x, v)), A = R(C(p, v, g)), P = R(C(p, v, x));
3527
+ return !!(w !== b && A !== P || w === 0 && I(g, p, x) || b === 0 && I(g, v, x) || A === 0 && I(p, g, v) || P === 0 && I(p, x, v));
3345
3528
  }
3346
- function O(g, x, p) {
3529
+ function I(g, x, p) {
3347
3530
  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);
3348
3531
  }
3349
3532
  function R(g) {
3350
3533
  return g > 0 ? 1 : g < 0 ? -1 : 0;
3351
3534
  }
3352
- function G(g, x) {
3535
+ function X(g, x) {
3353
3536
  var p = g;
3354
3537
  do {
3355
- 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;
3538
+ if (p.i !== g.i && p.next.i !== g.i && p.i !== x.i && p.next.i !== x.i && T(p, p.next, g, x)) return !0;
3356
3539
  p = p.next;
3357
3540
  } while (p !== g);
3358
3541
  return !1;
3359
3542
  }
3360
- function z(g, x) {
3361
- 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;
3362
- }
3363
3543
  function H(g, x) {
3364
- var p = g, v = !1, w = (g.x + x.x) / 2, A = (g.y + x.y) / 2;
3544
+ return C(g.prev, g, g.next) < 0 ? C(g, x, g.next) >= 0 && C(g, g.prev, x) >= 0 : C(g, x, g.prev) < 0 || C(g, g.next, x) < 0;
3545
+ }
3546
+ function Y(g, x) {
3547
+ var p = g, v = !1, w = (g.x + x.x) / 2, b = (g.y + x.y) / 2;
3365
3548
  do
3366
- 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;
3549
+ p.y > b != p.next.y > b && p.next.y !== p.y && w < (p.next.x - p.x) * (b - p.y) / (p.next.y - p.y) + p.x && (v = !v), p = p.next;
3367
3550
  while (p !== g);
3368
3551
  return v;
3369
3552
  }
3370
- function t0(g, x) {
3371
- 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;
3372
- 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;
3553
+ function tt(g, x) {
3554
+ var p = new K(g.i, g.x, g.y), v = new K(x.i, x.x, x.y), w = g.next, b = x.prev;
3555
+ return g.next = x, x.prev = g, p.next = w, w.prev = p, v.next = p, p.prev = v, b.next = v, v.prev = b, v;
3373
3556
  }
3374
- function e0(g, x, p, v) {
3557
+ function et(g, x, p, v) {
3375
3558
  var w = new K(g, x, p);
3376
3559
  return v ? (w.next = v.next, w.prev = v, v.next.prev = w, v.next = w) : (w.prev = w, w.next = w), w;
3377
3560
  }
3378
- function n0(g) {
3561
+ function nt(g) {
3379
3562
  g.next.prev = g.prev, g.prev.next = g.next, g.prevZ && (g.prevZ.nextZ = g.nextZ), g.nextZ && (g.nextZ.prevZ = g.prevZ);
3380
3563
  }
3381
3564
  function K(g, x, p) {
3382
3565
  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;
3383
3566
  }
3384
3567
  n.deviation = function(g, x, p, v) {
3385
- var w = x && x.length, A = w ? x[0] * p : g.length, b = Math.abs(F0(g, 0, A, p));
3568
+ var w = x && x.length, b = w ? x[0] * p : g.length, A = Math.abs(Rt(g, 0, b, p));
3386
3569
  if (w)
3387
- for (var L = 0, F = x.length; L < F; L++) {
3388
- var I = x[L] * p, Y = L < F - 1 ? x[L + 1] * p : g.length;
3389
- b -= Math.abs(F0(g, I, Y, p));
3570
+ for (var P = 0, F = x.length; P < F; P++) {
3571
+ var _ = x[P] * p, $ = P < F - 1 ? x[P + 1] * p : g.length;
3572
+ A -= Math.abs(Rt(g, _, $, p));
3390
3573
  }
3391
- var D = 0;
3392
- for (L = 0; L < v.length; L += 3) {
3393
- var N = v[L] * p, W = v[L + 1] * p, j = v[L + 2] * p;
3394
- D += Math.abs(
3395
- (g[N] - g[j]) * (g[W + 1] - g[N + 1]) - (g[N] - g[W]) * (g[j + 1] - g[N + 1])
3574
+ var z = 0;
3575
+ for (P = 0; P < v.length; P += 3) {
3576
+ var B = v[P] * p, Z = v[P + 1] * p, j = v[P + 2] * p;
3577
+ z += Math.abs(
3578
+ (g[B] - g[j]) * (g[Z + 1] - g[B + 1]) - (g[B] - g[Z]) * (g[j + 1] - g[B + 1])
3396
3579
  );
3397
3580
  }
3398
- return b === 0 && D === 0 ? 0 : Math.abs((D - b) / b);
3581
+ return A === 0 && z === 0 ? 0 : Math.abs((z - A) / A);
3399
3582
  };
3400
- function F0(g, x, p, v) {
3401
- for (var w = 0, A = x, b = p - v; A < p; A += v)
3402
- w += (g[b] - g[A]) * (g[A + 1] + g[b + 1]), b = A;
3583
+ function Rt(g, x, p, v) {
3584
+ for (var w = 0, b = x, A = p - v; b < p; b += v)
3585
+ w += (g[A] - g[b]) * (g[b + 1] + g[A + 1]), A = b;
3403
3586
  return w;
3404
3587
  }
3405
3588
  return n.flatten = function(g) {
3406
3589
  for (var x = g[0][0].length, p = { vertices: [], holes: [], dimensions: x }, v = 0, w = 0; w < g.length; w++) {
3407
- for (var A = 0; A < g[w].length; A++)
3408
- for (var b = 0; b < x; b++) p.vertices.push(g[w][A][b]);
3590
+ for (var b = 0; b < g[w].length; b++)
3591
+ for (var A = 0; A < x; A++) p.vertices.push(g[w][b][A]);
3409
3592
  w > 0 && (v += g[w - 1].length, p.holes.push(v));
3410
3593
  }
3411
3594
  return p;
3412
- }, I0.exports;
3595
+ }, It.exports;
3413
3596
  }
3414
- cn();
3415
- function jt(n, e) {
3597
+ bn();
3598
+ function K0(n, e) {
3416
3599
  return n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
3417
3600
  }
3418
- function un(n) {
3419
- return n.length === 1 && (n = fn(n)), {
3601
+ function An(n) {
3602
+ return n.length === 1 && (n = Mn(n)), {
3420
3603
  left: function(e, t, o, i) {
3421
3604
  for (o == null && (o = 0), i == null && (i = e.length); o < i; ) {
3422
3605
  var a = o + i >>> 1;
@@ -3433,31 +3616,31 @@ function un(n) {
3433
3616
  }
3434
3617
  };
3435
3618
  }
3436
- function fn(n) {
3619
+ function Mn(n) {
3437
3620
  return function(e, t) {
3438
- return jt(n(e), t);
3621
+ return K0(n(e), t);
3439
3622
  };
3440
3623
  }
3441
- un(jt);
3442
- function Rn(n, e, t = 3) {
3443
- const o = hn(n, e, { maxSegmentLength: t });
3624
+ An(K0);
3625
+ function Wn(n, e, t = 3) {
3626
+ const o = wn(n, e, { maxSegmentLength: t });
3444
3627
  return {
3445
3628
  check: (i) => typeof i == "string",
3446
3629
  interpolate: (i, a, s) => o(s)
3447
3630
  };
3448
3631
  }
3449
- function Nn(n) {
3632
+ function Xn(n) {
3450
3633
  const e = (o) => n.width * o, t = (o) => n.height * o;
3451
3634
  return {
3452
3635
  scaleX: e,
3453
3636
  scaleY: t,
3454
- position: (o, i) => X({
3637
+ position: (o, i) => W({
3455
3638
  x: e(o),
3456
3639
  y: t(i)
3457
3640
  })
3458
3641
  };
3459
3642
  }
3460
- function Bn(n) {
3643
+ function Gn(n) {
3461
3644
  const e = [];
3462
3645
  if (n.isAllKey) {
3463
3646
  for (let t = 0; t <= n.animations.length; t++)
@@ -3469,49 +3652,49 @@ function Bn(n) {
3469
3652
  }), n.isEndKey && e[e.length - 1] !== n.animations.length && e.push(n.animations.length), e;
3470
3653
  }
3471
3654
  export {
3472
- x0 as Alignment,
3473
- o0 as Anchor,
3474
- et as Animate,
3475
- mn as Arrow,
3476
- kn as BrowserCanvasRenderer,
3477
- An as Circle,
3478
- $ as Color,
3479
- tt as Easing,
3480
- pn as FadeIn,
3481
- dn as FadeOut,
3482
- de as FontStyle,
3483
- ye as FontWeight,
3484
- bn as Grid,
3485
- st as Group,
3486
- xn as Hide,
3487
- vn as IFrame,
3488
- Mn as Image,
3489
- Ln as Line,
3490
- Tn as Mask,
3655
+ xt as Alignment,
3656
+ ot as Anchor,
3657
+ o0 as Animate,
3658
+ In as Arrow,
3659
+ jn as BrowserCanvasRenderer,
3660
+ _n as Circle,
3661
+ G as Color,
3662
+ i0 as Easing,
3663
+ Tn as FadeIn,
3664
+ Cn as FadeOut,
3665
+ Ce as FontStyle,
3666
+ Ee as FontWeight,
3667
+ On as Grid,
3668
+ c0 as Group,
3669
+ Pn as Hide,
3670
+ Sn as IFrame,
3671
+ Fn as Image,
3672
+ Nn as Line,
3673
+ Rn as Mask,
3491
3674
  U as ObjectType,
3492
- Fn as Opaque,
3493
- Pn as Path,
3494
- In as Pause,
3495
- Cn as Polygon,
3496
- X as Position,
3497
- Pe as Presentation,
3498
- Sn as Rectangle,
3499
- En as SVG,
3500
- wn as ScreenCapture,
3501
- yn as Show,
3502
- a0 as Size,
3503
- _n as Slide,
3504
- l0 as SlideObject,
3505
- St as SlideWebExtra,
3506
- Ae as Text,
3507
- On as TextUnit,
3508
- pe as Transparent,
3509
- Ct as Update,
3510
- Bn as getKeySlideBuildIndices,
3511
- Nn as getSizingFunctions,
3512
- Rn as getSmoothPathInterpolator,
3513
- me as getTextContentLength,
3514
- ke as interpolateColor,
3515
- _e as interpolateNumber
3675
+ Yn as Opaque,
3676
+ Bn as Path,
3677
+ Hn as Pause,
3678
+ Dn as Polygon,
3679
+ W as Position,
3680
+ ze as Presentation,
3681
+ qn as Rectangle,
3682
+ zn as SVG,
3683
+ kn as ScreenCapture,
3684
+ En as Show,
3685
+ at as Size,
3686
+ Un as Slide,
3687
+ lt as SlideObject,
3688
+ N0 as SlideWebExtra,
3689
+ _e as Text,
3690
+ $n as TextUnit,
3691
+ Te as Transparent,
3692
+ F0 as Update,
3693
+ Gn as getKeySlideBuildIndices,
3694
+ Xn as getSizingFunctions,
3695
+ Wn as getSmoothPathInterpolator,
3696
+ Ie as getTextContentLength,
3697
+ Ue as interpolateColor,
3698
+ Ye as interpolateNumber
3516
3699
  };
3517
3700
  //# sourceMappingURL=presenter.mjs.map