@sheetxl/io-xlsx 0.8.0-beta.10 → 0.8.0-beta.12
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/esm/{BLXcoiDAaOMjFuhw.mjs → 9dwUocbOsJuAcmKn.mjs} +3021 -1986
- package/browser/esm/{xc_LzCPgHn-acgFZ.mjs → BIvDjK4Zl8bWRgl8.mjs} +2 -2
- package/browser/esm/CcH5ITJFTMVWUJO9.mjs +6154 -0
- package/browser/esm/{CI_CZI5m5-KkiAK5.mjs → D8k22TSWPd_RHEpj.mjs} +1798 -1009
- package/browser/esm/{BKT8OBj-bhQwdg49.mjs → DKnOwucZq4z9_-r-.mjs} +47 -10
- package/browser/esm/{2EOdn2WRK5y1L58S.mjs → DO75RoAQTgMuVzXv.mjs} +2 -2
- package/browser/esm/{NQIuOQIleHC4NUW6.mjs → DVLJTjJCGqrJUa8c.mjs} +587 -705
- package/browser/esm/DeMZN_qj__PKo4Wh.mjs +2265 -0
- package/browser/esm/{DXopGe8PrLWmwGaV.mjs → DsppUz-14Z7ti9i3.mjs} +1 -1
- package/browser/esm/{B-jb5SuiVh5NnBG_.mjs → aUBXbTh2r0u3x4Xo.mjs} +2 -2
- package/browser/esm/index.mjs +2 -2
- package/node/esm/BmIIQODk4dBVIXA4.mjs +4455 -0
- package/node/esm/{CHqRP_NjPpPd7m9L.mjs → C-e5AO_4TnGywT-m.mjs} +1 -1
- package/node/esm/C78E45n6j2E8rruH.mjs +5694 -0
- package/node/esm/CDKm5s3JE_d99TJw.mjs +2369 -0
- package/node/esm/{BmdmvgO5Zdgx-RWo.mjs → DCaAOfuW-w_dx_qd.mjs} +2 -2
- package/node/esm/{O5mti2R9drFOlXc7.mjs → DSgxL0sBZtWMydVl.mjs} +2 -2
- package/node/esm/DXusvwW73FUDSyvD.mjs +6367 -0
- package/node/esm/DsyuWxk3bdGhJUQN.mjs +2346 -0
- package/node/esm/index.mjs +64 -27
- package/package.json +3 -3
- package/types/src/AutoFilterRules.d.ts +8 -1
- package/types/src/DataTableFormula.d.ts +36 -0
- package/types/src/DefinedNameAttributes.d.ts +8 -0
- package/types/src/ExcelCompat.d.ts +15 -3
- package/types/src/KnownFonts.d.ts +50 -0
- package/types/src/LegacyFormula.d.ts +13 -0
- package/types/src/PageLayoutAttributes.d.ts +8 -0
- package/types/src/Plugin.d.ts +12 -0
- package/types/src/ProtectionAttributes.d.ts +2 -2
- package/types/src/SheetKinds.d.ts +57 -0
- package/types/src/SheetViewAttributes.d.ts +4 -0
- package/types/src/SortExtent.d.ts +16 -0
- package/types/src/Types.d.ts +11 -0
- package/types/src/XlsxHeader.d.ts +19 -0
- package/types/src/chart/ChartExXml.d.ts +38 -0
- package/types/src/chart/ChartPartXml.d.ts +47 -0
- package/types/src/chart/ChartSpaceXml.d.ts +37 -0
- package/types/src/chart/_XmlTree.d.ts +34 -0
- package/types/src/chart/_chartCodecs.d.ts +12 -0
- package/types/src/chart/_chartExCodecs.d.ts +7 -0
- package/types/src/chart/_chartExFold.d.ts +14 -0
- package/types/src/chart/_chartExMarkup.d.ts +236 -0
- package/types/src/chart/_chartExStyle.d.ts +22 -0
- package/types/src/chart/_codec.d.ts +78 -0
- package/types/src/chart/_drawingml.d.ts +10 -0
- package/types/src/chart/_xml.d.ts +70 -0
- package/types/src/reader/CellControls.d.ts +18 -0
- package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts +2 -2
- package/types/src/reader/HeaderStyles.d.ts +15 -0
- package/types/src/reader/IsoDateCell.d.ts +20 -0
- package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -3
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +3 -1
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +23 -8
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -1
- package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +27 -0
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
- package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
- package/types/src/reader/domVisitors/index.d.ts +4 -34
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +46 -6
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +24 -8
- package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
- package/types/src/richValue/IRichValueHandler.d.ts +109 -0
- package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
- package/types/src/richValue/RichDataParts.d.ts +69 -0
- package/types/src/richValue/RichRecordWriter.d.ts +61 -0
- package/types/src/richValue/RichValueHandlers.d.ts +25 -0
- package/types/src/richValue/RichValueResolver.d.ts +54 -0
- package/types/src/richValue/WebImageRichValueHandler.d.ts +42 -0
- package/types/src/richValue/index.d.ts +7 -0
- package/types/src/utils/DrawingMLText.d.ts +2 -2
- package/types/src/utils/FormControls.d.ts +4 -4
- package/types/src/utils/SharedNames.d.ts +13 -0
- package/types/src/utils/SpreadsheetFont.d.ts +38 -0
- package/types/src/utils/VmlNoteShapes.d.ts +16 -23
- package/types/src/utils/VmlNoteStyle.d.ts +44 -0
- package/types/src/utils/VmlPrefixes.d.ts +24 -0
- package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
- package/types/src/writer/builder/Types.d.ts +7 -0
- package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
- package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
- package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +18 -0
- package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
- package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
- package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
- package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
- package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
- package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
- package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
- package/types/src/writer/emitters/SlicerEmitter.d.ts +8 -5
- package/types/src/writer/emitters/StylesEmitter.d.ts +2 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +5 -0
- package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
- package/types/src/writer/utils/AutoFilter.d.ts +1 -1
- package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
- package/types/src/writer/utils/DefaultRows.d.ts +38 -0
- package/types/src/writer/utils/DxfCollector.d.ts +11 -8
- package/types/src/writer/utils/HiddenFormulaXfs.d.ts +1 -1
- package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
- package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
- package/types/src/writer/utils/TextUtils.d.ts +6 -1
- package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
- package/browser/esm/BPmehfSqdvgsLBsB.mjs +0 -5153
- package/node/esm/BpxxiZ2oKPkUSfdB.mjs +0 -2486
- package/node/esm/CtAF486aZqYzMeLM.mjs +0 -3651
- package/node/esm/QS_theNoeqNGLStj.mjs +0 -5298
- package/node/esm/nNQ7MG89sGKwkjMA.mjs +0 -4649
- package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
- package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
- package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
- package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
- package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
- package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
- package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
- package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
- package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
- package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { $
|
|
8
|
-
import { BufferUtils as
|
|
9
|
-
import { AddressUtils as
|
|
10
|
-
var
|
|
7
|
+
import { $n as e, $t as t, Bn as n, Bt as r, C as i, Cn as a, Dt as o, En as s, Et as c, Fn as l, Hn as u, It as d, Jt as f, Kt as p, Ln as m, Nn as h, On as g, Ot as _, Pn as v, Pt as y, Q as b, Qn as x, Sn as ee, Tn as te, Tt as ne, Vt as re, X as ie, Xn as ae, Xt as oe, Zt as se, _n as S, _t as C, ar as w, bn as ce, bt as T, d as le, dt as ue, en as de, et as fe, fn as E, ft as D, gn as O, gt as k, h as pe, hn as me, ht as he, jn as ge, kn as _e, mn as A, n as j, nn as ve, nr as ye, on as be, or as M, pt as xe, qn as N, qt as P, rn as Se, rr as F, rt as Ce, st as we, t as Te, tt as Ee, u as De, vn as I, vt as Oe, w as ke, wn as Ae, wt as je, x as Me, xn as Ne, xt as Pe, yn as Fe, zt as Ie } from "./9dwUocbOsJuAcmKn.mjs";
|
|
8
|
+
import { BufferUtils as Le, CommonUtils as L, ExpectedError as Re, OverlappingRange as ze, RangeAxis as Be } from "@sheetxl/utils";
|
|
9
|
+
import { AddressUtils as R, CommonUtils as Ve, CoordUtils as He, FormulaError as z, FormulaText as Ue, ICellStyle as B, ICondition as V, IConditionalFormat as H, ICustomProperty as U, IFont as We, IRange as Ge, OutOfBoundsError as Ke, PersonCollection as qe, ResourceCollection as Je, RichDataRegistry as Ye, Sort as Xe, Theme as Ze, Tuple as Qe, Workbook as $e } from "@sheetxl/sdk";
|
|
10
|
+
var et = {
|
|
11
11
|
ascending: "ascending",
|
|
12
12
|
descending: "descending",
|
|
13
13
|
natural: "dataSource"
|
|
14
14
|
};
|
|
15
|
-
function
|
|
15
|
+
function tt(e, t) {
|
|
16
16
|
if (!t) return null;
|
|
17
17
|
for (let n = 0; n < e.length; n++) if (e[n].id !== void 0 && String(e[n].id) === t) return e[n];
|
|
18
18
|
let n = Number(t);
|
|
19
19
|
return Number.isInteger(n) && n >= 1 && n <= e.length ? e[n - 1] : null;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function nt(e, t, n) {
|
|
22
22
|
let r = {
|
|
23
23
|
...t,
|
|
24
24
|
source: n
|
|
@@ -28,77 +28,28 @@ function De(e, t, n) {
|
|
|
28
28
|
t > 0 && t !== 27 && (r.rowHeight = t);
|
|
29
29
|
}
|
|
30
30
|
e.style && e.style !== "SlicerStyleLight1" && (r.style = e.style);
|
|
31
|
-
let i = e.sortOrder ?
|
|
31
|
+
let i = e.sortOrder ? et[e.sortOrder] : void 0;
|
|
32
32
|
return i && i !== "ascending" && (r.sortOrder = i), e.crossFilter && e.crossFilter !== "showItemsWithDataAtTop" && (r.crossFilter = e.crossFilter), e.lockedPosition && (r.lockedPosition = !0), !1 === e.customListSort && (r.disabledCustomListSort = !0), e.cacheName && (r.cacheName = e.cacheName), e.startItem && (r.startItem = e.startItem), e.level !== void 0 && (r.level = e.level), e.uid && (r.uid = e.uid), r;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
35
|
-
let
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
z(e, t, i);
|
|
34
|
+
var rt = "xl/richData/rdrichvaluestructure.xml", it = "xl/richData/rdrichvalue.xml", at = "xl/richData/rdarray.xml", ot = "xl/richData/rdsupportingpropertybagstructure.xml", st = "xl/richData/rdsupportingpropertybag.xml", ct = "xl/richData/rdRichValueTypes.xml", lt = "xl/richData/richStyles.xml", W = (e, t) => {
|
|
35
|
+
let n = [], r = e?.childNodes, i = r?.length ?? 0;
|
|
36
|
+
for (let e = 0; e < i; e++) {
|
|
37
|
+
let i = r.item(e);
|
|
38
|
+
i.nodeType !== 1 || t && i.localName !== t || n.push(i);
|
|
39
|
+
}
|
|
40
|
+
return n;
|
|
41
|
+
}, ut = (e) => W(e, "k").map((e) => [e.getAttribute("n") ?? "", e.getAttribute("t") || null]), dt = (e) => W(e, "v").map((e) => ({
|
|
42
|
+
t: e.getAttribute("t") || null,
|
|
43
|
+
text: e.textContent ?? ""
|
|
44
|
+
})), ft = (e) => {
|
|
45
|
+
let t = /* @__PURE__ */ new Map();
|
|
46
|
+
for (let n of W(e, "key")) {
|
|
47
|
+
let e = /* @__PURE__ */ new Map();
|
|
48
|
+
for (let t of W(n, "flag")) e.set(t.getAttribute("name") ?? "", t.getAttribute("value") ?? "");
|
|
49
|
+
t.set(n.getAttribute("name") ?? "", e);
|
|
51
50
|
}
|
|
52
|
-
return
|
|
53
|
-
},
|
|
54
|
-
if (!e) return null;
|
|
55
|
-
let a = Oe(e, t, n, r, i);
|
|
56
|
-
if (!a) return null;
|
|
57
|
-
let o = /* @__PURE__ */ new Map(), s = Object.keys(a), c = s.length;
|
|
58
|
-
for (let e = 0; e < c; e++) {
|
|
59
|
-
let t = s[e], n = a[t];
|
|
60
|
-
o.set(t, n);
|
|
61
|
-
}
|
|
62
|
-
return o;
|
|
63
|
-
}, V = (e, t, n, r, i, a = null) => {
|
|
64
|
-
let o = /* @__PURE__ */ new Map(), s = t[e], c = s ? s.length : 0;
|
|
65
|
-
for (let e = 0; e < c; e++) {
|
|
66
|
-
let t = s[e];
|
|
67
|
-
if (!t) continue;
|
|
68
|
-
let c = t;
|
|
69
|
-
c.startsWith("/") && (c = c.substring(1));
|
|
70
|
-
let l = Oe(c, n, r, i, a);
|
|
71
|
-
o.set(c, l);
|
|
72
|
-
}
|
|
73
|
-
return o;
|
|
74
|
-
}, ke = (e) => {
|
|
75
|
-
let t = e.split(/\/+/);
|
|
76
|
-
return t.reduce((e, t, n) => (t === "." ? e.splice(n, 1) : t === ".." && e.splice(n - 1, 2), e), t).join("/");
|
|
77
|
-
}, H = Object.freeze([
|
|
78
|
-
"lt1",
|
|
79
|
-
"dk1",
|
|
80
|
-
"lt2",
|
|
81
|
-
"dk2",
|
|
82
|
-
"accent1",
|
|
83
|
-
"accent2",
|
|
84
|
-
"accent3",
|
|
85
|
-
"accent4",
|
|
86
|
-
"accent5",
|
|
87
|
-
"accent6",
|
|
88
|
-
"hlink",
|
|
89
|
-
"folHlink"
|
|
90
|
-
]), Ae = (e, t = "auto") => {
|
|
91
|
-
let n, r = e("auto");
|
|
92
|
-
r === void 0 || r !== "1" && r !== "true" || (n = t);
|
|
93
|
-
let i = e("indexed");
|
|
94
|
-
i && (n = i === "64" ? "auto" : `index${i}`);
|
|
95
|
-
let a = e("rgb");
|
|
96
|
-
a && (n = a.toLowerCase(), a.length !== 8 || a.startsWith("FF") || (n = "FF" + a.substring(2, a.length)));
|
|
97
|
-
let o = e("theme");
|
|
98
|
-
o && (n = H[Number(o)]);
|
|
99
|
-
let s = e("tint");
|
|
100
|
-
if (s && (n += ` ${ve.AdjustmentType.ETint} ${parseFloat(s)}`), n) return n;
|
|
101
|
-
}, je = (e) => e && e.replace(/^\{([\s\S]+)\}$/, "$1"), U = /* @__PURE__ */ new Uint8Array(), W = class t {
|
|
51
|
+
return t;
|
|
52
|
+
}, pt = /* @__PURE__ */ new Uint8Array(), mt = class t {
|
|
102
53
|
constructor(e, t, n) {
|
|
103
54
|
this.buffers = /* @__PURE__ */ new Map(), this.zip = e, this.entries = t, this.rawBuffer = n;
|
|
104
55
|
}
|
|
@@ -106,7 +57,7 @@ var z = (e, t, n) => {
|
|
|
106
57
|
return e.startsWith("/") ? e.slice(1) : e;
|
|
107
58
|
}
|
|
108
59
|
static async create(n) {
|
|
109
|
-
let r = n instanceof Blob ?
|
|
60
|
+
let r = n instanceof Blob ? pt : n instanceof Uint8Array ? n : new Uint8Array(n), i = n instanceof Blob ? new e(n) : new ye(r), a = new x(i), o = /* @__PURE__ */ new Map();
|
|
110
61
|
for (let e of await a.getEntries()) e.directory || o.set(e.filename, e);
|
|
111
62
|
return new t(a, o, r);
|
|
112
63
|
}
|
|
@@ -124,12 +75,12 @@ var z = (e, t, n) => {
|
|
|
124
75
|
if (r) return r;
|
|
125
76
|
let i = this.entries.get(n);
|
|
126
77
|
if (!i) return null;
|
|
127
|
-
let a = await i.getData(new
|
|
78
|
+
let a = await i.getData(new F());
|
|
128
79
|
return this.buffers.set(n, a), a;
|
|
129
80
|
}
|
|
130
81
|
async prefetch(e) {
|
|
131
82
|
let t = [];
|
|
132
|
-
for (let [n, r] of this.entries) !this.buffers.has(n) && e(n, r) && t.push(r.getData(new
|
|
83
|
+
for (let [n, r] of this.entries) !this.buffers.has(n) && e(n, r) && t.push(r.getData(new F()).then((e) => {
|
|
133
84
|
this.buffers.set(n, e);
|
|
134
85
|
}));
|
|
135
86
|
await Promise.all(t);
|
|
@@ -172,18 +123,18 @@ var z = (e, t, n) => {
|
|
|
172
123
|
async close() {
|
|
173
124
|
await this.zip.close();
|
|
174
125
|
}
|
|
175
|
-
},
|
|
126
|
+
}, ht = class {
|
|
176
127
|
constructor(e) {
|
|
177
|
-
this._sink = e, this._samples = [], this._t0 =
|
|
128
|
+
this._sink = e, this._samples = [], this._t0 = gt(), this._tPrev = this._t0, this._heapPrev = _t();
|
|
178
129
|
}
|
|
179
130
|
mark(e) {
|
|
180
|
-
let t =
|
|
131
|
+
let t = gt(), n = _t(), r = {
|
|
181
132
|
label: e,
|
|
182
133
|
tMs: t - this._t0,
|
|
183
134
|
dtMs: t - this._tPrev,
|
|
184
135
|
heapBytes: n,
|
|
185
136
|
dHeapBytes: n !== void 0 && this._heapPrev !== void 0 ? n - this._heapPrev : void 0,
|
|
186
|
-
rssBytes:
|
|
137
|
+
rssBytes: vt()
|
|
187
138
|
};
|
|
188
139
|
this._tPrev = t, this._heapPrev = n, this._samples.push(r), this._sink?.(r);
|
|
189
140
|
}
|
|
@@ -195,91 +146,91 @@ var z = (e, t, n) => {
|
|
|
195
146
|
phase: e.label,
|
|
196
147
|
tMs: Math.round(e.tMs),
|
|
197
148
|
dtMs: Math.round(e.dtMs),
|
|
198
|
-
heapMB: e.heapBytes === void 0 ? "—" :
|
|
199
|
-
dHeapMB: e.dHeapBytes === void 0 ? "—" :
|
|
200
|
-
rssMB: e.rssBytes === void 0 ? "—" :
|
|
149
|
+
heapMB: e.heapBytes === void 0 ? "—" : yt(e.heapBytes / 1048576),
|
|
150
|
+
dHeapMB: e.dHeapBytes === void 0 ? "—" : yt(e.dHeapBytes / 1048576),
|
|
151
|
+
rssMB: e.rssBytes === void 0 ? "—" : yt(e.rssBytes / 1048576)
|
|
201
152
|
}));
|
|
202
153
|
}
|
|
203
|
-
},
|
|
204
|
-
function
|
|
154
|
+
}, gt = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now();
|
|
155
|
+
function _t() {
|
|
205
156
|
let e = typeof performance == "object" ? performance.memory : void 0;
|
|
206
157
|
if (e && typeof e.usedJSHeapSize == "number") return e.usedJSHeapSize;
|
|
207
158
|
let t = globalThis.process;
|
|
208
159
|
return typeof t == "object" && typeof t.memoryUsage == "function" ? t.memoryUsage().heapUsed : void 0;
|
|
209
160
|
}
|
|
210
|
-
function
|
|
161
|
+
function vt() {
|
|
211
162
|
let e = globalThis.process;
|
|
212
163
|
if (typeof e == "object" && typeof e.memoryUsage == "function") return e.memoryUsage().rss;
|
|
213
164
|
}
|
|
214
|
-
function
|
|
165
|
+
function yt(e) {
|
|
215
166
|
return Math.round(10 * e) / 10;
|
|
216
167
|
}
|
|
217
|
-
var
|
|
168
|
+
var bt = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", xt = `-${bt}.0-9·̀-ͯ‿-⁀`, St = (RegExp(`^[${bt}]$`, "u"), RegExp(`^[${xt}]$`, "u"), RegExp(`^[${bt}][${xt}]*$`, "u")), Ct = (RegExp(`^[${xt}]+$`, "u"), [
|
|
218
169
|
32,
|
|
219
170
|
10,
|
|
220
171
|
13,
|
|
221
172
|
9
|
|
222
173
|
]);
|
|
223
|
-
function
|
|
174
|
+
function G(e) {
|
|
224
175
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 58 || e === 95 || e === 8204 || e === 8205 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 767 || e >= 880 && e <= 893 || e >= 895 && e <= 8191 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
|
|
225
176
|
}
|
|
226
|
-
var
|
|
227
|
-
RegExp(`^[${
|
|
228
|
-
var
|
|
229
|
-
function
|
|
177
|
+
var wt = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", Tt = `-${wt}.0-9·̀-ͯ‿-⁀`;
|
|
178
|
+
RegExp(`^[${wt}]$`, "u"), RegExp(`^[${Tt}]$`, "u"), RegExp(`^[${wt}][${Tt}]*$`, "u"), RegExp(`^[${Tt}]+$`, "u");
|
|
179
|
+
var Et = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", Dt = `-${Et}.0-9·̀-ͯ‿-⁀`, Ot = (RegExp(`^[${Et}]$`, "u"), RegExp(`^[${Dt}]$`, "u"), RegExp(`^[${Et}][${Dt}]*$`, "u"));
|
|
180
|
+
function kt(e) {
|
|
230
181
|
return e >= 65 && e <= 90 || e === 95 || e >= 97 && e <= 122 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 767 || e >= 880 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
|
|
231
182
|
}
|
|
232
|
-
var
|
|
183
|
+
var K = function(e) {
|
|
233
184
|
return e === 32 || e === 10 || e === 13 || e === 9;
|
|
234
|
-
},
|
|
185
|
+
}, At = function(e) {
|
|
235
186
|
return e >= 32 && e <= 55295 || e === 10 || e === 13 || e === 9 || e >= 57344 && e <= 65533 || e >= 65536 && e <= 1114111;
|
|
236
|
-
},
|
|
237
|
-
return
|
|
238
|
-
},
|
|
187
|
+
}, jt = G, Mt = function(e) {
|
|
188
|
+
return G(e) || e >= 48 && e <= 57 || e === 45 || e === 46 || e === 183 || e >= 768 && e <= 879 || e >= 8255 && e <= 8256;
|
|
189
|
+
}, Nt = Ct, Pt = St, Ft = function(e) {
|
|
239
190
|
return e >= 1 && e <= 55295 || e >= 57344 && e <= 65533 || e >= 65536 && e <= 1114111;
|
|
240
|
-
},
|
|
241
|
-
return
|
|
242
|
-
},
|
|
191
|
+
}, It = kt, Lt = function(e) {
|
|
192
|
+
return kt(e) || e === 45 || e === 46 || e >= 48 && e <= 57 || e === 183 || e >= 768 && e <= 879 || e >= 8255 && e <= 8256;
|
|
193
|
+
}, Rt = Ot, zt = "http://www.w3.org/XML/1998/namespace", Bt = "http://www.w3.org/2000/xmlns/", Vt = {
|
|
243
194
|
__proto__: null,
|
|
244
|
-
xml:
|
|
245
|
-
xmlns:
|
|
246
|
-
},
|
|
195
|
+
xml: zt,
|
|
196
|
+
xmlns: Bt
|
|
197
|
+
}, Ht = {
|
|
247
198
|
__proto__: null,
|
|
248
199
|
amp: "&",
|
|
249
200
|
gt: ">",
|
|
250
201
|
lt: "<",
|
|
251
202
|
quot: "\"",
|
|
252
203
|
apos: "'"
|
|
253
|
-
}, q = -1,
|
|
254
|
-
...
|
|
204
|
+
}, q = -1, Ut = -2, J = 13, Wt = 33, Gt = 10, Kt = 60, qt = 61, Y = 62, X = 63, Jt = 93, Yt = (e) => e === 34 || e === 39, Xt = [34, 39], Zt = [
|
|
205
|
+
...Xt,
|
|
255
206
|
91,
|
|
256
207
|
Y
|
|
257
|
-
],
|
|
258
|
-
...
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
],
|
|
262
|
-
|
|
208
|
+
], Qt = [
|
|
209
|
+
...Xt,
|
|
210
|
+
Kt,
|
|
211
|
+
Jt
|
|
212
|
+
], $t = [
|
|
213
|
+
qt,
|
|
263
214
|
X,
|
|
264
|
-
...
|
|
265
|
-
],
|
|
266
|
-
...
|
|
215
|
+
...Nt
|
|
216
|
+
], en = [
|
|
217
|
+
...Nt,
|
|
267
218
|
Y,
|
|
268
219
|
38,
|
|
269
|
-
|
|
220
|
+
Kt
|
|
270
221
|
];
|
|
271
|
-
function
|
|
222
|
+
function tn(e, t, n) {
|
|
272
223
|
switch (t) {
|
|
273
224
|
case "xml":
|
|
274
|
-
n !==
|
|
225
|
+
n !== zt && e.fail(`xml prefix must be bound to ${zt}.`);
|
|
275
226
|
break;
|
|
276
|
-
case "xmlns": n !==
|
|
227
|
+
case "xmlns": n !== Bt && e.fail(`xmlns prefix must be bound to ${Bt}.`);
|
|
277
228
|
}
|
|
278
229
|
switch (n) {
|
|
279
|
-
case
|
|
280
|
-
e.fail(t === "" ? `the default namespace may not be set to ${n}.` : `may not assign a prefix (even "xmlns") to the URI ${
|
|
230
|
+
case Bt:
|
|
231
|
+
e.fail(t === "" ? `the default namespace may not be set to ${n}.` : `may not assign a prefix (even "xmlns") to the URI ${Bt}.`);
|
|
281
232
|
break;
|
|
282
|
-
case
|
|
233
|
+
case zt: switch (t) {
|
|
283
234
|
case "xml": break;
|
|
284
235
|
case "":
|
|
285
236
|
e.fail(`the default namespace may not be set to ${n}.`);
|
|
@@ -288,7 +239,7 @@ function vt(e, t, n) {
|
|
|
288
239
|
}
|
|
289
240
|
}
|
|
290
241
|
}
|
|
291
|
-
var
|
|
242
|
+
var nn, rn = (e) => Rt.test(e), an = (e) => Pt.test(e), on = {
|
|
292
243
|
xmldecl: "xmlDeclHandler",
|
|
293
244
|
text: "textHandler",
|
|
294
245
|
processinginstruction: "piHandler",
|
|
@@ -302,7 +253,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
302
253
|
error: "errorHandler",
|
|
303
254
|
end: "endHandler",
|
|
304
255
|
ready: "readyHandler"
|
|
305
|
-
},
|
|
256
|
+
}, sn = class {
|
|
306
257
|
get closed() {
|
|
307
258
|
return this._closed;
|
|
308
259
|
}
|
|
@@ -310,15 +261,15 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
310
261
|
this.i = 0, this.prevI = 0, this.opt = e ?? {}, this.fragmentOpt = !!this.opt.fragment;
|
|
311
262
|
let t = this.xmlnsOpt = !!this.opt.xmlns;
|
|
312
263
|
if (this.trackPosition = !1 !== this.opt.position, this.fileName = this.opt.fileName, t) {
|
|
313
|
-
this.nameStartCheck =
|
|
264
|
+
this.nameStartCheck = It, this.nameCheck = Lt, this.isName = rn, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
|
|
314
265
|
__proto__: null,
|
|
315
|
-
...
|
|
266
|
+
...Vt
|
|
316
267
|
};
|
|
317
268
|
let e = this.opt.additionalNamespaces;
|
|
318
269
|
e != null && (function(e, t) {
|
|
319
|
-
for (let n of Object.keys(t))
|
|
270
|
+
for (let n of Object.keys(t)) tn(e, n, t[n]);
|
|
320
271
|
}(this, e), Object.assign(this.ns, e));
|
|
321
|
-
} else this.nameStartCheck =
|
|
272
|
+
} else this.nameStartCheck = jt, this.nameCheck = Mt, this.isName = an, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
|
|
322
273
|
this.stateTable = [
|
|
323
274
|
this.sBegin,
|
|
324
275
|
this.sBeginWhitespace,
|
|
@@ -380,7 +331,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
380
331
|
version: void 0,
|
|
381
332
|
encoding: void 0,
|
|
382
333
|
standalone: void 0
|
|
383
|
-
}, this.line = 1, this.column = 0, this.ENTITIES = Object.create(
|
|
334
|
+
}, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Ht), this.readyHandler?.();
|
|
384
335
|
}
|
|
385
336
|
get position() {
|
|
386
337
|
return this.chunkPosition + this.i;
|
|
@@ -389,10 +340,10 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
389
340
|
return this.position - this.positionAtNewLine;
|
|
390
341
|
}
|
|
391
342
|
on(e, t) {
|
|
392
|
-
this[
|
|
343
|
+
this[on[e]] = t;
|
|
393
344
|
}
|
|
394
345
|
off(e) {
|
|
395
|
-
this[
|
|
346
|
+
this[on[e]] = void 0;
|
|
396
347
|
}
|
|
397
348
|
makeError(e) {
|
|
398
349
|
let t = this.fileName ?? "";
|
|
@@ -423,8 +374,8 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
423
374
|
if (this.column++, n < 55296) {
|
|
424
375
|
if (n >= 32 || n === 9) return n;
|
|
425
376
|
switch (n) {
|
|
426
|
-
case
|
|
427
|
-
case 13: return e.charCodeAt(t + 1) ===
|
|
377
|
+
case Gt: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Gt;
|
|
378
|
+
case 13: return e.charCodeAt(t + 1) === Gt && (this.i = t + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, Ut;
|
|
428
379
|
default: return this.fail("disallowed character."), n;
|
|
429
380
|
}
|
|
430
381
|
}
|
|
@@ -439,13 +390,13 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
439
390
|
if (this.column++, n < 55296) {
|
|
440
391
|
if (n > 31 && n < 127 || n > 159 && n !== 8232 || n === 9) return n;
|
|
441
392
|
switch (n) {
|
|
442
|
-
case
|
|
393
|
+
case Gt: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Gt;
|
|
443
394
|
case 13: {
|
|
444
395
|
let n = e.charCodeAt(t + 1);
|
|
445
|
-
n !==
|
|
396
|
+
n !== Gt && n !== 133 || (this.i = t + 2);
|
|
446
397
|
}
|
|
447
398
|
case 133:
|
|
448
|
-
case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position,
|
|
399
|
+
case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Ut;
|
|
449
400
|
default: return this.fail("disallowed character."), n;
|
|
450
401
|
}
|
|
451
402
|
}
|
|
@@ -455,7 +406,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
455
406
|
}
|
|
456
407
|
getCodeNorm() {
|
|
457
408
|
let e = this.getCode();
|
|
458
|
-
return e ===
|
|
409
|
+
return e === Ut ? Gt : e;
|
|
459
410
|
}
|
|
460
411
|
unGet() {
|
|
461
412
|
this.i = this.prevI, this.column--;
|
|
@@ -463,7 +414,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
463
414
|
captureTo(e) {
|
|
464
415
|
let { i: t } = this, { chunk: n } = this;
|
|
465
416
|
for (;;) {
|
|
466
|
-
let r = this.getCode(), i = r ===
|
|
417
|
+
let r = this.getCode(), i = r === Ut, a = i ? Gt : r;
|
|
467
418
|
if (a === q || e.includes(a)) return this.text += n.slice(t, this.prevI), a;
|
|
468
419
|
i && (this.text += `${n.slice(t, this.prevI)}\n`, t = this.i);
|
|
469
420
|
}
|
|
@@ -473,8 +424,8 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
473
424
|
for (;;) {
|
|
474
425
|
let r = this.getCode();
|
|
475
426
|
switch (r) {
|
|
476
|
-
case
|
|
477
|
-
this.text += `${n.slice(t, this.prevI)}\n`, t = this.i, r =
|
|
427
|
+
case Ut:
|
|
428
|
+
this.text += `${n.slice(t, this.prevI)}\n`, t = this.i, r = Gt;
|
|
478
429
|
break;
|
|
479
430
|
case q: return this.text += n.slice(t), !1;
|
|
480
431
|
}
|
|
@@ -486,17 +437,17 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
486
437
|
for (;;) {
|
|
487
438
|
let n = this.getCode();
|
|
488
439
|
if (n === q) return this.name += e.slice(t), q;
|
|
489
|
-
if (!
|
|
440
|
+
if (!Mt(n)) return this.name += e.slice(t, this.prevI), n === Ut ? Gt : n;
|
|
490
441
|
}
|
|
491
442
|
}
|
|
492
443
|
skipSpaces() {
|
|
493
444
|
for (;;) {
|
|
494
445
|
let e = this.getCodeNorm();
|
|
495
|
-
if (e === q || !
|
|
446
|
+
if (e === q || !K(e)) return e;
|
|
496
447
|
}
|
|
497
448
|
}
|
|
498
449
|
setXMLVersion(e) {
|
|
499
|
-
this.currentXMLVersion = e, e === "1.0" ? (this.isChar =
|
|
450
|
+
this.currentXMLVersion = e, e === "1.0" ? (this.isChar = At, this.getCode = this.getCode10) : (this.isChar = Ft, this.getCode = this.getCode11);
|
|
500
451
|
}
|
|
501
452
|
sBegin() {
|
|
502
453
|
this.chunk.charCodeAt(0) === 65279 && (this.i++, this.column++), this.state = 1;
|
|
@@ -504,7 +455,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
504
455
|
sBeginWhitespace() {
|
|
505
456
|
let e = this.i, t = this.skipSpaces();
|
|
506
457
|
switch (this.prevI !== e && (this.xmlDeclPossible = !1), t) {
|
|
507
|
-
case
|
|
458
|
+
case Kt:
|
|
508
459
|
if (this.state = 15, this.text.length !== 0) throw Error("no-empty text at start");
|
|
509
460
|
break;
|
|
510
461
|
case q: break;
|
|
@@ -512,13 +463,13 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
512
463
|
}
|
|
513
464
|
}
|
|
514
465
|
sDoctype() {
|
|
515
|
-
let e = this.captureTo(
|
|
466
|
+
let e = this.captureTo(Zt);
|
|
516
467
|
switch (e) {
|
|
517
468
|
case Y:
|
|
518
469
|
this.doctypeHandler?.(this.text), this.text = "", this.state = J, this.doctype = !0;
|
|
519
470
|
break;
|
|
520
471
|
case q: break;
|
|
521
|
-
default: this.text += String.fromCodePoint(e), e === 91 ? this.state = 4 :
|
|
472
|
+
default: this.text += String.fromCodePoint(e), e === 91 ? this.state = 4 : Yt(e) && (this.state = 3, this.q = e);
|
|
522
473
|
}
|
|
523
474
|
}
|
|
524
475
|
sDoctypeQuote() {
|
|
@@ -526,8 +477,8 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
526
477
|
this.captureToChar(e) && (this.text += String.fromCodePoint(e), this.q = null, this.state = 2);
|
|
527
478
|
}
|
|
528
479
|
sDTD() {
|
|
529
|
-
let e = this.captureTo(
|
|
530
|
-
e !== q && (this.text += String.fromCodePoint(e), e ===
|
|
480
|
+
let e = this.captureTo(Qt);
|
|
481
|
+
e !== q && (this.text += String.fromCodePoint(e), e === Jt ? this.state = 2 : e === Kt ? this.state = 6 : Yt(e) && (this.state = 5, this.q = e));
|
|
531
482
|
}
|
|
532
483
|
sDTDQuoted() {
|
|
533
484
|
let e = this.q;
|
|
@@ -573,7 +524,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
573
524
|
sEntity() {
|
|
574
525
|
let { i: e } = this, { chunk: t } = this;
|
|
575
526
|
t: for (;;) switch (this.getCode()) {
|
|
576
|
-
case
|
|
527
|
+
case Ut:
|
|
577
528
|
this.entity += `${t.slice(e, this.prevI)}\n`, e = this.i;
|
|
578
529
|
break;
|
|
579
530
|
case 59: {
|
|
@@ -588,7 +539,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
588
539
|
}
|
|
589
540
|
sOpenWaka() {
|
|
590
541
|
let e = this.getCode();
|
|
591
|
-
if (
|
|
542
|
+
if (jt(e)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
|
|
592
543
|
else switch (e) {
|
|
593
544
|
case 47:
|
|
594
545
|
this.state = 43, this.xmlDeclPossible = !1;
|
|
@@ -628,11 +579,11 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
628
579
|
e === Y ? this.state = J : (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(e)}`, this.state = 17);
|
|
629
580
|
}
|
|
630
581
|
sCData() {
|
|
631
|
-
this.captureToChar(
|
|
582
|
+
this.captureToChar(Jt) && (this.state = 21);
|
|
632
583
|
}
|
|
633
584
|
sCDataEnding() {
|
|
634
585
|
let e = this.getCodeNorm();
|
|
635
|
-
e ===
|
|
586
|
+
e === Jt ? this.state = 22 : (this.text += `]${String.fromCodePoint(e)}`, this.state = 20);
|
|
636
587
|
}
|
|
637
588
|
sCDataEnding2() {
|
|
638
589
|
let e = this.getCodeNorm();
|
|
@@ -640,7 +591,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
640
591
|
case Y:
|
|
641
592
|
this.cdataHandler?.(this.text), this.text = "", this.state = J;
|
|
642
593
|
break;
|
|
643
|
-
case
|
|
594
|
+
case Jt:
|
|
644
595
|
this.text += "]";
|
|
645
596
|
break;
|
|
646
597
|
default: this.text += `]]${String.fromCodePoint(e)}`, this.state = 20;
|
|
@@ -648,7 +599,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
648
599
|
}
|
|
649
600
|
sPIFirstChar() {
|
|
650
601
|
let e = this.getCodeNorm();
|
|
651
|
-
this.nameStartCheck(e) ? (this.piTarget += String.fromCodePoint(e), this.state = 24) : e === X ||
|
|
602
|
+
this.nameStartCheck(e) ? (this.piTarget += String.fromCodePoint(e), this.state = 24) : e === X || K(e) ? (this.fail("processing instruction without a target."), this.state = e === X ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(e), this.state = 24);
|
|
652
603
|
}
|
|
653
604
|
sPIRest() {
|
|
654
605
|
let { chunk: e, i: t } = this;
|
|
@@ -658,7 +609,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
658
609
|
if (!this.nameCheck(n)) {
|
|
659
610
|
this.piTarget += e.slice(t, this.prevI);
|
|
660
611
|
let r = n === X;
|
|
661
|
-
r ||
|
|
612
|
+
r || K(n) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = r ? Wt : 27) : this.state = r ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(n));
|
|
662
613
|
break;
|
|
663
614
|
}
|
|
664
615
|
}
|
|
@@ -666,7 +617,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
666
617
|
sPIBody() {
|
|
667
618
|
if (this.text.length === 0) {
|
|
668
619
|
let e = this.getCodeNorm();
|
|
669
|
-
e === X ? this.state = 26 :
|
|
620
|
+
e === X ? this.state = 26 : K(e) || (this.text = String.fromCodePoint(e));
|
|
670
621
|
} else this.captureToChar(X) && (this.state = 26);
|
|
671
622
|
}
|
|
672
623
|
sPIEnding() {
|
|
@@ -682,12 +633,12 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
682
633
|
}
|
|
683
634
|
sXMLDeclNameStart() {
|
|
684
635
|
let e = this.skipSpaces();
|
|
685
|
-
e === X ? this.state =
|
|
636
|
+
e === X ? this.state = Wt : e !== q && (this.state = 28, this.name = String.fromCodePoint(e));
|
|
686
637
|
}
|
|
687
638
|
sXMLDeclName() {
|
|
688
|
-
let e = this.captureTo(
|
|
689
|
-
if (e === X) return this.state =
|
|
690
|
-
if (
|
|
639
|
+
let e = this.captureTo($t);
|
|
640
|
+
if (e === X) return this.state = Wt, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
641
|
+
if (K(e) || e === qt) {
|
|
691
642
|
if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
|
|
692
643
|
case 0:
|
|
693
644
|
this.fail("did not expect any more name/value pairs.");
|
|
@@ -697,22 +648,22 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
697
648
|
break;
|
|
698
649
|
default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
|
|
699
650
|
}
|
|
700
|
-
this.state = e ===
|
|
651
|
+
this.state = e === qt ? 30 : 29;
|
|
701
652
|
}
|
|
702
653
|
}
|
|
703
654
|
sXMLDeclEq() {
|
|
704
655
|
let e = this.getCodeNorm();
|
|
705
|
-
if (e === X) return this.state =
|
|
706
|
-
|
|
656
|
+
if (e === X) return this.state = Wt, void this.fail("XML declaration is incomplete.");
|
|
657
|
+
K(e) || (e !== qt && this.fail("value required."), this.state = 30);
|
|
707
658
|
}
|
|
708
659
|
sXMLDeclValueStart() {
|
|
709
660
|
let e = this.getCodeNorm();
|
|
710
|
-
if (e === X) return this.state =
|
|
711
|
-
|
|
661
|
+
if (e === X) return this.state = Wt, void this.fail("XML declaration is incomplete.");
|
|
662
|
+
K(e) || (Yt(e) ? this.q = e : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
|
|
712
663
|
}
|
|
713
664
|
sXMLDeclValue() {
|
|
714
665
|
let e = this.captureTo([this.q, X]);
|
|
715
|
-
if (e === X) return this.state =
|
|
666
|
+
if (e === X) return this.state = Wt, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
716
667
|
if (e === q) return;
|
|
717
668
|
let t = this.text;
|
|
718
669
|
switch (this.text = "", this.name) {
|
|
@@ -731,7 +682,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
731
682
|
}
|
|
732
683
|
sXMLDeclSeparator() {
|
|
733
684
|
let e = this.getCodeNorm();
|
|
734
|
-
e === X ? this.state =
|
|
685
|
+
e === X ? this.state = Wt : (K(e) || (this.fail("whitespace required."), this.unGet()), this.state = 27);
|
|
735
686
|
}
|
|
736
687
|
sXMLDeclEnding() {
|
|
737
688
|
this.getCodeNorm() === Y ? (this.piTarget === "xml" ? this.name !== "version" && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version.") : this.fail("processing instructions are not allowed before root."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = J) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
|
|
@@ -750,7 +701,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
750
701
|
case 47:
|
|
751
702
|
this.state = 35;
|
|
752
703
|
break;
|
|
753
|
-
default:
|
|
704
|
+
default: K(e) || this.fail("disallowed character in tag name."), this.state = 36;
|
|
754
705
|
}
|
|
755
706
|
}
|
|
756
707
|
sOpenTagSlash() {
|
|
@@ -758,25 +709,25 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
758
709
|
}
|
|
759
710
|
sAttrib() {
|
|
760
711
|
let e = this.skipSpaces();
|
|
761
|
-
e !== q && (
|
|
712
|
+
e !== q && (jt(e) ? (this.unGet(), this.state = 37) : e === Y ? this.openTag() : e === 47 ? this.state = 35 : this.fail("disallowed character in attribute name."));
|
|
762
713
|
}
|
|
763
714
|
sAttribName() {
|
|
764
715
|
let e = this.captureNameChars();
|
|
765
|
-
e ===
|
|
716
|
+
e === qt ? this.state = 39 : K(e) ? this.state = 38 : e === Y ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : e !== q && this.fail("disallowed character in attribute name.");
|
|
766
717
|
}
|
|
767
718
|
sAttribNameSawWhite() {
|
|
768
719
|
let e = this.skipSpaces();
|
|
769
720
|
switch (e) {
|
|
770
721
|
case q: return;
|
|
771
|
-
case
|
|
722
|
+
case qt:
|
|
772
723
|
this.state = 39;
|
|
773
724
|
break;
|
|
774
|
-
default: this.fail("attribute without value."), this.text = "", this.name = "", e === Y ? this.openTag() :
|
|
725
|
+
default: this.fail("attribute without value."), this.text = "", this.name = "", e === Y ? this.openTag() : jt(e) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
|
|
775
726
|
}
|
|
776
727
|
}
|
|
777
728
|
sAttribValue() {
|
|
778
729
|
let e = this.getCodeNorm();
|
|
779
|
-
|
|
730
|
+
Yt(e) ? (this.q = e, this.state = 40) : K(e) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
|
|
780
731
|
}
|
|
781
732
|
sAttribValueQuoted() {
|
|
782
733
|
let { q: e, chunk: t } = this, { i: n } = this;
|
|
@@ -787,12 +738,12 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
787
738
|
case 38:
|
|
788
739
|
this.text += t.slice(n, this.prevI), this.state = 14, this.entityReturnState = 40;
|
|
789
740
|
return;
|
|
790
|
-
case
|
|
791
|
-
case
|
|
741
|
+
case Gt:
|
|
742
|
+
case Ut:
|
|
792
743
|
case 9:
|
|
793
744
|
this.text += `${t.slice(n, this.prevI)} `, n = this.i;
|
|
794
745
|
break;
|
|
795
|
-
case
|
|
746
|
+
case Kt:
|
|
796
747
|
this.text += t.slice(n, this.prevI), this.fail("disallowed character.");
|
|
797
748
|
return;
|
|
798
749
|
case q:
|
|
@@ -802,15 +753,15 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
802
753
|
}
|
|
803
754
|
sAttribValueClosed() {
|
|
804
755
|
let e = this.getCodeNorm();
|
|
805
|
-
|
|
756
|
+
K(e) ? this.state = 36 : e === Y ? this.openTag() : e === 47 ? this.state = 35 : jt(e) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
|
|
806
757
|
}
|
|
807
758
|
sAttribValueUnquoted() {
|
|
808
|
-
let e = this.captureTo(
|
|
759
|
+
let e = this.captureTo(en);
|
|
809
760
|
switch (e) {
|
|
810
761
|
case 38:
|
|
811
762
|
this.state = 14, this.entityReturnState = 42;
|
|
812
763
|
break;
|
|
813
|
-
case
|
|
764
|
+
case Kt:
|
|
814
765
|
this.fail("disallowed character.");
|
|
815
766
|
break;
|
|
816
767
|
case q: break;
|
|
@@ -819,7 +770,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
819
770
|
}
|
|
820
771
|
sCloseTag() {
|
|
821
772
|
let e = this.captureNameChars();
|
|
822
|
-
e === Y ? this.closeTag() :
|
|
773
|
+
e === Y ? this.closeTag() : K(e) ? this.state = 44 : e !== q && this.fail("disallowed character in closing tag.");
|
|
823
774
|
}
|
|
824
775
|
sCloseTagSawWhite() {
|
|
825
776
|
switch (this.skipSpaces()) {
|
|
@@ -833,7 +784,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
833
784
|
handleTextInRoot() {
|
|
834
785
|
let { i: e, forbiddenState: t } = this, { chunk: n, textHandler: r } = this;
|
|
835
786
|
t: for (;;) switch (this.getCode()) {
|
|
836
|
-
case
|
|
787
|
+
case Kt:
|
|
837
788
|
if (this.state = 15, r !== void 0) {
|
|
838
789
|
let { text: t } = this, i = n.slice(e, this.prevI);
|
|
839
790
|
t.length === 0 ? i.length !== 0 && r(i) : (r(t + i), this.text = "");
|
|
@@ -843,7 +794,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
843
794
|
case 38:
|
|
844
795
|
this.state = 14, this.entityReturnState = J, r !== void 0 && (this.text += n.slice(e, this.prevI)), t = 0;
|
|
845
796
|
break t;
|
|
846
|
-
case
|
|
797
|
+
case Jt:
|
|
847
798
|
switch (t) {
|
|
848
799
|
case 0:
|
|
849
800
|
t = 1;
|
|
@@ -858,7 +809,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
858
809
|
case Y:
|
|
859
810
|
t === 2 && this.fail("the string \"]]>\" is disallowed in char data."), t = 0;
|
|
860
811
|
break;
|
|
861
|
-
case
|
|
812
|
+
case Ut:
|
|
862
813
|
r !== void 0 && (this.text += `${n.slice(e, this.prevI)}\n`), e = this.i, t = 0;
|
|
863
814
|
break;
|
|
864
815
|
case q:
|
|
@@ -873,7 +824,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
873
824
|
t: for (;;) {
|
|
874
825
|
let i = this.getCode();
|
|
875
826
|
switch (i) {
|
|
876
|
-
case
|
|
827
|
+
case Kt:
|
|
877
828
|
if (this.state = 15, n !== void 0) {
|
|
878
829
|
let { text: r } = this, i = t.slice(e, this.prevI);
|
|
879
830
|
r.length === 0 ? i.length !== 0 && n(i) : (n(r + i), this.text = "");
|
|
@@ -882,13 +833,13 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
882
833
|
case 38:
|
|
883
834
|
this.state = 14, this.entityReturnState = J, n !== void 0 && (this.text += t.slice(e, this.prevI)), r = !0;
|
|
884
835
|
break t;
|
|
885
|
-
case
|
|
836
|
+
case Ut:
|
|
886
837
|
n !== void 0 && (this.text += `${t.slice(e, this.prevI)}\n`), e = this.i;
|
|
887
838
|
break;
|
|
888
839
|
case q:
|
|
889
840
|
n !== void 0 && (this.text += t.slice(e));
|
|
890
841
|
break t;
|
|
891
|
-
default:
|
|
842
|
+
default: K(i) || (r = !0);
|
|
892
843
|
}
|
|
893
844
|
}
|
|
894
845
|
r && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0));
|
|
@@ -902,10 +853,10 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
902
853
|
};
|
|
903
854
|
if (this.attribList.push(i), this.attributeHandler?.(i), n === "xmlns") {
|
|
904
855
|
let e = t.trim();
|
|
905
|
-
this.currentXMLVersion === "1.0" && e === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[r] = e,
|
|
856
|
+
this.currentXMLVersion === "1.0" && e === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[r] = e, tn(this, r, e);
|
|
906
857
|
} else if (e === "xmlns") {
|
|
907
858
|
let e = t.trim();
|
|
908
|
-
this.topNS[""] = e,
|
|
859
|
+
this.topNS[""] = e, tn(this, "", e);
|
|
909
860
|
}
|
|
910
861
|
}
|
|
911
862
|
pushAttribPlain(e, t) {
|
|
@@ -957,7 +908,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
957
908
|
let { attributes: n } = t, r = /* @__PURE__ */ new Set();
|
|
958
909
|
for (let t of e) {
|
|
959
910
|
let { name: e, prefix: i, local: a } = t, o, s;
|
|
960
|
-
i === "" ? (o = e === "xmlns" ?
|
|
911
|
+
i === "" ? (o = e === "xmlns" ? Bt : "", s = e) : (o = this.resolve(i), o === void 0 && (this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`), o = i), s = `{${o}}${a}`), r.has(s) && this.fail(`duplicate attribute: ${s}.`), r.add(s), t.uri = o, n[e] = t;
|
|
961
912
|
}
|
|
962
913
|
this.attribList = [];
|
|
963
914
|
}
|
|
@@ -995,21 +946,21 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
995
946
|
let t = NaN;
|
|
996
947
|
return e[1] === "x" && /^#x[0-9a-f]+$/i.test(e) ? t = parseInt(e.slice(2), 16) : /^#[0-9]+$/.test(e) && (t = parseInt(e.slice(1), 10)), this.isChar(t) ? String.fromCodePoint(t) : (this.fail("malformed character entity."), `&${e};`);
|
|
997
948
|
}
|
|
998
|
-
},
|
|
949
|
+
}, cn = /&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, ln = {
|
|
999
950
|
amp: "&",
|
|
1000
951
|
lt: "<",
|
|
1001
952
|
gt: ">",
|
|
1002
953
|
quot: "\"",
|
|
1003
954
|
apos: "'"
|
|
1004
|
-
},
|
|
1005
|
-
let n =
|
|
955
|
+
}, un = (e, t) => {
|
|
956
|
+
let n = ln[t];
|
|
1006
957
|
if (n !== void 0) return n;
|
|
1007
958
|
let r = t.charCodeAt(1) === 120 ? parseInt(t.slice(2), 16) : parseInt(t.slice(1), 10);
|
|
1008
959
|
return r > 0 && r <= 1114111 ? String.fromCodePoint(r) : e;
|
|
1009
|
-
},
|
|
960
|
+
}, dn = (e) => {
|
|
1010
961
|
let t = e;
|
|
1011
|
-
return t.indexOf("\r") !== -1 && (t = t.replace(/\r\n?/g, "\n")), t.indexOf("&") !== -1 && (t = t.replace(
|
|
1012
|
-
},
|
|
962
|
+
return t.indexOf("\r") !== -1 && (t = t.replace(/\r\n?/g, "\n")), t.indexOf("&") !== -1 && (t = t.replace(cn, un)), t;
|
|
963
|
+
}, fn = (e) => {
|
|
1013
964
|
let t = e, n = t.length;
|
|
1014
965
|
for (let e = 0; e < n; e++) {
|
|
1015
966
|
let n = t.charCodeAt(e);
|
|
@@ -1018,8 +969,8 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
1018
969
|
break;
|
|
1019
970
|
}
|
|
1020
971
|
}
|
|
1021
|
-
return t.indexOf("&") !== -1 && (t = t.replace(
|
|
1022
|
-
},
|
|
972
|
+
return t.indexOf("&") !== -1 && (t = t.replace(cn, un)), t;
|
|
973
|
+
}, pn = (e) => e === 32 || e === 9 || e === 10 || e === 13, mn = class e {
|
|
1023
974
|
constructor() {
|
|
1024
975
|
this._openTagHandler = void 0, this._closeTagHandler = void 0, this._textHandler = void 0, this._cdataHandler = void 0, this._errorHandler = void 0, this._endHandler = void 0, this._scanners = null, this._carry = "", this._text = "", this._tags = [], this._sawRoot = !1, this._closed = !1;
|
|
1025
976
|
}
|
|
@@ -1030,7 +981,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
1030
981
|
this.NOT_HANDLED = -2;
|
|
1031
982
|
}
|
|
1032
983
|
static decodeText(e) {
|
|
1033
|
-
return
|
|
984
|
+
return dn(e);
|
|
1034
985
|
}
|
|
1035
986
|
on(e, t) {
|
|
1036
987
|
switch (e) {
|
|
@@ -1096,7 +1047,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
1096
1047
|
if (e.length === 0) return;
|
|
1097
1048
|
this._text = "";
|
|
1098
1049
|
let t = this._textHandler;
|
|
1099
|
-
t !== void 0 && this._tags.length !== 0 && t(
|
|
1050
|
+
t !== void 0 && this._tags.length !== 0 && t(dn(e));
|
|
1100
1051
|
}
|
|
1101
1052
|
_markup(t, n, r) {
|
|
1102
1053
|
if (n + 1 >= r) return -1;
|
|
@@ -1135,7 +1086,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
1135
1086
|
let i = n + 1 + o.name.length;
|
|
1136
1087
|
if (i >= r) return -1;
|
|
1137
1088
|
let a = t.charCodeAt(i);
|
|
1138
|
-
if (a === 62 || a === 47 ||
|
|
1089
|
+
if (a === 62 || a === 47 || pn(a)) {
|
|
1139
1090
|
this._flushText();
|
|
1140
1091
|
let i = o.scan(t, n, r);
|
|
1141
1092
|
if (i !== e.NOT_HANDLED) {
|
|
@@ -1153,11 +1104,11 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
1153
1104
|
}
|
|
1154
1105
|
_openTag(e, t, n) {
|
|
1155
1106
|
let r = t + 1, i = 0;
|
|
1156
|
-
for (; r < n && (i = e.charCodeAt(r), i !== 62 && i !== 47 && !
|
|
1107
|
+
for (; r < n && (i = e.charCodeAt(r), i !== 62 && i !== 47 && !pn(i));) r++;
|
|
1157
1108
|
if (r >= n) return -1;
|
|
1158
1109
|
let a = e.slice(t + 1, r), o = {}, s = !1;
|
|
1159
1110
|
for (;;) {
|
|
1160
|
-
for (; r < n &&
|
|
1111
|
+
for (; r < n && pn(i = e.charCodeAt(r));) r++;
|
|
1161
1112
|
if (r >= n) return -1;
|
|
1162
1113
|
if (i === 62) {
|
|
1163
1114
|
r++;
|
|
@@ -1173,16 +1124,16 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
1173
1124
|
break;
|
|
1174
1125
|
}
|
|
1175
1126
|
let t = r;
|
|
1176
|
-
for (; r < n && (i = e.charCodeAt(r), i !== 61 && i !== 62 && i !== 47 && !
|
|
1127
|
+
for (; r < n && (i = e.charCodeAt(r), i !== 61 && i !== 62 && i !== 47 && !pn(i));) r++;
|
|
1177
1128
|
if (r >= n) return -1;
|
|
1178
1129
|
let a = e.slice(t, r);
|
|
1179
|
-
for (; r < n &&
|
|
1130
|
+
for (; r < n && pn(i = e.charCodeAt(r));) r++;
|
|
1180
1131
|
if (r >= n) return -1;
|
|
1181
1132
|
if (i !== 61) {
|
|
1182
1133
|
this.fail("attribute without value.");
|
|
1183
1134
|
continue;
|
|
1184
1135
|
}
|
|
1185
|
-
for (r++; r < n &&
|
|
1136
|
+
for (r++; r < n && pn(i = e.charCodeAt(r));) r++;
|
|
1186
1137
|
if (r >= n) return -1;
|
|
1187
1138
|
if (i !== 34 && i !== 39) {
|
|
1188
1139
|
this.fail("unquoted attribute value.");
|
|
@@ -1190,7 +1141,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
1190
1141
|
}
|
|
1191
1142
|
let c = e.indexOf(i === 34 ? "\"" : "'", r + 1);
|
|
1192
1143
|
if (c === -1) return -1;
|
|
1193
|
-
a !== "__proto__" && (o[a] =
|
|
1144
|
+
a !== "__proto__" && (o[a] = fn(e.slice(r + 1, c))), r = c + 1;
|
|
1194
1145
|
}
|
|
1195
1146
|
this._flushText(), this._sawRoot = !0;
|
|
1196
1147
|
let c = {
|
|
@@ -1228,7 +1179,7 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
1228
1179
|
Ready: "ready"
|
|
1229
1180
|
}, e.parseStream = async (e, t, n) => {
|
|
1230
1181
|
if (n?.lean) return (async (e, t) => {
|
|
1231
|
-
let n = new
|
|
1182
|
+
let n = new mn(), r;
|
|
1232
1183
|
t.elementScanners && n.setElementScanners(t.elementScanners), t.onOpenTag && n.on("opentag", t.onOpenTag), t.onCloseTag && n.on("closetag", t.onCloseTag), t.onText && n.on("text", t.onText), t.onError && n.on("error", t.onError);
|
|
1233
1184
|
let i = t.onEnd;
|
|
1234
1185
|
for (i && n.on("end", () => {
|
|
@@ -1240,13 +1191,13 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
1240
1191
|
}
|
|
1241
1192
|
return n.close(), r;
|
|
1242
1193
|
})(e, t);
|
|
1243
|
-
let r = new
|
|
1194
|
+
let r = new sn({
|
|
1244
1195
|
position: !1,
|
|
1245
1196
|
...n
|
|
1246
1197
|
}), i;
|
|
1247
|
-
t.onOpenTagStart && r.on(
|
|
1198
|
+
t.onOpenTagStart && r.on(nn.Events.OpenTagStart, t.onOpenTagStart), t.onOpenTag && r.on(nn.Events.OpenTag, t.onOpenTag), t.onCloseTag && r.on(nn.Events.CloseTag, t.onCloseTag), t.onAttribute && r.on(nn.Events.Attribute, t.onAttribute), t.onText && r.on(nn.Events.Text, t.onText), t.onError && r.on(nn.Events.Error, t.onError);
|
|
1248
1199
|
let a = t.onEnd;
|
|
1249
|
-
for (a && r.on(
|
|
1200
|
+
for (a && r.on(nn.Events.End, () => {
|
|
1250
1201
|
i = a();
|
|
1251
1202
|
});;) {
|
|
1252
1203
|
let { value: t, done: n } = await e.read();
|
|
@@ -1255,14 +1206,14 @@ var yt, bt = (e) => tt.test(e), xt = (e) => Qe.test(e), St = {
|
|
|
1255
1206
|
}
|
|
1256
1207
|
return r.close(), i;
|
|
1257
1208
|
};
|
|
1258
|
-
})(
|
|
1209
|
+
})(nn ||= {});
|
|
1259
1210
|
var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null, Q = (e) => {
|
|
1260
1211
|
let t = parseInt(e);
|
|
1261
1212
|
return isNaN(t) ? null : t;
|
|
1262
|
-
},
|
|
1213
|
+
}, hn = (e) => {
|
|
1263
1214
|
let t = parseFloat(e);
|
|
1264
1215
|
return isNaN(t) ? null : t;
|
|
1265
|
-
}, $ = null,
|
|
1216
|
+
}, $ = null, gn = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), _n = (e) => gn(e).replace(/"/g, """), vn = class {
|
|
1266
1217
|
constructor() {
|
|
1267
1218
|
this._registeredVisitors = /* @__PURE__ */ new Map();
|
|
1268
1219
|
}
|
|
@@ -1274,7 +1225,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1274
1225
|
key: null,
|
|
1275
1226
|
source: e,
|
|
1276
1227
|
parent: null
|
|
1277
|
-
}, f = null, p = !1, m = null,
|
|
1228
|
+
}, f = null, p = !1, m = null, h = null, g = null, _ = (e, t) => {
|
|
1278
1229
|
let n = c.attributes[e];
|
|
1279
1230
|
if (t) {
|
|
1280
1231
|
if (Array.isArray(t)) {
|
|
@@ -1283,7 +1234,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1283
1234
|
} else if (n == null || (n = t(n), n == null)) return;
|
|
1284
1235
|
}
|
|
1285
1236
|
return n;
|
|
1286
|
-
},
|
|
1237
|
+
}, v = {
|
|
1287
1238
|
getSource: () => f?.source ?? null,
|
|
1288
1239
|
setSource: (e) => {
|
|
1289
1240
|
f.source = e;
|
|
@@ -1292,8 +1243,8 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1292
1243
|
f.key = e;
|
|
1293
1244
|
},
|
|
1294
1245
|
getFrom: () => c,
|
|
1295
|
-
getAttribute: (e, t) =>
|
|
1296
|
-
hasAttribute: (e) =>
|
|
1246
|
+
getAttribute: (e, t) => _(e, t) ?? null,
|
|
1247
|
+
hasAttribute: (e) => v.getAttribute(e) !== null,
|
|
1297
1248
|
getParent: () => {
|
|
1298
1249
|
let e = u[u.length - 2];
|
|
1299
1250
|
return e.parent ?? e.source;
|
|
@@ -1303,14 +1254,14 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1303
1254
|
for (let n = 0; n < t; n++) e.push(a[n].local);
|
|
1304
1255
|
return e.join("\\");
|
|
1305
1256
|
},
|
|
1306
|
-
parseAttribute:
|
|
1307
|
-
getRawXml: () =>
|
|
1257
|
+
parseAttribute: _,
|
|
1258
|
+
getRawXml: () => g,
|
|
1308
1259
|
copyToObject: (e, t, n, r) => {
|
|
1309
|
-
let i =
|
|
1260
|
+
let i = _(r ?? t, n);
|
|
1310
1261
|
i !== void 0 && (e[t] = i);
|
|
1311
1262
|
},
|
|
1312
1263
|
copyTo: (e, t, n) => {
|
|
1313
|
-
let r =
|
|
1264
|
+
let r = _(n ?? e, t);
|
|
1314
1265
|
r !== void 0 && (f.source[e] = r);
|
|
1315
1266
|
},
|
|
1316
1267
|
warn: (e, t) => {
|
|
@@ -1324,7 +1275,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1324
1275
|
let t = e.attributes ?? {}, n = `<${e.name}`;
|
|
1325
1276
|
for (let e in t) {
|
|
1326
1277
|
let r = t[e];
|
|
1327
|
-
n += ` ${e}="${
|
|
1278
|
+
n += ` ${e}="${_n(typeof r == "string" ? r : r?.value ?? "")}"`;
|
|
1328
1279
|
}
|
|
1329
1280
|
return n + ">";
|
|
1330
1281
|
})(e)), o = {
|
|
@@ -1332,53 +1283,53 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1332
1283
|
tag: e,
|
|
1333
1284
|
destination: null
|
|
1334
1285
|
}, a.push(o), s = t, void (c = e);
|
|
1335
|
-
let
|
|
1286
|
+
let g = (i.length > 0 ? i[i.length - 1] : r).get(t);
|
|
1336
1287
|
if (o = {
|
|
1337
1288
|
local: t,
|
|
1338
|
-
visitor:
|
|
1289
|
+
visitor: g,
|
|
1339
1290
|
tag: e,
|
|
1340
1291
|
destination: null
|
|
1341
1292
|
}, p) return a.push(o), s = t, void (c = e);
|
|
1342
1293
|
l = o?.visitor ?? null, s = t, c = e;
|
|
1343
|
-
let
|
|
1344
|
-
if (
|
|
1345
|
-
let e =
|
|
1346
|
-
e === null ?
|
|
1294
|
+
let _ = !!g && g.to === null;
|
|
1295
|
+
if (g && !_ && g.scope) {
|
|
1296
|
+
let e = g.scope(v);
|
|
1297
|
+
e === null ? _ = !0 : e && (i.push(e), o.pushedScope = !0);
|
|
1347
1298
|
}
|
|
1348
|
-
|
|
1299
|
+
g && (a.length === 0 ? (f = d, o.destination = f, o.pushedDestination = !0, u.push(f)) : _ ? (f = null, o.destination = null) : g.transparent ? o.destination = f : (f = {
|
|
1349
1300
|
key: null,
|
|
1350
1301
|
source: {},
|
|
1351
1302
|
parent: null
|
|
1352
|
-
}, o.destination = f, o.pushedDestination = !0, u.push(f))), a.push(o), p =
|
|
1353
|
-
let
|
|
1354
|
-
|
|
1303
|
+
}, o.destination = f, o.pushedDestination = !0, u.push(f))), a.push(o), p = _;
|
|
1304
|
+
let y = l?.openTag?.(v);
|
|
1305
|
+
y !== void 0 && (f.parent = y), g?.raw && !_ && (m = [], h = o);
|
|
1355
1306
|
},
|
|
1356
1307
|
onCloseTag: (e) => {
|
|
1357
1308
|
let t = e.name, r = t.indexOf(":");
|
|
1358
1309
|
if (r !== -1 && (t = t.slice(r + 1)), t !== s) throw Error(`mismatch open/close tag: '${t}'/'${s}'`);
|
|
1359
|
-
let
|
|
1310
|
+
let _ = !1;
|
|
1360
1311
|
if (m) {
|
|
1361
|
-
if (a[a.length - 1] !==
|
|
1362
|
-
|
|
1312
|
+
if (a[a.length - 1] !== h) return m.push(`</${e.name}>`), a.pop(), o = a[a.length - 1] ?? null, s = o?.local ?? null, void (c = o?.tag ?? null);
|
|
1313
|
+
g = m.join(""), m = null, h = null, _ = !0;
|
|
1363
1314
|
}
|
|
1364
|
-
p || l?.closeTag?.(
|
|
1365
|
-
let
|
|
1366
|
-
o = a[a.length - 1] ?? null,
|
|
1367
|
-
let
|
|
1368
|
-
if (
|
|
1315
|
+
p || l?.closeTag?.(v), _ && (g = null);
|
|
1316
|
+
let y = a.pop() ?? null;
|
|
1317
|
+
o = a[a.length - 1] ?? null, y?.pushedScope && i.pop();
|
|
1318
|
+
let b = y?.destination;
|
|
1319
|
+
if (b && y.pushedDestination) {
|
|
1369
1320
|
u.pop(), f = u[u.length - 1] ?? d;
|
|
1370
|
-
let e =
|
|
1371
|
-
e && e.to &&
|
|
1372
|
-
} else
|
|
1321
|
+
let e = y.visitor;
|
|
1322
|
+
e && e.to && b.source !== void 0 && (Array.isArray(e.to) ? f.source.push ? f.source.push(b.source) : n?.(`Unable to parse array for ${e.from} at ${v.getPath()}`) : b.key ? f.source[b.key] = b.source : typeof e.to == "string" && (f.source[e.to] = b.source));
|
|
1323
|
+
} else b || (f = u[u.length - 1] ?? d);
|
|
1373
1324
|
s = o?.local ?? null, c = o?.tag ?? null, l = o?.visitor ?? null, p = !o?.destination;
|
|
1374
1325
|
},
|
|
1375
1326
|
onText: (e) => {
|
|
1376
|
-
m ? m.push(
|
|
1327
|
+
m ? m.push(gn(e)) : l?.text?.(e, v);
|
|
1377
1328
|
},
|
|
1378
1329
|
onEnd: t
|
|
1379
1330
|
};
|
|
1380
1331
|
}
|
|
1381
|
-
},
|
|
1332
|
+
}, yn = `IFERROR(${re}(`, bn = yn.toUpperCase(), xn = r.toUpperCase(), Sn = { kind: "none" }, Cn = { kind: "spilled" }, wn = (e, t) => {
|
|
1382
1333
|
if (e.charCodeAt(t) !== 34) return null;
|
|
1383
1334
|
let n = "", r = t + 1;
|
|
1384
1335
|
for (; r < e.length;) if (e.charCodeAt(r) === 34) {
|
|
@@ -1389,12 +1340,12 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1389
1340
|
n += "\"", r += 2;
|
|
1390
1341
|
} else n += e[r], r++;
|
|
1391
1342
|
return null;
|
|
1392
|
-
},
|
|
1343
|
+
}, Tn = (e) => {
|
|
1393
1344
|
let t = [], n = 0;
|
|
1394
1345
|
for (; n < e.length;) {
|
|
1395
1346
|
let r = e.charCodeAt(n);
|
|
1396
1347
|
if (r === 34) {
|
|
1397
|
-
let t =
|
|
1348
|
+
let t = wn(e, n);
|
|
1398
1349
|
if (t === null) break;
|
|
1399
1350
|
n = t.end;
|
|
1400
1351
|
continue;
|
|
@@ -1412,7 +1363,196 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1412
1363
|
e.charCodeAt(i) === 40 && t.push(e.slice(n, i).toUpperCase().replace(/^_XLFN\./, "").replace(/^_XLWS\./, "")), n = i;
|
|
1413
1364
|
}
|
|
1414
1365
|
return t;
|
|
1415
|
-
},
|
|
1366
|
+
}, En = /^\s*TABLE\s*\(([^()]*)\)\s*$/i, Dn = /^\s*(\$?)([A-Za-z]{1,3})(\$?)(\d{1,7})\s*$/, On = (e) => {
|
|
1367
|
+
let t = Dn.exec(e);
|
|
1368
|
+
if (!t) return null;
|
|
1369
|
+
let n = R.fastStringToCol(t[2]), r = parseInt(t[4], 10) - 1;
|
|
1370
|
+
return n < 0 || r < 0 ? null : {
|
|
1371
|
+
row: r,
|
|
1372
|
+
col: n,
|
|
1373
|
+
colAbsolute: t[1] === "$",
|
|
1374
|
+
rowAbsolute: t[3] === "$"
|
|
1375
|
+
};
|
|
1376
|
+
}, kn = (e) => R.cellToString({
|
|
1377
|
+
rowIndex: e.row,
|
|
1378
|
+
colIndex: e.col
|
|
1379
|
+
}), An = (e, t) => {
|
|
1380
|
+
let n = En.exec(e);
|
|
1381
|
+
if (!n) return null;
|
|
1382
|
+
let r = n[1].split(",");
|
|
1383
|
+
if (r.length !== 3 && r.length !== 5) return null;
|
|
1384
|
+
let i = [];
|
|
1385
|
+
for (let e = 0; e < r.length; e++) {
|
|
1386
|
+
let t = On(r[e]);
|
|
1387
|
+
if (!t) return null;
|
|
1388
|
+
i.push(t);
|
|
1389
|
+
}
|
|
1390
|
+
let a = t.rowStart, o = t.colStart, s = (e) => e.colAbsolute && !e.rowAbsolute && e.col === o - 1 && e.row === a, c = (e) => e.rowAbsolute && !e.colAbsolute && e.row === a - 1 && e.col === o, l = {
|
|
1391
|
+
rowStart: a,
|
|
1392
|
+
colStart: o,
|
|
1393
|
+
rowEnd: t.rowEnd,
|
|
1394
|
+
colEnd: t.colEnd
|
|
1395
|
+
}, u = i[0];
|
|
1396
|
+
if (i.length === 3) {
|
|
1397
|
+
let [, e, t] = i;
|
|
1398
|
+
return s(t) && c(u) ? {
|
|
1399
|
+
ref: l,
|
|
1400
|
+
columnInput: kn(e)
|
|
1401
|
+
} : c(t) && s(u) ? {
|
|
1402
|
+
ref: l,
|
|
1403
|
+
rowInput: kn(e)
|
|
1404
|
+
} : null;
|
|
1405
|
+
}
|
|
1406
|
+
if (!u.rowAbsolute || !u.colAbsolute || u.row !== a - 1 || u.col !== o - 1) return null;
|
|
1407
|
+
let [, d, f, p, m] = i;
|
|
1408
|
+
return s(f) && c(m) ? {
|
|
1409
|
+
ref: l,
|
|
1410
|
+
rowInput: kn(p),
|
|
1411
|
+
columnInput: kn(d)
|
|
1412
|
+
} : c(f) && s(m) ? {
|
|
1413
|
+
ref: l,
|
|
1414
|
+
rowInput: kn(d),
|
|
1415
|
+
columnInput: kn(p)
|
|
1416
|
+
} : null;
|
|
1417
|
+
}, jn = /^(?:(\d{4})-(\d{2})-(\d{2}))?T?(?:(\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?)?(?:Z|[+-]\d{2}:?\d{2})?$/, Mn = /^PT(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?$/, Nn = (e, t, n) => {
|
|
1418
|
+
let r = Math.floor((14 - t) / 12), i = e + 4800 - r, a = t + 12 * r - 3;
|
|
1419
|
+
return n + Math.floor((153 * a + 2) / 5) + 365 * i + Math.floor(i / 4) - Math.floor(i / 100) + Math.floor(i / 400) - 32045;
|
|
1420
|
+
}, Pn = Nn(1899, 12, 30), Fn = (e) => {
|
|
1421
|
+
let t = e.indexOf(":");
|
|
1422
|
+
return t === -1 ? e : e.slice(t + 1);
|
|
1423
|
+
}, In = class {
|
|
1424
|
+
constructor() {
|
|
1425
|
+
this._runs = null, this._text = "", this._font = null, this._inRun = !1, this._inRPr = !1;
|
|
1426
|
+
}
|
|
1427
|
+
reset() {
|
|
1428
|
+
this._runs = null, this._inRun = !1, this._inRPr = !1;
|
|
1429
|
+
}
|
|
1430
|
+
onOpenTag(e, t) {
|
|
1431
|
+
e === "r" ? (this._inRun = !0, this._text = "", this._font = null, this._runs ??= []) : e === "rPr" ? this._inRun && (this._inRPr = !0) : this._inRPr && function(e, t, n) {
|
|
1432
|
+
switch (e) {
|
|
1433
|
+
case "b":
|
|
1434
|
+
n.weight = zn(t) ? 700 : 400;
|
|
1435
|
+
break;
|
|
1436
|
+
case "i":
|
|
1437
|
+
n.style = zn(t) ? We.Style.Italic : We.Style.Normal;
|
|
1438
|
+
break;
|
|
1439
|
+
case "strike":
|
|
1440
|
+
n.strike = o(zn(t));
|
|
1441
|
+
break;
|
|
1442
|
+
case "outline":
|
|
1443
|
+
n.outline = zn(t);
|
|
1444
|
+
break;
|
|
1445
|
+
case "shadow":
|
|
1446
|
+
n.shadow = zn(t);
|
|
1447
|
+
break;
|
|
1448
|
+
case "condense":
|
|
1449
|
+
case "extend": {
|
|
1450
|
+
let r = c(e, zn(t));
|
|
1451
|
+
r !== void 0 && (n.letterSpacing = r);
|
|
1452
|
+
break;
|
|
1453
|
+
}
|
|
1454
|
+
case "u":
|
|
1455
|
+
n.underline = _(t.val);
|
|
1456
|
+
break;
|
|
1457
|
+
case "vertAlign": {
|
|
1458
|
+
let e = je(t.val);
|
|
1459
|
+
e !== void 0 && (n.baseline = e);
|
|
1460
|
+
break;
|
|
1461
|
+
}
|
|
1462
|
+
case "sz": {
|
|
1463
|
+
let e = parseFloat(t.val ?? "");
|
|
1464
|
+
isNaN(e) || (n.size = e);
|
|
1465
|
+
break;
|
|
1466
|
+
}
|
|
1467
|
+
case "rFont": {
|
|
1468
|
+
let e = t.val;
|
|
1469
|
+
e && (n.family = e);
|
|
1470
|
+
break;
|
|
1471
|
+
}
|
|
1472
|
+
case "family": {
|
|
1473
|
+
let e = Rn[t.val ?? ""];
|
|
1474
|
+
e && (n.fallbacks = [e]);
|
|
1475
|
+
break;
|
|
1476
|
+
}
|
|
1477
|
+
case "charset": {
|
|
1478
|
+
let e = parseInt(t.val ?? "", 10);
|
|
1479
|
+
isNaN(e) || (n.charset = e);
|
|
1480
|
+
break;
|
|
1481
|
+
}
|
|
1482
|
+
case "scheme":
|
|
1483
|
+
ne(n, t.val);
|
|
1484
|
+
break;
|
|
1485
|
+
case "color": {
|
|
1486
|
+
let e = t.rgb;
|
|
1487
|
+
if (e && t.theme === void 0) {
|
|
1488
|
+
n.color = "#" + (e.length === 8 ? e.substring(2) : e).toUpperCase();
|
|
1489
|
+
break;
|
|
1490
|
+
}
|
|
1491
|
+
let r = Fe((e) => t[e]);
|
|
1492
|
+
r && (n.color = r);
|
|
1493
|
+
break;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
}(e, t, this._font ??= {});
|
|
1497
|
+
}
|
|
1498
|
+
onText(e) {
|
|
1499
|
+
this._inRun && (this._text += e);
|
|
1500
|
+
}
|
|
1501
|
+
onCloseTag(e) {
|
|
1502
|
+
if (e === "rPr") this._inRPr = !1, this._font ??= {};
|
|
1503
|
+
else if (e === "r" && this._inRun) {
|
|
1504
|
+
let e = ae(this._text), t = this._font;
|
|
1505
|
+
this._runs.push(t ? {
|
|
1506
|
+
text: e,
|
|
1507
|
+
font: t
|
|
1508
|
+
} : { text: e }), this._inRun = !1;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
take() {
|
|
1512
|
+
let e = this._runs;
|
|
1513
|
+
if (this.reset(), !e) return null;
|
|
1514
|
+
for (let t = 0; t < e.length; t++) if (e[t].font) return e;
|
|
1515
|
+
return null;
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
function Ln(e, t) {
|
|
1519
|
+
let n = {
|
|
1520
|
+
family: "Calibri",
|
|
1521
|
+
size: 11,
|
|
1522
|
+
...t,
|
|
1523
|
+
weight: 400,
|
|
1524
|
+
style: We.Style.Normal,
|
|
1525
|
+
underline: We.UnderlineStyle.None,
|
|
1526
|
+
strike: We.StrikeStyle.None,
|
|
1527
|
+
baseline: 0
|
|
1528
|
+
}, r = Array(e.length);
|
|
1529
|
+
for (let t = 0; t < e.length; t++) {
|
|
1530
|
+
let i = e[t];
|
|
1531
|
+
if (!i.font) {
|
|
1532
|
+
r[t] = i;
|
|
1533
|
+
continue;
|
|
1534
|
+
}
|
|
1535
|
+
let a = {
|
|
1536
|
+
...n,
|
|
1537
|
+
...i.font
|
|
1538
|
+
};
|
|
1539
|
+
r[t] = {
|
|
1540
|
+
text: i.text,
|
|
1541
|
+
font: a
|
|
1542
|
+
};
|
|
1543
|
+
}
|
|
1544
|
+
return r;
|
|
1545
|
+
}
|
|
1546
|
+
var Rn = {
|
|
1547
|
+
1: "serif",
|
|
1548
|
+
2: "sans-serif",
|
|
1549
|
+
3: "monospace",
|
|
1550
|
+
4: "cursive",
|
|
1551
|
+
5: "fantasy"
|
|
1552
|
+
}, zn = (e) => {
|
|
1553
|
+
let t = e.val;
|
|
1554
|
+
return t === void 0 || t === "1" || t === "true";
|
|
1555
|
+
}, Bn = (e) => {
|
|
1416
1556
|
let t = (t) => {
|
|
1417
1557
|
if (e) return RegExp(`<(?:[\\w.-]+:)?${t}\\b[^>]*>([^<]*)<`).exec(e)?.[1];
|
|
1418
1558
|
}, n = (e) => {
|
|
@@ -1422,16 +1562,19 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1422
1562
|
return {
|
|
1423
1563
|
c: n(t("col")),
|
|
1424
1564
|
r: n(t("row")),
|
|
1425
|
-
x:
|
|
1426
|
-
y:
|
|
1565
|
+
x: P(t("colOff") ?? "0") ?? 0,
|
|
1566
|
+
y: P(t("rowOff") ?? "0") ?? 0
|
|
1427
1567
|
};
|
|
1428
|
-
},
|
|
1429
|
-
let
|
|
1430
|
-
|
|
1568
|
+
}, Vn = "formulaDialect", Hn = "date1904", Un = "richStrings", Wn = "defaultFont", Gn = (e, t, n, r, i, o, c, u) => {
|
|
1569
|
+
let h = new vn(), _ = (e) => {
|
|
1570
|
+
let t = e.getAttribute("dxfId", Q);
|
|
1571
|
+
return t === null ? void 0 : r?.get(t) || (o?.(`A color filter or sort names a format that does not exist (dxfId '${t}').`), {});
|
|
1572
|
+
}, x = !1, ne = u?.get("parseInlineDxf"), re = u?.get(Vn), oe = (e) => re && e ? re.readDetached(e) : e, se = new Qe.TransposedBuilder(), S = null, w = "topLeft";
|
|
1573
|
+
h.registerVisitor({
|
|
1431
1574
|
from: "autoFilter",
|
|
1432
1575
|
to: "autoTable",
|
|
1433
1576
|
openTag: (e) => {
|
|
1434
|
-
let t = e.getAttribute("ref"), n =
|
|
1577
|
+
let t = e.getAttribute("ref"), n = R.fastStringToRange(t);
|
|
1435
1578
|
e.getSource().r = n, e.getSource().v = {};
|
|
1436
1579
|
},
|
|
1437
1580
|
closeTag: (e) => {
|
|
@@ -1441,7 +1584,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1441
1584
|
e === 0 ? n.hiddenButtons = !1 : e === a && (n.hiddenButtons = !0);
|
|
1442
1585
|
}
|
|
1443
1586
|
}
|
|
1444
|
-
}),
|
|
1587
|
+
}), h.registerVisitor({
|
|
1445
1588
|
from: "conditionalFormatting",
|
|
1446
1589
|
to: {},
|
|
1447
1590
|
openTag: (e) => {
|
|
@@ -1455,7 +1598,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1455
1598
|
}, i = e.getAttribute("pivot", Z);
|
|
1456
1599
|
i !== null && (r.pivot = i), e.setSource(r);
|
|
1457
1600
|
}
|
|
1458
|
-
}),
|
|
1601
|
+
}), h.registerVisitor({
|
|
1459
1602
|
from: "cfRule",
|
|
1460
1603
|
to: {},
|
|
1461
1604
|
openTag: (e) => {
|
|
@@ -1467,10 +1610,10 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1467
1610
|
v: null,
|
|
1468
1611
|
rule: n
|
|
1469
1612
|
}), e.copyToObject(n, "type", $), e.copyToObject(n, "priority", Q), e.copyToObject(n, "stopIfTrue", Z);
|
|
1470
|
-
let
|
|
1471
|
-
if (
|
|
1472
|
-
let t =
|
|
1473
|
-
t ||= (o?.(`Unable to load conditional color. Invalid dxfI: '${
|
|
1613
|
+
let i = e.getAttribute("dxfId", Q);
|
|
1614
|
+
if (i !== null) {
|
|
1615
|
+
let t = r?.get(i);
|
|
1616
|
+
t ||= (o?.(`Unable to load conditional color. Invalid dxfI: '${i}' at '${e.getPath()}'.`), {}), n.style = t;
|
|
1474
1617
|
}
|
|
1475
1618
|
e.copyToObject(n, "aboveAverage", Z), e.copyToObject(n, "equalAverage", Z), e.copyToObject(n, "stdDev", Q), e.copyToObject(n, "bottom", Z), e.copyToObject(n, "percent", Z), e.copyToObject(n, "rank", Q), e.copyToObject(n, "operator", $), e.copyToObject(n, "text", $), e.copyToObject(n, "timePeriod", $);
|
|
1476
1619
|
},
|
|
@@ -1479,11 +1622,11 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1479
1622
|
if (!t?.r) return;
|
|
1480
1623
|
let n = t.conditionals[t.conditionals.length - 1], r = n?.rule;
|
|
1481
1624
|
if (!r) return;
|
|
1482
|
-
let i = {}, a =
|
|
1625
|
+
let i = {}, a = ue(r, o);
|
|
1483
1626
|
a && (i.condition = a), r.style && (i.style = r.style), r.scale && (i.scale = r.scale), r.stopIfTrue && (i.stopIfTrue = !0), r.pivot && (i.pivot = !0), n.v = i, n.priority = r.priority, r.x14Id && (n.x14Id = r.x14Id), delete n.rule;
|
|
1484
1627
|
}
|
|
1485
1628
|
});
|
|
1486
|
-
let
|
|
1629
|
+
let ce = (e) => {
|
|
1487
1630
|
let t = e.conditions ?? [], n = [];
|
|
1488
1631
|
for (let e = 0; e < t.length; e++) {
|
|
1489
1632
|
let r = t[e], i = {};
|
|
@@ -1491,19 +1634,19 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1491
1634
|
}
|
|
1492
1635
|
return n;
|
|
1493
1636
|
};
|
|
1494
|
-
|
|
1637
|
+
h.registerVisitor({
|
|
1495
1638
|
from: "colorScale",
|
|
1496
1639
|
to: {},
|
|
1497
1640
|
openTag: (e) => {},
|
|
1498
1641
|
closeTag: (e) => {
|
|
1499
|
-
let t = e.getSource(), n = t.colors ?? [], r =
|
|
1642
|
+
let t = e.getSource(), n = t.colors ?? [], r = ce(t);
|
|
1500
1643
|
for (let e = 0; e < r.length; e++) r[e].color = n[e];
|
|
1501
1644
|
e.getParent().scale = {
|
|
1502
|
-
type:
|
|
1645
|
+
type: H.ScaleType.ColorScale,
|
|
1503
1646
|
stops: r
|
|
1504
1647
|
};
|
|
1505
1648
|
}
|
|
1506
|
-
}),
|
|
1649
|
+
}), h.registerVisitor({
|
|
1507
1650
|
from: "dataBar",
|
|
1508
1651
|
to: {},
|
|
1509
1652
|
openTag: (e) => {
|
|
@@ -1511,12 +1654,12 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1511
1654
|
},
|
|
1512
1655
|
closeTag: (e) => {
|
|
1513
1656
|
let t = e.getSource(), n = {
|
|
1514
|
-
type:
|
|
1515
|
-
stops:
|
|
1657
|
+
type: H.ScaleType.DataBar,
|
|
1658
|
+
stops: ce(t)
|
|
1516
1659
|
}, r = t.colors?.[0];
|
|
1517
1660
|
r && (n.color = r), t.minLength !== void 0 && (n.minLength = t.minLength), t.maxLength !== void 0 && (n.maxLength = t.maxLength), t.showValue !== void 0 && (n.showValue = t.showValue), e.getParent().scale = n;
|
|
1518
1661
|
}
|
|
1519
|
-
}),
|
|
1662
|
+
}), h.registerVisitor({
|
|
1520
1663
|
from: "iconSet",
|
|
1521
1664
|
to: {},
|
|
1522
1665
|
openTag: (e) => {
|
|
@@ -1524,41 +1667,41 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1524
1667
|
},
|
|
1525
1668
|
closeTag: (e) => {
|
|
1526
1669
|
let t = e.getSource(), n = {
|
|
1527
|
-
type:
|
|
1528
|
-
stops:
|
|
1670
|
+
type: H.ScaleType.IconSet,
|
|
1671
|
+
stops: ce(t)
|
|
1529
1672
|
};
|
|
1530
1673
|
t.iconSet !== void 0 && (n.iconSet = t.iconSet), t.reverse !== void 0 && (n.reverse = t.reverse), t.showValue !== void 0 && (n.showValue = t.showValue), e.getParent().scale = n;
|
|
1531
1674
|
}
|
|
1532
|
-
}),
|
|
1675
|
+
}), h.registerVisitor({
|
|
1533
1676
|
from: "formula",
|
|
1534
1677
|
to: {},
|
|
1535
1678
|
text: (e, t) => {
|
|
1536
1679
|
let n = t.getParent(), r = n.formulas;
|
|
1537
|
-
r || (r = [], n.formulas = r), r.push(
|
|
1680
|
+
r || (r = [], n.formulas = r), r.push(oe(e));
|
|
1538
1681
|
}
|
|
1539
|
-
}),
|
|
1682
|
+
}), h.registerVisitor({
|
|
1540
1683
|
from: "cfvo",
|
|
1541
1684
|
to: {},
|
|
1542
1685
|
openTag: (e) => {
|
|
1543
1686
|
let t = e.getParent();
|
|
1544
1687
|
t.conditions ||= [];
|
|
1545
1688
|
let n = e.getSource();
|
|
1546
|
-
if (t.conditions.push(n), e.copyTo("type", $), n.type ===
|
|
1689
|
+
if (t.conditions.push(n), e.copyTo("type", $), n.type === H.ColorStopType.Formula) {
|
|
1547
1690
|
let t = e.getAttribute("val");
|
|
1548
|
-
t != null && (n.value =
|
|
1549
|
-
} else e.copyTo("value",
|
|
1691
|
+
t != null && (n.value = oe(String(t)));
|
|
1692
|
+
} else e.copyTo("value", hn, "val");
|
|
1550
1693
|
!1 === e.getAttribute("gte", Z) && (n.exclusive = !0);
|
|
1551
1694
|
}
|
|
1552
|
-
}),
|
|
1695
|
+
}), h.registerVisitor({
|
|
1553
1696
|
from: "color",
|
|
1554
1697
|
to: {},
|
|
1555
1698
|
openTag: (e) => {
|
|
1556
1699
|
let t = e.getParent();
|
|
1557
1700
|
t.colors ||= [];
|
|
1558
|
-
let n =
|
|
1701
|
+
let n = Fe((t) => e.getAttribute(t));
|
|
1559
1702
|
t.colors.push(n);
|
|
1560
1703
|
}
|
|
1561
|
-
}),
|
|
1704
|
+
}), h.registerVisitor({
|
|
1562
1705
|
from: "filterColumn",
|
|
1563
1706
|
to: {},
|
|
1564
1707
|
openTag: (e) => {
|
|
@@ -1577,48 +1720,50 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1577
1720
|
}
|
|
1578
1721
|
return r;
|
|
1579
1722
|
}
|
|
1580
|
-
}),
|
|
1723
|
+
}), h.registerVisitor({
|
|
1581
1724
|
from: "colorFilter",
|
|
1582
1725
|
openTag: (e) => {
|
|
1583
1726
|
let t = e.getParent(), n = {};
|
|
1584
|
-
t.operator =
|
|
1727
|
+
t.operator = V.BuiltInOperatorNames.Color, t.param = n, e.copyToObject(n, "cellColor", Z);
|
|
1728
|
+
let r = _(e);
|
|
1729
|
+
r && (n.style = r);
|
|
1585
1730
|
}
|
|
1586
|
-
}),
|
|
1731
|
+
}), h.registerVisitor({
|
|
1587
1732
|
from: "iconFilter",
|
|
1588
1733
|
openTag: (e) => {
|
|
1589
1734
|
let t = e.getParent(), n = {};
|
|
1590
|
-
t.operator =
|
|
1735
|
+
t.operator = V.BuiltInOperatorNames.Icon, t.param = n, e.copyToObject(n, "iconId", Q), e.copyToObject(n, "iconSet", $);
|
|
1591
1736
|
}
|
|
1592
|
-
}),
|
|
1737
|
+
}), h.registerVisitor({
|
|
1593
1738
|
from: "top10",
|
|
1594
1739
|
openTag: (e) => {
|
|
1595
1740
|
let t = e.getParent(), n = {};
|
|
1596
|
-
t.operator =
|
|
1741
|
+
t.operator = V.BuiltInOperatorNames.TopN, t.param = n, e.copyToObject(n, "filterVal", hn), e.copyToObject(n, "percent", Z), e.copyToObject(n, "top", Z), e.copyToObject(n, "limit", hn, "val");
|
|
1597
1742
|
}
|
|
1598
|
-
}),
|
|
1743
|
+
}), h.registerVisitor({
|
|
1599
1744
|
from: "dynamicFilter",
|
|
1600
1745
|
openTag: (e) => {
|
|
1601
|
-
let t = e.getParent(), n =
|
|
1746
|
+
let t = e.getParent(), n = fe(e.getAttribute("type"));
|
|
1602
1747
|
t.operator = n.operator, t.param = n.param;
|
|
1603
1748
|
}
|
|
1604
1749
|
});
|
|
1605
|
-
let
|
|
1750
|
+
let le = {
|
|
1606
1751
|
from: "filters",
|
|
1607
1752
|
to: {},
|
|
1608
1753
|
openTag: (e) => {
|
|
1609
1754
|
let t = e.getParent(), n = {};
|
|
1610
|
-
return t.selector =
|
|
1755
|
+
return t.selector = V.BuiltInSelectorNames.Display, t.operator = V.BuiltInOperatorNames.InSet, t.param = n, e.copyToObject(n, "blank", Z), e.copyToObject(n, "calendarType", $), n;
|
|
1611
1756
|
}
|
|
1612
1757
|
};
|
|
1613
|
-
|
|
1614
|
-
let
|
|
1758
|
+
h.registerVisitor(le);
|
|
1759
|
+
let de = {
|
|
1615
1760
|
from: "filter",
|
|
1616
1761
|
openTag: (e) => {
|
|
1617
1762
|
let t = e.getParent(), n = t.items;
|
|
1618
1763
|
n || (n = [], t.items = n), n.push(e.getAttribute("val", $));
|
|
1619
1764
|
}
|
|
1620
1765
|
};
|
|
1621
|
-
|
|
1766
|
+
h.registerVisitor(de);
|
|
1622
1767
|
let E = {
|
|
1623
1768
|
from: "dateGroupItem",
|
|
1624
1769
|
to: {},
|
|
@@ -1627,42 +1772,55 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1627
1772
|
n || (n = [], t.dateGroups = n), n.push(e.getSource()), e.copyTo("group", $, "dateTimeGrouping"), e.copyTo("day", Q), e.copyTo("hour", Q), e.copyTo("minute", Q), e.copyTo("month", Q), e.copyTo("second", Q), e.copyTo("year", Q);
|
|
1628
1773
|
}
|
|
1629
1774
|
};
|
|
1630
|
-
|
|
1631
|
-
let
|
|
1632
|
-
|
|
1775
|
+
h.registerVisitor(E);
|
|
1776
|
+
let D = /* @__PURE__ */ new Map();
|
|
1777
|
+
D.set("filterColumn", {
|
|
1633
1778
|
from: "filterColumn",
|
|
1634
1779
|
transparent: !0
|
|
1635
|
-
}),
|
|
1780
|
+
}), D.set("filters", le), D.set("filter", de), D.set("dateGroupItem", E), h.registerVisitor({
|
|
1636
1781
|
from: "customFilters",
|
|
1637
1782
|
openTag: (e) => {
|
|
1638
1783
|
let t = e.getParent(), n = e.getAttribute("and"), r = n === "and" || n === "1", i = [];
|
|
1639
|
-
return t.operator = r ?
|
|
1784
|
+
return t.operator = r ? V.BuiltInOperatorNames.And : V.BuiltInOperatorNames.Or, t.param = i, e.setSource(t), i;
|
|
1640
1785
|
},
|
|
1641
1786
|
closeTag: (e) => {
|
|
1642
1787
|
let t = e.getSource(), n = t?.param;
|
|
1643
1788
|
if (!t || !n) return;
|
|
1644
|
-
let r = n.length === 1 ? n[0] :
|
|
1789
|
+
let r = n.length === 1 ? n[0] : Ee(t);
|
|
1645
1790
|
r !== t && (t.operator = r.operator, t.param = r.param);
|
|
1646
1791
|
}
|
|
1647
|
-
}),
|
|
1792
|
+
}), h.registerVisitor({
|
|
1648
1793
|
from: "customFilter",
|
|
1649
1794
|
openTag: (e) => {
|
|
1650
1795
|
let t = e.getParent(), n;
|
|
1651
1796
|
Array.isArray(t) ? (n = {}, t.push(n)) : n = t;
|
|
1652
|
-
let r =
|
|
1797
|
+
let r = we({
|
|
1653
1798
|
operator: e.getAttribute("operator"),
|
|
1654
1799
|
val: e.getAttribute("val")
|
|
1655
1800
|
}, (t) => e.warn(t));
|
|
1656
1801
|
r && (n.operator = r.operator, n.param = r.param);
|
|
1657
1802
|
}
|
|
1658
|
-
})
|
|
1803
|
+
});
|
|
1804
|
+
let O = {}, me = null;
|
|
1805
|
+
h.registerVisitor({
|
|
1659
1806
|
from: "sortState",
|
|
1660
1807
|
to: {},
|
|
1661
1808
|
openTag: (e) => {
|
|
1662
1809
|
let t = e.getParent(), n = t.v;
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1810
|
+
if (!n) return;
|
|
1811
|
+
let r = {};
|
|
1812
|
+
O = {};
|
|
1813
|
+
let i = e.getAttribute("caseSensitive", Z);
|
|
1814
|
+
i != null && (O.collatorOptions = i ? Xe.CaseSensitiveOptions : Xe.CaseInsensitiveOptions);
|
|
1815
|
+
let a = e.getAttribute("sortMethod");
|
|
1816
|
+
a !== "stroke" && a !== "pinYin" || (O.collatorOptions = {
|
|
1817
|
+
...O.collatorOptions,
|
|
1818
|
+
collation: a === "stroke" ? "stroke" : "pinyin"
|
|
1819
|
+
}), e.getAttribute("columnSort", Z) && (r.axis = Ge.Axis.Column);
|
|
1820
|
+
let o = e.getAttribute("ref"), s = t.r;
|
|
1821
|
+
me = o && s ? R.fastStringToRange(o) : null, me && (r.extent = { range: d(s, me) }), n.sort = r, e.setSource(t);
|
|
1822
|
+
}
|
|
1823
|
+
}), h.registerVisitor({
|
|
1666
1824
|
from: "sortCondition",
|
|
1667
1825
|
to: {},
|
|
1668
1826
|
openTag: (e) => {
|
|
@@ -1672,66 +1830,88 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1672
1830
|
if (!r) return;
|
|
1673
1831
|
let i = r.sorts;
|
|
1674
1832
|
i || (i = [], r.sorts = i);
|
|
1675
|
-
let a = e.getAttribute("ref"), o = 0;
|
|
1833
|
+
let a = e.getAttribute("ref"), o = 0, s = null;
|
|
1676
1834
|
if (a) {
|
|
1677
|
-
let e =
|
|
1678
|
-
o =
|
|
1835
|
+
let e = R.fastStringToRange(a, Yn), n = e.colStart, r = t.r, i = r.colStart;
|
|
1836
|
+
o = r ? n - i : n, r && me && (s = y(r, me, e));
|
|
1679
1837
|
}
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1838
|
+
r.extent && (r.extent.sorts ??= []).push(s);
|
|
1839
|
+
let c = { ...O }, l = Ce(e.getAttribute("sortBy"));
|
|
1840
|
+
l && (c.sortOn = l);
|
|
1841
|
+
let u = _(e);
|
|
1842
|
+
u && (c.style = u), e.copyToObject(c, "iconSet", $), e.copyToObject(c, "customList", $), c.reverse = e.getAttribute("descending", Z) ?? !1;
|
|
1843
|
+
let d = {
|
|
1683
1844
|
index: o,
|
|
1684
|
-
criteria:
|
|
1845
|
+
criteria: c
|
|
1685
1846
|
};
|
|
1686
|
-
i.push(
|
|
1847
|
+
i.push(d);
|
|
1687
1848
|
}
|
|
1688
1849
|
});
|
|
1689
|
-
let
|
|
1690
|
-
|
|
1691
|
-
let t =
|
|
1692
|
-
n === null || t || (e.getSource().gridLineColor = "index" + parseFloat(n)), e.copyTo("showZeros", Z), e.copyTo("showFormulas", Z), e.copyTo("zoomScale", Q), e.copyTo("
|
|
1850
|
+
let ge = (e) => {
|
|
1851
|
+
S = e.getSource(), w = "topLeft", e.copyTo("topLeft", $, "topLeftCell");
|
|
1852
|
+
let t = p(e.getAttribute("defaultGridColor")), n = e.getAttribute("colorId");
|
|
1853
|
+
n === null || t || (e.getSource().gridLineColor = "index" + parseFloat(n)), e.copyTo("showZeros", Z), e.copyTo("showFormulas", Z), e.copyTo("zoomScale", Q), e.copyTo("viewMode", $, "view");
|
|
1854
|
+
let r = {};
|
|
1855
|
+
for (let [t, n] of Oe) {
|
|
1856
|
+
let i = e.getAttribute(n, Q);
|
|
1857
|
+
i && (r[t] = Math.min(400, Math.max(10, i)));
|
|
1858
|
+
}
|
|
1859
|
+
Object.keys(r).length > 0 && (e.getSource().zoomScales = r), e.copyTo("showRuler", Z), e.copyTo("showWhitespace", Z, "showWhiteSpace"), e.copyTo("windowProtection", Z), e.copyTo("showRowHeaders", Z, "showRowColHeaders"), e.copyTo("showColumnHeaders", Z, "showRowColHeaders"), e.copyTo("showRowGridlines", Z, "showGridLines"), e.copyTo("showColumnGridlines", Z, "showGridLines"), e.copyTo("rightToLeft", Z), e.copyTo("showOutlineSymbols", Z);
|
|
1693
1860
|
};
|
|
1694
|
-
|
|
1861
|
+
h.registerVisitor({
|
|
1695
1862
|
from: "sheetView",
|
|
1696
1863
|
to: "view",
|
|
1697
1864
|
openTag: (e) => {
|
|
1698
|
-
|
|
1865
|
+
ge(e);
|
|
1699
1866
|
},
|
|
1700
1867
|
closeTag: () => {
|
|
1701
|
-
|
|
1868
|
+
S = null;
|
|
1702
1869
|
}
|
|
1703
|
-
}),
|
|
1870
|
+
}), h.registerVisitor({
|
|
1704
1871
|
from: "customSheetViews",
|
|
1705
1872
|
to: "customSheetViews",
|
|
1706
1873
|
openTag: (e) => {
|
|
1707
1874
|
e.setSource([]);
|
|
1708
1875
|
}
|
|
1709
|
-
}),
|
|
1876
|
+
}), h.registerVisitor({
|
|
1710
1877
|
from: "customSheetView",
|
|
1711
1878
|
to: [],
|
|
1712
1879
|
openTag: (e) => {
|
|
1713
|
-
|
|
1880
|
+
A = !0, ge(e);
|
|
1714
1881
|
},
|
|
1715
1882
|
closeTag: () => {
|
|
1716
|
-
|
|
1883
|
+
A = !1, S = null;
|
|
1717
1884
|
}
|
|
1718
|
-
}),
|
|
1885
|
+
}), h.registerVisitor({
|
|
1719
1886
|
from: "selection",
|
|
1720
|
-
to:
|
|
1887
|
+
to: null,
|
|
1721
1888
|
openTag: (e) => {
|
|
1722
|
-
if (!
|
|
1723
|
-
e.
|
|
1724
|
-
|
|
1725
|
-
|
|
1889
|
+
if (!S) return;
|
|
1890
|
+
let t = e.getAttribute("activeCell")?.replace(/\$/g, ""), n = e.getAttribute("sqref")?.replace(/\$/g, ""), r = e.getAttribute("pane") ?? "topLeft";
|
|
1891
|
+
if (r !== w) {
|
|
1892
|
+
let e = S.freezePanes;
|
|
1893
|
+
if (e && t) {
|
|
1894
|
+
let i = { activeCell: t };
|
|
1895
|
+
n && n !== t && (i.sqref = n), (e.paneSelections ??= {})[r] = i;
|
|
1896
|
+
}
|
|
1897
|
+
return;
|
|
1898
|
+
}
|
|
1899
|
+
let i = {};
|
|
1900
|
+
t && (i.cell = t);
|
|
1901
|
+
let a = e.getAttribute("activeCellId", Q);
|
|
1902
|
+
a !== null && (i.rangeIndex = a), n && n !== t && (i.ranges = n.trim().split(/\s+/)), S.selection = i;
|
|
1726
1903
|
}
|
|
1727
|
-
}),
|
|
1904
|
+
}), h.registerVisitor({
|
|
1728
1905
|
from: "pane",
|
|
1729
1906
|
to: null,
|
|
1730
1907
|
openTag: (e) => {
|
|
1731
|
-
if (
|
|
1908
|
+
if (!S) return;
|
|
1909
|
+
w = e.getAttribute("activePane") ?? "topLeft";
|
|
1910
|
+
let t = e.getAttribute("state");
|
|
1911
|
+
if (t === "frozen" || t === "frozenSplit") {
|
|
1732
1912
|
let t = {};
|
|
1733
|
-
|
|
1734
|
-
let n = (
|
|
1913
|
+
S.freezePanes = t, e.copyToObject(t, "topLeft", $, "topLeftCell");
|
|
1914
|
+
let n = (S.topLeft ? R.fastStringToCell(S.topLeft) : void 0) ?? {
|
|
1735
1915
|
colIndex: 0,
|
|
1736
1916
|
rowIndex: 0
|
|
1737
1917
|
}, r = {
|
|
@@ -1743,28 +1923,36 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1743
1923
|
colIndex: n.colIndex + r.colIndex,
|
|
1744
1924
|
rowIndex: n.rowIndex + r.rowIndex
|
|
1745
1925
|
};
|
|
1746
|
-
t.coords =
|
|
1926
|
+
t.coords = R.cellToString(i);
|
|
1747
1927
|
}
|
|
1748
1928
|
}
|
|
1749
|
-
}),
|
|
1929
|
+
}), h.registerVisitor({
|
|
1750
1930
|
from: "sheetPr",
|
|
1751
1931
|
transparent: !0,
|
|
1752
1932
|
openTag: (t) => {
|
|
1753
1933
|
let n = t.getAttribute("codeName");
|
|
1754
|
-
n && (e.codeName = n), !1 === t.getAttribute("enableFormatConditionsCalculation", Z) && (e.conditionalFormatCalculation = !1);
|
|
1934
|
+
n && (e.codeName = n), !1 === t.getAttribute("enableFormatConditionsCalculation", Z) && (e.conditionalFormatCalculation = !1), !0 === t.getAttribute("transitionEvaluation", Z) && (e.transitionFormulaEvaluation = !0), !0 === t.getAttribute("transitionEntry", Z) && (e.transitionFormulaEntry = !0), !1 === t.getAttribute("published", Z) && (e.excludeFromPublishing = !0);
|
|
1935
|
+
let r = {};
|
|
1936
|
+
!0 === t.getAttribute("syncHorizontal", Z) && (r.horizontal = !0), !0 === t.getAttribute("syncVertical", Z) && (r.vertical = !0);
|
|
1937
|
+
let i = t.getAttribute("syncRef");
|
|
1938
|
+
i && (r.anchor = i), Object.keys(r).length > 0 && (e.syncScroll = r);
|
|
1755
1939
|
}
|
|
1756
|
-
}),
|
|
1940
|
+
}), h.registerVisitor({
|
|
1757
1941
|
from: "tabColor",
|
|
1758
1942
|
to: null,
|
|
1759
1943
|
openTag: (t) => {
|
|
1760
|
-
let n =
|
|
1944
|
+
let n = Fe((e) => t.getAttribute(e));
|
|
1761
1945
|
n && (e.tabColor = n);
|
|
1762
1946
|
}
|
|
1763
|
-
})
|
|
1947
|
+
});
|
|
1948
|
+
let A = !1, j = () => e.pageLayout ??= {};
|
|
1949
|
+
h.registerVisitor({
|
|
1764
1950
|
from: "pageSetUpPr",
|
|
1765
|
-
to:
|
|
1766
|
-
openTag: (e) => {
|
|
1767
|
-
|
|
1951
|
+
to: null,
|
|
1952
|
+
openTag: (e) => {
|
|
1953
|
+
!0 === e.getAttribute("fitToPage", Z) && (j().fitToPage = !0), !1 === e.getAttribute("autoPageBreaks", Z) && (j().hideAutoPageBreaks = !0);
|
|
1954
|
+
}
|
|
1955
|
+
}), h.registerVisitor({
|
|
1768
1956
|
from: "outlinePr",
|
|
1769
1957
|
to: null,
|
|
1770
1958
|
openTag: (t) => {
|
|
@@ -1777,42 +1965,139 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1777
1965
|
return n === "1" || n === "true";
|
|
1778
1966
|
})("applyStyles") && (r.automaticStyles = !0), Object.keys(r).length > 0 && (e.outline = r);
|
|
1779
1967
|
}
|
|
1780
|
-
}),
|
|
1968
|
+
}), h.registerVisitor({
|
|
1781
1969
|
from: "pageMargins",
|
|
1782
|
-
to:
|
|
1970
|
+
to: null,
|
|
1783
1971
|
openTag: (e) => {
|
|
1784
|
-
|
|
1972
|
+
if (A) return;
|
|
1973
|
+
let t = (t, n) => e.getAttribute(t, hn) ?? n, n = {
|
|
1974
|
+
left: t("left", .7),
|
|
1975
|
+
right: t("right", .7),
|
|
1976
|
+
top: t("top", .75),
|
|
1977
|
+
bottom: t("bottom", .75),
|
|
1978
|
+
header: t("header", .3),
|
|
1979
|
+
footer: t("footer", .3)
|
|
1980
|
+
};
|
|
1981
|
+
n.left === .7 && n.right === .7 && n.top === .75 && n.bottom === .75 && n.header === .3 && n.footer === .3 || (j().margins = n);
|
|
1785
1982
|
}
|
|
1786
|
-
}),
|
|
1983
|
+
}), h.registerVisitor({
|
|
1787
1984
|
from: "pageSetup",
|
|
1788
|
-
to:
|
|
1985
|
+
to: null,
|
|
1789
1986
|
openTag: (e) => {
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1987
|
+
if (A) return;
|
|
1988
|
+
let n = j(), r = (t) => e.getAttribute(t, Q) ?? void 0, i = (t) => e.getAttribute(t, Z), a = e.getAttribute("orientation");
|
|
1989
|
+
a !== "landscape" && a !== "portrait" || (n.orientation = a);
|
|
1990
|
+
for (let e of [
|
|
1991
|
+
"paperSize",
|
|
1992
|
+
"scale",
|
|
1993
|
+
"fitToWidth",
|
|
1994
|
+
"fitToHeight",
|
|
1995
|
+
"firstPageNumber",
|
|
1996
|
+
"horizontalDpi",
|
|
1997
|
+
"verticalDpi",
|
|
1998
|
+
"copies"
|
|
1999
|
+
]) {
|
|
2000
|
+
let t = r(e);
|
|
2001
|
+
t !== void 0 && (n[e] = t);
|
|
2002
|
+
}
|
|
2003
|
+
let o = e.getAttribute("paperHeight");
|
|
2004
|
+
o && (n.paperHeight = o);
|
|
2005
|
+
let s = e.getAttribute("paperWidth");
|
|
2006
|
+
s && (n.paperWidth = s), e.getAttribute("pageOrder") === "overThenDown" && (n.printOrder = "overThenDown"), !0 === i("blackAndWhite") && (n.blackAndWhite = !0), !0 === i("draft") && (n.draftMode = !0), !0 === i("useFirstPageNumber") && (n.useFirstPageNumber = !0), !1 === i("usePrinterDefaults") && (n.ignorePrinterDefaults = !0);
|
|
2007
|
+
let c = e.getAttribute("cellComments"), l = he.find(([e]) => e === c)?.[1];
|
|
2008
|
+
l && (n.printComments = l);
|
|
2009
|
+
let u = e.getAttribute("errors"), d = C.find(([e]) => e === u)?.[1];
|
|
2010
|
+
d && (n.printErrors = d);
|
|
2011
|
+
let f = e.getAttribute("r:id"), p = f ? t(f, "part") : null;
|
|
2012
|
+
p && (n.printerSettings = p);
|
|
2013
|
+
}
|
|
2014
|
+
}), h.registerVisitor({
|
|
1793
2015
|
from: "printOptions",
|
|
1794
|
-
to:
|
|
2016
|
+
to: null,
|
|
2017
|
+
openTag: (e) => {
|
|
2018
|
+
if (A) return;
|
|
2019
|
+
let t = (t) => !0 === e.getAttribute(t, Z);
|
|
2020
|
+
t("horizontalCentered") && (j().centerHorizontally = !0), t("verticalCentered") && (j().centerVertically = !0), t("gridLines") && (j().printGridlines = !0), t("headings") && (j().printHeadings = !0);
|
|
2021
|
+
}
|
|
2022
|
+
}), h.registerVisitor({
|
|
2023
|
+
from: "headerFooter",
|
|
2024
|
+
to: {},
|
|
2025
|
+
openTag: (e) => {
|
|
2026
|
+
if (A) return;
|
|
2027
|
+
let t = {}, n = (t) => e.getAttribute(t, Z);
|
|
2028
|
+
!0 === n("differentOddEven") && (t.differentOddEven = !0), !0 === n("differentFirst") && (t.differentFirst = !0), !1 === n("scaleWithDoc") && (t.ignoreSheetScale = !0), !1 === n("alignWithMargins") && (t.ignoreSheetMargins = !0), Object.keys(t).length > 0 && (j().headerFooter = t);
|
|
2029
|
+
}
|
|
2030
|
+
});
|
|
2031
|
+
for (let e of k) h.registerVisitor({
|
|
2032
|
+
from: e,
|
|
2033
|
+
to: {},
|
|
2034
|
+
text: (t, n) => {
|
|
2035
|
+
if (A) return;
|
|
2036
|
+
let r = j(), i = r.headerFooter ??= {};
|
|
2037
|
+
i[e] = (i[e] ?? "") + ae(t);
|
|
2038
|
+
}
|
|
2039
|
+
});
|
|
2040
|
+
let ve = "rowBreaks";
|
|
2041
|
+
for (let [e, t] of [["rowBreaks", "rowBreaks"], ["colBreaks", "columnBreaks"]]) h.registerVisitor({
|
|
2042
|
+
from: e,
|
|
2043
|
+
to: {},
|
|
2044
|
+
openTag: () => {
|
|
2045
|
+
ve = t;
|
|
2046
|
+
}
|
|
2047
|
+
});
|
|
2048
|
+
h.registerVisitor({
|
|
2049
|
+
from: "brk",
|
|
2050
|
+
to: null,
|
|
1795
2051
|
openTag: (e) => {
|
|
1796
|
-
|
|
2052
|
+
if (A) return;
|
|
2053
|
+
let t = e.getAttribute("id", Q);
|
|
2054
|
+
if (t == null) return;
|
|
2055
|
+
let n = { index: t }, r = e.getAttribute("min", Q);
|
|
2056
|
+
r != null && (n.min = r);
|
|
2057
|
+
let i = e.getAttribute("max", Q);
|
|
2058
|
+
i != null && (n.max = i), !0 !== e.getAttribute("man", Z) && (n.automatic = !0), !0 === e.getAttribute("pt", Z) && (n.pivot = !0);
|
|
2059
|
+
let a = j();
|
|
2060
|
+
(a[ve] ??= []).push(n);
|
|
2061
|
+
}
|
|
2062
|
+
}), h.registerVisitor({
|
|
2063
|
+
from: "ignoredErrors",
|
|
2064
|
+
transparent: !0
|
|
2065
|
+
}), h.registerVisitor({
|
|
2066
|
+
from: "ignoredError",
|
|
2067
|
+
to: null,
|
|
2068
|
+
openTag: (t) => {
|
|
2069
|
+
let n = t.getAttribute("sqref");
|
|
2070
|
+
if (!n) return;
|
|
2071
|
+
let r = [];
|
|
2072
|
+
for (let e of f) !0 === t.getAttribute(e, Z) && r.push(e);
|
|
2073
|
+
if (r.length !== 0) for (let t of n.trim().split(/\s+/)) (e.ignoredErrors ??= []).push({
|
|
2074
|
+
r: t,
|
|
2075
|
+
v: r
|
|
2076
|
+
});
|
|
1797
2077
|
}
|
|
1798
|
-
}),
|
|
1799
|
-
from: "headerFoot",
|
|
1800
|
-
to: "headerFoot",
|
|
1801
|
-
openTag: (e) => {}
|
|
1802
|
-
}), p.registerVisitor({
|
|
2078
|
+
}), h.registerVisitor({
|
|
1803
2079
|
from: "mergeCells",
|
|
1804
2080
|
to: "merges",
|
|
1805
2081
|
openTag: (e) => {
|
|
1806
2082
|
e.setSource([]);
|
|
1807
2083
|
}
|
|
1808
|
-
}),
|
|
2084
|
+
}), h.registerVisitor({
|
|
1809
2085
|
from: "dataValidations",
|
|
1810
2086
|
to: "validations",
|
|
1811
|
-
openTag: (
|
|
1812
|
-
|
|
2087
|
+
openTag: (t) => {
|
|
2088
|
+
t.setSource([]);
|
|
2089
|
+
let n = {};
|
|
2090
|
+
!0 === t.getAttribute("disablePrompts", Z) && (n.disablePrompts = !0);
|
|
2091
|
+
let r = t.getAttribute("xWindow", Q);
|
|
2092
|
+
r !== null && (n.windowX = r);
|
|
2093
|
+
let i = t.getAttribute("yWindow", Q);
|
|
2094
|
+
i !== null && (n.windowY = i), Object.keys(n).length > 0 && (e.validationSettings = {
|
|
2095
|
+
...e.validationSettings,
|
|
2096
|
+
...n
|
|
2097
|
+
});
|
|
1813
2098
|
}
|
|
1814
2099
|
});
|
|
1815
|
-
let
|
|
2100
|
+
let ye = {
|
|
1816
2101
|
from: "dataValidation",
|
|
1817
2102
|
to: [],
|
|
1818
2103
|
openTag: (e) => {
|
|
@@ -1831,25 +2116,25 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1831
2116
|
closeTag: (e) => {
|
|
1832
2117
|
let t = e.getSource();
|
|
1833
2118
|
if (!t?.rule) return;
|
|
1834
|
-
let n =
|
|
2119
|
+
let n = b(t.rule, o);
|
|
1835
2120
|
n && (e.getAttribute("allowBlank", Z) && (n.includeBlanks = !0), t.v.condition = n), delete t.rule;
|
|
1836
2121
|
}
|
|
1837
2122
|
};
|
|
1838
|
-
|
|
2123
|
+
h.registerVisitor(ye), h.registerVisitor({
|
|
1839
2124
|
from: "formula1",
|
|
1840
2125
|
to: {},
|
|
1841
2126
|
text: (e, t) => {
|
|
1842
2127
|
let n = t.getParent().rule;
|
|
1843
|
-
n?.type && (n.formula1 =
|
|
2128
|
+
n?.type && (n.formula1 = ie(oe(e), n.type));
|
|
1844
2129
|
}
|
|
1845
|
-
}),
|
|
2130
|
+
}), h.registerVisitor({
|
|
1846
2131
|
from: "formula2",
|
|
1847
2132
|
to: {},
|
|
1848
2133
|
text: (e, t) => {
|
|
1849
2134
|
let n = t.getParent().rule;
|
|
1850
|
-
n?.type && (n.formula2 =
|
|
2135
|
+
n?.type && (n.formula2 = ie(oe(e), n.type));
|
|
1851
2136
|
}
|
|
1852
|
-
}),
|
|
2137
|
+
}), h.registerVisitor({
|
|
1853
2138
|
from: "picture",
|
|
1854
2139
|
to: "picture",
|
|
1855
2140
|
openTag: (e) => {
|
|
@@ -1859,7 +2144,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1859
2144
|
e.getSource().resId = r;
|
|
1860
2145
|
}
|
|
1861
2146
|
});
|
|
1862
|
-
let
|
|
2147
|
+
let be = {
|
|
1863
2148
|
from: "slicer",
|
|
1864
2149
|
to: {},
|
|
1865
2150
|
openTag: (e) => {
|
|
@@ -1871,8 +2156,8 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1871
2156
|
for (let e of a) i.slicers[e] = r[e];
|
|
1872
2157
|
}
|
|
1873
2158
|
};
|
|
1874
|
-
|
|
1875
|
-
let
|
|
2159
|
+
h.registerVisitor(be);
|
|
2160
|
+
let M = (e, t) => ({
|
|
1876
2161
|
from: e,
|
|
1877
2162
|
to: {},
|
|
1878
2163
|
openTag: (e) => {
|
|
@@ -1884,8 +2169,8 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1884
2169
|
closeTag: (e) => {
|
|
1885
2170
|
t(String(e.getSource() ?? ""), e);
|
|
1886
2171
|
}
|
|
1887
|
-
}),
|
|
1888
|
-
|
|
2172
|
+
}), xe = /* @__PURE__ */ new Map();
|
|
2173
|
+
xe.set("dataValidations", {
|
|
1889
2174
|
from: "dataValidations",
|
|
1890
2175
|
to: "validations",
|
|
1891
2176
|
openTag: (e) => {
|
|
@@ -1895,15 +2180,15 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1895
2180
|
closeTag: (e) => {
|
|
1896
2181
|
(e.getSource()?.length ?? 0) === 0 && e.setSource(void 0);
|
|
1897
2182
|
}
|
|
1898
|
-
}),
|
|
1899
|
-
...
|
|
2183
|
+
}), xe.set("dataValidation", {
|
|
2184
|
+
...ye,
|
|
1900
2185
|
closeTag: (e) => {
|
|
1901
|
-
|
|
2186
|
+
ye.closeTag(e);
|
|
1902
2187
|
let t = e.getSource();
|
|
1903
2188
|
t && !t.r && (e.warn("x14 dataValidation with no xm:sqref was dropped."), e.setSource(void 0));
|
|
1904
2189
|
}
|
|
1905
2190
|
});
|
|
1906
|
-
let
|
|
2191
|
+
let N = (e) => ({
|
|
1907
2192
|
from: e,
|
|
1908
2193
|
to: {},
|
|
1909
2194
|
openTag: (t) => {
|
|
@@ -1913,18 +2198,18 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1913
2198
|
});
|
|
1914
2199
|
}
|
|
1915
2200
|
});
|
|
1916
|
-
|
|
2201
|
+
xe.set("formula1", N("formula1")), xe.set("formula2", N("formula2")), xe.set("f", M("f", (e, t) => {
|
|
1917
2202
|
let n = t.getParent(), r = n?.rule;
|
|
1918
|
-
r && (r[n.key] =
|
|
1919
|
-
})),
|
|
2203
|
+
r && (r[n.key] = ie(oe(e), r.type));
|
|
2204
|
+
})), xe.set("sqref", M("sqref", (e, t) => {
|
|
1920
2205
|
let n = t.getParent(), r = e.trim();
|
|
1921
2206
|
n && r && (n.r = r.split(/\s+/).join(","));
|
|
1922
2207
|
}));
|
|
1923
|
-
let
|
|
1924
|
-
|
|
2208
|
+
let P = /* @__PURE__ */ new Map(), Se = [], F = /* @__PURE__ */ new Map();
|
|
2209
|
+
F.set("conditionalFormattings", {
|
|
1925
2210
|
from: "conditionalFormattings",
|
|
1926
2211
|
transparent: !0
|
|
1927
|
-
}),
|
|
2212
|
+
}), F.set("conditionalFormatting", {
|
|
1928
2213
|
from: "conditionalFormatting",
|
|
1929
2214
|
to: {},
|
|
1930
2215
|
openTag: (e) => {
|
|
@@ -1934,10 +2219,10 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1934
2219
|
let t = e.getSource(), n = t?.rules ?? [];
|
|
1935
2220
|
for (let e = 0; e < n.length; e++) {
|
|
1936
2221
|
let r = n[e];
|
|
1937
|
-
r.sqref = t.sqref, r.id ?
|
|
2222
|
+
r.sqref = t.sqref, r.id ? P.set(r.id, r) : Se.push(r);
|
|
1938
2223
|
}
|
|
1939
2224
|
}
|
|
1940
|
-
}),
|
|
2225
|
+
}), F.set("cfRule", {
|
|
1941
2226
|
from: "cfRule",
|
|
1942
2227
|
to: {},
|
|
1943
2228
|
openTag: (e) => {
|
|
@@ -1947,10 +2232,10 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1947
2232
|
let t = e.getSource();
|
|
1948
2233
|
t && e.getParent()?.rules?.push(t);
|
|
1949
2234
|
}
|
|
1950
|
-
}),
|
|
2235
|
+
}), F.set("sqref", M("sqref", (e, t) => {
|
|
1951
2236
|
let n = t.getParent(), r = e.trim();
|
|
1952
2237
|
n && r && (n.sqref = r);
|
|
1953
|
-
})),
|
|
2238
|
+
})), F.set("dataBar", {
|
|
1954
2239
|
from: "dataBar",
|
|
1955
2240
|
to: {},
|
|
1956
2241
|
openTag: (e) => {
|
|
@@ -1959,7 +2244,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1959
2244
|
closeTag: (e) => {
|
|
1960
2245
|
e.getParent().dataBar = e.getSource();
|
|
1961
2246
|
}
|
|
1962
|
-
}),
|
|
2247
|
+
}), F.set("iconSet", {
|
|
1963
2248
|
from: "iconSet",
|
|
1964
2249
|
to: {},
|
|
1965
2250
|
openTag: (e) => {
|
|
@@ -1969,46 +2254,46 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1969
2254
|
e.getParent().iconSet = e.getSource();
|
|
1970
2255
|
}
|
|
1971
2256
|
});
|
|
1972
|
-
let
|
|
1973
|
-
|
|
2257
|
+
let Te = /* @__PURE__ */ new Map();
|
|
2258
|
+
Te.set("f", M("f", (e, t) => {
|
|
1974
2259
|
let n = t.getParent();
|
|
1975
2260
|
if (!n) return;
|
|
1976
2261
|
let r = e.trim(), i = Number(r);
|
|
1977
|
-
n.value = r.length > 0 && Number.isFinite(i) ? i :
|
|
1978
|
-
})),
|
|
2262
|
+
n.value = r.length > 0 && Number.isFinite(i) ? i : oe(e);
|
|
2263
|
+
})), F.set("cfvo", {
|
|
1979
2264
|
from: "cfvo",
|
|
1980
2265
|
to: {},
|
|
1981
|
-
scope: () =>
|
|
2266
|
+
scope: () => Te,
|
|
1982
2267
|
openTag: (e) => {
|
|
1983
2268
|
let t = e.getParent();
|
|
1984
2269
|
t.conditions ||= [];
|
|
1985
2270
|
let n = e.getSource();
|
|
1986
2271
|
t.conditions.push(n), e.copyTo("type", $), !1 === e.getAttribute("gte", Z) && (n.exclusive = !0);
|
|
1987
2272
|
}
|
|
1988
|
-
}),
|
|
2273
|
+
}), F.set("f", M("f", (e, t) => {
|
|
1989
2274
|
let n = t.getParent();
|
|
1990
|
-
n && (n.formulas ??= []).push(
|
|
1991
|
-
})),
|
|
2275
|
+
n && (n.formulas ??= []).push(oe(e));
|
|
2276
|
+
})), F.set("dxf", {
|
|
1992
2277
|
from: "dxf",
|
|
1993
2278
|
to: {},
|
|
1994
2279
|
raw: !0,
|
|
1995
2280
|
closeTag: (e) => {
|
|
1996
|
-
if (!
|
|
2281
|
+
if (!ne) return;
|
|
1997
2282
|
let t = e.getParent();
|
|
1998
2283
|
if (!t) return;
|
|
1999
|
-
let n =
|
|
2284
|
+
let n = ne(e.getRawXml() ?? "");
|
|
2000
2285
|
n && (t.style = n);
|
|
2001
2286
|
}
|
|
2002
2287
|
});
|
|
2003
|
-
let
|
|
2288
|
+
let De = (e) => ({
|
|
2004
2289
|
from: e,
|
|
2005
2290
|
to: {},
|
|
2006
2291
|
openTag: (t) => {
|
|
2007
|
-
let n =
|
|
2292
|
+
let n = Fe((e) => t.getAttribute(e));
|
|
2008
2293
|
n && (t.getParent()[e] = n);
|
|
2009
2294
|
}
|
|
2010
2295
|
});
|
|
2011
|
-
|
|
2296
|
+
F.set("borderColor", De("borderColor")), F.set("negativeFillColor", De("negativeFillColor")), F.set("negativeBorderColor", De("negativeBorderColor")), F.set("axisColor", De("axisColor")), F.set("cfIcon", {
|
|
2012
2297
|
from: "cfIcon",
|
|
2013
2298
|
to: {},
|
|
2014
2299
|
openTag: (e) => {
|
|
@@ -2021,55 +2306,55 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2021
2306
|
});
|
|
2022
2307
|
}
|
|
2023
2308
|
});
|
|
2024
|
-
let
|
|
2025
|
-
|
|
2309
|
+
let I = /* @__PURE__ */ new Map();
|
|
2310
|
+
I.set("id", M("id", (e, t) => {
|
|
2026
2311
|
let n = t.getParent(), r = e.trim();
|
|
2027
2312
|
n && r && (n.x14Id = r);
|
|
2028
2313
|
}));
|
|
2029
|
-
let
|
|
2030
|
-
|
|
2314
|
+
let ke = /* @__PURE__ */ new Map();
|
|
2315
|
+
ke.set("slicerList", {
|
|
2031
2316
|
from: "slicerList",
|
|
2032
2317
|
transparent: !0
|
|
2033
|
-
}),
|
|
2034
|
-
let
|
|
2035
|
-
[
|
|
2036
|
-
[
|
|
2037
|
-
[
|
|
2038
|
-
[
|
|
2039
|
-
[
|
|
2040
|
-
[
|
|
2041
|
-
[
|
|
2042
|
-
]),
|
|
2043
|
-
|
|
2318
|
+
}), ke.set("slicer", be);
|
|
2319
|
+
let je = /* @__PURE__ */ new Map([
|
|
2320
|
+
[m(te), xe],
|
|
2321
|
+
[m(a), F],
|
|
2322
|
+
[m(Ae), F],
|
|
2323
|
+
[m(ee), I],
|
|
2324
|
+
[m(g), ke],
|
|
2325
|
+
[m(_e), ke],
|
|
2326
|
+
[m(s), D]
|
|
2327
|
+
]), Me = /* @__PURE__ */ new Set();
|
|
2328
|
+
h.registerVisitor({
|
|
2044
2329
|
from: "extLst",
|
|
2045
2330
|
transparent: !0
|
|
2046
|
-
}),
|
|
2331
|
+
}), h.registerVisitor({
|
|
2047
2332
|
from: "ext",
|
|
2048
2333
|
transparent: !0,
|
|
2049
2334
|
scope: (e) => {
|
|
2050
|
-
let t = e.getAttribute("uri"), n =
|
|
2335
|
+
let t = e.getAttribute("uri"), n = m(t), r = je.get(n);
|
|
2051
2336
|
if (r) return r;
|
|
2052
|
-
if (!
|
|
2053
|
-
|
|
2054
|
-
let r =
|
|
2337
|
+
if (!v.has(n) && !Me.has(n)) {
|
|
2338
|
+
Me.add(n);
|
|
2339
|
+
let r = l[n];
|
|
2055
2340
|
e.warn(r ? `Extension content '${r}' (${t}) is not read; it will be lost on resave.` : `Unknown extension content (uri ${t}) is not read; it will be lost on resave.`);
|
|
2056
2341
|
}
|
|
2057
2342
|
return null;
|
|
2058
2343
|
}
|
|
2059
|
-
}),
|
|
2344
|
+
}), h.registerVisitor({
|
|
2060
2345
|
from: "mergeCell",
|
|
2061
2346
|
to: [],
|
|
2062
2347
|
openTag: (e) => {
|
|
2063
2348
|
let t = e.getAttribute("ref");
|
|
2064
2349
|
e.setSource(t);
|
|
2065
2350
|
}
|
|
2066
|
-
}),
|
|
2351
|
+
}), h.registerVisitor({
|
|
2067
2352
|
from: "hyperlinks",
|
|
2068
2353
|
to: "hyperlinks",
|
|
2069
2354
|
openTag: (e) => {
|
|
2070
2355
|
e.setSource([]);
|
|
2071
2356
|
}
|
|
2072
|
-
}),
|
|
2357
|
+
}), h.registerVisitor({
|
|
2073
2358
|
from: "hyperlink",
|
|
2074
2359
|
to: [],
|
|
2075
2360
|
openTag: (e) => {
|
|
@@ -2081,16 +2366,13 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2081
2366
|
i.endsWith("\\") && (i = i.substring(0, i.length - 1));
|
|
2082
2367
|
let a = e.getAttribute("location");
|
|
2083
2368
|
if (a && (i += "#" + a), !i) return void e.warn("A hyperlink has no address; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.address" });
|
|
2084
|
-
let o, s = e.getAttribute("tooltip");
|
|
2085
|
-
o = s
|
|
2086
|
-
address: i,
|
|
2087
|
-
screenTip: s
|
|
2088
|
-
} : i, e.setSource({
|
|
2369
|
+
let o, s = e.getAttribute("tooltip"), c = e.getAttribute("display");
|
|
2370
|
+
s || c ? (o = { address: i }, s && (o.screenTip = s), c && (o.display = c)) : o = i, e.setSource({
|
|
2089
2371
|
r,
|
|
2090
2372
|
v: o
|
|
2091
2373
|
});
|
|
2092
2374
|
}
|
|
2093
|
-
}),
|
|
2375
|
+
}), h.registerVisitor({
|
|
2094
2376
|
from: "drawing",
|
|
2095
2377
|
to: "movables",
|
|
2096
2378
|
openTag: (e) => {
|
|
@@ -2099,32 +2381,32 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2099
2381
|
let r = t(n);
|
|
2100
2382
|
r ? e.setSource(r.movables) : e.warn("A drawing part is missing; its shapes were not imported.", { onceKey: "xlsx.sheet.drawing.missing" });
|
|
2101
2383
|
}
|
|
2102
|
-
}),
|
|
2384
|
+
}), h.registerVisitor({
|
|
2103
2385
|
from: "legacyDrawing",
|
|
2104
2386
|
to: "legacyDrawing",
|
|
2105
2387
|
openTag: (e) => {
|
|
2106
2388
|
e.setSource(t(e.getAttribute("r:id"), "legacyDrawing") ?? void 0);
|
|
2107
2389
|
}
|
|
2108
|
-
}),
|
|
2390
|
+
}), h.registerVisitor({
|
|
2109
2391
|
from: "legacyDrawingHF",
|
|
2110
2392
|
to: "legacyDrawingHF",
|
|
2111
2393
|
openTag: (e) => {
|
|
2112
2394
|
e.setSource(t(e.getAttribute("r:id"), "legacyDrawing") ?? void 0);
|
|
2113
2395
|
}
|
|
2114
2396
|
});
|
|
2115
|
-
let
|
|
2397
|
+
let Ne = null, Ie = !1, Le = /* @__PURE__ */ new Map(), L = {
|
|
2116
2398
|
from: "Fallback",
|
|
2117
2399
|
to: null
|
|
2118
|
-
},
|
|
2400
|
+
}, Re = {
|
|
2119
2401
|
from: "Choice",
|
|
2120
2402
|
transparent: !0
|
|
2121
2403
|
};
|
|
2122
|
-
|
|
2404
|
+
Le.set("Fallback", L), Le.set("Choice", Re), Le.set("control", {
|
|
2123
2405
|
from: "control",
|
|
2124
2406
|
transparent: !0,
|
|
2125
2407
|
openTag: (e) => {
|
|
2126
2408
|
let n = e.getAttribute("name"), r = e.getAttribute("r:id"), i = r ? t(r, "formControl") : null;
|
|
2127
|
-
if (!i) return e.warn(`The form control '${n ?? ""}' has no properties and was not read.`, { onceKey: "xlsx.sheet.control.noProperties" }), void (
|
|
2409
|
+
if (!i) return e.warn(`The form control '${n ?? ""}' has no properties and was not read.`, { onceKey: "xlsx.sheet.control.noProperties" }), void (Ne = null);
|
|
2128
2410
|
let a = i.json, o = parseInt(e.getAttribute("shapeId") ?? "", 10);
|
|
2129
2411
|
isNaN(o) || (a.shapeId = o);
|
|
2130
2412
|
let s = {
|
|
@@ -2147,67 +2429,67 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2147
2429
|
json: a
|
|
2148
2430
|
}
|
|
2149
2431
|
};
|
|
2150
|
-
n && (s.content.name = n),
|
|
2432
|
+
n && (s.content.name = n), Ne = {
|
|
2151
2433
|
movable: s,
|
|
2152
2434
|
control: a
|
|
2153
2435
|
};
|
|
2154
2436
|
},
|
|
2155
2437
|
closeTag: () => {
|
|
2156
|
-
|
|
2438
|
+
Ne &&= (e.movables ||= [], e.movables.push(Ne.movable), null);
|
|
2157
2439
|
}
|
|
2158
|
-
}),
|
|
2440
|
+
}), Le.set("controlPr", {
|
|
2159
2441
|
from: "controlPr",
|
|
2160
2442
|
transparent: !0,
|
|
2161
2443
|
raw: !0,
|
|
2162
2444
|
openTag: (e) => {
|
|
2163
|
-
if (!
|
|
2445
|
+
if (!Ne) return;
|
|
2164
2446
|
let t = e.getFrom().attributes ?? {}, n = {};
|
|
2165
2447
|
for (let e in t) {
|
|
2166
2448
|
let r = t[e];
|
|
2167
2449
|
n[e] = typeof r == "string" ? r : r?.value ?? "";
|
|
2168
2450
|
}
|
|
2169
|
-
|
|
2451
|
+
pe(n, Ne.control);
|
|
2170
2452
|
},
|
|
2171
2453
|
closeTag: (e) => {
|
|
2172
|
-
if (!
|
|
2454
|
+
if (!Ne) return;
|
|
2173
2455
|
let t = ((e) => {
|
|
2174
2456
|
let t = /<(?:[\w.-]+:)?anchor\b([^>]*)>([\s\S]*?)<\/(?:[\w.-]+:)?anchor>/.exec(e);
|
|
2175
2457
|
if (!t) return null;
|
|
2176
2458
|
let n = t[2], r = (e) => RegExp(`<(?:[\\w.-]+:)?${e}\\b[^>]*>([\\s\\S]*?)<\\/(?:[\\w.-]+:)?${e}>`).exec(n)?.[1], i = t[1], a = /\bmoveWithCells="(?:1|true)"/.test(i), o = /\bsizeWithCells="(?:1|true)"/.test(i);
|
|
2177
2459
|
return {
|
|
2178
2460
|
anchor: {
|
|
2179
|
-
tl:
|
|
2180
|
-
br:
|
|
2461
|
+
tl: Bn(r("from")),
|
|
2462
|
+
br: Bn(r("to"))
|
|
2181
2463
|
},
|
|
2182
2464
|
anchorType: a ? o ? "twoCell" : "oneCell" : "absolute",
|
|
2183
2465
|
rest: (e.slice(0, t.index) + e.slice(t.index + t[0].length)).trim()
|
|
2184
2466
|
};
|
|
2185
2467
|
})(e.getRawXml() ?? "");
|
|
2186
|
-
t ? (
|
|
2468
|
+
t ? (Ne.movable.anchor = t.anchor, t.anchorType !== "twoCell" && (Ne.movable.anchorType = t.anchorType), t.rest && (Ne.control.xml = t.rest)) : Ie || (Ie = !0, e.warn("A form control has no anchor; it is placed at the top left of the sheet."));
|
|
2187
2469
|
}
|
|
2188
2470
|
});
|
|
2189
|
-
let
|
|
2471
|
+
let ze = {
|
|
2190
2472
|
from: "controls",
|
|
2191
2473
|
transparent: !0,
|
|
2192
|
-
scope: () =>
|
|
2474
|
+
scope: () => Le
|
|
2193
2475
|
};
|
|
2194
|
-
|
|
2195
|
-
let
|
|
2196
|
-
["Choice",
|
|
2197
|
-
["Fallback",
|
|
2198
|
-
["controls",
|
|
2476
|
+
h.registerVisitor(ze);
|
|
2477
|
+
let Be = /* @__PURE__ */ new Map([
|
|
2478
|
+
["Choice", Re],
|
|
2479
|
+
["Fallback", L],
|
|
2480
|
+
["controls", ze]
|
|
2199
2481
|
]);
|
|
2200
|
-
|
|
2482
|
+
h.registerVisitor({
|
|
2201
2483
|
from: "AlternateContent",
|
|
2202
2484
|
transparent: !0,
|
|
2203
|
-
scope: () =>
|
|
2204
|
-
}),
|
|
2485
|
+
scope: () => Be
|
|
2486
|
+
}), h.registerVisitor({
|
|
2205
2487
|
from: "tableParts",
|
|
2206
2488
|
to: "tables",
|
|
2207
2489
|
openTag: (e) => {
|
|
2208
2490
|
e.setSource([]);
|
|
2209
2491
|
}
|
|
2210
|
-
}),
|
|
2492
|
+
}), h.registerVisitor({
|
|
2211
2493
|
from: "tablePart",
|
|
2212
2494
|
to: [],
|
|
2213
2495
|
openTag: (e) => {
|
|
@@ -2217,26 +2499,26 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2217
2499
|
r ? e.setSource(r) : e.warn("A table part is missing; the table was not imported.", { onceKey: "xlsx.sheet.table.missing" });
|
|
2218
2500
|
}
|
|
2219
2501
|
});
|
|
2220
|
-
let
|
|
2221
|
-
t.conditions?.length && (e.stops =
|
|
2222
|
-
},
|
|
2223
|
-
t.conditions?.length && (e.stops =
|
|
2224
|
-
},
|
|
2502
|
+
let Ve = (e, t) => {
|
|
2503
|
+
t.conditions?.length && (e.stops = ce(t)), t.minLength !== void 0 && (e.minLength = t.minLength), t.maxLength !== void 0 && (e.maxLength = t.maxLength), (t.gradient ?? 1) && (e.gradient = !0), t.border && t.borderColor && (e.borderColor = t.borderColor), !t.negativeBarColorSameAsPositive && t.negativeFillColor && (e.negativeFillColor = t.negativeFillColor), !(t.negativeBarBorderColorSameAsPositive ?? 1) && t.negativeBorderColor && (e.negativeBorderColor = t.negativeBorderColor), t.axisColor && (e.axisColor = t.axisColor), t.axisPosition !== "middle" && t.axisPosition !== "none" || (e.axisPosition = t.axisPosition), t.direction !== "leftToRight" && t.direction !== "rightToLeft" || (e.direction = t.direction);
|
|
2504
|
+
}, He = (e, t) => {
|
|
2505
|
+
t.conditions?.length && (e.stops = ce(t)), t.iconSet && t.iconSet !== e.iconSet && (e.iconSet = t.iconSet), t.icons?.length && (e.icon = t.icons), t.reverse !== void 0 && (e.reverse = t.reverse), t.showValue !== void 0 && (e.showValue = t.showValue);
|
|
2506
|
+
}, z = (e) => {
|
|
2225
2507
|
if (!e.sqref) return null;
|
|
2226
2508
|
let t = e.sqref.split(/\s+/).join(",");
|
|
2227
2509
|
if (e.type === "iconSet") {
|
|
2228
2510
|
if (!e.iconSet) return null;
|
|
2229
2511
|
let n = {
|
|
2230
|
-
type:
|
|
2512
|
+
type: H.ScaleType.IconSet,
|
|
2231
2513
|
stops: []
|
|
2232
2514
|
};
|
|
2233
|
-
return
|
|
2515
|
+
return He(n, e.iconSet), {
|
|
2234
2516
|
r: t,
|
|
2235
2517
|
v: { scale: n },
|
|
2236
2518
|
priority: e.priority
|
|
2237
2519
|
};
|
|
2238
2520
|
}
|
|
2239
|
-
let n =
|
|
2521
|
+
let n = ue(e, o);
|
|
2240
2522
|
if (!n) return null;
|
|
2241
2523
|
let r = { condition: n };
|
|
2242
2524
|
return e.style && (r.style = e.style), e.stopIfTrue && (r.stopIfTrue = !0), {
|
|
@@ -2245,7 +2527,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2245
2527
|
priority: e.priority
|
|
2246
2528
|
};
|
|
2247
2529
|
};
|
|
2248
|
-
|
|
2530
|
+
h.registerVisitor({
|
|
2249
2531
|
from: "worksheet",
|
|
2250
2532
|
to: {},
|
|
2251
2533
|
openTag: (e) => {},
|
|
@@ -2255,15 +2537,15 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2255
2537
|
let t = n[e], r = t.x14Id;
|
|
2256
2538
|
if (!r) continue;
|
|
2257
2539
|
delete t.x14Id;
|
|
2258
|
-
let i =
|
|
2540
|
+
let i = P.get(r);
|
|
2259
2541
|
if (!i) continue;
|
|
2260
|
-
|
|
2542
|
+
P.delete(r);
|
|
2261
2543
|
let a = t.v?.scale;
|
|
2262
|
-
i.dataBar && a?.type ===
|
|
2544
|
+
i.dataBar && a?.type === H.ScaleType.DataBar ? Ve(a, i.dataBar) : i.iconSet && a?.type === H.ScaleType.IconSet && He(a, i.iconSet);
|
|
2263
2545
|
}
|
|
2264
|
-
let r = [...
|
|
2546
|
+
let r = [...P.values(), ...Se], i = /* @__PURE__ */ new Set(), a = 0;
|
|
2265
2547
|
for (let e = 0; e < r.length; e++) {
|
|
2266
|
-
let o =
|
|
2548
|
+
let o = z(r[e]);
|
|
2267
2549
|
o ? (n || (n = [], t.conditionals = n), n.push(o)) : (i.add(r[e].type ?? "unknown"), a++);
|
|
2268
2550
|
}
|
|
2269
2551
|
if (a > 0) {
|
|
@@ -2275,7 +2557,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2275
2557
|
for (let e = 0; e < n.length; e++) delete n[e].priority;
|
|
2276
2558
|
}
|
|
2277
2559
|
}
|
|
2278
|
-
}),
|
|
2560
|
+
}), h.registerVisitor({
|
|
2279
2561
|
from: "customProperties",
|
|
2280
2562
|
to: "customProperties",
|
|
2281
2563
|
openTag: (e) => {
|
|
@@ -2285,7 +2567,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2285
2567
|
let t = e.getSource();
|
|
2286
2568
|
t.length > 0 && (e.getParent().customProperties = t);
|
|
2287
2569
|
}
|
|
2288
|
-
}),
|
|
2570
|
+
}), h.registerVisitor({
|
|
2289
2571
|
from: "customPr",
|
|
2290
2572
|
to: {},
|
|
2291
2573
|
openTag: (e) => {
|
|
@@ -2296,26 +2578,26 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2296
2578
|
let i = t(r, "resource"), a = e.getSource();
|
|
2297
2579
|
a.resId = i, n.push(a);
|
|
2298
2580
|
}
|
|
2299
|
-
}),
|
|
2581
|
+
}), h.registerVisitor({
|
|
2300
2582
|
from: "sheetProtection",
|
|
2301
2583
|
to: "protection",
|
|
2302
2584
|
openTag: (e) => {
|
|
2303
2585
|
let t = e.getSource();
|
|
2304
|
-
for (let n of
|
|
2586
|
+
for (let n of T) {
|
|
2305
2587
|
let r = e.hasAttribute(n.attribute) ? e.getAttribute(n.attribute) : null;
|
|
2306
|
-
t[n.key] =
|
|
2588
|
+
t[n.key] = Pe(n, r);
|
|
2307
2589
|
}
|
|
2308
2590
|
if (t.sheet) return;
|
|
2309
2591
|
let n = {};
|
|
2310
|
-
e.copyToObject(n, "hash", $, "hashValue"), e.copyToObject(n, "algorithm", $, "algorithmName"), e.copyToObject(n, "salt", $, "saltValue"), e.copyToObject(n, "spinCount", Q), Object.keys(n).length > 0 && (e.getSource().password = n);
|
|
2592
|
+
e.copyToObject(n, "hash", $, "hashValue"), e.copyToObject(n, "algorithm", $, "algorithmName"), e.copyToObject(n, "salt", $, "saltValue"), e.copyToObject(n, "spinCount", Q), e.copyToObject(n, "legacyHash", $, "password"), Object.keys(n).length > 0 && (e.getSource().password = n);
|
|
2311
2593
|
}
|
|
2312
|
-
}),
|
|
2594
|
+
}), h.registerVisitor({
|
|
2313
2595
|
from: "protectedRanges",
|
|
2314
2596
|
to: "protectedRanges",
|
|
2315
2597
|
openTag: (e) => {
|
|
2316
2598
|
e.setSource([]);
|
|
2317
2599
|
}
|
|
2318
|
-
}),
|
|
2600
|
+
}), h.registerVisitor({
|
|
2319
2601
|
from: "protectedRange",
|
|
2320
2602
|
to: [],
|
|
2321
2603
|
openTag: (e) => {
|
|
@@ -2327,67 +2609,77 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2327
2609
|
};
|
|
2328
2610
|
e.copyToObject(n, "name"), e.copyToObject(n, "securityDescriptor");
|
|
2329
2611
|
let i = {};
|
|
2330
|
-
e.copyToObject(i, "hash", $, "hashValue"), e.copyToObject(i, "algorithm", $, "algorithmName"), e.copyToObject(i, "salt", $, "saltValue"), e.copyToObject(i, "spinCount", Q), Object.keys(i).length > 0 && (n.password = i), e.setSource(r);
|
|
2612
|
+
e.copyToObject(i, "hash", $, "hashValue"), e.copyToObject(i, "algorithm", $, "algorithmName"), e.copyToObject(i, "salt", $, "saltValue"), e.copyToObject(i, "spinCount", Q), e.copyToObject(i, "legacyHash", $, "password"), Object.keys(i).length > 0 && (n.password = i), e.setSource(r);
|
|
2331
2613
|
},
|
|
2332
2614
|
closeTag: (e) => {
|
|
2333
2615
|
let t = e.getSource();
|
|
2334
2616
|
t?.r && t.v.name || e.setSource(void 0);
|
|
2335
2617
|
}
|
|
2336
|
-
}),
|
|
2618
|
+
}), h.registerVisitor({
|
|
2337
2619
|
from: "sheetFormatPr",
|
|
2338
2620
|
to: "sheetFormatPr",
|
|
2339
2621
|
openTag: (t) => {
|
|
2340
|
-
t.copyToObject(e, "defaultColSize",
|
|
2622
|
+
t.copyToObject(e, "defaultColSize", hn, "defaultColWidth");
|
|
2341
2623
|
let n = t.getAttribute("customHeight");
|
|
2342
|
-
n !== "1" && n !== "true" || t.copyToObject(e, "defaultRowSize",
|
|
2624
|
+
n !== "1" && n !== "true" || t.copyToObject(e, "defaultRowSize", hn, "defaultRowHeight");
|
|
2625
|
+
let r = t.getAttribute("baseColWidth", Q);
|
|
2626
|
+
r && r !== 8 && (e.baseColSize = r), x = !!t.getAttribute("zeroHeight", Z);
|
|
2343
2627
|
}
|
|
2344
|
-
}),
|
|
2628
|
+
}), h.registerVisitor({
|
|
2345
2629
|
from: "cols",
|
|
2346
2630
|
to: "cols",
|
|
2347
2631
|
openTag: (e) => {
|
|
2348
2632
|
e.setSource([]);
|
|
2349
2633
|
}
|
|
2350
|
-
}),
|
|
2634
|
+
}), h.registerVisitor({
|
|
2351
2635
|
from: "col",
|
|
2352
2636
|
to: [],
|
|
2353
2637
|
openTag: (e) => {
|
|
2354
2638
|
let t = e.getSource(), n = e.getAttribute("min"), r = e.getAttribute("max"), i = n === void 0 ? 0 : parseInt(n) - 1, a = r === void 0 ? i : parseInt(r) - 1;
|
|
2355
|
-
t.r =
|
|
2639
|
+
t.r = R.runToString(i, a, !0);
|
|
2356
2640
|
let o = {};
|
|
2357
|
-
t.v = o, e.copyToObject(o, "sz",
|
|
2641
|
+
t.v = o, e.copyToObject(o, "sz", hn, "width"), e.copyToObject(o, "csz", Z, "customWidth"), e.copyToObject(o, "h", Z, "hidden"), e.copyToObject(o, "l", Q, "outlineLevel"), e.copyToObject(o, "cl", Z, "collapsed"), e.getAttribute("bestFit", Z) && (o.bf = !0), e.copyToObject(o, "s", Q, "style");
|
|
2358
2642
|
}
|
|
2359
|
-
}),
|
|
2643
|
+
}), h.registerVisitor({
|
|
2360
2644
|
from: "oleObjects",
|
|
2361
2645
|
to: null,
|
|
2362
2646
|
openTag: (e) => {
|
|
2363
2647
|
e.warn("'OLE Objects' are not supported.");
|
|
2364
2648
|
}
|
|
2365
2649
|
});
|
|
2366
|
-
let
|
|
2650
|
+
let Ue = !1, B = !1, U = 0, We = "", Ke = "", qe = (e) => {
|
|
2367
2651
|
let t = e.indexOf(":");
|
|
2368
2652
|
return t === -1 ? e : e.slice(t + 1);
|
|
2369
|
-
};
|
|
2370
|
-
return
|
|
2653
|
+
}, Je = new In();
|
|
2654
|
+
return Zn(se, e, h.createEventHandler(e, i, o), o, c, {
|
|
2371
2655
|
onOpenTag: (e) => {
|
|
2372
|
-
|
|
2373
|
-
let t =
|
|
2374
|
-
t === "t" || t === "v" ?
|
|
2656
|
+
Ue = !0;
|
|
2657
|
+
let t = qe(e.name);
|
|
2658
|
+
t === "t" || t === "v" ? U === 0 && (B = !0) : t === "rPh" || t === "phoneticPr" ? U++ : U === 0 && Je.onOpenTag(t, e.attributes);
|
|
2375
2659
|
},
|
|
2376
2660
|
onText: (e) => {
|
|
2377
|
-
|
|
2661
|
+
B && (We += e, Je.onText(e));
|
|
2378
2662
|
},
|
|
2379
2663
|
onCloseTag: (e) => {
|
|
2380
|
-
let t =
|
|
2381
|
-
t === "t" || t === "v" ?
|
|
2664
|
+
let t = qe(e.name);
|
|
2665
|
+
t === "t" || t === "v" ? B = !1 : t === "rPh" || t === "phoneticPr" ? U > 0 && U-- : Je.onCloseTag(t);
|
|
2382
2666
|
},
|
|
2383
2667
|
onEnd: () => {
|
|
2384
|
-
if (!
|
|
2385
|
-
let e =
|
|
2386
|
-
|
|
2668
|
+
if (!Ue) return;
|
|
2669
|
+
let e = Je.take();
|
|
2670
|
+
Ue = !1, B = !1, U = 0;
|
|
2671
|
+
let t = ae(We);
|
|
2672
|
+
return We = "", Ke = t, e ? {
|
|
2673
|
+
t: "r",
|
|
2674
|
+
v: {
|
|
2675
|
+
type: "richText",
|
|
2676
|
+
data: { runs: Ln(e, u?.get(Wn)) }
|
|
2677
|
+
}
|
|
2678
|
+
} : n(t);
|
|
2387
2679
|
},
|
|
2388
2680
|
onError: (e) => {}
|
|
2389
|
-
},
|
|
2390
|
-
},
|
|
2681
|
+
}, u, n, () => x, () => Ke);
|
|
2682
|
+
}, Kn = class {
|
|
2391
2683
|
static {
|
|
2392
2684
|
this.Collapsed = 1;
|
|
2393
2685
|
}
|
|
@@ -2418,66 +2710,99 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2418
2710
|
static {
|
|
2419
2711
|
this.Spans = 512;
|
|
2420
2712
|
}
|
|
2421
|
-
|
|
2422
|
-
this.ThickBot = 1024;
|
|
2423
|
-
}
|
|
2424
|
-
static {
|
|
2425
|
-
this.ThickTop = 2048;
|
|
2426
|
-
}
|
|
2427
|
-
}, Kt = (e, t, n) => {
|
|
2713
|
+
}, qn = (e, t, n) => {
|
|
2428
2714
|
if (e[0].value[0] === e[1].value[0]) return t;
|
|
2429
|
-
},
|
|
2715
|
+
}, Jn = /^\s*TABLE\s*\(/i, Yn = {
|
|
2430
2716
|
colStart: 0,
|
|
2431
2717
|
colEnd: 0,
|
|
2432
2718
|
rowStart: 0,
|
|
2433
2719
|
rowEnd: 0
|
|
2434
|
-
},
|
|
2435
|
-
let
|
|
2436
|
-
let
|
|
2437
|
-
if (
|
|
2720
|
+
}, Xn = (e) => e === "1" || e === "true", Zn = (e, t, n, r, i, a, o, s, c, l) => {
|
|
2721
|
+
let u = !1, d = [], f = o?.get(Un), p = o?.get(Wn), m = /* @__PURE__ */ new Map(), h = !1, g = [], _ = !1, v = null, y = null, b = null, x = null, ee = null, te = null, ne = o?.get("richData") ?? Ve.EmptyArray, re = o?.get("dummyWrapped") ?? null, ie = R.normalizeA1ToR1C1, ae = He.createConflatingRanges(), oe = /* @__PURE__ */ new Map(), se = [], S = [], C = !1, w = !1, ce = null, T = (e) => {
|
|
2722
|
+
let t = o?.get("metadata")?.values;
|
|
2723
|
+
if (!t) return;
|
|
2724
|
+
let n = parseInt(e, 10);
|
|
2725
|
+
if (!Number.isFinite(n) || n < 1) return;
|
|
2726
|
+
let r = t[n - 1]?.get("XLRICHVALUE");
|
|
2727
|
+
return r?.richValueIndex === void 0 ? void 0 : ne[r.richValueIndex];
|
|
2728
|
+
}, le = !1, ue = He.createConflatingRanges(), de, fe = !1, E = -1, D = -1, O = null, k = null, pe = (e) => ({
|
|
2729
|
+
t: "r",
|
|
2730
|
+
v: {
|
|
2731
|
+
type: "hyperlink",
|
|
2732
|
+
data: {
|
|
2733
|
+
address: de,
|
|
2734
|
+
friendly: e
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
}), me = null, he = [], ge = null, _e = -2, A = 0, j = "", ve = "", ye = "", be = "", M = "", N = "", P = "", Se = "", F = "", Ce = "", we = "", Te = "", Ee = "", De = "", I = !0, Oe = null, ke = !1, Ae = !1, je = !1, Me = null, Ne = 0, Pe = (e) => {
|
|
2738
|
+
let r = e.name, s = r.indexOf(":");
|
|
2739
|
+
if (s !== -1 && (r = r.slice(s + 1)), Ne++, Ne % 196608 == 0 && i?.(Ne), k) {
|
|
2438
2740
|
let t = e.attributes;
|
|
2439
2741
|
switch (r) {
|
|
2440
2742
|
case "v":
|
|
2441
|
-
|
|
2743
|
+
h = !0;
|
|
2442
2744
|
break;
|
|
2443
2745
|
case "f":
|
|
2444
|
-
switch (
|
|
2746
|
+
switch (_ = !0, t.t ?? null) {
|
|
2445
2747
|
case null:
|
|
2446
2748
|
case "normal": break;
|
|
2447
2749
|
case "shared":
|
|
2448
2750
|
let e = t.si;
|
|
2449
|
-
|
|
2751
|
+
y = t.ref, v = e;
|
|
2450
2752
|
break;
|
|
2451
2753
|
case "array":
|
|
2452
|
-
|
|
2754
|
+
y = t.ref, ce = y;
|
|
2453
2755
|
break;
|
|
2454
|
-
case "dataTable":
|
|
2756
|
+
case "dataTable": {
|
|
2757
|
+
let e = ((e, t, n) => {
|
|
2758
|
+
let r = e.r1, i = Xn(e.del1);
|
|
2759
|
+
if (!r && !i) return null;
|
|
2760
|
+
let a = e.ref ?? R.cellToString({
|
|
2761
|
+
rowIndex: t,
|
|
2762
|
+
colIndex: n
|
|
2763
|
+
}), o = R.fastStringToRange(a);
|
|
2764
|
+
if (!o) return null;
|
|
2765
|
+
let s = { ref: {
|
|
2766
|
+
rowStart: o.rowStart,
|
|
2767
|
+
colStart: o.colStart,
|
|
2768
|
+
rowEnd: o.rowEnd,
|
|
2769
|
+
colEnd: o.colEnd
|
|
2770
|
+
} }, c = Xn(e.dt2D);
|
|
2771
|
+
if (c || Xn(e.dtr) ? (r && (s.rowInput = r), i && (s.rowInputDeleted = !0)) : (r && (s.columnInput = r), i && (s.columnInputDeleted = !0)), c) {
|
|
2772
|
+
let t = e.r2;
|
|
2773
|
+
t && (s.columnInput = t), Xn(e.del2) && (s.columnInputDeleted = !0);
|
|
2774
|
+
}
|
|
2775
|
+
return s;
|
|
2776
|
+
})(t, E, D);
|
|
2777
|
+
e && (S.push(e), Xn(t.ca) && ue.append(E, D));
|
|
2778
|
+
return;
|
|
2779
|
+
}
|
|
2455
2780
|
}
|
|
2456
2781
|
let e = t.ca;
|
|
2457
|
-
e !== void 0 && (
|
|
2782
|
+
e !== void 0 && (le = e === "1");
|
|
2458
2783
|
break;
|
|
2459
2784
|
case "is":
|
|
2460
|
-
|
|
2785
|
+
fe = !0;
|
|
2461
2786
|
return;
|
|
2462
2787
|
}
|
|
2463
|
-
|
|
2464
|
-
} else if (
|
|
2788
|
+
fe && !_ && a?.onOpenTag?.(e);
|
|
2789
|
+
} else if (u) {
|
|
2465
2790
|
if (r === "c") {
|
|
2466
|
-
|
|
2791
|
+
k = e, de = void 0;
|
|
2467
2792
|
let t = e.attributes, n = t.r;
|
|
2468
|
-
|
|
2793
|
+
D = n === void 0 ? D + 1 : R.fastStringToCol(n);
|
|
2469
2794
|
let r = t.t;
|
|
2470
|
-
r === void 0 ?
|
|
2795
|
+
r === void 0 ? me = null : (me = r, me === "str" && (fe = !0));
|
|
2471
2796
|
let i = t.s;
|
|
2472
|
-
i === void 0 && (
|
|
2473
|
-
colStart:
|
|
2474
|
-
rowStart:
|
|
2475
|
-
colEnd:
|
|
2476
|
-
rowEnd:
|
|
2797
|
+
i === void 0 && (Me !== null || je) && (i = "0"), i !== void 0 && (i = parseInt(i), Oe && Oe.value === i && Oe.colEnd + 1 === D ? Oe.colEnd = D : (Oe = {
|
|
2798
|
+
colStart: D,
|
|
2799
|
+
rowStart: E,
|
|
2800
|
+
colEnd: D,
|
|
2801
|
+
rowEnd: E,
|
|
2477
2802
|
value: i
|
|
2478
|
-
},
|
|
2803
|
+
}, g.push(Oe))), ce = null, w = !1;
|
|
2479
2804
|
let a = t.cm;
|
|
2480
|
-
|
|
2805
|
+
C = a !== void 0 && ((e) => {
|
|
2481
2806
|
let t = o?.get("metadata")?.cells;
|
|
2482
2807
|
if (!t) return !1;
|
|
2483
2808
|
let n = parseInt(e, 10);
|
|
@@ -2485,170 +2810,233 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2485
2810
|
})(a);
|
|
2486
2811
|
let s = t.vm;
|
|
2487
2812
|
if (s !== void 0) {
|
|
2488
|
-
let e =
|
|
2489
|
-
if (
|
|
2813
|
+
let e = T(s);
|
|
2814
|
+
if (z.isError(e)) {
|
|
2490
2815
|
let t = e.getCode();
|
|
2491
|
-
|
|
2816
|
+
O = {
|
|
2492
2817
|
t: "e",
|
|
2493
2818
|
v: t
|
|
2494
|
-
},
|
|
2819
|
+
}, C && t === z.Code.Spill && (w = !0);
|
|
2495
2820
|
}
|
|
2496
2821
|
}
|
|
2497
2822
|
}
|
|
2498
2823
|
} else {
|
|
2499
|
-
if (
|
|
2500
|
-
|
|
2824
|
+
if (Ae && r === "row") {
|
|
2825
|
+
u = !0;
|
|
2501
2826
|
let t = e.attributes.r;
|
|
2502
|
-
if (
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2827
|
+
if (E = t === void 0 ? E + 1 : parseInt(t) - 1, D = -1, c?.()) {
|
|
2828
|
+
let e = d[d.length - 1];
|
|
2829
|
+
e && e.max + 1 === E ? e.max = E : d.push({
|
|
2830
|
+
min: E,
|
|
2831
|
+
max: E
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
if (A = 0, ve = e.attributes.customHeight, ve !== void 0 && (A |= Kn.CustomHeight), ve !== F && (I = !0, F = ve), j = e.attributes.ht, j !== void 0 && (A |= Kn.Ht), j !== Se && (I = !0, Se = j), ye = e.attributes.hidden, ye !== void 0 && (A |= Kn.Hidden), ye !== Ce && (I = !0, Ce = ye), M = e.attributes.s, M !== void 0 && (A |= Kn.S), M !== Te && (I = !0, Te = M), be = e.attributes.customFormat, be !== void 0 && (A |= Kn.CustomFormat), be !== we && (I = !0, we = be), N = e.attributes.outlineLevel, N !== void 0 && (A |= Kn.OutlineLevel), N !== Ee && (I = !0, Ee = N), P = e.attributes.collapsed, P !== void 0 && (A |= Kn.Collapsed), P !== De && (I = !0, De = P), A !== 0) {
|
|
2835
|
+
if (_e + 1 !== E || I) {
|
|
2836
|
+
let e = ve !== void 0 && (ve === "1" || ve === "true"), t = be !== void 0 && (be === "1" || be === "true");
|
|
2837
|
+
Me = t && M !== void 0 ? M : null, t && Me === null && (Me = "0"), ge = {
|
|
2838
|
+
min: E,
|
|
2839
|
+
max: E,
|
|
2508
2840
|
value: {
|
|
2509
|
-
sz:
|
|
2841
|
+
sz: j === void 0 ? -1 : parseFloat(j),
|
|
2510
2842
|
csz: e,
|
|
2511
|
-
h:
|
|
2512
|
-
s:
|
|
2513
|
-
l:
|
|
2514
|
-
cl:
|
|
2843
|
+
h: ye !== void 0 && (ye === "1" || ye === "true"),
|
|
2844
|
+
s: Me === null ? void 0 : Me === "0" ? 0 : parseInt(Me),
|
|
2845
|
+
l: N === void 0 || N === "0" ? 0 : parseInt(N),
|
|
2846
|
+
cl: P !== void 0 && (P === "1" || P === "true")
|
|
2515
2847
|
}
|
|
2516
|
-
},
|
|
2517
|
-
} else
|
|
2848
|
+
}, he.push(ge);
|
|
2849
|
+
} else ge.max = E;
|
|
2518
2850
|
}
|
|
2519
|
-
|
|
2851
|
+
_e = E, I = !1;
|
|
2520
2852
|
return;
|
|
2521
2853
|
}
|
|
2522
|
-
if (r === "sheetData" && (
|
|
2523
|
-
|
|
2854
|
+
if (r === "sheetData" && (Ae = !0), !ke && r === "sheetData") {
|
|
2855
|
+
ke = !0;
|
|
2524
2856
|
let e = t.cols, n = e ? e.length : 0;
|
|
2525
|
-
for (let t = 0; !
|
|
2857
|
+
for (let t = 0; !je && t < n; t++) e[t].v.s && (je = !0);
|
|
2526
2858
|
}
|
|
2527
2859
|
n?.onOpenTag?.(e);
|
|
2528
2860
|
}
|
|
2529
|
-
},
|
|
2861
|
+
}, Fe = (t) => {
|
|
2530
2862
|
let r = t.name;
|
|
2531
|
-
if (r === "sheetData" && (
|
|
2863
|
+
if (r === "sheetData" && (Ae = !1), !_ || r !== "c" && r !== "f" || (v && (x = oe.get(v) ?? null), x && (de = ((e) => {
|
|
2864
|
+
if (e.length < 11 || (32 | e.charCodeAt(0)) != 104 || !/^HYPERLINK\(/i.test(e)) return;
|
|
2865
|
+
let t = 1, n = !1, r = 10;
|
|
2866
|
+
for (; r < e.length && t > 0; r++) {
|
|
2867
|
+
let i = e.charCodeAt(r);
|
|
2868
|
+
n ? i === 34 && (e.charCodeAt(r + 1) === 34 ? r++ : n = !1) : i === 34 ? n = !0 : i === 40 ? t++ : i === 41 && t--;
|
|
2869
|
+
}
|
|
2870
|
+
if (t !== 0 || e.slice(r).trim().length > 0) return;
|
|
2871
|
+
let i = /^HYPERLINK\(\s*"((?:[^"]|"")*)"\s*[,)]/i.exec(e);
|
|
2872
|
+
return i ? i[1].replace(/""/g, "\"") : null;
|
|
2873
|
+
})(x[2]), ae.append(E, D, x), le && ue.append(E, D)), ce !== null && se.push([ce, C ? w ? "error" : "dynamic" : "fixed"]), _ = !1, x = null, v = null, y = null, h = !1, le = !1, ce = null, C = !1, w = !1), k) {
|
|
2532
2874
|
let n = r.indexOf(":");
|
|
2533
|
-
if (n !== -1 && (r = r.slice(n + 1)),
|
|
2875
|
+
if (n !== -1 && (r = r.slice(n + 1)), fe) {
|
|
2534
2876
|
if (r === "is" || r === "v") {
|
|
2535
2877
|
let t = a?.onEnd?.();
|
|
2536
|
-
t != null && e.pushAt(
|
|
2878
|
+
t != null && e.pushAt(E, D, de !== void 0 && typeof t == "number" ? pe(l?.() ?? "") : typeof t == "number" ? "" + t : t);
|
|
2537
2879
|
} else r !== "f" && a?.onCloseTag?.(t);
|
|
2538
2880
|
}
|
|
2539
|
-
|
|
2881
|
+
h &&= !1, r === "c" && (k = null, fe = !1);
|
|
2540
2882
|
} else {
|
|
2541
|
-
if (
|
|
2883
|
+
if (u) return u = !1, void (Oe = null);
|
|
2542
2884
|
n?.onCloseTag?.(t);
|
|
2543
2885
|
}
|
|
2544
|
-
},
|
|
2545
|
-
let
|
|
2546
|
-
if (
|
|
2547
|
-
switch (
|
|
2886
|
+
}, Le = (i) => {
|
|
2887
|
+
let c = i.trim();
|
|
2888
|
+
if (h) {
|
|
2889
|
+
switch (O = null, me) {
|
|
2548
2890
|
case null:
|
|
2549
2891
|
case "n":
|
|
2550
|
-
|
|
2892
|
+
O = parseFloat(c);
|
|
2551
2893
|
break;
|
|
2552
2894
|
case "b":
|
|
2553
|
-
|
|
2895
|
+
O = c === "1" || c === "true";
|
|
2896
|
+
break;
|
|
2897
|
+
case "s": {
|
|
2898
|
+
let e = parseInt(c, 10), t = m.get(e);
|
|
2899
|
+
if (t === void 0) {
|
|
2900
|
+
let n = f?.get(e);
|
|
2901
|
+
t = n ? Ln(n, p) : null, m.set(e, t);
|
|
2902
|
+
}
|
|
2903
|
+
O = t ? {
|
|
2904
|
+
t: "r",
|
|
2905
|
+
v: {
|
|
2906
|
+
type: "richText",
|
|
2907
|
+
data: { runs: t }
|
|
2908
|
+
}
|
|
2909
|
+
} : c;
|
|
2554
2910
|
break;
|
|
2555
|
-
|
|
2556
|
-
|
|
2911
|
+
}
|
|
2912
|
+
case "d": {
|
|
2913
|
+
let e = ((e, t = !1) => {
|
|
2914
|
+
if (!e) return null;
|
|
2915
|
+
let n = Mn.exec(e);
|
|
2916
|
+
if (n) {
|
|
2917
|
+
let [, e, t, r] = n;
|
|
2918
|
+
return e === void 0 && t === void 0 && r === void 0 ? null : (3600 * parseFloat(e ?? "0") + 60 * parseFloat(t ?? "0") + parseFloat(r ?? "0")) / 86400;
|
|
2919
|
+
}
|
|
2920
|
+
let r = jn.exec(e);
|
|
2921
|
+
if (!r) return null;
|
|
2922
|
+
let [, i, a, o, s, c, l, u] = r;
|
|
2923
|
+
if (i === void 0 && s === void 0) return null;
|
|
2924
|
+
let d = 0;
|
|
2925
|
+
if (i !== void 0) {
|
|
2926
|
+
let e = parseInt(i, 10), n = parseInt(a, 10), r = parseInt(o, 10);
|
|
2927
|
+
if (n < 1 || n > 12 || r < 1 || r > 31) return null;
|
|
2928
|
+
let s = Nn(e, n, r) - Pn;
|
|
2929
|
+
if (d = s <= 60 ? s - 1 : s, t && (d -= 1462), d < 0) return null;
|
|
2930
|
+
}
|
|
2931
|
+
return s !== void 0 && (d += (3600 * parseInt(s, 10) + 60 * parseInt(c, 10) + (l === void 0 ? 0 : parseInt(l, 10)) + (u === void 0 ? 0 : parseFloat(u))) / 86400), d;
|
|
2932
|
+
})(c, !0 === o?.get(Hn));
|
|
2933
|
+
e === null ? s && (r?.(`Date '${c}' in cell ${R.cellToString({
|
|
2934
|
+
colIndex: D,
|
|
2935
|
+
rowIndex: E
|
|
2936
|
+
})} is not a date this workbook can hold; kept as text.`, void 0, "xlsx.cell.isoDateText"), O = "" + s(c)) : O = e;
|
|
2557
2937
|
break;
|
|
2938
|
+
}
|
|
2558
2939
|
case "e":
|
|
2559
|
-
if (
|
|
2560
|
-
let e =
|
|
2940
|
+
if (c === "#VALUE!") {
|
|
2941
|
+
let e = k.attributes.vm;
|
|
2561
2942
|
if (e !== void 0) {
|
|
2562
|
-
let t =
|
|
2563
|
-
if (
|
|
2564
|
-
|
|
2943
|
+
let t = T(e);
|
|
2944
|
+
if (z.isError(t)) {
|
|
2945
|
+
O = {
|
|
2565
2946
|
t: "e",
|
|
2566
2947
|
v: t.getCode()
|
|
2567
2948
|
};
|
|
2568
2949
|
break;
|
|
2569
2950
|
}
|
|
2951
|
+
if (Ye.isJSON(t)) {
|
|
2952
|
+
O = {
|
|
2953
|
+
t: "r",
|
|
2954
|
+
v: t
|
|
2955
|
+
};
|
|
2956
|
+
break;
|
|
2957
|
+
}
|
|
2570
2958
|
}
|
|
2571
2959
|
}
|
|
2572
|
-
let e =
|
|
2573
|
-
e ?
|
|
2960
|
+
let e = z.getBuiltInByLabel(c);
|
|
2961
|
+
e ? O = {
|
|
2574
2962
|
t: "e",
|
|
2575
2963
|
v: e.getCode()
|
|
2576
|
-
} : (
|
|
2577
|
-
colIndex:
|
|
2578
|
-
rowIndex:
|
|
2964
|
+
} : (O = c, r?.(`Unknown formula error '${c}' in cell ${R.cellToString({
|
|
2965
|
+
colIndex: D,
|
|
2966
|
+
rowIndex: E
|
|
2579
2967
|
})}`));
|
|
2580
2968
|
break;
|
|
2581
2969
|
case "str":
|
|
2582
|
-
case "inlineStr":
|
|
2970
|
+
case "inlineStr": fe = !0;
|
|
2583
2971
|
}
|
|
2584
|
-
|
|
2972
|
+
O !== null && e.pushAt(E, D, de === void 0 || typeof O != "number" && typeof O != "boolean" ? O : pe(O));
|
|
2585
2973
|
}
|
|
2586
|
-
if (
|
|
2587
|
-
if (ee ===
|
|
2974
|
+
if (v) {
|
|
2975
|
+
if (ee === v) x = te;
|
|
2588
2976
|
else {
|
|
2589
|
-
if (
|
|
2977
|
+
if (x = oe.get(v) ?? null, !x) {
|
|
2590
2978
|
let e = [];
|
|
2591
|
-
|
|
2592
|
-
|
|
2979
|
+
b = ie(c, E, D, e), x = [
|
|
2980
|
+
b,
|
|
2593
2981
|
e,
|
|
2594
|
-
|
|
2595
|
-
],
|
|
2982
|
+
c
|
|
2983
|
+
], oe.set(v, x);
|
|
2596
2984
|
}
|
|
2597
|
-
ee =
|
|
2985
|
+
ee = v, te = x;
|
|
2598
2986
|
}
|
|
2599
|
-
|
|
2987
|
+
v = null;
|
|
2600
2988
|
}
|
|
2601
|
-
if (
|
|
2602
|
-
if (
|
|
2989
|
+
if (_) {
|
|
2990
|
+
if (re !== null) {
|
|
2603
2991
|
let e = ((e) => {
|
|
2604
|
-
if (e.length <
|
|
2605
|
-
let t =
|
|
2606
|
-
if (t === null || e.charCodeAt(t.end) !== 41 || e.charCodeAt(t.end + 1) !== 44 || e.charCodeAt(e.length - 1) !== 41) return
|
|
2992
|
+
if (e.length < yn.length || e.slice(0, yn.length).toUpperCase() !== bn) return Sn;
|
|
2993
|
+
let t = wn(e, yn.length);
|
|
2994
|
+
if (t === null || e.charCodeAt(t.end) !== 41 || e.charCodeAt(t.end + 1) !== 44 || e.charCodeAt(e.length - 1) !== 41) return Sn;
|
|
2607
2995
|
let n = t.value;
|
|
2608
|
-
return n.toUpperCase() ===
|
|
2996
|
+
return n.toUpperCase() === xn ? Cn : n.length === 0 ? Sn : {
|
|
2609
2997
|
kind: "formula",
|
|
2610
2998
|
formula: n
|
|
2611
2999
|
};
|
|
2612
|
-
})(
|
|
2613
|
-
e.kind !== "none" &&
|
|
3000
|
+
})(c);
|
|
3001
|
+
e.kind !== "none" && re.push({
|
|
2614
3002
|
sheet: t,
|
|
2615
|
-
rowIndex:
|
|
2616
|
-
colIndex:
|
|
3003
|
+
rowIndex: E,
|
|
3004
|
+
colIndex: D,
|
|
2617
3005
|
formula: e.kind === "formula" ? e.formula : null
|
|
2618
3006
|
});
|
|
2619
3007
|
}
|
|
2620
3008
|
let e = [];
|
|
2621
|
-
|
|
2622
|
-
|
|
3009
|
+
b = ie(c, E, D, e), x = [
|
|
3010
|
+
b,
|
|
2623
3011
|
e,
|
|
2624
|
-
|
|
3012
|
+
c
|
|
2625
3013
|
];
|
|
2626
3014
|
}
|
|
2627
|
-
|
|
2628
|
-
},
|
|
3015
|
+
fe ? a?.onText?.(i) : u || n?.onText?.(c);
|
|
3016
|
+
}, L = {
|
|
2629
3017
|
r: void 0,
|
|
2630
3018
|
t: void 0,
|
|
2631
3019
|
s: void 0,
|
|
2632
3020
|
cm: void 0,
|
|
2633
3021
|
vm: void 0
|
|
2634
|
-
},
|
|
3022
|
+
}, Re = {
|
|
2635
3023
|
name: "c",
|
|
2636
|
-
attributes:
|
|
3024
|
+
attributes: L,
|
|
2637
3025
|
isSelfClosing: !1
|
|
2638
|
-
},
|
|
3026
|
+
}, ze = {
|
|
2639
3027
|
t: void 0,
|
|
2640
3028
|
si: void 0,
|
|
2641
3029
|
ref: void 0,
|
|
2642
3030
|
ca: void 0
|
|
2643
|
-
},
|
|
3031
|
+
}, Be = {
|
|
2644
3032
|
name: "f",
|
|
2645
|
-
attributes:
|
|
3033
|
+
attributes: ze,
|
|
2646
3034
|
isSelfClosing: !1
|
|
2647
|
-
},
|
|
3035
|
+
}, Ue = {
|
|
2648
3036
|
name: "v",
|
|
2649
3037
|
attributes: {},
|
|
2650
3038
|
isSelfClosing: !1
|
|
2651
|
-
},
|
|
3039
|
+
}, B = {
|
|
2652
3040
|
r: void 0,
|
|
2653
3041
|
s: void 0,
|
|
2654
3042
|
ht: void 0,
|
|
@@ -2657,23 +3045,23 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2657
3045
|
customHeight: void 0,
|
|
2658
3046
|
customFormat: void 0,
|
|
2659
3047
|
outlineLevel: void 0
|
|
2660
|
-
},
|
|
3048
|
+
}, V = {
|
|
2661
3049
|
name: "row",
|
|
2662
|
-
attributes:
|
|
3050
|
+
attributes: B,
|
|
2663
3051
|
isSelfClosing: !1
|
|
2664
|
-
},
|
|
3052
|
+
}, H = mn.NEED_MORE, U = mn.NOT_HANDLED, We = mn.decodeText, Ke = !1, qe = (e, t, n, r) => {
|
|
2665
3053
|
for (;;) {
|
|
2666
3054
|
let i = 0;
|
|
2667
3055
|
for (; t < n && ((i = e.charCodeAt(t)) === 32 || i === 9 || i === 10 || i === 13);) t++;
|
|
2668
|
-
if (t >= n) return
|
|
2669
|
-
if (i === 62) return
|
|
2670
|
-
if (i === 47) return t + 1 >= n ?
|
|
3056
|
+
if (t >= n) return H;
|
|
3057
|
+
if (i === 62) return Ke = !1, t + 1;
|
|
3058
|
+
if (i === 47) return t + 1 >= n ? H : e.charCodeAt(t + 1) === 62 ? (Ke = !0, t + 2) : U;
|
|
2671
3059
|
let a = t;
|
|
2672
3060
|
for (; t < n && (i = e.charCodeAt(t)) !== 61;) {
|
|
2673
3061
|
if (i === 62 || i === 47 || i === 32 || i === 9 || i === 10 || i === 13) return U;
|
|
2674
3062
|
t++;
|
|
2675
3063
|
}
|
|
2676
|
-
if (t + 1 >= n) return
|
|
3064
|
+
if (t + 1 >= n) return H;
|
|
2677
3065
|
let o = t - a, s = e.charCodeAt(t + 1);
|
|
2678
3066
|
if (s !== 34 && s !== 39) return U;
|
|
2679
3067
|
let c = t + 2, l = c;
|
|
@@ -2681,153 +3069,369 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2681
3069
|
if (i === 38 || i < 32) return U;
|
|
2682
3070
|
l++;
|
|
2683
3071
|
}
|
|
2684
|
-
if (l >= n) return
|
|
3072
|
+
if (l >= n) return H;
|
|
2685
3073
|
t = l + 1;
|
|
2686
3074
|
let u = e.charCodeAt(a);
|
|
2687
3075
|
if (r === 2) switch (o) {
|
|
2688
3076
|
case 1:
|
|
2689
|
-
u === 114 ?
|
|
3077
|
+
u === 114 ? B.r = e.slice(c, l) : u === 115 && (B.s = e.slice(c, l));
|
|
2690
3078
|
break;
|
|
2691
3079
|
case 2:
|
|
2692
|
-
e.startsWith("ht", a) && (
|
|
3080
|
+
e.startsWith("ht", a) && (B.ht = e.slice(c, l));
|
|
2693
3081
|
break;
|
|
2694
3082
|
case 6:
|
|
2695
|
-
e.startsWith("hidden", a) && (
|
|
3083
|
+
e.startsWith("hidden", a) && (B.hidden = e.slice(c, l));
|
|
2696
3084
|
break;
|
|
2697
3085
|
case 9:
|
|
2698
|
-
e.startsWith("collapsed", a) && (
|
|
3086
|
+
e.startsWith("collapsed", a) && (B.collapsed = e.slice(c, l));
|
|
2699
3087
|
break;
|
|
2700
|
-
case 12: e.startsWith("customHeight", a) ?
|
|
3088
|
+
case 12: e.startsWith("customHeight", a) ? B.customHeight = e.slice(c, l) : e.startsWith("customFormat", a) ? B.customFormat = e.slice(c, l) : e.startsWith("outlineLevel", a) && (B.outlineLevel = e.slice(c, l));
|
|
2701
3089
|
}
|
|
2702
|
-
else if (r === 0) o === 1 ? u === 114 ?
|
|
2703
|
-
else if (o === 1) u === 116 && (
|
|
3090
|
+
else if (r === 0) o === 1 ? u === 114 ? L.r = e.slice(c, l) : u === 116 ? L.t = e.slice(c, l) : u === 115 && (L.s = e.slice(c, l)) : o === 2 && e.charCodeAt(a + 1) === 109 && (u === 99 ? L.cm = e.slice(c, l) : u === 118 && (L.vm = e.slice(c, l)));
|
|
3091
|
+
else if (o === 1) u === 116 && (ze.t = e.slice(c, l));
|
|
2704
3092
|
else if (o === 2) {
|
|
2705
3093
|
let t = e.charCodeAt(a + 1);
|
|
2706
|
-
u === 115 && t === 105 ?
|
|
2707
|
-
} else o === 3 && e.startsWith("ref", a) && (
|
|
3094
|
+
u === 115 && t === 105 ? ze.si = e.slice(c, l) : u === 99 && t === 97 && (ze.ca = e.slice(c, l));
|
|
3095
|
+
} else o === 3 && e.startsWith("ref", a) && (ze.ref = e.slice(c, l));
|
|
2708
3096
|
}
|
|
2709
|
-
},
|
|
3097
|
+
}, Je = (e, t, n) => e.charCodeAt(t + 1) === 47 && e.charCodeAt(t + 2) === n && e.charCodeAt(t + 3) === 62;
|
|
2710
3098
|
return {
|
|
2711
3099
|
...n,
|
|
2712
3100
|
onEnd: () => {
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
3101
|
+
if (c?.()) {
|
|
3102
|
+
let e = 0, t = [], n = (e, t) => ({
|
|
3103
|
+
min: e,
|
|
3104
|
+
max: t,
|
|
3105
|
+
value: {
|
|
3106
|
+
sz: -1,
|
|
3107
|
+
csz: !1,
|
|
3108
|
+
h: !0,
|
|
3109
|
+
s: void 0,
|
|
3110
|
+
l: 0,
|
|
3111
|
+
cl: !1
|
|
3112
|
+
}
|
|
3113
|
+
});
|
|
3114
|
+
for (let r of d) r.min > e && t.push(n(e, r.min - 1)), e = Math.max(e, r.max + 1);
|
|
3115
|
+
e <= xe && t.push(n(e, xe)), t.length > 0 && (he.push(...t), he.sort((e, t) => e.min - t.min));
|
|
3116
|
+
}
|
|
3117
|
+
he.length > 0 && (t.rows = R.runsToRefs(he, !1));
|
|
3118
|
+
let r = ae.done(qn);
|
|
3119
|
+
r = ((e, t) => {
|
|
3120
|
+
let n = null;
|
|
3121
|
+
for (let t = 0; t < e.length; t++) {
|
|
3122
|
+
let r = e[t];
|
|
3123
|
+
if (!Jn.test(r.value[2])) continue;
|
|
3124
|
+
n ??= /* @__PURE__ */ new Map();
|
|
3125
|
+
let i = r.value[0], a = n.get(i);
|
|
3126
|
+
a ? a.push(r) : n.set(i, [r]);
|
|
3127
|
+
}
|
|
3128
|
+
if (n === null) return e;
|
|
3129
|
+
let r = /* @__PURE__ */ new Set();
|
|
3130
|
+
for (let e of n.values()) {
|
|
3131
|
+
let n = e[0], i = {
|
|
3132
|
+
rowStart: n.rowStart,
|
|
3133
|
+
colStart: n.colStart,
|
|
3134
|
+
rowEnd: n.rowEnd,
|
|
3135
|
+
colEnd: n.colEnd
|
|
3136
|
+
}, a = 0;
|
|
3137
|
+
for (let t = 0; t < e.length; t++) {
|
|
3138
|
+
let n = e[t];
|
|
3139
|
+
n.rowStart < i.rowStart && (i.rowStart = n.rowStart), n.colStart < i.colStart && (i.colStart = n.colStart), n.rowEnd > i.rowEnd && (i.rowEnd = n.rowEnd), n.colEnd > i.colEnd && (i.colEnd = n.colEnd), a += (n.rowEnd - n.rowStart + 1) * (n.colEnd - n.colStart + 1);
|
|
3140
|
+
}
|
|
3141
|
+
if (a !== (i.rowEnd - i.rowStart + 1) * (i.colEnd - i.colStart + 1)) continue;
|
|
3142
|
+
let o = An(R.resolveRelativeToA1(n.value[1], i.rowStart, i.colStart), i);
|
|
3143
|
+
if (o) {
|
|
3144
|
+
t.push(o);
|
|
3145
|
+
for (let t = 0; t < e.length; t++) r.add(e[t]);
|
|
3146
|
+
}
|
|
3147
|
+
}
|
|
3148
|
+
return r.size === 0 ? e : e.filter((e) => !r.has(e));
|
|
3149
|
+
})(r, S);
|
|
3150
|
+
let i = r.length;
|
|
3151
|
+
if (i > 0 || S.length > 0) {
|
|
2716
3152
|
let e = Array(i);
|
|
2717
3153
|
for (let t = 0; t < i; t++) {
|
|
2718
|
-
let n = r[t], i =
|
|
3154
|
+
let n = r[t], i = R.rangeToString(n), a = n.value[1], o = R.resolveRelativeToA1(a, n.rowStart, n.colStart);
|
|
2719
3155
|
e[t] = [i, o];
|
|
2720
3156
|
}
|
|
3157
|
+
for (let t = 0; t < S.length; t++) {
|
|
3158
|
+
let n = S[t], r = n.ref;
|
|
3159
|
+
e.push([R.cellToString({
|
|
3160
|
+
rowIndex: r.rowStart,
|
|
3161
|
+
colIndex: r.colStart
|
|
3162
|
+
}), Ie(n)]), se.push([R.rangeToString(r), "dynamic"]);
|
|
3163
|
+
}
|
|
2721
3164
|
t.formulas = e;
|
|
2722
3165
|
}
|
|
2723
|
-
let a =
|
|
3166
|
+
let a = ue.done(!0), o = a.length;
|
|
2724
3167
|
if (o > 0) {
|
|
2725
3168
|
let e = Array(o);
|
|
2726
3169
|
for (let t = 0; t < o; t++) {
|
|
2727
|
-
let n = a[t], r =
|
|
3170
|
+
let n = a[t], r = R.rangeToString(n);
|
|
2728
3171
|
e[t] = r;
|
|
2729
3172
|
}
|
|
2730
3173
|
t.volatile = e;
|
|
2731
3174
|
}
|
|
2732
|
-
|
|
2733
|
-
let s =
|
|
3175
|
+
se.length > 0 && (t.formulaArray = [...se]);
|
|
3176
|
+
let s = g.length;
|
|
2734
3177
|
if (s > 0) {
|
|
2735
|
-
|
|
2736
|
-
let e =
|
|
3178
|
+
g.sort(He.createRangeComparator(Ge.Axis.Column));
|
|
3179
|
+
let e = g[0], n = e.colStart, r = e.colEnd, i = e.rowEnd, a = e.value, o = [];
|
|
2737
3180
|
o.push(e);
|
|
2738
3181
|
let c = null;
|
|
2739
|
-
for (let t = 1; t < s; t++) c =
|
|
2740
|
-
let
|
|
2741
|
-
for (let e = 0; e <
|
|
2742
|
-
let t = o[e], n =
|
|
2743
|
-
|
|
3182
|
+
for (let t = 1; t < s; t++) c = g[t], a !== c.value || n !== c.colStart || r !== c.colEnd || i + 1 !== c.rowEnd ? (o.push(c), e = c, n = e.colStart, r = e.colEnd, i = e.rowEnd, a = e.value) : (i = c.rowEnd, e.rowEnd = i);
|
|
3183
|
+
let l = o.length, u = Array(l);
|
|
3184
|
+
for (let e = 0; e < l; e++) {
|
|
3185
|
+
let t = o[e], n = R.rangeToString(t);
|
|
3186
|
+
u[e] = [n, t.value];
|
|
2744
3187
|
}
|
|
2745
|
-
t.directStyles =
|
|
3188
|
+
t.directStyles = u;
|
|
2746
3189
|
}
|
|
2747
|
-
let
|
|
2748
|
-
|
|
3190
|
+
let l = e.build();
|
|
3191
|
+
l && (t.data = l.tuples), n?.onEnd?.();
|
|
2749
3192
|
},
|
|
2750
|
-
onOpenTag:
|
|
2751
|
-
onCloseTag:
|
|
2752
|
-
onText:
|
|
3193
|
+
onOpenTag: Pe,
|
|
3194
|
+
onCloseTag: Fe,
|
|
3195
|
+
onText: Le,
|
|
2753
3196
|
elementScanners: [{
|
|
2754
3197
|
name: "c",
|
|
2755
3198
|
scan: (e, t, n) => {
|
|
2756
|
-
if (!
|
|
2757
|
-
|
|
2758
|
-
let r =
|
|
3199
|
+
if (!u || k !== null) return U;
|
|
3200
|
+
L.r = L.t = L.s = L.cm = L.vm = void 0;
|
|
3201
|
+
let r = qe(e, t + 2, n, 0);
|
|
2759
3202
|
if (r < 0) return r;
|
|
2760
|
-
let i =
|
|
2761
|
-
if (
|
|
2762
|
-
let a = !1, o = -1,
|
|
2763
|
-
if (!
|
|
3203
|
+
let i = L.t;
|
|
3204
|
+
if (L.r === void 0 || i === "str" || i === "inlineStr") return U;
|
|
3205
|
+
let a = !1, o = -1, s = -1, c = -1, l = -1, d = r;
|
|
3206
|
+
if (!Ke) for (ze.t = ze.si = ze.ref = ze.ca = void 0;;) {
|
|
2764
3207
|
let t = e.indexOf("<", r);
|
|
2765
|
-
if (t === -1 || t + 3 >= n) return
|
|
3208
|
+
if (t === -1 || t + 3 >= n) return H;
|
|
2766
3209
|
for (let n = r; n < t; n++) {
|
|
2767
3210
|
let t = e.charCodeAt(n);
|
|
2768
3211
|
if (t !== 32 && t !== 9 && t !== 10 && t !== 13) return U;
|
|
2769
3212
|
}
|
|
2770
|
-
let i = e.charCodeAt(t + 1),
|
|
3213
|
+
let i = e.charCodeAt(t + 1), u = e.charCodeAt(t + 2);
|
|
2771
3214
|
if (i === 47) {
|
|
2772
|
-
if (!
|
|
3215
|
+
if (!Je(e, t, 99)) return U;
|
|
2773
3216
|
d = t + 4;
|
|
2774
3217
|
break;
|
|
2775
3218
|
}
|
|
2776
|
-
if (i === 102 && !a &&
|
|
2777
|
-
if (a = !0, r =
|
|
2778
|
-
if (
|
|
3219
|
+
if (i === 102 && !a && c === -1 && (u === 32 || u === 62 || u === 47)) {
|
|
3220
|
+
if (a = !0, r = qe(e, t + 2, n, 1), r < 0) return r;
|
|
3221
|
+
if (ze.t === "dataTable") return U;
|
|
3222
|
+
if (Ke) continue;
|
|
2779
3223
|
let i = e.indexOf("<", r);
|
|
2780
|
-
if (i === -1 || i + 3 >= n) return
|
|
2781
|
-
if (!
|
|
2782
|
-
o = r,
|
|
2783
|
-
} else if (i === 118 &&
|
|
3224
|
+
if (i === -1 || i + 3 >= n) return H;
|
|
3225
|
+
if (!Je(e, i, 102)) return U;
|
|
3226
|
+
o = r, s = i, r = i + 4;
|
|
3227
|
+
} else if (i === 118 && u === 62 && c === -1) {
|
|
2784
3228
|
let i = e.indexOf("<", t + 3);
|
|
2785
|
-
if (i === -1 || i + 3 >= n) return
|
|
2786
|
-
if (!
|
|
2787
|
-
|
|
3229
|
+
if (i === -1 || i + 3 >= n) return H;
|
|
3230
|
+
if (!Je(e, i, 118)) return U;
|
|
3231
|
+
c = t + 3, l = i, r = i + 4;
|
|
2788
3232
|
} else return U;
|
|
2789
3233
|
}
|
|
2790
|
-
return
|
|
3234
|
+
return Pe(Re), a && (Pe(Be), s > o && Le(We(e.slice(o, s))), Fe(Be)), c !== -1 && (Pe(Ue), l > c && Le(We(e.slice(c, l))), Fe(Ue)), Fe(Re), d;
|
|
2791
3235
|
}
|
|
2792
3236
|
}, {
|
|
2793
3237
|
name: "row",
|
|
2794
|
-
openTag:
|
|
3238
|
+
openTag: V,
|
|
2795
3239
|
scan: (e, t, n) => {
|
|
2796
|
-
if (!
|
|
2797
|
-
|
|
2798
|
-
let r =
|
|
2799
|
-
return r < 0 ? r :
|
|
3240
|
+
if (!Ae || u || k !== null) return U;
|
|
3241
|
+
B.r = B.s = B.ht = B.hidden = B.collapsed = B.customHeight = B.customFormat = B.outlineLevel = void 0;
|
|
3242
|
+
let r = qe(e, t + 4, n, 2);
|
|
3243
|
+
return r < 0 ? r : Ke || B.r === void 0 ? U : (Pe(V), r);
|
|
2800
3244
|
}
|
|
2801
3245
|
}]
|
|
2802
3246
|
};
|
|
2803
|
-
},
|
|
3247
|
+
}, Qn = /* @__PURE__ */ new Map([
|
|
3248
|
+
["urn:schemas-microsoft-com:vml", "v"],
|
|
3249
|
+
["urn:schemas-microsoft-com:office:office", "o"],
|
|
3250
|
+
["urn:schemas-microsoft-com:office:excel", "x"]
|
|
3251
|
+
]), $n = [...Qn].map(([e, t]) => ` xmlns:${t}="${e}"`).join(""), er = /<(\/?)([A-Za-z_][\w.-]*(?::[\w.-]+)?)((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>/g, tr = /(\s+)([A-Za-z_][\w.-]*(?::[\w.-]+)?)(\s*=\s*)("[^"]*"|'[^']*')/g, nr = /\sxmlns(?::([\w.-]+))?\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
|
|
3252
|
+
function rr(e) {
|
|
3253
|
+
if (!e || !((e) => {
|
|
3254
|
+
let t;
|
|
3255
|
+
for (nr.lastIndex = 0; (t = nr.exec(e)) !== null;) {
|
|
3256
|
+
let e = Qn.get(t[2] ?? t[3] ?? "");
|
|
3257
|
+
if (e && e !== (t[1] ?? "")) return !0;
|
|
3258
|
+
}
|
|
3259
|
+
return !1;
|
|
3260
|
+
})(e)) return e;
|
|
3261
|
+
let t = [], n = (e, n, r) => {
|
|
3262
|
+
let i = e.indexOf(":");
|
|
3263
|
+
if (i === -1 && r) return null;
|
|
3264
|
+
let a = i === -1 ? "" : e.substring(0, i);
|
|
3265
|
+
if (a === "xmlns") return null;
|
|
3266
|
+
let o = ((e, n) => {
|
|
3267
|
+
let r = n?.get(e);
|
|
3268
|
+
if (r !== void 0) return r;
|
|
3269
|
+
for (let n = t.length - 1; n >= 0; n--) {
|
|
3270
|
+
let r = t[n].bindings.get(e);
|
|
3271
|
+
if (r !== void 0) return r;
|
|
3272
|
+
}
|
|
3273
|
+
})(a, n), s = o === void 0 ? void 0 : Qn.get(o);
|
|
3274
|
+
return s ? `${s}:${i === -1 ? e : e.substring(i + 1)}` : null;
|
|
3275
|
+
}, r = !1, i = !1, a = e.replace(er, (e, a, o, s, c) => {
|
|
3276
|
+
if (a) {
|
|
3277
|
+
let r = t[t.length - 1], i = n(o, null, !1);
|
|
3278
|
+
return r && r.name === o && (r.nested > 0 ? r.nested-- : t.pop()), i ? `</${i}>` : e;
|
|
3279
|
+
}
|
|
3280
|
+
let l = ((e) => {
|
|
3281
|
+
let t, n = null;
|
|
3282
|
+
for (nr.lastIndex = 0; (t = nr.exec(e)) !== null;) (n ??= /* @__PURE__ */ new Map()).set(t[1] ?? "", t[2] ?? t[3] ?? "");
|
|
3283
|
+
return n;
|
|
3284
|
+
})(s);
|
|
3285
|
+
l?.forEach((e, t) => {
|
|
3286
|
+
let n = [...Qn].find(([, e]) => e === t)?.[0];
|
|
3287
|
+
n && n !== e && (r = !0);
|
|
3288
|
+
});
|
|
3289
|
+
let u = n(o, l, !1), d = s.replace(tr, (e, t, r, i, a) => {
|
|
3290
|
+
if (r === "xmlns" || r.startsWith("xmlns:")) {
|
|
3291
|
+
let t = a.slice(1, -1);
|
|
3292
|
+
return Qn.has(t) ? "" : e;
|
|
3293
|
+
}
|
|
3294
|
+
let o = n(r, l, !0);
|
|
3295
|
+
return o ? `${t}${o}${i}${a}` : e;
|
|
3296
|
+
});
|
|
3297
|
+
if (i || (i = !0, d = d.replace(/\s+$/, "") + $n), !c) {
|
|
3298
|
+
let e = t[t.length - 1];
|
|
3299
|
+
l ? t.push({
|
|
3300
|
+
name: o,
|
|
3301
|
+
bindings: l,
|
|
3302
|
+
nested: 0
|
|
3303
|
+
}) : e && e.name === o && e.nested++;
|
|
3304
|
+
}
|
|
3305
|
+
return `<${u ?? o}${d}${c}>`;
|
|
3306
|
+
});
|
|
3307
|
+
return r ? e : a;
|
|
3308
|
+
}
|
|
3309
|
+
var ir = {
|
|
3310
|
+
creator: "author",
|
|
3311
|
+
category: "category",
|
|
3312
|
+
description: "comments",
|
|
3313
|
+
contentStatus: "contentStatus",
|
|
3314
|
+
created: "creationDate",
|
|
3315
|
+
keywords: "keywords",
|
|
3316
|
+
lastModifiedBy: "lastAuthor",
|
|
3317
|
+
modified: "lastModifiedDate",
|
|
3318
|
+
lastPrinted: "lastPrinted",
|
|
3319
|
+
revision: "revisionNumber",
|
|
3320
|
+
subject: "subject",
|
|
3321
|
+
title: "title"
|
|
3322
|
+
}, ar = {
|
|
3323
|
+
Company: "company",
|
|
3324
|
+
Manager: "manager"
|
|
3325
|
+
}, or = {
|
|
3326
|
+
lpwstr: U.Type.String,
|
|
3327
|
+
lpstr: U.Type.String,
|
|
3328
|
+
bstr: U.Type.String,
|
|
3329
|
+
i1: U.Type.Number,
|
|
3330
|
+
i2: U.Type.Number,
|
|
3331
|
+
i4: U.Type.Number,
|
|
3332
|
+
i8: U.Type.Number,
|
|
3333
|
+
int: U.Type.Number,
|
|
3334
|
+
ui1: U.Type.Number,
|
|
3335
|
+
ui2: U.Type.Number,
|
|
3336
|
+
ui4: U.Type.Number,
|
|
3337
|
+
ui8: U.Type.Number,
|
|
3338
|
+
uint: U.Type.Number,
|
|
3339
|
+
r4: U.Type.Float,
|
|
3340
|
+
r8: U.Type.Float,
|
|
3341
|
+
decimal: U.Type.Float,
|
|
3342
|
+
bool: U.Type.Boolean,
|
|
3343
|
+
filetime: U.Type.Date,
|
|
3344
|
+
date: U.Type.Date
|
|
3345
|
+
}, sr = (e) => {
|
|
3346
|
+
let t = e.kind ? or[e.kind] : void 0;
|
|
3347
|
+
if (!t) return null;
|
|
3348
|
+
let n = e.value.trim(), r;
|
|
3349
|
+
if (t === U.Type.String) r = {
|
|
3350
|
+
key: e.key,
|
|
3351
|
+
type: t,
|
|
3352
|
+
value: e.value
|
|
3353
|
+
};
|
|
3354
|
+
else if (t === U.Type.Boolean) {
|
|
3355
|
+
if (n !== "true" && n !== "false" && n !== "1" && n !== "0") return null;
|
|
3356
|
+
r = {
|
|
3357
|
+
key: e.key,
|
|
3358
|
+
type: t,
|
|
3359
|
+
value: n === "true" || n === "1"
|
|
3360
|
+
};
|
|
3361
|
+
} else if (t === U.Type.Date) {
|
|
3362
|
+
let i = new Date(n);
|
|
3363
|
+
if (!n || isNaN(i.getTime())) return null;
|
|
3364
|
+
r = {
|
|
3365
|
+
key: e.key,
|
|
3366
|
+
type: t,
|
|
3367
|
+
value: i.toISOString()
|
|
3368
|
+
};
|
|
3369
|
+
} else {
|
|
3370
|
+
let i = Number(n);
|
|
3371
|
+
if (!n || !Number.isFinite(i)) return null;
|
|
3372
|
+
let a = t === U.Type.Number && i >= -2147483648 && i <= 2147483647;
|
|
3373
|
+
r = {
|
|
3374
|
+
key: e.key,
|
|
3375
|
+
type: a ? t : U.Type.Float,
|
|
3376
|
+
value: i
|
|
3377
|
+
};
|
|
3378
|
+
}
|
|
3379
|
+
return e.linkTarget && (r.linkTarget = e.linkTarget), r;
|
|
3380
|
+
}, cr = "hiddenXfs", lr = (e) => (Array.isArray(e) ? e[1] : e?.v)?.s, ur = (e) => {
|
|
2804
3381
|
if (!e || e.length === 0) return !1;
|
|
2805
|
-
let t =
|
|
3382
|
+
let t = R.refsToRuns(e, !0), n = 0;
|
|
2806
3383
|
for (let e of t) {
|
|
2807
3384
|
if (e.min > n || e.value?.s === void 0) return !1;
|
|
2808
3385
|
n = Math.max(n, e.max + 1);
|
|
2809
3386
|
}
|
|
2810
|
-
return n >
|
|
2811
|
-
},
|
|
3387
|
+
return n > D;
|
|
3388
|
+
}, dr = (e, t) => {
|
|
2812
3389
|
e.protection = {
|
|
2813
3390
|
...e.protection,
|
|
2814
3391
|
showFormulas: t
|
|
2815
3392
|
};
|
|
2816
|
-
},
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
3393
|
+
}, fr = "xfComplements", pr = (e, t) => {
|
|
3394
|
+
if (typeof e == "string") return void t.push(e);
|
|
3395
|
+
let n = Array.isArray(e) ? e : [e];
|
|
3396
|
+
for (let e = 0; e < n.length; e++) {
|
|
3397
|
+
let r = R.rangeToString(n[e]);
|
|
3398
|
+
r && t.push(r);
|
|
3399
|
+
}
|
|
3400
|
+
}, mr = (e) => {
|
|
3401
|
+
let t = Array.isArray(e) ? e[1] : e.v;
|
|
3402
|
+
if (!t || !("s" in t)) return;
|
|
3403
|
+
let n = t.s;
|
|
3404
|
+
return delete t.s, n;
|
|
3405
|
+
}, hr = (e, t, n, r) => {
|
|
3406
|
+
if (!e) return;
|
|
3407
|
+
let i = t ? 2 : 1, a = t ? n.rowStart : n.colStart, o = t ? n.rowEnd : n.colEnd, s, c = -1;
|
|
3408
|
+
for (let n of e) {
|
|
3409
|
+
let e = R.refToRun(n, t), l = mr(n);
|
|
3410
|
+
e && l !== void 0 ? l !== c || (t ? s.colEnd : s.rowEnd) + 1 !== e.min ? (s = {
|
|
3411
|
+
colStart: t ? e.min : a,
|
|
3412
|
+
rowStart: t ? a : e.min,
|
|
3413
|
+
colEnd: t ? e.max : o,
|
|
3414
|
+
rowEnd: t ? o : e.max,
|
|
3415
|
+
value: {
|
|
3416
|
+
kind: i,
|
|
3417
|
+
index: l
|
|
3418
|
+
}
|
|
3419
|
+
}, c = l, r.push(s)) : t ? s.colEnd = e.max : s.rowEnd = e.max : c = -1;
|
|
3420
|
+
}
|
|
3421
|
+
}, gr = {
|
|
2820
3422
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
|
|
2821
3423
|
"application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
|
|
2822
3424
|
"application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
|
|
2823
3425
|
"application/vnd.ms-excel.addin.macroEnabled.main+xml": "workbooks",
|
|
2824
3426
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": "workbooks",
|
|
3427
|
+
"application/vnd.ms-excel.template.macroEnabled.main+xml": "workbooks",
|
|
2825
3428
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": "sheets",
|
|
2826
3429
|
"application/vnd.ms-excel.worksheet": "sheets",
|
|
2827
3430
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": "charts",
|
|
2828
3431
|
"application/vnd.ms-excel.chartsheet": "charts",
|
|
2829
3432
|
"application/vnd.ms-excel.macrosheet+xml": "macros",
|
|
2830
3433
|
"application/vnd.ms-excel.macrosheet": "macros",
|
|
3434
|
+
"application/vnd.ms-excel.intlmacrosheet+xml": "macros",
|
|
2831
3435
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": "dialogs",
|
|
2832
3436
|
"application/vnd.ms-excel.dialogsheet": "dialogs",
|
|
2833
3437
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml": "strs",
|
|
@@ -2843,50 +3447,68 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2843
3447
|
"application/vnd.ms-excel.person+xml": "people",
|
|
2844
3448
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "metadata",
|
|
2845
3449
|
"application/vnd.ms-excel.sheetMetadata": "metadata",
|
|
3450
|
+
"application/vnd.ms-excel.featurepropertybag+xml": "featurePropertyBag",
|
|
2846
3451
|
"application/vnd.ms-excel.externalLink": "links",
|
|
2847
3452
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
|
|
2848
3453
|
"application/vnd.openxmlformats-officedocument.theme+xml": "themes"
|
|
2849
|
-
},
|
|
2850
|
-
|
|
2851
|
-
|
|
3454
|
+
}, _r = w({ readXLSX: () => Sr }), vr = (e) => e.startsWith("/") ? e.slice(1) : e, yr = [
|
|
3455
|
+
208,
|
|
3456
|
+
207,
|
|
3457
|
+
17,
|
|
3458
|
+
224,
|
|
3459
|
+
161,
|
|
3460
|
+
177,
|
|
3461
|
+
26,
|
|
3462
|
+
225
|
|
3463
|
+
], br = /^xl\/worksheets\/[^/]+\.xml$/i, xr = (e) => typeof e == "string" ? e : (e?.runs ?? []).map((e) => e.text ?? "").join(""), Sr = async (e, r) => {
|
|
3464
|
+
let { password: a, onVBA: o, profile: s, calcOnLoad: c = "auto", createWorkbookOptions: l = {}, ...d } = r ?? {};
|
|
3465
|
+
await Ue.load();
|
|
3466
|
+
let f = !!l.origin && typeof l.origin != "string", p = s ? new ht(typeof s == "function" ? s : void 0) : null, m = [], g = (e, t, n) => {
|
|
3467
|
+
m.push([
|
|
2852
3468
|
e,
|
|
2853
3469
|
t ?? "",
|
|
2854
3470
|
n
|
|
2855
3471
|
]);
|
|
2856
|
-
},
|
|
2857
|
-
if (
|
|
2858
|
-
|
|
2859
|
-
let t = Math.min(b, Math.round(
|
|
2860
|
-
|
|
2861
|
-
} : void 0,
|
|
3472
|
+
}, _ = { onWarning: g }, v = r?.progress, y = v?.onProgress ? v.onProgress.bind(v) : void 0, b = e.byteLength, x = 0, ee = 0, te = y ? (e) => {
|
|
3473
|
+
if (x <= 0) return;
|
|
3474
|
+
ee += e;
|
|
3475
|
+
let t = Math.min(b, Math.round(ee / x * b));
|
|
3476
|
+
y(t, b);
|
|
3477
|
+
} : void 0, ne = import("./DVLJTjJCGqrJUa8c.mjs"), re = null;
|
|
2862
3478
|
try {
|
|
2863
|
-
|
|
3479
|
+
re = new DOMParser();
|
|
2864
3480
|
} catch {}
|
|
2865
|
-
let
|
|
3481
|
+
let ie = null;
|
|
2866
3482
|
try {
|
|
2867
|
-
|
|
3483
|
+
ie = new XMLSerializer();
|
|
2868
3484
|
} catch {}
|
|
2869
|
-
let
|
|
2870
|
-
|
|
3485
|
+
let C, w, T, ue = null;
|
|
3486
|
+
re || (ue = import("./DO75RoAQTgMuVzXv.mjs").then((e) => M(e.default, 1)));
|
|
2871
3487
|
try {
|
|
2872
|
-
let [e, t] = await Promise.all([
|
|
2873
|
-
|
|
3488
|
+
let [e, t] = await Promise.all([ue, ne]);
|
|
3489
|
+
C = new t.DOMTransformer(), w = re ?? new e.DOMParser(), T = ie ?? new e.XMLSerializer();
|
|
2874
3490
|
} catch (e) {
|
|
2875
3491
|
throw Error("Unable to load XLSX parser.", { cause: e });
|
|
2876
3492
|
}
|
|
2877
|
-
let
|
|
3493
|
+
let fe = (e) => T.serializeToString(e);
|
|
3494
|
+
if (((e) => {
|
|
3495
|
+
if (e.byteLength < yr.length) return !1;
|
|
3496
|
+
let t = new Uint8Array(e, 0, yr.length);
|
|
3497
|
+
return yr.every((e, n) => t[n] === e);
|
|
3498
|
+
})(e)) throw new Re("This is an Excel 97-2003 workbook (.xls), which cannot be read. Save it as '.xlsx' and try again.");
|
|
3499
|
+
let k;
|
|
2878
3500
|
try {
|
|
2879
|
-
|
|
3501
|
+
k = await mt.create(e);
|
|
2880
3502
|
} catch (e) {
|
|
2881
|
-
throw new
|
|
3503
|
+
throw new Re("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: e });
|
|
2882
3504
|
}
|
|
2883
|
-
|
|
3505
|
+
p?.mark("zip-open");
|
|
2884
3506
|
try {
|
|
2885
|
-
if (!
|
|
3507
|
+
if (!k.has("[Content_Types].xml")) throw new Re("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
2886
3508
|
let e = (e) => {
|
|
2887
|
-
let t =
|
|
3509
|
+
let t = k.getEntry(e);
|
|
2888
3510
|
return t ? { content: t } : void 0;
|
|
2889
|
-
},
|
|
3511
|
+
}, r = {
|
|
2890
3512
|
workbooks: [],
|
|
2891
3513
|
sheets: [],
|
|
2892
3514
|
charts: [],
|
|
@@ -2903,6 +3525,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2903
3525
|
styles: [],
|
|
2904
3526
|
metadata: [],
|
|
2905
3527
|
people: [],
|
|
3528
|
+
featurePropertyBag: [],
|
|
2906
3529
|
overrides: {},
|
|
2907
3530
|
sst: "",
|
|
2908
3531
|
style: "",
|
|
@@ -2919,7 +3542,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2919
3542
|
let t = r.ContentType, n = r.PartName;
|
|
2920
3543
|
if (!t || !n) return;
|
|
2921
3544
|
e.overrides[n.startsWith("/") ? n.slice(1) : n] = t;
|
|
2922
|
-
let i =
|
|
3545
|
+
let i = gr[t], a = i ? e[i] : void 0;
|
|
2923
3546
|
Array.isArray(a) && a.push(n);
|
|
2924
3547
|
} else if (n === "Default") {
|
|
2925
3548
|
let t = r.Extension, n = r.ContentType;
|
|
@@ -2932,89 +3555,88 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2932
3555
|
onError: (e) => {
|
|
2933
3556
|
t?.(`Error parsing content types: ${e?.message ?? e}`);
|
|
2934
3557
|
}
|
|
2935
|
-
}))(
|
|
2936
|
-
|
|
2937
|
-
}), t = await
|
|
3558
|
+
}))(r, (e) => {
|
|
3559
|
+
m.push([e, "[Content_Types].xml"]);
|
|
3560
|
+
}), t = await k.getTextStream("[Content_Types].xml");
|
|
2938
3561
|
if (!t) throw Error("Error parsing content types: '[Content_Types].xml'");
|
|
2939
3562
|
try {
|
|
2940
|
-
await
|
|
3563
|
+
await nn.parseStream(t, e, { xmlns: !1 });
|
|
2941
3564
|
} catch (e) {
|
|
2942
3565
|
throw Error("Error parsing content types: '[Content_Types].xml'", { cause: e });
|
|
2943
3566
|
}
|
|
2944
|
-
|
|
2945
|
-
}
|
|
2946
|
-
|
|
2947
|
-
let
|
|
2948
|
-
for (let e of
|
|
2949
|
-
|
|
2950
|
-
for (let e of
|
|
2951
|
-
if (await
|
|
2952
|
-
let t =
|
|
3567
|
+
f && await k.getBuffer("[Content_Types].xml");
|
|
3568
|
+
}
|
|
3569
|
+
p?.mark("content-types");
|
|
3570
|
+
let a = r.sst, d = /* @__PURE__ */ new Set();
|
|
3571
|
+
for (let e of r.sheets) d.add(vr(e));
|
|
3572
|
+
a && d.add(vr(a));
|
|
3573
|
+
for (let e of d) x += k.uncompressedSize(e);
|
|
3574
|
+
if (await k.prefetch((e) => !d.has(e) && !br.test(e)), p?.mark("prefetch-side-parts"), r.workbooks.length === 0) {
|
|
3575
|
+
let t = me("_rels/.rels", e, w, C, _);
|
|
2953
3576
|
if (t) {
|
|
2954
3577
|
for (let e of t.values()) if (e.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" && e.target) {
|
|
2955
|
-
|
|
3578
|
+
r.workbooks.push(e.target);
|
|
2956
3579
|
break;
|
|
2957
3580
|
}
|
|
2958
3581
|
}
|
|
2959
3582
|
}
|
|
2960
|
-
if (
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
D.set("richTypes", []), D.set("parseInlineDxf", (e) => {
|
|
3583
|
+
if (r.workbooks.length === 0) throw new Re("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
3584
|
+
let ee = l?.resources ?? new Je(), ne = ee.beginPersist(), re = {}, ie = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Map();
|
|
3585
|
+
T.set("parseInlineDxf", (e) => {
|
|
2964
3586
|
if (!e) return;
|
|
2965
|
-
let t =
|
|
3587
|
+
let t = w.parseFromString(`<dxf xmlns:x14="${ge}" xmlns:xm="${h}">${e}</dxf>`, "text/xml")?.documentElement;
|
|
2966
3588
|
if (!t) return;
|
|
2967
|
-
let n =
|
|
3589
|
+
let n = C.parseDxf(t, "", _);
|
|
2968
3590
|
return Object.keys(n).length > 0 ? n : void 0;
|
|
2969
3591
|
});
|
|
2970
|
-
let
|
|
2971
|
-
|
|
2972
|
-
let
|
|
2973
|
-
|
|
2974
|
-
let
|
|
2975
|
-
|
|
2976
|
-
},
|
|
3592
|
+
let ue = [];
|
|
3593
|
+
T.set("dummyWrapped", ue);
|
|
3594
|
+
let pe = I("metadata", r, e, w, C, _).entries().next()?.value?.[1]?.metadata;
|
|
3595
|
+
pe && T.set("metadata", pe), T.set(Vn, ve());
|
|
3596
|
+
let he = /* @__PURE__ */ new Map(), _e = [], ye = /* @__PURE__ */ new Set(), M = (e) => {
|
|
3597
|
+
ye.add(vr(e));
|
|
3598
|
+
}, P = (t, n = he) => {
|
|
2977
3599
|
let r = t.lastIndexOf("/"), i = t.substring(0, r + 1) + "_rels/" + t.substring(r + 1, t.length) + ".rels", a = n.get(i);
|
|
2978
|
-
return a || (a =
|
|
2979
|
-
},
|
|
2980
|
-
let a =
|
|
3600
|
+
return a || (a = me(i, e, w, C, z), n.set(i, a)), a;
|
|
3601
|
+
}, F = (t, n, r, i = he) => {
|
|
3602
|
+
let a = P(n, i).get(t), o = a?.target;
|
|
2981
3603
|
if (!o) return null;
|
|
2982
3604
|
if (a.targetMode === "External") {
|
|
2983
3605
|
if (!r) return a.target;
|
|
2984
|
-
let e =
|
|
2985
|
-
return e.addReference(
|
|
3606
|
+
let e = ee.add({ source: { external: a.target } });
|
|
3607
|
+
return e.addReference(re), ie.add(e), ne.toResourceId(e);
|
|
2986
3608
|
}
|
|
2987
3609
|
let s = n.lastIndexOf("/"), c = n.substring(0, s + 1);
|
|
2988
|
-
o.startsWith("/") || (o = c + o), o =
|
|
2989
|
-
let
|
|
2990
|
-
if (!
|
|
3610
|
+
o.startsWith("/") || (o = c + o), o = Ne(o);
|
|
3611
|
+
let l = C?.getVisitorParamsState().get("dxfs"), u = i.get(o);
|
|
3612
|
+
if (!u) {
|
|
2991
3613
|
if (a.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") {
|
|
2992
3614
|
let e = {};
|
|
2993
|
-
|
|
2994
|
-
let t =
|
|
2995
|
-
|
|
2996
|
-
}, void 0,
|
|
3615
|
+
u = e, _e.push((async () => {
|
|
3616
|
+
let t = Gn(e, (e, t) => t === "legacyDrawing" ? Ee(e, o) : t === "formControl" ? Oe(e, o) : t === "part" ? Ae(e, o) : F(e, o, t === "resource") ?? null, Ke, l, () => {}, (e, t, n) => {
|
|
3617
|
+
g(e, t ? `${t} (${o})` : o, n);
|
|
3618
|
+
}, void 0, T), n = await k.getTextStream(o, te);
|
|
2997
3619
|
if (n) try {
|
|
2998
|
-
await
|
|
3620
|
+
await nn.parseStream(n, t, {
|
|
2999
3621
|
xmlns: !1,
|
|
3000
3622
|
lean: !0
|
|
3001
3623
|
});
|
|
3002
3624
|
} catch (e) {
|
|
3003
3625
|
throw Error(`Error parsing sheet: '${o}'`, { cause: e });
|
|
3004
3626
|
}
|
|
3005
|
-
let r =
|
|
3627
|
+
let r = P(o, i);
|
|
3006
3628
|
if (r) {
|
|
3007
|
-
|
|
3629
|
+
we(e, o, r, i), le(e), De(e);
|
|
3008
3630
|
let t = [];
|
|
3009
3631
|
r.forEach((e, n) => {
|
|
3010
3632
|
if (e.type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable") return;
|
|
3011
|
-
let r =
|
|
3633
|
+
let r = Ae(n, o, e.type, (e) => e !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition");
|
|
3012
3634
|
if (!r?.xml) return;
|
|
3013
3635
|
let i = /<pivotTableDefinition\b[^>]*>/.exec(r.xml)?.[0] ?? "", a = parseInt(/\scacheId="(\d+)"/.exec(i)?.[1] ?? "", 10);
|
|
3014
|
-
if (isNaN(a)) return void
|
|
3636
|
+
if (isNaN(a)) return void m.push([`Pivot table '${r.name}' names no cache and was dropped.`, o]);
|
|
3015
3637
|
let s = /\sname="([^"]*)"/.exec(i)?.[1];
|
|
3016
3638
|
t.push({
|
|
3017
|
-
...s ? { name:
|
|
3639
|
+
...s ? { name: be(s) } : {},
|
|
3018
3640
|
cacheId: a,
|
|
3019
3641
|
part: r
|
|
3020
3642
|
});
|
|
@@ -3022,12 +3644,12 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3022
3644
|
}
|
|
3023
3645
|
})());
|
|
3024
3646
|
} else if (a.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink") {
|
|
3025
|
-
let t =
|
|
3647
|
+
let t = S(o, e, w, C, z);
|
|
3026
3648
|
if (t && Object.keys(t).length !== 0) {
|
|
3027
3649
|
let e = t, n = e.__bookRelId, r = e.__absoluteUrlRelId;
|
|
3028
3650
|
delete e.__bookRelId, delete e.__absoluteUrlRelId;
|
|
3029
3651
|
let a = [];
|
|
3030
|
-
|
|
3652
|
+
P(o, i)?.forEach((e, t) => {
|
|
3031
3653
|
if (e.targetMode === "External" && e.type && e.target) {
|
|
3032
3654
|
let i = {
|
|
3033
3655
|
type: e.type,
|
|
@@ -3035,114 +3657,99 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3035
3657
|
};
|
|
3036
3658
|
t === n ? i.role = "book" : t === r && (i.role = "absoluteUrl"), a.push(i);
|
|
3037
3659
|
}
|
|
3038
|
-
}), a.sort((e, t) => (e.role === "book" ? 0 : 1) - (t.role === "book" ? 0 : 1)), e.sources = a,
|
|
3039
|
-
} else
|
|
3040
|
-
} else
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
if (!o) return null;
|
|
3048
|
-
let s = o.content;
|
|
3049
|
-
try {
|
|
3050
|
-
n && (s = n(s, e));
|
|
3051
|
-
} catch (t) {
|
|
3052
|
-
z(e, t, r);
|
|
3053
|
-
}
|
|
3054
|
-
return r?.parsedRefs?.set(e, s), s;
|
|
3055
|
-
})(o, e, (e, t) => {
|
|
3056
|
-
let n = x.add({ source: { buffer: e } });
|
|
3057
|
-
return n.addReference(C), w.add(n), S.toResourceId(n);
|
|
3058
|
-
}, W) : Oe(o, e, E, T, W);
|
|
3059
|
-
}
|
|
3060
|
-
return d;
|
|
3061
|
-
}, L = (e, t) => {
|
|
3660
|
+
}), a.sort((e, t) => (e.role === "book" ? 0 : 1) - (t.role === "book" ? 0 : 1)), e.sources = a, M(o), u = e;
|
|
3661
|
+
} else u = null;
|
|
3662
|
+
} else u = r ? O(o, e, (e, t) => {
|
|
3663
|
+
let n = ee.add({ source: { buffer: e } });
|
|
3664
|
+
return n.addReference(re), ie.add(n), ne.toResourceId(n);
|
|
3665
|
+
}, z) : S(o, e, w, C, z);
|
|
3666
|
+
}
|
|
3667
|
+
return u;
|
|
3668
|
+
}, Ce = (e, t) => {
|
|
3062
3669
|
if (!e) return null;
|
|
3063
|
-
let n =
|
|
3670
|
+
let n = P(t, he)?.get(e);
|
|
3064
3671
|
if (!n?.target || n.targetMode === "External") return null;
|
|
3065
3672
|
let r = n.target;
|
|
3066
|
-
return r.startsWith("/") || (r = t.substring(0, t.lastIndexOf("/") + 1) + r),
|
|
3067
|
-
},
|
|
3068
|
-
let
|
|
3673
|
+
return r.startsWith("/") || (r = t.substring(0, t.lastIndexOf("/") + 1) + r), Ne(r);
|
|
3674
|
+
}, we = (e, t, n, r) => {
|
|
3675
|
+
let a = [], o = /* @__PURE__ */ new Map(), s = [];
|
|
3069
3676
|
n.forEach((e, n) => {
|
|
3070
3677
|
if (e.type !== "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment") return;
|
|
3071
|
-
let
|
|
3072
|
-
if (!
|
|
3073
|
-
for (let e = 0; e <
|
|
3074
|
-
let t =
|
|
3678
|
+
let i = F(n, t, !1, r)?.comments;
|
|
3679
|
+
if (!i) return;
|
|
3680
|
+
for (let e = 0; e < i.length; e++) {
|
|
3681
|
+
let t = i[e];
|
|
3075
3682
|
if (!t?.v?.id) continue;
|
|
3076
3683
|
let { parentId: n, done: r, content: c, ...l } = t.v, u = {
|
|
3077
3684
|
...l,
|
|
3078
|
-
content:
|
|
3685
|
+
content: xr(c)
|
|
3079
3686
|
};
|
|
3080
|
-
n ?
|
|
3687
|
+
n ? s.push({
|
|
3081
3688
|
parentId: n,
|
|
3082
3689
|
json: u
|
|
3083
|
-
}) : (r && (u.done = !0),
|
|
3690
|
+
}) : (r && (u.done = !0), o.set(u.id, u), a.push({
|
|
3084
3691
|
r: t.r,
|
|
3085
3692
|
v: u
|
|
3086
3693
|
}));
|
|
3087
3694
|
}
|
|
3088
|
-
let c =
|
|
3089
|
-
c &&
|
|
3695
|
+
let c = Ce(n, t);
|
|
3696
|
+
c && M(c);
|
|
3090
3697
|
});
|
|
3091
|
-
for (let e = 0; e <
|
|
3092
|
-
let { parentId: t, json: n } =
|
|
3698
|
+
for (let e = 0; e < s.length; e++) {
|
|
3699
|
+
let { parentId: t, json: n } = s[e], r = o.get(t);
|
|
3093
3700
|
r && (r.replies ??= []).push(n);
|
|
3094
3701
|
}
|
|
3095
|
-
let
|
|
3702
|
+
let c = [];
|
|
3096
3703
|
if (n.forEach((e, n) => {
|
|
3097
3704
|
if (e.type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") return;
|
|
3098
|
-
let i =
|
|
3099
|
-
if (!
|
|
3100
|
-
let
|
|
3101
|
-
for (let e = 0; e <
|
|
3102
|
-
let t =
|
|
3705
|
+
let i = F(n, t, !1, r), a = i?.comments;
|
|
3706
|
+
if (!a) return;
|
|
3707
|
+
let s = i?.authors;
|
|
3708
|
+
for (let e = 0; e < a.length; e++) {
|
|
3709
|
+
let t = a[e];
|
|
3103
3710
|
if (!t?.r) continue;
|
|
3104
|
-
let n =
|
|
3711
|
+
let n = s && t.v.authorId !== void 0 ? s[t.v.authorId] : void 0;
|
|
3105
3712
|
if (n && n.startsWith("tc=")) {
|
|
3106
|
-
if (
|
|
3713
|
+
if (o.has(ce(n.substring(3)))) continue;
|
|
3107
3714
|
n = void 0;
|
|
3108
3715
|
}
|
|
3109
3716
|
let r = {
|
|
3110
|
-
id:
|
|
3717
|
+
id: L.uuidV4().toUpperCase(),
|
|
3111
3718
|
asNote: !0,
|
|
3112
3719
|
content: t.v.content ?? ""
|
|
3113
|
-
}, i = n ?
|
|
3114
|
-
i && (r.personId = i.id),
|
|
3720
|
+
}, i = n ? He({ displayName: n }) : void 0;
|
|
3721
|
+
i && (r.personId = i.id), c.push({
|
|
3115
3722
|
r: t.r,
|
|
3116
3723
|
v: r
|
|
3117
3724
|
});
|
|
3118
3725
|
}
|
|
3119
|
-
let l =
|
|
3120
|
-
l &&
|
|
3121
|
-
}),
|
|
3122
|
-
let
|
|
3123
|
-
if (
|
|
3124
|
-
let { rest: t, notes: n } =
|
|
3726
|
+
let l = Ce(n, t);
|
|
3727
|
+
l && M(l);
|
|
3728
|
+
}), a.length === 0 && c.length === 0) return;
|
|
3729
|
+
let l = [...a, ...c], u = e.legacyDrawing;
|
|
3730
|
+
if (u?.xml) {
|
|
3731
|
+
let { rest: t, notes: n } = ke(u.xml);
|
|
3125
3732
|
if (n.length > 0) {
|
|
3126
3733
|
let r = /* @__PURE__ */ new Map();
|
|
3127
3734
|
for (let e = 0; e < n.length; e++) {
|
|
3128
3735
|
let t = n[e];
|
|
3129
|
-
r.set(
|
|
3736
|
+
r.set(R.cellToString({
|
|
3130
3737
|
rowIndex: t.row,
|
|
3131
3738
|
colIndex: t.col
|
|
3132
3739
|
}), t);
|
|
3133
3740
|
}
|
|
3134
|
-
for (let e = 0; e <
|
|
3135
|
-
let t =
|
|
3741
|
+
for (let e = 0; e < l.length; e++) {
|
|
3742
|
+
let t = l[e], n = r.get(String(t.r).toUpperCase());
|
|
3136
3743
|
if (!n || (r.delete(String(t.r).toUpperCase()), !t.v.asNote)) continue;
|
|
3137
|
-
let
|
|
3138
|
-
if (
|
|
3139
|
-
let [e, t, r,
|
|
3140
|
-
|
|
3744
|
+
let a = i(n.xml), o = {};
|
|
3745
|
+
if (a.anchor) {
|
|
3746
|
+
let [e, t, r, i, s, c, l, u] = a.anchor;
|
|
3747
|
+
o.anchor = {
|
|
3141
3748
|
tl: {
|
|
3142
3749
|
c: e - n.col,
|
|
3143
3750
|
x: t,
|
|
3144
3751
|
r: r - n.row,
|
|
3145
|
-
y:
|
|
3752
|
+
y: i
|
|
3146
3753
|
},
|
|
3147
3754
|
br: {
|
|
3148
3755
|
c: s - n.col,
|
|
@@ -3151,61 +3758,61 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3151
3758
|
y: u
|
|
3152
3759
|
}
|
|
3153
3760
|
};
|
|
3154
|
-
}
|
|
3155
|
-
|
|
3761
|
+
} else a.bounds && (o.bounds = a.bounds);
|
|
3762
|
+
a.style.fill && (o.fill = a.style.fill), a.style.stroke && (o.stroke = a.style.stroke), a.xml && (o.xml = a.xml), (o.anchor || o.bounds || o.fill || o.stroke || o.xml) && (t.v.box = o), a.visible && (t.v.shown = !0), a.alt && (t.v.description = a.alt);
|
|
3156
3763
|
}
|
|
3157
|
-
let
|
|
3764
|
+
let a = [];
|
|
3158
3765
|
r.forEach((e) => {
|
|
3159
|
-
|
|
3766
|
+
a.push(e.xml);
|
|
3160
3767
|
});
|
|
3161
|
-
let
|
|
3162
|
-
|
|
3768
|
+
let o = Me(t, a);
|
|
3769
|
+
o ? u.xml = o : delete e.legacyDrawing;
|
|
3163
3770
|
}
|
|
3164
3771
|
}
|
|
3165
|
-
e.comments =
|
|
3166
|
-
},
|
|
3167
|
-
let r =
|
|
3772
|
+
e.comments = l;
|
|
3773
|
+
}, Ee = (t, n) => {
|
|
3774
|
+
let r = Ce(t, n);
|
|
3168
3775
|
if (!r) return null;
|
|
3169
|
-
let i = e(
|
|
3776
|
+
let i = e(vr(r));
|
|
3170
3777
|
if (!i) return null;
|
|
3171
|
-
let a = { xml: new TextDecoder("utf-8").decode(i.content) }, o = [];
|
|
3172
|
-
return
|
|
3778
|
+
let a = { xml: rr(new TextDecoder("utf-8").decode(i.content)) }, o = [];
|
|
3779
|
+
return P(r, he)?.forEach((e, t) => {
|
|
3173
3780
|
if (e.type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") return;
|
|
3174
|
-
let n =
|
|
3781
|
+
let n = F(t, r, !0);
|
|
3175
3782
|
typeof n == "number" && o.push({
|
|
3176
3783
|
id: t,
|
|
3177
3784
|
resId: n
|
|
3178
3785
|
});
|
|
3179
|
-
}), o.length > 0 && (a.images = o),
|
|
3180
|
-
},
|
|
3181
|
-
let r =
|
|
3786
|
+
}), o.length > 0 && (a.images = o), M(r), a;
|
|
3787
|
+
}, Oe = (t, n) => {
|
|
3788
|
+
let r = Ce(t, n);
|
|
3182
3789
|
if (!r) return null;
|
|
3183
|
-
let i =
|
|
3184
|
-
return i &&
|
|
3185
|
-
},
|
|
3186
|
-
let s =
|
|
3790
|
+
let i = S(r, e, w, C, z)?.formControl ?? null;
|
|
3791
|
+
return i && M(r), i;
|
|
3792
|
+
}, Ae = (t, n, i, a, o = /* @__PURE__ */ new Set()) => {
|
|
3793
|
+
let s = Ce(t, n);
|
|
3187
3794
|
if (!s || o.has(s)) return null;
|
|
3188
|
-
let c = i ??
|
|
3795
|
+
let c = i ?? P(n, he)?.get(t)?.type;
|
|
3189
3796
|
if (!c) return null;
|
|
3190
|
-
let l = e(
|
|
3797
|
+
let l = e(vr(s));
|
|
3191
3798
|
if (!l) return null;
|
|
3192
3799
|
o.add(s);
|
|
3193
|
-
let u = s.substring(s.lastIndexOf("/") + 1), d =
|
|
3800
|
+
let u = s.substring(s.lastIndexOf("/") + 1), d = r.overrides[vr(s)] ?? r.defaults[u.substring(u.lastIndexOf(".") + 1).toLowerCase()], f = {
|
|
3194
3801
|
id: t,
|
|
3195
3802
|
type: c,
|
|
3196
3803
|
name: u
|
|
3197
3804
|
};
|
|
3198
3805
|
if (d && (f.contentType = d), ((e, t) => e ? e.endsWith("+xml") || e === "application/xml" : /\.(xml|rels|vml)$/i.test(t))(d, u)) f.xml = new TextDecoder("utf-8").decode(l.content);
|
|
3199
3806
|
else {
|
|
3200
|
-
let e =
|
|
3807
|
+
let e = F(t, n, !0);
|
|
3201
3808
|
if (typeof e != "number") return null;
|
|
3202
3809
|
f.resId = e;
|
|
3203
3810
|
}
|
|
3204
3811
|
let p = [];
|
|
3205
|
-
return
|
|
3812
|
+
return P(s, he)?.forEach((e, t) => {
|
|
3206
3813
|
if (!e?.type || a && !a(e.type)) return;
|
|
3207
3814
|
if (e.targetMode === "External") {
|
|
3208
|
-
let n =
|
|
3815
|
+
let n = F(t, s, !0);
|
|
3209
3816
|
typeof n == "number" && p.push({
|
|
3210
3817
|
id: t,
|
|
3211
3818
|
type: e.type,
|
|
@@ -3213,129 +3820,237 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3213
3820
|
});
|
|
3214
3821
|
return;
|
|
3215
3822
|
}
|
|
3216
|
-
let n =
|
|
3823
|
+
let n = Ae(t, s, e.type, a, o);
|
|
3217
3824
|
n && p.push(n);
|
|
3218
|
-
}), p.length > 0 && (f.parts = p),
|
|
3219
|
-
};
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3825
|
+
}), p.length > 0 && (f.parts = p), M(s), f;
|
|
3826
|
+
}, je = I("coreprops", r, e, w, C, _), Pe = I("extprops", r, e, w, C, _), Fe = I("custprops", r, e, w, C, _);
|
|
3827
|
+
Fe.forEach((e, t) => {
|
|
3828
|
+
e?.custom && M(t);
|
|
3829
|
+
});
|
|
3830
|
+
let Ie = new qe(), Ve = I("people", r, e, w, C, _);
|
|
3831
|
+
if (Ve.size > 0) {
|
|
3832
|
+
let [e, t] = Ve.entries().next().value;
|
|
3833
|
+
Ie.fromJSON(t?.persons), M(e);
|
|
3834
|
+
}
|
|
3835
|
+
let He = (e) => {
|
|
3836
|
+
if (e) return Ie.add(e).toJSON();
|
|
3837
|
+
}, z = {
|
|
3838
|
+
paramMap: T,
|
|
3839
|
+
getRefs: P,
|
|
3840
|
+
getRef: F,
|
|
3841
|
+
parsedRefs: he,
|
|
3842
|
+
readEmbeddedPart: (e, t) => Ae(e, t),
|
|
3843
|
+
addPerson: He,
|
|
3844
|
+
serializeElement: fe,
|
|
3845
|
+
onWarning: g
|
|
3846
|
+
}, V = [], H = /* @__PURE__ */ new Map();
|
|
3847
|
+
if (T.set(Un, H), a) {
|
|
3848
|
+
let e = await k.getTextStream(a, te);
|
|
3240
3849
|
if (e) {
|
|
3241
3850
|
let t = ((e, t) => {
|
|
3242
|
-
let n = !1, r = !1, i = 0, a = "";
|
|
3851
|
+
let n = !1, r = !1, i = 0, a = "", o = new In();
|
|
3243
3852
|
return {
|
|
3244
3853
|
onOpenTag: (e) => {
|
|
3245
|
-
let t =
|
|
3246
|
-
t === "t" ? n && i === 0 && (r = !0) : t === "si" ? (n = !0, a = "", i = 0) : t
|
|
3854
|
+
let t = Fn(e.name);
|
|
3855
|
+
t === "t" ? n && i === 0 && (r = !0) : t === "si" ? (n = !0, a = "", o.reset(), i = 0) : t === "rPh" || t === "phoneticPr" ? i++ : n && i === 0 && o.onOpenTag(t, e.attributes);
|
|
3247
3856
|
},
|
|
3248
3857
|
onText: (e) => {
|
|
3249
|
-
r && (a += e);
|
|
3858
|
+
r && (a += e, o.onText(e));
|
|
3250
3859
|
},
|
|
3251
3860
|
onCloseTag: (t) => {
|
|
3252
|
-
let
|
|
3253
|
-
|
|
3861
|
+
let s = Fn(t.name);
|
|
3862
|
+
s === "t" ? r = !1 : s === "si" ? (e(ae(a), o.take() ?? void 0), n = !1, a = "") : s === "rPh" || s === "phoneticPr" ? i > 0 && i-- : o.onCloseTag(s);
|
|
3254
3863
|
},
|
|
3255
3864
|
onError: (e) => {
|
|
3256
3865
|
t?.(`Error parsing shared strings: ${e?.message ?? e}`);
|
|
3257
3866
|
}
|
|
3258
3867
|
};
|
|
3259
|
-
})((e) => {
|
|
3260
|
-
|
|
3868
|
+
})((e, t) => {
|
|
3869
|
+
t && H.set(V.length, t), V.push(e);
|
|
3261
3870
|
}, (e) => {
|
|
3262
|
-
|
|
3871
|
+
g(e, a);
|
|
3263
3872
|
});
|
|
3264
3873
|
try {
|
|
3265
|
-
await
|
|
3874
|
+
await nn.parseStream(e, t, { xmlns: !1 });
|
|
3266
3875
|
} catch (e) {
|
|
3267
|
-
throw Error(`Error parsing shared strings: '${
|
|
3876
|
+
throw Error(`Error parsing shared strings: '${a}'`, { cause: e });
|
|
3268
3877
|
}
|
|
3269
3878
|
}
|
|
3270
3879
|
}
|
|
3271
|
-
|
|
3272
|
-
let
|
|
3273
|
-
let t =
|
|
3880
|
+
p?.mark("shared-strings");
|
|
3881
|
+
let U = V.length, We = /* @__PURE__ */ new Map(), Ge = U, Ke = (e) => {
|
|
3882
|
+
let t = We.get(e);
|
|
3274
3883
|
if (t !== void 0) return t;
|
|
3275
|
-
let n =
|
|
3276
|
-
return
|
|
3277
|
-
},
|
|
3278
|
-
|
|
3279
|
-
let
|
|
3280
|
-
for (let e = 0; e <
|
|
3281
|
-
let t =
|
|
3282
|
-
t && t.startsWith("xl/slicerCache") &&
|
|
3283
|
-
}
|
|
3284
|
-
let
|
|
3285
|
-
|
|
3286
|
-
e?.cacheName && (e.cachePath = t,
|
|
3287
|
-
}),
|
|
3288
|
-
let
|
|
3289
|
-
|
|
3290
|
-
for (let e = 0; e <
|
|
3291
|
-
let t =
|
|
3292
|
-
t && t.startsWith("xl/slicers/") && t.endsWith(".xml") &&
|
|
3293
|
-
}
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3884
|
+
let n = Ge;
|
|
3885
|
+
return We.set(e, Ge++), V.push(e), n;
|
|
3886
|
+
}, Ye = [];
|
|
3887
|
+
r.slicersCache = Ye;
|
|
3888
|
+
let Xe = k.getNames(), Qe = Xe.length;
|
|
3889
|
+
for (let e = 0; e < Qe; e++) {
|
|
3890
|
+
let t = Xe[e];
|
|
3891
|
+
t && t.startsWith("xl/slicerCache") && Ye.push(`/${t}`);
|
|
3892
|
+
}
|
|
3893
|
+
let et = I("slicersCache", r, e, w, C, z), pt = /* @__PURE__ */ new Map();
|
|
3894
|
+
et.forEach((e, t) => {
|
|
3895
|
+
e?.cacheName && (e.cachePath = t, pt.set(e.cacheName, e));
|
|
3896
|
+
}), T.set("slicerCaches", pt);
|
|
3897
|
+
let mt = [];
|
|
3898
|
+
r.slicers = mt;
|
|
3899
|
+
for (let e = 0; e < Qe; e++) {
|
|
3900
|
+
let t = Xe[e];
|
|
3901
|
+
t && t.startsWith("xl/slicers/") && t.endsWith(".xml") && mt.push(`/${t}`);
|
|
3902
|
+
}
|
|
3903
|
+
let ht = {
|
|
3904
|
+
getFile: e,
|
|
3905
|
+
domParser: w,
|
|
3906
|
+
getAddress: (e, t) => {
|
|
3907
|
+
let n = F(t, e, !1);
|
|
3908
|
+
return typeof n == "string" ? n : null;
|
|
3909
|
+
},
|
|
3910
|
+
getBytes: (t, n) => {
|
|
3911
|
+
let r = Ce(n, t), i = r ? e(r.substring(1))?.content : void 0;
|
|
3912
|
+
return i ? i.slice().buffer : null;
|
|
3913
|
+
},
|
|
3914
|
+
addFetched: (e, t) => {
|
|
3915
|
+
let n = ee.add({
|
|
3916
|
+
source: { buffer: e },
|
|
3917
|
+
fetchedFrom: t
|
|
3918
|
+
});
|
|
3919
|
+
return n.addReference(re), ie.add(n), ne.toResourceId(n);
|
|
3920
|
+
},
|
|
3921
|
+
markAbsorbed: M
|
|
3922
|
+
}, gt = /* @__PURE__ */ new Map();
|
|
3923
|
+
for (let e of A.getAll()) gt.set(e.structure, e.beginRead(ht));
|
|
3924
|
+
let _t = ((e, t) => {
|
|
3925
|
+
let n = (n) => {
|
|
3926
|
+
let r = e(n);
|
|
3927
|
+
return r ? t.parseFromString(new TextDecoder().decode(r.content), "text/xml").documentElement ?? null : null;
|
|
3928
|
+
}, r = W(n(rt), "s").map((e) => ({
|
|
3929
|
+
t: e.getAttribute("t") ?? "",
|
|
3930
|
+
keys: ut(e)
|
|
3931
|
+
})), i = W(n(it), "rv").map((e) => {
|
|
3932
|
+
let t = W(e, "fb")[0];
|
|
3933
|
+
return {
|
|
3934
|
+
s: parseInt(e.getAttribute("s") ?? "-1", 10),
|
|
3935
|
+
values: W(e, "v").map((e) => e.textContent ?? ""),
|
|
3936
|
+
fb: t ? t.textContent ?? "" : null
|
|
3937
|
+
};
|
|
3938
|
+
}), a = W(n(at), "a").map((e) => {
|
|
3939
|
+
let t = dt(e), n = parseInt(e.getAttribute("r") ?? "", 10), r = parseInt(e.getAttribute("c") ?? "", 10), i = n > 0 ? n : t.length;
|
|
3940
|
+
return {
|
|
3941
|
+
rows: i,
|
|
3942
|
+
columns: r > 0 ? r : Math.max(1, Math.ceil(t.length / Math.max(1, i))),
|
|
3943
|
+
items: t
|
|
3944
|
+
};
|
|
3945
|
+
}), o = W(n(ot), "s").map(ut), s = n(st), c = W(W(s, "spbArrays")[0], "a").map(dt), l = W(W(s, "spbData")[0], "spb").map((e) => ({
|
|
3946
|
+
s: parseInt(e.getAttribute("s") ?? "-1", 10),
|
|
3947
|
+
values: W(e, "v").map((e) => e.textContent ?? "")
|
|
3948
|
+
})), u = n(ct), d = ft(W(W(u, "global")[0], "keyFlags")[0]), f = /* @__PURE__ */ new Map();
|
|
3949
|
+
for (let e of W(W(u, "types")[0], "type")) f.set(e.getAttribute("name") ?? "", ft(W(e, "keyFlags")[0]));
|
|
3950
|
+
let p = n(lt), m = W(W(p, "dxfs")[0], "dxf").map((e) => W(e, "numFmt")[0]?.getAttribute("formatCode") ?? null), h = W(W(p, "richProperties")[0], "rPr").map((e) => e.getAttribute("n") ?? "");
|
|
3951
|
+
return {
|
|
3952
|
+
structures: r,
|
|
3953
|
+
values: i,
|
|
3954
|
+
arrays: a,
|
|
3955
|
+
bagStructures: o,
|
|
3956
|
+
bagArrays: c,
|
|
3957
|
+
bags: l,
|
|
3958
|
+
globalKeyFlags: d,
|
|
3959
|
+
typeKeyFlags: f,
|
|
3960
|
+
richStyles: W(W(p, "richStyles")[0], "rSty").map((e) => {
|
|
3961
|
+
let t = /* @__PURE__ */ new Map();
|
|
3962
|
+
for (let n of W(e, "rpv")) {
|
|
3963
|
+
let e = h[parseInt(n.getAttribute("i") ?? "-1", 10)];
|
|
3964
|
+
e && t.set(e, n.textContent ?? "");
|
|
3965
|
+
}
|
|
3966
|
+
let n = parseInt(e.getAttribute("dxfid") ?? "", 10);
|
|
3967
|
+
return {
|
|
3968
|
+
numberFormat: t.get("NumberFormat") ?? (n >= 0 ? m[n] ?? null : null),
|
|
3969
|
+
isTitle: t.get("IsTitleField") === "1",
|
|
3970
|
+
isHero: t.get("IsHeroField") === "1"
|
|
3971
|
+
};
|
|
3972
|
+
})
|
|
3973
|
+
};
|
|
3974
|
+
})(e, w), vt = E(_t, gt, (e) => {
|
|
3975
|
+
g(e, "/xl/richData/rdrichvalue.xml");
|
|
3976
|
+
});
|
|
3977
|
+
T.set("richData", _t.values.map((e, t) => vt.cellValue(t)));
|
|
3978
|
+
for (let e = 0; e < Qe; e++) {
|
|
3979
|
+
let t = Xe[e];
|
|
3980
|
+
t.startsWith("xl/richData/") && !t.includes("/_rels/") && M(t);
|
|
3981
|
+
}
|
|
3982
|
+
let yt = I("themes", r, e, w, C, z), bt = null;
|
|
3983
|
+
if (yt && yt.entries) {
|
|
3984
|
+
let e = yt.entries().next();
|
|
3985
|
+
e?.value?.[1] && (bt = e.value[1]);
|
|
3986
|
+
}
|
|
3987
|
+
let xt = new Ze(bt), St = I("styles", r, e, w, C, z).entries().next()?.value?.[1];
|
|
3988
|
+
St &&= JSON.parse(Le.JSONStableStringify(St));
|
|
3989
|
+
let Ct = I("workbooks", r, e, w, C, z);
|
|
3990
|
+
T.set(Hn, !0 === Ct.entries().next().value?.[1]?.date1904), p?.mark("side-parts-json"), await Promise.all(_e);
|
|
3304
3991
|
{
|
|
3305
|
-
let e =
|
|
3992
|
+
let e = Ct.entries().next().value?.[1], t = ve(e?.names), r = e?.sheets ?? [];
|
|
3306
3993
|
for (let e = 0; e < r.length; e++) {
|
|
3307
|
-
let i = r[e]
|
|
3308
|
-
i &&
|
|
3994
|
+
let i = r[e], a = u(i);
|
|
3995
|
+
if (i?.kind === "macro" && a?.part.xml) {
|
|
3996
|
+
a.part.xml = n(a.part.xml, V);
|
|
3997
|
+
continue;
|
|
3998
|
+
}
|
|
3999
|
+
let o = N(i);
|
|
4000
|
+
o && Se(o, t);
|
|
3309
4001
|
}
|
|
3310
4002
|
let i = e?.names;
|
|
3311
4003
|
if (i) for (let e = 0; e < i.length; e++) {
|
|
3312
|
-
let
|
|
3313
|
-
typeof
|
|
4004
|
+
let n = i[e]?.ref;
|
|
4005
|
+
typeof n == "string" && (i[e].ref = t.readDetached(n));
|
|
3314
4006
|
}
|
|
3315
4007
|
}
|
|
3316
|
-
|
|
4008
|
+
y && x > 0 && (y(b, b), await new Promise((e) => setTimeout(e, 0))), p?.mark("sheets");
|
|
3317
4009
|
let G = {
|
|
3318
|
-
...
|
|
3319
|
-
styles:
|
|
3320
|
-
theme:
|
|
3321
|
-
}
|
|
3322
|
-
|
|
4010
|
+
...Ct.entries().next().value?.[1],
|
|
4011
|
+
styles: St,
|
|
4012
|
+
theme: xt.toJSON()
|
|
4013
|
+
}, wt = ((e, t, n, r) => {
|
|
4014
|
+
let i = {}, a = (e, t) => {
|
|
4015
|
+
if (e) for (let { key: n, value: r } of e) {
|
|
4016
|
+
let e = t[n];
|
|
4017
|
+
if (e && r) {
|
|
4018
|
+
if (e === "revisionNumber") {
|
|
4019
|
+
let e = parseInt(r, 10);
|
|
4020
|
+
Number.isFinite(e) && (i.revisionNumber = e);
|
|
4021
|
+
} else i[e] = r;
|
|
4022
|
+
}
|
|
4023
|
+
}
|
|
4024
|
+
};
|
|
4025
|
+
if (a(e, ir), a(t, ar), n) {
|
|
4026
|
+
let e = [];
|
|
4027
|
+
for (let t of n) {
|
|
4028
|
+
let n = sr(t);
|
|
4029
|
+
n ? e.push(n) : r?.(`The custom document property '${t.key}' holds a value of a kind that is not read (${t.kind ? "vt:" + t.kind : "none"}); it was dropped.`, "xlsx.docProps.custom.kind");
|
|
4030
|
+
}
|
|
4031
|
+
e.length > 0 && (i.custom = e);
|
|
4032
|
+
}
|
|
4033
|
+
return Object.keys(i).length > 0 ? i : void 0;
|
|
4034
|
+
})(je.values().next().value?.properties, Pe.values().next().value?.properties, Fe.values().next().value?.custom, (e, t) => {
|
|
4035
|
+
g(e, "docProps/custom.xml", t);
|
|
4036
|
+
});
|
|
4037
|
+
wt && (G.properties = wt), ((e, t) => {
|
|
3323
4038
|
if (!t || t.size === 0) return;
|
|
3324
4039
|
let n = e.styles;
|
|
3325
4040
|
if (!n) return;
|
|
3326
4041
|
let r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
3327
4042
|
for (let n of e.sheets ?? []) {
|
|
3328
|
-
let e = n
|
|
4043
|
+
let e = N(n);
|
|
3329
4044
|
if (!e) continue;
|
|
3330
4045
|
let a = /* @__PURE__ */ new Set();
|
|
3331
|
-
|
|
4046
|
+
ur(e.cols) || a.add(0);
|
|
3332
4047
|
for (let t of e.directStyles ?? []) a.add(Array.isArray(t) ? t[1] : t.v);
|
|
3333
4048
|
for (let t of e.rows ?? []) {
|
|
3334
|
-
let e =
|
|
4049
|
+
let e = lr(t);
|
|
3335
4050
|
e !== void 0 && a.add(e);
|
|
3336
4051
|
}
|
|
3337
4052
|
for (let t of e.cols ?? []) {
|
|
3338
|
-
let e =
|
|
4053
|
+
let e = lr(t);
|
|
3339
4054
|
e !== void 0 && a.add(e);
|
|
3340
4055
|
}
|
|
3341
4056
|
let o = !1;
|
|
@@ -3353,48 +4068,118 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3353
4068
|
}
|
|
3354
4069
|
if (r.size === 0) return;
|
|
3355
4070
|
let a = n.direct ??= [];
|
|
3356
|
-
for (let e of r) e !== 0 &&
|
|
3357
|
-
for (let e of i) e !== 0 &&
|
|
4071
|
+
for (let e of r) e !== 0 && dr(a[e] ?? (a[e] = {}), !0);
|
|
4072
|
+
for (let e of i) e !== 0 && dr(a[e] ?? (a[e] = {}), !1);
|
|
3358
4073
|
if (r.has(0)) {
|
|
3359
|
-
let e = n.named ??= [], t =
|
|
4074
|
+
let e = n.named ??= [], t = B.BuiltInName.Normal.toLowerCase(), r = e.find((e) => e.name?.toLowerCase() === t);
|
|
3360
4075
|
r || (r = {
|
|
3361
|
-
name:
|
|
4076
|
+
name: B.BuiltInName.Normal,
|
|
3362
4077
|
style: {}
|
|
3363
|
-
}, e.push(r)),
|
|
4078
|
+
}, e.push(r)), dr(r.style, !0);
|
|
3364
4079
|
}
|
|
3365
|
-
})(G,
|
|
4080
|
+
})(G, T.get(cr)), ((e) => {
|
|
4081
|
+
let t = {
|
|
4082
|
+
colStart: 0,
|
|
4083
|
+
rowStart: 0,
|
|
4084
|
+
colEnd: D,
|
|
4085
|
+
rowEnd: xe
|
|
4086
|
+
};
|
|
4087
|
+
for (let n of e.sheets ?? []) {
|
|
4088
|
+
let e = N(n);
|
|
4089
|
+
if (!e) continue;
|
|
4090
|
+
let r = [];
|
|
4091
|
+
if (hr(e.cols, !0, t, r), hr(e.rows, !1, t, r), r.length === 0) continue;
|
|
4092
|
+
let i = [];
|
|
4093
|
+
for (let [t, n] of e.directStyles ?? []) i.push({
|
|
4094
|
+
...R.fastStringToRange(t),
|
|
4095
|
+
value: {
|
|
4096
|
+
kind: 0,
|
|
4097
|
+
index: n
|
|
4098
|
+
}
|
|
4099
|
+
});
|
|
4100
|
+
i.push(...r);
|
|
4101
|
+
let a = [], o = new ze.IteratorInstance(i, { axis: Be.Column });
|
|
4102
|
+
for (let e = o.next(); !e.done; e = o.next()) {
|
|
4103
|
+
let n = e.value.overlaps, r;
|
|
4104
|
+
if (n.length === 1) {
|
|
4105
|
+
if (r = n[0].value, r.index === 0) continue;
|
|
4106
|
+
} else {
|
|
4107
|
+
let e, t, i;
|
|
4108
|
+
for (let r = 0; !e && r < n.length; r++) {
|
|
4109
|
+
let a = n[r].value;
|
|
4110
|
+
a.kind === 0 ? e = a : a.kind === 1 ? t = a : i = a;
|
|
4111
|
+
}
|
|
4112
|
+
r = e ?? t ?? i;
|
|
4113
|
+
}
|
|
4114
|
+
a.push([R.rangeToString(e.value.range, t), r.index]);
|
|
4115
|
+
}
|
|
4116
|
+
a.length > 0 ? e.directStyles = a : delete e.directStyles;
|
|
4117
|
+
}
|
|
4118
|
+
})(G);
|
|
4119
|
+
{
|
|
4120
|
+
let t = T.get(fr);
|
|
4121
|
+
t && ((e, t, n) => {
|
|
4122
|
+
if (!t || t.size === 0 || !n) return;
|
|
4123
|
+
let r = (e) => {
|
|
4124
|
+
if (e === void 0 || e === 0) return null;
|
|
4125
|
+
let r = t.get(e);
|
|
4126
|
+
return r === void 0 ? null : n.controls[r] ?? null;
|
|
4127
|
+
};
|
|
4128
|
+
for (let t of e.sheets ?? []) {
|
|
4129
|
+
let e = N(t);
|
|
4130
|
+
if (!e) continue;
|
|
4131
|
+
let n = /* @__PURE__ */ new Map();
|
|
4132
|
+
for (let t of e.directStyles ?? []) {
|
|
4133
|
+
let e = Array.isArray(t) ? t[0] : t.r, i = r(Array.isArray(t) ? t[1] : t.v);
|
|
4134
|
+
if (!i) continue;
|
|
4135
|
+
let a = JSON.stringify(i), o = n.get(a);
|
|
4136
|
+
o || (o = {
|
|
4137
|
+
control: i,
|
|
4138
|
+
addresses: []
|
|
4139
|
+
}, n.set(a, o)), pr(e, o.addresses);
|
|
4140
|
+
}
|
|
4141
|
+
if (n.size === 0) continue;
|
|
4142
|
+
let i = [...e.cellControls ?? []];
|
|
4143
|
+
for (let { control: e, addresses: t } of n.values()) i.push({
|
|
4144
|
+
r: t.join(","),
|
|
4145
|
+
v: e
|
|
4146
|
+
});
|
|
4147
|
+
e.cellControls = i;
|
|
4148
|
+
}
|
|
4149
|
+
})(G, t, I("featurePropertyBag", r, e, w, C, z).values().next().value?.featurePropertyBag);
|
|
4150
|
+
}
|
|
3366
4151
|
{
|
|
3367
4152
|
let t = /* @__PURE__ */ new Map();
|
|
3368
|
-
|
|
4153
|
+
I("slicers", r, e, w, C, z).forEach((e, n) => {
|
|
3369
4154
|
e?.slicers && t.set(n, e.slicers);
|
|
3370
4155
|
}), function(e, t) {
|
|
3371
4156
|
let n = e.sheets ?? [], r = /* @__PURE__ */ new Map();
|
|
3372
4157
|
for (let e = 0; e < n.length; e++) {
|
|
3373
|
-
let t = n[e]?.
|
|
3374
|
-
for (let e = 0; e <
|
|
3375
|
-
let
|
|
3376
|
-
if (!
|
|
3377
|
-
let a = (
|
|
3378
|
-
r.set(String(
|
|
3379
|
-
name:
|
|
4158
|
+
let t = n[e], i = N(t)?.tables ?? [];
|
|
4159
|
+
for (let e = 0; e < i.length; e++) {
|
|
4160
|
+
let t = i[e], n = Array.isArray(t) ? t[1] : t?.v;
|
|
4161
|
+
if (!n?.id) continue;
|
|
4162
|
+
let a = (n.columns ?? []).map((e) => typeof e == "string" ? { name: e } : e);
|
|
4163
|
+
r.set(String(n.id), {
|
|
4164
|
+
name: n.name ?? "",
|
|
3380
4165
|
columns: a
|
|
3381
4166
|
});
|
|
3382
4167
|
}
|
|
3383
4168
|
}
|
|
3384
4169
|
let i = /* @__PURE__ */ new Set();
|
|
3385
4170
|
for (let e = 0; e < n.length; e++) {
|
|
3386
|
-
let a = n[e]
|
|
3387
|
-
if (!
|
|
3388
|
-
let
|
|
3389
|
-
if (
|
|
3390
|
-
let n =
|
|
4171
|
+
let a = n[e], o = N(a);
|
|
4172
|
+
if (!o) continue;
|
|
4173
|
+
let s = o.slicers, c = o.movables;
|
|
4174
|
+
if (s && c) for (let e = c.length - 1; e >= 0; e--) {
|
|
4175
|
+
let n = c[e].content;
|
|
3391
4176
|
if (n?.type !== "slicer" || n.json?.source) continue;
|
|
3392
|
-
let a = n.name ?? "",
|
|
3393
|
-
if (!
|
|
3394
|
-
let l = r.get(String(
|
|
3395
|
-
l && u ? (n.json =
|
|
4177
|
+
let a = n.name ?? "", o = s[a];
|
|
4178
|
+
if (!o?.tableId) continue;
|
|
4179
|
+
let l = r.get(String(o.tableId)), u = l ? tt(l.columns, o.columnId) : null;
|
|
4180
|
+
l && u ? (n.json = nt(o, n.json, Ue.structuredReference(l.name, u.name)), i.add(a), o.cachePath && t.markAbsorbed(o.cachePath)) : (t.warn("A slicer names no table; it was not imported.", "xlsx.slicer.cacheDefinition"), c.splice(e, 1));
|
|
3396
4181
|
}
|
|
3397
|
-
delete
|
|
4182
|
+
delete o.slicers;
|
|
3398
4183
|
}
|
|
3399
4184
|
t.slicerParts.forEach((e, n) => {
|
|
3400
4185
|
let r = Object.keys(e);
|
|
@@ -3402,26 +4187,26 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3402
4187
|
});
|
|
3403
4188
|
}(G, {
|
|
3404
4189
|
warn: (e, t) => {
|
|
3405
|
-
|
|
4190
|
+
g(e, "xl/slicers", t);
|
|
3406
4191
|
},
|
|
3407
|
-
markAbsorbed:
|
|
4192
|
+
markAbsorbed: M,
|
|
3408
4193
|
slicerParts: t
|
|
3409
4194
|
});
|
|
3410
4195
|
}
|
|
3411
4196
|
G.calc = {
|
|
3412
4197
|
...G.calc ?? {},
|
|
3413
4198
|
legacyIntersect: !0
|
|
3414
|
-
},
|
|
3415
|
-
let
|
|
3416
|
-
|
|
3417
|
-
let
|
|
3418
|
-
if (
|
|
3419
|
-
let { VBAProject: e } = await import("./
|
|
4199
|
+
}, V.length > 0 && (G.strings = V);
|
|
4200
|
+
let Tt = Ie.toJSON();
|
|
4201
|
+
Tt && Tt.length > 0 && (G.people = Tt);
|
|
4202
|
+
let Et = k.getEntry("xl/vbaProject.bin");
|
|
4203
|
+
if (Et) try {
|
|
4204
|
+
let { VBAProject: e } = await import("./aUBXbTh2r0u3x4Xo.mjs"), t = e.extract(Et);
|
|
3420
4205
|
if (t) {
|
|
3421
4206
|
let n = /* @__PURE__ */ new Map();
|
|
3422
4207
|
for (let e of G.sheets ?? []) {
|
|
3423
|
-
let t = e?.
|
|
3424
|
-
|
|
4208
|
+
let t = N(e), r = t?.codeName;
|
|
4209
|
+
r && n.set(r, t);
|
|
3425
4210
|
}
|
|
3426
4211
|
for (let r of t.modules) {
|
|
3427
4212
|
let t = { language: "vba" }, { header: i, body: a } = e.splitAttributes(r.code);
|
|
@@ -3431,25 +4216,29 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3431
4216
|
let s = o ? o.modules ??= {} : G.modules ??= {};
|
|
3432
4217
|
s[r.name] || (s[r.name] = t);
|
|
3433
4218
|
}
|
|
3434
|
-
|
|
3435
|
-
} else
|
|
4219
|
+
o?.(t);
|
|
4220
|
+
} else m.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
|
|
3436
4221
|
} catch (e) {
|
|
3437
|
-
|
|
4222
|
+
m.push([`Error extracting VBA: ${e?.message ?? e}`, "xl/vbaProject.bin"]);
|
|
3438
4223
|
}
|
|
3439
|
-
let
|
|
3440
|
-
...
|
|
3441
|
-
calcOnLoad:
|
|
3442
|
-
resources:
|
|
4224
|
+
let Dt = T.get("calcId"), Ot = Dt === void 0 || !(Number(Dt) >= 191029), kt = l.calcOnLoad ?? (c === "auto" && Ot ? "full" : c), K = {
|
|
4225
|
+
...l,
|
|
4226
|
+
calcOnLoad: kt,
|
|
4227
|
+
resources: ee,
|
|
3443
4228
|
json: G
|
|
3444
4229
|
};
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
4230
|
+
if (K.disableLoadAutoFit === void 0) {
|
|
4231
|
+
let e = T.get(Te);
|
|
4232
|
+
K.disableLoadAutoFit = !!e?.declared && e.normalIsThemeFont && await j(e.faces);
|
|
4233
|
+
}
|
|
4234
|
+
p?.mark("json-assembled");
|
|
4235
|
+
let At = new $e(K);
|
|
4236
|
+
if (p?.mark("workbook-constructed"), ue.length > 0 && kt !== "none") {
|
|
4237
|
+
await At.whenCalculationReady();
|
|
4238
|
+
let e = /* @__PURE__ */ new Map(), t = G.sheets ?? [], n = At.getSheets({ visibility: "veryHidden" });
|
|
3450
4239
|
for (let r = 0; r < t.length; r++) {
|
|
3451
|
-
let i = t[r]
|
|
3452
|
-
|
|
4240
|
+
let i = t[r], a = n[r], o = N(i);
|
|
4241
|
+
o && a?.isIWorksheet && e.set(o, a);
|
|
3453
4242
|
}
|
|
3454
4243
|
((e, t, n) => {
|
|
3455
4244
|
if (t.length === 0) return;
|
|
@@ -3468,7 +4257,7 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3468
4257
|
for (let e of t) e.formula === null && o.add(i(e.rowIndex, e.colIndex));
|
|
3469
4258
|
for (let e of t) {
|
|
3470
4259
|
if (e.formula === null) continue;
|
|
3471
|
-
let t =
|
|
4260
|
+
let t = Tn(e.formula), n = !0;
|
|
3472
4261
|
for (let e of t) if (!a(e)) {
|
|
3473
4262
|
n = !1;
|
|
3474
4263
|
break;
|
|
@@ -3501,19 +4290,19 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3501
4290
|
}).setValue("=" + e.formula);
|
|
3502
4291
|
}
|
|
3503
4292
|
}
|
|
3504
|
-
})(
|
|
3505
|
-
}
|
|
3506
|
-
if (
|
|
3507
|
-
e.deleteReference(
|
|
3508
|
-
}),
|
|
3509
|
-
|
|
3510
|
-
let e = /* @__PURE__ */ new Map(),
|
|
3511
|
-
for (let
|
|
3512
|
-
let r =
|
|
4293
|
+
})(At, ue, e);
|
|
4294
|
+
}
|
|
4295
|
+
if (ie.forEach((e) => {
|
|
4296
|
+
e.deleteReference(re);
|
|
4297
|
+
}), ne.endPersist(), f) {
|
|
4298
|
+
t(At);
|
|
4299
|
+
let e = /* @__PURE__ */ new Map(), n = 0;
|
|
4300
|
+
for (let t of k.getNames()) {
|
|
4301
|
+
let r = k.getEntry(t);
|
|
3513
4302
|
if (!r) continue;
|
|
3514
|
-
let i =
|
|
4303
|
+
let i = k.getRawEntry(t), a = i ? {
|
|
3515
4304
|
data: r,
|
|
3516
|
-
uncompressedSize:
|
|
4305
|
+
uncompressedSize: k.uncompressedSize(t),
|
|
3517
4306
|
raw: {
|
|
3518
4307
|
compressedData: i.data,
|
|
3519
4308
|
compressionMethod: i.compressionMethod,
|
|
@@ -3521,39 +4310,39 @@ var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3521
4310
|
}
|
|
3522
4311
|
} : {
|
|
3523
4312
|
data: r,
|
|
3524
|
-
uncompressedSize:
|
|
4313
|
+
uncompressedSize: k.uncompressedSize(t)
|
|
3525
4314
|
};
|
|
3526
|
-
e.set(
|
|
4315
|
+
e.set(t, a), n += r.byteLength;
|
|
3527
4316
|
}
|
|
3528
|
-
if (
|
|
4317
|
+
if (n > 67108864) m.push([`Source package too large to retain (${n} bytes, limit ${oe}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
|
|
3529
4318
|
else if (e.size > 0) {
|
|
3530
|
-
let
|
|
3531
|
-
|
|
3532
|
-
let
|
|
3533
|
-
let
|
|
3534
|
-
|
|
3535
|
-
} }),
|
|
3536
|
-
let e =
|
|
3537
|
-
(e.length !==
|
|
4319
|
+
let n = new se(e, ye);
|
|
4320
|
+
de(At, n);
|
|
4321
|
+
let r = At.getWorksheets().getItems(), i = At.getTransactions().addListener({ onCommitEnd: (e) => {
|
|
4322
|
+
let t = e.getOperation()?.name;
|
|
4323
|
+
t !== "insertCells" && t !== "deleteCells" || n.markStructuralChange();
|
|
4324
|
+
} }), a = At.addListeners({ onSheetsChange: () => {
|
|
4325
|
+
let e = At.getWorksheets().getItems();
|
|
4326
|
+
(e.length !== r.length || e.some((e, t) => e !== r[t])) && n.markStructuralChange(), r = e;
|
|
3538
4327
|
} });
|
|
3539
|
-
|
|
3540
|
-
|
|
4328
|
+
At.addListeners({ onClose: () => {
|
|
4329
|
+
i(), a(), t(At);
|
|
3541
4330
|
} });
|
|
3542
4331
|
}
|
|
3543
4332
|
}
|
|
3544
|
-
if (
|
|
4333
|
+
if (m.length && v?.onWarning) {
|
|
3545
4334
|
let e = /* @__PURE__ */ new Set();
|
|
3546
|
-
for (let t of
|
|
4335
|
+
for (let t of m) {
|
|
3547
4336
|
let [n, r, i] = t, a = i ?? n;
|
|
3548
|
-
e.has(a) || (e.add(a),
|
|
4337
|
+
e.has(a) || (e.add(a), v.onWarning(n, r));
|
|
3549
4338
|
}
|
|
3550
4339
|
}
|
|
3551
|
-
return
|
|
4340
|
+
return p && !0 === s && console.table(p.toTable()), await At.whenFontsReady(), At;
|
|
3552
4341
|
} catch (e) {
|
|
3553
4342
|
let t = "Unable to parse XLSX.";
|
|
3554
|
-
throw e instanceof
|
|
4343
|
+
throw e instanceof Ke && (t = "Unable to open XLSX. There are too many rows or columns."), Error(t, { cause: e });
|
|
3555
4344
|
} finally {
|
|
3556
|
-
await
|
|
4345
|
+
await k.close().catch(() => {});
|
|
3557
4346
|
}
|
|
3558
4347
|
};
|
|
3559
|
-
export {
|
|
4348
|
+
export { Wn as i, fr as n, cr as r, Sr as readXLSX, _r as t };
|