@sheetxl/io-xlsx 0.8.0-beta.15 → 0.8.0-beta.16
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/LICENSE.md +8 -7
- package/browser/esm/BQaNticMfvf7-y0L.mjs +2474 -0
- package/browser/esm/{BFHIFwfouCmmizKM.mjs → BalqIL4s8nR3NbK8.mjs} +2528 -1702
- package/browser/esm/{DPgI3veM7LuSesNu.mjs → BiueQ3eVPDOEdEeL.mjs} +1321 -1087
- package/browser/esm/{DsepJB2krbe8n-h0.mjs → BtLo1V0gnJ3ktOw9.mjs} +2 -2
- package/browser/esm/{VJT_B2rC29Twv3oJ.mjs → C3H8HKjSun-wLDrE.mjs} +5 -5
- package/browser/esm/{CbQ6xSA_Ryc9x49z.mjs → CCGqD5BzdZMq2pTI.mjs} +2 -2
- package/browser/esm/{B0as56gGm8o91eha.mjs → DT-3sV5qGuHTFmnB.mjs} +3295 -2163
- package/browser/esm/{CirSa4nJDHuHyGFb.mjs → W3dYk6brWDUtMZca.mjs} +3 -3
- package/browser/esm/{B5T6ZjCOm6tpqIxy.mjs → X5YJn8ZwrgDKMwwO.mjs} +3 -3
- package/browser/esm/{CVAAfrHVJ6jjaD4l.mjs → ekV6d7YNDF6FkKLw.mjs} +423 -318
- package/browser/esm/{cD_3iBL0XZP3GHGG.mjs → idgOmd_zpVTKLyek.mjs} +3 -3
- package/browser/esm/index.mjs +3 -3
- package/node/esm/{B_bFXQdvg63_jXXv.mjs → BO8o53Yo-gLFNELS.mjs} +3 -3
- package/node/esm/{CcMI8GfS94qlNCB0.mjs → BT0HKieizRDqDegH.mjs} +440 -330
- package/node/esm/BmIrpH_719z1aqvw.mjs +2562 -0
- package/node/esm/CJYMs5EGkLOZKyF0.mjs +4676 -0
- package/node/esm/{CQ3fUb7A8HUgTAIh.mjs → CZsPzV1CsMPKiICx.mjs} +2 -2
- package/node/esm/CdFqKswnjeM_u8-g.mjs +7242 -0
- package/node/esm/CnYiZh1EVKY4BNVs.mjs +6851 -0
- package/node/esm/{Cz6FfReTe9Ps5moN.mjs → OO5K_WYvAj-UV14K.mjs} +3 -3
- package/node/esm/index.mjs +5 -5
- package/package.json +4 -4
- package/types/src/AutoFilterRules.d.ts +26 -4
- package/types/src/OOXMLExtensions.d.ts +12 -1
- package/types/src/pivot/PivotArea.d.ts +20 -0
- package/types/src/pivot/PivotCacheRead.d.ts +30 -0
- package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
- package/types/src/pivot/PivotFilters.d.ts +29 -0
- package/types/src/pivot/PivotFormats.d.ts +60 -0
- package/types/src/pivot/PivotTableRead.d.ts +44 -0
- package/types/src/pivot/PivotTableWrite.d.ts +13 -0
- package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
- package/types/src/pivot/_PivotTableXml.d.ts +23 -0
- package/types/src/reader/PivotButtons.d.ts +14 -0
- package/types/src/reader/PivotCellFormats.d.ts +22 -0
- package/types/src/reader/SlicerJoin.d.ts +6 -4
- package/types/src/reader/_SlicerRecord.d.ts +22 -0
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +6 -2
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts +2 -0
- package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
- package/types/src/reader/domVisitors/index.d.ts +2 -0
- package/types/src/writer/EvaluationSheet.d.ts +5 -0
- package/types/src/writer/builder/Types.d.ts +13 -0
- package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
- package/types/src/writer/emitters/SlicerEmitter.d.ts +81 -18
- package/types/src/writer/emitters/StylesEmitter.d.ts +32 -1
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +19 -2
- package/types/src/writer/utils/DateSystem.d.ts +6 -0
- package/types/src/writer/utils/XfVariants.d.ts +61 -0
- package/browser/esm/CE5CJXtA1SK_ve3k.mjs +0 -2265
- package/node/esm/B0IbtakI6lvldj5N.mjs +0 -5693
- package/node/esm/C87CEL-9kIrXknM_.mjs +0 -2346
- package/node/esm/CPb9rk-UywrH-U7Y.mjs +0 -4437
- package/node/esm/Dw3qQRUIJShJWc_D.mjs +0 -6367
- package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
|
@@ -1,15 +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.16
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License:
|
|
5
|
+
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { A as e,
|
|
8
|
-
import { i as
|
|
9
|
-
import {
|
|
7
|
+
import { A as e, B as t, Dt as n, F as r, I as i, It as a, Jn as o, L as s, Lt as c, M as l, N as u, P as d, Qt as f, R as p, Rt as m, Tr as h, Tt as g, V as ee, Yn as _, Zt as te, _t as v, an as ne, cn as y, ft as re, gr as b, gt as x, ht as S, j as C, k as w, mt as ie, on as ae, pn as oe, r as se, t as ce, ut as le, v as ue, vt as T, wr as de, xt as fe, yt as E, z as pe } from "./DT-3sV5qGuHTFmnB.mjs";
|
|
8
|
+
import { a as me, i as he, n as ge, r as _e } from "./BiueQ3eVPDOEdEeL.mjs";
|
|
9
|
+
import { c as ve, l as ye, o as be, r as xe, s as Se } from "./BQaNticMfvf7-y0L.mjs";
|
|
10
10
|
import { CommonUtils as D } from "@sheetxl/utils";
|
|
11
|
-
import { AddressUtils as O, FormulaError as
|
|
12
|
-
var
|
|
11
|
+
import { AddressUtils as O, FormulaError as Ce, IBorders as k, ICellStyle as A, ICondition as j, IFill as M, IFont as N, IRange as we, IShape as P, ISlicerStyle as F, ITextFrame as I, ShapeStyleUtils as Te, Sort as L, Tuple as Ee } from "@sheetxl/sdk";
|
|
12
|
+
var De = class {
|
|
13
13
|
constructor(e) {
|
|
14
14
|
this.list = e;
|
|
15
15
|
}
|
|
@@ -35,13 +35,13 @@ var xe = class {
|
|
|
35
35
|
[Symbol.iterator]() {
|
|
36
36
|
return this.list.values();
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, Oe = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null, ke = (e) => {
|
|
39
39
|
let t = parseInt(e);
|
|
40
40
|
return isNaN(t) ? null : t;
|
|
41
|
-
},
|
|
41
|
+
}, Ae = (e) => {
|
|
42
42
|
let t = parseFloat(e);
|
|
43
43
|
return isNaN(t) ? null : t;
|
|
44
|
-
},
|
|
44
|
+
}, je = /* @__PURE__ */ new Map(), R = class {
|
|
45
45
|
constructor(e, t, n, r, i, a = null, o = D.EmptyObject) {
|
|
46
46
|
this._fileLocation = "";
|
|
47
47
|
let s = (e, t, n) => o?.getRef?.(e, t, n, o?.parsedRefs), c = (e) => o?.getRefs?.(e, o?.parsedRefs);
|
|
@@ -54,7 +54,7 @@ var xe = class {
|
|
|
54
54
|
return this._readEmbeddedPart?.(e, this._fileLocation) ?? null;
|
|
55
55
|
}
|
|
56
56
|
getRelationships() {
|
|
57
|
-
return this._getRefs?.(this._fileLocation) ??
|
|
57
|
+
return this._getRefs?.(this._fileLocation) ?? je;
|
|
58
58
|
}
|
|
59
59
|
getPath() {
|
|
60
60
|
return this.currentPath;
|
|
@@ -114,7 +114,7 @@ var xe = class {
|
|
|
114
114
|
}
|
|
115
115
|
if (n = a, n.length === 0) return null;
|
|
116
116
|
}
|
|
117
|
-
return n.length === 1 ? n[0] : n.length === 0 ? null : new
|
|
117
|
+
return n.length === 1 ? n[0] : n.length === 0 ? null : new De(n);
|
|
118
118
|
}
|
|
119
119
|
_matchesElementName(e, t) {
|
|
120
120
|
return t.includes(":") ? (e.tagName || e.nodeName) === t : e.localName === t;
|
|
@@ -154,13 +154,13 @@ var xe = class {
|
|
|
154
154
|
return n && n.hasAttribute("val") ? parseFloat(n.getAttribute("val")) ?? null : null;
|
|
155
155
|
}
|
|
156
156
|
get BOOLEAN_COPY() {
|
|
157
|
-
return
|
|
157
|
+
return Oe;
|
|
158
158
|
}
|
|
159
159
|
get INT_COPY() {
|
|
160
|
-
return
|
|
160
|
+
return ke;
|
|
161
161
|
}
|
|
162
162
|
get FLOAT_COPY() {
|
|
163
|
-
return
|
|
163
|
+
return Ae;
|
|
164
164
|
}
|
|
165
165
|
copyFromAttribute(e, t, n, r = t, i = null) {
|
|
166
166
|
if (!e || !n || !e.hasAttribute(t)) return;
|
|
@@ -173,20 +173,20 @@ var xe = class {
|
|
|
173
173
|
}
|
|
174
174
|
this.setToPath(n, r, a);
|
|
175
175
|
}
|
|
176
|
-
},
|
|
176
|
+
}, z = (e, t) => {
|
|
177
177
|
let n = [], r = e.childNodes, i = r.length;
|
|
178
178
|
for (let e = 0; e < i; e++) {
|
|
179
179
|
let i = r.item(e);
|
|
180
180
|
i.nodeType === 1 && i.localName === t && n.push(i);
|
|
181
181
|
}
|
|
182
182
|
return n;
|
|
183
|
-
},
|
|
183
|
+
}, Me = [
|
|
184
184
|
["fillRef", "fill"],
|
|
185
185
|
["lnRef", "stroke"],
|
|
186
186
|
["effectRef", "effect"]
|
|
187
|
-
],
|
|
188
|
-
let n = new
|
|
189
|
-
for (let [i, a] of
|
|
187
|
+
], B = (e, t) => {
|
|
188
|
+
let n = new d(), r = {};
|
|
189
|
+
for (let [i, a] of Me) {
|
|
190
190
|
let o = e.evaluate(i, t);
|
|
191
191
|
if (!o) continue;
|
|
192
192
|
let s = { index: parseInt(o.getAttribute("idx") ?? "0", 10) || 0 }, c = n.processAdjColor(e, o);
|
|
@@ -198,22 +198,22 @@ var xe = class {
|
|
|
198
198
|
a && (t.color = a), r.font = t;
|
|
199
199
|
}
|
|
200
200
|
return r;
|
|
201
|
-
},
|
|
201
|
+
}, V = class {
|
|
202
202
|
visit(e, t, n) {
|
|
203
203
|
if (!t) return;
|
|
204
204
|
let r = e.evaluate("*/cNvPr", t);
|
|
205
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;
|
|
206
206
|
}
|
|
207
|
-
readNonVisualDetails(t, n
|
|
208
|
-
|
|
209
|
-
let
|
|
210
|
-
|
|
211
|
-
let
|
|
212
|
-
|
|
213
|
-
let
|
|
214
|
-
|
|
215
|
-
...
|
|
216
|
-
nonVisual:
|
|
207
|
+
readNonVisualDetails(e, t, n) {
|
|
208
|
+
t.hasAttribute("title") && (n.title = t.getAttribute("title"));
|
|
209
|
+
let r = e.evaluate("hlinkClick", t);
|
|
210
|
+
r && (n.hyperlink = l(e, r));
|
|
211
|
+
let i = e.evaluate("hlinkHover", t);
|
|
212
|
+
i && (n.hoverHyperlink = l(e, i));
|
|
213
|
+
let a = e.evaluate("extLst", t), o = a ? e.serializeElement(a) : null;
|
|
214
|
+
o && (n.extLst = {
|
|
215
|
+
...n.extLst,
|
|
216
|
+
nonVisual: o
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
setContent(e, t) {
|
|
@@ -254,7 +254,7 @@ var xe = class {
|
|
|
254
254
|
readStyleRefs(e, t, n) {
|
|
255
255
|
let r = e.evaluate("style", t);
|
|
256
256
|
if (!r) return void (n.style = null);
|
|
257
|
-
let i =
|
|
257
|
+
let i = B(e, r), a = Te.withoutDefaultStyleRefs({
|
|
258
258
|
...n,
|
|
259
259
|
style: i
|
|
260
260
|
});
|
|
@@ -266,7 +266,7 @@ var xe = class {
|
|
|
266
266
|
let n = {};
|
|
267
267
|
for (let e = 0; e < t.length; e++) {
|
|
268
268
|
let r = t.item(e);
|
|
269
|
-
r.name.startsWith("xmlns") || (n[r.localName ?? r.name] =
|
|
269
|
+
r.name.startsWith("xmlns") || (n[r.localName ?? r.name] = c(r.value));
|
|
270
270
|
}
|
|
271
271
|
return Object.keys(n).length > 0 ? n : void 0;
|
|
272
272
|
}
|
|
@@ -276,20 +276,20 @@ var xe = class {
|
|
|
276
276
|
let r = n?.getAttribute?.("id"), i = r ? parseInt(r, 10) : void 0;
|
|
277
277
|
return i === void 0 || isNaN(i) ? void 0 : i;
|
|
278
278
|
}
|
|
279
|
-
},
|
|
279
|
+
}, Ne = [
|
|
280
280
|
["spDef", "shape"],
|
|
281
281
|
["lnDef", "line"],
|
|
282
282
|
["txDef", "text"]
|
|
283
|
-
],
|
|
283
|
+
], H = (e, t) => {
|
|
284
284
|
let n = t.getAttribute("dxfId");
|
|
285
285
|
if (n === null) return;
|
|
286
286
|
let r = parseInt(n);
|
|
287
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
|
-
},
|
|
288
|
+
}, U = (e) => e === "1" || e === "true", W = class {
|
|
289
289
|
visit(e, t, n) {}
|
|
290
290
|
processDataBarColor(e, t, n, r, i = "auto") {
|
|
291
291
|
if (!t) return;
|
|
292
|
-
let a =
|
|
292
|
+
let a = o((e) => t.getAttribute(e), i);
|
|
293
293
|
return a && (n[r] = a), n;
|
|
294
294
|
}
|
|
295
295
|
processFonts(e, t, n) {
|
|
@@ -304,42 +304,42 @@ var xe = class {
|
|
|
304
304
|
}
|
|
305
305
|
return n;
|
|
306
306
|
}
|
|
307
|
-
processFont(e,
|
|
308
|
-
e.getValAttrAsBoolean("b",
|
|
309
|
-
let
|
|
310
|
-
if (
|
|
311
|
-
let e =
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
let
|
|
315
|
-
|
|
316
|
-
let
|
|
317
|
-
this.processDataBarColor(e,
|
|
318
|
-
let
|
|
319
|
-
if (
|
|
320
|
-
let e =
|
|
307
|
+
processFont(e, n, r) {
|
|
308
|
+
e.getValAttrAsBoolean("b", n, !0) && (r.weight = 700), e.getValAttrAsBoolean("i", n, !0) && (r.style = N.Style.Italic), e.getValAttrAsBoolean("strike", n, !0) && (r.strike = T(!0));
|
|
309
|
+
let i = e.evaluate("u", n);
|
|
310
|
+
if (i) {
|
|
311
|
+
let e = i.getAttribute("val");
|
|
312
|
+
r.underline = E(e);
|
|
313
|
+
}
|
|
314
|
+
let a = S(e.evaluate("vertAlign", n)?.getAttribute("val"));
|
|
315
|
+
a !== void 0 && (r.baseline = a), p(e, n, r, "sz", "size");
|
|
316
|
+
let o = e.evaluate("color", n);
|
|
317
|
+
this.processDataBarColor(e, o, r, "color"), r.color ||= "auto", t(e, n, r, "name", "family"), t(e, n, r, "rFont", "family");
|
|
318
|
+
let c = e.evaluate("family", n);
|
|
319
|
+
if (c) {
|
|
320
|
+
let e = c.getAttribute("val");
|
|
321
321
|
if (e) switch (e) {
|
|
322
322
|
case "1":
|
|
323
|
-
|
|
323
|
+
r.fallbacks = ["serif"];
|
|
324
324
|
break;
|
|
325
325
|
case "2":
|
|
326
|
-
|
|
326
|
+
r.fallbacks = ["sans-serif"];
|
|
327
327
|
break;
|
|
328
328
|
case "3":
|
|
329
|
-
|
|
329
|
+
r.fallbacks = ["monospace"];
|
|
330
330
|
break;
|
|
331
331
|
case "4":
|
|
332
|
-
|
|
332
|
+
r.fallbacks = ["cursive"];
|
|
333
333
|
break;
|
|
334
|
-
case "5":
|
|
334
|
+
case "5": r.fallbacks = ["fantasy"];
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
|
|
338
|
-
for (let
|
|
339
|
-
let i =
|
|
340
|
-
i !== void 0 && (
|
|
337
|
+
x(r, e.evaluate("scheme", n)?.getAttribute("val")), s(e, n, r, "shadow", "shadow", !0), s(e, n, r, "outline", "outline", !0);
|
|
338
|
+
for (let t of ["condense", "extend"]) {
|
|
339
|
+
let i = v(t, !!e.getValAttrAsBoolean(t, n, !0));
|
|
340
|
+
i !== void 0 && (r.letterSpacing = i);
|
|
341
341
|
}
|
|
342
|
-
return
|
|
342
|
+
return pe(e, n, r, "charset", "charset"), r;
|
|
343
343
|
}
|
|
344
344
|
processFills(e, t, n) {
|
|
345
345
|
if (!t) return;
|
|
@@ -367,10 +367,10 @@ var xe = class {
|
|
|
367
367
|
i && (n.gradientType = i);
|
|
368
368
|
let a = t.hasAttribute("degree") ? parseFloat(t.getAttribute("degree")) : 0;
|
|
369
369
|
(a + 90) % 360 != 0 && (n.angle = (a + 90) % 360), (t.hasAttribute("left") || t.hasAttribute("top") || t.hasAttribute("right") || t.hasAttribute("bottom")) && (n.focus = {
|
|
370
|
-
left:
|
|
371
|
-
top:
|
|
372
|
-
right:
|
|
373
|
-
bottom:
|
|
370
|
+
left: G(t.getAttribute("left")),
|
|
371
|
+
top: G(t.getAttribute("top")),
|
|
372
|
+
right: G(t.getAttribute("right")),
|
|
373
|
+
bottom: G(t.getAttribute("bottom"))
|
|
374
374
|
});
|
|
375
375
|
let o = t.childNodes, s = o.length;
|
|
376
376
|
for (let t = 0; t < s; t++) {
|
|
@@ -413,7 +413,7 @@ var xe = class {
|
|
|
413
413
|
let a = {};
|
|
414
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
415
|
let o = this.processBorderStroke(e, t, {}, "diagonal");
|
|
416
|
-
return o && (
|
|
416
|
+
return o && (U(t.getAttribute("diagonalUp")) && (a.diagonalUp = { ...o }), U(t.getAttribute("diagonalDown")) && (a.diagonalDown = { ...o })), n[r] = a, n;
|
|
417
417
|
}
|
|
418
418
|
processBorderStroke(e, t, n, r) {
|
|
419
419
|
if (!t) return;
|
|
@@ -424,11 +424,11 @@ var xe = class {
|
|
|
424
424
|
let o = e.evaluate("color", i);
|
|
425
425
|
return o && this.processDataBarColor(e, o, a, "color"), Object.keys(a).length > 0 ? n[r] = a : null;
|
|
426
426
|
}
|
|
427
|
-
},
|
|
427
|
+
}, G = (e) => {
|
|
428
428
|
if (!e) return 0;
|
|
429
429
|
let t = parseFloat(e);
|
|
430
430
|
return isNaN(t) ? 0 : t;
|
|
431
|
-
},
|
|
431
|
+
}, K = (e, t) => {
|
|
432
432
|
if (!e || e.nodeType !== 1) return null;
|
|
433
433
|
let n = e.childNodes;
|
|
434
434
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -436,11 +436,11 @@ var xe = class {
|
|
|
436
436
|
if (r.nodeType === 1 && r.localName === t) return r;
|
|
437
437
|
}
|
|
438
438
|
return null;
|
|
439
|
-
},
|
|
439
|
+
}, Pe = new Set(Object.values(F.ElementType).filter((e) => e !== F.ElementType.WholeTable && e !== F.ElementType.HeaderRow)), Fe = {
|
|
440
440
|
auto: "auto",
|
|
441
441
|
autoNoTable: "automaticExceptTables",
|
|
442
442
|
manual: "manual"
|
|
443
|
-
},
|
|
443
|
+
}, q = [
|
|
444
444
|
"tableId",
|
|
445
445
|
"columnId",
|
|
446
446
|
"cacheName",
|
|
@@ -448,8 +448,19 @@ var xe = class {
|
|
|
448
448
|
"sourceName",
|
|
449
449
|
"sortOrder",
|
|
450
450
|
"customListSort",
|
|
451
|
-
"crossFilter"
|
|
452
|
-
|
|
451
|
+
"crossFilter",
|
|
452
|
+
"pivotTables",
|
|
453
|
+
"pivotCacheId",
|
|
454
|
+
"pivotBody",
|
|
455
|
+
"tabular",
|
|
456
|
+
"pivotData",
|
|
457
|
+
"showMissing"
|
|
458
|
+
], Ie = /* @__PURE__ */ new Set([
|
|
459
|
+
"name",
|
|
460
|
+
"xr10:uid",
|
|
461
|
+
"cache",
|
|
462
|
+
"caption"
|
|
463
|
+
]), J = (e, t) => {
|
|
453
464
|
let n = e.content, r = n?.json;
|
|
454
465
|
if (r) {
|
|
455
466
|
if (n.type === "shape" || n.type === "picture") {
|
|
@@ -465,38 +476,38 @@ var xe = class {
|
|
|
465
476
|
}
|
|
466
477
|
});
|
|
467
478
|
}
|
|
468
|
-
if (n.type === "group") for (let e of r.members ?? [])
|
|
479
|
+
if (n.type === "group") for (let e of r.members ?? []) J(e, !0);
|
|
469
480
|
}
|
|
470
|
-
},
|
|
481
|
+
}, Y = class extends V {
|
|
471
482
|
visit(e, t, n) {
|
|
472
483
|
if (t) return this.visitShape(e, t, n, "sp", "nvSpPr/cNvSpPr/spLocks");
|
|
473
484
|
}
|
|
474
|
-
visitShape(
|
|
475
|
-
let o =
|
|
476
|
-
if (this.isGroupContent(
|
|
477
|
-
if (
|
|
478
|
-
let { movable:
|
|
479
|
-
o !== P.Type.Shape && (s.type = o), this.readShapeDetails(
|
|
480
|
-
let c =
|
|
481
|
-
c?.hasAttribute?.("noChangeAspect") && (
|
|
482
|
-
let l = this.readTwinOf(
|
|
483
|
-
return l !== void 0 && Object.assign(s, { twinOf: l }),
|
|
484
|
-
}
|
|
485
|
-
if (
|
|
486
|
-
let i =
|
|
487
|
-
if (
|
|
488
|
-
let
|
|
489
|
-
a &&
|
|
485
|
+
visitShape(t, n, r, i, a) {
|
|
486
|
+
let o = ee[i];
|
|
487
|
+
if (this.isGroupContent(r)) {
|
|
488
|
+
if (t.getPath().includes("Fallback")) return {};
|
|
489
|
+
let { movable: e, content: s } = this.readMemberHeader(t, n, "shape");
|
|
490
|
+
o !== P.Type.Shape && (s.type = o), this.readShapeDetails(t, n, i, a, s), this.readStyleRefs(t, n, s);
|
|
491
|
+
let c = t.evaluate(a, n);
|
|
492
|
+
c?.hasAttribute?.("noChangeAspect") && (e.lockAspect = c.getAttribute("noChangeAspect") === "1");
|
|
493
|
+
let l = this.readTwinOf(t, n);
|
|
494
|
+
return l !== void 0 && Object.assign(s, { twinOf: l }), r.members.push(e), s;
|
|
495
|
+
}
|
|
496
|
+
if (t.getPath().includes("Fallback") && r.content) {
|
|
497
|
+
let i = r.content.json;
|
|
498
|
+
if (r.content.type === "shape" && i && (i.type ?? P.Type.Shape) === o) {
|
|
499
|
+
let r = t.evaluate("txBody", n), a = r ? new w().readTextBody(t, r) : null;
|
|
500
|
+
a && e(a) !== "" && (i.text = a);
|
|
490
501
|
}
|
|
491
502
|
return {};
|
|
492
503
|
}
|
|
493
|
-
|
|
494
|
-
let s =
|
|
495
|
-
s?.hasAttribute?.("noChangeAspect") && (
|
|
496
|
-
let c = o === P.Type.Shape ? {} : { type: o }, l = this.readSourceId(
|
|
497
|
-
l !== void 0 && (c.sourceId = l), this.readShapeDetails(
|
|
498
|
-
let u = this.readTwinOf(
|
|
499
|
-
return u !== void 0 && Object.assign(c, { twinOf: u }), this.setContent(
|
|
504
|
+
r = super.visit(t, n, r);
|
|
505
|
+
let s = t.evaluate(a, n);
|
|
506
|
+
s?.hasAttribute?.("noChangeAspect") && (r.lockAspect = s.getAttribute("noChangeAspect") === "1");
|
|
507
|
+
let c = o === P.Type.Shape ? {} : { type: o }, l = this.readSourceId(t, n);
|
|
508
|
+
l !== void 0 && (c.sourceId = l), this.readShapeDetails(t, n, i, a, c), this.readStyleRefs(t, n, c);
|
|
509
|
+
let u = this.readTwinOf(t, n);
|
|
510
|
+
return u !== void 0 && Object.assign(c, { twinOf: u }), this.setContent(r, {
|
|
500
511
|
type: "shape",
|
|
501
512
|
json: c
|
|
502
513
|
}), c;
|
|
@@ -511,13 +522,13 @@ var xe = class {
|
|
|
511
522
|
let a = t.getAttribute("macro");
|
|
512
523
|
a && (i.macro = a);
|
|
513
524
|
let o = t.getAttribute("textlink");
|
|
514
|
-
o && (i.textLink = o), t.hasAttribute("fLocksText") && (i.locksText =
|
|
515
|
-
let s = r.slice(0, r.lastIndexOf("/")),
|
|
516
|
-
|
|
517
|
-
let
|
|
518
|
-
if (
|
|
525
|
+
o && (i.textLink = o), t.hasAttribute("fLocksText") && (i.locksText = c(t.getAttribute("fLocksText"))), t.hasAttribute("fPublished") && (i.published = c(t.getAttribute("fPublished")));
|
|
526
|
+
let s = r.slice(0, r.lastIndexOf("/")), l = e.evaluate(s, t);
|
|
527
|
+
l?.getAttribute?.("txBox") === "1" && (i.textBox = !0);
|
|
528
|
+
let u = this.readLocks(e.evaluate(r, t));
|
|
529
|
+
if (u && (i.locks = u), n === "cxnSp" && l) {
|
|
519
530
|
let t = (t) => {
|
|
520
|
-
let n = e.evaluate(t,
|
|
531
|
+
let n = e.evaluate(t, l);
|
|
521
532
|
if (n?.getAttribute) return {
|
|
522
533
|
id: parseInt(n.getAttribute("id") ?? "0", 10) || 0,
|
|
523
534
|
index: parseInt(n.getAttribute("idx") ?? "0", 10) || 0
|
|
@@ -526,55 +537,55 @@ var xe = class {
|
|
|
526
537
|
(n || r) && (i.connectorEnds = {}, n && (i.connectorEnds.start = n), r && (i.connectorEnds.end = r));
|
|
527
538
|
}
|
|
528
539
|
}
|
|
529
|
-
},
|
|
540
|
+
}, Le = /^<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>$/, X = (e, t, n, r) => {
|
|
530
541
|
let i = e.evaluate(n, t), a = e.evaluate(r, t);
|
|
531
542
|
return i || a ? {
|
|
532
|
-
x:
|
|
533
|
-
y:
|
|
534
|
-
width:
|
|
535
|
-
height:
|
|
543
|
+
x: m(i?.getAttribute("x") ?? null) ?? 0,
|
|
544
|
+
y: m(i?.getAttribute("y") ?? null) ?? 0,
|
|
545
|
+
width: m(a?.getAttribute("cx") ?? null) ?? 0,
|
|
546
|
+
height: m(a?.getAttribute("cy") ?? null) ?? 0
|
|
536
547
|
} : null;
|
|
537
|
-
},
|
|
548
|
+
}, Re = { Checkbox: "checkbox" }, Z = (e) => {
|
|
538
549
|
let t = e.getAttribute("val");
|
|
539
550
|
return t !== "0" && t !== "false";
|
|
540
|
-
},
|
|
551
|
+
}, Q = {
|
|
541
552
|
1: "serif",
|
|
542
553
|
2: "sans-serif",
|
|
543
554
|
3: "monospace",
|
|
544
555
|
4: "cursive",
|
|
545
556
|
5: "fantasy"
|
|
546
557
|
};
|
|
547
|
-
function
|
|
558
|
+
function ze(e) {
|
|
548
559
|
let t = {}, n = e.childNodes;
|
|
549
560
|
for (let e = 0; e < n.length; e++) {
|
|
550
561
|
let r = n.item(e);
|
|
551
562
|
if (r.nodeType === 1) switch (r.localName) {
|
|
552
563
|
case "b":
|
|
553
|
-
t.weight =
|
|
564
|
+
t.weight = Z(r) ? 700 : 400;
|
|
554
565
|
break;
|
|
555
566
|
case "i":
|
|
556
|
-
t.style =
|
|
567
|
+
t.style = Z(r) ? N.Style.Italic : N.Style.Normal;
|
|
557
568
|
break;
|
|
558
569
|
case "strike":
|
|
559
|
-
t.strike =
|
|
570
|
+
t.strike = T(Z(r));
|
|
560
571
|
break;
|
|
561
572
|
case "outline":
|
|
562
|
-
t.outline =
|
|
573
|
+
t.outline = Z(r);
|
|
563
574
|
break;
|
|
564
575
|
case "shadow":
|
|
565
|
-
t.shadow =
|
|
576
|
+
t.shadow = Z(r);
|
|
566
577
|
break;
|
|
567
578
|
case "condense":
|
|
568
579
|
case "extend": {
|
|
569
|
-
let e =
|
|
580
|
+
let e = v(r.localName, Z(r));
|
|
570
581
|
e !== void 0 && (t.letterSpacing = e);
|
|
571
582
|
break;
|
|
572
583
|
}
|
|
573
584
|
case "u":
|
|
574
|
-
t.underline =
|
|
585
|
+
t.underline = E(r.getAttribute("val"));
|
|
575
586
|
break;
|
|
576
587
|
case "vertAlign": {
|
|
577
|
-
let e =
|
|
588
|
+
let e = S(r.getAttribute("val"));
|
|
578
589
|
e !== void 0 && (t.baseline = e);
|
|
579
590
|
break;
|
|
580
591
|
}
|
|
@@ -589,7 +600,7 @@ function Ne(e) {
|
|
|
589
600
|
break;
|
|
590
601
|
}
|
|
591
602
|
case "family": {
|
|
592
|
-
let e =
|
|
603
|
+
let e = Q[r.getAttribute("val") ?? ""];
|
|
593
604
|
e && (t.fallbacks = [e]);
|
|
594
605
|
break;
|
|
595
606
|
}
|
|
@@ -599,7 +610,7 @@ function Ne(e) {
|
|
|
599
610
|
break;
|
|
600
611
|
}
|
|
601
612
|
case "scheme":
|
|
602
|
-
|
|
613
|
+
x(t, r.getAttribute("val"));
|
|
603
614
|
break;
|
|
604
615
|
case "color": {
|
|
605
616
|
let e = r.getAttribute("rgb");
|
|
@@ -607,7 +618,7 @@ function Ne(e) {
|
|
|
607
618
|
t.color = "#" + (e.length === 8 ? e.substring(2) : e).toUpperCase();
|
|
608
619
|
break;
|
|
609
620
|
}
|
|
610
|
-
let n =
|
|
621
|
+
let n = o((e) => r.getAttribute(e));
|
|
611
622
|
n && (t.color = n);
|
|
612
623
|
break;
|
|
613
624
|
}
|
|
@@ -690,16 +701,16 @@ var $ = {
|
|
|
690
701
|
};
|
|
691
702
|
}
|
|
692
703
|
},
|
|
693
|
-
ShapePropertiesVisitor:
|
|
694
|
-
TextPropertiesVisitor:
|
|
695
|
-
ShapeTextVisitor:
|
|
704
|
+
ShapePropertiesVisitor: u,
|
|
705
|
+
TextPropertiesVisitor: C,
|
|
706
|
+
ShapeTextVisitor: w,
|
|
696
707
|
ThemeVisitor: class {
|
|
697
708
|
visit(e, t, n) {
|
|
698
709
|
n.name = t.getAttribute("name"), n.objectDefaults = {};
|
|
699
|
-
let r =
|
|
710
|
+
let r = z(t, "custClrLst")[0];
|
|
700
711
|
if (r) {
|
|
701
|
-
let t = new
|
|
702
|
-
for (let n of
|
|
712
|
+
let t = new d(), i = [];
|
|
713
|
+
for (let n of z(r, "custClr")) {
|
|
703
714
|
let r = t.processAdjColor(e, n);
|
|
704
715
|
if (!r) continue;
|
|
705
716
|
let a = { color: r }, o = n.getAttribute("name");
|
|
@@ -707,9 +718,9 @@ var $ = {
|
|
|
707
718
|
}
|
|
708
719
|
i.length && (n.customColors = i);
|
|
709
720
|
}
|
|
710
|
-
for (let e of
|
|
721
|
+
for (let e of z(t, "extLst")) for (let t of z(e, "ext")) {
|
|
711
722
|
if (t.getAttribute("uri") !== "{05A4C25C-085E-4340-85A3-A5531E510DB2}") continue;
|
|
712
|
-
let e =
|
|
723
|
+
let e = z(t, "themeFamily")[0], r = e?.getAttribute("id");
|
|
713
724
|
if (!r) continue;
|
|
714
725
|
let i = {
|
|
715
726
|
name: e.getAttribute("name") ?? "",
|
|
@@ -720,7 +731,7 @@ var $ = {
|
|
|
720
731
|
return n;
|
|
721
732
|
}
|
|
722
733
|
},
|
|
723
|
-
ClrSchemeVisitor: class extends
|
|
734
|
+
ClrSchemeVisitor: class extends d {
|
|
724
735
|
visit(e, t, n) {
|
|
725
736
|
let r = {};
|
|
726
737
|
r.name = t.getAttribute("name");
|
|
@@ -767,22 +778,22 @@ var $ = {
|
|
|
767
778
|
ObjectDefaultsVisitor: class {
|
|
768
779
|
visit(e, t, n) {
|
|
769
780
|
let r = {};
|
|
770
|
-
for (let [n, i] of
|
|
781
|
+
for (let [n, i] of Ne) {
|
|
771
782
|
let a = e.evaluate(n, t);
|
|
772
783
|
a && (r[i] = this.processDefault(e, a));
|
|
773
784
|
}
|
|
774
785
|
return n.objectDefaults = r, {};
|
|
775
786
|
}
|
|
776
787
|
processDefault(e, t) {
|
|
777
|
-
let n = {},
|
|
778
|
-
|
|
779
|
-
let
|
|
780
|
-
(
|
|
781
|
-
let
|
|
782
|
-
return
|
|
788
|
+
let n = {}, r = e.evaluate("spPr", t);
|
|
789
|
+
r && new u().visit(e, r, n);
|
|
790
|
+
let i = new w().readTextBody(e, t);
|
|
791
|
+
(i.body || i.listStyle) && (n.text = i);
|
|
792
|
+
let a = e.evaluate("style", t);
|
|
793
|
+
return a && (n.style = B(e, a)), n;
|
|
783
794
|
}
|
|
784
795
|
},
|
|
785
|
-
FmtSchemeVisitor: class extends
|
|
796
|
+
FmtSchemeVisitor: class extends d {
|
|
786
797
|
visit(e, t, n) {
|
|
787
798
|
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");
|
|
788
799
|
if (r && (n.fillStyleLst = r), i && (n.lnStyleLst = i), a && (n.effectStyleLst = a), o && (n.bgFillStyleLst = o), r && i && a && o) return;
|
|
@@ -854,7 +865,7 @@ var $ = {
|
|
|
854
865
|
param: n
|
|
855
866
|
};
|
|
856
867
|
e.copyFromAttribute(t, "cellColor", n, "cellColor", e.BOOLEAN_COPY);
|
|
857
|
-
let i =
|
|
868
|
+
let i = H(e, t);
|
|
858
869
|
return i && (n.style = i), r;
|
|
859
870
|
}
|
|
860
871
|
processCustomFilter(e, t) {
|
|
@@ -876,10 +887,10 @@ var $ = {
|
|
|
876
887
|
let r = null;
|
|
877
888
|
n.localName === "customFilter" && (r = this.processCustomFilter(e, n)), r && i.push(r);
|
|
878
889
|
}
|
|
879
|
-
return i.length === 1 ? i[0] :
|
|
890
|
+
return i.length === 1 ? i[0] : ae(a);
|
|
880
891
|
}
|
|
881
892
|
processDynamicFilter(e, t) {
|
|
882
|
-
return
|
|
893
|
+
return ne(t.getAttribute("type"), t.getAttribute("val"), t.getAttribute("maxVal"));
|
|
883
894
|
}
|
|
884
895
|
processDateGroupItem(e, t) {
|
|
885
896
|
let n = {};
|
|
@@ -927,7 +938,7 @@ var $ = {
|
|
|
927
938
|
let n = t.childNodes;
|
|
928
939
|
for (let t = 0; t < n.length; t++) {
|
|
929
940
|
let r = n.item(t);
|
|
930
|
-
if (r.nodeType !== 1 || r.localName !== "ext" ||
|
|
941
|
+
if (r.nodeType !== 1 || r.localName !== "ext" || b(r.getAttribute("uri")) !== b("{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}")) continue;
|
|
931
942
|
let i = r.childNodes;
|
|
932
943
|
for (let t = 0; t < i.length; t++) {
|
|
933
944
|
let n = i.item(t);
|
|
@@ -953,12 +964,12 @@ var $ = {
|
|
|
953
964
|
if (!t) return null;
|
|
954
965
|
if (!t.hasAttribute("colId")) return;
|
|
955
966
|
let r = parseInt(t.getAttribute("colId")), i = !1;
|
|
956
|
-
if (t.hasAttribute("hiddenButton") && (i =
|
|
967
|
+
if (t.hasAttribute("hiddenButton") && (i = c(t.getAttribute("hiddenButton"))), i && n) {
|
|
957
968
|
let e = n.hiddenButtons;
|
|
958
969
|
e || (e = [], n.hiddenButtons = e), e.push(r);
|
|
959
970
|
}
|
|
960
971
|
let a = !1;
|
|
961
|
-
if (t.hasAttribute("showButton") && (a =
|
|
972
|
+
if (t.hasAttribute("showButton") && (a = c(t.getAttribute("showButton"))), a && n) {
|
|
962
973
|
let e = n.showButtons;
|
|
963
974
|
!0 !== e && (e || (e = [], n.showButtons = e), e[r] = !0);
|
|
964
975
|
}
|
|
@@ -979,31 +990,31 @@ var $ = {
|
|
|
979
990
|
}
|
|
980
991
|
},
|
|
981
992
|
SortStateVisitor: class {
|
|
982
|
-
visit(e, t,
|
|
993
|
+
visit(e, t, r) {
|
|
983
994
|
if (!t) return;
|
|
984
|
-
let
|
|
985
|
-
t.hasAttribute("caseSensitive") && (
|
|
986
|
-
let
|
|
987
|
-
|
|
988
|
-
...
|
|
995
|
+
let i = t.getAttribute("ref"), a = {};
|
|
996
|
+
t.hasAttribute("caseSensitive") && (a.collatorOptions = c(t.getAttribute("caseSensitive")) ? L.CaseSensitiveOptions : L.CaseInsensitiveOptions);
|
|
997
|
+
let o = t.getAttribute("sortMethod");
|
|
998
|
+
o != null && o !== "none" && (o === "stroke" ? a.collatorOptions = {
|
|
999
|
+
...a.collatorOptions,
|
|
989
1000
|
collation: "stroke"
|
|
990
|
-
} :
|
|
991
|
-
...
|
|
1001
|
+
} : o === "pinYin" && (a.collatorOptions = {
|
|
1002
|
+
...a.collatorOptions,
|
|
992
1003
|
collation: "pinyin"
|
|
993
1004
|
}));
|
|
994
|
-
let
|
|
995
|
-
t.hasAttribute("columnSort") &&
|
|
996
|
-
let
|
|
997
|
-
this.processSortConditions(e, t,
|
|
1005
|
+
let s = {};
|
|
1006
|
+
t.hasAttribute("columnSort") && c(t.getAttribute("columnSort")) && (s.axis = we.Axis.Column);
|
|
1007
|
+
let l = O.fastStringToRange(i), u = [], d = [];
|
|
1008
|
+
this.processSortConditions(e, t, u, l, a, d), u.length > 0 && (s.sorts = u);
|
|
998
1009
|
let f = e.getVisitorParamsState().get("ref");
|
|
999
|
-
if (f &&
|
|
1010
|
+
if (f && i) {
|
|
1000
1011
|
let e = O.fastStringToRange(f);
|
|
1001
|
-
|
|
1002
|
-
range:
|
|
1003
|
-
sorts:
|
|
1012
|
+
s.extent = {
|
|
1013
|
+
range: n(e, l),
|
|
1014
|
+
sorts: d.map((t) => g(e, l, t))
|
|
1004
1015
|
};
|
|
1005
1016
|
}
|
|
1006
|
-
return Object.keys(
|
|
1017
|
+
return Object.keys(u).length > 0 && (r.sort = s), s;
|
|
1007
1018
|
}
|
|
1008
1019
|
processSortCondition(e, t, n, r, i) {
|
|
1009
1020
|
if (!t) return null;
|
|
@@ -1014,11 +1025,11 @@ var $ = {
|
|
|
1014
1025
|
a.index = n ? r.colStart - n.colStart : r.colStart, i?.push(r);
|
|
1015
1026
|
}
|
|
1016
1027
|
let o = { ...r };
|
|
1017
|
-
a.criteria = o, o.reverse = !1, t.hasAttribute("descending") && (o.reverse =
|
|
1018
|
-
let s =
|
|
1028
|
+
a.criteria = o, o.reverse = !1, t.hasAttribute("descending") && (o.reverse = c(t.getAttribute("descending")));
|
|
1029
|
+
let s = y(t.getAttribute("sortBy"));
|
|
1019
1030
|
s && (o.sortOn = s);
|
|
1020
|
-
let
|
|
1021
|
-
return
|
|
1031
|
+
let l = H(e, t);
|
|
1032
|
+
return l && (o.style = l), e.copyFromAttribute(t, "iconSet", o), e.copyFromAttribute(t, "customList", o), a;
|
|
1022
1033
|
}
|
|
1023
1034
|
processSortConditions(e, t, n, r, i, a) {
|
|
1024
1035
|
if (!t) return;
|
|
@@ -1032,47 +1043,49 @@ var $ = {
|
|
|
1032
1043
|
}
|
|
1033
1044
|
}
|
|
1034
1045
|
},
|
|
1035
|
-
SheetStyleVisitor: class extends
|
|
1036
|
-
visit(e,
|
|
1037
|
-
this.processNumFmts(e, e.evaluate("numFmts",
|
|
1038
|
-
let
|
|
1046
|
+
SheetStyleVisitor: class extends W {
|
|
1047
|
+
visit(e, t, n) {
|
|
1048
|
+
this.processNumFmts(e, e.evaluate("numFmts", t), null), e.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
|
|
1049
|
+
let r = {
|
|
1039
1050
|
fills: {},
|
|
1040
1051
|
fonts: {},
|
|
1041
1052
|
borders: {}
|
|
1042
|
-
},
|
|
1043
|
-
this.processFonts(e,
|
|
1044
|
-
let
|
|
1045
|
-
declared: ["1", "true"].includes(
|
|
1046
|
-
normalIsThemeFont:
|
|
1047
|
-
faces:
|
|
1053
|
+
}, i = e.evaluate("fonts", t);
|
|
1054
|
+
this.processFonts(e, i, r.fonts);
|
|
1055
|
+
let a = r.fonts[this.normalFontId(e, t)], o = {
|
|
1056
|
+
declared: ["1", "true"].includes(i?.getAttribute("x14ac:knownFonts") ?? ""),
|
|
1057
|
+
normalIsThemeFont: ie(a?.family),
|
|
1058
|
+
faces: se(Object.values(r.fonts).map((e) => ({
|
|
1048
1059
|
...e,
|
|
1049
|
-
family:
|
|
1060
|
+
family: fe(e?.family, e?.fallbacks, null, !1).name
|
|
1050
1061
|
})))
|
|
1051
1062
|
};
|
|
1052
|
-
e.getVisitorParamsState().set(
|
|
1063
|
+
e.getVisitorParamsState().set(ce, o), a && e.getVisitorParamsState().set(me, a), this.processFills(e, e.evaluate("fills", t), r.fills), this.processBorders(e, e.evaluate("borders", t), r.borders, !0), r.fills[0] = { type: M.Type.None }, r.fills[1] = {
|
|
1053
1064
|
type: M.Type.Pattern,
|
|
1054
1065
|
patternType: M.BuiltInSheetPattern.Gray125
|
|
1055
|
-
},
|
|
1066
|
+
}, r.borders[0] = {
|
|
1056
1067
|
bottom: { style: k.StrokeStyle.None },
|
|
1057
1068
|
left: { style: k.StrokeStyle.None },
|
|
1058
1069
|
right: { style: k.StrokeStyle.None },
|
|
1059
1070
|
top: { style: k.StrokeStyle.None }
|
|
1060
1071
|
};
|
|
1072
|
+
let s = [];
|
|
1073
|
+
this.processXFs(e, e.evaluate("cellStyleXfs", t), s, r, null, !1);
|
|
1074
|
+
let c = /* @__PURE__ */ new Map();
|
|
1075
|
+
if (s.length > 0) {
|
|
1076
|
+
let r = [];
|
|
1077
|
+
this.processCellStyles(e, e.evaluate("cellStyles", t), r, s, c), n.named = r;
|
|
1078
|
+
}
|
|
1061
1079
|
let l = [];
|
|
1062
|
-
this.processXFs(e, e.evaluate("
|
|
1063
|
-
let u =
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
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;
|
|
1080
|
+
this.processXFs(e, e.evaluate("cellXfs", t), l, r, c), Object.keys(l).length > 0 && (n.direct = l);
|
|
1081
|
+
let u = this.collectHiddenXfs(e.evaluate("cellXfs", t));
|
|
1082
|
+
u.size > 0 && e.getVisitorParamsState().set(he, u);
|
|
1083
|
+
let d = this.collectPivotButtonXfs(e.evaluate("cellXfs", t));
|
|
1084
|
+
d.size > 0 && e.getVisitorParamsState().set(_e, d);
|
|
1085
|
+
let f = this.collectXfComplements(e.evaluate("cellXfs", t));
|
|
1086
|
+
f.size > 0 && e.getVisitorParamsState().set(ge, f);
|
|
1087
|
+
let p = [];
|
|
1088
|
+
return this.processDXFs(e, e.evaluate("dxfs", t), p), this.processTableStyles(e, e.evaluate("tableStyles", t), n, p), this.processSlicerStyles(e, e.evaluate("extLst", t), n), this.processIndexColors(e, e.evaluate("colors/indexedColors", t), n), this.processMruColors(e, e.evaluate("colors/mruColors", t), n), n;
|
|
1076
1089
|
}
|
|
1077
1090
|
normalFontId(e, t) {
|
|
1078
1091
|
let n = e.evaluate("cellStyles", t)?.childNodes, r = 0;
|
|
@@ -1148,31 +1161,31 @@ var $ = {
|
|
|
1148
1161
|
let e = i.get(parseInt(o));
|
|
1149
1162
|
e && e !== A.BuiltInName.Normal && (n.named = e);
|
|
1150
1163
|
}
|
|
1151
|
-
let s = (e) => !(!a && t.hasAttribute(e)) ||
|
|
1164
|
+
let s = (e) => !(!a && t.hasAttribute(e)) || c(t.getAttribute(e)), l = (e) => !a || t.hasAttribute(e) && c(t.getAttribute(e)), u = a ? "0" : void 0;
|
|
1152
1165
|
if (s("applyFont")) {
|
|
1153
|
-
let e = t.getAttribute("fontId") ??
|
|
1154
|
-
if (e !== void 0 && (e !== "0" ||
|
|
1166
|
+
let e = t.getAttribute("fontId") ?? u;
|
|
1167
|
+
if (e !== void 0 && (e !== "0" || l("applyFont"))) {
|
|
1155
1168
|
let t = r.fonts[e];
|
|
1156
1169
|
t !== void 0 && (n.font = t);
|
|
1157
1170
|
}
|
|
1158
1171
|
}
|
|
1159
1172
|
if (s("applyFill")) {
|
|
1160
|
-
let e = t.getAttribute("fillId") ??
|
|
1161
|
-
if (e !== void 0 && (e !== "0" ||
|
|
1173
|
+
let e = t.getAttribute("fillId") ?? u;
|
|
1174
|
+
if (e !== void 0 && (e !== "0" || l("applyFill"))) {
|
|
1162
1175
|
let t = r.fills[e];
|
|
1163
1176
|
t !== void 0 && Object.keys(t).length > 0 && (n.fill = t);
|
|
1164
1177
|
}
|
|
1165
1178
|
}
|
|
1166
1179
|
if (s("applyBorder")) {
|
|
1167
|
-
let e = t.getAttribute("borderId") ??
|
|
1168
|
-
if (e !== void 0 && (e !== "0" ||
|
|
1180
|
+
let e = t.getAttribute("borderId") ?? u;
|
|
1181
|
+
if (e !== void 0 && (e !== "0" || l("applyBorder"))) {
|
|
1169
1182
|
let t = r.borders[e];
|
|
1170
1183
|
t !== void 0 && (n.borders = t);
|
|
1171
1184
|
}
|
|
1172
1185
|
}
|
|
1173
1186
|
if (s("applyNumberFormat")) {
|
|
1174
|
-
let r = t.getAttribute("numFmtId") ??
|
|
1175
|
-
if (r !== void 0 && (r !== "0" ||
|
|
1187
|
+
let r = t.getAttribute("numFmtId") ?? u;
|
|
1188
|
+
if (r !== void 0 && (r !== "0" || l("applyNumberFormat"))) {
|
|
1176
1189
|
let t = parseInt(r), i, a = e.getVisitorParamsState();
|
|
1177
1190
|
if (a) {
|
|
1178
1191
|
let e = a.get("numFmts");
|
|
@@ -1182,22 +1195,22 @@ var $ = {
|
|
|
1182
1195
|
}
|
|
1183
1196
|
if (s("applyAlignment")) {
|
|
1184
1197
|
let r = e.evaluate("alignment", t);
|
|
1185
|
-
(r ||
|
|
1198
|
+
(r || l("applyAlignment")) && this.processAlignment(e, r, n);
|
|
1186
1199
|
}
|
|
1187
1200
|
if (s("applyProtection")) {
|
|
1188
1201
|
let r = e.evaluate("protection", t);
|
|
1189
|
-
(r ||
|
|
1202
|
+
(r || l("applyProtection")) && this.processProtection(e, r, n);
|
|
1190
1203
|
}
|
|
1191
|
-
let
|
|
1192
|
-
|
|
1204
|
+
let d = c(t.getAttribute("quotePrefix") ?? "");
|
|
1205
|
+
d && (n.quotePrefix = d);
|
|
1193
1206
|
}
|
|
1194
1207
|
processAlignment(e, t, n) {
|
|
1195
1208
|
let r = {};
|
|
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 =
|
|
1209
|
+
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 = c(t?.getAttribute("wrapText") ?? "") ? I.Overflow.Wrap : I.Overflow.Visible, c(t?.getAttribute("shrinkToFit") ?? "") && (r.overflow = I.Overflow.Shrink), t?.hasAttribute("textRotation")) {
|
|
1197
1210
|
let e = parseFloat(t.getAttribute("textRotation"));
|
|
1198
1211
|
e > 0 && e <= 90 ? e = 360 - e : e > 90 && e <= 180 ? e -= 90 : e === 255 && (e = 0, r.stacked = !0), r.rotation = e;
|
|
1199
1212
|
} else r.rotation = 0;
|
|
1200
|
-
t?.hasAttribute("justifyLastLine") && (r.justifyLastLine =
|
|
1213
|
+
t?.hasAttribute("justifyLastLine") && (r.justifyLastLine = c(t.getAttribute("justifyLastLine")));
|
|
1201
1214
|
let i = t?.getAttribute("readingOrder");
|
|
1202
1215
|
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;
|
|
1203
1216
|
}
|
|
@@ -1211,12 +1224,22 @@ var $ = {
|
|
|
1211
1224
|
let a = i.childNodes;
|
|
1212
1225
|
for (let e = 0; e < a.length; e++) {
|
|
1213
1226
|
let n = a.item(e);
|
|
1214
|
-
n.nodeType === 1 && n.localName === "protection" &&
|
|
1227
|
+
n.nodeType === 1 && n.localName === "protection" && c(n.getAttribute("hidden") ?? "") && t.add(r);
|
|
1215
1228
|
}
|
|
1216
1229
|
r++;
|
|
1217
1230
|
}
|
|
1218
1231
|
return t;
|
|
1219
1232
|
}
|
|
1233
|
+
collectPivotButtonXfs(e) {
|
|
1234
|
+
let t = /* @__PURE__ */ new Set();
|
|
1235
|
+
if (!e) return t;
|
|
1236
|
+
let n = e.childNodes, r = 0;
|
|
1237
|
+
for (let e = 0; e < n.length; e++) {
|
|
1238
|
+
let i = n.item(e);
|
|
1239
|
+
i.nodeType === 1 && i.localName === "xf" && (c(i.getAttribute("pivotButton") ?? "") && t.add(r), r++);
|
|
1240
|
+
}
|
|
1241
|
+
return t;
|
|
1242
|
+
}
|
|
1220
1243
|
collectXfComplements(e) {
|
|
1221
1244
|
let t = /* @__PURE__ */ new Map();
|
|
1222
1245
|
if (!e) return t;
|
|
@@ -1224,11 +1247,11 @@ var $ = {
|
|
|
1224
1247
|
for (let e = 0; e < n.length; e++) {
|
|
1225
1248
|
let i = n.item(e);
|
|
1226
1249
|
if (i.nodeType !== 1 || i.localName !== "xf") continue;
|
|
1227
|
-
let a =
|
|
1250
|
+
let a = K(i, "extLst");
|
|
1228
1251
|
if (a) {
|
|
1229
1252
|
let e = a.childNodes;
|
|
1230
1253
|
for (let n = 0; n < e.length; n++) {
|
|
1231
|
-
let i =
|
|
1254
|
+
let i = K(e.item(n), "xfComplement"), a = parseInt(i?.getAttribute("i") ?? "", 10);
|
|
1232
1255
|
isNaN(a) || t.set(r, a);
|
|
1233
1256
|
}
|
|
1234
1257
|
}
|
|
@@ -1239,7 +1262,7 @@ var $ = {
|
|
|
1239
1262
|
processProtection(e, t, n) {
|
|
1240
1263
|
if (!t) return;
|
|
1241
1264
|
let r = t.getAttribute("locked");
|
|
1242
|
-
return n.protection = { alwaysUnlocked: !!r && !
|
|
1265
|
+
return n.protection = { alwaysUnlocked: !!r && !c(r) }, n;
|
|
1243
1266
|
}
|
|
1244
1267
|
processDXF(e, t, n) {
|
|
1245
1268
|
if (!t) return;
|
|
@@ -1322,7 +1345,7 @@ var $ = {
|
|
|
1322
1345
|
let n = c.item(t);
|
|
1323
1346
|
if (n.nodeType !== 1 || n.localName !== "slicerStyleElement") continue;
|
|
1324
1347
|
let r = n.getAttribute("type");
|
|
1325
|
-
if (!r || !
|
|
1348
|
+
if (!r || !Pe.has(r)) continue;
|
|
1326
1349
|
let a = n.getAttribute("dxfId"), s = a == null ? void 0 : o[parseInt(a)];
|
|
1327
1350
|
s ? i[r] = s : e.warn(`A slicer style names a format that does not exist (dxfId '${a}').`, { onceKey: "xlsx.style.slicerStyle.dxf" });
|
|
1328
1351
|
}
|
|
@@ -1332,9 +1355,9 @@ var $ = {
|
|
|
1332
1355
|
}
|
|
1333
1356
|
processTableStyle(e, t, n, r, i = !1) {
|
|
1334
1357
|
let a = t.getAttribute("name"), o = { name: a };
|
|
1335
|
-
t.hasAttribute("table") && (o.table =
|
|
1336
|
-
let s = t.childNodes,
|
|
1337
|
-
for (let t = 0; t <
|
|
1358
|
+
t.hasAttribute("table") && (o.table = c(t.getAttribute("table"))), o.pivot = !t.hasAttribute("pivot") || c(t.getAttribute("pivot")), i && !o.pivot && r.unshift(null);
|
|
1359
|
+
let s = t.childNodes, l = s.length;
|
|
1360
|
+
for (let t = 0; t < l; t++) {
|
|
1338
1361
|
let n = s.item(t);
|
|
1339
1362
|
if (n.nodeType === 1 && n.localName === "tableStyleElement") {
|
|
1340
1363
|
let t = n.getAttribute("type"), i = n.getAttribute("dxfId"), a = i == null ? void 0 : r?.[i];
|
|
@@ -1370,17 +1393,17 @@ var $ = {
|
|
|
1370
1393
|
e !== void 0 && (s = e);
|
|
1371
1394
|
}
|
|
1372
1395
|
if (i.set(e, s), !r[e]) continue;
|
|
1373
|
-
let
|
|
1396
|
+
let l = {
|
|
1374
1397
|
name: s,
|
|
1375
1398
|
style: r[e]
|
|
1376
1399
|
};
|
|
1377
|
-
t.getAttribute("hidden") && (
|
|
1400
|
+
t.getAttribute("hidden") && (l.hidden = c(t.getAttribute("hidden"))), t.getAttribute("iLevel") && (l.iLevel = parseInt(t.getAttribute("iLevel"))), o !== null && c(t.getAttribute("customBuiltin") ?? "0") && (l.customized = !0), n.push(l);
|
|
1378
1401
|
}
|
|
1379
1402
|
}
|
|
1380
1403
|
}
|
|
1381
1404
|
afterVisit(e, t, n) {}
|
|
1382
1405
|
},
|
|
1383
|
-
WorkbookVisitor: class extends
|
|
1406
|
+
WorkbookVisitor: class extends W {
|
|
1384
1407
|
visit(e, t, n) {
|
|
1385
1408
|
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;
|
|
1386
1409
|
}
|
|
@@ -1393,13 +1416,13 @@ var $ = {
|
|
|
1393
1416
|
if (!t) return;
|
|
1394
1417
|
let r = {};
|
|
1395
1418
|
this.processPassword(e, t, r, "workbook", "password"), this.processPassword(e, t, r, "revisions", "revisionsPassword");
|
|
1396
|
-
for (let e of
|
|
1419
|
+
for (let e of le) r[e.key] = re(e, t.getAttribute(e.attribute));
|
|
1397
1420
|
return n.protection = r, n;
|
|
1398
1421
|
}
|
|
1399
1422
|
processCalcPr(e, t, n) {
|
|
1400
1423
|
if (!t) return;
|
|
1401
1424
|
let r = {};
|
|
1402
|
-
e.copyFromAttribute(t, "calcMode", r, "calcMode", (e) =>
|
|
1425
|
+
e.copyFromAttribute(t, "calcMode", r, "calcMode", (e) => Fe[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);
|
|
1403
1426
|
let i = t.getAttribute("calcId");
|
|
1404
1427
|
i !== null && e.getVisitorParamsState().set("calcId", i), n.calc = r;
|
|
1405
1428
|
}
|
|
@@ -1415,19 +1438,19 @@ var $ = {
|
|
|
1415
1438
|
processSheetRef(e, t, n) {
|
|
1416
1439
|
let r = {};
|
|
1417
1440
|
e.copyFromAttribute(t, "name", r, "name"), e.copyFromAttribute(t, "state", r, "visibility"), e.copyFromAttribute(t, "sheetId", r, "sheetId", e.INT_COPY);
|
|
1418
|
-
let i = t.getAttribute("r:id"), a = i ?
|
|
1441
|
+
let i = t.getAttribute("r:id"), a = i ? h(e.getRelationships().get(i)?.type) : null;
|
|
1419
1442
|
if (a) {
|
|
1420
1443
|
let t = e.readEmbeddedPart(i);
|
|
1421
1444
|
if (t?.xml) {
|
|
1422
|
-
let e = { part: t }, i =
|
|
1423
|
-
|
|
1445
|
+
let e = { part: t }, i = de(t.xml), s = i ? o((e) => i.get(e)) : void 0;
|
|
1446
|
+
s && (e.tabColor = s), r.kind = a, r.sheet = e, n.push(r);
|
|
1424
1447
|
return;
|
|
1425
1448
|
}
|
|
1426
1449
|
e.warn(`The ${a} sheet '${r.name}' could not be read and was loaded as an empty worksheet.`), n.push(r);
|
|
1427
1450
|
return;
|
|
1428
1451
|
}
|
|
1429
|
-
let
|
|
1430
|
-
|
|
1452
|
+
let s = i ? e.getRef(i) : null;
|
|
1453
|
+
s && (r.sheet = s), n.push(r);
|
|
1431
1454
|
}
|
|
1432
1455
|
processExternalReferences(e, t, n) {
|
|
1433
1456
|
if (!t) return;
|
|
@@ -1443,16 +1466,21 @@ var $ = {
|
|
|
1443
1466
|
}
|
|
1444
1467
|
processPivotCaches(e, t, n) {
|
|
1445
1468
|
if (!t) return;
|
|
1446
|
-
let r = [], i = t.
|
|
1447
|
-
for (let t = 0; t <
|
|
1448
|
-
let n =
|
|
1469
|
+
let r = [], i = e.evaluate("workbookPr", t.parentNode)?.getAttribute?.("date1904"), a = i === "1" || i === "true", o = te(e.getVisitorParamsState().get("numFmts"), void 0), s = t.childNodes, c = s.length;
|
|
1470
|
+
for (let t = 0; t < c; t++) {
|
|
1471
|
+
let n = s.item(t);
|
|
1449
1472
|
if (n.nodeType !== 1 || n.localName !== "pivotCache") continue;
|
|
1450
|
-
let
|
|
1451
|
-
if (isNaN(
|
|
1452
|
-
let
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1473
|
+
let i = parseInt(n.getAttribute("cacheId") ?? "", 10), c = n.getAttribute("r:id");
|
|
1474
|
+
if (isNaN(i) || !c) continue;
|
|
1475
|
+
let l = e.readEmbeddedPart(c);
|
|
1476
|
+
if (!l) continue;
|
|
1477
|
+
let u = be(l, a, (e) => o.numberFormat(e)), d = !u && l.xml ? f(l.xml, o) : void 0, p = !u && l.xml ? Se(l.xml) : void 0;
|
|
1478
|
+
r.push({
|
|
1479
|
+
cacheId: i,
|
|
1480
|
+
part: l,
|
|
1481
|
+
...d ? { partFormats: d } : {},
|
|
1482
|
+
...p ? { source: p } : {},
|
|
1483
|
+
...u
|
|
1456
1484
|
});
|
|
1457
1485
|
}
|
|
1458
1486
|
r.length > 0 && (n.pivotCaches = r);
|
|
@@ -1495,8 +1523,8 @@ var $ = {
|
|
|
1495
1523
|
i.scope = r[n].name;
|
|
1496
1524
|
}
|
|
1497
1525
|
let o = {};
|
|
1498
|
-
for (let n of
|
|
1499
|
-
for (let e of
|
|
1526
|
+
for (let n of ye) e.copyFromAttribute(t, n, o);
|
|
1527
|
+
for (let e of ve) {
|
|
1500
1528
|
let n = t.getAttribute(e);
|
|
1501
1529
|
n !== "1" && n !== "true" || (o[e] = !0);
|
|
1502
1530
|
}
|
|
@@ -1512,7 +1540,10 @@ var $ = {
|
|
|
1512
1540
|
r.length > 0 && (n.names = r);
|
|
1513
1541
|
}
|
|
1514
1542
|
processWorkbookPr(e, t, n) {
|
|
1515
|
-
|
|
1543
|
+
if (!t) return;
|
|
1544
|
+
e.copyFromAttribute(t, "date1904", n, "date1904", e.BOOLEAN_COPY), e.copyFromAttribute(t, "codeName", n, "codeName"), e.copyFromAttribute(t, "updateLinks", n, "updateLinks");
|
|
1545
|
+
let r = t.getAttribute("hidePivotFieldList");
|
|
1546
|
+
r !== "1" && r !== "true" || (n.hiddenPivotFieldList = !0);
|
|
1516
1547
|
}
|
|
1517
1548
|
afterVisit(e, t, n) {}
|
|
1518
1549
|
},
|
|
@@ -1639,7 +1670,7 @@ var $ = {
|
|
|
1639
1670
|
i.length > 0 && (n.sheetDataSet = i);
|
|
1640
1671
|
}
|
|
1641
1672
|
processSheetData(e, t) {
|
|
1642
|
-
let n = new
|
|
1673
|
+
let n = new Ee.Builder(), r = t.childNodes, i = r.length;
|
|
1643
1674
|
for (let e = 0; e < i; e++) {
|
|
1644
1675
|
let t = r.item(e);
|
|
1645
1676
|
if (t.nodeType !== 1 || t.localName !== "row") continue;
|
|
@@ -1669,7 +1700,7 @@ var $ = {
|
|
|
1669
1700
|
case "str":
|
|
1670
1701
|
default: return t;
|
|
1671
1702
|
case "e": {
|
|
1672
|
-
let e =
|
|
1703
|
+
let e = Ce.getBuiltInByLabel(t);
|
|
1673
1704
|
return e ? {
|
|
1674
1705
|
t: "e",
|
|
1675
1706
|
v: e.getCode()
|
|
@@ -1694,7 +1725,47 @@ var $ = {
|
|
|
1694
1725
|
visit(e, t, n) {
|
|
1695
1726
|
e.copyFromAttribute(t, "name", n, "cacheName"), e.copyFromAttribute(t, "sourceName", n);
|
|
1696
1727
|
let r = e.evaluate("*/tableSlicerCache", t);
|
|
1697
|
-
return r ? (e.copyFromAttribute(r, "tableId", n), e.copyFromAttribute(r, "column", n, "columnId"), e.copyFromAttribute(r, "sortOrder", n), e.copyFromAttribute(r, "customListSort", n, "customListSort", e.BOOLEAN_COPY), e.copyFromAttribute(r, "crossFilter", n), n) : (
|
|
1728
|
+
return r ? (e.copyFromAttribute(r, "tableId", n), e.copyFromAttribute(r, "column", n, "columnId"), e.copyFromAttribute(r, "sortOrder", n), e.copyFromAttribute(r, "customListSort", n, "customListSort", e.BOOLEAN_COPY), e.copyFromAttribute(r, "crossFilter", n), n) : (this.processPivot(e, t, n), n);
|
|
1729
|
+
}
|
|
1730
|
+
processPivot(e, t, n) {
|
|
1731
|
+
let r = [], i = "", a = t.childNodes;
|
|
1732
|
+
for (let t = 0; t < a.length; t++) {
|
|
1733
|
+
let o = a.item(t);
|
|
1734
|
+
if (o.nodeType !== 1) continue;
|
|
1735
|
+
if (o.localName === "pivotTables") {
|
|
1736
|
+
let e = o.childNodes;
|
|
1737
|
+
for (let t = 0; t < e.length; t++) {
|
|
1738
|
+
let n = e.item(t);
|
|
1739
|
+
n.nodeType === 1 && n.localName === "pivotTable" && r.push({
|
|
1740
|
+
tabId: n.getAttribute("tabId") ?? "",
|
|
1741
|
+
name: n.getAttribute("name") ?? ""
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
continue;
|
|
1745
|
+
}
|
|
1746
|
+
let s = o.getAttribute("pivotCacheId");
|
|
1747
|
+
if (s && (n.pivotCacheId = s), o.localName === "state" || o.localName === "timelinePivotFilter") {
|
|
1748
|
+
n.tabular = !0, n.pivotData = (n.pivotData ?? "") + (e.serializeElement(o) ?? "");
|
|
1749
|
+
continue;
|
|
1750
|
+
}
|
|
1751
|
+
if (o.localName === "data") {
|
|
1752
|
+
let t = null, r = o.childNodes;
|
|
1753
|
+
for (let e = 0; e < r.length; e++) {
|
|
1754
|
+
let i = r.item(e);
|
|
1755
|
+
if (i.nodeType !== 1) continue;
|
|
1756
|
+
let a = i.getAttribute("pivotCacheId");
|
|
1757
|
+
a && (n.pivotCacheId = a), i.localName === "tabular" && (t = i);
|
|
1758
|
+
}
|
|
1759
|
+
if (t) {
|
|
1760
|
+
n.tabular = !0, e.copyFromAttribute(t, "sortOrder", n), e.copyFromAttribute(t, "customListSort", n, "customListSort", e.BOOLEAN_COPY), e.copyFromAttribute(t, "crossFilter", n), e.copyFromAttribute(t, "showMissing", n, "showMissing", e.BOOLEAN_COPY), n.pivotData = e.serializeElement(o) ?? void 0;
|
|
1761
|
+
continue;
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
let c = e.serializeElement(o);
|
|
1765
|
+
if (c === null) return;
|
|
1766
|
+
i += c;
|
|
1767
|
+
}
|
|
1768
|
+
n.pivotTables = r, n.pivotBody = i;
|
|
1698
1769
|
}
|
|
1699
1770
|
},
|
|
1700
1771
|
SlicersVisitor: class {
|
|
@@ -1713,13 +1784,47 @@ var $ = {
|
|
|
1713
1784
|
let r = {};
|
|
1714
1785
|
n[t.getAttribute("name")] = r, e.copyFromAttribute(t, "xr10:uid", r, "uid");
|
|
1715
1786
|
let i = t.getAttribute("cache"), a = e.getVisitorParamsState().get("slicerCaches"), o = i ? a?.get(i) : void 0;
|
|
1716
|
-
if (o) for (let e = 0; e <
|
|
1717
|
-
let t =
|
|
1787
|
+
if (o) for (let e = 0; e < q.length; e++) {
|
|
1788
|
+
let t = q[e];
|
|
1718
1789
|
o[t] !== void 0 && (r[t] = o[t]);
|
|
1719
1790
|
}
|
|
1720
1791
|
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);
|
|
1721
1792
|
}
|
|
1722
1793
|
},
|
|
1794
|
+
TimelinesVisitor: class {
|
|
1795
|
+
visit(e, t, n) {
|
|
1796
|
+
let r = n.slicers;
|
|
1797
|
+
r || (r = {}, n.slicers = r);
|
|
1798
|
+
let i = t.childNodes;
|
|
1799
|
+
for (let t = 0; t < i.length; t++) {
|
|
1800
|
+
let n = i.item(t);
|
|
1801
|
+
n.nodeType === 1 && n.localName === "timeline" && this.processTimeline(e, n, r);
|
|
1802
|
+
}
|
|
1803
|
+
return r;
|
|
1804
|
+
}
|
|
1805
|
+
processTimeline(e, t, n) {
|
|
1806
|
+
let r = {};
|
|
1807
|
+
n[t.getAttribute("name")] = r, e.copyFromAttribute(t, "xr10:uid", r, "uid");
|
|
1808
|
+
let i = t.getAttribute("cache"), a = e.getVisitorParamsState().get("slicerCaches"), o = i ? a?.get(i) : void 0;
|
|
1809
|
+
if (o) for (let e = 0; e < q.length; e++) {
|
|
1810
|
+
let t = q[e];
|
|
1811
|
+
o[t] !== void 0 && (r[t] = o[t]);
|
|
1812
|
+
}
|
|
1813
|
+
e.copyFromAttribute(t, "caption", r);
|
|
1814
|
+
let s = {};
|
|
1815
|
+
for (let e = 0; e < t.attributes.length; e++) {
|
|
1816
|
+
let n = t.attributes.item(e);
|
|
1817
|
+
Ie.has(n.name) || n.name.startsWith("xmlns") || (s[n.name] = n.value);
|
|
1818
|
+
}
|
|
1819
|
+
r.timelineAttributes = s;
|
|
1820
|
+
let c = "", l = t.childNodes;
|
|
1821
|
+
for (let t = 0; t < l.length; t++) {
|
|
1822
|
+
let n = l.item(t);
|
|
1823
|
+
n.nodeType === 1 && (c += e.serializeElement(n) ?? "");
|
|
1824
|
+
}
|
|
1825
|
+
r.timelineBody = c;
|
|
1826
|
+
}
|
|
1827
|
+
},
|
|
1723
1828
|
FormControlPrVisitor: class {
|
|
1724
1829
|
visit(e, t, n) {
|
|
1725
1830
|
let r = {}, i = t.attributes;
|
|
@@ -1740,7 +1845,7 @@ var $ = {
|
|
|
1740
1845
|
} else n.localName === "extLst" && (o = e.serializeElement(n) ?? void 0);
|
|
1741
1846
|
}
|
|
1742
1847
|
}
|
|
1743
|
-
let c =
|
|
1848
|
+
let c = ue(r, a, o);
|
|
1744
1849
|
return n.formControl = c, c;
|
|
1745
1850
|
}
|
|
1746
1851
|
},
|
|
@@ -1749,7 +1854,7 @@ var $ = {
|
|
|
1749
1854
|
return n;
|
|
1750
1855
|
}
|
|
1751
1856
|
afterVisit(e, t, n) {
|
|
1752
|
-
for (let e of n?.movables ?? [])
|
|
1857
|
+
for (let e of n?.movables ?? []) J(e, !1);
|
|
1753
1858
|
}
|
|
1754
1859
|
},
|
|
1755
1860
|
DrawingAnchorVisitor: class {
|
|
@@ -1769,7 +1874,7 @@ var $ = {
|
|
|
1769
1874
|
x: 0,
|
|
1770
1875
|
y: 0
|
|
1771
1876
|
};
|
|
1772
|
-
return o.x =
|
|
1877
|
+
return o.x = m(t.getAttribute(i)), o.y = m(t.getAttribute(a)), r === "from" ? n.tl = o : n.br = o, n;
|
|
1773
1878
|
}
|
|
1774
1879
|
processOffsetCoord(e, t, n, r) {
|
|
1775
1880
|
if (!t) return;
|
|
@@ -1779,38 +1884,38 @@ var $ = {
|
|
|
1779
1884
|
x: 0,
|
|
1780
1885
|
y: 0
|
|
1781
1886
|
};
|
|
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 =
|
|
1887
|
+
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 = m(e.evaluate("colOff", t).textContent)), e.evaluate("rowOff", t) && (i.y = m(e.evaluate("rowOff", t).textContent)), r === "from" ? n.tl = i : n.br = i, n;
|
|
1783
1888
|
}
|
|
1784
1889
|
},
|
|
1785
|
-
DrawingGraphicFrameVisitor: class extends
|
|
1890
|
+
DrawingGraphicFrameVisitor: class extends V {
|
|
1786
1891
|
visit(e, t, n) {
|
|
1787
1892
|
if (!t) return;
|
|
1788
1893
|
if (this.isGroupContent(n)) {
|
|
1789
1894
|
if (e.getPath().includes("Fallback")) return {};
|
|
1790
|
-
let { movable: r } = this.readMemberHeader(e, t, "graphicFrame"),
|
|
1791
|
-
if (
|
|
1792
|
-
|
|
1793
|
-
let t = e.evaluate("off",
|
|
1895
|
+
let { movable: r } = this.readMemberHeader(e, t, "graphicFrame"), a = e.evaluate("xfrm", t);
|
|
1896
|
+
if (a) {
|
|
1897
|
+
i(a, r);
|
|
1898
|
+
let t = e.evaluate("off", a), n = e.evaluate("ext", a);
|
|
1794
1899
|
r.anchor = {
|
|
1795
1900
|
tl: {
|
|
1796
|
-
x:
|
|
1797
|
-
y:
|
|
1901
|
+
x: m(t?.getAttribute("x") ?? null) ?? 0,
|
|
1902
|
+
y: m(t?.getAttribute("y") ?? null) ?? 0
|
|
1798
1903
|
},
|
|
1799
1904
|
br: {
|
|
1800
|
-
x:
|
|
1801
|
-
y:
|
|
1905
|
+
x: m(n?.getAttribute("cx") ?? null) ?? 0,
|
|
1906
|
+
y: m(n?.getAttribute("cy") ?? null) ?? 0
|
|
1802
1907
|
}
|
|
1803
1908
|
};
|
|
1804
1909
|
}
|
|
1805
|
-
let
|
|
1910
|
+
let o = this.readGraphic(e, t), s = o.type === "chart" ? {
|
|
1806
1911
|
...r.content.json,
|
|
1807
|
-
...
|
|
1808
|
-
} :
|
|
1912
|
+
...o.json
|
|
1913
|
+
} : o.json;
|
|
1809
1914
|
return r.content = {
|
|
1810
1915
|
...r.content,
|
|
1811
|
-
type:
|
|
1812
|
-
json:
|
|
1813
|
-
}, n.members.push(r),
|
|
1916
|
+
type: o.type,
|
|
1917
|
+
json: s
|
|
1918
|
+
}, n.members.push(r), o.json;
|
|
1814
1919
|
}
|
|
1815
1920
|
n = super.visit(e, t, n);
|
|
1816
1921
|
let r = e.evaluate("nvGraphicFramePr/cNvGraphicFramePr", t);
|
|
@@ -1818,8 +1923,8 @@ var $ = {
|
|
|
1818
1923
|
let t = e.evaluate("graphicFrameLocks", r);
|
|
1819
1924
|
t && t.hasAttribute("noChangeAspect") && (n.lockAspect = t.getAttribute("noChangeAspect") === "1");
|
|
1820
1925
|
}
|
|
1821
|
-
let
|
|
1822
|
-
return this.setContent(n,
|
|
1926
|
+
let a = this.readGraphic(e, t);
|
|
1927
|
+
return this.setContent(n, a), a;
|
|
1823
1928
|
}
|
|
1824
1929
|
readGraphic(e, t) {
|
|
1825
1930
|
let n = e.evaluate("graphic/graphicData", t), r = {
|
|
@@ -1832,12 +1937,12 @@ var $ = {
|
|
|
1832
1937
|
let a = i.item(n);
|
|
1833
1938
|
if (a.nodeType === 1) try {
|
|
1834
1939
|
let n = a.localName;
|
|
1835
|
-
n === "chart" ? n = "chart" : n
|
|
1940
|
+
n === "chart" ? n = "chart" : n !== "slicer" && n !== "timeslicer" || (n = "slicer"), r.type = n;
|
|
1836
1941
|
let i = a.getAttribute("r:id");
|
|
1837
1942
|
if (n === "chart" && i) {
|
|
1838
1943
|
let n = this.readSourceId(e, t), a = e.readEmbeddedPart(i) ?? void 0, o;
|
|
1839
1944
|
try {
|
|
1840
|
-
let t = a?.xml ?
|
|
1945
|
+
let t = a?.xml ? xe(a.xml) : null;
|
|
1841
1946
|
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
1947
|
} catch (t) {
|
|
1843
1948
|
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" });
|
|
@@ -1858,8 +1963,8 @@ var $ = {
|
|
|
1858
1963
|
return r;
|
|
1859
1964
|
}
|
|
1860
1965
|
},
|
|
1861
|
-
DrawingSpVisitor:
|
|
1862
|
-
DrawingPicVisitor: class extends
|
|
1966
|
+
DrawingSpVisitor: Y,
|
|
1967
|
+
DrawingPicVisitor: class extends V {
|
|
1863
1968
|
visit(e, t, n) {
|
|
1864
1969
|
if (!t) return;
|
|
1865
1970
|
if (this.isGroupContent(n)) {
|
|
@@ -1878,7 +1983,7 @@ var $ = {
|
|
|
1878
1983
|
readPictureDetails(e, t, n, r, i) {
|
|
1879
1984
|
n?.resId !== void 0 && (i.resId = n.resId), n?.image && (i.image = n.image);
|
|
1880
1985
|
let a = t.getAttribute("macro");
|
|
1881
|
-
a && (i.macro = a), t.hasAttribute("fPublished") && (i.published =
|
|
1986
|
+
a && (i.macro = a), t.hasAttribute("fPublished") && (i.published = c(t.getAttribute("fPublished")));
|
|
1882
1987
|
let o = e.evaluate("nvPicPr/cNvPicPr", t);
|
|
1883
1988
|
if (o?.getAttribute) {
|
|
1884
1989
|
o.getAttribute("preferRelativeResize") === "0" && (i.noRelativeResize = !0);
|
|
@@ -1890,45 +1995,45 @@ var $ = {
|
|
|
1890
1995
|
let n = e.evaluate("blipFill", t), r = n ? e.evaluate("blip", n) : null;
|
|
1891
1996
|
if (!r) return;
|
|
1892
1997
|
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
|
|
1894
|
-
return !o.tile && o.stretch && Object.keys(o.stretch).length === 0 && delete o.stretch, o.extLst &&
|
|
1998
|
+
let { type: i, resId: a, ...o } = new d().processImageFill(e, n);
|
|
1999
|
+
return !o.tile && o.stretch && Object.keys(o.stretch).length === 0 && delete o.stretch, o.extLst && Le.test(o.extLst) && delete o.extLst, {
|
|
1895
2000
|
resId: a,
|
|
1896
2001
|
image: Object.keys(o).length > 0 ? o : void 0
|
|
1897
2002
|
};
|
|
1898
2003
|
}
|
|
1899
2004
|
},
|
|
1900
|
-
DrawingGrpSpVisitor: class extends
|
|
2005
|
+
DrawingGrpSpVisitor: class extends V {
|
|
1901
2006
|
constructor(...e) {
|
|
1902
|
-
super(...e), this._fills = new
|
|
2007
|
+
super(...e), this._fills = new d();
|
|
1903
2008
|
}
|
|
1904
2009
|
visit(e, t, n) {
|
|
1905
2010
|
if (!t) return;
|
|
1906
|
-
let r = this.isGroupContent(n),
|
|
2011
|
+
let r = this.isGroupContent(n), a, o;
|
|
1907
2012
|
if (r) {
|
|
1908
2013
|
if (e.getPath().includes("Fallback")) return {};
|
|
1909
2014
|
let r = this.readMemberHeader(e, t, "group");
|
|
1910
|
-
|
|
2015
|
+
a = r.movable, o = r.content, n.members.push(a);
|
|
1911
2016
|
} else {
|
|
1912
2017
|
if (e.getPath().includes("Fallback") && n.content) return {};
|
|
1913
|
-
|
|
2018
|
+
a = super.visit(e, t, n), o = {};
|
|
1914
2019
|
let r = this.readSourceId(e, t);
|
|
1915
|
-
r !== void 0 && (
|
|
2020
|
+
r !== void 0 && (o.sourceId = r), this.setContent(a, {
|
|
1916
2021
|
type: "group",
|
|
1917
|
-
json:
|
|
2022
|
+
json: o
|
|
1918
2023
|
});
|
|
1919
2024
|
}
|
|
1920
|
-
|
|
1921
|
-
let
|
|
1922
|
-
|
|
1923
|
-
let
|
|
1924
|
-
|
|
1925
|
-
let
|
|
1926
|
-
if (
|
|
1927
|
-
let t = e.evaluate("xfrm",
|
|
2025
|
+
o.members = [];
|
|
2026
|
+
let s = e.evaluate("nvGrpSpPr/cNvGrpSpPr/grpSpLocks", t);
|
|
2027
|
+
s?.hasAttribute?.("noChangeAspect") && (a.lockAspect = s.getAttribute("noChangeAspect") === "1");
|
|
2028
|
+
let c = this.readLocks(s);
|
|
2029
|
+
c && (o.locks = c);
|
|
2030
|
+
let l = e.evaluate("grpSpPr", t);
|
|
2031
|
+
if (l) {
|
|
2032
|
+
let t = e.evaluate("xfrm", l);
|
|
1928
2033
|
if (t) {
|
|
1929
|
-
|
|
1930
|
-
let n =
|
|
1931
|
-
|
|
2034
|
+
i(t, a), t.getAttribute("flipH") === "1" && (a.flipH = !0), t.getAttribute("flipV") === "1" && (a.flipV = !0);
|
|
2035
|
+
let n = X(e, t, "off", "ext"), s = X(e, t, "chOff", "chExt") ?? n;
|
|
2036
|
+
s && (o.childBounds = s), r && n && (a.anchor = {
|
|
1932
2037
|
tl: {
|
|
1933
2038
|
x: n.x,
|
|
1934
2039
|
y: n.y
|
|
@@ -1939,22 +2044,22 @@ var $ = {
|
|
|
1939
2044
|
}
|
|
1940
2045
|
});
|
|
1941
2046
|
}
|
|
1942
|
-
let n = this._fills.getFill(e,
|
|
1943
|
-
n && Object.keys(n).length > 0 && (
|
|
1944
|
-
let
|
|
1945
|
-
|
|
1946
|
-
let
|
|
1947
|
-
|
|
1948
|
-
let
|
|
1949
|
-
|
|
1950
|
-
...
|
|
1951
|
-
properties:
|
|
2047
|
+
let n = this._fills.getFill(e, l);
|
|
2048
|
+
n && Object.keys(n).length > 0 && (o.fill = n);
|
|
2049
|
+
let s = this._fills.getEffects(e, l);
|
|
2050
|
+
s && (o.effects = s);
|
|
2051
|
+
let c = e.evaluate("scene3d", l), u = c ? e.serializeElement(c) : null;
|
|
2052
|
+
u && (o.scene3d = u);
|
|
2053
|
+
let d = e.evaluate("extLst", l), f = d ? e.serializeElement(d) : null;
|
|
2054
|
+
f && (o.extLst = {
|
|
2055
|
+
...o.extLst,
|
|
2056
|
+
properties: f
|
|
1952
2057
|
});
|
|
1953
2058
|
}
|
|
1954
|
-
return
|
|
2059
|
+
return o;
|
|
1955
2060
|
}
|
|
1956
2061
|
},
|
|
1957
|
-
DrawingCxnSpVisitor: class extends
|
|
2062
|
+
DrawingCxnSpVisitor: class extends Y {
|
|
1958
2063
|
visit(e, t, n) {
|
|
1959
2064
|
if (t) return this.visitShape(e, t, n, "cxnSp", "nvCxnSpPr/cNvCxnSpPr/cxnSpLocks");
|
|
1960
2065
|
}
|
|
@@ -2076,7 +2181,7 @@ var $ = {
|
|
|
2076
2181
|
}
|
|
2077
2182
|
let a = [], o = r.find((e) => e.type === "XFComplements")?.arrays.get("MappedFeaturePropertyBags") ?? [];
|
|
2078
2183
|
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 ?
|
|
2184
|
+
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 ? Re[s] : void 0;
|
|
2080
2185
|
c || e.warn(`A cell format's feature '${s ?? "unknown"}' is not read; its cells keep their values.`), a.push(c ? { type: c } : null);
|
|
2081
2186
|
}
|
|
2082
2187
|
let s = { controls: a };
|
|
@@ -2153,7 +2258,7 @@ var $ = {
|
|
|
2153
2258
|
if (n.nodeType === 1) {
|
|
2154
2259
|
if (n.localName === "t") e.text += n.textContent ?? "";
|
|
2155
2260
|
else if (n.localName === "rPr") {
|
|
2156
|
-
let t =
|
|
2261
|
+
let t = ze(n);
|
|
2157
2262
|
t && (e.font = t);
|
|
2158
2263
|
}
|
|
2159
2264
|
}
|
|
@@ -2180,16 +2285,16 @@ var $ = {
|
|
|
2180
2285
|
visit(e, t, n) {
|
|
2181
2286
|
if (!t) return;
|
|
2182
2287
|
let r = {};
|
|
2183
|
-
e.copyFromAttribute(t, "id", r, "id",
|
|
2288
|
+
e.copyFromAttribute(t, "id", r, "id", _);
|
|
2184
2289
|
let i = t.getAttribute("ref");
|
|
2185
|
-
e.copyFromAttribute(t, "personId", r, "personId",
|
|
2290
|
+
e.copyFromAttribute(t, "personId", r, "personId", _), e.copyFromAttribute(t, "parentId", r, "parentId", _);
|
|
2186
2291
|
let a = t.getAttribute("dT");
|
|
2187
2292
|
a && (r.dt = function(e) {
|
|
2188
2293
|
let t = /^(.*T\d{2}:\d{2}:\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:?\d{2})?$/i.exec(e.trim());
|
|
2189
2294
|
if (!t) return e;
|
|
2190
2295
|
let [, n, r, i] = t;
|
|
2191
2296
|
return `${n}${r ? `.${(r + "00").substring(0, 3)}` : ""}${i ?? "Z"}`;
|
|
2192
|
-
}(a)), t.hasAttribute("done") && (r.done =
|
|
2297
|
+
}(a)), t.hasAttribute("done") && (r.done = c(t.getAttribute("done")));
|
|
2193
2298
|
let o = function(e) {
|
|
2194
2299
|
let t, n = e.childNodes;
|
|
2195
2300
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -2202,8 +2307,8 @@ var $ = {
|
|
|
2202
2307
|
let r = n.getAttribute("mentionId"), a = n.getAttribute("mentionpersonId");
|
|
2203
2308
|
if (!r || !a) continue;
|
|
2204
2309
|
let o = {
|
|
2205
|
-
id:
|
|
2206
|
-
personId:
|
|
2310
|
+
id: _(r),
|
|
2311
|
+
personId: _(a)
|
|
2207
2312
|
}, s = parseInt(n.getAttribute("startIndex") ?? "", 10);
|
|
2208
2313
|
isNaN(s) || (o.startIndex = s);
|
|
2209
2314
|
let c = parseInt(n.getAttribute("length") ?? "", 10);
|
|
@@ -2225,33 +2330,33 @@ var $ = {
|
|
|
2225
2330
|
let n = i.item(t);
|
|
2226
2331
|
if (n.nodeType === 1 && n.localName === "person") {
|
|
2227
2332
|
let t = {};
|
|
2228
|
-
e.copyFromAttribute(n, "id", t, "id",
|
|
2333
|
+
e.copyFromAttribute(n, "id", t, "id", _), e.copyFromAttribute(n, "displayName", t), e.copyFromAttribute(n, "userId", t, "userId", _), e.copyFromAttribute(n, "providerId", t), r.push(t);
|
|
2229
2334
|
}
|
|
2230
2335
|
}
|
|
2231
2336
|
return r.length > 0 && (n.persons = r), r;
|
|
2232
2337
|
}
|
|
2233
2338
|
}
|
|
2234
|
-
},
|
|
2339
|
+
}, Be = class {
|
|
2235
2340
|
constructor(e, t) {
|
|
2236
2341
|
this.path = e, this.visitor = t;
|
|
2237
2342
|
}
|
|
2238
|
-
},
|
|
2343
|
+
}, Ve = class {
|
|
2239
2344
|
constructor() {
|
|
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());
|
|
2345
|
+
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("timelineCacheDefinition", new $.SlicerCacheDefinitionVisitor()), this.registerVisitor("timelines", new $.TimelinesVisitor()), this.registerVisitor("formControlPr", new $.FormControlPrVisitor());
|
|
2241
2346
|
}
|
|
2242
2347
|
registerVisitor(e, t, n = null) {
|
|
2243
2348
|
e.indexOf(":") === -1 && (e = "*:" + e);
|
|
2244
2349
|
let r = e.split(":"), i = r.length > 1 ? r[1] : r[0];
|
|
2245
2350
|
if (!n) return this.visitorsByXmlTagName.set(i, t), void this.visitorsByXmlTagName.set(e, t);
|
|
2246
2351
|
let a = this.scopedVisitorsByXmlTagName.get(i);
|
|
2247
|
-
a || (a = [], this.scopedVisitorsByXmlTagName.set(i, a), this.scopedVisitorsByXmlTagName.set(e, a)), a.push(new
|
|
2352
|
+
a || (a = [], this.scopedVisitorsByXmlTagName.set(i, a), this.scopedVisitorsByXmlTagName.set(e, a)), a.push(new Be(n, t));
|
|
2248
2353
|
}
|
|
2249
2354
|
parseDxf(e, t = "", n = D.EmptyObject) {
|
|
2250
2355
|
this.visitorParamsState ||= /* @__PURE__ */ new Map();
|
|
2251
2356
|
let r = this.visitorParamsState, i = r.get("processingDXFs");
|
|
2252
2357
|
r.set("processingDXFs", !0);
|
|
2253
2358
|
try {
|
|
2254
|
-
let r = new
|
|
2359
|
+
let r = new R(null, this, "/dxf", e, {}, t, n), i = {};
|
|
2255
2360
|
return new $.SheetStyleVisitor().processDXF(r, e, i), i;
|
|
2256
2361
|
} finally {
|
|
2257
2362
|
i === void 0 ? r.delete("processingDXFs") : r.set("processingDXFs", i);
|
|
@@ -2265,7 +2370,7 @@ var $ = {
|
|
|
2265
2370
|
this.visitorParamsState && !n?.paramMap || (this.visitorParamsState = n?.paramMap ?? /* @__PURE__ */ new Map());
|
|
2266
2371
|
let i = {}, a = this.visitorsByXmlTagName.get(r.nodeName);
|
|
2267
2372
|
if (a ||= this.visitorsByXmlTagName.get(r.localName), !a) throw Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);
|
|
2268
|
-
let o = "/" + r.localName, s = new
|
|
2373
|
+
let o = "/" + r.localName, s = new R(null, this, o, r, i, t, n), c = [];
|
|
2269
2374
|
this._doWalk(a, s, c, r, i, t, n);
|
|
2270
2375
|
let l = c.length;
|
|
2271
2376
|
for (let e = 0; e < l; e++) {
|
|
@@ -2293,7 +2398,7 @@ var $ = {
|
|
|
2293
2398
|
for (; l && l !== r;) s = l.localName + "/" + s, l = l.parentNode;
|
|
2294
2399
|
let u = t.getPath() + "/" + s;
|
|
2295
2400
|
if (c.visitor) {
|
|
2296
|
-
let r = new
|
|
2401
|
+
let r = new R(t, this, u, t.getElemRoot(), t.getJsonRoot(), a, o);
|
|
2297
2402
|
this._doWalk(c.visitor, r, n, e, i, a, o);
|
|
2298
2403
|
}
|
|
2299
2404
|
};
|
|
@@ -2319,10 +2424,10 @@ var $ = {
|
|
|
2319
2424
|
if (r.nodeType !== 1) continue;
|
|
2320
2425
|
let c = r, p = c.nodeName, m = l.get(p);
|
|
2321
2426
|
m ||= (p = c.localName, l.get(p));
|
|
2322
|
-
let h = t.getPath() + "/" + p, g = new
|
|
2427
|
+
let h = t.getPath() + "/" + p, g = new R(t, this, h, u, d, a, o);
|
|
2323
2428
|
this._doWalk(m, g, n, c, s ?? i, a, o);
|
|
2324
2429
|
}
|
|
2325
2430
|
return s;
|
|
2326
2431
|
}
|
|
2327
2432
|
};
|
|
2328
|
-
export {
|
|
2433
|
+
export { Ve as DOMTransformer, R as ExecutionContext, a as NumberUtils, r as VisitorUtils };
|