@zyzgroup/core-web 0.0.4 → 0.0.5
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/zyzgroup_core_web.iife.js +2 -2
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +177 -159
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +2 -2
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +6 -5
- package/types/env.d.ts +3 -0
- package/types/env.d.ts.map +1 -1
|
@@ -20,7 +20,7 @@ class j extends I {
|
|
|
20
20
|
super(`Please select files in ${t} format`), this.accepts = t;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Y(e, t) {
|
|
24
24
|
e.addEventListener(
|
|
25
25
|
"change",
|
|
26
26
|
function() {
|
|
@@ -29,7 +29,7 @@ function W(e, t) {
|
|
|
29
29
|
!1
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Q(e, t) {
|
|
33
33
|
e.addEventListener(
|
|
34
34
|
"dragover",
|
|
35
35
|
function(n) {
|
|
@@ -44,7 +44,7 @@ function J(e, t) {
|
|
|
44
44
|
!1
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const K = (e = ["*"], t) => {
|
|
48
48
|
if (!globalThis.document || !(globalThis.document instanceof Document))
|
|
49
49
|
throw new F();
|
|
50
50
|
const n = globalThis.document.createElement("input");
|
|
@@ -61,22 +61,22 @@ const Y = (e = ["*"], t) => {
|
|
|
61
61
|
if (!n.files || n.files?.length === 0)
|
|
62
62
|
l(new B());
|
|
63
63
|
else {
|
|
64
|
-
const
|
|
65
|
-
o(
|
|
64
|
+
const f = Array.from(n.files);
|
|
65
|
+
o(f) && l(new j(e)), r(f);
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
function o(r) {
|
|
70
70
|
return !e.includes("*") && r.some((l) => !e.includes(`.${$(l)}`));
|
|
71
71
|
}
|
|
72
|
-
},
|
|
72
|
+
}, Z = (e) => {
|
|
73
73
|
const t = new FileReader();
|
|
74
74
|
return new Promise((n, o) => {
|
|
75
75
|
t.addEventListener(
|
|
76
76
|
"progress",
|
|
77
77
|
(r) => {
|
|
78
|
-
const l = "(" + Math.floor(r.total / 1e3) + " KB)",
|
|
79
|
-
console.log(`Loading size: ${l} progress: ${
|
|
78
|
+
const l = "(" + Math.floor(r.total / 1e3) + " KB)", f = Math.floor(r.loaded / r.total * 100) + "%";
|
|
79
|
+
console.log(`Loading size: ${l} progress: ${f}`);
|
|
80
80
|
}
|
|
81
81
|
), t.addEventListener("load", (r) => {
|
|
82
82
|
n(r.target?.result);
|
|
@@ -87,20 +87,20 @@ const Y = (e = ["*"], t) => {
|
|
|
87
87
|
}, $ = (e) => {
|
|
88
88
|
let t;
|
|
89
89
|
return e instanceof File ? t = e.name : t = e, t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)[1] ?? "";
|
|
90
|
-
},
|
|
90
|
+
}, N = (e) => /^image\//.test(e.type), ee = (e) => /^video\//.test(e.type), te = (e) => /^audio\//.test(e.type), ne = (e) => /^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/.test(
|
|
91
91
|
e.type
|
|
92
|
-
),
|
|
92
|
+
), oe = (e) => /^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/.test(
|
|
93
93
|
e.type
|
|
94
|
-
),
|
|
94
|
+
), re = (e) => /^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/.test(
|
|
95
95
|
e.type
|
|
96
|
-
),
|
|
97
|
-
function
|
|
96
|
+
), ie = (e) => /^application\/json$/.test(e.type), ae = (e) => /^(?:application|text)\/(?:xml|xhtml\+xml)$/.test(e.type);
|
|
97
|
+
function se(e) {
|
|
98
98
|
const t = e.slice(0, 4), n = new FileReader();
|
|
99
99
|
let o;
|
|
100
100
|
return new Promise((r, l) => {
|
|
101
101
|
n.onload = function() {
|
|
102
|
-
const
|
|
103
|
-
switch (new DataView(
|
|
102
|
+
const f = n.result;
|
|
103
|
+
switch (new DataView(f).getUint32(0, !1)) {
|
|
104
104
|
case 2303741511:
|
|
105
105
|
o = "image/png";
|
|
106
106
|
break;
|
|
@@ -118,26 +118,26 @@ function ie(e) {
|
|
|
118
118
|
}, n.readAsArrayBuffer(t);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function ce(e) {
|
|
122
122
|
const t = new Blob(["(" + e.toString() + ")()"], {
|
|
123
123
|
type: "application/javascript"
|
|
124
124
|
});
|
|
125
125
|
return URL.createObjectURL(t);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function le(e, t) {
|
|
128
128
|
if (!e.type.startsWith("image/"))
|
|
129
129
|
return;
|
|
130
130
|
const n = document.createElement("img");
|
|
131
131
|
return n.src = URL.createObjectURL(e), n.width = t?.width ?? 60, n.height = t?.height ?? 60, n.onload = function() {
|
|
132
132
|
}, n;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function ue(e) {
|
|
135
135
|
function t() {
|
|
136
136
|
document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
|
|
137
137
|
}
|
|
138
138
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function de(e) {
|
|
141
141
|
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch(
|
|
142
142
|
(t) => setTimeout(() => {
|
|
143
143
|
throw t;
|
|
@@ -176,13 +176,13 @@ function z(e, t, n) {
|
|
|
176
176
|
e.lastChild && e.removeChild(e.lastChild);
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function fe(e, t, n) {
|
|
180
180
|
var o = /* @__PURE__ */ new Date();
|
|
181
181
|
o.setTime(o.getTime() + n * 24 * 60 * 60 * 1e3);
|
|
182
182
|
var r = "expires=" + o.toGMTString();
|
|
183
183
|
document.cookie = e + "=" + t + "; " + r;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function me(e) {
|
|
186
186
|
for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {
|
|
187
187
|
var r = n[o].trim();
|
|
188
188
|
if (r.indexOf(t) == 0)
|
|
@@ -190,7 +190,7 @@ function fe(e) {
|
|
|
190
190
|
}
|
|
191
191
|
return "";
|
|
192
192
|
}
|
|
193
|
-
const
|
|
193
|
+
const ge = () => document.cookie.split(";").map((e) => e.split("=")).reduce((e, [t, n]) => (e[t.trim().replace('"', "")] = n) && e, {}), pe = () => document.cookie.split(";").forEach(
|
|
194
194
|
(e) => document.cookie = e.replace(/^ +/, "").replace(/=.*/, `=;expires=${(/* @__PURE__ */ new Date()).toUTCString()};path=/`)
|
|
195
195
|
);
|
|
196
196
|
class y {
|
|
@@ -236,9 +236,9 @@ class y {
|
|
|
236
236
|
const o = this.waitingResponse[n] = { sent: n }, r = { ...o, ...t };
|
|
237
237
|
try {
|
|
238
238
|
this.socket.readyState === y.OPEN ? this.socket.send(JSON.stringify(r)) : this.recreateSocket(JSON.stringify(r));
|
|
239
|
-
const l = await new Promise(function(
|
|
240
|
-
o.resolve =
|
|
241
|
-
|
|
239
|
+
const l = await new Promise(function(f, d) {
|
|
240
|
+
o.resolve = f, console.log(o), setTimeout(() => {
|
|
241
|
+
d("Timeout");
|
|
242
242
|
}, 5e3);
|
|
243
243
|
});
|
|
244
244
|
return console.info("Time took", (+/* @__PURE__ */ new Date() - o.sent) / 1e3), l;
|
|
@@ -322,14 +322,14 @@ function D() {
|
|
|
322
322
|
height: e.clientHeight || window.innerHeight
|
|
323
323
|
};
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function he() {
|
|
326
326
|
const e = x(), t = D();
|
|
327
327
|
return {
|
|
328
328
|
width: Math.max(e.scrollWidth, t.width),
|
|
329
329
|
height: Math.max(e.scrollHeight, t.height)
|
|
330
330
|
};
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function we(e) {
|
|
333
333
|
const t = D(), n = e.getBoundingClientRect();
|
|
334
334
|
return n.bottom > 0 && n.top < t.height && n.right > 0 && n.left < t.width;
|
|
335
335
|
}
|
|
@@ -359,31 +359,31 @@ function V(e) {
|
|
|
359
359
|
t += n.offsetTop, n = n.offsetParent;
|
|
360
360
|
return t;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function ve(e) {
|
|
363
363
|
return {
|
|
364
364
|
x: G(e),
|
|
365
365
|
y: V(e)
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function be(e) {
|
|
369
369
|
const t = e.getBoundingClientRect(), n = U(), o = X();
|
|
370
370
|
return {
|
|
371
371
|
x: t.left + n.scrollLeft - o.clientLeft,
|
|
372
372
|
y: t.top + n.scrollTop - o.clientTop
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function Ee(e) {
|
|
376
376
|
const t = e.getBoundingClientRect();
|
|
377
377
|
return {
|
|
378
378
|
x: t.left,
|
|
379
379
|
y: t.top
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Te() {
|
|
383
383
|
const e = x(), t = e.scrollHeight - e.clientHeight;
|
|
384
384
|
return t <= 0 ? 0 : e.scrollTop / t * 100;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function ke(e) {
|
|
387
387
|
if (e.pageX && e.pageY)
|
|
388
388
|
return { x: e.pageX, y: e.pageY };
|
|
389
389
|
const t = U(), n = X();
|
|
@@ -392,13 +392,13 @@ function Ee(e) {
|
|
|
392
392
|
y: e.clientY + t.scrollTop - n.clientTop
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Le(e) {
|
|
396
396
|
return {
|
|
397
397
|
x: e.clientX,
|
|
398
398
|
y: e.clientY
|
|
399
399
|
};
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function xe(e) {
|
|
402
402
|
if (document.implementation.hasFeature("MouseEvents", "2.0"))
|
|
403
403
|
return e.button;
|
|
404
404
|
switch (e.button) {
|
|
@@ -415,7 +415,7 @@ function Te(e) {
|
|
|
415
415
|
return 1;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function ye() {
|
|
419
419
|
let e = navigator.userAgent;
|
|
420
420
|
return {
|
|
421
421
|
trident: e.indexOf("Trident") > -1,
|
|
@@ -440,10 +440,25 @@ function Le() {
|
|
|
440
440
|
//是否web应该程序,没有头部与底部
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function Pe() {
|
|
444
444
|
return (navigator.browserLanguage || navigator.language).toLowerCase();
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function W() {
|
|
447
|
+
return (
|
|
448
|
+
// Check if it is an iPhone
|
|
449
|
+
/iPhone/gi.test(window.navigator.platform) || // Check if it is an iPad. iPad reports itself as "MacIntel", but we can check if it is a touch
|
|
450
|
+
// screen. Let's hope that Apple doesn't release a touch screen Mac (or maybe this would then
|
|
451
|
+
// work as expected 🤔).
|
|
452
|
+
/Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
function J() {
|
|
456
|
+
return /Android/gi.test(window.navigator.userAgent);
|
|
457
|
+
}
|
|
458
|
+
function Ce() {
|
|
459
|
+
return W() || J();
|
|
460
|
+
}
|
|
461
|
+
function _e(e) {
|
|
447
462
|
var t = document.documentElement, n = window.devicePixelRatio;
|
|
448
463
|
t.dataset.dpr = n;
|
|
449
464
|
var o = 100, r = function() {
|
|
@@ -464,15 +479,15 @@ require("path");
|
|
|
464
479
|
require("querystring");
|
|
465
480
|
require("util");
|
|
466
481
|
require("url");
|
|
467
|
-
function
|
|
482
|
+
function Ae(e) {
|
|
468
483
|
return btoa(encodeURIComponent(e)).replaceAll("+", "*").replaceAll("/", "-").replaceAll("=", "");
|
|
469
484
|
}
|
|
470
|
-
function
|
|
485
|
+
function Me(e) {
|
|
471
486
|
let t = e.replaceAll("*", "+").replaceAll("-", "/"), n = t.length % 4;
|
|
472
487
|
return n && (t = t.padEnd(t.length + (4 - n), "=")), decodeURIComponent(atob(t));
|
|
473
488
|
}
|
|
474
|
-
const
|
|
475
|
-
function
|
|
489
|
+
const Se = (e) => !/^([a-z]+:)?[\\/]/i.test(e);
|
|
490
|
+
function Re(e) {
|
|
476
491
|
let t;
|
|
477
492
|
try {
|
|
478
493
|
t = new URL(e);
|
|
@@ -481,7 +496,7 @@ function Ae(e) {
|
|
|
481
496
|
}
|
|
482
497
|
return t.protocol === "http:" || t.protocol === "https:";
|
|
483
498
|
}
|
|
484
|
-
function
|
|
499
|
+
function Ie() {
|
|
485
500
|
let e = location.search;
|
|
486
501
|
if (e) {
|
|
487
502
|
let t = {};
|
|
@@ -491,13 +506,13 @@ function Me() {
|
|
|
491
506
|
} else
|
|
492
507
|
return !1;
|
|
493
508
|
}
|
|
494
|
-
const
|
|
509
|
+
const De = (e) => Array.from(new URLSearchParams(e)).reduce(
|
|
495
510
|
(t, [n, o]) => Object.assign({}, t, {
|
|
496
511
|
[n]: t[n] ? (Array.isArray(t[n]) ? t[n] : [t[n]]).concat(o) : o
|
|
497
512
|
}),
|
|
498
513
|
{}
|
|
499
514
|
);
|
|
500
|
-
function
|
|
515
|
+
function Oe(e) {
|
|
501
516
|
e = e || localStorage.theme, e || (e = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", localStorage.theme = e), document.documentElement.classList.toggle("dark", e === "dark");
|
|
502
517
|
}
|
|
503
518
|
class E {
|
|
@@ -739,14 +754,14 @@ class E {
|
|
|
739
754
|
222: "single_quote"
|
|
740
755
|
};
|
|
741
756
|
}
|
|
742
|
-
const
|
|
743
|
-
function
|
|
757
|
+
const qe = (e) => navigator.clipboard.writeText(e), Be = () => window.getSelection().toString(), Ue = (e) => e === document.activeElement, Xe = (e) => [].slice.call(e.parentNode.children).filter((t) => t !== e), He = () => window.scrollTo(0, 0), Fe = () => !document.hidden, je = () => history.back(), $e = () => history.go(-1);
|
|
758
|
+
function ze(e) {
|
|
744
759
|
let t = document.createElement("script");
|
|
745
760
|
t.type = "text/javascript", t.src = e, t.async = !1, document.body.appendChild(t), t.onload = () => {
|
|
746
761
|
}, t.onerror = () => {
|
|
747
762
|
};
|
|
748
763
|
}
|
|
749
|
-
function
|
|
764
|
+
function Ge(e) {
|
|
750
765
|
let t = e[0];
|
|
751
766
|
for (let n = 1; n < arguments.length; n++) {
|
|
752
767
|
let o = String(arguments[n]);
|
|
@@ -754,7 +769,7 @@ function je(e) {
|
|
|
754
769
|
}
|
|
755
770
|
return t;
|
|
756
771
|
}
|
|
757
|
-
function
|
|
772
|
+
function Ve(e) {
|
|
758
773
|
const t = /<%=(.+?)%>/g, n = /<%([\s\S]+?)%>/g;
|
|
759
774
|
return e = e.replace(t, "`); \n echo( $1 ); \n echo(`").replace(n, "`); \n $1 \n echo(`"), e = "echo(`" + e + "`);", `(function parse(data){
|
|
760
775
|
let output = "";
|
|
@@ -768,28 +783,28 @@ function $e(e) {
|
|
|
768
783
|
return output;
|
|
769
784
|
})`;
|
|
770
785
|
}
|
|
771
|
-
function
|
|
786
|
+
function We(e, t, n) {
|
|
772
787
|
e.addEventListener ? e.addEventListener(t, n, !1) : e.attachEvent ? e.attachEvent("on" + t, n) : e["on" + t] = n;
|
|
773
788
|
}
|
|
774
|
-
function
|
|
789
|
+
function Je(e, t, n) {
|
|
775
790
|
e.removeEventListener ? e.removeEventListener(t, n, !1) : e.detachEvent ? e.detachEvent("on" + t, n) : e["on" + t] = null;
|
|
776
791
|
}
|
|
777
|
-
function
|
|
792
|
+
function Ye(e) {
|
|
778
793
|
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0;
|
|
779
794
|
}
|
|
780
|
-
function
|
|
795
|
+
function Qe(e) {
|
|
781
796
|
e.preventDefault ? e.preventDefault : e.returnValue = !1;
|
|
782
797
|
}
|
|
783
|
-
function
|
|
798
|
+
function Ke(e) {
|
|
784
799
|
return e || window.event;
|
|
785
800
|
}
|
|
786
|
-
function
|
|
801
|
+
function Ze(e) {
|
|
787
802
|
return e.target || e.srcElement;
|
|
788
803
|
}
|
|
789
|
-
function
|
|
804
|
+
function Ne(e) {
|
|
790
805
|
return e.relatedTarget ? e.relatedTarget : e.toElement ? e.toElement : e.fromElement ? e.fromElement : null;
|
|
791
806
|
}
|
|
792
|
-
function
|
|
807
|
+
function et() {
|
|
793
808
|
return !!(window.File && window.FileReader && window.FileList && window.Blob);
|
|
794
809
|
}
|
|
795
810
|
window.requestAnimationFrame || (window.requestAnimationFrame = function() {
|
|
@@ -797,13 +812,13 @@ window.requestAnimationFrame || (window.requestAnimationFrame = function() {
|
|
|
797
812
|
window.setTimeout(e, 1e3 / 60);
|
|
798
813
|
};
|
|
799
814
|
}());
|
|
800
|
-
const
|
|
815
|
+
const tt = (e, t) => {
|
|
801
816
|
var n = document.getElementById(e), o = n.getContext("2d");
|
|
802
817
|
(function r() {
|
|
803
818
|
window.requestAnimationFrame(r), o.clearRect(0, 0, n.width, n.height), t(o);
|
|
804
819
|
})();
|
|
805
820
|
};
|
|
806
|
-
function
|
|
821
|
+
function nt(e) {
|
|
807
822
|
return new Promise(function(t, n) {
|
|
808
823
|
const o = new Image();
|
|
809
824
|
o.onload = function() {
|
|
@@ -813,18 +828,18 @@ function Ne(e) {
|
|
|
813
828
|
}, o.src = e;
|
|
814
829
|
});
|
|
815
830
|
}
|
|
816
|
-
function
|
|
831
|
+
function ot() {
|
|
817
832
|
const e = document.getElementsByTagName("img"), t = D().height;
|
|
818
833
|
let n = 0;
|
|
819
834
|
for (let o = n; o < e.length; o++)
|
|
820
835
|
e[o].getBoundingClientRect().top < t && (e[o].src = e[o].getAttribute("data-src"), n = o + 1);
|
|
821
836
|
}
|
|
822
|
-
function
|
|
823
|
-
var t = [], n = [], o = [], r, l,
|
|
824
|
-
h.src = e,
|
|
825
|
-
for (var w =
|
|
837
|
+
function rt(e) {
|
|
838
|
+
var t = [], n = [], o = [], r, l, f, d, u = 0, T = document.createElement("canvas"), k = T.getContext("2d"), h = document.createElement("image");
|
|
839
|
+
h.src = e, T.width = h.width, T.height = h.height, k.drawImage(h, 0, 0);
|
|
840
|
+
for (var w = k.getImageData(0, 0, h.width, h.height).data, g = 0; g < w.length; g += 4)
|
|
826
841
|
t[u] = w[g], n[u] = w[g + 1], o[u] = w[g + 2], u += 1;
|
|
827
|
-
return r = R(t), l = R(n),
|
|
842
|
+
return r = R(t), l = R(n), f = R(o), d = "rgb(" + r + "," + l + "," + f + ")", d;
|
|
828
843
|
}
|
|
829
844
|
function R(e) {
|
|
830
845
|
var t = {}, n = [], o = [], r = 0;
|
|
@@ -835,12 +850,12 @@ function R(e) {
|
|
|
835
850
|
for (var l = 0; l < n.length; l++)
|
|
836
851
|
n[u] === n[l] && (r += 1), o[u] = r;
|
|
837
852
|
}
|
|
838
|
-
for (var
|
|
839
|
-
if (o[
|
|
853
|
+
for (var f = Math.max.apply(null, o), d = 0; d < o.length; d++)
|
|
854
|
+
if (o[d] === f)
|
|
840
855
|
return;
|
|
841
|
-
return n[
|
|
856
|
+
return n[d];
|
|
842
857
|
}
|
|
843
|
-
const
|
|
858
|
+
const it = function(e) {
|
|
844
859
|
e || (e = "2d");
|
|
845
860
|
const t = function() {
|
|
846
861
|
const i = document.createElement("canvas"), a = i.getContext(
|
|
@@ -868,11 +883,11 @@ const nt = function(e) {
|
|
|
868
883
|
const c = document.createElement("a");
|
|
869
884
|
c.download = s + "." + a, c.href = i, c.click();
|
|
870
885
|
}
|
|
871
|
-
function
|
|
886
|
+
function f(i) {
|
|
872
887
|
const a = document.createElement("img");
|
|
873
888
|
return a.src = i, a;
|
|
874
889
|
}
|
|
875
|
-
function
|
|
890
|
+
function d(i) {
|
|
876
891
|
return i = i.toLowerCase().replace(/jpg/i, "jpeg"), "image/" + i.match(/png|jpeg|bmp|gif/)?.[0];
|
|
877
892
|
}
|
|
878
893
|
function u(i) {
|
|
@@ -886,13 +901,13 @@ const nt = function(e) {
|
|
|
886
901
|
a += String.fromCharCode(i[s]);
|
|
887
902
|
return btoa(a);
|
|
888
903
|
}
|
|
889
|
-
function
|
|
904
|
+
function T(i) {
|
|
890
905
|
const a = e == "2d" ? void 0 : { preserveDrawingBuffer: !0 };
|
|
891
906
|
return i.getContext(e, a);
|
|
892
907
|
}
|
|
893
|
-
function
|
|
908
|
+
function k(i) {
|
|
894
909
|
const a = i.width, s = i.height;
|
|
895
|
-
return
|
|
910
|
+
return T(i).getImageData(0, 0, a, s);
|
|
896
911
|
}
|
|
897
912
|
function h(i, a) {
|
|
898
913
|
return "data:" + a + ";base64," + i;
|
|
@@ -991,8 +1006,8 @@ const nt = function(e) {
|
|
|
991
1006
|
}, g = function(i, a, s, c, m) {
|
|
992
1007
|
const p = c;
|
|
993
1008
|
if (t.canvas && t.dataURL)
|
|
994
|
-
if (typeof i == "string" && (i = document.getElementById(i)), c === void 0 && (c = "png"), c =
|
|
995
|
-
const v =
|
|
1009
|
+
if (typeof i == "string" && (i = document.getElementById(i)), c === void 0 && (c = "png"), c = d(c), /bmp/.test(c)) {
|
|
1010
|
+
const v = k(o(i, a, s)), P = w(v);
|
|
996
1011
|
l(h(P, n), p, m);
|
|
997
1012
|
} else {
|
|
998
1013
|
const v = r(i, c, a, s);
|
|
@@ -1000,12 +1015,12 @@ const nt = function(e) {
|
|
|
1000
1015
|
}
|
|
1001
1016
|
}, L = function(i, a, s, c) {
|
|
1002
1017
|
if (t.canvas && t.dataURL)
|
|
1003
|
-
if (typeof i == "string" && (i = document.getElementById(i)), c === void 0 && (c = "png"), c =
|
|
1004
|
-
const m =
|
|
1005
|
-
return
|
|
1018
|
+
if (typeof i == "string" && (i = document.getElementById(i)), c === void 0 && (c = "png"), c = d(c), /bmp/.test(c)) {
|
|
1019
|
+
const m = k(o(i, a, s)), p = w(m);
|
|
1020
|
+
return f(h(p, "image/bmp"));
|
|
1006
1021
|
} else {
|
|
1007
1022
|
const m = r(i, c, a, s);
|
|
1008
|
-
return
|
|
1023
|
+
return f(m);
|
|
1009
1024
|
}
|
|
1010
1025
|
};
|
|
1011
1026
|
return {
|
|
@@ -1037,7 +1052,7 @@ const nt = function(e) {
|
|
|
1037
1052
|
}
|
|
1038
1053
|
};
|
|
1039
1054
|
};
|
|
1040
|
-
function
|
|
1055
|
+
function at() {
|
|
1041
1056
|
var e = null;
|
|
1042
1057
|
if (window.ActiveXObject)
|
|
1043
1058
|
for (var t = [
|
|
@@ -1059,7 +1074,7 @@ function ot() {
|
|
|
1059
1074
|
e = new XMLHttpRequest();
|
|
1060
1075
|
return e;
|
|
1061
1076
|
}
|
|
1062
|
-
function
|
|
1077
|
+
function st(e) {
|
|
1063
1078
|
if (e.action) {
|
|
1064
1079
|
if (e.method.toLowerCase() === "post")
|
|
1065
1080
|
return {
|
|
@@ -1086,27 +1101,27 @@ function rt(e) {
|
|
|
1086
1101
|
};
|
|
1087
1102
|
}
|
|
1088
1103
|
}
|
|
1089
|
-
function
|
|
1104
|
+
function ct(e, t) {
|
|
1090
1105
|
return new Promise((n, o) => {
|
|
1091
1106
|
var r = new XMLHttpRequest(), l = function() {
|
|
1092
1107
|
o("The request for " + e + " is timed out for " + t + ".");
|
|
1093
|
-
},
|
|
1108
|
+
}, f = function(d) {
|
|
1094
1109
|
r.readyState === 4 && (r.status === 200 ? n(r.response) : o(r.statusText));
|
|
1095
1110
|
};
|
|
1096
|
-
r.open("GET", e), r.onload =
|
|
1111
|
+
r.open("GET", e), r.onload = f, r.timeout = t, r.ontimeout = l, r.upload.addEventListener(
|
|
1097
1112
|
"progress",
|
|
1098
|
-
function(
|
|
1099
|
-
if (
|
|
1100
|
-
const u = Math.round(
|
|
1113
|
+
function(d) {
|
|
1114
|
+
if (d.lengthComputable) {
|
|
1115
|
+
const u = Math.round(d.loaded * 100 / d.total);
|
|
1101
1116
|
console.log(u + "%");
|
|
1102
1117
|
}
|
|
1103
1118
|
},
|
|
1104
1119
|
!1
|
|
1105
|
-
), r.upload.addEventListener("load", function(
|
|
1120
|
+
), r.upload.addEventListener("load", function(d) {
|
|
1106
1121
|
}, !1), r.send(null);
|
|
1107
1122
|
});
|
|
1108
1123
|
}
|
|
1109
|
-
function
|
|
1124
|
+
function lt(e, t, n) {
|
|
1110
1125
|
return fetch(
|
|
1111
1126
|
e,
|
|
1112
1127
|
Object.assign(
|
|
@@ -1135,7 +1150,7 @@ function at(e, t, n) {
|
|
|
1135
1150
|
)
|
|
1136
1151
|
).then((o) => o.json());
|
|
1137
1152
|
}
|
|
1138
|
-
function
|
|
1153
|
+
function ut(e, t) {
|
|
1139
1154
|
var n = new XMLHttpRequest();
|
|
1140
1155
|
n.open("HEAD", e), n.filepath = e, n.callback = t, n.onload = function() {
|
|
1141
1156
|
var o = parseFloat(
|
|
@@ -1146,87 +1161,90 @@ function st(e, t) {
|
|
|
1146
1161
|
}
|
|
1147
1162
|
export {
|
|
1148
1163
|
I as BaseError,
|
|
1149
|
-
|
|
1164
|
+
it as Canvas2Image,
|
|
1150
1165
|
E as DOMKeyboardKeyCode,
|
|
1151
1166
|
F as EnvironmentError,
|
|
1152
1167
|
B as FileSelectCancelError,
|
|
1153
1168
|
j as IllegalFileError,
|
|
1154
1169
|
y as WebSocket,
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1170
|
+
We as addEventListener,
|
|
1171
|
+
Re as checkHttpUrl,
|
|
1172
|
+
pe as clearCookies,
|
|
1173
|
+
qe as copyToClipboard,
|
|
1174
|
+
at as createXMLHttpRequest,
|
|
1175
|
+
tt as drawCanvasInWeb,
|
|
1176
|
+
lt as fetchUseFetch,
|
|
1177
|
+
ct as fetchUseXMLHttpRequest,
|
|
1178
|
+
le as file2Image,
|
|
1179
|
+
ce as fn2ObjectURL,
|
|
1180
|
+
Pe as getBrowserLanguage,
|
|
1181
|
+
ye as getBrowserUserAgent,
|
|
1182
|
+
me as getCookie,
|
|
1183
|
+
ge as getCookieObject,
|
|
1169
1184
|
x as getDocumentElement,
|
|
1170
1185
|
G as getElementLeftInPage,
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1186
|
+
be as getElementPositionInPage,
|
|
1187
|
+
ve as getElementPositionInPage2,
|
|
1188
|
+
Ee as getElementPositionInViewport,
|
|
1174
1189
|
V as getElementTopInPage,
|
|
1175
|
-
|
|
1190
|
+
Ke as getEvent,
|
|
1176
1191
|
$ as getFileExtension,
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1192
|
+
se as getFileType,
|
|
1193
|
+
st as getFormElementData,
|
|
1194
|
+
rt as getImageColor,
|
|
1195
|
+
xe as getMouseButton,
|
|
1196
|
+
ke as getMousePositionInPage,
|
|
1197
|
+
Le as getMousePositionInViewport,
|
|
1183
1198
|
X as getPageClient,
|
|
1184
1199
|
U as getPageScroll,
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1200
|
+
he as getPageSize,
|
|
1201
|
+
Te as getPageVerticalScrollPercent,
|
|
1202
|
+
Ne as getRelatedTarget,
|
|
1203
|
+
Ie as getSearchData,
|
|
1204
|
+
Be as getSelectedText,
|
|
1205
|
+
Ze as getTarget,
|
|
1206
|
+
De as getUrlParams,
|
|
1192
1207
|
D as getViewportSize,
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1208
|
+
Q as handleDragAndDropFiles,
|
|
1209
|
+
Y as handleInputFiles,
|
|
1210
|
+
ut as ifWebFileHasChanged,
|
|
1211
|
+
J as isAndroid,
|
|
1212
|
+
te as isAudio,
|
|
1213
|
+
et as isBrowserSupportFileAPI,
|
|
1214
|
+
we as isElementInViewport,
|
|
1215
|
+
oe as isExcelDocument,
|
|
1216
|
+
Ue as isFocus,
|
|
1217
|
+
W as isIOS,
|
|
1218
|
+
N as isImage,
|
|
1219
|
+
ie as isJsonDocument,
|
|
1220
|
+
Ce as isMobile,
|
|
1221
|
+
re as isPowerPointDocument,
|
|
1222
|
+
Fe as isTabInView,
|
|
1223
|
+
Se as isURLRelative,
|
|
1224
|
+
ee as isVideo,
|
|
1225
|
+
ne as isWordDocument,
|
|
1226
|
+
ae as isXmlDocument,
|
|
1227
|
+
ot as lazyloadImages,
|
|
1228
|
+
nt as loadImageAsync,
|
|
1229
|
+
ze as loadScript,
|
|
1230
|
+
de as microTask,
|
|
1231
|
+
je as navigateBack,
|
|
1232
|
+
$e as navigateBack2,
|
|
1233
|
+
ue as onDocumentReady,
|
|
1216
1234
|
z as patchDOM,
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1235
|
+
Qe as preventDefault,
|
|
1236
|
+
Z as readeFile,
|
|
1237
|
+
Je as removeEventListener,
|
|
1238
|
+
Ge as saferHTML,
|
|
1239
|
+
He as scrollToTop,
|
|
1240
|
+
K as selectFile,
|
|
1241
|
+
fe as setCookie,
|
|
1242
|
+
_e as setRem,
|
|
1243
|
+
Oe as setTheme,
|
|
1244
|
+
Xe as siblings,
|
|
1245
|
+
Ye as stopPropagation,
|
|
1246
|
+
Ve as templateCompile,
|
|
1247
|
+
Me as urlsafe_b64decode,
|
|
1248
|
+
Ae as urlsafe_b64encode
|
|
1231
1249
|
};
|
|
1232
1250
|
//# sourceMappingURL=zyzgroup_core_web.js.map
|