@oardi/ts-utils 0.0.58 → 0.0.60
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/helpers/download.helper.d.ts +4 -4
- package/helpers/file.helper.d.ts +1 -0
- package/helpers/image.helper.d.ts +1 -0
- package/index.cjs +6 -6
- package/index.mjs +391 -387
- package/index.umd.js +6 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ const zt = {
|
|
|
7
7
|
xxl: 1400,
|
|
8
8
|
xxxl: 1600
|
|
9
9
|
};
|
|
10
|
-
class
|
|
10
|
+
class bt {
|
|
11
11
|
static getScreenWidth() {
|
|
12
12
|
return document.documentElement.clientWidth;
|
|
13
13
|
}
|
|
@@ -18,62 +18,62 @@ class St {
|
|
|
18
18
|
class pt {
|
|
19
19
|
static breakPoints = zt;
|
|
20
20
|
static getCurrentBreakpoint() {
|
|
21
|
-
return pt.getBreakpointByScreenWidth(
|
|
21
|
+
return pt.getBreakpointByScreenWidth(bt.getScreenWidth());
|
|
22
22
|
}
|
|
23
|
-
static getBreakpointByScreenWidth(t =
|
|
23
|
+
static getBreakpointByScreenWidth(t = bt.getScreenWidth()) {
|
|
24
24
|
let n = "xs";
|
|
25
25
|
for (const s of Object.keys(pt.breakPoints))
|
|
26
26
|
pt.breakPoints[s] <= t && (n = s);
|
|
27
27
|
return { breakpoint: n, screenWidth: t };
|
|
28
28
|
}
|
|
29
29
|
static isScreenGreaterThan(t) {
|
|
30
|
-
return
|
|
30
|
+
return bt.getScreenWidth() > pt.breakPoints[t];
|
|
31
31
|
}
|
|
32
32
|
static isScreenSmallerThan(t) {
|
|
33
|
-
return
|
|
33
|
+
return bt.getScreenWidth() < pt.breakPoints[t];
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
var
|
|
37
|
-
const Ut = typeof navigator < "u" ? navigator.userAgent : "",
|
|
38
|
-
class
|
|
36
|
+
var et = /* @__PURE__ */ ((a) => (a.opera = "opera", a.firefox = "firefox", a.safari = "safari", a.ie = "ie", a.edgeLegacy = "edgeLegacy", a.edg = "edg", a.chrome = "chrome", a.iOS = "iOS", a.headlessChrome = "headlessChrome", a.nodeRuntime = "nodeRuntime", a.electron = "electron", a))(et || {});
|
|
37
|
+
const Ut = typeof navigator < "u" ? navigator.userAgent : "", dt = Ut.toLowerCase();
|
|
38
|
+
class rt {
|
|
39
39
|
/** check if current environment is running inside a browser */
|
|
40
40
|
static isBrowserEnv() {
|
|
41
41
|
return typeof window < "u" && typeof navigator < "u";
|
|
42
42
|
}
|
|
43
|
-
static isOpera(t =
|
|
43
|
+
static isOpera(t = dt) {
|
|
44
44
|
return this.isBrowserEnv() ? t.includes("opr/") || t.includes("opera") : !1;
|
|
45
45
|
}
|
|
46
|
-
static isFirefox(t =
|
|
46
|
+
static isFirefox(t = dt) {
|
|
47
47
|
return this.isBrowserEnv() ? t.includes("firefox") || typeof globalThis.InstallTrigger < "u" : !1;
|
|
48
48
|
}
|
|
49
|
-
static isSafari(t =
|
|
49
|
+
static isSafari(t = dt) {
|
|
50
50
|
if (!this.isBrowserEnv()) return !1;
|
|
51
|
-
const n = navigator.vendor && navigator.vendor.includes("Apple"), s = t.includes("safari"),
|
|
52
|
-
return n && s &&
|
|
51
|
+
const n = navigator.vendor && navigator.vendor.includes("Apple"), s = t.includes("safari"), h = !(t.includes("crios") || t.includes("chrome") || t.includes("android") || t.includes("opr/") || t.includes("edg"));
|
|
52
|
+
return n && s && h;
|
|
53
53
|
}
|
|
54
|
-
static isIOS(t =
|
|
54
|
+
static isIOS(t = dt) {
|
|
55
55
|
if (!this.isBrowserEnv()) return !1;
|
|
56
56
|
const n = /iphone|ipad|ipod/.test(t), s = t.includes("macintosh") && navigator.maxTouchPoints > 1;
|
|
57
57
|
return n || s;
|
|
58
58
|
}
|
|
59
59
|
static isEdgeLegacy() {
|
|
60
|
-
return this.isBrowserEnv() ? !!window.StyleMedia && !
|
|
60
|
+
return this.isBrowserEnv() ? !!window.StyleMedia && !dt.includes("edg/") : !1;
|
|
61
61
|
}
|
|
62
|
-
static isEdg(t =
|
|
62
|
+
static isEdg(t = dt) {
|
|
63
63
|
return this.isBrowserEnv() ? t.includes("edg/") : !1;
|
|
64
64
|
}
|
|
65
65
|
static isIE() {
|
|
66
66
|
return !this.isBrowserEnv() && typeof document > "u" ? !1 : !!document.documentMode;
|
|
67
67
|
}
|
|
68
|
-
static isChrome(t =
|
|
68
|
+
static isChrome(t = dt) {
|
|
69
69
|
if (!this.isBrowserEnv()) return !1;
|
|
70
|
-
const n = navigator.vendor && navigator.vendor.includes("Google"), s = t.includes("chrome") || t.includes("crios"),
|
|
71
|
-
return n && s &&
|
|
70
|
+
const n = navigator.vendor && navigator.vendor.includes("Google"), s = t.includes("chrome") || t.includes("crios"), h = !this.isEdg(t) && !this.isOpera(t);
|
|
71
|
+
return n && s && h;
|
|
72
72
|
}
|
|
73
|
-
static isElectron(t =
|
|
73
|
+
static isElectron(t = dt) {
|
|
74
74
|
return typeof process < "u" && process.versions?.electron ? !0 : t.includes("electron");
|
|
75
75
|
}
|
|
76
|
-
static isHeadlessChrome(t =
|
|
76
|
+
static isHeadlessChrome(t = dt) {
|
|
77
77
|
return t.includes("headlesschrome");
|
|
78
78
|
}
|
|
79
79
|
static isNodeRuntime() {
|
|
@@ -81,34 +81,34 @@ class H {
|
|
|
81
81
|
}
|
|
82
82
|
static getCurrentBrowser() {
|
|
83
83
|
if (typeof navigator > "u") {
|
|
84
|
-
if (
|
|
85
|
-
if (
|
|
84
|
+
if (rt.isElectron()) return et.electron;
|
|
85
|
+
if (rt.isNodeRuntime()) return et.nodeRuntime;
|
|
86
86
|
throw new Error("navigator not set");
|
|
87
87
|
}
|
|
88
88
|
const t = navigator.userAgent.toLowerCase();
|
|
89
|
-
if (
|
|
90
|
-
if (
|
|
91
|
-
if (
|
|
92
|
-
if (
|
|
93
|
-
if (
|
|
94
|
-
if (
|
|
95
|
-
if (
|
|
96
|
-
if (
|
|
97
|
-
if (
|
|
98
|
-
if (
|
|
99
|
-
if (
|
|
89
|
+
if (rt.isOpera()) return et.opera;
|
|
90
|
+
if (rt.isFirefox()) return et.firefox;
|
|
91
|
+
if (rt.isSafari()) return et.safari;
|
|
92
|
+
if (rt.isIE()) return et.ie;
|
|
93
|
+
if (rt.isEdgeLegacy()) return et.edgeLegacy;
|
|
94
|
+
if (rt.isEdg()) return et.edg;
|
|
95
|
+
if (rt.isChrome()) return et.chrome;
|
|
96
|
+
if (rt.isIOS(t)) return et.iOS;
|
|
97
|
+
if (rt.isElectron(t)) return et.electron;
|
|
98
|
+
if (rt.isHeadlessChrome(t)) return et.headlessChrome;
|
|
99
|
+
if (rt.isNodeRuntime()) return et.nodeRuntime;
|
|
100
100
|
throw new Error("Browser could not be detected: " + t);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
class ue {
|
|
104
|
-
static toBlob(t, n, s = !1,
|
|
105
|
-
return new Promise((
|
|
104
|
+
static toBlob(t, n, s = !1, h) {
|
|
105
|
+
return new Promise((S, U) => {
|
|
106
106
|
t.toBlob(
|
|
107
107
|
(I) => {
|
|
108
|
-
I ?
|
|
108
|
+
I ? S(I) : U(new Error("canvas.toBlob returned null"));
|
|
109
109
|
},
|
|
110
110
|
n,
|
|
111
|
-
s ?
|
|
111
|
+
s ? h : void 0
|
|
112
112
|
);
|
|
113
113
|
});
|
|
114
114
|
}
|
|
@@ -120,13 +120,13 @@ function Mt(a) {
|
|
|
120
120
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
121
121
|
}
|
|
122
122
|
var Et = { exports: {} };
|
|
123
|
-
var jt = Et.exports,
|
|
123
|
+
var jt = Et.exports, Tt;
|
|
124
124
|
function Yt() {
|
|
125
|
-
return
|
|
125
|
+
return Tt || (Tt = 1, (function(a, t) {
|
|
126
126
|
((n, s) => {
|
|
127
127
|
a.exports = s();
|
|
128
128
|
})(jt, function n() {
|
|
129
|
-
var s = typeof self < "u" ? self : typeof window < "u" ? window : s !== void 0 ? s : {},
|
|
129
|
+
var s = typeof self < "u" ? self : typeof window < "u" ? window : s !== void 0 ? s : {}, h, S = !s.document && !!s.postMessage, U = s.IS_PAPA_WORKER || !1, I = {}, K = 0, p = {};
|
|
130
130
|
function A(e) {
|
|
131
131
|
this._handle = null, this._finished = !1, this._completed = !1, this._halted = !1, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = !0, this._completeResults = { data: [], errors: [], meta: {} }, (function(r) {
|
|
132
132
|
var i = ct(r);
|
|
@@ -140,7 +140,7 @@ function Yt() {
|
|
|
140
140
|
this.isFirstChunk && R(this._config.beforeFirstChunk) && (y = this._config.beforeFirstChunk(r)) !== void 0 && (r = y), this.isFirstChunk = !1, this._halted = !1;
|
|
141
141
|
var u = this._partialLine + r, y = (this._partialLine = "", this._handle.parse(u, this._baseIndex, !this._finished));
|
|
142
142
|
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
143
|
-
if (r = y.meta.cursor, u = (this._finished || (this._partialLine = u.substring(r - this._baseIndex), this._baseIndex = r), y && y.data && (this._rowCount += y.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview), U) s.postMessage({ results: y, workerId:
|
|
143
|
+
if (r = y.meta.cursor, u = (this._finished || (this._partialLine = u.substring(r - this._baseIndex), this._baseIndex = r), y && y.data && (this._rowCount += y.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview), U) s.postMessage({ results: y, workerId: p.WORKER_ID, finished: u });
|
|
144
144
|
else if (R(this._config.chunk) && !i) {
|
|
145
145
|
if (this._config.chunk(y, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0);
|
|
146
146
|
this._completeResults = y = void 0;
|
|
@@ -149,12 +149,12 @@ function Yt() {
|
|
|
149
149
|
}
|
|
150
150
|
this._halted = !0;
|
|
151
151
|
}, this._sendError = function(r) {
|
|
152
|
-
R(this._config.error) ? this._config.error(r) : U && this._config.error && s.postMessage({ workerId:
|
|
152
|
+
R(this._config.error) ? this._config.error(r) : U && this._config.error && s.postMessage({ workerId: p.WORKER_ID, error: r, finished: !1 });
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
function j(e) {
|
|
156
156
|
var r;
|
|
157
|
-
(e = e || {}).chunkSize || (e.chunkSize =
|
|
157
|
+
(e = e || {}).chunkSize || (e.chunkSize = p.RemoteChunkSize), A.call(this, e), this._nextChunk = S ? function() {
|
|
158
158
|
this._readChunk(), this._chunkLoaded();
|
|
159
159
|
} : function() {
|
|
160
160
|
this._readChunk();
|
|
@@ -163,7 +163,7 @@ function Yt() {
|
|
|
163
163
|
}, this._readChunk = function() {
|
|
164
164
|
if (this._finished) this._chunkLoaded();
|
|
165
165
|
else {
|
|
166
|
-
if (r = new XMLHttpRequest(), this._config.withCredentials && (r.withCredentials = this._config.withCredentials),
|
|
166
|
+
if (r = new XMLHttpRequest(), this._config.withCredentials && (r.withCredentials = this._config.withCredentials), S || (r.onload = V(this._chunkLoaded, this), r.onerror = V(this._chunkError, this)), r.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !S), this._config.downloadRequestHeaders) {
|
|
167
167
|
var i, u = this._config.downloadRequestHeaders;
|
|
168
168
|
for (i in u) r.setRequestHeader(i, u[i]);
|
|
169
169
|
}
|
|
@@ -174,7 +174,7 @@ function Yt() {
|
|
|
174
174
|
} catch (E) {
|
|
175
175
|
this._chunkError(E.message);
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
S && r.status === 0 && this._chunkError();
|
|
178
178
|
}
|
|
179
179
|
}, this._chunkLoaded = function() {
|
|
180
180
|
r.readyState === 4 && (r.status < 200 || 400 <= r.status ? this._chunkError() : (this._start += this._config.chunkSize || r.responseText.length, this._finished = !this._config.chunkSize || this._start >= ((i) => (i = i.getResponseHeader("Content-Range")) !== null ? parseInt(i.substring(i.lastIndexOf("/") + 1)) : -1)(r), this.parseChunk(r.responseText)));
|
|
@@ -183,7 +183,7 @@ function Yt() {
|
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
function Q(e) {
|
|
186
|
-
(e = e || {}).chunkSize || (e.chunkSize =
|
|
186
|
+
(e = e || {}).chunkSize || (e.chunkSize = p.LocalChunkSize), A.call(this, e);
|
|
187
187
|
var r, i, u = typeof FileReader < "u";
|
|
188
188
|
this.stream = function(y) {
|
|
189
189
|
this._input = y, i = y.slice || y.webkitSlice || y.mozSlice, u ? ((r = new FileReader()).onload = V(this._chunkLoaded, this), r.onerror = V(this._chunkError, this)) : r = new FileReaderSync(), this._nextChunk();
|
|
@@ -235,54 +235,54 @@ function Yt() {
|
|
|
235
235
|
}, this);
|
|
236
236
|
}
|
|
237
237
|
function nt(e) {
|
|
238
|
-
var r, i, u, y, E = Math.pow(2, 53), v = -E,
|
|
239
|
-
function M(
|
|
240
|
-
return e.skipEmptyLines === "greedy" ?
|
|
238
|
+
var r, i, u, y, E = Math.pow(2, 53), v = -E, f = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, d = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, o = this, c = 0, l = 0, w = !1, g = !1, k = [], m = { data: [], errors: [], meta: {} };
|
|
239
|
+
function M(b) {
|
|
240
|
+
return e.skipEmptyLines === "greedy" ? b.join("").trim() === "" : b.length === 1 && b[0].length === 0;
|
|
241
241
|
}
|
|
242
242
|
function C() {
|
|
243
|
-
if (
|
|
244
|
-
return !M(
|
|
243
|
+
if (m && u && (W("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + p.DefaultDelimiter + "'"), u = !1), e.skipEmptyLines && (m.data = m.data.filter(function(_) {
|
|
244
|
+
return !M(_);
|
|
245
245
|
})), Y()) {
|
|
246
|
-
let
|
|
247
|
-
R(e.transformHeader) && (
|
|
246
|
+
let _ = function(L, N) {
|
|
247
|
+
R(e.transformHeader) && (L = e.transformHeader(L, N)), k.push(L);
|
|
248
248
|
};
|
|
249
|
-
if (
|
|
250
|
-
for (var
|
|
251
|
-
|
|
252
|
-
} else
|
|
249
|
+
if (m) if (Array.isArray(m.data[0])) {
|
|
250
|
+
for (var b = 0; Y() && b < m.data.length; b++) m.data[b].forEach(_);
|
|
251
|
+
m.data.splice(0, 1);
|
|
252
|
+
} else m.data.forEach(_);
|
|
253
253
|
}
|
|
254
|
-
function D(
|
|
255
|
-
for (var
|
|
256
|
-
var F =
|
|
257
|
-
if (
|
|
254
|
+
function D(_, L) {
|
|
255
|
+
for (var N = e.header ? {} : [], T = 0; T < _.length; T++) {
|
|
256
|
+
var F = T, $ = _[T], $ = ((it, x) => ((B) => (e.dynamicTypingFunction && e.dynamicTyping[B] === void 0 && (e.dynamicTyping[B] = e.dynamicTypingFunction(B)), (e.dynamicTyping[B] || e.dynamicTyping) === !0))(it) ? x === "true" || x === "TRUE" || x !== "false" && x !== "FALSE" && (((B) => {
|
|
257
|
+
if (f.test(B) && (B = parseFloat(B), v < B && B < E))
|
|
258
258
|
return 1;
|
|
259
|
-
})(x) ? parseFloat(x) :
|
|
260
|
-
F === "__parsed_extra" ? (
|
|
259
|
+
})(x) ? parseFloat(x) : d.test(x) ? new Date(x) : x === "" ? null : x) : x)(F = e.header ? T >= k.length ? "__parsed_extra" : k[T] : F, $ = e.transform ? e.transform($, F) : $);
|
|
260
|
+
F === "__parsed_extra" ? (N[F] = N[F] || [], N[F].push($)) : N[F] = $;
|
|
261
261
|
}
|
|
262
|
-
return e.header && (
|
|
262
|
+
return e.header && (T > k.length ? W("FieldMismatch", "TooManyFields", "Too many fields: expected " + k.length + " fields but parsed " + T, l + L) : T < k.length && W("FieldMismatch", "TooFewFields", "Too few fields: expected " + k.length + " fields but parsed " + T, l + L)), N;
|
|
263
263
|
}
|
|
264
264
|
var O;
|
|
265
|
-
|
|
265
|
+
m && (e.header || e.dynamicTyping || e.transform) && (O = 1, !m.data.length || Array.isArray(m.data[0]) ? (m.data = m.data.map(D), O = m.data.length) : m.data = D(m.data, 0), e.header && m.meta && (m.meta.fields = k), l += O);
|
|
266
266
|
}
|
|
267
267
|
function Y() {
|
|
268
268
|
return e.header && k.length === 0;
|
|
269
269
|
}
|
|
270
|
-
function W(
|
|
271
|
-
|
|
270
|
+
function W(b, D, O, _) {
|
|
271
|
+
b = { type: b, code: D, message: O }, _ !== void 0 && (b.row = _), m.errors.push(b);
|
|
272
272
|
}
|
|
273
|
-
R(e.step) && (y = e.step, e.step = function(
|
|
274
|
-
|
|
275
|
-
}), this.parse = function(
|
|
276
|
-
var
|
|
277
|
-
var it, x,
|
|
278
|
-
$ = $ || [",", " ", "|", ";",
|
|
273
|
+
R(e.step) && (y = e.step, e.step = function(b) {
|
|
274
|
+
m = b, Y() ? C() : (C(), m.data.length !== 0 && (c += b.data.length, e.preview && c > e.preview ? i.abort() : (m.data = m.data[0], y(m, o))));
|
|
275
|
+
}), this.parse = function(b, D, O) {
|
|
276
|
+
var _ = e.quoteChar || '"', _ = (e.newline || (e.newline = this.guessLineEndings(b, _)), u = !1, e.delimiter ? R(e.delimiter) && (e.delimiter = e.delimiter(b), m.meta.delimiter = e.delimiter) : ((_ = ((L, N, T, F, $) => {
|
|
277
|
+
var it, x, B, ht;
|
|
278
|
+
$ = $ || [",", " ", "|", ";", p.RECORD_SEP, p.UNIT_SEP];
|
|
279
279
|
for (var gt = 0; gt < $.length; gt++) {
|
|
280
|
-
for (var st, kt = $[gt], Z = 0, at = 0, J = 0,
|
|
281
|
-
0 <
|
|
280
|
+
for (var st, kt = $[gt], Z = 0, at = 0, J = 0, tt = (B = void 0, new mt({ comments: F, delimiter: kt, newline: N, preview: 10 }).parse(L)), lt = 0; lt < tt.data.length; lt++) T && M(tt.data[lt]) ? J++ : (st = tt.data[lt].length, at += st, B === void 0 ? B = st : 0 < st && (Z += Math.abs(st - B), B = st));
|
|
281
|
+
0 < tt.data.length && (at /= tt.data.length - J), (x === void 0 || Z <= x) && (ht === void 0 || ht < at) && 1.99 < at && (x = Z, it = kt, ht = at);
|
|
282
282
|
}
|
|
283
283
|
return { successful: !!(e.delimiter = it), bestDelimiter: it };
|
|
284
|
-
})(
|
|
285
|
-
return e.preview && e.header &&
|
|
284
|
+
})(b, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter = _.bestDelimiter : (u = !0, e.delimiter = p.DefaultDelimiter), m.meta.delimiter = e.delimiter), ct(e));
|
|
285
|
+
return e.preview && e.header && _.preview++, r = b, i = new mt(_), m = i.parse(r, D, O), C(), w ? { meta: { paused: !0 } } : m || { meta: { paused: !1 } };
|
|
286
286
|
}, this.paused = function() {
|
|
287
287
|
return w;
|
|
288
288
|
}, this.pause = function() {
|
|
@@ -292,16 +292,16 @@ function Yt() {
|
|
|
292
292
|
}, this.aborted = function() {
|
|
293
293
|
return g;
|
|
294
294
|
}, this.abort = function() {
|
|
295
|
-
g = !0, i.abort(),
|
|
296
|
-
}, this.guessLineEndings = function(
|
|
297
|
-
|
|
298
|
-
var
|
|
299
|
-
`),
|
|
300
|
-
if (O.length === 1 ||
|
|
295
|
+
g = !0, i.abort(), m.meta.aborted = !0, R(e.complete) && e.complete(m), r = "";
|
|
296
|
+
}, this.guessLineEndings = function(L, _) {
|
|
297
|
+
L = L.substring(0, 1048576);
|
|
298
|
+
var _ = new RegExp(ut(_) + "([^]*?)" + ut(_), "gm"), O = (L = L.replace(_, "")).split("\r"), _ = L.split(`
|
|
299
|
+
`), L = 1 < _.length && _[0].length < O[0].length;
|
|
300
|
+
if (O.length === 1 || L) return `
|
|
301
301
|
`;
|
|
302
|
-
for (var
|
|
303
|
-
` &&
|
|
304
|
-
return
|
|
302
|
+
for (var N = 0, T = 0; T < O.length; T++) O[T][0] === `
|
|
303
|
+
` && N++;
|
|
304
|
+
return N >= O.length / 2 ? `\r
|
|
305
305
|
` : "\r";
|
|
306
306
|
};
|
|
307
307
|
}
|
|
@@ -309,88 +309,88 @@ function Yt() {
|
|
|
309
309
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
310
310
|
}
|
|
311
311
|
function mt(e) {
|
|
312
|
-
var r = (e = e || {}).delimiter, i = e.newline, u = e.comments, y = e.step, E = e.preview, v = e.fastMode,
|
|
313
|
-
if (e.escapeChar !== void 0 && (c = e.escapeChar), (typeof r != "string" || -1 <
|
|
314
|
-
u === !0 ? u = "#" : (typeof u != "string" || -1 <
|
|
312
|
+
var r = (e = e || {}).delimiter, i = e.newline, u = e.comments, y = e.step, E = e.preview, v = e.fastMode, f = null, d = !1, o = e.quoteChar == null ? '"' : e.quoteChar, c = o;
|
|
313
|
+
if (e.escapeChar !== void 0 && (c = e.escapeChar), (typeof r != "string" || -1 < p.BAD_DELIMITERS.indexOf(r)) && (r = ","), u === r) throw new Error("Comment character same as delimiter");
|
|
314
|
+
u === !0 ? u = "#" : (typeof u != "string" || -1 < p.BAD_DELIMITERS.indexOf(u)) && (u = !1), i !== `
|
|
315
315
|
` && i !== "\r" && i !== `\r
|
|
316
316
|
` && (i = `
|
|
317
317
|
`);
|
|
318
318
|
var l = 0, w = !1;
|
|
319
|
-
this.parse = function(g, k,
|
|
319
|
+
this.parse = function(g, k, m) {
|
|
320
320
|
if (typeof g != "string") throw new Error("Input must be a string");
|
|
321
|
-
var M = g.length, C = r.length, Y = i.length, W = u.length,
|
|
321
|
+
var M = g.length, C = r.length, Y = i.length, W = u.length, b = R(y), D = [], O = [], _ = [], L = l = 0;
|
|
322
322
|
if (!g) return Z();
|
|
323
323
|
if (v || v !== !1 && g.indexOf(o) === -1) {
|
|
324
|
-
for (var
|
|
325
|
-
if (
|
|
326
|
-
else if (
|
|
327
|
-
if (!u ||
|
|
328
|
-
if (
|
|
329
|
-
if (D = [], ht(
|
|
330
|
-
} else ht(
|
|
331
|
-
if (E && E <=
|
|
324
|
+
for (var N = g.split(i), T = 0; T < N.length; T++) {
|
|
325
|
+
if (_ = N[T], l += _.length, T !== N.length - 1) l += i.length;
|
|
326
|
+
else if (m) return Z();
|
|
327
|
+
if (!u || _.substring(0, W) !== u) {
|
|
328
|
+
if (b) {
|
|
329
|
+
if (D = [], ht(_.split(r)), at(), w) return Z();
|
|
330
|
+
} else ht(_.split(r));
|
|
331
|
+
if (E && E <= T) return D = D.slice(0, E), Z(!0);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
return Z();
|
|
335
335
|
}
|
|
336
336
|
for (var F = g.indexOf(r, l), $ = g.indexOf(i, l), it = new RegExp(ut(c) + ut(o), "g"), x = g.indexOf(o, l); ; ) if (g[l] === o) for (x = l, l++; ; ) {
|
|
337
|
-
if ((x = g.indexOf(o, x + 1)) === -1) return
|
|
337
|
+
if ((x = g.indexOf(o, x + 1)) === -1) return m || O.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: D.length, index: l }), st();
|
|
338
338
|
if (x === M - 1) return st(g.substring(l, x).replace(it, o));
|
|
339
339
|
if (o === c && g[x + 1] === c) x++;
|
|
340
340
|
else if (o === c || x === 0 || g[x - 1] !== c) {
|
|
341
341
|
F !== -1 && F < x + 1 && (F = g.indexOf(r, x + 1));
|
|
342
|
-
var
|
|
343
|
-
if (g.substr(x + 1 +
|
|
344
|
-
|
|
342
|
+
var B = gt(($ = $ !== -1 && $ < x + 1 ? g.indexOf(i, x + 1) : $) === -1 ? F : Math.min(F, $));
|
|
343
|
+
if (g.substr(x + 1 + B, C) === r) {
|
|
344
|
+
_.push(g.substring(l, x).replace(it, o)), g[l = x + 1 + B + C] !== o && (x = g.indexOf(o, l)), F = g.indexOf(r, l), $ = g.indexOf(i, l);
|
|
345
345
|
break;
|
|
346
346
|
}
|
|
347
|
-
if (
|
|
348
|
-
if (
|
|
347
|
+
if (B = gt($), g.substring(x + 1 + B, x + 1 + B + Y) === i) {
|
|
348
|
+
if (_.push(g.substring(l, x).replace(it, o)), kt(x + 1 + B + Y), F = g.indexOf(r, l), x = g.indexOf(o, l), b && (at(), w)) return Z();
|
|
349
349
|
if (E && D.length >= E) return Z(!0);
|
|
350
350
|
break;
|
|
351
351
|
}
|
|
352
352
|
O.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: D.length, index: l }), x++;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
else if (u &&
|
|
355
|
+
else if (u && _.length === 0 && g.substring(l, l + W) === u) {
|
|
356
356
|
if ($ === -1) return Z();
|
|
357
357
|
l = $ + Y, $ = g.indexOf(i, l), F = g.indexOf(r, l);
|
|
358
|
-
} else if (F !== -1 && (F < $ || $ === -1))
|
|
358
|
+
} else if (F !== -1 && (F < $ || $ === -1)) _.push(g.substring(l, F)), l = F + C, F = g.indexOf(r, l);
|
|
359
359
|
else {
|
|
360
360
|
if ($ === -1) break;
|
|
361
|
-
if (
|
|
361
|
+
if (_.push(g.substring(l, $)), kt($ + Y), b && (at(), w)) return Z();
|
|
362
362
|
if (E && D.length >= E) return Z(!0);
|
|
363
363
|
}
|
|
364
364
|
return st();
|
|
365
365
|
function ht(J) {
|
|
366
|
-
D.push(J),
|
|
366
|
+
D.push(J), L = l;
|
|
367
367
|
}
|
|
368
368
|
function gt(J) {
|
|
369
|
-
var
|
|
370
|
-
return
|
|
369
|
+
var tt = 0;
|
|
370
|
+
return tt = J !== -1 && (J = g.substring(x + 1, J)) && J.trim() === "" ? J.length : tt;
|
|
371
371
|
}
|
|
372
372
|
function st(J) {
|
|
373
|
-
return
|
|
373
|
+
return m || (J === void 0 && (J = g.substring(l)), _.push(J), l = M, ht(_), b && at()), Z();
|
|
374
374
|
}
|
|
375
375
|
function kt(J) {
|
|
376
|
-
l = J, ht(
|
|
376
|
+
l = J, ht(_), _ = [], $ = g.indexOf(i, l);
|
|
377
377
|
}
|
|
378
378
|
function Z(J) {
|
|
379
|
-
if (e.header && !k && D.length && !
|
|
380
|
-
var
|
|
379
|
+
if (e.header && !k && D.length && !d) {
|
|
380
|
+
var tt = D[0], lt = /* @__PURE__ */ Object.create(null), $t = new Set(tt);
|
|
381
381
|
let Rt = !1;
|
|
382
|
-
for (let yt = 0; yt <
|
|
383
|
-
let ot =
|
|
382
|
+
for (let yt = 0; yt < tt.length; yt++) {
|
|
383
|
+
let ot = tt[yt];
|
|
384
384
|
if (lt[ot = R(e.transformHeader) ? e.transformHeader(ot, yt) : ot]) {
|
|
385
|
-
let _t,
|
|
386
|
-
for (; _t = ot + "_" +
|
|
387
|
-
$t.add(_t),
|
|
388
|
-
} else lt[ot] = 1,
|
|
385
|
+
let _t, Lt = lt[ot];
|
|
386
|
+
for (; _t = ot + "_" + Lt, Lt++, $t.has(_t); ) ;
|
|
387
|
+
$t.add(_t), tt[yt] = _t, lt[ot]++, Rt = !0, (f = f === null ? {} : f)[_t] = ot;
|
|
388
|
+
} else lt[ot] = 1, tt[yt] = ot;
|
|
389
389
|
$t.add(ot);
|
|
390
390
|
}
|
|
391
|
-
Rt && console.warn("Duplicate headers found and renamed."),
|
|
391
|
+
Rt && console.warn("Duplicate headers found and renamed."), d = !0;
|
|
392
392
|
}
|
|
393
|
-
return { data: D, errors: O, meta: { delimiter: r, linebreak: i, aborted: w, truncated: !!J, cursor:
|
|
393
|
+
return { data: D, errors: O, meta: { delimiter: r, linebreak: i, aborted: w, truncated: !!J, cursor: L + (k || 0), renamedHeaders: f } };
|
|
394
394
|
}
|
|
395
395
|
function at() {
|
|
396
396
|
y(Z()), D = [], O = [];
|
|
@@ -406,20 +406,20 @@ function Yt() {
|
|
|
406
406
|
if (r.error) i.userError(r.error, r.file);
|
|
407
407
|
else if (r.results && r.results.data) {
|
|
408
408
|
var y = { abort: function() {
|
|
409
|
-
u = !0,
|
|
410
|
-
}, pause:
|
|
409
|
+
u = !0, ft(r.workerId, { data: [], errors: [], meta: { aborted: !0 } });
|
|
410
|
+
}, pause: St, resume: St };
|
|
411
411
|
if (R(i.userStep)) {
|
|
412
412
|
for (var E = 0; E < r.results.data.length && (i.userStep({ data: r.results.data[E], errors: r.results.errors, meta: r.results.meta }, y), !u); E++) ;
|
|
413
413
|
delete r.results;
|
|
414
414
|
} else R(i.userChunk) && (i.userChunk(r.results, y, r.file), delete r.results);
|
|
415
415
|
}
|
|
416
|
-
r.finished && !u &&
|
|
416
|
+
r.finished && !u && ft(r.workerId, r.results);
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function ft(e, r) {
|
|
419
419
|
var i = I[e];
|
|
420
420
|
R(i.userComplete) && i.userComplete(r), i.terminate(), delete I[e];
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function St() {
|
|
423
423
|
throw new Error("Not implemented.");
|
|
424
424
|
}
|
|
425
425
|
function ct(e) {
|
|
@@ -436,103 +436,103 @@ function Yt() {
|
|
|
436
436
|
function R(e) {
|
|
437
437
|
return typeof e == "function";
|
|
438
438
|
}
|
|
439
|
-
return
|
|
439
|
+
return p.parse = function(e, r) {
|
|
440
440
|
var i = (r = r || {}).dynamicTyping || !1;
|
|
441
|
-
if (R(i) && (r.dynamicTypingFunction = i, i = {}), r.dynamicTyping = i, r.transform = !!R(r.transform) && r.transform, !r.worker || !
|
|
441
|
+
if (R(i) && (r.dynamicTypingFunction = i, i = {}), r.dynamicTyping = i, r.transform = !!R(r.transform) && r.transform, !r.worker || !p.WORKERS_SUPPORTED) return i = null, p.NODE_STREAM_INPUT, typeof e == "string" ? (e = ((u) => u.charCodeAt(0) !== 65279 ? u : u.slice(1))(e), i = new (r.download ? j : q)(r)) : e.readable === !0 && R(e.read) && R(e.on) ? i = new G(r) : (s.File && e instanceof File || e instanceof Object) && (i = new Q(r)), i.stream(e);
|
|
442
442
|
(i = (() => {
|
|
443
443
|
var u;
|
|
444
|
-
return !!
|
|
444
|
+
return !!p.WORKERS_SUPPORTED && (u = (() => {
|
|
445
445
|
var y = s.URL || s.webkitURL || null, E = n.toString();
|
|
446
|
-
return
|
|
446
|
+
return p.BLOB_URL || (p.BLOB_URL = y.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", E, ")();"], { type: "text/javascript" })));
|
|
447
447
|
})(), (u = new s.Worker(u)).onmessage = wt, u.id = K++, I[u.id] = u);
|
|
448
448
|
})()).userStep = r.step, i.userChunk = r.chunk, i.userComplete = r.complete, i.userError = r.error, r.step = R(r.step), r.chunk = R(r.chunk), r.complete = R(r.complete), r.error = R(r.error), delete r.worker, i.postMessage({ input: e, config: r, workerId: i.id });
|
|
449
|
-
},
|
|
449
|
+
}, p.unparse = function(e, r) {
|
|
450
450
|
var i = !1, u = !0, y = ",", E = `\r
|
|
451
|
-
`, v = '"',
|
|
451
|
+
`, v = '"', f = v + v, d = !1, o = null, c = !1, l = ((() => {
|
|
452
452
|
if (typeof r == "object") {
|
|
453
|
-
if (typeof r.delimiter != "string" ||
|
|
453
|
+
if (typeof r.delimiter != "string" || p.BAD_DELIMITERS.filter(function(k) {
|
|
454
454
|
return r.delimiter.indexOf(k) !== -1;
|
|
455
|
-
}).length || (y = r.delimiter), typeof r.quotes != "boolean" && typeof r.quotes != "function" && !Array.isArray(r.quotes) || (i = r.quotes), typeof r.skipEmptyLines != "boolean" && typeof r.skipEmptyLines != "string" || (
|
|
455
|
+
}).length || (y = r.delimiter), typeof r.quotes != "boolean" && typeof r.quotes != "function" && !Array.isArray(r.quotes) || (i = r.quotes), typeof r.skipEmptyLines != "boolean" && typeof r.skipEmptyLines != "string" || (d = r.skipEmptyLines), typeof r.newline == "string" && (E = r.newline), typeof r.quoteChar == "string" && (v = r.quoteChar), typeof r.header == "boolean" && (u = r.header), Array.isArray(r.columns)) {
|
|
456
456
|
if (r.columns.length === 0) throw new Error("Option columns is empty");
|
|
457
457
|
o = r.columns;
|
|
458
458
|
}
|
|
459
|
-
r.escapeChar !== void 0 && (
|
|
459
|
+
r.escapeChar !== void 0 && (f = r.escapeChar + v), r.escapeFormulae instanceof RegExp ? c = r.escapeFormulae : typeof r.escapeFormulae == "boolean" && r.escapeFormulae && (c = /^[=+\-@\t\r].*$/);
|
|
460
460
|
}
|
|
461
461
|
})(), new RegExp(ut(v), "g"));
|
|
462
462
|
if (typeof e == "string" && (e = JSON.parse(e)), Array.isArray(e)) {
|
|
463
|
-
if (!e.length || Array.isArray(e[0])) return w(null, e,
|
|
464
|
-
if (typeof e[0] == "object") return w(o || Object.keys(e[0]), e,
|
|
465
|
-
} else if (typeof e == "object") return typeof e.data == "string" && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || o), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : typeof e.data[0] == "object" ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || typeof e.data[0] == "object" || (e.data = [e.data])), w(e.fields || [], e.data || [],
|
|
463
|
+
if (!e.length || Array.isArray(e[0])) return w(null, e, d);
|
|
464
|
+
if (typeof e[0] == "object") return w(o || Object.keys(e[0]), e, d);
|
|
465
|
+
} else if (typeof e == "object") return typeof e.data == "string" && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || o), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : typeof e.data[0] == "object" ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || typeof e.data[0] == "object" || (e.data = [e.data])), w(e.fields || [], e.data || [], d);
|
|
466
466
|
throw new Error("Unable to serialize unrecognized input");
|
|
467
|
-
function w(k,
|
|
468
|
-
var C = "", Y = (typeof k == "string" && (k = JSON.parse(k)), typeof
|
|
467
|
+
function w(k, m, M) {
|
|
468
|
+
var C = "", Y = (typeof k == "string" && (k = JSON.parse(k)), typeof m == "string" && (m = JSON.parse(m)), Array.isArray(k) && 0 < k.length), W = !Array.isArray(m[0]);
|
|
469
469
|
if (Y && u) {
|
|
470
|
-
for (var
|
|
471
|
-
0 <
|
|
470
|
+
for (var b = 0; b < k.length; b++) 0 < b && (C += y), C += g(k[b], b);
|
|
471
|
+
0 < m.length && (C += E);
|
|
472
472
|
}
|
|
473
|
-
for (var D = 0; D <
|
|
474
|
-
var O = (Y ? k :
|
|
475
|
-
if (M && !Y && (
|
|
476
|
-
for (var
|
|
477
|
-
var F = W ? k[
|
|
478
|
-
|
|
473
|
+
for (var D = 0; D < m.length; D++) {
|
|
474
|
+
var O = (Y ? k : m[D]).length, _ = !1, L = Y ? Object.keys(m[D]).length === 0 : m[D].length === 0;
|
|
475
|
+
if (M && !Y && (_ = M === "greedy" ? m[D].join("").trim() === "" : m[D].length === 1 && m[D][0].length === 0), M === "greedy" && Y) {
|
|
476
|
+
for (var N = [], T = 0; T < O; T++) {
|
|
477
|
+
var F = W ? k[T] : T;
|
|
478
|
+
N.push(m[D][F]);
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
_ = N.join("").trim() === "";
|
|
481
481
|
}
|
|
482
|
-
if (!
|
|
482
|
+
if (!_) {
|
|
483
483
|
for (var $ = 0; $ < O; $++) {
|
|
484
|
-
0 < $ && !
|
|
484
|
+
0 < $ && !L && (C += y);
|
|
485
485
|
var it = Y && W ? k[$] : $;
|
|
486
|
-
C += g(
|
|
486
|
+
C += g(m[D][it], $);
|
|
487
487
|
}
|
|
488
|
-
D <
|
|
488
|
+
D < m.length - 1 && (!M || 0 < O && !L) && (C += E);
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
return C;
|
|
492
492
|
}
|
|
493
|
-
function g(k,
|
|
493
|
+
function g(k, m) {
|
|
494
494
|
var M, C;
|
|
495
|
-
return k == null ? "" : k.constructor === Date ? JSON.stringify(k).slice(1, 25) : (C = !1, c && typeof k == "string" && c.test(k) && (k = "'" + k, C = !0), M = k.toString().replace(l,
|
|
496
|
-
for (var
|
|
495
|
+
return k == null ? "" : k.constructor === Date ? JSON.stringify(k).slice(1, 25) : (C = !1, c && typeof k == "string" && c.test(k) && (k = "'" + k, C = !0), M = k.toString().replace(l, f), (C = C || i === !0 || typeof i == "function" && i(k, m) || Array.isArray(i) && i[m] || ((Y, W) => {
|
|
496
|
+
for (var b = 0; b < W.length; b++) if (-1 < Y.indexOf(W[b])) return !0;
|
|
497
497
|
return !1;
|
|
498
|
-
})(M,
|
|
498
|
+
})(M, p.BAD_DELIMITERS) || -1 < M.indexOf(y) || M.charAt(0) === " " || M.charAt(M.length - 1) === " ") ? v + M + v : M);
|
|
499
499
|
}
|
|
500
|
-
},
|
|
501
|
-
`, '"',
|
|
500
|
+
}, p.RECORD_SEP = "", p.UNIT_SEP = "", p.BYTE_ORDER_MARK = "\uFEFF", p.BAD_DELIMITERS = ["\r", `
|
|
501
|
+
`, '"', p.BYTE_ORDER_MARK], p.WORKERS_SUPPORTED = !S && !!s.Worker, p.NODE_STREAM_INPUT = 1, p.LocalChunkSize = 10485760, p.RemoteChunkSize = 5242880, p.DefaultDelimiter = ",", p.Parser = mt, p.ParserHandle = nt, p.NetworkStreamer = j, p.FileStreamer = Q, p.StringStreamer = q, p.ReadableStreamStreamer = G, s.jQuery && ((h = s.jQuery).fn.parse = function(e) {
|
|
502
502
|
var r = e.config || {}, i = [];
|
|
503
503
|
return this.each(function(E) {
|
|
504
|
-
if (!(
|
|
505
|
-
for (var v = 0; v < this.files.length; v++) i.push({ file: this.files[v], inputElem: this, instanceConfig:
|
|
504
|
+
if (!(h(this).prop("tagName").toUpperCase() === "INPUT" && h(this).attr("type").toLowerCase() === "file" && s.FileReader) || !this.files || this.files.length === 0) return !0;
|
|
505
|
+
for (var v = 0; v < this.files.length; v++) i.push({ file: this.files[v], inputElem: this, instanceConfig: h.extend({}, r) });
|
|
506
506
|
}), u(), this;
|
|
507
507
|
function u() {
|
|
508
508
|
if (i.length === 0) R(e.complete) && e.complete();
|
|
509
509
|
else {
|
|
510
|
-
var E, v,
|
|
510
|
+
var E, v, f, d, o = i[0];
|
|
511
511
|
if (R(e.before)) {
|
|
512
512
|
var c = e.before(o.file, o.inputElem);
|
|
513
513
|
if (typeof c == "object") {
|
|
514
|
-
if (c.action === "abort") return E = "AbortError", v = o.file,
|
|
514
|
+
if (c.action === "abort") return E = "AbortError", v = o.file, f = o.inputElem, d = c.reason, void (R(e.error) && e.error({ name: E }, v, f, d));
|
|
515
515
|
if (c.action === "skip") return void y();
|
|
516
|
-
typeof c.config == "object" && (o.instanceConfig =
|
|
516
|
+
typeof c.config == "object" && (o.instanceConfig = h.extend(o.instanceConfig, c.config));
|
|
517
517
|
} else if (c === "skip") return void y();
|
|
518
518
|
}
|
|
519
519
|
var l = o.instanceConfig.complete;
|
|
520
520
|
o.instanceConfig.complete = function(w) {
|
|
521
521
|
R(l) && l(w, o.file, o.inputElem), y();
|
|
522
|
-
},
|
|
522
|
+
}, p.parse(o.file, o.instanceConfig);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
function y() {
|
|
526
526
|
i.splice(0, 1), u();
|
|
527
527
|
}
|
|
528
528
|
}), U && (s.onmessage = function(e) {
|
|
529
|
-
e = e.data,
|
|
530
|
-
}), (j.prototype = Object.create(A.prototype)).constructor = j, (Q.prototype = Object.create(A.prototype)).constructor = Q, (q.prototype = Object.create(q.prototype)).constructor = q, (G.prototype = Object.create(A.prototype)).constructor = G,
|
|
529
|
+
e = e.data, p.WORKER_ID === void 0 && e && (p.WORKER_ID = e.workerId), typeof e.input == "string" ? s.postMessage({ workerId: p.WORKER_ID, results: p.parse(e.input, e.config), finished: !0 }) : (s.File && e.input instanceof File || e.input instanceof Object) && (e = p.parse(e.input, e.config)) && s.postMessage({ workerId: p.WORKER_ID, results: e, finished: !0 });
|
|
530
|
+
}), (j.prototype = Object.create(A.prototype)).constructor = j, (Q.prototype = Object.create(A.prototype)).constructor = Q, (q.prototype = Object.create(q.prototype)).constructor = q, (G.prototype = Object.create(A.prototype)).constructor = G, p;
|
|
531
531
|
});
|
|
532
532
|
})(Et)), Et.exports;
|
|
533
533
|
}
|
|
534
|
-
var
|
|
535
|
-
const
|
|
534
|
+
var Nt = Yt();
|
|
535
|
+
const Bt = /* @__PURE__ */ Mt(Nt), { parse: Pt, unparse: Wt } = Bt;
|
|
536
536
|
class le {
|
|
537
537
|
static unparse(t, n) {
|
|
538
538
|
return Wt(t, n);
|
|
@@ -541,8 +541,8 @@ class le {
|
|
|
541
541
|
return new Promise((n, s) => {
|
|
542
542
|
Pt(t, {
|
|
543
543
|
header: !0,
|
|
544
|
-
complete: (
|
|
545
|
-
error: (
|
|
544
|
+
complete: (h) => n(h),
|
|
545
|
+
error: (h) => s(h)
|
|
546
546
|
});
|
|
547
547
|
});
|
|
548
548
|
}
|
|
@@ -552,14 +552,17 @@ class qt {
|
|
|
552
552
|
static utf8BomMimeType = /^\s*(?:text\/\S*|application\/xml|\S+\/\S+\+xml)\s*;\s*charset\s*=\s*utf-8/i;
|
|
553
553
|
/**
|
|
554
554
|
* Starts a browser download for a blob.
|
|
555
|
-
*
|
|
556
|
-
*
|
|
555
|
+
* Missing file names fall back to the Blob's File name or "download".
|
|
556
|
+
* Browsers that ignore the download attribute use the link target as a new-tab fallback.
|
|
557
557
|
* Call this method directly from a user interaction to avoid browser download restrictions.
|
|
558
558
|
*/
|
|
559
559
|
static saveAs(t, n, s = {}) {
|
|
560
560
|
this.assertBrowserEnvironment();
|
|
561
|
-
const
|
|
562
|
-
this.downloadBlob(
|
|
561
|
+
const h = this.resolveFileName(t, n), S = s.autoBom ? this.addUtf8Bom(t) : t;
|
|
562
|
+
this.downloadBlob(S, h);
|
|
563
|
+
}
|
|
564
|
+
static resolveFileName(t, n) {
|
|
565
|
+
return typeof n == "string" && n.trim().length > 0 ? n : typeof File < "u" && t instanceof File && t.name.trim().length > 0 ? t.name : "download";
|
|
563
566
|
}
|
|
564
567
|
static addUtf8Bom(t) {
|
|
565
568
|
return this.utf8BomMimeType.test(t.type) ? new Blob(["\uFEFF", t], { type: t.type }) : t;
|
|
@@ -573,34 +576,24 @@ class qt {
|
|
|
573
576
|
static downloadBlob(t, n) {
|
|
574
577
|
const s = URL.createObjectURL(t);
|
|
575
578
|
try {
|
|
576
|
-
|
|
579
|
+
this.clickDownloadLink(s, n);
|
|
577
580
|
} finally {
|
|
578
581
|
window.setTimeout(() => URL.revokeObjectURL(s), this.revokeObjectUrlDelay);
|
|
579
582
|
}
|
|
580
583
|
}
|
|
581
|
-
static
|
|
582
|
-
const
|
|
583
|
-
if (!
|
|
584
|
-
return !1;
|
|
585
|
-
try {
|
|
586
|
-
return n.opener = null, n.location.replace(t), !0;
|
|
587
|
-
} catch {
|
|
588
|
-
return n.close(), !1;
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
static clickDownloadLink(t, n, s = !0) {
|
|
592
|
-
const m = document.body ?? document.documentElement;
|
|
593
|
-
if (!m)
|
|
584
|
+
static clickDownloadLink(t, n) {
|
|
585
|
+
const s = document.body ?? document.documentElement;
|
|
586
|
+
if (!s)
|
|
594
587
|
throw new Error("DownloadHelper.saveAs requires an initialized document.");
|
|
595
|
-
const
|
|
588
|
+
const h = document.createElement("a");
|
|
596
589
|
try {
|
|
597
|
-
|
|
590
|
+
h.download = n, h.href = t, h.target = "_blank", h.rel = "noopener noreferrer", h.style.display = "none", s.appendChild(h), h.click();
|
|
598
591
|
} finally {
|
|
599
|
-
|
|
592
|
+
h.remove();
|
|
600
593
|
}
|
|
601
594
|
}
|
|
602
595
|
}
|
|
603
|
-
class
|
|
596
|
+
class de {
|
|
604
597
|
static getEnumValue(t, n) {
|
|
605
598
|
if (n in t)
|
|
606
599
|
return t[n];
|
|
@@ -613,7 +606,7 @@ class fe {
|
|
|
613
606
|
}));
|
|
614
607
|
}
|
|
615
608
|
}
|
|
616
|
-
class
|
|
609
|
+
class fe {
|
|
617
610
|
static getFileExtension(t) {
|
|
618
611
|
let n = "";
|
|
619
612
|
const s = t.lastIndexOf(".");
|
|
@@ -624,32 +617,32 @@ class de {
|
|
|
624
617
|
*/
|
|
625
618
|
static readAsText(t) {
|
|
626
619
|
const n = new FileReader();
|
|
627
|
-
return new Promise((s,
|
|
620
|
+
return new Promise((s, h) => {
|
|
628
621
|
n.onload = () => {
|
|
629
|
-
n.onload = null, n.onerror = null, typeof n.result == "string" ? s(n.result) :
|
|
622
|
+
n.onload = null, n.onerror = null, typeof n.result == "string" ? s(n.result) : h(new Error("Unexpected result type"));
|
|
630
623
|
}, n.onerror = () => {
|
|
631
|
-
const
|
|
632
|
-
n.onload = null, n.onerror = null,
|
|
624
|
+
const S = n.error ?? new Error("FileReader error");
|
|
625
|
+
n.onload = null, n.onerror = null, h(S);
|
|
633
626
|
}, n.readAsText(t);
|
|
634
627
|
});
|
|
635
628
|
}
|
|
636
629
|
static readAsArrayBuffer(t) {
|
|
637
630
|
const n = new FileReader();
|
|
638
|
-
return new Promise((s,
|
|
631
|
+
return new Promise((s, h) => {
|
|
639
632
|
n.onload = () => {
|
|
640
|
-
n.onload = null, n.onerror = null, n.result instanceof ArrayBuffer ? s(n.result) :
|
|
633
|
+
n.onload = null, n.onerror = null, n.result instanceof ArrayBuffer ? s(n.result) : h(new Error("Unexpected result type"));
|
|
641
634
|
}, n.onerror = () => {
|
|
642
|
-
const
|
|
643
|
-
n.onload = null, n.onerror = null,
|
|
635
|
+
const S = n.error ?? new Error("FileReader error");
|
|
636
|
+
n.onload = null, n.onerror = null, h(S);
|
|
644
637
|
}, n.readAsArrayBuffer(t);
|
|
645
638
|
});
|
|
646
639
|
}
|
|
647
640
|
static readAsDataUrl(t) {
|
|
648
641
|
const n = new FileReader();
|
|
649
|
-
return new Promise((s,
|
|
650
|
-
n.onload = (
|
|
651
|
-
s(
|
|
652
|
-
}, n.onerror = (
|
|
642
|
+
return new Promise((s, h) => {
|
|
643
|
+
n.onload = (S) => {
|
|
644
|
+
s(S);
|
|
645
|
+
}, n.onerror = (S) => h(S), n.readAsDataURL(t);
|
|
653
646
|
});
|
|
654
647
|
}
|
|
655
648
|
/** usage:
|
|
@@ -659,39 +652,50 @@ class de {
|
|
|
659
652
|
static formatFileSize(t, n = 2, s) {
|
|
660
653
|
if (t === 0)
|
|
661
654
|
return "0 Bytes";
|
|
662
|
-
const
|
|
663
|
-
let U = Math.floor(Math.log(t) / Math.log(
|
|
664
|
-
s &&
|
|
665
|
-
const I = t / Math.pow(
|
|
666
|
-
return `${parseFloat(I.toFixed(n))} ${
|
|
655
|
+
const h = 1024, S = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
656
|
+
let U = Math.floor(Math.log(t) / Math.log(h));
|
|
657
|
+
s && S.includes(s) && (U = S.indexOf(s));
|
|
658
|
+
const I = t / Math.pow(h, U);
|
|
659
|
+
return `${parseFloat(I.toFixed(n))} ${S[U]}`;
|
|
660
|
+
}
|
|
661
|
+
static isWithinSizeLimit(t, n) {
|
|
662
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
663
|
+
throw new RangeError("maxBytes must be a non-negative safe integer.");
|
|
664
|
+
return t.size <= n;
|
|
667
665
|
}
|
|
668
666
|
static save(t, n, s) {
|
|
669
|
-
const
|
|
670
|
-
qt.saveAs(
|
|
667
|
+
const h = new Blob([t], { type: s });
|
|
668
|
+
qt.saveAs(h, n);
|
|
671
669
|
}
|
|
672
670
|
}
|
|
673
671
|
class he {
|
|
672
|
+
static hasAllowedMimeType(t, n) {
|
|
673
|
+
const s = t.type.trim().toLowerCase();
|
|
674
|
+
return s.length > 0 && n.some(
|
|
675
|
+
(h) => h.trim().toLowerCase() === s
|
|
676
|
+
);
|
|
677
|
+
}
|
|
674
678
|
static load(t) {
|
|
675
679
|
const n = URL.createObjectURL(t);
|
|
676
680
|
return this.loadSource(n).finally(() => URL.revokeObjectURL(n));
|
|
677
681
|
}
|
|
678
682
|
static async compress(t, n = 0.8, s = "image/jpeg") {
|
|
679
|
-
const
|
|
680
|
-
return
|
|
683
|
+
const h = await this.loadSource(t), { canvas: S } = this.resize(h, h.width, h.height);
|
|
684
|
+
return S.toDataURL(s, n);
|
|
681
685
|
}
|
|
682
686
|
static resize(t, n, s) {
|
|
683
|
-
let { width:
|
|
684
|
-
const U = n /
|
|
685
|
-
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
const A =
|
|
689
|
-
return A.clearRect(0, 0,
|
|
687
|
+
let { width: h, height: S } = t;
|
|
688
|
+
const U = n / h, I = s / S, K = Math.min(U, I, 1);
|
|
689
|
+
h = Math.floor(h * K), S = Math.floor(S * K);
|
|
690
|
+
const p = document.createElement("canvas");
|
|
691
|
+
p.width = h, p.height = S;
|
|
692
|
+
const A = p.getContext("2d");
|
|
693
|
+
return A.clearRect(0, 0, h, S), A.drawImage(t, 0, 0, h, S), { canvas: p, width: h, height: S };
|
|
690
694
|
}
|
|
691
695
|
static loadSource(t) {
|
|
692
696
|
return new Promise((n, s) => {
|
|
693
|
-
const
|
|
694
|
-
|
|
697
|
+
const h = new Image();
|
|
698
|
+
h.onload = () => n(h), h.onerror = s, h.src = t;
|
|
695
699
|
});
|
|
696
700
|
}
|
|
697
701
|
}
|
|
@@ -747,9 +751,9 @@ class X {
|
|
|
747
751
|
args: n,
|
|
748
752
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
749
753
|
};
|
|
750
|
-
for (const
|
|
754
|
+
for (const h of X.listeners)
|
|
751
755
|
try {
|
|
752
|
-
if (
|
|
756
|
+
if (h(s) === !1)
|
|
753
757
|
return;
|
|
754
758
|
} catch {
|
|
755
759
|
}
|
|
@@ -757,9 +761,9 @@ class X {
|
|
|
757
761
|
}
|
|
758
762
|
static onLog(t, n = !1) {
|
|
759
763
|
if (n) {
|
|
760
|
-
const s = (
|
|
764
|
+
const s = (h) => {
|
|
761
765
|
try {
|
|
762
|
-
return t(
|
|
766
|
+
return t(h);
|
|
763
767
|
} finally {
|
|
764
768
|
X.listeners.delete(s);
|
|
765
769
|
}
|
|
@@ -770,8 +774,8 @@ class X {
|
|
|
770
774
|
}
|
|
771
775
|
}
|
|
772
776
|
const Kt = (a, t, n) => a.localeCompare(t) * (n ? 1 : -1), Jt = (a, t) => a < t ? -1 : a === t ? 0 : 1, Qt = (a, t, n) => Jt(a, t) * (n ? 1 : -1), Vt = (a, t, n) => typeof a == "string" && typeof t == "string" ? Kt(a, t, n) : Qt(a, t, n), Zt = (a, t, n, s) => {
|
|
773
|
-
const
|
|
774
|
-
return Vt(
|
|
777
|
+
const h = n(a), S = n(t);
|
|
778
|
+
return Vt(h, S, s);
|
|
775
779
|
};
|
|
776
780
|
class pe {
|
|
777
781
|
static get(t) {
|
|
@@ -824,8 +828,8 @@ function P(a, t, n) {
|
|
|
824
828
|
function me() {
|
|
825
829
|
P(Array.prototype, "distinct", function(a) {
|
|
826
830
|
return a ? this.filter(
|
|
827
|
-
(n, s,
|
|
828
|
-
) : this.filter((n, s,
|
|
831
|
+
(n, s, h) => h.findIndex((S) => a(S, n)) === s
|
|
832
|
+
) : this.filter((n, s, h) => h.indexOf(n) === s);
|
|
829
833
|
}), P(Array.prototype, "filterBy", function(a) {
|
|
830
834
|
return this.filter((t) => a(t));
|
|
831
835
|
}), P(Array.prototype, "first", function() {
|
|
@@ -847,56 +851,56 @@ function Xt() {
|
|
|
847
851
|
(function(n, s) {
|
|
848
852
|
a.exports = s();
|
|
849
853
|
})(Gt, (function() {
|
|
850
|
-
var n = 1e3, s = 6e4,
|
|
851
|
-
var
|
|
852
|
-
return "[" + v + (
|
|
853
|
-
} },
|
|
854
|
+
var n = 1e3, s = 6e4, h = 36e5, S = "millisecond", U = "second", I = "minute", K = "hour", p = "day", A = "week", j = "month", Q = "quarter", q = "year", G = "date", nt = "Invalid Date", ut = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, mt = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, wt = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(v) {
|
|
855
|
+
var f = ["th", "st", "nd", "rd"], d = v % 100;
|
|
856
|
+
return "[" + v + (f[(d - 20) % 10] || f[d] || f[0]) + "]";
|
|
857
|
+
} }, ft = function(v, f, d) {
|
|
854
858
|
var o = String(v);
|
|
855
|
-
return !o || o.length >=
|
|
856
|
-
},
|
|
857
|
-
var
|
|
858
|
-
return (
|
|
859
|
-
}, m: function v(
|
|
860
|
-
if (
|
|
861
|
-
var o = 12 * (
|
|
862
|
-
return +(-(o + (
|
|
859
|
+
return !o || o.length >= f ? v : "" + Array(f + 1 - o.length).join(d) + v;
|
|
860
|
+
}, St = { s: ft, z: function(v) {
|
|
861
|
+
var f = -v.utcOffset(), d = Math.abs(f), o = Math.floor(d / 60), c = d % 60;
|
|
862
|
+
return (f <= 0 ? "+" : "-") + ft(o, 2, "0") + ":" + ft(c, 2, "0");
|
|
863
|
+
}, m: function v(f, d) {
|
|
864
|
+
if (f.date() < d.date()) return -v(d, f);
|
|
865
|
+
var o = 12 * (d.year() - f.year()) + (d.month() - f.month()), c = f.clone().add(o, j), l = d - c < 0, w = f.clone().add(o + (l ? -1 : 1), j);
|
|
866
|
+
return +(-(o + (d - c) / (l ? c - w : w - c)) || 0);
|
|
863
867
|
}, a: function(v) {
|
|
864
868
|
return v < 0 ? Math.ceil(v) || 0 : Math.floor(v);
|
|
865
869
|
}, p: function(v) {
|
|
866
|
-
return { M: j, y: q, w: A, d:
|
|
870
|
+
return { M: j, y: q, w: A, d: p, D: G, h: K, m: I, s: U, ms: S, Q }[v] || String(v || "").toLowerCase().replace(/s$/, "");
|
|
867
871
|
}, u: function(v) {
|
|
868
872
|
return v === void 0;
|
|
869
873
|
} }, ct = "en", V = {};
|
|
870
874
|
V[ct] = wt;
|
|
871
875
|
var R = "$isDayjsObject", e = function(v) {
|
|
872
876
|
return v instanceof y || !(!v || !v[R]);
|
|
873
|
-
}, r = function v(
|
|
877
|
+
}, r = function v(f, d, o) {
|
|
874
878
|
var c;
|
|
875
|
-
if (!
|
|
876
|
-
if (typeof
|
|
877
|
-
var l =
|
|
878
|
-
V[l] && (c = l),
|
|
879
|
-
var w =
|
|
879
|
+
if (!f) return ct;
|
|
880
|
+
if (typeof f == "string") {
|
|
881
|
+
var l = f.toLowerCase();
|
|
882
|
+
V[l] && (c = l), d && (V[l] = d, c = l);
|
|
883
|
+
var w = f.split("-");
|
|
880
884
|
if (!c && w.length > 1) return v(w[0]);
|
|
881
885
|
} else {
|
|
882
|
-
var g =
|
|
883
|
-
V[g] =
|
|
886
|
+
var g = f.name;
|
|
887
|
+
V[g] = f, c = g;
|
|
884
888
|
}
|
|
885
889
|
return !o && c && (ct = c), c || !o && ct;
|
|
886
|
-
}, i = function(v,
|
|
890
|
+
}, i = function(v, f) {
|
|
887
891
|
if (e(v)) return v.clone();
|
|
888
|
-
var
|
|
889
|
-
return
|
|
890
|
-
}, u =
|
|
891
|
-
u.l = r, u.i = e, u.w = function(v,
|
|
892
|
-
return i(v, { locale:
|
|
892
|
+
var d = typeof f == "object" ? f : {};
|
|
893
|
+
return d.date = v, d.args = arguments, new y(d);
|
|
894
|
+
}, u = St;
|
|
895
|
+
u.l = r, u.i = e, u.w = function(v, f) {
|
|
896
|
+
return i(v, { locale: f.$L, utc: f.$u, x: f.$x, $offset: f.$offset });
|
|
893
897
|
};
|
|
894
898
|
var y = (function() {
|
|
895
|
-
function v(
|
|
896
|
-
this.$L = r(
|
|
899
|
+
function v(d) {
|
|
900
|
+
this.$L = r(d.locale, null, !0), this.parse(d), this.$x = this.$x || d.x || {}, this[R] = !0;
|
|
897
901
|
}
|
|
898
|
-
var
|
|
899
|
-
return
|
|
902
|
+
var f = v.prototype;
|
|
903
|
+
return f.parse = function(d) {
|
|
900
904
|
this.$d = (function(o) {
|
|
901
905
|
var c = o.date, l = o.utc;
|
|
902
906
|
if (c === null) return /* @__PURE__ */ new Date(NaN);
|
|
@@ -910,43 +914,43 @@ function Xt() {
|
|
|
910
914
|
}
|
|
911
915
|
}
|
|
912
916
|
return new Date(c);
|
|
913
|
-
})(
|
|
914
|
-
},
|
|
915
|
-
var
|
|
916
|
-
this.$y =
|
|
917
|
-
},
|
|
917
|
+
})(d), this.init();
|
|
918
|
+
}, f.init = function() {
|
|
919
|
+
var d = this.$d;
|
|
920
|
+
this.$y = d.getFullYear(), this.$M = d.getMonth(), this.$D = d.getDate(), this.$W = d.getDay(), this.$H = d.getHours(), this.$m = d.getMinutes(), this.$s = d.getSeconds(), this.$ms = d.getMilliseconds();
|
|
921
|
+
}, f.$utils = function() {
|
|
918
922
|
return u;
|
|
919
|
-
},
|
|
923
|
+
}, f.isValid = function() {
|
|
920
924
|
return this.$d.toString() !== nt;
|
|
921
|
-
},
|
|
922
|
-
var c = i(
|
|
925
|
+
}, f.isSame = function(d, o) {
|
|
926
|
+
var c = i(d);
|
|
923
927
|
return this.startOf(o) <= c && c <= this.endOf(o);
|
|
924
|
-
},
|
|
925
|
-
return i(
|
|
926
|
-
},
|
|
927
|
-
return this.endOf(o) < i(
|
|
928
|
-
},
|
|
929
|
-
return u.u(
|
|
930
|
-
},
|
|
928
|
+
}, f.isAfter = function(d, o) {
|
|
929
|
+
return i(d) < this.startOf(o);
|
|
930
|
+
}, f.isBefore = function(d, o) {
|
|
931
|
+
return this.endOf(o) < i(d);
|
|
932
|
+
}, f.$g = function(d, o, c) {
|
|
933
|
+
return u.u(d) ? this[o] : this.set(c, d);
|
|
934
|
+
}, f.unix = function() {
|
|
931
935
|
return Math.floor(this.valueOf() / 1e3);
|
|
932
|
-
},
|
|
936
|
+
}, f.valueOf = function() {
|
|
933
937
|
return this.$d.getTime();
|
|
934
|
-
},
|
|
935
|
-
var c = this, l = !!u.u(o) || o, w = u.p(
|
|
936
|
-
var
|
|
937
|
-
return l ?
|
|
938
|
+
}, f.startOf = function(d, o) {
|
|
939
|
+
var c = this, l = !!u.u(o) || o, w = u.p(d), g = function(D, O) {
|
|
940
|
+
var _ = u.w(c.$u ? Date.UTC(c.$y, O, D) : new Date(c.$y, O, D), c);
|
|
941
|
+
return l ? _ : _.endOf(p);
|
|
938
942
|
}, k = function(D, O) {
|
|
939
943
|
return u.w(c.toDate()[D].apply(c.toDate("s"), (l ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(O)), c);
|
|
940
|
-
},
|
|
944
|
+
}, m = this.$W, M = this.$M, C = this.$D, Y = "set" + (this.$u ? "UTC" : "");
|
|
941
945
|
switch (w) {
|
|
942
946
|
case q:
|
|
943
947
|
return l ? g(1, 0) : g(31, 11);
|
|
944
948
|
case j:
|
|
945
949
|
return l ? g(1, M) : g(0, M + 1);
|
|
946
950
|
case A:
|
|
947
|
-
var W = this.$locale().weekStart || 0,
|
|
948
|
-
return g(l ? C -
|
|
949
|
-
case
|
|
951
|
+
var W = this.$locale().weekStart || 0, b = (m < W ? m + 7 : m) - W;
|
|
952
|
+
return g(l ? C - b : C + (6 - b), M);
|
|
953
|
+
case p:
|
|
950
954
|
case G:
|
|
951
955
|
return k(Y + "Hours", 0);
|
|
952
956
|
case K:
|
|
@@ -958,60 +962,60 @@ function Xt() {
|
|
|
958
962
|
default:
|
|
959
963
|
return this.clone();
|
|
960
964
|
}
|
|
961
|
-
},
|
|
962
|
-
return this.startOf(
|
|
963
|
-
},
|
|
964
|
-
var c, l = u.p(
|
|
965
|
+
}, f.endOf = function(d) {
|
|
966
|
+
return this.startOf(d, !1);
|
|
967
|
+
}, f.$set = function(d, o) {
|
|
968
|
+
var c, l = u.p(d), w = "set" + (this.$u ? "UTC" : ""), g = (c = {}, c[p] = w + "Date", c[G] = w + "Date", c[j] = w + "Month", c[q] = w + "FullYear", c[K] = w + "Hours", c[I] = w + "Minutes", c[U] = w + "Seconds", c[S] = w + "Milliseconds", c)[l], k = l === p ? this.$D + (o - this.$W) : o;
|
|
965
969
|
if (l === j || l === q) {
|
|
966
|
-
var
|
|
967
|
-
|
|
970
|
+
var m = this.clone().set(G, 1);
|
|
971
|
+
m.$d[g](k), m.init(), this.$d = m.set(G, Math.min(this.$D, m.daysInMonth())).$d;
|
|
968
972
|
} else g && this.$d[g](k);
|
|
969
973
|
return this.init(), this;
|
|
970
|
-
},
|
|
971
|
-
return this.clone().$set(
|
|
972
|
-
},
|
|
973
|
-
return this[u.p(
|
|
974
|
-
},
|
|
974
|
+
}, f.set = function(d, o) {
|
|
975
|
+
return this.clone().$set(d, o);
|
|
976
|
+
}, f.get = function(d) {
|
|
977
|
+
return this[u.p(d)]();
|
|
978
|
+
}, f.add = function(d, o) {
|
|
975
979
|
var c, l = this;
|
|
976
|
-
|
|
980
|
+
d = Number(d);
|
|
977
981
|
var w = u.p(o), g = function(M) {
|
|
978
982
|
var C = i(l);
|
|
979
|
-
return u.w(C.date(C.date() + Math.round(M *
|
|
983
|
+
return u.w(C.date(C.date() + Math.round(M * d)), l);
|
|
980
984
|
};
|
|
981
|
-
if (w === j) return this.set(j, this.$M +
|
|
982
|
-
if (w === q) return this.set(q, this.$y +
|
|
983
|
-
if (w ===
|
|
985
|
+
if (w === j) return this.set(j, this.$M + d);
|
|
986
|
+
if (w === q) return this.set(q, this.$y + d);
|
|
987
|
+
if (w === p) return g(1);
|
|
984
988
|
if (w === A) return g(7);
|
|
985
|
-
var k = (c = {}, c[I] = s, c[K] =
|
|
986
|
-
return u.w(
|
|
987
|
-
},
|
|
988
|
-
return this.add(-1 *
|
|
989
|
-
},
|
|
989
|
+
var k = (c = {}, c[I] = s, c[K] = h, c[U] = n, c)[w] || 1, m = this.$d.getTime() + d * k;
|
|
990
|
+
return u.w(m, this);
|
|
991
|
+
}, f.subtract = function(d, o) {
|
|
992
|
+
return this.add(-1 * d, o);
|
|
993
|
+
}, f.format = function(d) {
|
|
990
994
|
var o = this, c = this.$locale();
|
|
991
995
|
if (!this.isValid()) return c.invalidDate || nt;
|
|
992
|
-
var l =
|
|
993
|
-
return O && (O[
|
|
994
|
-
},
|
|
996
|
+
var l = d || "YYYY-MM-DDTHH:mm:ssZ", w = u.z(this), g = this.$H, k = this.$m, m = this.$M, M = c.weekdays, C = c.months, Y = c.meridiem, W = function(O, _, L, N) {
|
|
997
|
+
return O && (O[_] || O(o, l)) || L[_].slice(0, N);
|
|
998
|
+
}, b = function(O) {
|
|
995
999
|
return u.s(g % 12 || 12, O, "0");
|
|
996
|
-
}, D = Y || function(O,
|
|
997
|
-
var
|
|
998
|
-
return
|
|
1000
|
+
}, D = Y || function(O, _, L) {
|
|
1001
|
+
var N = O < 12 ? "AM" : "PM";
|
|
1002
|
+
return L ? N.toLowerCase() : N;
|
|
999
1003
|
};
|
|
1000
|
-
return l.replace(mt, (function(O,
|
|
1001
|
-
return
|
|
1002
|
-
switch (
|
|
1004
|
+
return l.replace(mt, (function(O, _) {
|
|
1005
|
+
return _ || (function(L) {
|
|
1006
|
+
switch (L) {
|
|
1003
1007
|
case "YY":
|
|
1004
1008
|
return String(o.$y).slice(-2);
|
|
1005
1009
|
case "YYYY":
|
|
1006
1010
|
return u.s(o.$y, 4, "0");
|
|
1007
1011
|
case "M":
|
|
1008
|
-
return
|
|
1012
|
+
return m + 1;
|
|
1009
1013
|
case "MM":
|
|
1010
|
-
return u.s(
|
|
1014
|
+
return u.s(m + 1, 2, "0");
|
|
1011
1015
|
case "MMM":
|
|
1012
|
-
return W(c.monthsShort,
|
|
1016
|
+
return W(c.monthsShort, m, C, 3);
|
|
1013
1017
|
case "MMMM":
|
|
1014
|
-
return W(C,
|
|
1018
|
+
return W(C, m);
|
|
1015
1019
|
case "D":
|
|
1016
1020
|
return o.$D;
|
|
1017
1021
|
case "DD":
|
|
@@ -1029,9 +1033,9 @@ function Xt() {
|
|
|
1029
1033
|
case "HH":
|
|
1030
1034
|
return u.s(g, 2, "0");
|
|
1031
1035
|
case "h":
|
|
1032
|
-
return
|
|
1036
|
+
return b(1);
|
|
1033
1037
|
case "hh":
|
|
1034
|
-
return
|
|
1038
|
+
return b(2);
|
|
1035
1039
|
case "a":
|
|
1036
1040
|
return D(g, k, !0);
|
|
1037
1041
|
case "A":
|
|
@@ -1052,10 +1056,10 @@ function Xt() {
|
|
|
1052
1056
|
return null;
|
|
1053
1057
|
})(O) || w.replace(":", "");
|
|
1054
1058
|
}));
|
|
1055
|
-
},
|
|
1059
|
+
}, f.utcOffset = function() {
|
|
1056
1060
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1057
|
-
},
|
|
1058
|
-
var l, w = this, g = u.p(o), k = i(
|
|
1061
|
+
}, f.diff = function(d, o, c) {
|
|
1062
|
+
var l, w = this, g = u.p(o), k = i(d), m = (k.utcOffset() - this.utcOffset()) * s, M = this - k, C = function() {
|
|
1059
1063
|
return u.m(w, k);
|
|
1060
1064
|
};
|
|
1061
1065
|
switch (g) {
|
|
@@ -1069,13 +1073,13 @@ function Xt() {
|
|
|
1069
1073
|
l = C() / 3;
|
|
1070
1074
|
break;
|
|
1071
1075
|
case A:
|
|
1072
|
-
l = (M -
|
|
1076
|
+
l = (M - m) / 6048e5;
|
|
1073
1077
|
break;
|
|
1074
|
-
case
|
|
1075
|
-
l = (M -
|
|
1078
|
+
case p:
|
|
1079
|
+
l = (M - m) / 864e5;
|
|
1076
1080
|
break;
|
|
1077
1081
|
case K:
|
|
1078
|
-
l = M /
|
|
1082
|
+
l = M / h;
|
|
1079
1083
|
break;
|
|
1080
1084
|
case I:
|
|
1081
1085
|
l = M / s;
|
|
@@ -1087,32 +1091,32 @@ function Xt() {
|
|
|
1087
1091
|
l = M;
|
|
1088
1092
|
}
|
|
1089
1093
|
return c ? l : u.a(l);
|
|
1090
|
-
},
|
|
1094
|
+
}, f.daysInMonth = function() {
|
|
1091
1095
|
return this.endOf(j).$D;
|
|
1092
|
-
},
|
|
1096
|
+
}, f.$locale = function() {
|
|
1093
1097
|
return V[this.$L];
|
|
1094
|
-
},
|
|
1095
|
-
if (!
|
|
1096
|
-
var c = this.clone(), l = r(
|
|
1098
|
+
}, f.locale = function(d, o) {
|
|
1099
|
+
if (!d) return this.$L;
|
|
1100
|
+
var c = this.clone(), l = r(d, o, !0);
|
|
1097
1101
|
return l && (c.$L = l), c;
|
|
1098
|
-
},
|
|
1102
|
+
}, f.clone = function() {
|
|
1099
1103
|
return u.w(this.$d, this);
|
|
1100
|
-
},
|
|
1104
|
+
}, f.toDate = function() {
|
|
1101
1105
|
return new Date(this.valueOf());
|
|
1102
|
-
},
|
|
1106
|
+
}, f.toJSON = function() {
|
|
1103
1107
|
return this.isValid() ? this.toISOString() : null;
|
|
1104
|
-
},
|
|
1108
|
+
}, f.toISOString = function() {
|
|
1105
1109
|
return this.$d.toISOString();
|
|
1106
|
-
},
|
|
1110
|
+
}, f.toString = function() {
|
|
1107
1111
|
return this.$d.toUTCString();
|
|
1108
1112
|
}, v;
|
|
1109
1113
|
})(), E = y.prototype;
|
|
1110
|
-
return i.prototype = E, [["$ms",
|
|
1111
|
-
E[v[1]] = function(
|
|
1112
|
-
return this.$g(
|
|
1114
|
+
return i.prototype = E, [["$ms", S], ["$s", U], ["$m", I], ["$H", K], ["$W", p], ["$M", j], ["$y", q], ["$D", G]].forEach((function(v) {
|
|
1115
|
+
E[v[1]] = function(f) {
|
|
1116
|
+
return this.$g(f, v[0], v[1]);
|
|
1113
1117
|
};
|
|
1114
|
-
})), i.extend = function(v,
|
|
1115
|
-
return v.$i || (v(
|
|
1118
|
+
})), i.extend = function(v, f) {
|
|
1119
|
+
return v.$i || (v(f, y, i), v.$i = !0), i;
|
|
1116
1120
|
}, i.locale = r, i.isDayjs = e, i.unix = function(v) {
|
|
1117
1121
|
return i(1e3 * v);
|
|
1118
1122
|
}, i.en = V[ct], i.Ls = V, i.p = {}, i;
|
|
@@ -1120,7 +1124,7 @@ function Xt() {
|
|
|
1120
1124
|
})(xt)), xt.exports;
|
|
1121
1125
|
}
|
|
1122
1126
|
var Ht = Xt();
|
|
1123
|
-
const
|
|
1127
|
+
const H = /* @__PURE__ */ Mt(Ht);
|
|
1124
1128
|
var Dt = { exports: {} }, te = Dt.exports, At;
|
|
1125
1129
|
function ee() {
|
|
1126
1130
|
return At || (At = 1, (function(a, t) {
|
|
@@ -1128,23 +1132,23 @@ function ee() {
|
|
|
1128
1132
|
a.exports = s();
|
|
1129
1133
|
})(te, (function() {
|
|
1130
1134
|
var n = "day";
|
|
1131
|
-
return function(s,
|
|
1132
|
-
var U = function(
|
|
1133
|
-
return
|
|
1134
|
-
}, I =
|
|
1135
|
+
return function(s, h, S) {
|
|
1136
|
+
var U = function(p) {
|
|
1137
|
+
return p.add(4 - p.isoWeekday(), n);
|
|
1138
|
+
}, I = h.prototype;
|
|
1135
1139
|
I.isoWeekYear = function() {
|
|
1136
1140
|
return U(this).year();
|
|
1137
|
-
}, I.isoWeek = function(
|
|
1138
|
-
if (!this.$utils().u(
|
|
1139
|
-
var A, j, Q, q, G = U(this), nt = (A = this.isoWeekYear(), j = this.$u, Q = (j ?
|
|
1141
|
+
}, I.isoWeek = function(p) {
|
|
1142
|
+
if (!this.$utils().u(p)) return this.add(7 * (p - this.isoWeek()), n);
|
|
1143
|
+
var A, j, Q, q, G = U(this), nt = (A = this.isoWeekYear(), j = this.$u, Q = (j ? S.utc : S)().year(A).startOf("year"), q = 4 - Q.isoWeekday(), Q.isoWeekday() > 4 && (q += 7), Q.add(q, n));
|
|
1140
1144
|
return G.diff(nt, "week") + 1;
|
|
1141
|
-
}, I.isoWeekday = function(
|
|
1142
|
-
return this.$utils().u(
|
|
1145
|
+
}, I.isoWeekday = function(p) {
|
|
1146
|
+
return this.$utils().u(p) ? this.day() || 7 : this.day(this.day() % 7 ? p : p - 7);
|
|
1143
1147
|
};
|
|
1144
1148
|
var K = I.startOf;
|
|
1145
|
-
I.startOf = function(
|
|
1149
|
+
I.startOf = function(p, A) {
|
|
1146
1150
|
var j = this.$utils(), Q = !!j.u(A) || A;
|
|
1147
|
-
return j.p(
|
|
1151
|
+
return j.p(p) === "isoweek" ? Q ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : K.bind(this)(p, A);
|
|
1148
1152
|
};
|
|
1149
1153
|
};
|
|
1150
1154
|
}));
|
|
@@ -1159,18 +1163,18 @@ function se() {
|
|
|
1159
1163
|
a.exports = s();
|
|
1160
1164
|
})(ie, (function() {
|
|
1161
1165
|
var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
|
|
1162
|
-
return function(s,
|
|
1163
|
-
var U =
|
|
1164
|
-
|
|
1166
|
+
return function(s, h, S) {
|
|
1167
|
+
var U = h.prototype, I = U.format;
|
|
1168
|
+
S.en.formats = n, U.format = function(K) {
|
|
1165
1169
|
K === void 0 && (K = "YYYY-MM-DDTHH:mm:ssZ");
|
|
1166
|
-
var
|
|
1170
|
+
var p = this.$locale().formats, A = (function(j, Q) {
|
|
1167
1171
|
return j.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(q, G, nt) {
|
|
1168
1172
|
var ut = nt && nt.toUpperCase();
|
|
1169
|
-
return G || Q[nt] || n[nt] || Q[ut].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(mt, wt,
|
|
1170
|
-
return wt ||
|
|
1173
|
+
return G || Q[nt] || n[nt] || Q[ut].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(mt, wt, ft) {
|
|
1174
|
+
return wt || ft.slice(1);
|
|
1171
1175
|
}));
|
|
1172
1176
|
}));
|
|
1173
|
-
})(K,
|
|
1177
|
+
})(K, p === void 0 ? {} : p);
|
|
1174
1178
|
return I.call(this, A);
|
|
1175
1179
|
};
|
|
1176
1180
|
};
|
|
@@ -1179,66 +1183,66 @@ function se() {
|
|
|
1179
1183
|
}
|
|
1180
1184
|
var ae = se();
|
|
1181
1185
|
const oe = /* @__PURE__ */ Mt(ae);
|
|
1182
|
-
|
|
1183
|
-
|
|
1186
|
+
H.extend(oe);
|
|
1187
|
+
H.extend(ne);
|
|
1184
1188
|
function ge() {
|
|
1185
1189
|
P(
|
|
1186
1190
|
Date.prototype,
|
|
1187
1191
|
"add",
|
|
1188
1192
|
function(a, t) {
|
|
1189
|
-
return
|
|
1193
|
+
return H(this).add(a, t).toDate();
|
|
1190
1194
|
}
|
|
1191
1195
|
), P(
|
|
1192
1196
|
Date.prototype,
|
|
1193
1197
|
"diff",
|
|
1194
1198
|
function(a, t) {
|
|
1195
|
-
return
|
|
1199
|
+
return H(this).diff(a, t);
|
|
1196
1200
|
}
|
|
1197
1201
|
), P(Date.prototype, "endOf", function(a) {
|
|
1198
|
-
return
|
|
1202
|
+
return H(this).endOf(a).toDate();
|
|
1199
1203
|
}), P(Date.prototype, "firstDayOfMonth", function() {
|
|
1200
|
-
return
|
|
1204
|
+
return H(this).startOf("month").toDate();
|
|
1201
1205
|
}), P(
|
|
1202
1206
|
Date.prototype,
|
|
1203
1207
|
"format",
|
|
1204
1208
|
function(a) {
|
|
1205
|
-
return
|
|
1209
|
+
return H(this).format(a);
|
|
1206
1210
|
}
|
|
1207
1211
|
), P(
|
|
1208
1212
|
Date.prototype,
|
|
1209
1213
|
"isAfter",
|
|
1210
1214
|
function(a, t) {
|
|
1211
|
-
return
|
|
1215
|
+
return H(this).isAfter(a, t);
|
|
1212
1216
|
}
|
|
1213
1217
|
), P(
|
|
1214
1218
|
Date.prototype,
|
|
1215
1219
|
"isBefore",
|
|
1216
1220
|
function(a, t) {
|
|
1217
|
-
return
|
|
1221
|
+
return H(this).isBefore(a, t);
|
|
1218
1222
|
}
|
|
1219
1223
|
), P(Date.prototype, "isValid", function() {
|
|
1220
|
-
return
|
|
1224
|
+
return H(this).isValid();
|
|
1221
1225
|
}), P(Date.prototype, "isoWeek", function() {
|
|
1222
|
-
return
|
|
1226
|
+
return H(this).isoWeek();
|
|
1223
1227
|
}), P(
|
|
1224
1228
|
Date.prototype,
|
|
1225
1229
|
"subtract",
|
|
1226
1230
|
function(a, t) {
|
|
1227
|
-
return
|
|
1231
|
+
return H(this).subtract(a, t).toDate();
|
|
1228
1232
|
}
|
|
1229
1233
|
), P(Date.prototype, "lastDayOfMonth", function() {
|
|
1230
|
-
return
|
|
1234
|
+
return H(this).endOf("month").toDate();
|
|
1231
1235
|
}), P(
|
|
1232
1236
|
Date.prototype,
|
|
1233
1237
|
"set",
|
|
1234
1238
|
function(a, t) {
|
|
1235
|
-
return
|
|
1239
|
+
return H(this).set(a, t).toDate();
|
|
1236
1240
|
}
|
|
1237
1241
|
), P(
|
|
1238
1242
|
Date.prototype,
|
|
1239
1243
|
"startOf",
|
|
1240
1244
|
function(a) {
|
|
1241
|
-
return
|
|
1245
|
+
return H(this).startOf(a).toDate();
|
|
1242
1246
|
}
|
|
1243
1247
|
);
|
|
1244
1248
|
}
|
|
@@ -1286,19 +1290,19 @@ class ve {
|
|
|
1286
1290
|
export {
|
|
1287
1291
|
pt as BreakPointHelper,
|
|
1288
1292
|
zt as BreakPoints,
|
|
1289
|
-
|
|
1293
|
+
rt as BrowserHelper,
|
|
1290
1294
|
ve as BrowserService,
|
|
1291
|
-
|
|
1295
|
+
et as BrowserType,
|
|
1292
1296
|
ue as CanvasHelper,
|
|
1293
1297
|
le as CsvHelper,
|
|
1294
1298
|
qt as DownloadHelper,
|
|
1295
|
-
|
|
1296
|
-
|
|
1299
|
+
de as EnumHelper,
|
|
1300
|
+
fe as FileHelper,
|
|
1297
1301
|
he as ImageHelper,
|
|
1298
1302
|
Ct as LocalStorageHelper,
|
|
1299
1303
|
X as LoggerHelper,
|
|
1300
1304
|
vt as LoggerType,
|
|
1301
|
-
|
|
1305
|
+
bt as ScreenHelper,
|
|
1302
1306
|
pe as TokenHelper,
|
|
1303
1307
|
z as WindowResizeHelper,
|
|
1304
1308
|
ce as copyToClipboard,
|