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