@oardi/ts-utils 0.0.19 → 0.0.20
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/browser/browser-type.enum.d.ts.map +1 -0
- package/helpers/browser/browser.helper.d.ts +16 -0
- package/helpers/browser/browser.helper.d.ts.map +1 -0
- package/helpers/browser/index.d.ts +3 -0
- package/helpers/browser/index.d.ts.map +1 -0
- package/index.cjs.js +9 -9
- package/index.es.js +539 -590
- package/index.umd.js +9 -9
- package/package.json +1 -1
- package/services/browser/browser.consts.d.ts +3 -0
- package/services/browser/browser.consts.d.ts.map +1 -0
- package/services/browser/browser.service.d.ts +4 -18
- package/services/browser/browser.service.d.ts.map +1 -1
- package/services/browser/browser.types.d.ts +4 -0
- package/services/browser/browser.types.d.ts.map +1 -0
- package/services/browser/index.d.ts +2 -1
- package/services/browser/index.d.ts.map +1 -1
- package/services/browser/browser-type.enum.d.ts.map +0 -1
- /package/{services → helpers}/browser/browser-type.enum.d.ts +0 -0
package/index.es.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
function
|
|
2
|
-
return navigator.clipboard.writeText(
|
|
1
|
+
function Xe(u) {
|
|
2
|
+
return navigator.clipboard.writeText(u);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function be(u) {
|
|
5
|
+
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
|
|
6
6
|
}
|
|
7
|
-
var
|
|
7
|
+
var _e = { exports: {} };
|
|
8
8
|
/* @license
|
|
9
9
|
Papa Parse
|
|
10
10
|
v5.5.3
|
|
11
11
|
https://github.com/mholt/PapaParse
|
|
12
12
|
License: MIT
|
|
13
13
|
*/
|
|
14
|
-
var $e =
|
|
15
|
-
function
|
|
16
|
-
return De || (De = 1, (function(
|
|
17
|
-
((i,
|
|
18
|
-
|
|
14
|
+
var $e = _e.exports, De;
|
|
15
|
+
function Ce() {
|
|
16
|
+
return De || (De = 1, (function(u, r) {
|
|
17
|
+
((i, l) => {
|
|
18
|
+
u.exports = l();
|
|
19
19
|
})($e, function i() {
|
|
20
|
-
var
|
|
20
|
+
var l = typeof self < "u" ? self : typeof window < "u" ? window : l !== void 0 ? l : {}, v, O = !l.document && !!l.postMessage, T = l.IS_PAPA_WORKER || !1, P = {}, Y = 0, w = {};
|
|
21
21
|
function N(e) {
|
|
22
22
|
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(t) {
|
|
23
|
-
var n =
|
|
24
|
-
n.chunkSize = parseInt(n.chunkSize), t.step || t.chunk || (n.chunkSize = null), this._handle = new
|
|
23
|
+
var n = se(t);
|
|
24
|
+
n.chunkSize = parseInt(n.chunkSize), t.step || t.chunk || (n.chunkSize = null), this._handle = new ee(n), (this._handle.streamer = this)._config = n;
|
|
25
25
|
}).call(this, e), this.parseChunk = function(t, n) {
|
|
26
|
-
var
|
|
27
|
-
if (this.isFirstChunk && 0 <
|
|
26
|
+
var a = parseInt(this._config.skipFirstNLines) || 0;
|
|
27
|
+
if (this.isFirstChunk && 0 < a) {
|
|
28
28
|
let S = this._config.newline;
|
|
29
|
-
S || (g = this._config.quoteChar || '"', S = this._handle.guessLineEndings(t, g)), t = [...t.split(S).slice(
|
|
29
|
+
S || (g = this._config.quoteChar || '"', S = this._handle.guessLineEndings(t, g)), t = [...t.split(S).slice(a)].join(S);
|
|
30
30
|
}
|
|
31
|
-
this.isFirstChunk &&
|
|
32
|
-
var
|
|
31
|
+
this.isFirstChunk && R(this._config.beforeFirstChunk) && (g = this._config.beforeFirstChunk(t)) !== void 0 && (t = g), this.isFirstChunk = !1, this._halted = !1;
|
|
32
|
+
var a = this._partialLine + t, g = (this._partialLine = "", this._handle.parse(a, this._baseIndex, !this._finished));
|
|
33
33
|
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
34
|
-
if (t = g.meta.cursor,
|
|
35
|
-
else if (
|
|
34
|
+
if (t = g.meta.cursor, a = (this._finished || (this._partialLine = a.substring(t - this._baseIndex), this._baseIndex = t), g && g.data && (this._rowCount += g.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview), T) l.postMessage({ results: g, workerId: w.WORKER_ID, finished: a });
|
|
35
|
+
else if (R(this._config.chunk) && !n) {
|
|
36
36
|
if (this._config.chunk(g, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0);
|
|
37
37
|
this._completeResults = g = void 0;
|
|
38
38
|
}
|
|
39
|
-
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(g.data), this._completeResults.errors = this._completeResults.errors.concat(g.errors), this._completeResults.meta = g.meta), this._completed || !
|
|
39
|
+
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(g.data), this._completeResults.errors = this._completeResults.errors.concat(g.errors), this._completeResults.meta = g.meta), this._completed || !a || !R(this._config.complete) || g && g.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = !0), a || g && g.meta.paused || this._nextChunk(), g;
|
|
40
40
|
}
|
|
41
41
|
this._halted = !0;
|
|
42
42
|
}, this._sendError = function(t) {
|
|
43
|
-
|
|
43
|
+
R(this._config.error) ? this._config.error(t) : T && this._config.error && l.postMessage({ workerId: w.WORKER_ID, error: t, finished: !1 });
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
function W(e) {
|
|
47
47
|
var t;
|
|
48
|
-
(e = e || {}).chunkSize || (e.chunkSize = w.RemoteChunkSize), N.call(this, e), this._nextChunk =
|
|
48
|
+
(e = e || {}).chunkSize || (e.chunkSize = w.RemoteChunkSize), N.call(this, e), this._nextChunk = O ? function() {
|
|
49
49
|
this._readChunk(), this._chunkLoaded();
|
|
50
50
|
} : function() {
|
|
51
51
|
this._readChunk();
|
|
@@ -54,9 +54,9 @@ function Ae() {
|
|
|
54
54
|
}, this._readChunk = function() {
|
|
55
55
|
if (this._finished) this._chunkLoaded();
|
|
56
56
|
else {
|
|
57
|
-
if (t = new XMLHttpRequest(), this._config.withCredentials && (t.withCredentials = this._config.withCredentials),
|
|
58
|
-
var n,
|
|
59
|
-
for (n in
|
|
57
|
+
if (t = new XMLHttpRequest(), this._config.withCredentials && (t.withCredentials = this._config.withCredentials), O || (t.onload = q(this._chunkLoaded, this), t.onerror = q(this._chunkError, this)), t.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !O), this._config.downloadRequestHeaders) {
|
|
58
|
+
var n, a = this._config.downloadRequestHeaders;
|
|
59
|
+
for (n in a) t.setRequestHeader(n, a[n]);
|
|
60
60
|
}
|
|
61
61
|
var g;
|
|
62
62
|
this._config.chunkSize && (g = this._start + this._config.chunkSize - 1, t.setRequestHeader("Range", "bytes=" + this._start + "-" + g));
|
|
@@ -65,7 +65,7 @@ function Ae() {
|
|
|
65
65
|
} catch (S) {
|
|
66
66
|
this._chunkError(S.message);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
O && t.status === 0 && this._chunkError();
|
|
69
69
|
}
|
|
70
70
|
}, this._chunkLoaded = function() {
|
|
71
71
|
t.readyState === 4 && (t.status < 200 || 400 <= t.status ? this._chunkError() : (this._start += this._config.chunkSize || t.responseText.length, this._finished = !this._config.chunkSize || this._start >= ((n) => (n = n.getResponseHeader("Content-Range")) !== null ? parseInt(n.substring(n.lastIndexOf("/") + 1)) : -1)(t), this.parseChunk(t.responseText)));
|
|
@@ -73,16 +73,16 @@ function Ae() {
|
|
|
73
73
|
n = t.statusText || n, this._sendError(new Error(n));
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function X(e) {
|
|
77
77
|
(e = e || {}).chunkSize || (e.chunkSize = w.LocalChunkSize), N.call(this, e);
|
|
78
|
-
var t, n,
|
|
78
|
+
var t, n, a = typeof FileReader < "u";
|
|
79
79
|
this.stream = function(g) {
|
|
80
|
-
this._input = g, n = g.slice || g.webkitSlice || g.mozSlice,
|
|
80
|
+
this._input = g, n = g.slice || g.webkitSlice || g.mozSlice, a ? ((t = new FileReader()).onload = q(this._chunkLoaded, this), t.onerror = q(this._chunkError, this)) : t = new FileReaderSync(), this._nextChunk();
|
|
81
81
|
}, this._nextChunk = function() {
|
|
82
82
|
this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
|
|
83
83
|
}, this._readChunk = function() {
|
|
84
84
|
var g = this._input, S = (this._config.chunkSize && (S = Math.min(this._start + this._config.chunkSize, this._input.size), g = n.call(g, this._start, S)), t.readAsText(g, this._config.encoding));
|
|
85
|
-
|
|
85
|
+
a || this._chunkLoaded({ target: { result: S } });
|
|
86
86
|
}, this._chunkLoaded = function(g) {
|
|
87
87
|
this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(g.target.result);
|
|
88
88
|
}, this._chunkError = function() {
|
|
@@ -94,13 +94,13 @@ function Ae() {
|
|
|
94
94
|
N.call(this, e = e || {}), this.stream = function(n) {
|
|
95
95
|
return t = n, this._nextChunk();
|
|
96
96
|
}, this._nextChunk = function() {
|
|
97
|
-
var n,
|
|
98
|
-
if (!this._finished) return n = this._config.chunkSize, t = n ? (
|
|
97
|
+
var n, a;
|
|
98
|
+
if (!this._finished) return n = this._config.chunkSize, t = n ? (a = t.substring(0, n), t.substring(n)) : (a = t, ""), this._finished = !t, this.parseChunk(a);
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
function Q(e) {
|
|
102
102
|
N.call(this, e = e || {});
|
|
103
|
-
var t = [], n = !0,
|
|
103
|
+
var t = [], n = !0, a = !1;
|
|
104
104
|
this.pause = function() {
|
|
105
105
|
N.prototype.pause.apply(this, arguments), this._input.pause();
|
|
106
106
|
}, this.resume = function() {
|
|
@@ -108,7 +108,7 @@ function Ae() {
|
|
|
108
108
|
}, this.stream = function(g) {
|
|
109
109
|
this._input = g, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
|
|
110
110
|
}, this._checkIsFinished = function() {
|
|
111
|
-
|
|
111
|
+
a && t.length === 1 && (this._finished = !0);
|
|
112
112
|
}, this._nextChunk = function() {
|
|
113
113
|
this._checkIsFinished(), t.length ? this.parseChunk(t.shift()) : n = !0;
|
|
114
114
|
}, this._streamData = q(function(g) {
|
|
@@ -120,171 +120,171 @@ function Ae() {
|
|
|
120
120
|
}, this), this._streamError = q(function(g) {
|
|
121
121
|
this._streamCleanUp(), this._sendError(g);
|
|
122
122
|
}, this), this._streamEnd = q(function() {
|
|
123
|
-
this._streamCleanUp(),
|
|
123
|
+
this._streamCleanUp(), a = !0, this._streamData("");
|
|
124
124
|
}, this), this._streamCleanUp = q(function() {
|
|
125
125
|
this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
|
|
126
126
|
}, this);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
var t, n,
|
|
130
|
-
function
|
|
128
|
+
function ee(e) {
|
|
129
|
+
var t, n, a, g, S = Math.pow(2, 53), m = -S, f = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, c = /^((\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)))$/, s = this, o = 0, h = 0, y = !1, p = !1, _ = [], d = { data: [], errors: [], meta: {} };
|
|
130
|
+
function M(b) {
|
|
131
131
|
return e.skipEmptyLines === "greedy" ? b.join("").trim() === "" : b.length === 1 && b[0].length === 0;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
if (
|
|
135
|
-
return !
|
|
136
|
-
})),
|
|
137
|
-
let
|
|
138
|
-
|
|
133
|
+
function C() {
|
|
134
|
+
if (d && a && (j("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + w.DefaultDelimiter + "'"), a = !1), e.skipEmptyLines && (d.data = d.data.filter(function(k) {
|
|
135
|
+
return !M(k);
|
|
136
|
+
})), B()) {
|
|
137
|
+
let k = function(A, F) {
|
|
138
|
+
R(e.transformHeader) && (A = e.transformHeader(A, F)), _.push(A);
|
|
139
139
|
};
|
|
140
|
-
if (
|
|
141
|
-
for (var b = 0;
|
|
142
|
-
|
|
143
|
-
} else
|
|
140
|
+
if (d) if (Array.isArray(d.data[0])) {
|
|
141
|
+
for (var b = 0; B() && b < d.data.length; b++) d.data[b].forEach(k);
|
|
142
|
+
d.data.splice(0, 1);
|
|
143
|
+
} else d.data.forEach(k);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
for (var
|
|
147
|
-
var
|
|
148
|
-
if (
|
|
145
|
+
function D(k, A) {
|
|
146
|
+
for (var F = e.header ? {} : [], L = 0; L < k.length; L++) {
|
|
147
|
+
var I = L, $ = k[L], $ = ((Z, x) => ((z) => (e.dynamicTypingFunction && e.dynamicTyping[z] === void 0 && (e.dynamicTyping[z] = e.dynamicTypingFunction(z)), (e.dynamicTyping[z] || e.dynamicTyping) === !0))(Z) ? x === "true" || x === "TRUE" || x !== "false" && x !== "FALSE" && (((z) => {
|
|
148
|
+
if (f.test(z) && (z = parseFloat(z), m < z && z < S))
|
|
149
149
|
return 1;
|
|
150
|
-
})(
|
|
151
|
-
|
|
150
|
+
})(x) ? parseFloat(x) : c.test(x) ? new Date(x) : x === "" ? null : x) : x)(I = e.header ? L >= _.length ? "__parsed_extra" : _[L] : I, $ = e.transform ? e.transform($, I) : $);
|
|
151
|
+
I === "__parsed_extra" ? (F[I] = F[I] || [], F[I].push($)) : F[I] = $;
|
|
152
152
|
}
|
|
153
|
-
return e.header && (L > _.length ? j("FieldMismatch", "TooManyFields", "Too many fields: expected " + _.length + " fields but parsed " + L, h + A) : L < _.length && j("FieldMismatch", "TooFewFields", "Too few fields: expected " + _.length + " fields but parsed " + L, h + A)),
|
|
153
|
+
return e.header && (L > _.length ? j("FieldMismatch", "TooManyFields", "Too many fields: expected " + _.length + " fields but parsed " + L, h + A) : L < _.length && j("FieldMismatch", "TooFewFields", "Too few fields: expected " + _.length + " fields but parsed " + L, h + A)), F;
|
|
154
154
|
}
|
|
155
|
-
var
|
|
156
|
-
|
|
155
|
+
var E;
|
|
156
|
+
d && (e.header || e.dynamicTyping || e.transform) && (E = 1, !d.data.length || Array.isArray(d.data[0]) ? (d.data = d.data.map(D), E = d.data.length) : d.data = D(d.data, 0), e.header && d.meta && (d.meta.fields = _), h += E);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function B() {
|
|
159
159
|
return e.header && _.length === 0;
|
|
160
160
|
}
|
|
161
|
-
function j(b,
|
|
162
|
-
b = { type: b, code:
|
|
161
|
+
function j(b, D, E, k) {
|
|
162
|
+
b = { type: b, code: D, message: E }, k !== void 0 && (b.row = k), d.errors.push(b);
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}), this.parse = function(b,
|
|
167
|
-
var
|
|
168
|
-
var
|
|
169
|
-
|
|
170
|
-
for (var
|
|
171
|
-
for (var
|
|
172
|
-
0 < J.data.length && (
|
|
164
|
+
R(e.step) && (g = e.step, e.step = function(b) {
|
|
165
|
+
d = b, B() ? C() : (C(), d.data.length !== 0 && (o += b.data.length, e.preview && o > e.preview ? n.abort() : (d.data = d.data[0], g(d, s))));
|
|
166
|
+
}), this.parse = function(b, D, E) {
|
|
167
|
+
var k = e.quoteChar || '"', k = (e.newline || (e.newline = this.guessLineEndings(b, k)), a = !1, e.delimiter ? R(e.delimiter) && (e.delimiter = e.delimiter(b), d.meta.delimiter = e.delimiter) : ((k = ((A, F, L, I, $) => {
|
|
168
|
+
var Z, x, z, ue;
|
|
169
|
+
$ = $ || [",", " ", "|", ";", w.RECORD_SEP, w.UNIT_SEP];
|
|
170
|
+
for (var ce = 0; ce < $.length; ce++) {
|
|
171
|
+
for (var te, pe = $[ce], H = 0, re = 0, U = 0, J = (z = void 0, new he({ comments: I, delimiter: pe, newline: F, preview: 10 }).parse(A)), ae = 0; ae < J.data.length; ae++) L && M(J.data[ae]) ? U++ : (te = J.data[ae].length, re += te, z === void 0 ? z = te : 0 < te && (H += Math.abs(te - z), z = te));
|
|
172
|
+
0 < J.data.length && (re /= J.data.length - U), (x === void 0 || H <= x) && (ue === void 0 || ue < re) && 1.99 < re && (x = H, Z = pe, ue = re);
|
|
173
173
|
}
|
|
174
|
-
return { successful: !!(e.delimiter =
|
|
175
|
-
})(b, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter =
|
|
176
|
-
return e.preview && e.header &&
|
|
174
|
+
return { successful: !!(e.delimiter = Z), bestDelimiter: Z };
|
|
175
|
+
})(b, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter = k.bestDelimiter : (a = !0, e.delimiter = w.DefaultDelimiter), d.meta.delimiter = e.delimiter), se(e));
|
|
176
|
+
return e.preview && e.header && k.preview++, t = b, n = new he(k), d = n.parse(t, D, E), C(), y ? { meta: { paused: !0 } } : d || { meta: { paused: !1 } };
|
|
177
177
|
}, this.paused = function() {
|
|
178
178
|
return y;
|
|
179
179
|
}, this.pause = function() {
|
|
180
|
-
y = !0, n.abort(), t =
|
|
180
|
+
y = !0, n.abort(), t = R(e.chunk) ? "" : t.substring(n.getCharIndex());
|
|
181
181
|
}, this.resume = function() {
|
|
182
|
-
|
|
182
|
+
s.streamer._halted ? (y = !1, s.streamer.parseChunk(t, !0)) : setTimeout(s.resume, 3);
|
|
183
183
|
}, this.aborted = function() {
|
|
184
184
|
return p;
|
|
185
185
|
}, this.abort = function() {
|
|
186
|
-
p = !0, n.abort(),
|
|
187
|
-
}, this.guessLineEndings = function(A,
|
|
186
|
+
p = !0, n.abort(), d.meta.aborted = !0, R(e.complete) && e.complete(d), t = "";
|
|
187
|
+
}, this.guessLineEndings = function(A, k) {
|
|
188
188
|
A = A.substring(0, 1048576);
|
|
189
|
-
var
|
|
190
|
-
`), A = 1 <
|
|
191
|
-
if (
|
|
189
|
+
var k = new RegExp(ie(k) + "([^]*?)" + ie(k), "gm"), E = (A = A.replace(k, "")).split("\r"), k = A.split(`
|
|
190
|
+
`), A = 1 < k.length && k[0].length < E[0].length;
|
|
191
|
+
if (E.length === 1 || A) return `
|
|
192
192
|
`;
|
|
193
|
-
for (var
|
|
194
|
-
` &&
|
|
195
|
-
return
|
|
193
|
+
for (var F = 0, L = 0; L < E.length; L++) E[L][0] === `
|
|
194
|
+
` && F++;
|
|
195
|
+
return F >= E.length / 2 ? `\r
|
|
196
196
|
` : "\r";
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function ie(e) {
|
|
200
200
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
var t = (e = e || {}).delimiter, n = e.newline,
|
|
204
|
-
if (e.escapeChar !== void 0 && (
|
|
205
|
-
|
|
202
|
+
function he(e) {
|
|
203
|
+
var t = (e = e || {}).delimiter, n = e.newline, a = e.comments, g = e.step, S = e.preview, m = e.fastMode, f = null, c = !1, s = e.quoteChar == null ? '"' : e.quoteChar, o = s;
|
|
204
|
+
if (e.escapeChar !== void 0 && (o = e.escapeChar), (typeof t != "string" || -1 < w.BAD_DELIMITERS.indexOf(t)) && (t = ","), a === t) throw new Error("Comment character same as delimiter");
|
|
205
|
+
a === !0 ? a = "#" : (typeof a != "string" || -1 < w.BAD_DELIMITERS.indexOf(a)) && (a = !1), n !== `
|
|
206
206
|
` && n !== "\r" && n !== `\r
|
|
207
207
|
` && (n = `
|
|
208
208
|
`);
|
|
209
209
|
var h = 0, y = !1;
|
|
210
|
-
this.parse = function(p, _,
|
|
210
|
+
this.parse = function(p, _, d) {
|
|
211
211
|
if (typeof p != "string") throw new Error("Input must be a string");
|
|
212
|
-
var
|
|
212
|
+
var M = p.length, C = t.length, B = n.length, j = a.length, b = R(g), D = [], E = [], k = [], A = h = 0;
|
|
213
213
|
if (!p) return H();
|
|
214
|
-
if (m || m !== !1 && p.indexOf(
|
|
215
|
-
for (var
|
|
216
|
-
if (
|
|
217
|
-
else if (
|
|
218
|
-
if (!
|
|
214
|
+
if (m || m !== !1 && p.indexOf(s) === -1) {
|
|
215
|
+
for (var F = p.split(n), L = 0; L < F.length; L++) {
|
|
216
|
+
if (k = F[L], h += k.length, L !== F.length - 1) h += n.length;
|
|
217
|
+
else if (d) return H();
|
|
218
|
+
if (!a || k.substring(0, j) !== a) {
|
|
219
219
|
if (b) {
|
|
220
|
-
if (
|
|
221
|
-
} else
|
|
222
|
-
if (S && S <= L) return
|
|
220
|
+
if (D = [], ue(k.split(t)), re(), y) return H();
|
|
221
|
+
} else ue(k.split(t));
|
|
222
|
+
if (S && S <= L) return D = D.slice(0, S), H(!0);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
return H();
|
|
226
226
|
}
|
|
227
|
-
for (var
|
|
228
|
-
if ((
|
|
229
|
-
if (
|
|
230
|
-
if (
|
|
231
|
-
else if (
|
|
232
|
-
|
|
233
|
-
var
|
|
234
|
-
if (p.substr(
|
|
235
|
-
|
|
227
|
+
for (var I = p.indexOf(t, h), $ = p.indexOf(n, h), Z = new RegExp(ie(o) + ie(s), "g"), x = p.indexOf(s, h); ; ) if (p[h] === s) for (x = h, h++; ; ) {
|
|
228
|
+
if ((x = p.indexOf(s, x + 1)) === -1) return d || E.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: D.length, index: h }), te();
|
|
229
|
+
if (x === M - 1) return te(p.substring(h, x).replace(Z, s));
|
|
230
|
+
if (s === o && p[x + 1] === o) x++;
|
|
231
|
+
else if (s === o || x === 0 || p[x - 1] !== o) {
|
|
232
|
+
I !== -1 && I < x + 1 && (I = p.indexOf(t, x + 1));
|
|
233
|
+
var z = ce(($ = $ !== -1 && $ < x + 1 ? p.indexOf(n, x + 1) : $) === -1 ? I : Math.min(I, $));
|
|
234
|
+
if (p.substr(x + 1 + z, C) === t) {
|
|
235
|
+
k.push(p.substring(h, x).replace(Z, s)), p[h = x + 1 + z + C] !== s && (x = p.indexOf(s, h)), I = p.indexOf(t, h), $ = p.indexOf(n, h);
|
|
236
236
|
break;
|
|
237
237
|
}
|
|
238
|
-
if (
|
|
239
|
-
if (
|
|
240
|
-
if (S &&
|
|
238
|
+
if (z = ce($), p.substring(x + 1 + z, x + 1 + z + B) === n) {
|
|
239
|
+
if (k.push(p.substring(h, x).replace(Z, s)), pe(x + 1 + z + B), I = p.indexOf(t, h), x = p.indexOf(s, h), b && (re(), y)) return H();
|
|
240
|
+
if (S && D.length >= S) return H(!0);
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
243
|
-
|
|
243
|
+
E.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: D.length, index: h }), x++;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
else if (
|
|
247
|
-
if (
|
|
248
|
-
h =
|
|
249
|
-
} else if (
|
|
246
|
+
else if (a && k.length === 0 && p.substring(h, h + j) === a) {
|
|
247
|
+
if ($ === -1) return H();
|
|
248
|
+
h = $ + B, $ = p.indexOf(n, h), I = p.indexOf(t, h);
|
|
249
|
+
} else if (I !== -1 && (I < $ || $ === -1)) k.push(p.substring(h, I)), h = I + C, I = p.indexOf(t, h);
|
|
250
250
|
else {
|
|
251
|
-
if (
|
|
252
|
-
if (
|
|
253
|
-
if (S &&
|
|
251
|
+
if ($ === -1) break;
|
|
252
|
+
if (k.push(p.substring(h, $)), pe($ + B), b && (re(), y)) return H();
|
|
253
|
+
if (S && D.length >= S) return H(!0);
|
|
254
254
|
}
|
|
255
|
-
return
|
|
256
|
-
function
|
|
257
|
-
|
|
255
|
+
return te();
|
|
256
|
+
function ue(U) {
|
|
257
|
+
D.push(U), A = h;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function ce(U) {
|
|
260
260
|
var J = 0;
|
|
261
|
-
return J = U !== -1 && (U = p.substring(
|
|
261
|
+
return J = U !== -1 && (U = p.substring(x + 1, U)) && U.trim() === "" ? U.length : J;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
263
|
+
function te(U) {
|
|
264
|
+
return d || (U === void 0 && (U = p.substring(h)), k.push(U), h = M, ue(k), b && re()), H();
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
h = U,
|
|
266
|
+
function pe(U) {
|
|
267
|
+
h = U, ue(k), k = [], $ = p.indexOf(n, h);
|
|
268
268
|
}
|
|
269
269
|
function H(U) {
|
|
270
|
-
if (e.header && !_ &&
|
|
271
|
-
var J =
|
|
272
|
-
let
|
|
273
|
-
for (let
|
|
274
|
-
let
|
|
275
|
-
if (
|
|
276
|
-
let
|
|
277
|
-
for (;
|
|
278
|
-
|
|
279
|
-
} else
|
|
280
|
-
|
|
270
|
+
if (e.header && !_ && D.length && !c) {
|
|
271
|
+
var J = D[0], ae = /* @__PURE__ */ Object.create(null), ve = new Set(J);
|
|
272
|
+
let Se = !1;
|
|
273
|
+
for (let le = 0; le < J.length; le++) {
|
|
274
|
+
let ne = J[le];
|
|
275
|
+
if (ae[ne = R(e.transformHeader) ? e.transformHeader(ne, le) : ne]) {
|
|
276
|
+
let ge, xe = ae[ne];
|
|
277
|
+
for (; ge = ne + "_" + xe, xe++, ve.has(ge); ) ;
|
|
278
|
+
ve.add(ge), J[le] = ge, ae[ne]++, Se = !0, (f = f === null ? {} : f)[ge] = ne;
|
|
279
|
+
} else ae[ne] = 1, J[le] = ne;
|
|
280
|
+
ve.add(ne);
|
|
281
281
|
}
|
|
282
|
-
|
|
282
|
+
Se && console.warn("Duplicate headers found and renamed."), c = !0;
|
|
283
283
|
}
|
|
284
|
-
return { data:
|
|
284
|
+
return { data: D, errors: E, meta: { delimiter: t, linebreak: n, aborted: y, truncated: !!U, cursor: A + (_ || 0), renamedHeaders: f } };
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
g(H()),
|
|
286
|
+
function re() {
|
|
287
|
+
g(H()), D = [], E = [];
|
|
288
288
|
}
|
|
289
289
|
}, this.abort = function() {
|
|
290
290
|
y = !0;
|
|
@@ -292,31 +292,31 @@ function Ae() {
|
|
|
292
292
|
return h;
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
var t = e.data, n = P[t.workerId],
|
|
295
|
+
function de(e) {
|
|
296
|
+
var t = e.data, n = P[t.workerId], a = !1;
|
|
297
297
|
if (t.error) n.userError(t.error, t.file);
|
|
298
298
|
else if (t.results && t.results.data) {
|
|
299
299
|
var g = { abort: function() {
|
|
300
|
-
|
|
301
|
-
}, pause:
|
|
302
|
-
if (
|
|
303
|
-
for (var S = 0; S < t.results.data.length && (n.userStep({ data: t.results.data[S], errors: t.results.errors, meta: t.results.meta }, g), !
|
|
300
|
+
a = !0, oe(t.workerId, { data: [], errors: [], meta: { aborted: !0 } });
|
|
301
|
+
}, pause: ye, resume: ye };
|
|
302
|
+
if (R(n.userStep)) {
|
|
303
|
+
for (var S = 0; S < t.results.data.length && (n.userStep({ data: t.results.data[S], errors: t.results.errors, meta: t.results.meta }, g), !a); S++) ;
|
|
304
304
|
delete t.results;
|
|
305
|
-
} else
|
|
305
|
+
} else R(n.userChunk) && (n.userChunk(t.results, g, t.file), delete t.results);
|
|
306
306
|
}
|
|
307
|
-
t.finished && !
|
|
307
|
+
t.finished && !a && oe(t.workerId, t.results);
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function oe(e, t) {
|
|
310
310
|
var n = P[e];
|
|
311
|
-
|
|
311
|
+
R(n.userComplete) && n.userComplete(t), n.terminate(), delete P[e];
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function ye() {
|
|
314
314
|
throw new Error("Not implemented.");
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function se(e) {
|
|
317
317
|
if (typeof e != "object" || e === null) return e;
|
|
318
318
|
var t, n = Array.isArray(e) ? [] : {};
|
|
319
|
-
for (t in e) n[t] =
|
|
319
|
+
for (t in e) n[t] = se(e[t]);
|
|
320
320
|
return n;
|
|
321
321
|
}
|
|
322
322
|
function q(e, t) {
|
|
@@ -324,148 +324,148 @@ function Ae() {
|
|
|
324
324
|
e.apply(t, arguments);
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function R(e) {
|
|
328
328
|
return typeof e == "function";
|
|
329
329
|
}
|
|
330
330
|
return w.parse = function(e, t) {
|
|
331
331
|
var n = (t = t || {}).dynamicTyping || !1;
|
|
332
|
-
if (
|
|
332
|
+
if (R(n) && (t.dynamicTypingFunction = n, n = {}), t.dynamicTyping = n, t.transform = !!R(t.transform) && t.transform, !t.worker || !w.WORKERS_SUPPORTED) return n = null, w.NODE_STREAM_INPUT, typeof e == "string" ? (e = ((a) => a.charCodeAt(0) !== 65279 ? a : a.slice(1))(e), n = new (t.download ? W : K)(t)) : e.readable === !0 && R(e.read) && R(e.on) ? n = new Q(t) : (l.File && e instanceof File || e instanceof Object) && (n = new X(t)), n.stream(e);
|
|
333
333
|
(n = (() => {
|
|
334
|
-
var
|
|
335
|
-
return !!w.WORKERS_SUPPORTED && (
|
|
336
|
-
var g =
|
|
334
|
+
var a;
|
|
335
|
+
return !!w.WORKERS_SUPPORTED && (a = (() => {
|
|
336
|
+
var g = l.URL || l.webkitURL || null, S = i.toString();
|
|
337
337
|
return w.BLOB_URL || (w.BLOB_URL = g.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; ", "(", S, ")();"], { type: "text/javascript" })));
|
|
338
|
-
})(), (
|
|
339
|
-
})()).userStep = t.step, n.userChunk = t.chunk, n.userComplete = t.complete, n.userError = t.error, t.step =
|
|
338
|
+
})(), (a = new l.Worker(a)).onmessage = de, a.id = Y++, P[a.id] = a);
|
|
339
|
+
})()).userStep = t.step, n.userChunk = t.chunk, n.userComplete = t.complete, n.userError = t.error, t.step = R(t.step), t.chunk = R(t.chunk), t.complete = R(t.complete), t.error = R(t.error), delete t.worker, n.postMessage({ input: e, config: t, workerId: n.id });
|
|
340
340
|
}, w.unparse = function(e, t) {
|
|
341
|
-
var n = !1,
|
|
342
|
-
`, m = '"',
|
|
341
|
+
var n = !1, a = !0, g = ",", S = `\r
|
|
342
|
+
`, m = '"', f = m + m, c = !1, s = null, o = !1, h = ((() => {
|
|
343
343
|
if (typeof t == "object") {
|
|
344
344
|
if (typeof t.delimiter != "string" || w.BAD_DELIMITERS.filter(function(_) {
|
|
345
345
|
return t.delimiter.indexOf(_) !== -1;
|
|
346
|
-
}).length || (g = t.delimiter), typeof t.quotes != "boolean" && typeof t.quotes != "function" && !Array.isArray(t.quotes) || (n = t.quotes), typeof t.skipEmptyLines != "boolean" && typeof t.skipEmptyLines != "string" || (c = t.skipEmptyLines), typeof t.newline == "string" && (S = t.newline), typeof t.quoteChar == "string" && (m = t.quoteChar), typeof t.header == "boolean" && (
|
|
346
|
+
}).length || (g = t.delimiter), typeof t.quotes != "boolean" && typeof t.quotes != "function" && !Array.isArray(t.quotes) || (n = t.quotes), typeof t.skipEmptyLines != "boolean" && typeof t.skipEmptyLines != "string" || (c = t.skipEmptyLines), typeof t.newline == "string" && (S = t.newline), typeof t.quoteChar == "string" && (m = t.quoteChar), typeof t.header == "boolean" && (a = t.header), Array.isArray(t.columns)) {
|
|
347
347
|
if (t.columns.length === 0) throw new Error("Option columns is empty");
|
|
348
|
-
|
|
348
|
+
s = t.columns;
|
|
349
349
|
}
|
|
350
|
-
t.escapeChar !== void 0 && (
|
|
350
|
+
t.escapeChar !== void 0 && (f = t.escapeChar + m), t.escapeFormulae instanceof RegExp ? o = t.escapeFormulae : typeof t.escapeFormulae == "boolean" && t.escapeFormulae && (o = /^[=+\-@\t\r].*$/);
|
|
351
351
|
}
|
|
352
|
-
})(), new RegExp(
|
|
352
|
+
})(), new RegExp(ie(m), "g"));
|
|
353
353
|
if (typeof e == "string" && (e = JSON.parse(e)), Array.isArray(e)) {
|
|
354
354
|
if (!e.length || Array.isArray(e[0])) return y(null, e, c);
|
|
355
|
-
if (typeof e[0] == "object") return y(
|
|
356
|
-
} 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 ||
|
|
355
|
+
if (typeof e[0] == "object") return y(s || Object.keys(e[0]), e, c);
|
|
356
|
+
} 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 || s), 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])), y(e.fields || [], e.data || [], c);
|
|
357
357
|
throw new Error("Unable to serialize unrecognized input");
|
|
358
|
-
function y(_,
|
|
359
|
-
var
|
|
360
|
-
if (
|
|
361
|
-
for (var b = 0; b < _.length; b++) 0 < b && (
|
|
362
|
-
0 <
|
|
358
|
+
function y(_, d, M) {
|
|
359
|
+
var C = "", B = (typeof _ == "string" && (_ = JSON.parse(_)), typeof d == "string" && (d = JSON.parse(d)), Array.isArray(_) && 0 < _.length), j = !Array.isArray(d[0]);
|
|
360
|
+
if (B && a) {
|
|
361
|
+
for (var b = 0; b < _.length; b++) 0 < b && (C += g), C += p(_[b], b);
|
|
362
|
+
0 < d.length && (C += S);
|
|
363
363
|
}
|
|
364
|
-
for (var
|
|
365
|
-
var
|
|
366
|
-
if (
|
|
367
|
-
for (var
|
|
368
|
-
var
|
|
369
|
-
|
|
364
|
+
for (var D = 0; D < d.length; D++) {
|
|
365
|
+
var E = (B ? _ : d[D]).length, k = !1, A = B ? Object.keys(d[D]).length === 0 : d[D].length === 0;
|
|
366
|
+
if (M && !B && (k = M === "greedy" ? d[D].join("").trim() === "" : d[D].length === 1 && d[D][0].length === 0), M === "greedy" && B) {
|
|
367
|
+
for (var F = [], L = 0; L < E; L++) {
|
|
368
|
+
var I = j ? _[L] : L;
|
|
369
|
+
F.push(d[D][I]);
|
|
370
370
|
}
|
|
371
|
-
|
|
371
|
+
k = F.join("").trim() === "";
|
|
372
372
|
}
|
|
373
|
-
if (!
|
|
374
|
-
for (var
|
|
375
|
-
0 <
|
|
376
|
-
var
|
|
377
|
-
|
|
373
|
+
if (!k) {
|
|
374
|
+
for (var $ = 0; $ < E; $++) {
|
|
375
|
+
0 < $ && !A && (C += g);
|
|
376
|
+
var Z = B && j ? _[$] : $;
|
|
377
|
+
C += p(d[D][Z], $);
|
|
378
378
|
}
|
|
379
|
-
|
|
379
|
+
D < d.length - 1 && (!M || 0 < E && !A) && (C += S);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
return
|
|
382
|
+
return C;
|
|
383
383
|
}
|
|
384
|
-
function p(_,
|
|
385
|
-
var
|
|
386
|
-
return _ == null ? "" : _.constructor === Date ? JSON.stringify(_).slice(1, 25) : (
|
|
387
|
-
for (var b = 0; b < j.length; b++) if (-1 <
|
|
384
|
+
function p(_, d) {
|
|
385
|
+
var M, C;
|
|
386
|
+
return _ == null ? "" : _.constructor === Date ? JSON.stringify(_).slice(1, 25) : (C = !1, o && typeof _ == "string" && o.test(_) && (_ = "'" + _, C = !0), M = _.toString().replace(h, f), (C = C || n === !0 || typeof n == "function" && n(_, d) || Array.isArray(n) && n[d] || ((B, j) => {
|
|
387
|
+
for (var b = 0; b < j.length; b++) if (-1 < B.indexOf(j[b])) return !0;
|
|
388
388
|
return !1;
|
|
389
|
-
})(
|
|
389
|
+
})(M, w.BAD_DELIMITERS) || -1 < M.indexOf(g) || M.charAt(0) === " " || M.charAt(M.length - 1) === " ") ? m + M + m : M);
|
|
390
390
|
}
|
|
391
391
|
}, w.RECORD_SEP = "", w.UNIT_SEP = "", w.BYTE_ORDER_MARK = "\uFEFF", w.BAD_DELIMITERS = ["\r", `
|
|
392
|
-
`, '"', w.BYTE_ORDER_MARK], w.WORKERS_SUPPORTED = !
|
|
392
|
+
`, '"', w.BYTE_ORDER_MARK], w.WORKERS_SUPPORTED = !O && !!l.Worker, w.NODE_STREAM_INPUT = 1, w.LocalChunkSize = 10485760, w.RemoteChunkSize = 5242880, w.DefaultDelimiter = ",", w.Parser = he, w.ParserHandle = ee, w.NetworkStreamer = W, w.FileStreamer = X, w.StringStreamer = K, w.ReadableStreamStreamer = Q, l.jQuery && ((v = l.jQuery).fn.parse = function(e) {
|
|
393
393
|
var t = e.config || {}, n = [];
|
|
394
394
|
return this.each(function(S) {
|
|
395
|
-
if (!(
|
|
396
|
-
for (var m = 0; m < this.files.length; m++) n.push({ file: this.files[m], inputElem: this, instanceConfig:
|
|
397
|
-
}),
|
|
398
|
-
function
|
|
399
|
-
if (n.length === 0)
|
|
395
|
+
if (!(v(this).prop("tagName").toUpperCase() === "INPUT" && v(this).attr("type").toLowerCase() === "file" && l.FileReader) || !this.files || this.files.length === 0) return !0;
|
|
396
|
+
for (var m = 0; m < this.files.length; m++) n.push({ file: this.files[m], inputElem: this, instanceConfig: v.extend({}, t) });
|
|
397
|
+
}), a(), this;
|
|
398
|
+
function a() {
|
|
399
|
+
if (n.length === 0) R(e.complete) && e.complete();
|
|
400
400
|
else {
|
|
401
|
-
var S, m,
|
|
402
|
-
if (
|
|
403
|
-
var
|
|
404
|
-
if (typeof
|
|
405
|
-
if (
|
|
406
|
-
if (
|
|
407
|
-
typeof
|
|
408
|
-
} else if (
|
|
401
|
+
var S, m, f, c, s = n[0];
|
|
402
|
+
if (R(e.before)) {
|
|
403
|
+
var o = e.before(s.file, s.inputElem);
|
|
404
|
+
if (typeof o == "object") {
|
|
405
|
+
if (o.action === "abort") return S = "AbortError", m = s.file, f = s.inputElem, c = o.reason, void (R(e.error) && e.error({ name: S }, m, f, c));
|
|
406
|
+
if (o.action === "skip") return void g();
|
|
407
|
+
typeof o.config == "object" && (s.instanceConfig = v.extend(s.instanceConfig, o.config));
|
|
408
|
+
} else if (o === "skip") return void g();
|
|
409
409
|
}
|
|
410
|
-
var h =
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}, w.parse(
|
|
410
|
+
var h = s.instanceConfig.complete;
|
|
411
|
+
s.instanceConfig.complete = function(y) {
|
|
412
|
+
R(h) && h(y, s.file, s.inputElem), g();
|
|
413
|
+
}, w.parse(s.file, s.instanceConfig);
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
function g() {
|
|
417
|
-
n.splice(0, 1),
|
|
417
|
+
n.splice(0, 1), a();
|
|
418
418
|
}
|
|
419
|
-
}),
|
|
420
|
-
e = e.data, w.WORKER_ID === void 0 && e && (w.WORKER_ID = e.workerId), typeof e.input == "string" ?
|
|
421
|
-
}), (W.prototype = Object.create(N.prototype)).constructor = W, (
|
|
419
|
+
}), T && (l.onmessage = function(e) {
|
|
420
|
+
e = e.data, w.WORKER_ID === void 0 && e && (w.WORKER_ID = e.workerId), typeof e.input == "string" ? l.postMessage({ workerId: w.WORKER_ID, results: w.parse(e.input, e.config), finished: !0 }) : (l.File && e.input instanceof File || e.input instanceof Object) && (e = w.parse(e.input, e.config)) && l.postMessage({ workerId: w.WORKER_ID, results: e, finished: !0 });
|
|
421
|
+
}), (W.prototype = Object.create(N.prototype)).constructor = W, (X.prototype = Object.create(N.prototype)).constructor = X, (K.prototype = Object.create(K.prototype)).constructor = K, (Q.prototype = Object.create(N.prototype)).constructor = Q, w;
|
|
422
422
|
});
|
|
423
|
-
})(
|
|
423
|
+
})(_e)), _e.exports;
|
|
424
424
|
}
|
|
425
|
-
var
|
|
426
|
-
const
|
|
427
|
-
class
|
|
425
|
+
var Re = Ce();
|
|
426
|
+
const Ae = /* @__PURE__ */ be(Re), { parse: Te, unparse: Le } = Ae;
|
|
427
|
+
class et {
|
|
428
428
|
static unparse(r, i) {
|
|
429
|
-
return
|
|
429
|
+
return Le(r, i);
|
|
430
430
|
}
|
|
431
431
|
static parse(r) {
|
|
432
|
-
return new Promise((i,
|
|
432
|
+
return new Promise((i, l) => {
|
|
433
433
|
Te(r, {
|
|
434
434
|
header: !0,
|
|
435
|
-
complete: (
|
|
436
|
-
error: (
|
|
435
|
+
complete: (v) => i(v),
|
|
436
|
+
error: (v) => l(v)
|
|
437
437
|
});
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
async function
|
|
442
|
-
const
|
|
441
|
+
async function Ie(u, r, i) {
|
|
442
|
+
const l = i?.mimeType ?? Fe(r), v = Be(u, l);
|
|
443
443
|
if ("showSaveFilePicker" in window && i?.showSaveFilePicker)
|
|
444
444
|
try {
|
|
445
445
|
const Y = await (await window.showSaveFilePicker({
|
|
446
446
|
suggestedName: r,
|
|
447
|
-
types: [{ description: "Datei", accept: { [
|
|
447
|
+
types: [{ description: "Datei", accept: { [l]: [`.${Oe(r)}`] } }]
|
|
448
448
|
})).createWritable();
|
|
449
|
-
await Y.write(
|
|
449
|
+
await Y.write(v), await Y.close();
|
|
450
450
|
return;
|
|
451
451
|
} catch {
|
|
452
452
|
}
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
document.body.removeChild(
|
|
456
|
-
}, 0),
|
|
453
|
+
const O = URL.createObjectURL(v), T = document.createElement("a");
|
|
454
|
+
T.href = O, T.download = r, T.rel = "noopener", T.style.display = "none", document.body.appendChild(T), ze(T), window.setTimeout(() => {
|
|
455
|
+
document.body.removeChild(T), URL.revokeObjectURL(O);
|
|
456
|
+
}, 0), je() && window.open(O, "_blank", "noopener,noreferrer");
|
|
457
457
|
}
|
|
458
|
-
function Be(
|
|
459
|
-
if (
|
|
460
|
-
return
|
|
461
|
-
if (
|
|
462
|
-
const i =
|
|
458
|
+
function Be(u, r) {
|
|
459
|
+
if (u instanceof Blob)
|
|
460
|
+
return u.type ? u : new Blob([u], { type: r });
|
|
461
|
+
if (u instanceof ArrayBuffer || u instanceof Uint8Array) {
|
|
462
|
+
const i = u instanceof Uint8Array ? u : new Uint8Array(u);
|
|
463
463
|
return new Blob([i], { type: r });
|
|
464
464
|
}
|
|
465
|
-
return new Blob([
|
|
465
|
+
return new Blob([u], { type: r || "text/plain;charset=utf-8" });
|
|
466
466
|
}
|
|
467
|
-
function
|
|
468
|
-
switch (
|
|
467
|
+
function Fe(u) {
|
|
468
|
+
switch (Oe(u).toLowerCase()) {
|
|
469
469
|
case "txt":
|
|
470
470
|
return "text/plain;charset=utf-8";
|
|
471
471
|
case "csv":
|
|
@@ -487,19 +487,19 @@ function je(s) {
|
|
|
487
487
|
return "application/octet-stream";
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
const r =
|
|
492
|
-
return r >= 0 && r <
|
|
490
|
+
function Oe(u) {
|
|
491
|
+
const r = u.lastIndexOf(".");
|
|
492
|
+
return r >= 0 && r < u.length - 1 ? u.slice(r + 1) : "";
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function ze(u) {
|
|
495
495
|
const r = document.createEvent("MouseEvents");
|
|
496
|
-
r.initMouseEvent("click", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
|
|
496
|
+
r.initMouseEvent("click", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), u.dispatchEvent(r);
|
|
497
497
|
}
|
|
498
|
-
function
|
|
499
|
-
const
|
|
498
|
+
function je() {
|
|
499
|
+
const u = navigator.userAgent, r = /iPad|iPhone|iPod/.test(u), i = /^((?!chrome|android).)*safari/i.test(u);
|
|
500
500
|
return r || i;
|
|
501
501
|
}
|
|
502
|
-
class
|
|
502
|
+
class tt {
|
|
503
503
|
static getEnumValue(r, i) {
|
|
504
504
|
if (i in r)
|
|
505
505
|
return r[i];
|
|
@@ -512,74 +512,74 @@ class rt {
|
|
|
512
512
|
}));
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
class
|
|
515
|
+
class rt {
|
|
516
516
|
static getFileExtension(r) {
|
|
517
517
|
let i = "";
|
|
518
|
-
const
|
|
519
|
-
return
|
|
518
|
+
const l = r.lastIndexOf(".");
|
|
519
|
+
return l > 0 && l < r.length - 1 && (i = `.${r.substring(l + 1).toLowerCase()}`), i;
|
|
520
520
|
}
|
|
521
521
|
/**
|
|
522
522
|
* read content from a file or blob
|
|
523
523
|
*/
|
|
524
524
|
static readAsText(r) {
|
|
525
525
|
const i = new FileReader();
|
|
526
|
-
return new Promise((
|
|
526
|
+
return new Promise((l, v) => {
|
|
527
527
|
i.onload = () => {
|
|
528
|
-
i.onload = null, i.onerror = null, typeof i.result == "string" ?
|
|
528
|
+
i.onload = null, i.onerror = null, typeof i.result == "string" ? l(i.result) : v(new Error("Unexpected result type"));
|
|
529
529
|
}, i.onerror = () => {
|
|
530
|
-
const
|
|
531
|
-
i.onload = null, i.onerror = null,
|
|
530
|
+
const O = i.error ?? new Error("FileReader error");
|
|
531
|
+
i.onload = null, i.onerror = null, v(O);
|
|
532
532
|
}, i.readAsText(r);
|
|
533
533
|
});
|
|
534
534
|
}
|
|
535
535
|
static readAsArrayBuffer(r) {
|
|
536
536
|
const i = new FileReader();
|
|
537
|
-
return new Promise((
|
|
537
|
+
return new Promise((l, v) => {
|
|
538
538
|
i.onload = () => {
|
|
539
|
-
i.onload = null, i.onerror = null, i.result instanceof ArrayBuffer ?
|
|
539
|
+
i.onload = null, i.onerror = null, i.result instanceof ArrayBuffer ? l(i.result) : v(new Error("Unexpected result type"));
|
|
540
540
|
}, i.onerror = () => {
|
|
541
|
-
const
|
|
542
|
-
i.onload = null, i.onerror = null,
|
|
541
|
+
const O = i.error ?? new Error("FileReader error");
|
|
542
|
+
i.onload = null, i.onerror = null, v(O);
|
|
543
543
|
}, i.readAsArrayBuffer(r);
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
546
|
static readAsDataUrl(r) {
|
|
547
547
|
const i = new FileReader();
|
|
548
|
-
return new Promise((
|
|
549
|
-
i.onload = (
|
|
550
|
-
|
|
551
|
-
}, i.onerror = (
|
|
548
|
+
return new Promise((l, v) => {
|
|
549
|
+
i.onload = (O) => {
|
|
550
|
+
l(O);
|
|
551
|
+
}, i.onerror = (O) => v(O), i.readAsDataURL(r);
|
|
552
552
|
});
|
|
553
553
|
}
|
|
554
554
|
/** usage:
|
|
555
555
|
* const file = new File(['Hello'], 'test.txt');
|
|
556
556
|
* FileHelper.formatFileSize(file.size);
|
|
557
557
|
* */
|
|
558
|
-
static formatFileSize(r, i = 2,
|
|
558
|
+
static formatFileSize(r, i = 2, l) {
|
|
559
559
|
if (r === 0)
|
|
560
560
|
return "0 Bytes";
|
|
561
|
-
const
|
|
562
|
-
let
|
|
563
|
-
|
|
564
|
-
const P = r / Math.pow(
|
|
565
|
-
return `${parseFloat(P.toFixed(i))} ${
|
|
561
|
+
const v = 1024, O = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
562
|
+
let T = Math.floor(Math.log(r) / Math.log(v));
|
|
563
|
+
l && O.includes(l) && (T = O.indexOf(l));
|
|
564
|
+
const P = r / Math.pow(v, T);
|
|
565
|
+
return `${parseFloat(P.toFixed(i))} ${O[T]}`;
|
|
566
566
|
}
|
|
567
|
-
static save(r, i,
|
|
568
|
-
const
|
|
569
|
-
|
|
567
|
+
static save(r, i, l) {
|
|
568
|
+
const v = new Blob([r], { type: l });
|
|
569
|
+
Ie(v, i);
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
class
|
|
572
|
+
class me {
|
|
573
573
|
static set(r, i) {
|
|
574
574
|
localStorage.setItem(r, JSON.stringify(i));
|
|
575
575
|
}
|
|
576
576
|
static get(r) {
|
|
577
577
|
let i = null;
|
|
578
|
-
const
|
|
579
|
-
return
|
|
578
|
+
const l = localStorage.getItem(r);
|
|
579
|
+
return l && (i = JSON.parse(l)), i;
|
|
580
580
|
}
|
|
581
581
|
static remove(r) {
|
|
582
|
-
let i = !!
|
|
582
|
+
let i = !!me.get(r);
|
|
583
583
|
return i && localStorage.removeItem(r), i;
|
|
584
584
|
}
|
|
585
585
|
static removeAll() {
|
|
@@ -589,33 +589,33 @@ class _e {
|
|
|
589
589
|
return Object.keys(localStorage).filter((i) => i.startsWith(r));
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
var
|
|
592
|
+
var fe = /* @__PURE__ */ ((u) => (u.log = "log", u.info = "info", u.warn = "warn", u.debug = "debug", u.error = "error", u))(fe || {});
|
|
593
593
|
class V {
|
|
594
594
|
static listeners = /* @__PURE__ */ new Set();
|
|
595
595
|
static log(...r) {
|
|
596
|
-
V.doLog(
|
|
596
|
+
V.doLog(fe.log, r);
|
|
597
597
|
}
|
|
598
598
|
static info(...r) {
|
|
599
|
-
V.doLog(
|
|
599
|
+
V.doLog(fe.info, r);
|
|
600
600
|
}
|
|
601
601
|
static warn(...r) {
|
|
602
|
-
V.doLog(
|
|
602
|
+
V.doLog(fe.warn, r);
|
|
603
603
|
}
|
|
604
604
|
static debug(...r) {
|
|
605
|
-
V.doLog(
|
|
605
|
+
V.doLog(fe.debug, r);
|
|
606
606
|
}
|
|
607
607
|
static error(...r) {
|
|
608
|
-
V.doLog(
|
|
608
|
+
V.doLog(fe.error, r);
|
|
609
609
|
}
|
|
610
610
|
static doLog(r, i) {
|
|
611
|
-
const
|
|
611
|
+
const l = {
|
|
612
612
|
type: r,
|
|
613
613
|
args: i,
|
|
614
614
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
615
615
|
};
|
|
616
|
-
for (const
|
|
616
|
+
for (const v of V.listeners)
|
|
617
617
|
try {
|
|
618
|
-
if (
|
|
618
|
+
if (v(l) === !1)
|
|
619
619
|
return;
|
|
620
620
|
} catch {
|
|
621
621
|
}
|
|
@@ -623,354 +623,354 @@ class V {
|
|
|
623
623
|
}
|
|
624
624
|
static onLog(r, i = !1) {
|
|
625
625
|
if (i) {
|
|
626
|
-
const
|
|
626
|
+
const l = (v) => {
|
|
627
627
|
try {
|
|
628
|
-
return r(
|
|
628
|
+
return r(v);
|
|
629
629
|
} finally {
|
|
630
|
-
V.listeners.delete(
|
|
630
|
+
V.listeners.delete(l);
|
|
631
631
|
}
|
|
632
632
|
};
|
|
633
|
-
return V.listeners.add(
|
|
633
|
+
return V.listeners.add(l), () => V.listeners.delete(l);
|
|
634
634
|
}
|
|
635
635
|
return V.listeners.add(r), () => V.listeners.delete(r);
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
-
const
|
|
639
|
-
let
|
|
640
|
-
return typeof
|
|
641
|
-
},
|
|
642
|
-
const
|
|
643
|
-
return
|
|
638
|
+
const We = (u, r, i) => u.localeCompare(r) * (i ? 1 : -1), Ue = (u, r) => u < r ? -1 : u === r ? 0 : 1, Pe = (u, r, i) => Ue(u, r) * (i ? 1 : -1), Ye = (u, r, i) => {
|
|
639
|
+
let l = 0;
|
|
640
|
+
return typeof u == "string" && typeof r == "string" ? l = We(u, r, i) : l = Pe(u, r, i), l;
|
|
641
|
+
}, Ne = (u, r, i, l) => {
|
|
642
|
+
const v = i(u), O = i(r);
|
|
643
|
+
return Ye(v, O, l);
|
|
644
644
|
};
|
|
645
|
-
class
|
|
645
|
+
class nt {
|
|
646
646
|
static get(r) {
|
|
647
|
-
return
|
|
647
|
+
return me.get(r);
|
|
648
648
|
}
|
|
649
649
|
static set(r, i) {
|
|
650
|
-
|
|
650
|
+
me.set(r, i);
|
|
651
651
|
}
|
|
652
652
|
static remove(r) {
|
|
653
|
-
|
|
653
|
+
me.remove(r);
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
-
Array.prototype.distinct = function(
|
|
656
|
+
Array.prototype.distinct = function(u) {
|
|
657
657
|
const r = this;
|
|
658
|
-
return
|
|
658
|
+
return u ? r.filter((l, v, O) => O.findIndex((T) => u(T, l)) === v) : r.filter((l, v, O) => O.indexOf(l) === v);
|
|
659
659
|
};
|
|
660
|
-
Array.prototype.filterBy = function(
|
|
661
|
-
return this.filter((r) =>
|
|
660
|
+
Array.prototype.filterBy = function(u) {
|
|
661
|
+
return this.filter((r) => u(r));
|
|
662
662
|
};
|
|
663
663
|
Array.prototype.first = function() {
|
|
664
664
|
return this?.length > 0 ? this[0] : null;
|
|
665
665
|
};
|
|
666
|
-
Array.prototype.groupBy = function(
|
|
666
|
+
Array.prototype.groupBy = function(u) {
|
|
667
667
|
return this.reduce((r, i) => {
|
|
668
|
-
const
|
|
669
|
-
return (r[
|
|
668
|
+
const l = u(i);
|
|
669
|
+
return (r[l] = r[l] || []).push(i), r;
|
|
670
670
|
}, {});
|
|
671
671
|
};
|
|
672
|
-
Array.prototype.orderBy = function(
|
|
673
|
-
return this?.sort((i,
|
|
672
|
+
Array.prototype.orderBy = function(u, r = !0) {
|
|
673
|
+
return this?.sort((i, l) => Ne(i, l, u, r)), this;
|
|
674
674
|
};
|
|
675
|
-
Array.prototype.removeBy = function(
|
|
676
|
-
return this.filter((i) =>
|
|
675
|
+
Array.prototype.removeBy = function(u, r) {
|
|
676
|
+
return this.filter((i) => u(i) !== r);
|
|
677
677
|
};
|
|
678
|
-
var
|
|
679
|
-
function
|
|
680
|
-
return
|
|
681
|
-
(function(i,
|
|
682
|
-
|
|
683
|
-
})(
|
|
684
|
-
var i = 1e3,
|
|
685
|
-
var
|
|
686
|
-
return "[" + m + (
|
|
687
|
-
} },
|
|
688
|
-
var
|
|
689
|
-
return !
|
|
690
|
-
},
|
|
691
|
-
var
|
|
692
|
-
return (
|
|
693
|
-
}, m: function m(
|
|
694
|
-
if (
|
|
695
|
-
var
|
|
696
|
-
return +(-(
|
|
678
|
+
var we = { exports: {} }, qe = we.exports, Ee;
|
|
679
|
+
function He() {
|
|
680
|
+
return Ee || (Ee = 1, (function(u, r) {
|
|
681
|
+
(function(i, l) {
|
|
682
|
+
u.exports = l();
|
|
683
|
+
})(qe, (function() {
|
|
684
|
+
var i = 1e3, l = 6e4, v = 36e5, O = "millisecond", T = "second", P = "minute", Y = "hour", w = "day", N = "week", W = "month", X = "quarter", K = "year", Q = "date", ee = "Invalid Date", ie = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, he = /\[([^\]]+)]|Y{1,4}|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, de = { 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(m) {
|
|
685
|
+
var f = ["th", "st", "nd", "rd"], c = m % 100;
|
|
686
|
+
return "[" + m + (f[(c - 20) % 10] || f[c] || f[0]) + "]";
|
|
687
|
+
} }, oe = function(m, f, c) {
|
|
688
|
+
var s = String(m);
|
|
689
|
+
return !s || s.length >= f ? m : "" + Array(f + 1 - s.length).join(c) + m;
|
|
690
|
+
}, ye = { s: oe, z: function(m) {
|
|
691
|
+
var f = -m.utcOffset(), c = Math.abs(f), s = Math.floor(c / 60), o = c % 60;
|
|
692
|
+
return (f <= 0 ? "+" : "-") + oe(s, 2, "0") + ":" + oe(o, 2, "0");
|
|
693
|
+
}, m: function m(f, c) {
|
|
694
|
+
if (f.date() < c.date()) return -m(c, f);
|
|
695
|
+
var s = 12 * (c.year() - f.year()) + (c.month() - f.month()), o = f.clone().add(s, W), h = c - o < 0, y = f.clone().add(s + (h ? -1 : 1), W);
|
|
696
|
+
return +(-(s + (c - o) / (h ? o - y : y - o)) || 0);
|
|
697
697
|
}, a: function(m) {
|
|
698
698
|
return m < 0 ? Math.ceil(m) || 0 : Math.floor(m);
|
|
699
699
|
}, p: function(m) {
|
|
700
|
-
return { M: W, y: K, w: N, d: w, D: Q, h: Y, m: P, s:
|
|
700
|
+
return { M: W, y: K, w: N, d: w, D: Q, h: Y, m: P, s: T, ms: O, Q: X }[m] || String(m || "").toLowerCase().replace(/s$/, "");
|
|
701
701
|
}, u: function(m) {
|
|
702
702
|
return m === void 0;
|
|
703
|
-
} },
|
|
704
|
-
q[
|
|
705
|
-
var
|
|
706
|
-
return m instanceof g || !(!m || !m[
|
|
707
|
-
}, t = function m(
|
|
708
|
-
var
|
|
709
|
-
if (!
|
|
710
|
-
if (typeof
|
|
711
|
-
var h =
|
|
712
|
-
q[h] && (
|
|
713
|
-
var y =
|
|
714
|
-
if (!
|
|
703
|
+
} }, se = "en", q = {};
|
|
704
|
+
q[se] = de;
|
|
705
|
+
var R = "$isDayjsObject", e = function(m) {
|
|
706
|
+
return m instanceof g || !(!m || !m[R]);
|
|
707
|
+
}, t = function m(f, c, s) {
|
|
708
|
+
var o;
|
|
709
|
+
if (!f) return se;
|
|
710
|
+
if (typeof f == "string") {
|
|
711
|
+
var h = f.toLowerCase();
|
|
712
|
+
q[h] && (o = h), c && (q[h] = c, o = h);
|
|
713
|
+
var y = f.split("-");
|
|
714
|
+
if (!o && y.length > 1) return m(y[0]);
|
|
715
715
|
} else {
|
|
716
|
-
var p =
|
|
717
|
-
q[p] =
|
|
716
|
+
var p = f.name;
|
|
717
|
+
q[p] = f, o = p;
|
|
718
718
|
}
|
|
719
|
-
return !
|
|
720
|
-
}, n = function(m,
|
|
719
|
+
return !s && o && (se = o), o || !s && se;
|
|
720
|
+
}, n = function(m, f) {
|
|
721
721
|
if (e(m)) return m.clone();
|
|
722
|
-
var c = typeof
|
|
722
|
+
var c = typeof f == "object" ? f : {};
|
|
723
723
|
return c.date = m, c.args = arguments, new g(c);
|
|
724
|
-
},
|
|
725
|
-
|
|
726
|
-
return n(m, { locale:
|
|
724
|
+
}, a = ye;
|
|
725
|
+
a.l = t, a.i = e, a.w = function(m, f) {
|
|
726
|
+
return n(m, { locale: f.$L, utc: f.$u, x: f.$x, $offset: f.$offset });
|
|
727
727
|
};
|
|
728
728
|
var g = (function() {
|
|
729
729
|
function m(c) {
|
|
730
|
-
this.$L = t(c.locale, null, !0), this.parse(c), this.$x = this.$x || c.x || {}, this[
|
|
730
|
+
this.$L = t(c.locale, null, !0), this.parse(c), this.$x = this.$x || c.x || {}, this[R] = !0;
|
|
731
731
|
}
|
|
732
|
-
var
|
|
733
|
-
return
|
|
734
|
-
this.$d = (function(
|
|
735
|
-
var
|
|
736
|
-
if (
|
|
737
|
-
if (
|
|
738
|
-
if (
|
|
739
|
-
if (typeof
|
|
740
|
-
var y =
|
|
732
|
+
var f = m.prototype;
|
|
733
|
+
return f.parse = function(c) {
|
|
734
|
+
this.$d = (function(s) {
|
|
735
|
+
var o = s.date, h = s.utc;
|
|
736
|
+
if (o === null) return /* @__PURE__ */ new Date(NaN);
|
|
737
|
+
if (a.u(o)) return /* @__PURE__ */ new Date();
|
|
738
|
+
if (o instanceof Date) return new Date(o);
|
|
739
|
+
if (typeof o == "string" && !/Z$/i.test(o)) {
|
|
740
|
+
var y = o.match(ie);
|
|
741
741
|
if (y) {
|
|
742
742
|
var p = y[2] - 1 || 0, _ = (y[7] || "0").substring(0, 3);
|
|
743
743
|
return h ? new Date(Date.UTC(y[1], p, y[3] || 1, y[4] || 0, y[5] || 0, y[6] || 0, _)) : new Date(y[1], p, y[3] || 1, y[4] || 0, y[5] || 0, y[6] || 0, _);
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
return new Date(
|
|
746
|
+
return new Date(o);
|
|
747
747
|
})(c), this.init();
|
|
748
|
-
},
|
|
748
|
+
}, f.init = function() {
|
|
749
749
|
var c = this.$d;
|
|
750
750
|
this.$y = c.getFullYear(), this.$M = c.getMonth(), this.$D = c.getDate(), this.$W = c.getDay(), this.$H = c.getHours(), this.$m = c.getMinutes(), this.$s = c.getSeconds(), this.$ms = c.getMilliseconds();
|
|
751
|
-
},
|
|
752
|
-
return
|
|
753
|
-
},
|
|
754
|
-
return this.$d.toString() !==
|
|
755
|
-
},
|
|
756
|
-
var
|
|
757
|
-
return this.startOf(
|
|
758
|
-
},
|
|
759
|
-
return n(c) < this.startOf(
|
|
760
|
-
},
|
|
761
|
-
return this.endOf(
|
|
762
|
-
},
|
|
763
|
-
return
|
|
764
|
-
},
|
|
751
|
+
}, f.$utils = function() {
|
|
752
|
+
return a;
|
|
753
|
+
}, f.isValid = function() {
|
|
754
|
+
return this.$d.toString() !== ee;
|
|
755
|
+
}, f.isSame = function(c, s) {
|
|
756
|
+
var o = n(c);
|
|
757
|
+
return this.startOf(s) <= o && o <= this.endOf(s);
|
|
758
|
+
}, f.isAfter = function(c, s) {
|
|
759
|
+
return n(c) < this.startOf(s);
|
|
760
|
+
}, f.isBefore = function(c, s) {
|
|
761
|
+
return this.endOf(s) < n(c);
|
|
762
|
+
}, f.$g = function(c, s, o) {
|
|
763
|
+
return a.u(c) ? this[s] : this.set(o, c);
|
|
764
|
+
}, f.unix = function() {
|
|
765
765
|
return Math.floor(this.valueOf() / 1e3);
|
|
766
|
-
},
|
|
766
|
+
}, f.valueOf = function() {
|
|
767
767
|
return this.$d.getTime();
|
|
768
|
-
},
|
|
769
|
-
var
|
|
770
|
-
var
|
|
771
|
-
return h ?
|
|
772
|
-
}, _ = function(
|
|
773
|
-
return
|
|
774
|
-
},
|
|
768
|
+
}, f.startOf = function(c, s) {
|
|
769
|
+
var o = this, h = !!a.u(s) || s, y = a.p(c), p = function(D, E) {
|
|
770
|
+
var k = a.w(o.$u ? Date.UTC(o.$y, E, D) : new Date(o.$y, E, D), o);
|
|
771
|
+
return h ? k : k.endOf(w);
|
|
772
|
+
}, _ = function(D, E) {
|
|
773
|
+
return a.w(o.toDate()[D].apply(o.toDate("s"), (h ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(E)), o);
|
|
774
|
+
}, d = this.$W, M = this.$M, C = this.$D, B = "set" + (this.$u ? "UTC" : "");
|
|
775
775
|
switch (y) {
|
|
776
776
|
case K:
|
|
777
777
|
return h ? p(1, 0) : p(31, 11);
|
|
778
778
|
case W:
|
|
779
|
-
return h ? p(1,
|
|
779
|
+
return h ? p(1, M) : p(0, M + 1);
|
|
780
780
|
case N:
|
|
781
|
-
var j = this.$locale().weekStart || 0, b = (
|
|
782
|
-
return p(h ?
|
|
781
|
+
var j = this.$locale().weekStart || 0, b = (d < j ? d + 7 : d) - j;
|
|
782
|
+
return p(h ? C - b : C + (6 - b), M);
|
|
783
783
|
case w:
|
|
784
784
|
case Q:
|
|
785
|
-
return _(
|
|
785
|
+
return _(B + "Hours", 0);
|
|
786
786
|
case Y:
|
|
787
|
-
return _(
|
|
787
|
+
return _(B + "Minutes", 1);
|
|
788
788
|
case P:
|
|
789
|
-
return _(
|
|
790
|
-
case
|
|
791
|
-
return _(
|
|
789
|
+
return _(B + "Seconds", 2);
|
|
790
|
+
case T:
|
|
791
|
+
return _(B + "Milliseconds", 3);
|
|
792
792
|
default:
|
|
793
793
|
return this.clone();
|
|
794
794
|
}
|
|
795
|
-
},
|
|
795
|
+
}, f.endOf = function(c) {
|
|
796
796
|
return this.startOf(c, !1);
|
|
797
|
-
},
|
|
798
|
-
var
|
|
797
|
+
}, f.$set = function(c, s) {
|
|
798
|
+
var o, h = a.p(c), y = "set" + (this.$u ? "UTC" : ""), p = (o = {}, o[w] = y + "Date", o[Q] = y + "Date", o[W] = y + "Month", o[K] = y + "FullYear", o[Y] = y + "Hours", o[P] = y + "Minutes", o[T] = y + "Seconds", o[O] = y + "Milliseconds", o)[h], _ = h === w ? this.$D + (s - this.$W) : s;
|
|
799
799
|
if (h === W || h === K) {
|
|
800
|
-
var
|
|
801
|
-
|
|
800
|
+
var d = this.clone().set(Q, 1);
|
|
801
|
+
d.$d[p](_), d.init(), this.$d = d.set(Q, Math.min(this.$D, d.daysInMonth())).$d;
|
|
802
802
|
} else p && this.$d[p](_);
|
|
803
803
|
return this.init(), this;
|
|
804
|
-
},
|
|
805
|
-
return this.clone().$set(c,
|
|
806
|
-
},
|
|
807
|
-
return this[
|
|
808
|
-
},
|
|
809
|
-
var
|
|
804
|
+
}, f.set = function(c, s) {
|
|
805
|
+
return this.clone().$set(c, s);
|
|
806
|
+
}, f.get = function(c) {
|
|
807
|
+
return this[a.p(c)]();
|
|
808
|
+
}, f.add = function(c, s) {
|
|
809
|
+
var o, h = this;
|
|
810
810
|
c = Number(c);
|
|
811
|
-
var y =
|
|
812
|
-
var
|
|
813
|
-
return
|
|
811
|
+
var y = a.p(s), p = function(M) {
|
|
812
|
+
var C = n(h);
|
|
813
|
+
return a.w(C.date(C.date() + Math.round(M * c)), h);
|
|
814
814
|
};
|
|
815
815
|
if (y === W) return this.set(W, this.$M + c);
|
|
816
816
|
if (y === K) return this.set(K, this.$y + c);
|
|
817
817
|
if (y === w) return p(1);
|
|
818
818
|
if (y === N) return p(7);
|
|
819
|
-
var _ = (
|
|
820
|
-
return
|
|
821
|
-
},
|
|
822
|
-
return this.add(-1 * c,
|
|
823
|
-
},
|
|
824
|
-
var
|
|
825
|
-
if (!this.isValid()) return
|
|
826
|
-
var h = c || "YYYY-MM-DDTHH:mm:ssZ", y =
|
|
827
|
-
return
|
|
828
|
-
}, b = function(
|
|
829
|
-
return
|
|
830
|
-
},
|
|
831
|
-
var
|
|
832
|
-
return A ?
|
|
819
|
+
var _ = (o = {}, o[P] = l, o[Y] = v, o[T] = i, o)[y] || 1, d = this.$d.getTime() + c * _;
|
|
820
|
+
return a.w(d, this);
|
|
821
|
+
}, f.subtract = function(c, s) {
|
|
822
|
+
return this.add(-1 * c, s);
|
|
823
|
+
}, f.format = function(c) {
|
|
824
|
+
var s = this, o = this.$locale();
|
|
825
|
+
if (!this.isValid()) return o.invalidDate || ee;
|
|
826
|
+
var h = c || "YYYY-MM-DDTHH:mm:ssZ", y = a.z(this), p = this.$H, _ = this.$m, d = this.$M, M = o.weekdays, C = o.months, B = o.meridiem, j = function(E, k, A, F) {
|
|
827
|
+
return E && (E[k] || E(s, h)) || A[k].slice(0, F);
|
|
828
|
+
}, b = function(E) {
|
|
829
|
+
return a.s(p % 12 || 12, E, "0");
|
|
830
|
+
}, D = B || function(E, k, A) {
|
|
831
|
+
var F = E < 12 ? "AM" : "PM";
|
|
832
|
+
return A ? F.toLowerCase() : F;
|
|
833
833
|
};
|
|
834
|
-
return h.replace(
|
|
835
|
-
return
|
|
834
|
+
return h.replace(he, (function(E, k) {
|
|
835
|
+
return k || (function(A) {
|
|
836
836
|
switch (A) {
|
|
837
837
|
case "YY":
|
|
838
|
-
return String(
|
|
838
|
+
return String(s.$y).slice(-2);
|
|
839
839
|
case "YYYY":
|
|
840
|
-
return
|
|
840
|
+
return a.s(s.$y, 4, "0");
|
|
841
841
|
case "M":
|
|
842
|
-
return
|
|
842
|
+
return d + 1;
|
|
843
843
|
case "MM":
|
|
844
|
-
return
|
|
844
|
+
return a.s(d + 1, 2, "0");
|
|
845
845
|
case "MMM":
|
|
846
|
-
return j(
|
|
846
|
+
return j(o.monthsShort, d, C, 3);
|
|
847
847
|
case "MMMM":
|
|
848
|
-
return j(
|
|
848
|
+
return j(C, d);
|
|
849
849
|
case "D":
|
|
850
|
-
return
|
|
850
|
+
return s.$D;
|
|
851
851
|
case "DD":
|
|
852
|
-
return
|
|
852
|
+
return a.s(s.$D, 2, "0");
|
|
853
853
|
case "d":
|
|
854
|
-
return String(
|
|
854
|
+
return String(s.$W);
|
|
855
855
|
case "dd":
|
|
856
|
-
return j(
|
|
856
|
+
return j(o.weekdaysMin, s.$W, M, 2);
|
|
857
857
|
case "ddd":
|
|
858
|
-
return j(
|
|
858
|
+
return j(o.weekdaysShort, s.$W, M, 3);
|
|
859
859
|
case "dddd":
|
|
860
|
-
return
|
|
860
|
+
return M[s.$W];
|
|
861
861
|
case "H":
|
|
862
862
|
return String(p);
|
|
863
863
|
case "HH":
|
|
864
|
-
return
|
|
864
|
+
return a.s(p, 2, "0");
|
|
865
865
|
case "h":
|
|
866
866
|
return b(1);
|
|
867
867
|
case "hh":
|
|
868
868
|
return b(2);
|
|
869
869
|
case "a":
|
|
870
|
-
return
|
|
870
|
+
return D(p, _, !0);
|
|
871
871
|
case "A":
|
|
872
|
-
return
|
|
872
|
+
return D(p, _, !1);
|
|
873
873
|
case "m":
|
|
874
874
|
return String(_);
|
|
875
875
|
case "mm":
|
|
876
|
-
return
|
|
876
|
+
return a.s(_, 2, "0");
|
|
877
877
|
case "s":
|
|
878
|
-
return String(
|
|
878
|
+
return String(s.$s);
|
|
879
879
|
case "ss":
|
|
880
|
-
return
|
|
880
|
+
return a.s(s.$s, 2, "0");
|
|
881
881
|
case "SSS":
|
|
882
|
-
return
|
|
882
|
+
return a.s(s.$ms, 3, "0");
|
|
883
883
|
case "Z":
|
|
884
884
|
return y;
|
|
885
885
|
}
|
|
886
886
|
return null;
|
|
887
|
-
})(
|
|
887
|
+
})(E) || y.replace(":", "");
|
|
888
888
|
}));
|
|
889
|
-
},
|
|
889
|
+
}, f.utcOffset = function() {
|
|
890
890
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
891
|
-
},
|
|
892
|
-
var h, y = this, p =
|
|
893
|
-
return
|
|
891
|
+
}, f.diff = function(c, s, o) {
|
|
892
|
+
var h, y = this, p = a.p(s), _ = n(c), d = (_.utcOffset() - this.utcOffset()) * l, M = this - _, C = function() {
|
|
893
|
+
return a.m(y, _);
|
|
894
894
|
};
|
|
895
895
|
switch (p) {
|
|
896
896
|
case K:
|
|
897
|
-
h =
|
|
897
|
+
h = C() / 12;
|
|
898
898
|
break;
|
|
899
899
|
case W:
|
|
900
|
-
h =
|
|
900
|
+
h = C();
|
|
901
901
|
break;
|
|
902
|
-
case
|
|
903
|
-
h =
|
|
902
|
+
case X:
|
|
903
|
+
h = C() / 3;
|
|
904
904
|
break;
|
|
905
905
|
case N:
|
|
906
|
-
h = (
|
|
906
|
+
h = (M - d) / 6048e5;
|
|
907
907
|
break;
|
|
908
908
|
case w:
|
|
909
|
-
h = (
|
|
909
|
+
h = (M - d) / 864e5;
|
|
910
910
|
break;
|
|
911
911
|
case Y:
|
|
912
|
-
h =
|
|
912
|
+
h = M / v;
|
|
913
913
|
break;
|
|
914
914
|
case P:
|
|
915
|
-
h =
|
|
915
|
+
h = M / l;
|
|
916
916
|
break;
|
|
917
|
-
case
|
|
918
|
-
h =
|
|
917
|
+
case T:
|
|
918
|
+
h = M / i;
|
|
919
919
|
break;
|
|
920
920
|
default:
|
|
921
|
-
h =
|
|
921
|
+
h = M;
|
|
922
922
|
}
|
|
923
|
-
return
|
|
924
|
-
},
|
|
923
|
+
return o ? h : a.a(h);
|
|
924
|
+
}, f.daysInMonth = function() {
|
|
925
925
|
return this.endOf(W).$D;
|
|
926
|
-
},
|
|
926
|
+
}, f.$locale = function() {
|
|
927
927
|
return q[this.$L];
|
|
928
|
-
},
|
|
928
|
+
}, f.locale = function(c, s) {
|
|
929
929
|
if (!c) return this.$L;
|
|
930
|
-
var
|
|
931
|
-
return h && (
|
|
932
|
-
},
|
|
933
|
-
return
|
|
934
|
-
},
|
|
930
|
+
var o = this.clone(), h = t(c, s, !0);
|
|
931
|
+
return h && (o.$L = h), o;
|
|
932
|
+
}, f.clone = function() {
|
|
933
|
+
return a.w(this.$d, this);
|
|
934
|
+
}, f.toDate = function() {
|
|
935
935
|
return new Date(this.valueOf());
|
|
936
|
-
},
|
|
936
|
+
}, f.toJSON = function() {
|
|
937
937
|
return this.isValid() ? this.toISOString() : null;
|
|
938
|
-
},
|
|
938
|
+
}, f.toISOString = function() {
|
|
939
939
|
return this.$d.toISOString();
|
|
940
|
-
},
|
|
940
|
+
}, f.toString = function() {
|
|
941
941
|
return this.$d.toUTCString();
|
|
942
942
|
}, m;
|
|
943
943
|
})(), S = g.prototype;
|
|
944
|
-
return n.prototype = S, [["$ms",
|
|
945
|
-
S[m[1]] = function(
|
|
946
|
-
return this.$g(
|
|
944
|
+
return n.prototype = S, [["$ms", O], ["$s", T], ["$m", P], ["$H", Y], ["$W", w], ["$M", W], ["$y", K], ["$D", Q]].forEach((function(m) {
|
|
945
|
+
S[m[1]] = function(f) {
|
|
946
|
+
return this.$g(f, m[0], m[1]);
|
|
947
947
|
};
|
|
948
|
-
})), n.extend = function(m,
|
|
949
|
-
return m.$i || (m(
|
|
948
|
+
})), n.extend = function(m, f) {
|
|
949
|
+
return m.$i || (m(f, g, n), m.$i = !0), n;
|
|
950
950
|
}, n.locale = t, n.isDayjs = e, n.unix = function(m) {
|
|
951
951
|
return n(1e3 * m);
|
|
952
|
-
}, n.en = q[
|
|
952
|
+
}, n.en = q[se], n.Ls = q, n.p = {}, n;
|
|
953
953
|
}));
|
|
954
|
-
})(
|
|
954
|
+
})(we)), we.exports;
|
|
955
955
|
}
|
|
956
|
-
var
|
|
957
|
-
const
|
|
958
|
-
var
|
|
959
|
-
function
|
|
960
|
-
return Me || (Me = 1, (function(
|
|
961
|
-
(function(i,
|
|
962
|
-
|
|
963
|
-
})(
|
|
956
|
+
var Ke = He();
|
|
957
|
+
const G = /* @__PURE__ */ be(Ke);
|
|
958
|
+
var ke = { exports: {} }, Je = ke.exports, Me;
|
|
959
|
+
function Qe() {
|
|
960
|
+
return Me || (Me = 1, (function(u, r) {
|
|
961
|
+
(function(i, l) {
|
|
962
|
+
u.exports = l();
|
|
963
|
+
})(Je, (function() {
|
|
964
964
|
var i = { 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" };
|
|
965
|
-
return function(
|
|
966
|
-
var
|
|
967
|
-
|
|
965
|
+
return function(l, v, O) {
|
|
966
|
+
var T = v.prototype, P = T.format;
|
|
967
|
+
O.en.formats = i, T.format = function(Y) {
|
|
968
968
|
Y === void 0 && (Y = "YYYY-MM-DDTHH:mm:ssZ");
|
|
969
|
-
var w = this.$locale().formats, N = (function(W,
|
|
970
|
-
return W.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(K, Q,
|
|
971
|
-
var
|
|
972
|
-
return Q || ee
|
|
973
|
-
return
|
|
969
|
+
var w = this.$locale().formats, N = (function(W, X) {
|
|
970
|
+
return W.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(K, Q, ee) {
|
|
971
|
+
var ie = ee && ee.toUpperCase();
|
|
972
|
+
return Q || X[ee] || i[ee] || X[ie].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(he, de, oe) {
|
|
973
|
+
return de || oe.slice(1);
|
|
974
974
|
}));
|
|
975
975
|
}));
|
|
976
976
|
})(Y, w === void 0 ? {} : w);
|
|
@@ -978,40 +978,40 @@ function Ze() {
|
|
|
978
978
|
};
|
|
979
979
|
};
|
|
980
980
|
}));
|
|
981
|
-
})(
|
|
981
|
+
})(ke)), ke.exports;
|
|
982
982
|
}
|
|
983
|
-
var
|
|
984
|
-
const
|
|
985
|
-
|
|
986
|
-
Date.prototype.isAfter = function(
|
|
987
|
-
return
|
|
983
|
+
var Ve = Qe();
|
|
984
|
+
const Ze = /* @__PURE__ */ be(Ve);
|
|
985
|
+
G.extend(Ze);
|
|
986
|
+
Date.prototype.isAfter = function(u, r) {
|
|
987
|
+
return G(this).isAfter(u, r);
|
|
988
988
|
};
|
|
989
|
-
Date.prototype.isBefore = function(
|
|
990
|
-
return
|
|
989
|
+
Date.prototype.isBefore = function(u, r) {
|
|
990
|
+
return G(this).isBefore(u, r);
|
|
991
991
|
};
|
|
992
|
-
Date.prototype.format = function(
|
|
993
|
-
return
|
|
992
|
+
Date.prototype.format = function(u) {
|
|
993
|
+
return G(this).format(u);
|
|
994
994
|
};
|
|
995
995
|
Date.prototype.isValid = function() {
|
|
996
|
-
return
|
|
996
|
+
return G(this).isValid();
|
|
997
997
|
};
|
|
998
|
-
Date.prototype.add = function(
|
|
999
|
-
return
|
|
998
|
+
Date.prototype.add = function(u, r) {
|
|
999
|
+
return G(this).add(u, r).toDate();
|
|
1000
1000
|
};
|
|
1001
|
-
Date.prototype.subtract = function(
|
|
1002
|
-
return
|
|
1001
|
+
Date.prototype.subtract = function(u, r) {
|
|
1002
|
+
return G(this).subtract(u, r).toDate();
|
|
1003
1003
|
};
|
|
1004
1004
|
Date.prototype.firstDayOfMonth = function() {
|
|
1005
|
-
return
|
|
1005
|
+
return G(this).startOf("month").toDate();
|
|
1006
1006
|
};
|
|
1007
1007
|
Date.prototype.lastDayOfMonth = function() {
|
|
1008
|
-
return
|
|
1008
|
+
return G(this).endOf("month").toDate();
|
|
1009
1009
|
};
|
|
1010
|
-
Date.prototype.set = function(
|
|
1011
|
-
return
|
|
1010
|
+
Date.prototype.set = function(u, r) {
|
|
1011
|
+
return G(this).set(u, r).toDate();
|
|
1012
1012
|
};
|
|
1013
|
-
Date.prototype.diff = function(
|
|
1014
|
-
return
|
|
1013
|
+
Date.prototype.diff = function(u, r) {
|
|
1014
|
+
return G(this).diff(u, r);
|
|
1015
1015
|
};
|
|
1016
1016
|
String.prototype.capitalize = function() {
|
|
1017
1017
|
return this.charAt(0).toUpperCase() + this.slice(1);
|
|
@@ -1022,8 +1022,7 @@ String.prototype.isNumber = function() {
|
|
|
1022
1022
|
String.prototype.isEmpty = function() {
|
|
1023
1023
|
return this === void 0 || !this || this.length === 0;
|
|
1024
1024
|
};
|
|
1025
|
-
|
|
1026
|
-
const le = {
|
|
1025
|
+
const Ge = {
|
|
1027
1026
|
xs: 0,
|
|
1028
1027
|
sm: 576,
|
|
1029
1028
|
md: 768,
|
|
@@ -1032,7 +1031,8 @@ const le = {
|
|
|
1032
1031
|
xxl: 1400,
|
|
1033
1032
|
xxxl: 1600
|
|
1034
1033
|
};
|
|
1035
|
-
class
|
|
1034
|
+
class it {
|
|
1035
|
+
screenBreakpoints;
|
|
1036
1036
|
screenWidth = 0;
|
|
1037
1037
|
lastBreakpoint;
|
|
1038
1038
|
resizeListener;
|
|
@@ -1046,18 +1046,18 @@ class st {
|
|
|
1046
1046
|
pendingWidth;
|
|
1047
1047
|
pendingBreakpoint;
|
|
1048
1048
|
duplicateThresholdMs = 60;
|
|
1049
|
-
constructor() {
|
|
1050
|
-
typeof window < "u" && (this.screenWidth = window.innerWidth, this.resizeListener = this.onResize.bind(this), window.addEventListener("resize", this.resizeListener, { passive: !0 }), this.lastBreakpoint = this.getBreakpointByScreenWidth(this.screenWidth));
|
|
1049
|
+
constructor(r) {
|
|
1050
|
+
typeof window < "u" && (this.screenBreakpoints = r || Ge, this.screenWidth = window.innerWidth, this.resizeListener = this.onResize.bind(this), window.addEventListener("resize", this.resizeListener, { passive: !0 }), this.lastBreakpoint = this.getBreakpointByScreenWidth(this.screenWidth));
|
|
1051
1051
|
}
|
|
1052
1052
|
destroy() {
|
|
1053
1053
|
typeof window < "u" && window.removeEventListener("resize", this.resizeListener), this.breakpointChangeCallbacks.clear(), this.onResizeCallbacks.clear(), this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
|
|
1054
1054
|
}
|
|
1055
|
-
getCurrentBreakpoint() {
|
|
1056
|
-
return this.lastBreakpoint;
|
|
1057
|
-
}
|
|
1058
1055
|
getCurrentScreenWidth() {
|
|
1059
1056
|
return this.screenWidth;
|
|
1060
1057
|
}
|
|
1058
|
+
getCurrentBreakpoint() {
|
|
1059
|
+
return this.lastBreakpoint;
|
|
1060
|
+
}
|
|
1061
1061
|
onBreakpointChange(r) {
|
|
1062
1062
|
this.breakpointChangeCallbacks.add(r);
|
|
1063
1063
|
}
|
|
@@ -1070,93 +1070,42 @@ class st {
|
|
|
1070
1070
|
offResizeChange(r) {
|
|
1071
1071
|
this.onResizeCallbacks.delete(r);
|
|
1072
1072
|
}
|
|
1073
|
-
getCurrentBrowser() {
|
|
1074
|
-
const r = navigator.userAgent.toLowerCase();
|
|
1075
|
-
if (this.isOpera()) return Z.opera;
|
|
1076
|
-
if (this.isFirefox()) return Z.firefox;
|
|
1077
|
-
if (this.isSafari()) return Z.safari;
|
|
1078
|
-
if (this.isIE()) return Z.ie;
|
|
1079
|
-
if (this.isEdge()) return Z.edge;
|
|
1080
|
-
if (this.isEdg()) return Z.edg;
|
|
1081
|
-
if (this.isElectron(r)) return Z.electron;
|
|
1082
|
-
if (this.isChrome()) return Z.chrome;
|
|
1083
|
-
if (this.isIOsSafari(r)) return Z.iOsSafari;
|
|
1084
|
-
if (this.isEdgiOs(r)) return Z.edgiOs;
|
|
1085
|
-
if (this.isHeadlessChrome(r)) return Z.headlessChrome;
|
|
1086
|
-
throw new Error("Browser could not be detected: " + r);
|
|
1087
|
-
}
|
|
1088
1073
|
getBreakpointByScreenWidth(r = this.screenWidth) {
|
|
1089
1074
|
let i = "xs";
|
|
1090
|
-
for (const
|
|
1091
|
-
|
|
1092
|
-
return { breakpoint: i, screenWidth:
|
|
1075
|
+
for (const l of Object.keys(this.screenBreakpoints))
|
|
1076
|
+
this.screenBreakpoints[l] <= r && (i = l);
|
|
1077
|
+
return { breakpoint: i, screenWidth: this.screenBreakpoints[i] };
|
|
1093
1078
|
}
|
|
1094
1079
|
isScreenGreaterThan(r) {
|
|
1095
|
-
return this.screenWidth >
|
|
1080
|
+
return this.screenWidth > this.screenBreakpoints[r];
|
|
1096
1081
|
}
|
|
1097
1082
|
isScreenSmallerThan(r) {
|
|
1098
|
-
return this.screenWidth <
|
|
1083
|
+
return this.screenWidth < this.screenBreakpoints[r];
|
|
1099
1084
|
}
|
|
1100
1085
|
getBreakpoint(r) {
|
|
1101
1086
|
return {
|
|
1102
1087
|
breakpoint: r,
|
|
1103
|
-
screenWidth:
|
|
1088
|
+
screenWidth: this.screenBreakpoints[r]
|
|
1104
1089
|
};
|
|
1105
1090
|
}
|
|
1106
|
-
isOpera() {
|
|
1107
|
-
return typeof window < "u" && (!!window.opr && !!window.opr.addons || !!window.opera || navigator.userAgent.includes("OPR/"));
|
|
1108
|
-
}
|
|
1109
|
-
isFirefox() {
|
|
1110
|
-
return typeof globalThis.InstallTrigger < "u";
|
|
1111
|
-
}
|
|
1112
|
-
isSafari() {
|
|
1113
|
-
return typeof window > "u" ? !1 : /constructor/i.test(window.HTMLElement) || ((r) => r.toString() === "[object SafariRemoteNotification]")(
|
|
1114
|
-
!window.safari || window.safari && window.safari.pushNotification
|
|
1115
|
-
);
|
|
1116
|
-
}
|
|
1117
|
-
isIE() {
|
|
1118
|
-
return typeof document > "u" ? !1 : !!document.documentMode;
|
|
1119
|
-
}
|
|
1120
|
-
isEdge() {
|
|
1121
|
-
return typeof window > "u" ? !1 : !this.isIE() && !!window.StyleMedia;
|
|
1122
|
-
}
|
|
1123
|
-
isEdg() {
|
|
1124
|
-
return typeof navigator > "u" ? !1 : navigator.userAgent.toLowerCase().includes("edg");
|
|
1125
|
-
}
|
|
1126
|
-
isElectron(r) {
|
|
1127
|
-
return r.includes("electron");
|
|
1128
|
-
}
|
|
1129
|
-
isChrome() {
|
|
1130
|
-
return typeof window > "u" ? !1 : !!window.chrome && !this.isOpera() && !this.isEdge() && !this.isEdg() && !this.isFirefox() && !this.isSafari() && !this.isIE();
|
|
1131
|
-
}
|
|
1132
|
-
isIOsSafari(r) {
|
|
1133
|
-
return r.includes("iphone") || r.includes("ipad") || r.includes("macintosh") && typeof document < "u" && "ontouchend" in document && r.includes("safari");
|
|
1134
|
-
}
|
|
1135
|
-
isEdgiOs(r) {
|
|
1136
|
-
return r.includes("edgios");
|
|
1137
|
-
}
|
|
1138
|
-
isHeadlessChrome(r) {
|
|
1139
|
-
return r.includes("headlesschrome");
|
|
1140
|
-
}
|
|
1141
1091
|
onResize = () => {
|
|
1142
1092
|
if (typeof window > "u") return;
|
|
1143
1093
|
const r = window.innerWidth, i = this.getBreakpointByScreenWidth(r);
|
|
1144
|
-
this.lastBreakpoint?.breakpoint !== i?.breakpoint && (this.lastBreakpoint = i, i && this.breakpointChangeCallbacks.forEach((
|
|
1145
|
-
this.pendingBreakpoint && this.onResizeCallbacks.forEach((
|
|
1094
|
+
this.lastBreakpoint?.breakpoint !== i?.breakpoint && (this.lastBreakpoint = i, i && this.breakpointChangeCallbacks.forEach((l) => l(i))), this.pendingWidth = r, this.pendingBreakpoint = i, this.emitTimeoutId && clearTimeout(this.emitTimeoutId), this.emitTimeoutId = window.setTimeout(() => {
|
|
1095
|
+
this.pendingBreakpoint && this.onResizeCallbacks.forEach((l) => l(this.pendingWidth, this.pendingBreakpoint)), this.pendingWidth = void 0, this.pendingBreakpoint = void 0, this.emitTimeoutId = null;
|
|
1146
1096
|
}, this.duplicateThresholdMs);
|
|
1147
1097
|
};
|
|
1148
1098
|
}
|
|
1149
1099
|
export {
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
tt as
|
|
1153
|
-
rt as
|
|
1154
|
-
|
|
1155
|
-
_e as LocalStorageHelper,
|
|
1100
|
+
it as BrowserService,
|
|
1101
|
+
et as CsvHelper,
|
|
1102
|
+
tt as EnumHelper,
|
|
1103
|
+
rt as FileHelper,
|
|
1104
|
+
me as LocalStorageHelper,
|
|
1156
1105
|
V as LoggerHelper,
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1106
|
+
Ge as ScreenBreakpoints,
|
|
1107
|
+
nt as TokenHelper,
|
|
1108
|
+
Xe as copyToClipboard,
|
|
1109
|
+
Ie as saveAs,
|
|
1110
|
+
Ne as sortHelper
|
|
1162
1111
|
};
|