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