@sheetxl/io-xlsx 0.8.0-beta.7 → 1.0.0

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