@sheetxl/io-xlsx 0.8.0-beta.6 → 0.8.0-beta.9
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/cjs/B0Ugu_crqQYpdfQz.cjs +1 -0
- package/browser/cjs/{qb-YQ8mGwpogSP08.cjs → BHM3_D9PsNURVAVy.cjs} +1 -1
- package/browser/cjs/BHWdwAQ322YA8JAZ.cjs +6 -0
- package/browser/cjs/CeuX8p1aBuKTuagi.cjs +2 -0
- package/browser/cjs/DSM4q1dhVVXvsgby.cjs +30 -0
- package/browser/cjs/DiAHwNv2I8RHE9GY.cjs +1 -0
- package/browser/cjs/index.cjs +1 -1
- package/browser/cjs/wrpXlaSBGEicQf6_.cjs +6 -0
- package/browser/esm/{B3cYXnqV2Zjaw6Jp.mjs → Bu64BYvRAlVftMr1.mjs} +4 -4
- package/browser/esm/{B0E-_6m23g4BDnX6.mjs → C-2KaUyV4gs-sDTZ.mjs} +2 -2
- package/browser/esm/{CGgjL7wM5WHZA6Dt.mjs → CRrTMRdN_IcSA_pm.mjs} +2 -2
- package/browser/esm/{BYENv_UE3Hv5ghGD.mjs → CWt4fDYEbj2hvsl_.mjs} +820 -800
- package/browser/esm/{BLEHoDT0SLbo8OO2.mjs → Ccnxz-y2WBEgfvvh.mjs} +2606 -1408
- package/browser/esm/{k-aEFzUZ8aU9FPf4.mjs → CxtFawTfwRTCC4Xr.mjs} +1 -1
- package/browser/esm/{DdTgGiFy8nAZTQ0d.mjs → D-epcZSoKLbsAIaC.mjs} +2 -2
- package/browser/esm/DsSIg46AR7IFBN5N.mjs +2298 -0
- package/browser/esm/{D01fs7vrCLlmdHoW.mjs → Dx64JMAGwNNDBkC1.mjs} +1555 -1159
- package/browser/esm/Sv4twwEJDb9dZ91h.mjs +149 -0
- package/browser/esm/index.mjs +2 -2
- package/node/esm/{am47EU_k1uSVm7yW.mjs → BCr4lCI6qQXXN0K1.mjs} +2 -2
- package/node/esm/BPn5XBizKkwaUqXB.mjs +4285 -0
- package/node/esm/{D-l0hqYTXUIEFoTg.mjs → BVV11IlqF6Lmlv8D.mjs} +53 -69
- package/node/esm/{Co5_sjvEk9d-x9gx.mjs → BiJEEgltJzx94zIR.mjs} +930 -909
- package/node/esm/{DWF_5NYPdrlTVvHi.mjs → BsTMtvwpQoPNv95M.mjs} +1 -1
- package/node/esm/{ZWSOYqmTKEmEOz2u.mjs → CBtj0-a4l2qux2hA.mjs} +2 -2
- package/node/esm/CkmZuMvRTpva7eQu.mjs +5074 -0
- package/node/esm/index.mjs +4 -4
- package/node/esm/j0RE2usgdljRw_gr.mjs +2345 -0
- package/package.json +3 -3
- package/types/src/AutoFilterRules.d.ts +83 -10
- package/types/src/OOXMLExtensions.d.ts +6 -0
- package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +13 -0
- package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +7 -1
- package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +23 -1
- package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +20 -1
- package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
- package/types/src/reader/domVisitors/DrawingVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
- package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
- package/types/src/reader/domVisitors/index.d.ts +4 -2
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +1 -1
- package/types/src/utils/DrawingMLText.d.ts +39 -0
- package/types/src/utils/FormControls.d.ts +97 -0
- package/types/src/writer/builder/Emitter.d.ts +5 -0
- package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
- package/types/src/writer/builder/Types.d.ts +10 -0
- package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
- package/types/src/writer/utils/DrawMLUtils.d.ts +39 -2
- package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
- package/types/src/writer/utils/TextUtils.d.ts +21 -2
- package/browser/cjs/17tMBnuyu4YIxixh.cjs +0 -1
- package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
- package/browser/cjs/BxU-OlZIQViQl7gX.cjs +0 -1
- package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
- package/browser/cjs/DHKWtqZ0vQfXrbq1.cjs +0 -2
- package/browser/cjs/DpZr07y7ifaZGvJ9.cjs +0 -5
- package/browser/cjs/MqKQ_B5qRARrRbO4.cjs +0 -24
- package/browser/esm/96C1ntelYWh7kQtW.mjs +0 -24
- package/browser/esm/FwrsLfi1iEAQGIjj.mjs +0 -2402
- package/browser/esm/gicSNvWtBLkvLsIw.mjs +0 -159
- package/node/esm/B-g20MoPHbZFapp8.mjs +0 -4642
- package/node/esm/Bu9QkKpBW4G2ULAg.mjs +0 -2450
- package/node/esm/CHl-WFsto0oTmBtB.mjs +0 -3051
- package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
|
@@ -1,15 +1,14 @@
|
|
|
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.9
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
var I = /* @__PURE__ */ new Uint8Array(), L = class e {
|
|
7
|
+
import { At as e, Bt as t, Ct as n, Dt as r, Et as i, Ft as a, Gt as o, Ht as s, J as c, Jt as l, K as u, Kt as d, Pt as f, Qt as p, Rt as m, Ut as h, Vt as g, W as _, Wt as v, Xt as ee, Y as y, Yt as te, _ as ne, bt as b, en as re, et as ie, ft as ae, i as oe, it as x, o as S, ot as C, p as w, pt as T, qt as se, rt as E, s as ce, ut as le, vt as D, wt as ue, xt as de, yt as O, zt as fe } from "./Ccnxz-y2WBEgfvvh.mjs";
|
|
8
|
+
import { a as pe, c as k, i as A, l as me, n as he, o as j, r as M, s as N, t as ge } from "./Sv4twwEJDb9dZ91h.mjs";
|
|
9
|
+
import { BufferUtils as _e, CommonUtils as ve, ExpectedError as P } from "@sheetxl/utils";
|
|
10
|
+
import { AddressUtils as ye, CommonUtils as be, CoordUtils as xe, FormulaError as F, ICondition as I, IConditionalFormat as L, IRange as Se, OutOfBoundsError as R, PersonCollection as Ce, ResourceCollection as we, Theme as Te, Tuple as Ee, Workbook as De } from "@sheetxl/sdk";
|
|
11
|
+
var z = /* @__PURE__ */ new Uint8Array(), Oe = class e {
|
|
13
12
|
constructor(e, t, n) {
|
|
14
13
|
this.buffers = /* @__PURE__ */ new Map(), this.zip = e, this.entries = t, this.rawBuffer = n;
|
|
15
14
|
}
|
|
@@ -17,7 +16,7 @@ var I = /* @__PURE__ */ new Uint8Array(), L = class e {
|
|
|
17
16
|
return e.startsWith("/") ? e.slice(1) : e;
|
|
18
17
|
}
|
|
19
18
|
static async create(t) {
|
|
20
|
-
let n = t instanceof Blob ?
|
|
19
|
+
let n = t instanceof Blob ? z : t instanceof Uint8Array ? t : new Uint8Array(t), r = new f(t instanceof Blob ? new a(t) : new m(n)), i = /* @__PURE__ */ new Map();
|
|
21
20
|
for (let e of await r.getEntries()) e.directory || i.set(e.filename, e);
|
|
22
21
|
return new e(r, i, n);
|
|
23
22
|
}
|
|
@@ -35,12 +34,12 @@ var I = /* @__PURE__ */ new Uint8Array(), L = class e {
|
|
|
35
34
|
if (r) return r;
|
|
36
35
|
let i = this.entries.get(n);
|
|
37
36
|
if (!i) return null;
|
|
38
|
-
let a = await i.getData(new
|
|
37
|
+
let a = await i.getData(new fe());
|
|
39
38
|
return this.buffers.set(n, a), a;
|
|
40
39
|
}
|
|
41
40
|
async prefetch(e) {
|
|
42
41
|
let t = [];
|
|
43
|
-
for (let [n, r] of this.entries) !this.buffers.has(n) && e(n, r) && t.push(r.getData(new
|
|
42
|
+
for (let [n, r] of this.entries) !this.buffers.has(n) && e(n, r) && t.push(r.getData(new fe()).then((e) => {
|
|
44
43
|
this.buffers.set(n, e);
|
|
45
44
|
}));
|
|
46
45
|
await Promise.all(t);
|
|
@@ -83,18 +82,18 @@ var I = /* @__PURE__ */ new Uint8Array(), L = class e {
|
|
|
83
82
|
async close() {
|
|
84
83
|
await this.zip.close();
|
|
85
84
|
}
|
|
86
|
-
},
|
|
85
|
+
}, B = class {
|
|
87
86
|
constructor(e) {
|
|
88
|
-
this._sink = e, this._samples = [], this._t0 =
|
|
87
|
+
this._sink = e, this._samples = [], this._t0 = ke(), this._tPrev = this._t0, this._heapPrev = Ae();
|
|
89
88
|
}
|
|
90
89
|
mark(e) {
|
|
91
|
-
let t =
|
|
90
|
+
let t = ke(), n = Ae(), r = {
|
|
92
91
|
label: e,
|
|
93
92
|
tMs: t - this._t0,
|
|
94
93
|
dtMs: t - this._tPrev,
|
|
95
94
|
heapBytes: n,
|
|
96
95
|
dHeapBytes: n !== void 0 && this._heapPrev !== void 0 ? n - this._heapPrev : void 0,
|
|
97
|
-
rssBytes:
|
|
96
|
+
rssBytes: V()
|
|
98
97
|
};
|
|
99
98
|
this._tPrev = t, this._heapPrev = n, this._samples.push(r), this._sink?.(r);
|
|
100
99
|
}
|
|
@@ -106,91 +105,91 @@ var I = /* @__PURE__ */ new Uint8Array(), L = class e {
|
|
|
106
105
|
phase: e.label,
|
|
107
106
|
tMs: Math.round(e.tMs),
|
|
108
107
|
dtMs: Math.round(e.dtMs),
|
|
109
|
-
heapMB: e.heapBytes === void 0 ? "—" :
|
|
110
|
-
dHeapMB: e.dHeapBytes === void 0 ? "—" :
|
|
111
|
-
rssMB: e.rssBytes === void 0 ? "—" :
|
|
108
|
+
heapMB: e.heapBytes === void 0 ? "—" : H(e.heapBytes / 1048576),
|
|
109
|
+
dHeapMB: e.dHeapBytes === void 0 ? "—" : H(e.dHeapBytes / 1048576),
|
|
110
|
+
rssMB: e.rssBytes === void 0 ? "—" : H(e.rssBytes / 1048576)
|
|
112
111
|
}));
|
|
113
112
|
}
|
|
114
|
-
},
|
|
115
|
-
function
|
|
113
|
+
}, ke = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now();
|
|
114
|
+
function Ae() {
|
|
116
115
|
let e = typeof performance == "object" ? performance.memory : void 0;
|
|
117
116
|
if (e && typeof e.usedJSHeapSize == "number") return e.usedJSHeapSize;
|
|
118
117
|
let t = globalThis.process;
|
|
119
118
|
return typeof t == "object" && typeof t.memoryUsage == "function" ? t.memoryUsage().heapUsed : void 0;
|
|
120
119
|
}
|
|
121
|
-
function
|
|
120
|
+
function V() {
|
|
122
121
|
let e = globalThis.process;
|
|
123
122
|
if (typeof e == "object" && typeof e.memoryUsage == "function") return e.memoryUsage().rss;
|
|
124
123
|
}
|
|
125
|
-
function
|
|
124
|
+
function H(e) {
|
|
126
125
|
return Math.round(10 * e) / 10;
|
|
127
126
|
}
|
|
128
|
-
var
|
|
127
|
+
var U = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", W = `-${U}.0-9·̀-ͯ‿-⁀`, je = (RegExp(`^[${U}]$`, "u"), RegExp(`^[${W}]$`, "u"), RegExp(`^[${U}][${W}]*$`, "u")), Me = (RegExp(`^[${W}]+$`, "u"), [
|
|
129
128
|
32,
|
|
130
129
|
10,
|
|
131
130
|
13,
|
|
132
131
|
9
|
|
133
132
|
]);
|
|
134
|
-
function
|
|
133
|
+
function Ne(e) {
|
|
135
134
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 58 || e === 95 || e === 8204 || e === 8205 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 767 || e >= 880 && e <= 893 || e >= 895 && e <= 8191 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
|
|
136
135
|
}
|
|
137
|
-
var
|
|
138
|
-
RegExp(`^[${
|
|
139
|
-
var
|
|
140
|
-
function
|
|
136
|
+
var Pe = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", Fe = `-${Pe}.0-9·̀-ͯ‿-⁀`;
|
|
137
|
+
RegExp(`^[${Pe}]$`, "u"), RegExp(`^[${Fe}]$`, "u"), RegExp(`^[${Pe}][${Fe}]*$`, "u"), RegExp(`^[${Fe}]+$`, "u");
|
|
138
|
+
var Ie = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", Le = `-${Ie}.0-9·̀-ͯ‿-⁀`, Re = (RegExp(`^[${Ie}]$`, "u"), RegExp(`^[${Le}]$`, "u"), RegExp(`^[${Ie}][${Le}]*$`, "u"));
|
|
139
|
+
function ze(e) {
|
|
141
140
|
return e >= 65 && e <= 90 || e === 95 || e >= 97 && e <= 122 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 767 || e >= 880 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
|
|
142
141
|
}
|
|
143
142
|
var G = function(e) {
|
|
144
143
|
return e === 32 || e === 10 || e === 13 || e === 9;
|
|
145
|
-
},
|
|
144
|
+
}, Be = function(e) {
|
|
146
145
|
return e >= 32 && e <= 55295 || e === 10 || e === 13 || e === 9 || e >= 57344 && e <= 65533 || e >= 65536 && e <= 1114111;
|
|
147
|
-
},
|
|
148
|
-
return
|
|
149
|
-
},
|
|
146
|
+
}, Ve = Ne, He = function(e) {
|
|
147
|
+
return Ne(e) || e >= 48 && e <= 57 || e === 45 || e === 46 || e === 183 || e >= 768 && e <= 879 || e >= 8255 && e <= 8256;
|
|
148
|
+
}, Ue = Me, We = je, Ge = function(e) {
|
|
150
149
|
return e >= 1 && e <= 55295 || e >= 57344 && e <= 65533 || e >= 65536 && e <= 1114111;
|
|
151
|
-
},
|
|
152
|
-
return
|
|
153
|
-
},
|
|
150
|
+
}, Ke = ze, qe = function(e) {
|
|
151
|
+
return ze(e) || e === 45 || e === 46 || e >= 48 && e <= 57 || e === 183 || e >= 768 && e <= 879 || e >= 8255 && e <= 8256;
|
|
152
|
+
}, Je = Re, Ye = "http://www.w3.org/XML/1998/namespace", K = "http://www.w3.org/2000/xmlns/", Xe = {
|
|
154
153
|
__proto__: null,
|
|
155
|
-
xml:
|
|
156
|
-
xmlns:
|
|
157
|
-
},
|
|
154
|
+
xml: Ye,
|
|
155
|
+
xmlns: K
|
|
156
|
+
}, Ze = {
|
|
158
157
|
__proto__: null,
|
|
159
158
|
amp: "&",
|
|
160
159
|
gt: ">",
|
|
161
160
|
lt: "<",
|
|
162
161
|
quot: "\"",
|
|
163
162
|
apos: "'"
|
|
164
|
-
},
|
|
165
|
-
...
|
|
163
|
+
}, q = -1, Qe = -2, J = 13, $e = 33, et = 10, tt = 60, nt = 61, Y = 62, X = 63, rt = 93, it = (e) => e === 34 || e === 39, at = [34, 39], ot = [
|
|
164
|
+
...at,
|
|
166
165
|
91,
|
|
167
|
-
|
|
168
|
-
],
|
|
169
|
-
...
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
],
|
|
173
|
-
|
|
166
|
+
Y
|
|
167
|
+
], st = [
|
|
168
|
+
...at,
|
|
169
|
+
tt,
|
|
170
|
+
rt
|
|
171
|
+
], ct = [
|
|
172
|
+
nt,
|
|
173
|
+
X,
|
|
174
|
+
...Ue
|
|
175
|
+
], lt = [
|
|
176
|
+
...Ue,
|
|
174
177
|
Y,
|
|
175
|
-
...Re
|
|
176
|
-
], at = [
|
|
177
|
-
...Re,
|
|
178
|
-
J,
|
|
179
178
|
38,
|
|
180
|
-
|
|
179
|
+
tt
|
|
181
180
|
];
|
|
182
|
-
function
|
|
181
|
+
function ut(e, t, n) {
|
|
183
182
|
switch (t) {
|
|
184
183
|
case "xml":
|
|
185
|
-
n !==
|
|
184
|
+
n !== Ye && e.fail(`xml prefix must be bound to ${Ye}.`);
|
|
186
185
|
break;
|
|
187
|
-
case "xmlns": n !==
|
|
186
|
+
case "xmlns": n !== K && e.fail(`xmlns prefix must be bound to ${K}.`);
|
|
188
187
|
}
|
|
189
188
|
switch (n) {
|
|
190
|
-
case
|
|
191
|
-
e.fail(t === "" ? `the default namespace may not be set to ${n}.` : `may not assign a prefix (even "xmlns") to the URI ${
|
|
189
|
+
case K:
|
|
190
|
+
e.fail(t === "" ? `the default namespace may not be set to ${n}.` : `may not assign a prefix (even "xmlns") to the URI ${K}.`);
|
|
192
191
|
break;
|
|
193
|
-
case
|
|
192
|
+
case Ye: switch (t) {
|
|
194
193
|
case "xml": break;
|
|
195
194
|
case "":
|
|
196
195
|
e.fail(`the default namespace may not be set to ${n}.`);
|
|
@@ -199,7 +198,7 @@ function ot(e, t, n) {
|
|
|
199
198
|
}
|
|
200
199
|
}
|
|
201
200
|
}
|
|
202
|
-
var
|
|
201
|
+
var dt, ft = (e) => Je.test(e), pt = (e) => We.test(e), mt = {
|
|
203
202
|
xmldecl: "xmlDeclHandler",
|
|
204
203
|
text: "textHandler",
|
|
205
204
|
processinginstruction: "piHandler",
|
|
@@ -213,7 +212,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
213
212
|
error: "errorHandler",
|
|
214
213
|
end: "endHandler",
|
|
215
214
|
ready: "readyHandler"
|
|
216
|
-
},
|
|
215
|
+
}, ht = class {
|
|
217
216
|
get closed() {
|
|
218
217
|
return this._closed;
|
|
219
218
|
}
|
|
@@ -221,15 +220,15 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
221
220
|
this.i = 0, this.prevI = 0, this.opt = e ?? {}, this.fragmentOpt = !!this.opt.fragment;
|
|
222
221
|
let t = this.xmlnsOpt = !!this.opt.xmlns;
|
|
223
222
|
if (this.trackPosition = !1 !== this.opt.position, this.fileName = this.opt.fileName, t) {
|
|
224
|
-
this.nameStartCheck =
|
|
223
|
+
this.nameStartCheck = Ke, this.nameCheck = qe, this.isName = ft, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
|
|
225
224
|
__proto__: null,
|
|
226
|
-
...
|
|
225
|
+
...Xe
|
|
227
226
|
};
|
|
228
227
|
let e = this.opt.additionalNamespaces;
|
|
229
228
|
e != null && (function(e, t) {
|
|
230
|
-
for (let n of Object.keys(t))
|
|
229
|
+
for (let n of Object.keys(t)) ut(e, n, t[n]);
|
|
231
230
|
}(this, e), Object.assign(this.ns, e));
|
|
232
|
-
} else this.nameStartCheck =
|
|
231
|
+
} else this.nameStartCheck = Ve, this.nameCheck = He, this.isName = pt, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
|
|
233
232
|
this.stateTable = [
|
|
234
233
|
this.sBegin,
|
|
235
234
|
this.sBeginWhitespace,
|
|
@@ -281,7 +280,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
281
280
|
_init() {
|
|
282
281
|
this.openWakaBang = "", this.text = "", this.name = "", this.piTarget = "", this.entity = "", this.q = null, this.tags = [], this.tag = null, this.topNS = null, this.chunk = "", this.chunkPosition = 0, this.i = 0, this.prevI = 0, this.carriedFromPrevious = void 0, this.forbiddenState = 0, this.attribList = [];
|
|
283
282
|
let { fragmentOpt: e } = this;
|
|
284
|
-
this.state = e ?
|
|
283
|
+
this.state = e ? J : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = e, this.xmlDeclPossible = !e, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
|
|
285
284
|
let { defaultXMLVersion: t } = this.opt;
|
|
286
285
|
if (t === void 0) {
|
|
287
286
|
if (!0 === this.opt.forceXMLVersion) throw Error("forceXMLVersion set but defaultXMLVersion is not set");
|
|
@@ -291,7 +290,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
291
290
|
version: void 0,
|
|
292
291
|
encoding: void 0,
|
|
293
292
|
standalone: void 0
|
|
294
|
-
}, this.line = 1, this.column = 0, this.ENTITIES = Object.create(
|
|
293
|
+
}, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Ze), this.readyHandler?.();
|
|
295
294
|
}
|
|
296
295
|
get position() {
|
|
297
296
|
return this.chunkPosition + this.i;
|
|
@@ -300,10 +299,10 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
300
299
|
return this.position - this.positionAtNewLine;
|
|
301
300
|
}
|
|
302
301
|
on(e, t) {
|
|
303
|
-
this[
|
|
302
|
+
this[mt[e]] = t;
|
|
304
303
|
}
|
|
305
304
|
off(e) {
|
|
306
|
-
this[
|
|
305
|
+
this[mt[e]] = void 0;
|
|
307
306
|
}
|
|
308
307
|
makeError(e) {
|
|
309
308
|
let t = this.fileName ?? "";
|
|
@@ -329,13 +328,13 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
329
328
|
}
|
|
330
329
|
getCode10() {
|
|
331
330
|
let e = this.chunk, t = this.i;
|
|
332
|
-
if (this.prevI = t, this.i++, t >= e.length) return
|
|
331
|
+
if (this.prevI = t, this.i++, t >= e.length) return q;
|
|
333
332
|
let n = e.charCodeAt(t);
|
|
334
333
|
if (this.column++, n < 55296) {
|
|
335
334
|
if (n >= 32 || n === 9) return n;
|
|
336
335
|
switch (n) {
|
|
337
|
-
case
|
|
338
|
-
case 13: return e.charCodeAt(t + 1) ===
|
|
336
|
+
case et: return this.line++, this.column = 0, this.positionAtNewLine = this.position, et;
|
|
337
|
+
case 13: return e.charCodeAt(t + 1) === et && (this.i = t + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, Qe;
|
|
339
338
|
default: return this.fail("disallowed character."), n;
|
|
340
339
|
}
|
|
341
340
|
}
|
|
@@ -345,18 +344,18 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
345
344
|
}
|
|
346
345
|
getCode11() {
|
|
347
346
|
let { chunk: e, i: t } = this;
|
|
348
|
-
if (this.prevI = t, this.i = t + 1, t >= e.length) return
|
|
347
|
+
if (this.prevI = t, this.i = t + 1, t >= e.length) return q;
|
|
349
348
|
let n = e.charCodeAt(t);
|
|
350
349
|
if (this.column++, n < 55296) {
|
|
351
350
|
if (n > 31 && n < 127 || n > 159 && n !== 8232 || n === 9) return n;
|
|
352
351
|
switch (n) {
|
|
353
|
-
case
|
|
352
|
+
case et: return this.line++, this.column = 0, this.positionAtNewLine = this.position, et;
|
|
354
353
|
case 13: {
|
|
355
354
|
let n = e.charCodeAt(t + 1);
|
|
356
|
-
n !==
|
|
355
|
+
n !== et && n !== 133 || (this.i = t + 2);
|
|
357
356
|
}
|
|
358
357
|
case 133:
|
|
359
|
-
case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position,
|
|
358
|
+
case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Qe;
|
|
360
359
|
default: return this.fail("disallowed character."), n;
|
|
361
360
|
}
|
|
362
361
|
}
|
|
@@ -366,7 +365,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
366
365
|
}
|
|
367
366
|
getCodeNorm() {
|
|
368
367
|
let e = this.getCode();
|
|
369
|
-
return e ===
|
|
368
|
+
return e === Qe ? et : e;
|
|
370
369
|
}
|
|
371
370
|
unGet() {
|
|
372
371
|
this.i = this.prevI, this.column--;
|
|
@@ -374,8 +373,8 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
374
373
|
captureTo(e) {
|
|
375
374
|
let { i: t } = this, { chunk: n } = this;
|
|
376
375
|
for (;;) {
|
|
377
|
-
let r = this.getCode(), i = r ===
|
|
378
|
-
if (a ===
|
|
376
|
+
let r = this.getCode(), i = r === Qe, a = i ? et : r;
|
|
377
|
+
if (a === q || e.includes(a)) return this.text += n.slice(t, this.prevI), a;
|
|
379
378
|
i && (this.text += `${n.slice(t, this.prevI)}\n`, t = this.i);
|
|
380
379
|
}
|
|
381
380
|
}
|
|
@@ -384,10 +383,10 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
384
383
|
for (;;) {
|
|
385
384
|
let r = this.getCode();
|
|
386
385
|
switch (r) {
|
|
387
|
-
case
|
|
388
|
-
this.text += `${n.slice(t, this.prevI)}\n`, t = this.i, r =
|
|
386
|
+
case Qe:
|
|
387
|
+
this.text += `${n.slice(t, this.prevI)}\n`, t = this.i, r = et;
|
|
389
388
|
break;
|
|
390
|
-
case
|
|
389
|
+
case q: return this.text += n.slice(t), !1;
|
|
391
390
|
}
|
|
392
391
|
if (r === e) return this.text += n.slice(t, this.prevI), !0;
|
|
393
392
|
}
|
|
@@ -396,18 +395,18 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
396
395
|
let { chunk: e, i: t } = this;
|
|
397
396
|
for (;;) {
|
|
398
397
|
let n = this.getCode();
|
|
399
|
-
if (n ===
|
|
400
|
-
if (!
|
|
398
|
+
if (n === q) return this.name += e.slice(t), q;
|
|
399
|
+
if (!He(n)) return this.name += e.slice(t, this.prevI), n === Qe ? et : n;
|
|
401
400
|
}
|
|
402
401
|
}
|
|
403
402
|
skipSpaces() {
|
|
404
403
|
for (;;) {
|
|
405
404
|
let e = this.getCodeNorm();
|
|
406
|
-
if (e ===
|
|
405
|
+
if (e === q || !G(e)) return e;
|
|
407
406
|
}
|
|
408
407
|
}
|
|
409
408
|
setXMLVersion(e) {
|
|
410
|
-
this.currentXMLVersion = e, e === "1.0" ? (this.isChar =
|
|
409
|
+
this.currentXMLVersion = e, e === "1.0" ? (this.isChar = Be, this.getCode = this.getCode10) : (this.isChar = Ge, this.getCode = this.getCode11);
|
|
411
410
|
}
|
|
412
411
|
sBegin() {
|
|
413
412
|
this.chunk.charCodeAt(0) === 65279 && (this.i++, this.column++), this.state = 1;
|
|
@@ -415,21 +414,21 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
415
414
|
sBeginWhitespace() {
|
|
416
415
|
let e = this.i, t = this.skipSpaces();
|
|
417
416
|
switch (this.prevI !== e && (this.xmlDeclPossible = !1), t) {
|
|
418
|
-
case
|
|
417
|
+
case tt:
|
|
419
418
|
if (this.state = 15, this.text.length !== 0) throw Error("no-empty text at start");
|
|
420
419
|
break;
|
|
421
|
-
case
|
|
422
|
-
default: this.unGet(), this.state =
|
|
420
|
+
case q: break;
|
|
421
|
+
default: this.unGet(), this.state = J, this.xmlDeclPossible = !1;
|
|
423
422
|
}
|
|
424
423
|
}
|
|
425
424
|
sDoctype() {
|
|
426
|
-
let e = this.captureTo(
|
|
425
|
+
let e = this.captureTo(ot);
|
|
427
426
|
switch (e) {
|
|
428
|
-
case
|
|
429
|
-
this.doctypeHandler?.(this.text), this.text = "", this.state =
|
|
427
|
+
case Y:
|
|
428
|
+
this.doctypeHandler?.(this.text), this.text = "", this.state = J, this.doctype = !0;
|
|
430
429
|
break;
|
|
431
|
-
case
|
|
432
|
-
default: this.text += String.fromCodePoint(e), e === 91 ? this.state = 4 :
|
|
430
|
+
case q: break;
|
|
431
|
+
default: this.text += String.fromCodePoint(e), e === 91 ? this.state = 4 : it(e) && (this.state = 3, this.q = e);
|
|
433
432
|
}
|
|
434
433
|
}
|
|
435
434
|
sDoctypeQuote() {
|
|
@@ -437,8 +436,8 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
437
436
|
this.captureToChar(e) && (this.text += String.fromCodePoint(e), this.q = null, this.state = 2);
|
|
438
437
|
}
|
|
439
438
|
sDTD() {
|
|
440
|
-
let e = this.captureTo(
|
|
441
|
-
e !==
|
|
439
|
+
let e = this.captureTo(st);
|
|
440
|
+
e !== q && (this.text += String.fromCodePoint(e), e === rt ? this.state = 2 : e === tt ? this.state = 6 : it(e) && (this.state = 5, this.q = e));
|
|
442
441
|
}
|
|
443
442
|
sDTDQuoted() {
|
|
444
443
|
let e = this.q;
|
|
@@ -450,7 +449,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
450
449
|
case 33:
|
|
451
450
|
this.state = 7, this.openWakaBang = "";
|
|
452
451
|
break;
|
|
453
|
-
case
|
|
452
|
+
case X:
|
|
454
453
|
this.state = 11;
|
|
455
454
|
break;
|
|
456
455
|
default: this.state = 4;
|
|
@@ -469,14 +468,14 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
469
468
|
}
|
|
470
469
|
sDTDCommentEnded() {
|
|
471
470
|
let e = this.getCodeNorm();
|
|
472
|
-
this.text += String.fromCodePoint(e), e ===
|
|
471
|
+
this.text += String.fromCodePoint(e), e === Y ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
|
|
473
472
|
}
|
|
474
473
|
sDTDPI() {
|
|
475
|
-
this.captureToChar(
|
|
474
|
+
this.captureToChar(X) && (this.text += "?", this.state = 12);
|
|
476
475
|
}
|
|
477
476
|
sDTDPIEnding() {
|
|
478
477
|
let e = this.getCodeNorm();
|
|
479
|
-
this.text += String.fromCodePoint(e), e ===
|
|
478
|
+
this.text += String.fromCodePoint(e), e === Y && (this.state = 4);
|
|
480
479
|
}
|
|
481
480
|
sText() {
|
|
482
481
|
this.tags.length === 0 ? this.handleTextOutsideRoot() : this.handleTextInRoot();
|
|
@@ -484,22 +483,22 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
484
483
|
sEntity() {
|
|
485
484
|
let { i: e } = this, { chunk: t } = this;
|
|
486
485
|
t: for (;;) switch (this.getCode()) {
|
|
487
|
-
case
|
|
486
|
+
case Qe:
|
|
488
487
|
this.entity += `${t.slice(e, this.prevI)}\n`, e = this.i;
|
|
489
488
|
break;
|
|
490
489
|
case 59: {
|
|
491
490
|
let { entityReturnState: n } = this, r = this.entity + t.slice(e, this.prevI), i;
|
|
492
|
-
this.state = n, r === "" ? (this.fail("empty entity name."), i = "&;") : (i = this.parseEntity(r), this.entity = ""), n ===
|
|
491
|
+
this.state = n, r === "" ? (this.fail("empty entity name."), i = "&;") : (i = this.parseEntity(r), this.entity = ""), n === J && this.textHandler === void 0 || (this.text += i);
|
|
493
492
|
break t;
|
|
494
493
|
}
|
|
495
|
-
case
|
|
494
|
+
case q:
|
|
496
495
|
this.entity += t.slice(e);
|
|
497
496
|
break t;
|
|
498
497
|
}
|
|
499
498
|
}
|
|
500
499
|
sOpenWaka() {
|
|
501
500
|
let e = this.getCode();
|
|
502
|
-
if (
|
|
501
|
+
if (Ve(e)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
|
|
503
502
|
else switch (e) {
|
|
504
503
|
case 47:
|
|
505
504
|
this.state = 43, this.xmlDeclPossible = !1;
|
|
@@ -507,10 +506,10 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
507
506
|
case 33:
|
|
508
507
|
this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
|
|
509
508
|
break;
|
|
510
|
-
case
|
|
509
|
+
case X:
|
|
511
510
|
this.state = 23;
|
|
512
511
|
break;
|
|
513
|
-
default: this.fail("disallowed character in tag name"), this.state =
|
|
512
|
+
default: this.fail("disallowed character in tag name"), this.state = J, this.xmlDeclPossible = !1;
|
|
514
513
|
}
|
|
515
514
|
}
|
|
516
515
|
sOpenWakaBang() {
|
|
@@ -536,22 +535,22 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
536
535
|
}
|
|
537
536
|
sCommentEnded() {
|
|
538
537
|
let e = this.getCodeNorm();
|
|
539
|
-
e ===
|
|
538
|
+
e === Y ? this.state = J : (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(e)}`, this.state = 17);
|
|
540
539
|
}
|
|
541
540
|
sCData() {
|
|
542
|
-
this.captureToChar(
|
|
541
|
+
this.captureToChar(rt) && (this.state = 21);
|
|
543
542
|
}
|
|
544
543
|
sCDataEnding() {
|
|
545
544
|
let e = this.getCodeNorm();
|
|
546
|
-
e ===
|
|
545
|
+
e === rt ? this.state = 22 : (this.text += `]${String.fromCodePoint(e)}`, this.state = 20);
|
|
547
546
|
}
|
|
548
547
|
sCDataEnding2() {
|
|
549
548
|
let e = this.getCodeNorm();
|
|
550
549
|
switch (e) {
|
|
551
|
-
case
|
|
552
|
-
this.cdataHandler?.(this.text), this.text = "", this.state =
|
|
550
|
+
case Y:
|
|
551
|
+
this.cdataHandler?.(this.text), this.text = "", this.state = J;
|
|
553
552
|
break;
|
|
554
|
-
case
|
|
553
|
+
case rt:
|
|
555
554
|
this.text += "]";
|
|
556
555
|
break;
|
|
557
556
|
default: this.text += `]]${String.fromCodePoint(e)}`, this.state = 20;
|
|
@@ -559,17 +558,17 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
559
558
|
}
|
|
560
559
|
sPIFirstChar() {
|
|
561
560
|
let e = this.getCodeNorm();
|
|
562
|
-
this.nameStartCheck(e) ? (this.piTarget += String.fromCodePoint(e), this.state = 24) : e ===
|
|
561
|
+
this.nameStartCheck(e) ? (this.piTarget += String.fromCodePoint(e), this.state = 24) : e === X || G(e) ? (this.fail("processing instruction without a target."), this.state = e === X ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(e), this.state = 24);
|
|
563
562
|
}
|
|
564
563
|
sPIRest() {
|
|
565
564
|
let { chunk: e, i: t } = this;
|
|
566
565
|
for (;;) {
|
|
567
566
|
let n = this.getCodeNorm();
|
|
568
|
-
if (n ===
|
|
567
|
+
if (n === q) return void (this.piTarget += e.slice(t));
|
|
569
568
|
if (!this.nameCheck(n)) {
|
|
570
569
|
this.piTarget += e.slice(t, this.prevI);
|
|
571
|
-
let r = n ===
|
|
572
|
-
r || G(n) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = r ?
|
|
570
|
+
let r = n === X;
|
|
571
|
+
r || G(n) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = r ? $e : 27) : this.state = r ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(n));
|
|
573
572
|
break;
|
|
574
573
|
}
|
|
575
574
|
}
|
|
@@ -577,28 +576,28 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
577
576
|
sPIBody() {
|
|
578
577
|
if (this.text.length === 0) {
|
|
579
578
|
let e = this.getCodeNorm();
|
|
580
|
-
e ===
|
|
581
|
-
} else this.captureToChar(
|
|
579
|
+
e === X ? this.state = 26 : G(e) || (this.text = String.fromCodePoint(e));
|
|
580
|
+
} else this.captureToChar(X) && (this.state = 26);
|
|
582
581
|
}
|
|
583
582
|
sPIEnding() {
|
|
584
583
|
let e = this.getCodeNorm();
|
|
585
|
-
if (e ===
|
|
584
|
+
if (e === Y) {
|
|
586
585
|
let { piTarget: e } = this;
|
|
587
586
|
e.toLowerCase() === "xml" && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({
|
|
588
587
|
target: e,
|
|
589
588
|
body: this.text
|
|
590
|
-
}), this.piTarget = this.text = "", this.state =
|
|
591
|
-
} else e ===
|
|
589
|
+
}), this.piTarget = this.text = "", this.state = J;
|
|
590
|
+
} else e === X ? this.text += "?" : (this.text += `?${String.fromCodePoint(e)}`, this.state = 25);
|
|
592
591
|
this.xmlDeclPossible = !1;
|
|
593
592
|
}
|
|
594
593
|
sXMLDeclNameStart() {
|
|
595
594
|
let e = this.skipSpaces();
|
|
596
|
-
e ===
|
|
595
|
+
e === X ? this.state = $e : e !== q && (this.state = 28, this.name = String.fromCodePoint(e));
|
|
597
596
|
}
|
|
598
597
|
sXMLDeclName() {
|
|
599
|
-
let e = this.captureTo(
|
|
600
|
-
if (e ===
|
|
601
|
-
if (G(e) || e ===
|
|
598
|
+
let e = this.captureTo(ct);
|
|
599
|
+
if (e === X) return this.state = $e, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
600
|
+
if (G(e) || e === nt) {
|
|
602
601
|
if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
|
|
603
602
|
case 0:
|
|
604
603
|
this.fail("did not expect any more name/value pairs.");
|
|
@@ -608,23 +607,23 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
608
607
|
break;
|
|
609
608
|
default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
|
|
610
609
|
}
|
|
611
|
-
this.state = e ===
|
|
610
|
+
this.state = e === nt ? 30 : 29;
|
|
612
611
|
}
|
|
613
612
|
}
|
|
614
613
|
sXMLDeclEq() {
|
|
615
614
|
let e = this.getCodeNorm();
|
|
616
|
-
if (e ===
|
|
617
|
-
G(e) || (e !==
|
|
615
|
+
if (e === X) return this.state = $e, void this.fail("XML declaration is incomplete.");
|
|
616
|
+
G(e) || (e !== nt && this.fail("value required."), this.state = 30);
|
|
618
617
|
}
|
|
619
618
|
sXMLDeclValueStart() {
|
|
620
619
|
let e = this.getCodeNorm();
|
|
621
|
-
if (e ===
|
|
622
|
-
G(e) || (
|
|
620
|
+
if (e === X) return this.state = $e, void this.fail("XML declaration is incomplete.");
|
|
621
|
+
G(e) || (it(e) ? this.q = e : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
|
|
623
622
|
}
|
|
624
623
|
sXMLDeclValue() {
|
|
625
|
-
let e = this.captureTo([this.q,
|
|
626
|
-
if (e ===
|
|
627
|
-
if (e ===
|
|
624
|
+
let e = this.captureTo([this.q, X]);
|
|
625
|
+
if (e === X) return this.state = $e, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
626
|
+
if (e === q) return;
|
|
628
627
|
let t = this.text;
|
|
629
628
|
switch (this.text = "", this.name) {
|
|
630
629
|
case "version": {
|
|
@@ -642,20 +641,20 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
642
641
|
}
|
|
643
642
|
sXMLDeclSeparator() {
|
|
644
643
|
let e = this.getCodeNorm();
|
|
645
|
-
e ===
|
|
644
|
+
e === X ? this.state = $e : (G(e) || (this.fail("whitespace required."), this.unGet()), this.state = 27);
|
|
646
645
|
}
|
|
647
646
|
sXMLDeclEnding() {
|
|
648
|
-
this.getCodeNorm() ===
|
|
647
|
+
this.getCodeNorm() === Y ? (this.piTarget === "xml" ? this.name !== "version" && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version.") : this.fail("processing instructions are not allowed before root."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = J) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
|
|
649
648
|
}
|
|
650
649
|
sOpenTag() {
|
|
651
650
|
let e = this.captureNameChars();
|
|
652
|
-
if (e ===
|
|
651
|
+
if (e === q) return;
|
|
653
652
|
let t = this.tag = {
|
|
654
653
|
name: this.name,
|
|
655
654
|
attributes: Object.create(null)
|
|
656
655
|
};
|
|
657
656
|
switch (this.name = "", this.xmlnsOpt && (this.topNS = t.ns = Object.create(null)), this.openTagStartHandler?.(t), this.sawRoot = !0, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), e) {
|
|
658
|
-
case
|
|
657
|
+
case Y:
|
|
659
658
|
this.openTag();
|
|
660
659
|
break;
|
|
661
660
|
case 47:
|
|
@@ -665,29 +664,29 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
665
664
|
}
|
|
666
665
|
}
|
|
667
666
|
sOpenTagSlash() {
|
|
668
|
-
this.getCode() ===
|
|
667
|
+
this.getCode() === Y ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
|
|
669
668
|
}
|
|
670
669
|
sAttrib() {
|
|
671
670
|
let e = this.skipSpaces();
|
|
672
|
-
e !==
|
|
671
|
+
e !== q && (Ve(e) ? (this.unGet(), this.state = 37) : e === Y ? this.openTag() : e === 47 ? this.state = 35 : this.fail("disallowed character in attribute name."));
|
|
673
672
|
}
|
|
674
673
|
sAttribName() {
|
|
675
674
|
let e = this.captureNameChars();
|
|
676
|
-
e ===
|
|
675
|
+
e === nt ? this.state = 39 : G(e) ? this.state = 38 : e === Y ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : e !== q && this.fail("disallowed character in attribute name.");
|
|
677
676
|
}
|
|
678
677
|
sAttribNameSawWhite() {
|
|
679
678
|
let e = this.skipSpaces();
|
|
680
679
|
switch (e) {
|
|
681
|
-
case
|
|
682
|
-
case
|
|
680
|
+
case q: return;
|
|
681
|
+
case nt:
|
|
683
682
|
this.state = 39;
|
|
684
683
|
break;
|
|
685
|
-
default: this.fail("attribute without value."), this.text = "", this.name = "", e ===
|
|
684
|
+
default: this.fail("attribute without value."), this.text = "", this.name = "", e === Y ? this.openTag() : Ve(e) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
|
|
686
685
|
}
|
|
687
686
|
}
|
|
688
687
|
sAttribValue() {
|
|
689
688
|
let e = this.getCodeNorm();
|
|
690
|
-
|
|
689
|
+
it(e) ? (this.q = e, this.state = 40) : G(e) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
|
|
691
690
|
}
|
|
692
691
|
sAttribValueQuoted() {
|
|
693
692
|
let { q: e, chunk: t } = this, { i: n } = this;
|
|
@@ -698,53 +697,53 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
698
697
|
case 38:
|
|
699
698
|
this.text += t.slice(n, this.prevI), this.state = 14, this.entityReturnState = 40;
|
|
700
699
|
return;
|
|
701
|
-
case
|
|
702
|
-
case
|
|
700
|
+
case et:
|
|
701
|
+
case Qe:
|
|
703
702
|
case 9:
|
|
704
703
|
this.text += `${t.slice(n, this.prevI)} `, n = this.i;
|
|
705
704
|
break;
|
|
706
|
-
case
|
|
705
|
+
case tt:
|
|
707
706
|
this.text += t.slice(n, this.prevI), this.fail("disallowed character.");
|
|
708
707
|
return;
|
|
709
|
-
case
|
|
708
|
+
case q:
|
|
710
709
|
this.text += t.slice(n);
|
|
711
710
|
return;
|
|
712
711
|
}
|
|
713
712
|
}
|
|
714
713
|
sAttribValueClosed() {
|
|
715
714
|
let e = this.getCodeNorm();
|
|
716
|
-
G(e) ? this.state = 36 : e ===
|
|
715
|
+
G(e) ? this.state = 36 : e === Y ? this.openTag() : e === 47 ? this.state = 35 : Ve(e) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
|
|
717
716
|
}
|
|
718
717
|
sAttribValueUnquoted() {
|
|
719
|
-
let e = this.captureTo(
|
|
718
|
+
let e = this.captureTo(lt);
|
|
720
719
|
switch (e) {
|
|
721
720
|
case 38:
|
|
722
721
|
this.state = 14, this.entityReturnState = 42;
|
|
723
722
|
break;
|
|
724
|
-
case
|
|
723
|
+
case tt:
|
|
725
724
|
this.fail("disallowed character.");
|
|
726
725
|
break;
|
|
727
|
-
case
|
|
728
|
-
default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", e ===
|
|
726
|
+
case q: break;
|
|
727
|
+
default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", e === Y ? this.openTag() : this.state = 36;
|
|
729
728
|
}
|
|
730
729
|
}
|
|
731
730
|
sCloseTag() {
|
|
732
731
|
let e = this.captureNameChars();
|
|
733
|
-
e ===
|
|
732
|
+
e === Y ? this.closeTag() : G(e) ? this.state = 44 : e !== q && this.fail("disallowed character in closing tag.");
|
|
734
733
|
}
|
|
735
734
|
sCloseTagSawWhite() {
|
|
736
735
|
switch (this.skipSpaces()) {
|
|
737
|
-
case
|
|
736
|
+
case Y:
|
|
738
737
|
this.closeTag();
|
|
739
738
|
break;
|
|
740
|
-
case
|
|
739
|
+
case q: break;
|
|
741
740
|
default: this.fail("disallowed character in closing tag.");
|
|
742
741
|
}
|
|
743
742
|
}
|
|
744
743
|
handleTextInRoot() {
|
|
745
744
|
let { i: e, forbiddenState: t } = this, { chunk: n, textHandler: r } = this;
|
|
746
745
|
t: for (;;) switch (this.getCode()) {
|
|
747
|
-
case
|
|
746
|
+
case tt:
|
|
748
747
|
if (this.state = 15, r !== void 0) {
|
|
749
748
|
let { text: t } = this, i = n.slice(e, this.prevI);
|
|
750
749
|
t.length === 0 ? i.length !== 0 && r(i) : (r(t + i), this.text = "");
|
|
@@ -752,9 +751,9 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
752
751
|
t = 0;
|
|
753
752
|
break t;
|
|
754
753
|
case 38:
|
|
755
|
-
this.state = 14, this.entityReturnState =
|
|
754
|
+
this.state = 14, this.entityReturnState = J, r !== void 0 && (this.text += n.slice(e, this.prevI)), t = 0;
|
|
756
755
|
break t;
|
|
757
|
-
case
|
|
756
|
+
case rt:
|
|
758
757
|
switch (t) {
|
|
759
758
|
case 0:
|
|
760
759
|
t = 1;
|
|
@@ -766,13 +765,13 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
766
765
|
default: throw Error("impossible state");
|
|
767
766
|
}
|
|
768
767
|
break;
|
|
769
|
-
case
|
|
768
|
+
case Y:
|
|
770
769
|
t === 2 && this.fail("the string \"]]>\" is disallowed in char data."), t = 0;
|
|
771
770
|
break;
|
|
772
|
-
case
|
|
771
|
+
case Qe:
|
|
773
772
|
r !== void 0 && (this.text += `${n.slice(e, this.prevI)}\n`), e = this.i, t = 0;
|
|
774
773
|
break;
|
|
775
|
-
case
|
|
774
|
+
case q:
|
|
776
775
|
r !== void 0 && (this.text += n.slice(e));
|
|
777
776
|
break t;
|
|
778
777
|
default: t = 0;
|
|
@@ -784,19 +783,19 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
784
783
|
t: for (;;) {
|
|
785
784
|
let i = this.getCode();
|
|
786
785
|
switch (i) {
|
|
787
|
-
case
|
|
786
|
+
case tt:
|
|
788
787
|
if (this.state = 15, n !== void 0) {
|
|
789
788
|
let { text: r } = this, i = t.slice(e, this.prevI);
|
|
790
789
|
r.length === 0 ? i.length !== 0 && n(i) : (n(r + i), this.text = "");
|
|
791
790
|
}
|
|
792
791
|
break t;
|
|
793
792
|
case 38:
|
|
794
|
-
this.state = 14, this.entityReturnState =
|
|
793
|
+
this.state = 14, this.entityReturnState = J, n !== void 0 && (this.text += t.slice(e, this.prevI)), r = !0;
|
|
795
794
|
break t;
|
|
796
|
-
case
|
|
795
|
+
case Qe:
|
|
797
796
|
n !== void 0 && (this.text += `${t.slice(e, this.prevI)}\n`), e = this.i;
|
|
798
797
|
break;
|
|
799
|
-
case
|
|
798
|
+
case q:
|
|
800
799
|
n !== void 0 && (this.text += t.slice(e));
|
|
801
800
|
break t;
|
|
802
801
|
default: G(i) || (r = !0);
|
|
@@ -813,10 +812,10 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
813
812
|
};
|
|
814
813
|
if (this.attribList.push(i), this.attributeHandler?.(i), n === "xmlns") {
|
|
815
814
|
let e = t.trim();
|
|
816
|
-
this.currentXMLVersion === "1.0" && e === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[r] = e,
|
|
815
|
+
this.currentXMLVersion === "1.0" && e === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[r] = e, ut(this, r, e);
|
|
817
816
|
} else if (e === "xmlns") {
|
|
818
817
|
let e = t.trim();
|
|
819
|
-
this.topNS[""] = e,
|
|
818
|
+
this.topNS[""] = e, ut(this, "", e);
|
|
820
819
|
}
|
|
821
820
|
}
|
|
822
821
|
pushAttribPlain(e, t) {
|
|
@@ -833,7 +832,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
833
832
|
let t = e.pop();
|
|
834
833
|
this.fail(`unclosed tag: ${t.name}`);
|
|
835
834
|
}
|
|
836
|
-
this.state !== 0 && this.state !==
|
|
835
|
+
this.state !== 0 && this.state !== J && this.fail("unexpected end.");
|
|
837
836
|
let { text: t } = this;
|
|
838
837
|
return t.length !== 0 && (this.textHandler?.(t), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
|
|
839
838
|
}
|
|
@@ -868,7 +867,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
868
867
|
let { attributes: n } = t, r = /* @__PURE__ */ new Set();
|
|
869
868
|
for (let t of e) {
|
|
870
869
|
let { name: e, prefix: i, local: a } = t, o, s;
|
|
871
|
-
i === "" ? (o = e === "xmlns" ?
|
|
870
|
+
i === "" ? (o = e === "xmlns" ? K : "", s = e) : (o = this.resolve(i), o === void 0 && (this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`), o = i), s = `{${o}}${a}`), r.has(s) && this.fail(`duplicate attribute: ${s}.`), r.add(s), t.uri = o, n[e] = t;
|
|
872
871
|
}
|
|
873
872
|
this.attribList = [];
|
|
874
873
|
}
|
|
@@ -880,16 +879,16 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
880
879
|
openTag() {
|
|
881
880
|
this.processAttribs();
|
|
882
881
|
let { tags: e } = this, t = this.tag;
|
|
883
|
-
t.isSelfClosing = !1, this.openTagHandler?.(t), e.push(t), this.state =
|
|
882
|
+
t.isSelfClosing = !1, this.openTagHandler?.(t), e.push(t), this.state = J, this.name = "";
|
|
884
883
|
}
|
|
885
884
|
openSelfClosingTag() {
|
|
886
885
|
this.processAttribs();
|
|
887
886
|
let { tags: e } = this, t = this.tag;
|
|
888
|
-
t.isSelfClosing = !0, this.openTagHandler?.(t), this.closeTagHandler?.(t), (this.tag = e[e.length - 1] ?? null) === null && (this.closedRoot = !0), this.state =
|
|
887
|
+
t.isSelfClosing = !0, this.openTagHandler?.(t), this.closeTagHandler?.(t), (this.tag = e[e.length - 1] ?? null) === null && (this.closedRoot = !0), this.state = J, this.name = "";
|
|
889
888
|
}
|
|
890
889
|
closeTag() {
|
|
891
890
|
let { tags: e, name: t } = this;
|
|
892
|
-
if (this.state =
|
|
891
|
+
if (this.state = J, this.name = "", t === "") return this.fail("weird empty close tag."), void (this.text += "</>");
|
|
893
892
|
let n = this.closeTagHandler, r = e.length;
|
|
894
893
|
for (; r-- > 0;) {
|
|
895
894
|
let r = this.tag = e.pop();
|
|
@@ -906,21 +905,21 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
906
905
|
let t = NaN;
|
|
907
906
|
return e[1] === "x" && /^#x[0-9a-f]+$/i.test(e) ? t = parseInt(e.slice(2), 16) : /^#[0-9]+$/.test(e) && (t = parseInt(e.slice(1), 10)), this.isChar(t) ? String.fromCodePoint(t) : (this.fail("malformed character entity."), `&${e};`);
|
|
908
907
|
}
|
|
909
|
-
},
|
|
908
|
+
}, gt = /&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, _t = {
|
|
910
909
|
amp: "&",
|
|
911
910
|
lt: "<",
|
|
912
911
|
gt: ">",
|
|
913
912
|
quot: "\"",
|
|
914
913
|
apos: "'"
|
|
915
|
-
},
|
|
916
|
-
let n =
|
|
914
|
+
}, vt = (e, t) => {
|
|
915
|
+
let n = _t[t];
|
|
917
916
|
if (n !== void 0) return n;
|
|
918
917
|
let r = t.charCodeAt(1) === 120 ? parseInt(t.slice(2), 16) : parseInt(t.slice(1), 10);
|
|
919
918
|
return r > 0 && r <= 1114111 ? String.fromCodePoint(r) : e;
|
|
920
|
-
},
|
|
919
|
+
}, yt = (e) => {
|
|
921
920
|
let t = e;
|
|
922
|
-
return t.indexOf("\r") !== -1 && (t = t.replace(/\r\n?/g, "\n")), t.indexOf("&") !== -1 && (t = t.replace(
|
|
923
|
-
},
|
|
921
|
+
return t.indexOf("\r") !== -1 && (t = t.replace(/\r\n?/g, "\n")), t.indexOf("&") !== -1 && (t = t.replace(gt, vt)), t;
|
|
922
|
+
}, bt = (e) => {
|
|
924
923
|
let t = e, n = t.length;
|
|
925
924
|
for (let e = 0; e < n; e++) {
|
|
926
925
|
let n = t.charCodeAt(e);
|
|
@@ -929,8 +928,8 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
929
928
|
break;
|
|
930
929
|
}
|
|
931
930
|
}
|
|
932
|
-
return t.indexOf("&") !== -1 && (t = t.replace(
|
|
933
|
-
},
|
|
931
|
+
return t.indexOf("&") !== -1 && (t = t.replace(gt, vt)), t;
|
|
932
|
+
}, xt = (e) => e === 32 || e === 9 || e === 10 || e === 13, St = class e {
|
|
934
933
|
constructor() {
|
|
935
934
|
this._openTagHandler = void 0, this._closeTagHandler = void 0, this._textHandler = void 0, this._cdataHandler = void 0, this._errorHandler = void 0, this._endHandler = void 0, this._scanners = null, this._carry = "", this._text = "", this._tags = [], this._sawRoot = !1, this._closed = !1;
|
|
936
935
|
}
|
|
@@ -941,7 +940,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
941
940
|
this.NOT_HANDLED = -2;
|
|
942
941
|
}
|
|
943
942
|
static decodeText(e) {
|
|
944
|
-
return
|
|
943
|
+
return yt(e);
|
|
945
944
|
}
|
|
946
945
|
on(e, t) {
|
|
947
946
|
switch (e) {
|
|
@@ -1007,7 +1006,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
1007
1006
|
if (e.length === 0) return;
|
|
1008
1007
|
this._text = "";
|
|
1009
1008
|
let t = this._textHandler;
|
|
1010
|
-
t !== void 0 && this._tags.length !== 0 && t(
|
|
1009
|
+
t !== void 0 && this._tags.length !== 0 && t(yt(e));
|
|
1011
1010
|
}
|
|
1012
1011
|
_markup(t, n, r) {
|
|
1013
1012
|
if (n + 1 >= r) return -1;
|
|
@@ -1046,7 +1045,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
1046
1045
|
let i = n + 1 + o.name.length;
|
|
1047
1046
|
if (i >= r) return -1;
|
|
1048
1047
|
let a = t.charCodeAt(i);
|
|
1049
|
-
if (a === 62 || a === 47 ||
|
|
1048
|
+
if (a === 62 || a === 47 || xt(a)) {
|
|
1050
1049
|
this._flushText();
|
|
1051
1050
|
let i = o.scan(t, n, r);
|
|
1052
1051
|
if (i !== e.NOT_HANDLED) {
|
|
@@ -1064,11 +1063,11 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
1064
1063
|
}
|
|
1065
1064
|
_openTag(e, t, n) {
|
|
1066
1065
|
let r = t + 1, i = 0;
|
|
1067
|
-
for (; r < n && (i = e.charCodeAt(r), i !== 62 && i !== 47 && !
|
|
1066
|
+
for (; r < n && (i = e.charCodeAt(r), i !== 62 && i !== 47 && !xt(i));) r++;
|
|
1068
1067
|
if (r >= n) return -1;
|
|
1069
1068
|
let a = e.slice(t + 1, r), o = {}, s = !1;
|
|
1070
1069
|
for (;;) {
|
|
1071
|
-
for (; r < n &&
|
|
1070
|
+
for (; r < n && xt(i = e.charCodeAt(r));) r++;
|
|
1072
1071
|
if (r >= n) return -1;
|
|
1073
1072
|
if (i === 62) {
|
|
1074
1073
|
r++;
|
|
@@ -1084,16 +1083,16 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
1084
1083
|
break;
|
|
1085
1084
|
}
|
|
1086
1085
|
let t = r;
|
|
1087
|
-
for (; r < n && (i = e.charCodeAt(r), i !== 61 && i !== 62 && i !== 47 && !
|
|
1086
|
+
for (; r < n && (i = e.charCodeAt(r), i !== 61 && i !== 62 && i !== 47 && !xt(i));) r++;
|
|
1088
1087
|
if (r >= n) return -1;
|
|
1089
1088
|
let a = e.slice(t, r);
|
|
1090
|
-
for (; r < n &&
|
|
1089
|
+
for (; r < n && xt(i = e.charCodeAt(r));) r++;
|
|
1091
1090
|
if (r >= n) return -1;
|
|
1092
1091
|
if (i !== 61) {
|
|
1093
1092
|
this.fail("attribute without value.");
|
|
1094
1093
|
continue;
|
|
1095
1094
|
}
|
|
1096
|
-
for (r++; r < n &&
|
|
1095
|
+
for (r++; r < n && xt(i = e.charCodeAt(r));) r++;
|
|
1097
1096
|
if (r >= n) return -1;
|
|
1098
1097
|
if (i !== 34 && i !== 39) {
|
|
1099
1098
|
this.fail("unquoted attribute value.");
|
|
@@ -1101,7 +1100,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
1101
1100
|
}
|
|
1102
1101
|
let c = e.indexOf(i === 34 ? "\"" : "'", r + 1);
|
|
1103
1102
|
if (c === -1) return -1;
|
|
1104
|
-
a !== "__proto__" && (o[a] =
|
|
1103
|
+
a !== "__proto__" && (o[a] = bt(e.slice(r + 1, c))), r = c + 1;
|
|
1105
1104
|
}
|
|
1106
1105
|
this._flushText(), this._sawRoot = !0;
|
|
1107
1106
|
let c = {
|
|
@@ -1139,7 +1138,7 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
1139
1138
|
Ready: "ready"
|
|
1140
1139
|
}, e.parseStream = async (e, t, n) => {
|
|
1141
1140
|
if (n?.lean) return (async (e, t) => {
|
|
1142
|
-
let n = new
|
|
1141
|
+
let n = new St(), r;
|
|
1143
1142
|
t.elementScanners && n.setElementScanners(t.elementScanners), t.onOpenTag && n.on("opentag", t.onOpenTag), t.onCloseTag && n.on("closetag", t.onCloseTag), t.onText && n.on("text", t.onText), t.onError && n.on("error", t.onError);
|
|
1144
1143
|
let i = t.onEnd;
|
|
1145
1144
|
for (i && n.on("end", () => {
|
|
@@ -1151,13 +1150,13 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
1151
1150
|
}
|
|
1152
1151
|
return n.close(), r;
|
|
1153
1152
|
})(e, t);
|
|
1154
|
-
let r = new
|
|
1153
|
+
let r = new ht({
|
|
1155
1154
|
position: !1,
|
|
1156
1155
|
...n
|
|
1157
1156
|
}), i;
|
|
1158
|
-
t.onOpenTagStart && r.on(
|
|
1157
|
+
t.onOpenTagStart && r.on(dt.Events.OpenTagStart, t.onOpenTagStart), t.onOpenTag && r.on(dt.Events.OpenTag, t.onOpenTag), t.onCloseTag && r.on(dt.Events.CloseTag, t.onCloseTag), t.onAttribute && r.on(dt.Events.Attribute, t.onAttribute), t.onText && r.on(dt.Events.Text, t.onText), t.onError && r.on(dt.Events.Error, t.onError);
|
|
1159
1158
|
let a = t.onEnd;
|
|
1160
|
-
for (a && r.on(
|
|
1159
|
+
for (a && r.on(dt.Events.End, () => {
|
|
1161
1160
|
i = a();
|
|
1162
1161
|
});;) {
|
|
1163
1162
|
let { value: t, done: n } = await e.read();
|
|
@@ -1166,14 +1165,14 @@ var st, ct = (e) => Ue.test(e), lt = (e) => ze.test(e), ut = {
|
|
|
1166
1165
|
}
|
|
1167
1166
|
return r.close(), i;
|
|
1168
1167
|
};
|
|
1169
|
-
})(
|
|
1170
|
-
var
|
|
1168
|
+
})(dt ||= {});
|
|
1169
|
+
var Z = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null, Q = (e) => {
|
|
1171
1170
|
let t = parseInt(e);
|
|
1172
1171
|
return isNaN(t) ? null : t;
|
|
1173
|
-
},
|
|
1172
|
+
}, Ct = (e) => {
|
|
1174
1173
|
let t = parseFloat(e);
|
|
1175
1174
|
return isNaN(t) ? null : t;
|
|
1176
|
-
}, $ = null,
|
|
1175
|
+
}, $ = null, wt = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), Tt = (e) => wt(e).replace(/"/g, """), Et = class {
|
|
1177
1176
|
constructor() {
|
|
1178
1177
|
this._registeredVisitors = /* @__PURE__ */ new Map();
|
|
1179
1178
|
}
|
|
@@ -1185,7 +1184,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1185
1184
|
key: null,
|
|
1186
1185
|
source: e,
|
|
1187
1186
|
parent: null
|
|
1188
|
-
}, f = null, p = !1, m = null,
|
|
1187
|
+
}, f = null, p = !1, m = null, h = null, g = null, _ = (e, t) => {
|
|
1189
1188
|
let n = c.attributes[e];
|
|
1190
1189
|
if (t) {
|
|
1191
1190
|
if (Array.isArray(t)) {
|
|
@@ -1194,7 +1193,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1194
1193
|
} else if (n == null || (n = t(n), n == null)) return;
|
|
1195
1194
|
}
|
|
1196
1195
|
return n;
|
|
1197
|
-
},
|
|
1196
|
+
}, v = {
|
|
1198
1197
|
getSource: () => f?.source ?? null,
|
|
1199
1198
|
setSource: (e) => {
|
|
1200
1199
|
f.source = e;
|
|
@@ -1203,8 +1202,8 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1203
1202
|
f.key = e;
|
|
1204
1203
|
},
|
|
1205
1204
|
getFrom: () => c,
|
|
1206
|
-
getAttribute: (e, t) =>
|
|
1207
|
-
hasAttribute: (e) =>
|
|
1205
|
+
getAttribute: (e, t) => _(e, t) ?? null,
|
|
1206
|
+
hasAttribute: (e) => v.getAttribute(e) !== null,
|
|
1208
1207
|
getParent: () => {
|
|
1209
1208
|
let e = u[u.length - 2];
|
|
1210
1209
|
return e.parent ?? e.source;
|
|
@@ -1214,14 +1213,14 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1214
1213
|
for (let n = 0; n < t; n++) e.push(a[n].local);
|
|
1215
1214
|
return e.join("\\");
|
|
1216
1215
|
},
|
|
1217
|
-
parseAttribute:
|
|
1218
|
-
getRawXml: () =>
|
|
1216
|
+
parseAttribute: _,
|
|
1217
|
+
getRawXml: () => g,
|
|
1219
1218
|
copyToObject: (e, t, n, r) => {
|
|
1220
|
-
let i =
|
|
1219
|
+
let i = _(r ?? t, n);
|
|
1221
1220
|
i !== void 0 && (e[t] = i);
|
|
1222
1221
|
},
|
|
1223
1222
|
copyTo: (e, t, n) => {
|
|
1224
|
-
let r =
|
|
1223
|
+
let r = _(n ?? e, t);
|
|
1225
1224
|
r !== void 0 && (f.source[e] = r);
|
|
1226
1225
|
},
|
|
1227
1226
|
warn: (e, t) => {
|
|
@@ -1235,7 +1234,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1235
1234
|
let t = e.attributes ?? {}, n = `<${e.name}`;
|
|
1236
1235
|
for (let e in t) {
|
|
1237
1236
|
let r = t[e];
|
|
1238
|
-
n += ` ${e}="${
|
|
1237
|
+
n += ` ${e}="${Tt(typeof r == "string" ? r : r?.value ?? "")}"`;
|
|
1239
1238
|
}
|
|
1240
1239
|
return n + ">";
|
|
1241
1240
|
})(e)), o = {
|
|
@@ -1243,53 +1242,53 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1243
1242
|
tag: e,
|
|
1244
1243
|
destination: null
|
|
1245
1244
|
}, a.push(o), s = t, void (c = e);
|
|
1246
|
-
let
|
|
1245
|
+
let g = (i.length > 0 ? i[i.length - 1] : r).get(t);
|
|
1247
1246
|
if (o = {
|
|
1248
1247
|
local: t,
|
|
1249
|
-
visitor:
|
|
1248
|
+
visitor: g,
|
|
1250
1249
|
tag: e,
|
|
1251
1250
|
destination: null
|
|
1252
1251
|
}, p) return a.push(o), s = t, void (c = e);
|
|
1253
1252
|
l = o?.visitor ?? null, s = t, c = e;
|
|
1254
|
-
let
|
|
1255
|
-
if (
|
|
1256
|
-
let e =
|
|
1257
|
-
e === null ?
|
|
1253
|
+
let _ = !!g && g.to === null;
|
|
1254
|
+
if (g && !_ && g.scope) {
|
|
1255
|
+
let e = g.scope(v);
|
|
1256
|
+
e === null ? _ = !0 : e && (i.push(e), o.pushedScope = !0);
|
|
1258
1257
|
}
|
|
1259
|
-
|
|
1258
|
+
g && (a.length === 0 ? (f = d, o.destination = f, o.pushedDestination = !0, u.push(f)) : _ ? (f = null, o.destination = null) : g.transparent ? o.destination = f : (f = {
|
|
1260
1259
|
key: null,
|
|
1261
1260
|
source: {},
|
|
1262
1261
|
parent: null
|
|
1263
|
-
}, o.destination = f, o.pushedDestination = !0, u.push(f))), a.push(o), p =
|
|
1264
|
-
let
|
|
1265
|
-
|
|
1262
|
+
}, o.destination = f, o.pushedDestination = !0, u.push(f))), a.push(o), p = _;
|
|
1263
|
+
let ee = l?.openTag?.(v);
|
|
1264
|
+
ee !== void 0 && (f.parent = ee), g?.raw && !_ && (m = [], h = o);
|
|
1266
1265
|
},
|
|
1267
1266
|
onCloseTag: (e) => {
|
|
1268
1267
|
let t = e.name, r = t.indexOf(":");
|
|
1269
1268
|
if (r !== -1 && (t = t.slice(r + 1)), t !== s) throw Error(`mismatch open/close tag: '${t}'/'${s}'`);
|
|
1270
|
-
let
|
|
1269
|
+
let _ = !1;
|
|
1271
1270
|
if (m) {
|
|
1272
|
-
if (a[a.length - 1] !==
|
|
1273
|
-
|
|
1271
|
+
if (a[a.length - 1] !== h) return m.push(`</${e.name}>`), a.pop(), o = a[a.length - 1] ?? null, s = o?.local ?? null, void (c = o?.tag ?? null);
|
|
1272
|
+
g = m.join(""), m = null, h = null, _ = !0;
|
|
1274
1273
|
}
|
|
1275
|
-
p || l?.closeTag?.(
|
|
1276
|
-
let
|
|
1277
|
-
o = a[a.length - 1] ?? null,
|
|
1278
|
-
let y =
|
|
1279
|
-
if (y &&
|
|
1274
|
+
p || l?.closeTag?.(v), _ && (g = null);
|
|
1275
|
+
let ee = a.pop() ?? null;
|
|
1276
|
+
o = a[a.length - 1] ?? null, ee?.pushedScope && i.pop();
|
|
1277
|
+
let y = ee?.destination;
|
|
1278
|
+
if (y && ee.pushedDestination) {
|
|
1280
1279
|
u.pop(), f = u[u.length - 1] ?? d;
|
|
1281
|
-
let e =
|
|
1282
|
-
e && e.to && y.source !== void 0 && (Array.isArray(e.to) ? f.source.push ? f.source.push(y.source) : n?.(`Unable to parse array for ${e.from} at ${
|
|
1280
|
+
let e = ee.visitor;
|
|
1281
|
+
e && e.to && y.source !== void 0 && (Array.isArray(e.to) ? f.source.push ? f.source.push(y.source) : n?.(`Unable to parse array for ${e.from} at ${v.getPath()}`) : y.key ? f.source[y.key] = y.source : typeof e.to == "string" && (f.source[e.to] = y.source));
|
|
1283
1282
|
} else y || (f = u[u.length - 1] ?? d);
|
|
1284
1283
|
s = o?.local ?? null, c = o?.tag ?? null, l = o?.visitor ?? null, p = !o?.destination;
|
|
1285
1284
|
},
|
|
1286
1285
|
onText: (e) => {
|
|
1287
|
-
m ? m.push(
|
|
1286
|
+
m ? m.push(wt(e)) : l?.text?.(e, v);
|
|
1288
1287
|
},
|
|
1289
1288
|
onEnd: t
|
|
1290
1289
|
};
|
|
1291
1290
|
}
|
|
1292
|
-
},
|
|
1291
|
+
}, Dt = `IFERROR(${T}(`, Ot = Dt.toUpperCase(), kt = ae.toUpperCase(), At = { kind: "none" }, jt = { kind: "spilled" }, Mt = (e, t) => {
|
|
1293
1292
|
if (e.charCodeAt(t) !== 34) return null;
|
|
1294
1293
|
let n = "", r = t + 1;
|
|
1295
1294
|
for (; r < e.length;) if (e.charCodeAt(r) === 34) {
|
|
@@ -1300,12 +1299,12 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1300
1299
|
n += "\"", r += 2;
|
|
1301
1300
|
} else n += e[r], r++;
|
|
1302
1301
|
return null;
|
|
1303
|
-
},
|
|
1302
|
+
}, Nt = (e) => {
|
|
1304
1303
|
let t = [], n = 0;
|
|
1305
1304
|
for (; n < e.length;) {
|
|
1306
1305
|
let r = e.charCodeAt(n);
|
|
1307
1306
|
if (r === 34) {
|
|
1308
|
-
let t =
|
|
1307
|
+
let t = Mt(e, n);
|
|
1309
1308
|
if (t === null) break;
|
|
1310
1309
|
n = t.end;
|
|
1311
1310
|
continue;
|
|
@@ -1323,7 +1322,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1323
1322
|
e.charCodeAt(i) === 40 && t.push(e.slice(n, i).toUpperCase().replace(/^_XLFN\./, "").replace(/^_XLWS\./, "")), n = i;
|
|
1324
1323
|
}
|
|
1325
1324
|
return t;
|
|
1326
|
-
},
|
|
1325
|
+
}, Pt = (e) => {
|
|
1327
1326
|
let t = (t) => {
|
|
1328
1327
|
if (e) return RegExp(`<(?:[\\w.-]+:)?${t}\\b[^>]*>([^<]*)<`).exec(e)?.[1];
|
|
1329
1328
|
}, n = (e) => {
|
|
@@ -1333,16 +1332,16 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1333
1332
|
return {
|
|
1334
1333
|
c: n(t("col")),
|
|
1335
1334
|
r: n(t("row")),
|
|
1336
|
-
x:
|
|
1337
|
-
y:
|
|
1335
|
+
x: O(t("colOff") ?? "0") ?? 0,
|
|
1336
|
+
y: O(t("rowOff") ?? "0") ?? 0
|
|
1338
1337
|
};
|
|
1339
|
-
},
|
|
1340
|
-
let
|
|
1341
|
-
|
|
1338
|
+
}, Ft = "formulaDialect", It = (e, n, r, i, a, l, f, m) => {
|
|
1339
|
+
let b = new Et(), re = m?.get("parseInlineDxf"), ae = m?.get(Ft), oe = (e) => ae && e ? ae.readDetached(e) : e, S = new Ee.TransposedBuilder(), w = null;
|
|
1340
|
+
b.registerVisitor({
|
|
1342
1341
|
from: "autoFilter",
|
|
1343
1342
|
to: "autoTable",
|
|
1344
1343
|
openTag: (e) => {
|
|
1345
|
-
let t = e.getAttribute("ref"), n =
|
|
1344
|
+
let t = e.getAttribute("ref"), n = ye.fastStringToRange(t);
|
|
1346
1345
|
e.getSource().r = n, e.getSource().v = {};
|
|
1347
1346
|
},
|
|
1348
1347
|
closeTag: (e) => {
|
|
@@ -1352,7 +1351,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1352
1351
|
e === 0 ? n.hiddenButtons = !1 : e === a && (n.hiddenButtons = !0);
|
|
1353
1352
|
}
|
|
1354
1353
|
}
|
|
1355
|
-
}),
|
|
1354
|
+
}), b.registerVisitor({
|
|
1356
1355
|
from: "conditionalFormatting",
|
|
1357
1356
|
to: {},
|
|
1358
1357
|
openTag: (e) => {
|
|
@@ -1363,10 +1362,10 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1363
1362
|
let r = {
|
|
1364
1363
|
r: n,
|
|
1365
1364
|
conditionals: t.conditionals
|
|
1366
|
-
}, i = e.getAttribute("pivot",
|
|
1365
|
+
}, i = e.getAttribute("pivot", Z);
|
|
1367
1366
|
i !== null && (r.pivot = i), e.setSource(r);
|
|
1368
1367
|
}
|
|
1369
|
-
}),
|
|
1368
|
+
}), b.registerVisitor({
|
|
1370
1369
|
from: "cfRule",
|
|
1371
1370
|
to: {},
|
|
1372
1371
|
openTag: (e) => {
|
|
@@ -1377,24 +1376,24 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1377
1376
|
r: t.r,
|
|
1378
1377
|
v: null,
|
|
1379
1378
|
rule: n
|
|
1380
|
-
}), e.copyToObject(n, "type", $), e.copyToObject(n, "priority",
|
|
1381
|
-
let r = e.getAttribute("dxfId",
|
|
1379
|
+
}), e.copyToObject(n, "type", $), e.copyToObject(n, "priority", Q), e.copyToObject(n, "stopIfTrue", Z);
|
|
1380
|
+
let r = e.getAttribute("dxfId", Q);
|
|
1382
1381
|
if (r !== null) {
|
|
1383
1382
|
let t = i?.get(r);
|
|
1384
|
-
t ||= (
|
|
1383
|
+
t ||= (l?.(`Unable to load conditional color. Invalid dxfI: '${r}' at '${e.getPath()}'.`), {}), n.style = t;
|
|
1385
1384
|
}
|
|
1386
|
-
e.copyToObject(n, "aboveAverage",
|
|
1385
|
+
e.copyToObject(n, "aboveAverage", Z), e.copyToObject(n, "equalAverage", Z), e.copyToObject(n, "stdDev", Q), e.copyToObject(n, "bottom", Z), e.copyToObject(n, "percent", Z), e.copyToObject(n, "rank", Q), e.copyToObject(n, "operator", $), e.copyToObject(n, "text", $), e.copyToObject(n, "timePeriod", $);
|
|
1387
1386
|
},
|
|
1388
1387
|
closeTag: (e) => {
|
|
1389
1388
|
let t = e.getParent();
|
|
1390
1389
|
if (!t?.r) return;
|
|
1391
1390
|
let n = t.conditionals[t.conditionals.length - 1], r = n?.rule;
|
|
1392
1391
|
if (!r) return;
|
|
1393
|
-
let i = {}, a =
|
|
1392
|
+
let i = {}, a = E(r, l);
|
|
1394
1393
|
a && (i.condition = a), r.style && (i.style = r.style), r.scale && (i.scale = r.scale), r.stopIfTrue && (i.stopIfTrue = !0), r.pivot && (i.pivot = !0), n.v = i, n.priority = r.priority, r.x14Id && (n.x14Id = r.x14Id), delete n.rule;
|
|
1395
1394
|
}
|
|
1396
1395
|
});
|
|
1397
|
-
let
|
|
1396
|
+
let T = (e) => {
|
|
1398
1397
|
let t = e.conditions ?? [], n = [];
|
|
1399
1398
|
for (let e = 0; e < t.length; e++) {
|
|
1400
1399
|
let r = t[e], i = {};
|
|
@@ -1402,74 +1401,74 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1402
1401
|
}
|
|
1403
1402
|
return n;
|
|
1404
1403
|
};
|
|
1405
|
-
|
|
1404
|
+
b.registerVisitor({
|
|
1406
1405
|
from: "colorScale",
|
|
1407
1406
|
to: {},
|
|
1408
1407
|
openTag: (e) => {},
|
|
1409
1408
|
closeTag: (e) => {
|
|
1410
|
-
let t = e.getSource(), n = t.colors ?? [], r =
|
|
1409
|
+
let t = e.getSource(), n = t.colors ?? [], r = T(t);
|
|
1411
1410
|
for (let e = 0; e < r.length; e++) r[e].color = n[e];
|
|
1412
1411
|
e.getParent().scale = {
|
|
1413
|
-
type:
|
|
1412
|
+
type: L.ScaleType.ColorScale,
|
|
1414
1413
|
stops: r
|
|
1415
1414
|
};
|
|
1416
1415
|
}
|
|
1417
|
-
}),
|
|
1416
|
+
}), b.registerVisitor({
|
|
1418
1417
|
from: "dataBar",
|
|
1419
1418
|
to: {},
|
|
1420
1419
|
openTag: (e) => {
|
|
1421
|
-
e.copyTo("maxLength",
|
|
1420
|
+
e.copyTo("maxLength", Q), e.copyTo("minLength", Q), e.copyTo("showValue", Z);
|
|
1422
1421
|
},
|
|
1423
1422
|
closeTag: (e) => {
|
|
1424
1423
|
let t = e.getSource(), n = {
|
|
1425
|
-
type:
|
|
1426
|
-
stops:
|
|
1424
|
+
type: L.ScaleType.DataBar,
|
|
1425
|
+
stops: T(t)
|
|
1427
1426
|
}, r = t.colors?.[0];
|
|
1428
1427
|
r && (n.color = r), t.minLength !== void 0 && (n.minLength = t.minLength), t.maxLength !== void 0 && (n.maxLength = t.maxLength), t.showValue !== void 0 && (n.showValue = t.showValue), e.getParent().scale = n;
|
|
1429
1428
|
}
|
|
1430
|
-
}),
|
|
1429
|
+
}), b.registerVisitor({
|
|
1431
1430
|
from: "iconSet",
|
|
1432
1431
|
to: {},
|
|
1433
1432
|
openTag: (e) => {
|
|
1434
|
-
e.copyTo("iconSet", $), e.copyTo("reverse",
|
|
1433
|
+
e.copyTo("iconSet", $), e.copyTo("reverse", Z), e.copyTo("showValue", Z);
|
|
1435
1434
|
},
|
|
1436
1435
|
closeTag: (e) => {
|
|
1437
1436
|
let t = e.getSource(), n = {
|
|
1438
|
-
type:
|
|
1439
|
-
stops:
|
|
1437
|
+
type: L.ScaleType.IconSet,
|
|
1438
|
+
stops: T(t)
|
|
1440
1439
|
};
|
|
1441
1440
|
t.iconSet !== void 0 && (n.iconSet = t.iconSet), t.reverse !== void 0 && (n.reverse = t.reverse), t.showValue !== void 0 && (n.showValue = t.showValue), e.getParent().scale = n;
|
|
1442
1441
|
}
|
|
1443
|
-
}),
|
|
1442
|
+
}), b.registerVisitor({
|
|
1444
1443
|
from: "formula",
|
|
1445
1444
|
to: {},
|
|
1446
1445
|
text: (e, t) => {
|
|
1447
1446
|
let n = t.getParent(), r = n.formulas;
|
|
1448
|
-
r || (r = [], n.formulas = r), r.push(
|
|
1447
|
+
r || (r = [], n.formulas = r), r.push(oe(e));
|
|
1449
1448
|
}
|
|
1450
|
-
}),
|
|
1449
|
+
}), b.registerVisitor({
|
|
1451
1450
|
from: "cfvo",
|
|
1452
1451
|
to: {},
|
|
1453
1452
|
openTag: (e) => {
|
|
1454
1453
|
let t = e.getParent();
|
|
1455
1454
|
t.conditions ||= [];
|
|
1456
1455
|
let n = e.getSource();
|
|
1457
|
-
if (t.conditions.push(n), e.copyTo("type", $), n.type ===
|
|
1456
|
+
if (t.conditions.push(n), e.copyTo("type", $), n.type === L.ColorStopType.Formula) {
|
|
1458
1457
|
let t = e.getAttribute("val");
|
|
1459
|
-
t != null && (n.value =
|
|
1460
|
-
} else e.copyTo("value",
|
|
1461
|
-
!1 === e.getAttribute("gte",
|
|
1458
|
+
t != null && (n.value = oe(String(t)));
|
|
1459
|
+
} else e.copyTo("value", Ct, "val");
|
|
1460
|
+
!1 === e.getAttribute("gte", Z) && (n.exclusive = !0);
|
|
1462
1461
|
}
|
|
1463
|
-
}),
|
|
1462
|
+
}), b.registerVisitor({
|
|
1464
1463
|
from: "color",
|
|
1465
1464
|
to: {},
|
|
1466
1465
|
openTag: (e) => {
|
|
1467
1466
|
let t = e.getParent();
|
|
1468
1467
|
t.colors ||= [];
|
|
1469
|
-
let n =
|
|
1468
|
+
let n = N((t) => e.getAttribute(t));
|
|
1470
1469
|
t.colors.push(n);
|
|
1471
1470
|
}
|
|
1472
|
-
}),
|
|
1471
|
+
}), b.registerVisitor({
|
|
1473
1472
|
from: "filterColumn",
|
|
1474
1473
|
to: {},
|
|
1475
1474
|
openTag: (e) => {
|
|
@@ -1478,93 +1477,102 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1478
1477
|
let i = t.filter;
|
|
1479
1478
|
i || (i = { conditions: [] }, t.filter = i);
|
|
1480
1479
|
let a = i.conditions;
|
|
1481
|
-
if (a || (a = [], i.conditions = a), a.push(r), e.getAttribute("hiddenButton",
|
|
1480
|
+
if (a || (a = [], i.conditions = a), a.push(r), e.getAttribute("hiddenButton", Z) && t) {
|
|
1482
1481
|
let e = t.hiddenButtons;
|
|
1483
1482
|
e || (e = [], t.hiddenButtons = e), e.push(n);
|
|
1484
1483
|
}
|
|
1485
|
-
if (e.getAttribute("showButton",
|
|
1484
|
+
if (e.getAttribute("showButton", Z) && t) {
|
|
1486
1485
|
let e = t.showButtons;
|
|
1487
1486
|
e || (e = [], t.showButtons = e), e.push(n);
|
|
1488
1487
|
}
|
|
1489
1488
|
return r;
|
|
1490
1489
|
}
|
|
1491
|
-
}),
|
|
1490
|
+
}), b.registerVisitor({
|
|
1492
1491
|
from: "colorFilter",
|
|
1493
1492
|
openTag: (e) => {
|
|
1494
1493
|
let t = e.getParent(), n = {};
|
|
1495
|
-
t.operator =
|
|
1494
|
+
t.operator = I.BuiltInOperatorNames.Color, t.param = n, e.copyToObject(n, "cellColor", Z), e.copyToObject(n, "styleId", Q, "dxfId");
|
|
1496
1495
|
}
|
|
1497
|
-
}),
|
|
1496
|
+
}), b.registerVisitor({
|
|
1498
1497
|
from: "iconFilter",
|
|
1499
1498
|
openTag: (e) => {
|
|
1500
1499
|
let t = e.getParent(), n = {};
|
|
1501
|
-
t.operator =
|
|
1500
|
+
t.operator = I.BuiltInOperatorNames.Icon, t.param = n, e.copyToObject(n, "iconId", Q), e.copyToObject(n, "iconSet", $);
|
|
1502
1501
|
}
|
|
1503
|
-
}),
|
|
1502
|
+
}), b.registerVisitor({
|
|
1504
1503
|
from: "top10",
|
|
1505
1504
|
openTag: (e) => {
|
|
1506
1505
|
let t = e.getParent(), n = {};
|
|
1507
|
-
t.operator =
|
|
1506
|
+
t.operator = I.BuiltInOperatorNames.TopN, t.param = n, e.copyToObject(n, "filterVal", Ct), e.copyToObject(n, "percent", Z), e.copyToObject(n, "top", Z), e.copyToObject(n, "limit", Ct, "val");
|
|
1508
1507
|
}
|
|
1509
|
-
}),
|
|
1508
|
+
}), b.registerVisitor({
|
|
1510
1509
|
from: "dynamicFilter",
|
|
1511
1510
|
openTag: (e) => {
|
|
1512
|
-
let t = e.getParent(), n =
|
|
1513
|
-
t.operator =
|
|
1514
|
-
let r = e.getAttribute("type");
|
|
1515
|
-
Object.values(P.AverageType).includes(r) ? (t.operator = P.BuiltInOperatorNames.Average, e.copyToObject(n, "stdDevs", Z, "val")) : e.copyToObject(n, "anchorDate", Z, "val"), e.copyToObject(n, "operator", $, "type"), e.copyToObject(n, "maxVal", Q, "maxVal");
|
|
1511
|
+
let t = e.getParent(), n = c(e.getAttribute("type"));
|
|
1512
|
+
t.operator = n.operator, t.param = n.param;
|
|
1516
1513
|
}
|
|
1517
|
-
})
|
|
1514
|
+
});
|
|
1515
|
+
let se = {
|
|
1518
1516
|
from: "filters",
|
|
1519
1517
|
to: {},
|
|
1520
1518
|
openTag: (e) => {
|
|
1521
|
-
let t = e.getParent(), n = {};
|
|
1522
|
-
return t.operator =
|
|
1519
|
+
let t = e.getParent(), n = { byDisplay: !0 };
|
|
1520
|
+
return t.operator = I.BuiltInOperatorNames.InSet, t.param = n, e.copyToObject(n, "blank", Z), n.blank && (t.includeBlanks = !0), e.copyToObject(n, "calendarType", $), n;
|
|
1523
1521
|
}
|
|
1524
|
-
}
|
|
1522
|
+
};
|
|
1523
|
+
b.registerVisitor(se);
|
|
1524
|
+
let ce = {
|
|
1525
1525
|
from: "filter",
|
|
1526
1526
|
openTag: (e) => {
|
|
1527
1527
|
let t = e.getParent(), n = t.items;
|
|
1528
1528
|
n || (n = [], t.items = n), n.push(e.getAttribute("val", $));
|
|
1529
1529
|
}
|
|
1530
|
-
}
|
|
1530
|
+
};
|
|
1531
|
+
b.registerVisitor(ce);
|
|
1532
|
+
let ue = {
|
|
1531
1533
|
from: "dateGroupItem",
|
|
1532
1534
|
to: {},
|
|
1533
1535
|
openTag: (e) => {
|
|
1534
1536
|
let t = e.getParent(), n = t.dateGroups;
|
|
1535
|
-
n || (n = [], t.dateGroups = n), n.push(e.getSource()), e.copyTo("group", $, "dateTimeGrouping"), e.copyTo("day",
|
|
1537
|
+
n || (n = [], t.dateGroups = n), n.push(e.getSource()), e.copyTo("group", $, "dateTimeGrouping"), e.copyTo("day", Q), e.copyTo("hour", Q), e.copyTo("minute", Q), e.copyTo("month", Q), e.copyTo("second", Q), e.copyTo("year", Q);
|
|
1536
1538
|
}
|
|
1537
|
-
}
|
|
1539
|
+
};
|
|
1540
|
+
b.registerVisitor(ue);
|
|
1541
|
+
let de = /* @__PURE__ */ new Map();
|
|
1542
|
+
de.set("filterColumn", {
|
|
1543
|
+
from: "filterColumn",
|
|
1544
|
+
transparent: !0
|
|
1545
|
+
}), de.set("filters", se), de.set("filter", ce), de.set("dateGroupItem", ue), b.registerVisitor({
|
|
1538
1546
|
from: "customFilters",
|
|
1539
1547
|
openTag: (e) => {
|
|
1540
1548
|
let t = e.getParent(), n = e.getAttribute("and"), r = n === "and" || n === "1", i = [];
|
|
1541
|
-
return t.operator = r ?
|
|
1549
|
+
return t.operator = r ? I.BuiltInOperatorNames.And : I.BuiltInOperatorNames.Or, t.param = i, e.setSource(t), i;
|
|
1542
1550
|
},
|
|
1543
1551
|
closeTag: (e) => {
|
|
1544
1552
|
let t = e.getSource(), n = t?.param;
|
|
1545
|
-
if (
|
|
1546
|
-
let r = n[0];
|
|
1547
|
-
t.operator = r.operator, t.param = r.param;
|
|
1553
|
+
if (!t || !n) return;
|
|
1554
|
+
let r = n.length === 1 ? n[0] : y(t);
|
|
1555
|
+
r !== t && (t.operator = r.operator, t.param = r.param, r.includeBlanks && (t.includeBlanks = !0));
|
|
1548
1556
|
}
|
|
1549
|
-
}),
|
|
1557
|
+
}), b.registerVisitor({
|
|
1550
1558
|
from: "customFilter",
|
|
1551
1559
|
openTag: (e) => {
|
|
1552
1560
|
let t = e.getParent(), n;
|
|
1553
1561
|
Array.isArray(t) ? (n = {}, t.push(n)) : n = t;
|
|
1554
|
-
let r =
|
|
1562
|
+
let r = ie({
|
|
1555
1563
|
operator: e.getAttribute("operator"),
|
|
1556
1564
|
val: e.getAttribute("val")
|
|
1557
|
-
});
|
|
1558
|
-
r && (n.operator = r.operator, n.param = r.param);
|
|
1565
|
+
}, (t) => e.warn(t));
|
|
1566
|
+
r && (n.operator = r.operator, n.param = r.param, r.includeBlanks && (n.includeBlanks = !0));
|
|
1559
1567
|
}
|
|
1560
|
-
}),
|
|
1568
|
+
}), b.registerVisitor({
|
|
1561
1569
|
from: "sortState",
|
|
1562
1570
|
to: {},
|
|
1563
1571
|
openTag: (e) => {
|
|
1564
1572
|
let t = e.getParent(), n = t.v;
|
|
1565
1573
|
n && (n.sort = {}, e.setSource(t));
|
|
1566
1574
|
}
|
|
1567
|
-
}),
|
|
1575
|
+
}), b.registerVisitor({
|
|
1568
1576
|
from: "sortCondition",
|
|
1569
1577
|
to: {},
|
|
1570
1578
|
openTag: (e) => {
|
|
@@ -1576,11 +1584,11 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1576
1584
|
i || (i = [], r.sorts = i);
|
|
1577
1585
|
let a = e.getAttribute("ref"), o = 0;
|
|
1578
1586
|
if (a) {
|
|
1579
|
-
let e =
|
|
1587
|
+
let e = ye.fastStringToRange(a, zt).colStart, n = t.r, r = n.colStart;
|
|
1580
1588
|
o = n ? e - r : e;
|
|
1581
1589
|
}
|
|
1582
1590
|
let s = {};
|
|
1583
|
-
e.copyToObject(s, "sortOn", $, "sortBy"), e.copyToObject(s, "dxfId", $, "sortBy"), e.copyToObject(s, "iconSet", $), e.copyToObject(s, "customList", $), s.reverse = e.getAttribute("descending",
|
|
1591
|
+
e.copyToObject(s, "sortOn", $, "sortBy"), e.copyToObject(s, "dxfId", $, "sortBy"), e.copyToObject(s, "iconSet", $), e.copyToObject(s, "customList", $), s.reverse = e.getAttribute("descending", Z) ?? !1;
|
|
1584
1592
|
let c = {
|
|
1585
1593
|
index: o,
|
|
1586
1594
|
criteria: s
|
|
@@ -1588,127 +1596,133 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1588
1596
|
i.push(c);
|
|
1589
1597
|
}
|
|
1590
1598
|
});
|
|
1591
|
-
let
|
|
1592
|
-
|
|
1593
|
-
let t =
|
|
1594
|
-
n === null || t || (e.getSource().gridLineColor = "index" + parseFloat(n)), e.copyTo("showZeros",
|
|
1599
|
+
let O = (e) => {
|
|
1600
|
+
w = e.getSource(), e.copyTo("topLeft", $, "topLeftCell");
|
|
1601
|
+
let t = D(e.getAttribute("defaultGridColor")), n = e.getAttribute("colorId");
|
|
1602
|
+
n === null || t || (e.getSource().gridLineColor = "index" + parseFloat(n)), e.copyTo("showZeros", Z), e.copyTo("showFormulas", Z), e.copyTo("zoomScale", Q), e.copyTo("showRowHeaders", Z, "showRowColHeaders"), e.copyTo("showColumnHeaders", Z, "showRowColHeaders"), e.copyTo("showRowGridlines", Z, "showGridLines"), e.copyTo("showColumnGridlines", Z, "showGridLines"), e.copyTo("rightToLeft", Z), e.copyTo("showOutlineSymbols", Z);
|
|
1595
1603
|
};
|
|
1596
|
-
|
|
1604
|
+
b.registerVisitor({
|
|
1597
1605
|
from: "sheetView",
|
|
1598
1606
|
to: "view",
|
|
1599
1607
|
openTag: (e) => {
|
|
1600
|
-
|
|
1608
|
+
O(e);
|
|
1601
1609
|
},
|
|
1602
1610
|
closeTag: () => {
|
|
1603
|
-
|
|
1611
|
+
w = null;
|
|
1604
1612
|
}
|
|
1605
|
-
}),
|
|
1613
|
+
}), b.registerVisitor({
|
|
1606
1614
|
from: "customSheetViews",
|
|
1607
1615
|
to: "customSheetViews",
|
|
1608
1616
|
openTag: (e) => {
|
|
1609
1617
|
e.setSource([]);
|
|
1610
1618
|
}
|
|
1611
|
-
}),
|
|
1619
|
+
}), b.registerVisitor({
|
|
1612
1620
|
from: "customSheetView",
|
|
1613
1621
|
to: [],
|
|
1614
1622
|
openTag: (e) => {
|
|
1615
|
-
|
|
1623
|
+
O(e);
|
|
1616
1624
|
},
|
|
1617
1625
|
closeTag: () => {
|
|
1618
|
-
|
|
1626
|
+
w = null;
|
|
1619
1627
|
}
|
|
1620
|
-
}),
|
|
1628
|
+
}), b.registerVisitor({
|
|
1621
1629
|
from: "selection",
|
|
1622
1630
|
to: "selection",
|
|
1623
1631
|
openTag: (e) => {
|
|
1624
|
-
if (!
|
|
1625
|
-
e.copyTo("cell", $, "activeCell"), e.copyTo("rangeIndex",
|
|
1632
|
+
if (!w) return;
|
|
1633
|
+
e.copyTo("cell", $, "activeCell"), e.copyTo("rangeIndex", Q, "activeCellId");
|
|
1626
1634
|
let t = e.getAttribute("activeCell"), n = e.getAttribute("sqref");
|
|
1627
1635
|
n && n !== t && (e.getSource().ranges = n.trim().split(/\s+/));
|
|
1628
1636
|
}
|
|
1629
|
-
}),
|
|
1637
|
+
}), b.registerVisitor({
|
|
1630
1638
|
from: "pane",
|
|
1631
1639
|
to: null,
|
|
1632
1640
|
openTag: (e) => {
|
|
1633
|
-
if (
|
|
1641
|
+
if (w && e.getAttribute("state") === "frozen") {
|
|
1634
1642
|
let t = {};
|
|
1635
|
-
|
|
1636
|
-
let n = (
|
|
1643
|
+
w.freezePanes = t, e.copyToObject(t, "topLeft", $, "topLeftCell");
|
|
1644
|
+
let n = (w.topLeft ? ye.fastStringToCell(w.topLeft) : void 0) ?? {
|
|
1637
1645
|
colIndex: 0,
|
|
1638
1646
|
rowIndex: 0
|
|
1639
1647
|
}, r = {
|
|
1640
1648
|
colIndex: 0,
|
|
1641
1649
|
rowIndex: 0
|
|
1642
1650
|
};
|
|
1643
|
-
e.copyToObject(r, "colIndex",
|
|
1651
|
+
e.copyToObject(r, "colIndex", Q, "xSplit"), e.copyToObject(r, "rowIndex", Q, "ySplit");
|
|
1644
1652
|
let i = {
|
|
1645
1653
|
colIndex: n.colIndex + r.colIndex,
|
|
1646
1654
|
rowIndex: n.rowIndex + r.rowIndex
|
|
1647
1655
|
};
|
|
1648
|
-
t.coords =
|
|
1656
|
+
t.coords = ye.cellToString(i);
|
|
1649
1657
|
}
|
|
1650
1658
|
}
|
|
1651
|
-
}),
|
|
1659
|
+
}), b.registerVisitor({
|
|
1652
1660
|
from: "sheetPr",
|
|
1653
1661
|
transparent: !0,
|
|
1654
1662
|
openTag: (t) => {
|
|
1655
1663
|
let n = t.getAttribute("codeName");
|
|
1656
|
-
n && (e.codeName = n), !1 === t.getAttribute("enableFormatConditionsCalculation",
|
|
1664
|
+
n && (e.codeName = n), !1 === t.getAttribute("enableFormatConditionsCalculation", Z) && (e.conditionalFormatCalculation = !1);
|
|
1657
1665
|
}
|
|
1658
|
-
}),
|
|
1666
|
+
}), b.registerVisitor({
|
|
1659
1667
|
from: "tabColor",
|
|
1660
1668
|
to: null,
|
|
1661
1669
|
openTag: (t) => {
|
|
1662
|
-
let n =
|
|
1670
|
+
let n = N((e) => t.getAttribute(e));
|
|
1663
1671
|
n && (e.tabColor = n);
|
|
1664
1672
|
}
|
|
1665
|
-
}),
|
|
1673
|
+
}), b.registerVisitor({
|
|
1666
1674
|
from: "pageSetUpPr",
|
|
1667
1675
|
to: "pageSetUpPr",
|
|
1668
1676
|
openTag: (e) => {}
|
|
1669
|
-
}),
|
|
1677
|
+
}), b.registerVisitor({
|
|
1670
1678
|
from: "outlinePr",
|
|
1671
1679
|
to: null,
|
|
1672
1680
|
openTag: (t) => {
|
|
1673
|
-
let n = {
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1681
|
+
let n = (e) => {
|
|
1682
|
+
let n = t.getAttribute(e);
|
|
1683
|
+
return n === "0" || n === "false";
|
|
1684
|
+
}, r = {};
|
|
1685
|
+
n("summaryBelow") && (r.summaryRow = "up"), n("summaryRight") && (r.summaryColumn = "left"), ((e) => {
|
|
1686
|
+
let n = t.getAttribute(e);
|
|
1687
|
+
return n === "1" || n === "true";
|
|
1688
|
+
})("applyStyles") && (r.automaticStyles = !0), Object.keys(r).length > 0 && (e.outline = r);
|
|
1689
|
+
}
|
|
1690
|
+
}), b.registerVisitor({
|
|
1677
1691
|
from: "pageMargins",
|
|
1678
1692
|
to: "pageMargins",
|
|
1679
1693
|
openTag: (e) => {
|
|
1680
|
-
e.copyTo("bottom",
|
|
1694
|
+
e.copyTo("bottom", Ct), e.copyTo("footer", Ct), e.copyTo("header", Ct), e.copyTo("left", Ct), e.copyTo("right", Ct), e.copyTo("top", Ct), e.copyTo("bottom", Ct);
|
|
1681
1695
|
}
|
|
1682
|
-
}),
|
|
1696
|
+
}), b.registerVisitor({
|
|
1683
1697
|
from: "pageSetup",
|
|
1684
1698
|
to: "pageSetup",
|
|
1685
1699
|
openTag: (e) => {
|
|
1686
|
-
e.copyTo("blackAndWhite",
|
|
1700
|
+
e.copyTo("blackAndWhite", Z), e.copyTo("cellComments"), e.copyTo("copies", Q), e.copyTo("draft", Z), e.copyTo("errors"), e.copyTo("firstPageNumber", Q), e.copyTo("fitToHeight", Q), e.copyTo("fitToWidth", Q), e.copyTo("horizontalDpi", Q), e.copyTo("orientation"), e.copyTo("pageOrder"), e.copyTo("paperSize", Q), e.copyTo("scale", Q), e.copyTo("useFirstPageNumber", Z), e.copyTo("usePrinterDefaults", Z), e.copyTo("verticalDpi", Q);
|
|
1687
1701
|
}
|
|
1688
|
-
}),
|
|
1702
|
+
}), b.registerVisitor({
|
|
1689
1703
|
from: "printOptions",
|
|
1690
1704
|
to: "printOptions",
|
|
1691
1705
|
openTag: (e) => {
|
|
1692
|
-
e.copyTo("gridLines",
|
|
1706
|
+
e.copyTo("gridLines", Z), e.copyTo("gridLinesSet", Z), e.copyTo("headings", Z), e.copyTo("horizontalCentered", Z), e.copyTo("verticalCentered", Z);
|
|
1693
1707
|
}
|
|
1694
|
-
}),
|
|
1708
|
+
}), b.registerVisitor({
|
|
1695
1709
|
from: "headerFoot",
|
|
1696
1710
|
to: "headerFoot",
|
|
1697
1711
|
openTag: (e) => {}
|
|
1698
|
-
}),
|
|
1712
|
+
}), b.registerVisitor({
|
|
1699
1713
|
from: "mergeCells",
|
|
1700
1714
|
to: "merges",
|
|
1701
1715
|
openTag: (e) => {
|
|
1702
1716
|
e.setSource([]);
|
|
1703
1717
|
}
|
|
1704
|
-
}),
|
|
1718
|
+
}), b.registerVisitor({
|
|
1705
1719
|
from: "dataValidations",
|
|
1706
1720
|
to: "validations",
|
|
1707
1721
|
openTag: (e) => {
|
|
1708
1722
|
e.setSource([]);
|
|
1709
1723
|
}
|
|
1710
1724
|
});
|
|
1711
|
-
let
|
|
1725
|
+
let fe = {
|
|
1712
1726
|
from: "dataValidation",
|
|
1713
1727
|
to: [],
|
|
1714
1728
|
openTag: (e) => {
|
|
@@ -1722,30 +1736,30 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1722
1736
|
operator: e.getAttribute("operator") ?? void 0
|
|
1723
1737
|
}
|
|
1724
1738
|
};
|
|
1725
|
-
!0 === e.getAttribute("showDropDown",
|
|
1739
|
+
!0 === e.getAttribute("showDropDown", Z) && (n.hideDropdown = !0), e.copyToObject(n, "alert", $, "error"), e.copyToObject(n, "alertTitle", $, "errorTitle"), e.copyToObject(n, "showAlertMessage", Z, "showErrorMessage"), n.alertStyle = e.getAttribute("errorStyle") ?? "stop", e.copyToObject(n, "imeMode"), e.copyToObject(n, "prompt"), e.copyToObject(n, "promptTitle"), e.copyToObject(n, "showPromptMessage", Z, "showInputMessage"), e.setSource(r);
|
|
1726
1740
|
},
|
|
1727
1741
|
closeTag: (e) => {
|
|
1728
1742
|
let t = e.getSource();
|
|
1729
1743
|
if (!t?.rule) return;
|
|
1730
|
-
let n =
|
|
1731
|
-
n && (e.getAttribute("allowBlank",
|
|
1744
|
+
let n = u(t.rule, l);
|
|
1745
|
+
n && (e.getAttribute("allowBlank", Z) && (n.includeBlanks = !0), t.v.condition = n), delete t.rule;
|
|
1732
1746
|
}
|
|
1733
1747
|
};
|
|
1734
|
-
|
|
1748
|
+
b.registerVisitor(fe), b.registerVisitor({
|
|
1735
1749
|
from: "formula1",
|
|
1736
1750
|
to: {},
|
|
1737
1751
|
text: (e, t) => {
|
|
1738
1752
|
let n = t.getParent().rule;
|
|
1739
|
-
n?.type && (n.formula1 =
|
|
1753
|
+
n?.type && (n.formula1 = _(oe(e), n.type));
|
|
1740
1754
|
}
|
|
1741
|
-
}),
|
|
1755
|
+
}), b.registerVisitor({
|
|
1742
1756
|
from: "formula2",
|
|
1743
1757
|
to: {},
|
|
1744
1758
|
text: (e, t) => {
|
|
1745
1759
|
let n = t.getParent().rule;
|
|
1746
|
-
n?.type && (n.formula2 =
|
|
1760
|
+
n?.type && (n.formula2 = _(oe(e), n.type));
|
|
1747
1761
|
}
|
|
1748
|
-
}),
|
|
1762
|
+
}), b.registerVisitor({
|
|
1749
1763
|
from: "picture",
|
|
1750
1764
|
to: "picture",
|
|
1751
1765
|
openTag: (e) => {
|
|
@@ -1755,7 +1769,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1755
1769
|
e.getSource().resId = r;
|
|
1756
1770
|
}
|
|
1757
1771
|
});
|
|
1758
|
-
let
|
|
1772
|
+
let pe = {
|
|
1759
1773
|
from: "slicer",
|
|
1760
1774
|
to: {},
|
|
1761
1775
|
openTag: (e) => {
|
|
@@ -1767,8 +1781,8 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1767
1781
|
for (let e of a) i.slicers[e] = r[e];
|
|
1768
1782
|
}
|
|
1769
1783
|
};
|
|
1770
|
-
|
|
1771
|
-
let
|
|
1784
|
+
b.registerVisitor(pe);
|
|
1785
|
+
let k = (e, t) => ({
|
|
1772
1786
|
from: e,
|
|
1773
1787
|
to: {},
|
|
1774
1788
|
openTag: (e) => {
|
|
@@ -1780,8 +1794,8 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1780
1794
|
closeTag: (e) => {
|
|
1781
1795
|
t(String(e.getSource() ?? ""), e);
|
|
1782
1796
|
}
|
|
1783
|
-
}),
|
|
1784
|
-
|
|
1797
|
+
}), A = /* @__PURE__ */ new Map();
|
|
1798
|
+
A.set("dataValidations", {
|
|
1785
1799
|
from: "dataValidations",
|
|
1786
1800
|
to: "validations",
|
|
1787
1801
|
openTag: (e) => {
|
|
@@ -1791,15 +1805,15 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1791
1805
|
closeTag: (e) => {
|
|
1792
1806
|
(e.getSource()?.length ?? 0) === 0 && e.setSource(void 0);
|
|
1793
1807
|
}
|
|
1794
|
-
}),
|
|
1795
|
-
...
|
|
1808
|
+
}), A.set("dataValidation", {
|
|
1809
|
+
...fe,
|
|
1796
1810
|
closeTag: (e) => {
|
|
1797
|
-
|
|
1811
|
+
fe.closeTag(e);
|
|
1798
1812
|
let t = e.getSource();
|
|
1799
1813
|
t && !t.r && (e.warn("x14 dataValidation with no xm:sqref was dropped."), e.setSource(void 0));
|
|
1800
1814
|
}
|
|
1801
1815
|
});
|
|
1802
|
-
let
|
|
1816
|
+
let me = (e) => ({
|
|
1803
1817
|
from: e,
|
|
1804
1818
|
to: {},
|
|
1805
1819
|
openTag: (t) => {
|
|
@@ -1809,18 +1823,18 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1809
1823
|
});
|
|
1810
1824
|
}
|
|
1811
1825
|
});
|
|
1812
|
-
|
|
1826
|
+
A.set("formula1", me("formula1")), A.set("formula2", me("formula2")), A.set("f", k("f", (e, t) => {
|
|
1813
1827
|
let n = t.getParent(), r = n?.rule;
|
|
1814
|
-
r && (r[n.key] =
|
|
1815
|
-
})),
|
|
1828
|
+
r && (r[n.key] = _(oe(e), r.type));
|
|
1829
|
+
})), A.set("sqref", k("sqref", (e, t) => {
|
|
1816
1830
|
let n = t.getParent(), r = e.trim();
|
|
1817
1831
|
n && r && (n.r = r.split(/\s+/).join(","));
|
|
1818
1832
|
}));
|
|
1819
|
-
let
|
|
1820
|
-
|
|
1833
|
+
let he = /* @__PURE__ */ new Map(), j = [], M = /* @__PURE__ */ new Map();
|
|
1834
|
+
M.set("conditionalFormattings", {
|
|
1821
1835
|
from: "conditionalFormattings",
|
|
1822
1836
|
transparent: !0
|
|
1823
|
-
}),
|
|
1837
|
+
}), M.set("conditionalFormatting", {
|
|
1824
1838
|
from: "conditionalFormatting",
|
|
1825
1839
|
to: {},
|
|
1826
1840
|
openTag: (e) => {
|
|
@@ -1830,85 +1844,85 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1830
1844
|
let t = e.getSource(), n = t?.rules ?? [];
|
|
1831
1845
|
for (let e = 0; e < n.length; e++) {
|
|
1832
1846
|
let r = n[e];
|
|
1833
|
-
r.sqref = t.sqref, r.id ?
|
|
1847
|
+
r.sqref = t.sqref, r.id ? he.set(r.id, r) : j.push(r);
|
|
1834
1848
|
}
|
|
1835
1849
|
}
|
|
1836
|
-
}),
|
|
1850
|
+
}), M.set("cfRule", {
|
|
1837
1851
|
from: "cfRule",
|
|
1838
1852
|
to: {},
|
|
1839
1853
|
openTag: (e) => {
|
|
1840
|
-
e.copyTo("id", $), e.copyTo("type", $), e.copyTo("priority",
|
|
1854
|
+
e.copyTo("id", $), e.copyTo("type", $), e.copyTo("priority", Q), e.copyTo("stopIfTrue", Z), e.copyTo("operator", $), e.copyTo("text", $), e.copyTo("timePeriod", $), e.copyTo("aboveAverage", Z), e.copyTo("equalAverage", Z), e.copyTo("stdDev", Q), e.copyTo("bottom", Z), e.copyTo("percent", Z), e.copyTo("rank", Q);
|
|
1841
1855
|
},
|
|
1842
1856
|
closeTag: (e) => {
|
|
1843
1857
|
let t = e.getSource();
|
|
1844
1858
|
t && e.getParent()?.rules?.push(t);
|
|
1845
1859
|
}
|
|
1846
|
-
}),
|
|
1860
|
+
}), M.set("sqref", k("sqref", (e, t) => {
|
|
1847
1861
|
let n = t.getParent(), r = e.trim();
|
|
1848
1862
|
n && r && (n.sqref = r);
|
|
1849
|
-
})),
|
|
1863
|
+
})), M.set("dataBar", {
|
|
1850
1864
|
from: "dataBar",
|
|
1851
1865
|
to: {},
|
|
1852
1866
|
openTag: (e) => {
|
|
1853
|
-
e.copyTo("minLength",
|
|
1867
|
+
e.copyTo("minLength", Q), e.copyTo("maxLength", Q), e.copyTo("gradient", Z), e.copyTo("border", Z), e.copyTo("direction", $), e.copyTo("axisPosition", $), e.copyTo("negativeBarColorSameAsPositive", Z), e.copyTo("negativeBarBorderColorSameAsPositive", Z);
|
|
1854
1868
|
},
|
|
1855
1869
|
closeTag: (e) => {
|
|
1856
1870
|
e.getParent().dataBar = e.getSource();
|
|
1857
1871
|
}
|
|
1858
|
-
}),
|
|
1872
|
+
}), M.set("iconSet", {
|
|
1859
1873
|
from: "iconSet",
|
|
1860
1874
|
to: {},
|
|
1861
1875
|
openTag: (e) => {
|
|
1862
|
-
e.copyTo("iconSet", $), e.copyTo("custom",
|
|
1876
|
+
e.copyTo("iconSet", $), e.copyTo("custom", Z), e.copyTo("reverse", Z), e.copyTo("showValue", Z);
|
|
1863
1877
|
},
|
|
1864
1878
|
closeTag: (e) => {
|
|
1865
1879
|
e.getParent().iconSet = e.getSource();
|
|
1866
1880
|
}
|
|
1867
1881
|
});
|
|
1868
|
-
let
|
|
1869
|
-
|
|
1882
|
+
let ge = /* @__PURE__ */ new Map();
|
|
1883
|
+
ge.set("f", k("f", (e, t) => {
|
|
1870
1884
|
let n = t.getParent();
|
|
1871
1885
|
if (!n) return;
|
|
1872
1886
|
let r = e.trim(), i = Number(r);
|
|
1873
|
-
n.value = r.length > 0 && Number.isFinite(i) ? i :
|
|
1874
|
-
})),
|
|
1887
|
+
n.value = r.length > 0 && Number.isFinite(i) ? i : oe(e);
|
|
1888
|
+
})), M.set("cfvo", {
|
|
1875
1889
|
from: "cfvo",
|
|
1876
1890
|
to: {},
|
|
1877
|
-
scope: () =>
|
|
1891
|
+
scope: () => ge,
|
|
1878
1892
|
openTag: (e) => {
|
|
1879
1893
|
let t = e.getParent();
|
|
1880
1894
|
t.conditions ||= [];
|
|
1881
1895
|
let n = e.getSource();
|
|
1882
|
-
t.conditions.push(n), e.copyTo("type", $), !1 === e.getAttribute("gte",
|
|
1896
|
+
t.conditions.push(n), e.copyTo("type", $), !1 === e.getAttribute("gte", Z) && (n.exclusive = !0);
|
|
1883
1897
|
}
|
|
1884
|
-
}),
|
|
1898
|
+
}), M.set("f", k("f", (e, t) => {
|
|
1885
1899
|
let n = t.getParent();
|
|
1886
|
-
n && (n.formulas ??= []).push(
|
|
1887
|
-
})),
|
|
1900
|
+
n && (n.formulas ??= []).push(oe(e));
|
|
1901
|
+
})), M.set("dxf", {
|
|
1888
1902
|
from: "dxf",
|
|
1889
1903
|
to: {},
|
|
1890
1904
|
raw: !0,
|
|
1891
1905
|
closeTag: (e) => {
|
|
1892
|
-
if (!
|
|
1906
|
+
if (!re) return;
|
|
1893
1907
|
let t = e.getParent();
|
|
1894
1908
|
if (!t) return;
|
|
1895
|
-
let n =
|
|
1909
|
+
let n = re(e.getRawXml() ?? "");
|
|
1896
1910
|
n && (t.style = n);
|
|
1897
1911
|
}
|
|
1898
1912
|
});
|
|
1899
|
-
let
|
|
1913
|
+
let _e = (e) => ({
|
|
1900
1914
|
from: e,
|
|
1901
1915
|
to: {},
|
|
1902
1916
|
openTag: (t) => {
|
|
1903
|
-
let n =
|
|
1917
|
+
let n = N((e) => t.getAttribute(e));
|
|
1904
1918
|
n && (t.getParent()[e] = n);
|
|
1905
1919
|
}
|
|
1906
1920
|
});
|
|
1907
|
-
|
|
1921
|
+
M.set("borderColor", _e("borderColor")), M.set("negativeFillColor", _e("negativeFillColor")), M.set("negativeBorderColor", _e("negativeBorderColor")), M.set("axisColor", _e("axisColor")), M.set("cfIcon", {
|
|
1908
1922
|
from: "cfIcon",
|
|
1909
1923
|
to: {},
|
|
1910
1924
|
openTag: (e) => {
|
|
1911
|
-
let t = e.getAttribute("iconSet"), n = e.getAttribute("iconId",
|
|
1925
|
+
let t = e.getAttribute("iconSet"), n = e.getAttribute("iconId", Q);
|
|
1912
1926
|
if (t === null || n === null) return;
|
|
1913
1927
|
let r = e.getParent();
|
|
1914
1928
|
r.icons ||= [], r.icons.push({
|
|
@@ -1917,54 +1931,55 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1917
1931
|
});
|
|
1918
1932
|
}
|
|
1919
1933
|
});
|
|
1920
|
-
let
|
|
1921
|
-
|
|
1934
|
+
let ve = /* @__PURE__ */ new Map();
|
|
1935
|
+
ve.set("id", k("id", (e, t) => {
|
|
1922
1936
|
let n = t.getParent(), r = e.trim();
|
|
1923
1937
|
n && r && (n.x14Id = r);
|
|
1924
1938
|
}));
|
|
1925
|
-
let
|
|
1926
|
-
|
|
1939
|
+
let P = /* @__PURE__ */ new Map();
|
|
1940
|
+
P.set("slicerList", {
|
|
1927
1941
|
from: "slicerList",
|
|
1928
1942
|
transparent: !0
|
|
1929
|
-
}),
|
|
1930
|
-
let
|
|
1931
|
-
[
|
|
1932
|
-
[
|
|
1933
|
-
[
|
|
1934
|
-
[
|
|
1935
|
-
[
|
|
1936
|
-
[
|
|
1937
|
-
|
|
1938
|
-
|
|
1943
|
+
}), P.set("slicer", pe);
|
|
1944
|
+
let be = /* @__PURE__ */ new Map([
|
|
1945
|
+
[p(h), A],
|
|
1946
|
+
[p(g), M],
|
|
1947
|
+
[p(s), M],
|
|
1948
|
+
[p(t), ve],
|
|
1949
|
+
[p(o), P],
|
|
1950
|
+
[p(d), P],
|
|
1951
|
+
[p(v), de]
|
|
1952
|
+
]), xe = /* @__PURE__ */ new Set();
|
|
1953
|
+
b.registerVisitor({
|
|
1939
1954
|
from: "extLst",
|
|
1940
1955
|
transparent: !0
|
|
1941
|
-
}),
|
|
1956
|
+
}), b.registerVisitor({
|
|
1942
1957
|
from: "ext",
|
|
1943
1958
|
transparent: !0,
|
|
1944
1959
|
scope: (e) => {
|
|
1945
|
-
let t = e.getAttribute("uri"), n =
|
|
1960
|
+
let t = e.getAttribute("uri"), n = p(t), r = be.get(n);
|
|
1946
1961
|
if (r) return r;
|
|
1947
|
-
if (!
|
|
1948
|
-
|
|
1949
|
-
let r =
|
|
1962
|
+
if (!te.has(n) && !xe.has(n)) {
|
|
1963
|
+
xe.add(n);
|
|
1964
|
+
let r = ee[n];
|
|
1950
1965
|
e.warn(r ? `Extension content '${r}' (${t}) is not read; it will be lost on resave.` : `Unknown extension content (uri ${t}) is not read; it will be lost on resave.`);
|
|
1951
1966
|
}
|
|
1952
1967
|
return null;
|
|
1953
1968
|
}
|
|
1954
|
-
}),
|
|
1969
|
+
}), b.registerVisitor({
|
|
1955
1970
|
from: "mergeCell",
|
|
1956
1971
|
to: [],
|
|
1957
1972
|
openTag: (e) => {
|
|
1958
1973
|
let t = e.getAttribute("ref");
|
|
1959
1974
|
e.setSource(t);
|
|
1960
1975
|
}
|
|
1961
|
-
}),
|
|
1976
|
+
}), b.registerVisitor({
|
|
1962
1977
|
from: "hyperlinks",
|
|
1963
1978
|
to: "hyperlinks",
|
|
1964
1979
|
openTag: (e) => {
|
|
1965
1980
|
e.setSource([]);
|
|
1966
1981
|
}
|
|
1967
|
-
}),
|
|
1982
|
+
}), b.registerVisitor({
|
|
1968
1983
|
from: "hyperlink",
|
|
1969
1984
|
to: [],
|
|
1970
1985
|
openTag: (e) => {
|
|
@@ -1985,7 +2000,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1985
2000
|
v: o
|
|
1986
2001
|
});
|
|
1987
2002
|
}
|
|
1988
|
-
}),
|
|
2003
|
+
}), b.registerVisitor({
|
|
1989
2004
|
from: "drawing",
|
|
1990
2005
|
to: "movables",
|
|
1991
2006
|
openTag: (e) => {
|
|
@@ -1994,35 +2009,35 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
1994
2009
|
let r = n(t);
|
|
1995
2010
|
r ? e.setSource(r.movables) : e.warn("A drawing part is missing; its shapes were not imported.", { onceKey: "xlsx.sheet.drawing.missing" });
|
|
1996
2011
|
}
|
|
1997
|
-
}),
|
|
2012
|
+
}), b.registerVisitor({
|
|
1998
2013
|
from: "legacyDrawing",
|
|
1999
2014
|
to: "legacyDrawing",
|
|
2000
2015
|
openTag: (e) => {
|
|
2001
2016
|
e.setSource(n(e.getAttribute("r:id"), "legacyDrawing") ?? void 0);
|
|
2002
2017
|
}
|
|
2003
|
-
}),
|
|
2018
|
+
}), b.registerVisitor({
|
|
2004
2019
|
from: "legacyDrawingHF",
|
|
2005
2020
|
to: "legacyDrawingHF",
|
|
2006
2021
|
openTag: (e) => {
|
|
2007
2022
|
e.setSource(n(e.getAttribute("r:id"), "legacyDrawing") ?? void 0);
|
|
2008
2023
|
}
|
|
2009
2024
|
});
|
|
2010
|
-
let
|
|
2025
|
+
let F = null, Se = !1, R = /* @__PURE__ */ new Map(), Ce = {
|
|
2011
2026
|
from: "Fallback",
|
|
2012
2027
|
to: null
|
|
2013
|
-
},
|
|
2028
|
+
}, we = {
|
|
2014
2029
|
from: "Choice",
|
|
2015
2030
|
transparent: !0
|
|
2016
2031
|
};
|
|
2017
|
-
|
|
2032
|
+
R.set("Fallback", Ce), R.set("Choice", we), R.set("control", {
|
|
2018
2033
|
from: "control",
|
|
2019
2034
|
transparent: !0,
|
|
2020
2035
|
openTag: (e) => {
|
|
2021
|
-
let t =
|
|
2022
|
-
|
|
2023
|
-
let i = e.getAttribute("
|
|
2024
|
-
|
|
2025
|
-
let
|
|
2036
|
+
let t = e.getAttribute("name"), r = e.getAttribute("r:id"), i = r ? n(r, "formControl") : null;
|
|
2037
|
+
if (!i) return e.warn(`The form control '${t ?? ""}' has no properties and was not read.`, { onceKey: "xlsx.sheet.control.noProperties" }), void (F = null);
|
|
2038
|
+
let a = i.json, o = parseInt(e.getAttribute("shapeId") ?? "", 10);
|
|
2039
|
+
isNaN(o) || (a.shapeId = o);
|
|
2040
|
+
let s = {
|
|
2026
2041
|
anchor: {
|
|
2027
2042
|
tl: {
|
|
2028
2043
|
c: 0,
|
|
@@ -2038,71 +2053,71 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2038
2053
|
}
|
|
2039
2054
|
},
|
|
2040
2055
|
content: {
|
|
2041
|
-
type:
|
|
2042
|
-
json:
|
|
2056
|
+
type: i.type,
|
|
2057
|
+
json: a
|
|
2043
2058
|
}
|
|
2044
2059
|
};
|
|
2045
|
-
|
|
2060
|
+
t && (s.content.name = t), F = {
|
|
2046
2061
|
movable: s,
|
|
2047
|
-
control:
|
|
2062
|
+
control: a
|
|
2048
2063
|
};
|
|
2049
2064
|
},
|
|
2050
2065
|
closeTag: () => {
|
|
2051
|
-
|
|
2066
|
+
F &&= (e.movables ||= [], e.movables.push(F.movable), null);
|
|
2052
2067
|
}
|
|
2053
|
-
}),
|
|
2068
|
+
}), R.set("controlPr", {
|
|
2054
2069
|
from: "controlPr",
|
|
2055
2070
|
transparent: !0,
|
|
2056
2071
|
raw: !0,
|
|
2057
2072
|
openTag: (e) => {
|
|
2058
|
-
if (!
|
|
2073
|
+
if (!F) return;
|
|
2059
2074
|
let t = e.getFrom().attributes ?? {}, n = {};
|
|
2060
2075
|
for (let e in t) {
|
|
2061
2076
|
let r = t[e];
|
|
2062
2077
|
n[e] = typeof r == "string" ? r : r?.value ?? "";
|
|
2063
2078
|
}
|
|
2064
|
-
|
|
2079
|
+
ne(n, F.control);
|
|
2065
2080
|
},
|
|
2066
2081
|
closeTag: (e) => {
|
|
2067
|
-
if (!
|
|
2082
|
+
if (!F) return;
|
|
2068
2083
|
let t = ((e) => {
|
|
2069
2084
|
let t = /<(?:[\w.-]+:)?anchor\b([^>]*)>([\s\S]*?)<\/(?:[\w.-]+:)?anchor>/.exec(e);
|
|
2070
2085
|
if (!t) return null;
|
|
2071
2086
|
let n = t[2], r = (e) => RegExp(`<(?:[\\w.-]+:)?${e}\\b[^>]*>([\\s\\S]*?)<\\/(?:[\\w.-]+:)?${e}>`).exec(n)?.[1], i = t[1], a = /\bmoveWithCells="(?:1|true)"/.test(i), o = /\bsizeWithCells="(?:1|true)"/.test(i);
|
|
2072
2087
|
return {
|
|
2073
2088
|
anchor: {
|
|
2074
|
-
tl:
|
|
2075
|
-
br:
|
|
2089
|
+
tl: Pt(r("from")),
|
|
2090
|
+
br: Pt(r("to"))
|
|
2076
2091
|
},
|
|
2077
2092
|
anchorType: a ? o ? "twoCell" : "oneCell" : "absolute",
|
|
2078
2093
|
rest: (e.slice(0, t.index) + e.slice(t.index + t[0].length)).trim()
|
|
2079
2094
|
};
|
|
2080
2095
|
})(e.getRawXml() ?? "");
|
|
2081
|
-
t ? (
|
|
2096
|
+
t ? (F.movable.anchor = t.anchor, t.anchorType !== "twoCell" && (F.movable.anchorType = t.anchorType), t.rest && (F.control.xml = t.rest)) : Se || (Se = !0, e.warn("A form control has no anchor; it is placed at the top left of the sheet."));
|
|
2082
2097
|
}
|
|
2083
2098
|
});
|
|
2084
|
-
let
|
|
2099
|
+
let Te = {
|
|
2085
2100
|
from: "controls",
|
|
2086
2101
|
transparent: !0,
|
|
2087
|
-
scope: () =>
|
|
2102
|
+
scope: () => R
|
|
2088
2103
|
};
|
|
2089
|
-
|
|
2090
|
-
let
|
|
2091
|
-
["Choice",
|
|
2092
|
-
["Fallback",
|
|
2093
|
-
["controls",
|
|
2104
|
+
b.registerVisitor(Te);
|
|
2105
|
+
let De = /* @__PURE__ */ new Map([
|
|
2106
|
+
["Choice", we],
|
|
2107
|
+
["Fallback", Ce],
|
|
2108
|
+
["controls", Te]
|
|
2094
2109
|
]);
|
|
2095
|
-
|
|
2110
|
+
b.registerVisitor({
|
|
2096
2111
|
from: "AlternateContent",
|
|
2097
2112
|
transparent: !0,
|
|
2098
|
-
scope: () =>
|
|
2099
|
-
}),
|
|
2113
|
+
scope: () => De
|
|
2114
|
+
}), b.registerVisitor({
|
|
2100
2115
|
from: "tableParts",
|
|
2101
2116
|
to: "tables",
|
|
2102
2117
|
openTag: (e) => {
|
|
2103
2118
|
e.setSource([]);
|
|
2104
2119
|
}
|
|
2105
|
-
}),
|
|
2120
|
+
}), b.registerVisitor({
|
|
2106
2121
|
from: "tablePart",
|
|
2107
2122
|
to: [],
|
|
2108
2123
|
openTag: (e) => {
|
|
@@ -2112,26 +2127,26 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2112
2127
|
r ? e.setSource(r) : e.warn("A table part is missing; the table was not imported.", { onceKey: "xlsx.sheet.table.missing" });
|
|
2113
2128
|
}
|
|
2114
2129
|
});
|
|
2115
|
-
let
|
|
2116
|
-
t.conditions?.length && (e.stops =
|
|
2117
|
-
},
|
|
2118
|
-
t.conditions?.length && (e.stops =
|
|
2119
|
-
},
|
|
2130
|
+
let z = (e, t) => {
|
|
2131
|
+
t.conditions?.length && (e.stops = T(t)), t.minLength !== void 0 && (e.minLength = t.minLength), t.maxLength !== void 0 && (e.maxLength = t.maxLength), (t.gradient ?? 1) && (e.gradient = !0), t.border && t.borderColor && (e.borderColor = t.borderColor), !t.negativeBarColorSameAsPositive && t.negativeFillColor && (e.negativeFillColor = t.negativeFillColor), !(t.negativeBarBorderColorSameAsPositive ?? 1) && t.negativeBorderColor && (e.negativeBorderColor = t.negativeBorderColor), t.axisColor && (e.axisColor = t.axisColor), t.axisPosition !== "middle" && t.axisPosition !== "none" || (e.axisPosition = t.axisPosition), t.direction !== "leftToRight" && t.direction !== "rightToLeft" || (e.direction = t.direction);
|
|
2132
|
+
}, Oe = (e, t) => {
|
|
2133
|
+
t.conditions?.length && (e.stops = T(t)), t.iconSet && t.iconSet !== e.iconSet && (e.iconSet = t.iconSet), t.icons?.length && (e.icon = t.icons), t.reverse !== void 0 && (e.reverse = t.reverse), t.showValue !== void 0 && (e.showValue = t.showValue);
|
|
2134
|
+
}, B = (e) => {
|
|
2120
2135
|
if (!e.sqref) return null;
|
|
2121
2136
|
let t = e.sqref.split(/\s+/).join(",");
|
|
2122
2137
|
if (e.type === "iconSet") {
|
|
2123
2138
|
if (!e.iconSet) return null;
|
|
2124
2139
|
let n = {
|
|
2125
|
-
type:
|
|
2140
|
+
type: L.ScaleType.IconSet,
|
|
2126
2141
|
stops: []
|
|
2127
2142
|
};
|
|
2128
|
-
return
|
|
2143
|
+
return Oe(n, e.iconSet), {
|
|
2129
2144
|
r: t,
|
|
2130
2145
|
v: { scale: n },
|
|
2131
2146
|
priority: e.priority
|
|
2132
2147
|
};
|
|
2133
2148
|
}
|
|
2134
|
-
let n =
|
|
2149
|
+
let n = E(e, l);
|
|
2135
2150
|
if (!n) return null;
|
|
2136
2151
|
let r = { condition: n };
|
|
2137
2152
|
return e.style && (r.style = e.style), e.stopIfTrue && (r.stopIfTrue = !0), {
|
|
@@ -2140,7 +2155,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2140
2155
|
priority: e.priority
|
|
2141
2156
|
};
|
|
2142
2157
|
};
|
|
2143
|
-
|
|
2158
|
+
b.registerVisitor({
|
|
2144
2159
|
from: "worksheet",
|
|
2145
2160
|
to: {},
|
|
2146
2161
|
openTag: (e) => {},
|
|
@@ -2150,27 +2165,27 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2150
2165
|
let t = n[e], r = t.x14Id;
|
|
2151
2166
|
if (!r) continue;
|
|
2152
2167
|
delete t.x14Id;
|
|
2153
|
-
let i =
|
|
2168
|
+
let i = he.get(r);
|
|
2154
2169
|
if (!i) continue;
|
|
2155
|
-
|
|
2170
|
+
he.delete(r);
|
|
2156
2171
|
let a = t.v?.scale;
|
|
2157
|
-
i.dataBar && a?.type ===
|
|
2172
|
+
i.dataBar && a?.type === L.ScaleType.DataBar ? z(a, i.dataBar) : i.iconSet && a?.type === L.ScaleType.IconSet && Oe(a, i.iconSet);
|
|
2158
2173
|
}
|
|
2159
|
-
let r = [...
|
|
2174
|
+
let r = [...he.values(), ...j], i = /* @__PURE__ */ new Set(), a = 0;
|
|
2160
2175
|
for (let e = 0; e < r.length; e++) {
|
|
2161
|
-
let o =
|
|
2176
|
+
let o = B(r[e]);
|
|
2162
2177
|
o ? (n || (n = [], t.conditionals = n), n.push(o)) : (i.add(r[e].type ?? "unknown"), a++);
|
|
2163
2178
|
}
|
|
2164
2179
|
if (a > 0) {
|
|
2165
2180
|
let e = [...i].map((e) => `'${e}'`).join(", ");
|
|
2166
|
-
|
|
2181
|
+
l?.(a === 1 ? `An x14-only conditional formatting rule (type ${e}) is not read and will be lost on resave.` : `${a} x14-only conditional formatting rules (types ${e}) are not read and will be lost on resave.`);
|
|
2167
2182
|
}
|
|
2168
2183
|
if (n) {
|
|
2169
2184
|
n.length > 1 && n.sort((e, t) => (e.priority ?? Infinity) - (t.priority ?? Infinity));
|
|
2170
2185
|
for (let e = 0; e < n.length; e++) delete n[e].priority;
|
|
2171
2186
|
}
|
|
2172
2187
|
}
|
|
2173
|
-
}),
|
|
2188
|
+
}), b.registerVisitor({
|
|
2174
2189
|
from: "customProperties",
|
|
2175
2190
|
to: "customProperties",
|
|
2176
2191
|
openTag: (e) => {
|
|
@@ -2180,7 +2195,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2180
2195
|
let t = e.getSource();
|
|
2181
2196
|
t.length > 0 && (e.getParent().customProperties = t);
|
|
2182
2197
|
}
|
|
2183
|
-
}),
|
|
2198
|
+
}), b.registerVisitor({
|
|
2184
2199
|
from: "customPr",
|
|
2185
2200
|
to: {},
|
|
2186
2201
|
openTag: (e) => {
|
|
@@ -2191,26 +2206,26 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2191
2206
|
let i = n(r, "resource"), a = e.getSource();
|
|
2192
2207
|
a.resId = i, t.push(a);
|
|
2193
2208
|
}
|
|
2194
|
-
}),
|
|
2209
|
+
}), b.registerVisitor({
|
|
2195
2210
|
from: "sheetProtection",
|
|
2196
2211
|
to: "protection",
|
|
2197
2212
|
openTag: (e) => {
|
|
2198
2213
|
let t = e.getSource();
|
|
2199
|
-
for (let n of
|
|
2214
|
+
for (let n of x) {
|
|
2200
2215
|
let r = e.hasAttribute(n.attribute) ? e.getAttribute(n.attribute) : null;
|
|
2201
|
-
t[n.key] =
|
|
2216
|
+
t[n.key] = C(n, r);
|
|
2202
2217
|
}
|
|
2203
2218
|
if (t.sheet) return;
|
|
2204
2219
|
let n = {};
|
|
2205
|
-
e.copyToObject(n, "hash", $, "hashValue"), e.copyToObject(n, "algorithm", $, "algorithmName"), e.copyToObject(n, "salt", $, "saltValue"), e.copyToObject(n, "spinCount",
|
|
2220
|
+
e.copyToObject(n, "hash", $, "hashValue"), e.copyToObject(n, "algorithm", $, "algorithmName"), e.copyToObject(n, "salt", $, "saltValue"), e.copyToObject(n, "spinCount", Q), Object.keys(n).length > 0 && (e.getSource().password = n);
|
|
2206
2221
|
}
|
|
2207
|
-
}),
|
|
2222
|
+
}), b.registerVisitor({
|
|
2208
2223
|
from: "protectedRanges",
|
|
2209
2224
|
to: "protectedRanges",
|
|
2210
2225
|
openTag: (e) => {
|
|
2211
2226
|
e.setSource([]);
|
|
2212
2227
|
}
|
|
2213
|
-
}),
|
|
2228
|
+
}), b.registerVisitor({
|
|
2214
2229
|
from: "protectedRange",
|
|
2215
2230
|
to: [],
|
|
2216
2231
|
openTag: (e) => {
|
|
@@ -2222,67 +2237,67 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2222
2237
|
};
|
|
2223
2238
|
e.copyToObject(n, "name"), e.copyToObject(n, "securityDescriptor");
|
|
2224
2239
|
let i = {};
|
|
2225
|
-
e.copyToObject(i, "hash", $, "hashValue"), e.copyToObject(i, "algorithm", $, "algorithmName"), e.copyToObject(i, "salt", $, "saltValue"), e.copyToObject(i, "spinCount",
|
|
2240
|
+
e.copyToObject(i, "hash", $, "hashValue"), e.copyToObject(i, "algorithm", $, "algorithmName"), e.copyToObject(i, "salt", $, "saltValue"), e.copyToObject(i, "spinCount", Q), Object.keys(i).length > 0 && (n.password = i), e.setSource(r);
|
|
2226
2241
|
},
|
|
2227
2242
|
closeTag: (e) => {
|
|
2228
2243
|
let t = e.getSource();
|
|
2229
2244
|
t?.r && t.v.name || e.setSource(void 0);
|
|
2230
2245
|
}
|
|
2231
|
-
}),
|
|
2246
|
+
}), b.registerVisitor({
|
|
2232
2247
|
from: "sheetFormatPr",
|
|
2233
2248
|
to: "sheetFormatPr",
|
|
2234
2249
|
openTag: (t) => {
|
|
2235
|
-
t.copyToObject(e, "defaultColSize",
|
|
2250
|
+
t.copyToObject(e, "defaultColSize", Ct, "defaultColWidth");
|
|
2236
2251
|
let n = t.getAttribute("customHeight");
|
|
2237
|
-
n !== "1" && n !== "true" || t.copyToObject(e, "defaultRowSize",
|
|
2252
|
+
n !== "1" && n !== "true" || t.copyToObject(e, "defaultRowSize", Ct, "defaultRowHeight");
|
|
2238
2253
|
}
|
|
2239
|
-
}),
|
|
2254
|
+
}), b.registerVisitor({
|
|
2240
2255
|
from: "cols",
|
|
2241
2256
|
to: "cols",
|
|
2242
2257
|
openTag: (e) => {
|
|
2243
2258
|
e.setSource([]);
|
|
2244
2259
|
}
|
|
2245
|
-
}),
|
|
2260
|
+
}), b.registerVisitor({
|
|
2246
2261
|
from: "col",
|
|
2247
2262
|
to: [],
|
|
2248
2263
|
openTag: (e) => {
|
|
2249
2264
|
let t = e.getSource(), n = e.getAttribute("min"), r = e.getAttribute("max"), i = n === void 0 ? 0 : parseInt(n) - 1, a = r === void 0 ? i : parseInt(r) - 1;
|
|
2250
|
-
t.r =
|
|
2265
|
+
t.r = ye.runToString(i, a, !0);
|
|
2251
2266
|
let o = {};
|
|
2252
|
-
t.v = o, e.copyToObject(o, "sz",
|
|
2267
|
+
t.v = o, e.copyToObject(o, "sz", Ct, "width"), e.copyToObject(o, "csz", Z, "customWidth"), e.copyToObject(o, "h", Z, "hidden"), e.copyToObject(o, "l", Q, "outlineLevel"), e.copyToObject(o, "cl", Z, "collapsed"), e.copyToObject(o, "s", Q, "style");
|
|
2253
2268
|
}
|
|
2254
|
-
}),
|
|
2269
|
+
}), b.registerVisitor({
|
|
2255
2270
|
from: "oleObjects",
|
|
2256
2271
|
to: null,
|
|
2257
2272
|
openTag: (e) => {
|
|
2258
2273
|
e.warn("'OLE Objects' are not supported.");
|
|
2259
2274
|
}
|
|
2260
2275
|
});
|
|
2261
|
-
let
|
|
2276
|
+
let ke = !1, Ae = !1, V = 0, H = "", U = (e) => {
|
|
2262
2277
|
let t = e.indexOf(":");
|
|
2263
2278
|
return t === -1 ? e : e.slice(t + 1);
|
|
2264
2279
|
};
|
|
2265
|
-
return
|
|
2280
|
+
return Bt(S, e, b.createEventHandler(e, a, l), l, f, {
|
|
2266
2281
|
onOpenTag: (e) => {
|
|
2267
|
-
|
|
2268
|
-
let t =
|
|
2269
|
-
t === "t" || t === "v" ?
|
|
2282
|
+
ke = !0;
|
|
2283
|
+
let t = U(e.name);
|
|
2284
|
+
t === "t" || t === "v" ? V === 0 && (Ae = !0) : t !== "rPh" && t !== "phoneticPr" || V++;
|
|
2270
2285
|
},
|
|
2271
2286
|
onText: (e) => {
|
|
2272
|
-
|
|
2287
|
+
Ae && (H += e);
|
|
2273
2288
|
},
|
|
2274
2289
|
onCloseTag: (e) => {
|
|
2275
|
-
let t =
|
|
2276
|
-
t === "t" || t === "v" ?
|
|
2290
|
+
let t = U(e.name);
|
|
2291
|
+
t === "t" || t === "v" ? Ae = !1 : t !== "rPh" && t !== "phoneticPr" || V > 0 && V--;
|
|
2277
2292
|
},
|
|
2278
2293
|
onEnd: () => {
|
|
2279
|
-
if (!
|
|
2280
|
-
let e = r(
|
|
2281
|
-
return
|
|
2294
|
+
if (!ke) return;
|
|
2295
|
+
let e = r(le(H));
|
|
2296
|
+
return ke = !1, Ae = !1, V = 0, H = "", e;
|
|
2282
2297
|
},
|
|
2283
2298
|
onError: (e) => {}
|
|
2284
|
-
},
|
|
2285
|
-
},
|
|
2299
|
+
}, m);
|
|
2300
|
+
}, Lt = class {
|
|
2286
2301
|
static {
|
|
2287
2302
|
this.Collapsed = 1;
|
|
2288
2303
|
}
|
|
@@ -2319,17 +2334,17 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2319
2334
|
static {
|
|
2320
2335
|
this.ThickTop = 2048;
|
|
2321
2336
|
}
|
|
2322
|
-
},
|
|
2337
|
+
}, Rt = (e, t, n) => {
|
|
2323
2338
|
if (e[0].value[0] === e[1].value[0]) return t;
|
|
2324
|
-
},
|
|
2339
|
+
}, zt = {
|
|
2325
2340
|
colStart: 0,
|
|
2326
2341
|
colEnd: 0,
|
|
2327
2342
|
rowStart: 0,
|
|
2328
2343
|
rowEnd: 0
|
|
2329
|
-
},
|
|
2330
|
-
let s = !1, c = !1, l = [], u = !1, d = null, f = null, p = null, m = null,
|
|
2344
|
+
}, Bt = (e, t, n, r, i, a, o) => {
|
|
2345
|
+
let s = !1, c = !1, l = [], u = !1, d = null, f = null, p = null, m = null, h = null, g = null, _ = o?.get("richData") ?? be.EmptyArray, v = o?.get("dummyWrapped") ?? null, ee = ye.normalizeA1ToR1C1, y = xe.createConflatingRanges(), te = /* @__PURE__ */ new Map(), ne = [], b = !1, re = !1, ie = null, ae = !1, oe = xe.createConflatingRanges(), x = !1, S = -1, C = -1, w = null, T = null, se = null, E = [], ce = null, le = -2, D = 0, ue = "", de = "", O = "", fe = "", pe = "", k = "", A = "", me = "", he = "", j = "", M = "", N = "", ge = "", _e = "", ve = !0, P = null, I = !1, L = !1, R = !1, Ce = null, we = 0, Te = (e) => {
|
|
2331
2346
|
let r = e.name, p = r.indexOf(":");
|
|
2332
|
-
if (p !== -1 && (r = r.slice(p + 1)),
|
|
2347
|
+
if (p !== -1 && (r = r.slice(p + 1)), we++, we % 196608 == 0 && i?.(we), T) {
|
|
2333
2348
|
let t = e.attributes;
|
|
2334
2349
|
switch (r) {
|
|
2335
2350
|
case "v":
|
|
@@ -2362,17 +2377,17 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2362
2377
|
if (r === "c") {
|
|
2363
2378
|
T = e;
|
|
2364
2379
|
let t = e.attributes, n = t.r;
|
|
2365
|
-
C =
|
|
2380
|
+
C = ye.fastStringToCol(n);
|
|
2366
2381
|
let r = t.t;
|
|
2367
2382
|
r === void 0 ? se = null : (se = r, se === "str" && (x = !0));
|
|
2368
2383
|
let i = t.s;
|
|
2369
|
-
i === void 0 && (
|
|
2384
|
+
i === void 0 && (Ce !== null || R) && (i = "0"), i !== void 0 && (i = parseInt(i), P && P.value === i && P.colEnd + 1 === C ? P.colEnd = C : (P = {
|
|
2370
2385
|
colStart: C,
|
|
2371
2386
|
rowStart: S,
|
|
2372
2387
|
colEnd: C,
|
|
2373
2388
|
rowEnd: S,
|
|
2374
2389
|
value: i
|
|
2375
|
-
}, l.push(
|
|
2390
|
+
}, l.push(P))), ie = null, re = !1;
|
|
2376
2391
|
let a = t.cm;
|
|
2377
2392
|
b = a !== void 0 && ((e) => {
|
|
2378
2393
|
let t = o?.get("metadata")?.cells;
|
|
@@ -2382,48 +2397,48 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2382
2397
|
})(a);
|
|
2383
2398
|
let s = t.vm;
|
|
2384
2399
|
if (s !== void 0) {
|
|
2385
|
-
let e =
|
|
2386
|
-
if (
|
|
2400
|
+
let e = _[parseInt(s) - 1];
|
|
2401
|
+
if (F.isError(e)) {
|
|
2387
2402
|
let t = e.getCode();
|
|
2388
2403
|
w = {
|
|
2389
2404
|
t: "e",
|
|
2390
2405
|
v: t
|
|
2391
|
-
}, b && t ===
|
|
2406
|
+
}, b && t === F.Code.Spill && (re = !0);
|
|
2392
2407
|
}
|
|
2393
2408
|
}
|
|
2394
2409
|
}
|
|
2395
2410
|
} else {
|
|
2396
|
-
if (
|
|
2411
|
+
if (L && r === "row") {
|
|
2397
2412
|
s = !0;
|
|
2398
2413
|
let t = e.attributes.r;
|
|
2399
|
-
if (S = parseInt(t) - 1, D = 0, de = e.attributes.customHeight, de !== void 0 && (D |=
|
|
2414
|
+
if (S = parseInt(t) - 1, D = 0, de = e.attributes.customHeight, de !== void 0 && (D |= Lt.CustomHeight), de !== he && (ve = !0, he = de), ue = e.attributes.ht, ue !== void 0 && (D |= Lt.Ht), ue !== me && (ve = !0, me = ue), O = e.attributes.hidden, O !== void 0 && (D |= Lt.Hidden), O !== j && (ve = !0, j = O), pe = e.attributes.s, pe !== void 0 && (D |= Lt.S), pe !== N && (ve = !0, N = pe), fe = e.attributes.customFormat, fe !== void 0 && (D |= Lt.CustomFormat), fe !== M && (ve = !0, M = fe), k = e.attributes.outlineLevel, k !== void 0 && (D |= Lt.OutlineLevel), k !== ge && (ve = !0, ge = k), A = e.attributes.collapsed, A !== void 0 && (D |= Lt.Collapsed), A !== _e && (ve = !0, _e = A), D !== 0) if (le + 1 !== S || ve) {
|
|
2400
2415
|
let e = de !== void 0 && (de === "1" || de === "true"), t = fe !== void 0 && (fe === "1" || fe === "true");
|
|
2401
|
-
|
|
2416
|
+
Ce = t && pe !== void 0 ? pe : null, t && Ce === null && (Ce = "0"), ce = {
|
|
2402
2417
|
min: S,
|
|
2403
2418
|
max: S,
|
|
2404
2419
|
value: {
|
|
2405
2420
|
sz: ue === void 0 ? -1 : parseFloat(ue),
|
|
2406
2421
|
csz: e,
|
|
2407
2422
|
h: O !== void 0 && (O === "1" || O === "true"),
|
|
2408
|
-
s:
|
|
2409
|
-
l:
|
|
2410
|
-
cl:
|
|
2423
|
+
s: Ce === null ? void 0 : Ce === "0" ? 0 : parseInt(Ce),
|
|
2424
|
+
l: k === void 0 || k === "0" ? 0 : parseInt(k),
|
|
2425
|
+
cl: A !== void 0 && (A === "1" || A === "true")
|
|
2411
2426
|
}
|
|
2412
|
-
},
|
|
2413
|
-
} else
|
|
2414
|
-
le = S,
|
|
2427
|
+
}, E.push(ce);
|
|
2428
|
+
} else ce.max = S;
|
|
2429
|
+
le = S, ve = !1;
|
|
2415
2430
|
return;
|
|
2416
2431
|
}
|
|
2417
|
-
if (r === "sheetData" && (
|
|
2418
|
-
|
|
2432
|
+
if (r === "sheetData" && (L = !0), !I && r === "sheetData") {
|
|
2433
|
+
I = !0;
|
|
2419
2434
|
let e = t.cols, n = e ? e.length : 0;
|
|
2420
|
-
for (let t = 0; !
|
|
2435
|
+
for (let t = 0; !R && t < n; t++) e[t].v.s && (R = !0);
|
|
2421
2436
|
}
|
|
2422
2437
|
n?.onOpenTag?.(e);
|
|
2423
2438
|
}
|
|
2424
2439
|
}, Ee = (t) => {
|
|
2425
2440
|
let r = t.name;
|
|
2426
|
-
if (r === "sheetData" && (
|
|
2441
|
+
if (r === "sheetData" && (L = !1), !u || r !== "c" && r !== "f" || (d && (m = te.get(d) ?? null), m && (y.append(S, C, m), ae && oe.append(S, C)), ie !== null && ne.push([ie, b ? re ? "error" : "dynamic" : "fixed"]), u = !1, m = null, d = null, f = null, c = !1, ae = !1, ie = null, b = !1, re = !1), T) {
|
|
2427
2442
|
let n = r.indexOf(":");
|
|
2428
2443
|
if (n !== -1 && (r = r.slice(n + 1)), x) if (r === "is" || r === "v") {
|
|
2429
2444
|
let t = a?.onEnd?.();
|
|
@@ -2432,7 +2447,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2432
2447
|
c &&= !1, r === "c" && (T = null, x = !1);
|
|
2433
2448
|
return;
|
|
2434
2449
|
}
|
|
2435
|
-
if (s) return s = !1, void (
|
|
2450
|
+
if (s) return s = !1, void (P = null);
|
|
2436
2451
|
n?.onCloseTag?.(t);
|
|
2437
2452
|
}, De = (i) => {
|
|
2438
2453
|
let o = i.trim();
|
|
@@ -2452,8 +2467,8 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2452
2467
|
if (o === "#VALUE!") {
|
|
2453
2468
|
let e = T.attributes.vm;
|
|
2454
2469
|
if (e !== void 0) {
|
|
2455
|
-
let t =
|
|
2456
|
-
if (
|
|
2470
|
+
let t = _[parseInt(e) - 1];
|
|
2471
|
+
if (F.isError(t)) {
|
|
2457
2472
|
w = {
|
|
2458
2473
|
t: "e",
|
|
2459
2474
|
v: t.getCode()
|
|
@@ -2462,11 +2477,11 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2462
2477
|
}
|
|
2463
2478
|
}
|
|
2464
2479
|
}
|
|
2465
|
-
let e =
|
|
2480
|
+
let e = F.getBuiltInByLabel(o);
|
|
2466
2481
|
e ? w = {
|
|
2467
2482
|
t: "e",
|
|
2468
2483
|
v: e.getCode()
|
|
2469
|
-
} : (w = o, r?.(`Unknown formula error '${o}' in cell ${
|
|
2484
|
+
} : (w = o, r?.(`Unknown formula error '${o}' in cell ${ye.cellToString({
|
|
2470
2485
|
colIndex: C,
|
|
2471
2486
|
rowIndex: S
|
|
2472
2487
|
})}`));
|
|
@@ -2477,33 +2492,33 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2477
2492
|
w !== null && e.pushAt(S, C, w);
|
|
2478
2493
|
}
|
|
2479
2494
|
if (d) {
|
|
2480
|
-
if (
|
|
2495
|
+
if (h === d) m = g;
|
|
2481
2496
|
else {
|
|
2482
2497
|
if (m = te.get(d) ?? null, !m) {
|
|
2483
2498
|
let e = [];
|
|
2484
|
-
p =
|
|
2499
|
+
p = ee(o, S, C, e), m = [
|
|
2485
2500
|
p,
|
|
2486
2501
|
e,
|
|
2487
2502
|
o
|
|
2488
2503
|
], te.set(d, m);
|
|
2489
2504
|
}
|
|
2490
|
-
|
|
2505
|
+
h = d, g = m;
|
|
2491
2506
|
}
|
|
2492
2507
|
d = null;
|
|
2493
2508
|
}
|
|
2494
2509
|
if (u) {
|
|
2495
|
-
if (
|
|
2510
|
+
if (v !== null) {
|
|
2496
2511
|
let e = ((e) => {
|
|
2497
|
-
if (e.length <
|
|
2498
|
-
let t =
|
|
2499
|
-
if (t === null || e.charCodeAt(t.end) !== 41 || e.charCodeAt(t.end + 1) !== 44 || e.charCodeAt(e.length - 1) !== 41) return
|
|
2512
|
+
if (e.length < Dt.length || e.slice(0, Dt.length).toUpperCase() !== Ot) return At;
|
|
2513
|
+
let t = Mt(e, Dt.length);
|
|
2514
|
+
if (t === null || e.charCodeAt(t.end) !== 41 || e.charCodeAt(t.end + 1) !== 44 || e.charCodeAt(e.length - 1) !== 41) return At;
|
|
2500
2515
|
let n = t.value;
|
|
2501
|
-
return n.toUpperCase() ===
|
|
2516
|
+
return n.toUpperCase() === kt ? jt : n.length === 0 ? At : {
|
|
2502
2517
|
kind: "formula",
|
|
2503
2518
|
formula: n
|
|
2504
2519
|
};
|
|
2505
2520
|
})(o);
|
|
2506
|
-
e.kind !== "none" &&
|
|
2521
|
+
e.kind !== "none" && v.push({
|
|
2507
2522
|
sheet: t,
|
|
2508
2523
|
rowIndex: S,
|
|
2509
2524
|
colIndex: C,
|
|
@@ -2511,7 +2526,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2511
2526
|
});
|
|
2512
2527
|
}
|
|
2513
2528
|
let e = [];
|
|
2514
|
-
p =
|
|
2529
|
+
p = ee(o, S, C, e), m = [
|
|
2515
2530
|
p,
|
|
2516
2531
|
e,
|
|
2517
2532
|
o
|
|
@@ -2537,11 +2552,11 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2537
2552
|
name: "f",
|
|
2538
2553
|
attributes: B,
|
|
2539
2554
|
isSelfClosing: !1
|
|
2540
|
-
},
|
|
2555
|
+
}, Ae = {
|
|
2541
2556
|
name: "v",
|
|
2542
2557
|
attributes: {},
|
|
2543
2558
|
isSelfClosing: !1
|
|
2544
|
-
},
|
|
2559
|
+
}, V = {
|
|
2545
2560
|
r: void 0,
|
|
2546
2561
|
s: void 0,
|
|
2547
2562
|
ht: void 0,
|
|
@@ -2550,11 +2565,11 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2550
2565
|
customHeight: void 0,
|
|
2551
2566
|
customFormat: void 0,
|
|
2552
2567
|
outlineLevel: void 0
|
|
2553
|
-
},
|
|
2568
|
+
}, H = {
|
|
2554
2569
|
name: "row",
|
|
2555
|
-
attributes:
|
|
2570
|
+
attributes: V,
|
|
2556
2571
|
isSelfClosing: !1
|
|
2557
|
-
}, U =
|
|
2572
|
+
}, U = St.NEED_MORE, W = St.NOT_HANDLED, je = St.decodeText, Me = !1, Ne = (e, t, n, r) => {
|
|
2558
2573
|
for (;;) {
|
|
2559
2574
|
let i = 0;
|
|
2560
2575
|
for (; t < n && ((i = e.charCodeAt(t)) === 32 || i === 9 || i === 10 || i === 13);) t++;
|
|
@@ -2579,18 +2594,18 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2579
2594
|
let u = e.charCodeAt(a);
|
|
2580
2595
|
if (r === 2) switch (o) {
|
|
2581
2596
|
case 1:
|
|
2582
|
-
u === 114 ?
|
|
2597
|
+
u === 114 ? V.r = e.slice(c, l) : u === 115 && (V.s = e.slice(c, l));
|
|
2583
2598
|
break;
|
|
2584
2599
|
case 2:
|
|
2585
|
-
e.startsWith("ht", a) && (
|
|
2600
|
+
e.startsWith("ht", a) && (V.ht = e.slice(c, l));
|
|
2586
2601
|
break;
|
|
2587
2602
|
case 6:
|
|
2588
|
-
e.startsWith("hidden", a) && (
|
|
2603
|
+
e.startsWith("hidden", a) && (V.hidden = e.slice(c, l));
|
|
2589
2604
|
break;
|
|
2590
2605
|
case 9:
|
|
2591
|
-
e.startsWith("collapsed", a) && (
|
|
2606
|
+
e.startsWith("collapsed", a) && (V.collapsed = e.slice(c, l));
|
|
2592
2607
|
break;
|
|
2593
|
-
case 12: e.startsWith("customHeight", a) ?
|
|
2608
|
+
case 12: e.startsWith("customHeight", a) ? V.customHeight = e.slice(c, l) : e.startsWith("customFormat", a) ? V.customFormat = e.slice(c, l) : e.startsWith("outlineLevel", a) && (V.outlineLevel = e.slice(c, l));
|
|
2594
2609
|
}
|
|
2595
2610
|
else if (r === 0) o === 1 ? u === 114 ? z.r = e.slice(c, l) : u === 116 ? z.t = e.slice(c, l) : u === 115 && (z.s = e.slice(c, l)) : o === 2 && e.charCodeAt(a + 1) === 109 && (u === 99 ? z.cm = e.slice(c, l) : u === 118 && (z.vm = e.slice(c, l)));
|
|
2596
2611
|
else if (o === 1) u === 116 && (B.t = e.slice(c, l));
|
|
@@ -2603,13 +2618,13 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2603
2618
|
return {
|
|
2604
2619
|
...n,
|
|
2605
2620
|
onEnd: () => {
|
|
2606
|
-
|
|
2607
|
-
let r = y.done(
|
|
2621
|
+
E.length > 0 && (t.rows = ye.runsToRefs(E, !1));
|
|
2622
|
+
let r = y.done(Rt), i = r.length;
|
|
2608
2623
|
if (i > 0) {
|
|
2609
2624
|
let e = Array(i);
|
|
2610
2625
|
for (let t = 0; t < i; t++) {
|
|
2611
|
-
let n = r[t], i =
|
|
2612
|
-
e[t] = [i,
|
|
2626
|
+
let n = r[t], i = ye.rangeToString(n), a = n.value[1];
|
|
2627
|
+
e[t] = [i, ye.resolveRelativeToA1(a, n.rowStart, n.colStart)];
|
|
2613
2628
|
}
|
|
2614
2629
|
t.formulas = e;
|
|
2615
2630
|
}
|
|
@@ -2618,14 +2633,14 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2618
2633
|
let e = Array(o);
|
|
2619
2634
|
for (let t = 0; t < o; t++) {
|
|
2620
2635
|
let n = a[t];
|
|
2621
|
-
e[t] =
|
|
2636
|
+
e[t] = ye.rangeToString(n);
|
|
2622
2637
|
}
|
|
2623
2638
|
t.volatile = e;
|
|
2624
2639
|
}
|
|
2625
2640
|
ne.length > 0 && (t.formulaArray = [...ne]);
|
|
2626
2641
|
let s = l.length;
|
|
2627
2642
|
if (s > 0) {
|
|
2628
|
-
l.sort(
|
|
2643
|
+
l.sort(xe.createRangeComparator(Se.Axis.Column));
|
|
2629
2644
|
let e = l[0], n = e.colStart, r = e.colEnd, i = e.rowEnd, a = e.value, o = [];
|
|
2630
2645
|
o.push(e);
|
|
2631
2646
|
let c = null;
|
|
@@ -2633,14 +2648,14 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2633
2648
|
let u = o.length, d = Array(u);
|
|
2634
2649
|
for (let e = 0; e < u; e++) {
|
|
2635
2650
|
let t = o[e];
|
|
2636
|
-
d[e] = [
|
|
2651
|
+
d[e] = [ye.rangeToString(t), t.value];
|
|
2637
2652
|
}
|
|
2638
2653
|
t.directStyles = d;
|
|
2639
2654
|
}
|
|
2640
2655
|
let c = e.build();
|
|
2641
2656
|
c && (t.data = c.tuples), n?.onEnd?.();
|
|
2642
2657
|
},
|
|
2643
|
-
onOpenTag:
|
|
2658
|
+
onOpenTag: Te,
|
|
2644
2659
|
onCloseTag: Ee,
|
|
2645
2660
|
onText: De,
|
|
2646
2661
|
elementScanners: [{
|
|
@@ -2684,23 +2699,23 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2684
2699
|
}
|
|
2685
2700
|
return W;
|
|
2686
2701
|
}
|
|
2687
|
-
return
|
|
2702
|
+
return Te(Oe), a && (Te(ke), c > o && De(je(e.slice(o, c))), Ee(ke)), l !== -1 && (Te(Ae), u > l && De(je(e.slice(l, u))), Ee(Ae)), Ee(Oe), d;
|
|
2688
2703
|
}
|
|
2689
2704
|
}, {
|
|
2690
2705
|
name: "row",
|
|
2691
|
-
openTag:
|
|
2706
|
+
openTag: H,
|
|
2692
2707
|
scan: (e, t, n) => {
|
|
2693
|
-
if (!
|
|
2694
|
-
|
|
2708
|
+
if (!L || s || T !== null) return W;
|
|
2709
|
+
V.r = V.s = V.ht = V.hidden = V.collapsed = V.customHeight = V.customFormat = V.outlineLevel = void 0;
|
|
2695
2710
|
let r = Ne(e, t + 4, n, 2);
|
|
2696
|
-
return r < 0 ? r : Me ||
|
|
2711
|
+
return r < 0 ? r : Me || V.r === void 0 ? W : (Te(H), r);
|
|
2697
2712
|
}
|
|
2698
2713
|
}]
|
|
2699
2714
|
};
|
|
2700
|
-
},
|
|
2715
|
+
}, Vt = (e) => {
|
|
2701
2716
|
let t = e.indexOf(":");
|
|
2702
2717
|
return t === -1 ? e : e.slice(t + 1);
|
|
2703
|
-
},
|
|
2718
|
+
}, Ht = {
|
|
2704
2719
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
|
|
2705
2720
|
"application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
|
|
2706
2721
|
"application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
|
|
@@ -2730,47 +2745,47 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2730
2745
|
"application/vnd.ms-excel.externalLink": "links",
|
|
2731
2746
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
|
|
2732
2747
|
"application/vnd.openxmlformats-officedocument.theme+xml": "themes"
|
|
2733
|
-
},
|
|
2734
|
-
let { password:
|
|
2735
|
-
|
|
2748
|
+
}, Ut = (e) => e.startsWith("/") ? e.slice(1) : e, Wt = /^xl\/(worksheets|chartsheets)\/[^/]+\.xml$/i, Gt = (e) => typeof e == "string" ? e : (e?.runs ?? []).map((e) => e.text ?? "").join(""), Kt = async (t, a) => {
|
|
2749
|
+
let { password: o, onVBA: s, profile: c, calcOnLoad: u = "auto", createWorkbookOptions: d = {}, ...f } = a ?? {}, p = !!d.origin && typeof d.origin != "string", m = c ? new B(typeof c == "function" ? c : void 0) : null, h = [], g = (e, t, n) => {
|
|
2750
|
+
h.push([
|
|
2736
2751
|
e,
|
|
2737
2752
|
t ?? "",
|
|
2738
2753
|
n
|
|
2739
2754
|
]);
|
|
2740
|
-
},
|
|
2741
|
-
if (
|
|
2742
|
-
|
|
2743
|
-
let t = Math.min(
|
|
2744
|
-
|
|
2745
|
-
} : void 0,
|
|
2755
|
+
}, _ = { onWarning: g }, v = a?.progress, ee = v?.onProgress ? v.onProgress.bind(v) : void 0, y = t.byteLength, te = 0, ne = 0, ie = ee ? (e) => {
|
|
2756
|
+
if (te <= 0) return;
|
|
2757
|
+
ne += e;
|
|
2758
|
+
let t = Math.min(y, Math.round(ne / te * y));
|
|
2759
|
+
ee(t, y);
|
|
2760
|
+
} : void 0, ae = import("./DsSIg46AR7IFBN5N.mjs"), x = null;
|
|
2746
2761
|
try {
|
|
2747
|
-
|
|
2762
|
+
x = new DOMParser();
|
|
2748
2763
|
} catch {}
|
|
2749
|
-
let
|
|
2764
|
+
let C = null;
|
|
2750
2765
|
try {
|
|
2751
|
-
|
|
2766
|
+
C = new XMLSerializer();
|
|
2752
2767
|
} catch {}
|
|
2753
|
-
let
|
|
2754
|
-
|
|
2768
|
+
let T, E, D, O = null;
|
|
2769
|
+
x || (O = import("./C-2KaUyV4gs-sDTZ.mjs").then((e) => re(e.default, 1)));
|
|
2755
2770
|
try {
|
|
2756
|
-
let [e, t] = await Promise.all([
|
|
2757
|
-
|
|
2771
|
+
let [e, t] = await Promise.all([O, ae]);
|
|
2772
|
+
T = new t.DOMTransformer(), E = x ?? new e.DOMParser(), D = C ?? new e.XMLSerializer();
|
|
2758
2773
|
} catch (e) {
|
|
2759
2774
|
throw Error("Unable to load XLSX parser.", { cause: e });
|
|
2760
2775
|
}
|
|
2761
|
-
let
|
|
2776
|
+
let fe = (e) => D.serializeToString(e), N;
|
|
2762
2777
|
try {
|
|
2763
|
-
|
|
2778
|
+
N = await Oe.create(t);
|
|
2764
2779
|
} catch (e) {
|
|
2765
|
-
throw new
|
|
2780
|
+
throw new P("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: e });
|
|
2766
2781
|
}
|
|
2767
|
-
|
|
2782
|
+
m?.mark("zip-open");
|
|
2768
2783
|
try {
|
|
2769
|
-
if (!
|
|
2770
|
-
let
|
|
2771
|
-
let t =
|
|
2784
|
+
if (!N.has("[Content_Types].xml")) throw new P("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
2785
|
+
let t = (e) => {
|
|
2786
|
+
let t = N.getEntry(e);
|
|
2772
2787
|
return t ? { content: t } : void 0;
|
|
2773
|
-
},
|
|
2788
|
+
}, a = {
|
|
2774
2789
|
workbooks: [],
|
|
2775
2790
|
sheets: [],
|
|
2776
2791
|
charts: [],
|
|
@@ -2803,7 +2818,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2803
2818
|
let t = r.ContentType, n = r.PartName;
|
|
2804
2819
|
if (!t || !n) return;
|
|
2805
2820
|
e.overrides[n.startsWith("/") ? n.slice(1) : n] = t;
|
|
2806
|
-
let i =
|
|
2821
|
+
let i = Ht[t], a = i ? e[i] : void 0;
|
|
2807
2822
|
Array.isArray(a) && a.push(n);
|
|
2808
2823
|
} else if (n === "Default") {
|
|
2809
2824
|
let t = r.Extension, n = r.ContentType;
|
|
@@ -2816,133 +2831,133 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2816
2831
|
onError: (e) => {
|
|
2817
2832
|
t?.(`Error parsing content types: ${e?.message ?? e}`);
|
|
2818
2833
|
}
|
|
2819
|
-
}))(
|
|
2820
|
-
|
|
2821
|
-
}),
|
|
2822
|
-
if (!
|
|
2834
|
+
}))(a, (e) => {
|
|
2835
|
+
h.push([e, "[Content_Types].xml"]);
|
|
2836
|
+
}), t = await N.getTextStream("[Content_Types].xml");
|
|
2837
|
+
if (!t) throw Error("Error parsing content types: '[Content_Types].xml'");
|
|
2823
2838
|
try {
|
|
2824
|
-
await
|
|
2839
|
+
await dt.parseStream(t, e, { xmlns: !1 });
|
|
2825
2840
|
} catch (e) {
|
|
2826
2841
|
throw Error("Error parsing content types: '[Content_Types].xml'", { cause: e });
|
|
2827
2842
|
}
|
|
2828
|
-
|
|
2829
|
-
}
|
|
2830
|
-
|
|
2831
|
-
let
|
|
2832
|
-
for (let e of
|
|
2833
|
-
|
|
2834
|
-
for (let e of
|
|
2835
|
-
if (await
|
|
2836
|
-
let
|
|
2837
|
-
if (
|
|
2838
|
-
for (let
|
|
2839
|
-
|
|
2843
|
+
p && await N.getBuffer("[Content_Types].xml");
|
|
2844
|
+
}
|
|
2845
|
+
m?.mark("content-types");
|
|
2846
|
+
let o = a.sst, f = /* @__PURE__ */ new Set();
|
|
2847
|
+
for (let e of a.sheets) f.add(Ut(e));
|
|
2848
|
+
o && f.add(Ut(o));
|
|
2849
|
+
for (let e of f) te += N.uncompressedSize(e);
|
|
2850
|
+
if (await N.prefetch((e) => !f.has(e) && !Wt.test(e)), m?.mark("prefetch-side-parts"), a.workbooks.length === 0) {
|
|
2851
|
+
let e = M("_rels/.rels", t, E, T, _);
|
|
2852
|
+
if (e) {
|
|
2853
|
+
for (let t of e.values()) if (t.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" && t.target) {
|
|
2854
|
+
a.workbooks.push(t.target);
|
|
2840
2855
|
break;
|
|
2841
2856
|
}
|
|
2842
2857
|
}
|
|
2843
2858
|
}
|
|
2844
|
-
if (
|
|
2845
|
-
|
|
2846
|
-
let
|
|
2847
|
-
|
|
2859
|
+
if (a.workbooks.length === 0) throw new P("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
2860
|
+
a.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], a.richdata = ["/xl/richData/rdrichvalue.xml"];
|
|
2861
|
+
let ne = d?.resources ?? new we(), re = ne.beginPersist(), ae = {}, x = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Map();
|
|
2862
|
+
C.set("richTypes", []), C.set("parseInlineDxf", (e) => {
|
|
2848
2863
|
if (!e) return;
|
|
2849
|
-
let t =
|
|
2864
|
+
let t = E.parseFromString(`<dxf xmlns:x14="${se}" xmlns:xm="${l}">${e}</dxf>`, "text/xml")?.documentElement;
|
|
2850
2865
|
if (!t) return;
|
|
2851
|
-
let n =
|
|
2866
|
+
let n = T.parseDxf(t, "", _);
|
|
2852
2867
|
return Object.keys(n).length > 0 ? n : void 0;
|
|
2853
2868
|
});
|
|
2854
|
-
let
|
|
2855
|
-
|
|
2856
|
-
let
|
|
2857
|
-
|
|
2858
|
-
let
|
|
2859
|
-
|
|
2860
|
-
},
|
|
2861
|
-
let r =
|
|
2862
|
-
return a || (a =
|
|
2863
|
-
},
|
|
2864
|
-
let
|
|
2865
|
-
if (!
|
|
2866
|
-
if (
|
|
2867
|
-
if (!
|
|
2868
|
-
let e =
|
|
2869
|
-
return e.addReference(
|
|
2869
|
+
let D = [];
|
|
2870
|
+
C.set("dummyWrapped", D);
|
|
2871
|
+
let O = j("metadata", a, t, E, T, _).entries().next()?.value?.[1]?.metadata;
|
|
2872
|
+
O && C.set("metadata", O), C.set(Ft, i());
|
|
2873
|
+
let be = /* @__PURE__ */ new Map(), xe = [], F = /* @__PURE__ */ new Set(), I = (e) => {
|
|
2874
|
+
F.add(Ut(e));
|
|
2875
|
+
}, L = (e, n = be) => {
|
|
2876
|
+
let r = e.lastIndexOf("/"), i = e.substring(0, r + 1) + "_rels/" + e.substring(r + 1, e.length) + ".rels", a = n.get(i);
|
|
2877
|
+
return a || (a = M(i, t, E, T, H), n.set(i, a)), a;
|
|
2878
|
+
}, Se = (n, r, i, a = be) => {
|
|
2879
|
+
let o = L(r, a).get(n), s = o?.target;
|
|
2880
|
+
if (!s) return null;
|
|
2881
|
+
if (o.targetMode === "External") {
|
|
2882
|
+
if (!i) return o.target;
|
|
2883
|
+
let e = ne.add({ source: { external: o.target } });
|
|
2884
|
+
return e.addReference(ae), x.add(e), re.toResourceId(e);
|
|
2870
2885
|
}
|
|
2871
|
-
let
|
|
2872
|
-
|
|
2873
|
-
let
|
|
2874
|
-
if (!
|
|
2875
|
-
let
|
|
2876
|
-
|
|
2877
|
-
let
|
|
2878
|
-
|
|
2879
|
-
}, void 0,
|
|
2880
|
-
if (
|
|
2881
|
-
await
|
|
2886
|
+
let c = r.lastIndexOf("/"), l = r.substring(0, c + 1);
|
|
2887
|
+
s.startsWith("/") || (s = l + s), s = me(s);
|
|
2888
|
+
let u = T?.getVisitorParamsState().get("dxfs"), d = a.get(s);
|
|
2889
|
+
if (!d) if (o.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") {
|
|
2890
|
+
let t = {};
|
|
2891
|
+
d = t, xe.push((async () => {
|
|
2892
|
+
let n = It(t, (e, t) => t === "legacyDrawing" ? z(e, s) : t === "formControl" ? Oe(e, s) : t === "part" ? B(e, s) : Se(e, s, t === "resource") ?? null, Ne, u, () => {}, (e, t, n) => {
|
|
2893
|
+
g(e, t ? `${t} (${s})` : s, n);
|
|
2894
|
+
}, void 0, C), r = await N.getTextStream(s, ie);
|
|
2895
|
+
if (r) try {
|
|
2896
|
+
await dt.parseStream(r, n, {
|
|
2882
2897
|
xmlns: !1,
|
|
2883
2898
|
lean: !0
|
|
2884
2899
|
});
|
|
2885
2900
|
} catch (e) {
|
|
2886
|
-
throw Error(`Error parsing sheet: '${
|
|
2901
|
+
throw Error(`Error parsing sheet: '${s}'`, { cause: e });
|
|
2887
2902
|
}
|
|
2888
|
-
let
|
|
2889
|
-
if (
|
|
2890
|
-
Ee(
|
|
2891
|
-
let
|
|
2892
|
-
|
|
2893
|
-
if (
|
|
2894
|
-
let
|
|
2895
|
-
if (!
|
|
2896
|
-
let
|
|
2897
|
-
if (isNaN(
|
|
2898
|
-
let
|
|
2899
|
-
|
|
2900
|
-
...
|
|
2901
|
-
cacheId:
|
|
2902
|
-
part:
|
|
2903
|
+
let i = L(s, a);
|
|
2904
|
+
if (i) {
|
|
2905
|
+
Ee(t, s, i, a), w(t);
|
|
2906
|
+
let n = [];
|
|
2907
|
+
i.forEach((t, r) => {
|
|
2908
|
+
if (t.type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable") return;
|
|
2909
|
+
let i = B(r, s, t.type, (e) => e !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition");
|
|
2910
|
+
if (!i?.xml) return;
|
|
2911
|
+
let a = /<pivotTableDefinition\b[^>]*>/.exec(i.xml)?.[0] ?? "", o = parseInt(/\scacheId="(\d+)"/.exec(a)?.[1] ?? "", 10);
|
|
2912
|
+
if (isNaN(o)) return void h.push([`Pivot table '${i.name}' names no cache and was dropped.`, s]);
|
|
2913
|
+
let c = /\sname="([^"]*)"/.exec(a)?.[1];
|
|
2914
|
+
n.push({
|
|
2915
|
+
...c ? { name: e(c) } : {},
|
|
2916
|
+
cacheId: o,
|
|
2917
|
+
part: i
|
|
2903
2918
|
});
|
|
2904
|
-
}),
|
|
2919
|
+
}), n.length > 0 && (t.pivotTables = n);
|
|
2905
2920
|
}
|
|
2906
2921
|
})());
|
|
2907
|
-
} else if (
|
|
2908
|
-
let
|
|
2909
|
-
if (
|
|
2910
|
-
let
|
|
2911
|
-
delete
|
|
2912
|
-
let
|
|
2913
|
-
|
|
2922
|
+
} else if (o.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink") {
|
|
2923
|
+
let e = pe(s, t, E, T, H);
|
|
2924
|
+
if (e && Object.keys(e).length !== 0) {
|
|
2925
|
+
let t = e, n = t.__bookRelId, r = t.__absoluteUrlRelId;
|
|
2926
|
+
delete t.__bookRelId, delete t.__absoluteUrlRelId;
|
|
2927
|
+
let i = [];
|
|
2928
|
+
L(s, a)?.forEach((e, t) => {
|
|
2914
2929
|
if (e.targetMode === "External" && e.type && e.target) {
|
|
2915
|
-
let
|
|
2930
|
+
let a = {
|
|
2916
2931
|
type: e.type,
|
|
2917
2932
|
target: e.target
|
|
2918
2933
|
};
|
|
2919
|
-
t === n ?
|
|
2934
|
+
t === n ? a.role = "book" : t === r && (a.role = "absoluteUrl"), i.push(a);
|
|
2920
2935
|
}
|
|
2921
|
-
}),
|
|
2922
|
-
} else
|
|
2923
|
-
} else
|
|
2924
|
-
let n =
|
|
2925
|
-
return n.addReference(
|
|
2926
|
-
},
|
|
2927
|
-
return
|
|
2936
|
+
}), i.sort((e, t) => (e.role === "book" ? 0 : 1) - (t.role === "book" ? 0 : 1)), t.sources = i, I(s), d = t;
|
|
2937
|
+
} else d = null;
|
|
2938
|
+
} else d = i ? A(s, t, (e, t) => {
|
|
2939
|
+
let n = ne.add({ source: { buffer: e } });
|
|
2940
|
+
return n.addReference(ae), x.add(n), re.toResourceId(n);
|
|
2941
|
+
}, H) : pe(s, t, E, T, H);
|
|
2942
|
+
return d;
|
|
2928
2943
|
}, R = (e, t) => {
|
|
2929
2944
|
if (!e) return null;
|
|
2930
|
-
let n =
|
|
2945
|
+
let n = L(t, be)?.get(e);
|
|
2931
2946
|
if (!n?.target || n.targetMode === "External") return null;
|
|
2932
2947
|
let r = n.target;
|
|
2933
|
-
return r.startsWith("/") || (r = t.substring(0, t.lastIndexOf("/") + 1) + r),
|
|
2948
|
+
return r.startsWith("/") || (r = t.substring(0, t.lastIndexOf("/") + 1) + r), me(r);
|
|
2934
2949
|
}, Ee = (e, t, n, r) => {
|
|
2935
2950
|
let i = [], a = /* @__PURE__ */ new Map(), o = [];
|
|
2936
2951
|
n.forEach((e, n) => {
|
|
2937
2952
|
if (e.type !== "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment") return;
|
|
2938
|
-
let s =
|
|
2953
|
+
let s = Se(n, t, !1, r)?.comments;
|
|
2939
2954
|
if (!s) return;
|
|
2940
2955
|
for (let e = 0; e < s.length; e++) {
|
|
2941
2956
|
let t = s[e];
|
|
2942
2957
|
if (!t?.v?.id) continue;
|
|
2943
2958
|
let { parentId: n, done: r, content: c, ...l } = t.v, u = {
|
|
2944
2959
|
...l,
|
|
2945
|
-
content:
|
|
2960
|
+
content: Gt(c)
|
|
2946
2961
|
};
|
|
2947
2962
|
n ? o.push({
|
|
2948
2963
|
parentId: n,
|
|
@@ -2953,7 +2968,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2953
2968
|
}));
|
|
2954
2969
|
}
|
|
2955
2970
|
let c = R(n, t);
|
|
2956
|
-
c &&
|
|
2971
|
+
c && I(c);
|
|
2957
2972
|
});
|
|
2958
2973
|
for (let e = 0; e < o.length; e++) {
|
|
2959
2974
|
let { parentId: t, json: n } = o[e], r = a.get(t);
|
|
@@ -2962,7 +2977,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2962
2977
|
let s = [];
|
|
2963
2978
|
if (n.forEach((e, n) => {
|
|
2964
2979
|
if (e.type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") return;
|
|
2965
|
-
let i =
|
|
2980
|
+
let i = Se(n, t, !1, r), o = i?.comments;
|
|
2966
2981
|
if (!o) return;
|
|
2967
2982
|
let c = i?.authors;
|
|
2968
2983
|
for (let e = 0; e < o.length; e++) {
|
|
@@ -2970,30 +2985,30 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
2970
2985
|
if (!t?.r) continue;
|
|
2971
2986
|
let n = c && t.v.authorId !== void 0 ? c[t.v.authorId] : void 0;
|
|
2972
2987
|
if (n && n.startsWith("tc=")) {
|
|
2973
|
-
if (a.has(
|
|
2988
|
+
if (a.has(k(n.substring(3)))) continue;
|
|
2974
2989
|
n = void 0;
|
|
2975
2990
|
}
|
|
2976
2991
|
let r = {
|
|
2977
|
-
id:
|
|
2992
|
+
id: ve.uuidV4().toUpperCase(),
|
|
2978
2993
|
asNote: !0,
|
|
2979
2994
|
content: t.v.content ?? ""
|
|
2980
|
-
}, i = n ?
|
|
2995
|
+
}, i = n ? V({ displayName: n }) : void 0;
|
|
2981
2996
|
i && (r.personId = i.id), s.push({
|
|
2982
2997
|
r: t.r,
|
|
2983
2998
|
v: r
|
|
2984
2999
|
});
|
|
2985
3000
|
}
|
|
2986
3001
|
let l = R(n, t);
|
|
2987
|
-
l &&
|
|
3002
|
+
l && I(l);
|
|
2988
3003
|
}), i.length === 0 && s.length === 0) return;
|
|
2989
3004
|
let c = [...i, ...s], l = e.legacyDrawing;
|
|
2990
3005
|
if (l?.xml) {
|
|
2991
|
-
let { rest: t, notes: n } =
|
|
3006
|
+
let { rest: t, notes: n } = ce(l.xml);
|
|
2992
3007
|
if (n.length > 0) {
|
|
2993
3008
|
let r = /* @__PURE__ */ new Map();
|
|
2994
3009
|
for (let e = 0; e < n.length; e++) {
|
|
2995
3010
|
let t = n[e];
|
|
2996
|
-
r.set(
|
|
3011
|
+
r.set(ye.cellToString({
|
|
2997
3012
|
rowIndex: t.row,
|
|
2998
3013
|
colIndex: t.col
|
|
2999
3014
|
}), t);
|
|
@@ -3001,7 +3016,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3001
3016
|
for (let e = 0; e < c.length; e++) {
|
|
3002
3017
|
let t = c[e], n = r.get(String(t.r).toUpperCase());
|
|
3003
3018
|
if (!n || (r.delete(String(t.r).toUpperCase()), !t.v.asNote)) continue;
|
|
3004
|
-
let i =
|
|
3019
|
+
let i = S(n.xml), a = {};
|
|
3005
3020
|
if (i.anchor) {
|
|
3006
3021
|
let [e, t, r, o, s, c, l, u] = i.anchor;
|
|
3007
3022
|
a.anchor = {
|
|
@@ -3025,49 +3040,54 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3025
3040
|
r.forEach((e) => {
|
|
3026
3041
|
i.push(e.xml);
|
|
3027
3042
|
});
|
|
3028
|
-
let a =
|
|
3043
|
+
let a = oe(t, i);
|
|
3029
3044
|
a ? l.xml = a : delete e.legacyDrawing;
|
|
3030
3045
|
}
|
|
3031
3046
|
}
|
|
3032
3047
|
e.comments = c;
|
|
3033
|
-
},
|
|
3034
|
-
let r = R(
|
|
3048
|
+
}, z = (e, n) => {
|
|
3049
|
+
let r = R(e, n);
|
|
3035
3050
|
if (!r) return null;
|
|
3036
|
-
let i =
|
|
3051
|
+
let i = t(Ut(r));
|
|
3037
3052
|
if (!i) return null;
|
|
3038
3053
|
let a = { xml: new TextDecoder("utf-8").decode(i.content) }, o = [];
|
|
3039
|
-
return
|
|
3054
|
+
return L(r, be)?.forEach((e, t) => {
|
|
3040
3055
|
if (e.type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") return;
|
|
3041
|
-
let n =
|
|
3056
|
+
let n = Se(t, r, !0);
|
|
3042
3057
|
typeof n == "number" && o.push({
|
|
3043
3058
|
id: t,
|
|
3044
3059
|
resId: n
|
|
3045
3060
|
});
|
|
3046
|
-
}), o.length > 0 && (a.images = o),
|
|
3047
|
-
},
|
|
3048
|
-
let
|
|
3061
|
+
}), o.length > 0 && (a.images = o), I(r), a;
|
|
3062
|
+
}, Oe = (e, n) => {
|
|
3063
|
+
let r = R(e, n);
|
|
3064
|
+
if (!r) return null;
|
|
3065
|
+
let i = pe(r, t, E, T, H)?.formControl ?? null;
|
|
3066
|
+
return i && I(r), i;
|
|
3067
|
+
}, B = (e, n, r, i, o = /* @__PURE__ */ new Set()) => {
|
|
3068
|
+
let s = R(e, n);
|
|
3049
3069
|
if (!s || o.has(s)) return null;
|
|
3050
|
-
let c =
|
|
3070
|
+
let c = r ?? L(n, be)?.get(e)?.type;
|
|
3051
3071
|
if (!c) return null;
|
|
3052
|
-
let l =
|
|
3072
|
+
let l = t(Ut(s));
|
|
3053
3073
|
if (!l) return null;
|
|
3054
3074
|
o.add(s);
|
|
3055
|
-
let u = s.substring(s.lastIndexOf("/") + 1), d =
|
|
3056
|
-
id:
|
|
3075
|
+
let u = s.substring(s.lastIndexOf("/") + 1), d = a.overrides[Ut(s)] ?? a.defaults[u.substring(u.lastIndexOf(".") + 1).toLowerCase()], f = {
|
|
3076
|
+
id: e,
|
|
3057
3077
|
type: c,
|
|
3058
3078
|
name: u
|
|
3059
3079
|
};
|
|
3060
3080
|
if (d && (f.contentType = d), ((e, t) => e ? e.endsWith("+xml") || e === "application/xml" : /\.(xml|rels|vml)$/i.test(t))(d, u)) f.xml = new TextDecoder("utf-8").decode(l.content);
|
|
3061
3081
|
else {
|
|
3062
|
-
let
|
|
3063
|
-
if (typeof
|
|
3064
|
-
f.resId =
|
|
3082
|
+
let t = Se(e, n, !0);
|
|
3083
|
+
if (typeof t != "number") return null;
|
|
3084
|
+
f.resId = t;
|
|
3065
3085
|
}
|
|
3066
3086
|
let p = [];
|
|
3067
|
-
return
|
|
3068
|
-
if (!e?.type ||
|
|
3087
|
+
return L(s, be)?.forEach((e, t) => {
|
|
3088
|
+
if (!e?.type || i && !i(e.type)) return;
|
|
3069
3089
|
if (e.targetMode === "External") {
|
|
3070
|
-
let n =
|
|
3090
|
+
let n = Se(t, s, !0);
|
|
3071
3091
|
typeof n == "number" && p.push({
|
|
3072
3092
|
id: t,
|
|
3073
3093
|
type: e.type,
|
|
@@ -3075,118 +3095,118 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3075
3095
|
});
|
|
3076
3096
|
return;
|
|
3077
3097
|
}
|
|
3078
|
-
let n =
|
|
3098
|
+
let n = B(t, s, e.type, i, o);
|
|
3079
3099
|
n && p.push(n);
|
|
3080
|
-
}), p.length > 0 && (f.parts = p),
|
|
3100
|
+
}), p.length > 0 && (f.parts = p), I(s), f;
|
|
3081
3101
|
};
|
|
3082
|
-
|
|
3083
|
-
let
|
|
3084
|
-
if (
|
|
3085
|
-
let [e, t] =
|
|
3086
|
-
|
|
3087
|
-
}
|
|
3088
|
-
let
|
|
3089
|
-
if (e) return
|
|
3090
|
-
},
|
|
3091
|
-
paramMap:
|
|
3092
|
-
getRefs:
|
|
3093
|
-
getRef:
|
|
3094
|
-
parsedRefs:
|
|
3095
|
-
readEmbeddedPart: (e, t) =>
|
|
3096
|
-
addPerson:
|
|
3097
|
-
serializeElement:
|
|
3098
|
-
onWarning:
|
|
3099
|
-
},
|
|
3100
|
-
if (
|
|
3101
|
-
let e = await
|
|
3102
|
+
j("coreprops", a, t, E, T, _), j("extprops", a, t, E, T, _);
|
|
3103
|
+
let ke = new Ce(), Ae = j("people", a, t, E, T, _);
|
|
3104
|
+
if (Ae.size > 0) {
|
|
3105
|
+
let [e, t] = Ae.entries().next().value;
|
|
3106
|
+
ke.fromJSON(t?.persons), I(e);
|
|
3107
|
+
}
|
|
3108
|
+
let V = (e) => {
|
|
3109
|
+
if (e) return ke.add(e).toJSON();
|
|
3110
|
+
}, H = {
|
|
3111
|
+
paramMap: C,
|
|
3112
|
+
getRefs: L,
|
|
3113
|
+
getRef: Se,
|
|
3114
|
+
parsedRefs: be,
|
|
3115
|
+
readEmbeddedPart: (e, t) => B(e, t),
|
|
3116
|
+
addPerson: V,
|
|
3117
|
+
serializeElement: fe,
|
|
3118
|
+
onWarning: g
|
|
3119
|
+
}, U = [];
|
|
3120
|
+
if (o) {
|
|
3121
|
+
let e = await N.getTextStream(o, ie);
|
|
3102
3122
|
if (e) {
|
|
3103
3123
|
let t = ((e, t) => {
|
|
3104
3124
|
let n = !1, r = !1, i = 0, a = "";
|
|
3105
3125
|
return {
|
|
3106
3126
|
onOpenTag: (e) => {
|
|
3107
|
-
let t =
|
|
3127
|
+
let t = Vt(e.name);
|
|
3108
3128
|
t === "t" ? n && i === 0 && (r = !0) : t === "si" ? (n = !0, a = "", i = 0) : t !== "rPh" && t !== "phoneticPr" || i++;
|
|
3109
3129
|
},
|
|
3110
3130
|
onText: (e) => {
|
|
3111
3131
|
r && (a += e);
|
|
3112
3132
|
},
|
|
3113
3133
|
onCloseTag: (t) => {
|
|
3114
|
-
let o =
|
|
3115
|
-
o === "t" ? r = !1 : o === "si" ? (e(
|
|
3134
|
+
let o = Vt(t.name);
|
|
3135
|
+
o === "t" ? r = !1 : o === "si" ? (e(le(a)), n = !1, a = "") : o !== "rPh" && o !== "phoneticPr" || i > 0 && i--;
|
|
3116
3136
|
},
|
|
3117
3137
|
onError: (e) => {
|
|
3118
3138
|
t?.(`Error parsing shared strings: ${e?.message ?? e}`);
|
|
3119
3139
|
}
|
|
3120
3140
|
};
|
|
3121
3141
|
})((e) => {
|
|
3122
|
-
|
|
3142
|
+
U.push(e);
|
|
3123
3143
|
}, (e) => {
|
|
3124
|
-
|
|
3144
|
+
g(e, o);
|
|
3125
3145
|
});
|
|
3126
3146
|
try {
|
|
3127
|
-
await
|
|
3147
|
+
await dt.parseStream(e, t, { xmlns: !1 });
|
|
3128
3148
|
} catch (e) {
|
|
3129
|
-
throw Error(`Error parsing shared strings: '${
|
|
3149
|
+
throw Error(`Error parsing shared strings: '${o}'`, { cause: e });
|
|
3130
3150
|
}
|
|
3131
3151
|
}
|
|
3132
3152
|
}
|
|
3133
|
-
|
|
3134
|
-
let
|
|
3135
|
-
let t =
|
|
3153
|
+
m?.mark("shared-strings");
|
|
3154
|
+
let W = U.length, je = /* @__PURE__ */ new Map(), Me = W, Ne = (e) => {
|
|
3155
|
+
let t = je.get(e);
|
|
3136
3156
|
if (t !== void 0) return t;
|
|
3137
|
-
let n =
|
|
3138
|
-
return
|
|
3139
|
-
},
|
|
3140
|
-
|
|
3141
|
-
let
|
|
3142
|
-
for (let e = 0; e <
|
|
3143
|
-
let t =
|
|
3144
|
-
t && t.startsWith("xl/slicerCache") &&
|
|
3145
|
-
}
|
|
3146
|
-
let
|
|
3147
|
-
|
|
3157
|
+
let n = Me;
|
|
3158
|
+
return je.set(e, Me++), U.push(e), n;
|
|
3159
|
+
}, Pe = [];
|
|
3160
|
+
a.slicersCache = Pe;
|
|
3161
|
+
let Fe = N.getNames(), Ie = Fe.length;
|
|
3162
|
+
for (let e = 0; e < Ie; e++) {
|
|
3163
|
+
let t = Fe[e];
|
|
3164
|
+
t && t.startsWith("xl/slicerCache") && Pe.push(`/${t}`);
|
|
3165
|
+
}
|
|
3166
|
+
let Le = j("slicersCache", a, t, E, T, H), Re = /* @__PURE__ */ new Map();
|
|
3167
|
+
Le.forEach((e) => {
|
|
3148
3168
|
let t = e.name;
|
|
3149
|
-
delete e.name,
|
|
3150
|
-
}),
|
|
3151
|
-
let
|
|
3152
|
-
if (
|
|
3153
|
-
let e =
|
|
3154
|
-
e?.value?.[1] && (
|
|
3155
|
-
}
|
|
3156
|
-
let
|
|
3157
|
-
|
|
3158
|
-
let
|
|
3159
|
-
|
|
3169
|
+
delete e.name, Re.set(t, e);
|
|
3170
|
+
}), C.set("slicerCaches", Re), j("richstructure", a, t, E, T, H), j("richdata", a, t, E, T, H);
|
|
3171
|
+
let ze = j("themes", a, t, E, T, H), G = null;
|
|
3172
|
+
if (ze && ze.entries) {
|
|
3173
|
+
let e = ze.entries().next();
|
|
3174
|
+
e?.value?.[1] && (G = e.value[1]);
|
|
3175
|
+
}
|
|
3176
|
+
let Be = new Te(G), Ve = j("styles", a, t, E, T, H).entries().next()?.value?.[1];
|
|
3177
|
+
Ve &&= JSON.parse(_e.JSONStableStringify(Ve));
|
|
3178
|
+
let He = j("workbooks", a, t, E, T, H);
|
|
3179
|
+
m?.mark("side-parts-json"), await Promise.all(xe);
|
|
3160
3180
|
{
|
|
3161
|
-
let e =
|
|
3181
|
+
let e = He.entries().next().value?.[1], t = i(e?.names), n = e?.sheets ?? [];
|
|
3162
3182
|
for (let e = 0; e < n.length; e++) {
|
|
3163
|
-
let
|
|
3164
|
-
|
|
3183
|
+
let i = n[e]?.sheet;
|
|
3184
|
+
i && r(i, t);
|
|
3165
3185
|
}
|
|
3166
|
-
let
|
|
3167
|
-
if (
|
|
3168
|
-
let n =
|
|
3169
|
-
typeof n == "string" && (
|
|
3186
|
+
let a = e?.names;
|
|
3187
|
+
if (a) for (let e = 0; e < a.length; e++) {
|
|
3188
|
+
let n = a[e]?.ref;
|
|
3189
|
+
typeof n == "string" && (a[e].ref = t.readDetached(n));
|
|
3170
3190
|
}
|
|
3171
3191
|
}
|
|
3172
|
-
|
|
3173
|
-
let
|
|
3174
|
-
...
|
|
3175
|
-
styles:
|
|
3176
|
-
theme:
|
|
3192
|
+
ee && te > 0 && (ee(y, y), await new Promise((e) => setTimeout(e, 0))), m?.mark("sheets");
|
|
3193
|
+
let Ue = {
|
|
3194
|
+
...He.entries().next().value?.[1],
|
|
3195
|
+
styles: Ve,
|
|
3196
|
+
theme: Be.toJSON()
|
|
3177
3197
|
};
|
|
3178
|
-
|
|
3179
|
-
...
|
|
3198
|
+
he(Ue, C.get(ge)), Ue.calc = {
|
|
3199
|
+
...Ue.calc ?? {},
|
|
3180
3200
|
legacyIntersect: !0
|
|
3181
|
-
},
|
|
3182
|
-
let
|
|
3183
|
-
|
|
3184
|
-
let
|
|
3185
|
-
if (
|
|
3186
|
-
let { VBAProject: e } = await import("./
|
|
3201
|
+
}, U.length > 0 && (Ue.strings = U);
|
|
3202
|
+
let We = ke.toJSON();
|
|
3203
|
+
We && We.length > 0 && (Ue.people = We);
|
|
3204
|
+
let Ge = N.getEntry("xl/vbaProject.bin");
|
|
3205
|
+
if (Ge) try {
|
|
3206
|
+
let { VBAProject: e } = await import("./CRrTMRdN_IcSA_pm.mjs"), t = e.extract(Ge);
|
|
3187
3207
|
if (t) {
|
|
3188
3208
|
let n = /* @__PURE__ */ new Map();
|
|
3189
|
-
for (let e of
|
|
3209
|
+
for (let e of Ue.sheets ?? []) {
|
|
3190
3210
|
let t = e?.sheet?.codeName;
|
|
3191
3211
|
t && n.set(t, e.sheet);
|
|
3192
3212
|
}
|
|
@@ -3195,25 +3215,25 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3195
3215
|
a && (t.source = a), i && (t.sourceHeader = i);
|
|
3196
3216
|
let o = r.type === "document" ? n.get(r.name) : void 0;
|
|
3197
3217
|
o || r.type !== "document" || (t.scope = "workbook");
|
|
3198
|
-
let s = o ? o.modules ??= {} :
|
|
3218
|
+
let s = o ? o.modules ??= {} : Ue.modules ??= {};
|
|
3199
3219
|
s[r.name] || (s[r.name] = t);
|
|
3200
3220
|
}
|
|
3201
|
-
|
|
3202
|
-
} else
|
|
3221
|
+
s?.(t);
|
|
3222
|
+
} else h.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
|
|
3203
3223
|
} catch (e) {
|
|
3204
|
-
|
|
3224
|
+
h.push([`Error extracting VBA: ${e?.message ?? e}`, "xl/vbaProject.bin"]);
|
|
3205
3225
|
}
|
|
3206
|
-
let
|
|
3207
|
-
...
|
|
3208
|
-
calcOnLoad:
|
|
3209
|
-
resources:
|
|
3210
|
-
json:
|
|
3226
|
+
let Ke = C.get("calcId"), qe = Ke === void 0 || !(Number(Ke) >= 191029), Je = d.calcOnLoad ?? (u === "auto" && qe ? "full" : u), Ye = {
|
|
3227
|
+
...d,
|
|
3228
|
+
calcOnLoad: Je,
|
|
3229
|
+
resources: ne,
|
|
3230
|
+
json: Ue
|
|
3211
3231
|
};
|
|
3212
|
-
|
|
3213
|
-
let K = new
|
|
3214
|
-
if (
|
|
3232
|
+
Ye.disableLoadAutoFit === void 0 && (Ye.disableLoadAutoFit = !1), m?.mark("json-assembled");
|
|
3233
|
+
let K = new De(Ye);
|
|
3234
|
+
if (m?.mark("workbook-constructed"), D.length > 0 && Je !== "none") {
|
|
3215
3235
|
await K.whenCalculationReady();
|
|
3216
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
3236
|
+
let e = /* @__PURE__ */ new Map(), t = Ue.sheets ?? [], n = K.getSheets().getItems();
|
|
3217
3237
|
for (let r = 0; r < t.length; r++) {
|
|
3218
3238
|
let i = t[r]?.sheet, a = n[r];
|
|
3219
3239
|
i && a && e.set(i, a);
|
|
@@ -3235,7 +3255,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3235
3255
|
for (let e of t) e.formula === null && o.add(i(e.rowIndex, e.colIndex));
|
|
3236
3256
|
for (let e of t) {
|
|
3237
3257
|
if (e.formula === null) continue;
|
|
3238
|
-
let t =
|
|
3258
|
+
let t = Nt(e.formula), n = !0;
|
|
3239
3259
|
for (let e of t) if (!a(e)) {
|
|
3240
3260
|
n = !1;
|
|
3241
3261
|
break;
|
|
@@ -3268,19 +3288,19 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3268
3288
|
}).setValue("=" + e.formula);
|
|
3269
3289
|
}
|
|
3270
3290
|
}
|
|
3271
|
-
})(K,
|
|
3291
|
+
})(K, D, e);
|
|
3272
3292
|
}
|
|
3273
|
-
if (
|
|
3274
|
-
e.deleteReference(
|
|
3275
|
-
}),
|
|
3276
|
-
|
|
3293
|
+
if (x.forEach((e) => {
|
|
3294
|
+
e.deleteReference(ae);
|
|
3295
|
+
}), re.endPersist(), p) {
|
|
3296
|
+
n(K);
|
|
3277
3297
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
3278
|
-
for (let n of
|
|
3279
|
-
let r =
|
|
3298
|
+
for (let n of N.getNames()) {
|
|
3299
|
+
let r = N.getEntry(n);
|
|
3280
3300
|
if (!r) continue;
|
|
3281
|
-
let i =
|
|
3301
|
+
let i = N.getRawEntry(n), a = i ? {
|
|
3282
3302
|
data: r,
|
|
3283
|
-
uncompressedSize:
|
|
3303
|
+
uncompressedSize: N.uncompressedSize(n),
|
|
3284
3304
|
raw: {
|
|
3285
3305
|
compressedData: i.data,
|
|
3286
3306
|
compressionMethod: i.compressionMethod,
|
|
@@ -3288,39 +3308,39 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
|
|
|
3288
3308
|
}
|
|
3289
3309
|
} : {
|
|
3290
3310
|
data: r,
|
|
3291
|
-
uncompressedSize:
|
|
3311
|
+
uncompressedSize: N.uncompressedSize(n)
|
|
3292
3312
|
};
|
|
3293
3313
|
e.set(n, a), t += r.byteLength;
|
|
3294
3314
|
}
|
|
3295
|
-
if (t > 67108864)
|
|
3315
|
+
if (t > 67108864) h.push([`Source package too large to retain (${t} bytes, limit ${b}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
|
|
3296
3316
|
else if (e.size > 0) {
|
|
3297
|
-
let t = new
|
|
3298
|
-
|
|
3299
|
-
let
|
|
3317
|
+
let t = new de(e, F);
|
|
3318
|
+
ue(K, t);
|
|
3319
|
+
let r = K.getSheets().getItems(), i = K.getTransactions().addListener({ onCommitEnd: (e) => {
|
|
3300
3320
|
let n = e.getOperation()?.name;
|
|
3301
3321
|
n !== "insertCells" && n !== "deleteCells" || t.markStructuralChange();
|
|
3302
3322
|
} }), a = K.addListeners({ onSheetsChange: () => {
|
|
3303
3323
|
let e = K.getSheets().getItems();
|
|
3304
|
-
(e.length !==
|
|
3324
|
+
(e.length !== r.length || e.some((e, t) => e !== r[t])) && t.markStructuralChange(), r = e;
|
|
3305
3325
|
} });
|
|
3306
3326
|
K.addListeners({ onClose: () => {
|
|
3307
|
-
|
|
3327
|
+
i(), a(), n(K);
|
|
3308
3328
|
} });
|
|
3309
3329
|
}
|
|
3310
3330
|
}
|
|
3311
|
-
if (
|
|
3331
|
+
if (h.length && v?.onWarning) {
|
|
3312
3332
|
let e = /* @__PURE__ */ new Set();
|
|
3313
|
-
for (let t of
|
|
3333
|
+
for (let t of h) {
|
|
3314
3334
|
let [n, r, i] = t, a = i ?? n;
|
|
3315
|
-
e.has(a) || (e.add(a),
|
|
3335
|
+
e.has(a) || (e.add(a), v.onWarning(n, r));
|
|
3316
3336
|
}
|
|
3317
3337
|
}
|
|
3318
|
-
return
|
|
3338
|
+
return m && !0 === c && console.table(m.toTable()), K;
|
|
3319
3339
|
} catch (e) {
|
|
3320
3340
|
let t = "Unable to parse XLSX.";
|
|
3321
|
-
throw e instanceof
|
|
3341
|
+
throw e instanceof R && (t = "Unable to open XLSX. There are too many rows or columns."), Error(t, { cause: e });
|
|
3322
3342
|
} finally {
|
|
3323
|
-
await
|
|
3343
|
+
await N.close().catch(() => {});
|
|
3324
3344
|
}
|
|
3325
3345
|
};
|
|
3326
|
-
export {
|
|
3346
|
+
export { Kt as readXLSX };
|