nhanh-pure-function 4.2.3 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,11 +1,11 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".no-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}._nhanh_canvas{cursor:initial}._nhanh_canvas:active{cursor:pointer}._nhanh_canvas._nhanh_canvas_draggable{cursor:grab}._nhanh_canvas._nhanh_canvas_draggable:active{cursor:grabbing}._nhanh_canvas_hover_overlay{cursor:pointer!important}._nhanh_canvas_hover_overlay:active{cursor:grabbing!important}._nhanh_canvas_hover_overlay_draggable{cursor:pointer!important}._nhanh_canvas_hover_overlay_draggable:active{cursor:move!important}._nhanh_canvas_hover_overlay_draggable_ew{cursor:pointer!important}._nhanh_canvas_hover_overlay_draggable_ew:active{cursor:e-resize!important;cursor:ew-resize!important}._nhanh_canvas_hover_overlay_draggable_ns{cursor:pointer!important}._nhanh_canvas_hover_overlay_draggable_ns:active{cursor:n-resize!important;cursor:ns-resize!important}")),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
2
  var Ze = Object.defineProperty;
3
- var we = (r) => {
3
+ var ye = (r) => {
4
4
  throw TypeError(r);
5
5
  };
6
6
  var Qe = (r, s, t) => s in r ? Ze(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
7
- var d = (r, s, t) => Qe(r, typeof s != "symbol" ? s + "" : s, t), xe = (r, s, t) => s.has(r) || we("Cannot " + t);
8
- var x = (r, s, t) => (xe(r, s, "read from private field"), t ? t.call(r) : s.get(r)), L = (r, s, t) => s.has(r) ? we("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, t), M = (r, s, t, e) => (xe(r, s, "write to private field"), e ? e.call(r, t) : s.set(r, t), t);
7
+ var d = (r, s, t) => Qe(r, typeof s != "symbol" ? s + "" : s, t), we = (r, s, t) => s.has(r) || ye("Cannot " + t);
8
+ var x = (r, s, t) => (we(r, s, "read from private field"), t ? t.call(r) : s.get(r)), L = (r, s, t) => s.has(r) ? ye("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, t), M = (r, s, t, e) => (we(r, s, "write to private field"), e ? e.call(r, t) : s.set(r, t), t);
9
9
  const Je = {
10
10
  ".mp3": "audio/mpeg",
11
11
  ".mp4": "video/mp4",
@@ -68,7 +68,7 @@ const Je = {
68
68
  ".otf": "font/otf",
69
69
  ".eot": "application/vnd.ms-fontobject",
70
70
  ".map": "application/json"
71
- }, re = {
71
+ }, Kt = {
72
72
  image: [
73
73
  ".jpg",
74
74
  ".jpeg",
@@ -248,7 +248,7 @@ const Je = {
248
248
  ".awk",
249
249
  ".php"
250
250
  ]
251
- }, Pe = [
251
+ }, xe = [
252
252
  "",
253
253
  "万",
254
254
  "亿",
@@ -262,7 +262,7 @@ const Je = {
262
262
  "正",
263
263
  "载",
264
264
  "极"
265
- ], Ls = ["_self", "_blank", "_parent", "_top"], Re = {
265
+ ], Ts = ["_self", "_blank", "_parent", "_top"], Re = {
266
266
  // 北美标准尺寸 (毫米)
267
267
  Letter: { width: 215.9, height: 279.4 },
268
268
  // 8.5 × 11 英寸
@@ -315,10 +315,10 @@ const Je = {
315
315
  C6: { width: 114, height: 162 },
316
316
  C7: { width: 81, height: 114 },
317
317
  C8: { width: 57, height: 81 }
318
- }, Ts = Object.keys(Re).map(
318
+ }, Is = Object.keys(Re).map(
319
319
  (r) => ({ value: r, label: r })
320
320
  );
321
- function Wt(r, s = 500) {
321
+ function Bt(r, s = 500) {
322
322
  let t, e = !0;
323
323
  function i(n) {
324
324
  if (!e) return;
@@ -328,19 +328,19 @@ function Wt(r, s = 500) {
328
328
  }
329
329
  return requestAnimationFrame(i), () => e = !1;
330
330
  }
331
- function Is(r, s, t, e, i = 2) {
331
+ function Ns(r, s, t, e, i = 4) {
332
332
  let n = r, o = !1, a = 1, l = r, c = s, h = t;
333
333
  const u = () => {
334
334
  const P = (c - l) / h;
335
335
  return Number(P.toFixed(i));
336
336
  };
337
337
  let f = u();
338
- const m = (P) => Math.min(Math.max(P, l), c), p = (P) => Number(P.toFixed(i)), g = (P, b, _) => {
338
+ const m = (P) => Math.min(Math.max(P, l), c), p = (P) => Number(P.toFixed(i)), g = (P, b, E) => {
339
339
  const A = [];
340
- return P >= b && A.push("最小值必须小于最大值"), _ <= 0 ? A.push("分段数必须为正数") : u() == 0 && A.push("数值精度过低,致使动画步长为 0"), A;
341
- }, y = (P, b, _) => {
342
- const A = g(P, b, _);
343
- return A.length > 0 ? (console.error(`参数更新失败: ${A.join("; ")}`), !1) : (l = P, c = b, h = _, f = u(), n = m(n), !0);
340
+ return P >= b && A.push("最小值必须小于最大值"), E <= 0 ? A.push("分段数必须为正数") : u() == 0 && A.push("数值精度过低,致使动画步长为 0"), A;
341
+ }, y = (P, b, E) => {
342
+ const A = g(P, b, E);
343
+ return A.length > 0 ? (console.error(`参数更新失败: ${A.join("; ")}`), !1) : (l = P, c = b, h = E, f = u(), n = m(n), !0);
344
344
  }, w = () => {
345
345
  o && (a = n >= c ? -1 : n <= l ? 1 : a, n = m(n + f * a), e(p(n)), requestAnimationFrame(w));
346
346
  };
@@ -376,7 +376,7 @@ function Ke(r, s, t, e, i = 4) {
376
376
  };
377
377
  h();
378
378
  }
379
- function Ns(r, s, t, e) {
379
+ function Hs(r, s, t, e) {
380
380
  const i = (l) => 3 * (1 - l) ** 2 * l * r + 3 * (1 - l) * l ** 2 * t + l ** 3, n = (l) => 3 * (1 - l) ** 2 * l * s + 3 * (1 - l) * l ** 2 * e + l ** 3, o = (l) => 3 * r * (1 - l) * (1 - 3 * l) + 3 * t * (2 * l - 3 * l ** 2) + 3 * l ** 2, a = (l) => {
381
381
  if (l <= 0) return 0;
382
382
  if (l >= 1) return 1;
@@ -404,7 +404,7 @@ function Ns(r, s, t, e) {
404
404
  return n(a(c));
405
405
  };
406
406
  }
407
- function Hs(r, s = "image/png") {
407
+ function Fs(r, s = "image/png") {
408
408
  try {
409
409
  let t, e = s;
410
410
  if (r instanceof File)
@@ -441,17 +441,17 @@ function Hs(r, s = "image/png") {
441
441
  ), null;
442
442
  }
443
443
  }
444
- function Fs(r) {
444
+ function zs(r) {
445
445
  return r.charAt(0).toUpperCase() + r.slice(1);
446
446
  }
447
447
  function Bs(r, s, t = 2) {
448
448
  return !Number.isFinite(r) || !Number.isFinite(s) || !Number.isFinite(t) ? (console.error("所有参数必须是有限的数字"), "") : s === 0 ? (console.error("分母不能为零"), "") : t < 0 ? (console.error("小数位数不能为负数"), "") : (r / s * 100).toFixed(t) + "%";
449
449
  }
450
- function le(r) {
450
+ function ee(r) {
451
451
  const t = r.toString().split("."), e = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
452
452
  return t.length > 1 ? e + "." + t[1] : e;
453
453
  }
454
- function zs(r, s) {
454
+ function Us(r, s) {
455
455
  const t = {
456
456
  join: !0,
457
457
  suffix: "",
@@ -462,7 +462,7 @@ function zs(r, s) {
462
462
  }, o = Number(r);
463
463
  if (isNaN(o)) return e ? `0${i}` : [0, i];
464
464
  const a = Math.abs(o), l = o >= 0, c = Math.max(0, Math.floor(Math.log10(a) / 4)), h = Math.pow(1e4, c), u = a / h, f = (l ? 1 : -1) * parseFloat(u.toFixed(Math.max(0, n)));
465
- return e ? `${f}${Pe[c]}${i}` : [f, Pe[c] + i];
465
+ return e ? `${f}${xe[c]}${i}` : [f, xe[c] + i];
466
466
  }
467
467
  function Gs(r) {
468
468
  const s = ["B", "KB", "MB", "GB", "TB", "PB"];
@@ -490,15 +490,15 @@ function ti(r, s = "YYYY-MM-DD hh:mm:ss", t = !0) {
490
490
  return t ? String(o).padStart(2, "0") : String(o);
491
491
  });
492
492
  }
493
- function ce(r, s = "file") {
493
+ function ie(r, s = "file") {
494
494
  if (!r || (r = String(r).trim(), r === "")) return s;
495
495
  const t = r.split("/");
496
496
  return t[t.length - 1].split("?")[0];
497
497
  }
498
- function Us(r, s) {
498
+ function Xs(r, s) {
499
499
  return r = r.replace(/([^a-zA-Z][a-z])/g, (t) => t.toUpperCase()), s ? r.replace(/[^a-zA-Z]+/g, "") : r;
500
500
  }
501
- function Xs(r, s, t = ",") {
501
+ function Ys(r, s, t = ",") {
502
502
  const e = new RegExp(
503
503
  `(^|${t})${s}(${t}|$)`,
504
504
  "g"
@@ -507,7 +507,7 @@ function Xs(r, s, t = ",") {
507
507
  return n === o ? t : "";
508
508
  });
509
509
  }
510
- function Ys(r, s = !0) {
510
+ function js(r, s = !0) {
511
511
  const t = {
512
512
  "\b": "\\b",
513
513
  " ": "\\t",
@@ -534,7 +534,7 @@ const It = [
534
534
  ["秒", 1e3],
535
535
  ["毫秒", 1]
536
536
  ];
537
- function js(r, s) {
537
+ function Ws(r, s) {
538
538
  if (!Number.isFinite(r) || r < 0) return "0毫秒";
539
539
  r = Math.round(r);
540
540
  const t = s ? It.findIndex(([i]) => i === s) : 0, e = t === -1 ? 0 : t;
@@ -543,12 +543,12 @@ function js(r, s) {
543
543
  if (r >= o) {
544
544
  const a = o === 1 ? r : Math.round(r / o * 10) / 10;
545
545
  let l = Number.isInteger(a) ? a : a.toFixed(1).replace(/\.0$/, "");
546
- return n === It[e][0] && (l = le(Number(l))), `${l}${n}`;
546
+ return n === It[e][0] && (l = ee(Number(l))), `${l}${n}`;
547
547
  }
548
548
  }
549
549
  return "0毫秒";
550
550
  }
551
- function Ws(r, s) {
551
+ function $s(r, s) {
552
552
  if (s < 1)
553
553
  return console.error("分割大小必须大于0"), [];
554
554
  const t = [];
@@ -558,24 +558,24 @@ function Ws(r, s) {
558
558
  }
559
559
  return t;
560
560
  }
561
- function ve(r, s = 2) {
561
+ function pe(r, s = 2) {
562
562
  if (Array.isArray(r) && r.length >= s) {
563
563
  for (let e = 0; e < r.length; e++)
564
564
  if (typeof r[e] != "number" || !Number.isFinite(r[e])) return !1;
565
565
  } else return !1;
566
566
  return !0;
567
567
  }
568
- function qt(r, s = 1, t = 2) {
568
+ function Ut(r, s = 1, t = 2) {
569
569
  if (Array.isArray(r) && r.length >= s) {
570
570
  for (let i = 0; i < r.length; i++)
571
- if (!ve(r[i], t)) return !1;
571
+ if (!pe(r[i], t)) return !1;
572
572
  } else return !1;
573
573
  return !0;
574
574
  }
575
575
  function qs(r, s, t) {
576
576
  return Math.abs(r - s) <= t;
577
577
  }
578
- function $s(r, s) {
578
+ function Zs(r, s) {
579
579
  let t = !1;
580
580
  const { x: e, y: i } = r, n = s.length;
581
581
  for (let o = 0, a = n - 1; o < n; a = o++) {
@@ -584,7 +584,7 @@ function $s(r, s) {
584
584
  }
585
585
  return t;
586
586
  }
587
- function Zs(r, s, t, e) {
587
+ function Qs(r, s, t, e) {
588
588
  const i = Math.min(r[0], s[0]), n = Math.max(r[0], s[0]), o = Math.min(r[1], s[1]), a = Math.max(r[1], s[1]), l = [
589
589
  [i, o],
590
590
  // 左上
@@ -608,10 +608,10 @@ function Zs(r, s, t, e) {
608
608
  }
609
609
  return m && p;
610
610
  }
611
- function he(r) {
611
+ function se(r) {
612
612
  return Object.prototype.toString.call(r).slice(8, -1).toLowerCase();
613
613
  }
614
- function Qs(r) {
614
+ function Js(r) {
615
615
  return [
616
616
  "https:",
617
617
  // HTTPS协议,用于安全地浏览网页
@@ -635,7 +635,7 @@ function Qs(r) {
635
635
  // VPN协议,用于创建安全的网络连接
636
636
  ].some((t) => r.startsWith(t));
637
637
  }
638
- function Js(r) {
638
+ function Ks(r) {
639
639
  return new Promise((s, t) => {
640
640
  if (typeof r != "string" || r.trim() === "" || !r.includes("://")) {
641
641
  t(new Error("Invalid URL: Must be a non-empty string"));
@@ -670,11 +670,11 @@ const it = class it {
670
670
  static check(s, t) {
671
671
  if (!s || typeof s != "string")
672
672
  return console.error("Invalid URL provided"), t ? !1 : "unknown";
673
- const e = ce(s).toLowerCase();
673
+ const e = ie(s).toLowerCase();
674
674
  if (t) {
675
- if (!re.hasOwnProperty(t))
675
+ if (!Kt.hasOwnProperty(t))
676
676
  return console.error(`Unknown file type: ${t}`), "unknown";
677
- const i = re[t];
677
+ const i = Kt[t];
678
678
  return it._checkExtension(e, i);
679
679
  }
680
680
  return it._detectFileType(e);
@@ -689,7 +689,7 @@ const it = class it {
689
689
  */
690
690
  static parseAddresses(s) {
691
691
  return !s || typeof s != "string" ? (console.error("Invalid URL provided"), []) : s.split(",").map((t) => {
692
- const e = ce(t), i = this.check(t);
692
+ const e = ie(t), i = this.check(t);
693
693
  return { url: t, name: e, type: i };
694
694
  });
695
695
  }
@@ -741,13 +741,13 @@ const it = class it {
741
741
  }
742
742
  };
743
743
  // 缓存文件扩展名的条目,以提高性能
744
- d(it, "cachedEntries", Object.entries(re));
745
- let be = it;
744
+ d(it, "cachedEntries", Object.entries(Kt));
745
+ let Pe = it;
746
746
  const ei = /\w*(?:\[\d+\])+|\w+/g, ke = /^\w*(?:\[\d+\])+$/, Ve = /\w+|(\[\d+\])/g, Oe = /\[(\d+)\]/;
747
747
  function Ae(r) {
748
748
  return r ? r.match(ei) || [] : [];
749
749
  }
750
- function Ks(r, s = 3e3) {
750
+ function tn(r, s = 3e3) {
751
751
  if (typeof r != "function")
752
752
  return console.error("非函数:", r);
753
753
  const t = window.requestIdleCallback, e = function(i) {
@@ -767,19 +767,19 @@ function ii(r, s) {
767
767
  n();
768
768
  });
769
769
  }
770
- function ct(r, s, t = [], e = Date.now()) {
770
+ function lt(r, s, t = [], e = Date.now()) {
771
771
  if (e < Date.now() - 50) {
772
772
  console.error("_MergeObjects 合并异常:疑似死循环");
773
773
  return;
774
774
  }
775
- const i = he(r), n = he(s);
775
+ const i = se(r), n = se(s);
776
776
  if (i != n) return s;
777
777
  if (i == "object" || i == "array") {
778
778
  if (t.some(([o, a]) => o == r && a == s)) return r;
779
779
  if (t.push([r, s]), i == "object") {
780
780
  for (const o in s)
781
781
  if (Object.prototype.hasOwnProperty.call(s, o)) {
782
- const a = s[o], l = r[o], c = ct(
782
+ const a = s[o], l = r[o], c = lt(
783
783
  l,
784
784
  a,
785
785
  t,
@@ -790,7 +790,7 @@ function ct(r, s, t = [], e = Date.now()) {
790
790
  return r;
791
791
  } else if (i == "array")
792
792
  return s.forEach((o, a) => {
793
- const l = o, c = r[a], h = ct(
793
+ const l = o, c = r[a], h = lt(
794
794
  c,
795
795
  l,
796
796
  t,
@@ -800,7 +800,7 @@ function ct(r, s, t = [], e = Date.now()) {
800
800
  }), r;
801
801
  } else return s;
802
802
  }
803
- function ue(r = "") {
803
+ function ne(r = "") {
804
804
  return r + "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(s) {
805
805
  const t = Math.random() * 16 | 0;
806
806
  return (s === "x" ? t : t & 3 | 8).toString(16);
@@ -814,7 +814,7 @@ function Le(r, s) {
814
814
  }, s);
815
815
  };
816
816
  }
817
- function tn(r, s) {
817
+ function en(r, s) {
818
818
  let t = -1 / 0;
819
819
  return function(...e) {
820
820
  const i = performance.now();
@@ -828,7 +828,7 @@ function tn(r, s) {
828
828
  }
829
829
  };
830
830
  }
831
- function en(r, s) {
831
+ function sn(r, s) {
832
832
  if (!r || !s) return r;
833
833
  const t = Ae(s);
834
834
  return t.length ? t.reduce((e, i, n) => {
@@ -845,7 +845,7 @@ function en(r, s) {
845
845
  return o ? e[i] : e[i] || {};
846
846
  }, r) : r;
847
847
  }
848
- function sn(r, s, t, e) {
848
+ function nn(r, s, t, e) {
849
849
  if (!r || !s) return t;
850
850
  const i = Ae(s);
851
851
  return i.length ? i.reduce((n, o, a) => {
@@ -863,7 +863,7 @@ function sn(r, s, t, e) {
863
863
  return l ? ((!e || !n.hasOwnProperty(o)) && (n[o] = t), n[o]) : (n.hasOwnProperty(o) || (n[o] = {}), n[o]);
864
864
  }, r) : t;
865
865
  }
866
- function nn(r) {
866
+ function rn(r) {
867
867
  return r.map((s, t) => r.slice(t).concat(r.slice(0, t)));
868
868
  }
869
869
  function si(r) {
@@ -873,7 +873,7 @@ function si(r) {
873
873
  return n;
874
874
  if (i.has(n))
875
875
  return i.get(n);
876
- switch (he(n)) {
876
+ switch (se(n)) {
877
877
  case "array": {
878
878
  const a = [];
879
879
  i.set(n, a);
@@ -989,7 +989,7 @@ function ni(r, s) {
989
989
  ), f;
990
990
  };
991
991
  }
992
- function rn(r) {
992
+ function on(r) {
993
993
  const s = Date.now();
994
994
  let t = performance.now();
995
995
  for (; Date.now() - s < r; ) {
@@ -1002,8 +1002,191 @@ function rn(r) {
1002
1002
  }
1003
1003
  return Date.now() - s;
1004
1004
  }
1005
+ class ri {
1006
+ constructor() {
1007
+ }
1008
+ /**
1009
+ * 数值钳制,确保在合法区间内。
1010
+ */
1011
+ static clamp(s, t, e) {
1012
+ return Math.min(Math.max(s, t), e);
1013
+ }
1014
+ static normalizeHue(s) {
1015
+ return (s % 360 + 360) % 360;
1016
+ }
1017
+ /**
1018
+ * 根据色相分段与色度参数生成 RGB(0-255)。
1019
+ */
1020
+ static chromaToRgb(s, t, e) {
1021
+ const i = t * (1 - Math.abs(s / 60 % 2 - 1));
1022
+ let n = 0, o = 0, a = 0;
1023
+ return s < 60 ? [n, o, a] = [t, i, 0] : s < 120 ? [n, o, a] = [i, t, 0] : s < 180 ? [n, o, a] = [0, t, i] : s < 240 ? [n, o, a] = [0, i, t] : s < 300 ? [n, o, a] = [i, 0, t] : [n, o, a] = [t, 0, i], {
1024
+ r: (n + e) * 255,
1025
+ g: (o + e) * 255,
1026
+ b: (a + e) * 255
1027
+ };
1028
+ }
1029
+ static resolveAlpha(s, t) {
1030
+ return Number.isFinite(s) ? this.clamp(s, 0, 1) : t;
1031
+ }
1032
+ static toRoundedRgbString(s, t, e) {
1033
+ return `rgb(${Math.round(s)}, ${Math.round(t)}, ${Math.round(e)})`;
1034
+ }
1035
+ /**
1036
+ * HSL 转 RGB。
1037
+ * h: 0-360, s/l: 0-100
1038
+ */
1039
+ static hslToRgb(s, t, e) {
1040
+ const i = this.normalizeHue(s), n = this.clamp(t, 0, 100) / 100, o = this.clamp(e, 0, 100) / 100, a = (1 - Math.abs(2 * o - 1)) * n, l = o - a / 2;
1041
+ return this.chromaToRgb(i, a, l);
1042
+ }
1043
+ /**
1044
+ * HSV 转 RGB。
1045
+ * h: 0-360, s/v: 0-100
1046
+ */
1047
+ static hsvToRgb(s, t, e) {
1048
+ const i = this.normalizeHue(s), n = this.clamp(t, 0, 100) / 100, o = this.clamp(e, 0, 100) / 100, a = o * n, l = o - a;
1049
+ return this.chromaToRgb(i, a, l);
1050
+ }
1051
+ /**
1052
+ * 解析任意受支持的颜色格式并标准化为 RGBA。
1053
+ */
1054
+ static parseColor(s) {
1055
+ const t = s.trim().toLowerCase();
1056
+ if (t.startsWith("#")) {
1057
+ const o = t.slice(1);
1058
+ if (o.length === 3 || o.length === 4) {
1059
+ const [a, l, c, h = "f"] = o.split("");
1060
+ return {
1061
+ r: parseInt(`${a}${a}`, 16),
1062
+ g: parseInt(`${l}${l}`, 16),
1063
+ b: parseInt(`${c}${c}`, 16),
1064
+ a: parseInt(`${h}${h}`, 16) / 255
1065
+ };
1066
+ }
1067
+ if (o.length === 6 || o.length === 8) {
1068
+ const a = parseInt(o.slice(0, 2), 16), l = parseInt(o.slice(2, 4), 16), c = parseInt(o.slice(4, 6), 16), h = o.length === 8 ? parseInt(o.slice(6, 8), 16) / 255 : this.DEFAULT_ALPHA;
1069
+ return { r: a, g: l, b: c, a: h };
1070
+ }
1071
+ }
1072
+ const e = t.match(/^rgba?\(([^)]+)\)$/);
1073
+ if (e) {
1074
+ const o = e[1].split(",").map((a) => a.trim());
1075
+ if (o.length >= 3) {
1076
+ const a = this.clamp(Number(o[0]), 0, 255), l = this.clamp(Number(o[1]), 0, 255), c = this.clamp(Number(o[2]), 0, 255), h = o.length >= 4 ? this.clamp(Number(o[3]), 0, 1) : this.DEFAULT_ALPHA;
1077
+ return { r: a, g: l, b: c, a: h };
1078
+ }
1079
+ }
1080
+ const i = t.match(/^hsl\(([^)]+)\)$/);
1081
+ if (i) {
1082
+ const o = i[1].split(",").map((a) => a.trim().replace("%", ""));
1083
+ if (o.length >= 3) {
1084
+ const a = Number(o[0]), l = Number(o[1]), c = Number(o[2]);
1085
+ return { ...this.hslToRgb(a, l, c), a: this.DEFAULT_ALPHA };
1086
+ }
1087
+ }
1088
+ const n = t.match(/^hsv\(([^)]+)\)$/);
1089
+ if (n) {
1090
+ const o = n[1].split(",").map((a) => a.trim().replace("%", ""));
1091
+ if (o.length >= 3) {
1092
+ const a = Number(o[0]), l = Number(o[1]), c = Number(o[2]);
1093
+ return { ...this.hsvToRgb(a, l, c), a: this.DEFAULT_ALPHA };
1094
+ }
1095
+ }
1096
+ return console.error("Invalid color format", s), { r: 0, g: 0, b: 0, a: this.DEFAULT_ALPHA };
1097
+ }
1098
+ /**
1099
+ * 十进制颜色分量转两位十六进制字符串。
1100
+ */
1101
+ static toHexPart(s) {
1102
+ return Math.round(this.clamp(s, 0, 255)).toString(16).padStart(2, "0");
1103
+ }
1104
+ /**
1105
+ * RGB 转 HSL。
1106
+ * 返回 h:0-360, s/l:0-100
1107
+ */
1108
+ static rgbToHsl(s, t, e) {
1109
+ const i = this.clamp(s, 0, 255) / 255, n = this.clamp(t, 0, 255) / 255, o = this.clamp(e, 0, 255) / 255, a = Math.max(i, n, o), l = Math.min(i, n, o), c = a - l;
1110
+ let h = 0;
1111
+ c !== 0 && (a === i ? h = 60 * ((n - o) / c % 6) : a === n ? h = 60 * ((o - i) / c + 2) : h = 60 * ((i - n) / c + 4)), h < 0 && (h += 360);
1112
+ const u = (a + l) / 2, f = c === 0 ? 0 : c / (1 - Math.abs(2 * u - 1));
1113
+ return { h, s: f * 100, l: u * 100 };
1114
+ }
1115
+ /**
1116
+ * RGB 转 HSV。
1117
+ * 返回 h:0-360, s/v:0-100
1118
+ */
1119
+ static rgbToHsv(s, t, e) {
1120
+ const i = this.clamp(s, 0, 255) / 255, n = this.clamp(t, 0, 255) / 255, o = this.clamp(e, 0, 255) / 255, a = Math.max(i, n, o), l = Math.min(i, n, o), c = a - l;
1121
+ let h = 0;
1122
+ c !== 0 && (a === i ? h = 60 * ((n - o) / c % 6) : a === n ? h = 60 * ((o - i) / c + 2) : h = 60 * ((i - n) / c + 4)), h < 0 && (h += 360);
1123
+ const u = a === 0 ? 0 : c / a, f = a;
1124
+ return { h, s: u * 100, v: f * 100 };
1125
+ }
1126
+ /**
1127
+ * 转换为 HEX(#RRGGBB)。
1128
+ */
1129
+ static toHex(s) {
1130
+ const { r: t, g: e, b: i } = this.parseColor(s);
1131
+ return `#${this.toHexPart(t)}${this.toHexPart(e)}${this.toHexPart(i)}`;
1132
+ }
1133
+ /**
1134
+ * 转换为 HEXA(#RRGGBBAA)。
1135
+ * alpha 不传时保留输入颜色中的透明度(默认 1)。
1136
+ */
1137
+ static toHexa(s, t) {
1138
+ const { r: e, g: i, b: n, a: o } = this.parseColor(s), a = this.resolveAlpha(t, o);
1139
+ return `#${this.toHexPart(e)}${this.toHexPart(i)}${this.toHexPart(n)}${this.toHexPart(a * 255)}`;
1140
+ }
1141
+ /**
1142
+ * 转换为 RGB(rgb(r, g, b))。
1143
+ */
1144
+ static toRgb(s) {
1145
+ const { r: t, g: e, b: i } = this.parseColor(s);
1146
+ return this.toRoundedRgbString(t, e, i);
1147
+ }
1148
+ /**
1149
+ * 转换为 RGBA(rgba(r, g, b, a))。
1150
+ * alpha 不传时保留输入颜色中的透明度(默认 1)。
1151
+ */
1152
+ static toRgba(s, t) {
1153
+ const e = this.parseColor(s), i = this.resolveAlpha(t, e.a);
1154
+ return `rgba(${Math.round(e.r)}, ${Math.round(e.g)}, ${Math.round(e.b)}, ${i})`;
1155
+ }
1156
+ /**
1157
+ * 转换为 HSL(hsl(h, s%, l%))。
1158
+ */
1159
+ static toHsl(s) {
1160
+ const { r: t, g: e, b: i } = this.parseColor(s), { h: n, s: o, l: a } = this.rgbToHsl(t, e, i);
1161
+ return `hsl(${Math.round(n)}, ${Math.round(o)}%, ${Math.round(a)}%)`;
1162
+ }
1163
+ /**
1164
+ * 转换为 HSLA(hsla(h, s%, l%, a))。
1165
+ * alpha 不传时保留输入颜色中的透明度(默认 1)。
1166
+ */
1167
+ static toHsla(s, t) {
1168
+ const e = this.parseColor(s), { h: i, s: n, l: o } = this.rgbToHsl(e.r, e.g, e.b), a = this.resolveAlpha(t, e.a);
1169
+ return `hsla(${Math.round(i)}, ${Math.round(n)}%, ${Math.round(o)}%, ${a})`;
1170
+ }
1171
+ /**
1172
+ * 转换为 HSV(hsv(h, s%, v%))。
1173
+ */
1174
+ static toHsv(s) {
1175
+ const { r: t, g: e, b: i } = this.parseColor(s), { h: n, s: o, v: a } = this.rgbToHsv(t, e, i);
1176
+ return `hsv(${Math.round(n)}, ${Math.round(o)}%, ${Math.round(a)}%)`;
1177
+ }
1178
+ /**
1179
+ * 转换为 HSVA(hsva(h, s%, v%, a))。
1180
+ * alpha 不传时保留输入颜色中的透明度(默认 1)。
1181
+ */
1182
+ static toHsva(s, t) {
1183
+ const e = this.parseColor(s), { h: i, s: n, v: o } = this.rgbToHsv(e.r, e.g, e.b), a = this.resolveAlpha(t, e.a);
1184
+ return `hsva(${Math.round(i)}, ${Math.round(n)}%, ${Math.round(o)}%, ${a})`;
1185
+ }
1186
+ }
1187
+ d(ri, "DEFAULT_ALPHA", 1);
1005
1188
  var yt = /* @__PURE__ */ ((r) => (r.RESPONSE = "response", r.QUERY = "query", r))(yt || {});
1006
- class on {
1189
+ class an {
1007
1190
  constructor(s, t) {
1008
1191
  /** 音效资源地址映射(preload 成功后对应项会替换为 blob: URL) */
1009
1192
  d(this, "soundSources");
@@ -1093,11 +1276,11 @@ class on {
1093
1276
  }), l;
1094
1277
  }
1095
1278
  }
1096
- function Ce(r, s) {
1279
+ function be(r, s) {
1097
1280
  for (const t of Object.keys(s))
1098
1281
  s[t] !== void 0 && (r[t] = s[t]);
1099
1282
  }
1100
- class an {
1283
+ class ln {
1101
1284
  constructor(s) {
1102
1285
  /** WebSocket地址 */
1103
1286
  d(this, "url");
@@ -1138,7 +1321,7 @@ class an {
1138
1321
  });
1139
1322
  if (!s) return;
1140
1323
  const { url: t, ping: e, maxRetryCount: i, retryInterval: n } = s;
1141
- e !== void 0 && (typeof e == "boolean" ? this.pingConfig.enabled = e : Ce(this.pingConfig, e)), Ce(this.retryConfig, {
1324
+ e !== void 0 && (typeof e == "boolean" ? this.pingConfig.enabled = e : be(this.pingConfig, e)), be(this.retryConfig, {
1142
1325
  maxCount: i,
1143
1326
  interval: n
1144
1327
  }), t && this.start(t);
@@ -1189,7 +1372,7 @@ class an {
1189
1372
  (s = this.socket) == null || s.close(), this.socket = void 0;
1190
1373
  }
1191
1374
  }
1192
- function ln(r, s = 10) {
1375
+ function cn(r, s = 10) {
1193
1376
  let t = 0, e = s;
1194
1377
  function i() {
1195
1378
  if (e > 0)
@@ -1203,7 +1386,7 @@ function ln(r, s = 10) {
1203
1386
  t = Date.now(), i();
1204
1387
  });
1205
1388
  }
1206
- function cn(r) {
1389
+ function hn(r) {
1207
1390
  const s = () => Promise.resolve(), t = (a) => (console.error(a), Promise.reject(a));
1208
1391
  function e() {
1209
1392
  return navigator.clipboard.writeText(r).then(s).catch(t);
@@ -1230,7 +1413,7 @@ function cn(r) {
1230
1413
  }
1231
1414
  return navigator.clipboard ? e().catch(o) : o();
1232
1415
  }
1233
- function hn(r, s) {
1416
+ function un(r, s) {
1234
1417
  const t = Re[r];
1235
1418
  if (!t) return console.error(`未知纸张类型: ${r}`);
1236
1419
  const { width: e, height: i } = t, n = (p) => p / 25.4, a = typeof window < "u" ? window.devicePixelRatio * 96 : 300, l = (p) => Math.round(n(p) * a), c = l(e), h = l(i), u = l(s), f = Math.max(0, c - 2 * u), m = Math.max(0, h - 2 * u);
@@ -1289,7 +1472,7 @@ class Nt {
1289
1472
  const o = "请先初始化标签页管理器";
1290
1473
  return console.error(o), Promise.reject(o);
1291
1474
  }
1292
- const t = ue();
1475
+ const t = ne();
1293
1476
  let e = !1;
1294
1477
  const i = this.pendingQueries.get(t) || [];
1295
1478
  i.push(() => e = !0), this.pendingQueries.set(t, i);
@@ -1320,7 +1503,7 @@ class Nt {
1320
1503
  const n = "请先初始化标签页管理器";
1321
1504
  return console.error(n), Promise.reject(n);
1322
1505
  }
1323
- const s = ue(), t = [], e = this.pendingQueries.get(s) || [];
1506
+ const s = ne(), t = [], e = this.pendingQueries.get(s) || [];
1324
1507
  e.push((n) => t.push(n)), this.pendingQueries.set(s, e);
1325
1508
  const i = {
1326
1509
  type: yt.QUERY,
@@ -1343,7 +1526,7 @@ d(Nt, "timeout", 150), /**
1343
1526
  * @param callback 匹配标签页的回调函数
1344
1527
  */
1345
1528
  d(Nt, "pendingQueries", /* @__PURE__ */ new Map());
1346
- class un {
1529
+ class dn {
1347
1530
  constructor() {
1348
1531
  /** 用户状态:active(活跃) / idle(闲置) */
1349
1532
  d(this, "status", "active");
@@ -1392,7 +1575,7 @@ class un {
1392
1575
  * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
1393
1576
  * MIT Licence
1394
1577
  */
1395
- var de = 9e15, ut = 1e9, fe = "0123456789abcdef", $t = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Zt = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", me = {
1578
+ var re = 9e15, ht = 1e9, oe = "0123456789abcdef", Gt = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Xt = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", ae = {
1396
1579
  // These values must be integers within the stated ranges (inclusive).
1397
1580
  // Most of these values can be changed at run-time using the `Decimal.config` method.
1398
1581
  // The maximum number of significant digits of the result of a calculation or base conversion.
@@ -1445,12 +1628,12 @@ var de = 9e15, ut = 1e9, fe = "0123456789abcdef", $t = "2.3025850929940456840179
1445
1628
  // -1 to -EXP_LIMIT
1446
1629
  // The maximum exponent value, above which overflow to Infinity occurs.
1447
1630
  // JavaScript numbers: 308 (1.7976931348623157e+308)
1448
- maxE: de,
1631
+ maxE: re,
1449
1632
  // 1 to EXP_LIMIT
1450
1633
  // Whether to use cryptographically-secure random number generation, if available.
1451
1634
  crypto: !1
1452
1635
  // true/false
1453
- }, Te, nt, E = !0, ee = "[DecimalError] ", ht = ee + "Invalid argument: ", Ie = ee + "Precision limit exceeded", Ne = ee + "crypto unavailable", He = "[object Decimal]", F = Math.floor, I = Math.pow, ri = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, oi = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, ai = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Fe = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Q = 1e7, S = 7, li = 9007199254740991, ci = $t.length - 1, ge = Zt.length - 1, v = { toStringTag: He };
1636
+ }, Te, nt, _ = !0, qt = "[DecimalError] ", ct = qt + "Invalid argument: ", Ie = qt + "Precision limit exceeded", Ne = qt + "crypto unavailable", He = "[object Decimal]", F = Math.floor, I = Math.pow, oi = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, ai = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, li = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Fe = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Q = 1e7, S = 7, ci = 9007199254740991, hi = Gt.length - 1, le = Xt.length - 1, v = { toStringTag: He };
1454
1637
  v.absoluteValue = v.abs = function() {
1455
1638
  var r = new this.constructor(this);
1456
1639
  return r.s < 0 && (r.s = 1), C(r);
@@ -1461,7 +1644,7 @@ v.ceil = function() {
1461
1644
  v.clampedTo = v.clamp = function(r, s) {
1462
1645
  var t, e = this, i = e.constructor;
1463
1646
  if (r = new i(r), s = new i(s), !r.s || !s.s) return new i(NaN);
1464
- if (r.gt(s)) throw Error(ht + s);
1647
+ if (r.gt(s)) throw Error(ct + s);
1465
1648
  return t = e.cmp(r), t < 0 ? r : e.cmp(s) > 0 ? s : new i(e);
1466
1649
  };
1467
1650
  v.comparedTo = v.cmp = function(r) {
@@ -1477,12 +1660,12 @@ v.comparedTo = v.cmp = function(r) {
1477
1660
  };
1478
1661
  v.cosine = v.cos = function() {
1479
1662
  var r, s, t = this, e = t.constructor;
1480
- return t.d ? t.d[0] ? (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = hi(e, Xe(e, t)), e.precision = r, e.rounding = s, C(nt == 2 || nt == 3 ? t.neg() : t, r, s, !0)) : new e(1) : new e(NaN);
1663
+ return t.d ? t.d[0] ? (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = ui(e, Xe(e, t)), e.precision = r, e.rounding = s, C(nt == 2 || nt == 3 ? t.neg() : t, r, s, !0)) : new e(1) : new e(NaN);
1481
1664
  };
1482
1665
  v.cubeRoot = v.cbrt = function() {
1483
1666
  var r, s, t, e, i, n, o, a, l, c, h = this, u = h.constructor;
1484
1667
  if (!h.isFinite() || h.isZero()) return new u(h);
1485
- for (E = !1, n = h.s * I(h.s * h, 1 / 3), !n || Math.abs(n) == 1 / 0 ? (t = N(h.d), r = h.e, (n = (r - t.length + 1) % 3) && (t += n == 1 || n == -2 ? "0" : "00"), n = I(t, 1 / 3), r = F((r + 1) / 3) - (r % 3 == (r < 0 ? -1 : 2)), n == 1 / 0 ? t = "5e" + r : (t = n.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + r), e = new u(t), e.s = h.s) : e = new u(n.toString()), o = (r = u.precision) + 3; ; )
1668
+ for (_ = !1, n = h.s * I(h.s * h, 1 / 3), !n || Math.abs(n) == 1 / 0 ? (t = N(h.d), r = h.e, (n = (r - t.length + 1) % 3) && (t += n == 1 || n == -2 ? "0" : "00"), n = I(t, 1 / 3), r = F((r + 1) / 3) - (r % 3 == (r < 0 ? -1 : 2)), n == 1 / 0 ? t = "5e" + r : (t = n.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + r), e = new u(t), e.s = h.s) : e = new u(n.toString()), o = (r = u.precision) + 3; ; )
1486
1669
  if (a = e, l = a.times(a).times(a), c = l.plus(h), e = V(c.plus(h).times(a), c.plus(l), o + 2, 1), N(a.d).slice(0, o) === (t = N(e.d)).slice(0, o))
1487
1670
  if (t = t.slice(o - 3, o + 1), t == "9999" || !i && t == "4999") {
1488
1671
  if (!i && (C(a, r + 1, 0), a.times(a).times(a).eq(h))) {
@@ -1494,7 +1677,7 @@ v.cubeRoot = v.cbrt = function() {
1494
1677
  (!+t || !+t.slice(1) && t.charAt(0) == "5") && (C(e, r + 1, 1), s = !e.times(e).times(e).eq(h));
1495
1678
  break;
1496
1679
  }
1497
- return E = !0, C(e, r, u.rounding, s);
1680
+ return _ = !0, C(e, r, u.rounding, s);
1498
1681
  };
1499
1682
  v.decimalPlaces = v.dp = function() {
1500
1683
  var r, s = this.d, t = NaN;
@@ -1528,7 +1711,7 @@ v.hyperbolicCosine = v.cosh = function() {
1528
1711
  var r, s, t, e, i, n = this, o = n.constructor, a = new o(1);
1529
1712
  if (!n.isFinite()) return new o(n.s ? 1 / 0 : NaN);
1530
1713
  if (n.isZero()) return a;
1531
- t = o.precision, e = o.rounding, o.precision = t + Math.max(n.e, n.sd()) + 4, o.rounding = 1, i = n.d.length, i < 32 ? (r = Math.ceil(i / 3), s = (1 / se(4, r)).toString()) : (r = 16, s = "2.3283064365386962890625e-10"), n = Mt(o, 1, n.times(s), new o(1), !0);
1714
+ t = o.precision, e = o.rounding, o.precision = t + Math.max(n.e, n.sd()) + 4, o.rounding = 1, i = n.d.length, i < 32 ? (r = Math.ceil(i / 3), s = (1 / Qt(4, r)).toString()) : (r = 16, s = "2.3283064365386962890625e-10"), n = Mt(o, 1, n.times(s), new o(1), !0);
1532
1715
  for (var l, c = r, h = new o(8); c--; )
1533
1716
  l = n.times(n), n = a.minus(l.times(h.minus(l.times(h))));
1534
1717
  return C(n, o.precision = t, o.rounding = e, !0);
@@ -1539,7 +1722,7 @@ v.hyperbolicSine = v.sinh = function() {
1539
1722
  if (s = n.precision, t = n.rounding, n.precision = s + Math.max(i.e, i.sd()) + 4, n.rounding = 1, e = i.d.length, e < 3)
1540
1723
  i = Mt(n, 2, i, i, !0);
1541
1724
  else {
1542
- r = 1.4 * Math.sqrt(e), r = r > 16 ? 16 : r | 0, i = i.times(1 / se(5, r)), i = Mt(n, 2, i, i, !0);
1725
+ r = 1.4 * Math.sqrt(e), r = r > 16 ? 16 : r | 0, i = i.times(1 / Qt(5, r)), i = Mt(n, 2, i, i, !0);
1543
1726
  for (var o, a = new n(5), l = new n(16), c = new n(20); r--; )
1544
1727
  o = i.times(i), i = i.times(a.plus(o.times(l.times(o).plus(c))));
1545
1728
  }
@@ -1555,11 +1738,11 @@ v.inverseCosine = v.acos = function() {
1555
1738
  };
1556
1739
  v.inverseHyperbolicCosine = v.acosh = function() {
1557
1740
  var r, s, t = this, e = t.constructor;
1558
- return t.lte(1) ? new e(t.eq(1) ? 0 : NaN) : t.isFinite() ? (r = e.precision, s = e.rounding, e.precision = r + Math.max(Math.abs(t.e), t.sd()) + 4, e.rounding = 1, E = !1, t = t.times(t).minus(1).sqrt().plus(t), E = !0, e.precision = r, e.rounding = s, t.ln()) : new e(t);
1741
+ return t.lte(1) ? new e(t.eq(1) ? 0 : NaN) : t.isFinite() ? (r = e.precision, s = e.rounding, e.precision = r + Math.max(Math.abs(t.e), t.sd()) + 4, e.rounding = 1, _ = !1, t = t.times(t).minus(1).sqrt().plus(t), _ = !0, e.precision = r, e.rounding = s, t.ln()) : new e(t);
1559
1742
  };
1560
1743
  v.inverseHyperbolicSine = v.asinh = function() {
1561
1744
  var r, s, t = this, e = t.constructor;
1562
- return !t.isFinite() || t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 2 * Math.max(Math.abs(t.e), t.sd()) + 6, e.rounding = 1, E = !1, t = t.times(t).plus(1).sqrt().plus(t), E = !0, e.precision = r, e.rounding = s, t.ln());
1745
+ return !t.isFinite() || t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 2 * Math.max(Math.abs(t.e), t.sd()) + 6, e.rounding = 1, _ = !1, t = t.times(t).plus(1).sqrt().plus(t), _ = !0, e.precision = r, e.rounding = s, t.ln());
1563
1746
  };
1564
1747
  v.inverseHyperbolicTangent = v.atanh = function() {
1565
1748
  var r, s, t, e, i = this, n = i.constructor;
@@ -1574,17 +1757,17 @@ v.inverseTangent = v.atan = function() {
1574
1757
  if (c.isFinite()) {
1575
1758
  if (c.isZero())
1576
1759
  return new h(c);
1577
- if (c.abs().eq(1) && u + 4 <= ge)
1760
+ if (c.abs().eq(1) && u + 4 <= le)
1578
1761
  return o = tt(h, u + 4, f).times(0.25), o.s = c.s, o;
1579
1762
  } else {
1580
1763
  if (!c.s) return new h(NaN);
1581
- if (u + 4 <= ge)
1764
+ if (u + 4 <= le)
1582
1765
  return o = tt(h, u + 4, f).times(0.5), o.s = c.s, o;
1583
1766
  }
1584
1767
  for (h.precision = a = u + 10, h.rounding = 1, t = Math.min(28, a / S + 2 | 0), r = t; r; --r) c = c.div(c.times(c).plus(1).sqrt().plus(1));
1585
- for (E = !1, s = Math.ceil(a / S), e = 1, l = c.times(c), o = new h(c), i = c; r !== -1; )
1768
+ for (_ = !1, s = Math.ceil(a / S), e = 1, l = c.times(c), o = new h(c), i = c; r !== -1; )
1586
1769
  if (i = i.times(l), n = o.minus(i.div(e += 2)), i = i.times(l), o = n.plus(i.div(e += 2)), o.d[s] !== void 0) for (r = s; o.d[r] === n.d[r] && r--; ) ;
1587
- return t && (o = o.times(2 << t - 1)), E = !0, C(o, h.precision = u, h.rounding = f, !0);
1770
+ return t && (o = o.times(2 << t - 1)), _ = !0, C(o, h.precision = u, h.rounding = f, !0);
1588
1771
  };
1589
1772
  v.isFinite = function() {
1590
1773
  return !!this.d;
@@ -1627,14 +1810,14 @@ v.logarithm = v.log = function(r) {
1627
1810
  for (i = t[0]; i % 10 === 0; ) i /= 10;
1628
1811
  n = i !== 1;
1629
1812
  }
1630
- if (E = !1, a = u + m, o = at(c, a), e = s ? Qt(h, a + 10) : at(r, a), l = V(o, e, a, 1), kt(l.d, i = u, f))
1813
+ if (_ = !1, a = u + m, o = at(c, a), e = s ? Yt(h, a + 10) : at(r, a), l = V(o, e, a, 1), kt(l.d, i = u, f))
1631
1814
  do
1632
- if (a += 10, o = at(c, a), e = s ? Qt(h, a + 10) : at(r, a), l = V(o, e, a, 1), !n) {
1815
+ if (a += 10, o = at(c, a), e = s ? Yt(h, a + 10) : at(r, a), l = V(o, e, a, 1), !n) {
1633
1816
  +N(l.d).slice(i + 1, i + 15) + 1 == 1e14 && (l = C(l, u + 1, 0));
1634
1817
  break;
1635
1818
  }
1636
1819
  while (kt(l.d, i += 10, f));
1637
- return E = !0, C(l, u, f);
1820
+ return _ = !0, C(l, u, f);
1638
1821
  };
1639
1822
  v.minus = v.sub = function(r) {
1640
1823
  var s, t, e, i, n, o, a, l, c, h, u, f, m = this, p = m.constructor;
@@ -1646,7 +1829,7 @@ v.minus = v.sub = function(r) {
1646
1829
  if (f[0]) r.s = -r.s;
1647
1830
  else if (c[0]) r = new p(m);
1648
1831
  else return new p(l === 3 ? -0 : 0);
1649
- return E ? C(r, a, l) : r;
1832
+ return _ ? C(r, a, l) : r;
1650
1833
  }
1651
1834
  if (t = F(r.e / S), h = F(m.e / S), c = c.slice(), n = h - t, n) {
1652
1835
  for (u = n < 0, u ? (s = c, n = -n, o = f.length) : (s = f, t = h, o = c.length), e = Math.max(Math.ceil(a / S), o) + 2, n > e && (n = e, s.length = 1), s.reverse(), e = n; e--; ) s.push(0);
@@ -1669,14 +1852,14 @@ v.minus = v.sub = function(r) {
1669
1852
  }
1670
1853
  for (; c[--o] === 0; ) c.pop();
1671
1854
  for (; c[0] === 0; c.shift()) --t;
1672
- return c[0] ? (r.d = c, r.e = ie(c, t), E ? C(r, a, l) : r) : new p(l === 3 ? -0 : 0);
1855
+ return c[0] ? (r.d = c, r.e = Zt(c, t), _ ? C(r, a, l) : r) : new p(l === 3 ? -0 : 0);
1673
1856
  };
1674
1857
  v.modulo = v.mod = function(r) {
1675
1858
  var s, t = this, e = t.constructor;
1676
- return r = new e(r), !t.d || !r.s || r.d && !r.d[0] ? new e(NaN) : !r.d || t.d && !t.d[0] ? C(new e(t), e.precision, e.rounding) : (E = !1, e.modulo == 9 ? (s = V(t, r.abs(), 0, 3, 1), s.s *= r.s) : s = V(t, r, 0, e.modulo, 1), s = s.times(r), E = !0, t.minus(s));
1859
+ return r = new e(r), !t.d || !r.s || r.d && !r.d[0] ? new e(NaN) : !r.d || t.d && !t.d[0] ? C(new e(t), e.precision, e.rounding) : (_ = !1, e.modulo == 9 ? (s = V(t, r.abs(), 0, 3, 1), s.s *= r.s) : s = V(t, r, 0, e.modulo, 1), s = s.times(r), _ = !0, t.minus(s));
1677
1860
  };
1678
1861
  v.naturalExponential = v.exp = function() {
1679
- return pe(this);
1862
+ return ce(this);
1680
1863
  };
1681
1864
  v.naturalLogarithm = v.ln = function() {
1682
1865
  return at(this);
@@ -1692,7 +1875,7 @@ v.plus = v.add = function(r) {
1692
1875
  if (u.s != r.s)
1693
1876
  return r.s = -r.s, u.minus(r);
1694
1877
  if (c = u.d, h = r.d, a = f.precision, l = f.rounding, !c[0] || !h[0])
1695
- return h[0] || (r = new f(u)), E ? C(r, a, l) : r;
1878
+ return h[0] || (r = new f(u)), _ ? C(r, a, l) : r;
1696
1879
  if (n = F(u.e / S), e = F(r.e / S), c = c.slice(), i = n - e, i) {
1697
1880
  for (i < 0 ? (t = c, i = -i, o = h.length) : (t = h, e = n, o = c.length), n = Math.ceil(a / S), o = n > o ? n + 1 : o + 1, i > o && (i = o, t.length = 1), t.reverse(); i--; ) t.push(0);
1698
1881
  t.reverse();
@@ -1700,12 +1883,12 @@ v.plus = v.add = function(r) {
1700
1883
  for (o = c.length, i = h.length, o - i < 0 && (i = o, t = h, h = c, c = t), s = 0; i; )
1701
1884
  s = (c[--i] = c[i] + h[i] + s) / Q | 0, c[i] %= Q;
1702
1885
  for (s && (c.unshift(s), ++e), o = c.length; c[--o] == 0; ) c.pop();
1703
- return r.d = c, r.e = ie(c, e), E ? C(r, a, l) : r;
1886
+ return r.d = c, r.e = Zt(c, e), _ ? C(r, a, l) : r;
1704
1887
  };
1705
1888
  v.precision = v.sd = function(r) {
1706
1889
  var s, t = this;
1707
- if (r !== void 0 && r !== !!r && r !== 1 && r !== 0) throw Error(ht + r);
1708
- return t.d ? (s = Be(t.d), r && t.e + 1 > s && (s = t.e + 1)) : s = NaN, s;
1890
+ if (r !== void 0 && r !== !!r && r !== 1 && r !== 0) throw Error(ct + r);
1891
+ return t.d ? (s = ze(t.d), r && t.e + 1 > s && (s = t.e + 1)) : s = NaN, s;
1709
1892
  };
1710
1893
  v.round = function() {
1711
1894
  var r = this, s = r.constructor;
@@ -1713,13 +1896,13 @@ v.round = function() {
1713
1896
  };
1714
1897
  v.sine = v.sin = function() {
1715
1898
  var r, s, t = this, e = t.constructor;
1716
- return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = di(e, Xe(e, t)), e.precision = r, e.rounding = s, C(nt > 2 ? t.neg() : t, r, s, !0)) : new e(NaN);
1899
+ return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = fi(e, Xe(e, t)), e.precision = r, e.rounding = s, C(nt > 2 ? t.neg() : t, r, s, !0)) : new e(NaN);
1717
1900
  };
1718
1901
  v.squareRoot = v.sqrt = function() {
1719
1902
  var r, s, t, e, i, n, o = this, a = o.d, l = o.e, c = o.s, h = o.constructor;
1720
1903
  if (c !== 1 || !a || !a[0])
1721
1904
  return new h(!c || c < 0 && (!a || a[0]) ? NaN : a ? o : 1 / 0);
1722
- for (E = !1, c = Math.sqrt(+o), c == 0 || c == 1 / 0 ? (s = N(a), (s.length + l) % 2 == 0 && (s += "0"), c = Math.sqrt(s), l = F((l + 1) / 2) - (l < 0 || l % 2), c == 1 / 0 ? s = "5e" + l : (s = c.toExponential(), s = s.slice(0, s.indexOf("e") + 1) + l), e = new h(s)) : e = new h(c.toString()), t = (l = h.precision) + 3; ; )
1905
+ for (_ = !1, c = Math.sqrt(+o), c == 0 || c == 1 / 0 ? (s = N(a), (s.length + l) % 2 == 0 && (s += "0"), c = Math.sqrt(s), l = F((l + 1) / 2) - (l < 0 || l % 2), c == 1 / 0 ? s = "5e" + l : (s = c.toExponential(), s = s.slice(0, s.indexOf("e") + 1) + l), e = new h(s)) : e = new h(c.toString()), t = (l = h.precision) + 3; ; )
1723
1906
  if (n = e, e = n.plus(V(o, n, t + 2, 1)).times(0.5), N(n.d).slice(0, t) === (s = N(e.d)).slice(0, t))
1724
1907
  if (s = s.slice(t - 3, t + 1), s == "9999" || !i && s == "4999") {
1725
1908
  if (!i && (C(n, l + 1, 0), n.times(n).eq(o))) {
@@ -1731,7 +1914,7 @@ v.squareRoot = v.sqrt = function() {
1731
1914
  (!+s || !+s.slice(1) && s.charAt(0) == "5") && (C(e, l + 1, 1), r = !e.times(e).eq(o));
1732
1915
  break;
1733
1916
  }
1734
- return E = !0, C(e, l, h.rounding, r);
1917
+ return _ = !0, C(e, l, h.rounding, r);
1735
1918
  };
1736
1919
  v.tangent = v.tan = function() {
1737
1920
  var r, s, t = this, e = t.constructor;
@@ -1748,38 +1931,38 @@ v.times = v.mul = function(r) {
1748
1931
  n[i] = (n[i] + s) % Q | 0;
1749
1932
  }
1750
1933
  for (; !n[--o]; ) n.pop();
1751
- return s ? ++t : n.shift(), r.d = n, r.e = ie(n, t), E ? C(r, u.precision, u.rounding) : r;
1934
+ return s ? ++t : n.shift(), r.d = n, r.e = Zt(n, t), _ ? C(r, u.precision, u.rounding) : r;
1752
1935
  };
1753
1936
  v.toBinary = function(r, s) {
1754
- return ye(this, 2, r, s);
1937
+ return ve(this, 2, r, s);
1755
1938
  };
1756
1939
  v.toDecimalPlaces = v.toDP = function(r, s) {
1757
1940
  var t = this, e = t.constructor;
1758
- return t = new e(t), r === void 0 ? t : (G(r, 0, ut), s === void 0 ? s = e.rounding : G(s, 0, 8), C(t, r + t.e + 1, s));
1941
+ return t = new e(t), r === void 0 ? t : (U(r, 0, ht), s === void 0 ? s = e.rounding : U(s, 0, 8), C(t, r + t.e + 1, s));
1759
1942
  };
1760
1943
  v.toExponential = function(r, s) {
1761
1944
  var t, e = this, i = e.constructor;
1762
- return r === void 0 ? t = et(e, !0) : (G(r, 0, ut), s === void 0 ? s = i.rounding : G(s, 0, 8), e = C(new i(e), r + 1, s), t = et(e, !0, r + 1)), e.isNeg() && !e.isZero() ? "-" + t : t;
1945
+ return r === void 0 ? t = et(e, !0) : (U(r, 0, ht), s === void 0 ? s = i.rounding : U(s, 0, 8), e = C(new i(e), r + 1, s), t = et(e, !0, r + 1)), e.isNeg() && !e.isZero() ? "-" + t : t;
1763
1946
  };
1764
1947
  v.toFixed = function(r, s) {
1765
1948
  var t, e, i = this, n = i.constructor;
1766
- return r === void 0 ? t = et(i) : (G(r, 0, ut), s === void 0 ? s = n.rounding : G(s, 0, 8), e = C(new n(i), r + i.e + 1, s), t = et(e, !1, r + e.e + 1)), i.isNeg() && !i.isZero() ? "-" + t : t;
1949
+ return r === void 0 ? t = et(i) : (U(r, 0, ht), s === void 0 ? s = n.rounding : U(s, 0, 8), e = C(new n(i), r + i.e + 1, s), t = et(e, !1, r + e.e + 1)), i.isNeg() && !i.isZero() ? "-" + t : t;
1767
1950
  };
1768
1951
  v.toFraction = function(r) {
1769
1952
  var s, t, e, i, n, o, a, l, c, h, u, f, m = this, p = m.d, g = m.constructor;
1770
1953
  if (!p) return new g(m);
1771
- if (c = t = new g(1), e = l = new g(0), s = new g(e), n = s.e = Be(p) - m.e - 1, o = n % S, s.d[0] = I(10, o < 0 ? S + o : o), r == null)
1954
+ if (c = t = new g(1), e = l = new g(0), s = new g(e), n = s.e = ze(p) - m.e - 1, o = n % S, s.d[0] = I(10, o < 0 ? S + o : o), r == null)
1772
1955
  r = n > 0 ? s : c;
1773
1956
  else {
1774
- if (a = new g(r), !a.isInt() || a.lt(c)) throw Error(ht + a);
1957
+ if (a = new g(r), !a.isInt() || a.lt(c)) throw Error(ct + a);
1775
1958
  r = a.gt(s) ? n > 0 ? s : c : a;
1776
1959
  }
1777
- for (E = !1, a = new g(N(p)), h = g.precision, g.precision = n = p.length * S * 2; u = V(a, s, 0, 1, 1), i = t.plus(u.times(e)), i.cmp(r) != 1; )
1960
+ for (_ = !1, a = new g(N(p)), h = g.precision, g.precision = n = p.length * S * 2; u = V(a, s, 0, 1, 1), i = t.plus(u.times(e)), i.cmp(r) != 1; )
1778
1961
  t = e, e = i, i = c, c = l.plus(u.times(i)), l = i, i = s, s = a.minus(u.times(i)), a = i;
1779
- return i = V(r.minus(t), e, 0, 1, 1), l = l.plus(i.times(c)), t = t.plus(i.times(e)), l.s = c.s = m.s, f = V(c, e, n, 1).minus(m).abs().cmp(V(l, t, n, 1).minus(m).abs()) < 1 ? [c, e] : [l, t], g.precision = h, E = !0, f;
1962
+ return i = V(r.minus(t), e, 0, 1, 1), l = l.plus(i.times(c)), t = t.plus(i.times(e)), l.s = c.s = m.s, f = V(c, e, n, 1).minus(m).abs().cmp(V(l, t, n, 1).minus(m).abs()) < 1 ? [c, e] : [l, t], g.precision = h, _ = !0, f;
1780
1963
  };
1781
1964
  v.toHexadecimal = v.toHex = function(r, s) {
1782
- return ye(this, 16, r, s);
1965
+ return ve(this, 16, r, s);
1783
1966
  };
1784
1967
  v.toNearest = function(r, s) {
1785
1968
  var t = this, e = t.constructor;
@@ -1787,39 +1970,39 @@ v.toNearest = function(r, s) {
1787
1970
  if (!t.d) return t;
1788
1971
  r = new e(1), s = e.rounding;
1789
1972
  } else {
1790
- if (r = new e(r), s === void 0 ? s = e.rounding : G(s, 0, 8), !t.d) return r.s ? t : r;
1973
+ if (r = new e(r), s === void 0 ? s = e.rounding : U(s, 0, 8), !t.d) return r.s ? t : r;
1791
1974
  if (!r.d)
1792
1975
  return r.s && (r.s = t.s), r;
1793
1976
  }
1794
- return r.d[0] ? (E = !1, t = V(t, r, 0, s, 1).times(r), E = !0, C(t)) : (r.s = t.s, t = r), t;
1977
+ return r.d[0] ? (_ = !1, t = V(t, r, 0, s, 1).times(r), _ = !0, C(t)) : (r.s = t.s, t = r), t;
1795
1978
  };
1796
1979
  v.toNumber = function() {
1797
1980
  return +this;
1798
1981
  };
1799
1982
  v.toOctal = function(r, s) {
1800
- return ye(this, 8, r, s);
1983
+ return ve(this, 8, r, s);
1801
1984
  };
1802
1985
  v.toPower = v.pow = function(r) {
1803
1986
  var s, t, e, i, n, o, a = this, l = a.constructor, c = +(r = new l(r));
1804
1987
  if (!a.d || !r.d || !a.d[0] || !r.d[0]) return new l(I(+a, c));
1805
1988
  if (a = new l(a), a.eq(1)) return a;
1806
1989
  if (e = l.precision, n = l.rounding, r.eq(1)) return C(a, e, n);
1807
- if (s = F(r.e / S), s >= r.d.length - 1 && (t = c < 0 ? -c : c) <= li)
1808
- return i = ze(l, a, t, e), r.s < 0 ? new l(1).div(i) : C(i, e, n);
1990
+ if (s = F(r.e / S), s >= r.d.length - 1 && (t = c < 0 ? -c : c) <= ci)
1991
+ return i = Be(l, a, t, e), r.s < 0 ? new l(1).div(i) : C(i, e, n);
1809
1992
  if (o = a.s, o < 0) {
1810
1993
  if (s < r.d.length - 1) return new l(NaN);
1811
1994
  if (r.d[s] & 1 || (o = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
1812
1995
  return a.s = o, a;
1813
1996
  }
1814
- return t = I(+a, c), s = t == 0 || !isFinite(t) ? F(c * (Math.log("0." + N(a.d)) / Math.LN10 + a.e + 1)) : new l(t + "").e, s > l.maxE + 1 || s < l.minE - 1 ? new l(s > 0 ? o / 0 : 0) : (E = !1, l.rounding = a.s = 1, t = Math.min(12, (s + "").length), i = pe(r.times(at(a, e + t)), e), i.d && (i = C(i, e + 5, 1), kt(i.d, e, n) && (s = e + 10, i = C(pe(r.times(at(a, s + t)), s), s + 5, 1), +N(i.d).slice(e + 1, e + 15) + 1 == 1e14 && (i = C(i, e + 1, 0)))), i.s = o, E = !0, l.rounding = n, C(i, e, n));
1997
+ return t = I(+a, c), s = t == 0 || !isFinite(t) ? F(c * (Math.log("0." + N(a.d)) / Math.LN10 + a.e + 1)) : new l(t + "").e, s > l.maxE + 1 || s < l.minE - 1 ? new l(s > 0 ? o / 0 : 0) : (_ = !1, l.rounding = a.s = 1, t = Math.min(12, (s + "").length), i = ce(r.times(at(a, e + t)), e), i.d && (i = C(i, e + 5, 1), kt(i.d, e, n) && (s = e + 10, i = C(ce(r.times(at(a, s + t)), s), s + 5, 1), +N(i.d).slice(e + 1, e + 15) + 1 == 1e14 && (i = C(i, e + 1, 0)))), i.s = o, _ = !0, l.rounding = n, C(i, e, n));
1815
1998
  };
1816
1999
  v.toPrecision = function(r, s) {
1817
2000
  var t, e = this, i = e.constructor;
1818
- return r === void 0 ? t = et(e, e.e <= i.toExpNeg || e.e >= i.toExpPos) : (G(r, 1, ut), s === void 0 ? s = i.rounding : G(s, 0, 8), e = C(new i(e), r, s), t = et(e, r <= e.e || e.e <= i.toExpNeg, r)), e.isNeg() && !e.isZero() ? "-" + t : t;
2001
+ return r === void 0 ? t = et(e, e.e <= i.toExpNeg || e.e >= i.toExpPos) : (U(r, 1, ht), s === void 0 ? s = i.rounding : U(s, 0, 8), e = C(new i(e), r, s), t = et(e, r <= e.e || e.e <= i.toExpNeg, r)), e.isNeg() && !e.isZero() ? "-" + t : t;
1819
2002
  };
1820
2003
  v.toSignificantDigits = v.toSD = function(r, s) {
1821
2004
  var t = this, e = t.constructor;
1822
- return r === void 0 ? (r = e.precision, s = e.rounding) : (G(r, 1, ut), s === void 0 ? s = e.rounding : G(s, 0, 8)), C(new e(t), r, s);
2005
+ return r === void 0 ? (r = e.precision, s = e.rounding) : (U(r, 1, ht), s === void 0 ? s = e.rounding : U(s, 0, 8)), C(new e(t), r, s);
1823
2006
  };
1824
2007
  v.toString = function() {
1825
2008
  var r = this, s = r.constructor, t = et(r, r.e <= s.toExpNeg || r.e >= s.toExpPos);
@@ -1843,9 +2026,9 @@ function N(r) {
1843
2026
  for (; o % 10 === 0; ) o /= 10;
1844
2027
  return n + o;
1845
2028
  }
1846
- function G(r, s, t) {
2029
+ function U(r, s, t) {
1847
2030
  if (r !== ~~r || r < s || r > t)
1848
- throw Error(ht + r);
2031
+ throw Error(ct + r);
1849
2032
  }
1850
2033
  function kt(r, s, t, e) {
1851
2034
  var i, n, o, a;
@@ -1855,15 +2038,15 @@ function kt(r, s, t, e) {
1855
2038
  function Ft(r, s, t) {
1856
2039
  for (var e, i = [0], n, o = 0, a = r.length; o < a; ) {
1857
2040
  for (n = i.length; n--; ) i[n] *= s;
1858
- for (i[0] += fe.indexOf(r.charAt(o++)), e = 0; e < i.length; e++)
2041
+ for (i[0] += oe.indexOf(r.charAt(o++)), e = 0; e < i.length; e++)
1859
2042
  i[e] > t - 1 && (i[e + 1] === void 0 && (i[e + 1] = 0), i[e + 1] += i[e] / t | 0, i[e] %= t);
1860
2043
  }
1861
2044
  return i.reverse();
1862
2045
  }
1863
- function hi(r, s) {
2046
+ function ui(r, s) {
1864
2047
  var t, e, i;
1865
2048
  if (s.isZero()) return s;
1866
- e = s.d.length, e < 32 ? (t = Math.ceil(e / 3), i = (1 / se(4, t)).toString()) : (t = 16, i = "2.3283064365386962890625e-10"), r.precision += t, s = Mt(r, 1, s.times(i), new r(1));
2049
+ e = s.d.length, e < 32 ? (t = Math.ceil(e / 3), i = (1 / Qt(4, t)).toString()) : (t = 16, i = "2.3283064365386962890625e-10"), r.precision += t, s = Mt(r, 1, s.times(i), new r(1));
1867
2050
  for (var n = t; n--; ) {
1868
2051
  var o = s.times(s);
1869
2052
  s = o.times(o).minus(o).times(8).plus(1);
@@ -1895,29 +2078,29 @@ var V = /* @__PURE__ */ function() {
1895
2078
  for (; !e[0] && e.length > 1; ) e.shift();
1896
2079
  }
1897
2080
  return function(e, i, n, o, a, l) {
1898
- var c, h, u, f, m, p, g, y, w, P, b, _, A, U, At, dt, rt, vt, X, Lt, Tt = e.constructor, ne = e.s == i.s ? 1 : -1, H = e.d, O = i.d;
2081
+ var c, h, u, f, m, p, g, y, w, P, b, E, A, G, At, ut, rt, vt, X, Lt, Tt = e.constructor, Jt = e.s == i.s ? 1 : -1, H = e.d, O = i.d;
1899
2082
  if (!H || !H[0] || !O || !O[0])
1900
2083
  return new Tt(
1901
2084
  // Return NaN if either NaN, or both Infinity or 0.
1902
2085
  !e.s || !i.s || (H ? O && H[0] == O[0] : !O) ? NaN : (
1903
2086
  // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
1904
- H && H[0] == 0 || !O ? ne * 0 : ne / 0
2087
+ H && H[0] == 0 || !O ? Jt * 0 : Jt / 0
1905
2088
  )
1906
2089
  );
1907
- for (l ? (m = 1, h = e.e - i.e) : (l = Q, m = S, h = F(e.e / m) - F(i.e / m)), X = O.length, rt = H.length, w = new Tt(ne), P = w.d = [], u = 0; O[u] == (H[u] || 0); u++) ;
1908
- if (O[u] > (H[u] || 0) && h--, n == null ? (U = n = Tt.precision, o = Tt.rounding) : a ? U = n + (e.e - i.e) + 1 : U = n, U < 0)
2090
+ for (l ? (m = 1, h = e.e - i.e) : (l = Q, m = S, h = F(e.e / m) - F(i.e / m)), X = O.length, rt = H.length, w = new Tt(Jt), P = w.d = [], u = 0; O[u] == (H[u] || 0); u++) ;
2091
+ if (O[u] > (H[u] || 0) && h--, n == null ? (G = n = Tt.precision, o = Tt.rounding) : a ? G = n + (e.e - i.e) + 1 : G = n, G < 0)
1909
2092
  P.push(1), p = !0;
1910
2093
  else {
1911
- if (U = U / m + 2 | 0, u = 0, X == 1) {
1912
- for (f = 0, O = O[0], U++; (u < rt || f) && U--; u++)
2094
+ if (G = G / m + 2 | 0, u = 0, X == 1) {
2095
+ for (f = 0, O = O[0], G++; (u < rt || f) && G--; u++)
1913
2096
  At = f * l + (H[u] || 0), P[u] = At / O | 0, f = At % O | 0;
1914
2097
  p = f || u < rt;
1915
2098
  } else {
1916
- for (f = l / (O[0] + 1) | 0, f > 1 && (O = r(O, f, l), H = r(H, f, l), X = O.length, rt = H.length), dt = X, b = H.slice(0, X), _ = b.length; _ < X; ) b[_++] = 0;
2099
+ for (f = l / (O[0] + 1) | 0, f > 1 && (O = r(O, f, l), H = r(H, f, l), X = O.length, rt = H.length), ut = X, b = H.slice(0, X), E = b.length; E < X; ) b[E++] = 0;
1917
2100
  Lt = O.slice(), Lt.unshift(0), vt = O[0], O[1] >= l / 2 && ++vt;
1918
2101
  do
1919
- f = 0, c = s(O, b, X, _), c < 0 ? (A = b[0], X != _ && (A = A * l + (b[1] || 0)), f = A / vt | 0, f > 1 ? (f >= l && (f = l - 1), g = r(O, f, l), y = g.length, _ = b.length, c = s(g, b, y, _), c == 1 && (f--, t(g, X < y ? Lt : O, y, l))) : (f == 0 && (c = f = 1), g = O.slice()), y = g.length, y < _ && g.unshift(0), t(b, g, _, l), c == -1 && (_ = b.length, c = s(O, b, X, _), c < 1 && (f++, t(b, X < _ ? Lt : O, _, l))), _ = b.length) : c === 0 && (f++, b = [0]), P[u++] = f, c && b[0] ? b[_++] = H[dt] || 0 : (b = [H[dt]], _ = 1);
1920
- while ((dt++ < rt || b[0] !== void 0) && U--);
2102
+ f = 0, c = s(O, b, X, E), c < 0 ? (A = b[0], X != E && (A = A * l + (b[1] || 0)), f = A / vt | 0, f > 1 ? (f >= l && (f = l - 1), g = r(O, f, l), y = g.length, E = b.length, c = s(g, b, y, E), c == 1 && (f--, t(g, X < y ? Lt : O, y, l))) : (f == 0 && (c = f = 1), g = O.slice()), y = g.length, y < E && g.unshift(0), t(b, g, E, l), c == -1 && (E = b.length, c = s(O, b, X, E), c < 1 && (f++, t(b, X < E ? Lt : O, E, l))), E = b.length) : c === 0 && (f++, b = [0]), P[u++] = f, c && b[0] ? b[E++] = H[ut] || 0 : (b = [H[ut]], E = 1);
2103
+ while ((ut++ < rt || b[0] !== void 0) && G--);
1921
2104
  p = b[0] !== void 0;
1922
2105
  }
1923
2106
  P[0] || P.shift();
@@ -1964,28 +2147,28 @@ function C(r, s, t, e) {
1964
2147
  }
1965
2148
  for (n = u.length; u[--n] === 0; ) u.pop();
1966
2149
  }
1967
- return E && (r.e > m.maxE ? (r.d = null, r.e = NaN) : r.e < m.minE && (r.e = 0, r.d = [0])), r;
2150
+ return _ && (r.e > m.maxE ? (r.d = null, r.e = NaN) : r.e < m.minE && (r.e = 0, r.d = [0])), r;
1968
2151
  }
1969
2152
  function et(r, s, t) {
1970
- if (!r.isFinite()) return Ue(r);
2153
+ if (!r.isFinite()) return Ge(r);
1971
2154
  var e, i = r.e, n = N(r.d), o = n.length;
1972
2155
  return s ? (t && (e = t - o) > 0 ? n = n.charAt(0) + "." + n.slice(1) + ot(e) : o > 1 && (n = n.charAt(0) + "." + n.slice(1)), n = n + (r.e < 0 ? "e" : "e+") + r.e) : i < 0 ? (n = "0." + ot(-i - 1) + n, t && (e = t - o) > 0 && (n += ot(e))) : i >= o ? (n += ot(i + 1 - o), t && (e = t - i - 1) > 0 && (n = n + "." + ot(e))) : ((e = i + 1) < o && (n = n.slice(0, e) + "." + n.slice(e)), t && (e = t - o) > 0 && (i + 1 === o && (n += "."), n += ot(e))), n;
1973
2156
  }
1974
- function ie(r, s) {
2157
+ function Zt(r, s) {
1975
2158
  var t = r[0];
1976
2159
  for (s *= S; t >= 10; t /= 10) s++;
1977
2160
  return s;
1978
2161
  }
1979
- function Qt(r, s, t) {
1980
- if (s > ci)
1981
- throw E = !0, t && (r.precision = t), Error(Ie);
1982
- return C(new r($t), s, 1, !0);
2162
+ function Yt(r, s, t) {
2163
+ if (s > hi)
2164
+ throw _ = !0, t && (r.precision = t), Error(Ie);
2165
+ return C(new r(Gt), s, 1, !0);
1983
2166
  }
1984
2167
  function tt(r, s, t) {
1985
- if (s > ge) throw Error(Ie);
1986
- return C(new r(Zt), s, t, !0);
2168
+ if (s > le) throw Error(Ie);
2169
+ return C(new r(Xt), s, t, !0);
1987
2170
  }
1988
- function Be(r) {
2171
+ function ze(r) {
1989
2172
  var s = r.length - 1, t = s * S + 1;
1990
2173
  if (s = r[s], s) {
1991
2174
  for (; s % 10 == 0; s /= 10) t--;
@@ -1997,21 +2180,21 @@ function ot(r) {
1997
2180
  for (var s = ""; r--; ) s += "0";
1998
2181
  return s;
1999
2182
  }
2000
- function ze(r, s, t, e) {
2183
+ function Be(r, s, t, e) {
2001
2184
  var i, n = new r(1), o = Math.ceil(e / S + 4);
2002
- for (E = !1; ; ) {
2003
- if (t % 2 && (n = n.times(s), Ee(n.d, o) && (i = !0)), t = F(t / 2), t === 0) {
2185
+ for (_ = !1; ; ) {
2186
+ if (t % 2 && (n = n.times(s), Se(n.d, o) && (i = !0)), t = F(t / 2), t === 0) {
2004
2187
  t = n.d.length - 1, i && n.d[t] === 0 && ++n.d[t];
2005
2188
  break;
2006
2189
  }
2007
- s = s.times(s), Ee(s.d, o);
2190
+ s = s.times(s), Se(s.d, o);
2008
2191
  }
2009
- return E = !0, n;
2192
+ return _ = !0, n;
2010
2193
  }
2011
- function Se(r) {
2194
+ function Ce(r) {
2012
2195
  return r.d[r.d.length - 1] & 1;
2013
2196
  }
2014
- function Ge(r, s, t) {
2197
+ function Ue(r, s, t) {
2015
2198
  for (var e, i, n = new r(s[0]), o = 0; ++o < s.length; ) {
2016
2199
  if (i = new r(s[o]), !i.s) {
2017
2200
  n = i;
@@ -2021,11 +2204,11 @@ function Ge(r, s, t) {
2021
2204
  }
2022
2205
  return n;
2023
2206
  }
2024
- function pe(r, s) {
2207
+ function ce(r, s) {
2025
2208
  var t, e, i, n, o, a, l, c = 0, h = 0, u = 0, f = r.constructor, m = f.rounding, p = f.precision;
2026
2209
  if (!r.d || !r.d[0] || r.e > 17)
2027
2210
  return new f(r.d ? r.d[0] ? r.s < 0 ? 0 : 1 / 0 : 1 : r.s ? r.s < 0 ? 0 : r : NaN);
2028
- for (s == null ? (E = !1, l = p) : l = s, a = new f(0.03125); r.e > -2; )
2211
+ for (s == null ? (_ = !1, l = p) : l = s, a = new f(0.03125); r.e > -2; )
2029
2212
  r = r.times(a), u += 5;
2030
2213
  for (e = Math.log(I(2, u)) / Math.LN10 * 2 + 5 | 0, l += e, t = n = o = new f(1), f.precision = l; ; ) {
2031
2214
  if (n = C(n.times(r), l, 1), t = t.times(++h), a = o.plus(V(n, t, l, 1)), N(a.d).slice(0, l) === N(o.d).slice(0, l)) {
@@ -2034,7 +2217,7 @@ function pe(r, s) {
2034
2217
  if (c < 3 && kt(o.d, l - e, m, c))
2035
2218
  f.precision = l += 10, t = n = a = new f(1), h = 0, c++;
2036
2219
  else
2037
- return C(o, f.precision = p, m, E = !0);
2220
+ return C(o, f.precision = p, m, _ = !0);
2038
2221
  else
2039
2222
  return f.precision = p, o;
2040
2223
  }
@@ -2045,28 +2228,28 @@ function at(r, s) {
2045
2228
  var t, e, i, n, o, a, l, c, h, u, f, m = 1, p = 10, g = r, y = g.d, w = g.constructor, P = w.rounding, b = w.precision;
2046
2229
  if (g.s < 0 || !y || !y[0] || !g.e && y[0] == 1 && y.length == 1)
2047
2230
  return new w(y && !y[0] ? -1 / 0 : g.s != 1 ? NaN : y ? 0 : g);
2048
- if (s == null ? (E = !1, h = b) : h = s, w.precision = h += p, t = N(y), e = t.charAt(0), Math.abs(n = g.e) < 15e14) {
2231
+ if (s == null ? (_ = !1, h = b) : h = s, w.precision = h += p, t = N(y), e = t.charAt(0), Math.abs(n = g.e) < 15e14) {
2049
2232
  for (; e < 7 && e != 1 || e == 1 && t.charAt(1) > 3; )
2050
2233
  g = g.times(r), t = N(g.d), e = t.charAt(0), m++;
2051
2234
  n = g.e, e > 1 ? (g = new w("0." + t), n++) : g = new w(e + "." + t.slice(1));
2052
2235
  } else
2053
- return c = Qt(w, h + 2, b).times(n + ""), g = at(new w(e + "." + t.slice(1)), h - p).plus(c), w.precision = b, s == null ? C(g, b, P, E = !0) : g;
2236
+ return c = Yt(w, h + 2, b).times(n + ""), g = at(new w(e + "." + t.slice(1)), h - p).plus(c), w.precision = b, s == null ? C(g, b, P, _ = !0) : g;
2054
2237
  for (u = g, l = o = g = V(g.minus(1), g.plus(1), h, 1), f = C(g.times(g), h, 1), i = 3; ; ) {
2055
2238
  if (o = C(o.times(f), h, 1), c = l.plus(V(o, new w(i), h, 1)), N(c.d).slice(0, h) === N(l.d).slice(0, h))
2056
- if (l = l.times(2), n !== 0 && (l = l.plus(Qt(w, h + 2, b).times(n + ""))), l = V(l, new w(m), h, 1), s == null)
2239
+ if (l = l.times(2), n !== 0 && (l = l.plus(Yt(w, h + 2, b).times(n + ""))), l = V(l, new w(m), h, 1), s == null)
2057
2240
  if (kt(l.d, h - p, P, a))
2058
2241
  w.precision = h += p, c = o = g = V(u.minus(1), u.plus(1), h, 1), f = C(g.times(g), h, 1), i = a = 1;
2059
2242
  else
2060
- return C(l, w.precision = b, P, E = !0);
2243
+ return C(l, w.precision = b, P, _ = !0);
2061
2244
  else
2062
2245
  return w.precision = b, l;
2063
2246
  l = c, i += 2;
2064
2247
  }
2065
2248
  }
2066
- function Ue(r) {
2249
+ function Ge(r) {
2067
2250
  return String(r.s * r.s / 0);
2068
2251
  }
2069
- function Bt(r, s) {
2252
+ function zt(r, s) {
2070
2253
  var t, e, i;
2071
2254
  for ((t = s.indexOf(".")) > -1 && (s = s.replace(".", "")), (e = s.search(/e/i)) > 0 ? (t < 0 && (t = e), t += +s.slice(e + 1), s = s.substring(0, e)) : t < 0 && (t = s.length), e = 0; s.charCodeAt(e) === 48; e++) ;
2072
2255
  for (i = s.length; s.charCodeAt(i - 1) === 48; --i) ;
@@ -2077,49 +2260,49 @@ function Bt(r, s) {
2077
2260
  } else
2078
2261
  e -= i;
2079
2262
  for (; e--; ) s += "0";
2080
- r.d.push(+s), E && (r.e > r.constructor.maxE ? (r.d = null, r.e = NaN) : r.e < r.constructor.minE && (r.e = 0, r.d = [0]));
2263
+ r.d.push(+s), _ && (r.e > r.constructor.maxE ? (r.d = null, r.e = NaN) : r.e < r.constructor.minE && (r.e = 0, r.d = [0]));
2081
2264
  } else
2082
2265
  r.e = 0, r.d = [0];
2083
2266
  return r;
2084
2267
  }
2085
- function ui(r, s) {
2268
+ function di(r, s) {
2086
2269
  var t, e, i, n, o, a, l, c, h;
2087
2270
  if (s.indexOf("_") > -1) {
2088
- if (s = s.replace(/(\d)_(?=\d)/g, "$1"), Fe.test(s)) return Bt(r, s);
2271
+ if (s = s.replace(/(\d)_(?=\d)/g, "$1"), Fe.test(s)) return zt(r, s);
2089
2272
  } else if (s === "Infinity" || s === "NaN")
2090
2273
  return +s || (r.s = NaN), r.e = NaN, r.d = null, r;
2091
- if (oi.test(s))
2274
+ if (ai.test(s))
2092
2275
  t = 16, s = s.toLowerCase();
2093
- else if (ri.test(s))
2276
+ else if (oi.test(s))
2094
2277
  t = 2;
2095
- else if (ai.test(s))
2278
+ else if (li.test(s))
2096
2279
  t = 8;
2097
2280
  else
2098
- throw Error(ht + s);
2099
- for (n = s.search(/p/i), n > 0 ? (l = +s.slice(n + 1), s = s.substring(2, n)) : s = s.slice(2), n = s.indexOf("."), o = n >= 0, e = r.constructor, o && (s = s.replace(".", ""), a = s.length, n = a - n, i = ze(e, new e(t), n, n * 2)), c = Ft(s, t, Q), h = c.length - 1, n = h; c[n] === 0; --n) c.pop();
2100
- return n < 0 ? new e(r.s * 0) : (r.e = ie(c, h), r.d = c, E = !1, o && (r = V(r, i, a * 4)), l && (r = r.times(Math.abs(l) < 54 ? I(2, l) : R.pow(2, l))), E = !0, r);
2281
+ throw Error(ct + s);
2282
+ for (n = s.search(/p/i), n > 0 ? (l = +s.slice(n + 1), s = s.substring(2, n)) : s = s.slice(2), n = s.indexOf("."), o = n >= 0, e = r.constructor, o && (s = s.replace(".", ""), a = s.length, n = a - n, i = Be(e, new e(t), n, n * 2)), c = Ft(s, t, Q), h = c.length - 1, n = h; c[n] === 0; --n) c.pop();
2283
+ return n < 0 ? new e(r.s * 0) : (r.e = Zt(c, h), r.d = c, _ = !1, o && (r = V(r, i, a * 4)), l && (r = r.times(Math.abs(l) < 54 ? I(2, l) : R.pow(2, l))), _ = !0, r);
2101
2284
  }
2102
- function di(r, s) {
2285
+ function fi(r, s) {
2103
2286
  var t, e = s.d.length;
2104
2287
  if (e < 3)
2105
2288
  return s.isZero() ? s : Mt(r, 2, s, s);
2106
- t = 1.4 * Math.sqrt(e), t = t > 16 ? 16 : t | 0, s = s.times(1 / se(5, t)), s = Mt(r, 2, s, s);
2289
+ t = 1.4 * Math.sqrt(e), t = t > 16 ? 16 : t | 0, s = s.times(1 / Qt(5, t)), s = Mt(r, 2, s, s);
2107
2290
  for (var i, n = new r(5), o = new r(16), a = new r(20); t--; )
2108
2291
  i = s.times(s), s = s.times(n.plus(i.times(o.times(i).minus(a))));
2109
2292
  return s;
2110
2293
  }
2111
2294
  function Mt(r, s, t, e, i) {
2112
2295
  var n, o, a, l, c = r.precision, h = Math.ceil(c / S);
2113
- for (E = !1, l = t.times(t), a = new r(e); ; ) {
2296
+ for (_ = !1, l = t.times(t), a = new r(e); ; ) {
2114
2297
  if (o = V(a.times(l), new r(s++ * s++), c, 1), a = i ? e.plus(o) : e.minus(o), e = V(o.times(l), new r(s++ * s++), c, 1), o = a.plus(e), o.d[h] !== void 0) {
2115
2298
  for (n = h; o.d[n] === a.d[n] && n--; ) ;
2116
2299
  if (n == -1) break;
2117
2300
  }
2118
2301
  n = a, a = e, e = o, o = n;
2119
2302
  }
2120
- return E = !0, o.d.length = h + 1, o;
2303
+ return _ = !0, o.d.length = h + 1, o;
2121
2304
  }
2122
- function se(r, s) {
2305
+ function Qt(r, s) {
2123
2306
  for (var t = r; --s; ) t *= r;
2124
2307
  return t;
2125
2308
  }
@@ -2131,15 +2314,15 @@ function Xe(r, s) {
2131
2314
  nt = e ? 3 : 2;
2132
2315
  else {
2133
2316
  if (s = s.minus(t.times(i)), s.lte(n))
2134
- return nt = Se(t) ? e ? 2 : 3 : e ? 4 : 1, s;
2135
- nt = Se(t) ? e ? 1 : 4 : e ? 3 : 2;
2317
+ return nt = Ce(t) ? e ? 2 : 3 : e ? 4 : 1, s;
2318
+ nt = Ce(t) ? e ? 1 : 4 : e ? 3 : 2;
2136
2319
  }
2137
2320
  return s.minus(i).abs();
2138
2321
  }
2139
- function ye(r, s, t, e) {
2322
+ function ve(r, s, t, e) {
2140
2323
  var i, n, o, a, l, c, h, u, f, m = r.constructor, p = t !== void 0;
2141
- if (p ? (G(t, 1, ut), e === void 0 ? e = m.rounding : G(e, 0, 8)) : (t = m.precision, e = m.rounding), !r.isFinite())
2142
- h = Ue(r);
2324
+ if (p ? (U(t, 1, ht), e === void 0 ? e = m.rounding : U(e, 0, 8)) : (t = m.precision, e = m.rounding), !r.isFinite())
2325
+ h = Ge(r);
2143
2326
  else {
2144
2327
  for (h = et(r), o = h.indexOf("."), p ? (i = 2, s == 16 ? t = t * 4 - 3 : s == 8 && (t = t * 3 - 2)) : i = s, o >= 0 && (h = h.replace(".", ""), f = new m(1), f.e = h.length - o, f.d = Ft(et(f), 10, i), f.e = f.d.length), u = Ft(h, 10, i), n = l = u.length; u[--l] == 0; ) u.pop();
2145
2328
  if (!u[0])
@@ -2149,13 +2332,13 @@ function ye(r, s, t, e) {
2149
2332
  for (; ++u[--t] > i - 1; )
2150
2333
  u[t] = 0, t || (++n, u.unshift(1));
2151
2334
  for (l = u.length; !u[l - 1]; --l) ;
2152
- for (o = 0, h = ""; o < l; o++) h += fe.charAt(u[o]);
2335
+ for (o = 0, h = ""; o < l; o++) h += oe.charAt(u[o]);
2153
2336
  if (p) {
2154
2337
  if (l > 1)
2155
2338
  if (s == 16 || s == 8) {
2156
2339
  for (o = s == 16 ? 4 : 3, --l; l % o; l++) h += "0";
2157
2340
  for (u = Ft(h, i, s), l = u.length; !u[l - 1]; --l) ;
2158
- for (o = 1, h = "1."; o < l; o++) h += fe.charAt(u[o]);
2341
+ for (o = 1, h = "1."; o < l; o++) h += oe.charAt(u[o]);
2159
2342
  } else
2160
2343
  h = h.charAt(0) + "." + h.slice(1);
2161
2344
  h = h + (n < 0 ? "p" : "p+") + n;
@@ -2169,54 +2352,54 @@ function ye(r, s, t, e) {
2169
2352
  }
2170
2353
  return r.s < 0 ? "-" + h : h;
2171
2354
  }
2172
- function Ee(r, s) {
2355
+ function Se(r, s) {
2173
2356
  if (r.length > s)
2174
2357
  return r.length = s, !0;
2175
2358
  }
2176
- function fi(r) {
2359
+ function mi(r) {
2177
2360
  return new this(r).abs();
2178
2361
  }
2179
- function mi(r) {
2362
+ function gi(r) {
2180
2363
  return new this(r).acos();
2181
2364
  }
2182
- function gi(r) {
2365
+ function pi(r) {
2183
2366
  return new this(r).acosh();
2184
2367
  }
2185
- function pi(r, s) {
2368
+ function vi(r, s) {
2186
2369
  return new this(r).plus(s);
2187
2370
  }
2188
- function vi(r) {
2371
+ function yi(r) {
2189
2372
  return new this(r).asin();
2190
2373
  }
2191
- function yi(r) {
2374
+ function wi(r) {
2192
2375
  return new this(r).asinh();
2193
2376
  }
2194
- function wi(r) {
2377
+ function xi(r) {
2195
2378
  return new this(r).atan();
2196
2379
  }
2197
- function xi(r) {
2380
+ function Pi(r) {
2198
2381
  return new this(r).atanh();
2199
2382
  }
2200
- function Pi(r, s) {
2383
+ function bi(r, s) {
2201
2384
  r = new this(r), s = new this(s);
2202
2385
  var t, e = this.precision, i = this.rounding, n = e + 4;
2203
2386
  return !r.s || !s.s ? t = new this(NaN) : !r.d && !s.d ? (t = tt(this, n, 1).times(s.s > 0 ? 0.25 : 0.75), t.s = r.s) : !s.d || r.isZero() ? (t = s.s < 0 ? tt(this, e, i) : new this(0), t.s = r.s) : !r.d || s.isZero() ? (t = tt(this, n, 1).times(0.5), t.s = r.s) : s.s < 0 ? (this.precision = n, this.rounding = 1, t = this.atan(V(r, s, n, 1)), s = tt(this, n, 1), this.precision = e, this.rounding = i, t = r.s < 0 ? t.minus(s) : t.plus(s)) : t = this.atan(V(r, s, n, 1)), t;
2204
2387
  }
2205
- function bi(r) {
2388
+ function Ci(r) {
2206
2389
  return new this(r).cbrt();
2207
2390
  }
2208
- function Ci(r) {
2391
+ function Si(r) {
2209
2392
  return C(r = new this(r), r.e + 1, 2);
2210
2393
  }
2211
- function Si(r, s, t) {
2394
+ function _i(r, s, t) {
2212
2395
  return new this(r).clamp(s, t);
2213
2396
  }
2214
2397
  function Ei(r) {
2215
- if (!r || typeof r != "object") throw Error(ee + "Object expected");
2398
+ if (!r || typeof r != "object") throw Error(qt + "Object expected");
2216
2399
  var s, t, e, i = r.defaults === !0, n = [
2217
2400
  "precision",
2218
2401
  1,
2219
- ut,
2402
+ ht,
2220
2403
  "rounding",
2221
2404
  0,
2222
2405
  8,
@@ -2225,10 +2408,10 @@ function Ei(r) {
2225
2408
  0,
2226
2409
  "toExpPos",
2227
2410
  0,
2228
- de,
2411
+ re,
2229
2412
  "maxE",
2230
2413
  0,
2231
- de,
2414
+ re,
2232
2415
  "minE",
2233
2416
  -9e15,
2234
2417
  0,
@@ -2237,10 +2420,10 @@ function Ei(r) {
2237
2420
  9
2238
2421
  ];
2239
2422
  for (s = 0; s < n.length; s += 3)
2240
- if (t = n[s], i && (this[t] = me[t]), (e = r[t]) !== void 0)
2423
+ if (t = n[s], i && (this[t] = ae[t]), (e = r[t]) !== void 0)
2241
2424
  if (F(e) === e && e >= n[s + 1] && e <= n[s + 2]) this[t] = e;
2242
- else throw Error(ht + t + ": " + e);
2243
- if (t = "crypto", i && (this[t] = me[t]), (e = r[t]) !== void 0)
2425
+ else throw Error(ct + t + ": " + e);
2426
+ if (t = "crypto", i && (this[t] = ae[t]), (e = r[t]) !== void 0)
2244
2427
  if (e === !0 || e === !1 || e === 0 || e === 1)
2245
2428
  if (e)
2246
2429
  if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
@@ -2250,13 +2433,13 @@ function Ei(r) {
2250
2433
  else
2251
2434
  this[t] = !1;
2252
2435
  else
2253
- throw Error(ht + t + ": " + e);
2436
+ throw Error(ct + t + ": " + e);
2254
2437
  return this;
2255
2438
  }
2256
- function _i(r) {
2439
+ function Mi(r) {
2257
2440
  return new this(r).cos();
2258
2441
  }
2259
- function Mi(r) {
2442
+ function Di(r) {
2260
2443
  return new this(r).cosh();
2261
2444
  }
2262
2445
  function Ye(r) {
@@ -2265,7 +2448,7 @@ function Ye(r) {
2265
2448
  var o, a, l, c = this;
2266
2449
  if (!(c instanceof i)) return new i(n);
2267
2450
  if (c.constructor = i, _e(n)) {
2268
- c.s = n.s, E ? !n.d || n.e > i.maxE ? (c.e = NaN, c.d = null) : n.e < i.minE ? (c.e = 0, c.d = [0]) : (c.e = n.e, c.d = n.d.slice()) : (c.e = n.e, c.d = n.d ? n.d.slice() : n.d);
2451
+ c.s = n.s, _ ? !n.d || n.e > i.maxE ? (c.e = NaN, c.d = null) : n.e < i.minE ? (c.e = 0, c.d = [0]) : (c.e = n.e, c.d = n.d.slice()) : (c.e = n.e, c.d = n.d ? n.d.slice() : n.d);
2269
2452
  return;
2270
2453
  }
2271
2454
  if (l = typeof n, l === "number") {
@@ -2275,79 +2458,79 @@ function Ye(r) {
2275
2458
  }
2276
2459
  if (n < 0 ? (n = -n, c.s = -1) : c.s = 1, n === ~~n && n < 1e7) {
2277
2460
  for (o = 0, a = n; a >= 10; a /= 10) o++;
2278
- E ? o > i.maxE ? (c.e = NaN, c.d = null) : o < i.minE ? (c.e = 0, c.d = [0]) : (c.e = o, c.d = [n]) : (c.e = o, c.d = [n]);
2461
+ _ ? o > i.maxE ? (c.e = NaN, c.d = null) : o < i.minE ? (c.e = 0, c.d = [0]) : (c.e = o, c.d = [n]) : (c.e = o, c.d = [n]);
2279
2462
  return;
2280
2463
  }
2281
2464
  if (n * 0 !== 0) {
2282
2465
  n || (c.s = NaN), c.e = NaN, c.d = null;
2283
2466
  return;
2284
2467
  }
2285
- return Bt(c, n.toString());
2468
+ return zt(c, n.toString());
2286
2469
  }
2287
2470
  if (l === "string")
2288
- return (a = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (a === 43 && (n = n.slice(1)), c.s = 1), Fe.test(n) ? Bt(c, n) : ui(c, n);
2471
+ return (a = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (a === 43 && (n = n.slice(1)), c.s = 1), Fe.test(n) ? zt(c, n) : di(c, n);
2289
2472
  if (l === "bigint")
2290
- return n < 0 ? (n = -n, c.s = -1) : c.s = 1, Bt(c, n.toString());
2291
- throw Error(ht + n);
2473
+ return n < 0 ? (n = -n, c.s = -1) : c.s = 1, zt(c, n.toString());
2474
+ throw Error(ct + n);
2292
2475
  }
2293
- if (i.prototype = v, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.EUCLID = 9, i.config = i.set = Ei, i.clone = Ye, i.isDecimal = _e, i.abs = fi, i.acos = mi, i.acosh = gi, i.add = pi, i.asin = vi, i.asinh = yi, i.atan = wi, i.atanh = xi, i.atan2 = Pi, i.cbrt = bi, i.ceil = Ci, i.clamp = Si, i.cos = _i, i.cosh = Mi, i.div = Di, i.exp = Ri, i.floor = ki, i.hypot = Vi, i.ln = Oi, i.log = Ai, i.log10 = Ti, i.log2 = Li, i.max = Ii, i.min = Ni, i.mod = Hi, i.mul = Fi, i.pow = Bi, i.random = zi, i.round = Gi, i.sign = Ui, i.sin = Xi, i.sinh = Yi, i.sqrt = ji, i.sub = Wi, i.sum = qi, i.tan = $i, i.tanh = Zi, i.trunc = Qi, r === void 0 && (r = {}), r && r.defaults !== !0)
2476
+ if (i.prototype = v, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.EUCLID = 9, i.config = i.set = Ei, i.clone = Ye, i.isDecimal = _e, i.abs = mi, i.acos = gi, i.acosh = pi, i.add = vi, i.asin = yi, i.asinh = wi, i.atan = xi, i.atanh = Pi, i.atan2 = bi, i.cbrt = Ci, i.ceil = Si, i.clamp = _i, i.cos = Mi, i.cosh = Di, i.div = Ri, i.exp = ki, i.floor = Vi, i.hypot = Oi, i.ln = Ai, i.log = Li, i.log10 = Ii, i.log2 = Ti, i.max = Ni, i.min = Hi, i.mod = Fi, i.mul = zi, i.pow = Bi, i.random = Ui, i.round = Gi, i.sign = Xi, i.sin = Yi, i.sinh = ji, i.sqrt = Wi, i.sub = $i, i.sum = qi, i.tan = Zi, i.tanh = Qi, i.trunc = Ji, r === void 0 && (r = {}), r && r.defaults !== !0)
2294
2477
  for (e = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], s = 0; s < e.length; ) r.hasOwnProperty(t = e[s++]) || (r[t] = this[t]);
2295
2478
  return i.config(r), i;
2296
2479
  }
2297
- function Di(r, s) {
2480
+ function Ri(r, s) {
2298
2481
  return new this(r).div(s);
2299
2482
  }
2300
- function Ri(r) {
2483
+ function ki(r) {
2301
2484
  return new this(r).exp();
2302
2485
  }
2303
- function ki(r) {
2486
+ function Vi(r) {
2304
2487
  return C(r = new this(r), r.e + 1, 3);
2305
2488
  }
2306
- function Vi() {
2489
+ function Oi() {
2307
2490
  var r, s, t = new this(0);
2308
- for (E = !1, r = 0; r < arguments.length; )
2491
+ for (_ = !1, r = 0; r < arguments.length; )
2309
2492
  if (s = new this(arguments[r++]), s.d)
2310
2493
  t.d && (t = t.plus(s.times(s)));
2311
2494
  else {
2312
2495
  if (s.s)
2313
- return E = !0, new this(1 / 0);
2496
+ return _ = !0, new this(1 / 0);
2314
2497
  t = s;
2315
2498
  }
2316
- return E = !0, t.sqrt();
2499
+ return _ = !0, t.sqrt();
2317
2500
  }
2318
2501
  function _e(r) {
2319
2502
  return r instanceof R || r && r.toStringTag === He || !1;
2320
2503
  }
2321
- function Oi(r) {
2504
+ function Ai(r) {
2322
2505
  return new this(r).ln();
2323
2506
  }
2324
- function Ai(r, s) {
2507
+ function Li(r, s) {
2325
2508
  return new this(r).log(s);
2326
2509
  }
2327
- function Li(r) {
2510
+ function Ti(r) {
2328
2511
  return new this(r).log(2);
2329
2512
  }
2330
- function Ti(r) {
2513
+ function Ii(r) {
2331
2514
  return new this(r).log(10);
2332
2515
  }
2333
- function Ii() {
2334
- return Ge(this, arguments, -1);
2335
- }
2336
2516
  function Ni() {
2337
- return Ge(this, arguments, 1);
2517
+ return Ue(this, arguments, -1);
2338
2518
  }
2339
- function Hi(r, s) {
2340
- return new this(r).mod(s);
2519
+ function Hi() {
2520
+ return Ue(this, arguments, 1);
2341
2521
  }
2342
2522
  function Fi(r, s) {
2523
+ return new this(r).mod(s);
2524
+ }
2525
+ function zi(r, s) {
2343
2526
  return new this(r).mul(s);
2344
2527
  }
2345
2528
  function Bi(r, s) {
2346
2529
  return new this(r).pow(s);
2347
2530
  }
2348
- function zi(r) {
2531
+ function Ui(r) {
2349
2532
  var s, t, e, i, n = 0, o = new this(1), a = [];
2350
- if (r === void 0 ? r = this.precision : G(r, 1, ut), e = Math.ceil(r / S), this.crypto)
2533
+ if (r === void 0 ? r = this.precision : U(r, 1, ht), e = Math.ceil(r / S), this.crypto)
2351
2534
  if (crypto.getRandomValues)
2352
2535
  for (s = crypto.getRandomValues(new Uint32Array(e)); n < e; )
2353
2536
  i = s[n], i >= 429e7 ? s[n] = crypto.getRandomValues(new Uint32Array(1))[0] : a[n++] = i % 1e7;
@@ -2371,41 +2554,41 @@ function zi(r) {
2371
2554
  function Gi(r) {
2372
2555
  return C(r = new this(r), r.e + 1, this.rounding);
2373
2556
  }
2374
- function Ui(r) {
2557
+ function Xi(r) {
2375
2558
  return r = new this(r), r.d ? r.d[0] ? r.s : 0 * r.s : r.s || NaN;
2376
2559
  }
2377
- function Xi(r) {
2560
+ function Yi(r) {
2378
2561
  return new this(r).sin();
2379
2562
  }
2380
- function Yi(r) {
2563
+ function ji(r) {
2381
2564
  return new this(r).sinh();
2382
2565
  }
2383
- function ji(r) {
2566
+ function Wi(r) {
2384
2567
  return new this(r).sqrt();
2385
2568
  }
2386
- function Wi(r, s) {
2569
+ function $i(r, s) {
2387
2570
  return new this(r).sub(s);
2388
2571
  }
2389
2572
  function qi() {
2390
2573
  var r = 0, s = arguments, t = new this(s[r]);
2391
- for (E = !1; t.s && ++r < s.length; ) t = t.plus(s[r]);
2392
- return E = !0, C(t, this.precision, this.rounding);
2574
+ for (_ = !1; t.s && ++r < s.length; ) t = t.plus(s[r]);
2575
+ return _ = !0, C(t, this.precision, this.rounding);
2393
2576
  }
2394
- function $i(r) {
2577
+ function Zi(r) {
2395
2578
  return new this(r).tan();
2396
2579
  }
2397
- function Zi(r) {
2580
+ function Qi(r) {
2398
2581
  return new this(r).tanh();
2399
2582
  }
2400
- function Qi(r) {
2583
+ function Ji(r) {
2401
2584
  return C(r = new this(r), r.e + 1, 1);
2402
2585
  }
2403
2586
  v[Symbol.for("nodejs.util.inspect.custom")] = v.toString;
2404
2587
  v[Symbol.toStringTag] = "Decimal";
2405
- var R = v.constructor = Ye(me);
2406
- $t = new R($t);
2407
- Zt = new R(Zt);
2408
- class Ji {
2588
+ var R = v.constructor = Ye(ae);
2589
+ Gt = new R(Gt);
2590
+ Xt = new R(Xt);
2591
+ class Ki {
2409
2592
  constructor() {
2410
2593
  /** 父级 */
2411
2594
  d(this, "parent");
@@ -2434,8 +2617,13 @@ class Ji {
2434
2617
  setMainCanvas(s) {
2435
2618
  this.mainCanvas = s;
2436
2619
  }
2620
+ /** 从父级移除自身 */
2621
+ remove() {
2622
+ var s;
2623
+ (s = this.parent) == null || s.removeChild(this);
2624
+ }
2437
2625
  }
2438
- class Ki extends Ji {
2626
+ class ts extends Ki {
2439
2627
  constructor() {
2440
2628
  super(...arguments);
2441
2629
  d(this, "_isVisible", !0);
@@ -2481,12 +2669,12 @@ class Ki extends Ji {
2481
2669
  return !0;
2482
2670
  }
2483
2671
  }
2484
- let ts = class extends Ki {
2672
+ let es = class extends ts {
2485
2673
  constructor(s) {
2486
- super(), s.name = s.name || ue("default-name-"), Object.assign(this, { ...s });
2674
+ super(), s.name = s.name || ne("default-name-"), Object.assign(this, { ...s });
2487
2675
  }
2488
2676
  };
2489
- class es extends ts {
2677
+ class is extends es {
2490
2678
  constructor(t) {
2491
2679
  super(t);
2492
2680
  d(this, "_isInteractive", !0);
@@ -2565,7 +2753,7 @@ class es extends ts {
2565
2753
  return (this.parent ? this.parent[t] : !0) && e && (i ? this.isInteractive : !0);
2566
2754
  }
2567
2755
  }
2568
- class is {
2756
+ class ss {
2569
2757
  constructor(s) {
2570
2758
  d(this, "propagationStopped", !1);
2571
2759
  this.data = s;
@@ -2577,7 +2765,7 @@ class is {
2577
2765
  return !this.propagationStopped;
2578
2766
  }
2579
2767
  }
2580
- class Vt extends es {
2768
+ class Vt extends is {
2581
2769
  constructor() {
2582
2770
  super(...arguments);
2583
2771
  //#region 4. 添加事件管理器
@@ -2589,19 +2777,19 @@ class Vt extends es {
2589
2777
  contextmenu: /* @__PURE__ */ new Set(),
2590
2778
  click: /* @__PURE__ */ new Set(),
2591
2779
  doubleClick: /* @__PURE__ */ new Set(),
2592
- dragg: /* @__PURE__ */ new Set()
2780
+ drag: /* @__PURE__ */ new Set()
2593
2781
  });
2594
2782
  /** 共享事件状态集合 控制器 */
2595
2783
  d(this, "sharedControllers", {});
2596
2784
  d(this, "_eventDate", {});
2597
- d(this, "_clearEventDate", !1);
2785
+ d(this, "_clearEventData", !1);
2598
2786
  d(this, "_isHover", !1);
2599
2787
  /**
2600
2788
  * 接收悬停状态变更通知(由外部事件处理器判断后调用)
2601
2789
  * @param state - 当前悬停状态(true:进入元素 / false:离开元素)
2602
2790
  * @param [event] - 可选的关联鼠标事件对象
2603
2791
  */
2604
- d(this, "notifyHover", (t, e) => this.checkEventDate("hover", t) && this.trigger(
2792
+ d(this, "notifyHover", (t, e) => this.checkEventData("hover", t) && this.trigger(
2605
2793
  "hover",
2606
2794
  { state: t, oldState: this.isHover },
2607
2795
  e,
@@ -2613,14 +2801,14 @@ class Vt extends es {
2613
2801
  * @param state - 当前按下状态(true:按下开始 / false:按下结束)
2614
2802
  * @param [event] - 可选的关联鼠标事件对象
2615
2803
  */
2616
- d(this, "notifyDown", (t, e) => this.checkEventDate("down", t) && this.trigger("down", { state: t, oldState: this.isDown }, e, "isDownable"));
2804
+ d(this, "notifyDown", (t, e) => this.checkEventData("down", t) && this.trigger("down", { state: t, oldState: this.isDown }, e, "isDownable"));
2617
2805
  d(this, "_isContextmenu", !1);
2618
2806
  /**
2619
2807
  * 接收右键菜单触发通知(由外部事件处理器判断后调用)
2620
2808
  * @param state - 右键触发状态(true: 右键开始 / false: 右键结束)
2621
2809
  * @param [event] - 可选的关联鼠标事件对象
2622
2810
  */
2623
- d(this, "notifyContextmenu", (t, e) => this.checkEventDate("contextmenu", t) && this.trigger(
2811
+ d(this, "notifyContextmenu", (t, e) => this.checkEventData("contextmenu", t) && this.trigger(
2624
2812
  "contextmenu",
2625
2813
  { state: t, oldState: this.isContextmenu },
2626
2814
  e,
@@ -2637,7 +2825,7 @@ class Vt extends es {
2637
2825
  * @param [event] - 可选的关联鼠标事件对象
2638
2826
  */
2639
2827
  d(this, "notifyClick", (t, e) => {
2640
- if (!this.checkEventDate("click", t)) return;
2828
+ if (!this.checkEventData("click", t)) return;
2641
2829
  let i = !1;
2642
2830
  t ? (i = Date.now() - this.clickTimestamp < this.doubleClickInterval, this.clickTimestamp = i ? 0 : Date.now()) : (this._isDblClick = !1, this.clickTimestamp = 0), i ? this.notifyDoubleClick(i, e) : this.trigger(
2643
2831
  "click",
@@ -2652,7 +2840,7 @@ class Vt extends es {
2652
2840
  * @param state - 双击状态(true: 双击开始 / false: 双击结束)
2653
2841
  * @param [event] - 可选的关联鼠标事件对象
2654
2842
  */
2655
- d(this, "notifyDoubleClick", (t, e) => this.checkEventDate("doubleClick", t) && this.trigger(
2843
+ d(this, "notifyDoubleClick", (t, e) => this.checkEventData("doubleClick", t) && this.trigger(
2656
2844
  "doubleClick",
2657
2845
  { state: t, oldState: this.isDblClick },
2658
2846
  e,
@@ -2665,13 +2853,13 @@ class Vt extends es {
2665
2853
  * @param position.offsetY - 相对于元素Y轴的偏移量
2666
2854
  * @param [event] - 可选的关联鼠标事件对象
2667
2855
  */
2668
- d(this, "notifyDragg", (t, e) => this.checkEventDate("dragg", t) && this.trigger("dragg", t, e, "isDraggable"));
2856
+ d(this, "notifyDrag", (t, e) => this.checkEventData("drag", t) && this.trigger("drag", t, e, "isDraggable"));
2669
2857
  /**
2670
2858
  * 接收滚轮滚动通知(由外部事件处理器判断滚轮动作后调用)
2671
2859
  * @param step - 滚轮滚动步长(正数:向上滚动 / 负数:向下滚动)
2672
2860
  * @param [event] - 可选的关联滚轮事件对象
2673
2861
  */
2674
- d(this, "notifyWheel", (t, e) => this.checkEventDate("wheel", t) && this.trigger("wheel", t, e, "isWheelable"));
2862
+ d(this, "notifyWheel", (t, e) => this.checkEventData("wheel", t) && this.trigger("wheel", t, e, "isWheelable"));
2675
2863
  }
2676
2864
  /** 添加事件监听器 */
2677
2865
  addEventListener(t, e) {
@@ -2695,9 +2883,9 @@ class Vt extends es {
2695
2883
  var c, h;
2696
2884
  if (!this[n]) return;
2697
2885
  this.updateStates(t, e);
2698
- const o = new is(e);
2886
+ const o = new ss(e);
2699
2887
  this.listeners[t].forEach((u) => u(o, i));
2700
- const a = "notify" + (t.charAt(0).toUpperCase() + t.slice(1)), l = ["notifyDragg", "notifyWheel"].includes(a) ? e : e.state;
2888
+ const a = "notify" + (t.charAt(0).toUpperCase() + t.slice(1)), l = ["notifyDrag", "notifyWheel"].includes(a) ? e : e.state;
2701
2889
  o.canPropagate && ((c = this.parent) == null || c[a](l, i)), (h = this.sharedControllers[t]) == null || h.forEach(
2702
2890
  (u) => u !== this && u[a](l, i)
2703
2891
  );
@@ -2723,10 +2911,10 @@ class Vt extends es {
2723
2911
  break;
2724
2912
  }
2725
2913
  }
2726
- checkEventDate(t, e) {
2914
+ checkEventData(t, e) {
2727
2915
  const i = this._eventDate[t], n = JSON.stringify(e);
2728
- return i == n ? !1 : (this._eventDate[t] = n, this._clearEventDate || (this._clearEventDate = !0, Promise.resolve().then(() => {
2729
- this._clearEventDate = !1, this._eventDate = {};
2916
+ return i == n ? !1 : (this._eventDate[t] = n, this._clearEventData || (this._clearEventData = !0, Promise.resolve().then(() => {
2917
+ this._clearEventData = !1, this._eventDate = {};
2730
2918
  })), !0);
2731
2919
  }
2732
2920
  /** 是否触发悬停 */
@@ -2751,7 +2939,7 @@ class Vt extends es {
2751
2939
  }
2752
2940
  //#region 6. 添加事件通知方法
2753
2941
  }
2754
- class ss extends Vt {
2942
+ class ns extends Vt {
2755
2943
  constructor(t) {
2756
2944
  super(t);
2757
2945
  /** 画布元素 */
@@ -2850,6 +3038,9 @@ class ss extends Vt {
2850
3038
  set redrawInNextRenderFrame(t) {
2851
3039
  this._redrawInNextRenderFrame = t;
2852
3040
  }
3041
+ /** 占位,由子类实现 */
3042
+ removeChild(t) {
3043
+ }
2853
3044
  setNotifyReload(t) {
2854
3045
  this.notifyReload = t;
2855
3046
  }
@@ -3022,7 +3213,7 @@ class ss extends Vt {
3022
3213
  ) : l(t);
3023
3214
  }
3024
3215
  }
3025
- class ns extends ss {
3216
+ class rs extends ns {
3026
3217
  constructor(t) {
3027
3218
  super(t);
3028
3219
  /** 主题 */
@@ -3273,7 +3464,7 @@ class ns extends ss {
3273
3464
  const i = si(
3274
3465
  this.style[e] || this.style[this.theme]
3275
3466
  );
3276
- ct(i, t[e]), this.style[e] = i;
3467
+ lt(i, t[e]), this.style[e] = i;
3277
3468
  }
3278
3469
  this.initStyle();
3279
3470
  }
@@ -3548,7 +3739,7 @@ class D extends Vt {
3548
3739
  handleValuePosition(t, e) {
3549
3740
  let { value: i, position: n, mainCanvas: o } = this;
3550
3741
  if (!o) return !1;
3551
- const a = t === "array1D" ? ve : qt, [l, c] = [
3742
+ const a = t === "array1D" ? pe : Ut, [l, c] = [
3552
3743
  a(i) && (!e || i.length >= e),
3553
3744
  a(n) && (!e || n.length >= e)
3554
3745
  ], h = {
@@ -3604,9 +3795,12 @@ class D extends Vt {
3604
3795
  get cursorStyle() {
3605
3796
  return this.isInteractive ? this.isDraggable ? "_nhanh_canvas_hover_overlay_draggable" : "_nhanh_canvas_hover_overlay" : void 0;
3606
3797
  }
3798
+ /** 占位,无实际意义 */
3799
+ removeChild() {
3800
+ }
3607
3801
  }
3608
3802
  d(D, "ctx", document.createElement("canvas").getContext("2d"));
3609
- class zt extends D {
3803
+ class he extends D {
3610
3804
  constructor(t) {
3611
3805
  super(t);
3612
3806
  d(this, "_draw");
@@ -3714,13 +3908,13 @@ class k {
3714
3908
  return new R(s).div(t).toNumber();
3715
3909
  }
3716
3910
  }
3717
- class Gt extends D {
3911
+ class ue extends D {
3718
3912
  constructor(t) {
3719
3913
  super(t);
3720
3914
  /** 文字偏差 */
3721
3915
  d(this, "textOffset", { x: 0, y: 0 });
3722
3916
  d(this, "_text");
3723
- d(this, "defaultDragg", (t, e) => {
3917
+ d(this, "defaultDrag", (t, e) => {
3724
3918
  var l;
3725
3919
  const { offsetX: i, offsetY: n } = t.data, { x: o, y: a } = this.calculateOffset(i, n);
3726
3920
  this.internalUpdate(
@@ -3742,7 +3936,7 @@ class Gt extends D {
3742
3936
  ), (l = this.notifyReload) == null || l.call(this);
3743
3937
  });
3744
3938
  const { text: e } = t;
3745
- Object.assign(this, { text: e }), this.addEventListener("dragg", this.defaultDragg);
3939
+ Object.assign(this, { text: e }), this.addEventListener("drag", this.defaultDrag);
3746
3940
  }
3747
3941
  /** 文字 */
3748
3942
  get text() {
@@ -3814,11 +4008,11 @@ class Gt extends D {
3814
4008
  }
3815
4009
  }
3816
4010
  }
3817
- class lt extends D {
4011
+ class pt extends D {
3818
4012
  constructor(t) {
3819
4013
  super(t);
3820
4014
  d(this, "angle", 2 * Math.PI);
3821
- d(this, "defaultDragg", (t, e) => {
4015
+ d(this, "defaultDrag", (t, e) => {
3822
4016
  var l;
3823
4017
  const { offsetX: i, offsetY: n } = t.data, { x: o, y: a } = this.calculateOffset(i, n);
3824
4018
  this.internalUpdate(
@@ -3850,7 +4044,7 @@ class lt extends D {
3850
4044
  n - 100
3851
4045
  ) : i && this.startNewHoverAnimation(o, n);
3852
4046
  });
3853
- this.addEventListener("hover", this.defaultHover), this.addEventListener("dragg", this.defaultDragg);
4047
+ this.addEventListener("hover", this.defaultHover), this.addEventListener("drag", this.defaultDrag);
3854
4048
  }
3855
4049
  updateValueScope() {
3856
4050
  this.initValueScope();
@@ -3859,7 +4053,7 @@ class lt extends D {
3859
4053
  cancelAndRestartAnimation(t, e, i) {
3860
4054
  this.fillProgress.scheduleCallback();
3861
4055
  let n = 0;
3862
- this.fillProgress.scheduleCallback = Wt((o) => {
4056
+ this.fillProgress.scheduleCallback = Bt((o) => {
3863
4057
  !this.fillProgress || !o || (this.fillProgress.progress += (o - n) * (t ? 1 : -1), n = o, this.fillProgress.progress = Math.min(
3864
4058
  1,
3865
4059
  Math.max(0, this.fillProgress.progress)
@@ -3871,7 +4065,7 @@ class lt extends D {
3871
4065
  this.fillProgress = {
3872
4066
  lineWidthOffset: 0,
3873
4067
  progress: 0,
3874
- scheduleCallback: Wt((i) => {
4068
+ scheduleCallback: Bt((i) => {
3875
4069
  this.fillProgress && (this.fillProgress.progress = i, this.updateLineWidthOffset(t));
3876
4070
  }, e)
3877
4071
  };
@@ -3966,7 +4160,7 @@ class je extends D {
3966
4160
  }
3967
4161
  });
3968
4162
  /** 处理拖动状态变化 */
3969
- d(this, "defaultDragg", (t, e) => {
4163
+ d(this, "defaultDrag", (t, e) => {
3970
4164
  var n;
3971
4165
  if (!this.mainCanvas) return;
3972
4166
  const i = () => {
@@ -3999,14 +4193,14 @@ class je extends D {
3999
4193
  );
4000
4194
  if (o != -1) {
4001
4195
  const a = this.handlePoints[o];
4002
- a.notifyDragg(t.data, e), this.value[o] = a.value, this.position[o] = a.position, this.dynamicPosition[o] = a.dynamicPosition;
4196
+ a.notifyDrag(t.data, e), this.value[o] = a.value, this.position[o] = a.position, this.dynamicPosition[o] = a.dynamicPosition;
4003
4197
  } else i();
4004
4198
  } else i();
4005
4199
  (n = this.notifyReload) == null || n.call(this), this.updateValueScope();
4006
4200
  });
4007
4201
  ["isHandlePointsVisible", "canCreateOrDeleteHandlePoint"].forEach((e) => {
4008
4202
  e in t && (this[e] = t[e]);
4009
- }), this.addEventListener("click", this.defaultClick), this.addEventListener("doubleClick", this.defaultDoubleClick), this.addEventListener("dragg", this.defaultDragg);
4203
+ }), this.addEventListener("click", this.defaultClick), this.addEventListener("doubleClick", this.defaultDoubleClick), this.addEventListener("drag", this.defaultDrag);
4010
4204
  }
4011
4205
  /** 是否可显示控制点 */
4012
4206
  get isHandlePointsVisible() {
@@ -4029,7 +4223,7 @@ class je extends D {
4029
4223
  tryCreateNewHandlePoint(t, e) {
4030
4224
  var c;
4031
4225
  if (!this.isPointInStroke(t, e)) return;
4032
- const i = this.getExtendedDynamicPositions(), n = rs([t, e], i);
4226
+ const i = this.getExtendedDynamicPositions(), n = os([t, e], i);
4033
4227
  if (n === -1) return;
4034
4228
  const [o, a] = this.getAdjacentIndices(n), l = this.createNewHandlePoint(o, a);
4035
4229
  this.insertHandlePoint(n, l), this.lockHandlePointCreationTemporarily(), (c = this.notifyReload) == null || c.call(this);
@@ -4050,17 +4244,17 @@ class je extends D {
4050
4244
  }
4051
4245
  /** 创建新的控制点 */
4052
4246
  createNewHandlePoint(t, e) {
4053
- const i = oe(
4247
+ const i = te(
4054
4248
  this.value[t],
4055
4249
  this.value[e]
4056
- ), n = oe(
4250
+ ), n = te(
4057
4251
  this.position[t],
4058
4252
  this.position[e]
4059
- ), o = oe(
4253
+ ), o = te(
4060
4254
  this.dynamicPosition[t],
4061
4255
  this.dynamicPosition[e]
4062
4256
  );
4063
- return new lt({
4257
+ return new pt({
4064
4258
  value: i,
4065
4259
  position: n,
4066
4260
  dynamicPosition: o,
@@ -4099,7 +4293,7 @@ class je extends D {
4099
4293
  let { value: t, position: e, dynamicPosition: i, offset: n, isHandlePointsVisible: o } = this;
4100
4294
  !i || !o || (t == null || t.forEach((a, l) => {
4101
4295
  if (!this.handlePoints[l]) {
4102
- const c = new lt({
4296
+ const c = new pt({
4103
4297
  value: [0, 0],
4104
4298
  mainCanvas: this.mainCanvas,
4105
4299
  isDraggable: !0,
@@ -4128,12 +4322,12 @@ class je extends D {
4128
4322
  });
4129
4323
  }
4130
4324
  }
4131
- function rs(r, s, t = 10) {
4325
+ function os(r, s, t = 10) {
4132
4326
  if (s.length === 0) return 0;
4133
4327
  if (s.length === 1) return 1;
4134
4328
  let e = 1 / 0, i = -1;
4135
4329
  for (let n = 0; n < s.length - 1; n++) {
4136
- const o = Rs(
4330
+ const o = ks(
4137
4331
  r,
4138
4332
  s[n],
4139
4333
  s[n + 1]
@@ -4144,11 +4338,11 @@ function rs(r, s, t = 10) {
4144
4338
  }
4145
4339
  return i;
4146
4340
  }
4147
- function oe(r, s) {
4148
- const { x: t, y: e } = $e(...r, ...s);
4341
+ function te(r, s) {
4342
+ const { x: t, y: e } = qe(...r, ...s);
4149
4343
  return [t, e];
4150
4344
  }
4151
- class Ut extends je {
4345
+ class de extends je {
4152
4346
  constructor(t) {
4153
4347
  super(t);
4154
4348
  d(this, "_isInfinite");
@@ -4189,7 +4383,7 @@ class Ut extends je {
4189
4383
  if (this.isInfinite) {
4190
4384
  this.isRecalculate && this.updateDynamicPosition();
4191
4385
  const { width: t, height: e } = this.mainCanvas.rect;
4192
- return os(
4386
+ return as(
4193
4387
  [0, 0],
4194
4388
  [t, e],
4195
4389
  this.finalDynamicPosition[0],
@@ -4210,7 +4404,7 @@ class Ut extends je {
4210
4404
  var o;
4211
4405
  const e = this.mainCanvas, i = e.style[e.theme].line;
4212
4406
  let n = {};
4213
- return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.line) || i : typeof this.style == "object" ? n = ct(
4407
+ return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.line) || i : typeof this.style == "object" ? n = lt(
4214
4408
  JSON.parse(JSON.stringify(i)),
4215
4409
  this.style
4216
4410
  ) : n = i, t && this.setBaseLineStyle(t, n.stroke), n;
@@ -4239,12 +4433,12 @@ class Ut extends je {
4239
4433
  const { rect: n } = e, [o, a] = i, l = [a[0] - o[0], a[1] - o[1]];
4240
4434
  if (l[0] === 0 && l[1] === 0)
4241
4435
  return console.error("重合点无法确定方向");
4242
- const c = Me(
4436
+ const c = Ee(
4243
4437
  o,
4244
4438
  [-l[0], -l[1]],
4245
4439
  n.width,
4246
4440
  n.height
4247
- ), h = Me(
4441
+ ), h = Ee(
4248
4442
  a,
4249
4443
  l,
4250
4444
  n.width,
@@ -4259,7 +4453,7 @@ class Ut extends je {
4259
4453
  }
4260
4454
  }
4261
4455
  }
4262
- function Me(r, s, t, e) {
4456
+ function Ee(r, s, t, e) {
4263
4457
  const [i, n] = r, [o, a] = s;
4264
4458
  let l = 1 / 0;
4265
4459
  if (o !== 0) {
@@ -4272,7 +4466,7 @@ function Me(r, s, t, e) {
4272
4466
  }
4273
4467
  return l === 1 / 0 ? r : [i + o * l, n + a * l];
4274
4468
  }
4275
- function os(r, s, t, e) {
4469
+ function as(r, s, t, e) {
4276
4470
  const i = Math.min(r[0], s[0]), n = Math.max(r[0], s[0]), o = Math.min(r[1], s[1]), a = Math.max(r[1], s[1]), l = [
4277
4471
  [i, o],
4278
4472
  // 左上
@@ -4296,7 +4490,7 @@ function os(r, s, t, e) {
4296
4490
  }
4297
4491
  return m && p;
4298
4492
  }
4299
- class Xt extends je {
4493
+ class fe extends je {
4300
4494
  constructor(t) {
4301
4495
  super(t);
4302
4496
  d(this, "_isRect", !1);
@@ -4391,7 +4585,7 @@ class Xt extends je {
4391
4585
  var c;
4392
4586
  const e = this.isHover, i = this.mainCanvas, n = i.style[i.theme].polygon;
4393
4587
  let o = {};
4394
- typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.polygon) || n : typeof this.style == "object" ? o = ct(
4588
+ typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.polygon) || n : typeof this.style == "object" ? o = lt(
4395
4589
  JSON.parse(JSON.stringify(n)),
4396
4590
  this.style
4397
4591
  ) : o = n;
@@ -4433,7 +4627,7 @@ class Xt extends je {
4433
4627
  }
4434
4628
  }
4435
4629
  }
4436
- class Yt extends D {
4630
+ class me extends D {
4437
4631
  constructor(t) {
4438
4632
  super(t);
4439
4633
  d(this, "_isFill", !1);
@@ -4456,7 +4650,7 @@ class Yt extends D {
4456
4650
  i != n && ((o = this.notifyReload) == null || o.call(this));
4457
4651
  });
4458
4652
  /** 处理拖动状态变化 */
4459
- d(this, "defaultDragg", (t, e) => {
4653
+ d(this, "defaultDrag", (t, e) => {
4460
4654
  if (!this.mainCanvas) return;
4461
4655
  const i = () => {
4462
4656
  var h;
@@ -4514,7 +4708,7 @@ class Yt extends D {
4514
4708
  "isHandlePointsVisible"
4515
4709
  ].forEach((e) => {
4516
4710
  e in t && (this["_" + e] = t[e]);
4517
- }), this.addEventListener("click", this.defaultClick), this.addEventListener("dragg", this.defaultDragg);
4711
+ }), this.addEventListener("click", this.defaultClick), this.addEventListener("drag", this.defaultDrag);
4518
4712
  }
4519
4713
  /** 是否填充 */
4520
4714
  get isFill() {
@@ -4627,7 +4821,7 @@ class Yt extends D {
4627
4821
  var c;
4628
4822
  const e = this.isHover, i = this.mainCanvas, n = i.style[i.theme].arc;
4629
4823
  let o = {};
4630
- typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.arc) || n : typeof this.style == "object" ? o = ct(
4824
+ typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.arc) || n : typeof this.style == "object" ? o = lt(
4631
4825
  JSON.parse(JSON.stringify(n)),
4632
4826
  this.style
4633
4827
  ) : o = n;
@@ -4657,14 +4851,14 @@ class Yt extends D {
4657
4851
  offset: c
4658
4852
  } = this;
4659
4853
  if (!t || !a || !l) return;
4660
- const [h, u] = as(
4854
+ const [h, u] = ls(
4661
4855
  ...e,
4662
4856
  i,
4663
4857
  n,
4664
4858
  o,
4665
4859
  t.axisConfig.x,
4666
4860
  t.axisConfig.y
4667
- ), f = (w) => new lt({
4861
+ ), f = (w) => new pt({
4668
4862
  name: w,
4669
4863
  offset: c,
4670
4864
  value: [0, 0],
@@ -4761,14 +4955,14 @@ class Yt extends D {
4761
4955
  }
4762
4956
  }
4763
4957
  }
4764
- function as(r, s, t, e, i, n = 1, o = 1) {
4958
+ function ls(r, s, t, e, i, n = 1, o = 1) {
4765
4959
  const a = r + t * Math.cos(e) * n, l = s + t * Math.sin(e) * o, c = r + t * Math.cos(i) * n, h = s + t * Math.sin(i) * o;
4766
4960
  return [
4767
4961
  [a, l],
4768
4962
  [c, h]
4769
4963
  ];
4770
4964
  }
4771
- class jt extends D {
4965
+ class ge extends D {
4772
4966
  constructor(t) {
4773
4967
  super(t);
4774
4968
  /** 控制点 */
@@ -4787,12 +4981,12 @@ class jt extends D {
4787
4981
  i != n && ((o = this.notifyReload) == null || o.call(this));
4788
4982
  });
4789
4983
  /** 处理拖动状态变化 */
4790
- d(this, "defaultDragg", (t, e) => {
4984
+ d(this, "defaultDrag", (t, e) => {
4791
4985
  this.mainCanvas;
4792
4986
  });
4793
4987
  ["isHandlePointsVisible"].forEach((e) => {
4794
4988
  e in t && (this["_" + e] = t[e]);
4795
- }), this.addEventListener("click", this.defaultClick), this.addEventListener("dragg", this.defaultDragg);
4989
+ }), this.addEventListener("click", this.defaultClick), this.addEventListener("drag", this.defaultDrag);
4796
4990
  }
4797
4991
  /** 控制点数组 */
4798
4992
  get handlePointsArr() {
@@ -4853,7 +5047,7 @@ class jt extends D {
4853
5047
  var o;
4854
5048
  const e = this.mainCanvas, i = e.style[e.theme].arcTo;
4855
5049
  let n = {};
4856
- return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.arcTo) || i : typeof this.style == "object" ? n = ct(
5050
+ return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.arcTo) || i : typeof this.style == "object" ? n = lt(
4857
5051
  JSON.parse(JSON.stringify(i)),
4858
5052
  this.style
4859
5053
  ) : n = i, t && this.setBaseLineStyle(t, n.stroke), n;
@@ -4866,7 +5060,7 @@ class jt extends D {
4866
5060
  var c, h;
4867
5061
  let { value: t, position: e, dynamicPosition: i, isHandlePointsVisible: n } = this;
4868
5062
  if (!i || !n) return;
4869
- const o = () => new lt({
5063
+ const o = () => new pt({
4870
5064
  value: [0, 0],
4871
5065
  mainCanvas: this.mainCanvas,
4872
5066
  isDraggable: !0,
@@ -4892,8 +5086,8 @@ class jt extends D {
4892
5086
  if (!this.mainCanvas) return;
4893
5087
  let { value: t, position: e } = this;
4894
5088
  const [i, n] = [
4895
- qt(t) && t.length > 1,
4896
- qt(e) && e.length > 1
5089
+ Ut(t) && t.length > 1,
5090
+ Ut(e) && e.length > 1
4897
5091
  ];
4898
5092
  if (!i && !n)
4899
5093
  return this.handlePoints = void 0, this.internalUpdate({ dynamicPosition: void 0 });
@@ -4935,7 +5129,7 @@ class jt extends D {
4935
5129
  }
4936
5130
  }
4937
5131
  }
4938
- class ls extends ns {
5132
+ class cs extends rs {
4939
5133
  constructor(t) {
4940
5134
  super(t);
4941
5135
  /** 监听元素大小 */
@@ -5012,7 +5206,7 @@ class ls extends ns {
5012
5206
  if (a !== h) return h - a;
5013
5207
  if (l !== u)
5014
5208
  return u - l;
5015
- const m = (p) => p instanceof zt ? 5 : p instanceof Gt ? 4 : p instanceof lt ? 3 : p instanceof Ut || p instanceof Yt || p instanceof jt ? 2 : p instanceof Xt ? 1 : 0;
5209
+ const m = (p) => p instanceof he ? 5 : p instanceof ue ? 4 : p instanceof pt ? 3 : p instanceof de || p instanceof me || p instanceof ge ? 2 : p instanceof fe ? 1 : 0;
5016
5210
  return m(f) - m(c);
5017
5211
  }
5018
5212
  ), this.currentDrawOverlays = t.map(
@@ -5047,7 +5241,7 @@ class ls extends ns {
5047
5241
  (t = this.resizeObserver) == null || t.disconnect();
5048
5242
  }
5049
5243
  }
5050
- class cs extends ls {
5244
+ class hs extends cs {
5051
5245
  constructor(t) {
5052
5246
  super(t);
5053
5247
  /** 鼠标是否在画布内 */
@@ -5058,7 +5252,7 @@ class cs extends ls {
5058
5252
  d(this, "mouseLastPosition", { x: 0, y: 0 });
5059
5253
  d(this, "unBind");
5060
5254
  /** 上一个被点击的覆盖物 */
5061
- d(this, "lastClickedOverlay");
5255
+ d(this, "_lastClickedOverlay");
5062
5256
  d(this, "lockNotifyClick", !1);
5063
5257
  /** 上一个被右击的覆盖物 */
5064
5258
  d(this, "lastContextmenuOverlay");
@@ -5079,12 +5273,12 @@ class cs extends ls {
5079
5273
  this.setScale(e, t.data), this.redrawOnce();
5080
5274
  });
5081
5275
  /** 上一个被按下的覆盖物 */
5082
- d(this, "lastDownOverlay");
5276
+ d(this, "_lastDownOverlay");
5083
5277
  d(this, "defaultDown", (t, e) => {
5084
5278
  (e == null ? void 0 : e.button) == 0 && (this.mouseIsDown = !0);
5085
5279
  });
5086
5280
  /** 上一个被hover的覆盖物 */
5087
- d(this, "lastHoverOverlay");
5281
+ d(this, "_lastHoverOverlay");
5088
5282
  /** 最后的光标样式 */
5089
5283
  d(this, "lastCursorStyle");
5090
5284
  d(this, "oldClientX", []);
@@ -5117,6 +5311,13 @@ class cs extends ls {
5117
5311
  });
5118
5312
  };
5119
5313
  }
5314
+ /** 上一个被点击的覆盖物 */
5315
+ get lastClickedOverlay() {
5316
+ return this._lastClickedOverlay && (this._lastClickedOverlay.equalsMainCanvas(this) || (this._lastClickedOverlay = void 0)), this._lastClickedOverlay;
5317
+ }
5318
+ set lastClickedOverlay(t) {
5319
+ this._lastClickedOverlay = t;
5320
+ }
5120
5321
  /** 鼠标左键点击画布 */
5121
5322
  click(t) {
5122
5323
  var i;
@@ -5150,16 +5351,16 @@ class cs extends ls {
5150
5351
  keydown(t) {
5151
5352
  const { mouseInCanvas: e, offset: i, delta: n, axisConfig: o } = this, a = t.key;
5152
5353
  if (!e || !this.isDraggable || this.isAuto) return;
5153
- const l = this.getStep(a), c = this.lastClickedOverlay, u = (c == null ? void 0 : c.isDraggable) && this.currentDrawOverlays.includes(c) && (qt(c.value) ? "Matrix" : ve(c.value) ? "Single" : !1), f = (y, w) => {
5354
+ const l = this.getStep(a), c = this.lastClickedOverlay, u = (c == null ? void 0 : c.isDraggable) && this.currentDrawOverlays.includes(c) && (Ut(c.value) ? "Matrix" : pe(c.value) ? "Single" : !1), f = (y, w) => {
5154
5355
  if (!u)
5155
5356
  return i.x += y * l, i.y += w * l, !0;
5156
- const P = this.getAxisValueByPoint(l, 0).xV, [b, _] = [P * o.x, P * o.y];
5357
+ const P = this.getAxisValueByPoint(l, 0).xV, [b, E] = [P * o.x, P * o.y];
5157
5358
  if (u === "Single") {
5158
5359
  const A = c.value;
5159
- A[0] += y * b, A[1] += w * _;
5360
+ A[0] += y * b, A[1] += w * E;
5160
5361
  } else
5161
5362
  c.value.forEach((A) => {
5162
- A[0] += y * b, A[1] += w * _;
5363
+ A[0] += y * b, A[1] += w * E;
5163
5364
  });
5164
5365
  return c.value = [...c.value], !0;
5165
5366
  }, m = (y) => (this.setScale("center", y * n), !0), g = {
@@ -5189,6 +5390,13 @@ class cs extends ls {
5189
5390
  const n = t.deltaY < 0 ? e : -e, o = this.findOverlayByPoint(t);
5190
5391
  o == null || o.notifyWheel(n, t), this.notifyWheel(n, t);
5191
5392
  }
5393
+ /** 上一个被按下的覆盖物 */
5394
+ get lastDownOverlay() {
5395
+ return this._lastDownOverlay && (this._lastDownOverlay.equalsMainCanvas(this) || (this._lastDownOverlay = void 0)), this._lastDownOverlay;
5396
+ }
5397
+ set lastDownOverlay(t) {
5398
+ this._lastDownOverlay = t;
5399
+ }
5192
5400
  /** 鼠标按下 */
5193
5401
  mousedown(t) {
5194
5402
  var o;
@@ -5202,6 +5410,13 @@ class cs extends ls {
5202
5410
  mouseup(t) {
5203
5411
  this.mouseIsDown = !1, this.lastDownOverlay = void 0;
5204
5412
  }
5413
+ /** 上一个被hover的覆盖物 */
5414
+ get lastHoverOverlay() {
5415
+ return this._lastHoverOverlay && (this._lastHoverOverlay.equalsMainCanvas(this) || (this._lastHoverOverlay = void 0)), this._lastHoverOverlay;
5416
+ }
5417
+ set lastHoverOverlay(t) {
5418
+ this._lastHoverOverlay = t;
5419
+ }
5205
5420
  /** 鼠标移动 */
5206
5421
  mousemove(t) {
5207
5422
  this.isAuto || (this.canvas.classList.toggle("_nhanh_canvas_draggable", this.isDraggable), this.mouseIsDown ? this.handleDragMove(t) : this.handleHover(t));
@@ -5213,12 +5428,12 @@ class cs extends ls {
5213
5428
  if (JSON.stringify(n) == JSON.stringify(this.mouseLastPosition))
5214
5429
  return;
5215
5430
  const { lastDownOverlay: o } = this;
5216
- o != null && o.isDraggable ? this.notifyDraggOverlays(t) : this.handleCanvasPan(t), this.mouseLastPosition = n, this.lockNotifyClick = !0;
5431
+ o != null && o.isDraggable ? this.notifyDragOverlays(t) : this.handleCanvasPan(t), this.mouseLastPosition = n, this.lockNotifyClick = !0;
5217
5432
  }
5218
5433
  /** 通知可拖拽的 overlays */
5219
- notifyDraggOverlays(t) {
5434
+ notifyDragOverlays(t) {
5220
5435
  const e = this.lastDownOverlay, { mouseLastPosition: i } = this, { clientX: n, clientY: o } = t;
5221
- e.notifyDragg(
5436
+ e.notifyDrag(
5222
5437
  {
5223
5438
  offsetX: n - i.x,
5224
5439
  offsetY: o - i.y
@@ -5229,7 +5444,7 @@ class cs extends ls {
5229
5444
  /** 处理画布平移 */
5230
5445
  handleCanvasPan(t) {
5231
5446
  const { clientX: e, clientY: i } = t, { offset: n, mouseLastPosition: o } = this, a = e - o.x, l = i - o.y;
5232
- n.x += a, n.y += l, this.redrawOnce(), this.notifyDragg({ offsetX: a, offsetY: l }, t);
5447
+ n.x += a, n.y += l, this.redrawOnce(), this.notifyDrag({ offsetX: a, offsetY: l }, t);
5233
5448
  }
5234
5449
  /** 处理 hover 逻辑 */
5235
5450
  handleHover(t) {
@@ -5281,7 +5496,7 @@ class cs extends ls {
5281
5496
  u,
5282
5497
  f,
5283
5498
  m
5284
- ), { x: y, y: w } = $e(
5499
+ ), { x: y, y: w } = qe(
5285
5500
  h,
5286
5501
  u,
5287
5502
  f,
@@ -5354,6 +5569,10 @@ class Y extends Vt {
5354
5569
  e.setNotifyReload(), e.setMainCanvas(), e.parent = void 0;
5355
5570
  }), this.overlays.clear();
5356
5571
  }
5572
+ /** 移除覆盖物 */
5573
+ removeChild(t) {
5574
+ this.removeOverlay(t);
5575
+ }
5357
5576
  /** 获取覆盖物的绘制方法 */
5358
5577
  getOverlaysDrawingMethod() {
5359
5578
  const t = [];
@@ -5435,6 +5654,10 @@ class j extends Vt {
5435
5654
  e.setNotifyReload(), e.setMainCanvas(), e.parent = void 0;
5436
5655
  }), this.groups.clear(), (t = this.notifyReload) == null || t.call(this));
5437
5656
  }
5657
+ /** 移除覆盖物组 */
5658
+ removeChild(t) {
5659
+ this.removeGroup(t);
5660
+ }
5438
5661
  /** 获取画布 */
5439
5662
  getCanvas() {
5440
5663
  if (!this.mainCanvas) return;
@@ -5467,9 +5690,9 @@ class Rt extends Vt {
5467
5690
  d(this, "defaultClick", (t, e) => t.stopPropagation());
5468
5691
  d(this, "defaultDoubleClick", (t, e) => t.stopPropagation());
5469
5692
  d(this, "defaultHover", (t, e) => t.stopPropagation());
5470
- d(this, "defaultDragg", (t, e) => t.stopPropagation());
5693
+ d(this, "defaultDrag", (t, e) => t.stopPropagation());
5471
5694
  d(this, "defaultDown", (t, e) => t.stopPropagation());
5472
- this.inheritOpacity = !1, this.setNotifyReload(t.notifyReload), this.addEventListener("contextmenu", this.defaultContextmenu), this.addEventListener("click", this.defaultClick), this.addEventListener("doubleClick", this.defaultDoubleClick), this.addEventListener("hover", this.defaultHover), this.addEventListener("dragg", this.defaultDragg), this.addEventListener("down", this.defaultDown);
5695
+ this.inheritOpacity = !1, this.setNotifyReload(t.notifyReload), this.addEventListener("contextmenu", this.defaultContextmenu), this.addEventListener("click", this.defaultClick), this.addEventListener("doubleClick", this.defaultDoubleClick), this.addEventListener("hover", this.defaultHover), this.addEventListener("drag", this.defaultDrag), this.addEventListener("down", this.defaultDown);
5473
5696
  }
5474
5697
  get layersSizeChange() {
5475
5698
  const t = this.oldLlayersSize;
@@ -5510,6 +5733,10 @@ class Rt extends Vt {
5510
5733
  e.setNotifyReload(), e.setMainCanvas(), e.parent = void 0;
5511
5734
  }), this.layers.clear(), (t = this.notifyReload) == null || t.call(this));
5512
5735
  }
5736
+ /** 移除图层 */
5737
+ removeChild(t) {
5738
+ this.removeLayer(t);
5739
+ }
5513
5740
  /** 收集图层的 canvas */
5514
5741
  fetchCanvas() {
5515
5742
  if (this.shouldRender() && this.layers.size) {
@@ -5525,7 +5752,7 @@ class Rt extends Vt {
5525
5752
  return [];
5526
5753
  }
5527
5754
  }
5528
- class hs extends cs {
5755
+ class us extends hs {
5529
5756
  /** 获取默认覆盖物群组 */
5530
5757
  getDefaultOverlayGroup() {
5531
5758
  var c, h, u, f, m, p, g;
@@ -5565,7 +5792,7 @@ class hs extends cs {
5565
5792
  return t;
5566
5793
  }
5567
5794
  }
5568
- class us extends hs {
5795
+ class ds extends us {
5569
5796
  /** 缩放画布 */
5570
5797
  zoom(s) {
5571
5798
  const { canvas: t, rect: e } = this;
@@ -5598,7 +5825,7 @@ class us extends hs {
5598
5825
  super.setDefaultCenter(s), this.redrawOnce();
5599
5826
  }
5600
5827
  }
5601
- class ds extends us {
5828
+ class fs extends ds {
5602
5829
  /**
5603
5830
  * 调整视图以适应指定覆盖层
5604
5831
  * @param overlays 目标覆盖层数组,默认使用全部可见覆盖层
@@ -5656,11 +5883,11 @@ class ds extends us {
5656
5883
  const m = s / u, p = t / f, g = Math.max(m, p), y = a.count, w = y / a.min, P = n * o;
5657
5884
  let b;
5658
5885
  if (g > w) {
5659
- const _ = Math.ceil(g / w);
5660
- b = 1 - ((y * _ / g - a.min) / a.min + (_ - 2)) * P;
5886
+ const E = Math.ceil(g / w);
5887
+ b = 1 - ((y * E / g - a.min) / a.min + (E - 2)) * P;
5661
5888
  } else {
5662
- const _ = (dt, rt, vt) => dt < rt ? vt - 1 : _(dt / 2, rt, vt + 1), A = _(w, g, 0), U = Math.pow(2, A);
5663
- b = 1 + ((y / U / g - a.min) / a.min + A) * P;
5889
+ const E = (ut, rt, vt) => ut < rt ? vt - 1 : E(ut / 2, rt, vt + 1), A = E(w, g, 0), G = Math.pow(2, A);
5890
+ b = 1 + ((y / G / g - a.min) / a.min + A) * P;
5664
5891
  }
5665
5892
  return i !== void 0 && (b = Math.min(i, b)), b = new R(b).div(o).round().mul(o).toNumber(), b;
5666
5893
  }
@@ -5710,13 +5937,13 @@ class ds extends us {
5710
5937
  animateScale(s, t, e, i) {
5711
5938
  const n = t - s;
5712
5939
  let o = 0;
5713
- Wt((a) => {
5940
+ Bt((a) => {
5714
5941
  !this.isAuto || !this.canvas || !this.isInteractive || (this.setScale("center", (a - o) * n), o = a, this.redrawOnce(), a === 1 && i());
5715
5942
  }, e);
5716
5943
  }
5717
5944
  /** 执行偏移动画 */
5718
5945
  animateOffset(s, t, e, i) {
5719
- Wt((n) => {
5946
+ Bt((n) => {
5720
5947
  !this.isAuto || !this.canvas || !this.isInteractive || (this.offset = {
5721
5948
  x: Number((s.x + t.x * n).toFixed(0)),
5722
5949
  y: Number((s.y + t.y * n).toFixed(0))
@@ -5741,7 +5968,7 @@ class ds extends us {
5741
5968
  });
5742
5969
  }
5743
5970
  }
5744
- class fs extends ds {
5971
+ class ms extends fs {
5745
5972
  /** 开关坐标轴 */
5746
5973
  toggleAxis(s) {
5747
5974
  this.drawAxis.toggleAxis(s), this.redrawOnce();
@@ -5766,7 +5993,7 @@ class fs extends ds {
5766
5993
  return this.isInteractive = s ?? !this.isInteractive, this.isInteractive;
5767
5994
  }
5768
5995
  }
5769
- class ms extends fs {
5996
+ class gs extends ms {
5770
5997
  /**
5771
5998
  * 清除指定区域的像素点
5772
5999
  * @param ctx - Canvas 2D绘图上下文
@@ -5777,9 +6004,9 @@ class ms extends fs {
5777
6004
  s.save(), s.beginPath(), s.clip(t), s.clearRect(0, 0, e, i), s.restore();
5778
6005
  }
5779
6006
  }
5780
- class gs extends ms {
6007
+ class ps extends gs {
5781
6008
  }
5782
- class ps {
6009
+ class vs {
5783
6010
  constructor(s) {
5784
6011
  /** 画布 */
5785
6012
  d(this, "canvas");
@@ -5894,22 +6121,22 @@ class ps {
5894
6121
  const y = i.y > c || i.y < 0;
5895
6122
  let w = i.x > 0 ? i.x % p : i.x < 0 ? p + i.x % p : 0, P = s.getAxisValueByPoint((w - i.x) * n.x, 0).xV;
5896
6123
  for (; w <= l; ) {
5897
- const b = le(P), _ = h(b);
5898
- P !== 0 && this.drawText(b, w - _ / 2, g, y), w += p, P = new R(m).mul(n.x).add(P).toNumber();
6124
+ const b = ee(P), E = h(b);
6125
+ P !== 0 && this.drawText(b, w - E / 2, g, y), w += p, P = new R(m).mul(n.x).add(P).toNumber();
5899
6126
  }
5900
6127
  }
5901
6128
  {
5902
6129
  const g = i.x > l || i.x < 0;
5903
6130
  let y = i.y > 0 ? i.y % p : i.y < 0 ? p + i.y % p : 0, w = s.getAxisValueByPoint(0, (y - i.y) * n.y).yV;
5904
6131
  for (; y <= c; ) {
5905
- const P = le(w), b = h(P);
5906
- let _ = i.x - b - u;
5907
- _ = Math.max(Math.min(_, l - b - u), u), w != 0 && this.drawText(P, _, y + f / 2, g), y += p, w = new R(m).mul(n.y).add(w).toNumber();
6132
+ const P = ee(w), b = h(P);
6133
+ let E = i.x - b - u;
6134
+ E = Math.max(Math.min(E, l - b - u), u), w != 0 && this.drawText(P, E, y + f / 2, g), y += p, w = new R(m).mul(n.y).add(w).toNumber();
5908
6135
  }
5909
6136
  }
5910
6137
  }
5911
6138
  }
5912
- class vs {
6139
+ class ys {
5913
6140
  constructor(s) {
5914
6141
  /** 绑定的画布实例 */
5915
6142
  d(this, "canvas");
@@ -6013,7 +6240,7 @@ class vs {
6013
6240
  }
6014
6241
  }
6015
6242
  }
6016
- class ys {
6243
+ class ws {
6017
6244
  /**
6018
6245
  * 计算默认缩放比例,使图像适配视图容器
6019
6246
  * @param naturalWidth 图像原始宽度
@@ -6048,7 +6275,7 @@ class ys {
6048
6275
  };
6049
6276
  }
6050
6277
  }
6051
- class ws extends D {
6278
+ class xs extends D {
6052
6279
  constructor(t) {
6053
6280
  super(t);
6054
6281
  d(this, "_ready", !1);
@@ -6106,11 +6333,11 @@ class ws extends D {
6106
6333
  const p = u.w / u.h, g = f / m;
6107
6334
  if (o === "fill") return u;
6108
6335
  if (o === "contain" || o === "scale-down") {
6109
- const P = Math.min(u.w / f, u.h / m), b = o === "scale-down" ? Math.min(1, P) : P, _ = f * b, A = m * b;
6336
+ const P = Math.min(u.w / f, u.h / m), b = o === "scale-down" ? Math.min(1, P) : P, E = f * b, A = m * b;
6110
6337
  return {
6111
- x: u.x + (u.w - _) / 2,
6338
+ x: u.x + (u.w - E) / 2,
6112
6339
  y: u.y + (u.h - A) / 2,
6113
- w: _,
6340
+ w: E,
6114
6341
  h: A
6115
6342
  };
6116
6343
  }
@@ -6137,10 +6364,10 @@ class ws extends D {
6137
6364
  this.mainCanvas && (this.ready = !1, this.url && (this.image.src = this.url), this.handleValuePosition("array2D", 1));
6138
6365
  }
6139
6366
  }
6140
- class ae extends ws {
6367
+ class Me extends xs {
6141
6368
  constructor(t) {
6142
6369
  super(t);
6143
- d(this, "defaultDragg", (t, e) => {
6370
+ d(this, "defaultDrag", (t, e) => {
6144
6371
  var l;
6145
6372
  const { offsetX: i, offsetY: n } = t.data, { x: o, y: a } = this.calculateOffset(i, n);
6146
6373
  this.value.forEach((c, h) => {
@@ -6157,7 +6384,7 @@ class ae extends ws {
6157
6384
  }), (l = this.notifyReload) == null || l.call(this), this.updateValueScope();
6158
6385
  });
6159
6386
  const { url: e, objectFit: i } = t;
6160
- Object.assign(this, { url: e, objectFit: i }), this.addEventListener("dragg", this.defaultDragg);
6387
+ Object.assign(this, { url: e, objectFit: i }), this.addEventListener("drag", this.defaultDrag);
6161
6388
  }
6162
6389
  updateValueScope() {
6163
6390
  this.initValueScope();
@@ -6173,7 +6400,7 @@ class ae extends ws {
6173
6400
  var o;
6174
6401
  const e = this.mainCanvas, i = e.style[e.theme].billboard;
6175
6402
  let n = {};
6176
- return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.billboard) || i : typeof this.style == "object" ? n = ct(
6403
+ return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.billboard) || i : typeof this.style == "object" ? n = lt(
6177
6404
  JSON.parse(JSON.stringify(i)),
6178
6405
  this.style
6179
6406
  ) : n = i, t && this.setBaseLineStyle(t, n.stroke), n;
@@ -6203,12 +6430,12 @@ class ae extends ws {
6203
6430
  function Ht(r) {
6204
6431
  return [r].flat(1 / 0);
6205
6432
  }
6206
- class T extends gs {
6433
+ class T extends ps {
6207
6434
  constructor(t) {
6208
6435
  super(t);
6209
6436
  /** 按坐标轴值创建覆盖物(多边形/线)的交互管理 */
6210
6437
  d(this, "overlayCreator");
6211
- this.drawAxis = new ps(this), "axisShow" in t && this.toggleAxis(t.axisShow), this.overlayCreator = new vs(this), this.initLayerGroups(), this.updateCenter();
6438
+ this.drawAxis = new vs(this), "axisShow" in t && this.toggleAxis(t.axisShow), this.overlayCreator = new ys(this), this.initLayerGroups(), this.updateCenter();
6212
6439
  }
6213
6440
  initLayerGroups() {
6214
6441
  const t = new j({ name: "其他图层", zIndex: 1 });
@@ -6248,6 +6475,9 @@ class T extends gs {
6248
6475
  removeLayerGroup(t) {
6249
6476
  t instanceof Rt && (this.layerGroups.delete(t.name), t.setNotifyReload(), t.setMainCanvas(), t.parent = void 0, this.redrawOnce());
6250
6477
  }
6478
+ removeChild(t) {
6479
+ this.removeLayerGroup(t);
6480
+ }
6251
6481
  /** 添加图层 */
6252
6482
  addLayer(t) {
6253
6483
  const e = this.layerGroups.get("默认图层群组");
@@ -6255,8 +6485,7 @@ class T extends gs {
6255
6485
  }
6256
6486
  /** 移除图层 */
6257
6487
  removeLayer(t) {
6258
- const e = this.layerGroups.get("默认图层群组");
6259
- e && e.removeLayer(Ht(t));
6488
+ Ht(t).forEach((e) => e.remove());
6260
6489
  }
6261
6490
  /** 添加覆盖物 */
6262
6491
  addOverlay(t) {
@@ -6270,23 +6499,12 @@ class T extends gs {
6270
6499
  overlays_other: c
6271
6500
  } = this.getDefaultOverlayGroup() || {};
6272
6501
  Ht(t).forEach((h) => {
6273
- h instanceof Gt ? e == null || e.addOverlay(h) : h instanceof lt ? i == null || i.addOverlay(h) : h instanceof Ut || h instanceof Yt || h instanceof jt ? n == null || n.addOverlay(h) : h instanceof Xt ? o == null || o.addOverlay(h) : h instanceof zt ? a == null || a.addOverlay(h) : h instanceof ae ? l == null || l.addOverlay(h) : c == null || c.addOverlay(h);
6502
+ h instanceof ue ? e == null || e.addOverlay(h) : h instanceof pt ? i == null || i.addOverlay(h) : h instanceof de || h instanceof me || h instanceof ge ? n == null || n.addOverlay(h) : h instanceof fe ? o == null || o.addOverlay(h) : h instanceof he ? a == null || a.addOverlay(h) : h instanceof Me ? l == null || l.addOverlay(h) : c == null || c.addOverlay(h);
6274
6503
  });
6275
6504
  }
6276
6505
  /** 移除覆盖物 */
6277
6506
  removeOverlay(t) {
6278
- const {
6279
- overlays_text: e,
6280
- overlays_point: i,
6281
- overlays_line: n,
6282
- overlays_polygon: o,
6283
- overlays_custom: a,
6284
- overlays_billboard: l,
6285
- overlays_other: c
6286
- } = this.getDefaultOverlayGroup() || {};
6287
- Ht(t).forEach((h) => {
6288
- h instanceof Gt ? e == null || e.removeOverlay(h) : h instanceof lt ? i == null || i.removeOverlay(h) : h instanceof Ut || h instanceof Yt || h instanceof jt ? n == null || n.removeOverlay(h) : h instanceof Xt ? o == null || o.removeOverlay(h) : h instanceof zt ? a == null || a.addOverlay(h) : h instanceof ae ? l == null || l.removeOverlay(h) : c == null || c.removeOverlay(h);
6289
- });
6507
+ Ht(t).forEach((e) => e.remove());
6290
6508
  }
6291
6509
  /** 销毁 */
6292
6510
  destroy() {
@@ -6294,19 +6512,19 @@ class T extends gs {
6294
6512
  }
6295
6513
  }
6296
6514
  /** 视图适配工具:默认缩放、居中计算 */
6297
- d(T, "ViewFit", ys), /** 图层群组 */
6515
+ d(T, "ViewFit", ws), /** 图层群组 */
6298
6516
  d(T, "LayerGroup", Rt), /** 图层 */
6299
6517
  d(T, "Layer", j), /** 覆盖物群组 */
6300
6518
  d(T, "OverlayGroup", Y), /** 文字 */
6301
- d(T, "Text", Gt), /** 点位 */
6302
- d(T, "Point", lt), /** 线段 */
6303
- d(T, "Line", Ut), /** 多边形 */
6304
- d(T, "Polygon", Xt), /** 自定义绘制 */
6305
- d(T, "Custom", zt), /** 圆弧 */
6306
- d(T, "Arc", Yt), /** 圆角 */
6307
- d(T, "ArcTo", jt), /** 图片 */
6308
- d(T, "Billboard", ae);
6309
- class xs {
6519
+ d(T, "Text", ue), /** 点位 */
6520
+ d(T, "Point", pt), /** 线段 */
6521
+ d(T, "Line", de), /** 多边形 */
6522
+ d(T, "Polygon", fe), /** 自定义绘制 */
6523
+ d(T, "Custom", he), /** 圆弧 */
6524
+ d(T, "Arc", me), /** 圆角 */
6525
+ d(T, "ArcTo", ge), /** 图片 */
6526
+ d(T, "Billboard", Me);
6527
+ class Ps {
6310
6528
  /** @param id canvas DOM id(通过 getElementById 定位) */
6311
6529
  constructor(s) {
6312
6530
  /** Canvas DOM id(用于 `document.getElementById` 定位) */
@@ -6360,7 +6578,7 @@ class xs {
6360
6578
  this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0);
6361
6579
  }
6362
6580
  }
6363
- class Ps {
6581
+ class bs {
6364
6582
  /**
6365
6583
  * @param canvas 绑定 mousedown 的 canvas
6366
6584
  * @param onOffsetDelta 拖拽时的 dx 回调(由外部映射到时间偏移)
@@ -6399,7 +6617,7 @@ class Ps {
6399
6617
  this.canvas.removeEventListener("mousedown", this.handleMouseDown), window.removeEventListener("mousemove", this.handleMouseMove), window.removeEventListener("mouseup", this.handleMouseUp);
6400
6618
  }
6401
6619
  }
6402
- class bs {
6620
+ class Cs {
6403
6621
  /**
6404
6622
  * @param canvas 绑定 wheel 事件的 canvas
6405
6623
  * @param getTimeSpacing 读取当前 timeSpacing 的函数
@@ -6434,7 +6652,7 @@ class bs {
6434
6652
  this.canvas.removeEventListener("wheel", this.handleWheel);
6435
6653
  }
6436
6654
  }
6437
- class Cs {
6655
+ class Ss {
6438
6656
  /**
6439
6657
  * 只负责计算鼠标所在 x/y 对应的时间,并把结果通知给 TimeAxis(不直接操作 DOM)。
6440
6658
  */
@@ -6471,7 +6689,7 @@ class Cs {
6471
6689
  this.canvas.removeEventListener("mousemove", this.handleMouseMove), this.canvas.removeEventListener("mouseleave", this.handleMouseLeave);
6472
6690
  }
6473
6691
  }
6474
- const Ss = {
6692
+ const _s = {
6475
6693
  easeInOutQuad: (r) => r < 0.5 ? 2 * r * r : 1 - Math.pow(-2 * r + 2, 2) / 2
6476
6694
  };
6477
6695
  class Es {
@@ -6520,13 +6738,13 @@ class Es {
6520
6738
  * 可用于叠加额外图形(如指示线、事件点等)
6521
6739
  */
6522
6740
  d(this, "onDrawOverlay");
6523
- this.canvasManager = new xs(s), this.onMouseTimeChange = t, requestAnimationFrame(() => this.init());
6741
+ this.canvasManager = new Ps(s), this.onMouseTimeChange = t, requestAnimationFrame(() => this.init());
6524
6742
  }
6525
6743
  /** 初始化交互:拖拽平移、滚轮缩放、鼠标时间通知,并触发首次绘制 */
6526
6744
  init() {
6527
6745
  if (!this.canvasManager.init(() => this.render())) return;
6528
6746
  const t = this.canvasManager.getCanvas();
6529
- t && (this.offsetDrag = new Ps(
6747
+ t && (this.offsetDrag = new bs(
6530
6748
  t,
6531
6749
  (e) => {
6532
6750
  this.currentTime -= Math.round(
@@ -6536,14 +6754,14 @@ class Es {
6536
6754
  () => {
6537
6755
  this.stopCenterTimeAnimation();
6538
6756
  }
6539
- ), this.wheelZoom = new bs(
6757
+ ), this.wheelZoom = new Cs(
6540
6758
  t,
6541
6759
  () => this.timeSpacing,
6542
6760
  (e, i) => {
6543
6761
  const n = this.getTimeAtCanvasX(i);
6544
6762
  this.timeSpacing = e, this.setTimeAtCanvasX(n, i), this.render();
6545
6763
  }
6546
- ), this.centerTime = Date.now(), this.mouseTimeReporter = new Cs(
6764
+ ), this.centerTime = Date.now(), this.mouseTimeReporter = new Ss(
6547
6765
  t,
6548
6766
  (e) => this.getTimeAtCanvasX(e),
6549
6767
  (e) => {
@@ -6642,7 +6860,7 @@ class Es {
6642
6860
  Math.max(0.5, h)
6643
6861
  );
6644
6862
  return Math.max(1, Math.round(u * 60));
6645
- })(), a = (t == null ? void 0 : t.curve) ?? Ss.easeInOutQuad;
6863
+ })(), a = (t == null ? void 0 : t.curve) ?? _s.easeInOutQuad;
6646
6864
  Ke(
6647
6865
  0,
6648
6866
  1,
@@ -6664,7 +6882,7 @@ class Es {
6664
6882
  (s = this.offsetDrag) == null || s.destroy(), (t = this.wheelZoom) == null || t.destroy(), (e = this.mouseTimeReporter) == null || e.destroy(), this.canvasManager.destroy();
6665
6883
  }
6666
6884
  }
6667
- class fn extends Es {
6885
+ class mn extends Es {
6668
6886
  /**
6669
6887
  * 将填充样式解析为 ctx.fillStyle 可用的值(纯色或线性渐变)
6670
6888
  * @param rect 矩形区域,用于计算渐变起止点
@@ -6722,31 +6940,31 @@ function We(r) {
6722
6940
  const s = Ot(r);
6723
6941
  return s ? s.requestFullscreen ? s.requestFullscreen() : s.mozRequestFullScreen ? s.mozRequestFullScreen() : s.webkitRequestFullscreen ? s.webkitRequestFullscreen() : s.msRequestFullscreen ? s.msRequestFullscreen() : Promise.reject("No Fullscreen API") : Promise.reject("No Element");
6724
6942
  }
6725
- function qe() {
6943
+ function $e() {
6726
6944
  const r = document;
6727
6945
  return document.exitFullscreen ? document.exitFullscreen() : r.mozCancelFullScreen ? r.mozCancelFullScreen() : r.webkitExitFullscreen ? r.webkitExitFullscreen() : r.msExitFullscreen ? r.msExitFullscreen() : Promise.reject("No ExitFullscreen API");
6728
6946
  }
6729
- function Jt(r) {
6947
+ function jt(r) {
6730
6948
  const s = Ot(r), t = document, e = document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement;
6731
6949
  return s == e || !r && window.innerWidth == screen.width && window.innerHeight == screen.height;
6732
6950
  }
6733
- function mn(r) {
6951
+ function gn(r) {
6734
6952
  if (r = Ot(r), !!r)
6735
6953
  return function() {
6736
- Jt(r) ? qe() : We(r);
6954
+ jt(r) ? $e() : We(r);
6737
6955
  };
6738
6956
  }
6739
- function gn(r, s) {
6957
+ function pn(r, s) {
6740
6958
  const t = Ot(s);
6741
6959
  if (!t) return;
6742
6960
  const e = () => {
6743
- r(Jt(t));
6961
+ r(jt(t));
6744
6962
  };
6745
6963
  return document.addEventListener("fullscreenchange", e), document.addEventListener("webkitfullscreenchange", e), document.addEventListener("mozfullscreenchange", e), document.addEventListener("MSFullscreenChange", e), e(), () => {
6746
6964
  document.removeEventListener("fullscreenchange", e), document.removeEventListener("webkitfullscreenchange", e), document.removeEventListener("mozfullscreenchange", e), document.removeEventListener("MSFullscreenChange", e);
6747
6965
  };
6748
6966
  }
6749
- class pn {
6967
+ class vn {
6750
6968
  constructor(s, t) {
6751
6969
  /** 要全屏展示的目标元素 */
6752
6970
  d(this, "targetElement");
@@ -6770,15 +6988,15 @@ class pn {
6770
6988
  }
6771
6989
  /** 退出浏览器全屏(不区分由哪个元素进入) */
6772
6990
  exit() {
6773
- this.targetElement && qe();
6991
+ this.targetElement && $e();
6774
6992
  }
6775
6993
  /** 若当前已为该目标全屏则退出,否则进入全屏 */
6776
6994
  toggle() {
6777
- this.targetElement && (Jt(this.targetElement) ? this.exit() : this.enter());
6995
+ this.targetElement && (jt(this.targetElement) ? this.exit() : this.enter());
6778
6996
  }
6779
6997
  attachFullscreenChangeListeners() {
6780
6998
  const s = () => {
6781
- !this.targetElement || !this.onFullscreenChange || this.onFullscreenChange(Jt(this.targetElement));
6999
+ !this.targetElement || !this.onFullscreenChange || this.onFullscreenChange(jt(this.targetElement));
6782
7000
  };
6783
7001
  document.addEventListener("fullscreenchange", s), document.addEventListener(
6784
7002
  "webkitfullscreenchange",
@@ -6808,7 +7026,7 @@ class pn {
6808
7026
  (s = this.detachFullscreenListeners) == null || s.call(this), this.detachFullscreenListeners = void 0, this.targetElement = void 0, this.onFullscreenChange = void 0;
6809
7027
  }
6810
7028
  }
6811
- function vn(r) {
7029
+ function yn(r) {
6812
7030
  const s = Le(r, 100);
6813
7031
  let t = 0, e = 0;
6814
7032
  return function(i) {
@@ -6837,7 +7055,7 @@ function vn(r) {
6837
7055
  f(), m();
6838
7056
  };
6839
7057
  }
6840
- function yn(r, s, t) {
7058
+ function wn(r, s, t) {
6841
7059
  const { isClickAllowed: e, uiLibrary: i = ["naiveUI", "ElementPlus", "Element"] } = t || {}, n = function(l) {
6842
7060
  const c = [];
6843
7061
  for (const h in l)
@@ -6869,12 +7087,12 @@ function yn(r, s, t) {
6869
7087
  () => document.addEventListener("mousedown", a)
6870
7088
  );
6871
7089
  }
6872
- var W, ft, mt, xt, Pt, J, K, st, bt;
6873
- class wn {
7090
+ var W, dt, ft, xt, Pt, J, K, st, bt;
7091
+ class xn {
6874
7092
  constructor() {
6875
7093
  L(this, W);
6876
- L(this, ft, !1);
6877
- L(this, mt, {});
7094
+ L(this, dt, !1);
7095
+ L(this, ft, {});
6878
7096
  L(this, xt, 0);
6879
7097
  L(this, Pt, 0);
6880
7098
  L(this, J, 0);
@@ -6883,7 +7101,7 @@ class wn {
6883
7101
  L(this, bt);
6884
7102
  }
6885
7103
  init(s, t) {
6886
- this.finish(), M(this, W, s), M(this, st, t == null ? void 0 : t.limit), M(this, bt, t == null ? void 0 : t.dragDom), M(this, mt, {
7104
+ this.finish(), M(this, W, s), M(this, st, t == null ? void 0 : t.limit), M(this, bt, t == null ? void 0 : t.dragDom), M(this, ft, {
6887
7105
  mousedown: this.mousedown.bind(this),
6888
7106
  mousemove: this.mousemove.bind(this),
6889
7107
  mouseup: this.mouseup.bind(this)
@@ -6895,7 +7113,7 @@ class wn {
6895
7113
  bindOrUnbindEvent(s) {
6896
7114
  const t = s === "bind" ? "addEventListener" : "removeEventListener";
6897
7115
  if (!x(this, W)) return console.error("No DOM");
6898
- x(this, W)[t]("mousedown", x(this, mt).mousedown), document[t]("mousemove", x(this, mt).mousemove), document[t]("mouseup", x(this, mt).mouseup);
7116
+ x(this, W)[t]("mousedown", x(this, ft).mousedown), document[t]("mousemove", x(this, ft).mousemove), document[t]("mouseup", x(this, ft).mouseup);
6899
7117
  }
6900
7118
  alterLocation() {
6901
7119
  if (!x(this, W)) return console.error("No DOM");
@@ -6904,35 +7122,35 @@ class wn {
6904
7122
  mousedown(s) {
6905
7123
  if (!x(this, W)) return console.error("No DOM");
6906
7124
  if (x(this, bt) && s.target != x(this, bt)) return;
6907
- document.body.classList.add("no-select"), M(this, ft, !0);
7125
+ document.body.classList.add("no-select"), M(this, dt, !0);
6908
7126
  const t = x(this, W).getBoundingClientRect(), { pageX: e, pageY: i } = s;
6909
7127
  M(this, xt, e), M(this, Pt, i), M(this, J, t.y), M(this, K, t.x);
6910
7128
  }
6911
7129
  mousemove(s) {
6912
7130
  const { pageX: t, pageY: e } = s;
6913
- x(this, ft) && (M(this, J, x(this, J) + (e - x(this, Pt))), M(this, K, x(this, K) + (t - x(this, xt))), M(this, xt, t), M(this, Pt, e), this.alterLocation());
7131
+ x(this, dt) && (M(this, J, x(this, J) + (e - x(this, Pt))), M(this, K, x(this, K) + (t - x(this, xt))), M(this, xt, t), M(this, Pt, e), this.alterLocation());
6914
7132
  }
6915
7133
  mouseup() {
6916
- x(this, ft) && (M(this, ft, !1), document.body.classList.remove("no-select"));
7134
+ x(this, dt) && (M(this, dt, !1), document.body.classList.remove("no-select"));
6917
7135
  }
6918
7136
  }
6919
- W = new WeakMap(), ft = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), Pt = new WeakMap(), J = new WeakMap(), K = new WeakMap(), st = new WeakMap(), bt = new WeakMap();
6920
- var q, gt, pt, Ct, St, $, Z, z, Et, _t;
6921
- class xn {
7137
+ W = new WeakMap(), dt = new WeakMap(), ft = new WeakMap(), xt = new WeakMap(), Pt = new WeakMap(), J = new WeakMap(), K = new WeakMap(), st = new WeakMap(), bt = new WeakMap();
7138
+ var $, mt, gt, Ct, St, q, Z, B, _t, Et;
7139
+ class Pn {
6922
7140
  constructor() {
6923
- L(this, q);
6924
- L(this, gt, !1);
6925
- L(this, pt, {});
7141
+ L(this, $);
7142
+ L(this, mt, !1);
7143
+ L(this, gt, {});
6926
7144
  L(this, Ct, 0);
6927
7145
  L(this, St, 0);
6928
- L(this, $, 0);
7146
+ L(this, q, 0);
6929
7147
  L(this, Z, 0);
6930
- L(this, z);
6931
- L(this, Et);
7148
+ L(this, B);
6932
7149
  L(this, _t);
7150
+ L(this, Et);
6933
7151
  }
6934
7152
  init(s, t = {}) {
6935
- this.finish(), M(this, q, s), M(this, z, t.limit), M(this, Et, t.update_move), M(this, _t, t.update_up), M(this, pt, {
7153
+ this.finish(), M(this, $, s), M(this, B, t.limit), M(this, _t, t.update_move), M(this, Et, t.update_up), M(this, gt, {
6936
7154
  mousedown: this.mousedown.bind(this),
6937
7155
  mousemove: this.mousemove.bind(this),
6938
7156
  mouseup: this.mouseup.bind(this)
@@ -6943,17 +7161,17 @@ class xn {
6943
7161
  }
6944
7162
  bindOrUnbindEvent(s) {
6945
7163
  const t = s === "bind" ? "addEventListener" : "removeEventListener";
6946
- if (!x(this, q)) return console.error("No DOM");
6947
- x(this, q)[t]("mousedown", x(this, pt).mousedown), document[t]("mousemove", x(this, pt).mousemove), document[t]("mouseup", x(this, pt).mouseup);
7164
+ if (!x(this, $)) return console.error("No DOM");
7165
+ x(this, $)[t]("mousedown", x(this, gt).mousedown), document[t]("mousemove", x(this, gt).mousemove), document[t]("mouseup", x(this, gt).mouseup);
6948
7166
  }
6949
7167
  updateValue() {
6950
7168
  const s = {
6951
- top: x(this, $),
7169
+ top: x(this, q),
6952
7170
  left: x(this, Z),
6953
7171
  percentage: { top: 0, left: 0 }
6954
7172
  };
6955
- if (x(this, z)) {
6956
- const t = (e) => x(this, z) ? (s[e] - x(this, z).min[e]) / (x(this, z).max[e] - x(this, z).min[e]) : 0;
7173
+ if (x(this, B)) {
7174
+ const t = (e) => x(this, B) ? (s[e] - x(this, B).min[e]) / (x(this, B).max[e] - x(this, B).min[e]) : 0;
6957
7175
  s.percentage = {
6958
7176
  top: t("top") || 0,
6959
7177
  left: t("left") || 0
@@ -6962,27 +7180,27 @@ class xn {
6962
7180
  return s;
6963
7181
  }
6964
7182
  alterLocation() {
6965
- if (!x(this, q)) return console.error("No DOM");
6966
- x(this, z) && (M(this, $, Math.min(x(this, $), x(this, z).max.top)), M(this, $, Math.max(x(this, $), x(this, z).min.top)), M(this, Z, Math.min(x(this, Z), x(this, z).max.left)), M(this, Z, Math.max(x(this, Z), x(this, z).min.left))), x(this, Et) && x(this, Et).call(this, this.updateValue()), x(this, q).style.setProperty("--top", x(this, $) + "px"), x(this, q).style.setProperty("--left", x(this, Z) + "px");
7183
+ if (!x(this, $)) return console.error("No DOM");
7184
+ x(this, B) && (M(this, q, Math.min(x(this, q), x(this, B).max.top)), M(this, q, Math.max(x(this, q), x(this, B).min.top)), M(this, Z, Math.min(x(this, Z), x(this, B).max.left)), M(this, Z, Math.max(x(this, Z), x(this, B).min.left))), x(this, _t) && x(this, _t).call(this, this.updateValue()), x(this, $).style.setProperty("--top", x(this, q) + "px"), x(this, $).style.setProperty("--left", x(this, Z) + "px");
6967
7185
  }
6968
7186
  mousedown(s) {
6969
- if (!x(this, q)) return console.error("No DOM");
6970
- document.body.classList.add("no-select"), M(this, gt, !0);
6971
- const t = x(this, q).getBoundingClientRect();
7187
+ if (!x(this, $)) return console.error("No DOM");
7188
+ document.body.classList.add("no-select"), M(this, mt, !0);
7189
+ const t = x(this, $).getBoundingClientRect();
6972
7190
  M(this, St, t.y), M(this, Ct, t.x);
6973
7191
  const { pageX: e, pageY: i } = s;
6974
- M(this, $, i - x(this, St)), M(this, Z, e - x(this, Ct)), this.alterLocation();
7192
+ M(this, q, i - x(this, St)), M(this, Z, e - x(this, Ct)), this.alterLocation();
6975
7193
  }
6976
7194
  mousemove(s) {
6977
7195
  const { pageX: t, pageY: e } = s;
6978
- x(this, gt) && (M(this, $, e - x(this, St)), M(this, Z, t - x(this, Ct)), this.alterLocation());
7196
+ x(this, mt) && (M(this, q, e - x(this, St)), M(this, Z, t - x(this, Ct)), this.alterLocation());
6979
7197
  }
6980
7198
  mouseup() {
6981
- x(this, gt) && (M(this, gt, !1), document.body.classList.remove("no-select"), x(this, _t) && x(this, _t).call(this, this.updateValue()));
7199
+ x(this, mt) && (M(this, mt, !1), document.body.classList.remove("no-select"), x(this, Et) && x(this, Et).call(this, this.updateValue()));
6982
7200
  }
6983
7201
  }
6984
- q = new WeakMap(), gt = new WeakMap(), pt = new WeakMap(), Ct = new WeakMap(), St = new WeakMap(), $ = new WeakMap(), Z = new WeakMap(), z = new WeakMap(), Et = new WeakMap(), _t = new WeakMap();
6985
- function Pn(r, s) {
7202
+ $ = new WeakMap(), mt = new WeakMap(), gt = new WeakMap(), Ct = new WeakMap(), St = new WeakMap(), q = new WeakMap(), Z = new WeakMap(), B = new WeakMap(), _t = new WeakMap(), Et = new WeakMap();
7203
+ function bn(r, s) {
6986
7204
  if (typeof r == "number") return r;
6987
7205
  if (/px/.test(r)) return Number(r.replace(/px/, "")) || 0;
6988
7206
  const t = document.createElement("div");
@@ -6990,7 +7208,7 @@ function Pn(r, s) {
6990
7208
  const e = t.getBoundingClientRect().width;
6991
7209
  return s.removeChild(t), e;
6992
7210
  }
6993
- function bn(r, s) {
7211
+ function Cn(r, s) {
6994
7212
  if (!r) return;
6995
7213
  let t, e;
6996
7214
  if (typeof s == "string") {
@@ -7007,7 +7225,7 @@ function bn(r, s) {
7007
7225
  const i = t / e;
7008
7226
  return i > r ? [r * e, e] : i < r ? [t, t / r] : [t, e];
7009
7227
  }
7010
- function Cn(r, s = 5e3) {
7228
+ function Sn(r, s = 5e3) {
7011
7229
  return new Promise((t, e) => {
7012
7230
  const i = new Image();
7013
7231
  i.src = r;
@@ -7023,7 +7241,7 @@ function Cn(r, s = 5e3) {
7023
7241
  }, i.crossOrigin = "Anonymous";
7024
7242
  });
7025
7243
  }
7026
- function Sn(r) {
7244
+ function _n(r) {
7027
7245
  const t = document.getElementById(r).querySelectorAll("img"), e = t.length, i = [];
7028
7246
  let n = 0;
7029
7247
  return e === 0 ? Promise.resolve({
@@ -7072,7 +7290,16 @@ function En(r) {
7072
7290
  });
7073
7291
  });
7074
7292
  }
7075
- function _s(r) {
7293
+ function Mn(r) {
7294
+ const s = document.createElement("input");
7295
+ return s.type = "file", s.accept = (r == null ? void 0 : r.accept) || "", s.multiple = (r == null ? void 0 : r.multiple) || !1, new Promise((t, e) => {
7296
+ s.addEventListener("change", (i) => {
7297
+ const n = i.target.files;
7298
+ n ? t(Array.from(n)) : e();
7299
+ }), s.click();
7300
+ });
7301
+ }
7302
+ function Ms(r) {
7076
7303
  const {
7077
7304
  href: s,
7078
7305
  fileName: t,
@@ -7081,7 +7308,7 @@ function _s(r) {
7081
7308
  autoDownload: n = !0
7082
7309
  } = r;
7083
7310
  let o, a = !1, l = null, c;
7084
- const h = t || ce(s, "downloaded_file");
7311
+ const h = t || ie(s, "downloaded_file");
7085
7312
  c = decodeURIComponent(h);
7086
7313
  const u = () => {
7087
7314
  if (!l) return;
@@ -7111,24 +7338,24 @@ function _s(r) {
7111
7338
  !a && l && u();
7112
7339
  } };
7113
7340
  }
7114
- function _n(r, s, t) {
7341
+ function Dn(r, s, t) {
7115
7342
  if (!t) {
7116
7343
  let n = s.replace(/^[^.]+./, "");
7117
7344
  n = n == s ? "text/plain" : "application/" + n, t = { type: n };
7118
7345
  }
7119
7346
  const e = new Blob(r, t), i = URL.createObjectURL(e);
7120
- _s({ href: i, fileName: s });
7347
+ Ms({ href: i, fileName: s });
7121
7348
  }
7122
- const Ms = Math.PI / 2, Kt = Math.PI / 180, te = 6378137, Ds = 85.05112878;
7123
- function Mn(r, s) {
7124
- const t = Math.max(Math.min(r, 180), -180), e = Math.max(Math.min(s, Ds), -85.05112878), i = t * Kt * te, n = e * Kt, o = Math.log(Math.tan(Math.PI / 4 + n / 2)) * te;
7349
+ const Ds = Math.PI / 2, Wt = Math.PI / 180, $t = 6378137, Rs = 85.05112878;
7350
+ function Rn(r, s) {
7351
+ const t = Math.max(Math.min(r, 180), -180), e = Math.max(Math.min(s, Rs), -85.05112878), i = t * Wt * $t, n = e * Wt, o = Math.log(Math.tan(Math.PI / 4 + n / 2)) * $t;
7125
7352
  return [i, o];
7126
7353
  }
7127
- function Dn(r, s) {
7128
- const t = r / te / Kt, e = (2 * Math.atan(Math.exp(s / te)) - Ms) / Kt;
7354
+ function kn(r, s) {
7355
+ const t = r / $t / Wt, e = (2 * Math.atan(Math.exp(s / $t)) - Ds) / Wt;
7129
7356
  return [t, e];
7130
7357
  }
7131
- function Rs(r, s, t) {
7358
+ function ks(r, s, t) {
7132
7359
  const [e, i] = r, [n, o] = s, [a, l] = t, c = (a - n) ** 2 + (l - o) ** 2;
7133
7360
  if (c === 0) return Math.sqrt((e - n) ** 2 + (i - o) ** 2);
7134
7361
  let h = ((e - n) * (a - n) + (i - o) * (l - o)) / c;
@@ -7136,7 +7363,7 @@ function Rs(r, s, t) {
7136
7363
  (e - (n + h * (a - n))) ** 2 + (i - (o + h * (l - o))) ** 2
7137
7364
  );
7138
7365
  }
7139
- function Rn(r, s, t, e, i, n = 1, o = 1) {
7366
+ function Vn(r, s, t, e, i, n = 1, o = 1) {
7140
7367
  const a = r + t * Math.cos(e) * n, l = s + t * Math.sin(e) * o, c = r + t * Math.cos(i) * n, h = s + t * Math.sin(i) * o;
7141
7368
  return [
7142
7369
  [a, l],
@@ -7146,11 +7373,11 @@ function Rn(r, s, t, e, i, n = 1, o = 1) {
7146
7373
  function De(r, s, t, e) {
7147
7374
  return Math.hypot(Math.abs(t - r), Math.abs(e - s));
7148
7375
  }
7149
- function $e(r, s, t, e) {
7376
+ function qe(r, s, t, e) {
7150
7377
  const i = (r + t) / 2, n = (s + e) / 2;
7151
7378
  return { x: i, y: n };
7152
7379
  }
7153
- function kn(r, s, t, e) {
7380
+ function On(r, s, t, e) {
7154
7381
  const [i, n] = r, [o, a] = s;
7155
7382
  let l = 1 / 0;
7156
7383
  if (o !== 0) {
@@ -7163,7 +7390,7 @@ function kn(r, s, t, e) {
7163
7390
  }
7164
7391
  return l === 1 / 0 ? r : [i + o * l, n + a * l];
7165
7392
  }
7166
- const ks = /* @__PURE__ */ new Set([
7393
+ const Vs = /* @__PURE__ */ new Set([
7167
7394
  "sin",
7168
7395
  "cos",
7169
7396
  "tan",
@@ -7171,9 +7398,9 @@ const ks = /* @__PURE__ */ new Set([
7171
7398
  "acos",
7172
7399
  "atan",
7173
7400
  "atan2"
7174
- ]), Vn = new Proxy(Math, {
7401
+ ]), An = new Proxy(Math, {
7175
7402
  get(r, s) {
7176
- return ks.has(s) ? function(...t) {
7403
+ return Vs.has(s) ? function(...t) {
7177
7404
  const e = t.map((i) => i / 180 * Math.PI);
7178
7405
  return r[s](...e);
7179
7406
  } : r[s];
@@ -7187,6 +7414,23 @@ const ks = /* @__PURE__ */ new Set([
7187
7414
  throw new Error("DegreeMath 是只读的,不能删除属性");
7188
7415
  }
7189
7416
  });
7417
+ function Ln(r, s) {
7418
+ const t = r.length;
7419
+ if (t === 0) return [0, 0];
7420
+ if (t === 1) return [r[0][0], r[0][1]];
7421
+ const e = s;
7422
+ let i = r.map((n) => [n[0], n[1]]);
7423
+ for (; i.length > 1; ) {
7424
+ const n = [];
7425
+ for (let o = 0; o < i.length - 1; o++)
7426
+ n.push([
7427
+ (1 - e) * i[o][0] + e * i[o + 1][0],
7428
+ (1 - e) * i[o][1] + e * i[o + 1][1]
7429
+ ]);
7430
+ i = n;
7431
+ }
7432
+ return i[0];
7433
+ }
7190
7434
  class wt {
7191
7435
  constructor(s, t) {
7192
7436
  d(this, "resolve");
@@ -7204,7 +7448,7 @@ class wt {
7204
7448
  }) : s ? (t = this.resolve) == null || t.call(this) : (e = this.reject) == null || e.call(this), s;
7205
7449
  }
7206
7450
  }
7207
- class Vs extends wt {
7451
+ class Os extends wt {
7208
7452
  constructor(s) {
7209
7453
  super(), this.resolve = s;
7210
7454
  }
@@ -7223,7 +7467,7 @@ class Vs extends wt {
7223
7467
  return new wt(this.resolve, t);
7224
7468
  }
7225
7469
  }
7226
- class Os extends wt {
7470
+ class As extends wt {
7227
7471
  constructor(s) {
7228
7472
  super(), this.reject = s;
7229
7473
  }
@@ -7242,124 +7486,127 @@ class Os extends wt {
7242
7486
  return new wt(t, this.reject);
7243
7487
  }
7244
7488
  }
7245
- const B = class B {
7489
+ const z = class z {
7246
7490
  /**
7247
7491
  * 构造函数
7248
7492
  * @throws 如果尝试实例化该类,则抛出错误,因为应该使用静态方法
7249
7493
  */
7250
7494
  constructor() {
7251
- if (new.target === B)
7495
+ if (new.target === z)
7252
7496
  throw new Error("请直接使用静态方法,而不是实例化此类");
7253
7497
  }
7254
7498
  static register(s, t) {
7255
7499
  if (typeof t != "function")
7256
7500
  return console.error("TipHandler must be a function");
7257
- B.tips[s] = t;
7501
+ z.tips[s] = t;
7258
7502
  }
7259
7503
  static resolveTip(s) {
7260
7504
  return function(...t) {
7261
7505
  const e = () => {
7262
7506
  var i, n;
7263
- return (n = (i = B.tips)[s]) == null ? void 0 : n.call(i, ...t);
7507
+ return (n = (i = z.tips)[s]) == null ? void 0 : n.call(i, ...t);
7264
7508
  };
7265
- return new Vs(e);
7509
+ return new Os(e);
7266
7510
  };
7267
7511
  }
7268
7512
  static rejectTip(s) {
7269
7513
  return function(...t) {
7270
7514
  const e = () => {
7271
7515
  var i, n;
7272
- return (n = (i = B.tips)[s]) == null ? void 0 : n.call(i, ...t);
7516
+ return (n = (i = z.tips)[s]) == null ? void 0 : n.call(i, ...t);
7273
7517
  };
7274
- return new Os(e);
7518
+ return new As(e);
7275
7519
  };
7276
7520
  }
7277
7521
  };
7278
- d(B, "tips", {
7522
+ d(z, "tips", {
7279
7523
  info: void 0,
7280
7524
  success: void 0,
7281
7525
  warning: void 0,
7282
7526
  error: void 0
7283
- }), d(B, "info", B.resolveTip("info")), d(B, "success", B.resolveTip("success")), d(B, "warning", B.rejectTip("warning")), d(B, "error", B.rejectTip("error"));
7284
- let Dt = B;
7527
+ }), d(z, "info", z.resolveTip("info")), d(z, "success", z.resolveTip("success")), d(z, "warning", z.rejectTip("warning")), d(z, "error", z.rejectTip("error"));
7528
+ let Dt = z;
7285
7529
  export {
7286
7530
  Je as EXTENSION_TO_MIME,
7287
- re as FILE_EXTENSIONS,
7531
+ Kt as FILE_EXTENSIONS,
7288
7532
  Re as PAPER_SIZE_DEFINITIONS,
7289
- Ts as PAPER_SIZE_OPTIONS,
7290
- Pe as UNIT_LABELS,
7291
- Ls as WINDOW_TARGET,
7292
- Is as _Animate_CreateOscillator,
7293
- Ns as _Animate_CubicBezier,
7533
+ Is as PAPER_SIZE_OPTIONS,
7534
+ xe as UNIT_LABELS,
7535
+ Ts as WINDOW_TARGET,
7536
+ Ns as _Animate_CreateOscillator,
7537
+ Hs as _Animate_CubicBezier,
7294
7538
  Ke as _Animate_NumericTransition,
7295
- Wt as _Animate_Schedule,
7296
- Hs as _Blob_ConvertDataToImageUrl,
7297
- hn as _Browser_CalculatePrintableArea,
7298
- cn as _Browser_CopyToClipboard,
7299
- ln as _Browser_GetFrameRate,
7300
- un as _Browser_IdleDetection,
7539
+ Bt as _Animate_Schedule,
7540
+ Fs as _Blob_ConvertDataToImageUrl,
7541
+ un as _Browser_CalculatePrintableArea,
7542
+ hn as _Browser_CopyToClipboard,
7543
+ cn as _Browser_GetFrameRate,
7544
+ dn as _Browser_IdleDetection,
7301
7545
  Nt as _Browser_SameOriginTabManager,
7302
- on as _Browser_SoundEffects,
7303
- an as _Browser_WebSocketClient,
7546
+ an as _Browser_SoundEffects,
7547
+ ln as _Browser_WebSocketClient,
7304
7548
  T as _Canvas_Axis,
7305
- fn as _Canvas_TimeAxis,
7306
- bn as _Element_CalculateCanvasSize,
7307
- Sn as _Element_CheckImagesLoaded,
7308
- yn as _Element_CloseOnOutsideClick,
7309
- wn as _Element_Drag,
7549
+ mn as _Canvas_TimeAxis,
7550
+ Cn as _Element_CalculateCanvasSize,
7551
+ _n as _Element_CheckImagesLoaded,
7552
+ wn as _Element_CloseOnOutsideClick,
7553
+ xn as _Element_Drag,
7310
7554
  We as _Element_EnterFullscreen,
7311
- qe as _Element_ExitFullscreen,
7312
- mn as _Element_Fullscreen,
7313
- pn as _Element_FullscreenController,
7314
- gn as _Element_FullscreenObserver,
7315
- Pn as _Element_GetOtherSizeInPixels,
7316
- Jt as _Element_IsFullscreen,
7317
- Cn as _Element_LoadImage,
7318
- xn as _Element_LocalDrag,
7319
- vn as _Element_ScrollEndListener,
7320
- _n as _File_CreateAndDownload,
7321
- _s as _File_Download,
7555
+ $e as _Element_ExitFullscreen,
7556
+ gn as _Element_Fullscreen,
7557
+ vn as _Element_FullscreenController,
7558
+ pn as _Element_FullscreenObserver,
7559
+ bn as _Element_GetOtherSizeInPixels,
7560
+ jt as _Element_IsFullscreen,
7561
+ Sn as _Element_LoadImage,
7562
+ Pn as _Element_LocalDrag,
7563
+ yn as _Element_ScrollEndListener,
7564
+ Dn as _File_CreateAndDownload,
7565
+ Ms as _File_Download,
7322
7566
  En as _File_Read,
7323
- Us as _Format_CamelCase,
7324
- Fs as _Format_CapitalizeFirstLetter,
7325
- Ws as _Format_ChunkArray,
7326
- Xs as _Format_ExcludeSubstring,
7567
+ Mn as _File_Select,
7568
+ Xs as _Format_CamelCase,
7569
+ zs as _Format_CapitalizeFirstLetter,
7570
+ $s as _Format_ChunkArray,
7571
+ Ys as _Format_ExcludeSubstring,
7327
7572
  Gs as _Format_FileSize,
7328
- ce as _Format_HrefName,
7329
- js as _Format_MillisecondToReadable,
7330
- le as _Format_NumberWithCommas,
7331
- zs as _Format_NumberWithUnit,
7573
+ ie as _Format_HrefName,
7574
+ Ws as _Format_MillisecondToReadable,
7575
+ ee as _Format_NumberWithCommas,
7576
+ Us as _Format_NumberWithUnit,
7332
7577
  Bs as _Format_Percentage,
7333
7578
  ti as _Format_Timestamp,
7334
- Ys as _Format_ToggleInvisibleChars,
7579
+ js as _Format_ToggleInvisibleChars,
7335
7580
  De as _Math_CalculateDistance2D,
7336
- Vn as _Math_Degree,
7337
- Rn as _Math_GetArcPoints,
7338
- kn as _Math_GetBoundaryIntersection,
7339
- $e as _Math_GetMidpoint,
7340
- Mn as _Math_LngLatToPlane,
7341
- Dn as _Math_PlaneToLngLat,
7342
- Rs as _Math_PointToLineDistance,
7581
+ An as _Math_Degree,
7582
+ Vn as _Math_GetArcPoints,
7583
+ Ln as _Math_GetBezierCurveNodes,
7584
+ On as _Math_GetBoundaryIntersection,
7585
+ qe as _Math_GetMidpoint,
7586
+ Rn as _Math_LngLatToPlane,
7587
+ kn as _Math_PlaneToLngLat,
7588
+ ks as _Math_PointToLineDistance,
7343
7589
  Dt as _Tip,
7344
7590
  si as _Utility_Clone,
7591
+ ri as _Utility_ColorConverter,
7345
7592
  Le as _Utility_Debounce,
7346
- Ks as _Utility_ExecuteWhenIdle,
7347
- ue as _Utility_GenerateUUID,
7348
- en as _Utility_GetTargetByPath,
7349
- ct as _Utility_MergeObjects,
7350
- nn as _Utility_RotateList,
7351
- sn as _Utility_SetTargetByPath,
7352
- rn as _Utility_Sleep,
7353
- tn as _Utility_Throttle,
7593
+ tn as _Utility_ExecuteWhenIdle,
7594
+ ne as _Utility_GenerateUUID,
7595
+ sn as _Utility_GetTargetByPath,
7596
+ lt as _Utility_MergeObjects,
7597
+ rn as _Utility_RotateList,
7598
+ nn as _Utility_SetTargetByPath,
7599
+ on as _Utility_Sleep,
7600
+ en as _Utility_Throttle,
7354
7601
  ni as _Utility_TimeConsumption,
7355
7602
  ii as _Utility_WaitForCondition,
7356
- Js as _Valid_CheckConnectionWithXHR,
7357
- he as _Valid_DataType,
7358
- Zs as _Valid_DoesInfiniteLineIntersectRectangle,
7359
- be as _Valid_FileTypeChecker,
7360
- qt as _Valid_Is2DNumberArray,
7603
+ Ks as _Valid_CheckConnectionWithXHR,
7604
+ se as _Valid_DataType,
7605
+ Qs as _Valid_DoesInfiniteLineIntersectRectangle,
7606
+ Pe as _Valid_FileTypeChecker,
7607
+ Ut as _Valid_Is2DNumberArray,
7361
7608
  qs as _Valid_IsInMargin,
7362
- ve as _Valid_IsNumberArray,
7363
- $s as _Valid_IsPointInPolygon,
7364
- Qs as _Valid_IsSecureContext
7609
+ pe as _Valid_IsNumberArray,
7610
+ Zs as _Valid_IsPointInPolygon,
7611
+ Js as _Valid_IsSecureContext
7365
7612
  };