nhanh-pure-function 4.1.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Canvas/Axis/LayerGroup/index.d.ts +1 -1
- package/dist/Canvas/Axis/OverlayCreator/index.d.ts +3 -5
- package/dist/Canvas/Axis/OverlayGroup/billboard.d.ts +50 -0
- package/dist/Canvas/Axis/OverlayGroup/index.d.ts +5 -4
- package/dist/Canvas/Axis/common.type.d.ts +7 -0
- package/dist/Canvas/Axis/core/quikmethod.d.ts +2 -0
- package/dist/Canvas/Axis/index.d.ts +3 -0
- package/dist/Canvas/Axis/index.types.d.ts +2 -1
- package/dist/Element/Runtime/fullscreen.d.ts +48 -0
- package/dist/Element/Runtime/index.d.ts +2 -0
- package/dist/Element/index.d.ts +1 -20
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +1049 -792
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var Ze = Object.defineProperty;
|
|
3
|
+
var we = (r) => {
|
|
4
4
|
throw TypeError(r);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
var d = (r, s, t) =>
|
|
8
|
-
var x = (r, s, t) => (
|
|
9
|
-
const
|
|
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);
|
|
9
|
+
const Je = {
|
|
10
10
|
".mp3": "audio/mpeg",
|
|
11
11
|
".mp4": "video/mp4",
|
|
12
12
|
".m4a": "audio/mp4",
|
|
@@ -68,7 +68,7 @@ const $e = {
|
|
|
68
68
|
".otf": "font/otf",
|
|
69
69
|
".eot": "application/vnd.ms-fontobject",
|
|
70
70
|
".map": "application/json"
|
|
71
|
-
},
|
|
71
|
+
}, re = {
|
|
72
72
|
image: [
|
|
73
73
|
".jpg",
|
|
74
74
|
".jpeg",
|
|
@@ -248,7 +248,7 @@ const $e = {
|
|
|
248
248
|
".awk",
|
|
249
249
|
".php"
|
|
250
250
|
]
|
|
251
|
-
},
|
|
251
|
+
}, Pe = [
|
|
252
252
|
"",
|
|
253
253
|
"万",
|
|
254
254
|
"亿",
|
|
@@ -262,7 +262,7 @@ const $e = {
|
|
|
262
262
|
"正",
|
|
263
263
|
"载",
|
|
264
264
|
"极"
|
|
265
|
-
],
|
|
265
|
+
], Ls = ["_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 $e = {
|
|
|
315
315
|
C6: { width: 114, height: 162 },
|
|
316
316
|
C7: { width: 81, height: 114 },
|
|
317
317
|
C8: { width: 57, height: 81 }
|
|
318
|
-
},
|
|
318
|
+
}, Ts = Object.keys(Re).map(
|
|
319
319
|
(r) => ({ value: r, label: r })
|
|
320
320
|
);
|
|
321
|
-
function
|
|
321
|
+
function Wt(r, s = 500) {
|
|
322
322
|
let t, e = !0;
|
|
323
323
|
function i(n) {
|
|
324
324
|
if (!e) return;
|
|
@@ -328,26 +328,26 @@ function zt(r, s = 500) {
|
|
|
328
328
|
}
|
|
329
329
|
return requestAnimationFrame(i), () => e = !1;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function Is(r, s, t, e, i = 2) {
|
|
332
332
|
let n = r, o = !1, a = 1, l = r, c = s, h = t;
|
|
333
333
|
const u = () => {
|
|
334
|
-
const
|
|
335
|
-
return Number(
|
|
334
|
+
const P = (c - l) / h;
|
|
335
|
+
return Number(P.toFixed(i));
|
|
336
336
|
};
|
|
337
337
|
let f = u();
|
|
338
|
-
const m = (
|
|
338
|
+
const m = (P) => Math.min(Math.max(P, l), c), p = (P) => Number(P.toFixed(i)), g = (P, b, _) => {
|
|
339
339
|
const A = [];
|
|
340
|
-
return
|
|
341
|
-
}, y = (
|
|
342
|
-
const A = g(
|
|
343
|
-
return A.length > 0 ? (console.error(`参数更新失败: ${A.join("; ")}`), !1) : (l =
|
|
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);
|
|
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
|
};
|
|
347
347
|
return {
|
|
348
348
|
/** 启动/继续动画 */
|
|
349
|
-
play(
|
|
350
|
-
if (n = m(
|
|
349
|
+
play(P = n) {
|
|
350
|
+
if (n = m(P), g(l, c, h).length)
|
|
351
351
|
return console.error("配置参数错误", this.getParams());
|
|
352
352
|
o || (o = !0, w());
|
|
353
353
|
},
|
|
@@ -365,7 +365,7 @@ function Ts(r, s, t, e, i = 2) {
|
|
|
365
365
|
getParams: () => ({ min: l, max: c, steps: h, precision: i, stepSize: f })
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Ke(r, s, t, e, i = 4) {
|
|
369
369
|
if (t <= 0) return console.error("动画步数 必须为正数");
|
|
370
370
|
const n = (u) => Number(u.toFixed(i)), o = s - r, a = n(Math.abs(o) / t);
|
|
371
371
|
if (a === 0) return console.error("数值精度过低,致使动画步长为 0");
|
|
@@ -376,7 +376,7 @@ function Ze(r, s, t, e, i = 4) {
|
|
|
376
376
|
};
|
|
377
377
|
h();
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Ns(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 Ls(r, s, t, e) {
|
|
|
404
404
|
return n(a(c));
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Hs(r, s = "image/png") {
|
|
408
408
|
try {
|
|
409
409
|
let t, e = s;
|
|
410
410
|
if (r instanceof File)
|
|
@@ -441,17 +441,17 @@ function Is(r, s = "image/png") {
|
|
|
441
441
|
), null;
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function Fs(r) {
|
|
445
445
|
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
446
446
|
}
|
|
447
|
-
function
|
|
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
|
|
450
|
+
function le(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
|
|
454
|
+
function Gs(r, s) {
|
|
455
455
|
const t = {
|
|
456
456
|
join: !0,
|
|
457
457
|
suffix: "",
|
|
@@ -462,16 +462,16 @@ function Fs(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}${
|
|
465
|
+
return e ? `${f}${Pe[c]}${i}` : [f, Pe[c] + i];
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function Us(r) {
|
|
468
468
|
const s = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
469
469
|
let t = 0;
|
|
470
470
|
for (; r > 1024; )
|
|
471
471
|
r /= 1024, t++;
|
|
472
472
|
return `${Math.round(r * 100) / 100} ${s[t]}`;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function ti(r, s = "YYYY-MM-DD hh:mm:ss", t = !0) {
|
|
475
475
|
const e = new Date(r);
|
|
476
476
|
if (isNaN(e.getTime()))
|
|
477
477
|
return console.error("Invalid date"), "";
|
|
@@ -490,15 +490,15 @@ function Qe(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
|
|
493
|
+
function ce(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
|
|
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
|
|
501
|
+
function zs(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
|
|
510
|
+
function Ys(r, s = !0) {
|
|
511
511
|
const t = {
|
|
512
512
|
"\b": "\\b",
|
|
513
513
|
" ": "\\t",
|
|
@@ -524,7 +524,7 @@ function Gs(r, s = !0) {
|
|
|
524
524
|
(i) => t[i]
|
|
525
525
|
) : r.replace(/\\[btnvfrs]/g, (i) => e[i] || i);
|
|
526
526
|
}
|
|
527
|
-
const
|
|
527
|
+
const It = [
|
|
528
528
|
["年", 365 * 24 * 60 * 60 * 1e3],
|
|
529
529
|
["月", 30 * 24 * 60 * 60 * 1e3],
|
|
530
530
|
["周", 7 * 24 * 60 * 60 * 1e3],
|
|
@@ -534,21 +534,21 @@ const Lt = [
|
|
|
534
534
|
["秒", 1e3],
|
|
535
535
|
["毫秒", 1]
|
|
536
536
|
];
|
|
537
|
-
function
|
|
537
|
+
function js(r, s) {
|
|
538
538
|
if (!Number.isFinite(r) || r < 0) return "0毫秒";
|
|
539
539
|
r = Math.round(r);
|
|
540
|
-
const t = s ?
|
|
541
|
-
for (let i = e; i <
|
|
542
|
-
const [n, o] =
|
|
540
|
+
const t = s ? It.findIndex(([i]) => i === s) : 0, e = t === -1 ? 0 : t;
|
|
541
|
+
for (let i = e; i < It.length; i++) {
|
|
542
|
+
const [n, o] = It[i];
|
|
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 ===
|
|
546
|
+
return n === It[e][0] && (l = le(Number(l))), `${l}${n}`;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
return "0毫秒";
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Ws(r, s) {
|
|
552
552
|
if (s < 1)
|
|
553
553
|
return console.error("分割大小必须大于0"), [];
|
|
554
554
|
const t = [];
|
|
@@ -558,24 +558,24 @@ function Ys(r, s) {
|
|
|
558
558
|
}
|
|
559
559
|
return t;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function ve(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
|
|
568
|
+
function qt(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 (!
|
|
571
|
+
if (!ve(r[i], t)) return !1;
|
|
572
572
|
} else return !1;
|
|
573
573
|
return !0;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function qs(r, s, t) {
|
|
576
576
|
return Math.abs(r - s) <= t;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function $s(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 js(r, s) {
|
|
|
584
584
|
}
|
|
585
585
|
return t;
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Zs(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 qs(r, s, t, e) {
|
|
|
608
608
|
}
|
|
609
609
|
return m && p;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function he(r) {
|
|
612
612
|
return Object.prototype.toString.call(r).slice(8, -1).toLowerCase();
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function Qs(r) {
|
|
615
615
|
return [
|
|
616
616
|
"https:",
|
|
617
617
|
// HTTPS协议,用于安全地浏览网页
|
|
@@ -635,7 +635,7 @@ function $s(r) {
|
|
|
635
635
|
// VPN协议,用于创建安全的网络连接
|
|
636
636
|
].some((t) => r.startsWith(t));
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Js(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"));
|
|
@@ -662,22 +662,22 @@ function Zs(r) {
|
|
|
662
662
|
}
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
|
-
const
|
|
665
|
+
const it = class it {
|
|
666
666
|
constructor() {
|
|
667
|
-
if (new.target ===
|
|
667
|
+
if (new.target === it)
|
|
668
668
|
throw new Error("请直接使用静态方法,而不是实例化此类");
|
|
669
669
|
}
|
|
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 =
|
|
673
|
+
const e = ce(s).toLowerCase();
|
|
674
674
|
if (t) {
|
|
675
|
-
if (!
|
|
675
|
+
if (!re.hasOwnProperty(t))
|
|
676
676
|
return console.error(`Unknown file type: ${t}`), "unknown";
|
|
677
|
-
const i =
|
|
678
|
-
return
|
|
677
|
+
const i = re[t];
|
|
678
|
+
return it._checkExtension(e, i);
|
|
679
679
|
}
|
|
680
|
-
return
|
|
680
|
+
return it._detectFileType(e);
|
|
681
681
|
}
|
|
682
682
|
/**
|
|
683
683
|
* 静态方法,用于解析地址信息
|
|
@@ -689,7 +689,7 @@ const tt = class tt {
|
|
|
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 =
|
|
692
|
+
const e = ce(t), i = this.check(t);
|
|
693
693
|
return { url: t, name: e, type: i };
|
|
694
694
|
});
|
|
695
695
|
}
|
|
@@ -702,7 +702,7 @@ const tt = class tt {
|
|
|
702
702
|
static matchesMimeType(s, t) {
|
|
703
703
|
if (!t) return !0;
|
|
704
704
|
if (typeof s != "string" || typeof t != "string") return !1;
|
|
705
|
-
const e =
|
|
705
|
+
const e = it._normalizeType(s), i = t.split(",").map((a) => it._normalizeType(a.trim())), [n, o = "*"] = e.split("/");
|
|
706
706
|
return i.some((a) => {
|
|
707
707
|
const [l, c = "*"] = a.split("/");
|
|
708
708
|
return (l === "*" || n === "*" || l === n) && (c === "*" || o === "*" || c === o);
|
|
@@ -717,7 +717,7 @@ const tt = class tt {
|
|
|
717
717
|
* @returns {string} 标准化的MIME类型字符串,如果无法识别则返回原始输入
|
|
718
718
|
*/
|
|
719
719
|
static _normalizeType(s) {
|
|
720
|
-
return s.startsWith(".") && !s.includes("/") ?
|
|
720
|
+
return s.startsWith(".") && !s.includes("/") ? Je[s.toLowerCase()] || s : s.includes("/") ? s : `${s}/*`;
|
|
721
721
|
}
|
|
722
722
|
/**
|
|
723
723
|
* 检查URL是否具有任何指定的文件扩展名
|
|
@@ -734,20 +734,20 @@ const tt = class tt {
|
|
|
734
734
|
* @returns {string} - 如果URL与任何已知类型匹配,则返回文件类型,否则返回"unknown"
|
|
735
735
|
*/
|
|
736
736
|
static _detectFileType(s) {
|
|
737
|
-
for (const [t, e] of
|
|
737
|
+
for (const [t, e] of it.cachedEntries)
|
|
738
738
|
if (e.some((i) => s.endsWith(i)))
|
|
739
739
|
return t;
|
|
740
740
|
return "unknown";
|
|
741
741
|
}
|
|
742
742
|
};
|
|
743
743
|
// 缓存文件扩展名的条目,以提高性能
|
|
744
|
-
d(
|
|
745
|
-
let
|
|
746
|
-
const
|
|
747
|
-
function
|
|
748
|
-
return r ? r.match(
|
|
744
|
+
d(it, "cachedEntries", Object.entries(re));
|
|
745
|
+
let be = it;
|
|
746
|
+
const ei = /\w*(?:\[\d+\])+|\w+/g, ke = /^\w*(?:\[\d+\])+$/, Ve = /\w+|(\[\d+\])/g, Oe = /\[(\d+)\]/;
|
|
747
|
+
function Ae(r) {
|
|
748
|
+
return r ? r.match(ei) || [] : [];
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function Ks(r, s = 3e3) {
|
|
751
751
|
if (typeof r != "function")
|
|
752
752
|
return console.error("非函数:", r);
|
|
753
753
|
const t = window.requestIdleCallback, e = function(i) {
|
|
@@ -755,7 +755,7 @@ function Qs(r, s = 3e3) {
|
|
|
755
755
|
};
|
|
756
756
|
t ? t(e, { timeout: s }) : requestAnimationFrame(() => r());
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function ii(r, s) {
|
|
759
759
|
const t = Date.now();
|
|
760
760
|
return new Promise((e, i) => {
|
|
761
761
|
const n = () => {
|
|
@@ -767,19 +767,19 @@ function Ke(r, s) {
|
|
|
767
767
|
n();
|
|
768
768
|
});
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function ct(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 =
|
|
775
|
+
const i = he(r), n = he(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 =
|
|
782
|
+
const a = s[o], l = r[o], c = ct(
|
|
783
783
|
l,
|
|
784
784
|
a,
|
|
785
785
|
t,
|
|
@@ -790,7 +790,7 @@ function pt(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 =
|
|
793
|
+
const l = o, c = r[a], h = ct(
|
|
794
794
|
c,
|
|
795
795
|
l,
|
|
796
796
|
t,
|
|
@@ -800,13 +800,13 @@ function pt(r, s, t = [], e = Date.now()) {
|
|
|
800
800
|
}), r;
|
|
801
801
|
} else return s;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function ue(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);
|
|
807
807
|
});
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function Le(r, s) {
|
|
810
810
|
let t;
|
|
811
811
|
return function(...e) {
|
|
812
812
|
clearTimeout(t), t = setTimeout(() => {
|
|
@@ -814,7 +814,7 @@ function Oe(r, s) {
|
|
|
814
814
|
}, s);
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function tn(r, s) {
|
|
818
818
|
let t = -1 / 0;
|
|
819
819
|
return function(...e) {
|
|
820
820
|
const i = performance.now();
|
|
@@ -828,52 +828,52 @@ function Js(r, s) {
|
|
|
828
828
|
}
|
|
829
829
|
};
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function en(r, s) {
|
|
832
832
|
if (!r || !s) return r;
|
|
833
|
-
const t =
|
|
833
|
+
const t = Ae(s);
|
|
834
834
|
return t.length ? t.reduce((e, i, n) => {
|
|
835
835
|
const o = n === t.length - 1;
|
|
836
|
-
if (
|
|
837
|
-
const a = i.match(
|
|
836
|
+
if (ke.test(i)) {
|
|
837
|
+
const a = i.match(Ve) || [];
|
|
838
838
|
return a.reduce((l, c, h) => {
|
|
839
839
|
if (/^\w+$/.test(c))
|
|
840
840
|
return l[c] || (h < a.length - 1 ? [] : {});
|
|
841
|
-
const u = c.match(
|
|
841
|
+
const u = c.match(Oe), f = u ? parseInt(u[1], 10) : 0, m = h === a.length - 1;
|
|
842
842
|
return m && o ? l[f] : l[f] || (m ? {} : []);
|
|
843
843
|
}, e);
|
|
844
844
|
}
|
|
845
845
|
return o ? e[i] : e[i] || {};
|
|
846
846
|
}, r) : r;
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function sn(r, s, t, e) {
|
|
849
849
|
if (!r || !s) return t;
|
|
850
|
-
const i =
|
|
850
|
+
const i = Ae(s);
|
|
851
851
|
return i.length ? i.reduce((n, o, a) => {
|
|
852
852
|
const l = a === i.length - 1;
|
|
853
|
-
if (
|
|
854
|
-
const c = o.match(
|
|
853
|
+
if (ke.test(o)) {
|
|
854
|
+
const c = o.match(Ve) || [];
|
|
855
855
|
return c.reduce((h, u, f) => {
|
|
856
856
|
const m = f === c.length - 1;
|
|
857
857
|
if (/^\w+$/.test(u))
|
|
858
858
|
return h.hasOwnProperty(u) || (h[u] = []), h[u];
|
|
859
|
-
const p = u.match(
|
|
859
|
+
const p = u.match(Oe), g = p ? parseInt(p[1], 10) : 0, y = m && l;
|
|
860
860
|
return h.hasOwnProperty(g) ? y && !e && (h[g] = t) : h[g] = y ? t : m ? {} : [], h[g];
|
|
861
861
|
}, n);
|
|
862
862
|
}
|
|
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
|
|
866
|
+
function nn(r) {
|
|
867
867
|
return r.map((s, t) => r.slice(t).concat(r.slice(0, t)));
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function si(r) {
|
|
870
870
|
const s = window.structuredClone, t = (e, i = /* @__PURE__ */ new WeakMap()) => {
|
|
871
871
|
const n = e;
|
|
872
872
|
if (n === null || typeof n != "object")
|
|
873
873
|
return n;
|
|
874
874
|
if (i.has(n))
|
|
875
875
|
return i.get(n);
|
|
876
|
-
switch (
|
|
876
|
+
switch (he(n)) {
|
|
877
877
|
case "array": {
|
|
878
878
|
const a = [];
|
|
879
879
|
i.set(n, a);
|
|
@@ -957,7 +957,7 @@ function ti(r) {
|
|
|
957
957
|
return console.warn("structuredClone error:", e), s && t(r);
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
function
|
|
960
|
+
function ni(r, s) {
|
|
961
961
|
const t = [
|
|
962
962
|
[11, "#d03050"],
|
|
963
963
|
[8, "#f0a020"],
|
|
@@ -989,7 +989,7 @@ function ei(r, s) {
|
|
|
989
989
|
), f;
|
|
990
990
|
};
|
|
991
991
|
}
|
|
992
|
-
function
|
|
992
|
+
function rn(r) {
|
|
993
993
|
const s = Date.now();
|
|
994
994
|
let t = performance.now();
|
|
995
995
|
for (; Date.now() - s < r; ) {
|
|
@@ -1003,7 +1003,7 @@ function sn(r) {
|
|
|
1003
1003
|
return Date.now() - s;
|
|
1004
1004
|
}
|
|
1005
1005
|
var yt = /* @__PURE__ */ ((r) => (r.RESPONSE = "response", r.QUERY = "query", r))(yt || {});
|
|
1006
|
-
class
|
|
1006
|
+
class on {
|
|
1007
1007
|
constructor(s, t) {
|
|
1008
1008
|
/** 音效资源地址映射(preload 成功后对应项会替换为 blob: URL) */
|
|
1009
1009
|
d(this, "soundSources");
|
|
@@ -1093,11 +1093,11 @@ class nn {
|
|
|
1093
1093
|
}), l;
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1096
|
+
function Ce(r, s) {
|
|
1097
1097
|
for (const t of Object.keys(s))
|
|
1098
1098
|
s[t] !== void 0 && (r[t] = s[t]);
|
|
1099
1099
|
}
|
|
1100
|
-
class
|
|
1100
|
+
class an {
|
|
1101
1101
|
constructor(s) {
|
|
1102
1102
|
/** WebSocket地址 */
|
|
1103
1103
|
d(this, "url");
|
|
@@ -1138,7 +1138,7 @@ class rn {
|
|
|
1138
1138
|
});
|
|
1139
1139
|
if (!s) return;
|
|
1140
1140
|
const { url: t, ping: e, maxRetryCount: i, retryInterval: n } = s;
|
|
1141
|
-
e !== void 0 && (typeof e == "boolean" ? this.pingConfig.enabled = e :
|
|
1141
|
+
e !== void 0 && (typeof e == "boolean" ? this.pingConfig.enabled = e : Ce(this.pingConfig, e)), Ce(this.retryConfig, {
|
|
1142
1142
|
maxCount: i,
|
|
1143
1143
|
interval: n
|
|
1144
1144
|
}), t && this.start(t);
|
|
@@ -1167,6 +1167,7 @@ class rn {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
/** 开始 */
|
|
1169
1169
|
start(s) {
|
|
1170
|
+
this.stop();
|
|
1170
1171
|
const t = new WebSocket(s);
|
|
1171
1172
|
this.socket = t, this.url = s, t.onopen = (e) => {
|
|
1172
1173
|
var i;
|
|
@@ -1188,7 +1189,7 @@ class rn {
|
|
|
1188
1189
|
(s = this.socket) == null || s.close(), this.socket = void 0;
|
|
1189
1190
|
}
|
|
1190
1191
|
}
|
|
1191
|
-
function
|
|
1192
|
+
function ln(r, s = 10) {
|
|
1192
1193
|
let t = 0, e = s;
|
|
1193
1194
|
function i() {
|
|
1194
1195
|
if (e > 0)
|
|
@@ -1202,7 +1203,7 @@ function on(r, s = 10) {
|
|
|
1202
1203
|
t = Date.now(), i();
|
|
1203
1204
|
});
|
|
1204
1205
|
}
|
|
1205
|
-
function
|
|
1206
|
+
function cn(r) {
|
|
1206
1207
|
const s = () => Promise.resolve(), t = (a) => (console.error(a), Promise.reject(a));
|
|
1207
1208
|
function e() {
|
|
1208
1209
|
return navigator.clipboard.writeText(r).then(s).catch(t);
|
|
@@ -1229,8 +1230,8 @@ function an(r) {
|
|
|
1229
1230
|
}
|
|
1230
1231
|
return navigator.clipboard ? e().catch(o) : o();
|
|
1231
1232
|
}
|
|
1232
|
-
function
|
|
1233
|
-
const t =
|
|
1233
|
+
function hn(r, s) {
|
|
1234
|
+
const t = Re[r];
|
|
1234
1235
|
if (!t) return console.error(`未知纸张类型: ${r}`);
|
|
1235
1236
|
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);
|
|
1236
1237
|
return {
|
|
@@ -1246,7 +1247,7 @@ function ln(r, s) {
|
|
|
1246
1247
|
paperHeightPx: h
|
|
1247
1248
|
};
|
|
1248
1249
|
}
|
|
1249
|
-
class
|
|
1250
|
+
class Nt {
|
|
1250
1251
|
constructor() {
|
|
1251
1252
|
}
|
|
1252
1253
|
/** 初始化标签页管理器 */
|
|
@@ -1288,7 +1289,7 @@ class It {
|
|
|
1288
1289
|
const o = "请先初始化标签页管理器";
|
|
1289
1290
|
return console.error(o), Promise.reject(o);
|
|
1290
1291
|
}
|
|
1291
|
-
const t =
|
|
1292
|
+
const t = ue();
|
|
1292
1293
|
let e = !1;
|
|
1293
1294
|
const i = this.pendingQueries.get(t) || [];
|
|
1294
1295
|
i.push(() => e = !0), this.pendingQueries.set(t, i);
|
|
@@ -1297,7 +1298,7 @@ class It {
|
|
|
1297
1298
|
responseKey: t,
|
|
1298
1299
|
name: s
|
|
1299
1300
|
};
|
|
1300
|
-
return this.channel.postMessage(n),
|
|
1301
|
+
return this.channel.postMessage(n), ii(() => e, this.timeout).finally(
|
|
1301
1302
|
() => this.pendingQueries.delete(t)
|
|
1302
1303
|
);
|
|
1303
1304
|
}
|
|
@@ -1319,7 +1320,7 @@ class It {
|
|
|
1319
1320
|
const n = "请先初始化标签页管理器";
|
|
1320
1321
|
return console.error(n), Promise.reject(n);
|
|
1321
1322
|
}
|
|
1322
|
-
const s =
|
|
1323
|
+
const s = ue(), t = [], e = this.pendingQueries.get(s) || [];
|
|
1323
1324
|
e.push((n) => t.push(n)), this.pendingQueries.set(s, e);
|
|
1324
1325
|
const i = {
|
|
1325
1326
|
type: yt.QUERY,
|
|
@@ -1334,15 +1335,15 @@ class It {
|
|
|
1334
1335
|
}
|
|
1335
1336
|
}
|
|
1336
1337
|
/** 初始化完成标志 */
|
|
1337
|
-
d(
|
|
1338
|
-
d(
|
|
1339
|
-
d(
|
|
1338
|
+
d(Nt, "initFinish", !1), /** 频道 */
|
|
1339
|
+
d(Nt, "channel", new BroadcastChannel("nhanh-pure-function")), /** 等待回执消息时间上限(上限) */
|
|
1340
|
+
d(Nt, "timeout", 150), /**
|
|
1340
1341
|
* 待处理查询
|
|
1341
1342
|
* @param key 回执消息key
|
|
1342
1343
|
* @param callback 匹配标签页的回调函数
|
|
1343
1344
|
*/
|
|
1344
|
-
d(
|
|
1345
|
-
class
|
|
1345
|
+
d(Nt, "pendingQueries", /* @__PURE__ */ new Map());
|
|
1346
|
+
class un {
|
|
1346
1347
|
constructor() {
|
|
1347
1348
|
/** 用户状态:active(活跃) / idle(闲置) */
|
|
1348
1349
|
d(this, "status", "active");
|
|
@@ -1391,7 +1392,7 @@ class cn {
|
|
|
1391
1392
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
1392
1393
|
* MIT Licence
|
|
1393
1394
|
*/
|
|
1394
|
-
var
|
|
1395
|
+
var de = 9e15, ut = 1e9, fe = "0123456789abcdef", $t = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Zt = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", me = {
|
|
1395
1396
|
// These values must be integers within the stated ranges (inclusive).
|
|
1396
1397
|
// Most of these values can be changed at run-time using the `Decimal.config` method.
|
|
1397
1398
|
// The maximum number of significant digits of the result of a calculation or base conversion.
|
|
@@ -1444,23 +1445,23 @@ var le = 9e15, ht = 1e9, ce = "0123456789abcdef", Wt = "2.3025850929940456840179
|
|
|
1444
1445
|
// -1 to -EXP_LIMIT
|
|
1445
1446
|
// The maximum exponent value, above which overflow to Infinity occurs.
|
|
1446
1447
|
// JavaScript numbers: 308 (1.7976931348623157e+308)
|
|
1447
|
-
maxE:
|
|
1448
|
+
maxE: de,
|
|
1448
1449
|
// 1 to EXP_LIMIT
|
|
1449
1450
|
// Whether to use cryptographically-secure random number generation, if available.
|
|
1450
1451
|
crypto: !1
|
|
1451
1452
|
// true/false
|
|
1452
|
-
},
|
|
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 };
|
|
1453
1454
|
v.absoluteValue = v.abs = function() {
|
|
1454
1455
|
var r = new this.constructor(this);
|
|
1455
|
-
return r.s < 0 && (r.s = 1),
|
|
1456
|
+
return r.s < 0 && (r.s = 1), C(r);
|
|
1456
1457
|
};
|
|
1457
1458
|
v.ceil = function() {
|
|
1458
|
-
return
|
|
1459
|
+
return C(new this.constructor(this), this.e + 1, 2);
|
|
1459
1460
|
};
|
|
1460
1461
|
v.clampedTo = v.clamp = function(r, s) {
|
|
1461
1462
|
var t, e = this, i = e.constructor;
|
|
1462
1463
|
if (r = new i(r), s = new i(s), !r.s || !s.s) return new i(NaN);
|
|
1463
|
-
if (r.gt(s)) throw Error(
|
|
1464
|
+
if (r.gt(s)) throw Error(ht + s);
|
|
1464
1465
|
return t = e.cmp(r), t < 0 ? r : e.cmp(s) > 0 ? s : new i(e);
|
|
1465
1466
|
};
|
|
1466
1467
|
v.comparedTo = v.cmp = function(r) {
|
|
@@ -1476,24 +1477,24 @@ v.comparedTo = v.cmp = function(r) {
|
|
|
1476
1477
|
};
|
|
1477
1478
|
v.cosine = v.cos = function() {
|
|
1478
1479
|
var r, s, t = this, e = t.constructor;
|
|
1479
|
-
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 =
|
|
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, ze(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);
|
|
1480
1481
|
};
|
|
1481
1482
|
v.cubeRoot = v.cbrt = function() {
|
|
1482
1483
|
var r, s, t, e, i, n, o, a, l, c, h = this, u = h.constructor;
|
|
1483
1484
|
if (!h.isFinite() || h.isZero()) return new u(h);
|
|
1484
|
-
for (
|
|
1485
|
-
if (a = e, l = a.times(a).times(a), c = l.plus(h), e =
|
|
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; ; )
|
|
1486
|
+
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))
|
|
1486
1487
|
if (t = t.slice(o - 3, o + 1), t == "9999" || !i && t == "4999") {
|
|
1487
|
-
if (!i && (
|
|
1488
|
+
if (!i && (C(a, r + 1, 0), a.times(a).times(a).eq(h))) {
|
|
1488
1489
|
e = a;
|
|
1489
1490
|
break;
|
|
1490
1491
|
}
|
|
1491
1492
|
o += 4, i = 1;
|
|
1492
1493
|
} else {
|
|
1493
|
-
(!+t || !+t.slice(1) && t.charAt(0) == "5") && (
|
|
1494
|
+
(!+t || !+t.slice(1) && t.charAt(0) == "5") && (C(e, r + 1, 1), s = !e.times(e).times(e).eq(h));
|
|
1494
1495
|
break;
|
|
1495
1496
|
}
|
|
1496
|
-
return
|
|
1497
|
+
return E = !0, C(e, r, u.rounding, s);
|
|
1497
1498
|
};
|
|
1498
1499
|
v.decimalPlaces = v.dp = function() {
|
|
1499
1500
|
var r, s = this.d, t = NaN;
|
|
@@ -1504,17 +1505,17 @@ v.decimalPlaces = v.dp = function() {
|
|
|
1504
1505
|
return t;
|
|
1505
1506
|
};
|
|
1506
1507
|
v.dividedBy = v.div = function(r) {
|
|
1507
|
-
return
|
|
1508
|
+
return V(this, new this.constructor(r));
|
|
1508
1509
|
};
|
|
1509
1510
|
v.dividedToIntegerBy = v.divToInt = function(r) {
|
|
1510
1511
|
var s = this, t = s.constructor;
|
|
1511
|
-
return
|
|
1512
|
+
return C(V(s, new t(r), 0, 1, 1), t.precision, t.rounding);
|
|
1512
1513
|
};
|
|
1513
1514
|
v.equals = v.eq = function(r) {
|
|
1514
1515
|
return this.cmp(r) === 0;
|
|
1515
1516
|
};
|
|
1516
1517
|
v.floor = function() {
|
|
1517
|
-
return
|
|
1518
|
+
return C(new this.constructor(this), this.e + 1, 3);
|
|
1518
1519
|
};
|
|
1519
1520
|
v.greaterThan = v.gt = function(r) {
|
|
1520
1521
|
return this.cmp(r) > 0;
|
|
@@ -1527,10 +1528,10 @@ v.hyperbolicCosine = v.cosh = function() {
|
|
|
1527
1528
|
var r, s, t, e, i, n = this, o = n.constructor, a = new o(1);
|
|
1528
1529
|
if (!n.isFinite()) return new o(n.s ? 1 / 0 : NaN);
|
|
1529
1530
|
if (n.isZero()) return a;
|
|
1530
|
-
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 /
|
|
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);
|
|
1531
1532
|
for (var l, c = r, h = new o(8); c--; )
|
|
1532
1533
|
l = n.times(n), n = a.minus(l.times(h.minus(l.times(h))));
|
|
1533
|
-
return
|
|
1534
|
+
return C(n, o.precision = t, o.rounding = e, !0);
|
|
1534
1535
|
};
|
|
1535
1536
|
v.hyperbolicSine = v.sinh = function() {
|
|
1536
1537
|
var r, s, t, e, i = this, n = i.constructor;
|
|
@@ -1538,52 +1539,52 @@ v.hyperbolicSine = v.sinh = function() {
|
|
|
1538
1539
|
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)
|
|
1539
1540
|
i = Mt(n, 2, i, i, !0);
|
|
1540
1541
|
else {
|
|
1541
|
-
r = 1.4 * Math.sqrt(e), r = r > 16 ? 16 : r | 0, i = i.times(1 /
|
|
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);
|
|
1542
1543
|
for (var o, a = new n(5), l = new n(16), c = new n(20); r--; )
|
|
1543
1544
|
o = i.times(i), i = i.times(a.plus(o.times(l.times(o).plus(c))));
|
|
1544
1545
|
}
|
|
1545
|
-
return n.precision = s, n.rounding = t,
|
|
1546
|
+
return n.precision = s, n.rounding = t, C(i, s, t, !0);
|
|
1546
1547
|
};
|
|
1547
1548
|
v.hyperbolicTangent = v.tanh = function() {
|
|
1548
1549
|
var r, s, t = this, e = t.constructor;
|
|
1549
|
-
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 7, e.rounding = 1,
|
|
1550
|
+
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 7, e.rounding = 1, V(t.sinh(), t.cosh(), e.precision = r, e.rounding = s)) : new e(t.s);
|
|
1550
1551
|
};
|
|
1551
1552
|
v.inverseCosine = v.acos = function() {
|
|
1552
1553
|
var r = this, s = r.constructor, t = r.abs().cmp(1), e = s.precision, i = s.rounding;
|
|
1553
|
-
return t !== -1 ? t === 0 ? r.isNeg() ?
|
|
1554
|
+
return t !== -1 ? t === 0 ? r.isNeg() ? tt(s, e, i) : new s(0) : new s(NaN) : r.isZero() ? tt(s, e + 4, i).times(0.5) : (s.precision = e + 6, s.rounding = 1, r = new s(1).minus(r).div(r.plus(1)).sqrt().atan(), s.precision = e, s.rounding = i, r.times(2));
|
|
1554
1555
|
};
|
|
1555
1556
|
v.inverseHyperbolicCosine = v.acosh = function() {
|
|
1556
1557
|
var r, s, t = this, e = t.constructor;
|
|
1557
|
-
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,
|
|
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);
|
|
1558
1559
|
};
|
|
1559
1560
|
v.inverseHyperbolicSine = v.asinh = function() {
|
|
1560
1561
|
var r, s, t = this, e = t.constructor;
|
|
1561
|
-
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,
|
|
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());
|
|
1562
1563
|
};
|
|
1563
1564
|
v.inverseHyperbolicTangent = v.atanh = function() {
|
|
1564
1565
|
var r, s, t, e, i = this, n = i.constructor;
|
|
1565
|
-
return i.isFinite() ? i.e >= 0 ? new n(i.abs().eq(1) ? i.s / 0 : i.isZero() ? i : NaN) : (r = n.precision, s = n.rounding, e = i.sd(), Math.max(e, r) < 2 * -i.e - 1 ?
|
|
1566
|
+
return i.isFinite() ? i.e >= 0 ? new n(i.abs().eq(1) ? i.s / 0 : i.isZero() ? i : NaN) : (r = n.precision, s = n.rounding, e = i.sd(), Math.max(e, r) < 2 * -i.e - 1 ? C(new n(i), r, s, !0) : (n.precision = t = e - i.e, i = V(i.plus(1), new n(1).minus(i), t + r, 1), n.precision = r + 4, n.rounding = 1, i = i.ln(), n.precision = r, n.rounding = s, i.times(0.5))) : new n(NaN);
|
|
1566
1567
|
};
|
|
1567
1568
|
v.inverseSine = v.asin = function() {
|
|
1568
1569
|
var r, s, t, e, i = this, n = i.constructor;
|
|
1569
|
-
return i.isZero() ? new n(i) : (s = i.abs().cmp(1), t = n.precision, e = n.rounding, s !== -1 ? s === 0 ? (r =
|
|
1570
|
+
return i.isZero() ? new n(i) : (s = i.abs().cmp(1), t = n.precision, e = n.rounding, s !== -1 ? s === 0 ? (r = tt(n, t + 4, e).times(0.5), r.s = i.s, r) : new n(NaN) : (n.precision = t + 6, n.rounding = 1, i = i.div(new n(1).minus(i.times(i)).sqrt().plus(1)).atan(), n.precision = t, n.rounding = e, i.times(2)));
|
|
1570
1571
|
};
|
|
1571
1572
|
v.inverseTangent = v.atan = function() {
|
|
1572
1573
|
var r, s, t, e, i, n, o, a, l, c = this, h = c.constructor, u = h.precision, f = h.rounding;
|
|
1573
1574
|
if (c.isFinite()) {
|
|
1574
1575
|
if (c.isZero())
|
|
1575
1576
|
return new h(c);
|
|
1576
|
-
if (c.abs().eq(1) && u + 4 <=
|
|
1577
|
-
return o =
|
|
1577
|
+
if (c.abs().eq(1) && u + 4 <= ge)
|
|
1578
|
+
return o = tt(h, u + 4, f).times(0.25), o.s = c.s, o;
|
|
1578
1579
|
} else {
|
|
1579
1580
|
if (!c.s) return new h(NaN);
|
|
1580
|
-
if (u + 4 <=
|
|
1581
|
-
return o =
|
|
1581
|
+
if (u + 4 <= ge)
|
|
1582
|
+
return o = tt(h, u + 4, f).times(0.5), o.s = c.s, o;
|
|
1582
1583
|
}
|
|
1583
1584
|
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));
|
|
1584
|
-
for (
|
|
1585
|
+
for (E = !1, s = Math.ceil(a / S), e = 1, l = c.times(c), o = new h(c), i = c; r !== -1; )
|
|
1585
1586
|
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--; ) ;
|
|
1586
|
-
return t && (o = o.times(2 << t - 1)),
|
|
1587
|
+
return t && (o = o.times(2 << t - 1)), E = !0, C(o, h.precision = u, h.rounding = f, !0);
|
|
1587
1588
|
};
|
|
1588
1589
|
v.isFinite = function() {
|
|
1589
1590
|
return !!this.d;
|
|
@@ -1626,14 +1627,14 @@ v.logarithm = v.log = function(r) {
|
|
|
1626
1627
|
for (i = t[0]; i % 10 === 0; ) i /= 10;
|
|
1627
1628
|
n = i !== 1;
|
|
1628
1629
|
}
|
|
1629
|
-
if (
|
|
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))
|
|
1630
1631
|
do
|
|
1631
|
-
if (a += 10, o = at(c, a), e = s ?
|
|
1632
|
-
+N(l.d).slice(i + 1, i + 15) + 1 == 1e14 && (l =
|
|
1632
|
+
if (a += 10, o = at(c, a), e = s ? Qt(h, a + 10) : at(r, a), l = V(o, e, a, 1), !n) {
|
|
1633
|
+
+N(l.d).slice(i + 1, i + 15) + 1 == 1e14 && (l = C(l, u + 1, 0));
|
|
1633
1634
|
break;
|
|
1634
1635
|
}
|
|
1635
1636
|
while (kt(l.d, i += 10, f));
|
|
1636
|
-
return
|
|
1637
|
+
return E = !0, C(l, u, f);
|
|
1637
1638
|
};
|
|
1638
1639
|
v.minus = v.sub = function(r) {
|
|
1639
1640
|
var s, t, e, i, n, o, a, l, c, h, u, f, m = this, p = m.constructor;
|
|
@@ -1645,7 +1646,7 @@ v.minus = v.sub = function(r) {
|
|
|
1645
1646
|
if (f[0]) r.s = -r.s;
|
|
1646
1647
|
else if (c[0]) r = new p(m);
|
|
1647
1648
|
else return new p(l === 3 ? -0 : 0);
|
|
1648
|
-
return
|
|
1649
|
+
return E ? C(r, a, l) : r;
|
|
1649
1650
|
}
|
|
1650
1651
|
if (t = F(r.e / S), h = F(m.e / S), c = c.slice(), n = h - t, n) {
|
|
1651
1652
|
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);
|
|
@@ -1661,28 +1662,28 @@ v.minus = v.sub = function(r) {
|
|
|
1661
1662
|
for (u && (s = c, c = f, f = s, r.s = -r.s), o = c.length, e = f.length - o; e > 0; --e) c[o++] = 0;
|
|
1662
1663
|
for (e = f.length; e > n; ) {
|
|
1663
1664
|
if (c[--e] < f[e]) {
|
|
1664
|
-
for (i = e; i && c[--i] === 0; ) c[i] =
|
|
1665
|
-
--c[i], c[e] +=
|
|
1665
|
+
for (i = e; i && c[--i] === 0; ) c[i] = Q - 1;
|
|
1666
|
+
--c[i], c[e] += Q;
|
|
1666
1667
|
}
|
|
1667
1668
|
c[e] -= f[e];
|
|
1668
1669
|
}
|
|
1669
1670
|
for (; c[--o] === 0; ) c.pop();
|
|
1670
1671
|
for (; c[0] === 0; c.shift()) --t;
|
|
1671
|
-
return c[0] ? (r.d = c, r.e =
|
|
1672
|
+
return c[0] ? (r.d = c, r.e = ie(c, t), E ? C(r, a, l) : r) : new p(l === 3 ? -0 : 0);
|
|
1672
1673
|
};
|
|
1673
1674
|
v.modulo = v.mod = function(r) {
|
|
1674
1675
|
var s, t = this, e = t.constructor;
|
|
1675
|
-
return r = new e(r), !t.d || !r.s || r.d && !r.d[0] ? new e(NaN) : !r.d || t.d && !t.d[0] ?
|
|
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));
|
|
1676
1677
|
};
|
|
1677
1678
|
v.naturalExponential = v.exp = function() {
|
|
1678
|
-
return
|
|
1679
|
+
return pe(this);
|
|
1679
1680
|
};
|
|
1680
1681
|
v.naturalLogarithm = v.ln = function() {
|
|
1681
1682
|
return at(this);
|
|
1682
1683
|
};
|
|
1683
1684
|
v.negated = v.neg = function() {
|
|
1684
1685
|
var r = new this.constructor(this);
|
|
1685
|
-
return r.s = -r.s,
|
|
1686
|
+
return r.s = -r.s, C(r);
|
|
1686
1687
|
};
|
|
1687
1688
|
v.plus = v.add = function(r) {
|
|
1688
1689
|
var s, t, e, i, n, o, a, l, c, h, u = this, f = u.constructor;
|
|
@@ -1691,50 +1692,50 @@ v.plus = v.add = function(r) {
|
|
|
1691
1692
|
if (u.s != r.s)
|
|
1692
1693
|
return r.s = -r.s, u.minus(r);
|
|
1693
1694
|
if (c = u.d, h = r.d, a = f.precision, l = f.rounding, !c[0] || !h[0])
|
|
1694
|
-
return h[0] || (r = new f(u)),
|
|
1695
|
+
return h[0] || (r = new f(u)), E ? C(r, a, l) : r;
|
|
1695
1696
|
if (n = F(u.e / S), e = F(r.e / S), c = c.slice(), i = n - e, i) {
|
|
1696
1697
|
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);
|
|
1697
1698
|
t.reverse();
|
|
1698
1699
|
}
|
|
1699
1700
|
for (o = c.length, i = h.length, o - i < 0 && (i = o, t = h, h = c, c = t), s = 0; i; )
|
|
1700
|
-
s = (c[--i] = c[i] + h[i] + s) /
|
|
1701
|
+
s = (c[--i] = c[i] + h[i] + s) / Q | 0, c[i] %= Q;
|
|
1701
1702
|
for (s && (c.unshift(s), ++e), o = c.length; c[--o] == 0; ) c.pop();
|
|
1702
|
-
return r.d = c, r.e =
|
|
1703
|
+
return r.d = c, r.e = ie(c, e), E ? C(r, a, l) : r;
|
|
1703
1704
|
};
|
|
1704
1705
|
v.precision = v.sd = function(r) {
|
|
1705
1706
|
var s, t = this;
|
|
1706
|
-
if (r !== void 0 && r !== !!r && r !== 1 && r !== 0) throw Error(
|
|
1707
|
-
return t.d ? (s =
|
|
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;
|
|
1708
1709
|
};
|
|
1709
1710
|
v.round = function() {
|
|
1710
1711
|
var r = this, s = r.constructor;
|
|
1711
|
-
return
|
|
1712
|
+
return C(new s(r), r.e + 1, s.rounding);
|
|
1712
1713
|
};
|
|
1713
1714
|
v.sine = v.sin = function() {
|
|
1714
1715
|
var r, s, t = this, e = t.constructor;
|
|
1715
|
-
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 =
|
|
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, ze(e, t)), e.precision = r, e.rounding = s, C(nt > 2 ? t.neg() : t, r, s, !0)) : new e(NaN);
|
|
1716
1717
|
};
|
|
1717
1718
|
v.squareRoot = v.sqrt = function() {
|
|
1718
1719
|
var r, s, t, e, i, n, o = this, a = o.d, l = o.e, c = o.s, h = o.constructor;
|
|
1719
1720
|
if (c !== 1 || !a || !a[0])
|
|
1720
1721
|
return new h(!c || c < 0 && (!a || a[0]) ? NaN : a ? o : 1 / 0);
|
|
1721
|
-
for (
|
|
1722
|
-
if (n = e, e = n.plus(
|
|
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; ; )
|
|
1723
|
+
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))
|
|
1723
1724
|
if (s = s.slice(t - 3, t + 1), s == "9999" || !i && s == "4999") {
|
|
1724
|
-
if (!i && (
|
|
1725
|
+
if (!i && (C(n, l + 1, 0), n.times(n).eq(o))) {
|
|
1725
1726
|
e = n;
|
|
1726
1727
|
break;
|
|
1727
1728
|
}
|
|
1728
1729
|
t += 4, i = 1;
|
|
1729
1730
|
} else {
|
|
1730
|
-
(!+s || !+s.slice(1) && s.charAt(0) == "5") && (
|
|
1731
|
+
(!+s || !+s.slice(1) && s.charAt(0) == "5") && (C(e, l + 1, 1), r = !e.times(e).eq(o));
|
|
1731
1732
|
break;
|
|
1732
1733
|
}
|
|
1733
|
-
return
|
|
1734
|
+
return E = !0, C(e, l, h.rounding, r);
|
|
1734
1735
|
};
|
|
1735
1736
|
v.tangent = v.tan = function() {
|
|
1736
1737
|
var r, s, t = this, e = t.constructor;
|
|
1737
|
-
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 10, e.rounding = 1, t = t.sin(), t.s = 1, t =
|
|
1738
|
+
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 10, e.rounding = 1, t = t.sin(), t.s = 1, t = V(t, new e(1).minus(t.times(t)).sqrt(), r + 10, 0), e.precision = r, e.rounding = s, C(nt == 2 || nt == 4 ? t.neg() : t, r, s, !0)) : new e(NaN);
|
|
1738
1739
|
};
|
|
1739
1740
|
v.times = v.mul = function(r) {
|
|
1740
1741
|
var s, t, e, i, n, o, a, l, c, h = this, u = h.constructor, f = h.d, m = (r = new u(r)).d;
|
|
@@ -1743,42 +1744,42 @@ v.times = v.mul = function(r) {
|
|
|
1743
1744
|
for (t = F(h.e / S) + F(r.e / S), l = f.length, c = m.length, l < c && (n = f, f = m, m = n, o = l, l = c, c = o), n = [], o = l + c, e = o; e--; ) n.push(0);
|
|
1744
1745
|
for (e = c; --e >= 0; ) {
|
|
1745
1746
|
for (s = 0, i = l + e; i > e; )
|
|
1746
|
-
a = n[i] + m[e] * f[i - e - 1] + s, n[i--] = a %
|
|
1747
|
-
n[i] = (n[i] + s) %
|
|
1747
|
+
a = n[i] + m[e] * f[i - e - 1] + s, n[i--] = a % Q | 0, s = a / Q | 0;
|
|
1748
|
+
n[i] = (n[i] + s) % Q | 0;
|
|
1748
1749
|
}
|
|
1749
1750
|
for (; !n[--o]; ) n.pop();
|
|
1750
|
-
return s ? ++t : n.shift(), r.d = n, r.e =
|
|
1751
|
+
return s ? ++t : n.shift(), r.d = n, r.e = ie(n, t), E ? C(r, u.precision, u.rounding) : r;
|
|
1751
1752
|
};
|
|
1752
1753
|
v.toBinary = function(r, s) {
|
|
1753
|
-
return
|
|
1754
|
+
return ye(this, 2, r, s);
|
|
1754
1755
|
};
|
|
1755
1756
|
v.toDecimalPlaces = v.toDP = function(r, s) {
|
|
1756
1757
|
var t = this, e = t.constructor;
|
|
1757
|
-
return t = new e(t), r === void 0 ? t : (
|
|
1758
|
+
return t = new e(t), r === void 0 ? t : (U(r, 0, ut), s === void 0 ? s = e.rounding : U(s, 0, 8), C(t, r + t.e + 1, s));
|
|
1758
1759
|
};
|
|
1759
1760
|
v.toExponential = function(r, s) {
|
|
1760
1761
|
var t, e = this, i = e.constructor;
|
|
1761
|
-
return r === void 0 ? t =
|
|
1762
|
+
return r === void 0 ? t = et(e, !0) : (U(r, 0, ut), 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;
|
|
1762
1763
|
};
|
|
1763
1764
|
v.toFixed = function(r, s) {
|
|
1764
1765
|
var t, e, i = this, n = i.constructor;
|
|
1765
|
-
return r === void 0 ? t =
|
|
1766
|
+
return r === void 0 ? t = et(i) : (U(r, 0, ut), 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;
|
|
1766
1767
|
};
|
|
1767
1768
|
v.toFraction = function(r) {
|
|
1768
1769
|
var s, t, e, i, n, o, a, l, c, h, u, f, m = this, p = m.d, g = m.constructor;
|
|
1769
1770
|
if (!p) return new g(m);
|
|
1770
|
-
if (c = t = new g(1), e = l = new g(0), s = new g(e), n = s.e =
|
|
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)
|
|
1771
1772
|
r = n > 0 ? s : c;
|
|
1772
1773
|
else {
|
|
1773
|
-
if (a = new g(r), !a.isInt() || a.lt(c)) throw Error(
|
|
1774
|
+
if (a = new g(r), !a.isInt() || a.lt(c)) throw Error(ht + a);
|
|
1774
1775
|
r = a.gt(s) ? n > 0 ? s : c : a;
|
|
1775
1776
|
}
|
|
1776
|
-
for (
|
|
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; )
|
|
1777
1778
|
t = e, e = i, i = c, c = l.plus(u.times(i)), l = i, i = s, s = a.minus(u.times(i)), a = i;
|
|
1778
|
-
return 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;
|
|
1779
1780
|
};
|
|
1780
1781
|
v.toHexadecimal = v.toHex = function(r, s) {
|
|
1781
|
-
return
|
|
1782
|
+
return ye(this, 16, r, s);
|
|
1782
1783
|
};
|
|
1783
1784
|
v.toNearest = function(r, s) {
|
|
1784
1785
|
var t = this, e = t.constructor;
|
|
@@ -1786,49 +1787,49 @@ v.toNearest = function(r, s) {
|
|
|
1786
1787
|
if (!t.d) return t;
|
|
1787
1788
|
r = new e(1), s = e.rounding;
|
|
1788
1789
|
} else {
|
|
1789
|
-
if (r = new e(r), s === void 0 ? s = e.rounding :
|
|
1790
|
+
if (r = new e(r), s === void 0 ? s = e.rounding : U(s, 0, 8), !t.d) return r.s ? t : r;
|
|
1790
1791
|
if (!r.d)
|
|
1791
1792
|
return r.s && (r.s = t.s), r;
|
|
1792
1793
|
}
|
|
1793
|
-
return r.d[0] ? (
|
|
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;
|
|
1794
1795
|
};
|
|
1795
1796
|
v.toNumber = function() {
|
|
1796
1797
|
return +this;
|
|
1797
1798
|
};
|
|
1798
1799
|
v.toOctal = function(r, s) {
|
|
1799
|
-
return
|
|
1800
|
+
return ye(this, 8, r, s);
|
|
1800
1801
|
};
|
|
1801
1802
|
v.toPower = v.pow = function(r) {
|
|
1802
1803
|
var s, t, e, i, n, o, a = this, l = a.constructor, c = +(r = new l(r));
|
|
1803
|
-
if (!a.d || !r.d || !a.d[0] || !r.d[0]) return new l(
|
|
1804
|
+
if (!a.d || !r.d || !a.d[0] || !r.d[0]) return new l(I(+a, c));
|
|
1804
1805
|
if (a = new l(a), a.eq(1)) return a;
|
|
1805
|
-
if (e = l.precision, n = l.rounding, r.eq(1)) return
|
|
1806
|
-
if (s = F(r.e / S), s >= r.d.length - 1 && (t = c < 0 ? -c : c) <=
|
|
1807
|
-
return i =
|
|
1806
|
+
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 = Ge(l, a, t, e), r.s < 0 ? new l(1).div(i) : C(i, e, n);
|
|
1808
1809
|
if (o = a.s, o < 0) {
|
|
1809
1810
|
if (s < r.d.length - 1) return new l(NaN);
|
|
1810
1811
|
if (r.d[s] & 1 || (o = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
|
|
1811
1812
|
return a.s = o, a;
|
|
1812
1813
|
}
|
|
1813
|
-
return t =
|
|
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));
|
|
1814
1815
|
};
|
|
1815
1816
|
v.toPrecision = function(r, s) {
|
|
1816
1817
|
var t, e = this, i = e.constructor;
|
|
1817
|
-
return r === void 0 ? t =
|
|
1818
|
+
return r === void 0 ? t = et(e, e.e <= i.toExpNeg || e.e >= i.toExpPos) : (U(r, 1, ut), 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;
|
|
1818
1819
|
};
|
|
1819
1820
|
v.toSignificantDigits = v.toSD = function(r, s) {
|
|
1820
1821
|
var t = this, e = t.constructor;
|
|
1821
|
-
return r === void 0 ? (r = e.precision, s = e.rounding) : (
|
|
1822
|
+
return r === void 0 ? (r = e.precision, s = e.rounding) : (U(r, 1, ut), s === void 0 ? s = e.rounding : U(s, 0, 8)), C(new e(t), r, s);
|
|
1822
1823
|
};
|
|
1823
1824
|
v.toString = function() {
|
|
1824
|
-
var r = this, s = r.constructor, t =
|
|
1825
|
+
var r = this, s = r.constructor, t = et(r, r.e <= s.toExpNeg || r.e >= s.toExpPos);
|
|
1825
1826
|
return r.isNeg() && !r.isZero() ? "-" + t : t;
|
|
1826
1827
|
};
|
|
1827
1828
|
v.truncated = v.trunc = function() {
|
|
1828
|
-
return
|
|
1829
|
+
return C(new this.constructor(this), this.e + 1, 1);
|
|
1829
1830
|
};
|
|
1830
1831
|
v.valueOf = v.toJSON = function() {
|
|
1831
|
-
var r = this, s = r.constructor, t =
|
|
1832
|
+
var r = this, s = r.constructor, t = et(r, r.e <= s.toExpNeg || r.e >= s.toExpPos);
|
|
1832
1833
|
return r.isNeg() ? "-" + t : t;
|
|
1833
1834
|
};
|
|
1834
1835
|
function N(r) {
|
|
@@ -1842,34 +1843,34 @@ function N(r) {
|
|
|
1842
1843
|
for (; o % 10 === 0; ) o /= 10;
|
|
1843
1844
|
return n + o;
|
|
1844
1845
|
}
|
|
1845
|
-
function
|
|
1846
|
+
function U(r, s, t) {
|
|
1846
1847
|
if (r !== ~~r || r < s || r > t)
|
|
1847
|
-
throw Error(
|
|
1848
|
+
throw Error(ht + r);
|
|
1848
1849
|
}
|
|
1849
1850
|
function kt(r, s, t, e) {
|
|
1850
1851
|
var i, n, o, a;
|
|
1851
1852
|
for (n = r[0]; n >= 10; n /= 10) --s;
|
|
1852
|
-
return --s < 0 ? (s += S, i = 0) : (i = Math.ceil((s + 1) / S), s %= S), n =
|
|
1853
|
+
return --s < 0 ? (s += S, i = 0) : (i = Math.ceil((s + 1) / S), s %= S), n = I(10, S - s), a = r[i] % n | 0, e == null ? s < 3 ? (s == 0 ? a = a / 100 | 0 : s == 1 && (a = a / 10 | 0), o = t < 4 && a == 99999 || t > 3 && a == 49999 || a == 5e4 || a == 0) : o = (t < 4 && a + 1 == n || t > 3 && a + 1 == n / 2) && (r[i + 1] / n / 100 | 0) == I(10, s - 2) - 1 || (a == n / 2 || a == 0) && (r[i + 1] / n / 100 | 0) == 0 : s < 4 ? (s == 0 ? a = a / 1e3 | 0 : s == 1 ? a = a / 100 | 0 : s == 2 && (a = a / 10 | 0), o = (e || t < 4) && a == 9999 || !e && t > 3 && a == 4999) : o = ((e || t < 4) && a + 1 == n || !e && t > 3 && a + 1 == n / 2) && (r[i + 1] / n / 1e3 | 0) == I(10, s - 3) - 1, o;
|
|
1853
1854
|
}
|
|
1854
|
-
function
|
|
1855
|
+
function Ft(r, s, t) {
|
|
1855
1856
|
for (var e, i = [0], n, o = 0, a = r.length; o < a; ) {
|
|
1856
1857
|
for (n = i.length; n--; ) i[n] *= s;
|
|
1857
|
-
for (i[0] +=
|
|
1858
|
+
for (i[0] += fe.indexOf(r.charAt(o++)), e = 0; e < i.length; e++)
|
|
1858
1859
|
i[e] > t - 1 && (i[e + 1] === void 0 && (i[e + 1] = 0), i[e + 1] += i[e] / t | 0, i[e] %= t);
|
|
1859
1860
|
}
|
|
1860
1861
|
return i.reverse();
|
|
1861
1862
|
}
|
|
1862
|
-
function
|
|
1863
|
+
function hi(r, s) {
|
|
1863
1864
|
var t, e, i;
|
|
1864
1865
|
if (s.isZero()) return s;
|
|
1865
|
-
e = s.d.length, e < 32 ? (t = Math.ceil(e / 3), i = (1 /
|
|
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));
|
|
1866
1867
|
for (var n = t; n--; ) {
|
|
1867
1868
|
var o = s.times(s);
|
|
1868
1869
|
s = o.times(o).minus(o).times(8).plus(1);
|
|
1869
1870
|
}
|
|
1870
1871
|
return r.precision -= t, s;
|
|
1871
1872
|
}
|
|
1872
|
-
var
|
|
1873
|
+
var V = /* @__PURE__ */ function() {
|
|
1873
1874
|
function r(e, i, n) {
|
|
1874
1875
|
var o, a = 0, l = e.length;
|
|
1875
1876
|
for (e = e.slice(); l--; )
|
|
@@ -1894,49 +1895,49 @@ var k = /* @__PURE__ */ function() {
|
|
|
1894
1895
|
for (; !e[0] && e.length > 1; ) e.shift();
|
|
1895
1896
|
}
|
|
1896
1897
|
return function(e, i, n, o, a, l) {
|
|
1897
|
-
var c, h, u, f, m, p, g, y, w,
|
|
1898
|
-
if (!H || !H[0] || !
|
|
1898
|
+
var c, h, u, f, m, p, g, y, w, P, b, _, A, X, At, dt, rt, vt, z, Lt, Tt = e.constructor, ne = e.s == i.s ? 1 : -1, H = e.d, O = i.d;
|
|
1899
|
+
if (!H || !H[0] || !O || !O[0])
|
|
1899
1900
|
return new Tt(
|
|
1900
1901
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
1901
|
-
!e.s || !i.s || (H ?
|
|
1902
|
+
!e.s || !i.s || (H ? O && H[0] == O[0] : !O) ? NaN : (
|
|
1902
1903
|
// Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
|
|
1903
|
-
H && H[0] == 0 || !
|
|
1904
|
+
H && H[0] == 0 || !O ? ne * 0 : ne / 0
|
|
1904
1905
|
)
|
|
1905
1906
|
);
|
|
1906
|
-
for (l ? (m = 1, h = e.e - i.e) : (l =
|
|
1907
|
-
if (
|
|
1908
|
-
|
|
1907
|
+
for (l ? (m = 1, h = e.e - i.e) : (l = Q, m = S, h = F(e.e / m) - F(i.e / m)), z = 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 ? (X = n = Tt.precision, o = Tt.rounding) : a ? X = n + (e.e - i.e) + 1 : X = n, X < 0)
|
|
1909
|
+
P.push(1), p = !0;
|
|
1909
1910
|
else {
|
|
1910
|
-
if (
|
|
1911
|
-
for (f = 0,
|
|
1912
|
-
|
|
1911
|
+
if (X = X / m + 2 | 0, u = 0, z == 1) {
|
|
1912
|
+
for (f = 0, O = O[0], X++; (u < rt || f) && X--; u++)
|
|
1913
|
+
At = f * l + (H[u] || 0), P[u] = At / O | 0, f = At % O | 0;
|
|
1913
1914
|
p = f || u < rt;
|
|
1914
1915
|
} else {
|
|
1915
|
-
for (f = l / (
|
|
1916
|
-
|
|
1916
|
+
for (f = l / (O[0] + 1) | 0, f > 1 && (O = r(O, f, l), H = r(H, f, l), z = O.length, rt = H.length), dt = z, b = H.slice(0, z), _ = b.length; _ < z; ) b[_++] = 0;
|
|
1917
|
+
Lt = O.slice(), Lt.unshift(0), vt = O[0], O[1] >= l / 2 && ++vt;
|
|
1917
1918
|
do
|
|
1918
|
-
f = 0, c = s(
|
|
1919
|
-
while ((
|
|
1920
|
-
p =
|
|
1919
|
+
f = 0, c = s(O, b, z, _), c < 0 ? (A = b[0], z != _ && (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, z < 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, z, _), c < 1 && (f++, t(b, z < _ ? 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) && X--);
|
|
1921
|
+
p = b[0] !== void 0;
|
|
1921
1922
|
}
|
|
1922
|
-
|
|
1923
|
+
P[0] || P.shift();
|
|
1923
1924
|
}
|
|
1924
1925
|
if (m == 1)
|
|
1925
|
-
w.e = h,
|
|
1926
|
+
w.e = h, Te = p;
|
|
1926
1927
|
else {
|
|
1927
|
-
for (u = 1, f =
|
|
1928
|
-
w.e = u + h * m - 1,
|
|
1928
|
+
for (u = 1, f = P[0]; f >= 10; f /= 10) u++;
|
|
1929
|
+
w.e = u + h * m - 1, C(w, a ? n + w.e + 1 : n, o, p);
|
|
1929
1930
|
}
|
|
1930
1931
|
return w;
|
|
1931
1932
|
};
|
|
1932
1933
|
}();
|
|
1933
|
-
function
|
|
1934
|
+
function C(r, s, t, e) {
|
|
1934
1935
|
var i, n, o, a, l, c, h, u, f, m = r.constructor;
|
|
1935
1936
|
t: if (s != null) {
|
|
1936
1937
|
if (u = r.d, !u) return r;
|
|
1937
1938
|
for (i = 1, a = u[0]; a >= 10; a /= 10) i++;
|
|
1938
1939
|
if (n = s - i, n < 0)
|
|
1939
|
-
n += S, o = s, h = u[f = 0], l = h /
|
|
1940
|
+
n += S, o = s, h = u[f = 0], l = h / I(10, i - o - 1) % 10 | 0;
|
|
1940
1941
|
else if (f = Math.ceil((n + 1) / S), a = u.length, f >= a)
|
|
1941
1942
|
if (e) {
|
|
1942
1943
|
for (; a++ <= f; ) u.push(0);
|
|
@@ -1945,46 +1946,46 @@ function P(r, s, t, e) {
|
|
|
1945
1946
|
break t;
|
|
1946
1947
|
else {
|
|
1947
1948
|
for (h = a = u[f], i = 1; a >= 10; a /= 10) i++;
|
|
1948
|
-
n %= S, o = n - S + i, l = o < 0 ? 0 : h /
|
|
1949
|
+
n %= S, o = n - S + i, l = o < 0 ? 0 : h / I(10, i - o - 1) % 10 | 0;
|
|
1949
1950
|
}
|
|
1950
|
-
if (e = e || s < 0 || u[f + 1] !== void 0 || (o < 0 ? h : h %
|
|
1951
|
-
(n > 0 ? o > 0 ? h /
|
|
1952
|
-
return u.length = 0, c ? (s -= r.e + 1, u[0] =
|
|
1953
|
-
if (n == 0 ? (u.length = f, a = 1, f--) : (u.length = f + 1, a =
|
|
1951
|
+
if (e = e || s < 0 || u[f + 1] !== void 0 || (o < 0 ? h : h % I(10, i - o - 1)), c = t < 4 ? (l || e) && (t == 0 || t == (r.s < 0 ? 3 : 2)) : l > 5 || l == 5 && (t == 4 || e || t == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
1952
|
+
(n > 0 ? o > 0 ? h / I(10, i - o) : 0 : u[f - 1]) % 10 & 1 || t == (r.s < 0 ? 8 : 7)), s < 1 || !u[0])
|
|
1953
|
+
return u.length = 0, c ? (s -= r.e + 1, u[0] = I(10, (S - s % S) % S), r.e = -s || 0) : u[0] = r.e = 0, r;
|
|
1954
|
+
if (n == 0 ? (u.length = f, a = 1, f--) : (u.length = f + 1, a = I(10, S - n), u[f] = o > 0 ? (h / I(10, i - o) % I(10, o) | 0) * a : 0), c)
|
|
1954
1955
|
for (; ; )
|
|
1955
1956
|
if (f == 0) {
|
|
1956
1957
|
for (n = 1, o = u[0]; o >= 10; o /= 10) n++;
|
|
1957
1958
|
for (o = u[0] += a, a = 1; o >= 10; o /= 10) a++;
|
|
1958
|
-
n != a && (r.e++, u[0] ==
|
|
1959
|
+
n != a && (r.e++, u[0] == Q && (u[0] = 1));
|
|
1959
1960
|
break;
|
|
1960
1961
|
} else {
|
|
1961
|
-
if (u[f] += a, u[f] !=
|
|
1962
|
+
if (u[f] += a, u[f] != Q) break;
|
|
1962
1963
|
u[f--] = 0, a = 1;
|
|
1963
1964
|
}
|
|
1964
1965
|
for (n = u.length; u[--n] === 0; ) u.pop();
|
|
1965
1966
|
}
|
|
1966
|
-
return
|
|
1967
|
+
return E && (r.e > m.maxE ? (r.d = null, r.e = NaN) : r.e < m.minE && (r.e = 0, r.d = [0])), r;
|
|
1967
1968
|
}
|
|
1968
|
-
function
|
|
1969
|
-
if (!r.isFinite()) return
|
|
1969
|
+
function et(r, s, t) {
|
|
1970
|
+
if (!r.isFinite()) return Xe(r);
|
|
1970
1971
|
var e, i = r.e, n = N(r.d), o = n.length;
|
|
1971
1972
|
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;
|
|
1972
1973
|
}
|
|
1973
|
-
function
|
|
1974
|
+
function ie(r, s) {
|
|
1974
1975
|
var t = r[0];
|
|
1975
1976
|
for (s *= S; t >= 10; t /= 10) s++;
|
|
1976
1977
|
return s;
|
|
1977
1978
|
}
|
|
1978
|
-
function
|
|
1979
|
-
if (s >
|
|
1980
|
-
throw
|
|
1981
|
-
return
|
|
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);
|
|
1982
1983
|
}
|
|
1983
|
-
function
|
|
1984
|
-
if (s >
|
|
1985
|
-
return
|
|
1984
|
+
function tt(r, s, t) {
|
|
1985
|
+
if (s > ge) throw Error(Ie);
|
|
1986
|
+
return C(new r(Zt), s, t, !0);
|
|
1986
1987
|
}
|
|
1987
|
-
function
|
|
1988
|
+
function Be(r) {
|
|
1988
1989
|
var s = r.length - 1, t = s * S + 1;
|
|
1989
1990
|
if (s = r[s], s) {
|
|
1990
1991
|
for (; s % 10 == 0; s /= 10) t--;
|
|
@@ -1996,21 +1997,21 @@ function ot(r) {
|
|
|
1996
1997
|
for (var s = ""; r--; ) s += "0";
|
|
1997
1998
|
return s;
|
|
1998
1999
|
}
|
|
1999
|
-
function
|
|
2000
|
+
function Ge(r, s, t, e) {
|
|
2000
2001
|
var i, n = new r(1), o = Math.ceil(e / S + 4);
|
|
2001
|
-
for (
|
|
2002
|
-
if (t % 2 && (n = n.times(s),
|
|
2002
|
+
for (E = !1; ; ) {
|
|
2003
|
+
if (t % 2 && (n = n.times(s), Ee(n.d, o) && (i = !0)), t = F(t / 2), t === 0) {
|
|
2003
2004
|
t = n.d.length - 1, i && n.d[t] === 0 && ++n.d[t];
|
|
2004
2005
|
break;
|
|
2005
2006
|
}
|
|
2006
|
-
s = s.times(s),
|
|
2007
|
+
s = s.times(s), Ee(s.d, o);
|
|
2007
2008
|
}
|
|
2008
|
-
return
|
|
2009
|
+
return E = !0, n;
|
|
2009
2010
|
}
|
|
2010
|
-
function
|
|
2011
|
+
function Se(r) {
|
|
2011
2012
|
return r.d[r.d.length - 1] & 1;
|
|
2012
2013
|
}
|
|
2013
|
-
function
|
|
2014
|
+
function Ue(r, s, t) {
|
|
2014
2015
|
for (var e, i, n = new r(s[0]), o = 0; ++o < s.length; ) {
|
|
2015
2016
|
if (i = new r(s[o]), !i.s) {
|
|
2016
2017
|
n = i;
|
|
@@ -2020,20 +2021,20 @@ function Be(r, s, t) {
|
|
|
2020
2021
|
}
|
|
2021
2022
|
return n;
|
|
2022
2023
|
}
|
|
2023
|
-
function
|
|
2024
|
+
function pe(r, s) {
|
|
2024
2025
|
var t, e, i, n, o, a, l, c = 0, h = 0, u = 0, f = r.constructor, m = f.rounding, p = f.precision;
|
|
2025
2026
|
if (!r.d || !r.d[0] || r.e > 17)
|
|
2026
2027
|
return new f(r.d ? r.d[0] ? r.s < 0 ? 0 : 1 / 0 : 1 : r.s ? r.s < 0 ? 0 : r : NaN);
|
|
2027
|
-
for (s == null ? (
|
|
2028
|
+
for (s == null ? (E = !1, l = p) : l = s, a = new f(0.03125); r.e > -2; )
|
|
2028
2029
|
r = r.times(a), u += 5;
|
|
2029
|
-
for (e = Math.log(
|
|
2030
|
-
if (n =
|
|
2031
|
-
for (i = u; i--; ) o =
|
|
2030
|
+
for (e = Math.log(I(2, u)) / Math.LN10 * 2 + 5 | 0, l += e, t = n = o = new f(1), f.precision = l; ; ) {
|
|
2031
|
+
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)) {
|
|
2032
|
+
for (i = u; i--; ) o = C(o.times(o), l, 1);
|
|
2032
2033
|
if (s == null)
|
|
2033
2034
|
if (c < 3 && kt(o.d, l - e, m, c))
|
|
2034
2035
|
f.precision = l += 10, t = n = a = new f(1), h = 0, c++;
|
|
2035
2036
|
else
|
|
2036
|
-
return
|
|
2037
|
+
return C(o, f.precision = p, m, E = !0);
|
|
2037
2038
|
else
|
|
2038
2039
|
return f.precision = p, o;
|
|
2039
2040
|
}
|
|
@@ -2041,31 +2042,31 @@ function de(r, s) {
|
|
|
2041
2042
|
}
|
|
2042
2043
|
}
|
|
2043
2044
|
function at(r, s) {
|
|
2044
|
-
var t, e, i, n, o, a, l, c, h, u, f, m = 1, p = 10, g = r, y = g.d, w = g.constructor,
|
|
2045
|
+
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;
|
|
2045
2046
|
if (g.s < 0 || !y || !y[0] || !g.e && y[0] == 1 && y.length == 1)
|
|
2046
2047
|
return new w(y && !y[0] ? -1 / 0 : g.s != 1 ? NaN : y ? 0 : g);
|
|
2047
|
-
if (s == null ? (
|
|
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) {
|
|
2048
2049
|
for (; e < 7 && e != 1 || e == 1 && t.charAt(1) > 3; )
|
|
2049
2050
|
g = g.times(r), t = N(g.d), e = t.charAt(0), m++;
|
|
2050
2051
|
n = g.e, e > 1 ? (g = new w("0." + t), n++) : g = new w(e + "." + t.slice(1));
|
|
2051
2052
|
} else
|
|
2052
|
-
return c =
|
|
2053
|
-
for (u = g, l = o = g =
|
|
2054
|
-
if (o =
|
|
2055
|
-
if (l = l.times(2), n !== 0 && (l = l.plus(
|
|
2056
|
-
if (kt(l.d, h - p,
|
|
2057
|
-
w.precision = h += p, c = o = g =
|
|
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;
|
|
2054
|
+
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
|
+
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)
|
|
2057
|
+
if (kt(l.d, h - p, P, a))
|
|
2058
|
+
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;
|
|
2058
2059
|
else
|
|
2059
|
-
return
|
|
2060
|
+
return C(l, w.precision = b, P, E = !0);
|
|
2060
2061
|
else
|
|
2061
|
-
return w.precision =
|
|
2062
|
+
return w.precision = b, l;
|
|
2062
2063
|
l = c, i += 2;
|
|
2063
2064
|
}
|
|
2064
2065
|
}
|
|
2065
|
-
function
|
|
2066
|
+
function Xe(r) {
|
|
2066
2067
|
return String(r.s * r.s / 0);
|
|
2067
2068
|
}
|
|
2068
|
-
function
|
|
2069
|
+
function Bt(r, s) {
|
|
2069
2070
|
var t, e, i;
|
|
2070
2071
|
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++) ;
|
|
2071
2072
|
for (i = s.length; s.charCodeAt(i - 1) === 48; --i) ;
|
|
@@ -2076,85 +2077,85 @@ function Ft(r, s) {
|
|
|
2076
2077
|
} else
|
|
2077
2078
|
e -= i;
|
|
2078
2079
|
for (; e--; ) s += "0";
|
|
2079
|
-
r.d.push(+s),
|
|
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]));
|
|
2080
2081
|
} else
|
|
2081
2082
|
r.e = 0, r.d = [0];
|
|
2082
2083
|
return r;
|
|
2083
2084
|
}
|
|
2084
|
-
function
|
|
2085
|
+
function ui(r, s) {
|
|
2085
2086
|
var t, e, i, n, o, a, l, c, h;
|
|
2086
2087
|
if (s.indexOf("_") > -1) {
|
|
2087
|
-
if (s = s.replace(/(\d)_(?=\d)/g, "$1"),
|
|
2088
|
+
if (s = s.replace(/(\d)_(?=\d)/g, "$1"), Fe.test(s)) return Bt(r, s);
|
|
2088
2089
|
} else if (s === "Infinity" || s === "NaN")
|
|
2089
2090
|
return +s || (r.s = NaN), r.e = NaN, r.d = null, r;
|
|
2090
|
-
if (
|
|
2091
|
+
if (oi.test(s))
|
|
2091
2092
|
t = 16, s = s.toLowerCase();
|
|
2092
|
-
else if (
|
|
2093
|
+
else if (ri.test(s))
|
|
2093
2094
|
t = 2;
|
|
2094
|
-
else if (
|
|
2095
|
+
else if (ai.test(s))
|
|
2095
2096
|
t = 8;
|
|
2096
2097
|
else
|
|
2097
|
-
throw Error(
|
|
2098
|
-
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 =
|
|
2099
|
-
return n < 0 ? new e(r.s * 0) : (r.e =
|
|
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 = Ge(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);
|
|
2100
2101
|
}
|
|
2101
|
-
function
|
|
2102
|
+
function di(r, s) {
|
|
2102
2103
|
var t, e = s.d.length;
|
|
2103
2104
|
if (e < 3)
|
|
2104
2105
|
return s.isZero() ? s : Mt(r, 2, s, s);
|
|
2105
|
-
t = 1.4 * Math.sqrt(e), t = t > 16 ? 16 : t | 0, s = s.times(1 /
|
|
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);
|
|
2106
2107
|
for (var i, n = new r(5), o = new r(16), a = new r(20); t--; )
|
|
2107
2108
|
i = s.times(s), s = s.times(n.plus(i.times(o.times(i).minus(a))));
|
|
2108
2109
|
return s;
|
|
2109
2110
|
}
|
|
2110
2111
|
function Mt(r, s, t, e, i) {
|
|
2111
2112
|
var n, o, a, l, c = r.precision, h = Math.ceil(c / S);
|
|
2112
|
-
for (
|
|
2113
|
-
if (o =
|
|
2113
|
+
for (E = !1, l = t.times(t), a = new r(e); ; ) {
|
|
2114
|
+
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) {
|
|
2114
2115
|
for (n = h; o.d[n] === a.d[n] && n--; ) ;
|
|
2115
2116
|
if (n == -1) break;
|
|
2116
2117
|
}
|
|
2117
2118
|
n = a, a = e, e = o, o = n;
|
|
2118
2119
|
}
|
|
2119
|
-
return
|
|
2120
|
+
return E = !0, o.d.length = h + 1, o;
|
|
2120
2121
|
}
|
|
2121
|
-
function
|
|
2122
|
+
function se(r, s) {
|
|
2122
2123
|
for (var t = r; --s; ) t *= r;
|
|
2123
2124
|
return t;
|
|
2124
2125
|
}
|
|
2125
|
-
function
|
|
2126
|
-
var t, e = s.s < 0, i =
|
|
2126
|
+
function ze(r, s) {
|
|
2127
|
+
var t, e = s.s < 0, i = tt(r, r.precision, 1), n = i.times(0.5);
|
|
2127
2128
|
if (s = s.abs(), s.lte(n))
|
|
2128
2129
|
return nt = e ? 4 : 1, s;
|
|
2129
2130
|
if (t = s.divToInt(i), t.isZero())
|
|
2130
2131
|
nt = e ? 3 : 2;
|
|
2131
2132
|
else {
|
|
2132
2133
|
if (s = s.minus(t.times(i)), s.lte(n))
|
|
2133
|
-
return nt =
|
|
2134
|
-
nt =
|
|
2134
|
+
return nt = Se(t) ? e ? 2 : 3 : e ? 4 : 1, s;
|
|
2135
|
+
nt = Se(t) ? e ? 1 : 4 : e ? 3 : 2;
|
|
2135
2136
|
}
|
|
2136
2137
|
return s.minus(i).abs();
|
|
2137
2138
|
}
|
|
2138
|
-
function
|
|
2139
|
+
function ye(r, s, t, e) {
|
|
2139
2140
|
var i, n, o, a, l, c, h, u, f, m = r.constructor, p = t !== void 0;
|
|
2140
|
-
if (p ? (
|
|
2141
|
-
h =
|
|
2141
|
+
if (p ? (U(t, 1, ut), e === void 0 ? e = m.rounding : U(e, 0, 8)) : (t = m.precision, e = m.rounding), !r.isFinite())
|
|
2142
|
+
h = Xe(r);
|
|
2142
2143
|
else {
|
|
2143
|
-
for (h =
|
|
2144
|
+
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();
|
|
2144
2145
|
if (!u[0])
|
|
2145
2146
|
h = p ? "0p+0" : "0";
|
|
2146
2147
|
else {
|
|
2147
|
-
if (o < 0 ? n-- : (r = new m(r), r.d = u, r.e = n, r =
|
|
2148
|
+
if (o < 0 ? n-- : (r = new m(r), r.d = u, r.e = n, r = V(r, f, t, e, 0, i), u = r.d, n = r.e, c = Te), o = u[t], a = i / 2, c = c || u[t + 1] !== void 0, c = e < 4 ? (o !== void 0 || c) && (e === 0 || e === (r.s < 0 ? 3 : 2)) : o > a || o === a && (e === 4 || c || e === 6 && u[t - 1] & 1 || e === (r.s < 0 ? 8 : 7)), u.length = t, c)
|
|
2148
2149
|
for (; ++u[--t] > i - 1; )
|
|
2149
2150
|
u[t] = 0, t || (++n, u.unshift(1));
|
|
2150
2151
|
for (l = u.length; !u[l - 1]; --l) ;
|
|
2151
|
-
for (o = 0, h = ""; o < l; o++) h +=
|
|
2152
|
+
for (o = 0, h = ""; o < l; o++) h += fe.charAt(u[o]);
|
|
2152
2153
|
if (p) {
|
|
2153
2154
|
if (l > 1)
|
|
2154
2155
|
if (s == 16 || s == 8) {
|
|
2155
2156
|
for (o = s == 16 ? 4 : 3, --l; l % o; l++) h += "0";
|
|
2156
|
-
for (u =
|
|
2157
|
-
for (o = 1, h = "1."; o < l; o++) h +=
|
|
2157
|
+
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]);
|
|
2158
2159
|
} else
|
|
2159
2160
|
h = h.charAt(0) + "." + h.slice(1);
|
|
2160
2161
|
h = h + (n < 0 ? "p" : "p+") + n;
|
|
@@ -2168,54 +2169,54 @@ function pe(r, s, t, e) {
|
|
|
2168
2169
|
}
|
|
2169
2170
|
return r.s < 0 ? "-" + h : h;
|
|
2170
2171
|
}
|
|
2171
|
-
function
|
|
2172
|
+
function Ee(r, s) {
|
|
2172
2173
|
if (r.length > s)
|
|
2173
2174
|
return r.length = s, !0;
|
|
2174
2175
|
}
|
|
2175
|
-
function
|
|
2176
|
+
function fi(r) {
|
|
2176
2177
|
return new this(r).abs();
|
|
2177
2178
|
}
|
|
2178
|
-
function
|
|
2179
|
+
function mi(r) {
|
|
2179
2180
|
return new this(r).acos();
|
|
2180
2181
|
}
|
|
2181
|
-
function
|
|
2182
|
+
function gi(r) {
|
|
2182
2183
|
return new this(r).acosh();
|
|
2183
2184
|
}
|
|
2184
|
-
function
|
|
2185
|
+
function pi(r, s) {
|
|
2185
2186
|
return new this(r).plus(s);
|
|
2186
2187
|
}
|
|
2187
|
-
function
|
|
2188
|
+
function vi(r) {
|
|
2188
2189
|
return new this(r).asin();
|
|
2189
2190
|
}
|
|
2190
|
-
function
|
|
2191
|
+
function yi(r) {
|
|
2191
2192
|
return new this(r).asinh();
|
|
2192
2193
|
}
|
|
2193
|
-
function
|
|
2194
|
+
function wi(r) {
|
|
2194
2195
|
return new this(r).atan();
|
|
2195
2196
|
}
|
|
2196
|
-
function
|
|
2197
|
+
function xi(r) {
|
|
2197
2198
|
return new this(r).atanh();
|
|
2198
2199
|
}
|
|
2199
|
-
function
|
|
2200
|
+
function Pi(r, s) {
|
|
2200
2201
|
r = new this(r), s = new this(s);
|
|
2201
2202
|
var t, e = this.precision, i = this.rounding, n = e + 4;
|
|
2202
|
-
return !r.s || !s.s ? t = new this(NaN) : !r.d && !s.d ? (t =
|
|
2203
|
+
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;
|
|
2203
2204
|
}
|
|
2204
|
-
function
|
|
2205
|
+
function bi(r) {
|
|
2205
2206
|
return new this(r).cbrt();
|
|
2206
2207
|
}
|
|
2207
|
-
function
|
|
2208
|
-
return
|
|
2208
|
+
function Ci(r) {
|
|
2209
|
+
return C(r = new this(r), r.e + 1, 2);
|
|
2209
2210
|
}
|
|
2210
|
-
function
|
|
2211
|
+
function Si(r, s, t) {
|
|
2211
2212
|
return new this(r).clamp(s, t);
|
|
2212
2213
|
}
|
|
2213
|
-
function
|
|
2214
|
-
if (!r || typeof r != "object") throw Error(
|
|
2214
|
+
function Ei(r) {
|
|
2215
|
+
if (!r || typeof r != "object") throw Error(ee + "Object expected");
|
|
2215
2216
|
var s, t, e, i = r.defaults === !0, n = [
|
|
2216
2217
|
"precision",
|
|
2217
2218
|
1,
|
|
2218
|
-
|
|
2219
|
+
ut,
|
|
2219
2220
|
"rounding",
|
|
2220
2221
|
0,
|
|
2221
2222
|
8,
|
|
@@ -2224,10 +2225,10 @@ function bi(r) {
|
|
|
2224
2225
|
0,
|
|
2225
2226
|
"toExpPos",
|
|
2226
2227
|
0,
|
|
2227
|
-
|
|
2228
|
+
de,
|
|
2228
2229
|
"maxE",
|
|
2229
2230
|
0,
|
|
2230
|
-
|
|
2231
|
+
de,
|
|
2231
2232
|
"minE",
|
|
2232
2233
|
-9e15,
|
|
2233
2234
|
0,
|
|
@@ -2236,35 +2237,35 @@ function bi(r) {
|
|
|
2236
2237
|
9
|
|
2237
2238
|
];
|
|
2238
2239
|
for (s = 0; s < n.length; s += 3)
|
|
2239
|
-
if (t = n[s], i && (this[t] =
|
|
2240
|
+
if (t = n[s], i && (this[t] = me[t]), (e = r[t]) !== void 0)
|
|
2240
2241
|
if (F(e) === e && e >= n[s + 1] && e <= n[s + 2]) this[t] = e;
|
|
2241
|
-
else throw Error(
|
|
2242
|
-
if (t = "crypto", i && (this[t] =
|
|
2242
|
+
else throw Error(ht + t + ": " + e);
|
|
2243
|
+
if (t = "crypto", i && (this[t] = me[t]), (e = r[t]) !== void 0)
|
|
2243
2244
|
if (e === !0 || e === !1 || e === 0 || e === 1)
|
|
2244
2245
|
if (e)
|
|
2245
2246
|
if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
|
|
2246
2247
|
this[t] = !0;
|
|
2247
2248
|
else
|
|
2248
|
-
throw Error(
|
|
2249
|
+
throw Error(Ne);
|
|
2249
2250
|
else
|
|
2250
2251
|
this[t] = !1;
|
|
2251
2252
|
else
|
|
2252
|
-
throw Error(
|
|
2253
|
+
throw Error(ht + t + ": " + e);
|
|
2253
2254
|
return this;
|
|
2254
2255
|
}
|
|
2255
|
-
function
|
|
2256
|
+
function _i(r) {
|
|
2256
2257
|
return new this(r).cos();
|
|
2257
2258
|
}
|
|
2258
|
-
function
|
|
2259
|
+
function Mi(r) {
|
|
2259
2260
|
return new this(r).cosh();
|
|
2260
2261
|
}
|
|
2261
|
-
function
|
|
2262
|
+
function Ye(r) {
|
|
2262
2263
|
var s, t, e;
|
|
2263
2264
|
function i(n) {
|
|
2264
2265
|
var o, a, l, c = this;
|
|
2265
2266
|
if (!(c instanceof i)) return new i(n);
|
|
2266
|
-
if (c.constructor = i,
|
|
2267
|
-
c.s = n.s,
|
|
2267
|
+
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);
|
|
2268
2269
|
return;
|
|
2269
2270
|
}
|
|
2270
2271
|
if (l = typeof n, l === "number") {
|
|
@@ -2274,79 +2275,79 @@ function Ge(r) {
|
|
|
2274
2275
|
}
|
|
2275
2276
|
if (n < 0 ? (n = -n, c.s = -1) : c.s = 1, n === ~~n && n < 1e7) {
|
|
2276
2277
|
for (o = 0, a = n; a >= 10; a /= 10) o++;
|
|
2277
|
-
|
|
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]);
|
|
2278
2279
|
return;
|
|
2279
2280
|
}
|
|
2280
2281
|
if (n * 0 !== 0) {
|
|
2281
2282
|
n || (c.s = NaN), c.e = NaN, c.d = null;
|
|
2282
2283
|
return;
|
|
2283
2284
|
}
|
|
2284
|
-
return
|
|
2285
|
+
return Bt(c, n.toString());
|
|
2285
2286
|
}
|
|
2286
2287
|
if (l === "string")
|
|
2287
|
-
return (a = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (a === 43 && (n = n.slice(1)), c.s = 1),
|
|
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);
|
|
2288
2289
|
if (l === "bigint")
|
|
2289
|
-
return n < 0 ? (n = -n, c.s = -1) : c.s = 1,
|
|
2290
|
-
throw Error(
|
|
2290
|
+
return n < 0 ? (n = -n, c.s = -1) : c.s = 1, Bt(c, n.toString());
|
|
2291
|
+
throw Error(ht + n);
|
|
2291
2292
|
}
|
|
2292
|
-
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 =
|
|
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 = Gi, i.round = Ui, i.sign = Xi, i.sin = zi, 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)
|
|
2293
2294
|
for (e = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], s = 0; s < e.length; ) r.hasOwnProperty(t = e[s++]) || (r[t] = this[t]);
|
|
2294
2295
|
return i.config(r), i;
|
|
2295
2296
|
}
|
|
2296
|
-
function
|
|
2297
|
+
function Di(r, s) {
|
|
2297
2298
|
return new this(r).div(s);
|
|
2298
2299
|
}
|
|
2299
|
-
function
|
|
2300
|
+
function Ri(r) {
|
|
2300
2301
|
return new this(r).exp();
|
|
2301
2302
|
}
|
|
2302
|
-
function
|
|
2303
|
-
return
|
|
2303
|
+
function ki(r) {
|
|
2304
|
+
return C(r = new this(r), r.e + 1, 3);
|
|
2304
2305
|
}
|
|
2305
|
-
function
|
|
2306
|
+
function Vi() {
|
|
2306
2307
|
var r, s, t = new this(0);
|
|
2307
|
-
for (
|
|
2308
|
+
for (E = !1, r = 0; r < arguments.length; )
|
|
2308
2309
|
if (s = new this(arguments[r++]), s.d)
|
|
2309
2310
|
t.d && (t = t.plus(s.times(s)));
|
|
2310
2311
|
else {
|
|
2311
2312
|
if (s.s)
|
|
2312
|
-
return
|
|
2313
|
+
return E = !0, new this(1 / 0);
|
|
2313
2314
|
t = s;
|
|
2314
2315
|
}
|
|
2315
|
-
return
|
|
2316
|
+
return E = !0, t.sqrt();
|
|
2316
2317
|
}
|
|
2317
|
-
function
|
|
2318
|
-
return r instanceof
|
|
2318
|
+
function _e(r) {
|
|
2319
|
+
return r instanceof R || r && r.toStringTag === He || !1;
|
|
2319
2320
|
}
|
|
2320
|
-
function
|
|
2321
|
+
function Oi(r) {
|
|
2321
2322
|
return new this(r).ln();
|
|
2322
2323
|
}
|
|
2323
|
-
function
|
|
2324
|
+
function Ai(r, s) {
|
|
2324
2325
|
return new this(r).log(s);
|
|
2325
2326
|
}
|
|
2326
|
-
function
|
|
2327
|
+
function Li(r) {
|
|
2327
2328
|
return new this(r).log(2);
|
|
2328
2329
|
}
|
|
2329
|
-
function
|
|
2330
|
+
function Ti(r) {
|
|
2330
2331
|
return new this(r).log(10);
|
|
2331
2332
|
}
|
|
2332
|
-
function
|
|
2333
|
-
return
|
|
2333
|
+
function Ii() {
|
|
2334
|
+
return Ue(this, arguments, -1);
|
|
2334
2335
|
}
|
|
2335
|
-
function
|
|
2336
|
-
return
|
|
2336
|
+
function Ni() {
|
|
2337
|
+
return Ue(this, arguments, 1);
|
|
2337
2338
|
}
|
|
2338
|
-
function
|
|
2339
|
+
function Hi(r, s) {
|
|
2339
2340
|
return new this(r).mod(s);
|
|
2340
2341
|
}
|
|
2341
|
-
function
|
|
2342
|
+
function Fi(r, s) {
|
|
2342
2343
|
return new this(r).mul(s);
|
|
2343
2344
|
}
|
|
2344
|
-
function
|
|
2345
|
+
function Bi(r, s) {
|
|
2345
2346
|
return new this(r).pow(s);
|
|
2346
2347
|
}
|
|
2347
|
-
function
|
|
2348
|
+
function Gi(r) {
|
|
2348
2349
|
var s, t, e, i, n = 0, o = new this(1), a = [];
|
|
2349
|
-
if (r === void 0 ? r = this.precision :
|
|
2350
|
+
if (r === void 0 ? r = this.precision : U(r, 1, ut), e = Math.ceil(r / S), this.crypto)
|
|
2350
2351
|
if (crypto.getRandomValues)
|
|
2351
2352
|
for (s = crypto.getRandomValues(new Uint32Array(e)); n < e; )
|
|
2352
2353
|
i = s[n], i >= 429e7 ? s[n] = crypto.getRandomValues(new Uint32Array(1))[0] : a[n++] = i % 1e7;
|
|
@@ -2355,9 +2356,9 @@ function Hi(r) {
|
|
|
2355
2356
|
i = s[n] + (s[n + 1] << 8) + (s[n + 2] << 16) + ((s[n + 3] & 127) << 24), i >= 214e7 ? crypto.randomBytes(4).copy(s, n) : (a.push(i % 1e7), n += 4);
|
|
2356
2357
|
n = e / 4;
|
|
2357
2358
|
} else
|
|
2358
|
-
throw Error(
|
|
2359
|
+
throw Error(Ne);
|
|
2359
2360
|
else for (; n < e; ) a[n++] = Math.random() * 1e7 | 0;
|
|
2360
|
-
for (e = a[--n], r %= S, e && r && (i =
|
|
2361
|
+
for (e = a[--n], r %= S, e && r && (i = I(10, S - r), a[n] = (e / i | 0) * i); a[n] === 0; n--) a.pop();
|
|
2361
2362
|
if (n < 0)
|
|
2362
2363
|
t = 0, a = [0];
|
|
2363
2364
|
else {
|
|
@@ -2367,44 +2368,44 @@ function Hi(r) {
|
|
|
2367
2368
|
}
|
|
2368
2369
|
return o.e = t, o.d = a, o;
|
|
2369
2370
|
}
|
|
2370
|
-
function
|
|
2371
|
-
return
|
|
2371
|
+
function Ui(r) {
|
|
2372
|
+
return C(r = new this(r), r.e + 1, this.rounding);
|
|
2372
2373
|
}
|
|
2373
|
-
function
|
|
2374
|
+
function Xi(r) {
|
|
2374
2375
|
return r = new this(r), r.d ? r.d[0] ? r.s : 0 * r.s : r.s || NaN;
|
|
2375
2376
|
}
|
|
2376
|
-
function
|
|
2377
|
+
function zi(r) {
|
|
2377
2378
|
return new this(r).sin();
|
|
2378
2379
|
}
|
|
2379
|
-
function
|
|
2380
|
+
function Yi(r) {
|
|
2380
2381
|
return new this(r).sinh();
|
|
2381
2382
|
}
|
|
2382
|
-
function
|
|
2383
|
+
function ji(r) {
|
|
2383
2384
|
return new this(r).sqrt();
|
|
2384
2385
|
}
|
|
2385
|
-
function
|
|
2386
|
+
function Wi(r, s) {
|
|
2386
2387
|
return new this(r).sub(s);
|
|
2387
2388
|
}
|
|
2388
|
-
function
|
|
2389
|
+
function qi() {
|
|
2389
2390
|
var r = 0, s = arguments, t = new this(s[r]);
|
|
2390
|
-
for (
|
|
2391
|
-
return
|
|
2391
|
+
for (E = !1; t.s && ++r < s.length; ) t = t.plus(s[r]);
|
|
2392
|
+
return E = !0, C(t, this.precision, this.rounding);
|
|
2392
2393
|
}
|
|
2393
|
-
function
|
|
2394
|
+
function $i(r) {
|
|
2394
2395
|
return new this(r).tan();
|
|
2395
2396
|
}
|
|
2396
|
-
function
|
|
2397
|
+
function Zi(r) {
|
|
2397
2398
|
return new this(r).tanh();
|
|
2398
2399
|
}
|
|
2399
|
-
function
|
|
2400
|
-
return
|
|
2400
|
+
function Qi(r) {
|
|
2401
|
+
return C(r = new this(r), r.e + 1, 1);
|
|
2401
2402
|
}
|
|
2402
2403
|
v[Symbol.for("nodejs.util.inspect.custom")] = v.toString;
|
|
2403
2404
|
v[Symbol.toStringTag] = "Decimal";
|
|
2404
|
-
var
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
class
|
|
2405
|
+
var R = v.constructor = Ye(me);
|
|
2406
|
+
$t = new R($t);
|
|
2407
|
+
Zt = new R(Zt);
|
|
2408
|
+
class Ji {
|
|
2408
2409
|
constructor() {
|
|
2409
2410
|
/** 父级 */
|
|
2410
2411
|
d(this, "parent");
|
|
@@ -2434,7 +2435,7 @@ class $i {
|
|
|
2434
2435
|
this.mainCanvas = s;
|
|
2435
2436
|
}
|
|
2436
2437
|
}
|
|
2437
|
-
class
|
|
2438
|
+
class Ki extends Ji {
|
|
2438
2439
|
constructor() {
|
|
2439
2440
|
super(...arguments);
|
|
2440
2441
|
d(this, "_isVisible", !0);
|
|
@@ -2480,12 +2481,12 @@ class Zi extends $i {
|
|
|
2480
2481
|
return !0;
|
|
2481
2482
|
}
|
|
2482
2483
|
}
|
|
2483
|
-
let
|
|
2484
|
+
let ts = class extends Ki {
|
|
2484
2485
|
constructor(s) {
|
|
2485
|
-
super(), s.name = s.name ||
|
|
2486
|
+
super(), s.name = s.name || ue("default-name-"), Object.assign(this, { ...s });
|
|
2486
2487
|
}
|
|
2487
2488
|
};
|
|
2488
|
-
class
|
|
2489
|
+
class es extends ts {
|
|
2489
2490
|
constructor(t) {
|
|
2490
2491
|
super(t);
|
|
2491
2492
|
d(this, "_isInteractive", !0);
|
|
@@ -2564,7 +2565,7 @@ class Ji extends Qi {
|
|
|
2564
2565
|
return (this.parent ? this.parent[t] : !0) && e && (i ? this.isInteractive : !0);
|
|
2565
2566
|
}
|
|
2566
2567
|
}
|
|
2567
|
-
class
|
|
2568
|
+
class is {
|
|
2568
2569
|
constructor(s) {
|
|
2569
2570
|
d(this, "propagationStopped", !1);
|
|
2570
2571
|
this.data = s;
|
|
@@ -2576,7 +2577,7 @@ class Ki {
|
|
|
2576
2577
|
return !this.propagationStopped;
|
|
2577
2578
|
}
|
|
2578
2579
|
}
|
|
2579
|
-
class Vt extends
|
|
2580
|
+
class Vt extends es {
|
|
2580
2581
|
constructor() {
|
|
2581
2582
|
super(...arguments);
|
|
2582
2583
|
//#region 4. 添加事件管理器
|
|
@@ -2694,7 +2695,7 @@ class Vt extends Ji {
|
|
|
2694
2695
|
var c, h;
|
|
2695
2696
|
if (!this[n]) return;
|
|
2696
2697
|
this.updateStates(t, e);
|
|
2697
|
-
const o = new
|
|
2698
|
+
const o = new is(e);
|
|
2698
2699
|
this.listeners[t].forEach((u) => u(o, i));
|
|
2699
2700
|
const a = "notify" + (t.charAt(0).toUpperCase() + t.slice(1)), l = ["notifyDragg", "notifyWheel"].includes(a) ? e : e.state;
|
|
2700
2701
|
o.canPropagate && ((c = this.parent) == null || c[a](l, i)), (h = this.sharedControllers[t]) == null || h.forEach(
|
|
@@ -2750,7 +2751,7 @@ class Vt extends Ji {
|
|
|
2750
2751
|
}
|
|
2751
2752
|
//#region 6. 添加事件通知方法
|
|
2752
2753
|
}
|
|
2753
|
-
class
|
|
2754
|
+
class ss extends Vt {
|
|
2754
2755
|
constructor(t) {
|
|
2755
2756
|
super(t);
|
|
2756
2757
|
/** 画布元素 */
|
|
@@ -2873,12 +2874,12 @@ class ts extends Vt {
|
|
|
2873
2874
|
}
|
|
2874
2875
|
}, f = (g, y, w) => {
|
|
2875
2876
|
if (g !== void 0) {
|
|
2876
|
-
const
|
|
2877
|
-
if (
|
|
2877
|
+
const P = u.vertical(g, w);
|
|
2878
|
+
if (P !== void 0) return P;
|
|
2878
2879
|
}
|
|
2879
2880
|
if (y !== void 0) {
|
|
2880
|
-
const
|
|
2881
|
-
if (
|
|
2881
|
+
const P = u.reverse(y, w);
|
|
2882
|
+
if (P !== void 0) return P;
|
|
2882
2883
|
}
|
|
2883
2884
|
return w / 2;
|
|
2884
2885
|
}, m = f(a, l, o);
|
|
@@ -2907,7 +2908,7 @@ class ts extends Vt {
|
|
|
2907
2908
|
let l, c;
|
|
2908
2909
|
t === "center" ? (l = a.left + a.width / 2, c = a.top + a.height / 2) : [l, c] = [t.clientX, t.clientY];
|
|
2909
2910
|
const h = this.getMousePositionOnAxis({ clientX: l, clientY: c }), u = this.getAxisValueByPoint(h.x, h.y);
|
|
2910
|
-
this.scale = new
|
|
2911
|
+
this.scale = new R(this.scale).add(e).toNumber(), this.isScaleUpdated = !0, this.updateSize();
|
|
2911
2912
|
const f = this.getAxisPointByValue(
|
|
2912
2913
|
u.xV,
|
|
2913
2914
|
u.yV
|
|
@@ -2941,7 +2942,7 @@ class ts extends Vt {
|
|
|
2941
2942
|
*/
|
|
2942
2943
|
getGridSize(t) {
|
|
2943
2944
|
const { cycle: e, delta: i, axisConfig: n } = this;
|
|
2944
|
-
let o = new
|
|
2945
|
+
let o = new R(t).sub(1).abs().mod(e * i).div(i).toNumber();
|
|
2945
2946
|
return o = t < 1 && o != 0 ? e - o : o, Number(((o / e + 1) * n.min).toFixed(0));
|
|
2946
2947
|
}
|
|
2947
2948
|
/**
|
|
@@ -2953,11 +2954,11 @@ class ts extends Vt {
|
|
|
2953
2954
|
const { axisConfig: e, cycle: i, delta: n } = this, o = e.count, a = i * n;
|
|
2954
2955
|
if (t === 1) return o;
|
|
2955
2956
|
if (t > 1) {
|
|
2956
|
-
const l = new
|
|
2957
|
-
return new
|
|
2957
|
+
const l = new R(t).sub(1).div(a).floor();
|
|
2958
|
+
return new R(o).div(new R(2).pow(l)).toNumber();
|
|
2958
2959
|
} else {
|
|
2959
|
-
const l = new
|
|
2960
|
-
return new
|
|
2960
|
+
const l = new R(1).sub(t).div(a).ceil();
|
|
2961
|
+
return new R(o).mul(new R(2).pow(l)).toNumber();
|
|
2961
2962
|
}
|
|
2962
2963
|
}
|
|
2963
2964
|
/** 获取每个网格表示的数字 */
|
|
@@ -2980,7 +2981,7 @@ class ts extends Vt {
|
|
|
2980
2981
|
xV: t / n.min * n.count,
|
|
2981
2982
|
yV: e / n.min * n.count
|
|
2982
2983
|
};
|
|
2983
|
-
const o = this.getNowGridCount, a = new
|
|
2984
|
+
const o = this.getNowGridCount, a = new R(t).div(n.size).mul(o).toFixed(8), l = new R(e).div(n.size).mul(o).toFixed(8);
|
|
2984
2985
|
return { xV: Number(a), yV: Number(l) };
|
|
2985
2986
|
}
|
|
2986
2987
|
/** 通过坐标轴上的值 获取坐标轴上的点 */
|
|
@@ -2991,7 +2992,7 @@ class ts extends Vt {
|
|
|
2991
2992
|
x: t / n.count * n.min,
|
|
2992
2993
|
y: e / n.count * n.min
|
|
2993
2994
|
};
|
|
2994
|
-
const o = this.getNowGridCount, a = new
|
|
2995
|
+
const o = this.getNowGridCount, a = new R(t).div(o).mul(n.size).toFixed(3), l = new R(e).div(o).mul(n.size).toFixed(3);
|
|
2995
2996
|
return { x: Number(a), y: Number(l) };
|
|
2996
2997
|
}
|
|
2997
2998
|
/** 获取最大/小的 值 */
|
|
@@ -3021,7 +3022,7 @@ class ts extends Vt {
|
|
|
3021
3022
|
) : l(t);
|
|
3022
3023
|
}
|
|
3023
3024
|
}
|
|
3024
|
-
class
|
|
3025
|
+
class ns extends ss {
|
|
3025
3026
|
constructor(t) {
|
|
3026
3027
|
super(t);
|
|
3027
3028
|
/** 主题 */
|
|
@@ -3125,6 +3126,18 @@ class es extends ts {
|
|
|
3125
3126
|
width: 14,
|
|
3126
3127
|
fill: "#036933"
|
|
3127
3128
|
}
|
|
3129
|
+
},
|
|
3130
|
+
billboard: {
|
|
3131
|
+
stroke: {
|
|
3132
|
+
color: "#d03050",
|
|
3133
|
+
color_hover: "#d03050",
|
|
3134
|
+
width: 4,
|
|
3135
|
+
dash: !1,
|
|
3136
|
+
dashGap: [5, 10],
|
|
3137
|
+
dashOffset: 0,
|
|
3138
|
+
cap: "round",
|
|
3139
|
+
join: "round"
|
|
3140
|
+
}
|
|
3128
3141
|
}
|
|
3129
3142
|
},
|
|
3130
3143
|
dark: {
|
|
@@ -3223,6 +3236,18 @@ class es extends ts {
|
|
|
3223
3236
|
width: 14,
|
|
3224
3237
|
fill: "#7efbd1"
|
|
3225
3238
|
}
|
|
3239
|
+
},
|
|
3240
|
+
billboard: {
|
|
3241
|
+
stroke: {
|
|
3242
|
+
color: "#e88080",
|
|
3243
|
+
color_hover: "#e88080",
|
|
3244
|
+
width: 4,
|
|
3245
|
+
dash: !1,
|
|
3246
|
+
dashGap: [5, 10],
|
|
3247
|
+
dashOffset: 0,
|
|
3248
|
+
cap: "round",
|
|
3249
|
+
join: "round"
|
|
3250
|
+
}
|
|
3226
3251
|
}
|
|
3227
3252
|
}
|
|
3228
3253
|
});
|
|
@@ -3245,10 +3270,10 @@ class es extends ts {
|
|
|
3245
3270
|
setStyle(t) {
|
|
3246
3271
|
for (const e in t)
|
|
3247
3272
|
if (Object.prototype.hasOwnProperty.call(t, e)) {
|
|
3248
|
-
const i =
|
|
3273
|
+
const i = si(
|
|
3249
3274
|
this.style[e] || this.style[this.theme]
|
|
3250
3275
|
);
|
|
3251
|
-
|
|
3276
|
+
ct(i, t[e]), this.style[e] = i;
|
|
3252
3277
|
}
|
|
3253
3278
|
this.initStyle();
|
|
3254
3279
|
}
|
|
@@ -3257,7 +3282,7 @@ class es extends ts {
|
|
|
3257
3282
|
t in this.style && (this.theme = t, this.isThemeUpdated = !0);
|
|
3258
3283
|
}
|
|
3259
3284
|
}
|
|
3260
|
-
class
|
|
3285
|
+
class D extends Vt {
|
|
3261
3286
|
constructor(t) {
|
|
3262
3287
|
t = { ...t }, t.isDraggable = t.isDraggable ?? !1;
|
|
3263
3288
|
const { mainCanvas: e, notifyReload: i } = t;
|
|
@@ -3523,7 +3548,7 @@ class R extends Vt {
|
|
|
3523
3548
|
handleValuePosition(t, e) {
|
|
3524
3549
|
let { value: i, position: n, mainCanvas: o } = this;
|
|
3525
3550
|
if (!o) return !1;
|
|
3526
|
-
const a = t === "array1D" ?
|
|
3551
|
+
const a = t === "array1D" ? ve : qt, [l, c] = [
|
|
3527
3552
|
a(i) && (!e || i.length >= e),
|
|
3528
3553
|
a(n) && (!e || n.length >= e)
|
|
3529
3554
|
], h = {
|
|
@@ -3580,8 +3605,8 @@ class R extends Vt {
|
|
|
3580
3605
|
return this.isInteractive ? this.isDraggable ? "_nhanh_canvas_hover_overlay_draggable" : "_nhanh_canvas_hover_overlay" : void 0;
|
|
3581
3606
|
}
|
|
3582
3607
|
}
|
|
3583
|
-
d(
|
|
3584
|
-
class
|
|
3608
|
+
d(D, "ctx", document.createElement("canvas").getContext("2d"));
|
|
3609
|
+
class Gt extends D {
|
|
3585
3610
|
constructor(t) {
|
|
3586
3611
|
super(t);
|
|
3587
3612
|
d(this, "_draw");
|
|
@@ -3614,13 +3639,13 @@ class Bt extends R {
|
|
|
3614
3639
|
n[1],
|
|
3615
3640
|
!0
|
|
3616
3641
|
);
|
|
3617
|
-
e.push([o.x, o.y]), n[0] != 0 ? i = new
|
|
3642
|
+
e.push([o.x, o.y]), n[0] != 0 ? i = new R(o.x).div(n[0]).toNumber() : n[1] != 0 && (i = new R(o.y).div(n[1]).toNumber());
|
|
3618
3643
|
} else
|
|
3619
3644
|
e.push([
|
|
3620
3645
|
// this.mainCanvas!.preservePrecision(scale * item[0]),
|
|
3621
3646
|
// this.mainCanvas!.preservePrecision(scale * item[1]),
|
|
3622
|
-
new
|
|
3623
|
-
new
|
|
3647
|
+
new R(i).mul(n[0]).toNumber(),
|
|
3648
|
+
new R(i).mul(n[1]).toNumber()
|
|
3624
3649
|
]);
|
|
3625
3650
|
}), e;
|
|
3626
3651
|
}
|
|
@@ -3634,13 +3659,13 @@ class Bt extends R {
|
|
|
3634
3659
|
n[1],
|
|
3635
3660
|
!0
|
|
3636
3661
|
);
|
|
3637
|
-
e.push([a.xV, a.yV]), n[0] != 0 ? i = new
|
|
3662
|
+
e.push([a.xV, a.yV]), n[0] != 0 ? i = new R(a.xV).div(n[0]).toNumber() : n[1] != 0 && (i = new R(a.yV).div(n[1]).toNumber());
|
|
3638
3663
|
} else
|
|
3639
3664
|
e.push([
|
|
3640
3665
|
// this.mainCanvas!.preservePrecision(scale * item[0]),
|
|
3641
3666
|
// this.mainCanvas!.preservePrecision(scale * item[1]),
|
|
3642
|
-
new
|
|
3643
|
-
new
|
|
3667
|
+
new R(i).mul(n[0]).toNumber(),
|
|
3668
|
+
new R(i).mul(n[1]).toNumber()
|
|
3644
3669
|
]);
|
|
3645
3670
|
}), e;
|
|
3646
3671
|
}
|
|
@@ -3675,21 +3700,21 @@ class Bt extends R {
|
|
|
3675
3700
|
}
|
|
3676
3701
|
}
|
|
3677
3702
|
}
|
|
3678
|
-
class
|
|
3703
|
+
class k {
|
|
3679
3704
|
static add(s, t) {
|
|
3680
|
-
return new
|
|
3705
|
+
return new R(s).add(t).toNumber();
|
|
3681
3706
|
}
|
|
3682
3707
|
static sub(s, t) {
|
|
3683
|
-
return new
|
|
3708
|
+
return new R(s).sub(t).toNumber();
|
|
3684
3709
|
}
|
|
3685
3710
|
static mul(s, t) {
|
|
3686
|
-
return new
|
|
3711
|
+
return new R(s).mul(t).toNumber();
|
|
3687
3712
|
}
|
|
3688
3713
|
static div(s, t) {
|
|
3689
|
-
return new
|
|
3714
|
+
return new R(s).div(t).toNumber();
|
|
3690
3715
|
}
|
|
3691
3716
|
}
|
|
3692
|
-
class Ut extends
|
|
3717
|
+
class Ut extends D {
|
|
3693
3718
|
constructor(t) {
|
|
3694
3719
|
super(t);
|
|
3695
3720
|
/** 文字偏差 */
|
|
@@ -3701,16 +3726,16 @@ class Ut extends R {
|
|
|
3701
3726
|
this.internalUpdate(
|
|
3702
3727
|
{
|
|
3703
3728
|
value: [
|
|
3704
|
-
|
|
3705
|
-
|
|
3729
|
+
k.add(this.value[0], o.value),
|
|
3730
|
+
k.add(this.value[1], a.value)
|
|
3706
3731
|
],
|
|
3707
3732
|
position: [
|
|
3708
|
-
|
|
3709
|
-
|
|
3733
|
+
k.add(this.position[0], o.position),
|
|
3734
|
+
k.add(this.position[1], a.position)
|
|
3710
3735
|
],
|
|
3711
3736
|
dynamicPosition: [
|
|
3712
|
-
|
|
3713
|
-
|
|
3737
|
+
k.add(this.dynamicPosition[0], o.dynamicPosition),
|
|
3738
|
+
k.add(this.dynamicPosition[1], a.dynamicPosition)
|
|
3714
3739
|
]
|
|
3715
3740
|
},
|
|
3716
3741
|
!0
|
|
@@ -3738,7 +3763,7 @@ class Ut extends R {
|
|
|
3738
3763
|
});
|
|
3739
3764
|
}
|
|
3740
3765
|
isPointInPath(t, e) {
|
|
3741
|
-
return this.path ?
|
|
3766
|
+
return this.path ? D.ctx.isPointInPath(this.path, t, e) : !1;
|
|
3742
3767
|
}
|
|
3743
3768
|
isPointInStroke(t, e) {
|
|
3744
3769
|
return !1;
|
|
@@ -3747,7 +3772,7 @@ class Ut extends R {
|
|
|
3747
3772
|
if (!this.mainCanvas) return;
|
|
3748
3773
|
if (!this.text || this.text.length == 0)
|
|
3749
3774
|
return this.internalUpdate({ dynamicPosition: void 0 });
|
|
3750
|
-
const t =
|
|
3775
|
+
const t = D.ctx;
|
|
3751
3776
|
this.setOverlayStyles(t);
|
|
3752
3777
|
const e = t.measureText(this.text);
|
|
3753
3778
|
this.textOffset = {
|
|
@@ -3789,7 +3814,7 @@ class Ut extends R {
|
|
|
3789
3814
|
}
|
|
3790
3815
|
}
|
|
3791
3816
|
}
|
|
3792
|
-
class lt extends
|
|
3817
|
+
class lt extends D {
|
|
3793
3818
|
constructor(t) {
|
|
3794
3819
|
super(t);
|
|
3795
3820
|
d(this, "angle", 2 * Math.PI);
|
|
@@ -3799,16 +3824,16 @@ class lt extends R {
|
|
|
3799
3824
|
this.internalUpdate(
|
|
3800
3825
|
{
|
|
3801
3826
|
value: [
|
|
3802
|
-
|
|
3803
|
-
|
|
3827
|
+
k.add(this.value[0], o.value),
|
|
3828
|
+
k.add(this.value[1], a.value)
|
|
3804
3829
|
],
|
|
3805
3830
|
position: [
|
|
3806
|
-
|
|
3807
|
-
|
|
3831
|
+
k.add(this.position[0], o.position),
|
|
3832
|
+
k.add(this.position[1], a.position)
|
|
3808
3833
|
],
|
|
3809
3834
|
dynamicPosition: [
|
|
3810
|
-
|
|
3811
|
-
|
|
3835
|
+
k.add(this.dynamicPosition[0], o.dynamicPosition),
|
|
3836
|
+
k.add(this.dynamicPosition[1], a.dynamicPosition)
|
|
3812
3837
|
]
|
|
3813
3838
|
},
|
|
3814
3839
|
!0
|
|
@@ -3834,7 +3859,7 @@ class lt extends R {
|
|
|
3834
3859
|
cancelAndRestartAnimation(t, e, i) {
|
|
3835
3860
|
this.fillProgress.scheduleCallback();
|
|
3836
3861
|
let n = 0;
|
|
3837
|
-
this.fillProgress.scheduleCallback =
|
|
3862
|
+
this.fillProgress.scheduleCallback = Wt((o) => {
|
|
3838
3863
|
!this.fillProgress || !o || (this.fillProgress.progress += (o - n) * (t ? 1 : -1), n = o, this.fillProgress.progress = Math.min(
|
|
3839
3864
|
1,
|
|
3840
3865
|
Math.max(0, this.fillProgress.progress)
|
|
@@ -3846,7 +3871,7 @@ class lt extends R {
|
|
|
3846
3871
|
this.fillProgress = {
|
|
3847
3872
|
lineWidthOffset: 0,
|
|
3848
3873
|
progress: 0,
|
|
3849
|
-
scheduleCallback:
|
|
3874
|
+
scheduleCallback: Wt((i) => {
|
|
3850
3875
|
this.fillProgress && (this.fillProgress.progress = i, this.updateLineWidthOffset(t));
|
|
3851
3876
|
}, e)
|
|
3852
3877
|
};
|
|
@@ -3859,13 +3884,13 @@ class lt extends R {
|
|
|
3859
3884
|
e !== this.fillProgress.lineWidthOffset && (this.fillProgress.lineWidthOffset = e, (i = this.notifyReload) == null || i.call(this));
|
|
3860
3885
|
}
|
|
3861
3886
|
isPointInPath(t, e) {
|
|
3862
|
-
return this.path ?
|
|
3887
|
+
return this.path ? D.ctx.isPointInPath(this.path, t, e) : !1;
|
|
3863
3888
|
}
|
|
3864
3889
|
isPointInStroke(t, e) {
|
|
3865
3890
|
var i;
|
|
3866
3891
|
if (this.path && this.mainCanvas) {
|
|
3867
|
-
const { width: n } = this.setOverlayStyles(
|
|
3868
|
-
return ((i = this.fillProgress) == null ? void 0 : i.lineWidthOffset) == n ? !1 :
|
|
3892
|
+
const { width: n } = this.setOverlayStyles(D.ctx);
|
|
3893
|
+
return ((i = this.fillProgress) == null ? void 0 : i.lineWidthOffset) == n ? !1 : D.ctx.isPointInStroke(this.path, t, e);
|
|
3869
3894
|
}
|
|
3870
3895
|
return !1;
|
|
3871
3896
|
}
|
|
@@ -3905,7 +3930,7 @@ class lt extends R {
|
|
|
3905
3930
|
}
|
|
3906
3931
|
}
|
|
3907
3932
|
}
|
|
3908
|
-
class
|
|
3933
|
+
class je extends D {
|
|
3909
3934
|
constructor(t) {
|
|
3910
3935
|
super(t);
|
|
3911
3936
|
/** 控制点 */
|
|
@@ -3948,14 +3973,14 @@ class ze extends R {
|
|
|
3948
3973
|
const { offsetX: o, offsetY: a } = t.data, { x: l, y: c } = this.calculateOffset(o, a);
|
|
3949
3974
|
this.value.forEach((h, u) => {
|
|
3950
3975
|
this.value[u] = [
|
|
3951
|
-
|
|
3952
|
-
|
|
3976
|
+
k.add(this.value[u][0], l.value),
|
|
3977
|
+
k.add(this.value[u][1], c.value)
|
|
3953
3978
|
], this.position[u] = [
|
|
3954
|
-
|
|
3955
|
-
|
|
3979
|
+
k.add(this.position[u][0], l.position),
|
|
3980
|
+
k.add(this.position[u][1], c.position)
|
|
3956
3981
|
], this.dynamicPosition[u] = [
|
|
3957
|
-
|
|
3958
|
-
|
|
3982
|
+
k.add(this.dynamicPosition[u][0], l.dynamicPosition),
|
|
3983
|
+
k.add(this.dynamicPosition[u][1], c.dynamicPosition)
|
|
3959
3984
|
];
|
|
3960
3985
|
}), this.handlePoints.forEach((h, u) => {
|
|
3961
3986
|
h.internalUpdate({
|
|
@@ -4001,7 +4026,7 @@ class ze extends R {
|
|
|
4001
4026
|
tryCreateNewHandlePoint(t, e) {
|
|
4002
4027
|
var c;
|
|
4003
4028
|
if (!this.isPointInStroke(t, e)) return;
|
|
4004
|
-
const i = this.getExtendedDynamicPositions(), n =
|
|
4029
|
+
const i = this.getExtendedDynamicPositions(), n = rs([t, e], i);
|
|
4005
4030
|
if (n === -1) return;
|
|
4006
4031
|
const [o, a] = this.getAdjacentIndices(n), l = this.createNewHandlePoint(o, a);
|
|
4007
4032
|
this.insertHandlePoint(n, l), this.lockHandlePointCreationTemporarily(), (c = this.notifyReload) == null || c.call(this);
|
|
@@ -4022,13 +4047,13 @@ class ze extends R {
|
|
|
4022
4047
|
}
|
|
4023
4048
|
/** 创建新的控制点 */
|
|
4024
4049
|
createNewHandlePoint(t, e) {
|
|
4025
|
-
const i =
|
|
4050
|
+
const i = oe(
|
|
4026
4051
|
this.value[t],
|
|
4027
4052
|
this.value[e]
|
|
4028
|
-
), n =
|
|
4053
|
+
), n = oe(
|
|
4029
4054
|
this.position[t],
|
|
4030
4055
|
this.position[e]
|
|
4031
|
-
), o =
|
|
4056
|
+
), o = oe(
|
|
4032
4057
|
this.dynamicPosition[t],
|
|
4033
4058
|
this.dynamicPosition[e]
|
|
4034
4059
|
);
|
|
@@ -4100,12 +4125,12 @@ class ze extends R {
|
|
|
4100
4125
|
});
|
|
4101
4126
|
}
|
|
4102
4127
|
}
|
|
4103
|
-
function
|
|
4128
|
+
function rs(r, s, t = 10) {
|
|
4104
4129
|
if (s.length === 0) return 0;
|
|
4105
4130
|
if (s.length === 1) return 1;
|
|
4106
4131
|
let e = 1 / 0, i = -1;
|
|
4107
4132
|
for (let n = 0; n < s.length - 1; n++) {
|
|
4108
|
-
const o =
|
|
4133
|
+
const o = Rs(
|
|
4109
4134
|
r,
|
|
4110
4135
|
s[n],
|
|
4111
4136
|
s[n + 1]
|
|
@@ -4116,11 +4141,11 @@ function is(r, s, t = 10) {
|
|
|
4116
4141
|
}
|
|
4117
4142
|
return i;
|
|
4118
4143
|
}
|
|
4119
|
-
function
|
|
4120
|
-
const { x: t, y: e } =
|
|
4144
|
+
function oe(r, s) {
|
|
4145
|
+
const { x: t, y: e } = $e(...r, ...s);
|
|
4121
4146
|
return [t, e];
|
|
4122
4147
|
}
|
|
4123
|
-
class Xt extends
|
|
4148
|
+
class Xt extends je {
|
|
4124
4149
|
constructor(t) {
|
|
4125
4150
|
super(t);
|
|
4126
4151
|
d(this, "_isInfinite");
|
|
@@ -4144,7 +4169,7 @@ class Xt extends ze {
|
|
|
4144
4169
|
return !1;
|
|
4145
4170
|
}
|
|
4146
4171
|
isPointInStroke(t, e) {
|
|
4147
|
-
return this.path && this.mainCanvas ? (this.setOverlayStyles(
|
|
4172
|
+
return this.path && this.mainCanvas ? (this.setOverlayStyles(D.ctx), this.isDraggable && (D.ctx.lineWidth = Math.max(D.ctx.lineWidth, 20)), D.ctx.isPointInStroke(this.path, t, e)) : !1;
|
|
4148
4173
|
}
|
|
4149
4174
|
isPointInAnywhere(t, e) {
|
|
4150
4175
|
return ((n) => {
|
|
@@ -4161,7 +4186,7 @@ class Xt extends ze {
|
|
|
4161
4186
|
if (this.isInfinite) {
|
|
4162
4187
|
this.isRecalculate && this.updateDynamicPosition();
|
|
4163
4188
|
const { width: t, height: e } = this.mainCanvas.rect;
|
|
4164
|
-
return
|
|
4189
|
+
return os(
|
|
4165
4190
|
[0, 0],
|
|
4166
4191
|
[t, e],
|
|
4167
4192
|
this.finalDynamicPosition[0],
|
|
@@ -4182,7 +4207,7 @@ class Xt extends ze {
|
|
|
4182
4207
|
var o;
|
|
4183
4208
|
const e = this.mainCanvas, i = e.style[e.theme].line;
|
|
4184
4209
|
let n = {};
|
|
4185
|
-
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.line) || i : typeof this.style == "object" ? n =
|
|
4210
|
+
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.line) || i : typeof this.style == "object" ? n = ct(
|
|
4186
4211
|
JSON.parse(JSON.stringify(i)),
|
|
4187
4212
|
this.style
|
|
4188
4213
|
) : n = i, t && this.setBaseLineStyle(t, n.stroke), n;
|
|
@@ -4211,12 +4236,12 @@ class Xt extends ze {
|
|
|
4211
4236
|
const { rect: n } = e, [o, a] = i, l = [a[0] - o[0], a[1] - o[1]];
|
|
4212
4237
|
if (l[0] === 0 && l[1] === 0)
|
|
4213
4238
|
return console.error("重合点无法确定方向");
|
|
4214
|
-
const c =
|
|
4239
|
+
const c = Me(
|
|
4215
4240
|
o,
|
|
4216
4241
|
[-l[0], -l[1]],
|
|
4217
4242
|
n.width,
|
|
4218
4243
|
n.height
|
|
4219
|
-
), h =
|
|
4244
|
+
), h = Me(
|
|
4220
4245
|
a,
|
|
4221
4246
|
l,
|
|
4222
4247
|
n.width,
|
|
@@ -4231,7 +4256,7 @@ class Xt extends ze {
|
|
|
4231
4256
|
}
|
|
4232
4257
|
}
|
|
4233
4258
|
}
|
|
4234
|
-
function
|
|
4259
|
+
function Me(r, s, t, e) {
|
|
4235
4260
|
const [i, n] = r, [o, a] = s;
|
|
4236
4261
|
let l = 1 / 0;
|
|
4237
4262
|
if (o !== 0) {
|
|
@@ -4244,7 +4269,7 @@ function _e(r, s, t, e) {
|
|
|
4244
4269
|
}
|
|
4245
4270
|
return l === 1 / 0 ? r : [i + o * l, n + a * l];
|
|
4246
4271
|
}
|
|
4247
|
-
function
|
|
4272
|
+
function os(r, s, t, e) {
|
|
4248
4273
|
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 = [
|
|
4249
4274
|
[i, o],
|
|
4250
4275
|
// 左上
|
|
@@ -4268,7 +4293,7 @@ function ss(r, s, t, e) {
|
|
|
4268
4293
|
}
|
|
4269
4294
|
return m && p;
|
|
4270
4295
|
}
|
|
4271
|
-
class
|
|
4296
|
+
class zt extends je {
|
|
4272
4297
|
constructor(t) {
|
|
4273
4298
|
super(t);
|
|
4274
4299
|
d(this, "_isRect", !1);
|
|
@@ -4310,10 +4335,10 @@ class Gt extends ze {
|
|
|
4310
4335
|
this.initValueScope();
|
|
4311
4336
|
}
|
|
4312
4337
|
isPointInPath(t, e) {
|
|
4313
|
-
return this.path ?
|
|
4338
|
+
return this.path ? D.ctx.isPointInPath(this.path, t, e) : !1;
|
|
4314
4339
|
}
|
|
4315
4340
|
isPointInStroke(t, e) {
|
|
4316
|
-
return this.path && this.mainCanvas ? (this.setOverlayStyles(
|
|
4341
|
+
return this.path && this.mainCanvas ? (this.setOverlayStyles(D.ctx), this.isDraggable && (D.ctx.lineWidth = Math.max(D.ctx.lineWidth, 20)), D.ctx.isPointInStroke(this.path, t, e)) : !1;
|
|
4317
4342
|
}
|
|
4318
4343
|
isPointInAnywhere(t, e) {
|
|
4319
4344
|
return ((n) => {
|
|
@@ -4363,7 +4388,7 @@ class Gt extends ze {
|
|
|
4363
4388
|
var c;
|
|
4364
4389
|
const e = this.isHover, i = this.mainCanvas, n = i.style[i.theme].polygon;
|
|
4365
4390
|
let o = {};
|
|
4366
|
-
typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.polygon) || n : typeof this.style == "object" ? o =
|
|
4391
|
+
typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.polygon) || n : typeof this.style == "object" ? o = ct(
|
|
4367
4392
|
JSON.parse(JSON.stringify(n)),
|
|
4368
4393
|
this.style
|
|
4369
4394
|
) : o = n;
|
|
@@ -4405,7 +4430,7 @@ class Gt extends ze {
|
|
|
4405
4430
|
}
|
|
4406
4431
|
}
|
|
4407
4432
|
}
|
|
4408
|
-
class
|
|
4433
|
+
class Yt extends D {
|
|
4409
4434
|
constructor(t) {
|
|
4410
4435
|
super(t);
|
|
4411
4436
|
d(this, "_isFill", !1);
|
|
@@ -4437,16 +4462,16 @@ class fe extends R {
|
|
|
4437
4462
|
u.internalUpdate(
|
|
4438
4463
|
{
|
|
4439
4464
|
value: [
|
|
4440
|
-
|
|
4441
|
-
|
|
4465
|
+
k.add(u.value[0], a.value),
|
|
4466
|
+
k.add(u.value[1], l.value)
|
|
4442
4467
|
],
|
|
4443
4468
|
position: [
|
|
4444
|
-
|
|
4445
|
-
|
|
4469
|
+
k.add(u.position[0], a.position),
|
|
4470
|
+
k.add(u.position[1], l.position)
|
|
4446
4471
|
],
|
|
4447
4472
|
dynamicPosition: [
|
|
4448
|
-
|
|
4449
|
-
|
|
4473
|
+
k.add(u.dynamicPosition[0], a.dynamicPosition),
|
|
4474
|
+
k.add(u.dynamicPosition[1], l.dynamicPosition)
|
|
4450
4475
|
]
|
|
4451
4476
|
},
|
|
4452
4477
|
!0
|
|
@@ -4577,10 +4602,10 @@ class fe extends R {
|
|
|
4577
4602
|
}));
|
|
4578
4603
|
}
|
|
4579
4604
|
isPointInPath(t, e) {
|
|
4580
|
-
return this.isFill && this.path ?
|
|
4605
|
+
return this.isFill && this.path ? D.ctx.isPointInPath(this.path, t, e) : !1;
|
|
4581
4606
|
}
|
|
4582
4607
|
isPointInStroke(t, e) {
|
|
4583
|
-
return this.path && this.mainCanvas ? (this.setOverlayStyles(
|
|
4608
|
+
return this.path && this.mainCanvas ? (this.setOverlayStyles(D.ctx), this.isDraggable && (D.ctx.lineWidth = Math.max(D.ctx.lineWidth, 20)), D.ctx.isPointInStroke(this.path, t, e)) : !1;
|
|
4584
4609
|
}
|
|
4585
4610
|
isPointInAnywhere(t, e) {
|
|
4586
4611
|
return ((n) => {
|
|
@@ -4599,7 +4624,7 @@ class fe extends R {
|
|
|
4599
4624
|
var c;
|
|
4600
4625
|
const e = this.isHover, i = this.mainCanvas, n = i.style[i.theme].arc;
|
|
4601
4626
|
let o = {};
|
|
4602
|
-
typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.arc) || n : typeof this.style == "object" ? o =
|
|
4627
|
+
typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.arc) || n : typeof this.style == "object" ? o = ct(
|
|
4603
4628
|
JSON.parse(JSON.stringify(n)),
|
|
4604
4629
|
this.style
|
|
4605
4630
|
) : o = n;
|
|
@@ -4629,7 +4654,7 @@ class fe extends R {
|
|
|
4629
4654
|
offset: c
|
|
4630
4655
|
} = this;
|
|
4631
4656
|
if (!t || !a || !l) return;
|
|
4632
|
-
const [h, u] =
|
|
4657
|
+
const [h, u] = as(
|
|
4633
4658
|
...e,
|
|
4634
4659
|
i,
|
|
4635
4660
|
n,
|
|
@@ -4643,8 +4668,8 @@ class fe extends R {
|
|
|
4643
4668
|
isDraggable: !0,
|
|
4644
4669
|
mainCanvas: this.mainCanvas,
|
|
4645
4670
|
notifyReload: () => {
|
|
4646
|
-
var
|
|
4647
|
-
return (
|
|
4671
|
+
var P;
|
|
4672
|
+
return (P = this.notifyReload) == null ? void 0 : P.call(this);
|
|
4648
4673
|
}
|
|
4649
4674
|
}), m = this.handlePoints.start || f("start"), p = this.handlePoints.end || f("end"), g = this.handlePoints.radius || f("radius");
|
|
4650
4675
|
m.value = h, p.value = u;
|
|
@@ -4733,14 +4758,14 @@ class fe extends R {
|
|
|
4733
4758
|
}
|
|
4734
4759
|
}
|
|
4735
4760
|
}
|
|
4736
|
-
function
|
|
4761
|
+
function as(r, s, t, e, i, n = 1, o = 1) {
|
|
4737
4762
|
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;
|
|
4738
4763
|
return [
|
|
4739
4764
|
[a, l],
|
|
4740
4765
|
[c, h]
|
|
4741
4766
|
];
|
|
4742
4767
|
}
|
|
4743
|
-
class
|
|
4768
|
+
class jt extends D {
|
|
4744
4769
|
constructor(t) {
|
|
4745
4770
|
super(t);
|
|
4746
4771
|
/** 控制点 */
|
|
@@ -4805,7 +4830,7 @@ class me extends R {
|
|
|
4805
4830
|
return !1;
|
|
4806
4831
|
}
|
|
4807
4832
|
isPointInStroke(t, e) {
|
|
4808
|
-
return this.path && this.mainCanvas ? (this.setOverlayStyles(
|
|
4833
|
+
return this.path && this.mainCanvas ? (this.setOverlayStyles(D.ctx), this.isDraggable && (D.ctx.lineWidth = Math.max(D.ctx.lineWidth, 20)), D.ctx.isPointInStroke(this.path, t, e)) : !1;
|
|
4809
4834
|
}
|
|
4810
4835
|
isPointInAnywhere(t, e) {
|
|
4811
4836
|
return ((n) => {
|
|
@@ -4825,7 +4850,7 @@ class me extends R {
|
|
|
4825
4850
|
var o;
|
|
4826
4851
|
const e = this.mainCanvas, i = e.style[e.theme].arcTo;
|
|
4827
4852
|
let n = {};
|
|
4828
|
-
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.arcTo) || i : typeof this.style == "object" ? n =
|
|
4853
|
+
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.arcTo) || i : typeof this.style == "object" ? n = ct(
|
|
4829
4854
|
JSON.parse(JSON.stringify(i)),
|
|
4830
4855
|
this.style
|
|
4831
4856
|
) : n = i, t && this.setBaseLineStyle(t, n.stroke), n;
|
|
@@ -4864,8 +4889,8 @@ class me extends R {
|
|
|
4864
4889
|
if (!this.mainCanvas) return;
|
|
4865
4890
|
let { value: t, position: e } = this;
|
|
4866
4891
|
const [i, n] = [
|
|
4867
|
-
|
|
4868
|
-
|
|
4892
|
+
qt(t) && t.length > 1,
|
|
4893
|
+
qt(e) && e.length > 1
|
|
4869
4894
|
];
|
|
4870
4895
|
if (!i && !n)
|
|
4871
4896
|
return this.handlePoints = void 0, this.internalUpdate({ dynamicPosition: void 0 });
|
|
@@ -4907,7 +4932,7 @@ class me extends R {
|
|
|
4907
4932
|
}
|
|
4908
4933
|
}
|
|
4909
4934
|
}
|
|
4910
|
-
class
|
|
4935
|
+
class ls extends ns {
|
|
4911
4936
|
constructor(t) {
|
|
4912
4937
|
super(t);
|
|
4913
4938
|
/** 监听元素大小 */
|
|
@@ -4924,7 +4949,7 @@ class rs extends es {
|
|
|
4924
4949
|
maxYV: 0
|
|
4925
4950
|
});
|
|
4926
4951
|
/** 测量重绘性能 */
|
|
4927
|
-
d(this, "measureRedrawPerformance",
|
|
4952
|
+
d(this, "measureRedrawPerformance", ni(
|
|
4928
4953
|
() => {
|
|
4929
4954
|
this.isRendering = !0, this.redraw(), this.redrawInNextRenderFrame = !1, this.isRendering = !1;
|
|
4930
4955
|
},
|
|
@@ -4937,7 +4962,7 @@ class rs extends es {
|
|
|
4937
4962
|
}
|
|
4938
4963
|
));
|
|
4939
4964
|
this.canvas && (this.resizeObserver = new ResizeObserver(
|
|
4940
|
-
|
|
4965
|
+
Le(() => {
|
|
4941
4966
|
[this.canvas.width, this.canvas.height] = [
|
|
4942
4967
|
this.rect.width,
|
|
4943
4968
|
this.rect.height
|
|
@@ -4984,7 +5009,7 @@ class rs extends es {
|
|
|
4984
5009
|
if (a !== h) return h - a;
|
|
4985
5010
|
if (l !== u)
|
|
4986
5011
|
return u - l;
|
|
4987
|
-
const m = (p) => p instanceof
|
|
5012
|
+
const m = (p) => p instanceof Gt ? 5 : p instanceof Ut ? 4 : p instanceof lt ? 3 : p instanceof Xt || p instanceof Yt || p instanceof jt ? 2 : p instanceof zt ? 1 : 0;
|
|
4988
5013
|
return m(f) - m(c);
|
|
4989
5014
|
}
|
|
4990
5015
|
), this.currentDrawOverlays = t.map(
|
|
@@ -5019,7 +5044,7 @@ class rs extends es {
|
|
|
5019
5044
|
(t = this.resizeObserver) == null || t.disconnect();
|
|
5020
5045
|
}
|
|
5021
5046
|
}
|
|
5022
|
-
class
|
|
5047
|
+
class cs extends ls {
|
|
5023
5048
|
constructor(t) {
|
|
5024
5049
|
super(t);
|
|
5025
5050
|
/** 鼠标是否在画布内 */
|
|
@@ -5122,16 +5147,16 @@ class os extends rs {
|
|
|
5122
5147
|
keydown(t) {
|
|
5123
5148
|
const { mouseInCanvas: e, offset: i, delta: n, axisConfig: o } = this, a = t.key;
|
|
5124
5149
|
if (!e || !this.isDraggable || this.isAuto) return;
|
|
5125
|
-
const l = this.getStep(a), c = this.lastClickedOverlay, u = (c == null ? void 0 : c.isDraggable) && this.currentDrawOverlays.includes(c) && (
|
|
5150
|
+
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) => {
|
|
5126
5151
|
if (!u)
|
|
5127
5152
|
return i.x += y * l, i.y += w * l, !0;
|
|
5128
|
-
const
|
|
5153
|
+
const P = this.getAxisValueByPoint(l, 0).xV, [b, _] = [P * o.x, P * o.y];
|
|
5129
5154
|
if (u === "Single") {
|
|
5130
5155
|
const A = c.value;
|
|
5131
|
-
A[0] += y *
|
|
5156
|
+
A[0] += y * b, A[1] += w * _;
|
|
5132
5157
|
} else
|
|
5133
5158
|
c.value.forEach((A) => {
|
|
5134
|
-
A[0] += y *
|
|
5159
|
+
A[0] += y * b, A[1] += w * _;
|
|
5135
5160
|
});
|
|
5136
5161
|
return c.value = [...c.value], !0;
|
|
5137
5162
|
}, m = (y) => (this.setScale("center", y * n), !0), g = {
|
|
@@ -5243,17 +5268,17 @@ class os extends rs {
|
|
|
5243
5268
|
} else if (e.length === 2) {
|
|
5244
5269
|
const { clientX: h, clientY: u } = e[0], { clientX: f, clientY: m } = e[1];
|
|
5245
5270
|
if (i.length == 2) {
|
|
5246
|
-
const p =
|
|
5271
|
+
const p = De(
|
|
5247
5272
|
i[0],
|
|
5248
5273
|
n[0],
|
|
5249
5274
|
i[1],
|
|
5250
5275
|
n[1]
|
|
5251
|
-
), g =
|
|
5276
|
+
), g = De(
|
|
5252
5277
|
h,
|
|
5253
5278
|
u,
|
|
5254
5279
|
f,
|
|
5255
5280
|
m
|
|
5256
|
-
), { x: y, y: w } =
|
|
5281
|
+
), { x: y, y: w } = $e(
|
|
5257
5282
|
h,
|
|
5258
5283
|
u,
|
|
5259
5284
|
f,
|
|
@@ -5274,7 +5299,7 @@ class os extends rs {
|
|
|
5274
5299
|
super.destroy(), (t = this.unBind) == null || t.call(this);
|
|
5275
5300
|
}
|
|
5276
5301
|
}
|
|
5277
|
-
class
|
|
5302
|
+
class Y extends Vt {
|
|
5278
5303
|
constructor(t) {
|
|
5279
5304
|
super(t);
|
|
5280
5305
|
/** 覆盖物集合 */
|
|
@@ -5297,7 +5322,7 @@ class et extends Vt {
|
|
|
5297
5322
|
);
|
|
5298
5323
|
}
|
|
5299
5324
|
/** 添加覆盖物 */
|
|
5300
|
-
|
|
5325
|
+
addOverlay(t) {
|
|
5301
5326
|
var e;
|
|
5302
5327
|
[t].flat().forEach((i) => {
|
|
5303
5328
|
i.setNotifyReload(this.notifyReload), i.setMainCanvas(this.mainCanvas), i.parent = this, this.overlays.add(i);
|
|
@@ -5308,14 +5333,14 @@ class et extends Vt {
|
|
|
5308
5333
|
return this.overlays.has(t);
|
|
5309
5334
|
}
|
|
5310
5335
|
/** 移除覆盖物 */
|
|
5311
|
-
|
|
5336
|
+
removeOverlay(t) {
|
|
5312
5337
|
var e;
|
|
5313
5338
|
[t].flat().forEach((i) => {
|
|
5314
5339
|
this.overlays.delete(i), i.setNotifyReload(), i.setMainCanvas(), i.parent = void 0;
|
|
5315
5340
|
}), (e = this.notifyReload) == null || e.call(this);
|
|
5316
5341
|
}
|
|
5317
5342
|
/** 清空覆盖物 */
|
|
5318
|
-
|
|
5343
|
+
clearOverlay() {
|
|
5319
5344
|
var t;
|
|
5320
5345
|
(t = this.notifyReload) == null || t.call(this), this.overlays.forEach((e) => {
|
|
5321
5346
|
e.setNotifyReload(), e.setMainCanvas(), e.parent = void 0;
|
|
@@ -5333,7 +5358,7 @@ class et extends Vt {
|
|
|
5333
5358
|
}), t;
|
|
5334
5359
|
}
|
|
5335
5360
|
}
|
|
5336
|
-
class
|
|
5361
|
+
class j extends Vt {
|
|
5337
5362
|
constructor(t) {
|
|
5338
5363
|
super(t);
|
|
5339
5364
|
d(this, "_zIndex", 4);
|
|
@@ -5379,7 +5404,7 @@ class it extends Vt {
|
|
|
5379
5404
|
/** 添加覆盖物组 */
|
|
5380
5405
|
addGroup(t) {
|
|
5381
5406
|
[t].flat().forEach((e) => {
|
|
5382
|
-
e instanceof
|
|
5407
|
+
e instanceof Y && (this.setGroupNotifyReload(e), e.setMainCanvas(this.mainCanvas), e.parent = this, this.groups.set(e.name, e));
|
|
5383
5408
|
});
|
|
5384
5409
|
}
|
|
5385
5410
|
/** 移除覆盖物组 */
|
|
@@ -5387,7 +5412,7 @@ class it extends Vt {
|
|
|
5387
5412
|
var i;
|
|
5388
5413
|
let e = !1;
|
|
5389
5414
|
[t].flat().forEach((n) => {
|
|
5390
|
-
n instanceof
|
|
5415
|
+
n instanceof Y && (this.groups.delete(n.name), n.setNotifyReload(), n.setMainCanvas(), n.parent = void 0, e = !0);
|
|
5391
5416
|
}), e && ((i = this.notifyReload) == null || i.call(this));
|
|
5392
5417
|
}
|
|
5393
5418
|
/** 清空覆盖物 */
|
|
@@ -5449,7 +5474,7 @@ class Rt extends Vt {
|
|
|
5449
5474
|
/** 添加图层 */
|
|
5450
5475
|
addLayer(t) {
|
|
5451
5476
|
[t].flat().forEach((e) => {
|
|
5452
|
-
e instanceof
|
|
5477
|
+
e instanceof j && (e.setNotifyReload(this.notifyReload), e.setMainCanvas(this.mainCanvas), e.parent = this, this.layers.set(e.name, e));
|
|
5453
5478
|
});
|
|
5454
5479
|
}
|
|
5455
5480
|
/** 删除图层 */
|
|
@@ -5457,11 +5482,11 @@ class Rt extends Vt {
|
|
|
5457
5482
|
var i;
|
|
5458
5483
|
let e = !1;
|
|
5459
5484
|
[t].flat().forEach((n) => {
|
|
5460
|
-
n instanceof
|
|
5485
|
+
n instanceof j && (this.layers.delete(n.name), n.setNotifyReload(), n.setMainCanvas(), n.parent = void 0, e = !0);
|
|
5461
5486
|
}), e && ((i = this.notifyReload) == null || i.call(this));
|
|
5462
5487
|
}
|
|
5463
5488
|
/** 清空图层 */
|
|
5464
|
-
|
|
5489
|
+
clearLayer() {
|
|
5465
5490
|
var t;
|
|
5466
5491
|
this.layers.size && (this.layers.forEach((e) => {
|
|
5467
5492
|
e.setNotifyReload(), e.setMainCanvas(), e.parent = void 0;
|
|
@@ -5482,19 +5507,21 @@ class Rt extends Vt {
|
|
|
5482
5507
|
return [];
|
|
5483
5508
|
}
|
|
5484
5509
|
}
|
|
5485
|
-
class
|
|
5510
|
+
class hs extends cs {
|
|
5486
5511
|
/** 获取默认覆盖物群组 */
|
|
5487
5512
|
getDefaultOverlayGroup() {
|
|
5488
|
-
var
|
|
5513
|
+
var c, h, u, f, m, p, g;
|
|
5489
5514
|
const s = this.layerGroups.get("默认图层群组");
|
|
5490
5515
|
if (!s) return;
|
|
5491
|
-
const t = (
|
|
5516
|
+
const t = (c = s.getLayer("点位图层")) == null ? void 0 : c.getGroup("点位覆盖物群组"), e = (h = s.getLayer("线段图层")) == null ? void 0 : h.getGroup("线段覆盖物群组"), i = (u = s.getLayer("多边形图层")) == null ? void 0 : u.getGroup("多边形覆盖物群组"), n = (f = s.getLayer("文字图层")) == null ? void 0 : f.getGroup("文字覆盖物群组"), o = (m = s.getLayer("自定义绘制图层")) == null ? void 0 : m.getGroup("自定义绘制覆盖物群组"), a = (p = s.getLayer("图片图层")) == null ? void 0 : p.getGroup("图片覆盖物群组"), l = (g = s.getLayer("其他图层")) == null ? void 0 : g.getGroup("其他覆盖物群组");
|
|
5492
5517
|
return {
|
|
5493
5518
|
overlays_text: n,
|
|
5494
5519
|
overlays_point: t,
|
|
5495
5520
|
overlays_line: e,
|
|
5496
5521
|
overlays_polygon: i,
|
|
5497
|
-
overlays_custom: o
|
|
5522
|
+
overlays_custom: o,
|
|
5523
|
+
overlays_billboard: a,
|
|
5524
|
+
overlays_other: l
|
|
5498
5525
|
};
|
|
5499
5526
|
}
|
|
5500
5527
|
/**
|
|
@@ -5508,10 +5535,10 @@ class as extends os {
|
|
|
5508
5535
|
if (i instanceof Rt) {
|
|
5509
5536
|
if (!i.isVisible) continue;
|
|
5510
5537
|
e.push(...i.layers.values());
|
|
5511
|
-
} else if (i instanceof
|
|
5538
|
+
} else if (i instanceof j) {
|
|
5512
5539
|
if (!i.isVisible) continue;
|
|
5513
5540
|
e.push(...i.groups.values());
|
|
5514
|
-
} else if (i instanceof
|
|
5541
|
+
} else if (i instanceof Y) {
|
|
5515
5542
|
if (!i.isVisible) continue;
|
|
5516
5543
|
e.push(...i.overlays.values());
|
|
5517
5544
|
} else
|
|
@@ -5520,7 +5547,7 @@ class as extends os {
|
|
|
5520
5547
|
return t;
|
|
5521
5548
|
}
|
|
5522
5549
|
}
|
|
5523
|
-
class
|
|
5550
|
+
class us extends hs {
|
|
5524
5551
|
/** 缩放画布 */
|
|
5525
5552
|
zoom(s) {
|
|
5526
5553
|
const { canvas: t, rect: e } = this;
|
|
@@ -5553,7 +5580,7 @@ class ls extends as {
|
|
|
5553
5580
|
super.setDefaultCenter(s), this.redrawOnce();
|
|
5554
5581
|
}
|
|
5555
5582
|
}
|
|
5556
|
-
class
|
|
5583
|
+
class ds extends us {
|
|
5557
5584
|
/**
|
|
5558
5585
|
* 调整视图以适应指定覆盖层
|
|
5559
5586
|
* @param overlays 目标覆盖层数组,默认使用全部可见覆盖层
|
|
@@ -5608,16 +5635,16 @@ class cs extends ls {
|
|
|
5608
5635
|
const { cycle: n, delta: o, axisConfig: a, rect: l } = this, { width: c, height: h } = l, u = Math.max(0, c - e[1] - e[3]) || c, f = Math.max(0, h - e[0] - e[2]) || h;
|
|
5609
5636
|
if (u <= 0 || f <= 0)
|
|
5610
5637
|
return console.warn("无效的可视区域尺寸,边距设置可能不合理"), this.scale;
|
|
5611
|
-
const m = s / u, p = t / f, g = Math.max(m, p), y = a.count, w = y / a.min,
|
|
5612
|
-
let
|
|
5638
|
+
const m = s / u, p = t / f, g = Math.max(m, p), y = a.count, w = y / a.min, P = n * o;
|
|
5639
|
+
let b;
|
|
5613
5640
|
if (g > w) {
|
|
5614
|
-
const
|
|
5615
|
-
|
|
5641
|
+
const _ = Math.ceil(g / w);
|
|
5642
|
+
b = 1 - ((y * _ / g - a.min) / a.min + (_ - 2)) * P;
|
|
5616
5643
|
} else {
|
|
5617
|
-
const
|
|
5618
|
-
|
|
5644
|
+
const _ = (dt, rt, vt) => dt < rt ? vt - 1 : _(dt / 2, rt, vt + 1), A = _(w, g, 0), X = Math.pow(2, A);
|
|
5645
|
+
b = 1 + ((y / X / g - a.min) / a.min + A) * P;
|
|
5619
5646
|
}
|
|
5620
|
-
return i !== void 0 && (
|
|
5647
|
+
return i !== void 0 && (b = Math.min(i, b)), b = new R(b).div(o).round().mul(o).toNumber(), b;
|
|
5621
5648
|
}
|
|
5622
5649
|
/** 计算目标位置偏移 */
|
|
5623
5650
|
calculateOffsetDifference(s, t, e, i, n) {
|
|
@@ -5665,13 +5692,13 @@ class cs extends ls {
|
|
|
5665
5692
|
animateScale(s, t, e, i) {
|
|
5666
5693
|
const n = t - s;
|
|
5667
5694
|
let o = 0;
|
|
5668
|
-
|
|
5695
|
+
Wt((a) => {
|
|
5669
5696
|
!this.isAuto || !this.canvas || !this.isInteractive || (this.setScale("center", (a - o) * n), o = a, this.redrawOnce(), a === 1 && i());
|
|
5670
5697
|
}, e);
|
|
5671
5698
|
}
|
|
5672
5699
|
/** 执行偏移动画 */
|
|
5673
5700
|
animateOffset(s, t, e, i) {
|
|
5674
|
-
|
|
5701
|
+
Wt((n) => {
|
|
5675
5702
|
!this.isAuto || !this.canvas || !this.isInteractive || (this.offset = {
|
|
5676
5703
|
x: Number((s.x + t.x * n).toFixed(0)),
|
|
5677
5704
|
y: Number((s.y + t.y * n).toFixed(0))
|
|
@@ -5696,7 +5723,7 @@ class cs extends ls {
|
|
|
5696
5723
|
});
|
|
5697
5724
|
}
|
|
5698
5725
|
}
|
|
5699
|
-
class
|
|
5726
|
+
class fs extends ds {
|
|
5700
5727
|
/** 开关坐标轴 */
|
|
5701
5728
|
toggleAxis(s) {
|
|
5702
5729
|
this.drawAxis.toggleAxis(s), this.redrawOnce();
|
|
@@ -5721,7 +5748,7 @@ class hs extends cs {
|
|
|
5721
5748
|
return this.isInteractive = s ?? !this.isInteractive, this.isInteractive;
|
|
5722
5749
|
}
|
|
5723
5750
|
}
|
|
5724
|
-
class
|
|
5751
|
+
class ms extends fs {
|
|
5725
5752
|
/**
|
|
5726
5753
|
* 清除指定区域的像素点
|
|
5727
5754
|
* @param ctx - Canvas 2D绘图上下文
|
|
@@ -5732,9 +5759,9 @@ class us extends hs {
|
|
|
5732
5759
|
s.save(), s.beginPath(), s.clip(t), s.clearRect(0, 0, e, i), s.restore();
|
|
5733
5760
|
}
|
|
5734
5761
|
}
|
|
5735
|
-
class
|
|
5762
|
+
class gs extends ms {
|
|
5736
5763
|
}
|
|
5737
|
-
class
|
|
5764
|
+
class ps {
|
|
5738
5765
|
constructor(s) {
|
|
5739
5766
|
/** 画布 */
|
|
5740
5767
|
d(this, "canvas");
|
|
@@ -5847,35 +5874,39 @@ class fs {
|
|
|
5847
5874
|
let g = i.y + f + u;
|
|
5848
5875
|
g = Math.max(Math.min(g, c - u), u + f);
|
|
5849
5876
|
const y = i.y > c || i.y < 0;
|
|
5850
|
-
let w = i.x > 0 ? i.x % p : i.x < 0 ? p + i.x % p : 0,
|
|
5877
|
+
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;
|
|
5851
5878
|
for (; w <= l; ) {
|
|
5852
|
-
const
|
|
5853
|
-
|
|
5879
|
+
const b = le(P), _ = h(b);
|
|
5880
|
+
P !== 0 && this.drawText(b, w - _ / 2, g, y), w += p, P = new R(m).mul(n.x).add(P).toNumber();
|
|
5854
5881
|
}
|
|
5855
5882
|
}
|
|
5856
5883
|
{
|
|
5857
5884
|
const g = i.x > l || i.x < 0;
|
|
5858
5885
|
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;
|
|
5859
5886
|
for (; y <= c; ) {
|
|
5860
|
-
const
|
|
5861
|
-
let
|
|
5862
|
-
|
|
5887
|
+
const P = le(w), b = h(P);
|
|
5888
|
+
let _ = i.x - b - u;
|
|
5889
|
+
_ = 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();
|
|
5863
5890
|
}
|
|
5864
5891
|
}
|
|
5865
5892
|
}
|
|
5866
5893
|
}
|
|
5867
|
-
class
|
|
5894
|
+
class vs {
|
|
5868
5895
|
constructor(s) {
|
|
5869
5896
|
/** 绑定的画布实例 */
|
|
5870
5897
|
d(this, "canvas");
|
|
5871
|
-
d(this, "layerGroup", new
|
|
5898
|
+
d(this, "layerGroup", new T.LayerGroup({
|
|
5899
|
+
name: "创建覆盖物图层群组"
|
|
5900
|
+
}));
|
|
5872
5901
|
/** 创建中覆盖物的绘制层(置顶以保证可见) */
|
|
5873
|
-
d(this, "overlayLayer", new
|
|
5902
|
+
d(this, "overlayLayer", new T.Layer({
|
|
5874
5903
|
name: "creator-layer",
|
|
5875
5904
|
zIndex: 9999
|
|
5876
5905
|
}));
|
|
5877
5906
|
/** 该层内的覆盖物分组,便于统一增删 */
|
|
5878
|
-
d(this, "overlayGroup", new
|
|
5907
|
+
d(this, "overlayGroup", new T.OverlayGroup({
|
|
5908
|
+
name: "creator-group"
|
|
5909
|
+
}));
|
|
5879
5910
|
/** 当前正在创建的覆盖物(多边形或线),其顶点通过 overlay.value 即坐标轴上的值表示 */
|
|
5880
5911
|
d(this, "overlay");
|
|
5881
5912
|
/** 已确定的顶点在坐标轴上的值列表 [x, y][],对应 overlay.value */
|
|
@@ -5913,15 +5944,10 @@ class ms {
|
|
|
5913
5944
|
d(this, "handleContextmenu", (s, t) => {
|
|
5914
5945
|
var i, n;
|
|
5915
5946
|
if (!this.overlay) return;
|
|
5916
|
-
(((i = this.axisValueList) == null ? void 0 : i.length) ?? 0) >= this.minPointCount ? (this.overlay.value = this.axisValueList, (n = this.finish) == null || n.call(this, this.overlay)) : this.overlayGroup.
|
|
5947
|
+
(((i = this.axisValueList) == null ? void 0 : i.length) ?? 0) >= this.minPointCount ? (this.overlay.value = this.axisValueList, (n = this.finish) == null || n.call(this, this.overlay)) : this.overlayGroup.removeOverlay(this.overlay), this.overlay = void 0, this.axisValueList = void 0, this.restoreLayerGroupsInteractive();
|
|
5917
5948
|
});
|
|
5918
5949
|
this.canvas = s, this.overlayLayer.addGroup(this.overlayGroup), this.layerGroup.addLayer(this.overlayLayer), s.setLayerGroup(this.layerGroup), s.addEventListener("click", this.handleClick), s.addEventListener("contextmenu", this.handleContextmenu), s.canvas.addEventListener("mousemove", this.handleMousemove);
|
|
5919
5950
|
}
|
|
5920
|
-
/** 按类型开始创建:多边形或线 */
|
|
5921
|
-
create(s) {
|
|
5922
|
-
if (s === "polygon") return this.createPolygon();
|
|
5923
|
-
if (s === "line") return this.createLine();
|
|
5924
|
-
}
|
|
5925
5951
|
/** 禁用除创建层外的其他图层群组交互,并记录原始 isInteractive 以便复原 */
|
|
5926
5952
|
disableOtherLayerGroups() {
|
|
5927
5953
|
this.canvas.layerGroups.forEach((s) => {
|
|
@@ -5937,19 +5963,19 @@ class ms {
|
|
|
5937
5963
|
t.isInteractive = s;
|
|
5938
5964
|
}), this.savedLayerGroupInteractive.clear();
|
|
5939
5965
|
}
|
|
5940
|
-
createLine() {
|
|
5941
|
-
return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.
|
|
5966
|
+
createLine(s) {
|
|
5967
|
+
return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.removeOverlay(this.overlay), this.axisValueList = [], this.overlay = new T.Line({ ...s }), this.overlayGroup.addOverlay(this.overlay), this.overlay;
|
|
5942
5968
|
}
|
|
5943
|
-
createPolygon() {
|
|
5944
|
-
return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.
|
|
5969
|
+
createPolygon(s) {
|
|
5970
|
+
return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.removeOverlay(this.overlay), this.axisValueList = [], this.overlay = new T.Polygon({ ...s }), this.overlayGroup.addOverlay(this.overlay), this.overlay;
|
|
5945
5971
|
}
|
|
5946
5972
|
/** 从创建层中移除指定覆盖物,不传则清空该层全部 */
|
|
5947
|
-
|
|
5948
|
-
s ? this.overlayGroup.
|
|
5973
|
+
removeOverlay(s) {
|
|
5974
|
+
s ? this.overlayGroup.removeOverlay(s) : this.overlayGroup.clearOverlay();
|
|
5949
5975
|
}
|
|
5950
5976
|
/** 清空创建层并重置当前创建状态 */
|
|
5951
5977
|
clear() {
|
|
5952
|
-
this.restoreLayerGroupsInteractive(), this.overlayGroup.
|
|
5978
|
+
this.restoreLayerGroupsInteractive(), this.overlayGroup.clearOverlay(), this.overlay = void 0, this.axisValueList = void 0;
|
|
5953
5979
|
}
|
|
5954
5980
|
/** 销毁实例:清空覆盖物并移除所有事件监听 */
|
|
5955
5981
|
destroy() {
|
|
@@ -5957,7 +5983,7 @@ class ms {
|
|
|
5957
5983
|
}
|
|
5958
5984
|
/** 当前类型完成绘制所需的最少顶点数(多边形 3,线 2) */
|
|
5959
5985
|
get minPointCount() {
|
|
5960
|
-
return this.overlay instanceof
|
|
5986
|
+
return this.overlay instanceof T.Polygon ? 3 : this.overlay instanceof T.Line ? 2 : 0;
|
|
5961
5987
|
}
|
|
5962
5988
|
/** 从鼠标事件得到坐标轴上的 [x, y],若设置了限位器则先限位再返回 */
|
|
5963
5989
|
getAxisValueFromEvent(s) {
|
|
@@ -5969,7 +5995,7 @@ class ms {
|
|
|
5969
5995
|
}
|
|
5970
5996
|
}
|
|
5971
5997
|
}
|
|
5972
|
-
class
|
|
5998
|
+
class ys {
|
|
5973
5999
|
/**
|
|
5974
6000
|
* 计算默认缩放比例,使图像适配视图容器
|
|
5975
6001
|
* @param naturalWidth 图像原始宽度
|
|
@@ -6004,35 +6030,195 @@ class gs {
|
|
|
6004
6030
|
};
|
|
6005
6031
|
}
|
|
6006
6032
|
}
|
|
6007
|
-
|
|
6033
|
+
class ws extends D {
|
|
6034
|
+
constructor() {
|
|
6035
|
+
super(...arguments);
|
|
6036
|
+
d(this, "_ready", !1);
|
|
6037
|
+
d(this, "image", new Image());
|
|
6038
|
+
d(this, "_url");
|
|
6039
|
+
d(this, "_objectFit", "fill");
|
|
6040
|
+
}
|
|
6041
|
+
get ready() {
|
|
6042
|
+
return this._ready;
|
|
6043
|
+
}
|
|
6044
|
+
set ready(t) {
|
|
6045
|
+
var e;
|
|
6046
|
+
this._ready != t && (this._ready = t, (e = this.notifyReload) == null || e.call(this));
|
|
6047
|
+
}
|
|
6048
|
+
get url() {
|
|
6049
|
+
return this._url;
|
|
6050
|
+
}
|
|
6051
|
+
set url(t) {
|
|
6052
|
+
this._url != t && (this._url = t, this.updateBaseData());
|
|
6053
|
+
}
|
|
6054
|
+
get objectFit() {
|
|
6055
|
+
return this._objectFit;
|
|
6056
|
+
}
|
|
6057
|
+
set objectFit(t) {
|
|
6058
|
+
var e;
|
|
6059
|
+
this._objectFit != t && (this._objectFit = t, (e = this.notifyReload) == null || e.call(this));
|
|
6060
|
+
}
|
|
6061
|
+
/** 当前广告牌绘制矩形(左上角坐标 + 宽高) */
|
|
6062
|
+
get drawRect() {
|
|
6063
|
+
const { mainCanvas: t, finalDynamicPosition: e, value: i, image: n, objectFit: o } = this, [a, l] = e[0];
|
|
6064
|
+
let c = n.naturalWidth, h = n.naturalHeight;
|
|
6065
|
+
if (t && i && i.length > 1) {
|
|
6066
|
+
const P = [
|
|
6067
|
+
i[1][0] - i[0][0],
|
|
6068
|
+
i[1][1] - i[0][1]
|
|
6069
|
+
], b = t.getAxisPointByValue(
|
|
6070
|
+
P[0],
|
|
6071
|
+
P[1]
|
|
6072
|
+
);
|
|
6073
|
+
c = b.x, h = b.y;
|
|
6074
|
+
}
|
|
6075
|
+
const u = {
|
|
6076
|
+
x: a,
|
|
6077
|
+
y: l,
|
|
6078
|
+
w: c,
|
|
6079
|
+
h
|
|
6080
|
+
}, f = n.naturalWidth, m = n.naturalHeight;
|
|
6081
|
+
if (f <= 0 || m <= 0 || u.w <= 0 || u.h <= 0)
|
|
6082
|
+
return u;
|
|
6083
|
+
const p = u.w / u.h, g = f / m;
|
|
6084
|
+
if (o === "fill") return u;
|
|
6085
|
+
if (o === "contain" || o === "scale-down") {
|
|
6086
|
+
const P = Math.min(u.w / f, u.h / m), b = o === "scale-down" ? Math.min(1, P) : P, _ = f * b, A = m * b;
|
|
6087
|
+
return {
|
|
6088
|
+
x: u.x + (u.w - _) / 2,
|
|
6089
|
+
y: u.y + (u.h - A) / 2,
|
|
6090
|
+
w: _,
|
|
6091
|
+
h: A
|
|
6092
|
+
};
|
|
6093
|
+
}
|
|
6094
|
+
if (g > p) {
|
|
6095
|
+
const P = m * p, b = (f - P) / 2;
|
|
6096
|
+
return {
|
|
6097
|
+
...u,
|
|
6098
|
+
sx: b,
|
|
6099
|
+
sy: 0,
|
|
6100
|
+
sw: P,
|
|
6101
|
+
sh: m
|
|
6102
|
+
};
|
|
6103
|
+
}
|
|
6104
|
+
const y = f / p, w = (m - y) / 2;
|
|
6105
|
+
return {
|
|
6106
|
+
...u,
|
|
6107
|
+
sx: 0,
|
|
6108
|
+
sy: w,
|
|
6109
|
+
sw: f,
|
|
6110
|
+
sh: y
|
|
6111
|
+
};
|
|
6112
|
+
}
|
|
6113
|
+
loadImage() {
|
|
6114
|
+
this.ready = !1, this.url && (this.image.onload = () => {
|
|
6115
|
+
this.ready = !0;
|
|
6116
|
+
}, this.image.onerror = () => {
|
|
6117
|
+
this.ready = !1, console.error("图片加载失败");
|
|
6118
|
+
}, this.image.src = this.url);
|
|
6119
|
+
}
|
|
6120
|
+
updateBaseData() {
|
|
6121
|
+
this.mainCanvas && (this.loadImage(), this.handleValuePosition("array2D", 1));
|
|
6122
|
+
}
|
|
6123
|
+
}
|
|
6124
|
+
class ae extends ws {
|
|
6125
|
+
constructor(t) {
|
|
6126
|
+
super(t);
|
|
6127
|
+
d(this, "defaultDragg", (t, e) => {
|
|
6128
|
+
var l;
|
|
6129
|
+
const { offsetX: i, offsetY: n } = t.data, { x: o, y: a } = this.calculateOffset(i, n);
|
|
6130
|
+
this.value.forEach((c, h) => {
|
|
6131
|
+
this.value[h] = [
|
|
6132
|
+
k.add(this.value[h][0], o.value),
|
|
6133
|
+
k.add(this.value[h][1], a.value)
|
|
6134
|
+
], this.position[h] = [
|
|
6135
|
+
k.add(this.position[h][0], o.position),
|
|
6136
|
+
k.add(this.position[h][1], a.position)
|
|
6137
|
+
], this.dynamicPosition[h] = [
|
|
6138
|
+
k.add(this.dynamicPosition[h][0], o.dynamicPosition),
|
|
6139
|
+
k.add(this.dynamicPosition[h][1], a.dynamicPosition)
|
|
6140
|
+
];
|
|
6141
|
+
}), (l = this.notifyReload) == null || l.call(this), this.updateValueScope();
|
|
6142
|
+
});
|
|
6143
|
+
const { url: e, objectFit: i } = t;
|
|
6144
|
+
Object.assign(this, { url: e, objectFit: i }), this.addEventListener("dragg", this.defaultDragg);
|
|
6145
|
+
}
|
|
6146
|
+
updateValueScope() {
|
|
6147
|
+
this.initValueScope();
|
|
6148
|
+
}
|
|
6149
|
+
isPointInPath(t, e) {
|
|
6150
|
+
return this.path ? D.ctx.isPointInPath(this.path, t, e) : !1;
|
|
6151
|
+
}
|
|
6152
|
+
isPointInStroke(t, e) {
|
|
6153
|
+
return !1;
|
|
6154
|
+
}
|
|
6155
|
+
/** 设置样式 */
|
|
6156
|
+
setOverlayStyles(t) {
|
|
6157
|
+
var o;
|
|
6158
|
+
const e = this.mainCanvas, i = e.style[e.theme].billboard;
|
|
6159
|
+
let n = {};
|
|
6160
|
+
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.billboard) || i : typeof this.style == "object" ? n = ct(
|
|
6161
|
+
JSON.parse(JSON.stringify(i)),
|
|
6162
|
+
this.style
|
|
6163
|
+
) : n = i, t && this.setBaseLineStyle(t, n.stroke), n;
|
|
6164
|
+
}
|
|
6165
|
+
get computedValueScopeStyles() {
|
|
6166
|
+
return {};
|
|
6167
|
+
}
|
|
6168
|
+
draw(t) {
|
|
6169
|
+
const { mainCanvas: e, ready: i, image: n, isHover: o } = this;
|
|
6170
|
+
if (!e || !i) return;
|
|
6171
|
+
this.setGlobalAlpha(t), this.setOverlayStyles(t);
|
|
6172
|
+
const { x: a, y: l, w: c, h, sx: u, sy: f, sw: m, sh: p } = this.drawRect;
|
|
6173
|
+
typeof u == "number" && typeof f == "number" && typeof m == "number" && typeof p == "number" ? t.drawImage(n, u, f, m, p, a, l, c, h) : t.drawImage(n, a, l, c, h), o && t.strokeRect(a, l, c, h), this.path = new Path2D(), this.path.rect(a, l, c, h);
|
|
6174
|
+
}
|
|
6175
|
+
getDraw() {
|
|
6176
|
+
if (this.isNeedRender) {
|
|
6177
|
+
if (this.isRecalculate) {
|
|
6178
|
+
const { position: t, mainCanvas: e } = this;
|
|
6179
|
+
this.internalUpdate({
|
|
6180
|
+
dynamicPosition: e.transformPosition(t)
|
|
6181
|
+
});
|
|
6182
|
+
}
|
|
6183
|
+
return [this.draw, this];
|
|
6184
|
+
}
|
|
6185
|
+
}
|
|
6186
|
+
}
|
|
6187
|
+
function Ht(r) {
|
|
6008
6188
|
return [r].flat(1 / 0);
|
|
6009
6189
|
}
|
|
6010
|
-
class
|
|
6190
|
+
class T extends gs {
|
|
6011
6191
|
constructor(t) {
|
|
6012
6192
|
super(t);
|
|
6013
6193
|
/** 按坐标轴值创建覆盖物(多边形/线)的交互管理 */
|
|
6014
6194
|
d(this, "overlayCreator");
|
|
6015
|
-
this.drawAxis = new
|
|
6195
|
+
this.drawAxis = new ps(this), "axisShow" in t && this.toggleAxis(t.axisShow), this.overlayCreator = new vs(this), this.initLayerGroups(), this.updateCenter();
|
|
6016
6196
|
}
|
|
6017
6197
|
initLayerGroups() {
|
|
6018
|
-
const t = new
|
|
6019
|
-
t.addGroup(new
|
|
6020
|
-
const e = new
|
|
6021
|
-
e.addGroup(new
|
|
6022
|
-
const i = new
|
|
6023
|
-
i.addGroup(new
|
|
6024
|
-
const n = new
|
|
6025
|
-
n.addGroup(new
|
|
6026
|
-
const o = new
|
|
6027
|
-
o.addGroup(new
|
|
6028
|
-
const a = new
|
|
6029
|
-
a.
|
|
6198
|
+
const t = new j({ name: "其他图层", zIndex: 1 });
|
|
6199
|
+
t.addGroup(new Y({ name: "其他覆盖物群组" }));
|
|
6200
|
+
const e = new j({ name: "图片图层", zIndex: 2 });
|
|
6201
|
+
e.addGroup(new Y({ name: "图片覆盖物群组" }));
|
|
6202
|
+
const i = new j({ name: "多边形图层", zIndex: 3 });
|
|
6203
|
+
i.addGroup(new Y({ name: "多边形覆盖物群组" }));
|
|
6204
|
+
const n = new j({ name: "线段图层", zIndex: 4 });
|
|
6205
|
+
n.addGroup(new Y({ name: "线段覆盖物群组" }));
|
|
6206
|
+
const o = new j({ name: "点位图层", zIndex: 5 });
|
|
6207
|
+
o.addGroup(new Y({ name: "点位覆盖物群组" }));
|
|
6208
|
+
const a = new j({ name: "文字图层", zIndex: 6 });
|
|
6209
|
+
a.addGroup(new Y({ name: "文字覆盖物群组" }));
|
|
6210
|
+
const l = new j({ name: "自定义绘制图层", zIndex: 7 });
|
|
6211
|
+
l.addGroup(new Y({ name: "自定义绘制覆盖物群组" }));
|
|
6212
|
+
const c = new Rt({ name: "默认图层群组" });
|
|
6213
|
+
c.addLayer([
|
|
6214
|
+
a,
|
|
6215
|
+
o,
|
|
6030
6216
|
n,
|
|
6031
6217
|
i,
|
|
6218
|
+
l,
|
|
6032
6219
|
e,
|
|
6033
|
-
t
|
|
6034
|
-
|
|
6035
|
-
]), this.setLayerGroup(a);
|
|
6220
|
+
t
|
|
6221
|
+
]), this.setLayerGroup(c);
|
|
6036
6222
|
}
|
|
6037
6223
|
/** 获取图层群组 集合 */
|
|
6038
6224
|
gteLayerGroups(t = "默认图层群组") {
|
|
@@ -6049,12 +6235,12 @@ class I extends ds {
|
|
|
6049
6235
|
/** 添加图层 */
|
|
6050
6236
|
addLayer(t) {
|
|
6051
6237
|
const e = this.layerGroups.get("默认图层群组");
|
|
6052
|
-
e && e.addLayer(
|
|
6238
|
+
e && e.addLayer(Ht(t));
|
|
6053
6239
|
}
|
|
6054
6240
|
/** 移除图层 */
|
|
6055
6241
|
removeLayer(t) {
|
|
6056
6242
|
const e = this.layerGroups.get("默认图层群组");
|
|
6057
|
-
e && e.removeLayer(
|
|
6243
|
+
e && e.removeLayer(Ht(t));
|
|
6058
6244
|
}
|
|
6059
6245
|
/** 添加覆盖物 */
|
|
6060
6246
|
addOverlay(t) {
|
|
@@ -6063,10 +6249,12 @@ class I extends ds {
|
|
|
6063
6249
|
overlays_point: i,
|
|
6064
6250
|
overlays_line: n,
|
|
6065
6251
|
overlays_polygon: o,
|
|
6066
|
-
overlays_custom: a
|
|
6252
|
+
overlays_custom: a,
|
|
6253
|
+
overlays_billboard: l,
|
|
6254
|
+
overlays_other: c
|
|
6067
6255
|
} = this.getDefaultOverlayGroup() || {};
|
|
6068
|
-
|
|
6069
|
-
|
|
6256
|
+
Ht(t).forEach((h) => {
|
|
6257
|
+
h instanceof Ut ? e == null || e.addOverlay(h) : h instanceof lt ? i == null || i.addOverlay(h) : h instanceof Xt || h instanceof Yt || h instanceof jt ? n == null || n.addOverlay(h) : h instanceof zt ? o == null || o.addOverlay(h) : h instanceof Gt ? a == null || a.addOverlay(h) : h instanceof ae ? l == null || l.addOverlay(h) : c == null || c.addOverlay(h);
|
|
6070
6258
|
});
|
|
6071
6259
|
}
|
|
6072
6260
|
/** 移除覆盖物 */
|
|
@@ -6076,10 +6264,12 @@ class I extends ds {
|
|
|
6076
6264
|
overlays_point: i,
|
|
6077
6265
|
overlays_line: n,
|
|
6078
6266
|
overlays_polygon: o,
|
|
6079
|
-
overlays_custom: a
|
|
6267
|
+
overlays_custom: a,
|
|
6268
|
+
overlays_billboard: l,
|
|
6269
|
+
overlays_other: c
|
|
6080
6270
|
} = this.getDefaultOverlayGroup() || {};
|
|
6081
|
-
|
|
6082
|
-
|
|
6271
|
+
Ht(t).forEach((h) => {
|
|
6272
|
+
h instanceof Ut ? e == null || e.removeOverlay(h) : h instanceof lt ? i == null || i.removeOverlay(h) : h instanceof Xt || h instanceof Yt || h instanceof jt ? n == null || n.removeOverlay(h) : h instanceof zt ? o == null || o.removeOverlay(h) : h instanceof Gt ? a == null || a.addOverlay(h) : h instanceof ae ? l == null || l.removeOverlay(h) : c == null || c.removeOverlay(h);
|
|
6083
6273
|
});
|
|
6084
6274
|
}
|
|
6085
6275
|
/** 销毁 */
|
|
@@ -6088,18 +6278,19 @@ class I extends ds {
|
|
|
6088
6278
|
}
|
|
6089
6279
|
}
|
|
6090
6280
|
/** 视图适配工具:默认缩放、居中计算 */
|
|
6091
|
-
d(
|
|
6092
|
-
d(
|
|
6093
|
-
d(
|
|
6094
|
-
d(
|
|
6095
|
-
d(
|
|
6096
|
-
d(
|
|
6097
|
-
d(
|
|
6098
|
-
d(
|
|
6099
|
-
d(
|
|
6100
|
-
d(
|
|
6101
|
-
d(
|
|
6102
|
-
|
|
6281
|
+
d(T, "ViewFit", ys), /** 图层群组 */
|
|
6282
|
+
d(T, "LayerGroup", Rt), /** 图层 */
|
|
6283
|
+
d(T, "Layer", j), /** 覆盖物群组 */
|
|
6284
|
+
d(T, "OverlayGroup", Y), /** 文字 */
|
|
6285
|
+
d(T, "Text", Ut), /** 点位 */
|
|
6286
|
+
d(T, "Point", lt), /** 线段 */
|
|
6287
|
+
d(T, "Line", Xt), /** 多边形 */
|
|
6288
|
+
d(T, "Polygon", zt), /** 自定义绘制 */
|
|
6289
|
+
d(T, "Custom", Gt), /** 圆弧 */
|
|
6290
|
+
d(T, "Arc", Yt), /** 圆角 */
|
|
6291
|
+
d(T, "ArcTo", jt), /** 图片 */
|
|
6292
|
+
d(T, "Billboard", ae);
|
|
6293
|
+
class xs {
|
|
6103
6294
|
/** @param id canvas DOM id(通过 getElementById 定位) */
|
|
6104
6295
|
constructor(s) {
|
|
6105
6296
|
/** Canvas DOM id(用于 `document.getElementById` 定位) */
|
|
@@ -6121,7 +6312,7 @@ class ps {
|
|
|
6121
6312
|
* @returns true 表示初始化成功;false 表示找不到 canvas 或上下文
|
|
6122
6313
|
*/
|
|
6123
6314
|
init(s) {
|
|
6124
|
-
return this.canvas = document.getElementById(this.id), this.canvas ? (this.ctx = this.canvas.getContext("2d"), this.ctx ? (this.syncCanvasSize(), this.setupResizeListener(s), !0) : (console.error("Failed to get canvas context"), !1)) : (console.error(`Canvas with id ${this.id} not found`), !1);
|
|
6315
|
+
return this.destroy(), this.canvas = document.getElementById(this.id), this.canvas ? (this.ctx = this.canvas.getContext("2d"), this.ctx ? (this.syncCanvasSize(), this.setupResizeListener(s), !0) : (console.error("Failed to get canvas context"), !1)) : (console.error(`Canvas with id ${this.id} not found`), !1);
|
|
6125
6316
|
}
|
|
6126
6317
|
/** 获取当前 CanvasRenderingContext2D */
|
|
6127
6318
|
getContext() {
|
|
@@ -6153,7 +6344,7 @@ class ps {
|
|
|
6153
6344
|
this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0);
|
|
6154
6345
|
}
|
|
6155
6346
|
}
|
|
6156
|
-
class
|
|
6347
|
+
class Ps {
|
|
6157
6348
|
/**
|
|
6158
6349
|
* @param canvas 绑定 mousedown 的 canvas
|
|
6159
6350
|
* @param onOffsetDelta 拖拽时的 dx 回调(由外部映射到时间偏移)
|
|
@@ -6192,7 +6383,7 @@ class vs {
|
|
|
6192
6383
|
this.canvas.removeEventListener("mousedown", this.handleMouseDown), window.removeEventListener("mousemove", this.handleMouseMove), window.removeEventListener("mouseup", this.handleMouseUp);
|
|
6193
6384
|
}
|
|
6194
6385
|
}
|
|
6195
|
-
class
|
|
6386
|
+
class bs {
|
|
6196
6387
|
/**
|
|
6197
6388
|
* @param canvas 绑定 wheel 事件的 canvas
|
|
6198
6389
|
* @param getTimeSpacing 读取当前 timeSpacing 的函数
|
|
@@ -6227,7 +6418,7 @@ class ys {
|
|
|
6227
6418
|
this.canvas.removeEventListener("wheel", this.handleWheel);
|
|
6228
6419
|
}
|
|
6229
6420
|
}
|
|
6230
|
-
class
|
|
6421
|
+
class Cs {
|
|
6231
6422
|
/**
|
|
6232
6423
|
* 只负责计算鼠标所在 x/y 对应的时间,并把结果通知给 TimeAxis(不直接操作 DOM)。
|
|
6233
6424
|
*/
|
|
@@ -6264,10 +6455,10 @@ class ws {
|
|
|
6264
6455
|
this.canvas.removeEventListener("mousemove", this.handleMouseMove), this.canvas.removeEventListener("mouseleave", this.handleMouseLeave);
|
|
6265
6456
|
}
|
|
6266
6457
|
}
|
|
6267
|
-
const
|
|
6458
|
+
const Ss = {
|
|
6268
6459
|
easeInOutQuad: (r) => r < 0.5 ? 2 * r * r : 1 - Math.pow(-2 * r + 2, 2) / 2
|
|
6269
6460
|
};
|
|
6270
|
-
class
|
|
6461
|
+
class Es {
|
|
6271
6462
|
/**
|
|
6272
6463
|
* 创建时间轴引擎:会在构造后 `requestAnimationFrame` 初始化并开始渲染。
|
|
6273
6464
|
* @param id canvas DOM id
|
|
@@ -6313,13 +6504,13 @@ class Ps {
|
|
|
6313
6504
|
* 可用于叠加额外图形(如指示线、事件点等)
|
|
6314
6505
|
*/
|
|
6315
6506
|
d(this, "onDrawOverlay");
|
|
6316
|
-
this.canvasManager = new
|
|
6507
|
+
this.canvasManager = new xs(s), this.onMouseTimeChange = t, requestAnimationFrame(() => this.init());
|
|
6317
6508
|
}
|
|
6318
6509
|
/** 初始化交互:拖拽平移、滚轮缩放、鼠标时间通知,并触发首次绘制 */
|
|
6319
6510
|
init() {
|
|
6320
6511
|
if (!this.canvasManager.init(() => this.render())) return;
|
|
6321
6512
|
const t = this.canvasManager.getCanvas();
|
|
6322
|
-
t && (this.offsetDrag = new
|
|
6513
|
+
t && (this.offsetDrag = new Ps(
|
|
6323
6514
|
t,
|
|
6324
6515
|
(e) => {
|
|
6325
6516
|
this.currentTime -= Math.round(
|
|
@@ -6329,14 +6520,14 @@ class Ps {
|
|
|
6329
6520
|
() => {
|
|
6330
6521
|
this.stopCenterTimeAnimation();
|
|
6331
6522
|
}
|
|
6332
|
-
), this.wheelZoom = new
|
|
6523
|
+
), this.wheelZoom = new bs(
|
|
6333
6524
|
t,
|
|
6334
6525
|
() => this.timeSpacing,
|
|
6335
6526
|
(e, i) => {
|
|
6336
6527
|
const n = this.getTimeAtCanvasX(i);
|
|
6337
6528
|
this.timeSpacing = e, this.setTimeAtCanvasX(n, i), this.render();
|
|
6338
6529
|
}
|
|
6339
|
-
), this.centerTime = Date.now(), this.mouseTimeReporter = new
|
|
6530
|
+
), this.centerTime = Date.now(), this.mouseTimeReporter = new Cs(
|
|
6340
6531
|
t,
|
|
6341
6532
|
(e) => this.getTimeAtCanvasX(e),
|
|
6342
6533
|
(e) => {
|
|
@@ -6378,10 +6569,10 @@ class Ps {
|
|
|
6378
6569
|
const m = e / o;
|
|
6379
6570
|
let p = h, g = 0, y = u;
|
|
6380
6571
|
for (; y <= f; ) {
|
|
6381
|
-
const w = g % o === 0,
|
|
6382
|
-
if (s.fillRect(y, 0, 1,
|
|
6383
|
-
const
|
|
6384
|
-
s.fillText(
|
|
6572
|
+
const w = g % o === 0, P = w ? a : l;
|
|
6573
|
+
if (s.fillRect(y, 0, 1, P), w) {
|
|
6574
|
+
const b = ti(p, "MM-DD hh:mm:ss");
|
|
6575
|
+
s.fillText(b, y, c), p += t;
|
|
6385
6576
|
}
|
|
6386
6577
|
y += m, g++;
|
|
6387
6578
|
}
|
|
@@ -6435,8 +6626,8 @@ class Ps {
|
|
|
6435
6626
|
Math.max(0.5, h)
|
|
6436
6627
|
);
|
|
6437
6628
|
return Math.max(1, Math.round(u * 60));
|
|
6438
|
-
})(), a = (t == null ? void 0 : t.curve) ??
|
|
6439
|
-
|
|
6629
|
+
})(), a = (t == null ? void 0 : t.curve) ?? Ss.easeInOutQuad;
|
|
6630
|
+
Ke(
|
|
6440
6631
|
0,
|
|
6441
6632
|
1,
|
|
6442
6633
|
o,
|
|
@@ -6457,7 +6648,7 @@ class Ps {
|
|
|
6457
6648
|
(s = this.offsetDrag) == null || s.destroy(), (t = this.wheelZoom) == null || t.destroy(), (e = this.mouseTimeReporter) == null || e.destroy(), this.canvasManager.destroy();
|
|
6458
6649
|
}
|
|
6459
6650
|
}
|
|
6460
|
-
class
|
|
6651
|
+
class fn extends Es {
|
|
6461
6652
|
/**
|
|
6462
6653
|
* 将填充样式解析为 ctx.fillStyle 可用的值(纯色或线性渐变)
|
|
6463
6654
|
* @param rect 矩形区域,用于计算渐变起止点
|
|
@@ -6495,12 +6686,114 @@ class un extends Ps {
|
|
|
6495
6686
|
lineWidth: u = 1
|
|
6496
6687
|
} = s, f = this.getCanvasXAtTime(i), p = this.getCanvasXAtTime(n) - f;
|
|
6497
6688
|
if (!p) return;
|
|
6498
|
-
const g = this.resolveFillStyle(
|
|
6689
|
+
const g = this.resolveFillStyle(
|
|
6690
|
+
{ x: f, y: o, width: p, height: a },
|
|
6691
|
+
c
|
|
6692
|
+
);
|
|
6499
6693
|
g && (t.fillStyle = g), h && (t.strokeStyle = h), t.lineWidth = u, t.beginPath(), typeof t.roundRect == "function" ? t.roundRect(f, o, p, a + o, l) : t.rect(f, o, p, a + o), c && t.fill(), h && t.stroke();
|
|
6500
6694
|
}
|
|
6501
6695
|
}
|
|
6502
|
-
function
|
|
6503
|
-
|
|
6696
|
+
function Ot(r) {
|
|
6697
|
+
if (typeof r == "string") {
|
|
6698
|
+
const s = document.querySelector(r);
|
|
6699
|
+
if (s)
|
|
6700
|
+
return s;
|
|
6701
|
+
console.error(`Element "${r}" not found`);
|
|
6702
|
+
} else
|
|
6703
|
+
return r || document.documentElement;
|
|
6704
|
+
}
|
|
6705
|
+
function We(r) {
|
|
6706
|
+
const s = Ot(r);
|
|
6707
|
+
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");
|
|
6708
|
+
}
|
|
6709
|
+
function qe() {
|
|
6710
|
+
const r = document;
|
|
6711
|
+
return document.exitFullscreen ? document.exitFullscreen() : r.mozCancelFullScreen ? r.mozCancelFullScreen() : r.webkitExitFullscreen ? r.webkitExitFullscreen() : r.msExitFullscreen ? r.msExitFullscreen() : Promise.reject("No ExitFullscreen API");
|
|
6712
|
+
}
|
|
6713
|
+
function Jt(r) {
|
|
6714
|
+
const s = Ot(r), t = document, e = document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement;
|
|
6715
|
+
return s == e || !r && window.innerWidth == screen.width && window.innerHeight == screen.height;
|
|
6716
|
+
}
|
|
6717
|
+
function mn(r) {
|
|
6718
|
+
if (r = Ot(r), !!r)
|
|
6719
|
+
return function() {
|
|
6720
|
+
Jt(r) ? qe() : We(r);
|
|
6721
|
+
};
|
|
6722
|
+
}
|
|
6723
|
+
function gn(r, s) {
|
|
6724
|
+
const t = Ot(s);
|
|
6725
|
+
if (!t) return;
|
|
6726
|
+
const e = () => {
|
|
6727
|
+
r(Jt(t));
|
|
6728
|
+
};
|
|
6729
|
+
return document.addEventListener("fullscreenchange", e), document.addEventListener("webkitfullscreenchange", e), document.addEventListener("mozfullscreenchange", e), document.addEventListener("MSFullscreenChange", e), e(), () => {
|
|
6730
|
+
document.removeEventListener("fullscreenchange", e), document.removeEventListener("webkitfullscreenchange", e), document.removeEventListener("mozfullscreenchange", e), document.removeEventListener("MSFullscreenChange", e);
|
|
6731
|
+
};
|
|
6732
|
+
}
|
|
6733
|
+
class pn {
|
|
6734
|
+
constructor(s, t) {
|
|
6735
|
+
/** 要全屏展示的目标元素 */
|
|
6736
|
+
d(this, "targetElement");
|
|
6737
|
+
/**
|
|
6738
|
+
* 全屏状态变化回调。参数为 `true` 表示当前全屏元素为本实例的目标元素。
|
|
6739
|
+
*/
|
|
6740
|
+
d(this, "onFullscreenChange");
|
|
6741
|
+
/** 解除 {@link attachFullscreenChangeListeners} 注册的 document 监听 */
|
|
6742
|
+
d(this, "detachFullscreenListeners");
|
|
6743
|
+
this.init(s), this.onFullscreenChange = t, this.attachFullscreenChangeListeners();
|
|
6744
|
+
}
|
|
6745
|
+
/**
|
|
6746
|
+
* 设置或更新目标元素(`HTMLElement` 或 CSS 选择器;未传时内部会回退到 `document.documentElement`)
|
|
6747
|
+
*/
|
|
6748
|
+
init(s) {
|
|
6749
|
+
this.targetElement = Ot(s);
|
|
6750
|
+
}
|
|
6751
|
+
/** 使目标元素进入浏览器全屏 */
|
|
6752
|
+
enter() {
|
|
6753
|
+
this.targetElement && We(this.targetElement);
|
|
6754
|
+
}
|
|
6755
|
+
/** 退出浏览器全屏(不区分由哪个元素进入) */
|
|
6756
|
+
exit() {
|
|
6757
|
+
this.targetElement && qe();
|
|
6758
|
+
}
|
|
6759
|
+
/** 若当前已为该目标全屏则退出,否则进入全屏 */
|
|
6760
|
+
toggle() {
|
|
6761
|
+
this.targetElement && (Jt(this.targetElement) ? this.exit() : this.enter());
|
|
6762
|
+
}
|
|
6763
|
+
attachFullscreenChangeListeners() {
|
|
6764
|
+
const s = () => {
|
|
6765
|
+
!this.targetElement || !this.onFullscreenChange || this.onFullscreenChange(Jt(this.targetElement));
|
|
6766
|
+
};
|
|
6767
|
+
document.addEventListener("fullscreenchange", s), document.addEventListener(
|
|
6768
|
+
"webkitfullscreenchange",
|
|
6769
|
+
s
|
|
6770
|
+
), document.addEventListener(
|
|
6771
|
+
"mozfullscreenchange",
|
|
6772
|
+
s
|
|
6773
|
+
), document.addEventListener("MSFullscreenChange", s), s(), this.detachFullscreenListeners = () => {
|
|
6774
|
+
document.removeEventListener(
|
|
6775
|
+
"fullscreenchange",
|
|
6776
|
+
s
|
|
6777
|
+
), document.removeEventListener(
|
|
6778
|
+
"webkitfullscreenchange",
|
|
6779
|
+
s
|
|
6780
|
+
), document.removeEventListener(
|
|
6781
|
+
"mozfullscreenchange",
|
|
6782
|
+
s
|
|
6783
|
+
), document.removeEventListener(
|
|
6784
|
+
"MSFullscreenChange",
|
|
6785
|
+
s
|
|
6786
|
+
);
|
|
6787
|
+
};
|
|
6788
|
+
}
|
|
6789
|
+
/** 移除全屏事件监听,实例不应再使用 */
|
|
6790
|
+
destroy() {
|
|
6791
|
+
var s;
|
|
6792
|
+
(s = this.detachFullscreenListeners) == null || s.call(this), this.detachFullscreenListeners = void 0, this.targetElement = void 0, this.onFullscreenChange = void 0;
|
|
6793
|
+
}
|
|
6794
|
+
}
|
|
6795
|
+
function vn(r) {
|
|
6796
|
+
const s = Le(r, 100);
|
|
6504
6797
|
let t = 0, e = 0;
|
|
6505
6798
|
return function(i) {
|
|
6506
6799
|
const n = i.target;
|
|
@@ -6528,7 +6821,7 @@ function dn(r) {
|
|
|
6528
6821
|
f(), m();
|
|
6529
6822
|
};
|
|
6530
6823
|
}
|
|
6531
|
-
function
|
|
6824
|
+
function yn(r, s, t) {
|
|
6532
6825
|
const { isClickAllowed: e, uiLibrary: i = ["naiveUI", "ElementPlus", "Element"] } = t || {}, n = function(l) {
|
|
6533
6826
|
const c = [];
|
|
6534
6827
|
for (const h in l)
|
|
@@ -6560,21 +6853,21 @@ function fn(r, s, t) {
|
|
|
6560
6853
|
() => document.addEventListener("mousedown", a)
|
|
6561
6854
|
);
|
|
6562
6855
|
}
|
|
6563
|
-
var
|
|
6564
|
-
class
|
|
6856
|
+
var W, ft, mt, xt, Pt, J, K, st, bt;
|
|
6857
|
+
class wn {
|
|
6565
6858
|
constructor() {
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6859
|
+
L(this, W);
|
|
6860
|
+
L(this, ft, !1);
|
|
6861
|
+
L(this, mt, {});
|
|
6862
|
+
L(this, xt, 0);
|
|
6863
|
+
L(this, Pt, 0);
|
|
6864
|
+
L(this, J, 0);
|
|
6865
|
+
L(this, K, 0);
|
|
6866
|
+
L(this, st);
|
|
6867
|
+
L(this, bt);
|
|
6575
6868
|
}
|
|
6576
6869
|
init(s, t) {
|
|
6577
|
-
M(this,
|
|
6870
|
+
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, {
|
|
6578
6871
|
mousedown: this.mousedown.bind(this),
|
|
6579
6872
|
mousemove: this.mousemove.bind(this),
|
|
6580
6873
|
mouseup: this.mouseup.bind(this)
|
|
@@ -6585,45 +6878,45 @@ class mn {
|
|
|
6585
6878
|
}
|
|
6586
6879
|
bindOrUnbindEvent(s) {
|
|
6587
6880
|
const t = s === "bind" ? "addEventListener" : "removeEventListener";
|
|
6588
|
-
if (!x(this,
|
|
6589
|
-
x(this,
|
|
6881
|
+
if (!x(this, W)) return console.error("No DOM");
|
|
6882
|
+
x(this, W)[t]("mousedown", x(this, mt).mousedown), document[t]("mousemove", x(this, mt).mousemove), document[t]("mouseup", x(this, mt).mouseup);
|
|
6590
6883
|
}
|
|
6591
6884
|
alterLocation() {
|
|
6592
|
-
if (!x(this,
|
|
6593
|
-
x(this, st) && (M(this,
|
|
6885
|
+
if (!x(this, W)) return console.error("No DOM");
|
|
6886
|
+
x(this, st) && (M(this, J, Math.min(x(this, J), x(this, st).max.top)), M(this, J, Math.max(x(this, J), x(this, st).min.top)), M(this, K, Math.min(x(this, K), x(this, st).max.left)), M(this, K, Math.max(x(this, K), x(this, st).min.left))), x(this, W).style.setProperty("--top", x(this, J) + "px"), x(this, W).style.setProperty("--left", x(this, K) + "px");
|
|
6594
6887
|
}
|
|
6595
6888
|
mousedown(s) {
|
|
6596
|
-
if (!x(this,
|
|
6889
|
+
if (!x(this, W)) return console.error("No DOM");
|
|
6597
6890
|
if (x(this, bt) && s.target != x(this, bt)) return;
|
|
6598
|
-
document.body.classList.add("no-select"), M(this,
|
|
6599
|
-
const t = x(this,
|
|
6600
|
-
M(this, xt, e), M(this, Pt, i), M(this,
|
|
6891
|
+
document.body.classList.add("no-select"), M(this, ft, !0);
|
|
6892
|
+
const t = x(this, W).getBoundingClientRect(), { pageX: e, pageY: i } = s;
|
|
6893
|
+
M(this, xt, e), M(this, Pt, i), M(this, J, t.y), M(this, K, t.x);
|
|
6601
6894
|
}
|
|
6602
6895
|
mousemove(s) {
|
|
6603
6896
|
const { pageX: t, pageY: e } = s;
|
|
6604
|
-
x(this,
|
|
6897
|
+
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());
|
|
6605
6898
|
}
|
|
6606
6899
|
mouseup() {
|
|
6607
|
-
x(this,
|
|
6900
|
+
x(this, ft) && (M(this, ft, !1), document.body.classList.remove("no-select"));
|
|
6608
6901
|
}
|
|
6609
6902
|
}
|
|
6610
|
-
|
|
6611
|
-
var
|
|
6612
|
-
class
|
|
6903
|
+
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();
|
|
6904
|
+
var q, gt, pt, Ct, St, $, Z, G, Et, _t;
|
|
6905
|
+
class xn {
|
|
6613
6906
|
constructor() {
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6907
|
+
L(this, q);
|
|
6908
|
+
L(this, gt, !1);
|
|
6909
|
+
L(this, pt, {});
|
|
6910
|
+
L(this, Ct, 0);
|
|
6911
|
+
L(this, St, 0);
|
|
6912
|
+
L(this, $, 0);
|
|
6913
|
+
L(this, Z, 0);
|
|
6914
|
+
L(this, G);
|
|
6915
|
+
L(this, Et);
|
|
6916
|
+
L(this, _t);
|
|
6624
6917
|
}
|
|
6625
6918
|
init(s, t = {}) {
|
|
6626
|
-
M(this,
|
|
6919
|
+
this.finish(), M(this, q, s), M(this, G, t.limit), M(this, Et, t.update_move), M(this, _t, t.update_up), M(this, pt, {
|
|
6627
6920
|
mousedown: this.mousedown.bind(this),
|
|
6628
6921
|
mousemove: this.mousemove.bind(this),
|
|
6629
6922
|
mouseup: this.mouseup.bind(this)
|
|
@@ -6634,17 +6927,17 @@ class gn {
|
|
|
6634
6927
|
}
|
|
6635
6928
|
bindOrUnbindEvent(s) {
|
|
6636
6929
|
const t = s === "bind" ? "addEventListener" : "removeEventListener";
|
|
6637
|
-
if (!x(this,
|
|
6638
|
-
x(this,
|
|
6930
|
+
if (!x(this, q)) return console.error("No DOM");
|
|
6931
|
+
x(this, q)[t]("mousedown", x(this, pt).mousedown), document[t]("mousemove", x(this, pt).mousemove), document[t]("mouseup", x(this, pt).mouseup);
|
|
6639
6932
|
}
|
|
6640
6933
|
updateValue() {
|
|
6641
6934
|
const s = {
|
|
6642
|
-
top: x(this,
|
|
6643
|
-
left: x(this,
|
|
6935
|
+
top: x(this, $),
|
|
6936
|
+
left: x(this, Z),
|
|
6644
6937
|
percentage: { top: 0, left: 0 }
|
|
6645
6938
|
};
|
|
6646
|
-
if (x(this,
|
|
6647
|
-
const t = (e) => x(this,
|
|
6939
|
+
if (x(this, G)) {
|
|
6940
|
+
const t = (e) => x(this, G) ? (s[e] - x(this, G).min[e]) / (x(this, G).max[e] - x(this, G).min[e]) : 0;
|
|
6648
6941
|
s.percentage = {
|
|
6649
6942
|
top: t("top") || 0,
|
|
6650
6943
|
left: t("left") || 0
|
|
@@ -6653,64 +6946,27 @@ class gn {
|
|
|
6653
6946
|
return s;
|
|
6654
6947
|
}
|
|
6655
6948
|
alterLocation() {
|
|
6656
|
-
if (!x(this,
|
|
6657
|
-
x(this,
|
|
6949
|
+
if (!x(this, q)) return console.error("No DOM");
|
|
6950
|
+
x(this, G) && (M(this, $, Math.min(x(this, $), x(this, G).max.top)), M(this, $, Math.max(x(this, $), x(this, G).min.top)), M(this, Z, Math.min(x(this, Z), x(this, G).max.left)), M(this, Z, Math.max(x(this, Z), x(this, G).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");
|
|
6658
6951
|
}
|
|
6659
6952
|
mousedown(s) {
|
|
6660
|
-
if (!x(this,
|
|
6661
|
-
document.body.classList.add("no-select"), M(this,
|
|
6662
|
-
const t = x(this,
|
|
6953
|
+
if (!x(this, q)) return console.error("No DOM");
|
|
6954
|
+
document.body.classList.add("no-select"), M(this, gt, !0);
|
|
6955
|
+
const t = x(this, q).getBoundingClientRect();
|
|
6663
6956
|
M(this, St, t.y), M(this, Ct, t.x);
|
|
6664
6957
|
const { pageX: e, pageY: i } = s;
|
|
6665
|
-
M(this,
|
|
6958
|
+
M(this, $, i - x(this, St)), M(this, Z, e - x(this, Ct)), this.alterLocation();
|
|
6666
6959
|
}
|
|
6667
6960
|
mousemove(s) {
|
|
6668
6961
|
const { pageX: t, pageY: e } = s;
|
|
6669
|
-
x(this,
|
|
6962
|
+
x(this, gt) && (M(this, $, e - x(this, St)), M(this, Z, t - x(this, Ct)), this.alterLocation());
|
|
6670
6963
|
}
|
|
6671
6964
|
mouseup() {
|
|
6672
|
-
x(this,
|
|
6965
|
+
x(this, gt) && (M(this, gt, !1), document.body.classList.remove("no-select"), x(this, _t) && x(this, _t).call(this, this.updateValue()));
|
|
6673
6966
|
}
|
|
6674
6967
|
}
|
|
6675
|
-
|
|
6676
|
-
function
|
|
6677
|
-
if (typeof r == "string") {
|
|
6678
|
-
const s = document.querySelector(r);
|
|
6679
|
-
if (s)
|
|
6680
|
-
return s;
|
|
6681
|
-
console.error(`Element "${r}" not found`);
|
|
6682
|
-
} else
|
|
6683
|
-
return r || document.documentElement;
|
|
6684
|
-
}
|
|
6685
|
-
function bs(r) {
|
|
6686
|
-
const s = te(r);
|
|
6687
|
-
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");
|
|
6688
|
-
}
|
|
6689
|
-
function Cs() {
|
|
6690
|
-
const r = document;
|
|
6691
|
-
return document.exitFullscreen ? document.exitFullscreen() : r.mozCancelFullScreen ? r.mozCancelFullScreen() : r.webkitExitFullscreen ? r.webkitExitFullscreen() : r.msExitFullscreen ? r.msExitFullscreen() : Promise.reject("No ExitFullscreen API");
|
|
6692
|
-
}
|
|
6693
|
-
function Ye(r) {
|
|
6694
|
-
const s = te(r), t = document, e = document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement;
|
|
6695
|
-
return s == e || !r && window.innerWidth == screen.width && window.innerHeight == screen.height;
|
|
6696
|
-
}
|
|
6697
|
-
function pn(r) {
|
|
6698
|
-
if (r = te(r), !!r)
|
|
6699
|
-
return function() {
|
|
6700
|
-
Ye(r) ? Cs() : bs(r);
|
|
6701
|
-
};
|
|
6702
|
-
}
|
|
6703
|
-
function vn(r, s) {
|
|
6704
|
-
const t = te(s);
|
|
6705
|
-
if (!t) return;
|
|
6706
|
-
const e = () => {
|
|
6707
|
-
r(Ye(t));
|
|
6708
|
-
};
|
|
6709
|
-
return document.addEventListener("fullscreenchange", e), document.addEventListener("webkitfullscreenchange", e), document.addEventListener("mozfullscreenchange", e), document.addEventListener("MSFullscreenChange", e), e(), () => {
|
|
6710
|
-
document.removeEventListener("fullscreenchange", e), document.removeEventListener("webkitfullscreenchange", e), document.removeEventListener("mozfullscreenchange", e), document.removeEventListener("MSFullscreenChange", e);
|
|
6711
|
-
};
|
|
6712
|
-
}
|
|
6713
|
-
function yn(r, s) {
|
|
6968
|
+
q = new WeakMap(), gt = new WeakMap(), pt = new WeakMap(), Ct = new WeakMap(), St = new WeakMap(), $ = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Et = new WeakMap(), _t = new WeakMap();
|
|
6969
|
+
function Pn(r, s) {
|
|
6714
6970
|
if (typeof r == "number") return r;
|
|
6715
6971
|
if (/px/.test(r)) return Number(r.replace(/px/, "")) || 0;
|
|
6716
6972
|
const t = document.createElement("div");
|
|
@@ -6718,7 +6974,7 @@ function yn(r, s) {
|
|
|
6718
6974
|
const e = t.getBoundingClientRect().width;
|
|
6719
6975
|
return s.removeChild(t), e;
|
|
6720
6976
|
}
|
|
6721
|
-
function
|
|
6977
|
+
function bn(r, s) {
|
|
6722
6978
|
if (!r) return;
|
|
6723
6979
|
let t, e;
|
|
6724
6980
|
if (typeof s == "string") {
|
|
@@ -6735,7 +6991,7 @@ function wn(r, s) {
|
|
|
6735
6991
|
const i = t / e;
|
|
6736
6992
|
return i > r ? [r * e, e] : i < r ? [t, t / r] : [t, e];
|
|
6737
6993
|
}
|
|
6738
|
-
function
|
|
6994
|
+
function Cn(r, s = 5e3) {
|
|
6739
6995
|
return new Promise((t, e) => {
|
|
6740
6996
|
const i = new Image();
|
|
6741
6997
|
i.src = r;
|
|
@@ -6751,7 +7007,7 @@ function xn(r, s = 5e3) {
|
|
|
6751
7007
|
}, i.crossOrigin = "Anonymous";
|
|
6752
7008
|
});
|
|
6753
7009
|
}
|
|
6754
|
-
function
|
|
7010
|
+
function Sn(r) {
|
|
6755
7011
|
const t = document.getElementById(r).querySelectorAll("img"), e = t.length, i = [];
|
|
6756
7012
|
let n = 0;
|
|
6757
7013
|
return e === 0 ? Promise.resolve({
|
|
@@ -6793,14 +7049,14 @@ function Pn(r) {
|
|
|
6793
7049
|
});
|
|
6794
7050
|
});
|
|
6795
7051
|
}
|
|
6796
|
-
function
|
|
7052
|
+
function En(r) {
|
|
6797
7053
|
return new Promise((s, t) => {
|
|
6798
7054
|
fetch(r).then((e) => s(e.text())).catch((e) => {
|
|
6799
7055
|
console.error("Error fetching :", e), t(e);
|
|
6800
7056
|
});
|
|
6801
7057
|
});
|
|
6802
7058
|
}
|
|
6803
|
-
function
|
|
7059
|
+
function _s(r) {
|
|
6804
7060
|
const {
|
|
6805
7061
|
href: s,
|
|
6806
7062
|
fileName: t,
|
|
@@ -6809,7 +7065,7 @@ function Ss(r) {
|
|
|
6809
7065
|
autoDownload: n = !0
|
|
6810
7066
|
} = r;
|
|
6811
7067
|
let o, a = !1, l = null, c;
|
|
6812
|
-
const h = t ||
|
|
7068
|
+
const h = t || ce(s, "downloaded_file");
|
|
6813
7069
|
c = decodeURIComponent(h);
|
|
6814
7070
|
const u = () => {
|
|
6815
7071
|
if (!l) return;
|
|
@@ -6822,8 +7078,8 @@ function Ss(r) {
|
|
|
6822
7078
|
a || y(new Error(`请求超时(已超过${i / 1e3}秒)`));
|
|
6823
7079
|
}, o.addEventListener("progress", (w) => {
|
|
6824
7080
|
if (w.lengthComputable && !a) {
|
|
6825
|
-
const
|
|
6826
|
-
e == null || e(Number(
|
|
7081
|
+
const P = w.loaded / w.total * 100;
|
|
7082
|
+
e == null || e(Number(P.toFixed(2)));
|
|
6827
7083
|
}
|
|
6828
7084
|
}), o.addEventListener("load", () => {
|
|
6829
7085
|
a || (o.status >= 200 && o.status < 300 ? (l = o.response, n && u(), g(o.response)) : y(new Error(`下载失败,状态码: ${o.status}`)));
|
|
@@ -6839,24 +7095,24 @@ function Ss(r) {
|
|
|
6839
7095
|
!a && l && u();
|
|
6840
7096
|
} };
|
|
6841
7097
|
}
|
|
6842
|
-
function
|
|
7098
|
+
function _n(r, s, t) {
|
|
6843
7099
|
if (!t) {
|
|
6844
7100
|
let n = s.replace(/^[^.]+./, "");
|
|
6845
7101
|
n = n == s ? "text/plain" : "application/" + n, t = { type: n };
|
|
6846
7102
|
}
|
|
6847
7103
|
const e = new Blob(r, t), i = URL.createObjectURL(e);
|
|
6848
|
-
|
|
7104
|
+
_s({ href: i, fileName: s });
|
|
6849
7105
|
}
|
|
6850
|
-
const
|
|
6851
|
-
function
|
|
6852
|
-
const t = Math.max(Math.min(r, 180), -180), e = Math.max(Math.min(s,
|
|
7106
|
+
const Ms = Math.PI / 2, Kt = Math.PI / 180, te = 6378137, Ds = 85.05112878;
|
|
7107
|
+
function Mn(r, s) {
|
|
7108
|
+
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;
|
|
6853
7109
|
return [i, o];
|
|
6854
7110
|
}
|
|
6855
|
-
function
|
|
6856
|
-
const t = r /
|
|
7111
|
+
function Dn(r, s) {
|
|
7112
|
+
const t = r / te / Kt, e = (2 * Math.atan(Math.exp(s / te)) - Ms) / Kt;
|
|
6857
7113
|
return [t, e];
|
|
6858
7114
|
}
|
|
6859
|
-
function
|
|
7115
|
+
function Rs(r, s, t) {
|
|
6860
7116
|
const [e, i] = r, [n, o] = s, [a, l] = t, c = (a - n) ** 2 + (l - o) ** 2;
|
|
6861
7117
|
if (c === 0) return Math.sqrt((e - n) ** 2 + (i - o) ** 2);
|
|
6862
7118
|
let h = ((e - n) * (a - n) + (i - o) * (l - o)) / c;
|
|
@@ -6864,21 +7120,21 @@ function Ms(r, s, t) {
|
|
|
6864
7120
|
(e - (n + h * (a - n))) ** 2 + (i - (o + h * (l - o))) ** 2
|
|
6865
7121
|
);
|
|
6866
7122
|
}
|
|
6867
|
-
function
|
|
7123
|
+
function Rn(r, s, t, e, i, n = 1, o = 1) {
|
|
6868
7124
|
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;
|
|
6869
7125
|
return [
|
|
6870
7126
|
[a, l],
|
|
6871
7127
|
[c, h]
|
|
6872
7128
|
];
|
|
6873
7129
|
}
|
|
6874
|
-
function
|
|
7130
|
+
function De(r, s, t, e) {
|
|
6875
7131
|
return Math.hypot(Math.abs(t - r), Math.abs(e - s));
|
|
6876
7132
|
}
|
|
6877
|
-
function
|
|
7133
|
+
function $e(r, s, t, e) {
|
|
6878
7134
|
const i = (r + t) / 2, n = (s + e) / 2;
|
|
6879
7135
|
return { x: i, y: n };
|
|
6880
7136
|
}
|
|
6881
|
-
function
|
|
7137
|
+
function kn(r, s, t, e) {
|
|
6882
7138
|
const [i, n] = r, [o, a] = s;
|
|
6883
7139
|
let l = 1 / 0;
|
|
6884
7140
|
if (o !== 0) {
|
|
@@ -6891,7 +7147,7 @@ function Mn(r, s, t, e) {
|
|
|
6891
7147
|
}
|
|
6892
7148
|
return l === 1 / 0 ? r : [i + o * l, n + a * l];
|
|
6893
7149
|
}
|
|
6894
|
-
const
|
|
7150
|
+
const ks = /* @__PURE__ */ new Set([
|
|
6895
7151
|
"sin",
|
|
6896
7152
|
"cos",
|
|
6897
7153
|
"tan",
|
|
@@ -6899,9 +7155,9 @@ const Ds = /* @__PURE__ */ new Set([
|
|
|
6899
7155
|
"acos",
|
|
6900
7156
|
"atan",
|
|
6901
7157
|
"atan2"
|
|
6902
|
-
]),
|
|
7158
|
+
]), Vn = new Proxy(Math, {
|
|
6903
7159
|
get(r, s) {
|
|
6904
|
-
return
|
|
7160
|
+
return ks.has(s) ? function(...t) {
|
|
6905
7161
|
const e = t.map((i) => i / 180 * Math.PI);
|
|
6906
7162
|
return r[s](...e);
|
|
6907
7163
|
} : r[s];
|
|
@@ -6932,7 +7188,7 @@ class wt {
|
|
|
6932
7188
|
}) : s ? (t = this.resolve) == null || t.call(this) : (e = this.reject) == null || e.call(this), s;
|
|
6933
7189
|
}
|
|
6934
7190
|
}
|
|
6935
|
-
class
|
|
7191
|
+
class Vs extends wt {
|
|
6936
7192
|
constructor(s) {
|
|
6937
7193
|
super(), this.resolve = s;
|
|
6938
7194
|
}
|
|
@@ -6951,7 +7207,7 @@ class Rs extends wt {
|
|
|
6951
7207
|
return new wt(this.resolve, t);
|
|
6952
7208
|
}
|
|
6953
7209
|
}
|
|
6954
|
-
class
|
|
7210
|
+
class Os extends wt {
|
|
6955
7211
|
constructor(s) {
|
|
6956
7212
|
super(), this.reject = s;
|
|
6957
7213
|
}
|
|
@@ -6990,7 +7246,7 @@ const B = class B {
|
|
|
6990
7246
|
var i, n;
|
|
6991
7247
|
return (n = (i = B.tips)[s]) == null ? void 0 : n.call(i, ...t);
|
|
6992
7248
|
};
|
|
6993
|
-
return new
|
|
7249
|
+
return new Vs(e);
|
|
6994
7250
|
};
|
|
6995
7251
|
}
|
|
6996
7252
|
static rejectTip(s) {
|
|
@@ -6999,7 +7255,7 @@ const B = class B {
|
|
|
6999
7255
|
var i, n;
|
|
7000
7256
|
return (n = (i = B.tips)[s]) == null ? void 0 : n.call(i, ...t);
|
|
7001
7257
|
};
|
|
7002
|
-
return new
|
|
7258
|
+
return new Os(e);
|
|
7003
7259
|
};
|
|
7004
7260
|
}
|
|
7005
7261
|
};
|
|
@@ -7011,82 +7267,83 @@ d(B, "tips", {
|
|
|
7011
7267
|
}), d(B, "info", B.resolveTip("info")), d(B, "success", B.resolveTip("success")), d(B, "warning", B.rejectTip("warning")), d(B, "error", B.rejectTip("error"));
|
|
7012
7268
|
let Dt = B;
|
|
7013
7269
|
export {
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7270
|
+
Je as EXTENSION_TO_MIME,
|
|
7271
|
+
re as FILE_EXTENSIONS,
|
|
7272
|
+
Re as PAPER_SIZE_DEFINITIONS,
|
|
7273
|
+
Ts as PAPER_SIZE_OPTIONS,
|
|
7274
|
+
Pe as UNIT_LABELS,
|
|
7275
|
+
Ls as WINDOW_TARGET,
|
|
7276
|
+
Is as _Animate_CreateOscillator,
|
|
7277
|
+
Ns as _Animate_CubicBezier,
|
|
7278
|
+
Ke as _Animate_NumericTransition,
|
|
7279
|
+
Wt as _Animate_Schedule,
|
|
7280
|
+
Hs as _Blob_ConvertDataToImageUrl,
|
|
7281
|
+
hn as _Browser_CalculatePrintableArea,
|
|
7282
|
+
cn as _Browser_CopyToClipboard,
|
|
7283
|
+
ln as _Browser_GetFrameRate,
|
|
7284
|
+
un as _Browser_IdleDetection,
|
|
7285
|
+
Nt as _Browser_SameOriginTabManager,
|
|
7286
|
+
on as _Browser_SoundEffects,
|
|
7287
|
+
an as _Browser_WebSocketClient,
|
|
7288
|
+
T as _Canvas_Axis,
|
|
7289
|
+
fn as _Canvas_TimeAxis,
|
|
7290
|
+
bn as _Element_CalculateCanvasSize,
|
|
7291
|
+
Sn as _Element_CheckImagesLoaded,
|
|
7292
|
+
yn as _Element_CloseOnOutsideClick,
|
|
7293
|
+
wn as _Element_Drag,
|
|
7294
|
+
We as _Element_EnterFullscreen,
|
|
7295
|
+
qe as _Element_ExitFullscreen,
|
|
7296
|
+
mn as _Element_Fullscreen,
|
|
7297
|
+
pn as _Element_FullscreenController,
|
|
7298
|
+
gn as _Element_FullscreenObserver,
|
|
7299
|
+
Pn as _Element_GetOtherSizeInPixels,
|
|
7300
|
+
Jt as _Element_IsFullscreen,
|
|
7301
|
+
Cn as _Element_LoadImage,
|
|
7302
|
+
xn as _Element_LocalDrag,
|
|
7303
|
+
vn as _Element_ScrollEndListener,
|
|
7304
|
+
_n as _File_CreateAndDownload,
|
|
7305
|
+
_s as _File_Download,
|
|
7306
|
+
En as _File_Read,
|
|
7307
|
+
Xs as _Format_CamelCase,
|
|
7308
|
+
Fs as _Format_CapitalizeFirstLetter,
|
|
7309
|
+
Ws as _Format_ChunkArray,
|
|
7310
|
+
zs as _Format_ExcludeSubstring,
|
|
7311
|
+
Us as _Format_FileSize,
|
|
7312
|
+
ce as _Format_HrefName,
|
|
7313
|
+
js as _Format_MillisecondToReadable,
|
|
7314
|
+
le as _Format_NumberWithCommas,
|
|
7315
|
+
Gs as _Format_NumberWithUnit,
|
|
7316
|
+
Bs as _Format_Percentage,
|
|
7317
|
+
ti as _Format_Timestamp,
|
|
7318
|
+
Ys as _Format_ToggleInvisibleChars,
|
|
7319
|
+
De as _Math_CalculateDistance2D,
|
|
7320
|
+
Vn as _Math_Degree,
|
|
7321
|
+
Rn as _Math_GetArcPoints,
|
|
7322
|
+
kn as _Math_GetBoundaryIntersection,
|
|
7323
|
+
$e as _Math_GetMidpoint,
|
|
7324
|
+
Mn as _Math_LngLatToPlane,
|
|
7325
|
+
Dn as _Math_PlaneToLngLat,
|
|
7326
|
+
Rs as _Math_PointToLineDistance,
|
|
7070
7327
|
Dt as _Tip,
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7328
|
+
si as _Utility_Clone,
|
|
7329
|
+
Le as _Utility_Debounce,
|
|
7330
|
+
Ks as _Utility_ExecuteWhenIdle,
|
|
7331
|
+
ue as _Utility_GenerateUUID,
|
|
7332
|
+
en as _Utility_GetTargetByPath,
|
|
7333
|
+
ct as _Utility_MergeObjects,
|
|
7334
|
+
nn as _Utility_RotateList,
|
|
7335
|
+
sn as _Utility_SetTargetByPath,
|
|
7336
|
+
rn as _Utility_Sleep,
|
|
7337
|
+
tn as _Utility_Throttle,
|
|
7338
|
+
ni as _Utility_TimeConsumption,
|
|
7339
|
+
ii as _Utility_WaitForCondition,
|
|
7340
|
+
Js as _Valid_CheckConnectionWithXHR,
|
|
7341
|
+
he as _Valid_DataType,
|
|
7342
|
+
Zs as _Valid_DoesInfiniteLineIntersectRectangle,
|
|
7343
|
+
be as _Valid_FileTypeChecker,
|
|
7344
|
+
qt as _Valid_Is2DNumberArray,
|
|
7345
|
+
qs as _Valid_IsInMargin,
|
|
7346
|
+
ve as _Valid_IsNumberArray,
|
|
7347
|
+
$s as _Valid_IsPointInPolygon,
|
|
7348
|
+
Qs as _Valid_IsSecureContext
|
|
7092
7349
|
};
|