@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.
Files changed (68) hide show
  1. package/browser/cjs/B0Ugu_crqQYpdfQz.cjs +1 -0
  2. package/browser/cjs/{qb-YQ8mGwpogSP08.cjs → BHM3_D9PsNURVAVy.cjs} +1 -1
  3. package/browser/cjs/BHWdwAQ322YA8JAZ.cjs +6 -0
  4. package/browser/cjs/CeuX8p1aBuKTuagi.cjs +2 -0
  5. package/browser/cjs/DSM4q1dhVVXvsgby.cjs +30 -0
  6. package/browser/cjs/DiAHwNv2I8RHE9GY.cjs +1 -0
  7. package/browser/cjs/index.cjs +1 -1
  8. package/browser/cjs/wrpXlaSBGEicQf6_.cjs +6 -0
  9. package/browser/esm/{B3cYXnqV2Zjaw6Jp.mjs → Bu64BYvRAlVftMr1.mjs} +4 -4
  10. package/browser/esm/{B0E-_6m23g4BDnX6.mjs → C-2KaUyV4gs-sDTZ.mjs} +2 -2
  11. package/browser/esm/{CGgjL7wM5WHZA6Dt.mjs → CRrTMRdN_IcSA_pm.mjs} +2 -2
  12. package/browser/esm/{BYENv_UE3Hv5ghGD.mjs → CWt4fDYEbj2hvsl_.mjs} +820 -800
  13. package/browser/esm/{BLEHoDT0SLbo8OO2.mjs → Ccnxz-y2WBEgfvvh.mjs} +2606 -1408
  14. package/browser/esm/{k-aEFzUZ8aU9FPf4.mjs → CxtFawTfwRTCC4Xr.mjs} +1 -1
  15. package/browser/esm/{DdTgGiFy8nAZTQ0d.mjs → D-epcZSoKLbsAIaC.mjs} +2 -2
  16. package/browser/esm/DsSIg46AR7IFBN5N.mjs +2298 -0
  17. package/browser/esm/{D01fs7vrCLlmdHoW.mjs → Dx64JMAGwNNDBkC1.mjs} +1555 -1159
  18. package/browser/esm/Sv4twwEJDb9dZ91h.mjs +149 -0
  19. package/browser/esm/index.mjs +2 -2
  20. package/node/esm/{am47EU_k1uSVm7yW.mjs → BCr4lCI6qQXXN0K1.mjs} +2 -2
  21. package/node/esm/BPn5XBizKkwaUqXB.mjs +4285 -0
  22. package/node/esm/{D-l0hqYTXUIEFoTg.mjs → BVV11IlqF6Lmlv8D.mjs} +53 -69
  23. package/node/esm/{Co5_sjvEk9d-x9gx.mjs → BiJEEgltJzx94zIR.mjs} +930 -909
  24. package/node/esm/{DWF_5NYPdrlTVvHi.mjs → BsTMtvwpQoPNv95M.mjs} +1 -1
  25. package/node/esm/{ZWSOYqmTKEmEOz2u.mjs → CBtj0-a4l2qux2hA.mjs} +2 -2
  26. package/node/esm/CkmZuMvRTpva7eQu.mjs +5074 -0
  27. package/node/esm/index.mjs +4 -4
  28. package/node/esm/j0RE2usgdljRw_gr.mjs +2345 -0
  29. package/package.json +3 -3
  30. package/types/src/AutoFilterRules.d.ts +83 -10
  31. package/types/src/OOXMLExtensions.d.ts +6 -0
  32. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  33. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +13 -0
  34. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +7 -1
  35. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  36. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +23 -1
  37. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +9 -0
  38. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +20 -1
  39. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  40. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +8 -0
  41. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  42. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  43. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  44. package/types/src/reader/domVisitors/index.d.ts +4 -2
  45. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +1 -1
  46. package/types/src/utils/DrawingMLText.d.ts +39 -0
  47. package/types/src/utils/FormControls.d.ts +97 -0
  48. package/types/src/writer/builder/Emitter.d.ts +5 -0
  49. package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
  50. package/types/src/writer/builder/Types.d.ts +10 -0
  51. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  52. package/types/src/writer/utils/DrawMLUtils.d.ts +39 -2
  53. package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
  54. package/types/src/writer/utils/TextUtils.d.ts +21 -2
  55. package/browser/cjs/17tMBnuyu4YIxixh.cjs +0 -1
  56. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  57. package/browser/cjs/BxU-OlZIQViQl7gX.cjs +0 -1
  58. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  59. package/browser/cjs/DHKWtqZ0vQfXrbq1.cjs +0 -2
  60. package/browser/cjs/DpZr07y7ifaZGvJ9.cjs +0 -5
  61. package/browser/cjs/MqKQ_B5qRARrRbO4.cjs +0 -24
  62. package/browser/esm/96C1ntelYWh7kQtW.mjs +0 -24
  63. package/browser/esm/FwrsLfi1iEAQGIjj.mjs +0 -2402
  64. package/browser/esm/gicSNvWtBLkvLsIw.mjs +0 -159
  65. package/node/esm/B-g20MoPHbZFapp8.mjs +0 -4642
  66. package/node/esm/Bu9QkKpBW4G2ULAg.mjs +0 -2450
  67. package/node/esm/CHl-WFsto0oTmBtB.mjs +0 -3051
  68. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
@@ -1,4642 +0,0 @@
1
- /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.6
3
- *
4
- * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import "./index.mjs";
8
- import { A as r, C as o, G as s, H as a, I as l, L as i, N as c, O as d, S as m, T as p, U as f, W as h, X as u, Z as g, a as y, c as x, d as v, et as w, g as S, i as b, k as C, l as k, m as I, n as T, p as M, q as R, r as A, t as F, v as L, x as _, y as P } from "./CHl-WFsto0oTmBtB.mjs";
9
- import { AddressUtils as D, BufferUtils as E, Color as B, CommonUtils as O, CoordUtils as $, FormulaError as W, FormulaText as V, IColor as z, ICondition as j, IConditionalFormat as U, IEffect as X, IFill as H, IFont as q, ISheet as G, IStroke as J, IStyle as K, ITextFrame as Y, LicenseManager as Z, NumberFormat as Q, ScalarType as tt } from "@sheetxl/sdk";
10
- import { BlobWriter as et, TextReader as rt, Uint8ArrayReader as nt, Uint8ArrayWriter as ot, ZipWriter as st } from "@zip.js/zip.js";
11
- var at = "resourcesById", lt = class {
12
- constructor(t) {
13
- this._kind = t.kind, this._contentType = t.contentType, this._relTypeUri = t.relTypeUri, this._path = t.path;
14
- }
15
- getKind() {
16
- return this._kind;
17
- }
18
- getContentType(t) {
19
- return this._contentType;
20
- }
21
- getRelTypeUri(t) {
22
- return this._relTypeUri;
23
- }
24
- getPath(t) {
25
- return "function" == typeof this._path ? this._path(t) : this._path;
26
- }
27
- }, it = class t {
28
- constructor(t, e, r) {
29
- this.zipWriter = t, this.outputKind = e, this.outWritable = r;
30
- }
31
- static createUint8Array(e) {
32
- const r = new st(new ot(), e);
33
- return new t(r, "uint8array");
34
- }
35
- static createBlob(e) {
36
- const r = new st(new et("application/zip"), e);
37
- return new t(r, "blob");
38
- }
39
- static createWritableStream(e, r) {
40
- const n = new st(e, r);
41
- return new t(n, "writable", e);
42
- }
43
- async add(t, e, r) {
44
- const n = function(t) {
45
- let e = t.replace(/\\/g, "/").trim();
46
- for (; e.startsWith("/");) e = e.slice(1);
47
- return e;
48
- }(t), o = {
49
- level: r?.level,
50
- password: r?.password,
51
- encryptionStrength: r?.encryptionStrength,
52
- zipCrypto: r?.zipCrypto,
53
- lastModDate: r?.lastModDate,
54
- keepOrder: r?.keepOrder,
55
- uncompressedSize: r?.uncompressedSize,
56
- dataDescriptor: r?.dataDescriptor,
57
- passThrough: r?.passThrough,
58
- compressionMethod: r?.compressionMethod,
59
- signature: r?.signature
60
- };
61
- if ("string" == typeof e) return void await this.zipWriter.add(n, new rt(e), o);
62
- if (e instanceof Uint8Array || ArrayBuffer.isView(e) || e && "number" == typeof e.byteLength && "number" == typeof e.byteOffset) {
63
- try {
64
- await this.zipWriter.add(n, new nt(e), o);
65
- } catch (t) {
66
- throw console.log("Error adding Uint8Array source to zip:", n, o), t;
67
- }
68
- return;
69
- }
70
- const s = (a = e) && "function" == typeof a.getReader ? e : function(t) {
71
- const e = t[Symbol.asyncIterator]();
72
- return new ReadableStream({
73
- async pull(t) {
74
- const { value: r, done: n } = await e.next();
75
- n ? t.close() : t.enqueue(r);
76
- },
77
- async cancel(t) {
78
- if ("function" == typeof e.return) try {
79
- await e.return(t);
80
- } catch {}
81
- }
82
- });
83
- }(e);
84
- var a;
85
- await this.zipWriter.add(n, s, o);
86
- }
87
- async close(t) {
88
- const e = t?.comment, r = await this.zipWriter.close(e, {});
89
- return "writable" === this.outputKind ? this.outWritable ?? r : r;
90
- }
91
- };
92
- function ct(t) {
93
- const e = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), r = (t) => e(t).replace(/"/g, "&quot;"), n = (t) => {
94
- if (!t) return "";
95
- let e = "";
96
- for (const [n, o] of Object.entries(t)) void 0 !== o && !1 !== o && (e += !0 === o ? ` ${n}="1"` : ` ${n}="${r(String(o))}"`);
97
- return e;
98
- }, o = new TextEncoder();
99
- let s = "";
100
- const a = () => {
101
- s && (t.write(o.encode(s)), s = "");
102
- }, l = (t) => {
103
- s += t, s.length > 65536 && a();
104
- };
105
- let i = [], c = null, d = [], m = !0;
106
- return {
107
- decl() {
108
- l("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
109
- },
110
- pushDefaultNamespace(t) {
111
- i.push(t), c = t;
112
- },
113
- getDefaultNamespace: () => i.length > 0 ? i[i.length - 1] : null,
114
- popDefaultNamespace() {
115
- i.length > 0 && (i.pop(), c = i.length > 0 ? i[i.length - 1] : null);
116
- },
117
- start(t, e) {
118
- m && d.push({
119
- tag: t,
120
- attrs: e,
121
- bufferPos: s.length
122
- });
123
- let r = t;
124
- c && -1 === t.indexOf(":") && (r = `${c}:${t}`), l(`<${r}${n(e)}>`);
125
- },
126
- empty(t, e) {
127
- let r = t;
128
- c && -1 === t.indexOf(":") && (r = `${c}:${t}`), l(`<${r}${n(e)}/>`);
129
- },
130
- text(t) {
131
- l(e(String(t)));
132
- },
133
- raw(t) {
134
- l(t);
135
- },
136
- end(t) {
137
- let e;
138
- if (m) {
139
- if (0 === d.length) throw new Error(`XML Writer: Unexpected end tag </${t}> - no matching start tag`);
140
- if (e = d[d.length - 1], e.tag !== t) throw new Error(`XML Writer: End tag </${t}> does not match start tag <${e.tag}>`);
141
- }
142
- let r = t;
143
- if (c && -1 === t.indexOf(":") && (r = `${c}:${t}`), m) {
144
- const t = s.length, o = `<${r}${n(e.attrs)}>`.length;
145
- t === e.bufferPos + o ? (s = s.slice(0, e.bufferPos), l(`<${r}${n(e.attrs)}/>`)) : l(`</${r}>`), d.pop();
146
- } else l(`</${r}>`);
147
- },
148
- close() {
149
- a();
150
- },
151
- setValidationDisabled(t) {
152
- m = !t;
153
- }
154
- };
155
- }
156
- function dt(t) {
157
- switch (t.kind) {
158
- case "bytes": return t.bytes;
159
- case "text": return t.text;
160
- case "stream": return t.stream;
161
- case "xmlStream": {
162
- const e = [], r = ct({ write: (t) => e.push(t) });
163
- return t.writeXml(r), r.close(), function(t) {
164
- let e = 0;
165
- for (const r of t) e += r.byteLength;
166
- const r = new Uint8Array(e);
167
- let n = 0;
168
- for (const e of t) r.set(e, n), n += e.byteLength;
169
- return r;
170
- }(e);
171
- }
172
- case "xmlStreamed": return t.write();
173
- }
174
- }
175
- function mt(t) {
176
- const e = pt(t);
177
- if (!e) return "_rels/.rels";
178
- const r = e.lastIndexOf("/"), n = r >= 0 ? e.slice(0, r) : "";
179
- return `${n ? `${n}/_rels` : "_rels"}/${r >= 0 ? e.slice(r + 1) : e}.rels`;
180
- }
181
- function pt(t) {
182
- let e = (t ?? "").replace(/\\/g, "/").trim();
183
- for (; e.startsWith("/");) e = e.slice(1);
184
- return e;
185
- }
186
- function ft(t) {
187
- let e = (t ?? "").replace(/\\/g, "/").trim();
188
- return e.startsWith("/") || (e = "/" + e), e;
189
- }
190
- function ht(t) {
191
- const e = /^rId(\d+)$/.exec(t);
192
- return e ? parseInt(e[1], 10) : Number.MAX_SAFE_INTEGER;
193
- }
194
- function ut(t) {
195
- return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/>/g, "&gt;");
196
- }
197
- function gt(t, e, r, n = !1) {
198
- let o = e;
199
- if (e.startsWith("/")) o = e.slice(1);
200
- else {
201
- if (!t) throw new Error(`Relative path "${e}" cannot be used at root level. Use an absolute path starting with "/" (e.g., "/xl/workbook.xml").`);
202
- o = (t.includes("/") ? t.slice(0, t.lastIndexOf("/") + 1) : "") + e;
203
- }
204
- if (o = yt(o), !o.includes("{n}")) {
205
- if (!n && r.has(o)) throw new Error(`Path already existing path: ${o}`);
206
- return o;
207
- }
208
- let s, a = 1;
209
- do
210
- if (s = o.replace(/{n}/g, String(a)), a++, a > 1e4) throw new Error(`Failed to resolve path template "${e}" after 10000 attempts. This likely indicates a bug or an impossible constraint.`);
211
- while (r.has(s));
212
- return s;
213
- }
214
- function yt(t) {
215
- const e = t.split("/"), r = [];
216
- for (const n of e) {
217
- if ("" === n || "." === n) continue;
218
- if (".." === n) {
219
- if (0 === r.length) throw new Error(`Invalid path: too many ".." segments in "${t}"`);
220
- r.pop();
221
- } else r.push(n);
222
- }
223
- return r.join("/");
224
- }
225
- function xt(t, e) {
226
- if (!t) return e;
227
- const r = t.includes("/") ? t.slice(0, t.lastIndexOf("/")) : "", n = r ? r.split("/") : [], o = e.split("/");
228
- let s = 0;
229
- const a = Math.min(n.length, o.length - 1);
230
- for (let t = 0; t < a && n[t] === o[t]; t++) s++;
231
- const l = n.length - s;
232
- return "../".repeat(l) + o.slice(s).join("/");
233
- }
234
- function vt(t) {
235
- return new TextEncoder().encode(t);
236
- }
237
- function wt(t, e) {
238
- return function(t, e = " ") {
239
- let r = "", n = 0;
240
- const o = t.split(/(<[^>]+>)/g).filter(Boolean);
241
- for (let t = 0; t < o.length; t++) {
242
- const s = o[t];
243
- if (s.trim()) if (s.startsWith("<?")) r += s + "\n";
244
- else if (s.startsWith("</")) n--, n < 0 && console.warn(`XML formatting warning: negative indentation depth: ${s}`), r += e.repeat(Math.max(n, 0)) + s + "\n";
245
- else if (s.startsWith("<")) {
246
- const t = s.endsWith("/>");
247
- r += e.repeat(n) + s + "\n", t || n++;
248
- } else r += e.repeat(n) + s.trim() + "\n";
249
- }
250
- return r;
251
- }(function(t) {
252
- return new TextDecoder("utf-8").decode(t);
253
- }(t), e);
254
- }
255
- var St = class {
256
- constructor(t) {
257
- this.rels = [], this.usedIds = /* @__PURE__ */ new Set(), this.reservedIds = /* @__PURE__ */ new Set(), this.nextId = 1, this.sourcePart = pt(t);
258
- }
259
- add(t, e, r) {
260
- let n = r?.idHint && !this.usedIds.has(r.idHint) ? r.idHint : void 0;
261
- if (!n) do
262
- n = "rId" + this.nextId++;
263
- while (this.usedIds.has(n) || this.reservedIds.has(n));
264
- const o = /^rId(\d+)$/.exec(n);
265
- return o && (this.nextId = Math.max(this.nextId, parseInt(o[1], 10) + 1)), this.usedIds.add(n), this.rels.push({
266
- id: n,
267
- type: t,
268
- target: e,
269
- targetMode: r?.external ? "External" : void 0
270
- }), n;
271
- }
272
- reserve(t) {
273
- for (const e of t) {
274
- if (!e) continue;
275
- this.reservedIds.add(e);
276
- const t = /^rId(\d+)$/.exec(e);
277
- t && (this.nextId = Math.max(this.nextId, parseInt(t[1], 10) + 1));
278
- }
279
- }
280
- list() {
281
- return this.rels;
282
- }
283
- toXmlBytes() {
284
- const t = [...this.rels].sort((t, e) => ht(e.id) - ht(t.id) || t.id.localeCompare(e.id)), e = [];
285
- e.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), e.push(`<Relationships xmlns="${bt}">`);
286
- for (const r of t) {
287
- const t = [
288
- `Id="${ut(r.id)}"`,
289
- `Type="${ut(r.type)}"`,
290
- `Target="${ut(r.target)}"`
291
- ];
292
- "External" === r.targetMode && t.push("TargetMode=\"External\""), e.push(`<Relationship ${t.join(" ")}/>`);
293
- }
294
- return e.push("</Relationships>"), vt(e.join(""));
295
- }
296
- }, bt = "http://schemas.openxmlformats.org/package/2006/relationships", Ct = class {
297
- constructor() {
298
- this._defaultsSet = /* @__PURE__ */ new Set(), this._overridesSet = /* @__PURE__ */ new Set(), this._defaults = [], this._overrides = [];
299
- }
300
- addDefault(t, e) {
301
- const r = function(t) {
302
- let e = (t ?? "").trim().toLowerCase();
303
- return e.startsWith(".") && (e = e.slice(1)), e;
304
- }(t);
305
- this._defaultsSet.has(r) || (this._defaultsSet.add(r), this._defaults.push({
306
- key: r,
307
- content: e
308
- }));
309
- }
310
- addOverride(t, e) {
311
- const r = ft(t);
312
- this._overridesSet.has(r) || (this._overridesSet.add(r), this._overrides.push({
313
- key: r,
314
- content: e
315
- }));
316
- }
317
- replaceOverride(t, e) {
318
- const r = ft(t);
319
- if (!this._overridesSet.has(r)) return;
320
- const n = this._overrides.find((t) => t.key === r);
321
- n && (n.content = e);
322
- }
323
- toXmlBytes() {
324
- const t = [];
325
- t.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), t.push(`<Types xmlns="${kt}">`);
326
- const e = this._defaults.reverse();
327
- this.addDefault("rels", "application/vnd.openxmlformats-package.relationships+xml"), this.addDefault("xml", "application/xml");
328
- for (const { key: r, content: n } of e) t.push(`<Default Extension="${ut(r)}" ContentType="${ut(n)}"/>`);
329
- const r = this._overrides;
330
- for (const { key: e, content: n } of r) t.push(`<Override PartName="${ut(e)}" ContentType="${ut(n)}"/>`);
331
- return t.push("</Types>"), vt(t.join(""));
332
- }
333
- }, kt = "http://schemas.openxmlformats.org/package/2006/content-types", It = class {
334
- constructor(t) {
335
- this.parts = [], this.relsRoot = new St(""), this.relsByPart = /* @__PURE__ */ new Map(), this.contentTypes = new Ct(), this.zip = t;
336
- }
337
- addContentType(t, e) {
338
- const r = pt(t);
339
- this.contentTypes.addOverride("/" + r, e);
340
- }
341
- addDefaultType(t, e) {
342
- this.contentTypes.addDefault(t, e);
343
- }
344
- replaceContentType(t, e) {
345
- this.contentTypes.replaceOverride("/" + pt(t), e);
346
- }
347
- addPart(t, e, r, n) {
348
- const o = pt(t);
349
- this.parts.push({
350
- path: o,
351
- body: e,
352
- optionsZip: n
353
- }), r && this.contentTypes.addOverride("/" + o, r);
354
- }
355
- rels(t) {
356
- const e = pt(t || "");
357
- if (!e) return this.relsRoot;
358
- let r = this.relsByPart.get(e);
359
- return r || (r = new St(e), this.relsByPart.set(e, r)), r;
360
- }
361
- async emit() {
362
- const t = [...this.parts].sort((t, e) => t.path.localeCompare(e.path));
363
- for (const e of t) {
364
- const t = dt(e.body);
365
- await this.zip.add(e.path, t, e.optionsZip);
366
- }
367
- const e = this.relsRoot.toXmlBytes();
368
- await this.zip.add("_rels/.rels", e, {});
369
- const r = [...this.relsByPart.values()].sort((t, e) => t.sourcePart.localeCompare(e.sourcePart));
370
- for (const t of r) {
371
- const e = mt(t.sourcePart), r = t.toXmlBytes();
372
- await this.zip.add(e, r, {});
373
- }
374
- const n = this.contentTypes.toXmlBytes();
375
- await this.zip.add("[Content_Types].xml", n, {});
376
- }
377
- async build(t) {
378
- return await this.emit(), await this.zip.close(t);
379
- }
380
- }, Tt = /* @__PURE__ */ new Set(["xl/calcChain.xml"]), Mt = [/^xl\/slicers\//i, /^xl\/slicerCaches\//i];
381
- function Rt(t) {
382
- return "[Content_Types].xml" === t || At.test(t);
383
- }
384
- var At = /^(?:(.*)\/)?_rels\/(.*)\.rels$/;
385
- function Ft(t) {
386
- if ("_rels/.rels" === t) return "";
387
- const e = At.exec(t);
388
- if (!e) return null;
389
- const r = e[1] ?? "", n = e[2];
390
- return r ? `${r}/${n}` : n;
391
- }
392
- function Lt(t) {
393
- return t.startsWith("#");
394
- }
395
- function _t(t, e) {
396
- if (e.startsWith("/")) return yt(e);
397
- const r = t.includes("/") ? t.slice(0, t.lastIndexOf("/")) : "";
398
- return yt((r ? r + "/" : "") + e);
399
- }
400
- var Pt = class {
401
- constructor(t, e, r) {
402
- this._queue = [], this._scheduledByNodeKey = /* @__PURE__ */ new Map(), this._nodesByPath = /* @__PURE__ */ new Map(), this._writtenPaths = /* @__PURE__ */ new Set(), this._explicitRelTargets = /* @__PURE__ */ new Set(), this._partWriter = new It(t), this._registry = e, this._options = r ?? {}, this._mapState = this._options.mapState ?? /* @__PURE__ */ new Map(), this._sourcePackage = this._options.sourcePackage ?? null, this._macroEnabled = this._options.macroEnabled ?? !1, this._reserveSourceRelIds("");
403
- }
404
- _isSourcePartCarried(t) {
405
- const e = this._sourcePackage;
406
- return !(!e || !e.has(t)) && !Tt.has(t) && !e.isAbsorbed(t) && !(!this._macroEnabled && "xl/vbaProject.bin" === t) && !Rt(t) && (!e.hasStructuralChange() || !function(t) {
407
- return Mt.some((e) => e.test(t));
408
- }(t));
409
- }
410
- _reserveSourceRelIds(t) {
411
- const e = this._sourcePackage?.getPart(mt(t));
412
- e && this._partWriter.rels(t).reserve(f(e.data).map((t) => t.id));
413
- }
414
- async waitEmit() {
415
- const t = this._queue;
416
- for (; t.length;) {
417
- const e = t.shift();
418
- await this._processPart(e);
419
- }
420
- }
421
- async build(t) {
422
- return await this.waitEmit(), this._passthroughSourceParts(), this._applyWorkbookContentTypeVariant(), await this._partWriter.build(t ?? {});
423
- }
424
- _passthroughSourceParts() {
425
- const t = this._sourcePackage;
426
- if (!t) return;
427
- const e = new Set(this._writtenPaths), r = [];
428
- for (const n of t.getNames()) e.has(n) || this._isSourcePartCarried(n) && r.push(n);
429
- const n = new Set(e);
430
- for (const t of r) n.add(t);
431
- const o = t.getPart("[Content_Types].xml"), s = o ? a(o.data) : null;
432
- if (s) for (const { ext: t, contentType: e } of s.defaults) this._partWriter.addDefaultType(t, e);
433
- for (const e of r) {
434
- const r = t.getPart(e), n = s?.overrides.get("/" + e);
435
- r.raw ? this._partWriter.addPart(e, {
436
- kind: "bytes",
437
- bytes: r.raw.compressedData
438
- }, n, {
439
- passThrough: !0,
440
- compressionMethod: r.raw.compressionMethod,
441
- signature: r.raw.signature,
442
- uncompressedSize: r.uncompressedSize
443
- }) : this._partWriter.addPart(e, {
444
- kind: "bytes",
445
- bytes: r.data
446
- }, n), this._writtenPaths.add(e);
447
- }
448
- for (const r of t.getNames()) {
449
- if ("[Content_Types].xml" === r || !Rt(r)) continue;
450
- const o = Ft(r);
451
- null !== o && ("" === o || n.has(o)) && (t.isAbsorbed(o) || this._mergeSourceRelsInto(o, t.getPart(r).data, e, n));
452
- }
453
- }
454
- _applyWorkbookContentTypeVariant() {
455
- this._macroEnabled && this._partWriter.replaceContentType("xl/workbook.xml", "application/vnd.ms-excel.sheet.macroEnabled.main+xml");
456
- }
457
- _mergeSourceRelsInto(t, e, r, n) {
458
- const o = this._partWriter.rels(t), s = "" === t || r.has(t);
459
- for (const a of f(e)) {
460
- if (a.external || Lt(a.target)) {
461
- o.add(a.type, a.target, {
462
- external: a.external,
463
- idHint: a.id
464
- });
465
- continue;
466
- }
467
- const e = _t(t, a.target);
468
- if (s) {
469
- if (r.has(e)) continue;
470
- if (this._explicitRelTargets.has(`${t}::${e}`)) continue;
471
- }
472
- n.has(e) ? o.add(a.type, a.target, { idHint: a.id }) : this._registry.ownsRelType(a.type) || Tt.has(e) || this._sourcePackage?.isAbsorbed(e) || console.warn(`Dropping preserved relationship to missing part '${e}'`, t || "(root)");
473
- }
474
- }
475
- addPart(t, e, r, n) {
476
- return this._addPartInternal("", t, e, r, n);
477
- }
478
- _addPartInternal(t, e, r, n, o) {
479
- const s = this._registry.get(e);
480
- if (!s) throw new Error(`No emitter registered for kind '${e}'.`);
481
- const a = s.getContentType(r), l = s.getRelTypeUri(r), i = n ?? s.getPath?.(r);
482
- if (!i) throw new Error("No path provided in either argument or emitter.");
483
- const c = this._writtenPaths, d = gt(t, i, c), m = `${e}:${d}`;
484
- let p = this._scheduledByNodeKey.get(m);
485
- if (!p) {
486
- let t;
487
- this._reserveSourceRelIds(d), p = {
488
- kind: e,
489
- key: m,
490
- payload: r,
491
- path: d,
492
- contentType: a,
493
- promise: new Promise((e) => {
494
- t = e;
495
- }),
496
- resolve: t
497
- }, this._scheduledByNodeKey.set(m, p), this._queue.push(p);
498
- }
499
- let f = this._nodesByPath.get(t);
500
- f || (f = /* @__PURE__ */ new Set(), this._nodesByPath.set(t, f)), f.add(m), !a || l || t || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", d);
501
- let h = null;
502
- if (l) {
503
- const e = xt(t, p.path);
504
- h = this._partWriter.rels(t).add(l, e, { idHint: o });
505
- }
506
- return c.add(d), {
507
- path: d,
508
- contentTypeUri: a,
509
- relId: h
510
- };
511
- }
512
- addBinary(t, e, r, n, o = !1, s) {
513
- return this._addBinaryInternal("", t, e, r, n, o, s);
514
- }
515
- _addBinaryInternal(t, e, r, n, o, s = !1, a) {
516
- if (!o) throw new Error("No path provided for binary.");
517
- if (!r) throw new Error("No content type provided for binary.");
518
- const l = this._writtenPaths, i = gt(t, o, l, s);
519
- let c = null;
520
- if (n) {
521
- const e = xt(t, i);
522
- c = this._partWriter.rels(t).add(n, e, { idHint: a });
523
- }
524
- if (t || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", i), !l.has(i)) {
525
- const t = i.split(".").pop() || "";
526
- t && this._partWriter.addDefaultType(t, r), this._partWriter.addPart(i, {
527
- kind: "bytes",
528
- bytes: e
529
- }, void 0, {
530
- level: 0,
531
- uncompressedSize: e.byteLength,
532
- dataDescriptor: !1
533
- }), l.add(i);
534
- }
535
- return {
536
- path: i,
537
- contentTypeUri: r,
538
- relId: c
539
- };
540
- }
541
- async _waitForDescendants(t) {
542
- const e = this._nodesByPath.get(t);
543
- if (!e || 0 === e.size) return;
544
- const r = [];
545
- for (const t of e) {
546
- const e = this._scheduledByNodeKey.get(t);
547
- if (e) {
548
- const t = this._processPart(e);
549
- r.push(t);
550
- }
551
- }
552
- await Promise.all(r);
553
- }
554
- async _processPart(t) {
555
- if (t.processed) return t.promise;
556
- t.processed = !0;
557
- const e = this._registry.get(t.kind), r = t.path;
558
- this._partWriter.addContentType(t.path, t.contentType);
559
- try {
560
- const n = [], o = { write: (t) => {
561
- n.push(t);
562
- } };
563
- let s;
564
- await e.emit(t.payload, {
565
- getXMLWriter: () => s || (s = ct(o), s),
566
- addPart: (t, e, n, o) => this._addPartInternal(r, t, e, n, o),
567
- addBinary: (t, e, n, o, s = !1, a) => this._addBinaryInternal(r, t, e, n, o, s, a),
568
- addExternal: (t, e, n) => ({
569
- path: e,
570
- contentTypeUri: null,
571
- relId: this._partWriter.rels(r).add(t, e, {
572
- external: !0,
573
- idHint: n
574
- })
575
- }),
576
- addRelationship: (t, e, n) => {
577
- if (!this._writtenPaths.has(e) && !this._isSourcePartCarried(e)) return null;
578
- const o = xt(r, e), s = this._partWriter.rels(r).add(t, o, { idHint: n });
579
- return this._explicitRelTargets.add(`${r}::${e}`), s;
580
- },
581
- waitEmit: () => this._waitForDescendants(t.path),
582
- getPath: () => t.path,
583
- getSharedStates: () => this._mapState,
584
- warn: (e, r, n) => {
585
- const o = r ?? t.path, s = this._options.onWarning;
586
- s ? s(e, o, n) : console.warn(e, o);
587
- },
588
- log: (e, r) => {
589
- console.warn(e, r ?? t.path);
590
- }
591
- });
592
- const a = function(t) {
593
- let e = 0;
594
- for (const r of t) e += r.byteLength;
595
- const r = new Uint8Array(e);
596
- let n = 0;
597
- for (const e of t) r.set(e, n), n += e.byteLength;
598
- return r;
599
- }(n), l = this._options.onPartEmitted;
600
- l && await l(t.kind, t.path, a), Nt && (console.log(`\n=== ${t.path} ===`), console.log(wt(a))), this._partWriter.addPart(t.path, {
601
- kind: "bytes",
602
- bytes: a
603
- }, t.contentType);
604
- } catch (e) {
605
- throw this._options.onPartError?.(t.kind, t.path, e), e;
606
- } finally {
607
- this._nodesByPath.delete(t.path), this._scheduledByNodeKey.delete(t.key), t.resolve();
608
- }
609
- }
610
- }, Nt = !1, Dt = class {
611
- constructor() {
612
- this.map = /* @__PURE__ */ new Map();
613
- }
614
- register(t) {
615
- const e = t.getKind();
616
- if (this.map.has(e)) throw new Error(`Duplicate part kind: ${e}`);
617
- this.map.set(e, t);
618
- }
619
- get(t) {
620
- const e = this.map.get(t);
621
- if (!e) throw new Error(`Unknown part kind: ${t}`);
622
- return e;
623
- }
624
- has(t) {
625
- return this.map.has(t);
626
- }
627
- ownsRelType(t) {
628
- for (const e of this.map.values()) if (e.getRelTypeUri() === t) return !0;
629
- return !1;
630
- }
631
- };
632
- function Et(t, e, r) {
633
- t && (t.algorithm && (e[r ? `${r}AlgorithmName` : "algorithmName"] = t.algorithm), t.hash && (e[r ? `${r}HashValue` : "hashValue"] = t.hash), t.salt && (e[r ? `${r}SaltValue` : "saltValue"] = t.salt), void 0 !== t.spinCount && (e[r ? `${r}SpinCount` : "spinCount"] = t.spinCount));
634
- }
635
- var Bt = "hiddenFormulaXfs", Ot = class {
636
- constructor(t, e) {
637
- this._variants = /* @__PURE__ */ new Map(), this._sources = [], this._json = t, this._styles = e, this._directCount = Math.max(1, t?.direct?.length ?? 0);
638
- }
639
- getHiddenXf(t) {
640
- let e = this._variants.get(t);
641
- return void 0 !== e || (this._isShown(t) ? e = t : (e = this._directCount + this._sources.length, this._sources.push(t)), this._variants.set(t, e)), e;
642
- }
643
- getSources() {
644
- return this._sources;
645
- }
646
- _isShown(t) {
647
- const e = this._json?.direct?.[t], r = e?.protection?.showFormulas;
648
- if (void 0 !== r) return r;
649
- const n = (0 !== t ? e?.named : void 0) ?? K.BuiltInName.Normal;
650
- return this._styles.getNamedStyles().getByName(n)?.toJSON().style?.protection?.showFormulas ?? !1;
651
- }
652
- }, $t = class {
653
- constructor() {
654
- this._daprFMBks = [], this._daprFMBkMap = /* @__PURE__ */ new Map(), this._rvFMBks = [], this._rvFMBkMap = /* @__PURE__ */ new Map(), this._valueMeta = [];
655
- }
656
- registerArrayCell(t) {
657
- const e = t ? 1 : 0, r = `1,${e}`;
658
- let n = this._daprFMBkMap.get(r);
659
- return void 0 === n && (n = this._daprFMBks.length, this._daprFMBks.push({
660
- fDynamic: 1,
661
- fCollapsed: e
662
- }), this._daprFMBkMap.set(r, n)), n + 1;
663
- }
664
- registerRichValueCell(t) {
665
- let e = this._rvFMBkMap.get(t);
666
- void 0 === e && (e = this._rvFMBks.length, this._rvFMBks.push(t), this._rvFMBkMap.set(t, e));
667
- const r = this._valueMeta.length;
668
- return this._valueMeta.push(e), r + 1;
669
- }
670
- hasCellMeta() {
671
- return this._daprFMBks.length > 0;
672
- }
673
- hasValueMeta() {
674
- return this._valueMeta.length > 0;
675
- }
676
- hasAny() {
677
- return this.hasCellMeta() || this.hasValueMeta();
678
- }
679
- getDAPRFutureMetadataBlocks() {
680
- return this._daprFMBks;
681
- }
682
- getRVFutureMetadataBlocks() {
683
- return this._rvFMBks;
684
- }
685
- getValueMeta() {
686
- return this._valueMeta;
687
- }
688
- }, Wt = class {
689
- constructor(t, e = console.warn) {
690
- this._entries = [], this._keyMap = /* @__PURE__ */ new Map(), this._metaCollector = t, this._onWarn = e;
691
- }
692
- add(t) {
693
- if (null == t) return this._onWarn?.("RichValueCollector.add: null/undefined value — falling back to #UNKNOWN!"), this._registerFallback();
694
- if (W.isError(t)) {
695
- const e = t.getCode(), r = this._register(`_error:${e}`, { errorType: "" + (e - 1) }, Vt);
696
- return this._metaCollector.registerRichValueCell(r);
697
- }
698
- return t.isIRichData && t.getType(), this._onWarn?.("RichValueCollector.add: unsupported rich value type — falling back to #UNKNOWN!", t), this._registerFallback();
699
- }
700
- _registerFallback() {
701
- const t = this._register("_error:fallback", { errorType: W.Code.Unknown - 1 }, Vt);
702
- return this._metaCollector.registerRichValueCell(t);
703
- }
704
- _register(t, e, r) {
705
- let n = this._keyMap.get(t);
706
- return void 0 === n && (n = this._entries.length, this._entries.push({
707
- handler: r,
708
- rawValue: e
709
- }), this._keyMap.set(t, n)), n;
710
- }
711
- getCount() {
712
- return this._entries.length;
713
- }
714
- hasAny() {
715
- return this._entries.length > 0;
716
- }
717
- getEntries() {
718
- return this._entries;
719
- }
720
- uniqueHandlers() {
721
- const t = /* @__PURE__ */ new Set(), e = [];
722
- for (const r of this._entries) t.has(r.handler) || (t.add(r.handler), e.push(r.handler));
723
- return e;
724
- }
725
- handlerStructureIndex(t) {
726
- let e = 0;
727
- const r = /* @__PURE__ */ new Set();
728
- for (const n of this._entries) if (!r.has(n.handler)) {
729
- if (n.handler === t) return e;
730
- r.add(n.handler), e++;
731
- }
732
- return -1;
733
- }
734
- }, Vt = new class {
735
- constructor(t, e) {
736
- this.type = t, this.props = e;
737
- }
738
- getValues(t) {
739
- return this.props.map(([e, , r = ""]) => {
740
- const n = t?.[e];
741
- return null != n ? "" + n : r;
742
- });
743
- }
744
- }("_error", [[
745
- "errorType",
746
- "i",
747
- ""
748
- ], [
749
- "subType",
750
- "i",
751
- "0"
752
- ]]), zt = "application/xml", jt = async (t, e) => {
753
- const r = t.parts, n = r ? r.length : 0;
754
- for (let o = 0; o < n; o++) {
755
- const n = r[o];
756
- try {
757
- await Ut(n, e);
758
- } catch (r) {
759
- e.log(`Unable to write the part '${n.name ?? n.id}' referenced by '${t.name ?? t.id}'`, r);
760
- }
761
- }
762
- }, Ut = async (t, e, r) => {
763
- const n = void 0 === t.resId ? void 0 : e.getSharedStates().get(at)?.get(t.resId);
764
- if (!n) return void 0 !== t.resId ? (e.log(`The part '${t.name ?? t.id}' cites resource ${t.resId}, which is not in the workbook.`), null) : e.addPart("embeddedPart", t, r, t.id);
765
- const o = await n.getExternalURI();
766
- if (o) {
767
- const r = e.addExternal(t.type, o, t.id);
768
- return r.relId !== t.id && e.log(`The external reference '${t.id}' was written as '${r.relId}'; the markup will not find it.`), r;
769
- }
770
- const s = await n.toBuffer();
771
- return e.addBinary(new Uint8Array(s), t.contentType || zt, t.type, r ?? `./${Xt(t.name)}`, !1, t.id);
772
- }, Xt = (t) => {
773
- const e = t && /^[\w.\-~%]+$/.test(t) ? t : "part.xml", r = e.lastIndexOf("."), n = r > 0 ? e.slice(0, r) : e, o = r > 0 ? e.slice(r) : "";
774
- return `${n.replace(/\d+$/, "")}{n}${o}`;
775
- }, Ht = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml", qt = (t, e) => t.getSharedStates().get("pivotCachePaths")?.get(e) ?? null, Gt = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink", Jt = "fileVersion";
776
- var Kt = "sheetParts";
777
- var Yt = "externalLinkParts";
778
- function Zt(t) {
779
- if (!t || -1 === t.indexOf("[")) return [];
780
- const e = [], r = t.replace(/"(?:[^"]|"")*"/g, "");
781
- for (const t of r.matchAll(/\[(\d+)\]/g)) {
782
- const r = Number(t[1]);
783
- r > 0 && !e.includes(r) && e.push(r);
784
- }
785
- return e;
786
- }
787
- var Qt = {
788
- auto: "auto",
789
- automaticExceptTables: "autoNoTable",
790
- manual: "manual"
791
- };
792
- function te(t, e, r, n) {
793
- if (!r) return;
794
- const o = "string" == typeof r ? e.parseColor(r) : r;
795
- n && t.start(n);
796
- const s = o.getType(), a = o.getVal(), l = o.getAdjustments(), i = l && l.length > 0;
797
- switch (s) {
798
- case "scheme":
799
- i ? (t.start("schemeClr", { val: a }), ee(t, l), t.end("schemeClr")) : t.empty("schemeClr", { val: a });
800
- break;
801
- case "named":
802
- if (B.isSystem(a)) {
803
- const e = o.getLastColor() ?? o.getBaseColor().toHex().toString(!1).replace("#", "");
804
- i ? (t.start("sysClr", {
805
- val: a,
806
- lastClr: e
807
- }), ee(t, l), t.end("sysClr")) : t.empty("sysClr", {
808
- val: a,
809
- lastClr: e
810
- });
811
- } else i ? (t.start("prstClr", { val: a }), ee(t, l), t.end("prstClr")) : t.empty("prstClr", { val: a });
812
- break;
813
- case "auto": {
814
- const e = o.getLastColor() ?? o.getBaseColor().toHex().toString(!1).replace("#", "");
815
- i ? (t.start("sysClr", {
816
- val: "windowText",
817
- lastClr: e
818
- }), ee(t, l), t.end("sysClr")) : t.empty("sysClr", {
819
- val: "windowText",
820
- lastClr: e
821
- });
822
- break;
823
- }
824
- case "index":
825
- i ? (t.start("srgbClr", { val: a }), ee(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: a });
826
- break;
827
- case "hsl":
828
- const e = o.toHex().toString();
829
- i ? (t.start("srgbClr", { val: e }), ee(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: e });
830
- break;
831
- case "rgb":
832
- case "lrgb":
833
- const r = o.toHex().toString();
834
- i ? (t.start("srgbClr", { val: r }), ee(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: r });
835
- break;
836
- case "hex":
837
- const n = a.replace("#", "").toUpperCase();
838
- i ? (t.start("srgbClr", { val: n }), ee(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: n });
839
- break;
840
- default:
841
- const s = a.replace("#", "").toUpperCase();
842
- t.empty("srgbClr", { val: s });
843
- }
844
- n && t.end(n);
845
- }
846
- function ee(t, e) {
847
- if (e && 0 !== e.length) for (const r of e) for (const [e, n] of Object.entries(r)) {
848
- if (null == n) continue;
849
- const r = e;
850
- if (r) if ("boolean" == typeof n) t.empty(r);
851
- else {
852
- let o;
853
- if ("alpha" === e || "alphaOff" === e || "alphaMod" === e) o = Math.round(1e5 * n);
854
- else {
855
- if ("eTint" === e) {
856
- if (n < 0) {
857
- t.empty("shade", { val: Math.round(1e5 * (1 + n)).toString() });
858
- continue;
859
- }
860
- t.empty("tint", { val: Math.round(1e5 * n).toString() });
861
- continue;
862
- }
863
- o = Math.round(1e3 * n);
864
- }
865
- t.empty(r, { val: o.toString() });
866
- }
867
- }
868
- }
869
- function re(t, e, r, n, o = !1, s = !1) {
870
- if (!r) return;
871
- const a = "string" == typeof r ? e.parseColor(r) : r, l = () => {
872
- t.empty(n, { rgb: de(a.toHex().toString(!0)) });
873
- }, i = a.getAdjustments(), c = i && i.length > 0, d = a.getType();
874
- if (d !== z.Type.Auto) {
875
- if (d === z.Type.Scheme) {
876
- const e = a.getVal(), r = ne[e] ?? e, o = ae.get(r);
877
- if (void 0 === o && "phClr" !== r) return console.warn(`Color scheme not in theme. schemeVal=${e} themeKey=${r}`), l();
878
- const s = {};
879
- if (s.theme = o, c) {
880
- if (!function(t) {
881
- for (const e of t) switch (Object.keys(e)[0]) {
882
- case z.AdjustmentType.Tint:
883
- case z.AdjustmentType.ETint:
884
- case z.AdjustmentType.Shade:
885
- case z.AdjustmentType.Lum:
886
- case z.AdjustmentType.LumOff:
887
- case z.AdjustmentType.LumMod:
888
- case z.AdjustmentType.Alpha:
889
- case z.AdjustmentType.AlphaOff:
890
- case z.AdjustmentType.AlphaMod: continue;
891
- default: return !1;
892
- }
893
- return !0;
894
- }(i)) return l();
895
- const t = 1 === i.length ? i[0][z.AdjustmentType.ETint] : void 0;
896
- let e;
897
- if (void 0 !== t) e = ie(t);
898
- else {
899
- const t = a.getBaseColor().toHex().toString(!0), r = a.toHex().toString(!0);
900
- e = ie(function(t, e) {
901
- const r = le(t, 0, 255), n = le(e, 0, 255);
902
- if (Math.abs(n - r) < 1e-9) return 0;
903
- return n < r ? r <= 1e-9 ? -1 : le(n / r - 1, -1, 0) : 255 - r <= 1e-9 ? 0 : le((n - r) / (255 - r), 0, 1);
904
- }(ce(t), ce(r)));
905
- }
906
- 0 !== e && (s.tint = e);
907
- }
908
- t.empty(n, s);
909
- return;
910
- }
911
- if (d === z.Type.Index) {
912
- const e = a.getVal(), r = e.substring(5, e.length);
913
- t.empty(n, { indexed: Number(r) });
914
- return;
915
- }
916
- return l();
917
- }
918
- t.empty(n, { auto: 1 });
919
- }
920
- var ne = {
921
- bg1: "lt1",
922
- tx1: "dk1",
923
- bg2: "lt2",
924
- tx2: "dk2",
925
- accent1: "accent1",
926
- accent2: "accent2",
927
- accent3: "accent3",
928
- accent4: "accent4",
929
- accent5: "accent5",
930
- accent6: "accent6",
931
- hlink: "hlink",
932
- folHlink: "folHlink"
933
- }, oe = Object.freeze([
934
- "lt1",
935
- "dk1",
936
- "lt2",
937
- "dk2",
938
- "accent1",
939
- "accent2",
940
- "accent3",
941
- "accent4",
942
- "accent5",
943
- "accent6",
944
- "hlink",
945
- "folHlink"
946
- ]), se = Object.freeze([
947
- "dk1",
948
- "lt1",
949
- "dk2",
950
- "lt2",
951
- "accent1",
952
- "accent2",
953
- "accent3",
954
- "accent4",
955
- "accent5",
956
- "accent6",
957
- "hlink",
958
- "folHlink"
959
- ]), ae = new Map(oe.map((t, e) => [t, e]));
960
- function le(t, e, r) {
961
- return Math.max(e, Math.min(r, t));
962
- }
963
- function ie(t) {
964
- const e = le(t, -1, 1);
965
- return Math.abs(e) < 1e-12 ? 0 : e;
966
- }
967
- function ce(t) {
968
- const e = function(t) {
969
- const e = t.replace(/^#/, "").toUpperCase();
970
- if (8 === e.length) return e.slice(2);
971
- if (6 === e.length) return e;
972
- throw new Error(`Invalid hex: ${t}`);
973
- }(t), r = parseInt(e.slice(0, 2), 16) / 255, n = parseInt(e.slice(2, 4), 16) / 255, o = parseInt(e.slice(4, 6), 16) / 255;
974
- return (Math.max(r, n, o) + Math.min(r, n, o)) / 2 * 255;
975
- }
976
- function de(t) {
977
- const e = t.replace(/^#/, "").toUpperCase();
978
- if (8 === e.length) return e;
979
- if (6 === e.length) return "FF" + e;
980
- throw new Error(`Invalid hex: ${t}`);
981
- }
982
- function me(t, e = !1) {
983
- let r = t;
984
- return 8 === r.length && (r = r.substring(2, 8)), 6 === r.length && (r = (e ? "00" : "FF") + r), r.toUpperCase();
985
- }
986
- function pe(t) {
987
- let e = `[Threaded comment]\n\nYour version of Excel allows you to read this threaded comment; however, any edits to it will get removed if the file is opened in a newer version of Excel. Learn more: https://go.microsoft.com/fwlink/?linkid=870924\n\nComment:\n ${t.getContent()}`;
988
- const r = t.getReplies();
989
- for (let t = 0; t < r.length; t++) e += `\nReply:\n ${r[t].getContent()}`;
990
- return e;
991
- }
992
- function fe(t, e, r) {
993
- if ("string" == typeof e) return void ge(t, e);
994
- const n = e.runs;
995
- for (let e = 0; e < n.length; e++) {
996
- const o = n[e];
997
- t.start("r"), o.font && ue(t, o.font, r), ge(t, o.text ?? ""), t.end("r");
998
- }
999
- }
1000
- var he = {
1001
- serif: 1,
1002
- "sans-serif": 2,
1003
- monospace: 3,
1004
- cursive: 4,
1005
- fantasy: 5
1006
- };
1007
- function ue(t, e, r) {
1008
- t.start("rPr");
1009
- const n = (e, r) => {
1010
- void 0 !== r && t.empty(e, r ? void 0 : { val: 0 });
1011
- };
1012
- if (n("b", void 0 === e.weight ? void 0 : e.weight >= 700), n("i", void 0 === e.style ? void 0 : e.style !== q.Style.Normal), n("strike", e.strike), n("extend", e.extend), n("outline", e.outline), n("shadow", e.shadow), e.underline && t.empty("u", e.underline === q.UnderlineStyle.Single ? void 0 : { val: e.underline }), e.verticalAlign) {
1013
- const r = e.verticalAlign === q.VerticalAlignment.Super ? "superscript" : e.verticalAlign === q.VerticalAlignment.Sub ? "subscript" : e.verticalAlign;
1014
- t.empty("vertAlign", { val: r });
1015
- }
1016
- void 0 !== e.size && t.empty("sz", { val: e.size }), e.color && function(t, e, r) {
1017
- const n = /^index(\d+)$/.exec(e);
1018
- if (n) return void t.empty("color", { indexed: Number(n[1]) });
1019
- re(t, r, e, "color");
1020
- }(t, e.color, r), e.family && t.empty("rFont", { val: e.family });
1021
- const o = e.fallbacks;
1022
- if (o) for (let e = 0; e < o.length; e++) {
1023
- const r = he[o[e]];
1024
- if (void 0 !== r) {
1025
- t.empty("family", { val: r });
1026
- break;
1027
- }
1028
- }
1029
- void 0 !== e.charset && t.empty("charset", { val: e.charset }), e.scheme && e.scheme !== q.Scheme.None && t.empty("scheme", { val: e.scheme }), t.end("rPr");
1030
- }
1031
- function ge(t, e) {
1032
- t.start("t", o.test(e) || /[\n\r]/.test(e) ? m : void 0), t.text(e), t.end("t");
1033
- }
1034
- function ye(t) {
1035
- const e = t.getRanges();
1036
- if (e.isInvalid()) return null;
1037
- const r = e.getCoords()[0];
1038
- return r ? {
1039
- ref: D.cellToString({
1040
- rowIndex: r.rowStart,
1041
- colIndex: r.colStart
1042
- }),
1043
- row: r.rowStart,
1044
- col: r.colStart
1045
- } : null;
1046
- }
1047
- function xe(t, e, r, n, o = !1, s = !1) {
1048
- const a = n.getTheme();
1049
- if (o && e.start("fill"), "string" == typeof r && (r = {
1050
- type: H.Type.Solid,
1051
- color: r
1052
- }), r.type === H.Type.None) o ? e.empty("patternFill", { patternType: "none" }) : e.empty("noFill");
1053
- else if (r.type === H.Type.Solid) {
1054
- const t = r;
1055
- o ? e.start("patternFill", { patternType: "solid" }) : e.start("solidFill"), t.color && (o ? re(e, a, t.color, "fgColor") : te(e, a, t.color)), o ? e.end("patternFill") : e.end("solidFill");
1056
- } else if (r.type === H.Type.Pattern) {
1057
- const t = r, n = t.patternType || "solid";
1058
- e.start("patternFill", { patternType: n }), t.foreground && (o ? re(e, a, s ? t.background : t.foreground, "fgColor") : te(e, a, s ? t.background : t.foreground)), t.background && (o ? re(e, a, s ? t.foreground : t.background, "bgColor") : te(e, a, s ? t.foreground : t.background)), e.end("patternFill");
1059
- } else if (r.type === H.Type.Gradient && o) {
1060
- const t = r, n = {}, o = t.gradientType;
1061
- if (o !== H.GradientType.Path && o !== H.GradientType.Linear || (n.type = o), void 0 !== t.angle) {
1062
- const e = (t.angle - 90) % 360;
1063
- 0 !== e && (n.degree = String(e));
1064
- }
1065
- const s = t.focus;
1066
- s && (s.left && (n.left = String(s.left)), s.right && (n.right = String(s.right)), s.top && (n.top = String(s.top)), s.bottom && (n.bottom = String(s.bottom))), e.start("gradientFill", n);
1067
- const l = t.stops;
1068
- if (l && l.length > 0) for (const t of l) {
1069
- let r, n = 0;
1070
- if ("string" == typeof t || "object" == typeof t && !("offset" in t)) r = t, n = 0;
1071
- else {
1072
- const e = t;
1073
- n = e.offset || 0, r = e.color;
1074
- }
1075
- e.start("stop", { position: String(n) }), r && re(e, a, r, "color"), e.end("stop");
1076
- }
1077
- e.end("gradientFill");
1078
- } else if (r.type === H.Type.Gradient) {
1079
- const t = r, n = {};
1080
- void 0 !== t.isRotatedWithShape && (n.rotWithShape = t.isRotatedWithShape ? "1" : "0"), e.start("gradFill", n), e.start("gsLst");
1081
- const o = t.stops;
1082
- if (o && o.length > 0) for (const t of o) {
1083
- let r, n = 0;
1084
- if ("string" == typeof t || "object" == typeof t && !("offset" in t)) r = t;
1085
- else {
1086
- const e = t;
1087
- n = e.offset || 0, r = e.color;
1088
- }
1089
- e.start("gs", { pos: String(O.roundAccurately(1e3 * n, 0)) }), r && te(e, a, r), e.end("gs");
1090
- }
1091
- e.end("gsLst");
1092
- const s = t.gradientType;
1093
- if (s && s !== H.GradientType.Linear) {
1094
- const r = "radial" === s ? "circle" : s;
1095
- e.start("path", { path: r });
1096
- const n = t.focus;
1097
- if (n) {
1098
- const t = {};
1099
- void 0 !== n.t && (t.t = String(O.roundAccurately(1e3 * n.t, 0))), void 0 !== n.l && (t.l = String(O.roundAccurately(1e3 * n.l, 0))), void 0 !== n.b && (t.b = String(O.roundAccurately(1e3 * n.b, 0))), void 0 !== n.r && (t.r = String(O.roundAccurately(1e3 * n.r, 0))), e.empty("fillToRect", t);
1100
- }
1101
- e.end("path");
1102
- } else {
1103
- const r = {};
1104
- void 0 !== t.angle && (r.ang = String(O.roundAccurately(6e4 * t.angle, 0)));
1105
- const n = t.scaled;
1106
- void 0 !== n && (r.scaled = n ? "1" : "0"), e.empty("lin", r);
1107
- }
1108
- e.end("gradFill");
1109
- } else o ? e.empty("patternFill", { patternType: "none" }) : e.empty("noFill");
1110
- o && e.end("fill");
1111
- }
1112
- var ve = (t, e, r, n) => {
1113
- if (!r) return e.start("ln"), e.empty("noFill"), void e.end("ln");
1114
- "string" == typeof r && (r = { fill: r });
1115
- const o = r, s = {};
1116
- if (void 0 !== o.width && (s.w = String(Re(o.width))), void 0 !== o.lineCap && (s.cap = we(o.lineCap)), void 0 !== o.compound && (s.cmpd = o.compound), void 0 !== o.align && (s.algn = o.align), e.start("ln", s), xe(0, e, o.fill ?? ke, n), Array.isArray(o.dash)) {
1117
- e.start("custDash");
1118
- for (let t = 0; t < o.dash.length; t += 2) e.empty("ds", {
1119
- d: String(O.roundAccurately(1e3 * o.dash[t], 0)),
1120
- sp: String(O.roundAccurately(1e3 * (o.dash[t + 1] ?? 0), 0))
1121
- });
1122
- e.end("custDash");
1123
- } else "string" == typeof o.dash && e.empty("prstDash", { val: o.dash });
1124
- if (o.lineJoin === J.LineJoin.Round) e.empty("round");
1125
- else if (o.lineJoin === J.LineJoin.Bevel) e.empty("bevel");
1126
- else if (o.lineJoin === J.LineJoin.Miter) {
1127
- const t = {};
1128
- void 0 !== o.miterLimit && (t.lim = String(O.roundAccurately(1e5 * o.miterLimit, 0))), e.empty("miter", t);
1129
- }
1130
- e.end("ln");
1131
- }, we = (t) => "round" === t ? "rnd" : "butt" === t ? "flat" : "square" === t ? "sq" : t, Se = (t, e, r, n = void 0, o = !1) => {
1132
- if (!r) return;
1133
- if (!(r.fill || r.stroke || r.effects?.length || o)) return;
1134
- const s = t.getXMLWriter();
1135
- n && s.start(n), s.pushDefaultNamespace("a"), r.fill && xe(0, s, r.fill, e), r.stroke && ve(0, s, r.stroke, e), r.effects?.length ? be(t, s, e.getTheme(), r.effects) : o && s.empty("effectLst"), s.popDefaultNamespace(), n && s.end(n);
1136
- }, be = (t, e, r, n) => {
1137
- e.start("effectLst");
1138
- for (const t of n) Ce(e, r, t);
1139
- e.end("effectLst");
1140
- }, Ce = (t, e, r) => {
1141
- switch (r.type) {
1142
- case X.Type.OuterShadow: {
1143
- const n = r, o = {};
1144
- void 0 !== n.blur && (o.blurRad = String(Re(n.blur))), void 0 !== n.distance && (o.dist = String(Re(n.distance))), void 0 !== n.angle && (o.dir = String(Fe(n.angle))), void 0 !== n.alignment && (o.algn = n.alignment), void 0 !== n.isRotatedWithShape && (o.rotWithShape = n.isRotatedWithShape ? "1" : "0"), void 0 !== n.scaleX && (o.sx = String(O.roundAccurately(1e3 * n.scaleX, 0))), void 0 !== n.scaleY && (o.sy = String(O.roundAccurately(1e3 * n.scaleY, 0))), void 0 !== n.skewX && (o.kx = String(Fe(n.skewX))), void 0 !== n.skewY && (o.ky = String(Fe(n.skewY))), t.start("outerShdw", o), te(t, e, n.color), t.end("outerShdw");
1145
- break;
1146
- }
1147
- case X.Type.InnerShadow: {
1148
- const n = r, o = {};
1149
- void 0 !== n.blur && (o.blurRad = String(Re(n.blur))), void 0 !== n.distance && (o.dist = String(Re(n.distance))), void 0 !== n.angle && (o.dir = String(Fe(n.angle))), t.start("innerShdw", o), te(t, e, n.color), t.end("innerShdw");
1150
- break;
1151
- }
1152
- case X.Type.PresetShadow: {
1153
- const n = r, o = { prst: n.preset };
1154
- void 0 !== n.distance && (o.dist = String(Re(n.distance))), void 0 !== n.angle && (o.dir = String(Fe(n.angle))), t.start("prstShdw", o), te(t, e, n.color), t.end("prstShdw");
1155
- break;
1156
- }
1157
- case X.Type.Glow: {
1158
- const n = r, o = {};
1159
- void 0 !== n.radius && (o.rad = String(Re(n.radius))), t.start("glow", o), te(t, e, n.color), t.end("glow");
1160
- break;
1161
- }
1162
- case X.Type.SoftEdge: {
1163
- const e = r, n = {};
1164
- void 0 !== e.radius && (n.rad = String(Re(e.radius))), t.empty("softEdge", n);
1165
- break;
1166
- }
1167
- case X.Type.Reflection: {
1168
- const e = r, n = {};
1169
- void 0 !== e.blur && (n.blurRad = String(Re(e.blur))), void 0 !== e.distance && (n.dist = String(Re(e.distance))), void 0 !== e.angle && (n.dir = String(Fe(e.angle))), void 0 !== e.fadeAngle && (n.fadeDir = String(Fe(e.fadeAngle))), void 0 !== e.startAlpha && (n.stA = String(O.roundAccurately(1e3 * e.startAlpha, 0))), void 0 !== e.startPosition && (n.stPos = String(O.roundAccurately(1e3 * e.startPosition, 0))), void 0 !== e.endAlpha && (n.endA = String(O.roundAccurately(1e3 * e.endAlpha, 0))), void 0 !== e.endPosition && (n.endPos = String(O.roundAccurately(1e3 * e.endPosition, 0))), void 0 !== e.scaleX && (n.sx = String(O.roundAccurately(1e3 * e.scaleX, 0))), void 0 !== e.scaleY && (n.sy = String(O.roundAccurately(1e3 * e.scaleY, 0))), void 0 !== e.skewX && (n.kx = String(Fe(e.skewX))), void 0 !== e.skewY && (n.ky = String(Fe(e.skewY))), void 0 !== e.alignment && (n.algn = e.alignment), void 0 !== e.isRotatedWithShape && (n.rotWithShape = e.isRotatedWithShape ? "1" : "0"), t.empty("reflection", n);
1170
- break;
1171
- }
1172
- }
1173
- }, ke = { type: "none" }, Ie = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", Te = "imagesWritten", Me = {
1174
- mime: "image/png",
1175
- ext: "png"
1176
- }, Re = (t = 0) => O.roundAccurately(12700 * t, 0), Ae = (t = 0) => O.roundAccurately(9525 * t, 0), Fe = (t) => 6e4 * t, Le = (t = 0) => O.roundAccurately(100 * t, 2), _e = class {
1177
- constructor() {
1178
- this._dxfs = [], this._byKey = /* @__PURE__ */ new Map();
1179
- }
1180
- add(t) {
1181
- const e = JSON.stringify(t);
1182
- let r = this._byKey.get(e);
1183
- return void 0 === r && (r = this._dxfs.length, this._dxfs.push(t), this._byKey.set(e, r)), r;
1184
- }
1185
- getDxfs() {
1186
- return this._dxfs;
1187
- }
1188
- getCount() {
1189
- return this._dxfs.length;
1190
- }
1191
- }, Pe = "cfDxfs", Ne = [
1192
- "font",
1193
- "fill",
1194
- "borders",
1195
- "numberFormat",
1196
- "alignment"
1197
- ];
1198
- function De(t, e, r) {
1199
- if (e) {
1200
- if (e.named) {
1201
- const n = e.named, o = n.toLowerCase(), s = r.namedStyleMap;
1202
- if (!s.has(o)) {
1203
- s.set(o, "" + s.size);
1204
- const e = t.getNamedStyles().getByName(n).toJSON();
1205
- De(t, e.style ?? O.EmptyObject, r), r.namedStyles.push(e);
1206
- }
1207
- }
1208
- e.font && function(t, e, r) {
1209
- if (!e) return;
1210
- const n = E.JSONStableStringify(e), o = r.fontMap;
1211
- if (!o.has(n)) {
1212
- const t = o.size;
1213
- o.set(n, "" + t), r.fonts.push(e);
1214
- }
1215
- }(0, e.font, r), e.fill && function(t, e, r) {
1216
- if (!e) return;
1217
- const n = E.JSONStableStringify(e), o = r.fillMap;
1218
- if (!o.has(n) && "object" == typeof e && e.type) {
1219
- const t = o.size;
1220
- o.set(n, "" + t), r.fills.push(e);
1221
- }
1222
- }(0, e.fill, r), e.borders && function(t, e, r) {
1223
- if (!e) return;
1224
- const n = E.JSONStableStringify(e), o = r.borderMap;
1225
- if (!o.has(n)) {
1226
- const t = o.size;
1227
- o.set(n, "" + t), r.borders.push(e);
1228
- }
1229
- }(0, e.borders, r), void 0 !== e.numberFormat && function(t, e, r) {
1230
- if (!e) return;
1231
- const n = Q.toBuiltInID(e), o = r.numFmtMap;
1232
- if (!o.has(n)) {
1233
- let t = 0;
1234
- "number" == typeof n ? t = n : (t = r.numFmtsCustom.length + je, r.numFmtsCustom.push(n)), o.set(e, "" + t);
1235
- }
1236
- }(0, e.numberFormat, r);
1237
- }
1238
- }
1239
- function Ee(t, e, r) {
1240
- if (!e) return;
1241
- const n = e.name.toLowerCase();
1242
- r.namedStyleMap.has(n) || (r.namedStyleMap.set(n, "" + r.namedStyleMap.size), r.namedStyles.push(e), De(t, e.style, r));
1243
- }
1244
- function Be(t, e, r, n, o = !1) {
1245
- const s = n.getDefaultFontSize(), a = n.getTheme().getFontScheme().getMinorFont() ?? "Calibri", l = n.getNormal().getFont().getColor();
1246
- e.start("font"), r.weight && r.weight >= 700 && e.empty("b"), r.style && "normal" !== r.style && e.empty("i"), r.strike && e.empty("strike"), r.underline && e.empty("u", { val: r.underline }), r.outline && e.empty("outline"), r.shadow && e.empty("shadow"), r.extend && e.empty("extend");
1247
- let i = r.verticalAlign;
1248
- i && ("super" === i && (i = "superscript"), "sub" === i && (i = "subscript"), e.empty("vertAlign", { val: i })), o ? void 0 !== r.size && e.empty("sz", { val: String(r.size) }) : e.empty("sz", { val: String(r.size ?? s) }), re(e, n.getTheme(), r.color ?? l, "color", !o);
1249
- const c = !o || r.family && r.family !== a;
1250
- if (c && (e.empty("name", { val: r.family ?? a }), r.fallbacks && r.fallbacks.length > 0)) {
1251
- const t = r.fallbacks;
1252
- t.includes("serif") ? e.empty("family", { val: 1 }) : t.includes("sans-serif") ? e.empty("family", { val: 2 }) : t.includes("monospace") ? e.empty("family", { val: 3 }) : t.includes("cursive") ? e.empty("family", { val: 4 }) : t.includes("fantasy") && e.empty("family", { val: 5 });
1253
- }
1254
- void 0 !== r.charset && null !== r.charset && e.empty("charset", { val: String(r.charset) });
1255
- const d = r.scheme ?? (void 0 === r.family ? "minor" : void 0);
1256
- c && void 0 !== d && "none" !== d && e.empty("scheme", { val: d }), e.end("font");
1257
- }
1258
- function Oe(t, e, r, n, o, s = !1) {
1259
- if (!o || "none" === o.style || !o.style) return void (s && !o || e.empty(n));
1260
- e.start(n, { style: o.style });
1261
- let a = o.color;
1262
- a && re(e, r, a, "color", !s, s), e.end(n);
1263
- }
1264
- function $e(t, e, r, n, o = !1) {
1265
- const s = {};
1266
- o ? (s.diagonalUp = "0", s.diagonalDown = "0") : (r.diagonalUp && (s.diagonalUp = "1"), r.diagonalDown && (s.diagonalDown = "1")), e.start("border", s), Oe(0, e, n, "left", r.left, o), Oe(0, e, n, "right", r.right, o), Oe(0, e, n, "top", r.top, o), Oe(0, e, n, "bottom", r.bottom, o), o ? (Oe(0, e, n, "vertical", r.vertical, o), Oe(0, e, n, "horizontal", r.horizontal, o)) : Oe(0, e, n, "diagonal", r.diagonalUp ?? r.diagonalDown, o), e.end("border");
1267
- }
1268
- function We(t, e, r, n = !1) {
1269
- const o = {};
1270
- r.horizontal && r.horizontal !== Y.HorizontalAlignment.General && (o.horizontal = r.horizontal), r.vertical && r.vertical !== Y.VerticalAlignment.Bottom && (o.vertical = r.vertical);
1271
- let s = r.rotation;
1272
- r.stacked && (o.textRotation = "255", s = 0), s && (s >= 270 && s < 360 ? s = 360 - s : s > 0 && s <= 90 && (s += 90), o.textRotation = String(s));
1273
- const a = r.overflow;
1274
- switch (a === Y.Overflow.Wrap && (o.wrapText = "1"), r.indent && (o.indent = "" + r.indent), r.relativeIndent && (o.relativeIndent = "" + r.relativeIndent), r.justifyLastLine && (o.justifyLastLine = "1"), a === Y.Overflow.Shrink && (o.shrinkToFit = "1"), r.readingDirection) {
1275
- case Y.ReadingDirection.Auto: break;
1276
- case Y.ReadingDirection.LeftToRight:
1277
- o.readingOrder = "1";
1278
- break;
1279
- case Y.ReadingDirection.RightToLeft: o.readingOrder = "2";
1280
- }
1281
- return Object.keys(o).length > 0 ? o : null;
1282
- }
1283
- function Ve(t, e, r, n, o, s, a = !1) {
1284
- const l = {};
1285
- let i = null, c = n.named;
1286
- c && (i = r.getNamedStyles().getByName(c).toJSON().style);
1287
- const d = n.font ?? i?.font, m = d ? o.fontMap.get(E.JSONStableStringify(d)) ?? 0 : 0, p = n.fill ?? i?.fill, f = p ? o.fillMap.get(E.JSONStableStringify(p)) ?? 0 : 0, h = n.borders ?? i?.borders, u = h ? o.borderMap.get(E.JSONStableStringify(h)) ?? 0 : 0, g = n.numberFormat ?? i?.numberFormat;
1288
- if (l.numFmtId = (void 0 !== g ? o.numFmtMap.get(g) : void 0) ?? "0", l.fontId = String(m), l.fillId = String(f), l.borderId = String(u), s) {
1289
- const t = n.named ?? K.BuiltInName.Normal;
1290
- l.xfId = o.namedStyleMap.get(t.toLowerCase());
1291
- }
1292
- let y = null;
1293
- const x = n.alignment ?? i?.alignment;
1294
- x && (y = We(0, 0, x)), n.font && (l.applyFont = "1"), n.fill && (l.applyFill = "1"), n.numberFormat && (l.applyNumberFormat = "1"), n.borders && (l.applyBorder = "1"), y && (l.applyAlignment = "1");
1295
- let v = null;
1296
- const w = n.protection?.alwaysUnlocked ?? i?.protection?.alwaysUnlocked ?? !1;
1297
- (w || a) && (v = {}, w && (v.locked = "0"), a && (v.hidden = "1"), l.applyProtection = "1"), n.quotePrefix && (l.quotePrefix = "1"), y || v ? (e.start("xf", l), y && e.empty("alignment", y), v && e.empty("protection", v), e.end("xf")) : e.empty("xf", l);
1298
- }
1299
- function ze(t, e, r, n, o, s = "dxf", a = je) {
1300
- if (e.start(s), r.font && Be(0, e, r.font, n, !0), void 0 !== r.numberFormat && null !== r.numberFormat) {
1301
- const t = Q.toBuiltInID(r.numberFormat), n = "number" == typeof t, o = n ? Q.builtInFormat(t) : String(t);
1302
- o && e.empty("numFmt", {
1303
- numFmtId: String(n ? t : a++),
1304
- formatCode: o
1305
- });
1306
- }
1307
- if (r.fill && xe(0, e, r.fill, n, !0, !0), r.alignment) {
1308
- const t = We(0, 0, r.alignment, !0);
1309
- t && e.empty("alignment", t);
1310
- }
1311
- return r.borders && $e(0, e, r.borders, o, !0), e.end(s), a;
1312
- }
1313
- var je = 164, Ue = Object.freeze([
1314
- "wholeTable",
1315
- "headerRow",
1316
- "totalRow",
1317
- "firstColumn",
1318
- "lastColumn",
1319
- "firstRowStripe",
1320
- "secondRowStripe",
1321
- "firstColumnStripe",
1322
- "secondColumnStripe",
1323
- "firstHeaderCell",
1324
- "lastHeaderCell",
1325
- "firstTotalCell",
1326
- "lastTotalCell"
1327
- ]), Xe = j.BuiltInOperatorNames, He = (t, e, r, n, o, s) => {
1328
- const a = n.sorts, l = a ? a.length : 0;
1329
- if (0 === l) return;
1330
- const i = {};
1331
- if (l > 0) {
1332
- const t = a[0].criteria?.collatorOptions;
1333
- t && (i.caseSensitive = "object" != typeof t || Array.isArray(t) || "case" !== t.sensitivity && "variant" !== t.sensitivity ? "0" : "1");
1334
- }
1335
- i.ref = r.getRange().toString(), i["xmlns:xlrd2"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2", e.start("sortState", i);
1336
- for (let t = 0; t < l; t++) {
1337
- const r = a[t], n = r.criteria ?? {}, l = r.index + s.colStart, i = {};
1338
- n.reverse && (i.descending = "1"), i.ref = o.getIntersect({
1339
- colStart: l,
1340
- rowStart: s.rowStart,
1341
- colEnd: l,
1342
- rowEnd: s.rowEnd
1343
- }).toString(), n.sortOn && (i.sortBy = n.sortOn), void 0 !== n.dxfId && (i.dxfId = n.dxfId), void 0 !== n.iconSet && (i.iconSet = n.iconSet), void 0 !== n.customList && (i.customList = n.customList), e.empty("sortCondition", i);
1344
- }
1345
- e.end("sortState");
1346
- }, qe = (t, e, r, n, o = !1) => {
1347
- let s = r.getRange();
1348
- r.isShowTotals() && (s = s.getResizeBy(-1, 0));
1349
- const a = s.getCoords(), l = n.sort, i = n.filter, c = i ? i.conditions : void 0, d = c ? c.length : 0, m = n.hiddenButtons, p = {};
1350
- p.ref = s.toString();
1351
- let f, h = [];
1352
- for (let t = 0; t < d; t++) {
1353
- const e = c[t];
1354
- h[e.index] = { ...e };
1355
- }
1356
- if (Array.isArray(m) && m.length > 0) {
1357
- const t = m.length;
1358
- f = new Array(m[t - 1]);
1359
- for (let e = 0; e < t; e++) f[m[e]] = !0;
1360
- }
1361
- if (h || m || f || o) {
1362
- let i = 0;
1363
- n.columns ? i = n.columns.length : o && (i = s.getColumnCount()), e.start("autoFilter", p);
1364
- for (let r = 0; r < i; r++) {
1365
- const n = !0 === m || !0 === f?.[r], o = h[r];
1366
- (o || n) && Je(t, e, r, o, n);
1367
- }
1368
- l && o && He(0, e, r, l, s, a), e.end("autoFilter");
1369
- } else e.empty("autoFilter", p);
1370
- l && !o && He(0, e, r, l, s, a);
1371
- }, Ge = (t, e, r) => {
1372
- const n = M(r, (e) => t.warn(e, r));
1373
- if (!n) return;
1374
- const o = { operator: n.operator };
1375
- void 0 !== n.val && (o.val = n.val), e.empty("customFilter", o);
1376
- }, Je = (t, e, r, n, o) => {
1377
- const s = {};
1378
- s.colId = "" + r, o && (s.hiddenButton = "1"), n ? (e.start("filterColumn", s), ((t, e, r) => {
1379
- const n = r.operator;
1380
- if (n !== j.BuiltInOperatorNames.Expression) if (n !== j.BuiltInOperatorNames.Unique) {
1381
- if (n === j.BuiltInOperatorNames.Color) {
1382
- const t = r.param, n = {};
1383
- void 0 !== t.cellColor && (n.cellColor = t.cellColor ? "1" : "0"), void 0 !== t.styleId && (n.dxfId = t.styleId), e.empty("colorFilter", n);
1384
- }
1385
- if (Ke(n)) if ("between" === n) {
1386
- const n = r.param;
1387
- e.start("customFilters", { and: "1" }), Ge(t, e, {
1388
- operator: Xe.GreaterThanEqualTo,
1389
- param: n.from
1390
- }), Ge(t, e, {
1391
- operator: Xe.LessThanEqualTo,
1392
- param: n.to
1393
- }), e.end("customFilters");
1394
- } else if (n === j.BuiltInOperatorNames.Not) {
1395
- const n = r.param;
1396
- I(n?.operator) ? (e.start("customFilters"), Ge(t, e, r), e.end("customFilters")) : t.warn("Not rule with non-comparison criteria not supported in OOXML", n);
1397
- } else if (n === j.BuiltInOperatorNames.And || n === j.BuiltInOperatorNames.Or) {
1398
- const o = r.param, s = o.length;
1399
- if (s > 0) {
1400
- const r = {};
1401
- n === j.BuiltInOperatorNames.And && s > 1 && (r.and = "1"), e.start("customFilters", r);
1402
- for (let r = 0; r < s; r++) {
1403
- const n = o[r], s = n.operator === Xe.Not && I(n.param?.operator);
1404
- I(n.operator) || s ? Ge(t, e, n) : t.warn("Only Comparison criteria supported in Union conditions for Table AutoFilters", n);
1405
- }
1406
- e.end("customFilters");
1407
- }
1408
- } else I(n) && (e.start("customFilters"), Ge(t, e, r), e.end("customFilters"));
1409
- if (n === j.BuiltInOperatorNames.TimePeriod) {
1410
- const t = r.param, n = {};
1411
- t.type && (n.type = t.type), void 0 !== t.anchorDate && (n.val = "" + t.anchorDate), void 0 !== t.maxVal && (n.maxVal = "" + t.maxVal), e.empty("dynamicFilter", n);
1412
- }
1413
- if (n === j.BuiltInOperatorNames.Average) {
1414
- const t = r.param, n = {};
1415
- let o = t.type;
1416
- o && (o === j.AverageType.Above ? n.type = "aboveAverage" : o === j.AverageType.Below && (n.type = "belowAverage")), void 0 !== t.stdDevs && (n.val = "" + t.stdDevs), e.empty("dynamicFilter", n);
1417
- }
1418
- if (n === j.BuiltInOperatorNames.InSet) {
1419
- const t = r.param;
1420
- if (t.dateGroups) {
1421
- const r = t.dateGroups, n = r.length;
1422
- e.start("dateGroupItem");
1423
- for (let t = 0; t < n; t++) {
1424
- const n = r[t], o = {};
1425
- void 0 !== n.day && (o.day = "" + n.day), void 0 !== n.hour && (o.hour = "" + n.hour), void 0 !== n.minute && (o.minute = "" + n.minute), void 0 !== n.second && (o.second = "" + n.second), void 0 !== n.year && (o.year = "" + n.year), void 0 !== n.month && (o.month = "" + n.month), o.dateTimeGrouping = n.group, e.empty("dateGroupItem", o);
1426
- }
1427
- e.end("dateGroupItem");
1428
- }
1429
- if (t.items) {
1430
- const r = t.items, n = r.length;
1431
- e.start("filters");
1432
- for (let t = 0; t < n; t++) {
1433
- const n = r[t];
1434
- e.empty("filter", { val: "" + n });
1435
- }
1436
- e.end("filters");
1437
- }
1438
- }
1439
- if (n === j.BuiltInOperatorNames.Icon) {
1440
- const t = r.param, n = {};
1441
- void 0 !== t.iconSet && (n.iconSet = t.iconSet), void 0 !== t.iconId && (n.iconId = "" + t.iconId), e.empty("iconFilter", n);
1442
- }
1443
- if (n === j.BuiltInOperatorNames.TopN) {
1444
- const t = r.param, n = {};
1445
- t.percent && (n.percent = "1"), void 0 !== t.top && (n.top = t.top ? "1" : "0"), void 0 !== t.limit && (n.val = "" + t.limit), void 0 !== t.filterVal && (n.filterVal = "" + t.filterVal), e.empty("top10", n);
1446
- }
1447
- } else t.warn("Unique conditions not supported in Table AutoFilters", r);
1448
- else t.warn("Expression conditions not supported in Table AutoFilters", r);
1449
- })(t, e, n), e.end("filterColumn")) : e.empty("filterColumn", s);
1450
- }, Ke = (t) => t === j.BuiltInOperatorNames.GreaterThan || t === j.BuiltInOperatorNames.GreaterThanEqualTo || t === j.BuiltInOperatorNames.LessThan || t === j.BuiltInOperatorNames.LessThanEqualTo || t === j.BuiltInOperatorNames.EqualTo || t === j.BuiltInOperatorNames.And || t === j.BuiltInOperatorNames.Or || t === j.BuiltInOperatorNames.Not || "between" === t, Ye = {
1451
- names: /* @__PURE__ */ new Set(),
1452
- perFormula: [],
1453
- affects: () => !1
1454
- };
1455
- var Ze = 1048576, Qe = (t, e, r) => {
1456
- if (!r) return [];
1457
- let n = 0;
1458
- for (let o = 0; o < r.length; o++) {
1459
- const s = r[o][0], a = e.getRange(s).getCoords();
1460
- if (n += (a.rowEnd - a.rowStart + 1) * (a.colEnd - a.colStart + 1), n > Ze) return t.warn(`Direct styles cover more than ${Ze} cells; not writing the styles from '${s}' on. A range that size belongs in a column or row style.`), r.slice(0, o);
1461
- }
1462
- return r;
1463
- };
1464
- function tr(t, e) {
1465
- let r = e.type;
1466
- r === U.ColorStopType.AutoMin ? r = U.ColorStopType.Min : r === U.ColorStopType.AutoMax && (r = U.ColorStopType.Max), t.empty("cfvo", {
1467
- type: r,
1468
- val: e.value,
1469
- gte: e.exclusive ? "0" : void 0
1470
- });
1471
- }
1472
- function er(t, e) {
1473
- const r = {
1474
- type: e.type,
1475
- gte: e.exclusive ? "0" : void 0
1476
- };
1477
- void 0 !== e.value ? (t.start("x14:cfvo", r), t.start("xm:f"), t.text(e.value), t.end("xm:f"), t.end("x14:cfvo")) : t.empty("x14:cfvo", r);
1478
- }
1479
- var rr = /* @__PURE__ */ new Set([
1480
- K.IconSet.Arrows3,
1481
- K.IconSet.ArrowsGray3,
1482
- K.IconSet.Flags3,
1483
- K.IconSet.Signs3,
1484
- K.IconSet.Symbols3,
1485
- K.IconSet.Symbols3_2,
1486
- K.IconSet.TrafficLights3,
1487
- K.IconSet.TrafficLights3_2,
1488
- K.IconSet.Arrows4,
1489
- K.IconSet.ArrowsGray4,
1490
- K.IconSet.Rating4,
1491
- K.IconSet.RedToBlack4,
1492
- K.IconSet.TrafficLights4,
1493
- K.IconSet.Arrows5,
1494
- K.IconSet.ArrowsGray5,
1495
- K.IconSet.Quarters5,
1496
- K.IconSet.Rating5
1497
- ]);
1498
- function nr(t) {
1499
- return (t.icon?.length ?? 0) > 0 || void 0 !== t.iconSet && !rr.has(t.iconSet);
1500
- }
1501
- function or(t, e, r, n, o, s, a, l, i) {
1502
- const c = n.scale;
1503
- n.ext && t.warn("Conditional format extension payload is not written to xlsx; it will be lost.");
1504
- const d = {
1505
- type: o.type,
1506
- dxfId: n.style && Object.keys(n.style).length > 0 ? l.add(n.style) : void 0,
1507
- priority: a,
1508
- stopIfTrue: lr(n.stopIfTrue),
1509
- aboveAverage: lr(o.aboveAverage),
1510
- equalAverage: lr(o.equalAverage),
1511
- stdDev: o.stdDev,
1512
- bottom: lr(o.bottom),
1513
- percent: lr(o.percent),
1514
- rank: o.rank,
1515
- operator: o.operator,
1516
- text: o.text,
1517
- timePeriod: o.timePeriod
1518
- };
1519
- let m;
1520
- c?.type === U.ScaleType.DataBar && function(t) {
1521
- if (t.gradient || t.borderColor || t.negativeFillColor || t.negativeBorderColor || t.axisColor || t.axisPosition || t.direction) return !0;
1522
- const e = t.stops, r = e ? e.length : 0;
1523
- for (let t = 0; t < r; t++) {
1524
- const r = e[t].type;
1525
- if (r === U.ColorStopType.AutoMin || r === U.ColorStopType.AutoMax) return !0;
1526
- }
1527
- return !1;
1528
- }(c) && (m = w(O.uuidV4), i.push({
1529
- guid: m,
1530
- sqref: s,
1531
- priority: a,
1532
- scale: c
1533
- }));
1534
- const p = o.formulas, f = p ? p.length : 0;
1535
- if (0 !== f || c) {
1536
- e.start("cfRule", d);
1537
- for (let t = 0; t < f; t++) e.start("formula"), e.text(p[t]), e.end("formula");
1538
- if (c?.type === U.ScaleType.ColorScale) {
1539
- const t = c.stops ?? [];
1540
- e.start("colorScale");
1541
- for (let r = 0; r < t.length; r++) tr(e, t[r]);
1542
- for (let n = 0; n < t.length; n++) re(e, r, t[n].color, "color");
1543
- e.end("colorScale");
1544
- } else if (c?.type === U.ScaleType.DataBar) {
1545
- const t = c.stops ?? [];
1546
- e.start("dataBar", {
1547
- minLength: c.minLength,
1548
- maxLength: c.maxLength,
1549
- showValue: lr(c.showValue)
1550
- });
1551
- for (let r = 0; r < t.length; r++) tr(e, t[r]);
1552
- c.color && re(e, r, c.color, "color"), e.end("dataBar");
1553
- } else if (c?.type === U.ScaleType.IconSet) {
1554
- const t = c.stops ?? [];
1555
- e.start("iconSet", {
1556
- iconSet: c.iconSet,
1557
- reverse: lr(c.reverse),
1558
- showValue: lr(c.showValue)
1559
- });
1560
- for (let r = 0; r < t.length; r++) tr(e, t[r]);
1561
- e.end("iconSet");
1562
- }
1563
- m && (e.start("extLst"), e.start("ext", {
1564
- uri: h,
1565
- "xmlns:x14": u
1566
- }), e.start("x14:id"), e.text(m), e.end("x14:id"), e.end("ext"), e.end("extLst")), e.end("cfRule");
1567
- } else e.empty("cfRule", d);
1568
- }
1569
- function sr(t) {
1570
- let e = Number.MAX_SAFE_INTEGER, r = Number.MAX_SAFE_INTEGER;
1571
- const n = t.split(" ");
1572
- for (let t = 0; t < n.length; t++) {
1573
- if (!n[t]) continue;
1574
- const o = D.fastStringToRange(n[t]);
1575
- o.rowStart < e && (e = o.rowStart), o.colStart < r && (r = o.colStart);
1576
- }
1577
- return D.cellToString({
1578
- rowIndex: e,
1579
- colIndex: r
1580
- });
1581
- }
1582
- function ar(t) {
1583
- if ("string" == typeof t) return t.split(",").join(" ");
1584
- if (Array.isArray(t)) {
1585
- const e = [];
1586
- for (let r = 0; r < t.length; r++) {
1587
- const n = D.rangeToString(t[r]);
1588
- n && e.push(n);
1589
- }
1590
- return e.length > 0 ? e.join(" ") : null;
1591
- }
1592
- return D.rangeToString(t);
1593
- }
1594
- function lr(t) {
1595
- if (void 0 !== t) return t ? "1" : "0";
1596
- }
1597
- function ir(t) {
1598
- if ("string" != typeof t) return !1;
1599
- let e = !1;
1600
- for (let r = 0; r < t.length; r++) {
1601
- const n = t[r];
1602
- if ("\"" === n) e = !e;
1603
- else if ("!" === n && !e) return !0;
1604
- }
1605
- return !1;
1606
- }
1607
- function cr(t) {
1608
- const e = t.formulas, r = e ? e.length : 0;
1609
- for (let t = 0; t < r; t++) if (ir(e[t])) return !0;
1610
- return !1;
1611
- }
1612
- function dr(t) {
1613
- let e = Number.MAX_SAFE_INTEGER, r = Number.MAX_SAFE_INTEGER;
1614
- const n = t.split(" ");
1615
- for (let t = 0; t < n.length; t++) {
1616
- if (!n[t]) continue;
1617
- const o = D.fastStringToRange(n[t]);
1618
- o.rowStart < e && (e = o.rowStart), o.colStart < r && (r = o.colStart);
1619
- }
1620
- return e === Number.MAX_SAFE_INTEGER ? null : {
1621
- rowIndex: e,
1622
- colIndex: r
1623
- };
1624
- }
1625
- function mr(t, e, r) {
1626
- if ("string" != typeof t || !t || !e || !r) return t;
1627
- try {
1628
- const n = r.parse(t, e);
1629
- return n && V.image(r.spell(n, !0), { at: e }) || t;
1630
- } catch {
1631
- return t;
1632
- }
1633
- }
1634
- function pr(t, e, r) {
1635
- const n = t?.stops;
1636
- if (!n || !r) return t;
1637
- let o;
1638
- for (let t = 0; t < n.length; t++) {
1639
- const s = n[t]?.value;
1640
- if ("string" != typeof s) continue;
1641
- const a = mr(s, e, r);
1642
- a !== s && (o || (o = [...n]), o[t] = {
1643
- ...n[t],
1644
- value: a
1645
- });
1646
- }
1647
- return o ? {
1648
- ...t,
1649
- stops: o
1650
- } : t;
1651
- }
1652
- function fr(t, e, r, n) {
1653
- if (!n?.xml) return;
1654
- const o = t.addPart("legacyDrawing", n);
1655
- e.empty(r, { "r:id": o.relId });
1656
- }
1657
- var hr = (t, e, r, n) => {
1658
- const o = (e, r) => {
1659
- const n = t.getRangeAtBounds({
1660
- x: e,
1661
- y: r,
1662
- width: 0,
1663
- height: 0
1664
- }), o = n.getCoords(), s = n.getBounds();
1665
- return [
1666
- o.colStart,
1667
- e - s.x,
1668
- o.rowStart,
1669
- r - s.y
1670
- ];
1671
- };
1672
- let s = e.getMovable()?.getBounds() ?? null;
1673
- const a = s ? e.toJSON()?.box?.anchor : void 0;
1674
- if (s && a?.tl && a.br) {
1675
- const e = t.getEntireRange().getCoords(), o = (t) => [
1676
- Math.min(e.colEnd, Math.max(0, n + (t.c ?? 0))),
1677
- t.x ?? 0,
1678
- Math.min(e.rowEnd, Math.max(0, r + (t.r ?? 0))),
1679
- t.y ?? 0
1680
- ];
1681
- return {
1682
- bounds: s,
1683
- anchor: [...o(a.tl), ...o(a.br)]
1684
- };
1685
- }
1686
- if (!s) {
1687
- const e = t.getRange({
1688
- rowStart: r,
1689
- colStart: n,
1690
- rowEnd: r,
1691
- colEnd: n
1692
- }).getBounds();
1693
- s = {
1694
- x: e.x + e.width + 15,
1695
- y: Math.max(2, e.y - 10),
1696
- width: 144,
1697
- height: 79
1698
- };
1699
- }
1700
- return {
1701
- bounds: s,
1702
- anchor: [...o(s.x, s.y), ...o(s.x + s.width, s.y + s.height)]
1703
- };
1704
- }, ur = (t, e) => {
1705
- if (!e) return t;
1706
- const r = t?.xml ?? null;
1707
- let n = y(r ?? "");
1708
- const o = [], s = e.comments;
1709
- for (let t = 0; t < s.length; t++) {
1710
- const { comment: r, row: a, col: l } = s[t], i = r.isNote() ? r.toJSON() : null, { bounds: c, anchor: d } = hr(e.sheet, r, a, l);
1711
- o.push(x(i?.box?.xml, {
1712
- shapeId: ++n,
1713
- zIndex: t + 1,
1714
- row: a,
1715
- col: l,
1716
- anchor: d,
1717
- bounds: c,
1718
- visible: !!i?.shown,
1719
- alt: i?.description
1720
- }));
1721
- }
1722
- const a = b(r, o, n);
1723
- return a ? a === r ? t : t ? {
1724
- ...t,
1725
- xml: a
1726
- } : { xml: a } : t;
1727
- };
1728
- var gr = (t) => "control" !== t.content?.type, yr = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp";
1729
- var xr = (t, e) => {
1730
- if (!t?.xml) return t;
1731
- const r = e.movables;
1732
- if (!r) return t;
1733
- const n = /* @__PURE__ */ new Map(), o = r.length;
1734
- for (let t = 0; t < o; t++) {
1735
- const e = r[t];
1736
- if (gr(e)) continue;
1737
- const o = (e.content?.json)?.shapeId;
1738
- "number" == typeof o && n.set(o, e);
1739
- }
1740
- if (0 === n.size) return t;
1741
- const s = t.xml.replace(/<v:shape\b[\s\S]*?<\/v:shape>/g, (t) => {
1742
- const e = /\bo:spid="_x0000_s(\d+)"/.exec(t) ?? /\bid="_x0000_s(\d+)"/.exec(t), r = e ? n.get(parseInt(e[1], 10)) : void 0;
1743
- if (!r) return t;
1744
- const o = r.anchor, s = [
1745
- o.tl.c,
1746
- o.tl.r,
1747
- o.br.c,
1748
- o.br.r
1749
- ];
1750
- return t.replace(/(<x:Anchor>)([\s\d,-]*)(<\/x:Anchor>)/, (t, e, r, n) => {
1751
- const o = r.split(",").map((t) => t.trim());
1752
- if (8 !== o.length) return t;
1753
- const a = o.slice();
1754
- for (let t = 0; t < 4; t++) a[2 * t] = String(s[t] ?? 0);
1755
- return a.join(",") === o.join(",") ? t : `${e}${a.join(", ")}${n}`;
1756
- });
1757
- });
1758
- return s === t.xml ? t : {
1759
- ...t,
1760
- xml: s
1761
- };
1762
- }, vr = (t, e, r) => {
1763
- t.start(e), t.start("xdr:col"), t.text(r.c ?? 0), t.end("xdr:col"), t.start("xdr:colOff"), t.text(Ae(r.x)), t.end("xdr:colOff"), t.start("xdr:row"), t.text(r.r ?? 0), t.end("xdr:row"), t.start("xdr:rowOff"), t.text(Ae(r.y)), t.end("xdr:rowOff"), t.end(e);
1764
- };
1765
- var wr = {
1766
- r: void 0,
1767
- s: void 0,
1768
- t: void 0,
1769
- cm: void 0,
1770
- vm: void 0
1771
- }, Sr = {
1772
- r: void 0,
1773
- s: void 0,
1774
- customFormat: void 0,
1775
- hidden: void 0,
1776
- ht: void 0,
1777
- customHeight: void 0,
1778
- "x14ac:dyDescent": "0.25",
1779
- outlineLevel: void 0,
1780
- collapsed: void 0
1781
- }, br = {
1782
- t: void 0,
1783
- aca: void 0,
1784
- ref: void 0,
1785
- ca: void 0,
1786
- si: void 0
1787
- }, Cr = {
1788
- t: "shared",
1789
- aca: void 0,
1790
- ref: void 0,
1791
- ca: void 0,
1792
- si: void 0
1793
- }, kr = {
1794
- t: "array",
1795
- aca: void 0,
1796
- ref: void 0,
1797
- ca: void 0,
1798
- si: void 0
1799
- };
1800
- function Ir(t, e, r, n) {
1801
- r && (e.start(n), e.empty("latin", { typeface: r }), e.empty("ea", { typeface: "" }), e.empty("cs", { typeface: "" }), e.end(n));
1802
- }
1803
- var Tr = (t) => t.toISOString().split(".")[0] + "Z", Mr = (t, e, r) => {
1804
- switch (e) {
1805
- case "creator":
1806
- t.start("dc:creator"), t.text(r), t.end("dc:creator");
1807
- break;
1808
- case "lastModifiedBy":
1809
- t.start("cp:lastModifiedBy"), t.text(r), t.end("cp:lastModifiedBy");
1810
- break;
1811
- case "created":
1812
- t.start("dcterms:created", { "xsi:type": "dcterms:W3CDTF" }), t.text(r), t.end("dcterms:created");
1813
- break;
1814
- case "modified": t.start("dcterms:modified", { "xsi:type": "dcterms:W3CDTF" }), t.text(r), t.end("dcterms:modified");
1815
- }
1816
- }, Rr = (t, e, r, n) => {
1817
- e.start(r), e.text(n), e.end(r);
1818
- }, Ar = (t, e, r) => {
1819
- const n = r.getSheets().getItems({ visibility: G.Visibility.Hidden }).map((t) => t.getName()), o = r.getNames().getItems({ type: "formula" }).filter((t) => !!t.getRanges?.()).map((t) => t.getName());
1820
- e.start("HeadingPairs"), e.start("vt:vector", {
1821
- size: o.length > 0 ? "4" : "2",
1822
- baseType: "variant"
1823
- }), e.start("vt:variant"), e.start("vt:lpstr"), e.text("Worksheets"), e.end("vt:lpstr"), e.end("vt:variant"), e.start("vt:variant"), e.start("vt:i4"), e.text("" + n.length), e.end("vt:i4"), e.end("vt:variant"), o.length > 0 && (e.start("vt:variant"), e.start("vt:lpstr"), e.text("Named Ranges"), e.end("vt:lpstr"), e.end("vt:variant"), e.start("vt:variant"), e.start("vt:i4"), e.text("" + o.length), e.end("vt:i4"), e.end("vt:variant")), e.end("vt:vector"), e.end("HeadingPairs"), e.start("TitlesOfParts"), e.start("vt:vector", {
1824
- size: "" + (n.length + o.length),
1825
- baseType: "lpstr"
1826
- });
1827
- for (const t of n) e.start("vt:lpstr"), e.text(t), e.end("vt:lpstr");
1828
- for (const t of o) e.start("vt:lpstr"), e.text(t), e.end("vt:lpstr");
1829
- e.end("vt:vector"), e.end("TitlesOfParts");
1830
- }, Fr = {
1831
- minSupportedVersion: "120000",
1832
- copy: "1",
1833
- pasteAll: "1",
1834
- pasteValues: "1",
1835
- merge: "1",
1836
- splitFirst: "1",
1837
- rowColShift: "1",
1838
- clearFormats: "1",
1839
- clearComments: "1",
1840
- assign: "1",
1841
- coerce: "1"
1842
- }, Lr = (t, e, r = O.EmptyArray) => {
1843
- if (!e) return { ...r };
1844
- const { text: n, runs: o, color: s, size: a, kern: l, weight: i, style: c, b: d, i: m, spc: p, baseline: f, ...h } = e, u = {
1845
- ...r,
1846
- ...h
1847
- };
1848
- return void 0 !== a && (u.sz = "" + Le(a)), void 0 !== d && (u.b = d ? "1" : "0"), void 0 !== i && (u.b = i > 500 ? "1" : "0"), void 0 !== m && (u.i = m ? "1" : "0"), void 0 !== c && (u.i = "italic" === c ? "1" : "0"), void 0 !== l && (u.kern = "" + Le(l)), void 0 !== p && (u.spc = "" + Le(p)), void 0 !== f && (u.baseline = "" + Le(f)), u;
1849
- }, _r = (t, e, r) => {
1850
- if (!r) return;
1851
- const n = t.getXMLWriter();
1852
- n.start("txBody"), n.pushDefaultNamespace("a");
1853
- Nr(t, e, {
1854
- vertOverflow: "clip",
1855
- horzOverflow: "clip",
1856
- rtlCol: "0",
1857
- anchor: "ctr"
1858
- }), n.empty("lstStyle"), ((t, e, r) => {
1859
- if (!r) return;
1860
- const n = t.getXMLWriter();
1861
- n.pushDefaultNamespace("a"), "string" == typeof r && (r = { runs: [{ text: r }] }), n.start("p");
1862
- n.empty("pPr", { algn: "ctr" });
1863
- const s = Lr(0, r, {
1864
- ...Dr,
1865
- size: e.getDefaultFontSize()
1866
- }), a = r?.runs, l = a ? a.length : 0;
1867
- if (l > 0) for (let t = 0; t < l; t++) {
1868
- const r = a[t];
1869
- n.start("r", {});
1870
- const o = Lr(0, r, Dr), s = r.color;
1871
- s ? (n.start("rPr", o), xe(0, n, s, e), n.end("rPr")) : n.empty("rPr", o), n.start("t"), n.text(r?.text ?? ""), n.end("t"), n.end("r");
1872
- }
1873
- else n.empty("endParaRPr", s);
1874
- n.end("p"), n.popDefaultNamespace();
1875
- })(t, e, r), n.popDefaultNamespace(), n.end("txBody");
1876
- }, Pr = (t, e, r) => {
1877
- if (!r) return;
1878
- const n = t.getXMLWriter(), o = Lr(0, r);
1879
- n.empty("defRPr", o);
1880
- }, Nr = (t, e, r) => {
1881
- if (!r) return;
1882
- const n = t.getXMLWriter(), { spAutoFit: o, ...s } = r;
1883
- o ? (n.start("bodyPr", s), n.empty("spAutoFit"), n.end("bodyPr")) : n.empty("bodyPr", s);
1884
- }, Dr = Object.freeze({ lang: "en-US" }), Er = (t, e) => {
1885
- if (0 !== e.length) {
1886
- t.start("a:extLst");
1887
- for (const r of e) {
1888
- const e = {}, n = r[0];
1889
- n && (e.uri = n), t.start("a:ext", e), t.empty(r[1], r[2]), t.end("a:ext");
1890
- }
1891
- t.end("a:extLst");
1892
- }
1893
- }, Br = async (t, e, r, n, o) => {
1894
- const s = t.getSharedStates(), a = n.getContent().getResource(), l = await a.getExternalURI();
1895
- let i;
1896
- if (l) i = t.addExternal(Ie, l);
1897
- else if (i = r.get(a), !i) {
1898
- let e = s.get(Te);
1899
- e || (e = /* @__PURE__ */ new Map(), s.set(Te, e));
1900
- let n = e.get(a);
1901
- if (!n) {
1902
- const t = await a.toBuffer();
1903
- n = {
1904
- bytes: new Uint8Array(t),
1905
- type: await a.getType() ?? Me,
1906
- index: e.size + 1
1907
- }, e.set(a, n);
1908
- }
1909
- i = t.addBinary(n.bytes, n.type.mime, Ie, `../media/image${n.index}.${n.type.ext}`, !0), r.set(a, i);
1910
- }
1911
- const c = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
1912
- l ? c["r:link"] = i.relId : c["r:embed"] = i.relId;
1913
- const d = [];
1914
- l || d.push([
1915
- "{28A0092B-C50C-407E-A947-70E740481C1C}",
1916
- "a14:useLocalDpi",
1917
- {
1918
- "xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main",
1919
- val: "0"
1920
- }
1921
- ]);
1922
- const m = t.getXMLWriter();
1923
- m.start("pic"), m.start("nvPicPr"), Hr(t, m, n, o, e), Gr(t, m, n, o), m.end("nvPicPr"), m.start("blipFill"), m.start("a:blip", c), Er(m, d), m.end("a:blip"), m.start("a:stretch"), m.empty("a:fillRect"), m.end("a:stretch"), m.end("blipFill"), Ur(t, e, r, n, o), m.end("pic");
1924
- }, Or = async (t, e, r, n, o, s) => {
1925
- const a = o.content?.json, l = a?.xml, i = a?.part;
1926
- if (!l || !i) return jr(t, e, r, n, o);
1927
- const c = await Ut(i, t, "../charts/chart{n}.xml");
1928
- if (!c?.relId) return jr(t, e, r, n, o);
1929
- let d = c.relId === i.id ? l : l.replace(`r:id="${i.id}"`, `r:id="${c.relId}"`);
1930
- void 0 !== s && "number" == typeof o.content?.json?.sourceId && (d = d.replace(`cNvPr id="${o.content.json.sourceId}"`, `cNvPr id="${s}"`)), t.getXMLWriter().raw(d);
1931
- }, $r = async (t, e, r, n, o) => jr(t, e, r, n, o), Wr = async (t, e, r, n, o) => jr(t, e, r, n, o), Vr = async (t, e, r, n, o) => jr(t, e, r, n, o), zr = async (t, e, r, n, o, s) => {
1932
- const a = o.content?.json, l = a?.xml;
1933
- if (!l) return jr(t, e, r, n, o);
1934
- const i = void 0 !== s && "number" == typeof a?.sourceId ? l.replace(`cNvPr id="${a.sourceId}"`, `cNvPr id="${s}"`) : l;
1935
- t.getXMLWriter().raw(i);
1936
- }, jr = async (t, e, r, n, o) => {
1937
- (async (t, e, r, n, o) => {
1938
- const s = t.getXMLWriter(), a = {}, l = o.content?.json, i = l?.type ?? "sp", c = e.getStyles();
1939
- "cxnSp" === i ? (a.macro = "", s.start("cxnSp", a), s.start("nvCxnSpPr"), Hr(t, s, n, o, e), qr(t, s, n, o, e), s.start("cNvCxnSpPr"), s.empty("a:stCnx", {
1940
- id: "0",
1941
- idx: "0"
1942
- }), s.end("cNvCxnSpPr"), s.end("nvCxnSpPr"), Ur(t, e, r, n, o), Xr(t, e, r, n, o), _r(t, c, l?.text), s.end("cxnSp")) : "grpSp" === i || (a.macro = "", a.textlink = "", s.start("sp", a), s.start("nvSpPr"), Hr(t, s, n, o, e), qr(t, s, n, o, e), s.end("nvSpPr"), Ur(t, e, r, n, o), Xr(t, e, r, n, o), _r(t, c, l?.text), s.end("sp"));
1943
- })(t, e, r, n, {
1944
- ...o,
1945
- content: {
1946
- type: "shape",
1947
- name: o.content?.name,
1948
- description: o.content?.description,
1949
- json: {
1950
- fill: "bg1",
1951
- stroke: {
1952
- width: 2,
1953
- fill: "red"
1954
- },
1955
- text: { runs: [{
1956
- text: "Unsupported Type: " + (o.content?.type ?? "unknown"),
1957
- color: "tx1"
1958
- }] }
1959
- }
1960
- }
1961
- });
1962
- }, Ur = (t, e, r, n, o) => {
1963
- const s = t.getXMLWriter(), a = o.content?.json, l = a?.geometry ?? "rect", i = e.getStyles();
1964
- s.start("spPr"), s.pushDefaultNamespace("a"), Jr(s, n, o), s.start("prstGeom", { prst: l }), s.empty("avLst"), s.end("prstGeom"), Se(t, i, a), s.popDefaultNamespace(), s.end("spPr");
1965
- }, Xr = (t, e, r, n, o) => {
1966
- const s = t.getXMLWriter();
1967
- s.start("style"), s.pushDefaultNamespace("a"), s.start("lnRef", { idx: "1" }), s.start("schemeClr", { val: "accent1" }), s.empty("shade", { val: "15000" }), s.end("schemeClr"), s.end("lnRef"), s.start("fillRef", { idx: "1" }), s.empty("schemeClr", { val: "accent1" }), s.end("fillRef"), s.start("effectRef", { idx: "0" }), s.empty("schemeClr", { val: "accent1" }), s.end("effectRef"), s.start("fontRef", { idx: "minor" }), s.empty("schemeClr", { val: "lt1" }), s.end("fontRef"), s.popDefaultNamespace(), s.end("style");
1968
- }, Hr = (t, e, r, n, o) => {
1969
- const s = t.getSharedStates();
1970
- let a = s.get("uniqueIdCounter");
1971
- a || (a = /* @__PURE__ */ new Map(), s.set("uniqueIdCounter", a));
1972
- let l = a.get(o) ?? 1;
1973
- l++, a.set(o, l);
1974
- const i = {
1975
- id: "" + l,
1976
- name: n.content?.name
1977
- };
1978
- n.content?.description && (i.descr = n.content.description), n.hidden && (i.hidden = "1");
1979
- const c = [];
1980
- c.push([
1981
- "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}",
1982
- "a16:creationId",
1983
- {
1984
- "xmlns:a16": "http://schemas.microsoft.com/office/drawing/2014/main",
1985
- id: `{${O.uuidV4().toUpperCase()}}`
1986
- }
1987
- ]), e.start("cNvPr", i), Er(e, c), e.end("cNvPr");
1988
- }, qr = (t, e, r, n, o) => {
1989
- e.empty("cNvSpPr");
1990
- }, Gr = (t, e, r, n) => {
1991
- const o = {};
1992
- if (n.lockAspect && (o.noChangeAspect = "1"), n.locks) for (const t of Object.keys(n.locks)) !0 === n.locks[t] && (o[t] = "1");
1993
- e.start("cNvPicPr", {}), e.empty("a:picLocks", o), e.end("cNvPicPr");
1994
- }, Jr = (t, e, r) => {
1995
- const n = e.getBounds(), o = {}, s = r.rotation;
1996
- void 0 !== s && 0 !== s && (o.rot = "" + Fe(s)), t.start("xfrm", o), t.start("off", {
1997
- x: Ae(n.x),
1998
- y: Ae(n.y)
1999
- }), t.end("off"), t.start("ext", {
2000
- cx: Ae(n.width),
2001
- cy: Ae(n.height)
2002
- }), t.end("ext"), t.end("xfrm");
2003
- }, Kr = (t, e, r) => {
2004
- t.start(e), t.start("col"), t.text(r.c ?? 0), t.end("col"), t.start("colOff"), t.text(Ae(r.x)), t.end("colOff"), t.start("row"), t.text(r.r ?? 0), t.end("row"), t.start("rowOff"), t.text(Ae(r.y)), t.end("rowOff"), t.end(e);
2005
- }, Yr = async (t, e, r) => {
2006
- const n = await r.getExternalURI();
2007
- if (n) return void t.addExternal(Ie, n);
2008
- const o = t.getSharedStates();
2009
- let s = o.get(Te);
2010
- s || (s = /* @__PURE__ */ new Map(), o.set(Te, s));
2011
- let a = s.get(r);
2012
- if (!a) {
2013
- const t = await r.toBuffer();
2014
- a = {
2015
- bytes: new Uint8Array(t),
2016
- type: await r.getType() ?? Me,
2017
- index: s.size + 1
2018
- }, s.set(r, a);
2019
- }
2020
- const l = t.addBinary(a.bytes, a.type.mime, Ie, `../media/image${a.index}.${a.type.ext}`, !0, e);
2021
- l.relId !== e && t.log(`Legacy drawing image '${e}' was written as '${l.relId}'; the markup will not find it.`);
2022
- };
2023
- function Zr(t) {
2024
- return t.toISOString().substring(0, 22);
2025
- }
2026
- function Qr(t, e, r, n, s, a, l, i, c) {
2027
- const d = {
2028
- ref: e,
2029
- dT: Zr(s ?? /* @__PURE__ */ new Date()),
2030
- personId: n ? tn(n) : void 0,
2031
- id: tn(r),
2032
- parentId: l ? tn(l) : void 0,
2033
- done: i ? "1" : void 0
2034
- };
2035
- if (t.start("threadedComment", d), t.start("text", o.test(a) || /[\n\r]/.test(a) ? m : void 0), t.text(a), t.end("text"), c && c.length > 0) {
2036
- t.start("mentions");
2037
- for (let e = 0; e < c.length; e++) {
2038
- const r = c[e];
2039
- t.empty("mention", {
2040
- mentionpersonId: tn(r.personId),
2041
- mentionId: tn(r.id),
2042
- startIndex: r.startIndex ?? 0,
2043
- length: r.length ?? 0
2044
- });
2045
- }
2046
- t.end("mentions");
2047
- }
2048
- t.end("threadedComment");
2049
- }
2050
- function tn(t) {
2051
- return `{${t.replace(/^\{|\}$/g, "").toUpperCase()}}`;
2052
- }
2053
- var en = 0, rn = (t, e, r, n) => {
2054
- const o = n.columns, s = o ? o.length : 0;
2055
- if (0 !== s) {
2056
- e.start("tableColumns", { count: s });
2057
- for (let a = 0; a < s; a++) {
2058
- let s = o[a];
2059
- "string" == typeof s && (s = { name: s });
2060
- const l = {};
2061
- l.id = a + 1, l.name = s.name ?? `Column${a + 1}`;
2062
- let i = null;
2063
- const c = s.totalsRowFormula;
2064
- if ("number" == typeof c) {
2065
- const t = sn.get(c);
2066
- t ? l.totalsRowFunction = t : i = `SUBTOTAL(${c},${n.name?.trim()}[${l.name}])`;
2067
- } else c && (i = nn(t, r, a, c.startsWith("=") ? c.substring(1) : c));
2068
- i && (l.totalsRowFunction = "custom"), s.totalsRowLabel && (l.totalsRowLabel = s.totalsRowLabel);
2069
- const d = s.calculatedColumnFormula ? nn(t, r, a, s.calculatedColumnFormula) : null;
2070
- (i || d) && (e.start("tableColumn", l), d && (e.start("calculatedColumnFormula"), e.text(d), e.end("calculatedColumnFormula"))), i && (e.start("totalsRowFormula"), e.text(i), e.end("totalsRowFormula")), i || d ? e.end("tableColumn") : e.empty("tableColumn", l);
2071
- }
2072
- e.end("tableColumns");
2073
- }
2074
- }, nn = (t, e, r, n) => {
2075
- const o = t.getSharedStates().get(l);
2076
- if (!o) return n;
2077
- try {
2078
- const t = e.getDataRange().getCoords(), s = {
2079
- rowIndex: t.rowStart,
2080
- colIndex: t.colStart + r
2081
- }, a = o.parse(n, s);
2082
- return a && V.image(o.spell(a, !1, e.getName()), { at: s }) || n;
2083
- } catch {
2084
- return n;
2085
- }
2086
- }, on = (t, e, r, n) => {
2087
- const o = {
2088
- name: r.getStyle().getName(),
2089
- showFirstColumn: r.isShowHighlightFirstColumn() ? "1" : "0",
2090
- showLastColumn: r.isShowHighlightLastColumn() ? "1" : "0",
2091
- showRowStripes: r.isShowBandedRows() ? "1" : "0",
2092
- showColumnStripes: r.isShowBandedColumns() ? "1" : "0"
2093
- };
2094
- e.empty("tableStyleInfo", o);
2095
- }, sn = /* @__PURE__ */ new Map([
2096
- [101, "average"],
2097
- [102, "countNums"],
2098
- [103, "count"],
2099
- [104, "max"],
2100
- [105, "min"],
2101
- [107, "stdDev"],
2102
- [109, "sum"],
2103
- [110, "var"]
2104
- ]);
2105
- var an = {
2106
- rowIndex: 0,
2107
- colIndex: 0
2108
- };
2109
- function ln(t, e, r, n) {
2110
- if (null == n) return;
2111
- an.rowIndex = e, an.colIndex = r;
2112
- const o = D.cellToString(an);
2113
- let s, a;
2114
- switch (typeof n) {
2115
- case "number":
2116
- a = "" + n;
2117
- break;
2118
- case "boolean":
2119
- s = "b", a = n ? "1" : "0";
2120
- break;
2121
- case "string":
2122
- s = "str", a = n;
2123
- break;
2124
- default: {
2125
- const t = n;
2126
- if ("e" !== t.t) return;
2127
- s = "e", a = W.getBuiltInByCode(t.v)?.getLabel() ?? W.BuiltIn.Value.getLabel();
2128
- }
2129
- }
2130
- t.start("cell", s ? {
2131
- r: o,
2132
- t: s
2133
- } : { r: o }), t.start("v"), t.text(a), t.end("v"), t.end("cell");
2134
- }
2135
- var cn = (t, e, r, n) => {
2136
- e.start("mc:AlternateContent", { "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006" }), e.start("mc:Choice", {
2137
- Requires: "c14",
2138
- "xmlns:c14": "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"
2139
- }), e.empty("c14:style", { val: "102" }), e.end("mc:Choice"), e.start("mc:Fallback"), e.empty("c:style", { val: "2" }), e.end("mc:Fallback"), e.end("mc:AlternateContent");
2140
- }, dn = (t, e, r, n, o) => {
2141
- e.start("chart"), ((t, e, r, n, o) => {
2142
- e.start("title"), e.empty("overlay", { val: "0" }), Se(t, r, o, "spPr", !0), e.end("title"), e.empty("autoTitleDeleted", { val: "0" });
2143
- })(t, e, r, 0, o), ((t, e, r, n, o) => {
2144
- e.start("plotArea"), e.empty("layout"), Se(t, r, o, "spPr", !0), e.end("plotArea");
2145
- })(t, e, r, 0, o), e.empty("plotVisOnly", { val: "1" }), e.empty("dispBlanksAs", { val: "gap" }), e.empty("showDLblsOverMax", { val: "0" }), e.end("chart");
2146
- }, mn = (t, e, r, n) => {
2147
- e.start("printSettings"), e.empty("headerFooter"), e.empty("pageMargins", {
2148
- b: "0.75",
2149
- l: "0.7",
2150
- r: "0.7",
2151
- t: "0.75",
2152
- header: "0.3",
2153
- footer: "0.3"
2154
- }), e.empty("pageSetup"), e.end("printSettings");
2155
- }, pn = (t, e, r, n, o, s = "0") => {
2156
- const a = o?.color, l = { idx: o?.idx ?? s };
2157
- void 0 !== a ? (e.start(n, l), "auto" === a ? e.empty("styleClr", { val: "auto" }) : (e.pushDefaultNamespace("a"), te(e, r.getTheme(), a), e.popDefaultNamespace()), e.end(n)) : e.empty(n, l);
2158
- }, fn = (t, e, r, n) => {
2159
- const o = r.length;
2160
- for (let s = 0; s < o; s++) {
2161
- const o = r[s];
2162
- o.empty ? e.empty(o.type, o.mods) : (e.start(o.type, o.mods), pn(0, e, n, "lnRef", o.lineRef, "0"), pn(0, e, n, "fillRef", o.fillRef, "0"), pn(0, e, n, "effectRef", o.effectRef, "0"), pn(0, e, n, "fontRef", o.fontRef, "minor"), Se(t, n, o, "spPr"), Pr(t, 0, o.defRPr), Nr(t, n, o.bodyPr), e.end(o.type));
2163
- }
2164
- }, Xn = Object.freeze([
2165
- {
2166
- type: "axisTitle",
2167
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2168
- defRPr: {
2169
- size: 10,
2170
- kern: 12
2171
- }
2172
- },
2173
- {
2174
- type: "categoryAxis",
2175
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2176
- stroke: {
2177
- width: .75,
2178
- cap: "flat",
2179
- cmpd: "sng",
2180
- algn: "ctr",
2181
- round: !0,
2182
- fill: "tx1 lumMod 15 lumOff 85"
2183
- },
2184
- defRPr: {
2185
- size: 9,
2186
- kern: 12
2187
- }
2188
- },
2189
- {
2190
- type: "chartArea",
2191
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2192
- fontRef: { color: "tx1" },
2193
- fill: {
2194
- type: "solid",
2195
- color: "bg1"
2196
- },
2197
- stroke: {
2198
- width: .75,
2199
- cap: "flat",
2200
- cmpd: "sng",
2201
- algn: "ctr",
2202
- round: !0,
2203
- fill: "tx1 lumMod 15 lumOff 85"
2204
- },
2205
- defRPr: {
2206
- size: 10,
2207
- kern: 12
2208
- }
2209
- },
2210
- {
2211
- type: "dataLabel",
2212
- fontRef: { color: "tx1 lumMod 75 lumOff 25" },
2213
- defRPr: {
2214
- size: 9,
2215
- kern: 12
2216
- }
2217
- },
2218
- {
2219
- type: "dataLabelCallout",
2220
- fontRef: { color: "dk1 lumMod 65 lumOff 35" },
2221
- fill: {
2222
- type: "solid",
2223
- color: "lt1"
2224
- },
2225
- stroke: { fill: "dk1 lumMod 25 lumOff 75" },
2226
- defRPr: {
2227
- size: 9,
2228
- kern: 12
2229
- },
2230
- bodyPr: {
2231
- rot: "0",
2232
- spcFirstLastPara: "1",
2233
- vertOverflow: "clip",
2234
- horzOverflow: "clip",
2235
- vert: "horz",
2236
- wrap: "square",
2237
- lIns: "36576",
2238
- tIns: "18288",
2239
- rIns: "36576",
2240
- bIns: "18288",
2241
- anchor: "ctr",
2242
- anchorCtr: "1",
2243
- spAutoFit: "true"
2244
- }
2245
- },
2246
- {
2247
- type: "dataPoint",
2248
- fillRef: {
2249
- idx: "1",
2250
- color: "auto"
2251
- },
2252
- fontRef: { color: "tx1" }
2253
- },
2254
- {
2255
- type: "dataPoint3D",
2256
- fillRef: {
2257
- idx: "1",
2258
- color: "auto"
2259
- },
2260
- fontRef: { color: "tx1" }
2261
- },
2262
- {
2263
- type: "dataPointLine",
2264
- lineRef: { color: "auto" },
2265
- fillRef: { idx: "1" },
2266
- fontRef: { color: "tx1" },
2267
- stroke: {
2268
- width: 2.25,
2269
- cap: "rnd",
2270
- fill: "phClr",
2271
- round: !0
2272
- }
2273
- },
2274
- {
2275
- type: "dataPointMarker",
2276
- lineRef: { color: "auto" },
2277
- fillRef: {
2278
- idx: "1",
2279
- color: "auto"
2280
- },
2281
- fontRef: { color: "tx1" },
2282
- stroke: {
2283
- width: .75,
2284
- fill: "phClr"
2285
- }
2286
- },
2287
- {
2288
- type: "dataPointMarkerLayout",
2289
- mods: {
2290
- symbol: "circle",
2291
- size: "5"
2292
- },
2293
- empty: !0
2294
- },
2295
- {
2296
- type: "dataPointWireframe",
2297
- lineRef: { color: "auto" },
2298
- fillRef: { idx: "1" },
2299
- fontRef: { color: "tx1" },
2300
- stroke: {
2301
- width: .75,
2302
- cap: "rnd",
2303
- fill: "phClr",
2304
- round: !0
2305
- }
2306
- },
2307
- {
2308
- type: "dataTable",
2309
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2310
- fill: { type: "none" },
2311
- stroke: {
2312
- width: .75,
2313
- cap: "flat",
2314
- cmpd: "sng",
2315
- algn: "ctr",
2316
- round: !0,
2317
- fill: "tx1 lumMod 15 lumOff 85"
2318
- },
2319
- defRPr: {
2320
- size: 9,
2321
- kern: 12
2322
- }
2323
- },
2324
- {
2325
- type: "downBar",
2326
- fontRef: { color: "tx1" },
2327
- fill: {
2328
- type: "solid",
2329
- color: "dk1 lumMod 75 lumOff 25"
2330
- },
2331
- stroke: {
2332
- width: .75,
2333
- cap: "flat",
2334
- cmpd: "sng",
2335
- algn: "ctr",
2336
- round: !0,
2337
- fill: "tx1 lumMod 65 lumOff 35"
2338
- }
2339
- },
2340
- {
2341
- type: "dropLine",
2342
- fontRef: { color: "tx1" },
2343
- stroke: {
2344
- width: .75,
2345
- cap: "flat",
2346
- cmpd: "sng",
2347
- algn: "ctr",
2348
- round: !0,
2349
- fill: "tx1 lumMod 35 lumOff 65"
2350
- }
2351
- },
2352
- {
2353
- type: "errorBar",
2354
- fontRef: { color: "tx1" },
2355
- stroke: {
2356
- width: .75,
2357
- cap: "flat",
2358
- cmpd: "sng",
2359
- algn: "ctr",
2360
- round: !0,
2361
- fill: "tx1 lumMod 65 lumOff 35"
2362
- }
2363
- },
2364
- {
2365
- type: "floor",
2366
- fontRef: { color: "tx1" },
2367
- fill: { type: "none" },
2368
- stroke: {}
2369
- },
2370
- {
2371
- type: "gridlineMajor",
2372
- fontRef: { color: "tx1" },
2373
- stroke: {
2374
- width: .75,
2375
- cap: "flat",
2376
- cmpd: "sng",
2377
- algn: "ctr",
2378
- round: !0,
2379
- fill: "tx1 lumMod 15 lumOff 85"
2380
- }
2381
- },
2382
- {
2383
- type: "gridlineMinor",
2384
- fontRef: { color: "tx1" },
2385
- stroke: {
2386
- width: .75,
2387
- cap: "flat",
2388
- cmpd: "sng",
2389
- algn: "ctr",
2390
- round: !0,
2391
- fill: "tx1 lumMod 5 lumOff 95"
2392
- }
2393
- },
2394
- {
2395
- type: "hiLoLine",
2396
- fontRef: { color: "tx1" },
2397
- stroke: {
2398
- width: .75,
2399
- cap: "flat",
2400
- cmpd: "sng",
2401
- algn: "ctr",
2402
- round: !0,
2403
- fill: "tx1 lumMod 50 lumOff 50"
2404
- }
2405
- },
2406
- {
2407
- type: "leaderLine",
2408
- fontRef: { color: "tx1" },
2409
- stroke: {
2410
- width: .75,
2411
- cap: "flat",
2412
- cmpd: "sng",
2413
- algn: "ctr",
2414
- round: !0,
2415
- fill: "tx1 lumMod 35 lumOff 65"
2416
- }
2417
- },
2418
- {
2419
- type: "legend",
2420
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2421
- defRPr: {
2422
- size: 9,
2423
- kern: 12
2424
- }
2425
- },
2426
- {
2427
- type: "plotArea",
2428
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2429
- fontRef: { color: "tx1" }
2430
- },
2431
- {
2432
- type: "plotArea3D",
2433
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2434
- fontRef: { color: "tx1" }
2435
- },
2436
- {
2437
- type: "seriesAxis",
2438
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2439
- defRPr: {
2440
- size: 9,
2441
- kern: 12
2442
- }
2443
- },
2444
- {
2445
- type: "seriesLine",
2446
- fontRef: { color: "tx1" },
2447
- stroke: {
2448
- width: .75,
2449
- cap: "flat",
2450
- cmpd: "sng",
2451
- algn: "ctr",
2452
- round: !0,
2453
- fill: "tx1 lumMod 35 lumOff 65"
2454
- }
2455
- },
2456
- {
2457
- type: "title",
2458
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2459
- defRPr: {
2460
- size: 14,
2461
- b: !1,
2462
- kern: 12,
2463
- spc: 0,
2464
- baseline: 0
2465
- }
2466
- },
2467
- {
2468
- type: "trendline",
2469
- lineRef: { color: "auto" },
2470
- fontRef: { color: "tx1" },
2471
- stroke: {
2472
- width: 1.5,
2473
- cap: "rnd",
2474
- fill: "phClr",
2475
- prstDash: "sysDot"
2476
- }
2477
- },
2478
- {
2479
- type: "trendlineLabel",
2480
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2481
- defRPr: {
2482
- size: 9,
2483
- kern: 12
2484
- }
2485
- },
2486
- {
2487
- type: "upBar",
2488
- fontRef: { color: "tx1" },
2489
- fill: {
2490
- type: "solid",
2491
- color: "lt1"
2492
- },
2493
- stroke: {
2494
- width: .75,
2495
- cap: "flat",
2496
- cmpd: "sng",
2497
- algn: "ctr",
2498
- round: !0,
2499
- fill: "tx1 lumMod 65 lumOff 35"
2500
- }
2501
- },
2502
- {
2503
- type: "valueAxis",
2504
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2505
- defRPr: {
2506
- size: 9,
2507
- kern: 12
2508
- }
2509
- },
2510
- {
2511
- type: "wall",
2512
- fontRef: { color: "tx1" },
2513
- fill: { type: "none" },
2514
- stroke: {}
2515
- }
2516
- ]), Hn = (t, e, r) => {
2517
- const n = r.length;
2518
- for (let t = 0; t < n; t++) {
2519
- const n = r[t], o = {}, s = n[0], a = n[1];
2520
- s || a ? (e.start("variation", o), s && e.empty("a:lumMod", { val: s }), a && e.empty("a:lumOff", { val: a }), e.end("variation")) : e.empty("variation", o);
2521
- }
2522
- }, qn = Object.freeze([
2523
- [0, 0],
2524
- [6e4, 0],
2525
- [8e4, 2e4],
2526
- [8e4, 0],
2527
- [6e4, 4e4],
2528
- [5e4, 0],
2529
- [7e4, 3e4],
2530
- [7e4, 0],
2531
- [5e4, 5e4]
2532
- ]), Gn = [
2533
- new class extends lt {
2534
- constructor() {
2535
- super({
2536
- kind: "workbook",
2537
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
2538
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
2539
- path: "/xl/workbook.xml"
2540
- });
2541
- }
2542
- async emit(t, e) {
2543
- const r = e.getXMLWriter();
2544
- r.decl(), r.start("workbook", {
2545
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2546
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2547
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2548
- "mc:Ignorable": "x15 xr xr6 xr10 xr2",
2549
- "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main",
2550
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
2551
- "xmlns:xr6": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision6",
2552
- "xmlns:xr10": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision10",
2553
- "xmlns:xr2": "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"
2554
- });
2555
- const n = e.getSharedStates().get(at), o = await t.toJSON({
2556
- ignoreData: !0,
2557
- resources: (t, e) => (n?.set(e, t), null),
2558
- includeHeaderStyles: !0,
2559
- splitDirectBorders: !0
2560
- });
2561
- e.getSharedStates().set(l, i(o.names, function(t) {
2562
- const e = [], r = t.sheets ?? [];
2563
- for (let t = 0; t < r.length; t++) {
2564
- const n = r[t]?.sheet?.tables;
2565
- if (n) for (let t = 0; t < n.length; t++) {
2566
- const r = n[t], o = Array.isArray(r) ? r[1]?.name : r?.v?.name;
2567
- o && e.push(String(o));
2568
- }
2569
- }
2570
- return e;
2571
- }(o))), function(t, e) {
2572
- const r = t.getSharedStates().get(Jt);
2573
- if (!r) return;
2574
- e.empty("fileVersion", r);
2575
- }(e, r), function(t, e, r, n) {
2576
- const o = {}, s = r.getCodeName();
2577
- s && (o.codeName = s);
2578
- r.getRuntime().isDate1904() && (o.date1904 = "1");
2579
- n.updateLinks && (o.updateLinks = n.updateLinks);
2580
- e.empty("workbookPr", o);
2581
- }(0, r, t, o), function(t, e, r, n) {
2582
- const o = n.protection;
2583
- if (!o || o.workbook) return;
2584
- const s = {};
2585
- Et(o.password ?? {}, s, "workbook"), Et(o.revisionsPassword ?? {}, s, "revisions");
2586
- for (const t of P) {
2587
- const e = _(t, o[t.key]);
2588
- null !== e && (s[t.attribute] = e);
2589
- }
2590
- e.empty("workbookProtection", s);
2591
- }(0, r, 0, o), function(t, e, r) {
2592
- e.start("bookViews");
2593
- const n = r.getView(), o = {};
2594
- n.isShowHorizontalScrollbar() || (o.showHorizontalScroll = "0");
2595
- n.isShowVerticalScrollbar() || (o.showVerticalScroll = "0");
2596
- n.isShowTabs() || (o.showSheetTabs = "0");
2597
- const s = n.getTabRatio();
2598
- 600 !== s && (o.tabRatio = s);
2599
- const a = r.getSelectedSheet().getIndex();
2600
- 0 !== a && (o.activeTab = "" + a);
2601
- e.empty("workbookView", o), e.end("bookViews");
2602
- }(0, r, t, o.view);
2603
- const s = await (async (t, e) => {
2604
- const r = [], n = e ? e.length : 0;
2605
- if (0 === n) return r;
2606
- const o = /* @__PURE__ */ new Map();
2607
- t.getSharedStates().set("pivotCachePaths", o);
2608
- for (let s = 0; s < n; s++) {
2609
- const n = e[s], a = n.cacheId, l = n.part;
2610
- if (l?.xml && !o.has(a)) try {
2611
- const e = await Ut({
2612
- ...l,
2613
- type: l.type || "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",
2614
- contentType: l.contentType || "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"
2615
- }, t, "/xl/pivotCache/pivotCacheDefinition{n}.xml");
2616
- if (!e?.relId) continue;
2617
- o.set(a, e.path), r.push({
2618
- cacheId: a,
2619
- relId: e.relId
2620
- });
2621
- } catch (e) {
2622
- t.log(`Unable to write the pivot cache ${a}; the pivot tables on it will be dropped.`, e);
2623
- }
2624
- }
2625
- return r;
2626
- })(e, o.pivotCaches);
2627
- (function(t, e) {
2628
- if (!e.getComments().some((t) => !t.isNote())) return;
2629
- t.addPart("persons", e.getPeople());
2630
- })(e, t), r.start("sheets");
2631
- const a = e.getSharedStates(), c = t.getStrings().beginPersist();
2632
- a.set("persistStrings", c);
2633
- const d = new $t();
2634
- a.set("metaCollector", d);
2635
- const m = new Wt(d, e.log.bind(e));
2636
- a.set("persistRichTypes", m), a.set(Bt, new Ot(o.styles, t.getStyles()));
2637
- try {
2638
- const n = t.getSheets().getItems({ visibility: G.Visibility.VeryHidden }), s = o.sheets, l = t.getSelectedSheet(), i = n.length, d = ((t, e) => {
2639
- const r = new Array(e), n = /* @__PURE__ */ new Set();
2640
- let o = 1;
2641
- for (let s = 0; s < e; s++) {
2642
- const e = t?.[s]?.sheetId;
2643
- void 0 === e || !Number.isInteger(e) || e < 1 || n.has(e) || (n.add(e), r[s] = e, e >= o && (o = e + 1));
2644
- }
2645
- for (let t = 0; t < e; t++) if (void 0 === r[t]) {
2646
- for (; n.has(o);) o++;
2647
- n.add(o), r[t] = o++;
2648
- }
2649
- return r;
2650
- })(s, i), m = ((t, e, r) => {
2651
- const n = e.length, o = new Array(n), s = new Set(r?.values() ?? []), a = /* @__PURE__ */ new Set();
2652
- for (let s = 0; s < n; s++) {
2653
- const n = t?.[s]?.sheetId;
2654
- if (void 0 === n || e[s] !== n) continue;
2655
- const l = r?.get(n);
2656
- l && !a.has(l) && (a.add(l), o[s] = l);
2657
- }
2658
- let l = 1;
2659
- for (let t = 0; t < n; t++) {
2660
- if (o[t]) continue;
2661
- let e;
2662
- do
2663
- e = `xl/worksheets/sheet${l++}.xml`;
2664
- while (s.has(e) || a.has(e));
2665
- a.add(e), o[t] = e;
2666
- }
2667
- return o;
2668
- })(s, d, a.get(Kt));
2669
- for (let t = 0; t < i; t++) {
2670
- const o = n[t], a = "" + d[t], i = {
2671
- name: o.getName(),
2672
- sheetId: a
2673
- }, p = o.getVisibility();
2674
- "hidden" === p ? i.state = "hidden" : "veryHidden" === p && (i.state = "veryHidden");
2675
- const f = s[t].sheet;
2676
- i["r:id"] = e.addPart("worksheet", {
2677
- model: o,
2678
- isSelected: l === o,
2679
- json: f,
2680
- persistStrings: c
2681
- }, "/" + m[t]).relId, r.empty("sheet", i);
2682
- }
2683
- await e.waitEmit();
2684
- const p = t.getTheme();
2685
- e.addPart("theme", {
2686
- model: p,
2687
- json: o.theme
2688
- }), await e.waitEmit(), e.addPart("styles", {
2689
- styles: t.getStyles(),
2690
- theme: t.getTheme(),
2691
- json: o.styles
2692
- }), await e.waitEmit();
2693
- const f = await c.toJSONAsync();
2694
- f && f.length > 0 && (e.addPart("sharedStrings", {
2695
- model: f,
2696
- json: f
2697
- }), await e.waitEmit());
2698
- const h = a.get("persistRichTypes");
2699
- h?.hasAny() && (e.addPart("richValue", h), e.addPart("richValueStructure", h), e.addPart("richValueTypes", null), await e.waitEmit());
2700
- const u = a.get("metaCollector");
2701
- u?.hasAny() && (e.addPart("metadata", u), await e.waitEmit()), a.delete("persistRichTypes"), a.delete("metaCollector"), a.delete("persistStrings");
2702
- } catch (t) {
2703
- throw t;
2704
- } finally {
2705
- c.endPersist();
2706
- }
2707
- r.end("sheets"), function(t, e, r) {
2708
- const n = r.externalBooks, o = n ? n.length : 0;
2709
- if (0 === o) return;
2710
- const s = t.getSharedStates().get(Yt), a = /* @__PURE__ */ new Set();
2711
- if (s) for (let t = 0; t < o; t++) !n[t] && s[t] && a.add(s[t]);
2712
- const l = [];
2713
- let i = 1;
2714
- for (let e = 0; e < o; e++) {
2715
- const r = n[e];
2716
- if (r) {
2717
- let e;
2718
- do
2719
- e = `xl/externalLinks/externalLink${i++}.xml`;
2720
- while (a.has(e));
2721
- l.push(t.addPart("externalLink", r, "/" + e).relId);
2722
- continue;
2723
- }
2724
- const o = s?.[e], c = o ? t.addRelationship(Gt, o) : null;
2725
- c ? l.push(c) : t.log(`External link [${e + 1}] cannot be written and is being dropped; later links will renumber.`);
2726
- }
2727
- if (0 === l.length) return;
2728
- e.start("externalReferences");
2729
- for (let t = 0; t < l.length; t++) e.empty("externalReference", { "r:id": l[t] });
2730
- e.end("externalReferences");
2731
- }(e, r, o), function(t, e, r, n) {
2732
- const o = t.getSharedStates().get(l), s = n.names, a = s ? s.length : 0;
2733
- if (0 === a) return;
2734
- const i = n.externalBooks?.length ?? 0, c = /* @__PURE__ */ new Map(), d = r.getSheets().getItems({ visibility: G.Visibility.VeryHidden });
2735
- for (let t = 0; t < d.length; t++) c.set(d[t].getName().toLowerCase(), t);
2736
- e.start("definedNames");
2737
- for (let r = 0; r < a; r++) {
2738
- const n = s[r], a = { name: n.name };
2739
- if (n.comment && (a.comment = n.comment), n.scope) {
2740
- const e = c.get(n.scope.toLowerCase());
2741
- void 0 !== e ? a.localSheetId = "" + e : t.log(`Defined name '${n.name}' is scoped to unknown sheet '${n.scope}'; writing it as global.`);
2742
- }
2743
- n.hidden && (a.hidden = "1");
2744
- const l = o.writeName(n.ref);
2745
- for (const e of Zt(l)) e > i && t.log(`Defined name '${n.name}' cites external book [${e}], but only ${i} ${1 === i ? "is" : "are"} written; Excel will report the file as needing repair.`);
2746
- e.start("definedName", a), e.text(l), e.end("definedName");
2747
- }
2748
- e.end("definedNames");
2749
- }(e, r, t, o), function(t, e, r) {
2750
- const n = r.getCalculation().toJSON(), o = { calcId: t.getSharedStates().get("calcId") ?? "191029" }, s = (t, e) => {
2751
- const r = n[t];
2752
- "boolean" == typeof r && (o[e] = r ? "1" : "0");
2753
- };
2754
- if (n.calcMode) {
2755
- const t = Qt[n.calcMode];
2756
- t && "auto" !== t && (o.calcMode = t);
2757
- }
2758
- s("fullCalcOnLoad", "fullCalcOnLoad"), s("calcOnSave", "calcOnSave"), s("calcCompleted", "calcCompleted"), s("fullPrecision", "fullPrecision"), s("forceFullCalc", "forceFullCalc"), s("concurrentCalc", "concurrentCalc"), n.refMode && (o.refMode = n.refMode);
2759
- n.iterate && (o.iterate = "1");
2760
- void 0 !== n.maxIteration && (o.iterateCount = String(n.maxIteration));
2761
- void 0 !== n.maxIterateChange && (o.iterateDelta = String(n.maxIterateChange));
2762
- e.empty("calcPr", o);
2763
- }(e, r, t), function(t, e) {
2764
- if (0 === e.length) return;
2765
- t.start("pivotCaches");
2766
- for (let r = 0; r < e.length; r++) t.empty("pivotCache", {
2767
- cacheId: e[r].cacheId,
2768
- "r:id": e[r].relId
2769
- });
2770
- t.end("pivotCaches");
2771
- }(r, s), function(t, e) {
2772
- const r = t.getSharedStates().get("calcFeatures") ?? "<ext uri=\"{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}\" xmlns:xcalcf=\"http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures\"><xcalcf:calcFeatures><xcalcf:feature name=\"microsoft.com:RD\"/><xcalcf:feature name=\"microsoft.com:Single\"/><xcalcf:feature name=\"microsoft.com:FV\"/><xcalcf:feature name=\"microsoft.com:CNMTM\"/><xcalcf:feature name=\"microsoft.com:LET_WF\"/><xcalcf:feature name=\"microsoft.com:LAMBDA_WF\"/><xcalcf:feature name=\"microsoft.com:ARRAYTEXT_WF\"/></xcalcf:calcFeatures></ext>";
2773
- e.start("extLst"), e.raw(r), e.end("extLst");
2774
- }(e, r), r.end("workbook"), r.close();
2775
- }
2776
- }(),
2777
- new class extends lt {
2778
- constructor() {
2779
- super({
2780
- kind: "worksheet",
2781
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
2782
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
2783
- path: () => "/xl/worksheets/sheet{n}.xml"
2784
- });
2785
- }
2786
- async emit(t, e) {
2787
- const n = e.getXMLWriter(), a = t.model, c = t.json;
2788
- n.decl(), n.start("worksheet", {
2789
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2790
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2791
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2792
- "mc:Ignorable": "x14ac",
2793
- "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
2794
- }), function(t, e, r) {
2795
- const n = r.getTabColor(), o = r.getCodeName(), s = {};
2796
- o && (s.codeName = o);
2797
- r.isConditionalFormatCalculationEnabled() || (s.enableFormatConditionsCalculation = "0");
2798
- const a = r.getOutlineSettings(), l = {};
2799
- a.summaryBelow || (l.summaryBelow = "0");
2800
- a.summaryRight || (l.summaryRight = "0");
2801
- a.showOutlineSymbols || (l.showOutlineSymbols = "0");
2802
- a.applyStyles && (l.applyStyles = "1");
2803
- const i = Object.keys(l).length > 0, c = !!n || i;
2804
- if (!c && 0 === Object.keys(s).length) return;
2805
- if (!c) return void e.empty("sheetPr", s);
2806
- e.start("sheetPr", s), n && re(e, r.getStyles().getTheme(), n, "tabColor", !1);
2807
- i && e.empty("outlinePr", l);
2808
- e.end("sheetPr");
2809
- }(0, n, a), function(t, e, r, n) {
2810
- let o = r.getUsedRange({ features: [] }), s = o ? o.getCoords() : null;
2811
- const a = T, l = F, i = n.directStyles, c = i ? i.length : 0;
2812
- for (let t = 0; t < c; t++) {
2813
- let e = r.getRange(i[t][0]).getCoords();
2814
- if (e.colEnd === l) {
2815
- const t = s?.colStart ?? 0;
2816
- e = {
2817
- ...e,
2818
- colStart: t,
2819
- colEnd: t
2820
- };
2821
- }
2822
- if (e.rowEnd === a) {
2823
- const t = s?.rowStart ?? 0;
2824
- e = {
2825
- ...e,
2826
- rowStart: t,
2827
- rowEnd: t
2828
- };
2829
- }
2830
- s = $.unionRanges(s, e);
2831
- }
2832
- const d = n.merges, m = d ? d.length : 0;
2833
- for (let t = 0; t < m; t++) {
2834
- let e = r.getRange(d[t]).getCoords();
2835
- e.colEnd === l && (e = { ...s }, e.colStart = s?.colStart ?? 0, e.colEnd = e.colStart), e.rowEnd === a && (e = { ...e }, e.rowStart = s?.rowStart ?? 0, e.rowEnd = e.rowStart), s = $.unionRanges(s, e);
2836
- }
2837
- let p = "A1";
2838
- s && (o = r.getRange(s), p = s.colStart === s.colEnd && s.rowStart === s.rowEnd ? o.getAddress() : `${o.getIntersect({
2839
- colStart: s.colStart,
2840
- rowStart: s.rowStart,
2841
- colEnd: s.colStart,
2842
- rowEnd: s.rowStart
2843
- }).getAddress()}:${o.getIntersect({
2844
- colStart: s.colEnd,
2845
- rowStart: s.rowEnd,
2846
- colEnd: s.colEnd,
2847
- rowEnd: s.rowEnd
2848
- }).getAddress()}`);
2849
- e.empty("dimension", { ref: p });
2850
- }(0, n, a, c), function(t, e, r, n, o) {
2851
- const s = r.getView(), a = s.getTopLeft(), l = r.getRowHeaders().getIndex(a.top), i = r.getColumnHeaders().getIndex(a.left), c = D.cellToString({
2852
- colIndex: i,
2853
- rowIndex: l
2854
- });
2855
- e.start("sheetViews");
2856
- const d = {};
2857
- s.isShowFormulas() && (d.showFormulas = "1");
2858
- s.isShowColumnGridlines() || s.isShowRowGridlines() || (d.showGridLines = "0");
2859
- s.isShowColumnHeaders() || s.isShowRowHeaders() || (d.showRowColHeaders = "0");
2860
- s.isShowZeros() || (d.showZeros = "0");
2861
- s.isRightToLeft() && (d.rightToLeft = "1");
2862
- o && (d.tabSelected = "1");
2863
- "A1" !== c && (d.topLeftCell = c);
2864
- const m = s.getZoomScale();
2865
- 100 !== m && (d.zoomScale = m, d.zoomScaleNormal = m);
2866
- const p = s.getGridLineColor();
2867
- if (p) {
2868
- d.defaultGridColor = "0";
2869
- const t = p.toRGBA(), e = t.red, n = t.green, o = t.blue, s = r.getStyles().getIndexedColors(), a = s.length;
2870
- let l = 0, i = Number.MAX_VALUE;
2871
- for (let t = 0; t < a; t++) {
2872
- const r = s[t].toRGBA(), a = (e - r.red) ** 2 + (n - r.green) ** 2 + (o - r.blue) ** 2;
2873
- a < i && (i = a, l = t);
2874
- }
2875
- d.colorId = "" + l;
2876
- }
2877
- d.workbookViewId = "0";
2878
- const f = r.getSelection().getCoords(), h = D.cellToString(f.cell);
2879
- let u = {};
2880
- const g = s.getFreezePanes(), y = g.coords ?? {}, x = y.colIndex ?? 0, v = y.rowIndex ?? 0;
2881
- if (x > 0 || v > 0) {
2882
- const t = g.topLeft ?? {}, n = t.top ?? 0, o = t.left ?? 0, s = r.getRowHeaders().getIndex(n), l = r.getColumnHeaders().getIndex(o), i = x - l, c = v - s, m = Math.max(x, r.getColumnHeaders().getIndex(a.left + r.getColumnHeaders().getOffset(x) - o)), p = Math.max(v, r.getRowHeaders().getIndex(a.top + r.getRowHeaders().getOffset(v) - n)), f = D.cellToString({
2883
- colIndex: l,
2884
- rowIndex: s
2885
- });
2886
- "A1" !== f ? d.topLeftCell = f : delete d.topLeftCell, e.start("sheetView", d);
2887
- const h = {};
2888
- if (i > 0 && (h.xSplit = i), c > 0 && (h.ySplit = c), h.topLeftCell = D.cellToString({
2889
- colIndex: m,
2890
- rowIndex: p
2891
- }), h.state = "frozen", 0 === x) {
2892
- h.activePane = "bottomLeft", e.empty("pane", h);
2893
- const t = D.cellToString({
2894
- colIndex: m,
2895
- rowIndex: s
2896
- });
2897
- "A1" !== t && e.empty("selection", {
2898
- activeCell: t,
2899
- sqref: t
2900
- }), u.pane = "bottomLeft";
2901
- } else if (0 === v) {
2902
- h.activePane = "topRight", e.empty("pane", h);
2903
- const t = D.cellToString({
2904
- colIndex: l,
2905
- rowIndex: p
2906
- });
2907
- "A1" !== t && e.empty("selection", {
2908
- activeCell: t,
2909
- sqref: t
2910
- }), u.pane = "topRight";
2911
- } else {
2912
- h.activePane = "bottomRight", e.empty("pane", h), "A1" !== f && e.empty("selection", {
2913
- activeCell: f,
2914
- sqref: f
2915
- });
2916
- const t = D.cellToString({
2917
- colIndex: m,
2918
- rowIndex: s
2919
- });
2920
- e.empty("selection", {
2921
- pane: "topRight",
2922
- activeCell: t,
2923
- sqref: t
2924
- });
2925
- const r = D.cellToString({
2926
- colIndex: l,
2927
- rowIndex: p
2928
- });
2929
- e.empty("selection", {
2930
- pane: "bottomLeft",
2931
- activeCell: r,
2932
- sqref: r
2933
- }), u.pane = "bottomRight";
2934
- }
2935
- } else e.start("sheetView", d);
2936
- u.activeCell = h;
2937
- const w = f.ranges, S = w ? w.length : 0;
2938
- if (S > 0) {
2939
- let t = "";
2940
- for (let e = 0; e < S; e++) {
2941
- const r = w[e];
2942
- e > 0 && (t += " "), t += D.rangeToString(r);
2943
- }
2944
- u.sqref = t, (f.rangeIndex ?? 0) > 0 && (u.activeCellId = "" + f.rangeIndex);
2945
- } else "A1" === h ? u = null : u.sqref = h;
2946
- u && e.empty("selection", u);
2947
- e.end("sheetView"), e.end("sheetViews");
2948
- }(0, n, a, 0, t.isSelected), function(t, e, r, n) {
2949
- const o = n.defaultColSize, s = n.defaultRowSize, a = {};
2950
- void 0 !== o && (a.defaultColWidth = o);
2951
- a.defaultRowHeight = s ?? .75 * r.getRowHeaders().getDefaultSize(), void 0 !== s && (a.customHeight = "1");
2952
- a["x14ac:dyDescent"] = "0.25", e.empty("sheetFormatPr", a);
2953
- }(0, n, a, c);
2954
- const f = !1 === c.protection?.showFormulas ? e.getSharedStates().get("hiddenFormulaXfs") ?? null : null;
2955
- (function(t, e, r, n, o) {
2956
- const s = n.cols ? D.refsToRuns(n.cols, !0) : null, a = s ? s.length : 0;
2957
- r.getEntireRange().getColumnEnd();
2958
- const l = r.getColumnHeaders().getDefaultSizeNative(), i = o ? o.getHiddenXf(0) : 0;
2959
- let c = 1;
2960
- const d = (t) => {
2961
- 0 !== i && t >= c && e.empty("col", {
2962
- min: c,
2963
- max: t,
2964
- width: l,
2965
- style: i
2966
- });
2967
- };
2968
- if (a > 0 || 0 !== i) {
2969
- e.start("cols");
2970
- for (let t = 0; t < a; t++) {
2971
- const r = s[t], n = r.min + 1, a = F + 1;
2972
- if (n > a) continue;
2973
- const i = Math.min(r.max + 1, a);
2974
- d(n - 1), c = i + 1;
2975
- const m = {
2976
- min: n,
2977
- max: i
2978
- }, p = r.value, f = p.sz;
2979
- void 0 !== f ? 0 !== f && (m.width = Math.round(256 * f) / 256) : m.width = l;
2980
- const h = o ? o.getHiddenXf(p.s ?? 0) : p.s;
2981
- h && (m.style = h), void 0 !== p.h && (m.hidden = 1), p.csz && (m.customWidth = 1), void 0 !== p.l && (m.outlineLevel = p.l), void 0 !== p.cl && (m.collapsed = 1), e.empty("col", m);
2982
- }
2983
- d(F + 1), e.end("cols");
2984
- }
2985
- })(0, n, a, c, f), function(t, e, n, s, a, l) {
2986
- const c = t.getSharedStates(), d = c.get("persistStrings"), f = c.get("metaCollector"), h = c.get("persistRichTypes");
2987
- let u = 0, g = 0;
2988
- const y = n.getUsedRange();
2989
- let x = 0;
2990
- const v = s.rows ? D.refsToRuns(s.rows, !1) : null, w = v ? v.length : 0, S = v?.[w - 1]?.max ?? -1, b = s.cols ? D.refsToRuns(s.cols, !0) : null, k = b ? b.length : 0, I = b?.[k - 1]?.max ?? -1;
2991
- if (y || w > 0) {
2992
- const c = .75, y = s.defaultRowSize ?? n.getRowHeaders().getDefaultSize() * c, w = n.getStyles().getNormal().getBestFit().height * c, k = (t, e) => {
2993
- const r = Sr;
2994
- if (r.r = "" + (t + 1), r.s = void 0, r.customFormat = void 0, r.hidden = void 0, r.ht = void 0, r.customHeight = void 0, r.outlineLevel = void 0, r.collapsed = void 0, !e) return r;
2995
- const n = e.value;
2996
- void 0 !== n.s && (r.s = "" + (l ? l.getHiddenXf(n.s) : n.s), r.customFormat = "1"), n.h && (r.hidden = "1");
2997
- const o = n.csz ?? !1, s = n.sz ?? y;
2998
- return (s !== w || o) && (r.ht = "" + s), o && (r.customHeight = "1"), void 0 !== n.l && (r.outlineLevel = "" + n.l), void 0 !== n.cl && (r.collapsed = "" + n.cl), r;
2999
- };
3000
- let T = 0, M = v?.[T] ?? null, R = M?.min ?? Number.MAX_SAFE_INTEGER, A = M?.max ?? Number.MAX_SAFE_INTEGER, F = M?.value?.s, L = -1, _ = 0, P = b?.[_] ?? null, N = P?.min ?? Number.MAX_SAFE_INTEGER, E = P?.max ?? Number.MAX_SAFE_INTEGER, B = P?.value?.s;
3001
- const O = (t, r = !1) => {
3002
- if (L !== t) {
3003
- for (-1 !== L && (e.end("row"), 0 !== _ && (_ = 0, P = b?.[_] ?? null, N = P?.min ?? Number.MAX_SAFE_INTEGER, E = P?.max ?? Number.MAX_SAFE_INTEGER, B = P?.value?.s)); L + 1 <= t;) {
3004
- L++, M && L > A && (M = v[++T] ?? null, M ? (R = M.min, A = M.max, F = M.value?.s) : (R = Number.MAX_SAFE_INTEGER, A = Number.MAX_SAFE_INTEGER, F = void 0)), L < R && L < t && (L = M ? Math.min(R, t) : t);
3005
- const n = L < t || r && L === t, o = k(L, M && L >= R && L <= A ? M : null);
3006
- n ? e.empty("row", o) : e.start("row", o);
3007
- }
3008
- if (t < L) {
3009
- const r = k(t, null);
3010
- e.start("row", r);
3011
- }
3012
- }
3013
- };
3014
- e.setValidationDisabled(!0), e.start("sheetData");
3015
- const $ = [];
3016
- $.push(Qe(t, n, s.directStyles));
3017
- const z = s.formulas, j = z ? z.length : 0;
3018
- if (j > 0) {
3019
- const e = /* @__PURE__ */ new Map();
3020
- if (a.names.size > 0 && s.formulaArray) for (const t of s.formulaArray) try {
3021
- const r = n.getRange(t[0]).getCoords();
3022
- e.set(`${r.rowStart},${r.colStart}`, r);
3023
- } catch {}
3024
- const o = [];
3025
- if (s.formulaArray) for (const t of s.formulaArray) try {
3026
- o.push(n.getRange(t[0]).getCoords());
3027
- } catch {}
3028
- const l = (t) => {
3029
- for (let e = 0; e < o.length; e++) {
3030
- const r = o[e];
3031
- if (r.rowStart <= t.rowEnd && r.rowEnd >= t.rowStart && r.colStart <= t.colEnd && r.colEnd >= t.colStart) return !0;
3032
- }
3033
- return !1;
3034
- }, c = t.getSharedStates().get("xlsxFormulaDialect") ?? i(n.getCalculation().getNamedFormulas().toJSON(), n.getTables().getItems().map((t) => t.getName())), d = n.getEntireRange().getCoords(), m = [];
3035
- for (const t of n.getTables().getItems()) m.push([t.getRange().getCoords(), t.getName()]);
3036
- const p = (t, e) => {
3037
- for (let r = 0; r < m.length; r++) {
3038
- const n = m[r][0];
3039
- if (t >= n.rowStart && t <= n.rowEnd && e >= n.colStart && e <= n.colEnd) return m[r][1];
3040
- }
3041
- return null;
3042
- }, f = /* @__PURE__ */ new Set();
3043
- for (let t = 0; t < o.length; t++) f.add(`${o[t].rowStart},${o[t].colStart}`);
3044
- const h = [];
3045
- for (let o = 0; o < j; o++) {
3046
- const s = z[o];
3047
- try {
3048
- const t = s[0], i = n.getRange(t), m = i.getCoords();
3049
- let u = s[1], g = null;
3050
- const y = {
3051
- rowIndex: m.rowStart,
3052
- colIndex: m.colStart
3053
- }, v = c.parse(u, y), w = v ? c.annotate(v) : void 0, S = v ? c.spell(v, f.has(`${m.rowStart},${m.colStart}`), p(m.rowStart, m.colStart)) : null, b = S ? V.imager(S, { entireCoords: d }) : null;
3054
- b && (u = b(y));
3055
- let k = !0 === w?.cm;
3056
- const I = !0 === w?.ca;
3057
- if (a.affects(o)) {
3058
- g = null, k = !1;
3059
- const t = (t, e, r) => {
3060
- const n = {
3061
- rowStart: t,
3062
- colStart: e,
3063
- rowEnd: t,
3064
- colEnd: e
3065
- };
3066
- h.push([n, {
3067
- coords: n,
3068
- formula: r,
3069
- sharedId: null,
3070
- ref: D.rangeToString(n),
3071
- isDynamicRange: !1,
3072
- isWrapped: !0
3073
- }]);
3074
- }, o = e.get(`${m.rowStart},${m.colStart}`), s = void 0 !== o && (o.rowEnd > o.rowStart || o.colEnd > o.colStart);
3075
- let a = !1;
3076
- if (s) {
3077
- const e = C(u, i.getCell().getValue());
3078
- if (null !== e) for (let s = o.rowStart; s <= o.rowEnd; s++) for (let l = o.colStart; l <= o.colEnd; l++) {
3079
- if (s === o.rowStart && l === o.colStart) {
3080
- t(s, l, e), a = !0;
3081
- continue;
3082
- }
3083
- const i = r(n.getRange(D.rangeToString({
3084
- rowStart: s,
3085
- colStart: l,
3086
- rowEnd: s,
3087
- colEnd: l
3088
- })).getCell().getValue());
3089
- null !== i && t(s, l, i);
3090
- }
3091
- } else i.forEach((e, r) => {
3092
- const n = r.getCoords(), o = C(b?.(n) ?? u, r.getCell().getValue());
3093
- null !== o && (t(n.rowIndex, n.colIndex, o), a = !0);
3094
- }, { includeEmpty: !0 });
3095
- if (a) continue;
3096
- }
3097
- const T = -1 !== u.indexOf("!") || -1 !== u.indexOf("[");
3098
- k || i.isSingleCell() || T || l(m) || (g = "" + x++);
3099
- const M = null !== g || i.isSingleCell() ? null : b, R = [m, {
3100
- coords: m,
3101
- formula: u,
3102
- sharedId: g,
3103
- ref: t,
3104
- isDynamicRange: k,
3105
- isExcelVolatile: I,
3106
- memberImage: M
3107
- }];
3108
- h.push(R);
3109
- } catch (e) {
3110
- t.log(`Could not write the formula '${s[1]}' over '${s[0]}'; those cells are written as values only. ${e}`);
3111
- continue;
3112
- }
3113
- }
3114
- $.push(h);
3115
- } else $.push([]);
3116
- const U = s.volatile, X = U ? U.length : 0;
3117
- if (X > 0) {
3118
- const t = new Array(X);
3119
- for (let e = 0; e < X; e++) {
3120
- const r = U[e];
3121
- try {
3122
- t[e] = [n.getRange(r).getCoords(), !0];
3123
- } catch (t) {
3124
- console.warn(`Failed to parse volatile: ${r}`, t);
3125
- continue;
3126
- }
3127
- }
3128
- $.push(t);
3129
- } else $.push([]);
3130
- const H = s.formulaArray, q = H ? H.length : 0;
3131
- if (q > 0) {
3132
- const t = new Array(q);
3133
- for (let e = 0; e < q; e++) {
3134
- const r = H[e];
3135
- try {
3136
- const o = r[0];
3137
- t[e] = [n.getRange(o).getCoords(), {
3138
- ref: o,
3139
- kind: r[1] ?? "dynamic"
3140
- }];
3141
- } catch (t) {
3142
- console.warn(`Failed to parse formula array: ${r}`, t);
3143
- continue;
3144
- }
3145
- }
3146
- $.push(t);
3147
- } else $.push([]);
3148
- n.getEntireRange().forEach((r, n) => {
3149
- const s = n.getCoords(), a = s.rowIndex, i = s.colIndex;
3150
- L !== a && O(a);
3151
- let c = n.getInjectedReference(0);
3152
- if (void 0 === c && void 0 !== F && a >= R && a <= A && (c = F), void 0 === c) {
3153
- for (; i <= I && i > E;) _++, P = b?.[_] ?? null, N = P?.min ?? Number.MAX_SAFE_INTEGER, E = P?.max ?? Number.MAX_SAFE_INTEGER, B = P?.value?.s;
3154
- void 0 !== B && i >= N && i <= E && (c = B);
3155
- }
3156
- const y = n.getType();
3157
- let x = null;
3158
- j > 0 && (x = n.getInjectedReference(1) ?? null);
3159
- let v = !1;
3160
- X > 0 && (v = n.getInjectedReference(2) ?? !1);
3161
- let w = null;
3162
- q > 0 && (w = n.getInjectedReference(3) ?? null);
3163
- const S = "error" === w?.kind, C = "fixed" === w?.kind, k = wr;
3164
- k.r = n.getAddress(), k.s = void 0, k.t = void 0, k.cm = void 0, k.vm = void 0, l && (c = l.getHiddenXf(c ?? 0)), void 0 !== c && 0 !== c && (k.s = "" + c);
3165
- let T = null, M = null;
3166
- switch (y) {
3167
- case tt.Boolean:
3168
- T = r ? "1" : "0", M = "b";
3169
- break;
3170
- case tt.Error:
3171
- const t = r.getCode();
3172
- if (M = "e", t > 7) T = W.BuiltIn.Value.getLabel(), k.vm = "" + h.add(r);
3173
- else if (t < 1) {
3174
- let t;
3175
- M = "s", x ? (t = "=" + x.formula, x = null) : t = "" + r.getLabel(), T = "" + d.add(t), u++;
3176
- } else T = "" + r.getLabel();
3177
- break;
3178
- case tt.Number:
3179
- T = "" + r, M = null;
3180
- break;
3181
- case tt.String:
3182
- T = r, x ? (M = "str", T = r) : (M = "s", T = "" + d.add(T), u++);
3183
- break;
3184
- case tt.RichData: M = "e", T = W.BuiltIn.Value.getLabel(), k.vm = "" + h.add(r);
3185
- }
3186
- M && (k.t = M);
3187
- const D = !x?.isWrapped && (null !== w || (x?.isDynamicRange ?? !1));
3188
- if (null !== x || null !== T) {
3189
- if (D && null !== x && !C && (k.cm = "" + f.registerArrayCell(S)), e.start("c", k), x) {
3190
- const t = a === x.coords.rowStart && i === x.coords.colStart;
3191
- let r = x.formula;
3192
- x.memberImage && !t && (r = x.memberImage({
3193
- rowIndex: a,
3194
- colIndex: i
3195
- }));
3196
- let n, o = null;
3197
- const s = x.sharedId;
3198
- if (s) {
3199
- n = Cr;
3200
- const t = x.coords;
3201
- t.colStart === i && t.rowStart === a ? (n.ref = x.ref, n.si = s, o = x.formula) : (n.ref = void 0, n.si = s);
3202
- } else D ? (n = kr, n.aca = S ? "1" : void 0, n.ref = S ? k.r : w?.ref ?? k.r, o = r) : (n = br, o = r);
3203
- n.ca = v || S || x.isExcelVolatile ? "1" : void 0, o ? (e.start("f", n), e.text(o), e.end("f")) : e.empty("f", n);
3204
- }
3205
- null !== T && ("str" === M && T ? (e.start("v", o.test(T) ? m : void 0), e.text(p(T))) : (e.start("v"), T && e.text(T)), e.end("v")), e.end("c");
3206
- } else g++ < Ze ? e.empty("c", k) : 1048577 === g && t.warn(`Reached ${Ze} style-only cells at '${k.r}'; not writing the rest.`);
3207
- }, {
3208
- injectReferences: $,
3209
- features: []
3210
- }), -1 !== L && L >= S ? e.end("row") : O(S, !0), e.end("sheetData"), e.setValidationDisabled(!1);
3211
- } else e.empty("sheetData");
3212
- if (u > 0) {
3213
- const t = c.get("stringsCount") ?? 0;
3214
- c.set("stringsCount", t + u);
3215
- }
3216
- }(e, n, a, c, await (async (t, e) => {
3217
- const r = e ? e.length : 0;
3218
- if (0 === r) return Ye;
3219
- const n = /* @__PURE__ */ new Set(), o = new Array(r);
3220
- for (let t = 0; t < r; t++) {
3221
- o[t] = null;
3222
- try {
3223
- const r = V.parse(e[t][1]);
3224
- if (!r) continue;
3225
- let s = null;
3226
- const a = (t) => {
3227
- let e = null;
3228
- "function" === t.type ? e = String(t.value) : "call" === t.type && "named" === t.inputs?.[0]?.type && (e = String(t.inputs[0].value?.name ?? "")), e && (e = e.toUpperCase(), n.add(e), (s ??= /* @__PURE__ */ new Set()).add(e));
3229
- const r = t.inputs;
3230
- if (r) for (let t = 0; t < r.length; t++) r[t] && a(r[t]);
3231
- };
3232
- a(r), o[t] = s;
3233
- } catch {}
3234
- }
3235
- const s = t.getWorkbook();
3236
- if (!s) return Ye;
3237
- const a = await d(s, n);
3238
- return 0 === a.size ? Ye : {
3239
- names: a,
3240
- perFormula: o,
3241
- affects: (t) => {
3242
- const e = o[t];
3243
- if (!e) return !1;
3244
- for (const t of e) if (a.has(t)) return !0;
3245
- return !1;
3246
- }
3247
- };
3248
- })(a, c.formulas), f), function(t, e, r, n) {
3249
- const o = n.protection;
3250
- if (!o) return;
3251
- const s = {};
3252
- o.sheet || Et(o.password ?? {}, s);
3253
- for (const t of L) {
3254
- const e = _(t, o[t.key]);
3255
- null !== e && (s[t.attribute] = e);
3256
- }
3257
- e.empty("sheetProtection", s);
3258
- }(0, n, 0, c), function(t, e, r, n) {
3259
- const o = n.protectedRanges, s = o ? o.length : 0;
3260
- if (0 === s) return;
3261
- const a = [];
3262
- for (let e = 0; e < s; e++) {
3263
- const r = o[e];
3264
- let n, s;
3265
- Array.isArray(r) ? (n = r[0], s = r[1]) : (n = r.r, s = r.v);
3266
- const l = ar(n);
3267
- if (!l || !s) {
3268
- t.log("Skipping protectedRange with no range.");
3269
- continue;
3270
- }
3271
- if (!s.name) {
3272
- t.log("Skipping protectedRange with no name.");
3273
- continue;
3274
- }
3275
- const i = {};
3276
- Et(s.password ?? {}, i), i.sqref = l, i.name = s.name, s.securityDescriptor && (i.securityDescriptor = s.securityDescriptor), a.push(i);
3277
- }
3278
- if (0 === a.length) return;
3279
- e.start("protectedRanges");
3280
- for (let t = 0; t < a.length; t++) e.empty("protectedRange", a[t]);
3281
- e.end("protectedRanges");
3282
- }(e, n, 0, c);
3283
- const h = c.autoTable;
3284
- if (h) {
3285
- let t;
3286
- const r = h;
3287
- t = Array.isArray(r) ? r[1] : r.v, qe(e, n, a.getAutoTable(), t, !0);
3288
- }
3289
- (function(t, e, r, n) {
3290
- const o = n.merges ? n.merges.length : 0;
3291
- if (o > 0) {
3292
- e.start("mergeCells", { count: o });
3293
- for (let t = 0; t < o; t++) {
3294
- const r = n.merges[t], o = "string" == typeof r ? r : D.rangeToString(r);
3295
- e.empty("mergeCell", { ref: o });
3296
- }
3297
- e.end("mergeCells");
3298
- }
3299
- })(0, n, 0, c);
3300
- const y = function(t, e, r, n) {
3301
- const o = [], s = n.conditionals, a = s ? s.length : 0;
3302
- if (0 === a) return o;
3303
- const i = t.getSharedStates();
3304
- let c = i.get(Pe);
3305
- c || (c = new _e(), i.set(Pe, c));
3306
- const d = r.getStyles().getTheme(), m = i.get(l);
3307
- let p = null, f = 0;
3308
- for (let r = 0; r < a; r++) {
3309
- const n = s[r];
3310
- let a, l;
3311
- Array.isArray(n) ? (a = n[0], l = n[1]) : (a = n.r, l = n.v);
3312
- const i = ar(a);
3313
- if (!i || !l) {
3314
- t.log("Skipping conditionalFormatting with no range.");
3315
- continue;
3316
- }
3317
- const h = dr(i), u = pr(l.scale, h, m);
3318
- u !== l.scale && (l = {
3319
- ...l,
3320
- scale: u
3321
- });
3322
- const g = u ? { type: u.type } : S(l.condition, sr(i), (e, r) => t.warn(e, void 0, r));
3323
- g ? (g.formulas && (g.formulas = g.formulas.map((t) => mr(t, h, m))), u?.type === U.ScaleType.IconSet && nr(u) ? (f++, o.push({
3324
- guid: w(O.uuidV4),
3325
- sqref: i,
3326
- priority: f,
3327
- scale: u
3328
- })) : u || !cr(g) ? (i !== p && (null !== p && e.end("conditionalFormatting"), e.start("conditionalFormatting", {
3329
- sqref: i,
3330
- pivot: l.pivot ? "1" : void 0
3331
- }), p = i), f++, or(t, e, d, l, g, i, f, c, o)) : (f++, o.push({
3332
- guid: w(O.uuidV4),
3333
- sqref: i,
3334
- priority: f,
3335
- rule: g,
3336
- style: l.style,
3337
- stopIfTrue: l.stopIfTrue
3338
- }))) : l.condition || t.log("Skipping conditional format with neither a condition nor a scale.");
3339
- }
3340
- null !== p && e.end("conditionalFormatting");
3341
- return o;
3342
- }(e, n, a, c), x = function(t, e, r, n) {
3343
- const o = [], s = t.getSharedStates().get(l), a = n.validations, i = a ? a.length : 0;
3344
- if (0 === i) return o;
3345
- const c = [];
3346
- for (let e = 0; e < i; e++) {
3347
- const r = a[e];
3348
- let n, l;
3349
- Array.isArray(r) ? (n = r[0], l = r[1]) : (n = r.r, l = r.v);
3350
- const i = ar(n);
3351
- if (!i || !l) {
3352
- t.log("Skipping dataValidation with no range.");
3353
- continue;
3354
- }
3355
- l.ext && t.warn("DataValidation extension payload is not written to xlsx; it will be lost.");
3356
- const d = (e, r) => t.warn(e, void 0, r), m = v(l.condition, d), { type: p, operator: f } = m ?? {}, h = dr(i), u = mr(m?.formula1, h, s), g = mr(m?.formula2, h, s), y = {
3357
- type: p,
3358
- operator: f,
3359
- allowBlank: lr(l.condition?.includeBlanks ?? !1),
3360
- showDropDown: l.hideDropdown ? "1" : void 0,
3361
- showInputMessage: lr(l.showPromptMessage),
3362
- showErrorMessage: lr(l.showAlertMessage),
3363
- errorStyle: l.alertStyle ?? "stop",
3364
- errorTitle: k(l.alertTitle, "errorTitle", d),
3365
- error: k(l.alert, "error", d),
3366
- promptTitle: k(l.promptTitle, "promptTitle", d),
3367
- prompt: k(l.prompt, "prompt", d),
3368
- imeMode: l.imeMode
3369
- };
3370
- ir(u) || ir(g) ? o.push({
3371
- attrs: y,
3372
- formula1: u,
3373
- formula2: g,
3374
- sqref: i
3375
- }) : (y.sqref = i, c.push({
3376
- attrs: y,
3377
- formula1: u,
3378
- formula2: g
3379
- }));
3380
- }
3381
- if (0 === c.length) return o;
3382
- e.start("dataValidations", { count: c.length });
3383
- for (let t = 0; t < c.length; t++) {
3384
- const { attrs: r, formula1: n, formula2: o } = c[t];
3385
- void 0 !== n || void 0 !== o ? (e.start("dataValidation", r), void 0 !== n && (e.start("formula1"), e.text(n), e.end("formula1")), void 0 !== o && (e.start("formula2"), e.text(o), e.end("formula2")), e.end("dataValidation")) : e.empty("dataValidation", r);
3386
- }
3387
- return e.end("dataValidations"), o;
3388
- }(e, n, 0, c);
3389
- (function(t, e, r, n) {
3390
- const o = n.hyperlinks, s = o ? o.length : 0;
3391
- if (0 === s) return;
3392
- e.start("hyperlinks");
3393
- for (let r = 0; r < s; r++) {
3394
- let n, s;
3395
- const a = o[r];
3396
- Array.isArray(a) ? (s = a[0], n = a[1]) : (s = a.r, n = a.v), "string" == typeof n && (n = { address: n });
3397
- const l = n.address ?? "", i = l.indexOf("#"), c = -1 === i ? l : l.substring(0, i), d = -1 === i ? "" : l.substring(i + 1), m = {};
3398
- m.ref = s, c && (m["r:id"] = t.addExternal("http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", c).relId), d && (m.location = d), n.screenTip && (m.tooltip = n.screenTip), e.empty("hyperlink", m);
3399
- }
3400
- e.end("hyperlinks");
3401
- })(e, n, 0, c), function(t, e, r, n) {
3402
- const o = n.pageMargins;
3403
- e.empty("pageMargins", {
3404
- left: o?.left ?? .7,
3405
- right: o?.right ?? .7,
3406
- top: o?.top ?? .75,
3407
- bottom: o?.bottom ?? .75,
3408
- header: o?.header ?? .3,
3409
- footer: o?.footer ?? .3
3410
- });
3411
- }(0, n, 0, c), function(t, e, r, n) {
3412
- const o = n.movables?.filter(gr);
3413
- if (0 === (o ? o.length : 0)) return;
3414
- const s = (t) => {
3415
- const e = t.content?.type;
3416
- if ("picture" === e || "chart" === e) return !0;
3417
- if ("shape" === e) {
3418
- const e = t.content?.json?.type;
3419
- return "sp" === e || "cxnSp" === e;
3420
- }
3421
- return !1;
3422
- };
3423
- if (!o.some(s)) return;
3424
- const a = r.getMovables().getItems().filter((t) => "note" !== t.getContent().getType()).filter((t, e) => gr(n.movables[e])), l = t.addPart("drawing", {
3425
- sheet: r,
3426
- movables: a,
3427
- jsonMovables: o,
3428
- resources: r.getResources()
3429
- });
3430
- e.empty("drawing", { "r:id": l.relId });
3431
- }(e, n, a, c);
3432
- const b = function(t) {
3433
- const e = t.getComments().toArray();
3434
- if (0 === e.length) return null;
3435
- const r = [];
3436
- for (let t = 0; t < e.length; t++) {
3437
- const n = e[t], o = ye(n);
3438
- o && r.push({
3439
- comment: n,
3440
- ...o
3441
- });
3442
- }
3443
- return 0 === r.length ? null : (r.sort((t, e) => t.row - e.row || t.col - e.col), {
3444
- sheet: t,
3445
- comments: r
3446
- });
3447
- }(a);
3448
- fr(e, n, "legacyDrawing", ur(xr(c.legacyDrawing ?? null, c), b)), fr(e, n, "legacyDrawingHF", c.legacyDrawingHF ?? null), await async function(t, e, r) {
3449
- const n = r.getPicture();
3450
- if (!n) return;
3451
- const o = n.getResource(), s = await o.getExternalURI();
3452
- let a;
3453
- if (s) a = t.addExternal(Ie, s);
3454
- else {
3455
- const e = t.getSharedStates();
3456
- let r = e.get(Te);
3457
- r || (r = /* @__PURE__ */ new Map(), e.set(Te, r));
3458
- let n = r.get(o);
3459
- if (!n) {
3460
- const t = await o.toBuffer();
3461
- n = {
3462
- bytes: new Uint8Array(t),
3463
- type: await o.getType() ?? Me,
3464
- index: r.size + 1
3465
- }, r.set(o, n);
3466
- }
3467
- a = t.addBinary(n.bytes, n.type.mime, Ie, `../media/image${n.index}.${n.type.ext}`, !0);
3468
- }
3469
- e.empty("picture", { "r:id": a.relId });
3470
- }(e, n, a), await async function(t, e, r) {
3471
- const n = r.movables;
3472
- if (!n || n.every(gr)) return;
3473
- const o = [], s = n.length;
3474
- for (let e = 0; e < s; e++) {
3475
- const r = n[e];
3476
- if (gr(r)) continue;
3477
- const s = r.content?.json ?? {}, a = s.part;
3478
- let l;
3479
- if (a) try {
3480
- l = (await Ut(a.type ? a : {
3481
- ...a,
3482
- type: yr
3483
- }, t, "../ctrlProps/ctrlProp{n}.xml"))?.relId ?? void 0;
3484
- } catch (e) {
3485
- t.log(`Unable to write the properties of the control '${r.content?.name}'`, e);
3486
- }
3487
- l ? o.push({
3488
- jsonMovable: r,
3489
- jsonControl: s,
3490
- relId: l
3491
- }) : t.log(`The control '${r.content?.name}' has no properties to write and was dropped.`);
3492
- }
3493
- if (0 === o.length) return;
3494
- e.start("mc:AlternateContent", {
3495
- "xmlns:x14": u,
3496
- "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
3497
- }), e.start("mc:Choice", { Requires: "x14" }), e.start("controls");
3498
- const a = o.length;
3499
- for (let t = 0; t < a; t++) {
3500
- const { jsonMovable: r, jsonControl: n, relId: s } = o[t];
3501
- e.start("mc:AlternateContent"), e.start("mc:Choice", { Requires: "x14" }), e.start("control", {
3502
- shapeId: n.shapeId,
3503
- "r:id": s,
3504
- name: r.content?.name ?? void 0
3505
- });
3506
- const a = r.anchorType ?? "twoCell";
3507
- e.start("controlPr", n.props), e.start("anchor", {
3508
- moveWithCells: "absolute" === a ? void 0 : "1",
3509
- sizeWithCells: "twoCell" === a ? "1" : void 0
3510
- }), vr(e, "from", r.anchor.tl), vr(e, "to", r.anchor.br), e.end("anchor"), n.xml && e.raw(n.xml), e.end("controlPr"), e.end("control"), e.end("mc:Choice"), e.end("mc:AlternateContent");
3511
- }
3512
- e.end("controls"), e.end("mc:Choice"), e.end("mc:AlternateContent");
3513
- }(e, n, c), function(t, e, r, n) {
3514
- const o = n.tables, s = o ? o.length : 0;
3515
- if (0 === s) return;
3516
- const a = r.getTables().getItems();
3517
- e.start("tableParts", { count: s });
3518
- for (let r = 0; r < s; r++) {
3519
- let n, s;
3520
- const l = o[r];
3521
- Array.isArray(l) ? (s = l[0], n = l[1]) : (s = l.r, n = l.v);
3522
- const i = t.addPart("table", {
3523
- json: n,
3524
- model: a[r],
3525
- ref: s
3526
- }), c = {};
3527
- c["r:id"] = i.relId, e.empty("tablePart", c);
3528
- }
3529
- e.end("tableParts");
3530
- }(e, n, a, c), function(t, e, r, n, o) {
3531
- if (0 === n.length && 0 === o.length) return;
3532
- const a = r.getStyles(), l = a.getTheme();
3533
- if (e.start("extLst"), n.length > 0) {
3534
- e.start("ext", {
3535
- uri: s,
3536
- "xmlns:x14": u
3537
- }), e.start("x14:conditionalFormattings");
3538
- for (let t = 0; t < n.length; t++) {
3539
- const { guid: r, sqref: o, priority: s, scale: i, rule: c, style: d, stopIfTrue: m } = n[t];
3540
- if (e.start("x14:conditionalFormatting", { "xmlns:xm": g }), i) if (i.type === U.ScaleType.DataBar) {
3541
- e.start("x14:cfRule", {
3542
- type: "dataBar",
3543
- id: r
3544
- }), e.start("x14:dataBar", {
3545
- minLength: i.minLength,
3546
- maxLength: i.maxLength,
3547
- gradient: i.gradient ? void 0 : "0",
3548
- border: i.borderColor ? "1" : void 0,
3549
- direction: i.direction,
3550
- negativeBarColorSameAsPositive: i.negativeFillColor ? "0" : "1",
3551
- negativeBarBorderColorSameAsPositive: i.negativeBorderColor ? "0" : void 0,
3552
- axisPosition: i.axisPosition
3553
- });
3554
- const t = i.stops ?? [];
3555
- if (0 === t.length) er(e, { type: U.ColorStopType.AutoMin }), er(e, { type: U.ColorStopType.AutoMax });
3556
- else for (let r = 0; r < t.length; r++) er(e, t[r]);
3557
- i.borderColor && re(e, l, i.borderColor, "x14:borderColor"), i.negativeFillColor && re(e, l, i.negativeFillColor, "x14:negativeFillColor"), i.negativeBorderColor && re(e, l, i.negativeBorderColor, "x14:negativeBorderColor"), i.axisColor && re(e, l, i.axisColor, "x14:axisColor"), e.end("x14:dataBar"), e.end("x14:cfRule");
3558
- } else {
3559
- e.start("x14:cfRule", {
3560
- type: "iconSet",
3561
- priority: s,
3562
- id: r
3563
- }), e.start("x14:iconSet", {
3564
- iconSet: i.iconSet,
3565
- reverse: lr(i.reverse),
3566
- showValue: lr(i.showValue),
3567
- custom: (i.icon?.length ?? 0) > 0 ? "1" : void 0
3568
- });
3569
- const t = i.stops ?? [];
3570
- for (let r = 0; r < t.length; r++) er(e, t[r]);
3571
- const n = i.icon ?? [];
3572
- for (let t = 0; t < n.length; t++) e.empty("x14:cfIcon", {
3573
- iconSet: n[t].set,
3574
- iconId: n[t].id
3575
- });
3576
- e.end("x14:iconSet"), e.end("x14:cfRule");
3577
- }
3578
- else {
3579
- e.start("x14:cfRule", {
3580
- type: c.type,
3581
- priority: s,
3582
- stopIfTrue: lr(m),
3583
- aboveAverage: lr(c.aboveAverage),
3584
- equalAverage: lr(c.equalAverage),
3585
- stdDev: c.stdDev,
3586
- bottom: lr(c.bottom),
3587
- percent: lr(c.percent),
3588
- rank: c.rank,
3589
- operator: c.operator,
3590
- text: c.text,
3591
- timePeriod: c.timePeriod,
3592
- id: r
3593
- });
3594
- const t = c.formulas ?? [];
3595
- for (let r = 0; r < t.length; r++) e.start("xm:f"), e.text(t[r]), e.end("xm:f");
3596
- d && Object.keys(d).length > 0 && ze(0, e, d, a, l, "x14:dxf"), e.end("x14:cfRule");
3597
- }
3598
- e.start("xm:sqref"), e.text(o), e.end("xm:sqref"), e.end("x14:conditionalFormatting");
3599
- }
3600
- e.end("x14:conditionalFormattings"), e.end("ext");
3601
- }
3602
- if (o.length > 0) {
3603
- e.start("ext", {
3604
- uri: R,
3605
- "xmlns:x14": u
3606
- }), e.start("x14:dataValidations", {
3607
- "xmlns:xm": g,
3608
- count: o.length
3609
- });
3610
- for (let t = 0; t < o.length; t++) {
3611
- const { attrs: r, formula1: n, formula2: s, sqref: a } = o[t];
3612
- e.start("x14:dataValidation", r), void 0 !== n && (e.start("x14:formula1"), e.start("xm:f"), e.text(n), e.end("xm:f"), e.end("x14:formula1")), void 0 !== s && (e.start("x14:formula2"), e.start("xm:f"), e.text(s), e.end("xm:f"), e.end("x14:formula2")), e.start("xm:sqref"), e.text(a), e.end("xm:sqref"), e.end("x14:dataValidation");
3613
- }
3614
- e.end("x14:dataValidations"), e.end("ext");
3615
- }
3616
- e.end("extLst");
3617
- }(0, n, a, y, x), function(t, e) {
3618
- const r = e.pivotTables, n = r ? r.length : 0;
3619
- for (let e = 0; e < n; e++) {
3620
- const n = r[e], o = n.part;
3621
- o?.xml && (qt(t, n.cacheId) ? t.addPart("pivotTable", n) : t.log(`The pivot table '${o.name ?? ""}' has no cache with id ${n.cacheId} and was dropped.`));
3622
- }
3623
- }(e, c), function(t, e) {
3624
- if (!e) return;
3625
- t.addPart("comments", e), e.comments.some((t) => !t.comment.isNote()) && t.addPart("threadedComments", e);
3626
- }(e, b), n.end("worksheet"), n.close();
3627
- }
3628
- }(),
3629
- new class extends lt {
3630
- constructor() {
3631
- super({
3632
- kind: "sharedStrings",
3633
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
3634
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",
3635
- path: "/xl/sharedStrings.xml"
3636
- });
3637
- }
3638
- async emit(t, e) {
3639
- const r = e.getXMLWriter(), n = t.json, s = n ? n.length : 0, a = e.getSharedStates().get("stringsCount") ?? 0;
3640
- r.decl(), r.start("sst", {
3641
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3642
- count: a,
3643
- uniqueCount: s
3644
- });
3645
- for (let t = 0; t < s; t++) {
3646
- const e = n[t];
3647
- r.start("si");
3648
- const s = o.test(e) ? m : void 0;
3649
- r.start("t", s), r.text(p(e)), r.end("t"), r.end("si");
3650
- }
3651
- r.end("sst"), r.close();
3652
- }
3653
- }(),
3654
- new class extends lt {
3655
- constructor() {
3656
- super({
3657
- kind: "theme",
3658
- contentType: "application/vnd.openxmlformats-officedocument.theme+xml",
3659
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
3660
- path: "/xl/theme/theme{n}.xml"
3661
- });
3662
- }
3663
- async emit(t, e) {
3664
- const r = e.getXMLWriter(), n = t.model, o = t.json;
3665
- r.decl(), r.pushDefaultNamespace("a"), r.start("theme", {
3666
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3667
- name: n.getName() || "Office Theme"
3668
- }), r.start("themeElements"), function(t, e, r, n) {
3669
- const o = r?.getColorScheme();
3670
- if (!o) return;
3671
- e.start(n, { name: o.getName() || "Office" });
3672
- for (const t of se) e.start(t), te(e, r, o["get" + t.charAt(0).toUpperCase() + t.slice(1)]()), e.end(t);
3673
- e.end(n);
3674
- }(0, r, n, "clrScheme"), function(t, e, r, n) {
3675
- if (!r) return;
3676
- e.start(n, { name: r.getName() || "Office" }), Ir(t, e, r.getMajorFont() || "Calibri Light", "majorFont"), Ir(t, e, r.getMinorFont() || "Calibri", "minorFont"), e.end(n);
3677
- }(e, r, n.getFontScheme(), "fontScheme"), function(t, e, r, n, o) {
3678
- if (o?.fillStyleLst && o?.lnStyleLst && o?.effectStyleLst && o?.bgFillStyleLst) return void function(t, e, r, n, o) {
3679
- const s = { getTheme: () => n };
3680
- e.start(r, { name: "Office" }), e.start("fillStyleLst");
3681
- for (const t of o.fillStyleLst) xe(0, e, t, s);
3682
- e.end("fillStyleLst"), e.start("lnStyleLst");
3683
- for (const t of o.lnStyleLst) ve(0, e, t, s);
3684
- e.end("lnStyleLst"), e.start("effectStyleLst");
3685
- for (const r of o.effectStyleLst) e.start("effectStyle"), r.length > 0 ? be(t, e, n, r) : e.empty("effectLst"), e.end("effectStyle");
3686
- e.end("effectStyleLst"), e.start("bgFillStyleLst");
3687
- for (const t of o.bgFillStyleLst) xe(0, e, t, s);
3688
- e.end("bgFillStyleLst"), e.end(r);
3689
- }(t, e, r, n, o);
3690
- if (o?.formatSchemeXml) return void e.raw(o.formatSchemeXml);
3691
- e.start(r, { name: "Office" }), function(t, e) {
3692
- e.start("fillStyleLst"), e.start("solidFill"), e.empty("schemeClr", { val: "phClr" }), e.end("solidFill"), e.start("gradFill", { rotWithShape: "1" }), e.start("gsLst"), e.start("gs", { pos: "0" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "50000" }), e.empty("satMod", { val: "300000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "35000" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "37000" }), e.empty("satMod", { val: "300000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "100000" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "15000" }), e.empty("satMod", { val: "350000" }), e.end("schemeClr"), e.end("gs"), e.end("gsLst"), e.empty("lin", {
3693
- ang: "16200000",
3694
- scaled: "1"
3695
- }), e.end("gradFill"), e.start("gradFill", { rotWithShape: "1" }), e.start("gsLst"), e.start("gs", { pos: "0" }), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "51000" }), e.empty("satMod", { val: "130000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "80000" }), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "93000" }), e.empty("satMod", { val: "130000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "100000" }), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "94000" }), e.empty("satMod", { val: "135000" }), e.end("schemeClr"), e.end("gs"), e.end("gsLst"), e.empty("lin", {
3696
- ang: "16200000",
3697
- scaled: "0"
3698
- }), e.end("gradFill"), e.end("fillStyleLst");
3699
- }(0, e), function(t, e) {
3700
- e.start("lnStyleLst");
3701
- const r = [
3702
- 9525,
3703
- 25400,
3704
- 38100
3705
- ];
3706
- for (let t = 0; t < 3; t++) e.start("ln", {
3707
- w: r[t].toString(),
3708
- cap: "flat",
3709
- cmpd: "sng",
3710
- algn: "ctr"
3711
- }), e.start("solidFill"), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "95000" }), e.empty("satMod", { val: "105000" }), e.end("schemeClr"), e.end("solidFill"), e.empty("prstDash", { val: "solid" }), e.end("ln");
3712
- e.end("lnStyleLst");
3713
- }(0, e), function(t, e) {
3714
- e.start("effectStyleLst");
3715
- for (let t = 0; t < 3; t++) e.start("effectStyle"), e.start("effectLst"), 2 === t && (e.start("outerShdw", {
3716
- blurRad: "40000",
3717
- dist: "20000",
3718
- dir: "5400000",
3719
- rotWithShape: "0"
3720
- }), e.start("srgbClr", { val: "000000" }), e.empty("alpha", { val: "38000" }), e.end("srgbClr"), e.end("outerShdw")), e.end("effectLst"), e.end("effectStyle");
3721
- e.end("effectStyleLst");
3722
- }(0, e), function(t, e) {
3723
- e.start("bgFillStyleLst"), e.start("solidFill"), e.empty("schemeClr", { val: "phClr" }), e.end("solidFill"), e.start("gradFill", { rotWithShape: "1" }), e.start("gsLst"), e.start("gs", { pos: "0" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "40000" }), e.empty("satMod", { val: "350000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "40000" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "45000" }), e.empty("shade", { val: "99000" }), e.empty("satMod", { val: "350000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "100000" }), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "20000" }), e.empty("satMod", { val: "255000" }), e.end("schemeClr"), e.end("gs"), e.end("gsLst"), e.empty("path", { path: "circle" }), e.empty("fillToRect", {
3724
- l: "50000",
3725
- t: "-80000",
3726
- r: "50000",
3727
- b: "180000"
3728
- }), e.end("gradFill"), e.start("gradFill", { rotWithShape: "1" }), e.start("gsLst"), e.start("gs", { pos: "0" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "80000" }), e.empty("satMod", { val: "300000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "100000" }), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "30000" }), e.empty("satMod", { val: "200000" }), e.end("schemeClr"), e.end("gs"), e.end("gsLst"), e.empty("path", { path: "circle" }), e.empty("fillToRect", {
3729
- l: "50000",
3730
- t: "50000",
3731
- r: "50000",
3732
- b: "50000"
3733
- }), e.end("gradFill"), e.end("bgFillStyleLst");
3734
- }(0, e), e.end(r);
3735
- }(e, r, "fmtScheme", n, o), r.end("themeElements"), r.start("objectDefaults"), r.end("objectDefaults"), r.start("extraClrSchemeLst"), r.end("extraClrSchemeLst"), r.end("theme"), r.close();
3736
- }
3737
- }(),
3738
- new class extends lt {
3739
- constructor() {
3740
- super({
3741
- kind: "styles",
3742
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
3743
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",
3744
- path: "/xl/styles.xml"
3745
- });
3746
- }
3747
- async emit(t, e) {
3748
- const r = e.getXMLWriter(), n = t.json, o = (t.theme, t.styles);
3749
- r.decl(), r.start("styleSheet", {
3750
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3751
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
3752
- "mc:Ignorable": "x14ac x16r2 xr",
3753
- "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac",
3754
- "xmlns:x16r2": "http://schemas.microsoft.com/office/spreadsheetml/2015/02/main",
3755
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision"
3756
- });
3757
- const s = function(t, e) {
3758
- let r = e?.direct;
3759
- r && 0 !== r.length || (r = [{}]);
3760
- const n = r.length, o = new Array(n);
3761
- for (let e = 0; e < n; e++) {
3762
- const n = 0 === e ? {
3763
- ...r[e],
3764
- named: K.BuiltInName.Normal
3765
- } : r[e], s = t.resolve(n), a = {};
3766
- void 0 !== n.named && (a.named = n.named), void 0 !== n.quotePrefix && (a.quotePrefix = n.quotePrefix), void 0 !== n.protection && (a.protection = n.protection);
3767
- for (let t = 0; t < Ne.length; t++) {
3768
- const e = Ne[t];
3769
- if (void 0 === n[e] && "alignment" !== e) continue;
3770
- const r = s?.[e] ?? n[e];
3771
- void 0 !== r && (a[e] = r);
3772
- }
3773
- o[e] = a;
3774
- }
3775
- return o;
3776
- }(o, n), a = function(t, e, r) {
3777
- const n = {
3778
- fontMap: /* @__PURE__ */ new Map(),
3779
- fonts: [],
3780
- fillMap: /* @__PURE__ */ new Map(),
3781
- fills: [],
3782
- borderMap: /* @__PURE__ */ new Map(),
3783
- borders: [],
3784
- numFmtMap: /* @__PURE__ */ new Map(),
3785
- numFmtsCustom: [],
3786
- namedStyleMap: /* @__PURE__ */ new Map(),
3787
- namedStyles: []
3788
- };
3789
- (function(t, e) {
3790
- const r = (t.getNamedStyles().getByName(K.BuiltInName.Normal).toJSON().style ?? {}).font ?? {};
3791
- e.fontMap.set(E.JSONStableStringify(r), "0"), e.fonts.push(r);
3792
- })(t, n), function(t) {
3793
- const e = { type: "none" };
3794
- t.fillMap.set(E.JSONStableStringify(e), "0"), t.fills.push(e);
3795
- const r = {
3796
- type: "pattern",
3797
- patternType: "gray125"
3798
- };
3799
- t.fillMap.set(E.JSONStableStringify(r), "1"), t.fills.push(r);
3800
- }(n), function(t) {
3801
- const e = {
3802
- bottom: { style: "none" },
3803
- left: { style: "none" },
3804
- right: { style: "none" },
3805
- top: { style: "none" }
3806
- };
3807
- t.borderMap.set(E.JSONStableStringify(e), "0"), t.borders.push(e);
3808
- }(n), function(t, e) {
3809
- Ee(t, t.getNamedStyles().getByName(K.BuiltInName.Normal).toJSON(), e);
3810
- }(t, n);
3811
- const o = e?.named ?? O.EmptyArray;
3812
- for (const e of o) Ee(t, e, n);
3813
- for (const e of r) De(t, e, n);
3814
- return n;
3815
- }(o, n, s), l = e.getSharedStates().get(Pe), i = function(t, e = 0) {
3816
- const r = t?.tables;
3817
- if (!r) return null;
3818
- const n = r.styles;
3819
- if (!n) return null;
3820
- const o = [], s = /* @__PURE__ */ new Map(), a = Object.keys(n), l = [...Ue].reverse();
3821
- for (const t of a) {
3822
- const r = n[t];
3823
- for (const n of l) {
3824
- const a = r[n];
3825
- if (!a) continue;
3826
- const l = {};
3827
- if (a.font && (l.font = a.font), a.fill && (l.fill = a.fill), a.borders && (l.borders = a.borders), void 0 !== a.numberFormat && (l.numberFormat = a.numberFormat), 0 === Object.keys(l).length) continue;
3828
- const i = e + o.length;
3829
- o.push(l);
3830
- const c = `${t}:${n}`;
3831
- s.set(c, i);
3832
- }
3833
- }
3834
- return {
3835
- dxfs: o,
3836
- dxfIndexMap: s
3837
- };
3838
- }(n, l?.getCount() ?? 0);
3839
- (function(t, e, r) {
3840
- const n = r.numFmtsCustom, o = n.length;
3841
- if (0 === o) return;
3842
- e.start("numFmts", { count: String(o) });
3843
- for (let t = 0; t < o; t++) {
3844
- const r = n[t];
3845
- e.empty("numFmt", {
3846
- numFmtId: String(t + je),
3847
- formatCode: r
3848
- });
3849
- }
3850
- e.end("numFmts");
3851
- })(0, r, a), function(t, e, r, n) {
3852
- const o = n.fonts, s = o.length;
3853
- e.start("fonts", {
3854
- count: String(s),
3855
- "x14ac:knownFonts": "1"
3856
- });
3857
- for (const n of o) Be(t, e, n, r);
3858
- e.end("fonts");
3859
- }(e, r, o, a), function(t, e, r, n) {
3860
- const o = n.fills, s = o.length;
3861
- e.start("fills", { count: String(s) });
3862
- for (const t of o) xe(0, e, t, r, !0);
3863
- e.end("fills");
3864
- }(0, r, o, a), function(t, e, r, n) {
3865
- const o = n.borders, s = o.length;
3866
- e.start("borders", { count: String(s) });
3867
- const a = r.getTheme();
3868
- for (const r of o) $e(t, e, r, a, !1);
3869
- e.end("borders");
3870
- }(e, r, o, a), function(t, e, r, n, o) {
3871
- const s = o.namedStyles, a = s.length;
3872
- e.start("cellStyleXfs", { count: String(a) });
3873
- for (const n of s) Ve(t, e, r, n.style ?? O.EmptyObject, o, !1);
3874
- e.end("cellStyleXfs");
3875
- }(e, r, o, 0, a), function(t, e, r, n, o, s) {
3876
- const a = n.length, l = s?.getSources() ?? [];
3877
- e.start("cellXfs", { count: String(a + l.length) });
3878
- for (let s = 0; s < a; s++) Ve(t, e, r, n[s], o, !0);
3879
- for (let s = 0; s < l.length; s++) Ve(t, e, r, n[l[s]], o, !0, !0);
3880
- e.end("cellXfs");
3881
- }(e, r, o, s, a, e.getSharedStates().get(Bt)), function(t, e, r, n, o) {
3882
- const s = o.namedStyles, a = s.length;
3883
- e.start("cellStyles", { count: String(a) });
3884
- const l = o.namedStyleMap;
3885
- for (let t = 0; t < a; t++) {
3886
- const n = s[t], o = n.name, a = o.toLowerCase(), i = {
3887
- name: o,
3888
- xfId: l.get(a)
3889
- };
3890
- n.hidden && (i.hidden = "1"), n.iLevel && (i.iLevel = String(n.iLevel));
3891
- let c = null;
3892
- c = a === K.BuiltInName.Normal.toLowerCase() ? 0 : r.getNamedStyles().getByName(o).getBuiltInID(), null !== c && (i.builtinId = String(c), i.customBuiltin = "1"), e.empty("cellStyle", i);
3893
- }
3894
- e.end("cellStyles");
3895
- }(0, r, o, 0, a), function(t, e, r, n, o) {
3896
- const s = [...o?.getDxfs() ?? [], ...n?.dxfs ?? []];
3897
- if (0 === s.length) return void e.empty("dxfs", { count: "0" });
3898
- const a = r.getTheme();
3899
- e.start("dxfs", { count: String(s.length) });
3900
- let l = je;
3901
- for (const n of s) l = ze(t, e, n, r, a, "dxf", l);
3902
- e.end("dxfs");
3903
- }(e, r, o, i, l), function(t, e, r, n, o) {
3904
- const s = n?.tables, a = s?.styles ?? null, l = a ? Object.keys(a) : null, i = l ? l.length : 0, c = {
3905
- count: String(i),
3906
- defaultTableStyle: s?.defaultTableStyle ?? "TableStyleMedium2",
3907
- defaultPivotStyle: s?.defaultPivotStyle ?? "PivotStyleLight16"
3908
- };
3909
- if (0 === i) return void e.empty("tableStyles", c);
3910
- e.start("tableStyles", c);
3911
- for (const t of l) {
3912
- const r = a[t], n = [];
3913
- for (const t of Ue) {
3914
- const e = r[t];
3915
- e && n.push([t, e]);
3916
- }
3917
- const s = {
3918
- name: t,
3919
- pivot: r.pivot ? "1" : "0",
3920
- count: String(n.length)
3921
- };
3922
- e.start("tableStyle", s);
3923
- for (const [r, s] of n) {
3924
- const n = `${t}:${r}`, a = o?.dxfIndexMap.get(n) ?? "0", l = {};
3925
- l.type = r, void 0 !== s.size && (l.size = String(s.size)), l.dxfId = String(a), e.empty("tableStyleElement", l);
3926
- }
3927
- e.end("tableStyle");
3928
- }
3929
- e.end("tableStyles");
3930
- }(0, r, 0, n, i), function(t, e, r, n) {
3931
- const o = n?.indexedColors && n.indexedColors.length > 0, s = n?.mruColors && n.mruColors.length > 0;
3932
- if (!o && !s) return;
3933
- if (e.start("colors"), o) {
3934
- e.start("indexedColors");
3935
- for (const t of n.indexedColors) {
3936
- const r = me(t, !0);
3937
- e.empty("rgbColor", { rgb: r });
3938
- }
3939
- e.end("indexedColors");
3940
- }
3941
- if (s) {
3942
- e.start("mruColors");
3943
- for (const t of n.mruColors) {
3944
- const r = me(t);
3945
- e.empty("color", { rgb: r });
3946
- }
3947
- e.end("mruColors");
3948
- }
3949
- e.end("colors");
3950
- }(0, r, 0, n), function(t, e) {
3951
- e.start("extLst"), e.start("ext", {
3952
- uri: "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}",
3953
- "xmlns:x14": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
3954
- }), e.empty("x14:slicerStyles", { defaultSlicerStyle: "SlicerStyleLight1" }), e.end("ext"), e.start("ext", {
3955
- uri: "{9260A510-F301-46a8-8635-F512D64BE5F5}",
3956
- "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
3957
- }), e.empty("x15:timelineStyles", { defaultTimelineStyle: "TimeSlicerStyleLight1" }), e.end("ext"), e.end("extLst");
3958
- }(0, r), r.end("styleSheet"), r.close();
3959
- }
3960
- }(),
3961
- new class extends lt {
3962
- constructor() {
3963
- super({
3964
- kind: "propsCore",
3965
- contentType: "application/vnd.openxmlformats-package.core-properties+xml",
3966
- relTypeUri: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
3967
- path: "/docProps/core.xml"
3968
- });
3969
- }
3970
- async emit(t, e) {
3971
- const r = e.getXMLWriter();
3972
- r.decl(), r.start("cp:coreProperties", {
3973
- "xmlns:cp": "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
3974
- "xmlns:dc": "http://purl.org/dc/elements/1.1/",
3975
- "xmlns:dcterms": "http://purl.org/dc/terms/",
3976
- "xmlns:dcmitype": "http://purl.org/dc/dcmitype/",
3977
- "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
3978
- });
3979
- const n = /* @__PURE__ */ new Date(), o = [
3980
- ["creator", "SheetXL"],
3981
- ["lastModifiedBy", "SheetXL"],
3982
- ["created", Tr(n)],
3983
- ["modified", Tr(n)]
3984
- ];
3985
- for (const t of o) Mr(r, t[0], t[1]);
3986
- r.end("cp:coreProperties"), r.close();
3987
- }
3988
- }(),
3989
- new class extends lt {
3990
- constructor() {
3991
- super({
3992
- kind: "propsApp",
3993
- contentType: "application/vnd.openxmlformats-officedocument.extended-properties+xml",
3994
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",
3995
- path: "/docProps/app.xml"
3996
- });
3997
- }
3998
- async emit(t, e) {
3999
- const r = e.getXMLWriter(), n = t.model, o = await Z.getDetails(), s = A(o.getBuildVersion()), a = o.getLicensee() || "";
4000
- r.setValidationDisabled(!0), r.decl(), r.start("Properties", {
4001
- xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
4002
- "xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
4003
- }), Rr(e, r, "Application", "SheetXL"), Rr(e, r, "DocSecurity", "0"), Rr(e, r, "ScaleCrop", "false"), Ar(e, r, n), Rr(e, r, "Company", a), Rr(e, r, "LinksUpToDate", "false"), Rr(e, r, "SharedDoc", "false"), Rr(e, r, "HyperlinksChanged", "false"), Rr(e, r, "AppVersion", s), r.end("Properties"), r.close();
4004
- }
4005
- }(),
4006
- new class extends lt {
4007
- constructor() {
4008
- super({
4009
- kind: "metadata",
4010
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",
4011
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",
4012
- path: "/xl/metadata.xml"
4013
- });
4014
- }
4015
- emit(t, e) {
4016
- const r = e.getXMLWriter(), n = t.hasCellMeta(), o = t.hasValueMeta(), s = t.getDAPRFutureMetadataBlocks(), a = t.getRVFutureMetadataBlocks(), l = t.getValueMeta();
4017
- let i = 0, c = 0, d = 0;
4018
- n && (i = ++d), o && (c = ++d);
4019
- const m = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
4020
- if (n && (m["xmlns:xda"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"), o && (m["xmlns:xlrd"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata"), r.decl(), r.start("metadata", m), r.start("metadataTypes", { count: d }), n && r.empty("metadataType", {
4021
- name: "XLDAPR",
4022
- ...Fr,
4023
- cellMeta: "1"
4024
- }), o && r.empty("metadataType", {
4025
- name: "XLRICHVALUE",
4026
- ...Fr
4027
- }), r.end("metadataTypes"), n) {
4028
- r.start("futureMetadata", {
4029
- name: "XLDAPR",
4030
- count: s.length
4031
- });
4032
- for (const t of s) r.start("bk"), r.start("extLst"), r.start("ext", { uri: "{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}" }), r.empty("xda:dynamicArrayProperties", {
4033
- fDynamic: t.fDynamic,
4034
- fCollapsed: t.fCollapsed
4035
- }), r.end("ext"), r.end("extLst"), r.end("bk");
4036
- r.end("futureMetadata");
4037
- }
4038
- if (o) {
4039
- r.start("futureMetadata", {
4040
- name: "XLRICHVALUE",
4041
- count: a.length
4042
- });
4043
- for (const t of a) r.start("bk"), r.start("extLst"), r.start("ext", { uri: "{3e2802c4-a4d2-4d8b-9148-e3be6c30e623}" }), r.empty("xlrd:rvb", { i: t }), r.end("ext"), r.end("extLst"), r.end("bk");
4044
- r.end("futureMetadata");
4045
- }
4046
- if (n) {
4047
- r.start("cellMetadata", { count: s.length });
4048
- for (let t = 0; t < s.length; t++) r.start("bk"), r.empty("rc", {
4049
- t: i,
4050
- v: t
4051
- }), r.end("bk");
4052
- r.end("cellMetadata");
4053
- }
4054
- if (o) {
4055
- r.start("valueMetadata", { count: l.length });
4056
- for (const t of l) r.start("bk"), r.empty("rc", {
4057
- t: c,
4058
- v: t
4059
- }), r.end("bk");
4060
- r.end("valueMetadata");
4061
- }
4062
- r.end("metadata"), r.close();
4063
- }
4064
- }(),
4065
- new class extends lt {
4066
- constructor() {
4067
- super({
4068
- kind: "richValue",
4069
- contentType: "application/vnd.ms-excel.rdrichvalue+xml",
4070
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValue",
4071
- path: "./richData/rdrichvalue.xml"
4072
- });
4073
- }
4074
- async emit(t, e) {
4075
- const r = e.getXMLWriter(), n = t.getEntries(), o = n.length;
4076
- r.decl(), r.start("rvData", {
4077
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata",
4078
- count: o
4079
- });
4080
- for (const e of n) {
4081
- const n = t.handlerStructureIndex(e.handler);
4082
- r.start("rv", { s: n });
4083
- const o = e.handler.getValues(e.rawValue);
4084
- for (const t of o) r.start("v"), r.text(t), r.end("v");
4085
- r.end("rv");
4086
- }
4087
- r.end("rvData"), r.close();
4088
- }
4089
- }(),
4090
- new class extends lt {
4091
- constructor() {
4092
- super({
4093
- kind: "richValueStructure",
4094
- contentType: "application/vnd.ms-excel.rdrichvaluestructure+xml",
4095
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueStructure",
4096
- path: "./richData/rdrichvaluestructure.xml"
4097
- });
4098
- }
4099
- async emit(t, e) {
4100
- const r = e.getXMLWriter(), n = t.uniqueHandlers(), o = n.length;
4101
- r.decl(), r.start("rvStructures", {
4102
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata",
4103
- count: o
4104
- });
4105
- for (const t of n) {
4106
- r.start("s", { t: t.type });
4107
- for (const [e, n] of t.props) r.empty("k", {
4108
- n: e,
4109
- t: n
4110
- });
4111
- r.end("s");
4112
- }
4113
- r.end("rvStructures"), r.close();
4114
- }
4115
- }(),
4116
- new class extends lt {
4117
- constructor() {
4118
- super({
4119
- kind: "richValueTypes",
4120
- contentType: "application/vnd.ms-excel.rdrichvaluetypes+xml",
4121
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueTypes",
4122
- path: "./richData/rdRichValueTypes.xml"
4123
- });
4124
- }
4125
- async emit(t, e) {
4126
- const r = e.getXMLWriter();
4127
- r.decl(), r.start("rvTypesInfo", {
4128
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2",
4129
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
4130
- "mc:Ignorable": "x",
4131
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
4132
- });
4133
- const n = [
4134
- ["_self", ["ExcludeFromFile", "ExcludeFromCalcComparison"]],
4135
- ["_DisplayString", ["ExcludeFromCalcComparison"]],
4136
- ["_Flags", ["ExcludeFromCalcComparison"]],
4137
- ["_Format", ["ExcludeFromCalcComparison"]],
4138
- ["_SubLabel", ["ExcludeFromCalcComparison"]],
4139
- ["_Attribution", ["ExcludeFromCalcComparison"]],
4140
- ["_Icons", ["ExcludeFromCalcComparison"]],
4141
- ["_Display", ["ExcludeFromCalcComparison"]],
4142
- ["_CanonicalPropertyNames", ["ExcludeFromCalcComparison"]],
4143
- ["_ClassificationId", ["ExcludeFromCalcComparison"]]
4144
- ];
4145
- r.start("global"), r.start("keyFlags");
4146
- for (const [t, e] of n) {
4147
- r.start("key", { name: t });
4148
- for (const t of e) r.empty("flag", {
4149
- name: t,
4150
- value: "1"
4151
- });
4152
- r.end("key");
4153
- }
4154
- r.end("keyFlags"), r.end("global"), r.end("rvTypesInfo"), r.close();
4155
- }
4156
- }(),
4157
- new class extends lt {
4158
- constructor() {
4159
- super({
4160
- kind: "drawing",
4161
- contentType: "application/vnd.openxmlformats-officedocument.drawing+xml",
4162
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
4163
- path: "../drawings/drawing{n}.xml"
4164
- });
4165
- }
4166
- async emit(t, e) {
4167
- const r = e.getXMLWriter();
4168
- r.decl(), r.pushDefaultNamespace("xdr"), r.start("wsDr", {
4169
- "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
4170
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main"
4171
- });
4172
- const n = /* @__PURE__ */ new Map(), o = t.sheet, s = t.movables, a = t.jsonMovables, l = a ? a.length : 0;
4173
- let i = 0;
4174
- for (let t = 0; t < l; t++) {
4175
- const e = a[t].content?.json?.sourceId;
4176
- "number" == typeof e && e > i && (i = e);
4177
- }
4178
- const c = /* @__PURE__ */ new Map();
4179
- let d;
4180
- if (i > 0) {
4181
- const t = e.getSharedStates();
4182
- d = t.get("uniqueIdCounter"), d || (d = /* @__PURE__ */ new Map(), t.set("uniqueIdCounter", d)), d.set(o, Math.max(d.get(o) ?? 1, i));
4183
- const r = /* @__PURE__ */ new Set();
4184
- for (let t = 0; t < l; t++) {
4185
- const e = a[t].content?.json?.sourceId;
4186
- if ("number" == typeof e) if (r.has(e)) {
4187
- const e = d.get(o) + 1;
4188
- d.set(o, e), c.set(a[t], e);
4189
- } else r.add(e);
4190
- }
4191
- }
4192
- for (let t = 0; t < l; t++) {
4193
- const l = a[t], i = s[t], d = l.content?.type;
4194
- switch (r.start("twoCellAnchor", { editAs: l.anchorType || "twoCell" }), Kr(r, "from", l.anchor.tl), Kr(r, "to", l.anchor.br), d) {
4195
- case "picture":
4196
- await Br(e, o, n, i, l);
4197
- break;
4198
- case "chart":
4199
- await Or(e, o, n, i, l, c.get(l));
4200
- break;
4201
- case "shape":
4202
- await zr(e, o, n, i, l, c.get(l));
4203
- break;
4204
- case "smartArt":
4205
- await $r(e, o, n, i, l);
4206
- break;
4207
- case "slicer":
4208
- await Wr(e, o, n, i, l);
4209
- break;
4210
- case "graphicFrame":
4211
- await Vr(e, o, n, i, l);
4212
- break;
4213
- default: await jr(e, o, n, i, l);
4214
- }
4215
- r.empty("clientData"), r.end("twoCellAnchor");
4216
- }
4217
- r.end("wsDr"), r.close();
4218
- }
4219
- }(),
4220
- new class extends lt {
4221
- constructor() {
4222
- super({
4223
- kind: "legacyDrawing",
4224
- contentType: "application/vnd.openxmlformats-officedocument.vmlDrawing",
4225
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",
4226
- path: "../drawings/vmlDrawing{n}.vml"
4227
- });
4228
- }
4229
- async emit(t, e) {
4230
- const r = t.images, n = r ? r.length : 0;
4231
- if (n > 0) {
4232
- const t = e.getSharedStates().get(at);
4233
- for (let o = 0; o < n; o++) {
4234
- const n = r[o], s = t?.get(n.resId);
4235
- if (s) try {
4236
- await Yr(e, n.id, s);
4237
- } catch (t) {
4238
- e.log(`Unable to write legacy drawing image '${n.id}'`, t);
4239
- }
4240
- else e.log(`Legacy drawing image '${n.id}' has no resource ${n.resId} and was not written.`);
4241
- }
4242
- }
4243
- const o = e.getXMLWriter();
4244
- o.setValidationDisabled(!0), o.raw(t.xml), o.close();
4245
- }
4246
- }(),
4247
- new class extends lt {
4248
- constructor() {
4249
- super({
4250
- kind: "embeddedPart",
4251
- contentType: zt,
4252
- relTypeUri: ""
4253
- });
4254
- }
4255
- getContentType(t) {
4256
- return t?.contentType || zt;
4257
- }
4258
- getRelTypeUri(t) {
4259
- return t?.type ?? "";
4260
- }
4261
- getPath(t) {
4262
- return `./${Xt(t.name)}`;
4263
- }
4264
- async emit(t, e) {
4265
- await jt(t, e);
4266
- const r = e.getXMLWriter();
4267
- r.setValidationDisabled(!0), r.raw(t.xml ?? ""), r.close();
4268
- }
4269
- }(),
4270
- new class extends lt {
4271
- constructor() {
4272
- super({
4273
- kind: "pivotTable",
4274
- contentType: Ht,
4275
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
4276
- path: "../pivotTables/pivotTable{n}.xml"
4277
- });
4278
- }
4279
- getContentType(t) {
4280
- return t?.part?.contentType || Ht;
4281
- }
4282
- async emit(t, e) {
4283
- const r = t.part;
4284
- await jt(r, e);
4285
- const n = qt(e, t.cacheId);
4286
- if (!n || !e.addRelationship("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition", n)) throw new Error(`Pivot table '${r.name ?? ""}' has no cache with id ${t.cacheId}.`);
4287
- const o = e.getXMLWriter();
4288
- o.setValidationDisabled(!0), o.raw(r.xml ?? ""), o.close();
4289
- }
4290
- }(),
4291
- new class extends lt {
4292
- constructor() {
4293
- super({
4294
- kind: "comments",
4295
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
4296
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",
4297
- path: "../comments{n}.xml"
4298
- });
4299
- }
4300
- async emit(t, e) {
4301
- const r = e.getXMLWriter();
4302
- r.decl(), r.start("comments", {
4303
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
4304
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
4305
- "mc:Ignorable": "xr",
4306
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision"
4307
- });
4308
- const n = [], o = /* @__PURE__ */ new Map(), s = (t) => {
4309
- let e = o.get(t);
4310
- return void 0 === e && (e = n.length, n.push(t), o.set(t, e)), e;
4311
- }, a = t.comments, l = [];
4312
- for (let t = 0; t < a.length; t++) {
4313
- const { comment: e, ref: r } = a[t];
4314
- e.isNote() ? l.push({
4315
- ref: r,
4316
- authorId: s(e.getAuthor()?.getDisplayName() ?? ""),
4317
- content: e.getRichContent() ?? e.getContent()
4318
- }) : l.push({
4319
- ref: r,
4320
- authorId: s(`tc={${e.getId().toUpperCase()}}`),
4321
- content: pe(e)
4322
- });
4323
- }
4324
- r.start("authors");
4325
- for (let t = 0; t < n.length; t++) r.start("author"), r.text(n[t]), r.end("author");
4326
- r.end("authors");
4327
- const i = t.sheet.getStyles().getTheme();
4328
- r.start("commentList");
4329
- for (let t = 0; t < l.length; t++) {
4330
- const e = l[t];
4331
- r.start("comment", {
4332
- ref: e.ref,
4333
- authorId: e.authorId,
4334
- shapeId: 0
4335
- }), r.start("text"), fe(r, e.content, i), r.end("text"), r.end("comment");
4336
- }
4337
- r.end("commentList"), r.end("comments"), r.close();
4338
- }
4339
- }(),
4340
- new class extends lt {
4341
- constructor() {
4342
- super({
4343
- kind: "threadedComments",
4344
- contentType: "application/vnd.ms-excel.threadedcomments+xml",
4345
- relTypeUri: "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",
4346
- path: "../threadedComments/threadedComment{n}.xml"
4347
- });
4348
- }
4349
- async emit(t, e) {
4350
- const r = e.getXMLWriter();
4351
- r.decl(), r.start("ThreadedComments", {
4352
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",
4353
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
4354
- });
4355
- const n = t.comments;
4356
- for (let t = 0; t < n.length; t++) {
4357
- const { comment: e, ref: o } = n[t];
4358
- if (e.isNote()) continue;
4359
- Qr(r, o, e.getId(), e.getAuthor()?.getId(), e.getCreationDate(), e.getContent(), null, e.isResolved(), e.toJSON()?.mentions);
4360
- const s = e.getReplies();
4361
- for (let t = 0; t < s.length; t++) {
4362
- const n = s[t];
4363
- Qr(r, o, n.getId(), n.getAuthor()?.getId(), n.getCreationDate(), n.getContent(), e.getId(), !1, n.toJSON().mentions);
4364
- }
4365
- }
4366
- r.end("ThreadedComments"), r.close();
4367
- }
4368
- }(),
4369
- new class extends lt {
4370
- constructor() {
4371
- super({
4372
- kind: "persons",
4373
- contentType: "application/vnd.ms-excel.person+xml",
4374
- relTypeUri: "http://schemas.microsoft.com/office/2017/10/relationships/person",
4375
- path: "persons/person.xml"
4376
- });
4377
- }
4378
- async emit(t, e) {
4379
- const r = e.getXMLWriter();
4380
- r.decl(), r.start("personList", {
4381
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",
4382
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
4383
- });
4384
- const n = t.toArray();
4385
- for (let t = 0; t < n.length; t++) {
4386
- const e = n[t];
4387
- r.empty("person", {
4388
- displayName: e.getDisplayName(),
4389
- id: tn(e.getId()),
4390
- userId: e.getUserId() ?? e.getDisplayName(),
4391
- providerId: e.getProviderId() ?? "None"
4392
- });
4393
- }
4394
- r.end("personList"), r.close();
4395
- }
4396
- }(),
4397
- new class extends lt {
4398
- constructor() {
4399
- super({
4400
- kind: "table",
4401
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",
4402
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
4403
- path: "../tables/table{n}.xml"
4404
- });
4405
- }
4406
- async emit(t, e) {
4407
- const r = e.getXMLWriter();
4408
- r.decl();
4409
- const n = {
4410
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
4411
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
4412
- "mc:Ignorable": "xr xr3",
4413
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
4414
- "xmlns:xr3": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"
4415
- }, o = t.json, s = t.model;
4416
- s.isShowHeaders(), n.id = ++en, n.name = o.name?.trim(), n.displayName = o.description ?? o.name, n.ref = t.ref, 1 !== o.headerRowCount && (n.headerRowCount = o.headerRowCount), 0 !== o.totalsRowCount && (n.totalsRowCount = o.totalsRowCount), o.totalsRowShown || s.isShowTotals() || (n.totalsRowShown = "0"), r.start("table", n), s.isShowHeaders() && qe(e, r, s, o), rn(e, r, s, o), on(e, r, s, o), r.end("table"), r.close();
4417
- }
4418
- }(),
4419
- new class extends lt {
4420
- constructor() {
4421
- super({
4422
- kind: "externalLink",
4423
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml",
4424
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",
4425
- path: "../externalLinks/externalLink{n}.xml"
4426
- });
4427
- }
4428
- async emit(t, e) {
4429
- const r = e.getXMLWriter(), n = t.sources ?? [];
4430
- let o = n.findIndex((t) => "book" === t.role);
4431
- o < 0 && n.length > 0 && (o = 0);
4432
- let s = null, a = null;
4433
- for (let t = 0; t < n.length; t++) {
4434
- const r = n[t], l = e.addExternal(r.type || "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath", r.target).relId;
4435
- t === o ? s = l : "absoluteUrl" === r.role && (a = l);
4436
- }
4437
- s || e.log("External book has no path relationship; Excel cannot locate its source.", t.sheetNames), r.decl();
4438
- const l = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
4439
- (t.mceIgnorable || a) && (l["xmlns:mc"] = "http://schemas.openxmlformats.org/markup-compatibility/2006", l["mc:Ignorable"] = "x14 xxl21", l["xmlns:x14"] = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main", l["xmlns:xxl21"] = "http://schemas.microsoft.com/office/spreadsheetml/2021/extlinks2021"), r.start("externalLink", l);
4440
- const i = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
4441
- s && (i["r:id"] = s), r.start("externalBook", i), a && (r.start("xxl21:alternateUrls"), r.empty("xxl21:absoluteUrl", { "r:id": a }), r.end("xxl21:alternateUrls")), function(t, e) {
4442
- const r = e.sheetNames, n = r ? r.length : 0;
4443
- if (0 === n) return;
4444
- t.start("sheetNames");
4445
- for (let e = 0; e < n; e++) t.empty("sheetName", { val: r[e] });
4446
- t.end("sheetNames");
4447
- }(r, t), function(t, e) {
4448
- const r = e.definedNames, n = r ? r.length : 0;
4449
- if (0 === n) return;
4450
- t.start("definedNames");
4451
- for (let e = 0; e < n; e++) {
4452
- const n = r[e], o = {
4453
- name: n.name,
4454
- refersTo: n.refersTo
4455
- };
4456
- void 0 !== n.sheetIndex && (o.sheetId = "" + n.sheetIndex), t.empty("definedName", o);
4457
- }
4458
- t.end("definedNames");
4459
- }(r, t), function(t, e) {
4460
- const r = e.sheetDataSet, n = r ? r.length : 0;
4461
- if (0 === n) return;
4462
- t.start("sheetDataSet");
4463
- for (let e = 0; e < n; e++) {
4464
- const n = r[e], o = { sheetId: "" + n.sheetIndex };
4465
- n.refreshError && (o.refreshError = "1");
4466
- const s = n.data, a = s ? s.length : 0;
4467
- if (0 !== a) {
4468
- t.start("sheetData", o);
4469
- for (let e = 0; e < a; e++) {
4470
- const [r, n] = s[e];
4471
- t.start("row", { r: "" + (r + 1) });
4472
- const o = n.length;
4473
- for (let e = 0; e < o; e++) {
4474
- const [o, s] = n[e], a = s.length;
4475
- for (let e = 0; e < a; e++) ln(t, r, o + e, s.at(e));
4476
- }
4477
- t.end("row");
4478
- }
4479
- t.end("sheetData");
4480
- } else t.empty("sheetData", o);
4481
- }
4482
- t.end("sheetDataSet");
4483
- }(r, t), r.end("externalBook"), r.end("externalLink"), r.close();
4484
- }
4485
- }(),
4486
- new class extends lt {
4487
- constructor() {
4488
- super({
4489
- kind: "chart",
4490
- contentType: "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
4491
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
4492
- path: "../charts/chart{n}.xml"
4493
- });
4494
- }
4495
- async emit(t, e) {
4496
- const r = e.getXMLWriter();
4497
- r.decl(), r.pushDefaultNamespace("c"), r.start("chartSpace", {
4498
- "xmlns:c": "http://schemas.openxmlformats.org/drawingml/2006/chart",
4499
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4500
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
4501
- "xmlns:c16r2": "http://schemas.microsoft.com/office/drawing/2015/06/chart"
4502
- }), r.empty("date1904", { val: "0" }), r.empty("lang", { val: "en-US" }), r.empty("roundedCorners", { val: "0" }), cn(e, r, t.model, t.json), dn(e, r, t.styles, t.model, t.json), mn(e, r, t.model, t.json), r.end("chartSpace"), r.popDefaultNamespace(), r.close(), e.addPart("chartStyle", { styles: t.styles }), e.addPart("chartColors", { styles: t.styles });
4503
- }
4504
- }(),
4505
- new class extends lt {
4506
- constructor() {
4507
- super({
4508
- kind: "chartStyle",
4509
- contentType: "application/vnd.ms-office.chartstyle+xml",
4510
- relTypeUri: "http://schemas.microsoft.com/office/2011/relationships/chartStyle",
4511
- path: "./style{n}.xml"
4512
- });
4513
- }
4514
- async emit(t, e) {
4515
- const r = e.getXMLWriter();
4516
- r.pushDefaultNamespace("cs"), r.start("chartStyle", {
4517
- "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
4518
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4519
- id: "297"
4520
- }), fn(e, r, Xn, t.styles), r.end("chartStyle"), r.close();
4521
- }
4522
- }(),
4523
- new class extends lt {
4524
- constructor() {
4525
- super({
4526
- kind: "chartColors",
4527
- contentType: "application/vnd.ms-office.chartcolorstyle+xml",
4528
- relTypeUri: "http://schemas.microsoft.com/office/2011/relationships/chartColorStyle",
4529
- path: "./colors{n}.xml"
4530
- });
4531
- }
4532
- async emit(t, e) {
4533
- const r = e.getXMLWriter();
4534
- r.pushDefaultNamespace("cs"), r.start("cs:colorStyle", {
4535
- "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
4536
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4537
- meth: "cycle",
4538
- id: "10"
4539
- }), r.empty("a:schemeClr", { val: "accent1" }), r.empty("a:schemeClr", { val: "accent2" }), r.empty("a:schemeClr", { val: "accent3" }), r.empty("a:schemeClr", { val: "accent4" }), r.empty("a:schemeClr", { val: "accent5" }), r.empty("a:schemeClr", { val: "accent6" }), Hn(e, r, qn), r.end("cs:colorStyle"), r.close();
4540
- }
4541
- }()
4542
- ], Jn = (t) => {
4543
- const e = t.getPart("xl/_rels/workbook.xml.rels");
4544
- if (!e) return null;
4545
- const r = /* @__PURE__ */ new Map();
4546
- for (const t of f(e.data)) {
4547
- if (!t.id) continue;
4548
- const e = t.external ? t.target : yt(t.target.startsWith("/") ? t.target : "xl/" + t.target);
4549
- r.set(t.id, {
4550
- type: t.type,
4551
- target: e,
4552
- external: t.external
4553
- });
4554
- }
4555
- return r;
4556
- }, Kn = (t) => {
4557
- const e = t.getPart("xl/workbook.xml");
4558
- return e ? new TextDecoder("utf-8").decode(e.data) : null;
4559
- }, Yn = (t) => {
4560
- const e = Zn.get(t);
4561
- if (void 0 !== e) return e;
4562
- const r = t.getPart("xl/workbook.xml"), n = r ? new TextDecoder("utf-8").decode(r.data) : null;
4563
- return Zn.set(t, n), n;
4564
- }, Zn = /* @__PURE__ */ new WeakMap(), Qn = async (t, e) => {
4565
- const r = new Dt();
4566
- for (const t of Gn) r.register(t);
4567
- const n = to, o = it.createUint8Array({
4568
- lastModDate: new Date(1899, 11, 29, 19, 0, 0),
4569
- level: n
4570
- }), s = "Excel" === e?.format || "ExcelMacro" === e?.format ? c(t) : null, a = /* @__PURE__ */ new Map(), l = s ? ((t) => {
4571
- const e = t.getPart("xl/workbook.xml");
4572
- if (!e) return null;
4573
- const r = new TextDecoder("utf-8").decode(e.data.subarray(0, 4096)).match(/<fileVersion\b([^>]*)\/?>/);
4574
- if (!r) return null;
4575
- const n = {};
4576
- for (const t of r[1].matchAll(/([\w:]+)="([^"]*)"/g)) n[t[1]] = t[2];
4577
- return Object.keys(n).length > 0 ? n : null;
4578
- })(s) : null;
4579
- l && (e?.macroEnabled || delete l.codeName, a.set(Jt, l));
4580
- const i = s ? ((t) => {
4581
- const e = Yn(t)?.match(/<calcPr\b[^>]*?\bcalcId="([^"]*)"/);
4582
- return e ? e[1] : null;
4583
- })(s) : null;
4584
- null !== i && a.set("calcId", i);
4585
- const d = s ? ((t) => {
4586
- const e = Yn(t)?.match(/<ext\b[^>]*>\s*<xcalcf:calcFeatures\b[\s\S]*?<\/xcalcf:calcFeatures>\s*<\/ext>/);
4587
- return e ? e[0] : null;
4588
- })(s) : null;
4589
- null !== d && a.set("calcFeatures", d);
4590
- const m = s ? ((t) => {
4591
- const e = Kn(t);
4592
- if (!e) return null;
4593
- const r = /<externalReferences\b[^>]*>([\s\S]*?)<\/externalReferences>/.exec(e);
4594
- if (!r) return null;
4595
- const n = [...r[1].matchAll(/<externalReference\b[^>]*\sr:id="([^"]*)"/g)].map((t) => t[1]);
4596
- if (0 === n.length) return null;
4597
- const o = Jn(t);
4598
- return o ? n.map((t) => {
4599
- const e = o.get(t);
4600
- return e && !e.external ? e.target : null;
4601
- }) : null;
4602
- })(s) : null;
4603
- m && a.set(Yt, m);
4604
- const p = s ? ((t) => {
4605
- const e = Kn(t), r = e ? Jn(t) : null;
4606
- if (!e || !r) return null;
4607
- const n = /* @__PURE__ */ new Map();
4608
- for (const t of e.matchAll(/<sheet\b([^>]*)\/?>/g)) {
4609
- const e = /\bsheetId="(\d+)"/.exec(t[1])?.[1], o = /\br:id="([^"]*)"/.exec(t[1])?.[1];
4610
- if (!e || !o) continue;
4611
- const s = r.get(o);
4612
- s && !s.external && "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" === s.type && n.set(parseInt(e, 10), s.target);
4613
- }
4614
- return n.size > 0 ? n : null;
4615
- })(s) : null;
4616
- p && a.set(Kt, p), a.set(at, /* @__PURE__ */ new Map());
4617
- const f = [], h = new Pt(o, r, {
4618
- strictDuplicateChildren: !0,
4619
- onPartEmitted: e?.onPartEmitted,
4620
- onWarning: (t, e, r) => {
4621
- f.push([
4622
- t,
4623
- e,
4624
- r
4625
- ]);
4626
- },
4627
- mapState: a,
4628
- sourcePackage: s,
4629
- macroEnabled: e?.macroEnabled ?? !1
4630
- });
4631
- h.addPart("workbook", t, "/xl/workbook.xml"), await h.waitEmit(), h.addPart("propsCore", {}), h.addPart("propsApp", { model: t });
4632
- const u = await h.build(), g = e?.progress?.onWarning;
4633
- if (f.length && g) {
4634
- const t = /* @__PURE__ */ new Set();
4635
- for (const [r, n, o] of f) {
4636
- const s = o ?? r;
4637
- t.has(s) || (t.add(s), g.call(e.progress, r, n));
4638
- }
4639
- }
4640
- return 0 === u.byteOffset && u.byteLength === u.buffer.byteLength ? u.buffer : u.slice().buffer;
4641
- }, to = 1;
4642
- export { Qn as writeXLSX };