@sheetxl/io-xlsx 0.8.0-beta.1 → 0.8.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/browser/esm/BiDqExNXiY7ykk8E.mjs +2327 -0
  2. package/browser/esm/{Ctqql4O-3xj2K8vv.mjs → Bs0EzhdU8WgGfPzf.mjs} +193 -143
  3. package/browser/esm/CLWsOc6DO8l1G_LF.mjs +2213 -0
  4. package/browser/esm/{CLWzJJyoSrykkVLX.mjs → CZ9I80og75SDRjv0.mjs} +2 -2
  5. package/browser/esm/{Dz1Dp8DDJvhd09RR.mjs → CuAXx5i4uqTz-mMY.mjs} +1 -1
  6. package/browser/esm/Cv3R6fGatARKedSn.mjs +8635 -0
  7. package/browser/esm/{BkNXyG6NC-w5Xo92.mjs → CzFYJPxmLyKgEKF0.mjs} +28 -13
  8. package/browser/esm/DICL6ecj9BdJv8aX.mjs +104 -0
  9. package/browser/esm/DatIA9fZbEPjW4bh.mjs +5638 -0
  10. package/browser/esm/index.mjs +2 -3
  11. package/browser/esm/yveeVJ6hKDI5KDEz.mjs +4168 -0
  12. package/licenses/dependencies.txt +2 -2
  13. package/node/esm/B9Zn6H1RV07Ob377.mjs +2294 -0
  14. package/node/esm/Bpqm_PpGLpdjL47-.mjs +2368 -0
  15. package/node/esm/{fOnuUjpPCAzmuIXN.mjs → CAJxmJdobUbzpUz5.mjs} +2 -2
  16. package/node/esm/{CEV7nKotMpeRRnQC.mjs → CxlSbH7mmnEEsqmX.mjs} +1 -1
  17. package/node/esm/DD-yXSBzvDYy0TX5.mjs +5842 -0
  18. package/node/esm/DScqM1V4wPntNP6-.mjs +5235 -0
  19. package/node/esm/{CEAmv36xpTNgFwl_.mjs → fopiRR7OiVoEiF7B.mjs} +49 -35
  20. package/node/esm/index.mjs +77 -25
  21. package/node/esm/ipiyzn5Pfohw2afB.mjs +4271 -0
  22. package/package.json +7 -8
  23. package/types/src/AutoFilterRules.d.ts +94 -11
  24. package/types/src/ConditionalFormatRules.d.ts +5 -5
  25. package/types/src/DataValidationRules.d.ts +18 -2
  26. package/types/src/DefinedNameAttributes.d.ts +8 -0
  27. package/types/src/ExcelCalcStamp.d.ts +39 -0
  28. package/types/src/ExcelCompat.d.ts +209 -42
  29. package/types/src/ExcelReservedNames.d.ts +3 -4
  30. package/types/src/KnownFonts.d.ts +50 -0
  31. package/types/src/LegacyFormula.d.ts +41 -7
  32. package/types/src/OOXMLExtensions.d.ts +14 -2
  33. package/types/src/PageLayoutAttributes.d.ts +8 -0
  34. package/types/src/Plugin.d.ts +28 -5
  35. package/types/src/ProtectionAttributes.d.ts +38 -0
  36. package/types/src/SheetKinds.d.ts +57 -0
  37. package/types/src/SheetViewAttributes.d.ts +4 -0
  38. package/types/src/SortExtent.d.ts +16 -0
  39. package/types/src/SourcePackage.d.ts +31 -12
  40. package/types/src/Types.d.ts +28 -0
  41. package/types/src/XlsxHeader.d.ts +19 -0
  42. package/types/src/chart/ChartExXml.d.ts +38 -0
  43. package/types/src/chart/ChartPartXml.d.ts +47 -0
  44. package/types/src/chart/ChartSpaceXml.d.ts +36 -0
  45. package/types/src/chart/_XmlTree.d.ts +34 -0
  46. package/types/src/chart/_chartCodecs.d.ts +10 -0
  47. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  48. package/types/src/chart/_chartExFold.d.ts +14 -0
  49. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  50. package/types/src/chart/_chartExStyle.d.ts +22 -0
  51. package/types/src/chart/_codec.d.ts +78 -0
  52. package/types/src/chart/_drawingml.d.ts +10 -0
  53. package/types/src/chart/_xml.d.ts +70 -0
  54. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  55. package/types/src/reader/DummyFunctionUnwrap.d.ts +2 -2
  56. package/types/src/reader/HeaderStyles.d.ts +15 -0
  57. package/types/src/reader/HiddenFormulas.d.ts +16 -0
  58. package/types/src/reader/IsoDateCell.d.ts +20 -0
  59. package/types/src/reader/LibreOfficeDataTable.d.ts +11 -0
  60. package/types/src/reader/SlicerJoin.d.ts +24 -0
  61. package/types/src/reader/Warning.d.ts +29 -0
  62. package/types/src/reader/ZipReader.d.ts +1 -1
  63. package/types/src/reader/_SlicerRecord.d.ts +37 -0
  64. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  65. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  66. package/types/src/reader/dom/ExecutionContext.d.ts +16 -3
  67. package/types/src/reader/dom/Types.d.ts +19 -3
  68. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  69. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +16 -3
  70. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
  71. package/types/src/reader/domVisitors/CommentVisitor.d.ts +24 -2
  72. package/types/src/reader/domVisitors/CommentsVisitor.d.ts +2 -2
  73. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  74. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +34 -1
  75. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  76. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
  77. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +30 -2
  78. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  79. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
  80. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +21 -3
  81. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +4 -4
  82. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  83. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  84. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  85. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  86. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +3 -3
  87. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +21 -6
  88. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +7 -2
  89. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +7 -3
  90. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  91. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  92. package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +18 -1
  93. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  94. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +11 -1
  95. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  96. package/types/src/reader/domVisitors/index.d.ts +6 -32
  97. package/types/src/reader/sax/LeanSaxParser.d.ts +58 -0
  98. package/types/src/reader/sax/SaxParser.d.ts +11 -1
  99. package/types/src/reader/sax/SaxVisitor.d.ts +3 -2
  100. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +9 -0
  101. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +46 -6
  102. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +23 -11
  103. package/types/src/utils/DrawingMLText.d.ts +39 -0
  104. package/types/src/utils/FormControls.d.ts +170 -0
  105. package/types/src/utils/SharedNames.d.ts +13 -0
  106. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  107. package/types/src/utils/VmlNoteShapes.d.ts +128 -0
  108. package/types/src/utils/VmlNoteStyle.d.ts +44 -0
  109. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  110. package/types/src/vba/VBAProject.d.ts +52 -4
  111. package/types/src/writer/builder/ContentTypes.d.ts +13 -0
  112. package/types/src/writer/builder/Emitter.d.ts +11 -6
  113. package/types/src/writer/builder/OpcXmlUtils.d.ts +2 -0
  114. package/types/src/writer/builder/PackageBuilder.d.ts +74 -22
  115. package/types/src/writer/builder/PartWriter.d.ts +5 -0
  116. package/types/src/writer/builder/RelationshipSet.d.ts +3 -0
  117. package/types/src/writer/builder/Types.d.ts +124 -38
  118. package/types/src/writer/builder/_Types.d.ts +17 -0
  119. package/types/src/writer/emitters/CommentsEmitter.d.ts +58 -0
  120. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  121. package/types/src/writer/emitters/EmbeddedPartEmitter.d.ts +60 -0
  122. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +19 -0
  123. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +18 -0
  124. package/types/src/writer/emitters/PersonsEmitter.d.ts +17 -0
  125. package/types/src/writer/emitters/PivotTableEmitter.d.ts +45 -0
  126. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  127. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  128. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  129. package/types/src/writer/emitters/SlicerEmitter.d.ts +66 -0
  130. package/types/src/writer/emitters/StylesEmitter.d.ts +2 -2
  131. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  132. package/types/src/writer/emitters/ThreadedCommentsEmitter.d.ts +27 -0
  133. package/types/src/writer/emitters/WorkbookEmitter.d.ts +21 -3
  134. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  135. package/types/src/writer/utils/AutoFilter.d.ts +3 -3
  136. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  137. package/types/src/writer/utils/DefaultRows.d.ts +38 -0
  138. package/types/src/writer/utils/DrawMLUtils.d.ts +57 -3
  139. package/types/src/writer/utils/DummyFunction.d.ts +0 -2
  140. package/types/src/writer/utils/DxfCollector.d.ts +14 -11
  141. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +28 -0
  142. package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
  143. package/types/src/writer/utils/SheetStyleLayout.d.ts +73 -0
  144. package/types/src/writer/utils/TextUtils.d.ts +26 -2
  145. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  146. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  147. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  148. package/browser/cjs/BAtEL-5TLyoaPFDP.cjs +0 -2
  149. package/browser/cjs/Bg0e53JZa8vhmm5a.cjs +0 -1
  150. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  151. package/browser/cjs/CK5FFUvet6FnIYO_.cjs +0 -5
  152. package/browser/cjs/D5Y4KQhKdukOkjvA.cjs +0 -2
  153. package/browser/cjs/DV6LeTEiiFUrZoxj.cjs +0 -1
  154. package/browser/cjs/DWkuoJSgvcXJTdN1.cjs +0 -1
  155. package/browser/cjs/Db8YjGM6TG34c8aT.cjs +0 -1
  156. package/browser/cjs/index.cjs +0 -1
  157. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  158. package/browser/esm/4BWLu134ABlCQEtM.mjs +0 -3655
  159. package/browser/esm/BzQ_lPzc8C4OTIGZ.mjs +0 -99
  160. package/browser/esm/CJknI8BYGSZr-4zS.mjs +0 -52
  161. package/browser/esm/Cok_fBIUCHDSrKw0.mjs +0 -2211
  162. package/browser/esm/D-m_kQLaewdwuXaF.mjs +0 -2685
  163. package/browser/esm/Dj7D2nVdAZ3TiUks.mjs +0 -4743
  164. package/browser/esm/ijQzHH-bvDfUHIi1.mjs +0 -24
  165. package/node/esm/CF1R5ovFsRNu--Rw.mjs +0 -3744
  166. package/node/esm/Ctcl4jN52INWpKWC.mjs +0 -2255
  167. package/node/esm/CvnRSooxEQdlJgMn.mjs +0 -2766
  168. package/node/esm/DQd0vxzTaPt2qSL-.mjs +0 -108
  169. package/node/esm/ssSlRCbCqxvZ9IX8.mjs +0 -2481
  170. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  171. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  172. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  173. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  174. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  175. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  176. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  177. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  178. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  179. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  180. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
  181. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  182. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  183. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  184. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  185. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  186. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  187. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  188. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  189. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  190. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  191. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
@@ -1,3655 +0,0 @@
1
- /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.1
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 "./CJknI8BYGSZr-4zS.mjs";
8
- import { D as e, E as t, F as n, H as r, I as i, K as a, L as o, M as s, N as c, O as l, P as u, U as d, _ as f, a as p, b as m, f as h, g, h as _, i as v, k as y, l as b, n as x, s as S, u as ee, w as C, z as w } from "./Dj7D2nVdAZ3TiUks.mjs";
9
- import { AddressUtils as T, BufferUtils as E, Color as te, CommonUtils as D, CoordUtils as O, FormulaError as ne, IColor as k, ICondition as A, IConditionalFormat as j, IEffect as M, IFill as N, ISheet as P, IStroke as F, IStyle as I, ITextFrame as L, LicenseManager as re, NumberFormat as R, ScalarType as z } from "@sheetxl/sdk";
10
- var B = class {
11
- constructor(e) {
12
- this._kind = e.kind, this._contentType = e.contentType, this._relTypeUri = e.relTypeUri, this._path = e.path;
13
- }
14
- get kind() {
15
- return this._kind;
16
- }
17
- get contentType() {
18
- return this._contentType;
19
- }
20
- get relTypeUri() {
21
- return this._relTypeUri;
22
- }
23
- getPath(e) {
24
- return typeof this._path == "function" ? this._path(e) : this._path;
25
- }
26
- }, ie = class e {
27
- constructor(e, t, n) {
28
- this.zipWriter = e, this.outputKind = t, this.outWritable = n;
29
- }
30
- static createUint8Array(t) {
31
- let r = new y(new n(), t);
32
- return new e(r, "uint8array");
33
- }
34
- static createBlob(t) {
35
- let n = new y(new s("application/zip"), t);
36
- return new e(n, "blob");
37
- }
38
- static createWritableStream(t, n) {
39
- let r = new y(t, n);
40
- return new e(r, "writable", t);
41
- }
42
- async add(e, t, n) {
43
- let r = function(e) {
44
- let t = e.replace(/\\/g, "/").trim();
45
- for (; t.startsWith("/");) t = t.slice(1);
46
- return t;
47
- }(e), i = {
48
- level: n?.level,
49
- password: n?.password,
50
- encryptionStrength: n?.encryptionStrength,
51
- zipCrypto: n?.zipCrypto,
52
- lastModDate: n?.lastModDate,
53
- keepOrder: n?.keepOrder,
54
- uncompressedSize: n?.uncompressedSize,
55
- dataDescriptor: n?.dataDescriptor,
56
- passThrough: n?.passThrough,
57
- compressionMethod: n?.compressionMethod,
58
- signature: n?.signature
59
- };
60
- if (typeof t == "string") return void await this.zipWriter.add(r, new c(t), i);
61
- if (t instanceof Uint8Array || ArrayBuffer.isView(t) || t && typeof t.byteLength == "number" && typeof t.byteOffset == "number") {
62
- try {
63
- await this.zipWriter.add(r, new u(t), i);
64
- } catch (e) {
65
- throw console.log("Error adding Uint8Array source to zip:", r, i), e;
66
- }
67
- return;
68
- }
69
- let a = (o = t) && typeof o.getReader == "function" ? t : function(e) {
70
- let t = e[Symbol.asyncIterator]();
71
- return new ReadableStream({
72
- async pull(e) {
73
- let { value: n, done: r } = await t.next();
74
- r ? e.close() : e.enqueue(n);
75
- },
76
- async cancel(e) {
77
- if (typeof t.return == "function") try {
78
- await t.return(e);
79
- } catch {}
80
- }
81
- });
82
- }(t);
83
- var o;
84
- await this.zipWriter.add(r, a, i);
85
- }
86
- async close(e) {
87
- let t = e?.comment, n = await this.zipWriter.close(t, {});
88
- return this.outputKind === "writable" ? this.outWritable ?? n : n;
89
- }
90
- };
91
- function ae(e) {
92
- let t = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), n = (e) => t(e).replace(/"/g, "&quot;"), r = (e) => {
93
- if (!e) return "";
94
- let t = "";
95
- for (let [r, i] of Object.entries(e)) i !== void 0 && !1 !== i && (t += !0 === i ? ` ${r}="1"` : ` ${r}="${n(String(i))}"`);
96
- return t;
97
- }, i = new TextEncoder(), a = "", o = () => {
98
- a &&= (e.write(i.encode(a)), "");
99
- }, s = (e) => {
100
- a += e, a.length > 65536 && o();
101
- }, c = [], l = null, u = [], d = !0;
102
- return {
103
- decl() {
104
- s("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
105
- },
106
- pushDefaultNamespace(e) {
107
- c.push(e), l = e;
108
- },
109
- getDefaultNamespace: () => c.length > 0 ? c[c.length - 1] : null,
110
- popDefaultNamespace() {
111
- c.length > 0 && (c.pop(), l = c.length > 0 ? c[c.length - 1] : null);
112
- },
113
- start(e, t) {
114
- d && u.push({
115
- tag: e,
116
- attrs: t,
117
- bufferPos: a.length
118
- });
119
- let n = e;
120
- l && e.indexOf(":") === -1 && (n = `${l}:${e}`), s(`<${n}${r(t)}>`);
121
- },
122
- empty(e, t) {
123
- let n = e;
124
- l && e.indexOf(":") === -1 && (n = `${l}:${e}`), s(`<${n}${r(t)}/>`);
125
- },
126
- text(e) {
127
- s(t(String(e)));
128
- },
129
- raw(e) {
130
- s(e);
131
- },
132
- end(e) {
133
- let t;
134
- if (d) {
135
- if (u.length === 0) throw Error(`XML Writer: Unexpected end tag </${e}> - no matching start tag`);
136
- if (t = u[u.length - 1], t.tag !== e) throw Error(`XML Writer: End tag </${e}> does not match start tag <${t.tag}>`);
137
- }
138
- let n = e;
139
- if (l && e.indexOf(":") === -1 && (n = `${l}:${e}`), d) {
140
- let e = a.length, i = `<${n}${r(t.attrs)}>`.length;
141
- e === t.bufferPos + i ? (a = a.slice(0, t.bufferPos), s(`<${n}${r(t.attrs)}/>`)) : s(`</${n}>`), u.pop();
142
- } else s(`</${n}>`);
143
- },
144
- close() {
145
- o();
146
- },
147
- setValidationDisabled(e) {
148
- d = !e;
149
- }
150
- };
151
- }
152
- function oe(e) {
153
- switch (e.kind) {
154
- case "bytes": return e.bytes;
155
- case "text": return e.text;
156
- case "stream": return e.stream;
157
- case "xmlStream": {
158
- let t = [], n = ae({ write: (e) => t.push(e) });
159
- return e.writeXml(n), n.close(), function(e) {
160
- let t = 0;
161
- for (let n of e) t += n.byteLength;
162
- let n = new Uint8Array(t), r = 0;
163
- for (let t of e) n.set(t, r), r += t.byteLength;
164
- return n;
165
- }(t);
166
- }
167
- case "xmlStreamed": return e.write();
168
- }
169
- }
170
- function se(e) {
171
- let t = V(e);
172
- if (!t) return "_rels/.rels";
173
- let n = t.lastIndexOf("/"), r = n >= 0 ? t.slice(0, n) : "";
174
- return `${r ? `${r}/_rels` : "_rels"}/${n >= 0 ? t.slice(n + 1) : t}.rels`;
175
- }
176
- function V(e) {
177
- let t = (e ?? "").replace(/\\/g, "/").trim();
178
- for (; t.startsWith("/");) t = t.slice(1);
179
- return t;
180
- }
181
- function ce(e) {
182
- let t = /^rId(\d+)$/.exec(e);
183
- return t ? parseInt(t[1], 10) : 2 ** 53 - 1;
184
- }
185
- function H(e) {
186
- return String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/>/g, "&gt;");
187
- }
188
- function le(e, t, n, r = !1) {
189
- let i = t;
190
- if (t.startsWith("/")) i = t.slice(1);
191
- else {
192
- if (!e) throw Error(`Relative path "${t}" cannot be used at root level. Use an absolute path starting with "/" (e.g., "/xl/workbook.xml").`);
193
- i = (e.includes("/") ? e.slice(0, e.lastIndexOf("/") + 1) : "") + t;
194
- }
195
- if (i = ue(i), !i.includes("{n}")) {
196
- if (!r && n.has(i)) throw Error(`Path already existing path: ${i}`);
197
- return i;
198
- }
199
- let a, o = 1;
200
- do
201
- if (a = i.replace(/{n}/g, String(o)), o++, o > 1e4) throw Error(`Failed to resolve path template "${t}" after 10000 attempts. This likely indicates a bug or an impossible constraint.`);
202
- while (n.has(a));
203
- return a;
204
- }
205
- function ue(e) {
206
- let t = e.split("/"), n = [];
207
- for (let r of t) if (r !== "" && r !== ".") if (r === "..") {
208
- if (n.length === 0) throw Error(`Invalid path: too many ".." segments in "${e}"`);
209
- n.pop();
210
- } else n.push(r);
211
- return n.join("/");
212
- }
213
- function de(e, t) {
214
- if (!e) return t;
215
- let n = e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "", r = n ? n.split("/") : [], i = t.split("/"), a = 0, o = Math.min(r.length, i.length - 1);
216
- for (let e = 0; e < o && r[e] === i[e]; e++) a++;
217
- let s = r.length - a;
218
- return "../".repeat(s) + i.slice(a).join("/");
219
- }
220
- function fe(e) {
221
- return new TextEncoder().encode(e);
222
- }
223
- function pe(e, t) {
224
- return function(e, t = " ") {
225
- let n = "", r = 0, i = e.split(/(<[^>]+>)/g).filter(Boolean);
226
- for (let e = 0; e < i.length; e++) {
227
- let a = i[e];
228
- if (a.trim()) if (a.startsWith("<?")) n += a + "\n";
229
- else if (a.startsWith("</")) r--, r < 0 && console.warn(`XML formatting warning: negative indentation depth: ${a}`), n += t.repeat(Math.max(r, 0)) + a + "\n";
230
- else if (a.startsWith("<")) {
231
- let e = a.endsWith("/>");
232
- n += t.repeat(r) + a + "\n", e || r++;
233
- } else n += t.repeat(r) + a.trim() + "\n";
234
- }
235
- return n;
236
- }(function(e) {
237
- return new TextDecoder("utf-8").decode(e);
238
- }(e), t);
239
- }
240
- var me = /&(amp|lt|gt|quot|apos|#x[0-9a-fA-F]+|#[0-9]+);/g;
241
- function he(e, t) {
242
- switch (t) {
243
- case "amp": return "&";
244
- case "lt": return "<";
245
- case "gt": return ">";
246
- case "quot": return "\"";
247
- case "apos": return "'";
248
- default: return t.startsWith("#x") ? String.fromCodePoint(parseInt(t.slice(2), 16)) : t.startsWith("#") ? String.fromCodePoint(parseInt(t.slice(1), 10)) : e;
249
- }
250
- }
251
- function ge(e) {
252
- return e.replace(me, he);
253
- }
254
- function _e(e) {
255
- let t = {}, n = /([A-Za-z_:][-A-Za-z0-9_:.]*)\s*=\s*"([^"]*)"/g, r;
256
- for (; r = n.exec(e);) t[r[1]] = ge(r[2]);
257
- return t;
258
- }
259
- function ve(e, t) {
260
- let n = [], r = RegExp(`<${t}\\b([^>]*)/?>`, "g"), i;
261
- for (; i = r.exec(e);) n.push(_e(i[1]));
262
- return n;
263
- }
264
- function ye(e) {
265
- return ve(new TextDecoder("utf-8").decode(e), "Relationship").filter((e) => e.Type && e.Target).map((e) => ({
266
- type: e.Type,
267
- target: e.Target,
268
- external: e.TargetMode === "External"
269
- }));
270
- }
271
- var be = class {
272
- constructor(e) {
273
- this.rels = [], this.usedIds = /* @__PURE__ */ new Set(), this.nextId = 1, this.sourcePart = V(e);
274
- }
275
- add(e, t, n) {
276
- let r = n?.idHint && !this.usedIds.has(n.idHint) ? n.idHint : void 0;
277
- if (!r) do
278
- r = "rId" + this.nextId++;
279
- while (this.usedIds.has(r));
280
- let i = /^rId(\d+)$/.exec(r);
281
- return i && (this.nextId = Math.max(this.nextId, parseInt(i[1], 10) + 1)), this.usedIds.add(r), this.rels.push({
282
- id: r,
283
- type: e,
284
- target: t,
285
- targetMode: n?.external ? "External" : void 0
286
- }), r;
287
- }
288
- list() {
289
- return this.rels;
290
- }
291
- toXmlBytes() {
292
- let e = [...this.rels].sort((e, t) => ce(t.id) - ce(e.id) || e.id.localeCompare(t.id)), t = [];
293
- t.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), t.push(`<Relationships xmlns="${xe}">`);
294
- for (let n of e) {
295
- let e = [
296
- `Id="${H(n.id)}"`,
297
- `Type="${H(n.type)}"`,
298
- `Target="${H(n.target)}"`
299
- ];
300
- n.targetMode === "External" && e.push("TargetMode=\"External\""), t.push(`<Relationship ${e.join(" ")}/>`);
301
- }
302
- return t.push("</Relationships>"), fe(t.join(""));
303
- }
304
- }, xe = "http://schemas.openxmlformats.org/package/2006/relationships", Se = class {
305
- constructor() {
306
- this._defaultsSet = /* @__PURE__ */ new Set(), this._overridesSet = /* @__PURE__ */ new Set(), this._defaults = [], this._overrides = [];
307
- }
308
- addDefault(e, t) {
309
- let n = function(e) {
310
- let t = (e ?? "").trim().toLowerCase();
311
- return t.startsWith(".") && (t = t.slice(1)), t;
312
- }(e);
313
- this._defaultsSet.has(n) || (this._defaultsSet.add(n), this._defaults.push({
314
- key: n,
315
- content: t
316
- }));
317
- }
318
- addOverride(e, t) {
319
- let n = function(e) {
320
- let t = (e ?? "").replace(/\\/g, "/").trim();
321
- return t.startsWith("/") || (t = "/" + t), t;
322
- }(e);
323
- this._overridesSet.has(n) || (this._overridesSet.add(n), this._overrides.push({
324
- key: n,
325
- content: t
326
- }));
327
- }
328
- toXmlBytes() {
329
- let e = [];
330
- e.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), e.push(`<Types xmlns="${Ce}">`);
331
- let t = this._defaults.reverse();
332
- this.addDefault("rels", "application/vnd.openxmlformats-package.relationships+xml"), this.addDefault("xml", "application/xml");
333
- for (let { key: n, content: r } of t) e.push(`<Default Extension="${H(n)}" ContentType="${H(r)}"/>`);
334
- let n = this._overrides;
335
- for (let { key: t, content: r } of n) e.push(`<Override PartName="${H(t)}" ContentType="${H(r)}"/>`);
336
- return e.push("</Types>"), fe(e.join(""));
337
- }
338
- }, Ce = "http://schemas.openxmlformats.org/package/2006/content-types", we = class {
339
- constructor(e) {
340
- this.parts = [], this.relsRoot = new be(""), this.relsByPart = /* @__PURE__ */ new Map(), this.contentTypes = new Se(), this.zip = e;
341
- }
342
- addContentType(e, t) {
343
- let n = V(e);
344
- this.contentTypes.addOverride("/" + n, t);
345
- }
346
- addDefaultType(e, t) {
347
- this.contentTypes.addDefault(e, t);
348
- }
349
- addPart(e, t, n, r) {
350
- let i = V(e);
351
- this.parts.push({
352
- path: i,
353
- body: t,
354
- optionsZip: r
355
- }), n && this.contentTypes.addOverride("/" + i, n);
356
- }
357
- rels(e) {
358
- let t = V(e || "");
359
- if (!t) return this.relsRoot;
360
- let n = this.relsByPart.get(t);
361
- return n || (n = new be(t), this.relsByPart.set(t, n)), n;
362
- }
363
- async emit() {
364
- let e = [...this.parts].sort((e, t) => e.path.localeCompare(t.path));
365
- for (let t of e) {
366
- let e = oe(t.body);
367
- await this.zip.add(t.path, e, t.optionsZip);
368
- }
369
- let t = this.relsRoot.toXmlBytes();
370
- await this.zip.add("_rels/.rels", t, {});
371
- let n = [...this.relsByPart.values()].sort((e, t) => e.sourcePart.localeCompare(t.sourcePart));
372
- for (let e of n) {
373
- let t = se(e.sourcePart), n = e.toXmlBytes();
374
- await this.zip.add(t, n, {});
375
- }
376
- let r = this.contentTypes.toXmlBytes();
377
- await this.zip.add("[Content_Types].xml", r, {});
378
- }
379
- async build(e) {
380
- return await this.emit(), await this.zip.close(e);
381
- }
382
- }, Te = /* @__PURE__ */ new Set(["xl/calcChain.xml"]), Ee = [
383
- /^xl\/drawings\/vmlDrawing\d+\.vml$/i,
384
- /^xl\/ctrlProps\//i,
385
- /^xl\/slicers\//i,
386
- /^xl\/slicerCaches\//i,
387
- /^xl\/pivotCache\//i,
388
- /^xl\/pivotTables\//i
389
- ];
390
- function De(e) {
391
- return Ee.some((t) => t.test(e));
392
- }
393
- function Oe(e) {
394
- return e === "[Content_Types].xml" || ke.test(e);
395
- }
396
- var ke = /^(?:(.*)\/)?_rels\/(.*)\.rels$/;
397
- function Ae(e) {
398
- if (e === "_rels/.rels") return "";
399
- let t = ke.exec(e);
400
- if (!t) return null;
401
- let n = t[1] ?? "", r = t[2];
402
- return n ? `${n}/${r}` : r;
403
- }
404
- var je = class {
405
- constructor(e, t, n) {
406
- 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 we(e), this._registry = t, this._options = n ?? {}, this._mapState = this._options.mapState ?? /* @__PURE__ */ new Map(), this._sourcePackage = this._options.sourcePackage ?? null;
407
- }
408
- async waitEmit() {
409
- let e = this._queue;
410
- for (; e.length;) {
411
- let t = e.shift();
412
- await this._processPart(t);
413
- }
414
- }
415
- async build(e) {
416
- return await this.waitEmit(), this._passthroughSourceParts(), await this._partWriter.build(e ?? {});
417
- }
418
- _passthroughSourceParts() {
419
- let e = this._sourcePackage;
420
- if (!e) return;
421
- let t = new Set(this._writtenPaths), n = e.hasStructuralChange(), r = [];
422
- for (let i of e.getNames()) t.has(i) || Te.has(i) || Oe(i) || n && De(i) || r.push(i);
423
- let i = new Set(t);
424
- for (let e of r) i.add(e);
425
- let a = e.getPart("[Content_Types].xml"), o = a ? function(e) {
426
- let t = new TextDecoder("utf-8").decode(e), n = ve(t, "Default").map((e) => ({
427
- ext: (e.Extension ?? "").toLowerCase(),
428
- contentType: e.ContentType ?? ""
429
- })).filter((e) => e.ext && e.contentType), r = /* @__PURE__ */ new Map();
430
- for (let e of ve(t, "Override")) e.PartName && e.ContentType && r.set(e.PartName, e.ContentType);
431
- return {
432
- defaults: n,
433
- overrides: r
434
- };
435
- }(a.data) : null;
436
- if (o) for (let { ext: e, contentType: t } of o.defaults) this._partWriter.addDefaultType(e, t);
437
- for (let t of r) {
438
- let n = e.getPart(t), r = o?.overrides.get("/" + t);
439
- n.raw ? this._partWriter.addPart(t, {
440
- kind: "bytes",
441
- bytes: n.raw.compressedData
442
- }, r, {
443
- passThrough: !0,
444
- compressionMethod: n.raw.compressionMethod,
445
- signature: n.raw.signature,
446
- uncompressedSize: n.uncompressedSize
447
- }) : this._partWriter.addPart(t, {
448
- kind: "bytes",
449
- bytes: n.data
450
- }, r), this._writtenPaths.add(t);
451
- }
452
- for (let n of e.getNames()) {
453
- if (n === "[Content_Types].xml" || !Oe(n)) continue;
454
- let r = Ae(n);
455
- r !== null && (r === "" || i.has(r)) && this._mergeSourceRelsInto(r, e.getPart(n).data, t, i);
456
- }
457
- }
458
- _mergeSourceRelsInto(e, t, n, r) {
459
- let i = this._partWriter.rels(e), a = e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "";
460
- for (let o of ye(t)) {
461
- if (o.external) {
462
- i.add(o.type, o.target, { external: !0 });
463
- continue;
464
- }
465
- let t = ue((a ? a + "/" : "") + o.target);
466
- n.has(t) || this._explicitRelTargets.has(`${e}::${t}`) || (r.has(t) ? i.add(o.type, o.target) : this._registry.ownsRelType(o.type) || console.warn(`Dropping preserved relationship to missing part '${t}'`, e || "(root)"));
467
- }
468
- }
469
- addPart(e, t, n) {
470
- return this._addPartInternal("", e, t, n);
471
- }
472
- _addPartInternal(e, t, n, r) {
473
- let i = this._registry.get(t);
474
- if (!i) throw Error(`No emitter registered for kind '${t}'.`);
475
- let a = r ?? i.getPath?.(n);
476
- if (!a) throw Error("No path provided in either argument or emitter.");
477
- let o = this._writtenPaths, s = le(e, a, o), c = `${t}:${s}`, l = this._scheduledByNodeKey.get(c);
478
- if (!l) {
479
- let e, r = new Promise((t) => {
480
- e = t;
481
- });
482
- l = {
483
- kind: t,
484
- key: c,
485
- payload: n,
486
- path: s,
487
- contentType: i.contentType,
488
- promise: r,
489
- resolve: e
490
- }, this._scheduledByNodeKey.set(c, l), this._queue.push(l);
491
- }
492
- let u = this._nodesByPath.get(e);
493
- u || (u = /* @__PURE__ */ new Set(), this._nodesByPath.set(e, u)), u.add(c), !i.contentType || i.relTypeUri || e || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", s);
494
- let d = null;
495
- if (i.relTypeUri) {
496
- let t = de(e, l.path);
497
- d = this._partWriter.rels(e).add(i.relTypeUri, t);
498
- }
499
- return o.add(s), {
500
- path: s,
501
- contentTypeUri: i.contentType,
502
- relId: d
503
- };
504
- }
505
- addBinary(e, t, n, r, i = !1) {
506
- return this._addBinaryInternal("", e, t, n, r, i);
507
- }
508
- _addBinaryInternal(e, t, n, r, i, a = !1) {
509
- if (!i) throw Error("No path provided for binary.");
510
- if (!n) throw Error("No content type provided for binary.");
511
- let o = this._writtenPaths, s = le(e, i, o, a), c = null;
512
- if (r) {
513
- let t = de(e, s);
514
- c = this._partWriter.rels(e).add(r, t);
515
- }
516
- if (e || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", s), !o.has(s)) {
517
- let e = s.split(".").pop() || "";
518
- e && this._partWriter.addDefaultType(e, n), this._partWriter.addPart(s, {
519
- kind: "bytes",
520
- bytes: t
521
- }, void 0, {
522
- level: 0,
523
- uncompressedSize: t.byteLength,
524
- dataDescriptor: !1
525
- }), o.add(s);
526
- }
527
- return {
528
- path: s,
529
- contentTypeUri: n,
530
- relId: c
531
- };
532
- }
533
- _forkPreservedPart(e, t, n, r, i) {
534
- let a = this._sourcePackage;
535
- if (!a) return null;
536
- let o = a.getPart(t);
537
- if (!o) return null;
538
- let s = new Set(this._writtenPaths);
539
- for (let e of a.getNames()) s.add(e);
540
- let c = le(e, i, s), l = this._addBinaryInternal(e, o.data, n, r, "/" + c), u = a.getPart(se(t));
541
- if (u) {
542
- let e = this._partWriter.rels(l.path);
543
- for (let t of ye(u.data)) e.add(t.type, t.target, t.external ? { external: !0 } : void 0);
544
- }
545
- return l;
546
- }
547
- async _waitForDescendants(e) {
548
- let t = this._nodesByPath.get(e);
549
- if (!t || t.size === 0) return;
550
- let n = [];
551
- for (let e of t) {
552
- let t = this._scheduledByNodeKey.get(e);
553
- if (t) {
554
- let e = this._processPart(t);
555
- n.push(e);
556
- }
557
- }
558
- await Promise.all(n);
559
- }
560
- async _processPart(e) {
561
- if (e.processed) return e.promise;
562
- e.processed = !0;
563
- let t = this._registry.get(e.kind), n = e.path;
564
- this._partWriter.addContentType(e.path, e.contentType);
565
- try {
566
- let r = [], i = { write: (e) => {
567
- r.push(e);
568
- } }, a;
569
- await t.emit(e.payload, {
570
- getXMLWriter: () => a || (a = ae(i), a),
571
- addPart: (e, t, r) => this._addPartInternal(n, e, t, r),
572
- addBinary: (e, t, r, i, a = !1) => this._addBinaryInternal(n, e, t, r, i, a),
573
- addExternal: (e, t) => ({
574
- path: t,
575
- contentTypeUri: null,
576
- relId: this._partWriter.rels(n).add(e, t, { external: !0 })
577
- }),
578
- addPreservedRelationship: (e, t, r) => {
579
- let i = de(n, t), a = this._partWriter.rels(n).add(e, i, { idHint: r });
580
- return this._explicitRelTargets.add(`${n}::${t}`), a;
581
- },
582
- forkPreservedPart: (e, t, r, i) => this._forkPreservedPart(n, e, t, r, i),
583
- waitEmit: () => this._waitForDescendants(e.path),
584
- getPath: () => e.path,
585
- getSharedStates: () => this._mapState,
586
- warn: (e, t) => {
587
- console.warn(e, t);
588
- }
589
- });
590
- let o = function(e) {
591
- let t = 0;
592
- for (let n of e) t += n.byteLength;
593
- let n = new Uint8Array(t), r = 0;
594
- for (let t of e) n.set(t, r), r += t.byteLength;
595
- return n;
596
- }(r), s = this._options.onPartEmitted;
597
- s && await s(e.kind, e.path, o), Me && (console.log(`\n=== ${e.path} ===`), console.log(pe(o))), this._partWriter.addPart(e.path, {
598
- kind: "bytes",
599
- bytes: o
600
- }, e.contentType);
601
- } catch (t) {
602
- throw this._options.onPartError?.(e.kind, e.path, t), t;
603
- } finally {
604
- this._nodesByPath.delete(e.path), this._scheduledByNodeKey.delete(e.key), e.resolve();
605
- }
606
- }
607
- }, Me = !1, Ne = class {
608
- constructor() {
609
- this.map = /* @__PURE__ */ new Map();
610
- }
611
- register(e) {
612
- if (this.map.has(e.kind)) throw Error(`Duplicate part kind: ${e.kind}`);
613
- this.map.set(e.kind, e);
614
- }
615
- get(e) {
616
- let t = this.map.get(e);
617
- if (!t) throw Error(`Unknown part kind: ${e}`);
618
- return t;
619
- }
620
- has(e) {
621
- return this.map.has(e);
622
- }
623
- ownsRelType(e) {
624
- for (let t of this.map.values()) if (t.relTypeUri === e) return !0;
625
- return !1;
626
- }
627
- };
628
- function Pe(e, t, n) {
629
- e && (e.algorithm && (t[n ? `${n}AlgorithmName` : "algorithmName"] = e.algorithm), e.hash && (t[n ? `${n}HashValue` : "hashValue"] = e.hash), e.salt && (t[n ? `${n}SaltValue` : "saltValue"] = e.salt), e.spinCount !== void 0 && (t[n ? `${n}SpinCount` : "spinCount"] = e.spinCount));
630
- }
631
- var Fe = class {
632
- constructor() {
633
- this._daprFMBks = [], this._daprFMBkMap = /* @__PURE__ */ new Map(), this._rvFMBks = [], this._rvFMBkMap = /* @__PURE__ */ new Map(), this._valueMeta = [];
634
- }
635
- registerArrayCell(e) {
636
- let t = +!!e, n = `1,${t}`, r = this._daprFMBkMap.get(n);
637
- return r === void 0 && (r = this._daprFMBks.length, this._daprFMBks.push({
638
- fDynamic: 1,
639
- fCollapsed: t
640
- }), this._daprFMBkMap.set(n, r)), r + 1;
641
- }
642
- registerRichValueCell(e) {
643
- let t = this._rvFMBkMap.get(e);
644
- t === void 0 && (t = this._rvFMBks.length, this._rvFMBks.push(e), this._rvFMBkMap.set(e, t));
645
- let n = this._valueMeta.length;
646
- return this._valueMeta.push(t), n + 1;
647
- }
648
- hasCellMeta() {
649
- return this._daprFMBks.length > 0;
650
- }
651
- hasValueMeta() {
652
- return this._valueMeta.length > 0;
653
- }
654
- hasAny() {
655
- return this.hasCellMeta() || this.hasValueMeta();
656
- }
657
- getDAPRFutureMetadataBlocks() {
658
- return this._daprFMBks;
659
- }
660
- getRVFutureMetadataBlocks() {
661
- return this._rvFMBks;
662
- }
663
- getValueMeta() {
664
- return this._valueMeta;
665
- }
666
- }, Ie = class {
667
- constructor(e, t = console.warn) {
668
- this._entries = [], this._keyMap = /* @__PURE__ */ new Map(), this._metaCollector = e, this._onWarn = t;
669
- }
670
- add(e) {
671
- if (e == null) return this._onWarn?.("RichValueCollector.add: null/undefined value — falling back to #UNKNOWN!"), this._registerFallback();
672
- if (ne.isError(e)) {
673
- let t = e.getCode(), n = this._register(`_error:${t}`, { errorType: "" + (t - 1) }, Le);
674
- return this._metaCollector.registerRichValueCell(n);
675
- }
676
- return e.isIRichData && e.getType(), this._onWarn?.("RichValueCollector.add: unsupported rich value type — falling back to #UNKNOWN!", e), this._registerFallback();
677
- }
678
- _registerFallback() {
679
- let e = this._register("_error:fallback", { errorType: ne.Code.Unknown - 1 }, Le);
680
- return this._metaCollector.registerRichValueCell(e);
681
- }
682
- _register(e, t, n) {
683
- let r = this._keyMap.get(e);
684
- return r === void 0 && (r = this._entries.length, this._entries.push({
685
- handler: n,
686
- rawValue: t
687
- }), this._keyMap.set(e, r)), r;
688
- }
689
- getCount() {
690
- return this._entries.length;
691
- }
692
- hasAny() {
693
- return this._entries.length > 0;
694
- }
695
- getEntries() {
696
- return this._entries;
697
- }
698
- uniqueHandlers() {
699
- let e = /* @__PURE__ */ new Set(), t = [];
700
- for (let n of this._entries) e.has(n.handler) || (e.add(n.handler), t.push(n.handler));
701
- return t;
702
- }
703
- handlerStructureIndex(e) {
704
- let t = 0, n = /* @__PURE__ */ new Set();
705
- for (let r of this._entries) if (!n.has(r.handler)) {
706
- if (r.handler === e) return t;
707
- n.add(r.handler), t++;
708
- }
709
- return -1;
710
- }
711
- }, Le = new class {
712
- constructor(e, t) {
713
- this.type = e, this.props = t;
714
- }
715
- getValues(e) {
716
- return this.props.map(([t, , n = ""]) => {
717
- let r = e?.[t];
718
- return r == null ? n : "" + r;
719
- });
720
- }
721
- }("_error", [[
722
- "errorType",
723
- "i",
724
- ""
725
- ], [
726
- "subType",
727
- "i",
728
- "0"
729
- ]]), Re = {
730
- auto: "auto",
731
- automaticExceptTables: "autoNoTable",
732
- manual: "manual"
733
- };
734
- function U(e, t, n, r) {
735
- if (!n) return;
736
- let i = typeof n == "string" ? t.parseColor(n) : n;
737
- r && e.start(r);
738
- let a = i.getType(), o = i.getVal(), s = i.getAdjustments(), c = s && s.length > 0;
739
- switch (a) {
740
- case "scheme":
741
- c ? (e.start("schemeClr", { val: o }), W(e, s), e.end("schemeClr")) : e.empty("schemeClr", { val: o });
742
- break;
743
- case "named":
744
- if (te.isSystem(o)) {
745
- let t = i.getLastColor() ?? i.getBaseColor().toHex().toString(!1).replace("#", "");
746
- c ? (e.start("sysClr", {
747
- val: o,
748
- lastClr: t
749
- }), W(e, s), e.end("sysClr")) : e.empty("sysClr", {
750
- val: o,
751
- lastClr: t
752
- });
753
- } else c ? (e.start("prstClr", { val: o }), W(e, s), e.end("prstClr")) : e.empty("prstClr", { val: o });
754
- break;
755
- case "auto": {
756
- let t = i.getLastColor() ?? i.getBaseColor().toHex().toString(!1).replace("#", "");
757
- c ? (e.start("sysClr", {
758
- val: "windowText",
759
- lastClr: t
760
- }), W(e, s), e.end("sysClr")) : e.empty("sysClr", {
761
- val: "windowText",
762
- lastClr: t
763
- });
764
- break;
765
- }
766
- case "index":
767
- c ? (e.start("srgbClr", { val: o }), W(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: o });
768
- break;
769
- case "hsl":
770
- let t = i.toHex().toString();
771
- c ? (e.start("srgbClr", { val: t }), W(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: t });
772
- break;
773
- case "rgb":
774
- case "lrgb":
775
- let n = i.toHex().toString();
776
- c ? (e.start("srgbClr", { val: n }), W(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: n });
777
- break;
778
- case "hex":
779
- let r = o.replace("#", "").toUpperCase();
780
- c ? (e.start("srgbClr", { val: r }), W(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: r });
781
- break;
782
- default:
783
- let a = o.replace("#", "").toUpperCase();
784
- e.empty("srgbClr", { val: a });
785
- }
786
- r && e.end(r);
787
- }
788
- function W(e, t) {
789
- if (t && t.length !== 0) for (let n of t) for (let [t, r] of Object.entries(n)) {
790
- if (r == null) continue;
791
- let n = t;
792
- if (n) if (typeof r == "boolean") e.empty(n);
793
- else {
794
- let i;
795
- if (t === "alpha" || t === "alphaOff" || t === "alphaMod") i = Math.round(1e5 * r);
796
- else {
797
- if (t === "eTint") {
798
- if (r < 0) {
799
- e.empty("shade", { val: Math.round(1e5 * (1 + r)).toString() });
800
- continue;
801
- }
802
- e.empty("tint", { val: Math.round(1e5 * r).toString() });
803
- continue;
804
- }
805
- i = Math.round(1e3 * r);
806
- }
807
- e.empty(n, { val: i.toString() });
808
- }
809
- }
810
- }
811
- function G(e, t, n, r, i = !1, a = !1) {
812
- if (!n) return;
813
- let o = typeof n == "string" ? t.parseColor(n) : n, s = () => {
814
- e.empty(r, { rgb: Ke(o.toHex().toString(!0)) });
815
- }, c = o.getAdjustments(), l = c && c.length > 0, u = o.getType();
816
- if (u !== k.Type.Auto) {
817
- if (u === k.Type.Scheme) {
818
- let t = o.getVal(), n = ze[t] ?? t, i = He.get(n);
819
- if (i === void 0 && n !== "phClr") return console.warn(`Color scheme not in theme. schemeVal=${t} themeKey=${n}`), s();
820
- let a = {};
821
- if (a.theme = i, l) {
822
- if (!function(e) {
823
- for (let t of e) switch (Object.keys(t)[0]) {
824
- case k.AdjustmentType.Tint:
825
- case k.AdjustmentType.ETint:
826
- case k.AdjustmentType.Shade:
827
- case k.AdjustmentType.Lum:
828
- case k.AdjustmentType.LumOff:
829
- case k.AdjustmentType.LumMod:
830
- case k.AdjustmentType.Alpha:
831
- case k.AdjustmentType.AlphaOff:
832
- case k.AdjustmentType.AlphaMod: continue;
833
- default: return !1;
834
- }
835
- return !0;
836
- }(c)) return s();
837
- let e = c.length === 1 ? c[0][k.AdjustmentType.ETint] : void 0, t;
838
- if (e !== void 0) t = We(e);
839
- else {
840
- let e = o.getBaseColor().toHex().toString(!0), n = o.toHex().toString(!0);
841
- t = We(function(e, t) {
842
- let n = Ue(e, 0, 255), r = Ue(t, 0, 255);
843
- return Math.abs(r - n) < 1e-9 ? 0 : r < n ? n <= 1e-9 ? -1 : Ue(r / n - 1, -1, 0) : 255 - n <= 1e-9 ? 0 : Ue((r - n) / (255 - n), 0, 1);
844
- }(Ge(e), Ge(n)));
845
- }
846
- t !== 0 && (a.tint = t);
847
- }
848
- e.empty(r, a);
849
- return;
850
- }
851
- if (u === k.Type.Index) {
852
- let t = o.getVal(), n = t.substring(5, t.length);
853
- e.empty(r, { indexed: Number(n) });
854
- return;
855
- }
856
- return s();
857
- }
858
- e.empty(r, { auto: 1 });
859
- }
860
- var ze = {
861
- bg1: "lt1",
862
- tx1: "dk1",
863
- bg2: "lt2",
864
- tx2: "dk2",
865
- accent1: "accent1",
866
- accent2: "accent2",
867
- accent3: "accent3",
868
- accent4: "accent4",
869
- accent5: "accent5",
870
- accent6: "accent6",
871
- hlink: "hlink",
872
- folHlink: "folHlink"
873
- }, Be = Object.freeze([
874
- "lt1",
875
- "dk1",
876
- "lt2",
877
- "dk2",
878
- "accent1",
879
- "accent2",
880
- "accent3",
881
- "accent4",
882
- "accent5",
883
- "accent6",
884
- "hlink",
885
- "folHlink"
886
- ]), Ve = Object.freeze([
887
- "dk1",
888
- "lt1",
889
- "dk2",
890
- "lt2",
891
- "accent1",
892
- "accent2",
893
- "accent3",
894
- "accent4",
895
- "accent5",
896
- "accent6",
897
- "hlink",
898
- "folHlink"
899
- ]), He = new Map(Be.map((e, t) => [e, t]));
900
- function Ue(e, t, n) {
901
- return Math.max(t, Math.min(n, e));
902
- }
903
- function We(e) {
904
- let t = Ue(e, -1, 1);
905
- return Math.abs(t) < 1e-12 ? 0 : t;
906
- }
907
- function Ge(e) {
908
- let t = function(e) {
909
- let t = e.replace(/^#/, "").toUpperCase();
910
- if (t.length === 8) return t.slice(2);
911
- if (t.length === 6) return t;
912
- throw Error(`Invalid hex: ${e}`);
913
- }(e), n = parseInt(t.slice(0, 2), 16) / 255, r = parseInt(t.slice(2, 4), 16) / 255, i = parseInt(t.slice(4, 6), 16) / 255;
914
- return (Math.max(n, r, i) + Math.min(n, r, i)) / 2 * 255;
915
- }
916
- function Ke(e) {
917
- let t = e.replace(/^#/, "").toUpperCase();
918
- if (t.length === 8) return t;
919
- if (t.length === 6) return "FF" + t;
920
- throw Error(`Invalid hex: ${e}`);
921
- }
922
- function qe(e, t = !1) {
923
- let n = e;
924
- return n.length === 8 && (n = n.substring(2, 8)), n.length === 6 && (n = (t ? "00" : "FF") + n), n.toUpperCase();
925
- }
926
- function K(e, t, n, r, i = !1, a = !1) {
927
- let o = r.getTheme();
928
- if (i && t.start("fill"), typeof n == "string" && (n = {
929
- type: N.Type.Solid,
930
- color: n
931
- }), n.type === N.Type.None) i ? t.empty("patternFill", { patternType: "none" }) : t.empty("noFill");
932
- else if (n.type === N.Type.Solid) {
933
- let e = n;
934
- i ? t.start("patternFill", { patternType: "solid" }) : t.start("solidFill"), e.color && (i ? G(t, o, e.color, "fgColor") : U(t, o, e.color)), i ? t.end("patternFill") : t.end("solidFill");
935
- } else if (n.type === N.Type.Pattern) {
936
- let e = n, r = e.patternType || "solid";
937
- t.start("patternFill", { patternType: r }), e.foreground && (i ? G(t, o, a ? e.background : e.foreground, "fgColor") : U(t, o, a ? e.background : e.foreground)), e.background && (i ? G(t, o, a ? e.foreground : e.background, "bgColor") : U(t, o, a ? e.foreground : e.background)), t.end("patternFill");
938
- } else if (n.type === N.Type.Gradient && i) {
939
- let e = n, r = {}, i = e.gradientType;
940
- if (i !== N.GradientType.Path && i !== N.GradientType.Linear || (r.type = i), e.angle !== void 0) {
941
- let t = (e.angle - 90) % 360;
942
- t !== 0 && (r.degree = String(t));
943
- }
944
- let a = e.focus;
945
- a && (a.left && (r.left = String(a.left)), a.right && (r.right = String(a.right)), a.top && (r.top = String(a.top)), a.bottom && (r.bottom = String(a.bottom))), t.start("gradientFill", r);
946
- let s = e.stops;
947
- if (s && s.length > 0) for (let e of s) {
948
- let n, r = 0;
949
- if (typeof e == "string" || typeof e == "object" && !("offset" in e)) n = e, r = 0;
950
- else {
951
- let t = e;
952
- r = t.offset || 0, n = t.color;
953
- }
954
- t.start("stop", { position: String(r) }), n && G(t, o, n, "color"), t.end("stop");
955
- }
956
- t.end("gradientFill");
957
- } else if (n.type === N.Type.Gradient) {
958
- let e = n, r = {};
959
- e.isRotatedWithShape !== void 0 && (r.rotWithShape = e.isRotatedWithShape ? "1" : "0"), t.start("gradFill", r), t.start("gsLst");
960
- let i = e.stops;
961
- if (i && i.length > 0) for (let e of i) {
962
- let n, r = 0;
963
- if (typeof e == "string" || typeof e == "object" && !("offset" in e)) n = e;
964
- else {
965
- let t = e;
966
- r = t.offset || 0, n = t.color;
967
- }
968
- t.start("gs", { pos: String(D.roundAccurately(1e3 * r, 0)) }), n && U(t, o, n), t.end("gs");
969
- }
970
- t.end("gsLst");
971
- let a = e.gradientType;
972
- if (a && a !== N.GradientType.Linear) {
973
- let n = a === "radial" ? "circle" : a;
974
- t.start("path", { path: n });
975
- let r = e.focus;
976
- if (r) {
977
- let e = {};
978
- r.t !== void 0 && (e.t = String(D.roundAccurately(1e3 * r.t, 0))), r.l !== void 0 && (e.l = String(D.roundAccurately(1e3 * r.l, 0))), r.b !== void 0 && (e.b = String(D.roundAccurately(1e3 * r.b, 0))), r.r !== void 0 && (e.r = String(D.roundAccurately(1e3 * r.r, 0))), t.empty("fillToRect", e);
979
- }
980
- t.end("path");
981
- } else {
982
- let n = {};
983
- e.angle !== void 0 && (n.ang = String(D.roundAccurately(6e4 * e.angle, 0)));
984
- let r = e.scaled;
985
- r !== void 0 && (n.scaled = r ? "1" : "0"), t.empty("lin", n);
986
- }
987
- t.end("gradFill");
988
- } else i ? t.empty("patternFill", { patternType: "none" }) : t.empty("noFill");
989
- i && t.end("fill");
990
- }
991
- var Je = (e, t, n, r) => {
992
- if (!n) return t.start("ln"), t.empty("noFill"), void t.end("ln");
993
- typeof n == "string" && (n = { fill: n });
994
- let i = n, a = {};
995
- if (i.width !== void 0 && (a.w = String(q(i.width))), i.lineCap !== void 0 && (a.cap = Ye(i.lineCap)), i.compound !== void 0 && (a.cmpd = i.compound), i.align !== void 0 && (a.algn = i.align), t.start("ln", a), K(0, t, i.fill ?? $e, r), Array.isArray(i.dash)) {
996
- t.start("custDash");
997
- for (let e = 0; e < i.dash.length; e += 2) t.empty("ds", {
998
- d: String(D.roundAccurately(1e3 * i.dash[e], 0)),
999
- sp: String(D.roundAccurately(1e3 * (i.dash[e + 1] ?? 0), 0))
1000
- });
1001
- t.end("custDash");
1002
- } else typeof i.dash == "string" && t.empty("prstDash", { val: i.dash });
1003
- if (i.lineJoin === F.LineJoin.Round) t.empty("round");
1004
- else if (i.lineJoin === F.LineJoin.Bevel) t.empty("bevel");
1005
- else if (i.lineJoin === F.LineJoin.Miter) {
1006
- let e = {};
1007
- i.miterLimit !== void 0 && (e.lim = String(D.roundAccurately(1e5 * i.miterLimit, 0))), t.empty("miter", e);
1008
- }
1009
- t.end("ln");
1010
- }, Ye = (e) => e === "round" ? "rnd" : e === "butt" ? "flat" : e === "square" ? "sq" : e, Xe = (e, t, n, r = void 0, i = !1) => {
1011
- if (!n || !(n.fill || n.stroke || n.effects?.length || i)) return;
1012
- let a = e.getXMLWriter();
1013
- r && a.start(r), a.pushDefaultNamespace("a"), n.fill && K(0, a, n.fill, t), n.stroke && Je(0, a, n.stroke, t), n.effects?.length ? Ze(e, a, t.getTheme(), n.effects) : i && a.empty("effectLst"), a.popDefaultNamespace(), r && a.end(r);
1014
- }, Ze = (e, t, n, r) => {
1015
- t.start("effectLst");
1016
- for (let e of r) Qe(t, n, e);
1017
- t.end("effectLst");
1018
- }, Qe = (e, t, n) => {
1019
- switch (n.type) {
1020
- case M.Type.OuterShadow: {
1021
- let r = n, i = {};
1022
- r.blur !== void 0 && (i.blurRad = String(q(r.blur))), r.distance !== void 0 && (i.dist = String(q(r.distance))), r.angle !== void 0 && (i.dir = String(Y(r.angle))), r.alignment !== void 0 && (i.algn = r.alignment), r.isRotatedWithShape !== void 0 && (i.rotWithShape = r.isRotatedWithShape ? "1" : "0"), r.scaleX !== void 0 && (i.sx = String(D.roundAccurately(1e3 * r.scaleX, 0))), r.scaleY !== void 0 && (i.sy = String(D.roundAccurately(1e3 * r.scaleY, 0))), r.skewX !== void 0 && (i.kx = String(Y(r.skewX))), r.skewY !== void 0 && (i.ky = String(Y(r.skewY))), e.start("outerShdw", i), U(e, t, r.color), e.end("outerShdw");
1023
- break;
1024
- }
1025
- case M.Type.InnerShadow: {
1026
- let r = n, i = {};
1027
- r.blur !== void 0 && (i.blurRad = String(q(r.blur))), r.distance !== void 0 && (i.dist = String(q(r.distance))), r.angle !== void 0 && (i.dir = String(Y(r.angle))), e.start("innerShdw", i), U(e, t, r.color), e.end("innerShdw");
1028
- break;
1029
- }
1030
- case M.Type.PresetShadow: {
1031
- let r = n, i = { prst: r.preset };
1032
- r.distance !== void 0 && (i.dist = String(q(r.distance))), r.angle !== void 0 && (i.dir = String(Y(r.angle))), e.start("prstShdw", i), U(e, t, r.color), e.end("prstShdw");
1033
- break;
1034
- }
1035
- case M.Type.Glow: {
1036
- let r = n, i = {};
1037
- r.radius !== void 0 && (i.rad = String(q(r.radius))), e.start("glow", i), U(e, t, r.color), e.end("glow");
1038
- break;
1039
- }
1040
- case M.Type.SoftEdge: {
1041
- let t = n, r = {};
1042
- t.radius !== void 0 && (r.rad = String(q(t.radius))), e.empty("softEdge", r);
1043
- break;
1044
- }
1045
- case M.Type.Reflection: {
1046
- let t = n, r = {};
1047
- t.blur !== void 0 && (r.blurRad = String(q(t.blur))), t.distance !== void 0 && (r.dist = String(q(t.distance))), t.angle !== void 0 && (r.dir = String(Y(t.angle))), t.fadeAngle !== void 0 && (r.fadeDir = String(Y(t.fadeAngle))), t.startAlpha !== void 0 && (r.stA = String(D.roundAccurately(1e3 * t.startAlpha, 0))), t.startPosition !== void 0 && (r.stPos = String(D.roundAccurately(1e3 * t.startPosition, 0))), t.endAlpha !== void 0 && (r.endA = String(D.roundAccurately(1e3 * t.endAlpha, 0))), t.endPosition !== void 0 && (r.endPos = String(D.roundAccurately(1e3 * t.endPosition, 0))), t.scaleX !== void 0 && (r.sx = String(D.roundAccurately(1e3 * t.scaleX, 0))), t.scaleY !== void 0 && (r.sy = String(D.roundAccurately(1e3 * t.scaleY, 0))), t.skewX !== void 0 && (r.kx = String(Y(t.skewX))), t.skewY !== void 0 && (r.ky = String(Y(t.skewY))), t.alignment !== void 0 && (r.algn = t.alignment), t.isRotatedWithShape !== void 0 && (r.rotWithShape = t.isRotatedWithShape ? "1" : "0"), e.empty("reflection", r);
1048
- break;
1049
- }
1050
- }
1051
- }, $e = { type: "none" }, et = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", tt = {
1052
- mime: "image/png",
1053
- ext: "png"
1054
- }, q = (e = 0) => D.roundAccurately(12700 * e, 0), J = (e = 0) => D.roundAccurately(9525 * e, 0), Y = (e) => 6e4 * e, nt = (e = 0) => D.roundAccurately(100 * e, 2), rt = class {
1055
- constructor() {
1056
- this._dxfs = [], this._byKey = /* @__PURE__ */ new Map();
1057
- }
1058
- add(e) {
1059
- let t = JSON.stringify(e), n = this._byKey.get(t);
1060
- return n === void 0 && (n = this._dxfs.length, this._dxfs.push(e), this._byKey.set(t, n)), n;
1061
- }
1062
- getDxfs() {
1063
- return this._dxfs;
1064
- }
1065
- getCount() {
1066
- return this._dxfs.length;
1067
- }
1068
- }, it = "cfDxfs", at = [
1069
- "font",
1070
- "fill",
1071
- "border",
1072
- "numberFormat",
1073
- "alignment"
1074
- ];
1075
- function ot(e, t, n) {
1076
- if (t) {
1077
- if (t.named) {
1078
- let r = t.named, i = r.toLowerCase(), a = n.namedStyleMap;
1079
- if (!a.has(i)) {
1080
- a.set(i, "" + a.size);
1081
- let t = e.getNamed(r).toJSON();
1082
- ot(e, t.style ?? D.EmptyObject, n), n.namedStyles.push(t);
1083
- }
1084
- }
1085
- t.font && function(e, t, n) {
1086
- if (!t) return;
1087
- let r = E.JSONStableStringify(t), i = n.fontMap;
1088
- if (!i.has(r)) {
1089
- let e = i.size;
1090
- i.set(r, "" + e), n.fonts.push(t);
1091
- }
1092
- }(0, t.font, n), t.fill && function(e, t, n) {
1093
- if (!t) return;
1094
- let r = E.JSONStableStringify(t), i = n.fillMap;
1095
- if (!i.has(r) && typeof t == "object" && t.type) {
1096
- let e = i.size;
1097
- i.set(r, "" + e), n.fills.push(t);
1098
- }
1099
- }(0, t.fill, n), t.border && function(e, t, n) {
1100
- if (!t) return;
1101
- let r = E.JSONStableStringify(t), i = n.borderMap;
1102
- if (!i.has(r)) {
1103
- let e = i.size;
1104
- i.set(r, "" + e), n.borders.push(t);
1105
- }
1106
- }(0, t.border, n), t.numberFormat !== void 0 && function(e, t, n) {
1107
- if (!t) return;
1108
- let r = R.toBuiltInID(t), i = n.numFmtMap;
1109
- if (!i.has(r)) {
1110
- let e = 0;
1111
- typeof r == "number" ? e = r : (e = n.numFmtsCustom.length + pt, n.numFmtsCustom.push(r)), i.set(t, "" + e);
1112
- }
1113
- }(0, t.numberFormat, n);
1114
- }
1115
- }
1116
- function st(e, t, n) {
1117
- if (!t) return;
1118
- let r = t.name.toLowerCase();
1119
- n.namedStyleMap.has(r) || (n.namedStyleMap.set(r, "" + n.namedStyleMap.size), n.namedStyles.push(t), ot(e, t.style, n));
1120
- }
1121
- function ct(e, t, n, r, i = !1) {
1122
- let a = r.getDefaultFontSize(), o = r.getTheme().getFontScheme().getMinorFont() ?? "Calibri", s = r.getNormal().getFont().getColor();
1123
- t.start("font"), n.weight && n.weight >= 700 && t.empty("b"), n.style && n.style !== "normal" && t.empty("i"), n.strike && t.empty("strike"), n.underline && t.empty("u", { val: n.underline }), n.outline && t.empty("outline"), n.shadow && t.empty("shadow"), n.extend && t.empty("extend");
1124
- let c = n.verticalAlign;
1125
- c && (c === "super" && (c = "superscript"), c === "sub" && (c = "subscript"), t.empty("vertAlign", { val: c })), i ? n.size !== void 0 && t.empty("sz", { val: String(n.size) }) : t.empty("sz", { val: String(n.size ?? a) }), G(t, r.getTheme(), n.color ?? s, "color", !i);
1126
- let l = !i || n.family && n.family !== o;
1127
- if (l && (t.empty("name", { val: n.family ?? o }), n.fallbacks && n.fallbacks.length > 0)) {
1128
- let e = n.fallbacks;
1129
- e.includes("serif") ? t.empty("family", { val: 1 }) : e.includes("sans-serif") ? t.empty("family", { val: 2 }) : e.includes("monospace") ? t.empty("family", { val: 3 }) : e.includes("cursive") ? t.empty("family", { val: 4 }) : e.includes("fantasy") && t.empty("family", { val: 5 });
1130
- }
1131
- n.charset !== void 0 && n.charset !== null && t.empty("charset", { val: String(n.charset) });
1132
- let u = n.scheme ?? (n.family === void 0 ? "minor" : void 0);
1133
- l && u !== void 0 && u !== "none" && t.empty("scheme", { val: u }), t.end("font");
1134
- }
1135
- function X(e, t, n, r, i, a = !1) {
1136
- if (!i || i.style === "none" || !i.style) return void (a && !i || t.empty(r));
1137
- t.start(r, { style: i.style });
1138
- let o = i.color;
1139
- o && G(t, n, o, "color", !a, a), t.end(r);
1140
- }
1141
- function lt(e, t, n, r, i = !1) {
1142
- let a = {};
1143
- i ? (a.diagonalUp = "0", a.diagonalDown = "0") : (n.diagonalUp && (a.diagonalUp = "1"), n.diagonalDown && (a.diagonalDown = "1")), t.start("border", a), X(0, t, r, "left", n.left, i), X(0, t, r, "right", n.right, i), X(0, t, r, "top", n.top, i), X(0, t, r, "bottom", n.bottom, i), i ? (X(0, t, r, "vertical", n.vertical, i), X(0, t, r, "horizontal", n.horizontal, i)) : X(0, t, r, "diagonal", n.diagonalUp ?? n.diagonalDown, i), t.end("border");
1144
- }
1145
- function ut(e, t, n, r = !1) {
1146
- let i = {};
1147
- n.horizontal && n.horizontal !== L.HorizontalAlignment.General && (i.horizontal = n.horizontal), n.vertical && n.vertical !== L.VerticalAlignment.Bottom && (i.vertical = n.vertical);
1148
- let a = n.rotation;
1149
- n.stacked && (i.textRotation = "255", a = 0), a && (a >= 270 && a < 360 ? a = 360 - a : a > 0 && a <= 90 && (a += 90), i.textRotation = String(a));
1150
- let o = n.overflow;
1151
- switch (o === L.Overflow.Wrap && (i.wrapText = "1"), n.indent && (i.indent = "" + n.indent), n.relativeIndent && (i.relativeIndent = "" + n.relativeIndent), n.justifyLastLine && (i.justifyLastLine = "1"), o === L.Overflow.Shrink && (i.shrinkToFit = "1"), n.readingDirection) {
1152
- case L.ReadingDirection.Auto: break;
1153
- case L.ReadingDirection.LeftToRight:
1154
- i.readingOrder = "1";
1155
- break;
1156
- case L.ReadingDirection.RightToLeft: i.readingOrder = "2";
1157
- }
1158
- return Object.keys(i).length > 0 ? i : null;
1159
- }
1160
- function dt(e, t, n, r, i, a) {
1161
- let o = {}, s = null, c = r.named;
1162
- c && (s = n.getNamed(c).toJSON().style);
1163
- let l = r.font ?? s?.font, u = l ? i.fontMap.get(E.JSONStableStringify(l)) ?? 0 : 0, d = r.fill ?? s?.fill, f = d ? i.fillMap.get(E.JSONStableStringify(d)) ?? 0 : 0, p = r.border ?? s?.border, m = p ? i.borderMap.get(E.JSONStableStringify(p)) ?? 0 : 0, h = r.numberFormat ?? s?.numberFormat;
1164
- if (o.numFmtId = (h === void 0 ? void 0 : i.numFmtMap.get(h)) ?? "0", o.fontId = String(u), o.fillId = String(f), o.borderId = String(m), a) {
1165
- let e = r.named ?? I.BuiltInName.Normal;
1166
- o.xfId = i.namedStyleMap.get(e.toLowerCase());
1167
- }
1168
- let g = null, _ = r.alignment ?? s?.alignment;
1169
- _ && (g = ut(0, 0, _)), r.font && (o.applyFont = "1"), r.fill && (o.applyFill = "1"), r.numberFormat && (o.applyNumberFormat = "1"), r.border && (o.applyBorder = "1"), g && (o.applyAlignment = "1"), r.quotePrefix && (o.quotePrefix = "1"), g ? (t.start("xf", o), g && t.empty("alignment", g), t.end("xf")) : t.empty("xf", o);
1170
- }
1171
- function ft(e, t, n, r, i, a = "dxf", o = pt) {
1172
- if (t.start(a), n.font && ct(0, t, n.font, r, !0), n.numberFormat !== void 0 && n.numberFormat !== null) {
1173
- let e = R.toBuiltInID(n.numberFormat), r = typeof e == "number", i = r ? R.builtInFormat(e) : String(e);
1174
- i && t.empty("numFmt", {
1175
- numFmtId: String(r ? e : o++),
1176
- formatCode: i
1177
- });
1178
- }
1179
- if (n.fill && K(0, t, n.fill, r, !0, !0), n.alignment) {
1180
- let e = ut(0, 0, n.alignment, !0);
1181
- e && t.empty("alignment", e);
1182
- }
1183
- return n.border && lt(0, t, n.border, i, !0), t.end(a), o;
1184
- }
1185
- var pt = 164, mt = Object.freeze([
1186
- "wholeTable",
1187
- "headerRow",
1188
- "totalRow",
1189
- "firstColumn",
1190
- "lastColumn",
1191
- "firstRowStripe",
1192
- "secondRowStripe",
1193
- "firstColumnStripe",
1194
- "secondColumnStripe",
1195
- "firstHeaderCell",
1196
- "lastHeaderCell",
1197
- "firstTotalCell",
1198
- "lastTotalCell"
1199
- ]), ht = A.BuiltInOperatorNames, gt = (e, t, n, r, i, a) => {
1200
- let o = r.sorts, s = o ? o.length : 0;
1201
- if (s === 0) return;
1202
- let c = {};
1203
- if (s > 0) {
1204
- let e = o[0].criteria?.collatorOptions;
1205
- e && (c.caseSensitive = typeof e != "object" || Array.isArray(e) || e.sensitivity !== "case" && e.sensitivity !== "variant" ? "0" : "1");
1206
- }
1207
- c.ref = n.getRange().toString(), c["xmlns:xlrd2"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2", t.start("sortState", c);
1208
- for (let e = 0; e < s; e++) {
1209
- let n = o[e], r = n.criteria ?? {}, s = n.index + a.colStart, c = {};
1210
- r.reverse && (c.descending = "1"), c.ref = i.getIntersect({
1211
- colStart: s,
1212
- rowStart: a.rowStart,
1213
- colEnd: s,
1214
- rowEnd: a.rowEnd
1215
- }).toString(), r.sortOn && (c.sortBy = r.sortOn), r.dxfId !== void 0 && (c.dxfId = r.dxfId), r.iconSet !== void 0 && (c.iconSet = r.iconSet), r.customList !== void 0 && (c.customList = r.customList), t.empty("sortCondition", c);
1216
- }
1217
- t.end("sortState");
1218
- }, _t = (e, t, n, r, i = !1) => {
1219
- let a = n.getRange();
1220
- n.isShowTotals() && (a = a.getResizeBy(-1, 0));
1221
- let o = a.getCoords(), s = r.sort, c = r.filter, l = c ? c.conditions : void 0, u = l ? l.length : 0, d = r.hiddenButtons, f = {};
1222
- f.ref = a.toString();
1223
- let p, m = [];
1224
- for (let e = 0; e < u; e++) {
1225
- let t = l[e];
1226
- m[t.index] = { ...t };
1227
- }
1228
- if (Array.isArray(d) && d.length > 0) {
1229
- let e = d.length;
1230
- p = Array(d[e - 1]);
1231
- for (let t = 0; t < e; t++) p[d[t]] = !0;
1232
- }
1233
- if (m || d || p || i) {
1234
- let c = 0;
1235
- r.columns ? c = r.columns.length : i && (c = a.getColumnCount()), t.start("autoFilter", f);
1236
- for (let n = 0; n < c; n++) {
1237
- let r = !0 === d || !0 === p?.[n], i = m[n];
1238
- (i || r) && yt(e, t, n, i, r);
1239
- }
1240
- s && i && gt(0, t, n, s, a, o), t.end("autoFilter");
1241
- } else t.empty("autoFilter", f);
1242
- s && !i && gt(0, t, n, s, a, o);
1243
- }, vt = (e, t, n) => {
1244
- let r = v(n, (t) => e.warn(t, n));
1245
- if (!r) return;
1246
- let i = { operator: r.operator };
1247
- r.val !== void 0 && (i.val = r.val), t.empty("customFilter", i);
1248
- }, yt = (e, t, n, r, i) => {
1249
- let a = {};
1250
- a.colId = "" + n, i && (a.hiddenButton = "1"), r ? (t.start("filterColumn", a), ((e, t, n) => {
1251
- let r = n.operator;
1252
- if (r !== A.BuiltInOperatorNames.Expression) if (r !== A.BuiltInOperatorNames.Unique) {
1253
- if (r === A.BuiltInOperatorNames.Color) {
1254
- let e = n.param, r = {};
1255
- e.cellColor !== void 0 && (r.cellColor = e.cellColor ? "1" : "0"), e.styleId !== void 0 && (r.dxfId = e.styleId), t.empty("colorFilter", r);
1256
- }
1257
- if (bt(r)) if (r === "between") {
1258
- let r = n.param;
1259
- t.start("customFilters", { and: "1" }), vt(e, t, {
1260
- operator: ht.GreaterThanEqualTo,
1261
- param: r.from
1262
- }), vt(e, t, {
1263
- operator: ht.LessThanEqualTo,
1264
- param: r.to
1265
- }), t.end("customFilters");
1266
- } else if (r === A.BuiltInOperatorNames.Not) {
1267
- let r = n.param;
1268
- p(r?.operator) ? (t.start("customFilters"), vt(e, t, n), t.end("customFilters")) : e.warn("Not rule with non-comparison criteria not supported in OOXML", r);
1269
- } else if (r === A.BuiltInOperatorNames.And || r === A.BuiltInOperatorNames.Or) {
1270
- let i = n.param, a = i.length;
1271
- if (a > 0) {
1272
- let n = {};
1273
- r === A.BuiltInOperatorNames.And && a > 1 && (n.and = "1"), t.start("customFilters", n);
1274
- for (let n = 0; n < a; n++) {
1275
- let r = i[n], a = r.operator === ht.Not && p(r.param?.operator);
1276
- p(r.operator) || a ? vt(e, t, r) : e.warn("Only Comparison criteria supported in Union conditions for Table AutoFilters", r);
1277
- }
1278
- t.end("customFilters");
1279
- }
1280
- } else p(r) && (t.start("customFilters"), vt(e, t, n), t.end("customFilters"));
1281
- if (r === A.BuiltInOperatorNames.TimePeriod) {
1282
- let e = n.param, r = {};
1283
- e.type && (r.type = e.type), e.anchorDate !== void 0 && (r.val = "" + e.anchorDate), e.maxVal !== void 0 && (r.maxVal = "" + e.maxVal), t.empty("dynamicFilter", r);
1284
- }
1285
- if (r === A.BuiltInOperatorNames.Average) {
1286
- let e = n.param, r = {}, i = e.type;
1287
- i && (i === A.AverageType.Above ? r.type = "aboveAverage" : i === A.AverageType.Below && (r.type = "belowAverage")), e.stdDevs !== void 0 && (r.val = "" + e.stdDevs), t.empty("dynamicFilter", r);
1288
- }
1289
- if (r === A.BuiltInOperatorNames.InSet) {
1290
- let e = n.param;
1291
- if (e.dateGroups) {
1292
- let n = e.dateGroups, r = n.length;
1293
- t.start("dateGroupItem");
1294
- for (let e = 0; e < r; e++) {
1295
- let r = n[e], i = {};
1296
- r.day !== void 0 && (i.day = "" + r.day), r.hour !== void 0 && (i.hour = "" + r.hour), r.minute !== void 0 && (i.minute = "" + r.minute), r.second !== void 0 && (i.second = "" + r.second), r.year !== void 0 && (i.year = "" + r.year), r.month !== void 0 && (i.month = "" + r.month), i.dateTimeGrouping = r.group, t.empty("dateGroupItem", i);
1297
- }
1298
- t.end("dateGroupItem");
1299
- }
1300
- if (e.items) {
1301
- let n = e.items, r = n.length;
1302
- t.start("filters");
1303
- for (let e = 0; e < r; e++) {
1304
- let r = n[e];
1305
- t.empty("filter", { val: "" + r });
1306
- }
1307
- t.end("filters");
1308
- }
1309
- }
1310
- if (r === A.BuiltInOperatorNames.Icon) {
1311
- let e = n.param, r = {};
1312
- e.iconSet !== void 0 && (r.iconSet = e.iconSet), e.iconId !== void 0 && (r.iconId = "" + e.iconId), t.empty("iconFilter", r);
1313
- }
1314
- if (r === A.BuiltInOperatorNames.TopN) {
1315
- let e = n.param, r = {};
1316
- e.percent && (r.percent = "1"), e.top !== void 0 && (r.top = e.top ? "1" : "0"), e.limit !== void 0 && (r.val = "" + e.limit), e.filterVal !== void 0 && (r.filterVal = "" + e.filterVal), t.empty("top10", r);
1317
- }
1318
- } else e.warn("Unique conditions not supported in Table AutoFilters", n);
1319
- else e.warn("Expression conditions not supported in Table AutoFilters", n);
1320
- })(e, t, r), t.end("filterColumn")) : t.empty("filterColumn", a);
1321
- }, bt = (e) => e === A.BuiltInOperatorNames.GreaterThan || e === A.BuiltInOperatorNames.GreaterThanEqualTo || e === A.BuiltInOperatorNames.LessThan || e === A.BuiltInOperatorNames.LessThanEqualTo || e === A.BuiltInOperatorNames.EqualTo || e === A.BuiltInOperatorNames.And || e === A.BuiltInOperatorNames.Or || e === A.BuiltInOperatorNames.Not || e === "between", xt = "16.0000", St = 1048575, Ct = 16383, wt = {
1322
- names: /* @__PURE__ */ new Set(),
1323
- perFormula: [],
1324
- affects: () => !1
1325
- }, Tt = 1048576, Et = (e, t, n) => {
1326
- if (!n) return [];
1327
- let r = 0;
1328
- for (let i = 0; i < n.length; i++) {
1329
- let a = n[i][0], o = t.getRange(a).getCoords();
1330
- if (r += (o.rowEnd - o.rowStart + 1) * (o.colEnd - o.colStart + 1), r > Tt) return e.warn(`Direct styles cover more than ${Tt} cells; not writing the styles from '${a}' on. A range that size belongs in a column or row style.`), n.slice(0, i);
1331
- }
1332
- return n;
1333
- };
1334
- function Dt(e, t) {
1335
- let n = t.type;
1336
- n === j.ColorStopType.AutoMin ? n = j.ColorStopType.Min : n === j.ColorStopType.AutoMax && (n = j.ColorStopType.Max), e.empty("cfvo", {
1337
- type: n,
1338
- val: t.value,
1339
- gte: t.exclusive ? "0" : void 0
1340
- });
1341
- }
1342
- function Ot(e, t) {
1343
- let n = {
1344
- type: t.type,
1345
- gte: t.exclusive ? "0" : void 0
1346
- };
1347
- t.value === void 0 ? e.empty("x14:cfvo", n) : (e.start("x14:cfvo", n), e.start("xm:f"), e.text(t.value), e.end("xm:f"), e.end("x14:cfvo"));
1348
- }
1349
- var kt = /* @__PURE__ */ new Set([
1350
- I.IconSet.Arrows3,
1351
- I.IconSet.ArrowsGray3,
1352
- I.IconSet.Flags3,
1353
- I.IconSet.Signs3,
1354
- I.IconSet.Symbols3,
1355
- I.IconSet.Symbols3_2,
1356
- I.IconSet.TrafficLights3,
1357
- I.IconSet.TrafficLights3_2,
1358
- I.IconSet.Arrows4,
1359
- I.IconSet.ArrowsGray4,
1360
- I.IconSet.Rating4,
1361
- I.IconSet.RedToBlack4,
1362
- I.IconSet.TrafficLights4,
1363
- I.IconSet.Arrows5,
1364
- I.IconSet.ArrowsGray5,
1365
- I.IconSet.Quarters5,
1366
- I.IconSet.Rating5
1367
- ]);
1368
- function At(e) {
1369
- return (e.icon?.length ?? 0) > 0 || e.iconSet !== void 0 && !kt.has(e.iconSet);
1370
- }
1371
- function jt(e, t, n, o, s, c, l, u, d) {
1372
- let f = o.scale;
1373
- o.ext && e.warn("Conditional format extension payload is not written to xlsx; it will be lost.");
1374
- let p = {
1375
- type: s.type,
1376
- dxfId: o.style && Object.keys(o.style).length > 0 ? u.add(o.style) : void 0,
1377
- priority: l,
1378
- stopIfTrue: Z(o.stopIfTrue),
1379
- aboveAverage: Z(s.aboveAverage),
1380
- equalAverage: Z(s.equalAverage),
1381
- stdDev: s.stdDev,
1382
- bottom: Z(s.bottom),
1383
- percent: Z(s.percent),
1384
- rank: s.rank,
1385
- operator: s.operator,
1386
- text: s.text,
1387
- timePeriod: s.timePeriod
1388
- }, m;
1389
- f?.type === j.ScaleType.DataBar && function(e) {
1390
- if (e.gradient || e.borderColor || e.negativeFillColor || e.negativeBorderColor || e.axisColor || e.axisPosition || e.direction) return !0;
1391
- let t = e.stops, n = t ? t.length : 0;
1392
- for (let e = 0; e < n; e++) {
1393
- let n = t[e].type;
1394
- if (n === j.ColorStopType.AutoMin || n === j.ColorStopType.AutoMax) return !0;
1395
- }
1396
- return !1;
1397
- }(f) && (m = a(D.uuidV4), d.push({
1398
- guid: m,
1399
- sqref: c,
1400
- priority: l,
1401
- scale: f
1402
- }));
1403
- let h = s.formulas, g = h ? h.length : 0;
1404
- if (g !== 0 || f) {
1405
- t.start("cfRule", p);
1406
- for (let e = 0; e < g; e++) t.start("formula"), t.text(h[e]), t.end("formula");
1407
- if (f?.type === j.ScaleType.ColorScale) {
1408
- let e = f.stops ?? [];
1409
- t.start("colorScale");
1410
- for (let n = 0; n < e.length; n++) Dt(t, e[n]);
1411
- for (let r = 0; r < e.length; r++) G(t, n, e[r].color, "color");
1412
- t.end("colorScale");
1413
- } else if (f?.type === j.ScaleType.DataBar) {
1414
- let e = f.stops ?? [];
1415
- t.start("dataBar", {
1416
- minLength: f.minLength,
1417
- maxLength: f.maxLength,
1418
- showValue: Z(f.showValue)
1419
- });
1420
- for (let n = 0; n < e.length; n++) Dt(t, e[n]);
1421
- f.color && G(t, n, f.color, "color"), t.end("dataBar");
1422
- } else if (f?.type === j.ScaleType.IconSet) {
1423
- let e = f.stops ?? [];
1424
- t.start("iconSet", {
1425
- iconSet: f.iconSet,
1426
- reverse: Z(f.reverse),
1427
- showValue: Z(f.showValue)
1428
- });
1429
- for (let n = 0; n < e.length; n++) Dt(t, e[n]);
1430
- t.end("iconSet");
1431
- }
1432
- m && (t.start("extLst"), t.start("ext", {
1433
- uri: i,
1434
- "xmlns:x14": r
1435
- }), t.start("x14:id"), t.text(m), t.end("x14:id"), t.end("ext"), t.end("extLst")), t.end("cfRule");
1436
- } else t.empty("cfRule", p);
1437
- }
1438
- function Mt(e) {
1439
- return e.split(" ")[0].split(":")[0];
1440
- }
1441
- function Nt(e) {
1442
- if (typeof e == "string") return e.split(",").join(" ");
1443
- if (Array.isArray(e)) {
1444
- let t = [];
1445
- for (let n = 0; n < e.length; n++) {
1446
- let r = T.rangeToString(e[n]);
1447
- r && t.push(r);
1448
- }
1449
- return t.length > 0 ? t.join(" ") : null;
1450
- }
1451
- return T.rangeToString(e);
1452
- }
1453
- function Z(e) {
1454
- if (e !== void 0) return e ? "1" : "0";
1455
- }
1456
- function Pt(e) {
1457
- if (typeof e != "string") return !1;
1458
- let t = !1;
1459
- for (let n = 0; n < e.length; n++) {
1460
- let r = e[n];
1461
- if (r === "\"") t = !t;
1462
- else if (r === "!" && !t) return !0;
1463
- }
1464
- return !1;
1465
- }
1466
- function Ft(e) {
1467
- let t = e.formulas, n = t ? t.length : 0;
1468
- for (let e = 0; e < n; e++) if (Pt(t[e])) return !0;
1469
- return !1;
1470
- }
1471
- var It = {
1472
- r: void 0,
1473
- s: void 0,
1474
- t: void 0,
1475
- cm: void 0,
1476
- vm: void 0
1477
- }, Lt = {
1478
- r: void 0,
1479
- s: void 0,
1480
- customFormat: void 0,
1481
- hidden: void 0,
1482
- ht: void 0,
1483
- customHeight: void 0,
1484
- "x14ac:dyDescent": "0.25",
1485
- outlineLevel: void 0,
1486
- collapsed: void 0
1487
- }, Rt = {
1488
- t: void 0,
1489
- aca: void 0,
1490
- ref: void 0,
1491
- ca: void 0,
1492
- si: void 0
1493
- }, zt = {
1494
- t: "shared",
1495
- aca: void 0,
1496
- ref: void 0,
1497
- ca: void 0,
1498
- si: void 0
1499
- }, Bt = {
1500
- t: "array",
1501
- aca: void 0,
1502
- ref: void 0,
1503
- ca: void 0,
1504
- si: void 0
1505
- };
1506
- function Vt(e, t, n, r) {
1507
- n && (t.start(r), t.empty("latin", { typeface: n }), t.empty("ea", { typeface: "" }), t.empty("cs", { typeface: "" }), t.end(r));
1508
- }
1509
- var Ht = (e) => e.toISOString().split(".")[0] + "Z", Ut = (e, t, n) => {
1510
- switch (t) {
1511
- case "creator":
1512
- e.start("dc:creator"), e.text(n), e.end("dc:creator");
1513
- break;
1514
- case "lastModifiedBy":
1515
- e.start("cp:lastModifiedBy"), e.text(n), e.end("cp:lastModifiedBy");
1516
- break;
1517
- case "created":
1518
- e.start("dcterms:created", { "xsi:type": "dcterms:W3CDTF" }), e.text(n), e.end("dcterms:created");
1519
- break;
1520
- case "modified": e.start("dcterms:modified", { "xsi:type": "dcterms:W3CDTF" }), e.text(n), e.end("dcterms:modified");
1521
- }
1522
- }, Q = (e, t, n, r) => {
1523
- t.start(n), t.text(r), t.end(n);
1524
- }, Wt = (e, t, n) => {
1525
- let r = n.getSheets().getItems({ visibility: P.Visibility.Hidden }).map((e) => e.getName()), i = n.getNames().getItems({ type: "formula" }).filter((e) => !!e.getRanges?.()).map((e) => e.getName());
1526
- t.start("HeadingPairs"), t.start("vt:vector", {
1527
- size: i.length > 0 ? "4" : "2",
1528
- baseType: "variant"
1529
- }), t.start("vt:variant"), t.start("vt:lpstr"), t.text("Worksheets"), t.end("vt:lpstr"), t.end("vt:variant"), t.start("vt:variant"), t.start("vt:i4"), t.text("" + r.length), t.end("vt:i4"), t.end("vt:variant"), i.length > 0 && (t.start("vt:variant"), t.start("vt:lpstr"), t.text("Named Ranges"), t.end("vt:lpstr"), t.end("vt:variant"), t.start("vt:variant"), t.start("vt:i4"), t.text("" + i.length), t.end("vt:i4"), t.end("vt:variant")), t.end("vt:vector"), t.end("HeadingPairs"), t.start("TitlesOfParts"), t.start("vt:vector", {
1530
- size: "" + (r.length + i.length),
1531
- baseType: "lpstr"
1532
- });
1533
- for (let e of r) t.start("vt:lpstr"), t.text(e), t.end("vt:lpstr");
1534
- for (let e of i) t.start("vt:lpstr"), t.text(e), t.end("vt:lpstr");
1535
- t.end("vt:vector"), t.end("TitlesOfParts");
1536
- }, Gt = {
1537
- minSupportedVersion: "120000",
1538
- copy: "1",
1539
- pasteAll: "1",
1540
- pasteValues: "1",
1541
- merge: "1",
1542
- splitFirst: "1",
1543
- rowColShift: "1",
1544
- clearFormats: "1",
1545
- clearComments: "1",
1546
- assign: "1",
1547
- coerce: "1"
1548
- }, Kt = (e, t, n = D.EmptyArray) => {
1549
- if (!t) return { ...n };
1550
- let { text: r, runs: i, color: a, size: o, kern: s, weight: c, style: l, b: u, i: d, spc: f, baseline: p, ...m } = t, h = {
1551
- ...n,
1552
- ...m
1553
- };
1554
- return o !== void 0 && (h.sz = "" + nt(o)), u !== void 0 && (h.b = u ? "1" : "0"), c !== void 0 && (h.b = c > 500 ? "1" : "0"), d !== void 0 && (h.i = d ? "1" : "0"), l !== void 0 && (h.i = l === "italic" ? "1" : "0"), s !== void 0 && (h.kern = "" + nt(s)), f !== void 0 && (h.spc = "" + nt(f)), p !== void 0 && (h.baseline = "" + nt(p)), h;
1555
- }, qt = (e, t, n) => {
1556
- if (!n) return;
1557
- let r = e.getXMLWriter();
1558
- r.start("txBody"), r.pushDefaultNamespace("a"), Yt(e, t, {
1559
- vertOverflow: "clip",
1560
- horzOverflow: "clip",
1561
- rtlCol: "0",
1562
- anchor: "ctr"
1563
- }), r.empty("lstStyle"), ((e, t, n) => {
1564
- if (!n) return;
1565
- let r = e.getXMLWriter();
1566
- r.pushDefaultNamespace("a"), typeof n == "string" && (n = { runs: [{ text: n }] }), r.start("p"), r.empty("pPr", { algn: "ctr" });
1567
- let i = Kt(0, n, {
1568
- ...Xt,
1569
- size: t.getDefaultFontSize()
1570
- }), a = n?.runs, o = a ? a.length : 0;
1571
- if (o > 0) for (let e = 0; e < o; e++) {
1572
- let n = a[e];
1573
- r.start("r", {});
1574
- let i = Kt(0, n, Xt), o = n.color;
1575
- o ? (r.start("rPr", i), K(0, r, o, t), r.end("rPr")) : r.empty("rPr", i), r.start("t"), r.text(n?.text ?? ""), r.end("t"), r.end("r");
1576
- }
1577
- else r.empty("endParaRPr", i);
1578
- r.end("p"), r.popDefaultNamespace();
1579
- })(e, t, n), r.popDefaultNamespace(), r.end("txBody");
1580
- }, Jt = (e, t, n) => {
1581
- if (!n) return;
1582
- let r = e.getXMLWriter(), i = Kt(0, n);
1583
- r.empty("defRPr", i);
1584
- }, Yt = (e, t, n) => {
1585
- if (!n) return;
1586
- let r = e.getXMLWriter(), { spAutoFit: i, ...a } = n;
1587
- i ? (r.start("bodyPr", a), r.empty("spAutoFit"), r.end("bodyPr")) : r.empty("bodyPr", a);
1588
- }, Xt = Object.freeze({ lang: "en-US" }), Zt = (e, t) => {
1589
- if (t.length !== 0) {
1590
- e.start("a:extLst");
1591
- for (let n of t) {
1592
- let t = {}, r = n[0];
1593
- r && (t.uri = r), e.start("a:ext", t), e.empty(n[1], n[2]), e.end("a:ext");
1594
- }
1595
- e.end("a:extLst");
1596
- }
1597
- }, Qt = async (e, t, n, r, i) => {
1598
- let a = e.getSharedStates(), o = r.getContent().getResource(), s = await o.getExternalURI(), c;
1599
- if (s) c = e.addExternal(et, s);
1600
- else if (c = n.get(o), !c) {
1601
- let t = a.get("imagesWritten");
1602
- t || (t = /* @__PURE__ */ new Map(), a.set("imagesWritten", t));
1603
- let r = t.get(o);
1604
- if (!r) {
1605
- let e = await o.toBuffer();
1606
- r = {
1607
- bytes: new Uint8Array(e),
1608
- type: await o.getType() ?? tt,
1609
- index: t.size + 1
1610
- }, t.set(o, r);
1611
- }
1612
- c = e.addBinary(r.bytes, r.type.mime, et, `../media/image${r.index}.${r.type.ext}`, !0), n.set(o, c);
1613
- }
1614
- let l = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
1615
- s ? l["r:link"] = c.relId : l["r:embed"] = c.relId;
1616
- let u = [];
1617
- s || u.push([
1618
- "{28A0092B-C50C-407E-A947-70E740481C1C}",
1619
- "a14:useLocalDpi",
1620
- {
1621
- "xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main",
1622
- val: "0"
1623
- }
1624
- ]);
1625
- let d = e.getXMLWriter();
1626
- d.start("pic"), d.start("nvPicPr"), cn(e, d, r, i, t), un(e, d, r, i), d.end("nvPicPr"), d.start("blipFill"), d.start("a:blip", l), Zt(d, u), d.end("a:blip"), d.start("a:stretch"), d.empty("a:fillRect"), d.end("a:stretch"), d.end("blipFill"), on(e, t, n, r, i), d.end("pic");
1627
- }, $t = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart", en = async (e, t, n, r, i, a) => {
1628
- let o = i.content?.json, s = o?.xml, c = o?.chartRelId, l = o?.chartTargetPath;
1629
- if (!s || !c || !l) return $(e, t, n, r, i);
1630
- let u = e.getSharedStates(), d, f = u.get("claimedChartTargets");
1631
- if (f || (f = /* @__PURE__ */ new Set(), u.set("claimedChartTargets", f)), f.has(l)) {
1632
- let a = e.forkPreservedPart(l, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml", $t, "../charts/chart{n}.xml");
1633
- if (!a?.relId) return $(e, t, n, r, i);
1634
- d = a.relId;
1635
- } else f.add(l), d = e.addPreservedRelationship($t, l, c);
1636
- let p = d === c ? s : s.replace(`r:id="${c}"`, `r:id="${d}"`);
1637
- a !== void 0 && typeof o?.sourceId == "number" && (p = p.replace(`cNvPr id="${o.sourceId}"`, `cNvPr id="${a}"`)), e.getXMLWriter().raw(p);
1638
- }, tn = async (e, t, n, r, i) => $(e, t, n, r, i), nn = async (e, t, n, r, i) => $(e, t, n, r, i), rn = async (e, t, n, r, i) => $(e, t, n, r, i), an = async (e, t, n, r, i, a) => {
1639
- let o = i.content?.json, s = o?.xml;
1640
- if (!s) return $(e, t, n, r, i);
1641
- let c = a !== void 0 && typeof o?.sourceId == "number" ? s.replace(`cNvPr id="${o.sourceId}"`, `cNvPr id="${a}"`) : s;
1642
- e.getXMLWriter().raw(c);
1643
- }, $ = async (e, t, n, r, i) => {
1644
- (async (e, t, n, r, i) => {
1645
- let a = e.getXMLWriter(), o = {}, s = i.content?.json, c = s?.type ?? "sp", l = t.getStyles();
1646
- c === "cxnSp" ? (o.macro = "", a.start("cxnSp", o), a.start("nvCxnSpPr"), cn(e, a, r, i, t), ln(e, a, r, i, t), a.start("cNvCxnSpPr"), a.empty("a:stCnx", {
1647
- id: "0",
1648
- idx: "0"
1649
- }), a.end("cNvCxnSpPr"), a.end("nvCxnSpPr"), on(e, t, n, r, i), sn(e, t, n, r, i), qt(e, l, s?.text), a.end("cxnSp")) : c === "grpSp" || (o.macro = "", o.textlink = "", a.start("sp", o), a.start("nvSpPr"), cn(e, a, r, i, t), ln(e, a, r, i, t), a.end("nvSpPr"), on(e, t, n, r, i), sn(e, t, n, r, i), qt(e, l, s?.text), a.end("sp"));
1650
- })(e, t, n, r, {
1651
- ...i,
1652
- content: {
1653
- type: "shape",
1654
- json: {
1655
- fill: "bg1",
1656
- stroke: {
1657
- width: 2,
1658
- fill: "red"
1659
- },
1660
- text: { runs: [{
1661
- text: "Unsupported Type: " + (i.content?.type ?? "unknown"),
1662
- color: "tx1"
1663
- }] }
1664
- }
1665
- }
1666
- });
1667
- }, on = (e, t, n, r, i) => {
1668
- let a = e.getXMLWriter(), o = i.content?.json, s = o?.geometry ?? "rect", c = t.getStyles();
1669
- a.start("spPr"), a.pushDefaultNamespace("a"), dn(a, r, i), a.start("prstGeom", { prst: s }), a.empty("avLst"), a.end("prstGeom"), Xe(e, c, o), a.popDefaultNamespace(), a.end("spPr");
1670
- }, sn = (e, t, n, r, i) => {
1671
- let a = e.getXMLWriter();
1672
- a.start("style"), a.pushDefaultNamespace("a"), a.start("lnRef", { idx: "1" }), a.start("schemeClr", { val: "accent1" }), a.empty("shade", { val: "15000" }), a.end("schemeClr"), a.end("lnRef"), a.start("fillRef", { idx: "1" }), a.empty("schemeClr", { val: "accent1" }), a.end("fillRef"), a.start("effectRef", { idx: "0" }), a.empty("schemeClr", { val: "accent1" }), a.end("effectRef"), a.start("fontRef", { idx: "minor" }), a.empty("schemeClr", { val: "lt1" }), a.end("fontRef"), a.popDefaultNamespace(), a.end("style");
1673
- }, cn = (e, t, n, r, i) => {
1674
- let a = e.getSharedStates(), o = a.get("uniqueIdCounter");
1675
- o || (o = /* @__PURE__ */ new Map(), a.set("uniqueIdCounter", o));
1676
- let s = o.get(i) ?? 1;
1677
- s++, o.set(i, s);
1678
- let c = {
1679
- id: "" + s,
1680
- name: r.name
1681
- };
1682
- r.description && (c.descr = r.description), r.hidden && (c.hidden = "1");
1683
- let l = [];
1684
- l.push([
1685
- "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}",
1686
- "a16:creationId",
1687
- {
1688
- "xmlns:a16": "http://schemas.microsoft.com/office/drawing/2014/main",
1689
- id: `{${D.uuidV4().toUpperCase()}}`
1690
- }
1691
- ]), t.start("cNvPr", c), Zt(t, l), t.end("cNvPr");
1692
- }, ln = (e, t, n, r, i) => {
1693
- t.empty("cNvSpPr");
1694
- }, un = (e, t, n, r) => {
1695
- let i = {};
1696
- if (r.lockAspect && (i.noChangeAspect = "1"), r.locks) for (let e of Object.keys(r.locks)) !0 === r.locks[e] && (i[e] = "1");
1697
- t.start("cNvPicPr", {}), t.empty("a:picLocks", i), t.end("cNvPicPr");
1698
- }, dn = (e, t, n) => {
1699
- let r = t.getBounds(), i = {}, a = n.rotation;
1700
- a !== void 0 && a !== 0 && (i.rot = "" + Y(a)), e.start("xfrm", i), e.start("off", {
1701
- x: J(r.x),
1702
- y: J(r.y)
1703
- }), e.end("off"), e.start("ext", {
1704
- cx: J(r.width),
1705
- cy: J(r.height)
1706
- }), e.end("ext"), e.end("xfrm");
1707
- }, fn = (e, t, n) => {
1708
- e.start(t), e.start("col"), e.text(n.c ?? 0), e.end("col"), e.start("colOff"), e.text(J(n.x)), e.end("colOff"), e.start("row"), e.text(n.r ?? 0), e.end("row"), e.start("rowOff"), e.text(J(n.y)), e.end("rowOff"), e.end(t);
1709
- }, pn = 0, mn = (e, t, n, r) => {
1710
- let i = r.columns, a = i ? i.length : 0;
1711
- if (a !== 0) {
1712
- t.start("tableColumns", { count: a });
1713
- for (let e = 0; e < a; e++) {
1714
- let n = i[e];
1715
- typeof n == "string" && (n = { name: n });
1716
- let r = {};
1717
- r.id = e + 1, r.name = n.name ?? `Column${e + 1}`;
1718
- let a = null, o = n.totalsRowFormula;
1719
- o && (typeof o == "number" && (o = _n.get(o)), o && !gn.has(o.toLowerCase()) && (a = o, o = "custom"), o && (r.totalsRowFunction = o)), n.totalsRowLabel && (r.totalsRowLabel = n.totalsRowLabel), a ? (t.start("tableColumn", r), t.start("totalsRowFormula"), t.text(a), t.end("totalsRowFormula"), t.end("tableColumn")) : t.empty("tableColumn", r);
1720
- }
1721
- t.end("tableColumns");
1722
- }
1723
- }, hn = (e, t, n, r) => {
1724
- let i = {
1725
- name: n.getStyle().getName(),
1726
- showFirstColumn: n.isShowHighlightFirstColumn() ? "1" : "0",
1727
- showLastColumn: n.isShowHighlightLastColumn() ? "1" : "0",
1728
- showRowStripes: n.isShowBandedRows() ? "1" : "0",
1729
- showColumnStripes: n.isShowBandedColumns() ? "1" : "0"
1730
- };
1731
- t.empty("tableStyleInfo", i);
1732
- }, gn = /* @__PURE__ */ new Map([
1733
- ["average", 101],
1734
- ["countnums", 102],
1735
- ["count", 103],
1736
- ["max", 104],
1737
- ["min", 105],
1738
- ["product", 106],
1739
- ["stddev", 107],
1740
- ["stddevp", 108],
1741
- ["sum", 109],
1742
- ["var", 110]
1743
- ]), _n = /* @__PURE__ */ new Map();
1744
- gn.forEach((e, t) => {
1745
- _n.set(e, t);
1746
- });
1747
- var vn = (e, t, n, r) => {
1748
- t.start("mc:AlternateContent", { "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006" }), t.start("mc:Choice", {
1749
- Requires: "c14",
1750
- "xmlns:c14": "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"
1751
- }), t.empty("c14:style", { val: "102" }), t.end("mc:Choice"), t.start("mc:Fallback"), t.empty("c:style", { val: "2" }), t.end("mc:Fallback"), t.end("mc:AlternateContent");
1752
- }, yn = (e, t, n, r, i) => {
1753
- t.start("chart"), ((e, t, n, r, i) => {
1754
- t.start("title"), t.empty("overlay", { val: "0" }), Xe(e, n, i, "spPr", !0), t.end("title"), t.empty("autoTitleDeleted", { val: "0" });
1755
- })(e, t, n, 0, i), ((e, t, n, r, i) => {
1756
- t.start("plotArea"), t.empty("layout"), Xe(e, n, i, "spPr", !0), t.end("plotArea");
1757
- })(e, t, n, 0, i), t.empty("plotVisOnly", { val: "1" }), t.empty("dispBlanksAs", { val: "gap" }), t.empty("showDLblsOverMax", { val: "0" }), t.end("chart");
1758
- }, bn = (e, t, n, r) => {
1759
- t.start("printSettings"), t.empty("headerFooter"), t.empty("pageMargins", {
1760
- b: "0.75",
1761
- l: "0.7",
1762
- r: "0.7",
1763
- t: "0.75",
1764
- header: "0.3",
1765
- footer: "0.3"
1766
- }), t.empty("pageSetup"), t.end("printSettings");
1767
- }, xn = (e, t, n, r, i, a = "0") => {
1768
- let o = i?.color, s = { idx: i?.idx ?? a };
1769
- o === void 0 ? t.empty(r, s) : (t.start(r, s), o === "auto" ? t.empty("styleClr", { val: "auto" }) : (t.pushDefaultNamespace("a"), U(t, n.getTheme(), o), t.popDefaultNamespace()), t.end(r));
1770
- }, Sn = (e, t, n, r) => {
1771
- let i = n.length;
1772
- for (let a = 0; a < i; a++) {
1773
- let i = n[a];
1774
- i.empty ? t.empty(i.type, i.mods) : (t.start(i.type, i.mods), xn(0, t, r, "lnRef", i.lineRef, "0"), xn(0, t, r, "fillRef", i.fillRef, "0"), xn(0, t, r, "effectRef", i.effectRef, "0"), xn(0, t, r, "fontRef", i.fontRef, "minor"), Xe(e, r, i, "spPr"), Jt(e, 0, i.defRPr), Yt(e, r, i.bodyPr), t.end(i.type));
1775
- }
1776
- }, Cn = Object.freeze([
1777
- {
1778
- type: "axisTitle",
1779
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
1780
- defRPr: {
1781
- size: 10,
1782
- kern: 12
1783
- }
1784
- },
1785
- {
1786
- type: "categoryAxis",
1787
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
1788
- stroke: {
1789
- width: .75,
1790
- cap: "flat",
1791
- cmpd: "sng",
1792
- algn: "ctr",
1793
- round: !0,
1794
- fill: "tx1 lumMod 15 lumOff 85"
1795
- },
1796
- defRPr: {
1797
- size: 9,
1798
- kern: 12
1799
- }
1800
- },
1801
- {
1802
- type: "chartArea",
1803
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
1804
- fontRef: { color: "tx1" },
1805
- fill: {
1806
- type: "solid",
1807
- color: "bg1"
1808
- },
1809
- stroke: {
1810
- width: .75,
1811
- cap: "flat",
1812
- cmpd: "sng",
1813
- algn: "ctr",
1814
- round: !0,
1815
- fill: "tx1 lumMod 15 lumOff 85"
1816
- },
1817
- defRPr: {
1818
- size: 10,
1819
- kern: 12
1820
- }
1821
- },
1822
- {
1823
- type: "dataLabel",
1824
- fontRef: { color: "tx1 lumMod 75 lumOff 25" },
1825
- defRPr: {
1826
- size: 9,
1827
- kern: 12
1828
- }
1829
- },
1830
- {
1831
- type: "dataLabelCallout",
1832
- fontRef: { color: "dk1 lumMod 65 lumOff 35" },
1833
- fill: {
1834
- type: "solid",
1835
- color: "lt1"
1836
- },
1837
- stroke: { fill: "dk1 lumMod 25 lumOff 75" },
1838
- defRPr: {
1839
- size: 9,
1840
- kern: 12
1841
- },
1842
- bodyPr: {
1843
- rot: "0",
1844
- spcFirstLastPara: "1",
1845
- vertOverflow: "clip",
1846
- horzOverflow: "clip",
1847
- vert: "horz",
1848
- wrap: "square",
1849
- lIns: "36576",
1850
- tIns: "18288",
1851
- rIns: "36576",
1852
- bIns: "18288",
1853
- anchor: "ctr",
1854
- anchorCtr: "1",
1855
- spAutoFit: "true"
1856
- }
1857
- },
1858
- {
1859
- type: "dataPoint",
1860
- fillRef: {
1861
- idx: "1",
1862
- color: "auto"
1863
- },
1864
- fontRef: { color: "tx1" }
1865
- },
1866
- {
1867
- type: "dataPoint3D",
1868
- fillRef: {
1869
- idx: "1",
1870
- color: "auto"
1871
- },
1872
- fontRef: { color: "tx1" }
1873
- },
1874
- {
1875
- type: "dataPointLine",
1876
- lineRef: { color: "auto" },
1877
- fillRef: { idx: "1" },
1878
- fontRef: { color: "tx1" },
1879
- stroke: {
1880
- width: 2.25,
1881
- cap: "rnd",
1882
- fill: "phClr",
1883
- round: !0
1884
- }
1885
- },
1886
- {
1887
- type: "dataPointMarker",
1888
- lineRef: { color: "auto" },
1889
- fillRef: {
1890
- idx: "1",
1891
- color: "auto"
1892
- },
1893
- fontRef: { color: "tx1" },
1894
- stroke: {
1895
- width: .75,
1896
- fill: "phClr"
1897
- }
1898
- },
1899
- {
1900
- type: "dataPointMarkerLayout",
1901
- mods: {
1902
- symbol: "circle",
1903
- size: "5"
1904
- },
1905
- empty: !0
1906
- },
1907
- {
1908
- type: "dataPointWireframe",
1909
- lineRef: { color: "auto" },
1910
- fillRef: { idx: "1" },
1911
- fontRef: { color: "tx1" },
1912
- stroke: {
1913
- width: .75,
1914
- cap: "rnd",
1915
- fill: "phClr",
1916
- round: !0
1917
- }
1918
- },
1919
- {
1920
- type: "dataTable",
1921
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
1922
- fill: { type: "none" },
1923
- stroke: {
1924
- width: .75,
1925
- cap: "flat",
1926
- cmpd: "sng",
1927
- algn: "ctr",
1928
- round: !0,
1929
- fill: "tx1 lumMod 15 lumOff 85"
1930
- },
1931
- defRPr: {
1932
- size: 9,
1933
- kern: 12
1934
- }
1935
- },
1936
- {
1937
- type: "downBar",
1938
- fontRef: { color: "tx1" },
1939
- fill: {
1940
- type: "solid",
1941
- color: "dk1 lumMod 75 lumOff 25"
1942
- },
1943
- stroke: {
1944
- width: .75,
1945
- cap: "flat",
1946
- cmpd: "sng",
1947
- algn: "ctr",
1948
- round: !0,
1949
- fill: "tx1 lumMod 65 lumOff 35"
1950
- }
1951
- },
1952
- {
1953
- type: "dropLine",
1954
- fontRef: { color: "tx1" },
1955
- stroke: {
1956
- width: .75,
1957
- cap: "flat",
1958
- cmpd: "sng",
1959
- algn: "ctr",
1960
- round: !0,
1961
- fill: "tx1 lumMod 35 lumOff 65"
1962
- }
1963
- },
1964
- {
1965
- type: "errorBar",
1966
- fontRef: { color: "tx1" },
1967
- stroke: {
1968
- width: .75,
1969
- cap: "flat",
1970
- cmpd: "sng",
1971
- algn: "ctr",
1972
- round: !0,
1973
- fill: "tx1 lumMod 65 lumOff 35"
1974
- }
1975
- },
1976
- {
1977
- type: "floor",
1978
- fontRef: { color: "tx1" },
1979
- fill: { type: "none" },
1980
- stroke: {}
1981
- },
1982
- {
1983
- type: "gridlineMajor",
1984
- fontRef: { color: "tx1" },
1985
- stroke: {
1986
- width: .75,
1987
- cap: "flat",
1988
- cmpd: "sng",
1989
- algn: "ctr",
1990
- round: !0,
1991
- fill: "tx1 lumMod 15 lumOff 85"
1992
- }
1993
- },
1994
- {
1995
- type: "gridlineMinor",
1996
- fontRef: { color: "tx1" },
1997
- stroke: {
1998
- width: .75,
1999
- cap: "flat",
2000
- cmpd: "sng",
2001
- algn: "ctr",
2002
- round: !0,
2003
- fill: "tx1 lumMod 5 lumOff 95"
2004
- }
2005
- },
2006
- {
2007
- type: "hiLoLine",
2008
- fontRef: { color: "tx1" },
2009
- stroke: {
2010
- width: .75,
2011
- cap: "flat",
2012
- cmpd: "sng",
2013
- algn: "ctr",
2014
- round: !0,
2015
- fill: "tx1 lumMod 50 lumOff 50"
2016
- }
2017
- },
2018
- {
2019
- type: "leaderLine",
2020
- fontRef: { color: "tx1" },
2021
- stroke: {
2022
- width: .75,
2023
- cap: "flat",
2024
- cmpd: "sng",
2025
- algn: "ctr",
2026
- round: !0,
2027
- fill: "tx1 lumMod 35 lumOff 65"
2028
- }
2029
- },
2030
- {
2031
- type: "legend",
2032
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2033
- defRPr: {
2034
- size: 9,
2035
- kern: 12
2036
- }
2037
- },
2038
- {
2039
- type: "plotArea",
2040
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2041
- fontRef: { color: "tx1" }
2042
- },
2043
- {
2044
- type: "plotArea3D",
2045
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2046
- fontRef: { color: "tx1" }
2047
- },
2048
- {
2049
- type: "seriesAxis",
2050
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2051
- defRPr: {
2052
- size: 9,
2053
- kern: 12
2054
- }
2055
- },
2056
- {
2057
- type: "seriesLine",
2058
- fontRef: { color: "tx1" },
2059
- stroke: {
2060
- width: .75,
2061
- cap: "flat",
2062
- cmpd: "sng",
2063
- algn: "ctr",
2064
- round: !0,
2065
- fill: "tx1 lumMod 35 lumOff 65"
2066
- }
2067
- },
2068
- {
2069
- type: "title",
2070
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2071
- defRPr: {
2072
- size: 14,
2073
- b: !1,
2074
- kern: 12,
2075
- spc: 0,
2076
- baseline: 0
2077
- }
2078
- },
2079
- {
2080
- type: "trendline",
2081
- lineRef: { color: "auto" },
2082
- fontRef: { color: "tx1" },
2083
- stroke: {
2084
- width: 1.5,
2085
- cap: "rnd",
2086
- fill: "phClr",
2087
- prstDash: "sysDot"
2088
- }
2089
- },
2090
- {
2091
- type: "trendlineLabel",
2092
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2093
- defRPr: {
2094
- size: 9,
2095
- kern: 12
2096
- }
2097
- },
2098
- {
2099
- type: "upBar",
2100
- fontRef: { color: "tx1" },
2101
- fill: {
2102
- type: "solid",
2103
- color: "lt1"
2104
- },
2105
- stroke: {
2106
- width: .75,
2107
- cap: "flat",
2108
- cmpd: "sng",
2109
- algn: "ctr",
2110
- round: !0,
2111
- fill: "tx1 lumMod 65 lumOff 35"
2112
- }
2113
- },
2114
- {
2115
- type: "valueAxis",
2116
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2117
- defRPr: {
2118
- size: 9,
2119
- kern: 12
2120
- }
2121
- },
2122
- {
2123
- type: "wall",
2124
- fontRef: { color: "tx1" },
2125
- fill: { type: "none" },
2126
- stroke: {}
2127
- }
2128
- ]), wn = (e, t, n) => {
2129
- let r = n.length;
2130
- for (let e = 0; e < r; e++) {
2131
- let r = n[e], i = {}, a = r[0], o = r[1];
2132
- a || o ? (t.start("variation", i), a && t.empty("a:lumMod", { val: a }), o && t.empty("a:lumOff", { val: o }), t.end("variation")) : t.empty("variation", i);
2133
- }
2134
- }, Tn = Object.freeze([
2135
- [0, 0],
2136
- [6e4, 0],
2137
- [8e4, 2e4],
2138
- [8e4, 0],
2139
- [6e4, 4e4],
2140
- [5e4, 0],
2141
- [7e4, 3e4],
2142
- [7e4, 0],
2143
- [5e4, 5e4]
2144
- ]), En = [
2145
- new class extends B {
2146
- constructor() {
2147
- super({
2148
- kind: "workbook",
2149
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
2150
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
2151
- path: "/xl/workbook.xml"
2152
- });
2153
- }
2154
- async emit(e, t) {
2155
- let n = t.getXMLWriter();
2156
- n.decl(), n.start("workbook", {
2157
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2158
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2159
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2160
- "mc:Ignorable": "x15 xr xr6 xr10 xr2",
2161
- "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main",
2162
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
2163
- "xmlns:xr6": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision6",
2164
- "xmlns:xr10": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision10",
2165
- "xmlns:xr2": "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"
2166
- });
2167
- let r = /* @__PURE__ */ new Set(), i = e.getCalculation().getNamedFormulas().getItems();
2168
- for (let e = 0; e < i.length; e++) r.add(i[e].getName().toUpperCase());
2169
- let a = l(r), o = await e.toJSON({
2170
- ignoreData: !0,
2171
- ignoreResources: !0,
2172
- includeHeaderStyles: !0,
2173
- formulaTransform: a,
2174
- splitDirectBorders: !0
2175
- });
2176
- (function(e, t, n) {
2177
- let r = {};
2178
- n.getRuntime().isDate1904() && (r.date1904 = "1"), t.empty("workbookPr", r);
2179
- })(0, n, e), function(e, t, n, r) {
2180
- let i = r.protection;
2181
- if (!i) return;
2182
- let a = {};
2183
- Pe(i.password ?? {}, a, "workbook"), Pe(i.revisionsPassword ?? {}, a, "revisions"), i.structure && (a.lockStructure = "1"), i.windows && (a.lockWindows = "1"), i.revision && (a.lockRevision = "1"), t.empty("workbookProtection", a);
2184
- }(0, n, 0, o), function(e, t, n) {
2185
- t.start("bookViews");
2186
- let r = n.getView(), i = {};
2187
- r.isShowHorizontalScrollbar() || (i.showHorizontalScroll = "0"), r.isShowVerticalScrollbar() || (i.showVerticalScroll = "0"), r.isShowTabs() || (i.showSheetTabs = "0");
2188
- let a = r.getTabRatio();
2189
- a !== 600 && (i.tabRatio = a);
2190
- let o = n.getSelectedSheet().getIndex();
2191
- o !== 0 && (i.activeTab = "" + o), t.empty("workbookView", i), t.end("bookViews");
2192
- }(0, n, e, o.view), n.start("sheets");
2193
- let s = t.getSharedStates();
2194
- s.set("formulaTransform", a);
2195
- let c = e.getStrings().beginPersist();
2196
- s.set("persistStrings", c);
2197
- let u = new Fe();
2198
- s.set("metaCollector", u);
2199
- let d = new Ie(u, t.warn.bind(t));
2200
- s.set("persistRichTypes", d);
2201
- try {
2202
- let r = e.getSheets().getItems({ visibility: P.Visibility.VeryHidden }), i = o.sheets, a = e.getSelectedSheet(), l = r.length;
2203
- for (let e = 0; e < l; e++) {
2204
- let o = r[e], s = "" + (o.getIndex() + 1), l = {
2205
- name: o.getName(),
2206
- sheetId: s
2207
- }, u = o.getVisibility();
2208
- u === "hidden" ? l.state = "hidden" : u === "veryHidden" && (l.state = "veryHidden");
2209
- let d = i[e].sheet;
2210
- l["r:id"] = t.addPart("worksheet", {
2211
- model: o,
2212
- isSelected: a === o,
2213
- json: d,
2214
- persistStrings: c
2215
- }).relId, n.empty("sheet", l);
2216
- }
2217
- await t.waitEmit();
2218
- let u = e.getTheme();
2219
- t.addPart("theme", {
2220
- model: u,
2221
- json: o.theme
2222
- }), await t.waitEmit(), t.addPart("styles", {
2223
- styles: e.getStyles(),
2224
- theme: e.getTheme(),
2225
- json: o.styles
2226
- }), await t.waitEmit();
2227
- let d = await c.toJSONAsync();
2228
- d && d.length > 0 && (t.addPart("sharedStrings", {
2229
- model: d,
2230
- json: d
2231
- }), await t.waitEmit());
2232
- let f = s.get("persistRichTypes");
2233
- f?.hasAny() && (t.addPart("richValue", f), t.addPart("richValueStructure", f), t.addPart("richValueTypes", null), await t.waitEmit());
2234
- let p = s.get("metaCollector");
2235
- p?.hasAny() && (t.addPart("metadata", p), await t.waitEmit()), s.delete("persistRichTypes"), s.delete("metaCollector"), s.delete("persistStrings");
2236
- } catch (e) {
2237
- throw e;
2238
- } finally {
2239
- c.endPersist();
2240
- }
2241
- n.end("sheets"), function(e, t, n, r, i) {
2242
- let a = r.names, o = a ? a.length : 0;
2243
- if (o === 0) return;
2244
- let s = n.getCalculation().getNamedFormulas(), c = /* @__PURE__ */ new Map(), l = n.getSheets().getItems({ visibility: P.Visibility.VeryHidden });
2245
- for (let e = 0; e < l.length; e++) c.set(l[e].getName().toLowerCase(), e);
2246
- t.start("definedNames");
2247
- for (let n = 0; n < o; n++) {
2248
- let r = a[n], o = { name: r.name };
2249
- if (r.comment && (o.comment = r.comment), r.scope) {
2250
- let t = c.get(r.scope.toLowerCase());
2251
- t === void 0 ? e.warn(`Defined name '${r.name}' is scoped to unknown sheet '${r.scope}'; writing it as global.`) : o.localSheetId = "" + t;
2252
- }
2253
- r.hidden && (o.hidden = "1");
2254
- let l = r.ref, u = s.getItems({
2255
- name: r.name,
2256
- scope: r.scope ?? null
2257
- })[0];
2258
- u && (l = u.getExpression({ formulaTransform: i })), t.start("definedName", o), t.text(l), t.end("definedName");
2259
- }
2260
- t.end("definedNames");
2261
- }(t, n, e, o, a), function(e, t, n) {
2262
- let r = n.getCalculation().toJSON(), i = {}, a = (e, t) => {
2263
- let n = r[e];
2264
- typeof n == "boolean" && (i[t] = n ? "1" : "0");
2265
- };
2266
- if (r.calcMode) {
2267
- let e = Re[r.calcMode];
2268
- e && e !== "auto" && (i.calcMode = e);
2269
- }
2270
- a("fullCalcOnLoad", "fullCalcOnLoad"), a("calcOnSave", "calcOnSave"), a("calcCompleted", "calcCompleted"), a("fullPrecision", "fullPrecision"), a("forceFullCalc", "forceFullCalc"), a("concurrentCalc", "concurrentCalc"), r.refMode && (i.refMode = r.refMode), r.iterate && (i.iterate = "1"), r.maxIterations !== void 0 && (i.iterateCount = String(r.maxIterations)), r.maxIterateChange !== void 0 && (i.iterateDelta = String(r.maxIterateChange)), Object.keys(i).length !== 0 && t.empty("calcPr", i);
2271
- }(0, n, e), n.end("workbook"), n.close();
2272
- }
2273
- }(),
2274
- new class extends B {
2275
- constructor() {
2276
- super({
2277
- kind: "worksheet",
2278
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
2279
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
2280
- path: () => "/xl/worksheets/sheet{n}.xml"
2281
- });
2282
- }
2283
- async emit(n, i) {
2284
- let s = i.getXMLWriter(), c = n.model, l = n.json;
2285
- s.decl(), s.start("worksheet", {
2286
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2287
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2288
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2289
- "mc:Ignorable": "x14ac",
2290
- "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
2291
- }), function(e, t, n) {
2292
- let r = n.getTabColor();
2293
- r && (t.start("sheetPr"), r && G(t, n.getStyles().getTheme(), r, "tabColor", !1), t.end("sheetPr"));
2294
- }(0, s, c), function(e, t, n, r) {
2295
- let i = n.getUsedRange({ features: [] }), a = i ? i.getCoords() : null, o = St, s = Ct, c = r.directStyles, l = c ? c.length : 0;
2296
- for (let e = 0; e < l; e++) {
2297
- let t = n.getRange(c[e][0]).getCoords();
2298
- if (t.colEnd === s) {
2299
- let e = a?.colStart ?? 0;
2300
- t = {
2301
- ...t,
2302
- colStart: e,
2303
- colEnd: e
2304
- };
2305
- }
2306
- if (t.rowEnd === o) {
2307
- let e = a?.rowStart ?? 0;
2308
- t = {
2309
- ...t,
2310
- rowStart: e,
2311
- rowEnd: e
2312
- };
2313
- }
2314
- a = O.unionRanges(a, t);
2315
- }
2316
- let u = r.merges, d = u ? u.length : 0;
2317
- for (let e = 0; e < d; e++) {
2318
- let t = n.getRange(u[e]).getCoords();
2319
- t.colEnd === s && (t = { ...a }, t.colStart = a?.colStart ?? 0, t.colEnd = t.colStart), t.rowEnd === o && (t = { ...t }, t.rowStart = a?.rowStart ?? 0, t.rowEnd = t.rowStart), a = O.unionRanges(a, t);
2320
- }
2321
- let f = "A1";
2322
- a && (i = n.getRange(a), f = a.colStart === a.colEnd && a.rowStart === a.rowEnd ? i.getAddress() : `${i.getIntersect({
2323
- colStart: a.colStart,
2324
- rowStart: a.rowStart,
2325
- colEnd: a.colStart,
2326
- rowEnd: a.rowStart
2327
- }).getAddress()}:${i.getIntersect({
2328
- colStart: a.colEnd,
2329
- rowStart: a.rowEnd,
2330
- colEnd: a.colEnd,
2331
- rowEnd: a.rowEnd
2332
- }).getAddress()}`), t.empty("dimension", { ref: f });
2333
- }(0, s, c, l), function(e, t, n, r, i) {
2334
- let a = n.getView(), o = a.getTopLeft(), s = n.getRowHeaders().getIndex(o.top), c = n.getColumnHeaders().getIndex(o.left), l = T.cellToString({
2335
- colIndex: c,
2336
- rowIndex: s
2337
- });
2338
- t.start("sheetViews");
2339
- let u = {};
2340
- a.isShowFormulas() && (u.showFormulas = "1"), a.isShowColumnGridlines() || a.isShowRowGridlines() || (u.showGridLines = "0"), a.isShowColumnHeaders() || a.isShowRowHeaders() || (u.showRowColHeaders = "0"), a.isShowZeros() || (u.showZeros = "0"), a.isRightToLeft() && (u.rightToLeft = "1"), i && (u.tabSelected = "1"), l !== "A1" && (u.topLeftCell = l);
2341
- let d = a.getZoomScale();
2342
- d !== 100 && (u.zoomScale = d, u.zoomScaleNormal = d);
2343
- let f = a.getGridLineColor();
2344
- if (f) {
2345
- u.defaultGridColor = "0";
2346
- let e = f.toRGBA(), t = e.red, r = e.green, i = e.blue, a = n.getStyles().getIndexedColors(), o = a.length, s = 0, c = Number.MAX_VALUE;
2347
- for (let e = 0; e < o; e++) {
2348
- let n = a[e].toRGBA(), o = (t - n.red) ** 2 + (r - n.green) ** 2 + (i - n.blue) ** 2;
2349
- o < c && (c = o, s = e);
2350
- }
2351
- u.colorId = "" + s;
2352
- }
2353
- u.workbookViewId = "0";
2354
- let p = n.getSelection().getCoords(), m = T.cellToString(p.cell), h = {}, g = a.getFreezePanes(), _ = g.coords ?? {}, v = _.colIndex ?? 0, y = _.rowIndex ?? 0;
2355
- if (v > 0 || y > 0) {
2356
- let e = g.topLeft ?? {}, r = e.top ?? 0, i = e.left ?? 0, a = n.getRowHeaders().getIndex(r), s = n.getColumnHeaders().getIndex(i), c = v - s, l = y - a, d = Math.max(v, n.getColumnHeaders().getIndex(o.left + n.getColumnHeaders().getOffset(v) - i)), f = Math.max(y, n.getRowHeaders().getIndex(o.top + n.getRowHeaders().getOffset(y) - r)), p = T.cellToString({
2357
- colIndex: s,
2358
- rowIndex: a
2359
- });
2360
- p === "A1" ? delete u.topLeftCell : u.topLeftCell = p, t.start("sheetView", u);
2361
- let m = {};
2362
- if (c > 0 && (m.xSplit = c), l > 0 && (m.ySplit = l), m.topLeftCell = T.cellToString({
2363
- colIndex: d,
2364
- rowIndex: f
2365
- }), m.state = "frozen", v === 0) {
2366
- m.activePane = "bottomLeft", t.empty("pane", m);
2367
- let e = T.cellToString({
2368
- colIndex: d,
2369
- rowIndex: a
2370
- });
2371
- e !== "A1" && t.empty("selection", {
2372
- activeCell: e,
2373
- sqref: e
2374
- }), h.pane = "bottomLeft";
2375
- } else if (y === 0) {
2376
- m.activePane = "topRight", t.empty("pane", m);
2377
- let e = T.cellToString({
2378
- colIndex: s,
2379
- rowIndex: f
2380
- });
2381
- e !== "A1" && t.empty("selection", {
2382
- activeCell: e,
2383
- sqref: e
2384
- }), h.pane = "topRight";
2385
- } else {
2386
- m.activePane = "bottomRight", t.empty("pane", m), p !== "A1" && t.empty("selection", {
2387
- activeCell: p,
2388
- sqref: p
2389
- });
2390
- let e = T.cellToString({
2391
- colIndex: d,
2392
- rowIndex: a
2393
- });
2394
- t.empty("selection", {
2395
- pane: "topRight",
2396
- activeCell: e,
2397
- sqref: e
2398
- });
2399
- let n = T.cellToString({
2400
- colIndex: s,
2401
- rowIndex: f
2402
- });
2403
- t.empty("selection", {
2404
- pane: "bottomLeft",
2405
- activeCell: n,
2406
- sqref: n
2407
- }), h.pane = "bottomRight";
2408
- }
2409
- } else t.start("sheetView", u);
2410
- h.activeCell = m;
2411
- let b = p.ranges, x = b ? b.length : 0;
2412
- if (x > 0) {
2413
- let e = "";
2414
- for (let t = 0; t < x; t++) {
2415
- let n = b[t];
2416
- t > 0 && (e += " "), e += T.rangeToString(n);
2417
- }
2418
- h.sqref = e, (p.rangeIndex ?? 0) > 0 && (h.activeCellId = "" + p.rangeIndex);
2419
- } else m === "A1" ? h = null : h.sqref = m;
2420
- h && t.empty("selection", h), t.end("sheetView"), t.end("sheetViews");
2421
- }(0, s, c, 0, n.isSelected), function(e, t, n, r) {
2422
- let i = r.defaultColSize, a = r.defaultRowSize, o = {};
2423
- i !== void 0 && (o.defaultColWidth = i), o.defaultRowHeight = a ?? .75 * n.getRowHeaders().getDefaultSize(), a !== void 0 && (o.customHeight = "1"), o["x14ac:dyDescent"] = "0.25", t.empty("sheetFormatPr", o);
2424
- }(0, s, c, l), function(e, t, n, r) {
2425
- let i = r.cols ? T.refsToRuns(r.cols, !0) : null, a = i ? i.length : 0;
2426
- n.getEntireRange().getColumnEnd();
2427
- let o = n.getColumnHeaders().getDefaultSizeNative();
2428
- if (a > 0) {
2429
- t.start("cols");
2430
- for (let e = 0; e < a; e++) {
2431
- let n = i[e], r = n.min + 1, a = 16384;
2432
- if (r > a) continue;
2433
- let s = {
2434
- min: r,
2435
- max: Math.min(n.max + 1, a)
2436
- }, c = n.value, l = c.sz;
2437
- l === void 0 ? s.width = o : l !== 0 && (s.width = Math.round(256 * l) / 256), c.s && (s.style = c.s), c.h !== void 0 && (s.hidden = 1), c.csz && (s.customWidth = 1), c.l !== void 0 && (s.outlineLevel = c.l), c.cl !== void 0 && (s.collapsed = 1), t.empty("col", s);
2438
- }
2439
- t.end("cols");
2440
- }
2441
- }(0, s, c, l), function(n, r, i, a, o) {
2442
- let s = n.getSharedStates(), c = s.get("persistStrings"), l = s.get("metaCollector"), u = s.get("persistRichTypes"), d = s.get("formulaTransform"), p = 0, m = 0, _ = i.getUsedRange(), v = 0, y = a.rows ? T.refsToRuns(a.rows, !1) : null, x = y ? y.length : 0, S = y?.[x - 1]?.max ?? -1, w = a.cols ? T.refsToRuns(a.cols, !0) : null, E = w ? w.length : 0, te = w?.[E - 1]?.max ?? -1;
2443
- if (_ || x > 0) {
2444
- let s = .75, _ = a.defaultRowSize ?? i.getRowHeaders().getDefaultSize() * s, x = i.getStyles().getNormal().getBestFit().height * s, E = (e, t) => {
2445
- let n = Lt;
2446
- if (n.r = "" + (e + 1), n.s = void 0, n.customFormat = void 0, n.hidden = void 0, n.ht = void 0, n.customHeight = void 0, n.outlineLevel = void 0, n.collapsed = void 0, !t) return n;
2447
- let r = t.value;
2448
- r.s !== void 0 && (n.s = "" + r.s, n.customFormat = "1"), r.h && (n.hidden = "1");
2449
- let i = r.csz ?? !1, a = r.sz ?? _;
2450
- return (a !== x || i) && (n.ht = "" + a), i && (n.customHeight = "1"), r.l !== void 0 && (n.outlineLevel = "" + r.l), r.cl !== void 0 && (n.collapsed = "" + r.cl), n;
2451
- }, D = 0, O = y?.[D] ?? null, k = O?.min ?? 2 ** 53 - 1, A = O?.max ?? 2 ** 53 - 1, j = O?.value?.s, M = -1, N = 0, P = w?.[N] ?? null, F = P?.min ?? 2 ** 53 - 1, I = P?.max ?? 2 ** 53 - 1, L = P?.value?.s, re = (e, t = !1) => {
2452
- if (M !== e) {
2453
- for (M !== -1 && (r.end("row"), N !== 0 && (N = 0, P = w?.[N] ?? null, F = P?.min ?? 2 ** 53 - 1, I = P?.max ?? 2 ** 53 - 1, L = P?.value?.s)); M + 1 <= e;) {
2454
- M++, O && M > A && (O = y[++D] ?? null, O ? (k = O.min, A = O.max, j = O.value?.s) : (k = 2 ** 53 - 1, A = 2 ** 53 - 1, j = void 0)), M < k && M < e && (M = O ? Math.min(k, e) : e);
2455
- let n = M < e || t && M === e, i = E(M, O && M >= k && M <= A ? O : null);
2456
- n ? r.empty("row", i) : r.start("row", i);
2457
- }
2458
- if (e < M) {
2459
- let t = E(e, null);
2460
- r.start("row", t);
2461
- }
2462
- }
2463
- };
2464
- r.setValidationDisabled(!0), r.start("sheetData");
2465
- let R = [];
2466
- R.push(Et(n, i, a.directStyles));
2467
- let B = a.formulas, ie = B ? B.length : 0;
2468
- if (ie > 0) {
2469
- let n = /* @__PURE__ */ new Map();
2470
- if (o.names.size > 0 && a.formulaArray) for (let e of a.formulaArray) try {
2471
- let t = i.getRange(e[0]).getCoords();
2472
- n.set(`${t.rowStart},${t.colStart}`, t);
2473
- } catch {}
2474
- let r = [];
2475
- if (a.formulaArray) for (let e of a.formulaArray) try {
2476
- r.push(i.getRange(e[0]).getCoords());
2477
- } catch {}
2478
- let s = (e) => {
2479
- for (let t = 0; t < r.length; t++) {
2480
- let n = r[t];
2481
- if (n.rowStart <= e.rowEnd && n.rowEnd >= e.rowStart && n.colStart <= e.colEnd && n.colEnd >= e.colStart) return !0;
2482
- }
2483
- return !1;
2484
- }, c = C(() => i.getCalculation()), l = (e) => {
2485
- if (!e) return;
2486
- let t;
2487
- return e.getExpression({ formulaTransform: (e, n) => {
2488
- n === void 0 && (t = e);
2489
- } }), t;
2490
- }, u = [];
2491
- for (let r = 0; r < ie; r++) {
2492
- let a = B[r];
2493
- try {
2494
- let p = a[0], m = i.getRange(p), h = m.getCoords(), _ = a[1], y = null, b = l(m.getCell().getFormula()), x = !!b && t(b, c), S = e(b);
2495
- if (o.affects(r)) {
2496
- y = null, x = !1;
2497
- let e = (e, t, n) => {
2498
- let r = {
2499
- rowStart: e,
2500
- colStart: t,
2501
- rowEnd: e,
2502
- colEnd: t
2503
- };
2504
- u.push([r, {
2505
- coords: r,
2506
- formula: n,
2507
- sharedId: null,
2508
- ref: T.rangeToString(r),
2509
- isDynamicRange: !1,
2510
- isWrapped: !0
2511
- }]);
2512
- }, t = n.get(`${h.rowStart},${h.colStart}`), r = t !== void 0 && (t.rowEnd > t.rowStart || t.colEnd > t.colStart), a = !1;
2513
- if (r) {
2514
- let n = g(_, m.getCell().getValue());
2515
- if (n !== null) for (let r = t.rowStart; r <= t.rowEnd; r++) for (let o = t.colStart; o <= t.colEnd; o++) {
2516
- if (r === t.rowStart && o === t.colStart) {
2517
- e(r, o, n), a = !0;
2518
- continue;
2519
- }
2520
- let s = f(i.getRange(T.rangeToString({
2521
- rowStart: r,
2522
- colStart: o,
2523
- rowEnd: r,
2524
- colEnd: o
2525
- })).getCell().getValue());
2526
- s !== null && e(r, o, s);
2527
- }
2528
- } else {
2529
- let t = m.getCells();
2530
- for (let n = 0; n < t.length; n++) {
2531
- let r = t[n];
2532
- for (let t = 0; t < r.length; t++) {
2533
- let i = r[t], o = g(i.getFormula()?.getExpression() ?? _, i.getValue());
2534
- o !== null && (e(h.rowStart + n, h.colStart + t, o), a = !0);
2535
- }
2536
- }
2537
- }
2538
- if (a) continue;
2539
- }
2540
- let ee = _.indexOf("!") !== -1 || _.indexOf("[") !== -1, C;
2541
- if (x || m.isSingleCell() || ee || s(h) || (y = "" + v++), y === null && !m.isSingleCell()) {
2542
- C = [];
2543
- let e = m.getCells();
2544
- for (let t = 0; t < e.length; t++) {
2545
- let n = e[t], r = Array(n.length);
2546
- for (let e = 0; e < n.length; e++) t === 0 && e === 0 || (r[e] = n[e].getFormula()?.getExpression({ formulaTransform: d }) ?? void 0);
2547
- C.push(r);
2548
- }
2549
- }
2550
- let w = [h, {
2551
- coords: h,
2552
- formula: _,
2553
- sharedId: y,
2554
- ref: p,
2555
- isDynamicRange: x,
2556
- isExcelVolatile: S,
2557
- memberTexts: C
2558
- }];
2559
- u.push(w);
2560
- } catch (e) {
2561
- console.warn(`Failed to parse formula: ${a[1]}`, e);
2562
- continue;
2563
- }
2564
- }
2565
- R.push(u);
2566
- } else R.push([]);
2567
- let ae = a.volatile, oe = ae ? ae.length : 0;
2568
- if (oe > 0) {
2569
- let e = Array(oe);
2570
- for (let t = 0; t < oe; t++) {
2571
- let n = ae[t];
2572
- try {
2573
- e[t] = [i.getRange(n).getCoords(), !0];
2574
- } catch (e) {
2575
- console.warn(`Failed to parse volatile: ${n}`, e);
2576
- continue;
2577
- }
2578
- }
2579
- R.push(e);
2580
- } else R.push([]);
2581
- let se = a.formulaArray, V = se ? se.length : 0;
2582
- if (V > 0) {
2583
- let e = Array(V);
2584
- for (let t = 0; t < V; t++) {
2585
- let n = se[t];
2586
- try {
2587
- let r = n[0];
2588
- e[t] = [i.getRange(r).getCoords(), {
2589
- ref: r,
2590
- kind: n[1] ?? "dynamic"
2591
- }];
2592
- } catch (e) {
2593
- console.warn(`Failed to parse formula array: ${n}`, e);
2594
- continue;
2595
- }
2596
- }
2597
- R.push(e);
2598
- } else R.push([]);
2599
- i.getEntireRange().forEach((e, t) => {
2600
- let i = t.getCoords(), a = i.rowIndex, o = i.colIndex;
2601
- M !== a && re(a);
2602
- let s = t.getInjectedReference(0);
2603
- if (s === void 0 && j !== void 0 && a >= k && a <= A && (s = j), s === void 0) {
2604
- for (; o <= te && o > I;) N++, P = w?.[N] ?? null, F = P?.min ?? 2 ** 53 - 1, I = P?.max ?? 2 ** 53 - 1, L = P?.value?.s;
2605
- L !== void 0 && o >= F && o <= I && (s = L);
2606
- }
2607
- let d = t.getType(), f = null;
2608
- ie > 0 && (f = t.getInjectedReference(1) ?? null);
2609
- let g = !1;
2610
- oe > 0 && (g = t.getInjectedReference(2) ?? !1);
2611
- let _ = null;
2612
- V > 0 && (_ = t.getInjectedReference(3) ?? null);
2613
- let v = _?.kind === "dynamicSpillError", y = _?.kind === "static", x = It;
2614
- x.r = t.getAddress(), x.s = void 0, x.t = void 0, x.cm = void 0, x.vm = void 0, s !== void 0 && s !== 0 && (x.s = "" + s);
2615
- let S = null, C = null;
2616
- switch (d) {
2617
- case z.Boolean:
2618
- S = e ? "1" : "0", C = "b";
2619
- break;
2620
- case z.Error:
2621
- let t = e.getCode();
2622
- if (C = "e", t > 7) S = ne.BuiltIn.Value.getLabel(), x.vm = "" + u.add(e);
2623
- else if (t < 1) {
2624
- let t;
2625
- C = "s", f ? (t = "=" + f.formula, f = null) : t = "" + e.getLabel(), S = "" + c.add(t), p++;
2626
- } else S = "" + e.getLabel();
2627
- break;
2628
- case z.Number:
2629
- S = "" + e, C = null;
2630
- break;
2631
- case z.String:
2632
- S = e, f ? (C = "str", S = e) : (C = "s", S = "" + c.add(S), p++);
2633
- break;
2634
- case z.RichData: C = "e", S = ne.BuiltIn.Value.getLabel(), x.vm = "" + u.add(e);
2635
- }
2636
- C && (x.t = C);
2637
- let T = !f?.isWrapped && (_ !== null || (f?.isDynamicRange ?? !1));
2638
- if (f !== null || S !== null) {
2639
- if (T && f !== null && !y && (x.cm = "" + l.registerArrayCell(v)), r.start("c", x), f) {
2640
- let e = f.memberTexts?.[a - f.coords.rowStart]?.[o - f.coords.colStart] ?? f.formula, t, n = null, i = f.sharedId;
2641
- if (i) {
2642
- t = zt;
2643
- let e = f.coords;
2644
- e.colStart === o && e.rowStart === a ? (t.ref = f.ref, t.si = i, n = f.formula) : (t.ref = void 0, t.si = i);
2645
- } else T ? (t = Bt, t.aca = v ? "1" : void 0, t.ref = v ? x.r : _?.ref ?? x.r, n = e) : (t = Rt, n = e);
2646
- t.ca = g || v || f.isExcelVolatile ? "1" : void 0, n ? (r.start("f", t), r.text(n), r.end("f")) : r.empty("f", t);
2647
- }
2648
- S !== null && (C === "str" && S ? (r.start("v", ee.test(S) ? b : void 0), r.text(h(S))) : (r.start("v"), S && r.text(S)), r.end("v")), r.end("c");
2649
- } else m++ < Tt ? r.empty("c", x) : m === 1048577 && n.warn(`Reached ${Tt} style-only cells at '${x.r}'; not writing the rest.`);
2650
- }, {
2651
- injectReferences: R,
2652
- features: []
2653
- }), M !== -1 && M >= S ? r.end("row") : re(S, !0), r.end("sheetData"), r.setValidationDisabled(!1);
2654
- } else r.empty("sheetData");
2655
- if (p > 0) {
2656
- let e = s.get("stringsCount") ?? 0;
2657
- s.set("stringsCount", e + p);
2658
- }
2659
- }(i, s, c, l, await (async (e, t) => {
2660
- let n = t ? t.length : 0;
2661
- if (n === 0) return wt;
2662
- let r = /* @__PURE__ */ new Set(), i = Array(n);
2663
- for (let a = 0; a < n; a++) {
2664
- i[a] = null;
2665
- try {
2666
- let n = e.getRange(t[a][0]).getCell().getFormula()?.getTokens();
2667
- if (!n) continue;
2668
- let o = null;
2669
- for (let e = 0; e < n.length; e++) {
2670
- let t = n[e], i = null;
2671
- t.type === "function" ? i = String(t.value) : t.type === "named" && n[e + 1]?.type === "paren" && n[e + 1].value === "(" && (i = String(t.value?.name ?? "")), i && (i = i.toUpperCase(), r.add(i), (o ??= /* @__PURE__ */ new Set()).add(i));
2672
- }
2673
- i[a] = o;
2674
- } catch {}
2675
- }
2676
- let a = e.getWorkbook();
2677
- if (!a) return wt;
2678
- let o = await _(a, r);
2679
- return o.size === 0 ? wt : {
2680
- names: o,
2681
- perFormula: i,
2682
- affects: (e) => {
2683
- let t = i[e];
2684
- if (!t) return !1;
2685
- for (let e of t) if (o.has(e)) return !0;
2686
- return !1;
2687
- }
2688
- };
2689
- })(c, l.formulas)), function(e, t, n, r) {
2690
- let i = r.protection;
2691
- if (!i) return;
2692
- let a = {};
2693
- Pe(i.password ?? {}, a), a.sheet = "1";
2694
- let o = (e, t, n) => {
2695
- let r = i[e];
2696
- r !== void 0 && r !== t && (a[n ?? e] = r ? "1" : "0");
2697
- };
2698
- o("objects", "0"), o("scenarios", "0"), o("formatCells", "0"), o("formatColumns", "0"), o("formatRows", "0"), o("insertColumns", "0"), o("insertRows", "0"), o("insertHyperlinks", "0"), o("deleteColumns", "0"), o("deleteRows", "0"), o("selectLockedCells", "1"), o("sort", "0"), o("autoTable", "0", "autoFilter"), o("pivotTables", "0"), o("selectUnlockedCells", "1"), t.empty("sheetProtection", a);
2699
- }(0, s, 0, l), function(e, t, n, r) {
2700
- let i = r.protectedRanges, a = i ? i.length : 0;
2701
- if (a === 0) return;
2702
- let o = [];
2703
- for (let t = 0; t < a; t++) {
2704
- let n = i[t], r, a;
2705
- Array.isArray(n) ? (r = n[0], a = n[1]) : (r = n.r, a = n.v);
2706
- let s = Nt(r);
2707
- if (!s || !a) {
2708
- e.warn("Skipping protectedRange with no range.");
2709
- continue;
2710
- }
2711
- if (!a.name) {
2712
- e.warn("Skipping protectedRange with no name.");
2713
- continue;
2714
- }
2715
- let c = {};
2716
- Pe(a.password ?? {}, c), c.sqref = s, c.name = a.name, a.securityDescriptor && (c.securityDescriptor = a.securityDescriptor), o.push(c);
2717
- }
2718
- if (o.length !== 0) {
2719
- t.start("protectedRanges");
2720
- for (let e = 0; e < o.length; e++) t.empty("protectedRange", o[e]);
2721
- t.end("protectedRanges");
2722
- }
2723
- }(i, s, 0, l);
2724
- let u = l.autoTable;
2725
- if (u) {
2726
- let e, t = u;
2727
- e = Array.isArray(t) ? t[1] : t.v, _t(i, s, c.getAutoTable(), e, !0);
2728
- }
2729
- (function(e, t, n, r) {
2730
- let i = r.merges ? r.merges.length : 0;
2731
- if (i > 0) {
2732
- t.start("mergeCells", { count: i });
2733
- for (let e = 0; e < i; e++) {
2734
- let n = r.merges[e], i = typeof n == "string" ? n : T.rangeToString(n);
2735
- t.empty("mergeCell", { ref: i });
2736
- }
2737
- t.end("mergeCells");
2738
- }
2739
- })(0, s, 0, l);
2740
- let p = function(e, t, n, r) {
2741
- let i = [], o = r.conditionals, s = o ? o.length : 0;
2742
- if (s === 0) return i;
2743
- let c = e.getSharedStates(), l = c.get(it);
2744
- l || (l = new rt(), c.set(it, l));
2745
- let u = n.getStyles().getTheme(), d = null, f = 0;
2746
- for (let n = 0; n < s; n++) {
2747
- let r = o[n], s, c;
2748
- Array.isArray(r) ? (s = r[0], c = r[1]) : (s = r.r, c = r.v);
2749
- let p = Nt(s);
2750
- if (!p || !c) {
2751
- e.warn("Skipping conditionalFormatting with no range.");
2752
- continue;
2753
- }
2754
- let m = c.scale, h = m ? { type: m.type } : S(c.condition, Mt(p), (t) => e.warn(t));
2755
- h ? m?.type === j.ScaleType.IconSet && At(m) ? (f++, i.push({
2756
- guid: a(D.uuidV4),
2757
- sqref: p,
2758
- priority: f,
2759
- scale: m
2760
- })) : m || !Ft(h) ? (p !== d && (d !== null && t.end("conditionalFormatting"), t.start("conditionalFormatting", {
2761
- sqref: p,
2762
- pivot: c.pivot ? "1" : void 0
2763
- }), d = p), f++, jt(e, t, u, c, h, p, f, l, i)) : (f++, i.push({
2764
- guid: a(D.uuidV4),
2765
- sqref: p,
2766
- priority: f,
2767
- rule: h,
2768
- style: c.style,
2769
- stopIfTrue: c.stopIfTrue
2770
- })) : c.condition || e.warn("Skipping conditional format with neither a condition nor a scale.");
2771
- }
2772
- return d !== null && t.end("conditionalFormatting"), i;
2773
- }(i, s, c, l), m = function(e, t, n, r) {
2774
- let i = [], a = r.validations, o = a ? a.length : 0;
2775
- if (o === 0) return i;
2776
- let s = [];
2777
- for (let t = 0; t < o; t++) {
2778
- let n = a[t], r, o;
2779
- Array.isArray(n) ? (r = n[0], o = n[1]) : (r = n.r, o = n.v);
2780
- let c = Nt(r);
2781
- if (!c || !o) {
2782
- e.warn?.("Skipping dataValidation with no range.");
2783
- continue;
2784
- }
2785
- o.ext && e.warn("DataValidation extension payload is not written to xlsx; it will be lost.");
2786
- let { type: l, operator: u, formula1: d, formula2: f } = x(o.condition, (t) => e.warn(t)) ?? {}, p = {
2787
- type: l,
2788
- operator: u,
2789
- allowBlank: Z(o.condition?.includeBlanks ?? !1),
2790
- showDropDown: o.hideDropdown ? "1" : void 0,
2791
- showInputMessage: Z(o.showPromptMessage),
2792
- showErrorMessage: Z(o.showAlertMessage),
2793
- errorStyle: o.alertStyle ?? "information",
2794
- errorTitle: o.alertTitle,
2795
- error: o.alert,
2796
- promptTitle: o.promptTitle,
2797
- prompt: o.prompt,
2798
- imeMode: o.imeMode
2799
- };
2800
- Pt(d) || Pt(f) ? i.push({
2801
- attrs: p,
2802
- formula1: d,
2803
- formula2: f,
2804
- sqref: c
2805
- }) : (p.sqref = c, s.push({
2806
- attrs: p,
2807
- formula1: d,
2808
- formula2: f
2809
- }));
2810
- }
2811
- if (s.length === 0) return i;
2812
- t.start("dataValidations", { count: s.length });
2813
- for (let e = 0; e < s.length; e++) {
2814
- let { attrs: n, formula1: r, formula2: i } = s[e];
2815
- r !== void 0 || i !== void 0 ? (t.start("dataValidation", n), r !== void 0 && (t.start("formula1"), t.text(r), t.end("formula1")), i !== void 0 && (t.start("formula2"), t.text(i), t.end("formula2")), t.end("dataValidation")) : t.empty("dataValidation", n);
2816
- }
2817
- return t.end("dataValidations"), i;
2818
- }(i, s, 0, l);
2819
- (function(e, t, n, r) {
2820
- let i = r.hyperlinks, a = i ? i.length : 0;
2821
- if (a !== 0) {
2822
- t.start("hyperlinks");
2823
- for (let n = 0; n < a; n++) {
2824
- let r, a, o = i[n];
2825
- Array.isArray(o) ? (a = o[0], r = o[1]) : (a = o.r, r = o.v), typeof r == "string" && (r = { address: r });
2826
- let s = r.address ?? "", c = s.indexOf("#"), l = c === -1 ? s : s.substring(0, c), u = c === -1 ? "" : s.substring(c + 1), d = {};
2827
- d.ref = a, l && (d["r:id"] = e.addExternal("http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", l).relId), u && (d.location = u), r.screenTip && (d.tooltip = r.screenTip), t.empty("hyperlink", d);
2828
- }
2829
- t.end("hyperlinks");
2830
- }
2831
- })(i, s, 0, l), function(e, t, n, r) {
2832
- let i = r.pageMargins;
2833
- t.empty("pageMargins", {
2834
- left: i?.left ?? .7,
2835
- right: i?.right ?? .7,
2836
- top: i?.top ?? .75,
2837
- bottom: i?.bottom ?? .75,
2838
- header: i?.header ?? .3,
2839
- footer: i?.footer ?? .3
2840
- });
2841
- }(0, s, 0, l), function(e, t, n, r) {
2842
- let i = r.movables;
2843
- if ((i ? i.length : 0) === 0 || !i.some((e) => {
2844
- let t = e.content?.type;
2845
- if (t === "picture" || t === "chart") return !0;
2846
- if (t === "shape") {
2847
- let t = e.content?.json?.type;
2848
- return t === "sp" || t === "cxnSp";
2849
- }
2850
- return !1;
2851
- })) return;
2852
- let a = n.getMovables().getItems(), o = e.addPart("drawing", {
2853
- sheet: n,
2854
- movables: a,
2855
- jsonMovables: i,
2856
- resources: n.getResources()
2857
- });
2858
- t.empty("drawing", { "r:id": o.relId });
2859
- }(i, s, c, l), function(e, t, n, r) {
2860
- let i = r.tables, a = i ? i.length : 0;
2861
- if (a === 0) return;
2862
- let o = n.getTables().getItems();
2863
- t.start("tableParts", { count: a });
2864
- for (let n = 0; n < a; n++) {
2865
- let r, a, s = i[n];
2866
- Array.isArray(s) ? (a = s[0], r = s[1]) : (a = s.r, r = s.v);
2867
- let c = e.addPart("table", {
2868
- json: r,
2869
- model: o[n],
2870
- ref: a
2871
- }), l = {};
2872
- l["r:id"] = c.relId, t.empty("tablePart", l);
2873
- }
2874
- t.end("tableParts");
2875
- }(i, s, c, l), function(e, t, n, i, a) {
2876
- if (i.length === 0 && a.length === 0) return;
2877
- let s = n.getStyles(), c = s.getTheme();
2878
- if (t.start("extLst"), i.length > 0) {
2879
- t.start("ext", {
2880
- uri: o,
2881
- "xmlns:x14": r
2882
- }), t.start("x14:conditionalFormattings");
2883
- for (let e = 0; e < i.length; e++) {
2884
- let { guid: n, sqref: r, priority: a, scale: o, rule: l, style: u, stopIfTrue: f } = i[e];
2885
- if (t.start("x14:conditionalFormatting", { "xmlns:xm": d }), o) if (o.type === j.ScaleType.DataBar) {
2886
- t.start("x14:cfRule", {
2887
- type: "dataBar",
2888
- id: n
2889
- }), t.start("x14:dataBar", {
2890
- minLength: o.minLength,
2891
- maxLength: o.maxLength,
2892
- gradient: o.gradient ? void 0 : "0",
2893
- border: o.borderColor ? "1" : void 0,
2894
- direction: o.direction,
2895
- negativeBarColorSameAsPositive: o.negativeFillColor ? "0" : "1",
2896
- negativeBarBorderColorSameAsPositive: o.negativeBorderColor ? "0" : void 0,
2897
- axisPosition: o.axisPosition
2898
- });
2899
- let e = o.stops ?? [];
2900
- if (e.length === 0) Ot(t, { type: j.ColorStopType.AutoMin }), Ot(t, { type: j.ColorStopType.AutoMax });
2901
- else for (let n = 0; n < e.length; n++) Ot(t, e[n]);
2902
- o.borderColor && G(t, c, o.borderColor, "x14:borderColor"), o.negativeFillColor && G(t, c, o.negativeFillColor, "x14:negativeFillColor"), o.negativeBorderColor && G(t, c, o.negativeBorderColor, "x14:negativeBorderColor"), o.axisColor && G(t, c, o.axisColor, "x14:axisColor"), t.end("x14:dataBar"), t.end("x14:cfRule");
2903
- } else {
2904
- t.start("x14:cfRule", {
2905
- type: "iconSet",
2906
- priority: a,
2907
- id: n
2908
- }), t.start("x14:iconSet", {
2909
- iconSet: o.iconSet,
2910
- reverse: Z(o.reverse),
2911
- showValue: Z(o.showValue),
2912
- custom: (o.icon?.length ?? 0) > 0 ? "1" : void 0
2913
- });
2914
- let e = o.stops ?? [];
2915
- for (let n = 0; n < e.length; n++) Ot(t, e[n]);
2916
- let r = o.icon ?? [];
2917
- for (let e = 0; e < r.length; e++) t.empty("x14:cfIcon", {
2918
- iconSet: r[e].set,
2919
- iconId: r[e].id
2920
- });
2921
- t.end("x14:iconSet"), t.end("x14:cfRule");
2922
- }
2923
- else {
2924
- t.start("x14:cfRule", {
2925
- type: l.type,
2926
- priority: a,
2927
- stopIfTrue: Z(f),
2928
- aboveAverage: Z(l.aboveAverage),
2929
- equalAverage: Z(l.equalAverage),
2930
- stdDev: l.stdDev,
2931
- bottom: Z(l.bottom),
2932
- percent: Z(l.percent),
2933
- rank: l.rank,
2934
- operator: l.operator,
2935
- text: l.text,
2936
- timePeriod: l.timePeriod,
2937
- id: n
2938
- });
2939
- let e = l.formulas ?? [];
2940
- for (let n = 0; n < e.length; n++) t.start("xm:f"), t.text(e[n]), t.end("xm:f");
2941
- u && Object.keys(u).length > 0 && ft(0, t, u, s, c, "x14:dxf"), t.end("x14:cfRule");
2942
- }
2943
- t.start("xm:sqref"), t.text(r), t.end("xm:sqref"), t.end("x14:conditionalFormatting");
2944
- }
2945
- t.end("x14:conditionalFormattings"), t.end("ext");
2946
- }
2947
- if (a.length > 0) {
2948
- t.start("ext", {
2949
- uri: w,
2950
- "xmlns:x14": r
2951
- }), t.start("x14:dataValidations", {
2952
- "xmlns:xm": d,
2953
- count: a.length
2954
- });
2955
- for (let e = 0; e < a.length; e++) {
2956
- let { attrs: n, formula1: r, formula2: i, sqref: o } = a[e];
2957
- t.start("x14:dataValidation", n), r !== void 0 && (t.start("x14:formula1"), t.start("xm:f"), t.text(r), t.end("xm:f"), t.end("x14:formula1")), i !== void 0 && (t.start("x14:formula2"), t.start("xm:f"), t.text(i), t.end("xm:f"), t.end("x14:formula2")), t.start("xm:sqref"), t.text(o), t.end("xm:sqref"), t.end("x14:dataValidation");
2958
- }
2959
- t.end("x14:dataValidations"), t.end("ext");
2960
- }
2961
- t.end("extLst");
2962
- }(0, s, c, p, m), s.end("worksheet"), s.close();
2963
- }
2964
- }(),
2965
- new class extends B {
2966
- constructor() {
2967
- super({
2968
- kind: "sharedStrings",
2969
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
2970
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",
2971
- path: "/xl/sharedStrings.xml"
2972
- });
2973
- }
2974
- async emit(e, t) {
2975
- let n = t.getXMLWriter(), r = e.json, i = r ? r.length : 0, a = t.getSharedStates().get("stringsCount") ?? 0;
2976
- n.decl(), n.start("sst", {
2977
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2978
- count: a,
2979
- uniqueCount: i
2980
- });
2981
- for (let e = 0; e < i; e++) {
2982
- let t = r[e];
2983
- n.start("si");
2984
- let i = ee.test(t) ? b : void 0;
2985
- n.start("t", i), n.text(h(t)), n.end("t"), n.end("si");
2986
- }
2987
- n.end("sst"), n.close();
2988
- }
2989
- }(),
2990
- new class extends B {
2991
- constructor() {
2992
- super({
2993
- kind: "theme",
2994
- contentType: "application/vnd.openxmlformats-officedocument.theme+xml",
2995
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
2996
- path: "/xl/theme/theme{n}.xml"
2997
- });
2998
- }
2999
- async emit(e, t) {
3000
- let n = t.getXMLWriter(), r = e.model, i = e.json;
3001
- n.decl(), n.pushDefaultNamespace("a"), n.start("theme", {
3002
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3003
- name: r.getName() || "Office Theme"
3004
- }), n.start("themeElements"), function(e, t, n, r) {
3005
- let i = n?.getColorScheme();
3006
- if (i) {
3007
- t.start(r, { name: i.getName() || "Office" });
3008
- for (let e of Ve) t.start(e), U(t, n, i["get" + e.charAt(0).toUpperCase() + e.slice(1)]()), t.end(e);
3009
- t.end(r);
3010
- }
3011
- }(0, n, r, "clrScheme"), function(e, t, n, r) {
3012
- n && (t.start(r, { name: n.getName() || "Office" }), Vt(e, t, n.getMajorFont() || "Calibri Light", "majorFont"), Vt(e, t, n.getMinorFont() || "Calibri", "minorFont"), t.end(r));
3013
- }(t, n, r.getFontScheme(), "fontScheme"), function(e, t, n, r, i) {
3014
- if (i?.fillStyleLst && i?.lnStyleLst && i?.effectStyleLst && i?.bgFillStyleLst) return void function(e, t, n, r, i) {
3015
- let a = { getTheme: () => r };
3016
- t.start(n, { name: "Office" }), t.start("fillStyleLst");
3017
- for (let e of i.fillStyleLst) K(0, t, e, a);
3018
- t.end("fillStyleLst"), t.start("lnStyleLst");
3019
- for (let e of i.lnStyleLst) Je(0, t, e, a);
3020
- t.end("lnStyleLst"), t.start("effectStyleLst");
3021
- for (let n of i.effectStyleLst) t.start("effectStyle"), n.length > 0 ? Ze(e, t, r, n) : t.empty("effectLst"), t.end("effectStyle");
3022
- t.end("effectStyleLst"), t.start("bgFillStyleLst");
3023
- for (let e of i.bgFillStyleLst) K(0, t, e, a);
3024
- t.end("bgFillStyleLst"), t.end(n);
3025
- }(e, t, n, r, i);
3026
- if (i?.formatSchemeXml) return void t.raw(i.formatSchemeXml);
3027
- t.start(n, { name: "Office" }), function(e, t) {
3028
- t.start("fillStyleLst"), t.start("solidFill"), t.empty("schemeClr", { val: "phClr" }), t.end("solidFill"), t.start("gradFill", { rotWithShape: "1" }), t.start("gsLst"), t.start("gs", { pos: "0" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "50000" }), t.empty("satMod", { val: "300000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "35000" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "37000" }), t.empty("satMod", { val: "300000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "100000" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "15000" }), t.empty("satMod", { val: "350000" }), t.end("schemeClr"), t.end("gs"), t.end("gsLst"), t.empty("lin", {
3029
- ang: "16200000",
3030
- scaled: "1"
3031
- }), t.end("gradFill"), t.start("gradFill", { rotWithShape: "1" }), t.start("gsLst"), t.start("gs", { pos: "0" }), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "51000" }), t.empty("satMod", { val: "130000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "80000" }), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "93000" }), t.empty("satMod", { val: "130000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "100000" }), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "94000" }), t.empty("satMod", { val: "135000" }), t.end("schemeClr"), t.end("gs"), t.end("gsLst"), t.empty("lin", {
3032
- ang: "16200000",
3033
- scaled: "0"
3034
- }), t.end("gradFill"), t.end("fillStyleLst");
3035
- }(0, t), function(e, t) {
3036
- t.start("lnStyleLst");
3037
- let n = [
3038
- 9525,
3039
- 25400,
3040
- 38100
3041
- ];
3042
- for (let e = 0; e < 3; e++) t.start("ln", {
3043
- w: n[e].toString(),
3044
- cap: "flat",
3045
- cmpd: "sng",
3046
- algn: "ctr"
3047
- }), t.start("solidFill"), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "95000" }), t.empty("satMod", { val: "105000" }), t.end("schemeClr"), t.end("solidFill"), t.empty("prstDash", { val: "solid" }), t.end("ln");
3048
- t.end("lnStyleLst");
3049
- }(0, t), function(e, t) {
3050
- t.start("effectStyleLst");
3051
- for (let e = 0; e < 3; e++) t.start("effectStyle"), t.start("effectLst"), e === 2 && (t.start("outerShdw", {
3052
- blurRad: "40000",
3053
- dist: "20000",
3054
- dir: "5400000",
3055
- rotWithShape: "0"
3056
- }), t.start("srgbClr", { val: "000000" }), t.empty("alpha", { val: "38000" }), t.end("srgbClr"), t.end("outerShdw")), t.end("effectLst"), t.end("effectStyle");
3057
- t.end("effectStyleLst");
3058
- }(0, t), function(e, t) {
3059
- t.start("bgFillStyleLst"), t.start("solidFill"), t.empty("schemeClr", { val: "phClr" }), t.end("solidFill"), t.start("gradFill", { rotWithShape: "1" }), t.start("gsLst"), t.start("gs", { pos: "0" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "40000" }), t.empty("satMod", { val: "350000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "40000" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "45000" }), t.empty("shade", { val: "99000" }), t.empty("satMod", { val: "350000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "100000" }), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "20000" }), t.empty("satMod", { val: "255000" }), t.end("schemeClr"), t.end("gs"), t.end("gsLst"), t.empty("path", { path: "circle" }), t.empty("fillToRect", {
3060
- l: "50000",
3061
- t: "-80000",
3062
- r: "50000",
3063
- b: "180000"
3064
- }), t.end("gradFill"), t.start("gradFill", { rotWithShape: "1" }), t.start("gsLst"), t.start("gs", { pos: "0" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "80000" }), t.empty("satMod", { val: "300000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "100000" }), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "30000" }), t.empty("satMod", { val: "200000" }), t.end("schemeClr"), t.end("gs"), t.end("gsLst"), t.empty("path", { path: "circle" }), t.empty("fillToRect", {
3065
- l: "50000",
3066
- t: "50000",
3067
- r: "50000",
3068
- b: "50000"
3069
- }), t.end("gradFill"), t.end("bgFillStyleLst");
3070
- }(0, t), t.end(n);
3071
- }(t, n, "fmtScheme", r, i), n.end("themeElements"), n.start("objectDefaults"), n.end("objectDefaults"), n.start("extraClrSchemeLst"), n.end("extraClrSchemeLst"), n.end("theme"), n.close();
3072
- }
3073
- }(),
3074
- new class extends B {
3075
- constructor() {
3076
- super({
3077
- kind: "styles",
3078
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
3079
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",
3080
- path: "/xl/styles.xml"
3081
- });
3082
- }
3083
- async emit(e, t) {
3084
- let n = t.getXMLWriter(), r = e.json, i = (e.theme, e.styles);
3085
- n.decl(), n.start("styleSheet", {
3086
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3087
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
3088
- "mc:Ignorable": "x14ac x16r2 xr",
3089
- "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac",
3090
- "xmlns:x16r2": "http://schemas.microsoft.com/office/spreadsheetml/2015/02/main",
3091
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision"
3092
- });
3093
- let a = function(e, t) {
3094
- let n = t?.direct;
3095
- n && n.length !== 0 || (n = [{}]);
3096
- let r = n.length, i = Array(r);
3097
- for (let t = 0; t < r; t++) {
3098
- let r = t === 0 ? {
3099
- ...n[t],
3100
- named: I.BuiltInName.Normal
3101
- } : n[t], a = e.resolve(r), o = {};
3102
- r.named !== void 0 && (o.named = r.named), r.quotePrefix !== void 0 && (o.quotePrefix = r.quotePrefix);
3103
- for (let e = 0; e < at.length; e++) {
3104
- let t = at[e];
3105
- if (r[t] === void 0 && t !== "alignment") continue;
3106
- let n = a?.[t] ?? r[t];
3107
- n !== void 0 && (o[t] = n);
3108
- }
3109
- i[t] = o;
3110
- }
3111
- return i;
3112
- }(i, r), o = function(e, t, n) {
3113
- let r = {
3114
- fontMap: /* @__PURE__ */ new Map(),
3115
- fonts: [],
3116
- fillMap: /* @__PURE__ */ new Map(),
3117
- fills: [],
3118
- borderMap: /* @__PURE__ */ new Map(),
3119
- borders: [],
3120
- numFmtMap: /* @__PURE__ */ new Map(),
3121
- numFmtsCustom: [],
3122
- namedStyleMap: /* @__PURE__ */ new Map(),
3123
- namedStyles: []
3124
- };
3125
- (function(e, t) {
3126
- let n = (e.getNamed(I.BuiltInName.Normal).toJSON().style ?? {}).font ?? {};
3127
- t.fontMap.set(E.JSONStableStringify(n), "0"), t.fonts.push(n);
3128
- })(e, r), function(e) {
3129
- let t = { type: "none" };
3130
- e.fillMap.set(E.JSONStableStringify(t), "0"), e.fills.push(t);
3131
- let n = {
3132
- type: "pattern",
3133
- patternType: "gray125"
3134
- };
3135
- e.fillMap.set(E.JSONStableStringify(n), "1"), e.fills.push(n);
3136
- }(r), function(e) {
3137
- let t = {
3138
- bottom: { style: "none" },
3139
- left: { style: "none" },
3140
- right: { style: "none" },
3141
- top: { style: "none" }
3142
- };
3143
- e.borderMap.set(E.JSONStableStringify(t), "0"), e.borders.push(t);
3144
- }(r), function(e, t) {
3145
- st(e, e.getNamed(I.BuiltInName.Normal).toJSON(), t);
3146
- }(e, r);
3147
- let i = t?.named ?? D.EmptyArray;
3148
- for (let t of i) st(e, t, r);
3149
- for (let t of n) ot(e, t, r);
3150
- return r;
3151
- }(i, r, a), s = t.getSharedStates().get(it), c = function(e, t = 0) {
3152
- let n = e?.tables;
3153
- if (!n) return null;
3154
- let r = n.styles;
3155
- if (!r) return null;
3156
- let i = [], a = /* @__PURE__ */ new Map(), o = Object.keys(r), s = [...mt].reverse();
3157
- for (let e of o) {
3158
- let n = r[e];
3159
- for (let r of s) {
3160
- let o = n[r];
3161
- if (!o) continue;
3162
- let s = {};
3163
- if (o.font && (s.font = o.font), o.fill && (s.fill = o.fill), o.border && (s.border = o.border), o.numberFormat !== void 0 && (s.numberFormat = o.numberFormat), Object.keys(s).length === 0) continue;
3164
- let c = t + i.length;
3165
- i.push(s);
3166
- let l = `${e}:${r}`;
3167
- a.set(l, c);
3168
- }
3169
- }
3170
- return {
3171
- dxfs: i,
3172
- dxfIndexMap: a
3173
- };
3174
- }(r, s?.getCount() ?? 0);
3175
- (function(e, t, n) {
3176
- let r = n.numFmtsCustom, i = r.length;
3177
- if (i !== 0) {
3178
- t.start("numFmts", { count: String(i) });
3179
- for (let e = 0; e < i; e++) {
3180
- let n = r[e];
3181
- t.empty("numFmt", {
3182
- numFmtId: String(e + pt),
3183
- formatCode: n
3184
- });
3185
- }
3186
- t.end("numFmts");
3187
- }
3188
- })(0, n, o), function(e, t, n, r) {
3189
- let i = r.fonts, a = i.length;
3190
- t.start("fonts", {
3191
- count: String(a),
3192
- "x14ac:knownFonts": "1"
3193
- });
3194
- for (let r of i) ct(e, t, r, n);
3195
- t.end("fonts");
3196
- }(t, n, i, o), function(e, t, n, r) {
3197
- let i = r.fills, a = i.length;
3198
- t.start("fills", { count: String(a) });
3199
- for (let e of i) K(0, t, e, n, !0);
3200
- t.end("fills");
3201
- }(0, n, i, o), function(e, t, n, r) {
3202
- let i = r.borders, a = i.length;
3203
- t.start("borders", { count: String(a) });
3204
- let o = n.getTheme();
3205
- for (let n of i) lt(e, t, n, o, !1);
3206
- t.end("borders");
3207
- }(t, n, i, o), function(e, t, n, r, i) {
3208
- let a = i.namedStyles, o = a.length;
3209
- t.start("cellStyleXfs", { count: String(o) });
3210
- for (let r of a) dt(e, t, n, r.style ?? D.EmptyObject, i, !1);
3211
- t.end("cellStyleXfs");
3212
- }(t, n, i, 0, o), function(e, t, n, r, i) {
3213
- let a = r.length;
3214
- t.start("cellXfs", { count: String(a) });
3215
- for (let o = 0; o < a; o++) dt(e, t, n, r[o], i, !0);
3216
- t.end("cellXfs");
3217
- }(t, n, i, a, o), function(e, t, n, r, i) {
3218
- let a = i.namedStyles, o = a.length;
3219
- t.start("cellStyles", { count: String(o) });
3220
- let s = i.namedStyleMap;
3221
- for (let e = 0; e < o; e++) {
3222
- let r = a[e], i = r.name, o = i.toLowerCase(), c = {
3223
- name: i,
3224
- xfId: s.get(o)
3225
- };
3226
- r.hidden && (c.hidden = "1"), r.iLevel && (c.iLevel = String(r.iLevel));
3227
- let l = null;
3228
- l = o === I.BuiltInName.Normal.toLowerCase() ? 0 : n.getNamed(i).getBuiltInID(), l !== null && (c.builtinId = String(l), c.customBuiltin = "1"), t.empty("cellStyle", c);
3229
- }
3230
- t.end("cellStyles");
3231
- }(0, n, i, 0, o), function(e, t, n, r, i) {
3232
- let a = [...i?.getDxfs() ?? [], ...r?.dxfs ?? []];
3233
- if (a.length === 0) return void t.empty("dxfs", { count: "0" });
3234
- let o = n.getTheme();
3235
- t.start("dxfs", { count: String(a.length) });
3236
- let s = pt;
3237
- for (let r of a) s = ft(e, t, r, n, o, "dxf", s);
3238
- t.end("dxfs");
3239
- }(t, n, i, c, s), function(e, t, n, r, i) {
3240
- let a = r?.tables, o = a?.styles ?? null, s = o ? Object.keys(o) : null, c = s ? s.length : 0, l = {
3241
- count: String(c),
3242
- defaultTableStyle: a?.defaultTableStyle ?? "TableStyleMedium2",
3243
- defaultPivotStyle: a?.defaultPivotStyle ?? "PivotStyleLight16"
3244
- };
3245
- if (c === 0) return void t.empty("tableStyles", l);
3246
- t.start("tableStyles", l);
3247
- for (let e of s) {
3248
- let n = o[e], r = [];
3249
- for (let e of mt) {
3250
- let t = n[e];
3251
- t && r.push([e, t]);
3252
- }
3253
- let a = {
3254
- name: e,
3255
- pivot: n.pivot ? "1" : "0",
3256
- count: String(r.length)
3257
- };
3258
- t.start("tableStyle", a);
3259
- for (let [n, a] of r) {
3260
- let r = `${e}:${n}`, o = i?.dxfIndexMap.get(r) ?? "0", s = {};
3261
- s.type = n, a.size !== void 0 && (s.size = String(a.size)), s.dxfId = String(o), t.empty("tableStyleElement", s);
3262
- }
3263
- t.end("tableStyle");
3264
- }
3265
- t.end("tableStyles");
3266
- }(0, n, 0, r, c), function(e, t, n, r) {
3267
- let i = r?.indexedColors && r.indexedColors.length > 0, a = r?.mruColors && r.mruColors.length > 0;
3268
- if (!(!i && !a)) {
3269
- if (t.start("colors"), i) {
3270
- t.start("indexedColors");
3271
- for (let e of r.indexedColors) {
3272
- let n = qe(e, !0);
3273
- t.empty("rgbColor", { rgb: n });
3274
- }
3275
- t.end("indexedColors");
3276
- }
3277
- if (a) {
3278
- t.start("mruColors");
3279
- for (let e of r.mruColors) {
3280
- let n = qe(e);
3281
- t.empty("color", { rgb: n });
3282
- }
3283
- t.end("mruColors");
3284
- }
3285
- t.end("colors");
3286
- }
3287
- }(0, n, 0, r), function(e, t) {
3288
- t.start("extLst"), t.start("ext", {
3289
- uri: "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}",
3290
- "xmlns:x14": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
3291
- }), t.empty("x14:slicerStyles", { defaultSlicerStyle: "SlicerStyleLight1" }), t.end("ext"), t.start("ext", {
3292
- uri: "{9260A510-F301-46a8-8635-F512D64BE5F5}",
3293
- "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
3294
- }), t.empty("x15:timelineStyles", { defaultTimelineStyle: "TimeSlicerStyleLight1" }), t.end("ext"), t.end("extLst");
3295
- }(0, n), n.end("styleSheet"), n.close();
3296
- }
3297
- }(),
3298
- new class extends B {
3299
- constructor() {
3300
- super({
3301
- kind: "propsCore",
3302
- contentType: "application/vnd.openxmlformats-package.core-properties+xml",
3303
- relTypeUri: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
3304
- path: "/docProps/core.xml"
3305
- });
3306
- }
3307
- async emit(e, t) {
3308
- let n = t.getXMLWriter();
3309
- n.decl(), n.start("cp:coreProperties", {
3310
- "xmlns:cp": "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
3311
- "xmlns:dc": "http://purl.org/dc/elements/1.1/",
3312
- "xmlns:dcterms": "http://purl.org/dc/terms/",
3313
- "xmlns:dcmitype": "http://purl.org/dc/dcmitype/",
3314
- "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
3315
- });
3316
- let r = /* @__PURE__ */ new Date(), i = [
3317
- ["creator", "SheetXL"],
3318
- ["lastModifiedBy", "SheetXL"],
3319
- ["created", Ht(r)],
3320
- ["modified", Ht(r)]
3321
- ];
3322
- for (let e of i) Ut(n, e[0], e[1]);
3323
- n.end("cp:coreProperties"), n.close();
3324
- }
3325
- }(),
3326
- new class extends B {
3327
- constructor() {
3328
- super({
3329
- kind: "propsApp",
3330
- contentType: "application/vnd.openxmlformats-officedocument.extended-properties+xml",
3331
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",
3332
- path: "/docProps/app.xml"
3333
- });
3334
- }
3335
- async emit(e, t) {
3336
- let n = t.getXMLWriter(), r = e.model, i = await re.getDetails(), a = function(e) {
3337
- if (!e || typeof e != "string") return xt;
3338
- if (e === "local" || e === "dev" || e === "development") return "00.0000";
3339
- let t = e.match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
3340
- if (!t) return xt;
3341
- let n = parseInt(t[1], 10), r = parseInt(t[2] || "0", 10);
3342
- return n > 99 || r > 9999 ? xt : `${n.toString()}.${r.toString().padStart(4, "0")}`;
3343
- }(i.getBuildVersion()), o = i.getLicensee() || "";
3344
- n.setValidationDisabled(!0), n.decl(), n.start("Properties", {
3345
- xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
3346
- "xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
3347
- }), Q(t, n, "Application", "SheetXL"), Q(t, n, "DocSecurity", "0"), Q(t, n, "ScaleCrop", "false"), Wt(t, n, r), Q(t, n, "Company", o), Q(t, n, "LinksUpToDate", "false"), Q(t, n, "SharedDoc", "false"), Q(t, n, "HyperlinksChanged", "false"), Q(t, n, "AppVersion", a), n.end("Properties"), n.close();
3348
- }
3349
- }(),
3350
- new class extends B {
3351
- constructor() {
3352
- super({
3353
- kind: "metadata",
3354
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",
3355
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",
3356
- path: "/xl/metadata.xml"
3357
- });
3358
- }
3359
- emit(e, t) {
3360
- let n = t.getXMLWriter(), r = e.hasCellMeta(), i = e.hasValueMeta(), a = e.getDAPRFutureMetadataBlocks(), o = e.getRVFutureMetadataBlocks(), s = e.getValueMeta(), c = 0, l = 0, u = 0;
3361
- r && (c = ++u), i && (l = ++u);
3362
- let d = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
3363
- if (r && (d["xmlns:xda"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"), i && (d["xmlns:xlrd"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata"), n.decl(), n.start("metadata", d), n.start("metadataTypes", { count: u }), r && n.empty("metadataType", {
3364
- name: "XLDAPR",
3365
- ...Gt,
3366
- cellMeta: "1"
3367
- }), i && n.empty("metadataType", {
3368
- name: "XLRICHVALUE",
3369
- ...Gt
3370
- }), n.end("metadataTypes"), r) {
3371
- n.start("futureMetadata", {
3372
- name: "XLDAPR",
3373
- count: a.length
3374
- });
3375
- for (let e of a) n.start("bk"), n.start("extLst"), n.start("ext", { uri: "{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}" }), n.empty("xda:dynamicArrayProperties", {
3376
- fDynamic: e.fDynamic,
3377
- fCollapsed: e.fCollapsed
3378
- }), n.end("ext"), n.end("extLst"), n.end("bk");
3379
- n.end("futureMetadata");
3380
- }
3381
- if (i) {
3382
- n.start("futureMetadata", {
3383
- name: "XLRICHVALUE",
3384
- count: o.length
3385
- });
3386
- for (let e of o) n.start("bk"), n.start("extLst"), n.start("ext", { uri: "{3e2802c4-a4d2-4d8b-9148-e3be6c30e623}" }), n.empty("xlrd:rvb", { i: e }), n.end("ext"), n.end("extLst"), n.end("bk");
3387
- n.end("futureMetadata");
3388
- }
3389
- if (r) {
3390
- n.start("cellMetadata", { count: a.length });
3391
- for (let e = 0; e < a.length; e++) n.start("bk"), n.empty("rc", {
3392
- t: c,
3393
- v: e
3394
- }), n.end("bk");
3395
- n.end("cellMetadata");
3396
- }
3397
- if (i) {
3398
- n.start("valueMetadata", { count: s.length });
3399
- for (let e of s) n.start("bk"), n.empty("rc", {
3400
- t: l,
3401
- v: e
3402
- }), n.end("bk");
3403
- n.end("valueMetadata");
3404
- }
3405
- n.end("metadata"), n.close();
3406
- }
3407
- }(),
3408
- new class extends B {
3409
- constructor() {
3410
- super({
3411
- kind: "richValue",
3412
- contentType: "application/vnd.ms-excel.rdrichvalue+xml",
3413
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValue",
3414
- path: "./richData/rdrichvalue.xml"
3415
- });
3416
- }
3417
- async emit(e, t) {
3418
- let n = t.getXMLWriter(), r = e.getEntries(), i = r.length;
3419
- n.decl(), n.start("rvData", {
3420
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata",
3421
- count: i
3422
- });
3423
- for (let t of r) {
3424
- let r = e.handlerStructureIndex(t.handler);
3425
- n.start("rv", { s: r });
3426
- let i = t.handler.getValues(t.rawValue);
3427
- for (let e of i) n.start("v"), n.text(e), n.end("v");
3428
- n.end("rv");
3429
- }
3430
- n.end("rvData"), n.close();
3431
- }
3432
- }(),
3433
- new class extends B {
3434
- constructor() {
3435
- super({
3436
- kind: "richValueStructure",
3437
- contentType: "application/vnd.ms-excel.rdrichvaluestructure+xml",
3438
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueStructure",
3439
- path: "./richData/rdrichvaluestructure.xml"
3440
- });
3441
- }
3442
- async emit(e, t) {
3443
- let n = t.getXMLWriter(), r = e.uniqueHandlers(), i = r.length;
3444
- n.decl(), n.start("rvStructures", {
3445
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata",
3446
- count: i
3447
- });
3448
- for (let e of r) {
3449
- n.start("s", { t: e.type });
3450
- for (let [t, r] of e.props) n.empty("k", {
3451
- n: t,
3452
- t: r
3453
- });
3454
- n.end("s");
3455
- }
3456
- n.end("rvStructures"), n.close();
3457
- }
3458
- }(),
3459
- new class extends B {
3460
- constructor() {
3461
- super({
3462
- kind: "richValueTypes",
3463
- contentType: "application/vnd.ms-excel.rdrichvaluetypes+xml",
3464
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueTypes",
3465
- path: "./richData/rdRichValueTypes.xml"
3466
- });
3467
- }
3468
- async emit(e, t) {
3469
- let n = t.getXMLWriter();
3470
- n.decl(), n.start("rvTypesInfo", {
3471
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2",
3472
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
3473
- "mc:Ignorable": "x",
3474
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
3475
- });
3476
- let r = [
3477
- ["_self", ["ExcludeFromFile", "ExcludeFromCalcComparison"]],
3478
- ["_DisplayString", ["ExcludeFromCalcComparison"]],
3479
- ["_Flags", ["ExcludeFromCalcComparison"]],
3480
- ["_Format", ["ExcludeFromCalcComparison"]],
3481
- ["_SubLabel", ["ExcludeFromCalcComparison"]],
3482
- ["_Attribution", ["ExcludeFromCalcComparison"]],
3483
- ["_Icons", ["ExcludeFromCalcComparison"]],
3484
- ["_Display", ["ExcludeFromCalcComparison"]],
3485
- ["_CanonicalPropertyNames", ["ExcludeFromCalcComparison"]],
3486
- ["_ClassificationId", ["ExcludeFromCalcComparison"]]
3487
- ];
3488
- n.start("global"), n.start("keyFlags");
3489
- for (let [e, t] of r) {
3490
- n.start("key", { name: e });
3491
- for (let e of t) n.empty("flag", {
3492
- name: e,
3493
- value: "1"
3494
- });
3495
- n.end("key");
3496
- }
3497
- n.end("keyFlags"), n.end("global"), n.end("rvTypesInfo"), n.close();
3498
- }
3499
- }(),
3500
- new class extends B {
3501
- constructor() {
3502
- super({
3503
- kind: "drawing",
3504
- contentType: "application/vnd.openxmlformats-officedocument.drawing+xml",
3505
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
3506
- path: "../drawings/drawing{n}.xml"
3507
- });
3508
- }
3509
- async emit(e, t) {
3510
- let n = t.getXMLWriter();
3511
- n.decl(), n.pushDefaultNamespace("xdr"), n.start("wsDr", {
3512
- "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
3513
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main"
3514
- });
3515
- let r = /* @__PURE__ */ new Map(), i = e.sheet, a = e.movables, o = e.jsonMovables, s = o ? o.length : 0, c = 0;
3516
- for (let e = 0; e < s; e++) {
3517
- let t = o[e].content?.json?.sourceId;
3518
- typeof t == "number" && t > c && (c = t);
3519
- }
3520
- let l = /* @__PURE__ */ new Map(), u;
3521
- if (c > 0) {
3522
- let e = t.getSharedStates();
3523
- u = e.get("uniqueIdCounter"), u || (u = /* @__PURE__ */ new Map(), e.set("uniqueIdCounter", u)), u.set(i, Math.max(u.get(i) ?? 1, c));
3524
- let n = /* @__PURE__ */ new Set();
3525
- for (let e = 0; e < s; e++) {
3526
- let t = o[e].content?.json?.sourceId;
3527
- if (typeof t == "number") if (n.has(t)) {
3528
- let t = u.get(i) + 1;
3529
- u.set(i, t), l.set(o[e], t);
3530
- } else n.add(t);
3531
- }
3532
- }
3533
- for (let e = 0; e < s; e++) {
3534
- let s = o[e], c = a[e], u = s.content?.type;
3535
- switch (n.start("twoCellAnchor", { editAs: s.anchorType || "twoCell" }), fn(n, "from", s.anchor.tl), fn(n, "to", s.anchor.br), u) {
3536
- case "picture":
3537
- await Qt(t, i, r, c, s);
3538
- break;
3539
- case "chart":
3540
- await en(t, i, r, c, s, l.get(s));
3541
- break;
3542
- case "shape":
3543
- await an(t, i, r, c, s, l.get(s));
3544
- break;
3545
- case "smartArt":
3546
- await tn(t, i, r, c, s);
3547
- break;
3548
- case "slicer":
3549
- await nn(t, i, r, c, s);
3550
- break;
3551
- case "graphicFrame":
3552
- await rn(t, i, r, c, s);
3553
- break;
3554
- default: await $(t, i, r, c, s);
3555
- }
3556
- n.empty("clientData"), n.end("twoCellAnchor");
3557
- }
3558
- n.end("wsDr"), n.close();
3559
- }
3560
- }(),
3561
- new class extends B {
3562
- constructor() {
3563
- super({
3564
- kind: "table",
3565
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",
3566
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
3567
- path: "../tables/table{n}.xml"
3568
- });
3569
- }
3570
- async emit(e, t) {
3571
- let n = t.getXMLWriter();
3572
- n.decl();
3573
- let r = {
3574
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3575
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
3576
- "mc:Ignorable": "xr xr3",
3577
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
3578
- "xmlns:xr3": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"
3579
- }, i = e.json, a = e.model;
3580
- a.isShowHeaders(), r.id = ++pn, r.name = i.name?.trim(), r.displayName = i.description ?? i.name, r.ref = e.ref, i.headerRowCount !== 1 && (r.headerRowCount = i.headerRowCount), i.totalsRowCount !== 0 && (r.totalsRowCount = i.totalsRowCount), a.isShowTotals() || (r.totalsRowShown = "0"), n.start("table", r), a.isShowHeaders() && _t(t, n, a, i), mn(t, n, a, i), hn(t, n, a, i), n.end("table"), n.close();
3581
- }
3582
- }(),
3583
- new class extends B {
3584
- constructor() {
3585
- super({
3586
- kind: "chart",
3587
- contentType: "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
3588
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
3589
- path: "../charts/chart{n}.xml"
3590
- });
3591
- }
3592
- async emit(e, t) {
3593
- let n = t.getXMLWriter();
3594
- n.decl(), n.pushDefaultNamespace("c"), n.start("chartSpace", {
3595
- "xmlns:c": "http://schemas.openxmlformats.org/drawingml/2006/chart",
3596
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3597
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
3598
- "xmlns:c16r2": "http://schemas.microsoft.com/office/drawing/2015/06/chart"
3599
- }), n.empty("date1904", { val: "0" }), n.empty("lang", { val: "en-US" }), n.empty("roundedCorners", { val: "0" }), vn(t, n, e.model, e.json), yn(t, n, e.styles, e.model, e.json), bn(t, n, e.model, e.json), n.end("chartSpace"), n.popDefaultNamespace(), n.close(), t.addPart("chartStyle", { styles: e.styles }), t.addPart("chartColors", { styles: e.styles });
3600
- }
3601
- }(),
3602
- new class extends B {
3603
- constructor() {
3604
- super({
3605
- kind: "chartStyle",
3606
- contentType: "application/vnd.ms-office.chartstyle+xml",
3607
- relTypeUri: "http://schemas.microsoft.com/office/2011/relationships/chartStyle",
3608
- path: "./style{n}.xml"
3609
- });
3610
- }
3611
- async emit(e, t) {
3612
- let n = t.getXMLWriter();
3613
- n.pushDefaultNamespace("cs"), n.start("chartStyle", {
3614
- "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
3615
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3616
- id: "297"
3617
- }), Sn(t, n, Cn, e.styles), n.end("chartStyle"), n.close();
3618
- }
3619
- }(),
3620
- new class extends B {
3621
- constructor() {
3622
- super({
3623
- kind: "chartColors",
3624
- contentType: "application/vnd.ms-office.chartcolorstyle+xml",
3625
- relTypeUri: "http://schemas.microsoft.com/office/2011/relationships/chartColorStyle",
3626
- path: "./colors{n}.xml"
3627
- });
3628
- }
3629
- async emit(e, t) {
3630
- let n = t.getXMLWriter();
3631
- n.pushDefaultNamespace("cs"), n.start("cs:colorStyle", {
3632
- "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
3633
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3634
- meth: "cycle",
3635
- id: "10"
3636
- }), n.empty("a:schemeClr", { val: "accent1" }), n.empty("a:schemeClr", { val: "accent2" }), n.empty("a:schemeClr", { val: "accent3" }), n.empty("a:schemeClr", { val: "accent4" }), n.empty("a:schemeClr", { val: "accent5" }), n.empty("a:schemeClr", { val: "accent6" }), wn(t, n, Tn), n.end("cs:colorStyle"), n.close();
3637
- }
3638
- }()
3639
- ], Dn = async (e, t) => {
3640
- let n = new Ne();
3641
- for (let e of En) n.register(e);
3642
- let r = On, i = ie.createUint8Array({
3643
- lastModDate: new Date(1899, 11, 29, 19, 0, 0),
3644
- level: r
3645
- }), a = e.getOrigin(), o = t?.format === "Excel" ? m(a) : null, s = /* @__PURE__ */ new Map(), c = new je(i, n, {
3646
- strictDuplicateChildren: !0,
3647
- onPartEmitted: t?.onPartEmitted,
3648
- mapState: s,
3649
- sourcePackage: o
3650
- });
3651
- c.addPart("workbook", e, "/xl/workbook.xml"), await c.waitEmit(), c.addPart("propsCore", {}), c.addPart("propsApp", { model: e });
3652
- let l = await c.build();
3653
- return l.byteOffset === 0 && l.byteLength === l.buffer.byteLength ? l.buffer : l.slice().buffer;
3654
- }, On = 1;
3655
- export { Dn as writeXLSX };