@sheetxl/studio-vanilla 0.4.10 → 0.4.11
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/browser/cjs/B0rdyyttE2Aibsag.cjs +7 -0
- package/browser/cjs/B2e7dDI-zKoqXpIW.cjs +107 -0
- package/browser/cjs/BAyEOOtO-9sHQQRW.cjs +7 -0
- package/browser/cjs/BPTHTRDvNOVkUJGa.cjs +7 -0
- package/browser/cjs/BlSFY6zLlebuejdV.cjs +7 -0
- package/browser/cjs/BplA5pDzOJpfTZuA.cjs +7 -0
- package/browser/cjs/BshvMtUxTJHj3JQN.cjs +7 -0
- package/browser/cjs/BuWtGFX0HiBezGjw.cjs +7 -0
- package/browser/cjs/C5FXOMLhAu_KTjVe.cjs +7 -0
- package/browser/cjs/C7EZCTczsC-gkRcq.cjs +7 -0
- package/browser/cjs/CFcjX5-nVsgzdZ4F.cjs +7 -0
- package/browser/cjs/CjZbhk41S1qO_74G.cjs +7 -0
- package/browser/cjs/CuTW2Pt-L5n-hNxV.cjs +7 -0
- package/browser/cjs/D3iOk-Q2tRdUeTcn.cjs +7 -0
- package/browser/cjs/DFspSkki779xN-Ey.cjs +7 -0
- package/browser/cjs/DFtyXc7YFh9dIp74.cjs +7 -0
- package/browser/cjs/Db_Ew1r6yOMYylvA.cjs +7 -0
- package/browser/cjs/DgBn3aW39yjgm0X_.cjs +7 -0
- package/browser/cjs/DiBy6-IxLscyMW2y.cjs +7 -0
- package/browser/cjs/DrlS1oz9Nea8Pm3j.cjs +7 -0
- package/browser/cjs/Dx-jp_LJxWbAScyA.cjs +7 -0
- package/browser/cjs/SzxJv7OUs5ojl8gx.cjs +7 -0
- package/browser/cjs/T4SHYo66xDT3l9JN.cjs +7 -0
- package/browser/cjs/index.cjs +4 -3
- package/browser/cjs/vfUix5Di0Ro8tEID.cjs +7 -0
- package/browser/esm/B5kkStdEkTczERyM.mjs +7 -0
- package/browser/esm/B905wKzTtod-jbsD.mjs +7 -0
- package/browser/esm/BALnKy2Fp7fyk-lc.mjs +7 -0
- package/browser/esm/BDVJ7eOPpW5FnEAP.mjs +7 -0
- package/browser/esm/BGpv6Kq7eBlJy43T.mjs +7 -0
- package/browser/esm/BUSR_OK5Qi6hRPfw.mjs +7 -0
- package/browser/esm/BXUGsC1Mo3FP8vnW.mjs +7 -0
- package/browser/esm/BlGoi1_x9rUMpWMd.mjs +7 -0
- package/browser/esm/Bo_ZPRrOQrqOVHAF.mjs +7 -0
- package/browser/esm/BuURCm92KsyGHG9e.mjs +7 -0
- package/browser/esm/CFFC0SNc24a0Dxnh.mjs +7 -0
- package/browser/esm/CGZ5MX7afzMxDkCe.mjs +7 -0
- package/browser/esm/Cc_VWd0wF5-39LsI.mjs +7 -0
- package/browser/esm/Cq8D_M0jeHLcnRjg.mjs +7 -0
- package/browser/esm/CzmNwV9tfFYUp_gS.mjs +7 -0
- package/browser/esm/De6RPxc4p_jXLlT5.mjs +7 -0
- package/browser/esm/DlVZFM9ZR5jGyG0_.mjs +7 -0
- package/browser/esm/DqXxZP6yKF4U1YfY.mjs +7 -0
- package/browser/esm/DtmE60AvstK9u0Ta.mjs +107 -0
- package/browser/esm/Dz2OVgq3kxi1TkfX.mjs +7 -0
- package/browser/esm/PS0cqYnlMVEGOQpI.mjs +7 -0
- package/browser/esm/QBGUD1XS5_pysBLL.mjs +7 -0
- package/browser/esm/index.mjs +2 -8
- package/browser/esm/tFhROdVSw9KLQfUN.mjs +7 -0
- package/browser/esm/uGDCdtqxjqRCo4Xn.mjs +7 -0
- package/cdn/index.js +40 -44
- package/cdn/loader.js +1 -1
- package/package.json +5 -5
- package/browser/cjs/B1UGqZP_7Z0Ewpog.cjs +0 -6
- package/browser/cjs/B6m9VXoFseD4zuZ5.cjs +0 -6
- package/browser/cjs/BKePSaEpM6Z063z-.cjs +0 -161
- package/browser/cjs/Bqn0ZeP_srNfL9rG.cjs +0 -6
- package/browser/cjs/C-izbj62pQuZjOrT.cjs +0 -304
- package/browser/cjs/C-w-GX8N54TxTjjf.cjs +0 -6
- package/browser/cjs/C1QGdcqJ-9sdGTQR.cjs +0 -6
- package/browser/cjs/C38aiRglHLxZ8KRY.cjs +0 -6
- package/browser/cjs/C4JMn_hMnlOnDpQO.cjs +0 -6
- package/browser/cjs/CApEj4LhhPUvQjIG.cjs +0 -16
- package/browser/cjs/CFcJbmmXjWjl6fQH.cjs +0 -6
- package/browser/cjs/CKiDbCZ6rGgXK7yN.cjs +0 -42
- package/browser/cjs/CM8btXQsJbnFKXUm.cjs +0 -6
- package/browser/cjs/Cb0K3Wzp7BAa4zni.cjs +0 -15
- package/browser/cjs/CiAUhPU7v1BK-8Bb.cjs +0 -7
- package/browser/cjs/CsXS-EN0N5SZHTnQ.cjs +0 -145
- package/browser/cjs/Cu2eUomoF0HToa4l.cjs +0 -6
- package/browser/cjs/Cy7ii9B_Vqx94pbu.cjs +0 -19
- package/browser/cjs/CzI4ZcsmzsyPBpWN.cjs +0 -12
- package/browser/cjs/DKHzUx2gKXwboKy1.cjs +0 -11
- package/browser/cjs/DKc8wAq8dwbDddQn.cjs +0 -11
- package/browser/cjs/DMyKApbUVRtNYC4e.cjs +0 -6
- package/browser/cjs/DROR08HMGyg7rizQ.cjs +0 -6
- package/browser/cjs/DfGDZlbFVknGyu_X.cjs +0 -6
- package/browser/cjs/OQdqVM_6m78kE5Aj.cjs +0 -7
- package/browser/cjs/v4OEtYXaUw_GeiXM.cjs +0 -12
- package/browser/esm/4uEr84M4w57AMyDg.mjs +0 -1703
- package/browser/esm/B8Ja5DlyKAy8xfQD.mjs +0 -1365
- package/browser/esm/B9bN60uAvy62vnwt.mjs +0 -22
- package/browser/esm/BAOzSQdzHl43K9Hd.mjs +0 -50
- package/browser/esm/BQYSD5Nb35y0WeeV.mjs +0 -421
- package/browser/esm/BVcaNvORp_uKPQgJ.mjs +0 -46
- package/browser/esm/BqXO_cQhrMJu7JoQ.mjs +0 -3756
- package/browser/esm/C18A_DcIEHNYBDvR.mjs +0 -46
- package/browser/esm/C7FoKZbSzjvuY3UB.mjs +0 -43
- package/browser/esm/CCIJpHSbFPjTEF8S.mjs +0 -1665
- package/browser/esm/CHNPjJxb0GY_naLa.mjs +0 -25025
- package/browser/esm/CKHsU9LUNYowimxS.mjs +0 -1346
- package/browser/esm/C_Zx1tYjI3n7KKZH.mjs +0 -21
- package/browser/esm/Cm-m3bZh0V44y0li.mjs +0 -390
- package/browser/esm/D1e_ccSgcNXvWHgy.mjs +0 -151
- package/browser/esm/D47D26mVYSAdb5C8.mjs +0 -2178
- package/browser/esm/D9CdO3PtV12RnK8K.mjs +0 -1467
- package/browser/esm/D9x-Q8y57gePf-tE.mjs +0 -944
- package/browser/esm/DHhXutXh7b5LsU1m.mjs +0 -2346
- package/browser/esm/DIGFi66CQPMV3HsL.mjs +0 -84
- package/browser/esm/DamiTeQsSMP2Cwld.mjs +0 -58
- package/browser/esm/DhD48oFrbrnZ6Zg5.mjs +0 -13208
- package/browser/esm/Ln2ZalJgj1CiJJue.mjs +0 -50
- package/browser/esm/S9fgUO7h8YgZxoKH.mjs +0 -633
- package/browser/esm/qVAHcpq07IhtAaQc.mjs +0 -24
- package/browser/esm/xrzJ8ILZHb118Oyt.mjs +0 -41
- package/cdn/assets/2-xJlw77WsCoyz09.js +0 -24872
- package/cdn/assets/B-9FcTf3xBEVGdjV.js +0 -1467
- package/cdn/assets/B-p1i2SNRMunPXCF.js +0 -43
- package/cdn/assets/B3J6oAmsS7oLNFPd.js +0 -46
- package/cdn/assets/B8Ja5DlyKAy8xfQD.js +0 -1365
- package/cdn/assets/BG3YTMAzNKPRGoLs.js +0 -50
- package/cdn/assets/BQYSD5Nb35y0WeeV.js +0 -421
- package/cdn/assets/BbzUpvQOkxsN-yIH.js +0 -2346
- package/cdn/assets/BqXO_cQhrMJu7JoQ.js +0 -3756
- package/cdn/assets/Bt1JSlSpWXDOBfq3.js +0 -1703
- package/cdn/assets/CCIJpHSbFPjTEF8S.js +0 -1665
- package/cdn/assets/CKHsU9LUNYowimxS.js +0 -1346
- package/cdn/assets/CWLJZwD2GVXljoWG.js +0 -46
- package/cdn/assets/Cm-m3bZh0V44y0li.js +0 -390
- package/cdn/assets/CtQlXGkNWgI-vtGy.js +0 -2178
- package/cdn/assets/DIGFi66CQPMV3HsL.js +0 -84
- package/cdn/assets/DK4S0DbayChkfTD6.js +0 -58
- package/cdn/assets/DQvsBz9F1GS_S7r9.js +0 -50
- package/cdn/assets/DTOgv_zwXSur-yCq.js +0 -151
- package/cdn/assets/DYZjOnD8WWQkCYuH.js +0 -944
- package/cdn/assets/DhD48oFrbrnZ6Zg5.js +0 -13208
- package/cdn/assets/DhyAyTCDkMBf392P.js +0 -21
- package/cdn/assets/P7HeVw5SHROLSWBz.js +0 -24
- package/cdn/assets/S4Z0SN8x6EltjsHT.js +0 -22
- package/cdn/assets/S9fgUO7h8YgZxoKH.js +0 -633
- package/cdn/assets/guYe4C_6pE93QsDV.js +0 -41
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as o, jsxs as D } from "react/jsx-runtime";
|
|
2
|
-
import { memo as N, useState as i, useCallback as T } from "react";
|
|
3
|
-
import { w as k, v, B as j, aP as y, at as B, au as F } from "./CHNPjJxb0GY_naLa.mjs";
|
|
4
|
-
/**
|
|
5
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.10
|
|
6
|
-
*
|
|
7
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
8
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
9
|
-
*/
|
|
10
|
-
const H = ["Ok", "Cancel"], A = N((u) => {
|
|
11
|
-
const { tableOptions: e, context: p, onOption: c, onValidateOption: I, onDone: r, options: d = H, defaultOption: t = d?.[0], cancelOption: s = "Cancel", sx: m, ...h } = u, [x, O] = i(!1), [n, b] = i(() => e?.hasHeader ?? !1), [l, f] = i(() => e?.ranges ?? null), C = k((a) => {
|
|
12
|
-
const g = { ...e, hasHeader: n, ranges: l };
|
|
13
|
-
c?.(a, a === s, a === t), r?.({ option: a, tableOptions: g });
|
|
14
|
-
}, [r, c, t, s, n, l, e]), w = T(async (a, g) => null, []);
|
|
15
|
-
return o(v, { title: "Insert Table", options: d, onDone: C, onValidateOption: w, defaultOption: t, cancelOption: s, autoFocusSel: ".range-input input", sx: { width: "360px", ...m }, ...h, children: D(j, { sx: { paddingTop: (a) => a.spacing(1), paddingBottom: (a) => a.spacing(0), rowGap: (a) => a.spacing(1), display: "flex", flexDirection: "column" }, children: [o(y, { formName: "range", value: l, onChangeInput: (a) => f(a), resolvedAddress: p.getNames().getRanges.bind(p.getNames()), onFocus: (a) => {
|
|
16
|
-
x || a.target?.select(), O(!0);
|
|
17
|
-
} }), o(B, { control: o(F, { checked: n, onChange: () => b(!n) }), label: "Table has headers", labelPlacement: "end" })] }) });
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
A as TableNewDialog,
|
|
21
|
-
A as default
|
|
22
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
2
|
-
import { memo as G, useState as x, useCallback as O, useEffect as H, useMemo as w } from "react";
|
|
3
|
-
import { NumberFormat as n } from "@sheetxl/sdk";
|
|
4
|
-
import { w as l, av as K, v as q, B as P, F as S, aw as A, ax as J, a as p, ay as c, T as Q, $, az as U } from "./CHNPjJxb0GY_naLa.mjs";
|
|
5
|
-
/**
|
|
6
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.10
|
|
7
|
-
*
|
|
8
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
9
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
10
|
-
*/
|
|
11
|
-
const X = ["Ok", "Cancel"], ea = G((D) => {
|
|
12
|
-
const { initialValue: I, context: h, onOption: b, onValidateOption: u, onInputOption: v, onDone: d, options: C = X, defaultOption: r = C?.[0], cancelOption: m = "Cancel", sx: N, ...V } = D, [e, T] = x(I), [j, z] = x(!1), g = O(async (a, o) => !0, []), y = l(async (a) => {
|
|
13
|
-
v?.(e, a), b?.(a, a === m, a === r), d?.();
|
|
14
|
-
}, [e, v, d, b, m, r]), B = l(async (a) => {
|
|
15
|
-
a.keyCode === K.Enter && await g?.(e, null) !== !1 && y(r);
|
|
16
|
-
}, [e, y]), M = l((a) => {
|
|
17
|
-
T(a.target.value), g?.(a.target.value, null);
|
|
18
|
-
}, [u]), E = l(async (a) => {
|
|
19
|
-
let o = await Promise.resolve(u?.(a));
|
|
20
|
-
try {
|
|
21
|
-
o !== !1 && (o = await Promise.resolve(g?.(e, a)) ?? !0);
|
|
22
|
-
} catch {
|
|
23
|
-
}
|
|
24
|
-
return o ?? !0;
|
|
25
|
-
}, [u]), [k, F] = x(n.Styles.lookupStyle(e).formatType ?? n.Type.Custom);
|
|
26
|
-
H(() => {
|
|
27
|
-
F(n.Styles.lookupStyle(e).formatType ?? n.Type.Custom);
|
|
28
|
-
}, [e]);
|
|
29
|
-
const L = w(() => {
|
|
30
|
-
const a = n.Styles.lookupPrimary(), o = (i) => t(U, { value: i, children: i }, i), s = Object.keys(a).map((i) => o(a[i].formatType));
|
|
31
|
-
return s.push(o(n.Type.Custom)), s;
|
|
32
|
-
}, []), R = O((a) => {
|
|
33
|
-
const o = a.target.value;
|
|
34
|
-
F(o);
|
|
35
|
-
const s = n.Styles.lookupDefault(o);
|
|
36
|
-
s && T(s);
|
|
37
|
-
}, []), W = w(() => {
|
|
38
|
-
const a = h();
|
|
39
|
-
return a.createTemporaryCell({ value: a.getValue() ?? 12345, style: { numberFormat: e } });
|
|
40
|
-
}, [k, e, h]);
|
|
41
|
-
return t(q, { title: "Number Format", options: C, onDone: d, onOption: (a) => y(a), onValidateOption: E, defaultOption: r, cancelOption: m, autoFocusSel: ".autoFocus", sx: { width: "580px", ...N }, ...V, children: f(P, { sx: { paddingTop: (a) => a.spacing(1), paddingBottom: (a) => a.spacing(0), rowGap: (a) => a.spacing(1), display: "flex", flexDirection: "column" }, children: [f(S, { sx: { minWidth: 135 }, size: "small", children: [t(A, { children: "Category" }), t(J, { value: k, label: "Category", onChange: R, sx: { backgroundImage: `linear-gradient(${p("#fff", c(5))}, ${p("#fff", c(5))})` }, children: L })] }), t(S, { sx: { paddingTop: (a) => a.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(Q, { label: "Code", onFocus: (a) => {
|
|
42
|
-
j || a.target?.select(), z(!0);
|
|
43
|
-
}, sx: { "& .MuiFormHelperText-root": { marginTop: (a) => a.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (a) => a.spacing(1.25), paddingBottom: (a) => a.spacing(0.75), backgroundImage: `linear-gradient(${p("#fff", c(5))}, ${p("#fff", c(5))})` } } }, value: e, onChange: M, onKeyDown: B, onContextMenu: (a) => {
|
|
44
|
-
a.stopPropagation();
|
|
45
|
-
} }) }), f(P, { children: [t($, { variant: "caption", component: "div", sx: { paddingLeft: (a) => a.spacing(2) }, children: "Preview" }), t($, { variant: "body2", component: "div", sx: { borderRadius: (a) => `${a.shape.borderRadius}px`, padding: (a) => a.spacing(1), border: (a) => `1px solid ${a.palette.grey[400]}` }, children: W.getNumberFormat().displayText || "(empty)" })] })] }) });
|
|
46
|
-
});
|
|
47
|
-
export {
|
|
48
|
-
ea as NumberFormatDialog,
|
|
49
|
-
ea as default
|
|
50
|
-
};
|
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.10
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
var ct, pt = { exports: {} };
|
|
8
|
-
const _t = function(Y, Q) {
|
|
9
|
-
for (var b = 0; b < Q.length; b++) {
|
|
10
|
-
const P = Q[b];
|
|
11
|
-
if (typeof P != "string" && !Array.isArray(P)) {
|
|
12
|
-
for (const B in P) if (B !== "default" && !(B in Y)) {
|
|
13
|
-
const J = Object.getOwnPropertyDescriptor(P, B);
|
|
14
|
-
J && Object.defineProperty(Y, B, J.get ? J : { enumerable: !0, get: () => P[B] });
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return Object.freeze(Object.defineProperty(Y, Symbol.toStringTag, { value: "Module" }));
|
|
19
|
-
}({ __proto__: null }, [(ct || (ct = 1, pt.exports = function Y() {
|
|
20
|
-
var Q, b = typeof self < "u" ? self : typeof window < "u" ? window : b !== void 0 ? b : {}, P = !b.document && !!b.postMessage, B = b.IS_PAPA_WORKER || !1, J = {}, gt = 0, a = {};
|
|
21
|
-
function K(t) {
|
|
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(e) {
|
|
23
|
-
var i = at(e);
|
|
24
|
-
i.chunkSize = parseInt(i.chunkSize), e.step || e.chunk || (i.chunkSize = null), this._handle = new ht(i), (this._handle.streamer = this)._config = i;
|
|
25
|
-
}.call(this, t), this.parseChunk = function(e, i) {
|
|
26
|
-
var n = parseInt(this._config.skipFirstNLines) || 0;
|
|
27
|
-
if (this.isFirstChunk && 0 < n) {
|
|
28
|
-
let l = this._config.newline;
|
|
29
|
-
l || (r = this._config.quoteChar || '"', l = this._handle.guessLineEndings(e, r)), e = [...e.split(l).slice(n)].join(l);
|
|
30
|
-
}
|
|
31
|
-
this.isFirstChunk && y(this._config.beforeFirstChunk) && (r = this._config.beforeFirstChunk(e)) !== void 0 && (e = r), this.isFirstChunk = !1, this._halted = !1, n = this._partialLine + e;
|
|
32
|
-
var r = (this._partialLine = "", this._handle.parse(n, this._baseIndex, !this._finished));
|
|
33
|
-
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
34
|
-
if (e = r.meta.cursor, this._finished || (this._partialLine = n.substring(e - this._baseIndex), this._baseIndex = e), r && r.data && (this._rowCount += r.data.length), n = this._finished || this._config.preview && this._rowCount >= this._config.preview, B) b.postMessage({ results: r, workerId: a.WORKER_ID, finished: n });
|
|
35
|
-
else if (y(this._config.chunk) && !i) {
|
|
36
|
-
if (this._config.chunk(r, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0);
|
|
37
|
-
this._completeResults = r = void 0;
|
|
38
|
-
}
|
|
39
|
-
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r.data), this._completeResults.errors = this._completeResults.errors.concat(r.errors), this._completeResults.meta = r.meta), this._completed || !n || !y(this._config.complete) || r && r.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = !0), n || r && r.meta.paused || this._nextChunk(), r;
|
|
40
|
-
}
|
|
41
|
-
this._halted = !0;
|
|
42
|
-
}, this._sendError = function(e) {
|
|
43
|
-
y(this._config.error) ? this._config.error(e) : B && this._config.error && b.postMessage({ workerId: a.WORKER_ID, error: e, finished: !1 });
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function it(t) {
|
|
47
|
-
var e;
|
|
48
|
-
(t = t || {}).chunkSize || (t.chunkSize = a.RemoteChunkSize), K.call(this, t), this._nextChunk = P ? function() {
|
|
49
|
-
this._readChunk(), this._chunkLoaded();
|
|
50
|
-
} : function() {
|
|
51
|
-
this._readChunk();
|
|
52
|
-
}, this.stream = function(i) {
|
|
53
|
-
this._input = i, this._nextChunk();
|
|
54
|
-
}, this._readChunk = function() {
|
|
55
|
-
if (this._finished) this._chunkLoaded();
|
|
56
|
-
else {
|
|
57
|
-
if (e = new XMLHttpRequest(), this._config.withCredentials && (e.withCredentials = this._config.withCredentials), P || (e.onload = $(this._chunkLoaded, this), e.onerror = $(this._chunkError, this)), e.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !P), this._config.downloadRequestHeaders) {
|
|
58
|
-
var i, n = this._config.downloadRequestHeaders;
|
|
59
|
-
for (i in n) e.setRequestHeader(i, n[i]);
|
|
60
|
-
}
|
|
61
|
-
var r;
|
|
62
|
-
this._config.chunkSize && (r = this._start + this._config.chunkSize - 1, e.setRequestHeader("Range", "bytes=" + this._start + "-" + r));
|
|
63
|
-
try {
|
|
64
|
-
e.send(this._config.downloadRequestBody);
|
|
65
|
-
} catch (l) {
|
|
66
|
-
this._chunkError(l.message);
|
|
67
|
-
}
|
|
68
|
-
P && e.status === 0 && this._chunkError();
|
|
69
|
-
}
|
|
70
|
-
}, this._chunkLoaded = function() {
|
|
71
|
-
var i;
|
|
72
|
-
e.readyState === 4 && (e.status < 200 || 400 <= e.status ? this._chunkError() : (this._start += this._config.chunkSize || e.responseText.length, this._finished = !this._config.chunkSize || this._start >= ((i = (i = e).getResponseHeader("Content-Range")) !== null ? parseInt(i.substring(i.lastIndexOf("/") + 1)) : -1), this.parseChunk(e.responseText)));
|
|
73
|
-
}, this._chunkError = function(i) {
|
|
74
|
-
i = e.statusText || i, this._sendError(new Error(i));
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function rt(t) {
|
|
78
|
-
(t = t || {}).chunkSize || (t.chunkSize = a.LocalChunkSize), K.call(this, t);
|
|
79
|
-
var e, i, n = typeof FileReader < "u";
|
|
80
|
-
this.stream = function(r) {
|
|
81
|
-
this._input = r, i = r.slice || r.webkitSlice || r.mozSlice, n ? ((e = new FileReader()).onload = $(this._chunkLoaded, this), e.onerror = $(this._chunkError, this)) : e = new FileReaderSync(), this._nextChunk();
|
|
82
|
-
}, this._nextChunk = function() {
|
|
83
|
-
this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
|
|
84
|
-
}, this._readChunk = function() {
|
|
85
|
-
var r = this._input, l = (this._config.chunkSize && (l = Math.min(this._start + this._config.chunkSize, this._input.size), r = i.call(r, this._start, l)), e.readAsText(r, this._config.encoding));
|
|
86
|
-
n || this._chunkLoaded({ target: { result: l } });
|
|
87
|
-
}, this._chunkLoaded = function(r) {
|
|
88
|
-
this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(r.target.result);
|
|
89
|
-
}, this._chunkError = function() {
|
|
90
|
-
this._sendError(e.error);
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function X(t) {
|
|
94
|
-
var e;
|
|
95
|
-
K.call(this, t = t || {}), this.stream = function(i) {
|
|
96
|
-
return e = i, this._nextChunk();
|
|
97
|
-
}, this._nextChunk = function() {
|
|
98
|
-
var i, n;
|
|
99
|
-
if (!this._finished) return i = this._config.chunkSize, e = i ? (n = e.substring(0, i), e.substring(i)) : (n = e, ""), this._finished = !e, this.parseChunk(n);
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
function nt(t) {
|
|
103
|
-
K.call(this, t = t || {});
|
|
104
|
-
var e = [], i = !0, n = !1;
|
|
105
|
-
this.pause = function() {
|
|
106
|
-
K.prototype.pause.apply(this, arguments), this._input.pause();
|
|
107
|
-
}, this.resume = function() {
|
|
108
|
-
K.prototype.resume.apply(this, arguments), this._input.resume();
|
|
109
|
-
}, this.stream = function(r) {
|
|
110
|
-
this._input = r, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
|
|
111
|
-
}, this._checkIsFinished = function() {
|
|
112
|
-
n && e.length === 1 && (this._finished = !0);
|
|
113
|
-
}, this._nextChunk = function() {
|
|
114
|
-
this._checkIsFinished(), e.length ? this.parseChunk(e.shift()) : i = !0;
|
|
115
|
-
}, this._streamData = $(function(r) {
|
|
116
|
-
try {
|
|
117
|
-
e.push(typeof r == "string" ? r : r.toString(this._config.encoding)), i && (i = !1, this._checkIsFinished(), this.parseChunk(e.shift()));
|
|
118
|
-
} catch (l) {
|
|
119
|
-
this._streamError(l);
|
|
120
|
-
}
|
|
121
|
-
}, this), this._streamError = $(function(r) {
|
|
122
|
-
this._streamCleanUp(), this._sendError(r);
|
|
123
|
-
}, this), this._streamEnd = $(function() {
|
|
124
|
-
this._streamCleanUp(), n = !0, this._streamData("");
|
|
125
|
-
}, this), this._streamCleanUp = $(function() {
|
|
126
|
-
this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
|
|
127
|
-
}, this);
|
|
128
|
-
}
|
|
129
|
-
function ht(t) {
|
|
130
|
-
var e, i, n, r, l = Math.pow(2, 53), p = -l, z = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, w = /^((\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)))$/, _ = this, T = 0, o = 0, I = !1, u = !1, g = [], s = { data: [], errors: [], meta: {} };
|
|
131
|
-
function C(h) {
|
|
132
|
-
return t.skipEmptyLines === "greedy" ? h.join("").trim() === "" : h.length === 1 && h[0].length === 0;
|
|
133
|
-
}
|
|
134
|
-
function R() {
|
|
135
|
-
if (s && n && (M("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + a.DefaultDelimiter + "'"), n = !1), t.skipEmptyLines && (s.data = s.data.filter(function(f) {
|
|
136
|
-
return !C(f);
|
|
137
|
-
})), L()) {
|
|
138
|
-
let f = function(O, A) {
|
|
139
|
-
y(t.transformHeader) && (O = t.transformHeader(O, A)), g.push(O);
|
|
140
|
-
};
|
|
141
|
-
if (s) if (Array.isArray(s.data[0])) {
|
|
142
|
-
for (var h = 0; L() && h < s.data.length; h++) s.data[h].forEach(f);
|
|
143
|
-
s.data.splice(0, 1);
|
|
144
|
-
} else s.data.forEach(f);
|
|
145
|
-
}
|
|
146
|
-
function c(f, O) {
|
|
147
|
-
for (var A = t.header ? {} : [], v = 0; v < f.length; v++) {
|
|
148
|
-
var k = v, m = f[v];
|
|
149
|
-
m = ((U, d) => {
|
|
150
|
-
return S = U, t.dynamicTypingFunction && t.dynamicTyping[S] === void 0 && (t.dynamicTyping[S] = t.dynamicTypingFunction(S)), (t.dynamicTyping[S] || t.dynamicTyping) === !0 ? d === "true" || d === "TRUE" || d !== "false" && d !== "FALSE" && (((j) => {
|
|
151
|
-
if (z.test(j) && (j = parseFloat(j), p < j && j < l)) return 1;
|
|
152
|
-
})(d) ? parseFloat(d) : w.test(d) ? new Date(d) : d === "" ? null : d) : d;
|
|
153
|
-
var S;
|
|
154
|
-
})(k = t.header ? v >= g.length ? "__parsed_extra" : g[v] : k, m = t.transform ? t.transform(m, k) : m), k === "__parsed_extra" ? (A[k] = A[k] || [], A[k].push(m)) : A[k] = m;
|
|
155
|
-
}
|
|
156
|
-
return t.header && (v > g.length ? M("FieldMismatch", "TooManyFields", "Too many fields: expected " + g.length + " fields but parsed " + v, o + O) : v < g.length && M("FieldMismatch", "TooFewFields", "Too few fields: expected " + g.length + " fields but parsed " + v, o + O)), A;
|
|
157
|
-
}
|
|
158
|
-
var E;
|
|
159
|
-
s && (t.header || t.dynamicTyping || t.transform) && (E = 1, !s.data.length || Array.isArray(s.data[0]) ? (s.data = s.data.map(c), E = s.data.length) : s.data = c(s.data, 0), t.header && s.meta && (s.meta.fields = g), o += E);
|
|
160
|
-
}
|
|
161
|
-
function L() {
|
|
162
|
-
return t.header && g.length === 0;
|
|
163
|
-
}
|
|
164
|
-
function M(h, c, E, f) {
|
|
165
|
-
h = { type: h, code: c, message: E }, f !== void 0 && (h.row = f), s.errors.push(h);
|
|
166
|
-
}
|
|
167
|
-
y(t.step) && (r = t.step, t.step = function(h) {
|
|
168
|
-
s = h, L() ? R() : (R(), s.data.length !== 0 && (T += h.data.length, t.preview && T > t.preview ? i.abort() : (s.data = s.data[0], r(s, _))));
|
|
169
|
-
}), this.parse = function(h, c, E) {
|
|
170
|
-
var f = t.quoteChar || '"';
|
|
171
|
-
return t.newline || (t.newline = this.guessLineEndings(h, f)), n = !1, t.delimiter ? y(t.delimiter) && (t.delimiter = t.delimiter(h), s.meta.delimiter = t.delimiter) : ((f = ((O, A, v, k, m) => {
|
|
172
|
-
var U, d, S, j;
|
|
173
|
-
m = m || [",", " ", "|", ";", a.RECORD_SEP, a.UNIT_SEP];
|
|
174
|
-
for (var Z = 0; Z < m.length; Z++) {
|
|
175
|
-
for (var W, tt = m[Z], F = 0, q = 0, x = 0, D = (S = void 0, new st({ comments: k, delimiter: tt, newline: A, preview: 10 }).parse(O)), H = 0; H < D.data.length; H++) v && C(D.data[H]) ? x++ : (q += W = D.data[H].length, S === void 0 ? S = W : 0 < W && (F += Math.abs(W - S), S = W));
|
|
176
|
-
0 < D.data.length && (q /= D.data.length - x), (d === void 0 || F <= d) && (j === void 0 || j < q) && 1.99 < q && (d = F, U = tt, j = q);
|
|
177
|
-
}
|
|
178
|
-
return { successful: !!(t.delimiter = U), bestDelimiter: U };
|
|
179
|
-
})(h, t.newline, t.skipEmptyLines, t.comments, t.delimitersToGuess)).successful ? t.delimiter = f.bestDelimiter : (n = !0, t.delimiter = a.DefaultDelimiter), s.meta.delimiter = t.delimiter), f = at(t), t.preview && t.header && f.preview++, e = h, i = new st(f), s = i.parse(e, c, E), R(), I ? { meta: { paused: !0 } } : s || { meta: { paused: !1 } };
|
|
180
|
-
}, this.paused = function() {
|
|
181
|
-
return I;
|
|
182
|
-
}, this.pause = function() {
|
|
183
|
-
I = !0, i.abort(), e = y(t.chunk) ? "" : e.substring(i.getCharIndex());
|
|
184
|
-
}, this.resume = function() {
|
|
185
|
-
_.streamer._halted ? (I = !1, _.streamer.parseChunk(e, !0)) : setTimeout(_.resume, 3);
|
|
186
|
-
}, this.aborted = function() {
|
|
187
|
-
return u;
|
|
188
|
-
}, this.abort = function() {
|
|
189
|
-
u = !0, i.abort(), s.meta.aborted = !0, y(t.complete) && t.complete(s), e = "";
|
|
190
|
-
}, this.guessLineEndings = function(h, c) {
|
|
191
|
-
h = h.substring(0, 1048576), c = new RegExp(V(c) + "([^]*?)" + V(c), "gm");
|
|
192
|
-
var E = (h = h.replace(c, "")).split("\r");
|
|
193
|
-
if (h = 1 < (c = h.split(`
|
|
194
|
-
`)).length && c[0].length < E[0].length, E.length === 1 || h) return `
|
|
195
|
-
`;
|
|
196
|
-
for (var f = 0, O = 0; O < E.length; O++) E[O][0] === `
|
|
197
|
-
` && f++;
|
|
198
|
-
return f >= E.length / 2 ? `\r
|
|
199
|
-
` : "\r";
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
function V(t) {
|
|
203
|
-
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
204
|
-
}
|
|
205
|
-
function st(t) {
|
|
206
|
-
var e = (t = t || {}).delimiter, i = t.newline, n = t.comments, r = t.step, l = t.preview, p = t.fastMode, z = null, w = !1, _ = t.quoteChar == null ? '"' : t.quoteChar, T = _;
|
|
207
|
-
if (t.escapeChar !== void 0 && (T = t.escapeChar), (typeof e != "string" || -1 < a.BAD_DELIMITERS.indexOf(e)) && (e = ","), n === e) throw new Error("Comment character same as delimiter");
|
|
208
|
-
n === !0 ? n = "#" : (typeof n != "string" || -1 < a.BAD_DELIMITERS.indexOf(n)) && (n = !1), i !== `
|
|
209
|
-
` && i !== "\r" && i !== `\r
|
|
210
|
-
` && (i = `
|
|
211
|
-
`);
|
|
212
|
-
var o = 0, I = !1;
|
|
213
|
-
this.parse = function(u, g, s) {
|
|
214
|
-
if (typeof u != "string") throw new Error("Input must be a string");
|
|
215
|
-
var C = u.length, R = e.length, L = i.length, M = n.length, h = y(r), c = [], E = [], f = [], O = o = 0;
|
|
216
|
-
if (!u) return F();
|
|
217
|
-
if (p || p !== !1 && u.indexOf(_) === -1) {
|
|
218
|
-
for (var A = u.split(i), v = 0; v < A.length; v++) {
|
|
219
|
-
if (f = A[v], o += f.length, v !== A.length - 1) o += i.length;
|
|
220
|
-
else if (s) return F();
|
|
221
|
-
if (!n || f.substring(0, M) !== n) {
|
|
222
|
-
if (h) {
|
|
223
|
-
if (c = [], j(f.split(e)), q(), I) return F();
|
|
224
|
-
} else j(f.split(e));
|
|
225
|
-
if (l && l <= v) return c = c.slice(0, l), F(!0);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return F();
|
|
229
|
-
}
|
|
230
|
-
for (var k = u.indexOf(e, o), m = u.indexOf(i, o), U = new RegExp(V(T) + V(_), "g"), d = u.indexOf(_, o); ; ) if (u[o] === _) for (d = o, o++; ; ) {
|
|
231
|
-
if ((d = u.indexOf(_, d + 1)) === -1) return s || E.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: c.length, index: o }), W();
|
|
232
|
-
if (d === C - 1) return W(u.substring(o, d).replace(U, _));
|
|
233
|
-
if (_ === T && u[d + 1] === T) d++;
|
|
234
|
-
else if (_ === T || d === 0 || u[d - 1] !== T) {
|
|
235
|
-
k !== -1 && k < d + 1 && (k = u.indexOf(e, d + 1));
|
|
236
|
-
var S = Z((m = m !== -1 && m < d + 1 ? u.indexOf(i, d + 1) : m) === -1 ? k : Math.min(k, m));
|
|
237
|
-
if (u.substr(d + 1 + S, R) === e) {
|
|
238
|
-
f.push(u.substring(o, d).replace(U, _)), u[o = d + 1 + S + R] !== _ && (d = u.indexOf(_, o)), k = u.indexOf(e, o), m = u.indexOf(i, o);
|
|
239
|
-
break;
|
|
240
|
-
}
|
|
241
|
-
if (S = Z(m), u.substring(d + 1 + S, d + 1 + S + L) === i) {
|
|
242
|
-
if (f.push(u.substring(o, d).replace(U, _)), tt(d + 1 + S + L), k = u.indexOf(e, o), d = u.indexOf(_, o), h && (q(), I)) return F();
|
|
243
|
-
if (l && c.length >= l) return F(!0);
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
E.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: c.length, index: o }), d++;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
else if (n && f.length === 0 && u.substring(o, o + M) === n) {
|
|
250
|
-
if (m === -1) return F();
|
|
251
|
-
o = m + L, m = u.indexOf(i, o), k = u.indexOf(e, o);
|
|
252
|
-
} else if (k !== -1 && (k < m || m === -1)) f.push(u.substring(o, k)), o = k + R, k = u.indexOf(e, o);
|
|
253
|
-
else {
|
|
254
|
-
if (m === -1) break;
|
|
255
|
-
if (f.push(u.substring(o, m)), tt(m + L), h && (q(), I)) return F();
|
|
256
|
-
if (l && c.length >= l) return F(!0);
|
|
257
|
-
}
|
|
258
|
-
return W();
|
|
259
|
-
function j(x) {
|
|
260
|
-
c.push(x), O = o;
|
|
261
|
-
}
|
|
262
|
-
function Z(x) {
|
|
263
|
-
return x !== -1 && (x = u.substring(d + 1, x)) && x.trim() === "" ? x.length : 0;
|
|
264
|
-
}
|
|
265
|
-
function W(x) {
|
|
266
|
-
return s || (x === void 0 && (x = u.substring(o)), f.push(x), o = C, j(f), h && q()), F();
|
|
267
|
-
}
|
|
268
|
-
function tt(x) {
|
|
269
|
-
o = x, j(f), f = [], m = u.indexOf(i, o);
|
|
270
|
-
}
|
|
271
|
-
function F(x) {
|
|
272
|
-
if (t.header && !g && c.length && !w) {
|
|
273
|
-
var D = c[0], H = /* @__PURE__ */ Object.create(null), ot = new Set(D);
|
|
274
|
-
let ft = !1;
|
|
275
|
-
for (let G = 0; G < D.length; G++) {
|
|
276
|
-
let N = D[G];
|
|
277
|
-
if (H[N = y(t.transformHeader) ? t.transformHeader(N, G) : N]) {
|
|
278
|
-
let et, lt = H[N];
|
|
279
|
-
for (; et = N + "_" + lt, lt++, ot.has(et); ) ;
|
|
280
|
-
ot.add(et), D[G] = et, H[N]++, ft = !0, (z = z === null ? {} : z)[et] = N;
|
|
281
|
-
} else H[N] = 1, D[G] = N;
|
|
282
|
-
ot.add(N);
|
|
283
|
-
}
|
|
284
|
-
ft && console.warn("Duplicate headers found and renamed."), w = !0;
|
|
285
|
-
}
|
|
286
|
-
return { data: c, errors: E, meta: { delimiter: e, linebreak: i, aborted: I, truncated: !!x, cursor: O + (g || 0), renamedHeaders: z } };
|
|
287
|
-
}
|
|
288
|
-
function q() {
|
|
289
|
-
r(F()), c = [], E = [];
|
|
290
|
-
}
|
|
291
|
-
}, this.abort = function() {
|
|
292
|
-
I = !0;
|
|
293
|
-
}, this.getCharIndex = function() {
|
|
294
|
-
return o;
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
function mt(t) {
|
|
298
|
-
var e = t.data, i = J[e.workerId], n = !1;
|
|
299
|
-
if (e.error) i.userError(e.error, e.file);
|
|
300
|
-
else if (e.results && e.results.data) {
|
|
301
|
-
var r = { abort: function() {
|
|
302
|
-
n = !0, ut(e.workerId, { data: [], errors: [], meta: { aborted: !0 } });
|
|
303
|
-
}, pause: dt, resume: dt };
|
|
304
|
-
if (y(i.userStep)) {
|
|
305
|
-
for (var l = 0; l < e.results.data.length && (i.userStep({ data: e.results.data[l], errors: e.results.errors, meta: e.results.meta }, r), !n); l++) ;
|
|
306
|
-
delete e.results;
|
|
307
|
-
} else y(i.userChunk) && (i.userChunk(e.results, r, e.file), delete e.results);
|
|
308
|
-
}
|
|
309
|
-
e.finished && !n && ut(e.workerId, e.results);
|
|
310
|
-
}
|
|
311
|
-
function ut(t, e) {
|
|
312
|
-
var i = J[t];
|
|
313
|
-
y(i.userComplete) && i.userComplete(e), i.terminate(), delete J[t];
|
|
314
|
-
}
|
|
315
|
-
function dt() {
|
|
316
|
-
throw new Error("Not implemented.");
|
|
317
|
-
}
|
|
318
|
-
function at(t) {
|
|
319
|
-
if (typeof t != "object" || t === null) return t;
|
|
320
|
-
var e, i = Array.isArray(t) ? [] : {};
|
|
321
|
-
for (e in t) i[e] = at(t[e]);
|
|
322
|
-
return i;
|
|
323
|
-
}
|
|
324
|
-
function $(t, e) {
|
|
325
|
-
return function() {
|
|
326
|
-
t.apply(e, arguments);
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
function y(t) {
|
|
330
|
-
return typeof t == "function";
|
|
331
|
-
}
|
|
332
|
-
return a.parse = function(t, e) {
|
|
333
|
-
var i, n, r, l, p = (e = e || {}).dynamicTyping || !1;
|
|
334
|
-
if (y(p) && (e.dynamicTypingFunction = p, p = {}), e.dynamicTyping = p, e.transform = !!y(e.transform) && e.transform, !e.worker || !a.WORKERS_SUPPORTED) return p = null, a.NODE_STREAM_INPUT, typeof t == "string" ? (t = (i = t).charCodeAt(0) !== 65279 ? i : i.slice(1), p = new (e.download ? it : X)(e)) : t.readable === !0 && y(t.read) && y(t.on) ? p = new nt(e) : (b.File && t instanceof File || t instanceof Object) && (p = new rt(e)), p.stream(t);
|
|
335
|
-
(p = !!a.WORKERS_SUPPORTED && (r = b.URL || b.webkitURL || null, l = Y.toString(), n = a.BLOB_URL || (a.BLOB_URL = r.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; ", "(", l, ")();"], { type: "text/javascript" }))), (n = new b.Worker(n)).onmessage = mt, n.id = gt++, J[n.id] = n)).userStep = e.step, p.userChunk = e.chunk, p.userComplete = e.complete, p.userError = e.error, e.step = y(e.step), e.chunk = y(e.chunk), e.complete = y(e.complete), e.error = y(e.error), delete e.worker, p.postMessage({ input: t, config: e, workerId: p.id });
|
|
336
|
-
}, a.unparse = function(t, e) {
|
|
337
|
-
var i = !1, n = !0, r = ",", l = `\r
|
|
338
|
-
`, p = '"', z = p + p, w = !1, _ = null, T = !1, o = ((() => {
|
|
339
|
-
if (typeof e == "object") {
|
|
340
|
-
if (typeof e.delimiter != "string" || a.BAD_DELIMITERS.filter(function(g) {
|
|
341
|
-
return e.delimiter.indexOf(g) !== -1;
|
|
342
|
-
}).length || (r = e.delimiter), typeof e.quotes != "boolean" && typeof e.quotes != "function" && !Array.isArray(e.quotes) || (i = e.quotes), typeof e.skipEmptyLines != "boolean" && typeof e.skipEmptyLines != "string" || (w = e.skipEmptyLines), typeof e.newline == "string" && (l = e.newline), typeof e.quoteChar == "string" && (p = e.quoteChar), typeof e.header == "boolean" && (n = e.header), Array.isArray(e.columns)) {
|
|
343
|
-
if (e.columns.length === 0) throw new Error("Option columns is empty");
|
|
344
|
-
_ = e.columns;
|
|
345
|
-
}
|
|
346
|
-
e.escapeChar !== void 0 && (z = e.escapeChar + p), e.escapeFormulae instanceof RegExp ? T = e.escapeFormulae : typeof e.escapeFormulae == "boolean" && e.escapeFormulae && (T = /^[=+\-@\t\r].*$/);
|
|
347
|
-
}
|
|
348
|
-
})(), new RegExp(V(p), "g"));
|
|
349
|
-
if (typeof t == "string" && (t = JSON.parse(t)), Array.isArray(t)) {
|
|
350
|
-
if (!t.length || Array.isArray(t[0])) return I(null, t, w);
|
|
351
|
-
if (typeof t[0] == "object") return I(_ || Object.keys(t[0]), t, w);
|
|
352
|
-
} else if (typeof t == "object") return typeof t.data == "string" && (t.data = JSON.parse(t.data)), Array.isArray(t.data) && (t.fields || (t.fields = t.meta && t.meta.fields || _), t.fields || (t.fields = Array.isArray(t.data[0]) ? t.fields : typeof t.data[0] == "object" ? Object.keys(t.data[0]) : []), Array.isArray(t.data[0]) || typeof t.data[0] == "object" || (t.data = [t.data])), I(t.fields || [], t.data || [], w);
|
|
353
|
-
throw new Error("Unable to serialize unrecognized input");
|
|
354
|
-
function I(g, s, C) {
|
|
355
|
-
var R = "", L = (typeof g == "string" && (g = JSON.parse(g)), typeof s == "string" && (s = JSON.parse(s)), Array.isArray(g) && 0 < g.length), M = !Array.isArray(s[0]);
|
|
356
|
-
if (L && n) {
|
|
357
|
-
for (var h = 0; h < g.length; h++) 0 < h && (R += r), R += u(g[h], h);
|
|
358
|
-
0 < s.length && (R += l);
|
|
359
|
-
}
|
|
360
|
-
for (var c = 0; c < s.length; c++) {
|
|
361
|
-
var E = (L ? g : s[c]).length, f = !1, O = L ? Object.keys(s[c]).length === 0 : s[c].length === 0;
|
|
362
|
-
if (C && !L && (f = C === "greedy" ? s[c].join("").trim() === "" : s[c].length === 1 && s[c][0].length === 0), C === "greedy" && L) {
|
|
363
|
-
for (var A = [], v = 0; v < E; v++) {
|
|
364
|
-
var k = M ? g[v] : v;
|
|
365
|
-
A.push(s[c][k]);
|
|
366
|
-
}
|
|
367
|
-
f = A.join("").trim() === "";
|
|
368
|
-
}
|
|
369
|
-
if (!f) {
|
|
370
|
-
for (var m = 0; m < E; m++) {
|
|
371
|
-
0 < m && !O && (R += r);
|
|
372
|
-
var U = L && M ? g[m] : m;
|
|
373
|
-
R += u(s[c][U], m);
|
|
374
|
-
}
|
|
375
|
-
c < s.length - 1 && (!C || 0 < E && !O) && (R += l);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
return R;
|
|
379
|
-
}
|
|
380
|
-
function u(g, s) {
|
|
381
|
-
var C, R;
|
|
382
|
-
return g == null ? "" : g.constructor === Date ? JSON.stringify(g).slice(1, 25) : (R = !1, T && typeof g == "string" && T.test(g) && (g = "'" + g, R = !0), C = g.toString().replace(o, z), (R = R || i === !0 || typeof i == "function" && i(g, s) || Array.isArray(i) && i[s] || ((L, M) => {
|
|
383
|
-
for (var h = 0; h < M.length; h++) if (-1 < L.indexOf(M[h])) return !0;
|
|
384
|
-
return !1;
|
|
385
|
-
})(C, a.BAD_DELIMITERS) || -1 < C.indexOf(r) || C.charAt(0) === " " || C.charAt(C.length - 1) === " ") ? p + C + p : C);
|
|
386
|
-
}
|
|
387
|
-
}, a.RECORD_SEP = "", a.UNIT_SEP = "", a.BYTE_ORDER_MARK = "\uFEFF", a.BAD_DELIMITERS = ["\r", `
|
|
388
|
-
`, '"', a.BYTE_ORDER_MARK], a.WORKERS_SUPPORTED = !P && !!b.Worker, a.NODE_STREAM_INPUT = 1, a.LocalChunkSize = 10485760, a.RemoteChunkSize = 5242880, a.DefaultDelimiter = ",", a.Parser = st, a.ParserHandle = ht, a.NetworkStreamer = it, a.FileStreamer = rt, a.StringStreamer = X, a.ReadableStreamStreamer = nt, b.jQuery && ((Q = b.jQuery).fn.parse = function(t) {
|
|
389
|
-
var e = t.config || {}, i = [];
|
|
390
|
-
return this.each(function(l) {
|
|
391
|
-
if (Q(this).prop("tagName").toUpperCase() !== "INPUT" || Q(this).attr("type").toLowerCase() !== "file" || !b.FileReader || !this.files || this.files.length === 0) return !0;
|
|
392
|
-
for (var p = 0; p < this.files.length; p++) i.push({ file: this.files[p], inputElem: this, instanceConfig: Q.extend({}, e) });
|
|
393
|
-
}), n(), this;
|
|
394
|
-
function n() {
|
|
395
|
-
if (i.length === 0) y(t.complete) && t.complete();
|
|
396
|
-
else {
|
|
397
|
-
var l, p, z, w = i[0];
|
|
398
|
-
if (y(t.before)) {
|
|
399
|
-
var _ = t.before(w.file, w.inputElem);
|
|
400
|
-
if (typeof _ == "object") {
|
|
401
|
-
if (_.action === "abort") return l = w.file, p = w.inputElem, z = _.reason, void (y(t.error) && t.error({ name: "AbortError" }, l, p, z));
|
|
402
|
-
if (_.action === "skip") return void r();
|
|
403
|
-
typeof _.config == "object" && (w.instanceConfig = Q.extend(w.instanceConfig, _.config));
|
|
404
|
-
} else if (_ === "skip") return void r();
|
|
405
|
-
}
|
|
406
|
-
var T = w.instanceConfig.complete;
|
|
407
|
-
w.instanceConfig.complete = function(o) {
|
|
408
|
-
y(T) && T(o, w.file, w.inputElem), r();
|
|
409
|
-
}, a.parse(w.file, w.instanceConfig);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
function r() {
|
|
413
|
-
i.splice(0, 1), n();
|
|
414
|
-
}
|
|
415
|
-
}), B && (b.onmessage = function(t) {
|
|
416
|
-
t = t.data, a.WORKER_ID === void 0 && t && (a.WORKER_ID = t.workerId), typeof t.input == "string" ? b.postMessage({ workerId: a.WORKER_ID, results: a.parse(t.input, t.config), finished: !0 }) : (b.File && t.input instanceof File || t.input instanceof Object) && (t = a.parse(t.input, t.config)) && b.postMessage({ workerId: a.WORKER_ID, results: t, finished: !0 });
|
|
417
|
-
}), (it.prototype = Object.create(K.prototype)).constructor = it, (rt.prototype = Object.create(K.prototype)).constructor = rt, (X.prototype = Object.create(X.prototype)).constructor = X, (nt.prototype = Object.create(K.prototype)).constructor = nt, a;
|
|
418
|
-
}()), pt.exports)]);
|
|
419
|
-
export {
|
|
420
|
-
_t as p
|
|
421
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Workbook as y, IRange as k } from "@sheetxl/sdk";
|
|
2
|
-
/**
|
|
3
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.10
|
|
4
|
-
*
|
|
5
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
7
|
-
*/
|
|
8
|
-
const E = async (a, p) => {
|
|
9
|
-
const { trimLeadingBlankRow: i = !0, trimLeadingBlankColumn: f = !0, excludeHidden: h = !1, sheetKey: r = null, papaParseConfig: m = {} } = p || {}, u = await import("./BQYSD5Nb35y0WeeV.mjs").then((s) => s.p);
|
|
10
|
-
if (!a) throw new Error("workbook must be specified");
|
|
11
|
-
let t = null;
|
|
12
|
-
if (r === null ? t = a.getSelectedSheet() : typeof r == "number" ? t = a.getSheets().search()[r] : typeof r == "string" && (t = a.getSheets().getByName(r)), !t) throw new Error("invalid sheetKey specified");
|
|
13
|
-
let c = null;
|
|
14
|
-
const d = [];
|
|
15
|
-
let e = null, n = t.getUsedRange({ excludeHidden: h });
|
|
16
|
-
if (!n) throw new Error("Nothing to export");
|
|
17
|
-
if (!i || !f) {
|
|
18
|
-
const s = i ? n.getRowStart() : 0, l = f ? n.getColumnStart() : 0;
|
|
19
|
-
n = n.getOffsetTo(s, l);
|
|
20
|
-
}
|
|
21
|
-
n.forEach((s, l) => {
|
|
22
|
-
const w = l.getCoords(), x = l.getCell();
|
|
23
|
-
c !== w.rowIndex && (e && d.push(e), e = [], c = w.rowIndex);
|
|
24
|
-
const S = x.toTextUnformatted() ?? "";
|
|
25
|
-
e.push(S);
|
|
26
|
-
}, { includeEmpty: !0, address: null }), e && d.push(e);
|
|
27
|
-
const o = { ...m }, g = u.unparse(d, o);
|
|
28
|
-
return new TextEncoder().encode(g).buffer;
|
|
29
|
-
}, b = async (a, p) => {
|
|
30
|
-
const { papaParseConfig: i, setValuesOptions: f, createWorkbookOptions: h } = p ?? {}, r = await import("./BQYSD5Nb35y0WeeV.mjs").then((o) => o.p), m = new TextDecoder().decode(a);
|
|
31
|
-
let u = -1;
|
|
32
|
-
const t = new y(h), c = t.getSelectedSheet().getEntireRange().startIncrementalUpdates({ orientation: k.Orientation.Row }), d = p?.onProgress;
|
|
33
|
-
let e = 0;
|
|
34
|
-
const n = { ...i, transform: (o, g) => {
|
|
35
|
-
i?.transform && (o = i.transform(o, g));
|
|
36
|
-
const s = g;
|
|
37
|
-
s === 0 && u++;
|
|
38
|
-
let l = o ?? "";
|
|
39
|
-
return c.pushAt(u, s, l), e++, e % 1e5 == 0 && d?.(e), o;
|
|
40
|
-
} };
|
|
41
|
-
return r.parse(m, n).data, c.apply({ textParser: !0, ...f }), t;
|
|
42
|
-
};
|
|
43
|
-
export {
|
|
44
|
-
b as fromBufferCSV,
|
|
45
|
-
E as toBufferCSV
|
|
46
|
-
};
|