@sheetxl/io-xlsx 0.8.0-beta.10 → 0.8.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/esm/{BLXcoiDAaOMjFuhw.mjs → 9dwUocbOsJuAcmKn.mjs} +3021 -1986
- package/browser/esm/{xc_LzCPgHn-acgFZ.mjs → BIvDjK4Zl8bWRgl8.mjs} +2 -2
- package/browser/esm/CcH5ITJFTMVWUJO9.mjs +6154 -0
- package/browser/esm/{CI_CZI5m5-KkiAK5.mjs → D8k22TSWPd_RHEpj.mjs} +1798 -1009
- package/browser/esm/{BKT8OBj-bhQwdg49.mjs → DKnOwucZq4z9_-r-.mjs} +47 -10
- package/browser/esm/{2EOdn2WRK5y1L58S.mjs → DO75RoAQTgMuVzXv.mjs} +2 -2
- package/browser/esm/{NQIuOQIleHC4NUW6.mjs → DVLJTjJCGqrJUa8c.mjs} +587 -705
- package/browser/esm/DeMZN_qj__PKo4Wh.mjs +2265 -0
- package/browser/esm/{DXopGe8PrLWmwGaV.mjs → DsppUz-14Z7ti9i3.mjs} +1 -1
- package/browser/esm/{B-jb5SuiVh5NnBG_.mjs → aUBXbTh2r0u3x4Xo.mjs} +2 -2
- package/browser/esm/index.mjs +2 -2
- package/node/esm/BmIIQODk4dBVIXA4.mjs +4455 -0
- package/node/esm/{CHqRP_NjPpPd7m9L.mjs → C-e5AO_4TnGywT-m.mjs} +1 -1
- package/node/esm/C78E45n6j2E8rruH.mjs +5694 -0
- package/node/esm/CDKm5s3JE_d99TJw.mjs +2369 -0
- package/node/esm/{BmdmvgO5Zdgx-RWo.mjs → DCaAOfuW-w_dx_qd.mjs} +2 -2
- package/node/esm/{O5mti2R9drFOlXc7.mjs → DSgxL0sBZtWMydVl.mjs} +2 -2
- package/node/esm/DXusvwW73FUDSyvD.mjs +6367 -0
- package/node/esm/DsyuWxk3bdGhJUQN.mjs +2346 -0
- package/node/esm/index.mjs +64 -27
- package/package.json +3 -3
- package/types/src/AutoFilterRules.d.ts +8 -1
- package/types/src/DataTableFormula.d.ts +36 -0
- package/types/src/DefinedNameAttributes.d.ts +8 -0
- package/types/src/ExcelCompat.d.ts +15 -3
- package/types/src/KnownFonts.d.ts +50 -0
- package/types/src/LegacyFormula.d.ts +13 -0
- package/types/src/PageLayoutAttributes.d.ts +8 -0
- package/types/src/Plugin.d.ts +12 -0
- package/types/src/ProtectionAttributes.d.ts +2 -2
- package/types/src/SheetKinds.d.ts +57 -0
- package/types/src/SheetViewAttributes.d.ts +4 -0
- package/types/src/SortExtent.d.ts +16 -0
- package/types/src/Types.d.ts +11 -0
- package/types/src/XlsxHeader.d.ts +19 -0
- package/types/src/chart/ChartExXml.d.ts +38 -0
- package/types/src/chart/ChartPartXml.d.ts +47 -0
- package/types/src/chart/ChartSpaceXml.d.ts +37 -0
- package/types/src/chart/_XmlTree.d.ts +34 -0
- package/types/src/chart/_chartCodecs.d.ts +12 -0
- package/types/src/chart/_chartExCodecs.d.ts +7 -0
- package/types/src/chart/_chartExFold.d.ts +14 -0
- package/types/src/chart/_chartExMarkup.d.ts +236 -0
- package/types/src/chart/_chartExStyle.d.ts +22 -0
- package/types/src/chart/_codec.d.ts +78 -0
- package/types/src/chart/_drawingml.d.ts +10 -0
- package/types/src/chart/_xml.d.ts +70 -0
- package/types/src/reader/CellControls.d.ts +18 -0
- package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts +2 -2
- package/types/src/reader/HeaderStyles.d.ts +15 -0
- package/types/src/reader/IsoDateCell.d.ts +20 -0
- package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -3
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +3 -1
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +23 -8
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -1
- package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +27 -0
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
- package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
- package/types/src/reader/domVisitors/index.d.ts +4 -34
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +46 -6
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +24 -8
- package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
- package/types/src/richValue/IRichValueHandler.d.ts +109 -0
- package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
- package/types/src/richValue/RichDataParts.d.ts +69 -0
- package/types/src/richValue/RichRecordWriter.d.ts +61 -0
- package/types/src/richValue/RichValueHandlers.d.ts +25 -0
- package/types/src/richValue/RichValueResolver.d.ts +54 -0
- package/types/src/richValue/WebImageRichValueHandler.d.ts +42 -0
- package/types/src/richValue/index.d.ts +7 -0
- package/types/src/utils/DrawingMLText.d.ts +2 -2
- package/types/src/utils/FormControls.d.ts +4 -4
- package/types/src/utils/SharedNames.d.ts +13 -0
- package/types/src/utils/SpreadsheetFont.d.ts +38 -0
- package/types/src/utils/VmlNoteShapes.d.ts +16 -23
- package/types/src/utils/VmlNoteStyle.d.ts +44 -0
- package/types/src/utils/VmlPrefixes.d.ts +24 -0
- package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
- package/types/src/writer/builder/Types.d.ts +7 -0
- package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
- package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
- package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +18 -0
- package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
- package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
- package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
- package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
- package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
- package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
- package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
- package/types/src/writer/emitters/SlicerEmitter.d.ts +8 -5
- package/types/src/writer/emitters/StylesEmitter.d.ts +2 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +5 -0
- package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
- package/types/src/writer/utils/AutoFilter.d.ts +1 -1
- package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
- package/types/src/writer/utils/DefaultRows.d.ts +38 -0
- package/types/src/writer/utils/DxfCollector.d.ts +11 -8
- package/types/src/writer/utils/HiddenFormulaXfs.d.ts +1 -1
- package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
- package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
- package/types/src/writer/utils/TextUtils.d.ts +6 -1
- package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
- package/browser/esm/BPmehfSqdvgsLBsB.mjs +0 -5153
- package/node/esm/BpxxiZ2oKPkUSfdB.mjs +0 -2486
- package/node/esm/CtAF486aZqYzMeLM.mjs +0 -3651
- package/node/esm/QS_theNoeqNGLStj.mjs +0 -5298
- package/node/esm/nNQ7MG89sGKwkjMA.mjs +0 -4649
- package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
- package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
- package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
- package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
- package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
- package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
- package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
- package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
- package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
- package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { A as e,
|
|
8
|
-
import { i as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
7
|
+
import { A as e, At as t, Ct as n, D as r, Dt as i, Et as a, F as o, Gn as s, Gt as c, I as l, It as u, Kn as d, Kt as f, L as p, Ln as m, M as h, N as g, O as ee, Ot as _, P as v, Pt as te, R as y, Tt as b, bn as x, et as ne, g as S, j as C, k as re, qt as w, r as ie, rt as ae, st as oe, t as se, tt as ce, wt as T, xt as le, yn as E, yt as ue, z as de } from "./9dwUocbOsJuAcmKn.mjs";
|
|
8
|
+
import { i as fe, n as pe, r as me } from "./D8k22TSWPd_RHEpj.mjs";
|
|
9
|
+
import { a as he, o as ge, r as _e } from "./DeMZN_qj__PKo4Wh.mjs";
|
|
10
|
+
import { CommonUtils as D } from "@sheetxl/utils";
|
|
11
|
+
import { AddressUtils as O, FormulaError as ve, IBorders as k, ICellStyle as A, ICondition as j, IFill as M, IFont as N, IRange as ye, IShape as P, ISlicerStyle as F, ITextFrame as I, ShapeStyleUtils as L, Sort as R, Tuple as be } from "@sheetxl/sdk";
|
|
12
|
+
var xe = class {
|
|
12
13
|
constructor(e) {
|
|
13
14
|
this.list = e;
|
|
14
15
|
}
|
|
@@ -34,14 +35,14 @@ var F = class {
|
|
|
34
35
|
[Symbol.iterator]() {
|
|
35
36
|
return this.list.values();
|
|
36
37
|
}
|
|
37
|
-
},
|
|
38
|
+
}, Se = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null, Ce = (e) => {
|
|
38
39
|
let t = parseInt(e);
|
|
39
40
|
return isNaN(t) ? null : t;
|
|
40
|
-
},
|
|
41
|
+
}, we = (e) => {
|
|
41
42
|
let t = parseFloat(e);
|
|
42
43
|
return isNaN(t) ? null : t;
|
|
43
|
-
},
|
|
44
|
-
constructor(e, t, n, r, i, a = null, o =
|
|
44
|
+
}, Te = /* @__PURE__ */ new Map(), z = class {
|
|
45
|
+
constructor(e, t, n, r, i, a = null, o = D.EmptyObject) {
|
|
45
46
|
this._fileLocation = "";
|
|
46
47
|
let s = (e, t, n) => o?.getRef?.(e, t, n, o?.parsedRefs), c = (e) => o?.getRefs?.(e, o?.parsedRefs);
|
|
47
48
|
this._parent = e, this.sharedShared = t, this.currentPath = n, this.elemRoot = r, this.jsonRoot = i, e ? (this._fileLocation = e._fileLocation, this._getRef = e._getRef, this._getRefs = e._getRefs, this._serializeElement = e._serializeElement, this._readEmbeddedPart = e._readEmbeddedPart) : (a && (this._fileLocation = a), o?.getRef && (this._getRef = s), o?.getRefs && (this._getRefs = c), this._onWarning = o?.onWarning, this._addPerson = o?.addPerson, this._serializeElement = o?.serializeElement, this._readEmbeddedPart = o?.readEmbeddedPart);
|
|
@@ -53,7 +54,7 @@ var F = class {
|
|
|
53
54
|
return this._readEmbeddedPart?.(e, this._fileLocation) ?? null;
|
|
54
55
|
}
|
|
55
56
|
getRelationships() {
|
|
56
|
-
return this._getRefs?.(this._fileLocation) ??
|
|
57
|
+
return this._getRefs?.(this._fileLocation) ?? Te;
|
|
57
58
|
}
|
|
58
59
|
getPath() {
|
|
59
60
|
return this.currentPath;
|
|
@@ -113,7 +114,7 @@ var F = class {
|
|
|
113
114
|
}
|
|
114
115
|
if (n = a, n.length === 0) return null;
|
|
115
116
|
}
|
|
116
|
-
return n.length === 1 ? n[0] : n.length === 0 ? null : new
|
|
117
|
+
return n.length === 1 ? n[0] : n.length === 0 ? null : new xe(n);
|
|
117
118
|
}
|
|
118
119
|
_matchesElementName(e, t) {
|
|
119
120
|
return t.includes(":") ? (e.tagName || e.nodeName) === t : e.localName === t;
|
|
@@ -129,10 +130,10 @@ var F = class {
|
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
getFromPath(e, t) {
|
|
132
|
-
return
|
|
133
|
+
return D.getFromPath(e, t);
|
|
133
134
|
}
|
|
134
135
|
setToPath(e, t, n) {
|
|
135
|
-
return
|
|
136
|
+
return D.setToPath(e, t, n);
|
|
136
137
|
}
|
|
137
138
|
getValAttrAsString(e, t) {
|
|
138
139
|
let n = this.evaluate(e, t);
|
|
@@ -153,13 +154,13 @@ var F = class {
|
|
|
153
154
|
return n && n.hasAttribute("val") ? parseFloat(n.getAttribute("val")) ?? null : null;
|
|
154
155
|
}
|
|
155
156
|
get BOOLEAN_COPY() {
|
|
156
|
-
return
|
|
157
|
+
return Se;
|
|
157
158
|
}
|
|
158
159
|
get INT_COPY() {
|
|
159
|
-
return
|
|
160
|
+
return Ce;
|
|
160
161
|
}
|
|
161
162
|
get FLOAT_COPY() {
|
|
162
|
-
return
|
|
163
|
+
return we;
|
|
163
164
|
}
|
|
164
165
|
copyFromAttribute(e, t, n, r = t, i = null) {
|
|
165
166
|
if (!e || !n || !e.hasAttribute(t)) return;
|
|
@@ -172,67 +173,123 @@ var F = class {
|
|
|
172
173
|
}
|
|
173
174
|
this.setToPath(n, r, a);
|
|
174
175
|
}
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
}, B = (e, t) => {
|
|
177
|
+
let n = [], r = e.childNodes, i = r.length;
|
|
178
|
+
for (let e = 0; e < i; e++) {
|
|
179
|
+
let i = r.item(e);
|
|
180
|
+
i.nodeType === 1 && i.localName === t && n.push(i);
|
|
178
181
|
}
|
|
182
|
+
return n;
|
|
183
|
+
}, Ee = [
|
|
184
|
+
["fillRef", "fill"],
|
|
185
|
+
["lnRef", "stroke"],
|
|
186
|
+
["effectRef", "effect"]
|
|
187
|
+
], V = (e, t) => {
|
|
188
|
+
let n = new h(), r = {};
|
|
189
|
+
for (let [i, a] of Ee) {
|
|
190
|
+
let o = e.evaluate(i, t);
|
|
191
|
+
if (!o) continue;
|
|
192
|
+
let s = { index: parseInt(o.getAttribute("idx") ?? "0", 10) || 0 }, c = n.processAdjColor(e, o);
|
|
193
|
+
c && (s.color = c), r[a] = s;
|
|
194
|
+
}
|
|
195
|
+
let i = e.evaluate("fontRef", t);
|
|
196
|
+
if (i) {
|
|
197
|
+
let t = { index: i.getAttribute("idx") ?? "none" }, a = n.processAdjColor(e, i);
|
|
198
|
+
a && (t.color = a), r.font = t;
|
|
199
|
+
}
|
|
200
|
+
return r;
|
|
201
|
+
}, H = class {
|
|
179
202
|
visit(e, t, n) {
|
|
180
|
-
|
|
181
|
-
|
|
203
|
+
if (!t) return;
|
|
204
|
+
let r = e.evaluate("*/cNvPr", t);
|
|
205
|
+
return r.item && (r = r.item(0)), r && (e.copyFromAttribute(r, "name", n), e.copyFromAttribute(r, "descr", n, "description"), e.copyFromAttribute(r, "hidden", n, "hidden", e.BOOLEAN_COPY), this.readNonVisualDetails(e, r, n), e.copyFromAttribute(r, "id", n)), n;
|
|
182
206
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
let i =
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
207
|
+
readNonVisualDetails(t, n, r) {
|
|
208
|
+
n.hasAttribute("title") && (r.title = n.getAttribute("title"));
|
|
209
|
+
let i = t.evaluate("hlinkClick", n);
|
|
210
|
+
i && (r.hyperlink = e(t, i));
|
|
211
|
+
let a = t.evaluate("hlinkHover", n);
|
|
212
|
+
a && (r.hoverHyperlink = e(t, a));
|
|
213
|
+
let o = t.evaluate("extLst", n), s = o ? t.serializeElement(o) : null;
|
|
214
|
+
s && (r.extLst = {
|
|
215
|
+
...r.extLst,
|
|
216
|
+
nonVisual: s
|
|
217
|
+
});
|
|
191
218
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
case "pieChart":
|
|
203
|
-
n.type = "pie";
|
|
204
|
-
break;
|
|
205
|
-
case "lineChart":
|
|
206
|
-
n.type = "line";
|
|
207
|
-
break;
|
|
208
|
-
case "scatterChart": n.type = "scatter";
|
|
209
|
-
}
|
|
219
|
+
setContent(e, t) {
|
|
220
|
+
let n = e;
|
|
221
|
+
n.name !== void 0 && (t.name = n.name, delete n.name), n.description !== void 0 && (t.description = n.description, delete n.description);
|
|
222
|
+
for (let e of [
|
|
223
|
+
"title",
|
|
224
|
+
"hyperlink",
|
|
225
|
+
"hoverHyperlink",
|
|
226
|
+
"extLst"
|
|
227
|
+
]) n[e] !== void 0 && (t.json && (t.json[e] = n[e]), delete n[e]);
|
|
228
|
+
e.content = t;
|
|
210
229
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
r && r.length !== 0 && (n.xAxisId = r.item(0).getAttribute("val"), n.yAxisId = r.item(1).getAttribute("val"));
|
|
230
|
+
isGroupContent(e) {
|
|
231
|
+
return Array.isArray(e?.members);
|
|
214
232
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
233
|
+
readMemberHeader(e, t, n) {
|
|
234
|
+
let r = {}, i = {
|
|
235
|
+
anchor: void 0,
|
|
236
|
+
content: {
|
|
237
|
+
type: n,
|
|
238
|
+
json: r
|
|
221
239
|
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
240
|
+
}, a = e.evaluate("*/cNvPr", t);
|
|
241
|
+
if (a?.item && (a = a.item(0)), a) {
|
|
242
|
+
let n = a.getAttribute("name");
|
|
243
|
+
n !== null && (i.content.name = n);
|
|
244
|
+
let o = a.getAttribute("descr");
|
|
245
|
+
o && (i.content.description = o), e.copyFromAttribute(a, "hidden", i, "hidden", e.BOOLEAN_COPY), this.readNonVisualDetails(e, a, r);
|
|
246
|
+
let s = this.readSourceId(e, t);
|
|
247
|
+
s !== void 0 && (r.sourceId = s);
|
|
229
248
|
}
|
|
249
|
+
return {
|
|
250
|
+
movable: i,
|
|
251
|
+
content: r
|
|
252
|
+
};
|
|
230
253
|
}
|
|
231
|
-
|
|
254
|
+
readStyleRefs(e, t, n) {
|
|
255
|
+
let r = e.evaluate("style", t);
|
|
256
|
+
if (!r) return void (n.style = null);
|
|
257
|
+
let i = V(e, r), a = L.withoutDefaultStyleRefs({
|
|
258
|
+
...n,
|
|
259
|
+
style: i
|
|
260
|
+
});
|
|
261
|
+
a && (n.style = a);
|
|
262
|
+
}
|
|
263
|
+
readLocks(e) {
|
|
264
|
+
let t = e?.attributes;
|
|
265
|
+
if (!t || t.length === 0) return;
|
|
266
|
+
let n = {};
|
|
267
|
+
for (let e = 0; e < t.length; e++) {
|
|
268
|
+
let r = t.item(e);
|
|
269
|
+
r.name.startsWith("xmlns") || (n[r.localName ?? r.name] = f(r.value));
|
|
270
|
+
}
|
|
271
|
+
return Object.keys(n).length > 0 ? n : void 0;
|
|
272
|
+
}
|
|
273
|
+
readSourceId(e, t) {
|
|
274
|
+
let n = e.evaluate("*/cNvPr", t);
|
|
275
|
+
n?.item && (n = n.item(0));
|
|
276
|
+
let r = n?.getAttribute?.("id"), i = r ? parseInt(r, 10) : void 0;
|
|
277
|
+
return i === void 0 || isNaN(i) ? void 0 : i;
|
|
278
|
+
}
|
|
279
|
+
}, De = [
|
|
280
|
+
["spDef", "shape"],
|
|
281
|
+
["lnDef", "line"],
|
|
282
|
+
["txDef", "text"]
|
|
283
|
+
], U = (e, t) => {
|
|
284
|
+
let n = t.getAttribute("dxfId");
|
|
285
|
+
if (n === null) return;
|
|
286
|
+
let r = parseInt(n);
|
|
287
|
+
return e.getVisitorParamsState().get("dxfs")?.get(r) || (e.warn(`A color filter or sort names a format that does not exist (dxfId '${n}').`), {});
|
|
288
|
+
}, W = (e) => e === "1" || e === "true", G = class {
|
|
232
289
|
visit(e, t, n) {}
|
|
233
290
|
processDataBarColor(e, t, n, r, i = "auto") {
|
|
234
291
|
if (!t) return;
|
|
235
|
-
let a =
|
|
292
|
+
let a = E((e) => t.getAttribute(e), i);
|
|
236
293
|
return a && (n[r] = a), n;
|
|
237
294
|
}
|
|
238
295
|
processFonts(e, t, n) {
|
|
@@ -248,14 +305,19 @@ var F = class {
|
|
|
248
305
|
return n;
|
|
249
306
|
}
|
|
250
307
|
processFont(e, t, n) {
|
|
251
|
-
e.getValAttrAsBoolean("b", t, !0) && (n.weight = 700), e.getValAttrAsBoolean("i", t, !0) && (n.style =
|
|
252
|
-
let
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
308
|
+
e.getValAttrAsBoolean("b", t, !0) && (n.weight = 700), e.getValAttrAsBoolean("i", t, !0) && (n.style = N.Style.Italic), e.getValAttrAsBoolean("strike", t, !0) && (n.strike = i(!0));
|
|
309
|
+
let r = e.evaluate("u", t);
|
|
310
|
+
if (r) {
|
|
311
|
+
let e = r.getAttribute("val");
|
|
312
|
+
n.underline = _(e);
|
|
313
|
+
}
|
|
314
|
+
let s = T(e.evaluate("vertAlign", t)?.getAttribute("val"));
|
|
315
|
+
s !== void 0 && (n.baseline = s), l(e, t, n, "sz", "size");
|
|
316
|
+
let c = e.evaluate("color", t);
|
|
317
|
+
this.processDataBarColor(e, c, n, "color"), n.color ||= "auto", y(e, t, n, "name", "family"), y(e, t, n, "rFont", "family");
|
|
318
|
+
let u = e.evaluate("family", t);
|
|
319
|
+
if (u) {
|
|
320
|
+
let e = u.getAttribute("val");
|
|
259
321
|
if (e) switch (e) {
|
|
260
322
|
case "1":
|
|
261
323
|
n.fallbacks = ["serif"];
|
|
@@ -272,7 +334,12 @@ var F = class {
|
|
|
272
334
|
case "5": n.fallbacks = ["fantasy"];
|
|
273
335
|
}
|
|
274
336
|
}
|
|
275
|
-
|
|
337
|
+
b(n, e.evaluate("scheme", t)?.getAttribute("val")), o(e, t, n, "shadow", "shadow", !0), o(e, t, n, "outline", "outline", !0);
|
|
338
|
+
for (let r of ["condense", "extend"]) {
|
|
339
|
+
let i = a(r, !!e.getValAttrAsBoolean(r, t, !0));
|
|
340
|
+
i !== void 0 && (n.letterSpacing = i);
|
|
341
|
+
}
|
|
342
|
+
return p(e, t, n, "charset", "charset"), n;
|
|
276
343
|
}
|
|
277
344
|
processFills(e, t, n) {
|
|
278
345
|
if (!t) return;
|
|
@@ -284,7 +351,7 @@ var F = class {
|
|
|
284
351
|
return n;
|
|
285
352
|
}
|
|
286
353
|
processFill(e, t, n, r) {
|
|
287
|
-
let i = { type:
|
|
354
|
+
let i = { type: M.Type.None }, a = t.childNodes, o = !1, s = a.length;
|
|
288
355
|
for (let t = 0; !o && t < s; t++) {
|
|
289
356
|
let n = a.item(t);
|
|
290
357
|
n.nodeType === 1 && (n.localName === "gradientFill" ? (this.processGradientFill(e, n, i), o = !0) : n.localName === "patternFill" && (this.processPatternFill(e, n, i), o = !0));
|
|
@@ -293,17 +360,17 @@ var F = class {
|
|
|
293
360
|
}
|
|
294
361
|
processGradientFill(e, t, n) {
|
|
295
362
|
if (!t) return;
|
|
296
|
-
n.type =
|
|
363
|
+
n.type = M.Type.Gradient;
|
|
297
364
|
let r = [];
|
|
298
365
|
n.stops = r;
|
|
299
366
|
let i = t.getAttribute("type");
|
|
300
367
|
i && (n.gradientType = i);
|
|
301
368
|
let a = t.hasAttribute("degree") ? parseFloat(t.getAttribute("degree")) : 0;
|
|
302
369
|
(a + 90) % 360 != 0 && (n.angle = (a + 90) % 360), (t.hasAttribute("left") || t.hasAttribute("top") || t.hasAttribute("right") || t.hasAttribute("bottom")) && (n.focus = {
|
|
303
|
-
left:
|
|
304
|
-
top:
|
|
305
|
-
right:
|
|
306
|
-
bottom:
|
|
370
|
+
left: K(t.getAttribute("left")),
|
|
371
|
+
top: K(t.getAttribute("top")),
|
|
372
|
+
right: K(t.getAttribute("right")),
|
|
373
|
+
bottom: K(t.getAttribute("bottom"))
|
|
307
374
|
});
|
|
308
375
|
let o = t.childNodes, s = o.length;
|
|
309
376
|
for (let t = 0; t < s; t++) {
|
|
@@ -319,10 +386,10 @@ var F = class {
|
|
|
319
386
|
}
|
|
320
387
|
processPatternFill(e, t, n) {
|
|
321
388
|
if (!t) return;
|
|
322
|
-
let r = e.getVisitorParamsState().get("processingDXFs"), i = t.getAttribute("patternType") || (r ?
|
|
323
|
-
if (i ===
|
|
324
|
-
n.type =
|
|
325
|
-
let a = "foreground", o = "background", s = n.patternType ===
|
|
389
|
+
let r = e.getVisitorParamsState().get("processingDXFs"), i = t.getAttribute("patternType") || (r ? M.BuiltInSheetPattern.Solid : M.BuiltInSheetPattern.None);
|
|
390
|
+
if (i === M.BuiltInSheetPattern.None) return { none: !0 };
|
|
391
|
+
n.type = M.Type.Pattern, i && (n.patternType = i);
|
|
392
|
+
let a = "foreground", o = "background", s = n.patternType === M.BuiltInSheetPattern.Solid && r, c = s ? "dk1" : "lt1", l = s ? "lt1" : "dk1";
|
|
326
393
|
if (s) {
|
|
327
394
|
let e = a;
|
|
328
395
|
a = o, o = e;
|
|
@@ -344,26 +411,36 @@ var F = class {
|
|
|
344
411
|
processBorder(e, t, n, r, i) {
|
|
345
412
|
if (!t) return;
|
|
346
413
|
let a = {};
|
|
347
|
-
|
|
414
|
+
this.processBorderStroke(e, t, a, k.Edge.Left), this.processBorderStroke(e, t, a, k.Edge.Right), i ? (a.right || a.left) && (a.vertical = a.right ? { ...a.right } : { ...a.left }) : this.processBorderStroke(e, t, a, k.Edge.Vertical), this.processBorderStroke(e, t, a, k.Edge.Top), this.processBorderStroke(e, t, a, k.Edge.Bottom), i ? (a.bottom || a.top) && (a.horizontal = a.bottom ? { ...a.bottom } : { ...a.top }) : this.processBorderStroke(e, t, a, k.Edge.Horizontal);
|
|
415
|
+
let o = this.processBorderStroke(e, t, {}, "diagonal");
|
|
416
|
+
return o && (W(t.getAttribute("diagonalUp")) && (a.diagonalUp = { ...o }), W(t.getAttribute("diagonalDown")) && (a.diagonalDown = { ...o })), n[r] = a, n;
|
|
348
417
|
}
|
|
349
418
|
processBorderStroke(e, t, n, r) {
|
|
350
419
|
if (!t) return;
|
|
351
420
|
let i = e.evaluate(r, t);
|
|
352
421
|
if (!i) return;
|
|
353
422
|
let a = {};
|
|
354
|
-
i.hasAttribute("style") ? a.style = i.getAttribute("style") : e.getVisitorParamsState().get("processingDXFs") && (a.style =
|
|
423
|
+
i.hasAttribute("style") ? a.style = i.getAttribute("style") : e.getVisitorParamsState().get("processingDXFs") && (a.style = k.StrokeStyle.None);
|
|
355
424
|
let o = e.evaluate("color", i);
|
|
356
425
|
return o && this.processDataBarColor(e, o, a, "color"), Object.keys(a).length > 0 ? n[r] = a : null;
|
|
357
426
|
}
|
|
358
|
-
},
|
|
427
|
+
}, K = (e) => {
|
|
359
428
|
if (!e) return 0;
|
|
360
429
|
let t = parseFloat(e);
|
|
361
430
|
return isNaN(t) ? 0 : t;
|
|
362
|
-
},
|
|
431
|
+
}, q = (e, t) => {
|
|
432
|
+
if (!e || e.nodeType !== 1) return null;
|
|
433
|
+
let n = e.childNodes;
|
|
434
|
+
for (let e = 0; e < n.length; e++) {
|
|
435
|
+
let r = n.item(e);
|
|
436
|
+
if (r.nodeType === 1 && r.localName === t) return r;
|
|
437
|
+
}
|
|
438
|
+
return null;
|
|
439
|
+
}, Oe = new Set(Object.values(F.ElementType).filter((e) => e !== F.ElementType.WholeTable && e !== F.ElementType.HeaderRow)), ke = {
|
|
363
440
|
auto: "auto",
|
|
364
441
|
autoNoTable: "automaticExceptTables",
|
|
365
442
|
manual: "manual"
|
|
366
|
-
},
|
|
443
|
+
}, J = [
|
|
367
444
|
"tableId",
|
|
368
445
|
"columnId",
|
|
369
446
|
"cacheName",
|
|
@@ -372,10 +449,10 @@ var F = class {
|
|
|
372
449
|
"sortOrder",
|
|
373
450
|
"customListSort",
|
|
374
451
|
"crossFilter"
|
|
375
|
-
],
|
|
452
|
+
], Y = (e, t) => {
|
|
376
453
|
let n = e.content, r = n?.json;
|
|
377
454
|
if (r) {
|
|
378
|
-
if (n.type === "shape" ||
|
|
455
|
+
if (n.type === "shape" || n.type === "picture") {
|
|
379
456
|
let { rotation: n, flipH: i, flipV: a, bounds: o } = r;
|
|
380
457
|
delete r.rotation, delete r.flipH, delete r.flipV, delete r.bounds, n !== void 0 && n !== 0 && (e.rotation = n), i && (e.flipH = !0), a && (e.flipV = !0), t && o && (e.anchor = {
|
|
381
458
|
tl: {
|
|
@@ -388,130 +465,36 @@ var F = class {
|
|
|
388
465
|
}
|
|
389
466
|
});
|
|
390
467
|
}
|
|
391
|
-
if (n.type === "group") for (let e of r.members ?? [])
|
|
468
|
+
if (n.type === "group") for (let e of r.members ?? []) Y(e, !0);
|
|
392
469
|
}
|
|
393
|
-
},
|
|
394
|
-
["fillRef", "fill"],
|
|
395
|
-
["lnRef", "stroke"],
|
|
396
|
-
["effectRef", "effect"]
|
|
397
|
-
], q = class {
|
|
398
|
-
visit(e, t, n) {
|
|
399
|
-
if (!t) return;
|
|
400
|
-
let r = e.evaluate("*/cNvPr", t);
|
|
401
|
-
return r.item && (r = r.item(0)), r && (e.copyFromAttribute(r, "name", n), e.copyFromAttribute(r, "descr", n, "description"), e.copyFromAttribute(r, "hidden", n, "hidden", e.BOOLEAN_COPY), this.readNonVisualDetails(e, r, n), e.copyFromAttribute(r, "id", n)), n;
|
|
402
|
-
}
|
|
403
|
-
readNonVisualDetails(e, n, r) {
|
|
404
|
-
n.hasAttribute("title") && (r.title = n.getAttribute("title"));
|
|
405
|
-
let i = e.evaluate("hlinkClick", n);
|
|
406
|
-
i && (r.hyperlink = t(e, i));
|
|
407
|
-
let a = e.evaluate("hlinkHover", n);
|
|
408
|
-
a && (r.hoverHyperlink = t(e, a));
|
|
409
|
-
let o = e.evaluate("extLst", n), s = o ? e.serializeElement(o) : null;
|
|
410
|
-
s && (r.extLst = {
|
|
411
|
-
...r.extLst,
|
|
412
|
-
nonVisual: s
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
setContent(e, t) {
|
|
416
|
-
let n = e;
|
|
417
|
-
n.name !== void 0 && (t.name = n.name, delete n.name), n.description !== void 0 && (t.description = n.description, delete n.description);
|
|
418
|
-
for (let e of [
|
|
419
|
-
"title",
|
|
420
|
-
"hyperlink",
|
|
421
|
-
"hoverHyperlink",
|
|
422
|
-
"extLst"
|
|
423
|
-
]) n[e] !== void 0 && (t.json && (t.json[e] = n[e]), delete n[e]);
|
|
424
|
-
e.content = t;
|
|
425
|
-
}
|
|
426
|
-
isGroupContent(e) {
|
|
427
|
-
return Array.isArray(e?.members);
|
|
428
|
-
}
|
|
429
|
-
readMemberHeader(e, t, n) {
|
|
430
|
-
let r = {}, i = {
|
|
431
|
-
anchor: void 0,
|
|
432
|
-
content: {
|
|
433
|
-
type: n,
|
|
434
|
-
json: r
|
|
435
|
-
}
|
|
436
|
-
}, a = e.evaluate("*/cNvPr", t);
|
|
437
|
-
if (a?.item && (a = a.item(0)), a) {
|
|
438
|
-
let n = a.getAttribute("name");
|
|
439
|
-
n !== null && (i.content.name = n);
|
|
440
|
-
let o = a.getAttribute("descr");
|
|
441
|
-
o && (i.content.description = o), e.copyFromAttribute(a, "hidden", i, "hidden", e.BOOLEAN_COPY), this.readNonVisualDetails(e, a, r);
|
|
442
|
-
let s = this.readSourceId(e, t);
|
|
443
|
-
s !== void 0 && (r.sourceId = s);
|
|
444
|
-
}
|
|
445
|
-
return {
|
|
446
|
-
movable: i,
|
|
447
|
-
content: r
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
readStyleRefs(e, t, n) {
|
|
451
|
-
let r = e.evaluate("style", t);
|
|
452
|
-
if (!r) return void (n.style = null);
|
|
453
|
-
let i = new v(), a = {};
|
|
454
|
-
for (let [t, n] of le) {
|
|
455
|
-
let o = e.evaluate(t, r);
|
|
456
|
-
if (!o) continue;
|
|
457
|
-
let s = { index: parseInt(o.getAttribute("idx") ?? "0", 10) || 0 }, c = i.processAdjColor(e, o);
|
|
458
|
-
c && (s.color = c), a[n] = s;
|
|
459
|
-
}
|
|
460
|
-
let o = e.evaluate("fontRef", r);
|
|
461
|
-
if (o) {
|
|
462
|
-
let t = { index: o.getAttribute("idx") ?? "none" }, n = i.processAdjColor(e, o);
|
|
463
|
-
n && (t.color = n), a.font = t;
|
|
464
|
-
}
|
|
465
|
-
let s = ie.withoutDefaultStyleRefs({
|
|
466
|
-
...n,
|
|
467
|
-
style: a
|
|
468
|
-
});
|
|
469
|
-
s && (n.style = s);
|
|
470
|
-
}
|
|
471
|
-
readLocks(e) {
|
|
472
|
-
let t = e?.attributes;
|
|
473
|
-
if (!t || t.length === 0) return;
|
|
474
|
-
let n = {};
|
|
475
|
-
for (let e = 0; e < t.length; e++) {
|
|
476
|
-
let r = t.item(e);
|
|
477
|
-
r.name.startsWith("xmlns") || (n[r.localName ?? r.name] = b(r.value));
|
|
478
|
-
}
|
|
479
|
-
return Object.keys(n).length > 0 ? n : void 0;
|
|
480
|
-
}
|
|
481
|
-
readSourceId(e, t) {
|
|
482
|
-
let n = e.evaluate("*/cNvPr", t);
|
|
483
|
-
n?.item && (n = n.item(0));
|
|
484
|
-
let r = n?.getAttribute?.("id"), i = r ? parseInt(r, 10) : void 0;
|
|
485
|
-
return i === void 0 || isNaN(i) ? void 0 : i;
|
|
486
|
-
}
|
|
487
|
-
}, J = class extends q {
|
|
470
|
+
}, X = class extends H {
|
|
488
471
|
visit(e, t, n) {
|
|
489
472
|
if (t) return this.visitShape(e, t, n, "sp", "nvSpPr/cNvSpPr/spLocks");
|
|
490
473
|
}
|
|
491
|
-
visitShape(e, t, n,
|
|
492
|
-
let o = i
|
|
474
|
+
visitShape(e, t, n, i, a) {
|
|
475
|
+
let o = de[i];
|
|
493
476
|
if (this.isGroupContent(n)) {
|
|
494
477
|
if (e.getPath().includes("Fallback")) return {};
|
|
495
|
-
let { movable:
|
|
496
|
-
o !==
|
|
478
|
+
let { movable: r, content: s } = this.readMemberHeader(e, t, "shape");
|
|
479
|
+
o !== P.Type.Shape && (s.type = o), this.readShapeDetails(e, t, i, a, s), this.readStyleRefs(e, t, s);
|
|
497
480
|
let c = e.evaluate(a, t);
|
|
498
|
-
c?.hasAttribute?.("noChangeAspect") && (
|
|
481
|
+
c?.hasAttribute?.("noChangeAspect") && (r.lockAspect = c.getAttribute("noChangeAspect") === "1");
|
|
499
482
|
let l = this.readTwinOf(e, t);
|
|
500
|
-
return l !== void 0 && Object.assign(s, { twinOf: l }), n.members.push(
|
|
483
|
+
return l !== void 0 && Object.assign(s, { twinOf: l }), n.members.push(r), s;
|
|
501
484
|
}
|
|
502
485
|
if (e.getPath().includes("Fallback") && n.content) {
|
|
503
|
-
let
|
|
504
|
-
if (n.content.type === "shape" &&
|
|
505
|
-
let n = e.evaluate("txBody", t),
|
|
506
|
-
|
|
486
|
+
let i = n.content.json;
|
|
487
|
+
if (n.content.type === "shape" && i && (i.type ?? P.Type.Shape) === o) {
|
|
488
|
+
let n = e.evaluate("txBody", t), a = n ? new r().readTextBody(e, n) : null;
|
|
489
|
+
a && ee(a) !== "" && (i.text = a);
|
|
507
490
|
}
|
|
508
491
|
return {};
|
|
509
492
|
}
|
|
510
493
|
n = super.visit(e, t, n);
|
|
511
494
|
let s = e.evaluate(a, t);
|
|
512
495
|
s?.hasAttribute?.("noChangeAspect") && (n.lockAspect = s.getAttribute("noChangeAspect") === "1");
|
|
513
|
-
let c = o ===
|
|
514
|
-
l !== void 0 && (c.sourceId = l), this.
|
|
496
|
+
let c = o === P.Type.Shape ? {} : { type: o }, l = this.readSourceId(e, t);
|
|
497
|
+
l !== void 0 && (c.sourceId = l), this.readShapeDetails(e, t, i, a, c), this.readStyleRefs(e, t, c);
|
|
515
498
|
let u = this.readTwinOf(e, t);
|
|
516
499
|
return u !== void 0 && Object.assign(c, { twinOf: u }), this.setContent(n, {
|
|
517
500
|
type: "shape",
|
|
@@ -528,7 +511,7 @@ var F = class {
|
|
|
528
511
|
let a = t.getAttribute("macro");
|
|
529
512
|
a && (i.macro = a);
|
|
530
513
|
let o = t.getAttribute("textlink");
|
|
531
|
-
o && (i.textLink = o), t.hasAttribute("fLocksText") && (i.locksText =
|
|
514
|
+
o && (i.textLink = o), t.hasAttribute("fLocksText") && (i.locksText = f(t.getAttribute("fLocksText"))), t.hasAttribute("fPublished") && (i.published = f(t.getAttribute("fPublished")));
|
|
532
515
|
let s = r.slice(0, r.lastIndexOf("/")), c = e.evaluate(s, t);
|
|
533
516
|
c?.getAttribute?.("txBox") === "1" && (i.textBox = !0);
|
|
534
517
|
let l = this.readLocks(e.evaluate(r, t));
|
|
@@ -543,25 +526,25 @@ var F = class {
|
|
|
543
526
|
(n || r) && (i.connectorEnds = {}, n && (i.connectorEnds.start = n), r && (i.connectorEnds.end = r));
|
|
544
527
|
}
|
|
545
528
|
}
|
|
546
|
-
},
|
|
529
|
+
}, Ae = /^<a:extLst(?:\s+xmlns:a="[^"]*")?><a:ext uri="\{28A0092B-C50C-407E-A947-70E740481C1C\}"><a14:useLocalDpi(?:\s+xmlns:a14="[^"]*")?\s+val="0"\s*\/><\/a:ext><\/a:extLst>$/, Z = (e, t, n, r) => {
|
|
547
530
|
let i = e.evaluate(n, t), a = e.evaluate(r, t);
|
|
548
531
|
return i || a ? {
|
|
549
|
-
x:
|
|
550
|
-
y:
|
|
551
|
-
width:
|
|
552
|
-
height:
|
|
532
|
+
x: w(i?.getAttribute("x") ?? null) ?? 0,
|
|
533
|
+
y: w(i?.getAttribute("y") ?? null) ?? 0,
|
|
534
|
+
width: w(a?.getAttribute("cx") ?? null) ?? 0,
|
|
535
|
+
height: w(a?.getAttribute("cy") ?? null) ?? 0
|
|
553
536
|
} : null;
|
|
554
|
-
},
|
|
537
|
+
}, je = { Checkbox: "checkbox" }, Q = (e) => {
|
|
555
538
|
let t = e.getAttribute("val");
|
|
556
539
|
return t !== "0" && t !== "false";
|
|
557
|
-
},
|
|
540
|
+
}, Me = {
|
|
558
541
|
1: "serif",
|
|
559
542
|
2: "sans-serif",
|
|
560
543
|
3: "monospace",
|
|
561
544
|
4: "cursive",
|
|
562
545
|
5: "fantasy"
|
|
563
546
|
};
|
|
564
|
-
function
|
|
547
|
+
function Ne(e) {
|
|
565
548
|
let t = {}, n = e.childNodes;
|
|
566
549
|
for (let e = 0; e < n.length; e++) {
|
|
567
550
|
let r = n.item(e);
|
|
@@ -570,10 +553,10 @@ function de(e) {
|
|
|
570
553
|
t.weight = Q(r) ? 700 : 400;
|
|
571
554
|
break;
|
|
572
555
|
case "i":
|
|
573
|
-
t.style = Q(r) ?
|
|
556
|
+
t.style = Q(r) ? N.Style.Italic : N.Style.Normal;
|
|
574
557
|
break;
|
|
575
558
|
case "strike":
|
|
576
|
-
t.strike = Q(r);
|
|
559
|
+
t.strike = i(Q(r));
|
|
577
560
|
break;
|
|
578
561
|
case "outline":
|
|
579
562
|
t.outline = Q(r);
|
|
@@ -581,15 +564,18 @@ function de(e) {
|
|
|
581
564
|
case "shadow":
|
|
582
565
|
t.shadow = Q(r);
|
|
583
566
|
break;
|
|
584
|
-
case "
|
|
585
|
-
|
|
567
|
+
case "condense":
|
|
568
|
+
case "extend": {
|
|
569
|
+
let e = a(r.localName, Q(r));
|
|
570
|
+
e !== void 0 && (t.letterSpacing = e);
|
|
586
571
|
break;
|
|
572
|
+
}
|
|
587
573
|
case "u":
|
|
588
|
-
t.underline = r.getAttribute("val")
|
|
574
|
+
t.underline = _(r.getAttribute("val"));
|
|
589
575
|
break;
|
|
590
576
|
case "vertAlign": {
|
|
591
|
-
let e = r.getAttribute("val");
|
|
592
|
-
e
|
|
577
|
+
let e = T(r.getAttribute("val"));
|
|
578
|
+
e !== void 0 && (t.baseline = e);
|
|
593
579
|
break;
|
|
594
580
|
}
|
|
595
581
|
case "sz": {
|
|
@@ -603,7 +589,7 @@ function de(e) {
|
|
|
603
589
|
break;
|
|
604
590
|
}
|
|
605
591
|
case "family": {
|
|
606
|
-
let e =
|
|
592
|
+
let e = Me[r.getAttribute("val") ?? ""];
|
|
607
593
|
e && (t.fallbacks = [e]);
|
|
608
594
|
break;
|
|
609
595
|
}
|
|
@@ -612,18 +598,16 @@ function de(e) {
|
|
|
612
598
|
isNaN(e) || (t.charset = e);
|
|
613
599
|
break;
|
|
614
600
|
}
|
|
615
|
-
case "scheme":
|
|
616
|
-
|
|
617
|
-
e && (t.scheme = e);
|
|
601
|
+
case "scheme":
|
|
602
|
+
b(t, r.getAttribute("val"));
|
|
618
603
|
break;
|
|
619
|
-
}
|
|
620
604
|
case "color": {
|
|
621
605
|
let e = r.getAttribute("rgb");
|
|
622
606
|
if (e && !r.hasAttribute("theme")) {
|
|
623
607
|
t.color = "#" + (e.length === 8 ? e.substring(2) : e).toUpperCase();
|
|
624
608
|
break;
|
|
625
609
|
}
|
|
626
|
-
let n =
|
|
610
|
+
let n = E((e) => r.getAttribute(e));
|
|
627
611
|
n && (t.color = n);
|
|
628
612
|
break;
|
|
629
613
|
}
|
|
@@ -667,14 +651,37 @@ var $ = {
|
|
|
667
651
|
},
|
|
668
652
|
AppPropertiesVisitor: class {
|
|
669
653
|
visit(e, t, n) {
|
|
670
|
-
let r =
|
|
671
|
-
for (let
|
|
672
|
-
|
|
654
|
+
let r = t.childNodes, i = r.length;
|
|
655
|
+
for (let e = 0; e < i; e++) if (r.item(e).localName === "property") return this.visitCustom(t, n);
|
|
656
|
+
let a = [];
|
|
657
|
+
for (let t = 0; t < i; t++) {
|
|
658
|
+
let n = r.item(t);
|
|
673
659
|
if (n.nodeType !== 1) continue;
|
|
674
|
-
let
|
|
675
|
-
|
|
660
|
+
let i = this.processProperty(e, n);
|
|
661
|
+
i && a.push(i);
|
|
676
662
|
}
|
|
677
|
-
return
|
|
663
|
+
return a.length > 0 && (n.properties = a), a;
|
|
664
|
+
}
|
|
665
|
+
visitCustom(e, t) {
|
|
666
|
+
let n = [], r = e.childNodes, i = r.length;
|
|
667
|
+
for (let e = 0; e < i; e++) {
|
|
668
|
+
let t = r.item(e);
|
|
669
|
+
if (t.nodeType !== 1 || t.localName !== "property") continue;
|
|
670
|
+
let i = t.getAttribute("name");
|
|
671
|
+
if (!i) continue;
|
|
672
|
+
let a = null;
|
|
673
|
+
for (let e = 0; e < t.childNodes.length && !a; e++) {
|
|
674
|
+
let n = t.childNodes.item(e);
|
|
675
|
+
n.nodeType === 1 && (a = n);
|
|
676
|
+
}
|
|
677
|
+
let o = {
|
|
678
|
+
key: i,
|
|
679
|
+
kind: a?.localName ?? null,
|
|
680
|
+
value: a?.textContent ?? ""
|
|
681
|
+
}, s = t.getAttribute("linkTarget");
|
|
682
|
+
s && (o.linkTarget = s), n.push(o);
|
|
683
|
+
}
|
|
684
|
+
return n.length > 0 && (t.custom = n), n;
|
|
678
685
|
}
|
|
679
686
|
processProperty(e, t) {
|
|
680
687
|
if (t) return {
|
|
@@ -683,272 +690,37 @@ var $ = {
|
|
|
683
690
|
};
|
|
684
691
|
}
|
|
685
692
|
},
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
afterVisit(e, t, n) {
|
|
691
|
-
let r = {};
|
|
692
|
-
n.types = r;
|
|
693
|
-
let i = {}, a = 0, o = {}, s = 0, c = e.getVisitorParamsState().get("axes"), l = e.getVisitorParamsState().get("types"), u = l.length;
|
|
694
|
-
for (let e = 0; e < u; e++) {
|
|
695
|
-
let t = l[e];
|
|
696
|
-
if (t.xAxisId) {
|
|
697
|
-
let r = t.xAxisId, o = c.get(r);
|
|
698
|
-
i[e + ""] = o, t.offsetXAxis = e, delete t.xAxisId, n.xAxes = i, i.length = ++a;
|
|
699
|
-
}
|
|
700
|
-
if (t.yAxisId) {
|
|
701
|
-
let r = t.yAxisId, i = c.get(r);
|
|
702
|
-
o[e + ""] = i, t.offsetYAxis = e, delete t.yAxisId, n.yAxes = o, o.length = ++s;
|
|
703
|
-
}
|
|
704
|
-
r[e + ""] = t;
|
|
705
|
-
}
|
|
706
|
-
r.length = l.length;
|
|
707
|
-
let d = e.getVisitorParamsState().get("series");
|
|
708
|
-
if (!d || d.length === 0) return;
|
|
709
|
-
let f = {};
|
|
710
|
-
n.series = f;
|
|
711
|
-
let p = d.length;
|
|
712
|
-
for (let e = 0; e < p; e++) f[e + ""] = d[e];
|
|
713
|
-
f.length = p, e.getVisitorParamsState().delete("types"), e.getVisitorParamsState().delete("axes"), e.getVisitorParamsState().delete("series");
|
|
714
|
-
}
|
|
715
|
-
},
|
|
716
|
-
ChartVisitor: class {
|
|
717
|
-
visit(e, t, n) {
|
|
718
|
-
return e.getVisitorParamsState().set("types", []), e.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()), a(e, t, n, "plotVisOnly", "plotVisOnly"), r(e, t, n, "dispBlanksAs", "dispBlanksAs"), a(e, t, n, ".//extLst/ext/dataDisplayOptions16/dispNaAsBlank", "dispNaAsBlank"), a(e, t, n, "showDLblsOverMax", "showDLblsOverMax"), n;
|
|
719
|
-
}
|
|
720
|
-
afterVisit(e, t, n) {
|
|
721
|
-
try {
|
|
722
|
-
let r = e.getValAttrAsBoolean("autoTitleDeleted", t), i = e.evaluate("title", t);
|
|
723
|
-
e.setToPath(n, "title.shown", !(!0 === r || !i));
|
|
724
|
-
let a = e.evaluate("legend", t);
|
|
725
|
-
e.setToPath(n, "legend.shown", a !== null);
|
|
726
|
-
} catch (e) {
|
|
727
|
-
throw Error("Unexpected Error parsing Chart: " + e);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
},
|
|
731
|
-
PlotAreaVisitor: class {
|
|
732
|
-
visit(e, t, n) {
|
|
733
|
-
let r = {};
|
|
734
|
-
return n.plotArea = r, r;
|
|
735
|
-
}
|
|
736
|
-
},
|
|
737
|
-
ShapePropertiesVisitor: s,
|
|
738
|
-
BarChartTypeVisitor: class extends z {
|
|
739
|
-
parseType(e, t, n) {
|
|
740
|
-
let r = e.getValAttrAsString("barDir", t);
|
|
741
|
-
r && (n.type = r === "col" ? "column" : "bar");
|
|
742
|
-
}
|
|
743
|
-
},
|
|
744
|
-
ChartTypeVisitor: z,
|
|
745
|
-
DataLabelsVisitor: class {
|
|
746
|
-
constructor(e) {
|
|
747
|
-
this.jsonKey = e;
|
|
748
|
-
}
|
|
749
|
-
visit(e, t, n) {
|
|
750
|
-
let i = {}, o = i, s = e.getValAttrAsString("idx", t);
|
|
751
|
-
s !== null && (o = {}, o[s] = i);
|
|
752
|
-
let c = e.getValAttrAsBoolean("delete", t);
|
|
753
|
-
this.parseNumFormat(e, t, i), !0 === c ? (i.showBubbleSize = !1, i.showCatName = !1, i.showLeaderLines = !1, i.showPercentage = !1, i.showSerName = !1, i.showVal = !1, i.showLegendKey = !1) : (a(e, t, i, "showBubbleSize", "showBubbleSize"), a(e, t, i, "showCatName", "showCatName"), a(e, t, i, "showLeaderLines", "showLeaderLines"), a(e, t, i, "showPercent", "showPercentage"), a(e, t, i, "showSerName", "showSerName"), a(e, t, i, "showVal", "showVal"), a(e, t, i, "showLegendKey", "showLegendKey"));
|
|
754
|
-
let l = e.evaluate("separator", t);
|
|
755
|
-
return l !== null && (i.separator = l.textContent), r(e, t, i, "dLblPos", "position"), n[this.jsonKey] = o, i;
|
|
756
|
-
}
|
|
757
|
-
parseNumFormat(e, t, n) {
|
|
758
|
-
let r = e.evaluate("numFmt", t);
|
|
759
|
-
r && (n.formatCode = r.getAttribute("formatCode"), r.hasAttribute("sourceLinked") && (n.sourceLinked = r.getAttribute("sourceLinked") === "1"));
|
|
760
|
-
}
|
|
761
|
-
},
|
|
762
|
-
SeriesVisitor: class {
|
|
693
|
+
ShapePropertiesVisitor: C,
|
|
694
|
+
TextPropertiesVisitor: re,
|
|
695
|
+
ShapeTextVisitor: r,
|
|
696
|
+
ThemeVisitor: class {
|
|
763
697
|
visit(e, t, n) {
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
let i = e.evaluate("cat/*/f", t);
|
|
767
|
-
i ||= e.evaluate("xVal/*/f", t);
|
|
768
|
-
let o = null;
|
|
769
|
-
i !== null && i.firstChild !== null && (o = i.firstChild.nodeValue), i || (i = e.evaluate("cat/strLit", t), i ||= e.evaluate("cat/numLit", t), i && (o = this.parsePointsAsString(e, i))), o !== null && (r.xRange = o);
|
|
770
|
-
let s = e.evaluate("val/*/f", t);
|
|
771
|
-
s ||= e.evaluate("yVal/*/f", t);
|
|
772
|
-
let l = null;
|
|
773
|
-
s && s.firstChild && (l = s.firstChild.nodeValue), s || (s = e.evaluate("val/numLit", t), s !== null && (l = this.parsePointsAsString(e, s))), l !== null && (r.valRange = l), this.parseTitleRangeOrValue(e, t, r), c(e, t, r, "idx", "idx"), a(e, t, r, "smooth", "smooth"), r.offsetChart = e.getVisitorParamsState().get("types").length - 1;
|
|
774
|
-
let u = e.getVisitorParamsState().get("series");
|
|
775
|
-
return u || (u = [], e.getVisitorParamsState().set("series", u)), u.push(r), r;
|
|
776
|
-
}
|
|
777
|
-
parseTitleRangeOrValue(e, t, n) {
|
|
778
|
-
let r = e.evaluate("tx/strRef/f", t);
|
|
779
|
-
if (r !== null) {
|
|
780
|
-
let t = r.firstChild.nodeValue;
|
|
781
|
-
e.setToPath(n, "title.range", t);
|
|
782
|
-
} else {
|
|
783
|
-
let r = e.evaluate("tx/v", t);
|
|
784
|
-
r !== null && e.setToPath(n, "title.text.simpleRun", r.firstChild.nodeValue);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
parsePointsAsString(e, t) {
|
|
788
|
-
let n = "{", r = e.getValAttrAsInteger("ptCount", t), i = e.evaluate("pt", t), a = [];
|
|
789
|
-
for (let n = 0; i && r && n < r; n++) {
|
|
790
|
-
let r = null, i = e.evaluate("pt[@idx='" + n + "']/v", t);
|
|
791
|
-
i && (r = i.textContent), a[n] = r;
|
|
792
|
-
}
|
|
793
|
-
for (let e = 0; e < a.length; e++) e > 0 && (n += ","), a[e] !== void 0 && (n += a[e]);
|
|
794
|
-
return n += "}", n;
|
|
795
|
-
}
|
|
796
|
-
afterVisit(e, t, n) {
|
|
797
|
-
B(e, t, n);
|
|
798
|
-
let r = e.getFromPath(n, "points");
|
|
698
|
+
n.name = t.getAttribute("name"), n.objectDefaults = {};
|
|
699
|
+
let r = B(t, "custClrLst")[0];
|
|
799
700
|
if (r) {
|
|
800
|
-
let t =
|
|
801
|
-
for (let
|
|
802
|
-
let
|
|
803
|
-
if (!
|
|
804
|
-
let
|
|
805
|
-
|
|
701
|
+
let t = new h(), i = [];
|
|
702
|
+
for (let n of B(r, "custClr")) {
|
|
703
|
+
let r = t.processAdjColor(e, n);
|
|
704
|
+
if (!r) continue;
|
|
705
|
+
let a = { color: r }, o = n.getAttribute("name");
|
|
706
|
+
o && (a.name = o), i.push(a);
|
|
806
707
|
}
|
|
708
|
+
i.length && (n.customColors = i);
|
|
807
709
|
}
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
}
|
|
818
|
-
},
|
|
819
|
-
MarkerVisitor: class {
|
|
820
|
-
visit(e, t, n) {
|
|
821
|
-
let r = t.parentNode.localName;
|
|
822
|
-
if (r === "ser" || r === "dPt") {
|
|
823
|
-
let r = {}, i = e.getValAttrAsString("size", t);
|
|
824
|
-
i !== null && (r.size = i);
|
|
825
|
-
let a = e.getValAttrAsString("symbol", t);
|
|
826
|
-
return a && (r.type = a), n.markers = r, r;
|
|
827
|
-
}
|
|
828
|
-
return null;
|
|
829
|
-
}
|
|
830
|
-
},
|
|
831
|
-
AxisVisitor: class {
|
|
832
|
-
visit(e, t, n) {
|
|
833
|
-
let i = {};
|
|
834
|
-
this.parseScaling(e, t, i), o(e, t, i, "majorUnit", "majorUnits"), o(e, t, i, "minorUnit", "minorUnits"), a(e, t, i, "delete", "shown"), this.parseOrientation(e, t, i), this.parseNumFormat(e, t, i), r(e, t, i, "majorTickMark", "majorTickMarks"), r(e, t, i, "minorTickMark", "minorTickMarks"), r(e, t, i, "crosses", "crosses"), o(e, t, i, "crossesAt", "crosses"), r(e, t, i, "crossBetween", "crossBetween"), this.parseLabelAlign(e, t, i), c(e, t, i, "lblOffset", "labelOffset"), r(e, t, i, "tickLblPos", "labelPosition");
|
|
835
|
-
let s = e.getValAttrAsInteger("noMultiLvlLbl", t);
|
|
836
|
-
i.labelMultiLevel = s !== null && s === 0, c(e, t, i, "tickMarkSkip", "tickMarkSkip"), c(e, t, i, "tickLblSkip", "labelInterval"), this.parseDisplayCustOrBuiltInUnit(t, e, i), this.parseTimeUnits(e, t, i, "majorUnitDates", "majorTimeUnit", "majorUnit"), this.parseTimeUnits(e, t, i, "minorUnitDates", "minorTimeUnit", "minorUnit"), r(e, t, i, "baseTimeUnit", "baseUnitDates"), e.getVisitorParamsState().get("axes") || (e.warn("An axis was read outside a chart; its axes were started fresh.", { onceKey: "xlsx.chart.axesState" }), e.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()));
|
|
837
|
-
let l = e.getValAttrAsString("axId", t);
|
|
838
|
-
return e.getVisitorParamsState().get("axes").set(l, i), i;
|
|
839
|
-
}
|
|
840
|
-
parseTimeUnits(e, t, n, r, i, a) {
|
|
841
|
-
let o = {}, s = e.getValAttrAsString(i, t);
|
|
842
|
-
s !== null && (o.dem = s, o.amt = e.getValAttrAsString(a, t)), Object.keys(o).length > 0 && (n[r] = o);
|
|
843
|
-
}
|
|
844
|
-
parseDisplayCustOrBuiltInUnit(e, t, n) {
|
|
845
|
-
let r = t.getValAttrAsString("dispUnits/builtInUnit", e);
|
|
846
|
-
r ||= t.getValAttrAsString("dispUnits/custUnit", e), r && (n.displayUnits = r);
|
|
847
|
-
}
|
|
848
|
-
parseLabelAlign(e, t, n) {
|
|
849
|
-
let r = e.getValAttrAsString("lblAlgn", t);
|
|
850
|
-
r !== null && (r === "ctr" ? n.labelAlign = "center" : r === "l" ? n.labelAlign = "left" : r === "r" && (n.labelAlign = "right"));
|
|
851
|
-
}
|
|
852
|
-
parseOrientation(e, t, n) {
|
|
853
|
-
let r = e.getValAttrAsString("AxPos", t);
|
|
854
|
-
r !== null && (r === "b" ? n.orientation = "bottom" : r === "l" ? n.orientation = "left" : r === "r" ? n.orientation = "right" : r === "t" && (n.orientation = "top"));
|
|
855
|
-
}
|
|
856
|
-
parseNumFormat(e, t, n) {
|
|
857
|
-
let r = {}, i = e.evaluate("numFmt", t);
|
|
858
|
-
i !== null && (i.hasAttribute("formatCode") && (r.formatCode = i.getAttribute("formatCode")), i.hasAttribute("sourceLinked") && (r.sourceLinked = i.getAttribute("sourceLinked") === "1")), Object.keys(r).length > 0 && (n.labels = r);
|
|
859
|
-
}
|
|
860
|
-
parseScaling(e, t, n) {
|
|
861
|
-
let r = e.getValAttrAsString("scaling/orientation", t);
|
|
862
|
-
r !== null && (n.inverted = r !== "minMax");
|
|
863
|
-
let i = e.getValAttrAsFloat("scaling/logBase", t);
|
|
864
|
-
i !== null && (n.logBase = i, n.scaleType = "log"), o(e, t, n, "scaling/max", "max"), o(e, t, n, "scaling/min", "min");
|
|
865
|
-
}
|
|
866
|
-
afterVisit(e, t, n) {
|
|
867
|
-
n.fill && n.labels && (n.labels.fill = n.fill, delete n.fill);
|
|
868
|
-
let r = e.getValAttrAsBoolean("delete", t);
|
|
869
|
-
r !== null && (e.setToPath(n, "labels.shown", !0 !== r), e.setToPath(n, "shown", !0 !== r));
|
|
870
|
-
let i = e.getFromPath(n, "dispUnits.displayUnitsLabel");
|
|
871
|
-
i && (e.setToPath(n, "displayUnitsLabel", i), delete n.dispUnits);
|
|
872
|
-
let a = e.evaluate("title", t);
|
|
873
|
-
e.setToPath(n, "title.shown", a !== null);
|
|
874
|
-
let o = e.evaluate("minorGridlines", t);
|
|
875
|
-
e.setToPath(n, "gridLinesMinor.shown", o !== null);
|
|
876
|
-
let s = e.evaluate("majorGridlines", t);
|
|
877
|
-
e.setToPath(n, "gridLinesMajor.shown", s !== null);
|
|
878
|
-
}
|
|
879
|
-
},
|
|
880
|
-
TextPropertiesVisitor: n,
|
|
881
|
-
ShapeTextVisitor: y,
|
|
882
|
-
LegendEntryVisitor: class {
|
|
883
|
-
visit(e, t, n) {
|
|
884
|
-
let r = e.getVisitorParamsState().get("series"), i = e.getValAttrAsInteger("idx", t), a = i === null ? void 0 : r[i];
|
|
885
|
-
if (a) {
|
|
886
|
-
let n = e.getFromPath(a, "title");
|
|
887
|
-
n || (n = {}, e.setToPath(a, "title", n));
|
|
888
|
-
let r = n, i = e.getValAttrAsBoolean("delete", t);
|
|
889
|
-
return i !== null && (r.shown = !i), r;
|
|
710
|
+
for (let e of B(t, "extLst")) for (let t of B(e, "ext")) {
|
|
711
|
+
if (t.getAttribute("uri") !== "{05A4C25C-085E-4340-85A3-A5531E510DB2}") continue;
|
|
712
|
+
let e = B(t, "themeFamily")[0], r = e?.getAttribute("id");
|
|
713
|
+
if (!r) continue;
|
|
714
|
+
let i = {
|
|
715
|
+
name: e.getAttribute("name") ?? "",
|
|
716
|
+
id: r
|
|
717
|
+
}, a = e.getAttribute("vid");
|
|
718
|
+
a && (i.vid = a), n.family = i;
|
|
890
719
|
}
|
|
891
720
|
return n;
|
|
892
721
|
}
|
|
893
722
|
},
|
|
894
|
-
|
|
895
|
-
visit(e, t, n) {
|
|
896
|
-
let i = {};
|
|
897
|
-
return a(e, t, i, "overlay", "overlay"), r(e, t, i, "legendPos", "position"), n.legend = i, i;
|
|
898
|
-
}
|
|
899
|
-
},
|
|
900
|
-
NegativeShapeVisitor: class extends s {
|
|
901
|
-
visit(e, t, n) {
|
|
902
|
-
let r = this.getFill(e, t);
|
|
903
|
-
Object.keys(r).length > 0 && (n.fillNegative = r);
|
|
904
|
-
let i = this.getStroke(e, t);
|
|
905
|
-
return Object.keys(i).length > 0 && (n.strokeNegative = i), n;
|
|
906
|
-
}
|
|
907
|
-
},
|
|
908
|
-
TitleVisitor: class extends n {
|
|
909
|
-
constructor(e = "title") {
|
|
910
|
-
super(e);
|
|
911
|
-
}
|
|
912
|
-
parseTitleRangeOrValue(e, t, n) {
|
|
913
|
-
let r = e.evaluate("tx/strRef/f", t) ?? null;
|
|
914
|
-
if (r) {
|
|
915
|
-
let t = r.firstElementChild.nodeValue;
|
|
916
|
-
e.setToPath(n, "range", t);
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
visit(e, t, n) {
|
|
920
|
-
let r = {};
|
|
921
|
-
a(e, t, r, "overlay", "overlay"), n[this._jsonKey] = r;
|
|
922
|
-
let i = e.getFromPath(r, this.getTextPath());
|
|
923
|
-
i ||= {}, this.parseTitleRangeOrValue(e, t, r);
|
|
924
|
-
let o = e.evaluate("txPr", t);
|
|
925
|
-
o && this.parseTextElement(e, o, i, !1);
|
|
926
|
-
let s = e.evaluate("tx/rich", t);
|
|
927
|
-
return s && this.parseTextElement(e, s, i, !0), Object.keys(i).length > 0 && e.setToPath(r, "text", i), r;
|
|
928
|
-
}
|
|
929
|
-
afterVisit(e, t, n) {
|
|
930
|
-
if (n?.text) {
|
|
931
|
-
let e = n.text?.rotation ?? null;
|
|
932
|
-
e !== null && (n.rotation = parseInt(e), delete n.title.rotation);
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
},
|
|
936
|
-
LayoutVisitor: class {
|
|
937
|
-
visit(e, t, n) {
|
|
938
|
-
let i = e.evaluate("manualLayout", t);
|
|
939
|
-
if (i) {
|
|
940
|
-
let t = {};
|
|
941
|
-
o(e, i, t, "x", "x"), o(e, i, t, "y", "y"), o(e, i, t, "w", "w"), o(e, i, t, "h", "h"), r(e, i, t, "xMode", "xMode"), r(e, i, t, "yMode", "yMode"), r(e, i, t, "wMode", "wMode"), r(e, i, t, "hMode", "hMode"), Object.keys(t).length > 0 && (n.manualLayout = t);
|
|
942
|
-
}
|
|
943
|
-
return n;
|
|
944
|
-
}
|
|
945
|
-
},
|
|
946
|
-
ThemeVisitor: class {
|
|
947
|
-
visit(e, t, n) {
|
|
948
|
-
return n.name = t.getAttribute("name"), n;
|
|
949
|
-
}
|
|
950
|
-
},
|
|
951
|
-
ClrSchemeVisitor: class extends v {
|
|
723
|
+
ClrSchemeVisitor: class extends h {
|
|
952
724
|
visit(e, t, n) {
|
|
953
725
|
let r = {};
|
|
954
726
|
r.name = t.getAttribute("name");
|
|
@@ -967,22 +739,50 @@ var $ = {
|
|
|
967
739
|
visit(e, t, n) {
|
|
968
740
|
let r = {};
|
|
969
741
|
r.name = t.getAttribute("name");
|
|
970
|
-
let i = e.evaluate("majorFont", t)
|
|
971
|
-
|
|
972
|
-
let
|
|
973
|
-
return
|
|
742
|
+
let i = this.processFontCollection(e, e.evaluate("majorFont", t));
|
|
743
|
+
i && (r.major = i);
|
|
744
|
+
let a = this.processFontCollection(e, e.evaluate("minorFont", t));
|
|
745
|
+
return a && (r.minor = a), n.fonts = r, r;
|
|
974
746
|
}
|
|
975
|
-
|
|
747
|
+
processFontCollection(e, t) {
|
|
976
748
|
if (!t) return;
|
|
977
|
-
let r = e.evaluate("latin", t);
|
|
978
|
-
|
|
979
|
-
let
|
|
980
|
-
|
|
981
|
-
let
|
|
982
|
-
|
|
749
|
+
let n = {}, r = e.evaluate("latin", t), i = r?.getAttribute("typeface");
|
|
750
|
+
i && (n.latin = i);
|
|
751
|
+
let a = r?.getAttribute("panose");
|
|
752
|
+
a && (n.panose = a);
|
|
753
|
+
let o = e.evaluate("ea", t)?.getAttribute("typeface");
|
|
754
|
+
o && (n.eastAsian = o);
|
|
755
|
+
let s = e.evaluate("cs", t)?.getAttribute("typeface"), c;
|
|
756
|
+
s && (n.complexScript = s);
|
|
757
|
+
let l = t.childNodes, u = l.length;
|
|
758
|
+
for (let e = 0; e < u; e++) {
|
|
759
|
+
let t = l.item(e);
|
|
760
|
+
if (t.nodeType !== 1 || t.localName !== "font") continue;
|
|
761
|
+
let n = t.getAttribute("script");
|
|
762
|
+
n && ((c ??= {})[n] = t.getAttribute("typeface") ?? "");
|
|
763
|
+
}
|
|
764
|
+
return c && (n.scripts = c), n;
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
ObjectDefaultsVisitor: class {
|
|
768
|
+
visit(e, t, n) {
|
|
769
|
+
let r = {};
|
|
770
|
+
for (let [n, i] of De) {
|
|
771
|
+
let a = e.evaluate(n, t);
|
|
772
|
+
a && (r[i] = this.processDefault(e, a));
|
|
773
|
+
}
|
|
774
|
+
return n.objectDefaults = r, {};
|
|
775
|
+
}
|
|
776
|
+
processDefault(e, t) {
|
|
777
|
+
let n = {}, i = e.evaluate("spPr", t);
|
|
778
|
+
i && new C().visit(e, i, n);
|
|
779
|
+
let a = new r().readTextBody(e, t);
|
|
780
|
+
(a.body || a.listStyle) && (n.text = a);
|
|
781
|
+
let o = e.evaluate("style", t);
|
|
782
|
+
return o && (n.style = V(e, o)), n;
|
|
983
783
|
}
|
|
984
784
|
},
|
|
985
|
-
FmtSchemeVisitor: class extends
|
|
785
|
+
FmtSchemeVisitor: class extends h {
|
|
986
786
|
visit(e, t, n) {
|
|
987
787
|
let r = this.parseFillList(e, t, "fillStyleLst"), i = this.parseLnList(e, t, "lnStyleLst"), a = this.parseEffectStyleList(e, t, "effectStyleLst"), o = this.parseFillList(e, t, "bgFillStyleLst");
|
|
988
788
|
if (r && (n.fillStyleLst = r), i && (n.lnStyleLst = i), a && (n.effectStyleLst = a), o && (n.bgFillStyleLst = o), r && i && a && o) return;
|
|
@@ -1004,11 +804,11 @@ var $ = {
|
|
|
1004
804
|
}
|
|
1005
805
|
parseFillListItem(e, t) {
|
|
1006
806
|
switch (t.localName) {
|
|
1007
|
-
case "noFill": return { type:
|
|
807
|
+
case "noFill": return { type: M.Type.None };
|
|
1008
808
|
case "solidFill": {
|
|
1009
809
|
let n = this.processAdjColor(e, t);
|
|
1010
810
|
return n ? {
|
|
1011
|
-
type:
|
|
811
|
+
type: M.Type.Solid,
|
|
1012
812
|
color: n
|
|
1013
813
|
} : void 0;
|
|
1014
814
|
}
|
|
@@ -1046,17 +846,19 @@ var $ = {
|
|
|
1046
846
|
visit(e, t, n) {
|
|
1047
847
|
if (!t) return;
|
|
1048
848
|
let r = {}, i = [];
|
|
1049
|
-
return this.processFilterColumns(e, t, i, n), i.length > 0 && (r.conditions = i), Object.keys(r).length > 0 && (n.filter = r),
|
|
849
|
+
return this.processFilterColumns(e, t, i, n), i.length > 0 && (r.conditions = i), Object.keys(r).length > 0 && (n.filter = r), n;
|
|
1050
850
|
}
|
|
1051
851
|
processColorFilter(e, t) {
|
|
1052
852
|
let n = {}, r = {
|
|
1053
|
-
operator:
|
|
853
|
+
operator: j.BuiltInOperatorNames.Color,
|
|
1054
854
|
param: n
|
|
1055
855
|
};
|
|
1056
|
-
|
|
856
|
+
e.copyFromAttribute(t, "cellColor", n, "cellColor", e.BOOLEAN_COPY);
|
|
857
|
+
let i = U(e, t);
|
|
858
|
+
return i && (n.style = i), r;
|
|
1057
859
|
}
|
|
1058
860
|
processCustomFilter(e, t) {
|
|
1059
|
-
return
|
|
861
|
+
return oe({
|
|
1060
862
|
operator: t.getAttribute("operator"),
|
|
1061
863
|
val: t.getAttribute("val")
|
|
1062
864
|
}, (t) => e.warn(t));
|
|
@@ -1065,7 +867,7 @@ var $ = {
|
|
|
1065
867
|
let n = t.getAttribute("and"), r = n === "and" || n === "1";
|
|
1066
868
|
t.getAttribute("val");
|
|
1067
869
|
let i = [], a = {
|
|
1068
|
-
operator: r ?
|
|
870
|
+
operator: r ? j.BuiltInOperatorNames.And : j.BuiltInOperatorNames.Or,
|
|
1069
871
|
param: i
|
|
1070
872
|
}, o = t.childNodes, s = o.length;
|
|
1071
873
|
for (let t = 0; t < s; t++) {
|
|
@@ -1074,10 +876,10 @@ var $ = {
|
|
|
1074
876
|
let r = null;
|
|
1075
877
|
n.localName === "customFilter" && (r = this.processCustomFilter(e, n)), r && i.push(r);
|
|
1076
878
|
}
|
|
1077
|
-
return i.length === 1 ? i[0] :
|
|
879
|
+
return i.length === 1 ? i[0] : ce(a);
|
|
1078
880
|
}
|
|
1079
881
|
processDynamicFilter(e, t) {
|
|
1080
|
-
return
|
|
882
|
+
return ne(t.getAttribute("type"));
|
|
1081
883
|
}
|
|
1082
884
|
processDateGroupItem(e, t) {
|
|
1083
885
|
let n = {};
|
|
@@ -1088,10 +890,10 @@ var $ = {
|
|
|
1088
890
|
}
|
|
1089
891
|
processFilters(e, t) {
|
|
1090
892
|
let n = {}, r = {
|
|
1091
|
-
operator:
|
|
893
|
+
operator: j.BuiltInOperatorNames.InSet,
|
|
1092
894
|
param: n
|
|
1093
895
|
};
|
|
1094
|
-
r.selector =
|
|
896
|
+
r.selector = j.BuiltInSelectorNames.Display, e.copyFromAttribute(t, "blank", n, "blank", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calendarType", n, "calendarType");
|
|
1095
897
|
let i = [], a = [], o = t.childNodes, s = o.length;
|
|
1096
898
|
for (let t = 0; t < s; t++) {
|
|
1097
899
|
let n = o.item(t);
|
|
@@ -1109,14 +911,14 @@ var $ = {
|
|
|
1109
911
|
}
|
|
1110
912
|
processIcon(e, t) {
|
|
1111
913
|
let n = {}, r = {
|
|
1112
|
-
operator:
|
|
914
|
+
operator: j.BuiltInOperatorNames.Icon,
|
|
1113
915
|
param: n
|
|
1114
916
|
};
|
|
1115
917
|
return e.copyFromAttribute(t, "iconId", n, "iconId", e.INT_COPY), e.copyFromAttribute(t, "iconSet", n), r;
|
|
1116
918
|
}
|
|
1117
919
|
processTop10(e, t) {
|
|
1118
920
|
let n = {}, r = {
|
|
1119
|
-
operator:
|
|
921
|
+
operator: j.BuiltInOperatorNames.TopN,
|
|
1120
922
|
param: n
|
|
1121
923
|
};
|
|
1122
924
|
return e.copyFromAttribute(t, "filterVal", n, "filterVal", e.FLOAT_COPY), e.copyFromAttribute(t, "percent", n, "percent", e.BOOLEAN_COPY), e.copyFromAttribute(t, "top", n, "top", e.BOOLEAN_COPY), e.copyFromAttribute(t, "val", n, "limit", e.FLOAT_COPY), r;
|
|
@@ -1125,7 +927,7 @@ var $ = {
|
|
|
1125
927
|
let n = t.childNodes;
|
|
1126
928
|
for (let t = 0; t < n.length; t++) {
|
|
1127
929
|
let r = n.item(t);
|
|
1128
|
-
if (r.nodeType !== 1 || r.localName !== "ext" ||
|
|
930
|
+
if (r.nodeType !== 1 || r.localName !== "ext" || m(r.getAttribute("uri")) !== m("{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}")) continue;
|
|
1129
931
|
let i = r.childNodes;
|
|
1130
932
|
for (let t = 0; t < i.length; t++) {
|
|
1131
933
|
let n = i.item(t);
|
|
@@ -1151,12 +953,12 @@ var $ = {
|
|
|
1151
953
|
if (!t) return null;
|
|
1152
954
|
if (!t.hasAttribute("colId")) return;
|
|
1153
955
|
let r = parseInt(t.getAttribute("colId")), i = !1;
|
|
1154
|
-
if (t.hasAttribute("hiddenButton") && (i =
|
|
956
|
+
if (t.hasAttribute("hiddenButton") && (i = f(t.getAttribute("hiddenButton"))), i && n) {
|
|
1155
957
|
let e = n.hiddenButtons;
|
|
1156
958
|
e || (e = [], n.hiddenButtons = e), e.push(r);
|
|
1157
959
|
}
|
|
1158
960
|
let a = !1;
|
|
1159
|
-
if (t.hasAttribute("showButton") && (a =
|
|
961
|
+
if (t.hasAttribute("showButton") && (a = f(t.getAttribute("showButton"))), a && n) {
|
|
1160
962
|
let e = n.showButtons;
|
|
1161
963
|
!0 !== e && (e || (e = [], n.showButtons = e), e[r] = !0);
|
|
1162
964
|
}
|
|
@@ -1180,7 +982,7 @@ var $ = {
|
|
|
1180
982
|
visit(e, t, n) {
|
|
1181
983
|
if (!t) return;
|
|
1182
984
|
let r = t.getAttribute("ref"), i = {};
|
|
1183
|
-
t.hasAttribute("caseSensitive") && (i.collatorOptions =
|
|
985
|
+
t.hasAttribute("caseSensitive") && (i.collatorOptions = f(t.getAttribute("caseSensitive")) ? R.CaseSensitiveOptions : R.CaseInsensitiveOptions);
|
|
1184
986
|
let a = t.getAttribute("sortMethod");
|
|
1185
987
|
a != null && a !== "none" && (a === "stroke" ? i.collatorOptions = {
|
|
1186
988
|
...i.collatorOptions,
|
|
@@ -1190,63 +992,103 @@ var $ = {
|
|
|
1190
992
|
collation: "pinyin"
|
|
1191
993
|
}));
|
|
1192
994
|
let o = {};
|
|
1193
|
-
t.hasAttribute("columnSort") &&
|
|
1194
|
-
let s =
|
|
1195
|
-
|
|
995
|
+
t.hasAttribute("columnSort") && f(t.getAttribute("columnSort")) && (o.axis = ye.Axis.Column);
|
|
996
|
+
let s = O.fastStringToRange(r), c = [], l = [];
|
|
997
|
+
this.processSortConditions(e, t, c, s, i, l), c.length > 0 && (o.sorts = c);
|
|
998
|
+
let d = e.getVisitorParamsState().get("ref");
|
|
999
|
+
if (d && r) {
|
|
1000
|
+
let e = O.fastStringToRange(d);
|
|
1001
|
+
o.extent = {
|
|
1002
|
+
range: u(e, s),
|
|
1003
|
+
sorts: l.map((t) => te(e, s, t))
|
|
1004
|
+
};
|
|
1005
|
+
}
|
|
1006
|
+
return Object.keys(c).length > 0 && (n.sort = o), o;
|
|
1196
1007
|
}
|
|
1197
|
-
processSortCondition(e, t, n, r) {
|
|
1008
|
+
processSortCondition(e, t, n, r, i) {
|
|
1198
1009
|
if (!t) return null;
|
|
1199
|
-
let
|
|
1010
|
+
let a = {};
|
|
1200
1011
|
if (!t.hasAttribute("ref")) return void e.warn("A sort condition has no ref; it was dropped.", { onceKey: "xlsx.sheet.sort.noRef" });
|
|
1201
1012
|
if (t.hasAttribute("ref")) {
|
|
1202
|
-
let e = t.getAttribute("ref"), r =
|
|
1203
|
-
|
|
1013
|
+
let e = t.getAttribute("ref"), r = O.fastStringToRange(e);
|
|
1014
|
+
a.index = n ? r.colStart - n.colStart : r.colStart, i?.push(r);
|
|
1204
1015
|
}
|
|
1205
|
-
let
|
|
1206
|
-
|
|
1016
|
+
let o = { ...r };
|
|
1017
|
+
a.criteria = o, o.reverse = !1, t.hasAttribute("descending") && (o.reverse = f(t.getAttribute("descending")));
|
|
1018
|
+
let s = ae(t.getAttribute("sortBy"));
|
|
1019
|
+
s && (o.sortOn = s);
|
|
1020
|
+
let c = U(e, t);
|
|
1021
|
+
return c && (o.style = c), e.copyFromAttribute(t, "iconSet", o), e.copyFromAttribute(t, "customList", o), a;
|
|
1207
1022
|
}
|
|
1208
|
-
processSortConditions(e, t, n, r, i) {
|
|
1023
|
+
processSortConditions(e, t, n, r, i, a) {
|
|
1209
1024
|
if (!t) return;
|
|
1210
|
-
let
|
|
1211
|
-
for (let t = 0; t <
|
|
1212
|
-
let
|
|
1213
|
-
if (
|
|
1214
|
-
let t = this.processSortCondition(e,
|
|
1025
|
+
let o = t.childNodes, s = o.length;
|
|
1026
|
+
for (let t = 0; t < s; t++) {
|
|
1027
|
+
let s = o.item(t);
|
|
1028
|
+
if (s.nodeType === 1 && s.localName === "sortCondition") {
|
|
1029
|
+
let t = this.processSortCondition(e, s, r, i, a);
|
|
1215
1030
|
t && n.push(t);
|
|
1216
1031
|
}
|
|
1217
1032
|
}
|
|
1218
1033
|
}
|
|
1219
1034
|
},
|
|
1220
|
-
SheetStyleVisitor: class extends
|
|
1221
|
-
visit(e,
|
|
1222
|
-
this.processNumFmts(e, e.evaluate("numFmts",
|
|
1223
|
-
let
|
|
1035
|
+
SheetStyleVisitor: class extends G {
|
|
1036
|
+
visit(e, r, i) {
|
|
1037
|
+
this.processNumFmts(e, e.evaluate("numFmts", r), null), e.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
|
|
1038
|
+
let a = {
|
|
1224
1039
|
fills: {},
|
|
1225
1040
|
fonts: {},
|
|
1226
1041
|
borders: {}
|
|
1042
|
+
}, o = e.evaluate("fonts", r);
|
|
1043
|
+
this.processFonts(e, o, a.fonts);
|
|
1044
|
+
let s = a.fonts[this.normalFontId(e, r)], c = {
|
|
1045
|
+
declared: ["1", "true"].includes(o?.getAttribute("x14ac:knownFonts") ?? ""),
|
|
1046
|
+
normalIsThemeFont: n(s?.family),
|
|
1047
|
+
faces: ie(Object.values(a.fonts).map((e) => ({
|
|
1048
|
+
...e,
|
|
1049
|
+
family: t(e?.family, e?.fallbacks, null, !1).name
|
|
1050
|
+
})))
|
|
1227
1051
|
};
|
|
1228
|
-
|
|
1229
|
-
type:
|
|
1230
|
-
patternType:
|
|
1231
|
-
},
|
|
1232
|
-
bottom: { style:
|
|
1233
|
-
left: { style:
|
|
1234
|
-
right: { style:
|
|
1235
|
-
top: { style:
|
|
1052
|
+
e.getVisitorParamsState().set(se, c), s && e.getVisitorParamsState().set(fe, s), this.processFills(e, e.evaluate("fills", r), a.fills), this.processBorders(e, e.evaluate("borders", r), a.borders, !0), a.fills[0] = { type: M.Type.None }, a.fills[1] = {
|
|
1053
|
+
type: M.Type.Pattern,
|
|
1054
|
+
patternType: M.BuiltInSheetPattern.Gray125
|
|
1055
|
+
}, a.borders[0] = {
|
|
1056
|
+
bottom: { style: k.StrokeStyle.None },
|
|
1057
|
+
left: { style: k.StrokeStyle.None },
|
|
1058
|
+
right: { style: k.StrokeStyle.None },
|
|
1059
|
+
top: { style: k.StrokeStyle.None }
|
|
1236
1060
|
};
|
|
1237
|
-
let
|
|
1238
|
-
this.processXFs(e, e.evaluate("cellStyleXfs",
|
|
1239
|
-
let
|
|
1240
|
-
if (
|
|
1241
|
-
let
|
|
1242
|
-
this.processCellStyles(e, e.evaluate("cellStyles",
|
|
1061
|
+
let l = [];
|
|
1062
|
+
this.processXFs(e, e.evaluate("cellStyleXfs", r), l, a, null, !1);
|
|
1063
|
+
let u = /* @__PURE__ */ new Map();
|
|
1064
|
+
if (l.length > 0) {
|
|
1065
|
+
let t = [];
|
|
1066
|
+
this.processCellStyles(e, e.evaluate("cellStyles", r), t, l, u), i.named = t;
|
|
1067
|
+
}
|
|
1068
|
+
let d = [];
|
|
1069
|
+
this.processXFs(e, e.evaluate("cellXfs", r), d, a, u), Object.keys(d).length > 0 && (i.direct = d);
|
|
1070
|
+
let f = this.collectHiddenXfs(e.evaluate("cellXfs", r));
|
|
1071
|
+
f.size > 0 && e.getVisitorParamsState().set(me, f);
|
|
1072
|
+
let p = this.collectXfComplements(e.evaluate("cellXfs", r));
|
|
1073
|
+
p.size > 0 && e.getVisitorParamsState().set(pe, p);
|
|
1074
|
+
let m = [];
|
|
1075
|
+
return this.processDXFs(e, e.evaluate("dxfs", r), m), this.processTableStyles(e, e.evaluate("tableStyles", r), i, m), this.processSlicerStyles(e, e.evaluate("extLst", r), i), this.processIndexColors(e, e.evaluate("colors/indexedColors", r), i), this.processMruColors(e, e.evaluate("colors/mruColors", r), i), i;
|
|
1076
|
+
}
|
|
1077
|
+
normalFontId(e, t) {
|
|
1078
|
+
let n = e.evaluate("cellStyles", t)?.childNodes, r = 0;
|
|
1079
|
+
for (let e = 0; e < (n?.length ?? 0); e++) {
|
|
1080
|
+
let t = n.item(e);
|
|
1081
|
+
if (t.nodeType === 1 && t.getAttribute("builtinId") === "0") {
|
|
1082
|
+
r = parseInt(t.getAttribute("xfId") ?? "0", 10) || 0;
|
|
1083
|
+
break;
|
|
1084
|
+
}
|
|
1243
1085
|
}
|
|
1244
|
-
let
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
return
|
|
1086
|
+
let i = e.evaluate("cellStyleXfs", t)?.childNodes, a = 0;
|
|
1087
|
+
for (let e = 0; e < (i?.length ?? 0); e++) {
|
|
1088
|
+
let t = i.item(e);
|
|
1089
|
+
if (t.nodeType === 1 && a++ === r) return parseInt(t.getAttribute("fontId") ?? "0", 10) || 0;
|
|
1090
|
+
}
|
|
1091
|
+
return 0;
|
|
1250
1092
|
}
|
|
1251
1093
|
processIndexColors(e, t, n) {
|
|
1252
1094
|
if (!t) return;
|
|
@@ -1304,9 +1146,9 @@ var $ = {
|
|
|
1304
1146
|
let o = t.getAttribute("xfId");
|
|
1305
1147
|
if (o && i) {
|
|
1306
1148
|
let e = i.get(parseInt(o));
|
|
1307
|
-
e && e !==
|
|
1149
|
+
e && e !== A.BuiltInName.Normal && (n.named = e);
|
|
1308
1150
|
}
|
|
1309
|
-
let s = (e) => !(!a && t.hasAttribute(e)) ||
|
|
1151
|
+
let s = (e) => !(!a && t.hasAttribute(e)) || f(t.getAttribute(e)), c = (e) => !a || t.hasAttribute(e) && f(t.getAttribute(e)), l = a ? "0" : void 0;
|
|
1310
1152
|
if (s("applyFont")) {
|
|
1311
1153
|
let e = t.getAttribute("fontId") ?? l;
|
|
1312
1154
|
if (e !== void 0 && (e !== "0" || c("applyFont"))) {
|
|
@@ -1346,18 +1188,18 @@ var $ = {
|
|
|
1346
1188
|
let r = e.evaluate("protection", t);
|
|
1347
1189
|
(r || c("applyProtection")) && this.processProtection(e, r, n);
|
|
1348
1190
|
}
|
|
1349
|
-
let u =
|
|
1191
|
+
let u = f(t.getAttribute("quotePrefix") ?? "");
|
|
1350
1192
|
u && (n.quotePrefix = u);
|
|
1351
1193
|
}
|
|
1352
1194
|
processAlignment(e, t, n) {
|
|
1353
1195
|
let r = {};
|
|
1354
|
-
if (r.horizontal = t?.hasAttribute("horizontal") ? t.getAttribute("horizontal") :
|
|
1196
|
+
if (r.horizontal = t?.hasAttribute("horizontal") ? t.getAttribute("horizontal") : I.HorizontalAlignment.General, r.vertical = t?.hasAttribute("vertical") ? t.getAttribute("vertical") : I.VerticalAlignment.Bottom, r.indent = t?.hasAttribute("indent") ? parseInt(t.getAttribute("indent")) : 0, r.relativeIndent = t?.hasAttribute("relativeIndent") ? parseInt(t.getAttribute("relativeIndent")) : 0, r.overflow = f(t?.getAttribute("wrapText") ?? "") ? I.Overflow.Wrap : I.Overflow.Visible, f(t?.getAttribute("shrinkToFit") ?? "") && (r.overflow = I.Overflow.Shrink), t?.hasAttribute("textRotation")) {
|
|
1355
1197
|
let e = parseFloat(t.getAttribute("textRotation"));
|
|
1356
1198
|
e > 0 && e <= 90 ? e = 360 - e : e > 90 && e <= 180 ? e -= 90 : e === 255 && (e = 0, r.stacked = !0), r.rotation = e;
|
|
1357
1199
|
} else r.rotation = 0;
|
|
1358
|
-
t?.hasAttribute("justifyLastLine") && (r.justifyLastLine =
|
|
1200
|
+
t?.hasAttribute("justifyLastLine") && (r.justifyLastLine = f(t.getAttribute("justifyLastLine")));
|
|
1359
1201
|
let i = t?.getAttribute("readingOrder");
|
|
1360
|
-
return i && (i === "0" ? r.readingDirection =
|
|
1202
|
+
return i && (i === "0" ? r.readingDirection = I.ReadingDirection.Auto : i === "1" ? r.readingDirection = I.ReadingDirection.LeftToRight : i === "2" ? r.readingDirection = I.ReadingDirection.RightToLeft : e.warn(`Invalid readingOrder '${i}'; the direction was left automatic.`, { onceKey: "xlsx.style.readingOrder" })), Object.keys(r).length > 0 && (n.alignment = r), n;
|
|
1361
1203
|
}
|
|
1362
1204
|
collectHiddenXfs(e) {
|
|
1363
1205
|
let t = /* @__PURE__ */ new Set();
|
|
@@ -1369,7 +1211,26 @@ var $ = {
|
|
|
1369
1211
|
let a = i.childNodes;
|
|
1370
1212
|
for (let e = 0; e < a.length; e++) {
|
|
1371
1213
|
let n = a.item(e);
|
|
1372
|
-
n.nodeType === 1 && n.localName === "protection" &&
|
|
1214
|
+
n.nodeType === 1 && n.localName === "protection" && f(n.getAttribute("hidden") ?? "") && t.add(r);
|
|
1215
|
+
}
|
|
1216
|
+
r++;
|
|
1217
|
+
}
|
|
1218
|
+
return t;
|
|
1219
|
+
}
|
|
1220
|
+
collectXfComplements(e) {
|
|
1221
|
+
let t = /* @__PURE__ */ new Map();
|
|
1222
|
+
if (!e) return t;
|
|
1223
|
+
let n = e.childNodes, r = 0;
|
|
1224
|
+
for (let e = 0; e < n.length; e++) {
|
|
1225
|
+
let i = n.item(e);
|
|
1226
|
+
if (i.nodeType !== 1 || i.localName !== "xf") continue;
|
|
1227
|
+
let a = q(i, "extLst");
|
|
1228
|
+
if (a) {
|
|
1229
|
+
let e = a.childNodes;
|
|
1230
|
+
for (let n = 0; n < e.length; n++) {
|
|
1231
|
+
let i = q(e.item(n), "xfComplement"), a = parseInt(i?.getAttribute("i") ?? "", 10);
|
|
1232
|
+
isNaN(a) || t.set(r, a);
|
|
1233
|
+
}
|
|
1373
1234
|
}
|
|
1374
1235
|
r++;
|
|
1375
1236
|
}
|
|
@@ -1378,7 +1239,7 @@ var $ = {
|
|
|
1378
1239
|
processProtection(e, t, n) {
|
|
1379
1240
|
if (!t) return;
|
|
1380
1241
|
let r = t.getAttribute("locked");
|
|
1381
|
-
return n.protection = { alwaysUnlocked: !!r && !
|
|
1242
|
+
return n.protection = { alwaysUnlocked: !!r && !f(r) }, n;
|
|
1382
1243
|
}
|
|
1383
1244
|
processDXF(e, t, n) {
|
|
1384
1245
|
if (!t) return;
|
|
@@ -1461,7 +1322,7 @@ var $ = {
|
|
|
1461
1322
|
let n = c.item(t);
|
|
1462
1323
|
if (n.nodeType !== 1 || n.localName !== "slicerStyleElement") continue;
|
|
1463
1324
|
let r = n.getAttribute("type");
|
|
1464
|
-
if (!r || !
|
|
1325
|
+
if (!r || !Oe.has(r)) continue;
|
|
1465
1326
|
let a = n.getAttribute("dxfId"), s = a == null ? void 0 : o[parseInt(a)];
|
|
1466
1327
|
s ? i[r] = s : e.warn(`A slicer style names a format that does not exist (dxfId '${a}').`, { onceKey: "xlsx.style.slicerStyle.dxf" });
|
|
1467
1328
|
}
|
|
@@ -1471,7 +1332,7 @@ var $ = {
|
|
|
1471
1332
|
}
|
|
1472
1333
|
processTableStyle(e, t, n, r, i = !1) {
|
|
1473
1334
|
let a = t.getAttribute("name"), o = { name: a };
|
|
1474
|
-
t.hasAttribute("table") && (o.table =
|
|
1335
|
+
t.hasAttribute("table") && (o.table = f(t.getAttribute("table"))), t.hasAttribute("pivot") && (o.pivot = f(t.getAttribute("pivot"))), i && !o.pivot && r.unshift(null);
|
|
1475
1336
|
let s = t.childNodes, c = s.length;
|
|
1476
1337
|
for (let t = 0; t < c; t++) {
|
|
1477
1338
|
let n = s.item(t);
|
|
@@ -1505,7 +1366,7 @@ var $ = {
|
|
|
1505
1366
|
if (t.nodeType === 1 && t.localName === "cellStyle") {
|
|
1506
1367
|
let e = parseInt(t.getAttribute("xfId") ?? ""), a = t.getAttribute("name"), o = t.getAttribute("builtinId"), s = a;
|
|
1507
1368
|
if (o !== null) {
|
|
1508
|
-
let e =
|
|
1369
|
+
let e = A.builtInNameFromId(parseInt(o));
|
|
1509
1370
|
e !== void 0 && (s = e);
|
|
1510
1371
|
}
|
|
1511
1372
|
if (i.set(e, s), !r[e]) continue;
|
|
@@ -1513,32 +1374,32 @@ var $ = {
|
|
|
1513
1374
|
name: s,
|
|
1514
1375
|
style: r[e]
|
|
1515
1376
|
};
|
|
1516
|
-
t.getAttribute("hidden") && (c.hidden =
|
|
1377
|
+
t.getAttribute("hidden") && (c.hidden = f(t.getAttribute("hidden"))), t.getAttribute("iLevel") && (c.iLevel = parseInt(t.getAttribute("iLevel"))), o !== null && f(t.getAttribute("customBuiltin") ?? "0") && (c.customized = !0), n.push(c);
|
|
1517
1378
|
}
|
|
1518
1379
|
}
|
|
1519
1380
|
}
|
|
1520
1381
|
afterVisit(e, t, n) {}
|
|
1521
1382
|
},
|
|
1522
|
-
WorkbookVisitor: class extends
|
|
1383
|
+
WorkbookVisitor: class extends G {
|
|
1523
1384
|
visit(e, t, n) {
|
|
1524
1385
|
return this.processSheetRefs(e, e.evaluate("sheets", t), n), this.processExternalReferences(e, e.evaluate("externalReferences", t), n), this.processBookViews(e, e.evaluate("bookViews", t), n), this.processDefinedNames(e, e.evaluate("definedNames", t), n), this.processCalcPr(e, e.evaluate("calcPr", t), n), this.processPivotCaches(e, e.evaluate("pivotCaches", t), n), this.processWorkbookProtection(e, e.evaluate("workbookProtection", t), n), this.processWorkbookPr(e, e.evaluate("workbookPr", t), n), n;
|
|
1525
1386
|
}
|
|
1526
1387
|
processPassword(e, t, n, r = "workbook", i = "password") {
|
|
1527
1388
|
if (!t) return;
|
|
1528
1389
|
let a = {};
|
|
1529
|
-
e.copyFromAttribute(t, `${r}AlgorithmName`, a, "algorithm"), e.copyFromAttribute(t, `${r}HashValue`, a, "hash"), e.copyFromAttribute(t, `${r}SaltValue`, a, "salt"), e.copyFromAttribute(t, `${r}SpinCount`, a, "spinCount", e.INT_COPY), Object.keys(a).length > 0 && (n[i] = a);
|
|
1390
|
+
e.copyFromAttribute(t, `${r}AlgorithmName`, a, "algorithm"), e.copyFromAttribute(t, `${r}HashValue`, a, "hash"), e.copyFromAttribute(t, `${r}SaltValue`, a, "salt"), e.copyFromAttribute(t, `${r}SpinCount`, a, "spinCount", e.INT_COPY), e.copyFromAttribute(t, `${r}Password`, a, "legacyHash"), Object.keys(a).length > 0 && (n[i] = a);
|
|
1530
1391
|
}
|
|
1531
1392
|
processWorkbookProtection(e, t, n) {
|
|
1532
1393
|
if (!t) return;
|
|
1533
1394
|
let r = {};
|
|
1534
1395
|
this.processPassword(e, t, r, "workbook", "password"), this.processPassword(e, t, r, "revisions", "revisionsPassword");
|
|
1535
|
-
for (let e of
|
|
1396
|
+
for (let e of ue) r[e.key] = le(e, t.getAttribute(e.attribute));
|
|
1536
1397
|
return n.protection = r, n;
|
|
1537
1398
|
}
|
|
1538
1399
|
processCalcPr(e, t, n) {
|
|
1539
1400
|
if (!t) return;
|
|
1540
1401
|
let r = {};
|
|
1541
|
-
e.copyFromAttribute(t, "calcMode", r, "calcMode", (e) =>
|
|
1402
|
+
e.copyFromAttribute(t, "calcMode", r, "calcMode", (e) => ke[e] ?? null), e.copyFromAttribute(t, "fullCalcOnLoad", r, "fullCalcOnLoad", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calcOnSave", r, "calcOnSave", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calcCompleted", r, "calcCompleted", e.BOOLEAN_COPY), e.copyFromAttribute(t, "fullPrecision", r, "fullPrecision", e.BOOLEAN_COPY), e.copyFromAttribute(t, "forceFullCalc", r, "forceFullCalc", e.BOOLEAN_COPY), e.copyFromAttribute(t, "concurrentCalc", r, "concurrentCalc", e.BOOLEAN_COPY), e.copyFromAttribute(t, "concurrentManualCount", r, "concurrentManualCount", e.INT_COPY), e.copyFromAttribute(t, "refMode", r, "refMode"), e.copyFromAttribute(t, "iterate", r, "iterate", e.BOOLEAN_COPY), e.copyFromAttribute(t, "iterateCount", r, "maxIteration", e.INT_COPY), e.copyFromAttribute(t, "iterateDelta", r, "maxIterateChange", e.FLOAT_COPY);
|
|
1542
1403
|
let i = t.getAttribute("calcId");
|
|
1543
1404
|
i !== null && e.getVisitorParamsState().set("calcId", i), n.calc = r;
|
|
1544
1405
|
}
|
|
@@ -1554,8 +1415,19 @@ var $ = {
|
|
|
1554
1415
|
processSheetRef(e, t, n) {
|
|
1555
1416
|
let r = {};
|
|
1556
1417
|
e.copyFromAttribute(t, "name", r, "name"), e.copyFromAttribute(t, "state", r, "visibility"), e.copyFromAttribute(t, "sheetId", r, "sheetId", e.INT_COPY);
|
|
1557
|
-
let i = t.getAttribute("r:id"), a = e.
|
|
1558
|
-
|
|
1418
|
+
let i = t.getAttribute("r:id"), a = i ? d(e.getRelationships().get(i)?.type) : null;
|
|
1419
|
+
if (a) {
|
|
1420
|
+
let t = e.readEmbeddedPart(i);
|
|
1421
|
+
if (t?.xml) {
|
|
1422
|
+
let e = { part: t }, i = s(t.xml), o = i ? E((e) => i.get(e)) : void 0;
|
|
1423
|
+
o && (e.tabColor = o), r.kind = a, r.sheet = e, n.push(r);
|
|
1424
|
+
return;
|
|
1425
|
+
}
|
|
1426
|
+
e.warn(`The ${a} sheet '${r.name}' could not be read and was loaded as an empty worksheet.`), n.push(r);
|
|
1427
|
+
return;
|
|
1428
|
+
}
|
|
1429
|
+
let o = i ? e.getRef(i) : null;
|
|
1430
|
+
o && (r.sheet = o), n.push(r);
|
|
1559
1431
|
}
|
|
1560
1432
|
processExternalReferences(e, t, n) {
|
|
1561
1433
|
if (!t) return;
|
|
@@ -1595,8 +1467,24 @@ var $ = {
|
|
|
1595
1467
|
}
|
|
1596
1468
|
processWorkbookView(e, t, n) {
|
|
1597
1469
|
if (!t) return;
|
|
1598
|
-
let r = {}
|
|
1599
|
-
|
|
1470
|
+
let r = {}, i = [
|
|
1471
|
+
"xWindow",
|
|
1472
|
+
"yWindow",
|
|
1473
|
+
"windowWidth",
|
|
1474
|
+
"windowHeight"
|
|
1475
|
+
].map((e) => parseInt(t.getAttribute(e) ?? "", 10));
|
|
1476
|
+
if (i.some((e) => Number.isFinite(e))) {
|
|
1477
|
+
let [e, t, n, a] = i.map((e) => Number.isFinite(e) ? e : 0);
|
|
1478
|
+
r.windowBounds = {
|
|
1479
|
+
left: e,
|
|
1480
|
+
top: t,
|
|
1481
|
+
width: n,
|
|
1482
|
+
height: a
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1485
|
+
e.copyFromAttribute(t, "activeTab", r, "activeSheetId", [e.INT_COPY, (e) => e]), t.hasAttribute("activeTab") || (r.activeSheetId = 0), e.copyFromAttribute(t, "showHorizontalScroll", r, "showHorizontalScrollbar", e.BOOLEAN_COPY), e.copyFromAttribute(t, "showVerticalScroll", r, "showVerticalScrollbar", e.BOOLEAN_COPY), e.copyFromAttribute(t, "showSheetTabs", r, "showTabs", e.BOOLEAN_COPY), e.copyFromAttribute(t, "tabRatio", r, "tabRatio", [e.FLOAT_COPY, (e) => e]), e.copyFromAttribute(t, "firstSheet", r, "firstTab", [e.INT_COPY, (e) => e]), e.copyFromAttribute(t, "minimized", r, "minimized", e.BOOLEAN_COPY), e.copyFromAttribute(t, "autoFilterDateGrouping", r, "autoFilterDateGrouping", e.BOOLEAN_COPY);
|
|
1486
|
+
let a = t.getAttribute("visibility");
|
|
1487
|
+
a !== "hidden" && a !== "veryHidden" || (r.visibility = a), Object.keys(r).length > 0 && (n.view = r);
|
|
1600
1488
|
}
|
|
1601
1489
|
processDefineName(e, t, n, r) {
|
|
1602
1490
|
if (!t) return;
|
|
@@ -1606,7 +1494,13 @@ var $ = {
|
|
|
1606
1494
|
if (!r[n]?.name) return void e.warn(`Defined name '${t.getAttribute("name")}' references a sheet with localSheetId '${n}' which does not exist.`);
|
|
1607
1495
|
i.scope = r[n].name;
|
|
1608
1496
|
}
|
|
1609
|
-
|
|
1497
|
+
let o = {};
|
|
1498
|
+
for (let n of ge) e.copyFromAttribute(t, n, o);
|
|
1499
|
+
for (let e of he) {
|
|
1500
|
+
let n = t.getAttribute(e);
|
|
1501
|
+
n !== "1" && n !== "true" || (o[e] = !0);
|
|
1502
|
+
}
|
|
1503
|
+
e.copyFromAttribute(t, "functionGroupId", o, "functionGroupId", e.INT_COPY), Object.keys(o).length > 0 && (i.fileAttributes = o), Object.keys(i).length > 0 && n.push(i);
|
|
1610
1504
|
}
|
|
1611
1505
|
processDefinedNames(e, t, n) {
|
|
1612
1506
|
if (!t) return;
|
|
@@ -1625,7 +1519,7 @@ var $ = {
|
|
|
1625
1519
|
TableVisitor: class {
|
|
1626
1520
|
visit(e, t, n) {
|
|
1627
1521
|
let r = {};
|
|
1628
|
-
return e.copyFromAttribute(t, "ref", n, "r"), e.getVisitorParamsState().set("ref", n.r), n.v = r, e.copyFromAttribute(t, "name", r), e.copyFromAttribute(t, "displayName", r), e.copyFromAttribute(t, "headerRowCount", r, "headerRowCount", e.INT_COPY), e.copyFromAttribute(t, "totalsRowCount", r, "totalsRowCount", e.INT_COPY), this.processTableColumns(e, t, r), this.processTableStyleInfo(e, t, r), e.copyFromAttribute(t, "id", r), e.copyFromAttribute(t, "comment", r, "description"), e.copyFromAttribute(t, "connectionId", r, "connectionId", e.INT_COPY), e.copyFromAttribute(t, "tableType", r), e.copyFromAttribute(t, "published", r, "published", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRow", r, "insertRow", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRowShift", r, "insertRowShift", e.BOOLEAN_COPY), r.totalsRowShown = t.getAttribute("totalsRowShown") !== "0", r;
|
|
1522
|
+
return e.copyFromAttribute(t, "ref", n, "r"), e.getVisitorParamsState().set("ref", n.r), n.v = r, e.copyFromAttribute(t, "name", r), e.copyFromAttribute(t, "displayName", r, "name"), e.copyFromAttribute(t, "headerRowCount", r, "headerRowCount", e.INT_COPY), e.copyFromAttribute(t, "totalsRowCount", r, "totalsRowCount", e.INT_COPY), this.processTableColumns(e, t, r), this.processTableStyleInfo(e, t, r), e.copyFromAttribute(t, "id", r), e.copyFromAttribute(t, "comment", r, "description"), e.copyFromAttribute(t, "connectionId", r, "connectionId", e.INT_COPY), e.copyFromAttribute(t, "tableType", r), e.copyFromAttribute(t, "published", r, "published", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRow", r, "insertRow", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRowShift", r, "insertRowShift", e.BOOLEAN_COPY), r.totalsRowShown = t.getAttribute("totalsRowShown") !== "0", r;
|
|
1629
1523
|
}
|
|
1630
1524
|
afterVisit(e, t, n) {
|
|
1631
1525
|
let r = n.v;
|
|
@@ -1745,7 +1639,7 @@ var $ = {
|
|
|
1745
1639
|
i.length > 0 && (n.sheetDataSet = i);
|
|
1746
1640
|
}
|
|
1747
1641
|
processSheetData(e, t) {
|
|
1748
|
-
let n = new
|
|
1642
|
+
let n = new be.Builder(), r = t.childNodes, i = r.length;
|
|
1749
1643
|
for (let e = 0; e < i; e++) {
|
|
1750
1644
|
let t = r.item(e);
|
|
1751
1645
|
if (t.nodeType !== 1 || t.localName !== "row") continue;
|
|
@@ -1755,7 +1649,7 @@ var $ = {
|
|
|
1755
1649
|
if (t.nodeType !== 1 || t.localName !== "cell") continue;
|
|
1756
1650
|
let r = t.getAttribute("r");
|
|
1757
1651
|
if (!r) continue;
|
|
1758
|
-
let a =
|
|
1652
|
+
let a = O.fastStringToCell(r);
|
|
1759
1653
|
if (a?.rowIndex === void 0 || a?.colIndex === void 0) continue;
|
|
1760
1654
|
let o = this._readCellValue(t);
|
|
1761
1655
|
o !== void 0 && n.pushAt(a.rowIndex, a.colIndex, o);
|
|
@@ -1775,7 +1669,7 @@ var $ = {
|
|
|
1775
1669
|
case "str":
|
|
1776
1670
|
default: return t;
|
|
1777
1671
|
case "e": {
|
|
1778
|
-
let e =
|
|
1672
|
+
let e = ve.getBuiltInByLabel(t);
|
|
1779
1673
|
return e ? {
|
|
1780
1674
|
t: "e",
|
|
1781
1675
|
v: e.getCode()
|
|
@@ -1819,8 +1713,8 @@ var $ = {
|
|
|
1819
1713
|
let r = {};
|
|
1820
1714
|
n[t.getAttribute("name")] = r, e.copyFromAttribute(t, "xr10:uid", r, "uid");
|
|
1821
1715
|
let i = t.getAttribute("cache"), a = e.getVisitorParamsState().get("slicerCaches"), o = i ? a?.get(i) : void 0;
|
|
1822
|
-
if (o) for (let e = 0; e <
|
|
1823
|
-
let t =
|
|
1716
|
+
if (o) for (let e = 0; e < J.length; e++) {
|
|
1717
|
+
let t = J[e];
|
|
1824
1718
|
o[t] !== void 0 && (r[t] = o[t]);
|
|
1825
1719
|
}
|
|
1826
1720
|
e.copyFromAttribute(t, "caption", r), e.copyFromAttribute(t, "startItem", r, "startItem", e.INT_COPY), e.copyFromAttribute(t, "columnCount", r, "columnCount", e.INT_COPY), e.copyFromAttribute(t, "showCaption", r, "showCaption", e.BOOLEAN_COPY), e.copyFromAttribute(t, "level", r, "level", e.INT_COPY), e.copyFromAttribute(t, "style", r), e.copyFromAttribute(t, "lockedPosition", r, "lockedPosition", e.BOOLEAN_COPY), e.copyFromAttribute(t, "rowHeight", r, "rowHeight", e.INT_COPY);
|
|
@@ -1846,7 +1740,7 @@ var $ = {
|
|
|
1846
1740
|
} else n.localName === "extLst" && (o = e.serializeElement(n) ?? void 0);
|
|
1847
1741
|
}
|
|
1848
1742
|
}
|
|
1849
|
-
let c =
|
|
1743
|
+
let c = S(r, a, o);
|
|
1850
1744
|
return n.formControl = c, c;
|
|
1851
1745
|
}
|
|
1852
1746
|
},
|
|
@@ -1855,14 +1749,19 @@ var $ = {
|
|
|
1855
1749
|
return n;
|
|
1856
1750
|
}
|
|
1857
1751
|
afterVisit(e, t, n) {
|
|
1858
|
-
for (let e of n?.movables ?? [])
|
|
1752
|
+
for (let e of n?.movables ?? []) Y(e, !1);
|
|
1859
1753
|
}
|
|
1860
1754
|
},
|
|
1861
1755
|
DrawingAnchorVisitor: class {
|
|
1862
1756
|
visit(e, t, n) {
|
|
1863
1757
|
if (!t) return;
|
|
1864
1758
|
let r = {};
|
|
1865
|
-
|
|
1759
|
+
e.copyFromAttribute(t, "editAs", r, "anchorType"), r.anchor = {}, t.localName === "absoluteAnchor" ? (r.anchorType = "absolute", this.processAbsoluteCoord(e, e.evaluate("pos", t), r.anchor, "from", "x", "y"), this.processAbsoluteCoord(e, e.evaluate("ext", t), r.anchor, "to", "cx", "cy")) : t.localName === "oneCellAnchor" ? (this.processOffsetCoord(e, e.evaluate("from", t), r.anchor, "from"), this.processAbsoluteCoord(e, e.evaluate("ext", t), r.anchor, "to", "cx", "cy")) : (this.processOffsetCoord(e, e.evaluate("from", t), r.anchor, "from"), this.processOffsetCoord(e, e.evaluate("to", t), r.anchor, "to"));
|
|
1760
|
+
let i = e.evaluate("clientData", t), a = (e) => {
|
|
1761
|
+
let t = i?.getAttribute(e);
|
|
1762
|
+
return t === "0" || t === "false";
|
|
1763
|
+
};
|
|
1764
|
+
return a("fPrintsWithSheet") && (r.noPrint = !0), a("fLocksWithSheet") && (r.unlocked = !0), n.movables ||= [], n.movables.push(r), r;
|
|
1866
1765
|
}
|
|
1867
1766
|
processAbsoluteCoord(e, t, n, r, i, a) {
|
|
1868
1767
|
if (!t) return;
|
|
@@ -1870,7 +1769,7 @@ var $ = {
|
|
|
1870
1769
|
x: 0,
|
|
1871
1770
|
y: 0
|
|
1872
1771
|
};
|
|
1873
|
-
return o.x =
|
|
1772
|
+
return o.x = w(t.getAttribute(i)), o.y = w(t.getAttribute(a)), r === "from" ? n.tl = o : n.br = o, n;
|
|
1874
1773
|
}
|
|
1875
1774
|
processOffsetCoord(e, t, n, r) {
|
|
1876
1775
|
if (!t) return;
|
|
@@ -1880,34 +1779,37 @@ var $ = {
|
|
|
1880
1779
|
x: 0,
|
|
1881
1780
|
y: 0
|
|
1882
1781
|
};
|
|
1883
|
-
return e.evaluate("col", t) && (i.c = parseInt(e.evaluate("col", t).textContent)), e.evaluate("row", t) && (i.r = parseInt(e.evaluate("row", t).textContent)), e.evaluate("colOff", t) && (i.x =
|
|
1782
|
+
return e.evaluate("col", t) && (i.c = parseInt(e.evaluate("col", t).textContent)), e.evaluate("row", t) && (i.r = parseInt(e.evaluate("row", t).textContent)), e.evaluate("colOff", t) && (i.x = w(e.evaluate("colOff", t).textContent)), e.evaluate("rowOff", t) && (i.y = w(e.evaluate("rowOff", t).textContent)), r === "from" ? n.tl = i : n.br = i, n;
|
|
1884
1783
|
}
|
|
1885
1784
|
},
|
|
1886
|
-
DrawingGraphicFrameVisitor: class extends
|
|
1785
|
+
DrawingGraphicFrameVisitor: class extends H {
|
|
1887
1786
|
visit(e, t, n) {
|
|
1888
1787
|
if (!t) return;
|
|
1889
1788
|
if (this.isGroupContent(n)) {
|
|
1890
1789
|
if (e.getPath().includes("Fallback")) return {};
|
|
1891
1790
|
let { movable: r } = this.readMemberHeader(e, t, "graphicFrame"), i = e.evaluate("xfrm", t);
|
|
1892
1791
|
if (i) {
|
|
1893
|
-
|
|
1792
|
+
v(i, r);
|
|
1894
1793
|
let t = e.evaluate("off", i), n = e.evaluate("ext", i);
|
|
1895
1794
|
r.anchor = {
|
|
1896
1795
|
tl: {
|
|
1897
|
-
x:
|
|
1898
|
-
y:
|
|
1796
|
+
x: w(t?.getAttribute("x") ?? null) ?? 0,
|
|
1797
|
+
y: w(t?.getAttribute("y") ?? null) ?? 0
|
|
1899
1798
|
},
|
|
1900
1799
|
br: {
|
|
1901
|
-
x:
|
|
1902
|
-
y:
|
|
1800
|
+
x: w(n?.getAttribute("cx") ?? null) ?? 0,
|
|
1801
|
+
y: w(n?.getAttribute("cy") ?? null) ?? 0
|
|
1903
1802
|
}
|
|
1904
1803
|
};
|
|
1905
1804
|
}
|
|
1906
|
-
let a = this.readGraphic(e, t)
|
|
1805
|
+
let a = this.readGraphic(e, t), o = a.type === "chart" ? {
|
|
1806
|
+
...r.content.json,
|
|
1807
|
+
...a.json
|
|
1808
|
+
} : a.json;
|
|
1907
1809
|
return r.content = {
|
|
1908
1810
|
...r.content,
|
|
1909
1811
|
type: a.type,
|
|
1910
|
-
json:
|
|
1812
|
+
json: o
|
|
1911
1813
|
}, n.members.push(r), a.json;
|
|
1912
1814
|
}
|
|
1913
1815
|
n = super.visit(e, t, n);
|
|
@@ -1933,11 +1835,17 @@ var $ = {
|
|
|
1933
1835
|
n === "chart" ? n = "chart" : n === "slicer" && (n = "slicer"), r.type = n;
|
|
1934
1836
|
let i = a.getAttribute("r:id");
|
|
1935
1837
|
if (n === "chart" && i) {
|
|
1936
|
-
let n = this.readSourceId(e, t);
|
|
1838
|
+
let n = this.readSourceId(e, t), a = e.readEmbeddedPart(i) ?? void 0, o;
|
|
1839
|
+
try {
|
|
1840
|
+
let t = a?.xml ? _e(a.xml) : null;
|
|
1841
|
+
o = t?.model, t?.lossy && e.warn("A chart states something its model does not; it is saved as it was until it is changed.", { onceKey: "xlsx.chart.lossy" });
|
|
1842
|
+
} catch (t) {
|
|
1843
|
+
e.warn(`A chart could not be read into the chart model; it is kept as its markup: ${t?.message ?? t}`, { onceKey: "xlsx.chart.model" });
|
|
1844
|
+
}
|
|
1937
1845
|
r.json = {
|
|
1938
|
-
xml: e.serializeElement(t) ?? void 0,
|
|
1939
1846
|
sourceId: n,
|
|
1940
|
-
part:
|
|
1847
|
+
part: a,
|
|
1848
|
+
model: o
|
|
1941
1849
|
};
|
|
1942
1850
|
} else if (n === "slicer") {
|
|
1943
1851
|
let n = this.readSourceId(e, t);
|
|
@@ -1950,46 +1858,48 @@ var $ = {
|
|
|
1950
1858
|
return r;
|
|
1951
1859
|
}
|
|
1952
1860
|
},
|
|
1953
|
-
DrawingSpVisitor:
|
|
1954
|
-
DrawingPicVisitor: class extends
|
|
1861
|
+
DrawingSpVisitor: X,
|
|
1862
|
+
DrawingPicVisitor: class extends H {
|
|
1955
1863
|
visit(e, t, n) {
|
|
1956
1864
|
if (!t) return;
|
|
1957
1865
|
if (this.isGroupContent(n)) {
|
|
1958
1866
|
if (e.getPath().includes("Fallback")) return {};
|
|
1959
|
-
let { movable: r, content: i } = this.readMemberHeader(e, t, "picture"), a = this.
|
|
1960
|
-
|
|
1961
|
-
i.resId = a;
|
|
1962
|
-
let o = this.readLocks(e.evaluate("nvPicPr/cNvPicPr/picLocks", t));
|
|
1963
|
-
return o && (o.noChangeAspect !== void 0 && (r.lockAspect = o.noChangeAspect), r.locks = o), n.members.push(r), i;
|
|
1964
|
-
}
|
|
1965
|
-
let r = super.visit(e, t, n), i = e.evaluate("nvPicPr/cNvPicPr", t);
|
|
1966
|
-
if (i) {
|
|
1967
|
-
e.copyFromAttribute(t, "preferRelativeResize", r, "preferRelativeResize", e.BOOLEAN_COPY);
|
|
1968
|
-
let n = e.evaluate("picLocks", i);
|
|
1969
|
-
if (n) {
|
|
1970
|
-
n.hasAttribute("noChangeAspect") && (r.lockAspect = n.getAttribute("noChangeAspect") === "1");
|
|
1971
|
-
let t = {};
|
|
1972
|
-
e.copyFromAttribute(n, "noChangeArrowheads", r, "noChangeArrowheads", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noChangeShapeType", r, "noChangeShapeType", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noEditPoints", r, "noEditPoints", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noAdjustHandles", r, "noAdjustHandles", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noCrop", r, "noCrop", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noGrp", r, "noGrp", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noMove", r, "noMove", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noResize", r, "noResize", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noRot", r, "noRot", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noSelect", r, "noSelect", e.BOOLEAN_COPY), Object.keys(t).length > 0 && (r.locks = t);
|
|
1973
|
-
}
|
|
1867
|
+
let { movable: r, content: i } = this.readMemberHeader(e, t, "picture"), a = this.readImage(e, t);
|
|
1868
|
+
return a ? (this.readPictureDetails(e, t, a, r, i), n.members.push(r), i) : {};
|
|
1974
1869
|
}
|
|
1975
|
-
let
|
|
1976
|
-
if (
|
|
1977
|
-
let
|
|
1978
|
-
return
|
|
1870
|
+
let r = super.visit(e, t, n), i = this.readImage(e, t);
|
|
1871
|
+
if (i === null) return;
|
|
1872
|
+
let a = {}, o = this.readSourceId(e, t);
|
|
1873
|
+
return o !== void 0 && (a.sourceId = o), this.readPictureDetails(e, t, i, r, a), this.setContent(r, {
|
|
1979
1874
|
type: "picture",
|
|
1980
|
-
json:
|
|
1981
|
-
}),
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1875
|
+
json: a
|
|
1876
|
+
}), a;
|
|
1877
|
+
}
|
|
1878
|
+
readPictureDetails(e, t, n, r, i) {
|
|
1879
|
+
n?.resId !== void 0 && (i.resId = n.resId), n?.image && (i.image = n.image);
|
|
1880
|
+
let a = t.getAttribute("macro");
|
|
1881
|
+
a && (i.macro = a), t.hasAttribute("fPublished") && (i.published = f(t.getAttribute("fPublished")));
|
|
1882
|
+
let o = e.evaluate("nvPicPr/cNvPicPr", t);
|
|
1883
|
+
if (o?.getAttribute) {
|
|
1884
|
+
o.getAttribute("preferRelativeResize") === "0" && (i.noRelativeResize = !0);
|
|
1885
|
+
let t = this.readLocks(e.evaluate("picLocks", o));
|
|
1886
|
+
t && (i.locks = t), r.lockAspect = t?.noChangeAspect ?? !1;
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
readImage(e, t) {
|
|
1890
|
+
let n = e.evaluate("blipFill", t), r = n ? e.evaluate("blip", n) : null;
|
|
1891
|
+
if (!r) return;
|
|
1892
|
+
if (!(r.getAttribute("r:embed") ?? r.getAttribute("embed") ?? r.getAttribute("r:link") ?? r.getAttribute("link"))) return e.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.drawing.picture.noRel" }), null;
|
|
1893
|
+
let { type: i, resId: a, ...o } = new h().processImageFill(e, n);
|
|
1894
|
+
return !o.tile && o.stretch && Object.keys(o.stretch).length === 0 && delete o.stretch, o.extLst && Ae.test(o.extLst) && delete o.extLst, {
|
|
1895
|
+
resId: a,
|
|
1896
|
+
image: Object.keys(o).length > 0 ? o : void 0
|
|
1897
|
+
};
|
|
1988
1898
|
}
|
|
1989
1899
|
},
|
|
1990
|
-
DrawingGrpSpVisitor: class extends
|
|
1900
|
+
DrawingGrpSpVisitor: class extends H {
|
|
1991
1901
|
constructor(...e) {
|
|
1992
|
-
super(...e), this._fills = new
|
|
1902
|
+
super(...e), this._fills = new h();
|
|
1993
1903
|
}
|
|
1994
1904
|
visit(e, t, n) {
|
|
1995
1905
|
if (!t) return;
|
|
@@ -2016,8 +1926,8 @@ var $ = {
|
|
|
2016
1926
|
if (c) {
|
|
2017
1927
|
let t = e.evaluate("xfrm", c);
|
|
2018
1928
|
if (t) {
|
|
2019
|
-
|
|
2020
|
-
let n =
|
|
1929
|
+
v(t, i), t.getAttribute("flipH") === "1" && (i.flipH = !0), t.getAttribute("flipV") === "1" && (i.flipV = !0);
|
|
1930
|
+
let n = Z(e, t, "off", "ext"), o = Z(e, t, "chOff", "chExt") ?? n;
|
|
2021
1931
|
o && (a.childBounds = o), r && n && (i.anchor = {
|
|
2022
1932
|
tl: {
|
|
2023
1933
|
x: n.x,
|
|
@@ -2044,7 +1954,7 @@ var $ = {
|
|
|
2044
1954
|
return a;
|
|
2045
1955
|
}
|
|
2046
1956
|
},
|
|
2047
|
-
DrawingCxnSpVisitor: class extends
|
|
1957
|
+
DrawingCxnSpVisitor: class extends X {
|
|
2048
1958
|
visit(e, t, n) {
|
|
2049
1959
|
if (t) return this.visitShape(e, t, n, "cxnSp", "nvCxnSpPr/cNvCxnSpPr/cxnSpLocks");
|
|
2050
1960
|
}
|
|
@@ -2157,75 +2067,47 @@ var $ = {
|
|
|
2157
2067
|
return n;
|
|
2158
2068
|
}
|
|
2159
2069
|
},
|
|
2160
|
-
|
|
2070
|
+
FeaturePropertyBagVisitor: class {
|
|
2161
2071
|
visit(e, t, n) {
|
|
2162
|
-
let r =
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
let n = i.item(t);
|
|
2167
|
-
if (n.nodeType === 1 && n.localName === "s") {
|
|
2168
|
-
let t = {
|
|
2169
|
-
type: n.getAttribute("t") ?? "n",
|
|
2170
|
-
keys: []
|
|
2171
|
-
};
|
|
2172
|
-
this.processKeys(e, n, t), r.push(t);
|
|
2173
|
-
}
|
|
2072
|
+
let r = [], i = t.childNodes;
|
|
2073
|
+
for (let e = 0; e < i.length; e++) {
|
|
2074
|
+
let t = i.item(e);
|
|
2075
|
+
t.nodeType === 1 && t.localName === "bag" && r.push(this._readBag(t));
|
|
2174
2076
|
}
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
for (let e = 0; e < i; e++) {
|
|
2180
|
-
let t = r.item(e);
|
|
2181
|
-
if (t.nodeType === 1 && t.localName === "k") {
|
|
2182
|
-
let e = t.getAttribute("n"), n = t.getAttribute("t");
|
|
2183
|
-
a.push([e, n]);
|
|
2184
|
-
}
|
|
2077
|
+
let a = [], o = r.find((e) => e.type === "XFComplements")?.arrays.get("MappedFeaturePropertyBags") ?? [];
|
|
2078
|
+
for (let t = 0; t < o.length; t++) {
|
|
2079
|
+
let n = r[o[t]]?.ids.get("XFControls"), i = n === void 0 ? void 0 : r[n]?.ids.get("CellControl"), s = i === void 0 ? void 0 : r[i]?.type, c = s ? je[s] : void 0;
|
|
2080
|
+
c || e.warn(`A cell format's feature '${s ?? "unknown"}' is not read; its cells keep their values.`), a.push(c ? { type: c } : null);
|
|
2185
2081
|
}
|
|
2082
|
+
let s = { controls: a };
|
|
2083
|
+
return n.featurePropertyBag = s, s;
|
|
2186
2084
|
}
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
let
|
|
2197
|
-
if (
|
|
2198
|
-
let
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2085
|
+
_readBag(e) {
|
|
2086
|
+
let t = {
|
|
2087
|
+
type: e.getAttribute("type") ?? "",
|
|
2088
|
+
ids: /* @__PURE__ */ new Map(),
|
|
2089
|
+
arrays: /* @__PURE__ */ new Map()
|
|
2090
|
+
}, n = e.childNodes;
|
|
2091
|
+
for (let e = 0; e < n.length; e++) {
|
|
2092
|
+
let r = n.item(e);
|
|
2093
|
+
if (r.nodeType !== 1) continue;
|
|
2094
|
+
let i = r.getAttribute("k") ?? "";
|
|
2095
|
+
if (r.localName === "bagId") {
|
|
2096
|
+
let e = parseInt(r.textContent ?? "", 10);
|
|
2097
|
+
isNaN(e) || t.ids.set(i, e);
|
|
2098
|
+
} else if (r.localName === "a") {
|
|
2099
|
+
let e = [], n = r.childNodes;
|
|
2100
|
+
for (let t = 0; t < n.length; t++) {
|
|
2101
|
+
let r = n.item(t);
|
|
2102
|
+
if (r.nodeType !== 1 || r.localName !== "bagId") continue;
|
|
2103
|
+
let i = parseInt(r.textContent ?? "", 10);
|
|
2104
|
+
isNaN(i) || e.push(i);
|
|
2105
|
+
}
|
|
2106
|
+
t.arrays.set(i, e);
|
|
2202
2107
|
}
|
|
2203
2108
|
}
|
|
2204
|
-
return n.richData = i, i;
|
|
2205
|
-
}
|
|
2206
|
-
mapType(e, t) {
|
|
2207
|
-
if (t.type === "_error") {
|
|
2208
|
-
let e = t.errorType;
|
|
2209
|
-
if (e) try {
|
|
2210
|
-
t = T.getBuiltInByCode(e + 1) ?? T.BuiltIn.Unknown;
|
|
2211
|
-
} catch {}
|
|
2212
|
-
}
|
|
2213
2109
|
return t;
|
|
2214
2110
|
}
|
|
2215
|
-
processValues(e, t, n, r) {
|
|
2216
|
-
let i = t.childNodes, a = i.length;
|
|
2217
|
-
r.type;
|
|
2218
|
-
let o = r.keys;
|
|
2219
|
-
for (let t = 0; t < a; t++) {
|
|
2220
|
-
let r = i.item(t);
|
|
2221
|
-
if (r.nodeType === 1 && r.localName === "v") {
|
|
2222
|
-
let i = o[t];
|
|
2223
|
-
if (!i) return void e.warn("Invalid richData");
|
|
2224
|
-
let a = i[0], s = i[1], c = r.textContent;
|
|
2225
|
-
s === "i" && (c = Number(c)), n[a] = c;
|
|
2226
|
-
}
|
|
2227
|
-
}
|
|
2228
|
-
}
|
|
2229
2111
|
},
|
|
2230
2112
|
CommentsVisitor: class {
|
|
2231
2113
|
visit(e, t, n) {
|
|
@@ -2271,7 +2153,7 @@ var $ = {
|
|
|
2271
2153
|
if (n.nodeType === 1) {
|
|
2272
2154
|
if (n.localName === "t") e.text += n.textContent ?? "";
|
|
2273
2155
|
else if (n.localName === "rPr") {
|
|
2274
|
-
let t =
|
|
2156
|
+
let t = Ne(n);
|
|
2275
2157
|
t && (e.font = t);
|
|
2276
2158
|
}
|
|
2277
2159
|
}
|
|
@@ -2307,7 +2189,7 @@ var $ = {
|
|
|
2307
2189
|
if (!t) return e;
|
|
2308
2190
|
let [, n, r, i] = t;
|
|
2309
2191
|
return `${n}${r ? `.${(r + "00").substring(0, 3)}` : ""}${i ?? "Z"}`;
|
|
2310
|
-
}(a)), t.hasAttribute("done") && (r.done =
|
|
2192
|
+
}(a)), t.hasAttribute("done") && (r.done = f(t.getAttribute("done")));
|
|
2311
2193
|
let o = function(e) {
|
|
2312
2194
|
let t, n = e.childNodes;
|
|
2313
2195
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -2349,27 +2231,27 @@ var $ = {
|
|
|
2349
2231
|
return r.length > 0 && (n.persons = r), r;
|
|
2350
2232
|
}
|
|
2351
2233
|
}
|
|
2352
|
-
},
|
|
2234
|
+
}, Pe = class {
|
|
2353
2235
|
constructor(e, t) {
|
|
2354
2236
|
this.path = e, this.visitor = t;
|
|
2355
2237
|
}
|
|
2356
|
-
},
|
|
2238
|
+
}, Fe = class {
|
|
2357
2239
|
constructor() {
|
|
2358
|
-
this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new $.RelsVisitor()), this.registerVisitor("cp:coreProperties", new $.CorePropertiesVisitor()), this.registerVisitor("Properties", new $.AppPropertiesVisitor()), this.registerVisitor("spPr", new $.ShapePropertiesVisitor()), this.registerVisitor("txBody", new $.ShapeTextVisitor()), this.registerVisitor("txPr", new $.TextPropertiesVisitor()), this.registerVisitor("
|
|
2240
|
+
this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new $.RelsVisitor()), this.registerVisitor("cp:coreProperties", new $.CorePropertiesVisitor()), this.registerVisitor("Properties", new $.AppPropertiesVisitor()), this.registerVisitor("spPr", new $.ShapePropertiesVisitor()), this.registerVisitor("txBody", new $.ShapeTextVisitor()), this.registerVisitor("txPr", new $.TextPropertiesVisitor()), this.registerVisitor("a:theme", new $.ThemeVisitor()), this.registerVisitor("a:theme", new $.ClrSchemeVisitor(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new $.FontSchemeVisitor(), "themeElements/fontScheme"), this.registerVisitor("a:theme", new $.FmtSchemeVisitor(), "themeElements/fmtScheme"), this.registerVisitor("a:theme", new $.ObjectDefaultsVisitor(), "objectDefaults"), this.registerVisitor("autoFilter", new $.AutoFilterVisitor()), this.registerVisitor("sortState", new $.SortStateVisitor()), this.registerVisitor("s:workbook", new $.WorkbookVisitor()), this.registerVisitor("styleSheet", new $.SheetStyleVisitor()), this.registerVisitor("x14:table", new $.TableX14Visitor()), this.registerVisitor("table", new $.TableVisitor()), this.registerVisitor("externalLink", new $.ExternalLinkVisitor()), this.registerVisitor("wsDr", new $.DrawingVisitor()), this.registerVisitor("twoCellAnchor", new $.DrawingAnchorVisitor()), this.registerVisitor("oneCellAnchor", new $.DrawingAnchorVisitor()), this.registerVisitor("absoluteAnchor", new $.DrawingAnchorVisitor()), this.registerVisitor("graphicFrame", new $.DrawingGraphicFrameVisitor()), this.registerVisitor("sp", new $.DrawingSpVisitor()), this.registerVisitor("grpSp", new $.DrawingGrpSpVisitor()), this.registerVisitor("cxnSp", new $.DrawingCxnSpVisitor()), this.registerVisitor("pic", new $.DrawingPicVisitor()), this.registerVisitor("metadata", new $.MetadataVisitor()), this.registerVisitor("FeaturePropertyBags", new $.FeaturePropertyBagVisitor()), this.registerVisitor("comments", new $.CommentsVisitor()), this.registerVisitor("comment", new $.CommentVisitor()), this.registerVisitor("ThreadedComments", new $.ThreadedCommentsVisitor()), this.registerVisitor("threadedComment", new $.ThreadedCommentVisitor()), this.registerVisitor("threadedComment", new $.TextPropertiesVisitor("content"), "text"), this.registerVisitor("personList", new $.PersonListVisitor()), this.registerVisitor("slicerCacheDefinition", new $.SlicerCacheDefinitionVisitor()), this.registerVisitor("slicers", new $.SlicersVisitor()), this.registerVisitor("formControlPr", new $.FormControlPrVisitor());
|
|
2359
2241
|
}
|
|
2360
2242
|
registerVisitor(e, t, n = null) {
|
|
2361
2243
|
e.indexOf(":") === -1 && (e = "*:" + e);
|
|
2362
2244
|
let r = e.split(":"), i = r.length > 1 ? r[1] : r[0];
|
|
2363
2245
|
if (!n) return this.visitorsByXmlTagName.set(i, t), void this.visitorsByXmlTagName.set(e, t);
|
|
2364
2246
|
let a = this.scopedVisitorsByXmlTagName.get(i);
|
|
2365
|
-
a || (a = [], this.scopedVisitorsByXmlTagName.set(i, a), this.scopedVisitorsByXmlTagName.set(e, a)), a.push(new
|
|
2247
|
+
a || (a = [], this.scopedVisitorsByXmlTagName.set(i, a), this.scopedVisitorsByXmlTagName.set(e, a)), a.push(new Pe(n, t));
|
|
2366
2248
|
}
|
|
2367
|
-
parseDxf(e, t = "", n =
|
|
2249
|
+
parseDxf(e, t = "", n = D.EmptyObject) {
|
|
2368
2250
|
this.visitorParamsState ||= /* @__PURE__ */ new Map();
|
|
2369
2251
|
let r = this.visitorParamsState, i = r.get("processingDXFs");
|
|
2370
2252
|
r.set("processingDXFs", !0);
|
|
2371
2253
|
try {
|
|
2372
|
-
let r = new
|
|
2254
|
+
let r = new z(null, this, "/dxf", e, {}, t, n), i = {};
|
|
2373
2255
|
return new $.SheetStyleVisitor().processDXF(r, e, i), i;
|
|
2374
2256
|
} finally {
|
|
2375
2257
|
i === void 0 ? r.delete("processingDXFs") : r.set("processingDXFs", i);
|
|
@@ -2378,12 +2260,12 @@ var $ = {
|
|
|
2378
2260
|
getVisitorParamsState() {
|
|
2379
2261
|
return this.visitorParamsState;
|
|
2380
2262
|
}
|
|
2381
|
-
transform(e, t, n =
|
|
2263
|
+
transform(e, t, n = D.EmptyObject) {
|
|
2382
2264
|
let r = e.documentElement;
|
|
2383
2265
|
this.visitorParamsState && !n?.paramMap || (this.visitorParamsState = n?.paramMap ?? /* @__PURE__ */ new Map());
|
|
2384
2266
|
let i = {}, a = this.visitorsByXmlTagName.get(r.nodeName);
|
|
2385
2267
|
if (a ||= this.visitorsByXmlTagName.get(r.localName), !a) throw Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);
|
|
2386
|
-
let o = "/" + r.localName, s = new
|
|
2268
|
+
let o = "/" + r.localName, s = new z(null, this, o, r, i, t, n), c = [];
|
|
2387
2269
|
this._doWalk(a, s, c, r, i, t, n);
|
|
2388
2270
|
let l = c.length;
|
|
2389
2271
|
for (let e = 0; e < l; e++) {
|
|
@@ -2411,7 +2293,7 @@ var $ = {
|
|
|
2411
2293
|
for (; l && l !== r;) s = l.localName + "/" + s, l = l.parentNode;
|
|
2412
2294
|
let u = t.getPath() + "/" + s;
|
|
2413
2295
|
if (c.visitor) {
|
|
2414
|
-
let r = new
|
|
2296
|
+
let r = new z(t, this, u, t.getElemRoot(), t.getJsonRoot(), a, o);
|
|
2415
2297
|
this._doWalk(c.visitor, r, n, e, i, a, o);
|
|
2416
2298
|
}
|
|
2417
2299
|
};
|
|
@@ -2437,10 +2319,10 @@ var $ = {
|
|
|
2437
2319
|
if (r.nodeType !== 1) continue;
|
|
2438
2320
|
let c = r, p = c.nodeName, m = l.get(p);
|
|
2439
2321
|
m ||= (p = c.localName, l.get(p));
|
|
2440
|
-
let h = t.getPath() + "/" + p, g = new
|
|
2322
|
+
let h = t.getPath() + "/" + p, g = new z(t, this, h, u, d, a, o);
|
|
2441
2323
|
this._doWalk(m, g, n, c, s ?? i, a, o);
|
|
2442
2324
|
}
|
|
2443
2325
|
return s;
|
|
2444
2326
|
}
|
|
2445
2327
|
};
|
|
2446
|
-
export {
|
|
2328
|
+
export { Fe as DOMTransformer, z as ExecutionContext, c as NumberUtils, g as VisitorUtils };
|