@oardi/ts-utils 0.0.50 → 0.0.52
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/extensions/array-extensions.d.ts.map +1 -1
- package/helpers/break-point/break-point.helper.d.ts.map +1 -1
- package/helpers/browser/browser.helper.d.ts.map +1 -1
- package/helpers/canvas.helper.d.ts.map +1 -1
- package/helpers/download.helper.d.ts.map +1 -1
- package/helpers/file.helper.d.ts.map +1 -1
- package/helpers/image.helper.d.ts.map +1 -1
- package/helpers/sort.helper.d.ts.map +1 -1
- package/index.cjs.js +7 -7
- package/index.es.js +347 -325
- package/index.umd.js +7 -7
- package/package.json +1 -1
- package/services/browser/browser.service.d.ts +1 -2
- package/services/browser/browser.service.d.ts.map +1 -1
package/index.es.js
CHANGED
|
@@ -15,22 +15,22 @@ class St {
|
|
|
15
15
|
return document.documentElement.clientHeight;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
class
|
|
18
|
+
class ht {
|
|
19
19
|
static breakPoints = zt;
|
|
20
20
|
static getCurrentBreakpoint() {
|
|
21
|
-
return
|
|
21
|
+
return ht.getBreakpointByScreenWidth(St.getScreenWidth());
|
|
22
22
|
}
|
|
23
23
|
static getBreakpointByScreenWidth(t = St.getScreenWidth()) {
|
|
24
|
-
let
|
|
25
|
-
for (const
|
|
26
|
-
|
|
27
|
-
return { breakpoint:
|
|
24
|
+
let n = "xs";
|
|
25
|
+
for (const a of Object.keys(ht.breakPoints))
|
|
26
|
+
ht.breakPoints[a] <= t && (n = a);
|
|
27
|
+
return { breakpoint: n, screenWidth: t };
|
|
28
28
|
}
|
|
29
29
|
static isScreenGreaterThan(t) {
|
|
30
|
-
return St.getScreenWidth() >
|
|
30
|
+
return St.getScreenWidth() > ht.breakPoints[t];
|
|
31
31
|
}
|
|
32
32
|
static isScreenSmallerThan(t) {
|
|
33
|
-
return St.getScreenWidth() <
|
|
33
|
+
return St.getScreenWidth() < ht.breakPoints[t];
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
var et = /* @__PURE__ */ ((s) => (s.opera = "opera", s.firefox = "firefox", s.safari = "safari", s.ie = "ie", s.edgeLegacy = "edgeLegacy", s.edg = "edg", s.chrome = "chrome", s.iOS = "iOS", s.headlessChrome = "headlessChrome", s.nodeRuntime = "nodeRuntime", s.electron = "electron", s))(et || {});
|
|
@@ -48,13 +48,13 @@ class rt {
|
|
|
48
48
|
}
|
|
49
49
|
static isSafari(t = ft) {
|
|
50
50
|
if (!this.isBrowserEnv()) return !1;
|
|
51
|
-
const
|
|
52
|
-
return
|
|
51
|
+
const n = navigator.vendor && navigator.vendor.includes("Apple"), a = t.includes("safari"), k = !(t.includes("crios") || t.includes("chrome") || t.includes("android") || t.includes("opr/") || t.includes("edg"));
|
|
52
|
+
return n && a && k;
|
|
53
53
|
}
|
|
54
54
|
static isIOS(t = ft) {
|
|
55
55
|
if (!this.isBrowserEnv()) return !1;
|
|
56
|
-
const
|
|
57
|
-
return
|
|
56
|
+
const n = /iphone|ipad|ipod/.test(t), a = t.includes("macintosh") && navigator.maxTouchPoints > 1;
|
|
57
|
+
return n || a;
|
|
58
58
|
}
|
|
59
59
|
static isEdgeLegacy() {
|
|
60
60
|
return this.isBrowserEnv() ? !!window.StyleMedia && !ft.includes("edg/") : !1;
|
|
@@ -67,8 +67,8 @@ class rt {
|
|
|
67
67
|
}
|
|
68
68
|
static isChrome(t = ft) {
|
|
69
69
|
if (!this.isBrowserEnv()) return !1;
|
|
70
|
-
const
|
|
71
|
-
return
|
|
70
|
+
const n = navigator.vendor && navigator.vendor.includes("Google"), a = t.includes("chrome") || t.includes("crios"), k = !this.isEdg(t) && !this.isOpera(t);
|
|
71
|
+
return n && a && k;
|
|
72
72
|
}
|
|
73
73
|
static isElectron(t = ft) {
|
|
74
74
|
return typeof process < "u" && process.versions?.electron ? !0 : t.includes("electron");
|
|
@@ -103,18 +103,18 @@ function Mt(s) {
|
|
|
103
103
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
104
104
|
}
|
|
105
105
|
var Et = { exports: {} };
|
|
106
|
-
var Yt = Et.exports,
|
|
106
|
+
var Yt = Et.exports, Tt;
|
|
107
107
|
function Pt() {
|
|
108
|
-
return
|
|
109
|
-
((
|
|
110
|
-
s.exports =
|
|
111
|
-
})(Yt, function
|
|
112
|
-
var
|
|
108
|
+
return Tt || (Tt = 1, (function(s, t) {
|
|
109
|
+
((n, a) => {
|
|
110
|
+
s.exports = a();
|
|
111
|
+
})(Yt, function n() {
|
|
112
|
+
var a = typeof self < "u" ? self : typeof window < "u" ? window : a !== void 0 ? a : {}, k, D = !a.document && !!a.postMessage, T = a.IS_PAPA_WORKER || !1, Y = {}, q = 0, p = {};
|
|
113
113
|
function P(e) {
|
|
114
114
|
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) {
|
|
115
|
-
var
|
|
116
|
-
|
|
117
|
-
}).call(this, e), this.parseChunk = function(r,
|
|
115
|
+
var i = ut(r);
|
|
116
|
+
i.chunkSize = parseInt(i.chunkSize), r.step || r.chunk || (i.chunkSize = null), this._handle = new tt(i), (this._handle.streamer = this)._config = i;
|
|
117
|
+
}).call(this, e), this.parseChunk = function(r, i) {
|
|
118
118
|
var u = parseInt(this._config.skipFirstNLines) || 0;
|
|
119
119
|
if (this.isFirstChunk && 0 < u) {
|
|
120
120
|
let S = this._config.newline;
|
|
@@ -123,8 +123,8 @@ function Pt() {
|
|
|
123
123
|
this.isFirstChunk && R(this._config.beforeFirstChunk) && (m = this._config.beforeFirstChunk(r)) !== void 0 && (r = m), this.isFirstChunk = !1, this._halted = !1;
|
|
124
124
|
var u = this._partialLine + r, m = (this._partialLine = "", this._handle.parse(u, this._baseIndex, !this._finished));
|
|
125
125
|
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
126
|
-
if (r = m.meta.cursor, u = (this._finished || (this._partialLine = u.substring(r - this._baseIndex), this._baseIndex = r), m && m.data && (this._rowCount += m.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview),
|
|
127
|
-
else if (R(this._config.chunk) && !
|
|
126
|
+
if (r = m.meta.cursor, u = (this._finished || (this._partialLine = u.substring(r - this._baseIndex), this._baseIndex = r), m && m.data && (this._rowCount += m.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview), T) a.postMessage({ results: m, workerId: p.WORKER_ID, finished: u });
|
|
127
|
+
else if (R(this._config.chunk) && !i) {
|
|
128
128
|
if (this._config.chunk(m, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0);
|
|
129
129
|
this._completeResults = m = void 0;
|
|
130
130
|
}
|
|
@@ -132,7 +132,7 @@ function Pt() {
|
|
|
132
132
|
}
|
|
133
133
|
this._halted = !0;
|
|
134
134
|
}, this._sendError = function(r) {
|
|
135
|
-
R(this._config.error) ? this._config.error(r) :
|
|
135
|
+
R(this._config.error) ? this._config.error(r) : T && this._config.error && a.postMessage({ workerId: p.WORKER_ID, error: r, finished: !1 });
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
function F(e) {
|
|
@@ -141,14 +141,14 @@ function Pt() {
|
|
|
141
141
|
this._readChunk(), this._chunkLoaded();
|
|
142
142
|
} : function() {
|
|
143
143
|
this._readChunk();
|
|
144
|
-
}, this.stream = function(
|
|
145
|
-
this._input =
|
|
144
|
+
}, this.stream = function(i) {
|
|
145
|
+
this._input = i, this._nextChunk();
|
|
146
146
|
}, this._readChunk = function() {
|
|
147
147
|
if (this._finished) this._chunkLoaded();
|
|
148
148
|
else {
|
|
149
149
|
if (r = new XMLHttpRequest(), this._config.withCredentials && (r.withCredentials = this._config.withCredentials), D || (r.onload = Q(this._chunkLoaded, this), r.onerror = Q(this._chunkError, this)), r.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !D), this._config.downloadRequestHeaders) {
|
|
150
|
-
var
|
|
151
|
-
for (
|
|
150
|
+
var i, u = this._config.downloadRequestHeaders;
|
|
151
|
+
for (i in u) r.setRequestHeader(i, u[i]);
|
|
152
152
|
}
|
|
153
153
|
var m;
|
|
154
154
|
this._config.chunkSize && (m = this._start + this._config.chunkSize - 1, r.setRequestHeader("Range", "bytes=" + this._start + "-" + m));
|
|
@@ -160,20 +160,20 @@ function Pt() {
|
|
|
160
160
|
D && r.status === 0 && this._chunkError();
|
|
161
161
|
}
|
|
162
162
|
}, this._chunkLoaded = function() {
|
|
163
|
-
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 >= ((
|
|
164
|
-
}, this._chunkError = function(
|
|
165
|
-
|
|
163
|
+
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)));
|
|
164
|
+
}, this._chunkError = function(i) {
|
|
165
|
+
i = r.statusText || i, this._sendError(new Error(i));
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
168
|
function J(e) {
|
|
169
169
|
(e = e || {}).chunkSize || (e.chunkSize = p.LocalChunkSize), P.call(this, e);
|
|
170
|
-
var r,
|
|
170
|
+
var r, i, u = typeof FileReader < "u";
|
|
171
171
|
this.stream = function(m) {
|
|
172
|
-
this._input = m,
|
|
172
|
+
this._input = m, i = m.slice || m.webkitSlice || m.mozSlice, u ? ((r = new FileReader()).onload = Q(this._chunkLoaded, this), r.onerror = Q(this._chunkError, this)) : r = new FileReaderSync(), this._nextChunk();
|
|
173
173
|
}, this._nextChunk = function() {
|
|
174
174
|
this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
|
|
175
175
|
}, this._readChunk = function() {
|
|
176
|
-
var m = this._input, S = (this._config.chunkSize && (S = Math.min(this._start + this._config.chunkSize, this._input.size), m =
|
|
176
|
+
var m = this._input, S = (this._config.chunkSize && (S = Math.min(this._start + this._config.chunkSize, this._input.size), m = i.call(m, this._start, S)), r.readAsText(m, this._config.encoding));
|
|
177
177
|
u || this._chunkLoaded({ target: { result: S } });
|
|
178
178
|
}, this._chunkLoaded = function(m) {
|
|
179
179
|
this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(m.target.result);
|
|
@@ -183,16 +183,16 @@ function Pt() {
|
|
|
183
183
|
}
|
|
184
184
|
function B(e) {
|
|
185
185
|
var r;
|
|
186
|
-
P.call(this, e = e || {}), this.stream = function(
|
|
187
|
-
return r =
|
|
186
|
+
P.call(this, e = e || {}), this.stream = function(i) {
|
|
187
|
+
return r = i, this._nextChunk();
|
|
188
188
|
}, this._nextChunk = function() {
|
|
189
|
-
var
|
|
190
|
-
if (!this._finished) return
|
|
189
|
+
var i, u;
|
|
190
|
+
if (!this._finished) return i = this._config.chunkSize, r = i ? (u = r.substring(0, i), r.substring(i)) : (u = r, ""), this._finished = !r, this.parseChunk(u);
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
193
|
function Z(e) {
|
|
194
194
|
P.call(this, e = e || {});
|
|
195
|
-
var r = [],
|
|
195
|
+
var r = [], i = !0, u = !1;
|
|
196
196
|
this.pause = function() {
|
|
197
197
|
P.prototype.pause.apply(this, arguments), this._input.pause();
|
|
198
198
|
}, this.resume = function() {
|
|
@@ -202,10 +202,10 @@ function Pt() {
|
|
|
202
202
|
}, this._checkIsFinished = function() {
|
|
203
203
|
u && r.length === 1 && (this._finished = !0);
|
|
204
204
|
}, this._nextChunk = function() {
|
|
205
|
-
this._checkIsFinished(), r.length ? this.parseChunk(r.shift()) :
|
|
205
|
+
this._checkIsFinished(), r.length ? this.parseChunk(r.shift()) : i = !0;
|
|
206
206
|
}, this._streamData = Q(function(m) {
|
|
207
207
|
try {
|
|
208
|
-
r.push(typeof m == "string" ? m : m.toString(this._config.encoding)),
|
|
208
|
+
r.push(typeof m == "string" ? m : m.toString(this._config.encoding)), i && (i = !1, this._checkIsFinished(), this.parseChunk(r.shift()));
|
|
209
209
|
} catch (S) {
|
|
210
210
|
this._streamError(S);
|
|
211
211
|
}
|
|
@@ -218,7 +218,7 @@ function Pt() {
|
|
|
218
218
|
}, this);
|
|
219
219
|
}
|
|
220
220
|
function tt(e) {
|
|
221
|
-
var r,
|
|
221
|
+
var r, i, u, m, S = Math.pow(2, 53), y = -S, l = /^\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, f = 0, v = !1, g = !1, _ = [], h = { data: [], errors: [], meta: {} };
|
|
222
222
|
function M(b) {
|
|
223
223
|
return e.skipEmptyLines === "greedy" ? b.join("").trim() === "" : b.length === 1 && b[0].length === 0;
|
|
224
224
|
}
|
|
@@ -226,23 +226,23 @@ function Pt() {
|
|
|
226
226
|
if (h && u && (W("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + p.DefaultDelimiter + "'"), u = !1), e.skipEmptyLines && (h.data = h.data.filter(function(w) {
|
|
227
227
|
return !M(w);
|
|
228
228
|
})), z()) {
|
|
229
|
-
let w = function(
|
|
230
|
-
R(e.transformHeader) && (
|
|
229
|
+
let w = function(I, j) {
|
|
230
|
+
R(e.transformHeader) && (I = e.transformHeader(I, j)), _.push(I);
|
|
231
231
|
};
|
|
232
232
|
if (h) if (Array.isArray(h.data[0])) {
|
|
233
233
|
for (var b = 0; z() && b < h.data.length; b++) h.data[b].forEach(w);
|
|
234
234
|
h.data.splice(0, 1);
|
|
235
235
|
} else h.data.forEach(w);
|
|
236
236
|
}
|
|
237
|
-
function x(w,
|
|
238
|
-
for (var j = e.header ? {} : [],
|
|
239
|
-
var L =
|
|
237
|
+
function x(w, I) {
|
|
238
|
+
for (var j = e.header ? {} : [], A = 0; A < w.length; A++) {
|
|
239
|
+
var L = A, $ = w[A], $ = ((nt, E) => ((U) => (e.dynamicTypingFunction && e.dynamicTyping[U] === void 0 && (e.dynamicTyping[U] = e.dynamicTypingFunction(U)), (e.dynamicTyping[U] || e.dynamicTyping) === !0))(nt) ? E === "true" || E === "TRUE" || E !== "false" && E !== "FALSE" && (((U) => {
|
|
240
240
|
if (l.test(U) && (U = parseFloat(U), y < U && U < S))
|
|
241
241
|
return 1;
|
|
242
|
-
})(E) ? parseFloat(E) : d.test(E) ? new Date(E) : E === "" ? null : E) : E)(L = e.header ?
|
|
242
|
+
})(E) ? parseFloat(E) : d.test(E) ? new Date(E) : E === "" ? null : E) : E)(L = e.header ? A >= _.length ? "__parsed_extra" : _[A] : L, $ = e.transform ? e.transform($, L) : $);
|
|
243
243
|
L === "__parsed_extra" ? (j[L] = j[L] || [], j[L].push($)) : j[L] = $;
|
|
244
244
|
}
|
|
245
|
-
return e.header && (
|
|
245
|
+
return e.header && (A > _.length ? W("FieldMismatch", "TooManyFields", "Too many fields: expected " + _.length + " fields but parsed " + A, f + I) : A < _.length && W("FieldMismatch", "TooFewFields", "Too few fields: expected " + _.length + " fields but parsed " + A, f + I)), j;
|
|
246
246
|
}
|
|
247
247
|
var O;
|
|
248
248
|
h && (e.header || e.dynamicTyping || e.transform) && (O = 1, !h.data.length || Array.isArray(h.data[0]) ? (h.data = h.data.map(x), O = h.data.length) : h.data = x(h.data, 0), e.header && h.meta && (h.meta.fields = _), f += O);
|
|
@@ -254,35 +254,35 @@ function Pt() {
|
|
|
254
254
|
b = { type: b, code: x, message: O }, w !== void 0 && (b.row = w), h.errors.push(b);
|
|
255
255
|
}
|
|
256
256
|
R(e.step) && (m = e.step, e.step = function(b) {
|
|
257
|
-
h = b, z() ? C() : (C(), h.data.length !== 0 && (c += b.data.length, e.preview && c > e.preview ?
|
|
257
|
+
h = b, z() ? C() : (C(), h.data.length !== 0 && (c += b.data.length, e.preview && c > e.preview ? i.abort() : (h.data = h.data[0], m(h, o))));
|
|
258
258
|
}), this.parse = function(b, x, O) {
|
|
259
|
-
var w = e.quoteChar || '"', w = (e.newline || (e.newline = this.guessLineEndings(b, w)), u = !1, e.delimiter ? R(e.delimiter) && (e.delimiter = e.delimiter(b), h.meta.delimiter = e.delimiter) : ((w = ((
|
|
259
|
+
var w = e.quoteChar || '"', w = (e.newline || (e.newline = this.guessLineEndings(b, w)), u = !1, e.delimiter ? R(e.delimiter) && (e.delimiter = e.delimiter(b), h.meta.delimiter = e.delimiter) : ((w = ((I, j, A, L, $) => {
|
|
260
260
|
var nt, E, U, lt;
|
|
261
261
|
$ = $ || [",", " ", "|", ";", p.RECORD_SEP, p.UNIT_SEP];
|
|
262
|
-
for (var
|
|
263
|
-
for (var it, _t = $[
|
|
262
|
+
for (var gt = 0; gt < $.length; gt++) {
|
|
263
|
+
for (var it, _t = $[gt], V = 0, st = 0, K = 0, H = (U = void 0, new pt({ comments: L, delimiter: _t, newline: j, preview: 10 }).parse(I)), ct = 0; ct < H.data.length; ct++) A && M(H.data[ct]) ? K++ : (it = H.data[ct].length, st += it, U === void 0 ? U = it : 0 < it && (V += Math.abs(it - U), U = it));
|
|
264
264
|
0 < H.data.length && (st /= H.data.length - K), (E === void 0 || V <= E) && (lt === void 0 || lt < st) && 1.99 < st && (E = V, nt = _t, lt = st);
|
|
265
265
|
}
|
|
266
266
|
return { successful: !!(e.delimiter = nt), bestDelimiter: nt };
|
|
267
267
|
})(b, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter = w.bestDelimiter : (u = !0, e.delimiter = p.DefaultDelimiter), h.meta.delimiter = e.delimiter), ut(e));
|
|
268
|
-
return e.preview && e.header && w.preview++, r = b,
|
|
268
|
+
return e.preview && e.header && w.preview++, r = b, i = new pt(w), h = i.parse(r, x, O), C(), v ? { meta: { paused: !0 } } : h || { meta: { paused: !1 } };
|
|
269
269
|
}, this.paused = function() {
|
|
270
270
|
return v;
|
|
271
271
|
}, this.pause = function() {
|
|
272
|
-
v = !0,
|
|
272
|
+
v = !0, i.abort(), r = R(e.chunk) ? "" : r.substring(i.getCharIndex());
|
|
273
273
|
}, this.resume = function() {
|
|
274
|
-
|
|
274
|
+
o.streamer._halted ? (v = !1, o.streamer.parseChunk(r, !0)) : setTimeout(o.resume, 3);
|
|
275
275
|
}, this.aborted = function() {
|
|
276
276
|
return g;
|
|
277
277
|
}, this.abort = function() {
|
|
278
|
-
g = !0,
|
|
279
|
-
}, this.guessLineEndings = function(
|
|
280
|
-
|
|
281
|
-
var w = new RegExp(ot(w) + "([^]*?)" + ot(w), "gm"), O = (
|
|
282
|
-
`),
|
|
283
|
-
if (O.length === 1 ||
|
|
278
|
+
g = !0, i.abort(), h.meta.aborted = !0, R(e.complete) && e.complete(h), r = "";
|
|
279
|
+
}, this.guessLineEndings = function(I, w) {
|
|
280
|
+
I = I.substring(0, 1048576);
|
|
281
|
+
var w = new RegExp(ot(w) + "([^]*?)" + ot(w), "gm"), O = (I = I.replace(w, "")).split("\r"), w = I.split(`
|
|
282
|
+
`), I = 1 < w.length && w[0].length < O[0].length;
|
|
283
|
+
if (O.length === 1 || I) return `
|
|
284
284
|
`;
|
|
285
|
-
for (var j = 0,
|
|
285
|
+
for (var j = 0, A = 0; A < O.length; A++) O[A][0] === `
|
|
286
286
|
` && j++;
|
|
287
287
|
return j >= O.length / 2 ? `\r
|
|
288
288
|
` : "\r";
|
|
@@ -291,44 +291,44 @@ function Pt() {
|
|
|
291
291
|
function ot(e) {
|
|
292
292
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
var r = (e = e || {}).delimiter,
|
|
294
|
+
function pt(e) {
|
|
295
|
+
var r = (e = e || {}).delimiter, i = e.newline, u = e.comments, m = e.step, S = e.preview, y = e.fastMode, l = null, d = !1, o = e.quoteChar == null ? '"' : e.quoteChar, c = o;
|
|
296
296
|
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");
|
|
297
|
-
u === !0 ? u = "#" : (typeof u != "string" || -1 < p.BAD_DELIMITERS.indexOf(u)) && (u = !1),
|
|
298
|
-
` &&
|
|
299
|
-
` && (
|
|
297
|
+
u === !0 ? u = "#" : (typeof u != "string" || -1 < p.BAD_DELIMITERS.indexOf(u)) && (u = !1), i !== `
|
|
298
|
+
` && i !== "\r" && i !== `\r
|
|
299
|
+
` && (i = `
|
|
300
300
|
`);
|
|
301
301
|
var f = 0, v = !1;
|
|
302
302
|
this.parse = function(g, _, h) {
|
|
303
303
|
if (typeof g != "string") throw new Error("Input must be a string");
|
|
304
|
-
var M = g.length, C = r.length, z =
|
|
304
|
+
var M = g.length, C = r.length, z = i.length, W = u.length, b = R(m), x = [], O = [], w = [], I = f = 0;
|
|
305
305
|
if (!g) return V();
|
|
306
|
-
if (y || y !== !1 && g.indexOf(
|
|
307
|
-
for (var j = g.split(
|
|
308
|
-
if (w = j[
|
|
306
|
+
if (y || y !== !1 && g.indexOf(o) === -1) {
|
|
307
|
+
for (var j = g.split(i), A = 0; A < j.length; A++) {
|
|
308
|
+
if (w = j[A], f += w.length, A !== j.length - 1) f += i.length;
|
|
309
309
|
else if (h) return V();
|
|
310
310
|
if (!u || w.substring(0, W) !== u) {
|
|
311
311
|
if (b) {
|
|
312
312
|
if (x = [], lt(w.split(r)), st(), v) return V();
|
|
313
313
|
} else lt(w.split(r));
|
|
314
|
-
if (S && S <=
|
|
314
|
+
if (S && S <= A) return x = x.slice(0, S), V(!0);
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
return V();
|
|
318
318
|
}
|
|
319
|
-
for (var L = g.indexOf(r, f), $ = g.indexOf(
|
|
320
|
-
if ((E = g.indexOf(
|
|
321
|
-
if (E === M - 1) return it(g.substring(f, E).replace(nt,
|
|
322
|
-
if (
|
|
323
|
-
else if (
|
|
319
|
+
for (var L = g.indexOf(r, f), $ = g.indexOf(i, f), nt = new RegExp(ot(c) + ot(o), "g"), E = g.indexOf(o, f); ; ) if (g[f] === o) for (E = f, f++; ; ) {
|
|
320
|
+
if ((E = g.indexOf(o, E + 1)) === -1) return h || O.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: x.length, index: f }), it();
|
|
321
|
+
if (E === M - 1) return it(g.substring(f, E).replace(nt, o));
|
|
322
|
+
if (o === c && g[E + 1] === c) E++;
|
|
323
|
+
else if (o === c || E === 0 || g[E - 1] !== c) {
|
|
324
324
|
L !== -1 && L < E + 1 && (L = g.indexOf(r, E + 1));
|
|
325
|
-
var U =
|
|
325
|
+
var U = gt(($ = $ !== -1 && $ < E + 1 ? g.indexOf(i, E + 1) : $) === -1 ? L : Math.min(L, $));
|
|
326
326
|
if (g.substr(E + 1 + U, C) === r) {
|
|
327
|
-
w.push(g.substring(f, E).replace(nt,
|
|
327
|
+
w.push(g.substring(f, E).replace(nt, o)), g[f = E + 1 + U + C] !== o && (E = g.indexOf(o, f)), L = g.indexOf(r, f), $ = g.indexOf(i, f);
|
|
328
328
|
break;
|
|
329
329
|
}
|
|
330
|
-
if (U =
|
|
331
|
-
if (w.push(g.substring(f, E).replace(nt,
|
|
330
|
+
if (U = gt($), g.substring(E + 1 + U, E + 1 + U + z) === i) {
|
|
331
|
+
if (w.push(g.substring(f, E).replace(nt, o)), _t(E + 1 + U + z), L = g.indexOf(r, f), E = g.indexOf(o, f), b && (st(), v)) return V();
|
|
332
332
|
if (S && x.length >= S) return V(!0);
|
|
333
333
|
break;
|
|
334
334
|
}
|
|
@@ -337,7 +337,7 @@ function Pt() {
|
|
|
337
337
|
}
|
|
338
338
|
else if (u && w.length === 0 && g.substring(f, f + W) === u) {
|
|
339
339
|
if ($ === -1) return V();
|
|
340
|
-
f = $ + z, $ = g.indexOf(
|
|
340
|
+
f = $ + z, $ = g.indexOf(i, f), L = g.indexOf(r, f);
|
|
341
341
|
} else if (L !== -1 && (L < $ || $ === -1)) w.push(g.substring(f, L)), f = L + C, L = g.indexOf(r, f);
|
|
342
342
|
else {
|
|
343
343
|
if ($ === -1) break;
|
|
@@ -346,9 +346,9 @@ function Pt() {
|
|
|
346
346
|
}
|
|
347
347
|
return it();
|
|
348
348
|
function lt(K) {
|
|
349
|
-
x.push(K),
|
|
349
|
+
x.push(K), I = f;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function gt(K) {
|
|
352
352
|
var H = 0;
|
|
353
353
|
return H = K !== -1 && (K = g.substring(E + 1, K)) && K.trim() === "" ? K.length : H;
|
|
354
354
|
}
|
|
@@ -356,24 +356,24 @@ function Pt() {
|
|
|
356
356
|
return h || (K === void 0 && (K = g.substring(f)), w.push(K), f = M, lt(w), b && st()), V();
|
|
357
357
|
}
|
|
358
358
|
function _t(K) {
|
|
359
|
-
f = K, lt(w), w = [], $ = g.indexOf(
|
|
359
|
+
f = K, lt(w), w = [], $ = g.indexOf(i, f);
|
|
360
360
|
}
|
|
361
361
|
function V(K) {
|
|
362
362
|
if (e.header && !_ && x.length && !d) {
|
|
363
363
|
var H = x[0], ct = /* @__PURE__ */ Object.create(null), $t = new Set(H);
|
|
364
364
|
let Ct = !1;
|
|
365
|
-
for (let
|
|
366
|
-
let at = H[
|
|
367
|
-
if (ct[at = R(e.transformHeader) ? e.transformHeader(at,
|
|
365
|
+
for (let mt = 0; mt < H.length; mt++) {
|
|
366
|
+
let at = H[mt];
|
|
367
|
+
if (ct[at = R(e.transformHeader) ? e.transformHeader(at, mt) : at]) {
|
|
368
368
|
let wt, Rt = ct[at];
|
|
369
369
|
for (; wt = at + "_" + Rt, Rt++, $t.has(wt); ) ;
|
|
370
|
-
$t.add(wt), H[
|
|
371
|
-
} else ct[at] = 1, H[
|
|
370
|
+
$t.add(wt), H[mt] = wt, ct[at]++, Ct = !0, (l = l === null ? {} : l)[wt] = at;
|
|
371
|
+
} else ct[at] = 1, H[mt] = at;
|
|
372
372
|
$t.add(at);
|
|
373
373
|
}
|
|
374
374
|
Ct && console.warn("Duplicate headers found and renamed."), d = !0;
|
|
375
375
|
}
|
|
376
|
-
return { data: x, errors: O, meta: { delimiter: r, linebreak:
|
|
376
|
+
return { data: x, errors: O, meta: { delimiter: r, linebreak: i, aborted: v, truncated: !!K, cursor: I + (_ || 0), renamedHeaders: l } };
|
|
377
377
|
}
|
|
378
378
|
function st() {
|
|
379
379
|
m(V()), x = [], O = [];
|
|
@@ -385,31 +385,31 @@ function Pt() {
|
|
|
385
385
|
};
|
|
386
386
|
}
|
|
387
387
|
function vt(e) {
|
|
388
|
-
var r = e.data,
|
|
389
|
-
if (r.error)
|
|
388
|
+
var r = e.data, i = Y[r.workerId], u = !1;
|
|
389
|
+
if (r.error) i.userError(r.error, r.file);
|
|
390
390
|
else if (r.results && r.results.data) {
|
|
391
391
|
var m = { abort: function() {
|
|
392
392
|
u = !0, dt(r.workerId, { data: [], errors: [], meta: { aborted: !0 } });
|
|
393
393
|
}, pause: bt, resume: bt };
|
|
394
|
-
if (R(
|
|
395
|
-
for (var S = 0; S < r.results.data.length && (
|
|
394
|
+
if (R(i.userStep)) {
|
|
395
|
+
for (var S = 0; S < r.results.data.length && (i.userStep({ data: r.results.data[S], errors: r.results.errors, meta: r.results.meta }, m), !u); S++) ;
|
|
396
396
|
delete r.results;
|
|
397
|
-
} else R(
|
|
397
|
+
} else R(i.userChunk) && (i.userChunk(r.results, m, r.file), delete r.results);
|
|
398
398
|
}
|
|
399
399
|
r.finished && !u && dt(r.workerId, r.results);
|
|
400
400
|
}
|
|
401
401
|
function dt(e, r) {
|
|
402
|
-
var
|
|
403
|
-
R(
|
|
402
|
+
var i = Y[e];
|
|
403
|
+
R(i.userComplete) && i.userComplete(r), i.terminate(), delete Y[e];
|
|
404
404
|
}
|
|
405
405
|
function bt() {
|
|
406
406
|
throw new Error("Not implemented.");
|
|
407
407
|
}
|
|
408
408
|
function ut(e) {
|
|
409
409
|
if (typeof e != "object" || e === null) return e;
|
|
410
|
-
var r,
|
|
411
|
-
for (r in e)
|
|
412
|
-
return
|
|
410
|
+
var r, i = Array.isArray(e) ? [] : {};
|
|
411
|
+
for (r in e) i[r] = ut(e[r]);
|
|
412
|
+
return i;
|
|
413
413
|
}
|
|
414
414
|
function Q(e, r) {
|
|
415
415
|
return function() {
|
|
@@ -420,32 +420,32 @@ function Pt() {
|
|
|
420
420
|
return typeof e == "function";
|
|
421
421
|
}
|
|
422
422
|
return p.parse = function(e, r) {
|
|
423
|
-
var
|
|
424
|
-
if (R(
|
|
425
|
-
(
|
|
423
|
+
var i = (r = r || {}).dynamicTyping || !1;
|
|
424
|
+
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 ? F : B)(r)) : e.readable === !0 && R(e.read) && R(e.on) ? i = new Z(r) : (a.File && e instanceof File || e instanceof Object) && (i = new J(r)), i.stream(e);
|
|
425
|
+
(i = (() => {
|
|
426
426
|
var u;
|
|
427
427
|
return !!p.WORKERS_SUPPORTED && (u = (() => {
|
|
428
|
-
var m =
|
|
428
|
+
var m = a.URL || a.webkitURL || null, S = n.toString();
|
|
429
429
|
return p.BLOB_URL || (p.BLOB_URL = m.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" })));
|
|
430
|
-
})(), (u = new
|
|
431
|
-
})()).userStep = r.step,
|
|
430
|
+
})(), (u = new a.Worker(u)).onmessage = vt, u.id = q++, Y[u.id] = u);
|
|
431
|
+
})()).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 });
|
|
432
432
|
}, p.unparse = function(e, r) {
|
|
433
|
-
var
|
|
434
|
-
`, y = '"', l = y + y, d = !1,
|
|
433
|
+
var i = !1, u = !0, m = ",", S = `\r
|
|
434
|
+
`, y = '"', l = y + y, d = !1, o = null, c = !1, f = ((() => {
|
|
435
435
|
if (typeof r == "object") {
|
|
436
436
|
if (typeof r.delimiter != "string" || p.BAD_DELIMITERS.filter(function(_) {
|
|
437
437
|
return r.delimiter.indexOf(_) !== -1;
|
|
438
|
-
}).length || (m = r.delimiter), typeof r.quotes != "boolean" && typeof r.quotes != "function" && !Array.isArray(r.quotes) || (
|
|
438
|
+
}).length || (m = 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" && (S = r.newline), typeof r.quoteChar == "string" && (y = r.quoteChar), typeof r.header == "boolean" && (u = r.header), Array.isArray(r.columns)) {
|
|
439
439
|
if (r.columns.length === 0) throw new Error("Option columns is empty");
|
|
440
|
-
|
|
440
|
+
o = r.columns;
|
|
441
441
|
}
|
|
442
442
|
r.escapeChar !== void 0 && (l = r.escapeChar + y), r.escapeFormulae instanceof RegExp ? c = r.escapeFormulae : typeof r.escapeFormulae == "boolean" && r.escapeFormulae && (c = /^[=+\-@\t\r].*$/);
|
|
443
443
|
}
|
|
444
444
|
})(), new RegExp(ot(y), "g"));
|
|
445
445
|
if (typeof e == "string" && (e = JSON.parse(e)), Array.isArray(e)) {
|
|
446
446
|
if (!e.length || Array.isArray(e[0])) return v(null, e, d);
|
|
447
|
-
if (typeof e[0] == "object") return v(
|
|
448
|
-
} 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 ||
|
|
447
|
+
if (typeof e[0] == "object") return v(o || Object.keys(e[0]), e, d);
|
|
448
|
+
} 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])), v(e.fields || [], e.data || [], d);
|
|
449
449
|
throw new Error("Unable to serialize unrecognized input");
|
|
450
450
|
function v(_, h, M) {
|
|
451
451
|
var C = "", z = (typeof _ == "string" && (_ = JSON.parse(_)), typeof h == "string" && (h = JSON.parse(h)), Array.isArray(_) && 0 < _.length), W = !Array.isArray(h[0]);
|
|
@@ -454,62 +454,62 @@ function Pt() {
|
|
|
454
454
|
0 < h.length && (C += S);
|
|
455
455
|
}
|
|
456
456
|
for (var x = 0; x < h.length; x++) {
|
|
457
|
-
var O = (z ? _ : h[x]).length, w = !1,
|
|
457
|
+
var O = (z ? _ : h[x]).length, w = !1, I = z ? Object.keys(h[x]).length === 0 : h[x].length === 0;
|
|
458
458
|
if (M && !z && (w = M === "greedy" ? h[x].join("").trim() === "" : h[x].length === 1 && h[x][0].length === 0), M === "greedy" && z) {
|
|
459
|
-
for (var j = [],
|
|
460
|
-
var L = W ? _[
|
|
459
|
+
for (var j = [], A = 0; A < O; A++) {
|
|
460
|
+
var L = W ? _[A] : A;
|
|
461
461
|
j.push(h[x][L]);
|
|
462
462
|
}
|
|
463
463
|
w = j.join("").trim() === "";
|
|
464
464
|
}
|
|
465
465
|
if (!w) {
|
|
466
466
|
for (var $ = 0; $ < O; $++) {
|
|
467
|
-
0 < $ && !
|
|
467
|
+
0 < $ && !I && (C += m);
|
|
468
468
|
var nt = z && W ? _[$] : $;
|
|
469
469
|
C += g(h[x][nt], $);
|
|
470
470
|
}
|
|
471
|
-
x < h.length - 1 && (!M || 0 < O && !
|
|
471
|
+
x < h.length - 1 && (!M || 0 < O && !I) && (C += S);
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
return C;
|
|
475
475
|
}
|
|
476
476
|
function g(_, h) {
|
|
477
477
|
var M, C;
|
|
478
|
-
return _ == null ? "" : _.constructor === Date ? JSON.stringify(_).slice(1, 25) : (C = !1, c && typeof _ == "string" && c.test(_) && (_ = "'" + _, C = !0), M = _.toString().replace(f, l), (C = C ||
|
|
478
|
+
return _ == null ? "" : _.constructor === Date ? JSON.stringify(_).slice(1, 25) : (C = !1, c && typeof _ == "string" && c.test(_) && (_ = "'" + _, C = !0), M = _.toString().replace(f, l), (C = C || i === !0 || typeof i == "function" && i(_, h) || Array.isArray(i) && i[h] || ((z, W) => {
|
|
479
479
|
for (var b = 0; b < W.length; b++) if (-1 < z.indexOf(W[b])) return !0;
|
|
480
480
|
return !1;
|
|
481
481
|
})(M, p.BAD_DELIMITERS) || -1 < M.indexOf(m) || M.charAt(0) === " " || M.charAt(M.length - 1) === " ") ? y + M + y : M);
|
|
482
482
|
}
|
|
483
483
|
}, p.RECORD_SEP = "", p.UNIT_SEP = "", p.BYTE_ORDER_MARK = "\uFEFF", p.BAD_DELIMITERS = ["\r", `
|
|
484
|
-
`, '"', p.BYTE_ORDER_MARK], p.WORKERS_SUPPORTED = !D && !!
|
|
485
|
-
var r = e.config || {},
|
|
484
|
+
`, '"', p.BYTE_ORDER_MARK], p.WORKERS_SUPPORTED = !D && !!a.Worker, p.NODE_STREAM_INPUT = 1, p.LocalChunkSize = 10485760, p.RemoteChunkSize = 5242880, p.DefaultDelimiter = ",", p.Parser = pt, p.ParserHandle = tt, p.NetworkStreamer = F, p.FileStreamer = J, p.StringStreamer = B, p.ReadableStreamStreamer = Z, a.jQuery && ((k = a.jQuery).fn.parse = function(e) {
|
|
485
|
+
var r = e.config || {}, i = [];
|
|
486
486
|
return this.each(function(S) {
|
|
487
|
-
if (!(k(this).prop("tagName").toUpperCase() === "INPUT" && k(this).attr("type").toLowerCase() === "file" &&
|
|
488
|
-
for (var y = 0; y < this.files.length; y++)
|
|
487
|
+
if (!(k(this).prop("tagName").toUpperCase() === "INPUT" && k(this).attr("type").toLowerCase() === "file" && a.FileReader) || !this.files || this.files.length === 0) return !0;
|
|
488
|
+
for (var y = 0; y < this.files.length; y++) i.push({ file: this.files[y], inputElem: this, instanceConfig: k.extend({}, r) });
|
|
489
489
|
}), u(), this;
|
|
490
490
|
function u() {
|
|
491
|
-
if (
|
|
491
|
+
if (i.length === 0) R(e.complete) && e.complete();
|
|
492
492
|
else {
|
|
493
|
-
var S, y, l, d,
|
|
493
|
+
var S, y, l, d, o = i[0];
|
|
494
494
|
if (R(e.before)) {
|
|
495
|
-
var c = e.before(
|
|
495
|
+
var c = e.before(o.file, o.inputElem);
|
|
496
496
|
if (typeof c == "object") {
|
|
497
|
-
if (c.action === "abort") return S = "AbortError", y =
|
|
497
|
+
if (c.action === "abort") return S = "AbortError", y = o.file, l = o.inputElem, d = c.reason, void (R(e.error) && e.error({ name: S }, y, l, d));
|
|
498
498
|
if (c.action === "skip") return void m();
|
|
499
|
-
typeof c.config == "object" && (
|
|
499
|
+
typeof c.config == "object" && (o.instanceConfig = k.extend(o.instanceConfig, c.config));
|
|
500
500
|
} else if (c === "skip") return void m();
|
|
501
501
|
}
|
|
502
|
-
var f =
|
|
503
|
-
|
|
504
|
-
R(f) && f(v,
|
|
505
|
-
}, p.parse(
|
|
502
|
+
var f = o.instanceConfig.complete;
|
|
503
|
+
o.instanceConfig.complete = function(v) {
|
|
504
|
+
R(f) && f(v, o.file, o.inputElem), m();
|
|
505
|
+
}, p.parse(o.file, o.instanceConfig);
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
function m() {
|
|
509
|
-
|
|
509
|
+
i.splice(0, 1), u();
|
|
510
510
|
}
|
|
511
|
-
}),
|
|
512
|
-
e = e.data, p.WORKER_ID === void 0 && e && (p.WORKER_ID = e.workerId), typeof e.input == "string" ?
|
|
511
|
+
}), T && (a.onmessage = function(e) {
|
|
512
|
+
e = e.data, p.WORKER_ID === void 0 && e && (p.WORKER_ID = e.workerId), typeof e.input == "string" ? a.postMessage({ workerId: p.WORKER_ID, results: p.parse(e.input, e.config), finished: !0 }) : (a.File && e.input instanceof File || e.input instanceof Object) && (e = p.parse(e.input, e.config)) && a.postMessage({ workerId: p.WORKER_ID, results: e, finished: !0 });
|
|
513
513
|
}), (F.prototype = Object.create(P.prototype)).constructor = F, (J.prototype = Object.create(P.prototype)).constructor = J, (B.prototype = Object.create(B.prototype)).constructor = B, (Z.prototype = Object.create(P.prototype)).constructor = Z, p;
|
|
514
514
|
});
|
|
515
515
|
})(Et)), Et.exports;
|
|
@@ -517,42 +517,42 @@ function Pt() {
|
|
|
517
517
|
var Ut = Pt();
|
|
518
518
|
const Wt = /* @__PURE__ */ Mt(Ut), { parse: Nt, unparse: Bt } = Wt;
|
|
519
519
|
class he {
|
|
520
|
-
static unparse(t,
|
|
521
|
-
return Bt(t,
|
|
520
|
+
static unparse(t, n) {
|
|
521
|
+
return Bt(t, n);
|
|
522
522
|
}
|
|
523
523
|
static parse(t) {
|
|
524
|
-
return new Promise((
|
|
524
|
+
return new Promise((n, a) => {
|
|
525
525
|
Nt(t, {
|
|
526
526
|
header: !0,
|
|
527
|
-
complete: (k) =>
|
|
528
|
-
error: (k) =>
|
|
527
|
+
complete: (k) => n(k),
|
|
528
|
+
error: (k) => a(k)
|
|
529
529
|
});
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
async function qt(s, t,
|
|
534
|
-
const
|
|
535
|
-
if ("showSaveFilePicker" in window &&
|
|
533
|
+
async function qt(s, t, n) {
|
|
534
|
+
const a = n?.mimeType ?? Jt(t), k = Kt(s, a);
|
|
535
|
+
if ("showSaveFilePicker" in window && n?.showSaveFilePicker)
|
|
536
536
|
try {
|
|
537
537
|
const q = await (await window.showSaveFilePicker({
|
|
538
538
|
suggestedName: t,
|
|
539
|
-
types: [{ description: "Datei", accept: { [
|
|
539
|
+
types: [{ description: "Datei", accept: { [a]: [`.${Ft(t)}`] } }]
|
|
540
540
|
})).createWritable();
|
|
541
541
|
await q.write(k), await q.close();
|
|
542
542
|
return;
|
|
543
543
|
} catch {
|
|
544
544
|
}
|
|
545
|
-
const D = URL.createObjectURL(k),
|
|
546
|
-
|
|
547
|
-
document.body.removeChild(
|
|
545
|
+
const D = URL.createObjectURL(k), T = document.createElement("a");
|
|
546
|
+
T.href = D, T.download = t, T.rel = "noopener", T.style.display = "none", document.body.appendChild(T), Qt(T), window.setTimeout(() => {
|
|
547
|
+
document.body.removeChild(T), URL.revokeObjectURL(D);
|
|
548
548
|
}, 0), Vt() && window.open(D, "_blank", "noopener,noreferrer");
|
|
549
549
|
}
|
|
550
550
|
function Kt(s, t) {
|
|
551
551
|
if (s instanceof Blob)
|
|
552
552
|
return s.type ? s : new Blob([s], { type: t });
|
|
553
553
|
if (s instanceof ArrayBuffer || s instanceof Uint8Array) {
|
|
554
|
-
const
|
|
555
|
-
return new Blob([
|
|
554
|
+
const n = s instanceof Uint8Array ? s : new Uint8Array(s);
|
|
555
|
+
return new Blob([n], { type: t });
|
|
556
556
|
}
|
|
557
557
|
return new Blob([s], { type: t || "text/plain;charset=utf-8" });
|
|
558
558
|
}
|
|
@@ -585,100 +585,116 @@ function Ft(s) {
|
|
|
585
585
|
}
|
|
586
586
|
function Qt(s) {
|
|
587
587
|
const t = document.createEvent("MouseEvents");
|
|
588
|
-
t.initMouseEvent(
|
|
588
|
+
t.initMouseEvent(
|
|
589
|
+
"click",
|
|
590
|
+
!0,
|
|
591
|
+
!0,
|
|
592
|
+
window,
|
|
593
|
+
0,
|
|
594
|
+
0,
|
|
595
|
+
0,
|
|
596
|
+
0,
|
|
597
|
+
0,
|
|
598
|
+
!1,
|
|
599
|
+
!1,
|
|
600
|
+
!1,
|
|
601
|
+
!1,
|
|
602
|
+
0,
|
|
603
|
+
null
|
|
604
|
+
), s.dispatchEvent(t);
|
|
589
605
|
}
|
|
590
606
|
function Vt() {
|
|
591
|
-
const s = navigator.userAgent, t = /iPad|iPhone|iPod/.test(s),
|
|
592
|
-
return t ||
|
|
607
|
+
const s = navigator.userAgent, t = /iPad|iPhone|iPod/.test(s), n = /^((?!chrome|android).)*safari/i.test(s);
|
|
608
|
+
return t || n;
|
|
593
609
|
}
|
|
594
610
|
class pe {
|
|
595
|
-
static getEnumValue(t,
|
|
596
|
-
if (
|
|
597
|
-
return t[
|
|
598
|
-
throw Error(`${
|
|
611
|
+
static getEnumValue(t, n) {
|
|
612
|
+
if (n in t)
|
|
613
|
+
return t[n];
|
|
614
|
+
throw Error(`${n} not found in ${t}`);
|
|
599
615
|
}
|
|
600
616
|
static getKeyValues(t) {
|
|
601
|
-
return Object.keys(t).filter((
|
|
602
|
-
key: Number(
|
|
603
|
-
value: t[
|
|
617
|
+
return Object.keys(t).filter((n) => !isNaN(Number(n))).map((n) => ({
|
|
618
|
+
key: Number(n),
|
|
619
|
+
value: t[n]
|
|
604
620
|
}));
|
|
605
621
|
}
|
|
606
622
|
}
|
|
607
623
|
class ge {
|
|
608
624
|
static getFileExtension(t) {
|
|
609
|
-
let
|
|
610
|
-
const
|
|
611
|
-
return
|
|
625
|
+
let n = "";
|
|
626
|
+
const a = t.lastIndexOf(".");
|
|
627
|
+
return a > 0 && a < t.length - 1 && (n = `.${t.substring(a + 1).toLowerCase()}`), n;
|
|
612
628
|
}
|
|
613
629
|
/**
|
|
614
630
|
* read content from a file or blob
|
|
615
631
|
*/
|
|
616
632
|
static readAsText(t) {
|
|
617
|
-
const
|
|
618
|
-
return new Promise((
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
},
|
|
622
|
-
const D =
|
|
623
|
-
|
|
624
|
-
},
|
|
633
|
+
const n = new FileReader();
|
|
634
|
+
return new Promise((a, k) => {
|
|
635
|
+
n.onload = () => {
|
|
636
|
+
n.onload = null, n.onerror = null, typeof n.result == "string" ? a(n.result) : k(new Error("Unexpected result type"));
|
|
637
|
+
}, n.onerror = () => {
|
|
638
|
+
const D = n.error ?? new Error("FileReader error");
|
|
639
|
+
n.onload = null, n.onerror = null, k(D);
|
|
640
|
+
}, n.readAsText(t);
|
|
625
641
|
});
|
|
626
642
|
}
|
|
627
643
|
static readAsArrayBuffer(t) {
|
|
628
|
-
const
|
|
629
|
-
return new Promise((
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
},
|
|
633
|
-
const D =
|
|
634
|
-
|
|
635
|
-
},
|
|
644
|
+
const n = new FileReader();
|
|
645
|
+
return new Promise((a, k) => {
|
|
646
|
+
n.onload = () => {
|
|
647
|
+
n.onload = null, n.onerror = null, n.result instanceof ArrayBuffer ? a(n.result) : k(new Error("Unexpected result type"));
|
|
648
|
+
}, n.onerror = () => {
|
|
649
|
+
const D = n.error ?? new Error("FileReader error");
|
|
650
|
+
n.onload = null, n.onerror = null, k(D);
|
|
651
|
+
}, n.readAsArrayBuffer(t);
|
|
636
652
|
});
|
|
637
653
|
}
|
|
638
654
|
static readAsDataUrl(t) {
|
|
639
|
-
const
|
|
640
|
-
return new Promise((
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
},
|
|
655
|
+
const n = new FileReader();
|
|
656
|
+
return new Promise((a, k) => {
|
|
657
|
+
n.onload = (D) => {
|
|
658
|
+
a(D);
|
|
659
|
+
}, n.onerror = (D) => k(D), n.readAsDataURL(t);
|
|
644
660
|
});
|
|
645
661
|
}
|
|
646
662
|
/** usage:
|
|
647
663
|
* const file = new File(['Hello'], 'test.txt');
|
|
648
664
|
* FileHelper.formatFileSize(file.size);
|
|
649
665
|
* */
|
|
650
|
-
static formatFileSize(t,
|
|
666
|
+
static formatFileSize(t, n = 2, a) {
|
|
651
667
|
if (t === 0)
|
|
652
668
|
return "0 Bytes";
|
|
653
669
|
const k = 1024, D = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
654
|
-
let
|
|
655
|
-
|
|
656
|
-
const Y = t / Math.pow(k,
|
|
657
|
-
return `${parseFloat(Y.toFixed(
|
|
670
|
+
let T = Math.floor(Math.log(t) / Math.log(k));
|
|
671
|
+
a && D.includes(a) && (T = D.indexOf(a));
|
|
672
|
+
const Y = t / Math.pow(k, T);
|
|
673
|
+
return `${parseFloat(Y.toFixed(n))} ${D[T]}`;
|
|
658
674
|
}
|
|
659
|
-
static save(t,
|
|
660
|
-
const k = new Blob([t], { type:
|
|
661
|
-
qt(k,
|
|
675
|
+
static save(t, n, a) {
|
|
676
|
+
const k = new Blob([t], { type: a });
|
|
677
|
+
qt(k, n);
|
|
662
678
|
}
|
|
663
679
|
}
|
|
664
680
|
class kt {
|
|
665
|
-
static set(t,
|
|
666
|
-
localStorage.setItem(t, JSON.stringify(
|
|
681
|
+
static set(t, n) {
|
|
682
|
+
localStorage.setItem(t, JSON.stringify(n));
|
|
667
683
|
}
|
|
668
684
|
static get(t) {
|
|
669
|
-
let
|
|
670
|
-
const
|
|
671
|
-
return
|
|
685
|
+
let n = null;
|
|
686
|
+
const a = localStorage.getItem(t);
|
|
687
|
+
return a && (n = JSON.parse(a)), n;
|
|
672
688
|
}
|
|
673
689
|
static remove(t) {
|
|
674
|
-
let
|
|
675
|
-
return
|
|
690
|
+
let n = !!kt.get(t);
|
|
691
|
+
return n && localStorage.removeItem(t), n;
|
|
676
692
|
}
|
|
677
693
|
static removeAll() {
|
|
678
694
|
localStorage.clear();
|
|
679
695
|
}
|
|
680
696
|
static getKeysBy(t) {
|
|
681
|
-
return Object.keys(localStorage).filter((
|
|
697
|
+
return Object.keys(localStorage).filter((n) => n.startsWith(t));
|
|
682
698
|
}
|
|
683
699
|
}
|
|
684
700
|
var yt = /* @__PURE__ */ ((s) => (s.log = "log", s.info = "info", s.warn = "warn", s.debug = "debug", s.error = "error", s))(yt || {});
|
|
@@ -706,48 +722,48 @@ class G {
|
|
|
706
722
|
static setEnabled(t) {
|
|
707
723
|
G.enabled = t;
|
|
708
724
|
}
|
|
709
|
-
static doLog(t,
|
|
725
|
+
static doLog(t, n) {
|
|
710
726
|
if (!G.enabled) return;
|
|
711
|
-
const
|
|
727
|
+
const a = {
|
|
712
728
|
type: t,
|
|
713
|
-
args:
|
|
729
|
+
args: n,
|
|
714
730
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
715
731
|
};
|
|
716
732
|
for (const k of G.listeners)
|
|
717
733
|
try {
|
|
718
|
-
if (k(
|
|
734
|
+
if (k(a) === !1)
|
|
719
735
|
return;
|
|
720
736
|
} catch {
|
|
721
737
|
}
|
|
722
|
-
console[t].apply(console,
|
|
738
|
+
console[t].apply(console, n);
|
|
723
739
|
}
|
|
724
|
-
static onLog(t,
|
|
725
|
-
if (
|
|
726
|
-
const
|
|
740
|
+
static onLog(t, n = !1) {
|
|
741
|
+
if (n) {
|
|
742
|
+
const a = (k) => {
|
|
727
743
|
try {
|
|
728
744
|
return t(k);
|
|
729
745
|
} finally {
|
|
730
|
-
G.listeners.delete(
|
|
746
|
+
G.listeners.delete(a);
|
|
731
747
|
}
|
|
732
748
|
};
|
|
733
|
-
return G.listeners.add(
|
|
749
|
+
return G.listeners.add(a), () => G.listeners.delete(a);
|
|
734
750
|
}
|
|
735
751
|
return G.listeners.add(t), () => G.listeners.delete(t);
|
|
736
752
|
}
|
|
737
753
|
}
|
|
738
|
-
const Zt = (s, t,
|
|
739
|
-
let
|
|
740
|
-
return typeof s == "string" && typeof t == "string" ?
|
|
741
|
-
}, te = (s, t,
|
|
742
|
-
const k =
|
|
743
|
-
return Ht(k, D,
|
|
754
|
+
const Zt = (s, t, n) => s.localeCompare(t) * (n ? 1 : -1), Gt = (s, t) => s < t ? -1 : s === t ? 0 : 1, Xt = (s, t, n) => Gt(s, t) * (n ? 1 : -1), Ht = (s, t, n) => {
|
|
755
|
+
let a = 0;
|
|
756
|
+
return typeof s == "string" && typeof t == "string" ? a = Zt(s, t, n) : a = Xt(s, t, n), a;
|
|
757
|
+
}, te = (s, t, n, a) => {
|
|
758
|
+
const k = n(s), D = n(t);
|
|
759
|
+
return Ht(k, D, a);
|
|
744
760
|
};
|
|
745
761
|
class me {
|
|
746
762
|
static get(t) {
|
|
747
763
|
return kt.get(t);
|
|
748
764
|
}
|
|
749
|
-
static set(t,
|
|
750
|
-
kt.set(t,
|
|
765
|
+
static set(t, n) {
|
|
766
|
+
kt.set(t, n);
|
|
751
767
|
}
|
|
752
768
|
static remove(t) {
|
|
753
769
|
kt.remove(t);
|
|
@@ -766,8 +782,8 @@ class N {
|
|
|
766
782
|
const t = window.innerWidth;
|
|
767
783
|
if (t !== N.lastWidth) {
|
|
768
784
|
N.lastWidth = t;
|
|
769
|
-
for (const
|
|
770
|
-
|
|
785
|
+
for (const n of N.listeners)
|
|
786
|
+
n(t);
|
|
771
787
|
}
|
|
772
788
|
}, 150);
|
|
773
789
|
};
|
|
@@ -780,52 +796,54 @@ class N {
|
|
|
780
796
|
}
|
|
781
797
|
function ye() {
|
|
782
798
|
Array.prototype.distinct = function(s) {
|
|
783
|
-
return s ? this.filter(
|
|
799
|
+
return s ? this.filter(
|
|
800
|
+
(n, a, k) => k.findIndex((D) => s(D, n)) === a
|
|
801
|
+
) : this.filter((n, a, k) => k.indexOf(n) === a);
|
|
784
802
|
}, Array.prototype.filterBy = function(s) {
|
|
785
803
|
return this.filter((t) => s(t));
|
|
786
804
|
}, Array.prototype.first = function() {
|
|
787
805
|
return this.length > 0 ? this[0] : null;
|
|
788
806
|
}, Array.prototype.groupBy = function(s) {
|
|
789
|
-
return this.reduce((t,
|
|
790
|
-
const
|
|
791
|
-
return t[
|
|
807
|
+
return this.reduce((t, n) => {
|
|
808
|
+
const a = s(n);
|
|
809
|
+
return t[a] || (t[a] = []), t[a].push(n), t;
|
|
792
810
|
}, {});
|
|
793
811
|
}, Array.prototype.orderBy = function(s, t = !0) {
|
|
794
|
-
return this?.sort((
|
|
812
|
+
return this?.sort((n, a) => te(n, a, s, t)), this;
|
|
795
813
|
}, Array.prototype.removeBy = function(s, t) {
|
|
796
|
-
return this.filter((
|
|
814
|
+
return this.filter((n) => s(n) !== t);
|
|
797
815
|
};
|
|
798
816
|
}
|
|
799
|
-
var xt = { exports: {} }, ee = xt.exports,
|
|
817
|
+
var xt = { exports: {} }, ee = xt.exports, It;
|
|
800
818
|
function re() {
|
|
801
|
-
return
|
|
802
|
-
(function(
|
|
803
|
-
s.exports =
|
|
819
|
+
return It || (It = 1, (function(s, t) {
|
|
820
|
+
(function(n, a) {
|
|
821
|
+
s.exports = a();
|
|
804
822
|
})(ee, (function() {
|
|
805
|
-
var
|
|
823
|
+
var n = 1e3, a = 6e4, k = 36e5, D = "millisecond", T = "second", Y = "minute", q = "hour", p = "day", P = "week", F = "month", J = "quarter", B = "year", Z = "date", tt = "Invalid Date", ot = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, pt = /\[([^\]]+)]|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, vt = { 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(y) {
|
|
806
824
|
var l = ["th", "st", "nd", "rd"], d = y % 100;
|
|
807
825
|
return "[" + y + (l[(d - 20) % 10] || l[d] || l[0]) + "]";
|
|
808
826
|
} }, dt = function(y, l, d) {
|
|
809
|
-
var
|
|
810
|
-
return !
|
|
827
|
+
var o = String(y);
|
|
828
|
+
return !o || o.length >= l ? y : "" + Array(l + 1 - o.length).join(d) + y;
|
|
811
829
|
}, bt = { s: dt, z: function(y) {
|
|
812
|
-
var l = -y.utcOffset(), d = Math.abs(l),
|
|
813
|
-
return (l <= 0 ? "+" : "-") + dt(
|
|
830
|
+
var l = -y.utcOffset(), d = Math.abs(l), o = Math.floor(d / 60), c = d % 60;
|
|
831
|
+
return (l <= 0 ? "+" : "-") + dt(o, 2, "0") + ":" + dt(c, 2, "0");
|
|
814
832
|
}, m: function y(l, d) {
|
|
815
833
|
if (l.date() < d.date()) return -y(d, l);
|
|
816
|
-
var
|
|
817
|
-
return +(-(
|
|
834
|
+
var o = 12 * (d.year() - l.year()) + (d.month() - l.month()), c = l.clone().add(o, F), f = d - c < 0, v = l.clone().add(o + (f ? -1 : 1), F);
|
|
835
|
+
return +(-(o + (d - c) / (f ? c - v : v - c)) || 0);
|
|
818
836
|
}, a: function(y) {
|
|
819
837
|
return y < 0 ? Math.ceil(y) || 0 : Math.floor(y);
|
|
820
838
|
}, p: function(y) {
|
|
821
|
-
return { M: F, y: B, w: P, d: p, D: Z, h: q, m: Y, s:
|
|
839
|
+
return { M: F, y: B, w: P, d: p, D: Z, h: q, m: Y, s: T, ms: D, Q: J }[y] || String(y || "").toLowerCase().replace(/s$/, "");
|
|
822
840
|
}, u: function(y) {
|
|
823
841
|
return y === void 0;
|
|
824
842
|
} }, ut = "en", Q = {};
|
|
825
843
|
Q[ut] = vt;
|
|
826
844
|
var R = "$isDayjsObject", e = function(y) {
|
|
827
845
|
return y instanceof m || !(!y || !y[R]);
|
|
828
|
-
}, r = function y(l, d,
|
|
846
|
+
}, r = function y(l, d, o) {
|
|
829
847
|
var c;
|
|
830
848
|
if (!l) return ut;
|
|
831
849
|
if (typeof l == "string") {
|
|
@@ -837,14 +855,14 @@ function re() {
|
|
|
837
855
|
var g = l.name;
|
|
838
856
|
Q[g] = l, c = g;
|
|
839
857
|
}
|
|
840
|
-
return !
|
|
841
|
-
},
|
|
858
|
+
return !o && c && (ut = c), c || !o && ut;
|
|
859
|
+
}, i = function(y, l) {
|
|
842
860
|
if (e(y)) return y.clone();
|
|
843
861
|
var d = typeof l == "object" ? l : {};
|
|
844
862
|
return d.date = y, d.args = arguments, new m(d);
|
|
845
863
|
}, u = bt;
|
|
846
864
|
u.l = r, u.i = e, u.w = function(y, l) {
|
|
847
|
-
return
|
|
865
|
+
return i(y, { locale: l.$L, utc: l.$u, x: l.$x, $offset: l.$offset });
|
|
848
866
|
};
|
|
849
867
|
var m = (function() {
|
|
850
868
|
function y(d) {
|
|
@@ -852,8 +870,8 @@ function re() {
|
|
|
852
870
|
}
|
|
853
871
|
var l = y.prototype;
|
|
854
872
|
return l.parse = function(d) {
|
|
855
|
-
this.$d = (function(
|
|
856
|
-
var c =
|
|
873
|
+
this.$d = (function(o) {
|
|
874
|
+
var c = o.date, f = o.utc;
|
|
857
875
|
if (c === null) return /* @__PURE__ */ new Date(NaN);
|
|
858
876
|
if (u.u(c)) return /* @__PURE__ */ new Date();
|
|
859
877
|
if (c instanceof Date) return new Date(c);
|
|
@@ -873,21 +891,21 @@ function re() {
|
|
|
873
891
|
return u;
|
|
874
892
|
}, l.isValid = function() {
|
|
875
893
|
return this.$d.toString() !== tt;
|
|
876
|
-
}, l.isSame = function(d,
|
|
877
|
-
var c =
|
|
878
|
-
return this.startOf(
|
|
879
|
-
}, l.isAfter = function(d,
|
|
880
|
-
return
|
|
881
|
-
}, l.isBefore = function(d,
|
|
882
|
-
return this.endOf(
|
|
883
|
-
}, l.$g = function(d,
|
|
884
|
-
return u.u(d) ? this[
|
|
894
|
+
}, l.isSame = function(d, o) {
|
|
895
|
+
var c = i(d);
|
|
896
|
+
return this.startOf(o) <= c && c <= this.endOf(o);
|
|
897
|
+
}, l.isAfter = function(d, o) {
|
|
898
|
+
return i(d) < this.startOf(o);
|
|
899
|
+
}, l.isBefore = function(d, o) {
|
|
900
|
+
return this.endOf(o) < i(d);
|
|
901
|
+
}, l.$g = function(d, o, c) {
|
|
902
|
+
return u.u(d) ? this[o] : this.set(c, d);
|
|
885
903
|
}, l.unix = function() {
|
|
886
904
|
return Math.floor(this.valueOf() / 1e3);
|
|
887
905
|
}, l.valueOf = function() {
|
|
888
906
|
return this.$d.getTime();
|
|
889
|
-
}, l.startOf = function(d,
|
|
890
|
-
var c = this, f = !!u.u(
|
|
907
|
+
}, l.startOf = function(d, o) {
|
|
908
|
+
var c = this, f = !!u.u(o) || o, v = u.p(d), g = function(x, O) {
|
|
891
909
|
var w = u.w(c.$u ? Date.UTC(c.$y, O, x) : new Date(c.$y, O, x), c);
|
|
892
910
|
return f ? w : w.endOf(p);
|
|
893
911
|
}, _ = function(x, O) {
|
|
@@ -908,57 +926,57 @@ function re() {
|
|
|
908
926
|
return _(z + "Minutes", 1);
|
|
909
927
|
case Y:
|
|
910
928
|
return _(z + "Seconds", 2);
|
|
911
|
-
case
|
|
929
|
+
case T:
|
|
912
930
|
return _(z + "Milliseconds", 3);
|
|
913
931
|
default:
|
|
914
932
|
return this.clone();
|
|
915
933
|
}
|
|
916
934
|
}, l.endOf = function(d) {
|
|
917
935
|
return this.startOf(d, !1);
|
|
918
|
-
}, l.$set = function(d,
|
|
919
|
-
var c, f = u.p(d), v = "set" + (this.$u ? "UTC" : ""), g = (c = {}, c[p] = v + "Date", c[Z] = v + "Date", c[F] = v + "Month", c[B] = v + "FullYear", c[q] = v + "Hours", c[Y] = v + "Minutes", c[
|
|
936
|
+
}, l.$set = function(d, o) {
|
|
937
|
+
var c, f = u.p(d), v = "set" + (this.$u ? "UTC" : ""), g = (c = {}, c[p] = v + "Date", c[Z] = v + "Date", c[F] = v + "Month", c[B] = v + "FullYear", c[q] = v + "Hours", c[Y] = v + "Minutes", c[T] = v + "Seconds", c[D] = v + "Milliseconds", c)[f], _ = f === p ? this.$D + (o - this.$W) : o;
|
|
920
938
|
if (f === F || f === B) {
|
|
921
939
|
var h = this.clone().set(Z, 1);
|
|
922
940
|
h.$d[g](_), h.init(), this.$d = h.set(Z, Math.min(this.$D, h.daysInMonth())).$d;
|
|
923
941
|
} else g && this.$d[g](_);
|
|
924
942
|
return this.init(), this;
|
|
925
|
-
}, l.set = function(d,
|
|
926
|
-
return this.clone().$set(d,
|
|
943
|
+
}, l.set = function(d, o) {
|
|
944
|
+
return this.clone().$set(d, o);
|
|
927
945
|
}, l.get = function(d) {
|
|
928
946
|
return this[u.p(d)]();
|
|
929
|
-
}, l.add = function(d,
|
|
947
|
+
}, l.add = function(d, o) {
|
|
930
948
|
var c, f = this;
|
|
931
949
|
d = Number(d);
|
|
932
|
-
var v = u.p(
|
|
933
|
-
var C =
|
|
950
|
+
var v = u.p(o), g = function(M) {
|
|
951
|
+
var C = i(f);
|
|
934
952
|
return u.w(C.date(C.date() + Math.round(M * d)), f);
|
|
935
953
|
};
|
|
936
954
|
if (v === F) return this.set(F, this.$M + d);
|
|
937
955
|
if (v === B) return this.set(B, this.$y + d);
|
|
938
956
|
if (v === p) return g(1);
|
|
939
957
|
if (v === P) return g(7);
|
|
940
|
-
var _ = (c = {}, c[Y] =
|
|
958
|
+
var _ = (c = {}, c[Y] = a, c[q] = k, c[T] = n, c)[v] || 1, h = this.$d.getTime() + d * _;
|
|
941
959
|
return u.w(h, this);
|
|
942
|
-
}, l.subtract = function(d,
|
|
943
|
-
return this.add(-1 * d,
|
|
960
|
+
}, l.subtract = function(d, o) {
|
|
961
|
+
return this.add(-1 * d, o);
|
|
944
962
|
}, l.format = function(d) {
|
|
945
|
-
var
|
|
963
|
+
var o = this, c = this.$locale();
|
|
946
964
|
if (!this.isValid()) return c.invalidDate || tt;
|
|
947
|
-
var f = d || "YYYY-MM-DDTHH:mm:ssZ", v = u.z(this), g = this.$H, _ = this.$m, h = this.$M, M = c.weekdays, C = c.months, z = c.meridiem, W = function(O, w,
|
|
948
|
-
return O && (O[w] || O(
|
|
965
|
+
var f = d || "YYYY-MM-DDTHH:mm:ssZ", v = u.z(this), g = this.$H, _ = this.$m, h = this.$M, M = c.weekdays, C = c.months, z = c.meridiem, W = function(O, w, I, j) {
|
|
966
|
+
return O && (O[w] || O(o, f)) || I[w].slice(0, j);
|
|
949
967
|
}, b = function(O) {
|
|
950
968
|
return u.s(g % 12 || 12, O, "0");
|
|
951
|
-
}, x = z || function(O, w,
|
|
969
|
+
}, x = z || function(O, w, I) {
|
|
952
970
|
var j = O < 12 ? "AM" : "PM";
|
|
953
|
-
return
|
|
971
|
+
return I ? j.toLowerCase() : j;
|
|
954
972
|
};
|
|
955
|
-
return f.replace(
|
|
956
|
-
return w || (function(
|
|
957
|
-
switch (
|
|
973
|
+
return f.replace(pt, (function(O, w) {
|
|
974
|
+
return w || (function(I) {
|
|
975
|
+
switch (I) {
|
|
958
976
|
case "YY":
|
|
959
|
-
return String(
|
|
977
|
+
return String(o.$y).slice(-2);
|
|
960
978
|
case "YYYY":
|
|
961
|
-
return u.s(
|
|
979
|
+
return u.s(o.$y, 4, "0");
|
|
962
980
|
case "M":
|
|
963
981
|
return h + 1;
|
|
964
982
|
case "MM":
|
|
@@ -968,17 +986,17 @@ function re() {
|
|
|
968
986
|
case "MMMM":
|
|
969
987
|
return W(C, h);
|
|
970
988
|
case "D":
|
|
971
|
-
return
|
|
989
|
+
return o.$D;
|
|
972
990
|
case "DD":
|
|
973
|
-
return u.s(
|
|
991
|
+
return u.s(o.$D, 2, "0");
|
|
974
992
|
case "d":
|
|
975
|
-
return String(
|
|
993
|
+
return String(o.$W);
|
|
976
994
|
case "dd":
|
|
977
|
-
return W(c.weekdaysMin,
|
|
995
|
+
return W(c.weekdaysMin, o.$W, M, 2);
|
|
978
996
|
case "ddd":
|
|
979
|
-
return W(c.weekdaysShort,
|
|
997
|
+
return W(c.weekdaysShort, o.$W, M, 3);
|
|
980
998
|
case "dddd":
|
|
981
|
-
return M[
|
|
999
|
+
return M[o.$W];
|
|
982
1000
|
case "H":
|
|
983
1001
|
return String(g);
|
|
984
1002
|
case "HH":
|
|
@@ -996,11 +1014,11 @@ function re() {
|
|
|
996
1014
|
case "mm":
|
|
997
1015
|
return u.s(_, 2, "0");
|
|
998
1016
|
case "s":
|
|
999
|
-
return String(
|
|
1017
|
+
return String(o.$s);
|
|
1000
1018
|
case "ss":
|
|
1001
|
-
return u.s(
|
|
1019
|
+
return u.s(o.$s, 2, "0");
|
|
1002
1020
|
case "SSS":
|
|
1003
|
-
return u.s(
|
|
1021
|
+
return u.s(o.$ms, 3, "0");
|
|
1004
1022
|
case "Z":
|
|
1005
1023
|
return v;
|
|
1006
1024
|
}
|
|
@@ -1009,8 +1027,8 @@ function re() {
|
|
|
1009
1027
|
}));
|
|
1010
1028
|
}, l.utcOffset = function() {
|
|
1011
1029
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1012
|
-
}, l.diff = function(d,
|
|
1013
|
-
var f, v = this, g = u.p(
|
|
1030
|
+
}, l.diff = function(d, o, c) {
|
|
1031
|
+
var f, v = this, g = u.p(o), _ = i(d), h = (_.utcOffset() - this.utcOffset()) * a, M = this - _, C = function() {
|
|
1014
1032
|
return u.m(v, _);
|
|
1015
1033
|
};
|
|
1016
1034
|
switch (g) {
|
|
@@ -1033,10 +1051,10 @@ function re() {
|
|
|
1033
1051
|
f = M / k;
|
|
1034
1052
|
break;
|
|
1035
1053
|
case Y:
|
|
1036
|
-
f = M /
|
|
1054
|
+
f = M / a;
|
|
1037
1055
|
break;
|
|
1038
|
-
case
|
|
1039
|
-
f = M /
|
|
1056
|
+
case T:
|
|
1057
|
+
f = M / n;
|
|
1040
1058
|
break;
|
|
1041
1059
|
default:
|
|
1042
1060
|
f = M;
|
|
@@ -1046,9 +1064,9 @@ function re() {
|
|
|
1046
1064
|
return this.endOf(F).$D;
|
|
1047
1065
|
}, l.$locale = function() {
|
|
1048
1066
|
return Q[this.$L];
|
|
1049
|
-
}, l.locale = function(d,
|
|
1067
|
+
}, l.locale = function(d, o) {
|
|
1050
1068
|
if (!d) return this.$L;
|
|
1051
|
-
var c = this.clone(), f = r(d,
|
|
1069
|
+
var c = this.clone(), f = r(d, o, !0);
|
|
1052
1070
|
return f && (c.$L = f), c;
|
|
1053
1071
|
}, l.clone = function() {
|
|
1054
1072
|
return u.w(this.$d, this);
|
|
@@ -1062,36 +1080,36 @@ function re() {
|
|
|
1062
1080
|
return this.$d.toUTCString();
|
|
1063
1081
|
}, y;
|
|
1064
1082
|
})(), S = m.prototype;
|
|
1065
|
-
return
|
|
1083
|
+
return i.prototype = S, [["$ms", D], ["$s", T], ["$m", Y], ["$H", q], ["$W", p], ["$M", F], ["$y", B], ["$D", Z]].forEach((function(y) {
|
|
1066
1084
|
S[y[1]] = function(l) {
|
|
1067
1085
|
return this.$g(l, y[0], y[1]);
|
|
1068
1086
|
};
|
|
1069
|
-
})),
|
|
1070
|
-
return y.$i || (y(l, m,
|
|
1071
|
-
},
|
|
1072
|
-
return
|
|
1073
|
-
},
|
|
1087
|
+
})), i.extend = function(y, l) {
|
|
1088
|
+
return y.$i || (y(l, m, i), y.$i = !0), i;
|
|
1089
|
+
}, i.locale = r, i.isDayjs = e, i.unix = function(y) {
|
|
1090
|
+
return i(1e3 * y);
|
|
1091
|
+
}, i.en = Q[ut], i.Ls = Q, i.p = {}, i;
|
|
1074
1092
|
}));
|
|
1075
1093
|
})(xt)), xt.exports;
|
|
1076
1094
|
}
|
|
1077
1095
|
var ne = re();
|
|
1078
1096
|
const X = /* @__PURE__ */ Mt(ne);
|
|
1079
|
-
var Ot = { exports: {} }, ie = Ot.exports,
|
|
1097
|
+
var Ot = { exports: {} }, ie = Ot.exports, At;
|
|
1080
1098
|
function se() {
|
|
1081
|
-
return
|
|
1082
|
-
(function(
|
|
1083
|
-
s.exports =
|
|
1099
|
+
return At || (At = 1, (function(s, t) {
|
|
1100
|
+
(function(n, a) {
|
|
1101
|
+
s.exports = a();
|
|
1084
1102
|
})(ie, (function() {
|
|
1085
|
-
var
|
|
1086
|
-
return function(
|
|
1087
|
-
var
|
|
1088
|
-
return p.add(4 - p.isoWeekday(),
|
|
1103
|
+
var n = "day";
|
|
1104
|
+
return function(a, k, D) {
|
|
1105
|
+
var T = function(p) {
|
|
1106
|
+
return p.add(4 - p.isoWeekday(), n);
|
|
1089
1107
|
}, Y = k.prototype;
|
|
1090
1108
|
Y.isoWeekYear = function() {
|
|
1091
|
-
return
|
|
1109
|
+
return T(this).year();
|
|
1092
1110
|
}, Y.isoWeek = function(p) {
|
|
1093
|
-
if (!this.$utils().u(p)) return this.add(7 * (p - this.isoWeek()),
|
|
1094
|
-
var P, F, J, B, Z =
|
|
1111
|
+
if (!this.$utils().u(p)) return this.add(7 * (p - this.isoWeek()), n);
|
|
1112
|
+
var P, F, J, B, Z = T(this), tt = (P = this.isoWeekYear(), F = this.$u, J = (F ? D.utc : D)().year(P).startOf("year"), B = 4 - J.isoWeekday(), J.isoWeekday() > 4 && (B += 7), J.add(B, n));
|
|
1095
1113
|
return Z.diff(tt, "week") + 1;
|
|
1096
1114
|
}, Y.isoWeekday = function(p) {
|
|
1097
1115
|
return this.$utils().u(p) ? this.day() || 7 : this.day(this.day() % 7 ? p : p - 7);
|
|
@@ -1110,18 +1128,18 @@ const oe = /* @__PURE__ */ Mt(ae);
|
|
|
1110
1128
|
var Dt = { exports: {} }, ue = Dt.exports, Lt;
|
|
1111
1129
|
function ce() {
|
|
1112
1130
|
return Lt || (Lt = 1, (function(s, t) {
|
|
1113
|
-
(function(
|
|
1114
|
-
s.exports =
|
|
1131
|
+
(function(n, a) {
|
|
1132
|
+
s.exports = a();
|
|
1115
1133
|
})(ue, (function() {
|
|
1116
|
-
var
|
|
1117
|
-
return function(
|
|
1118
|
-
var
|
|
1119
|
-
D.en.formats =
|
|
1134
|
+
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" };
|
|
1135
|
+
return function(a, k, D) {
|
|
1136
|
+
var T = k.prototype, Y = T.format;
|
|
1137
|
+
D.en.formats = n, T.format = function(q) {
|
|
1120
1138
|
q === void 0 && (q = "YYYY-MM-DDTHH:mm:ssZ");
|
|
1121
1139
|
var p = this.$locale().formats, P = (function(F, J) {
|
|
1122
1140
|
return F.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(B, Z, tt) {
|
|
1123
1141
|
var ot = tt && tt.toUpperCase();
|
|
1124
|
-
return Z || J[tt] ||
|
|
1142
|
+
return Z || J[tt] || n[tt] || J[ot].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(pt, vt, dt) {
|
|
1125
1143
|
return vt || dt.slice(1);
|
|
1126
1144
|
}));
|
|
1127
1145
|
}));
|
|
@@ -1177,18 +1195,17 @@ function _e() {
|
|
|
1177
1195
|
};
|
|
1178
1196
|
}
|
|
1179
1197
|
class we {
|
|
1180
|
-
resizeListener;
|
|
1198
|
+
resizeListener = null;
|
|
1181
1199
|
onResizeCallbacks = /* @__PURE__ */ new Set();
|
|
1182
1200
|
// feuert bei jedem throttled Resize
|
|
1183
|
-
rafId = null;
|
|
1184
1201
|
emitTimeoutId = null;
|
|
1185
1202
|
// für debounce der onResizeCallbacks
|
|
1186
1203
|
duplicateThresholdMs = 60;
|
|
1187
1204
|
constructor() {
|
|
1188
|
-
typeof window < "u" && (this.resizeListener = this.onResize
|
|
1205
|
+
typeof window < "u" && (this.resizeListener = this.onResize, window.addEventListener("resize", this.resizeListener, { passive: !0 }));
|
|
1189
1206
|
}
|
|
1190
1207
|
destroy() {
|
|
1191
|
-
typeof window < "u" && window.removeEventListener("resize", this.resizeListener), this.
|
|
1208
|
+
typeof window < "u" && this.resizeListener !== null && (window.removeEventListener("resize", this.resizeListener), this.resizeListener = null), this.emitTimeoutId !== null && (clearTimeout(this.emitTimeoutId), this.emitTimeoutId = null), this.onResizeCallbacks.clear();
|
|
1192
1209
|
}
|
|
1193
1210
|
onResizeChange(t) {
|
|
1194
1211
|
this.onResizeCallbacks.add(t);
|
|
@@ -1197,13 +1214,18 @@ class we {
|
|
|
1197
1214
|
this.onResizeCallbacks.delete(t);
|
|
1198
1215
|
}
|
|
1199
1216
|
onResize = () => {
|
|
1200
|
-
typeof window > "u"
|
|
1217
|
+
if (typeof window > "u") return;
|
|
1218
|
+
const t = window.innerWidth;
|
|
1219
|
+
this.emitTimeoutId !== null && clearTimeout(this.emitTimeoutId), this.emitTimeoutId = window.setTimeout(() => {
|
|
1201
1220
|
this.emitTimeoutId = null;
|
|
1202
|
-
|
|
1221
|
+
const n = ht.getBreakpointByScreenWidth(t);
|
|
1222
|
+
for (const a of this.onResizeCallbacks)
|
|
1223
|
+
a(t, n);
|
|
1224
|
+
}, this.duplicateThresholdMs);
|
|
1203
1225
|
};
|
|
1204
1226
|
}
|
|
1205
1227
|
export {
|
|
1206
|
-
|
|
1228
|
+
ht as BreakPointHelper,
|
|
1207
1229
|
zt as BreakPoints,
|
|
1208
1230
|
rt as BrowserHelper,
|
|
1209
1231
|
we as BrowserService,
|