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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/browser/esm/{NQIuOQIleHC4NUW6.mjs → BiDqExNXiY7ykk8E.mjs} +527 -646
  2. package/browser/esm/{2EOdn2WRK5y1L58S.mjs → Bs0EzhdU8WgGfPzf.mjs} +2 -2
  3. package/browser/esm/CLWsOc6DO8l1G_LF.mjs +2213 -0
  4. package/browser/esm/{xc_LzCPgHn-acgFZ.mjs → CZ9I80og75SDRjv0.mjs} +2 -2
  5. package/browser/esm/{DXopGe8PrLWmwGaV.mjs → CuAXx5i4uqTz-mMY.mjs} +1 -1
  6. package/browser/esm/{BLXcoiDAaOMjFuhw.mjs → Cv3R6fGatARKedSn.mjs} +2531 -1952
  7. package/browser/esm/{B-jb5SuiVh5NnBG_.mjs → CzFYJPxmLyKgEKF0.mjs} +2 -2
  8. package/browser/esm/{BKT8OBj-bhQwdg49.mjs → DICL6ecj9BdJv8aX.mjs} +47 -10
  9. package/browser/esm/DatIA9fZbEPjW4bh.mjs +5638 -0
  10. package/browser/esm/index.mjs +2 -2
  11. package/browser/esm/{CI_CZI5m5-KkiAK5.mjs → yveeVJ6hKDI5KDEz.mjs} +1599 -990
  12. package/node/esm/B9Zn6H1RV07Ob377.mjs +2294 -0
  13. package/node/esm/Bpqm_PpGLpdjL47-.mjs +2368 -0
  14. package/node/esm/{BmdmvgO5Zdgx-RWo.mjs → CAJxmJdobUbzpUz5.mjs} +2 -2
  15. package/node/esm/{CHqRP_NjPpPd7m9L.mjs → CxlSbH7mmnEEsqmX.mjs} +1 -1
  16. package/node/esm/DD-yXSBzvDYy0TX5.mjs +5842 -0
  17. package/node/esm/{nNQ7MG89sGKwkjMA.mjs → DScqM1V4wPntNP6-.mjs} +1672 -1086
  18. package/node/esm/{O5mti2R9drFOlXc7.mjs → fopiRR7OiVoEiF7B.mjs} +2 -2
  19. package/node/esm/index.mjs +64 -27
  20. package/node/esm/{CtAF486aZqYzMeLM.mjs → ipiyzn5Pfohw2afB.mjs} +1777 -1157
  21. package/package.json +3 -3
  22. package/types/src/AutoFilterRules.d.ts +8 -1
  23. package/types/src/DefinedNameAttributes.d.ts +8 -0
  24. package/types/src/ExcelCompat.d.ts +15 -3
  25. package/types/src/KnownFonts.d.ts +50 -0
  26. package/types/src/LegacyFormula.d.ts +13 -0
  27. package/types/src/PageLayoutAttributes.d.ts +8 -0
  28. package/types/src/Plugin.d.ts +12 -0
  29. package/types/src/ProtectionAttributes.d.ts +2 -2
  30. package/types/src/SheetKinds.d.ts +57 -0
  31. package/types/src/SheetViewAttributes.d.ts +4 -0
  32. package/types/src/SortExtent.d.ts +16 -0
  33. package/types/src/Types.d.ts +11 -0
  34. package/types/src/XlsxHeader.d.ts +19 -0
  35. package/types/src/chart/ChartExXml.d.ts +38 -0
  36. package/types/src/chart/ChartPartXml.d.ts +47 -0
  37. package/types/src/chart/ChartSpaceXml.d.ts +36 -0
  38. package/types/src/chart/_XmlTree.d.ts +34 -0
  39. package/types/src/chart/_chartCodecs.d.ts +10 -0
  40. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  41. package/types/src/chart/_chartExFold.d.ts +14 -0
  42. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  43. package/types/src/chart/_chartExStyle.d.ts +22 -0
  44. package/types/src/chart/_codec.d.ts +78 -0
  45. package/types/src/chart/_drawingml.d.ts +10 -0
  46. package/types/src/chart/_xml.d.ts +70 -0
  47. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  48. package/types/src/reader/DummyFunctionUnwrap.d.ts +2 -2
  49. package/types/src/reader/HeaderStyles.d.ts +15 -0
  50. package/types/src/reader/IsoDateCell.d.ts +20 -0
  51. package/types/src/reader/LibreOfficeDataTable.d.ts +11 -0
  52. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  53. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -3
  54. package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
  55. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +3 -1
  56. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +2 -2
  57. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +23 -8
  58. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  59. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  60. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  61. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +2 -0
  62. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  63. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  64. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  65. package/types/src/reader/domVisitors/index.d.ts +2 -30
  66. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +46 -6
  67. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +16 -11
  68. package/types/src/utils/DrawingMLText.d.ts +2 -2
  69. package/types/src/utils/FormControls.d.ts +4 -4
  70. package/types/src/utils/SharedNames.d.ts +13 -0
  71. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  72. package/types/src/utils/VmlNoteShapes.d.ts +16 -23
  73. package/types/src/utils/VmlNoteStyle.d.ts +44 -0
  74. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  75. package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
  76. package/types/src/writer/builder/Types.d.ts +7 -0
  77. package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
  78. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  79. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  80. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  81. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  82. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  83. package/types/src/writer/emitters/SlicerEmitter.d.ts +3 -3
  84. package/types/src/writer/emitters/WorkbookEmitter.d.ts +5 -0
  85. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  86. package/types/src/writer/utils/AutoFilter.d.ts +1 -1
  87. package/types/src/writer/utils/DefaultRows.d.ts +38 -0
  88. package/types/src/writer/utils/DxfCollector.d.ts +11 -8
  89. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +1 -1
  90. package/types/src/writer/utils/SheetStyleLayout.d.ts +73 -0
  91. package/types/src/writer/utils/TextUtils.d.ts +6 -1
  92. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  93. package/browser/esm/BPmehfSqdvgsLBsB.mjs +0 -5153
  94. package/node/esm/BpxxiZ2oKPkUSfdB.mjs +0 -2486
  95. package/node/esm/QS_theNoeqNGLStj.mjs +0 -5298
  96. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  97. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  98. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  99. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  100. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  101. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  102. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  103. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  104. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  105. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  106. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  107. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  108. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  109. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  110. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  111. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  112. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  113. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  114. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  115. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  116. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
@@ -1,25 +1,25 @@
1
1
  /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.10
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.11
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { At as t, Bt as e, Ct as s, Dt as o, Et as r, Gt as n, Ht as i, It as a, Jt as c, Lt as l, Nt as u, Q as d, Qt as p, Rt as f, S as g, St as m, Ut as x, Y as y, Yt as b, Z as v, Zt as T, gt as w, ht as S, kt as C, l as k, lt as A, m as E, ot as P, pt as O, q as I, qt as D, rt as N, st as _, t as L, u as $, wt as V, x as R, xt as j, y as M, zt as B } from "./nNQ7MG89sGKwkjMA.mjs";
8
- import { BufferUtils as H, CommonUtils as F, ExpectedError as W } from "@sheetxl/utils";
9
- import { AddressUtils as z, CommonUtils as X, CoordUtils as q, FormulaError as U, FormulaText as G, ICellStyle as K, IColor as J, ICondition as Z, IConditionalFormat as Q, IRange as Y, OutOfBoundsError as tt, PersonCollection as et, ResourceCollection as st, Theme as ot, Tuple as rt, Workbook as nt } from "@sheetxl/sdk";
10
- import { BlobReader as it, Uint8ArrayReader as at, Uint8ArrayWriter as ct, ZipReader as lt } from "@zip.js/zip.js";
11
- var ht = {
7
+ import { $t as t, C as e, Dt as s, En as o, Et as r, Gt as n, It as i, Jt as a, Lt as l, Nn as c, On as h, Ot as u, Pt as d, Q as p, Rn as f, Rt as g, Sn as m, Tn as b, Tt as x, Un as v, Ut as y, Vn as w, Wt as T, X as S, Xt as C, Zt as k, _n as A, _t as E, bn as I, bt as P, cn as O, d as D, dn as N, dt as _, en as $, et as R, fn as L, ft as V, gn as M, gt as j, h as B, hn as H, ht as F, jn as W, ln as z, mn as X, n as q, on as G, pn as Z, pt as K, qt as J, rn as Q, rt as Y, sn as tt, st as et, t as st, tt as ot, u as rt, un as nt, vt as it, w as at, wn as lt, wt as ct, x as ht, xt as ut, yn as dt } from "./DScqM1V4wPntNP6-.mjs";
8
+ import { BufferUtils as pt, CommonUtils as ft, ExpectedError as gt, OverlappingRange as mt, RangeAxis as bt } from "@sheetxl/utils";
9
+ import { AddressUtils as xt, CommonUtils as vt, CoordUtils as yt, FormulaError as wt, FormulaText as Tt, ICellStyle as St, ICondition as Ct, IConditionalFormat as kt, ICustomProperty as At, IFont as Et, IRange as It, OutOfBoundsError as Pt, PersonCollection as Ot, ResourceCollection as Dt, Sort as Nt, Theme as _t, Tuple as $t, Workbook as Rt } from "@sheetxl/sdk";
10
+ import { BlobReader as Lt, Uint8ArrayReader as Vt, Uint8ArrayWriter as Mt, ZipReader as jt } from "@zip.js/zip.js";
11
+ var Bt = {
12
12
  ascending: "ascending",
13
13
  descending: "descending",
14
14
  natural: "dataSource"
15
15
  };
16
- function ut(t, e) {
16
+ function Ht(t, e) {
17
17
  if (!e) return null;
18
18
  for (let s = 0; s < t.length; s++) if (void 0 !== t[s].id && String(t[s].id) === e) return t[s];
19
19
  const s = Number(e);
20
20
  return Number.isInteger(s) && s >= 1 && s <= t.length ? t[s - 1] : null;
21
21
  }
22
- function dt(t, e, s) {
22
+ function Ft(t, e, s) {
23
23
  const o = {
24
24
  ...e,
25
25
  source: s
@@ -29,80 +29,10 @@ function dt(t, e, s) {
29
29
  e > 0 && 27 !== e && (o.rowHeight = e);
30
30
  }
31
31
  t.style && "SlicerStyleLight1" !== t.style && (o.style = t.style);
32
- const r = t.sortOrder ? ht[t.sortOrder] : void 0;
32
+ const r = t.sortOrder ? Bt[t.sortOrder] : void 0;
33
33
  return r && "ascending" !== r && (o.sortOrder = r), t.crossFilter && "showItemsWithDataAtTop" !== t.crossFilter && (o.crossFilter = t.crossFilter), t.lockedPosition && (o.lockedPosition = !0), !1 === t.customListSort && (o.disabledCustomListSort = !0), t.cacheName && (o.cacheName = t.cacheName), t.startItem && (o.startItem = t.startItem), void 0 !== t.level && (o.level = t.level), t.uid && (o.uid = t.uid), o;
34
34
  }
35
- var pt = (t, e, s) => {
36
- const o = `Unable to read '${t}': ${e?.message ?? e}`;
37
- s?.onWarning ? s.onWarning(o, t) : console.warn(o);
38
- }, ft = (t, e, s, o, r = null) => {
39
- if (!t) return null;
40
- let n = t;
41
- n.startsWith("/") && (n = n.substring(1));
42
- let i = r?.parsedRefs?.get(t);
43
- if (void 0 !== i) return i;
44
- const a = e(n);
45
- if (!a) return null;
46
- const c = a.content;
47
- try {
48
- const e = new TextDecoder().decode(c), n = s.parseFromString(e, "text/xml"), i = o.transform(n, t, r ?? F.EmptyObject);
49
- return r?.parsedRefs?.set(t, i), i;
50
- } catch (e) {
51
- pt(t, e, r);
52
- }
53
- return null;
54
- }, gt = (t, e, s, o, r = null) => {
55
- if (!t) return null;
56
- const n = ft(t, e, s, o, r);
57
- if (!n) return null;
58
- const i = /* @__PURE__ */ new Map(), a = Object.keys(n), c = a.length;
59
- for (let t = 0; t < c; t++) {
60
- const e = a[t], s = n[e];
61
- i.set(e, s);
62
- }
63
- return i;
64
- }, mt = (t, e, s, o, r, n = null) => {
65
- const i = /* @__PURE__ */ new Map();
66
- let a = e[t];
67
- const c = a ? a.length : 0;
68
- for (let t = 0; t < c; t++) {
69
- const e = a[t];
70
- if (!e) continue;
71
- let c = e;
72
- c.startsWith("/") && (c = c.substring(1));
73
- const l = ft(c, s, o, r, n);
74
- i.set(c, l);
75
- }
76
- return i;
77
- }, xt = (t) => {
78
- const e = t.split(/\/+/);
79
- return e.reduce((t, e, s) => ("." === e ? t.splice(s, 1) : ".." === e && t.splice(s - 1, 2), t), e).join("/");
80
- }, yt = Object.freeze([
81
- "lt1",
82
- "dk1",
83
- "lt2",
84
- "dk2",
85
- "accent1",
86
- "accent2",
87
- "accent3",
88
- "accent4",
89
- "accent5",
90
- "accent6",
91
- "hlink",
92
- "folHlink"
93
- ]), bt = (t, e = "auto") => {
94
- let s;
95
- const o = t("auto");
96
- void 0 === o || "1" !== o && "true" !== o || (s = e);
97
- const r = t("indexed");
98
- r && (s = "64" === r ? "auto" : `index${r}`);
99
- const n = t("rgb");
100
- n && (s = n.toLowerCase(), 8 !== n.length || n.startsWith("FF") || (s = "FF" + n.substring(2, n.length)));
101
- const i = t("theme");
102
- i && (s = yt[Number(i)]);
103
- let a = t("tint");
104
- if (a && (s += ` ${J.AdjustmentType.ETint} ${parseFloat(a)}`), s) return s;
105
- }, vt = (t) => t ? t.replace(/^\{([\s\S]+)\}$/, "$1") : t, Tt = /* @__PURE__ */ new Uint8Array(0), wt = class t {
35
+ var Wt = /* @__PURE__ */ new Uint8Array(0), zt = class t {
106
36
  constructor(t, e, s) {
107
37
  this.buffers = /* @__PURE__ */ new Map(), this.zip = t, this.entries = e, this.rawBuffer = s;
108
38
  }
@@ -110,7 +40,7 @@ var pt = (t, e, s) => {
110
40
  return t.startsWith("/") ? t.slice(1) : t;
111
41
  }
112
42
  static async create(e) {
113
- const s = e instanceof Blob ? Tt : e instanceof Uint8Array ? e : new Uint8Array(e), o = e instanceof Blob ? new it(e) : new at(s), r = new lt(o), n = /* @__PURE__ */ new Map();
43
+ const s = e instanceof Blob ? Wt : e instanceof Uint8Array ? e : new Uint8Array(e), o = e instanceof Blob ? new Lt(e) : new Vt(s), r = new jt(o), n = /* @__PURE__ */ new Map();
114
44
  for (const t of await r.getEntries()) t.directory || n.set(t.filename, t);
115
45
  return new t(r, n, s);
116
46
  }
@@ -128,12 +58,12 @@ var pt = (t, e, s) => {
128
58
  if (o) return o;
129
59
  const r = this.entries.get(s);
130
60
  if (!r) return null;
131
- const n = await r.getData(new ct());
61
+ const n = await r.getData(new Mt());
132
62
  return this.buffers.set(s, n), n;
133
63
  }
134
64
  async prefetch(t) {
135
65
  const e = [];
136
- for (const [s, o] of this.entries) !this.buffers.has(s) && t(s, o) && e.push(o.getData(new ct()).then((t) => {
66
+ for (const [s, o] of this.entries) !this.buffers.has(s) && t(s, o) && e.push(o.getData(new Mt()).then((t) => {
137
67
  this.buffers.set(s, t);
138
68
  }));
139
69
  await Promise.all(e);
@@ -176,18 +106,18 @@ var pt = (t, e, s) => {
176
106
  async close() {
177
107
  await this.zip.close();
178
108
  }
179
- }, St = class {
109
+ }, Xt = class {
180
110
  constructor(t) {
181
- this._sink = t, this._samples = [], this._t0 = Ct(), this._tPrev = this._t0, this._heapPrev = kt();
111
+ this._sink = t, this._samples = [], this._t0 = qt(), this._tPrev = this._t0, this._heapPrev = Ut();
182
112
  }
183
113
  mark(t) {
184
- const e = Ct(), s = kt(), o = {
114
+ const e = qt(), s = Ut(), o = {
185
115
  label: t,
186
116
  tMs: e - this._t0,
187
117
  dtMs: e - this._tPrev,
188
118
  heapBytes: s,
189
119
  dHeapBytes: void 0 !== s && void 0 !== this._heapPrev ? s - this._heapPrev : void 0,
190
- rssBytes: At()
120
+ rssBytes: Gt()
191
121
  };
192
122
  this._tPrev = e, this._heapPrev = s, this._samples.push(o), this._sink?.(o);
193
123
  }
@@ -199,91 +129,91 @@ var pt = (t, e, s) => {
199
129
  phase: t.label,
200
130
  tMs: Math.round(t.tMs),
201
131
  dtMs: Math.round(t.dtMs),
202
- heapMB: void 0 !== t.heapBytes ? Et(t.heapBytes / 1048576) : "—",
203
- dHeapMB: void 0 !== t.dHeapBytes ? Et(t.dHeapBytes / 1048576) : "—",
204
- rssMB: void 0 !== t.rssBytes ? Et(t.rssBytes / 1048576) : "—"
132
+ heapMB: void 0 !== t.heapBytes ? Zt(t.heapBytes / 1048576) : "—",
133
+ dHeapMB: void 0 !== t.dHeapBytes ? Zt(t.dHeapBytes / 1048576) : "—",
134
+ rssMB: void 0 !== t.rssBytes ? Zt(t.rssBytes / 1048576) : "—"
205
135
  }));
206
136
  }
207
- }, Ct = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now();
208
- function kt() {
137
+ }, qt = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now();
138
+ function Ut() {
209
139
  const t = "object" == typeof performance ? performance.memory : void 0;
210
140
  if (t && "number" == typeof t.usedJSHeapSize) return t.usedJSHeapSize;
211
141
  const e = globalThis.process;
212
142
  return "object" == typeof e && "function" == typeof e.memoryUsage ? e.memoryUsage().heapUsed : void 0;
213
143
  }
214
- function At() {
144
+ function Gt() {
215
145
  const t = globalThis.process;
216
146
  if ("object" == typeof t && "function" == typeof t.memoryUsage) return t.memoryUsage().rss;
217
147
  }
218
- function Et(t) {
148
+ function Zt(t) {
219
149
  return Math.round(10 * t) / 10;
220
150
  }
221
- var Pt = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Ot = `-${Pt}.0-9·̀-ͯ‿-⁀`, It = (new RegExp(`^[${Pt}]$`, "u"), new RegExp(`^[${Ot}]$`, "u"), new RegExp(`^[${Pt}][${Ot}]*$`, "u")), Dt = (new RegExp(`^[${Ot}]+$`, "u"), [
151
+ var Kt = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Jt = `-${Kt}.0-9·̀-ͯ‿-⁀`, Qt = (new RegExp(`^[${Kt}]$`, "u"), new RegExp(`^[${Jt}]$`, "u"), new RegExp(`^[${Kt}][${Jt}]*$`, "u")), Yt = (new RegExp(`^[${Jt}]+$`, "u"), [
222
152
  32,
223
153
  10,
224
154
  13,
225
155
  9
226
156
  ]);
227
- function Nt(t) {
157
+ function te(t) {
228
158
  return t >= 65 && t <= 90 || t >= 97 && t <= 122 || 58 === t || 95 === t || 8204 === t || 8205 === t || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 767 || t >= 880 && t <= 893 || t >= 895 && t <= 8191 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
229
159
  }
230
- var _t = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Lt = `-${_t}.0-9·̀-ͯ‿-⁀`;
231
- new RegExp(`^[${_t}]$`, "u"), new RegExp(`^[${Lt}]$`, "u"), new RegExp(`^[${_t}][${Lt}]*$`, "u"), new RegExp(`^[${Lt}]+$`, "u");
232
- var $t = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Vt = `-${$t}.0-9·̀-ͯ‿-⁀`, Rt = (new RegExp(`^[${$t}]$`, "u"), new RegExp(`^[${Vt}]$`, "u"), new RegExp(`^[${$t}][${Vt}]*$`, "u"));
233
- function jt(t) {
160
+ var ee = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", se = `-${ee}.0-9·̀-ͯ‿-⁀`;
161
+ new RegExp(`^[${ee}]$`, "u"), new RegExp(`^[${se}]$`, "u"), new RegExp(`^[${ee}][${se}]*$`, "u"), new RegExp(`^[${se}]+$`, "u");
162
+ var oe = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", re = `-${oe}.0-9·̀-ͯ‿-⁀`, ne = (new RegExp(`^[${oe}]$`, "u"), new RegExp(`^[${re}]$`, "u"), new RegExp(`^[${oe}][${re}]*$`, "u"));
163
+ function ie(t) {
234
164
  return t >= 65 && t <= 90 || 95 === t || t >= 97 && t <= 122 || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 767 || t >= 880 && t <= 893 || t >= 895 && t <= 8191 || t >= 8204 && t <= 8205 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
235
165
  }
236
- var Mt = function(t) {
166
+ var ae = function(t) {
237
167
  return 32 === t || 10 === t || 13 === t || 9 === t;
238
- }, Bt = function(t) {
168
+ }, le = function(t) {
239
169
  return t >= 32 && t <= 55295 || 10 === t || 13 === t || 9 === t || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
240
- }, Ht = Nt, Ft = function(t) {
241
- return Nt(t) || t >= 48 && t <= 57 || 45 === t || 46 === t || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
242
- }, Wt = Dt, zt = It, Xt = function(t) {
170
+ }, ce = te, he = function(t) {
171
+ return te(t) || t >= 48 && t <= 57 || 45 === t || 46 === t || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
172
+ }, ue = Yt, de = Qt, pe = function(t) {
243
173
  return t >= 1 && t <= 55295 || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
244
- }, qt = jt, Ut = function(t) {
245
- return jt(t) || 45 === t || 46 === t || t >= 48 && t <= 57 || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
246
- }, Gt = Rt, Kt = "http://www.w3.org/XML/1998/namespace", Jt = "http://www.w3.org/2000/xmlns/", Zt = {
174
+ }, fe = ie, ge = function(t) {
175
+ return ie(t) || 45 === t || 46 === t || t >= 48 && t <= 57 || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
176
+ }, me = ne, be = "http://www.w3.org/XML/1998/namespace", xe = "http://www.w3.org/2000/xmlns/", ve = {
247
177
  __proto__: null,
248
- xml: Kt,
249
- xmlns: Jt
250
- }, Qt = {
178
+ xml: be,
179
+ xmlns: xe
180
+ }, ye = {
251
181
  __proto__: null,
252
182
  amp: "&",
253
183
  gt: ">",
254
184
  lt: "<",
255
185
  quot: "\"",
256
186
  apos: "'"
257
- }, Yt = -1, te = -2, ee = 13, se = 33, oe = 10, re = 60, ne = 61, ie = 62, ae = 63, ce = 93, le = (t) => 34 === t || 39 === t, he = [34, 39], ue = [
258
- ...he,
187
+ }, we = -1, Te = -2, Se = 13, Ce = 33, ke = 10, Ae = 60, Ee = 61, Ie = 62, Pe = 63, Oe = 93, De = (t) => 34 === t || 39 === t, Ne = [34, 39], _e = [
188
+ ...Ne,
259
189
  91,
260
- ie
261
- ], de = [
262
- ...he,
263
- re,
264
- ce
265
- ], pe = [
266
- ne,
267
- ae,
268
- ...Wt
269
- ], fe = [
270
- ...Wt,
271
- ie,
190
+ Ie
191
+ ], $e = [
192
+ ...Ne,
193
+ Ae,
194
+ Oe
195
+ ], Re = [
196
+ Ee,
197
+ Pe,
198
+ ...ue
199
+ ], Le = [
200
+ ...ue,
201
+ Ie,
272
202
  38,
273
- re
203
+ Ae
274
204
  ];
275
- function ge(t, e, s) {
205
+ function Ve(t, e, s) {
276
206
  switch (e) {
277
207
  case "xml":
278
- s !== Kt && t.fail(`xml prefix must be bound to ${Kt}.`);
208
+ s !== be && t.fail(`xml prefix must be bound to ${be}.`);
279
209
  break;
280
- case "xmlns": s !== Jt && t.fail(`xmlns prefix must be bound to ${Jt}.`);
210
+ case "xmlns": s !== xe && t.fail(`xmlns prefix must be bound to ${xe}.`);
281
211
  }
282
212
  switch (s) {
283
- case Jt:
284
- t.fail("" === e ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${Jt}.`);
213
+ case xe:
214
+ t.fail("" === e ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${xe}.`);
285
215
  break;
286
- case Kt: switch (e) {
216
+ case be: switch (e) {
287
217
  case "xml": break;
288
218
  case "":
289
219
  t.fail(`the default namespace may not be set to ${s}.`);
@@ -292,7 +222,7 @@ function ge(t, e, s) {
292
222
  }
293
223
  }
294
224
  }
295
- var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
225
+ var Me, je = (t) => me.test(t), Be = (t) => de.test(t), He = {
296
226
  xmldecl: "xmlDeclHandler",
297
227
  text: "textHandler",
298
228
  processinginstruction: "piHandler",
@@ -306,7 +236,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
306
236
  error: "errorHandler",
307
237
  end: "endHandler",
308
238
  ready: "readyHandler"
309
- }, ve = class {
239
+ }, Fe = class {
310
240
  get closed() {
311
241
  return this._closed;
312
242
  }
@@ -314,15 +244,15 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
314
244
  this.i = 0, this.prevI = 0, this.opt = t ?? {}, this.fragmentOpt = !!this.opt.fragment;
315
245
  const e = this.xmlnsOpt = !!this.opt.xmlns;
316
246
  if (this.trackPosition = !1 !== this.opt.position, this.fileName = this.opt.fileName, e) {
317
- this.nameStartCheck = qt, this.nameCheck = Ut, this.isName = xe, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
247
+ this.nameStartCheck = fe, this.nameCheck = ge, this.isName = je, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
318
248
  __proto__: null,
319
- ...Zt
249
+ ...ve
320
250
  };
321
251
  const t = this.opt.additionalNamespaces;
322
252
  null != t && (function(t, e) {
323
- for (const s of Object.keys(e)) ge(t, s, e[s]);
253
+ for (const s of Object.keys(e)) Ve(t, s, e[s]);
324
254
  }(this, t), Object.assign(this.ns, t));
325
- } else this.nameStartCheck = Ht, this.nameCheck = Ft, this.isName = ye, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
255
+ } else this.nameStartCheck = ce, this.nameCheck = he, this.isName = Be, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
326
256
  this.stateTable = [
327
257
  this.sBegin,
328
258
  this.sBeginWhitespace,
@@ -374,7 +304,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
374
304
  _init() {
375
305
  this.openWakaBang = "", this.text = "", this.name = "", this.piTarget = "", this.entity = "", this.q = null, this.tags = [], this.tag = null, this.topNS = null, this.chunk = "", this.chunkPosition = 0, this.i = 0, this.prevI = 0, this.carriedFromPrevious = void 0, this.forbiddenState = 0, this.attribList = [];
376
306
  const { fragmentOpt: t } = this;
377
- this.state = t ? ee : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t, this.xmlDeclPossible = !t, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
307
+ this.state = t ? Se : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t, this.xmlDeclPossible = !t, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
378
308
  let { defaultXMLVersion: e } = this.opt;
379
309
  if (void 0 === e) {
380
310
  if (!0 === this.opt.forceXMLVersion) throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
@@ -384,7 +314,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
384
314
  version: void 0,
385
315
  encoding: void 0,
386
316
  standalone: void 0
387
- }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Qt), this.readyHandler?.();
317
+ }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(ye), this.readyHandler?.();
388
318
  }
389
319
  get position() {
390
320
  return this.chunkPosition + this.i;
@@ -393,10 +323,10 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
393
323
  return this.position - this.positionAtNewLine;
394
324
  }
395
325
  on(t, e) {
396
- this[be[t]] = e;
326
+ this[He[t]] = e;
397
327
  }
398
328
  off(t) {
399
- this[be[t]] = void 0;
329
+ this[He[t]] = void 0;
400
330
  }
401
331
  makeError(t) {
402
332
  let e = this.fileName ?? "";
@@ -423,13 +353,13 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
423
353
  }
424
354
  getCode10() {
425
355
  const t = this.chunk, e = this.i;
426
- if (this.prevI = e, this.i++, e >= t.length) return Yt;
356
+ if (this.prevI = e, this.i++, e >= t.length) return we;
427
357
  const s = t.charCodeAt(e);
428
358
  if (this.column++, s < 55296) {
429
359
  if (s >= 32 || 9 === s) return s;
430
360
  switch (s) {
431
- case oe: return this.line++, this.column = 0, this.positionAtNewLine = this.position, oe;
432
- case 13: return t.charCodeAt(e + 1) === oe && (this.i = e + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, te;
361
+ case ke: return this.line++, this.column = 0, this.positionAtNewLine = this.position, ke;
362
+ case 13: return t.charCodeAt(e + 1) === ke && (this.i = e + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, Te;
433
363
  default: return this.fail("disallowed character."), s;
434
364
  }
435
365
  }
@@ -439,18 +369,18 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
439
369
  }
440
370
  getCode11() {
441
371
  const { chunk: t, i: e } = this;
442
- if (this.prevI = e, this.i = e + 1, e >= t.length) return Yt;
372
+ if (this.prevI = e, this.i = e + 1, e >= t.length) return we;
443
373
  const s = t.charCodeAt(e);
444
374
  if (this.column++, s < 55296) {
445
375
  if (s > 31 && s < 127 || s > 159 && 8232 !== s || 9 === s) return s;
446
376
  switch (s) {
447
- case oe: return this.line++, this.column = 0, this.positionAtNewLine = this.position, oe;
377
+ case ke: return this.line++, this.column = 0, this.positionAtNewLine = this.position, ke;
448
378
  case 13: {
449
379
  const s = t.charCodeAt(e + 1);
450
- s !== oe && 133 !== s || (this.i = e + 2);
380
+ s !== ke && 133 !== s || (this.i = e + 2);
451
381
  }
452
382
  case 133:
453
- case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, te;
383
+ case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Te;
454
384
  default: return this.fail("disallowed character."), s;
455
385
  }
456
386
  }
@@ -460,7 +390,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
460
390
  }
461
391
  getCodeNorm() {
462
392
  const t = this.getCode();
463
- return t === te ? oe : t;
393
+ return t === Te ? ke : t;
464
394
  }
465
395
  unGet() {
466
396
  this.i = this.prevI, this.column--;
@@ -469,8 +399,8 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
469
399
  let { i: e } = this;
470
400
  const { chunk: s } = this;
471
401
  for (;;) {
472
- const o = this.getCode(), r = o === te, n = r ? oe : o;
473
- if (n === Yt || t.includes(n)) return this.text += s.slice(e, this.prevI), n;
402
+ const o = this.getCode(), r = o === Te, n = r ? ke : o;
403
+ if (n === we || t.includes(n)) return this.text += s.slice(e, this.prevI), n;
474
404
  r && (this.text += `${s.slice(e, this.prevI)}\n`, e = this.i);
475
405
  }
476
406
  }
@@ -480,10 +410,10 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
480
410
  for (;;) {
481
411
  let o = this.getCode();
482
412
  switch (o) {
483
- case te:
484
- this.text += `${s.slice(e, this.prevI)}\n`, e = this.i, o = oe;
413
+ case Te:
414
+ this.text += `${s.slice(e, this.prevI)}\n`, e = this.i, o = ke;
485
415
  break;
486
- case Yt: return this.text += s.slice(e), !1;
416
+ case we: return this.text += s.slice(e), !1;
487
417
  }
488
418
  if (o === t) return this.text += s.slice(e, this.prevI), !0;
489
419
  }
@@ -492,18 +422,18 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
492
422
  const { chunk: t, i: e } = this;
493
423
  for (;;) {
494
424
  const s = this.getCode();
495
- if (s === Yt) return this.name += t.slice(e), Yt;
496
- if (!Ft(s)) return this.name += t.slice(e, this.prevI), s === te ? oe : s;
425
+ if (s === we) return this.name += t.slice(e), we;
426
+ if (!he(s)) return this.name += t.slice(e, this.prevI), s === Te ? ke : s;
497
427
  }
498
428
  }
499
429
  skipSpaces() {
500
430
  for (;;) {
501
431
  const t = this.getCodeNorm();
502
- if (t === Yt || !Mt(t)) return t;
432
+ if (t === we || !ae(t)) return t;
503
433
  }
504
434
  }
505
435
  setXMLVersion(t) {
506
- this.currentXMLVersion = t, "1.0" === t ? (this.isChar = Bt, this.getCode = this.getCode10) : (this.isChar = Xt, this.getCode = this.getCode11);
436
+ this.currentXMLVersion = t, "1.0" === t ? (this.isChar = le, this.getCode = this.getCode10) : (this.isChar = pe, this.getCode = this.getCode11);
507
437
  }
508
438
  sBegin() {
509
439
  65279 === this.chunk.charCodeAt(0) && (this.i++, this.column++), this.state = 1;
@@ -511,21 +441,21 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
511
441
  sBeginWhitespace() {
512
442
  const t = this.i, e = this.skipSpaces();
513
443
  switch (this.prevI !== t && (this.xmlDeclPossible = !1), e) {
514
- case re:
444
+ case Ae:
515
445
  if (this.state = 15, 0 !== this.text.length) throw new Error("no-empty text at start");
516
446
  break;
517
- case Yt: break;
518
- default: this.unGet(), this.state = ee, this.xmlDeclPossible = !1;
447
+ case we: break;
448
+ default: this.unGet(), this.state = Se, this.xmlDeclPossible = !1;
519
449
  }
520
450
  }
521
451
  sDoctype() {
522
- const t = this.captureTo(ue);
452
+ const t = this.captureTo(_e);
523
453
  switch (t) {
524
- case ie:
525
- this.doctypeHandler?.(this.text), this.text = "", this.state = ee, this.doctype = !0;
454
+ case Ie:
455
+ this.doctypeHandler?.(this.text), this.text = "", this.state = Se, this.doctype = !0;
526
456
  break;
527
- case Yt: break;
528
- default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 : le(t) && (this.state = 3, this.q = t);
457
+ case we: break;
458
+ default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 : De(t) && (this.state = 3, this.q = t);
529
459
  }
530
460
  }
531
461
  sDoctypeQuote() {
@@ -533,8 +463,8 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
533
463
  this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.q = null, this.state = 2);
534
464
  }
535
465
  sDTD() {
536
- const t = this.captureTo(de);
537
- t !== Yt && (this.text += String.fromCodePoint(t), t === ce ? this.state = 2 : t === re ? this.state = 6 : le(t) && (this.state = 5, this.q = t));
466
+ const t = this.captureTo($e);
467
+ t !== we && (this.text += String.fromCodePoint(t), t === Oe ? this.state = 2 : t === Ae ? this.state = 6 : De(t) && (this.state = 5, this.q = t));
538
468
  }
539
469
  sDTDQuoted() {
540
470
  const t = this.q;
@@ -546,7 +476,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
546
476
  case 33:
547
477
  this.state = 7, this.openWakaBang = "";
548
478
  break;
549
- case ae:
479
+ case Pe:
550
480
  this.state = 11;
551
481
  break;
552
482
  default: this.state = 4;
@@ -565,14 +495,14 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
565
495
  }
566
496
  sDTDCommentEnded() {
567
497
  const t = this.getCodeNorm();
568
- this.text += String.fromCodePoint(t), t === ie ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
498
+ this.text += String.fromCodePoint(t), t === Ie ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
569
499
  }
570
500
  sDTDPI() {
571
- this.captureToChar(ae) && (this.text += "?", this.state = 12);
501
+ this.captureToChar(Pe) && (this.text += "?", this.state = 12);
572
502
  }
573
503
  sDTDPIEnding() {
574
504
  const t = this.getCodeNorm();
575
- this.text += String.fromCodePoint(t), t === ie && (this.state = 4);
505
+ this.text += String.fromCodePoint(t), t === Ie && (this.state = 4);
576
506
  }
577
507
  sText() {
578
508
  0 !== this.tags.length ? this.handleTextInRoot() : this.handleTextOutsideRoot();
@@ -581,23 +511,23 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
581
511
  let { i: t } = this;
582
512
  const { chunk: e } = this;
583
513
  t: for (;;) switch (this.getCode()) {
584
- case te:
514
+ case Te:
585
515
  this.entity += `${e.slice(t, this.prevI)}\n`, t = this.i;
586
516
  break;
587
517
  case 59: {
588
518
  const { entityReturnState: s } = this, o = this.entity + e.slice(t, this.prevI);
589
519
  let r;
590
- this.state = s, "" === o ? (this.fail("empty entity name."), r = "&;") : (r = this.parseEntity(o), this.entity = ""), s === ee && void 0 === this.textHandler || (this.text += r);
520
+ this.state = s, "" === o ? (this.fail("empty entity name."), r = "&;") : (r = this.parseEntity(o), this.entity = ""), s === Se && void 0 === this.textHandler || (this.text += r);
591
521
  break t;
592
522
  }
593
- case Yt:
523
+ case we:
594
524
  this.entity += e.slice(t);
595
525
  break t;
596
526
  }
597
527
  }
598
528
  sOpenWaka() {
599
529
  const t = this.getCode();
600
- if (Ht(t)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
530
+ if (ce(t)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
601
531
  else switch (t) {
602
532
  case 47:
603
533
  this.state = 43, this.xmlDeclPossible = !1;
@@ -605,10 +535,10 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
605
535
  case 33:
606
536
  this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
607
537
  break;
608
- case ae:
538
+ case Pe:
609
539
  this.state = 23;
610
540
  break;
611
- default: this.fail("disallowed character in tag name"), this.state = ee, this.xmlDeclPossible = !1;
541
+ default: this.fail("disallowed character in tag name"), this.state = Se, this.xmlDeclPossible = !1;
612
542
  }
613
543
  }
614
544
  sOpenWakaBang() {
@@ -634,22 +564,22 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
634
564
  }
635
565
  sCommentEnded() {
636
566
  const t = this.getCodeNorm();
637
- t !== ie ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = ee;
567
+ t !== Ie ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = Se;
638
568
  }
639
569
  sCData() {
640
- this.captureToChar(ce) && (this.state = 21);
570
+ this.captureToChar(Oe) && (this.state = 21);
641
571
  }
642
572
  sCDataEnding() {
643
573
  const t = this.getCodeNorm();
644
- t === ce ? this.state = 22 : (this.text += `]${String.fromCodePoint(t)}`, this.state = 20);
574
+ t === Oe ? this.state = 22 : (this.text += `]${String.fromCodePoint(t)}`, this.state = 20);
645
575
  }
646
576
  sCDataEnding2() {
647
577
  const t = this.getCodeNorm();
648
578
  switch (t) {
649
- case ie:
650
- this.cdataHandler?.(this.text), this.text = "", this.state = ee;
579
+ case Ie:
580
+ this.cdataHandler?.(this.text), this.text = "", this.state = Se;
651
581
  break;
652
- case ce:
582
+ case Oe:
653
583
  this.text += "]";
654
584
  break;
655
585
  default: this.text += `]]${String.fromCodePoint(t)}`, this.state = 20;
@@ -657,17 +587,17 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
657
587
  }
658
588
  sPIFirstChar() {
659
589
  const t = this.getCodeNorm();
660
- this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t === ae || Mt(t) ? (this.fail("processing instruction without a target."), this.state = t === ae ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t), this.state = 24);
590
+ this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t === Pe || ae(t) ? (this.fail("processing instruction without a target."), this.state = t === Pe ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t), this.state = 24);
661
591
  }
662
592
  sPIRest() {
663
593
  const { chunk: t, i: e } = this;
664
594
  for (;;) {
665
595
  const s = this.getCodeNorm();
666
- if (s === Yt) return void (this.piTarget += t.slice(e));
596
+ if (s === we) return void (this.piTarget += t.slice(e));
667
597
  if (!this.nameCheck(s)) {
668
598
  this.piTarget += t.slice(e, this.prevI);
669
- const o = s === ae;
670
- o || Mt(s) ? "xml" === this.piTarget ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = o ? se : 27) : this.state = o ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(s));
599
+ const o = s === Pe;
600
+ o || ae(s) ? "xml" === this.piTarget ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = o ? Ce : 27) : this.state = o ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(s));
671
601
  break;
672
602
  }
673
603
  }
@@ -675,28 +605,28 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
675
605
  sPIBody() {
676
606
  if (0 === this.text.length) {
677
607
  const t = this.getCodeNorm();
678
- t === ae ? this.state = 26 : Mt(t) || (this.text = String.fromCodePoint(t));
679
- } else this.captureToChar(ae) && (this.state = 26);
608
+ t === Pe ? this.state = 26 : ae(t) || (this.text = String.fromCodePoint(t));
609
+ } else this.captureToChar(Pe) && (this.state = 26);
680
610
  }
681
611
  sPIEnding() {
682
612
  const t = this.getCodeNorm();
683
- if (t === ie) {
613
+ if (t === Ie) {
684
614
  const { piTarget: t } = this;
685
615
  "xml" === t.toLowerCase() && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({
686
616
  target: t,
687
617
  body: this.text
688
- }), this.piTarget = this.text = "", this.state = ee;
689
- } else t === ae ? this.text += "?" : (this.text += `?${String.fromCodePoint(t)}`, this.state = 25);
618
+ }), this.piTarget = this.text = "", this.state = Se;
619
+ } else t === Pe ? this.text += "?" : (this.text += `?${String.fromCodePoint(t)}`, this.state = 25);
690
620
  this.xmlDeclPossible = !1;
691
621
  }
692
622
  sXMLDeclNameStart() {
693
623
  const t = this.skipSpaces();
694
- t !== ae ? t !== Yt && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = se;
624
+ t !== Pe ? t !== we && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = Ce;
695
625
  }
696
626
  sXMLDeclName() {
697
- const t = this.captureTo(pe);
698
- if (t === ae) return this.state = se, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
699
- if (Mt(t) || t === ne) {
627
+ const t = this.captureTo(Re);
628
+ if (t === Pe) return this.state = Ce, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
629
+ if (ae(t) || t === Ee) {
700
630
  if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
701
631
  case 0:
702
632
  this.fail("did not expect any more name/value pairs.");
@@ -706,23 +636,23 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
706
636
  break;
707
637
  default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
708
638
  }
709
- this.state = t === ne ? 30 : 29;
639
+ this.state = t === Ee ? 30 : 29;
710
640
  }
711
641
  }
712
642
  sXMLDeclEq() {
713
643
  const t = this.getCodeNorm();
714
- if (t === ae) return this.state = se, void this.fail("XML declaration is incomplete.");
715
- Mt(t) || (t !== ne && this.fail("value required."), this.state = 30);
644
+ if (t === Pe) return this.state = Ce, void this.fail("XML declaration is incomplete.");
645
+ ae(t) || (t !== Ee && this.fail("value required."), this.state = 30);
716
646
  }
717
647
  sXMLDeclValueStart() {
718
648
  const t = this.getCodeNorm();
719
- if (t === ae) return this.state = se, void this.fail("XML declaration is incomplete.");
720
- Mt(t) || (le(t) ? this.q = t : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
649
+ if (t === Pe) return this.state = Ce, void this.fail("XML declaration is incomplete.");
650
+ ae(t) || (De(t) ? this.q = t : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
721
651
  }
722
652
  sXMLDeclValue() {
723
- const t = this.captureTo([this.q, ae]);
724
- if (t === ae) return this.state = se, this.text = "", void this.fail("XML declaration is incomplete.");
725
- if (t === Yt) return;
653
+ const t = this.captureTo([this.q, Pe]);
654
+ if (t === Pe) return this.state = Ce, this.text = "", void this.fail("XML declaration is incomplete.");
655
+ if (t === we) return;
726
656
  const e = this.text;
727
657
  switch (this.text = "", this.name) {
728
658
  case "version": {
@@ -740,52 +670,52 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
740
670
  }
741
671
  sXMLDeclSeparator() {
742
672
  const t = this.getCodeNorm();
743
- t !== ae ? (Mt(t) || (this.fail("whitespace required."), this.unGet()), this.state = 27) : this.state = se;
673
+ t !== Pe ? (ae(t) || (this.fail("whitespace required."), this.unGet()), this.state = 27) : this.state = Ce;
744
674
  }
745
675
  sXMLDeclEnding() {
746
- this.getCodeNorm() === ie ? ("xml" !== this.piTarget ? this.fail("processing instructions are not allowed before root.") : "version" !== this.name && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = ee) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
676
+ this.getCodeNorm() === Ie ? ("xml" !== this.piTarget ? this.fail("processing instructions are not allowed before root.") : "version" !== this.name && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = Se) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
747
677
  }
748
678
  sOpenTag() {
749
679
  const t = this.captureNameChars();
750
- if (t === Yt) return;
680
+ if (t === we) return;
751
681
  const e = this.tag = {
752
682
  name: this.name,
753
683
  attributes: Object.create(null)
754
684
  };
755
685
  switch (this.name = "", this.xmlnsOpt && (this.topNS = e.ns = Object.create(null)), this.openTagStartHandler?.(e), this.sawRoot = !0, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), t) {
756
- case ie:
686
+ case Ie:
757
687
  this.openTag();
758
688
  break;
759
689
  case 47:
760
690
  this.state = 35;
761
691
  break;
762
- default: Mt(t) || this.fail("disallowed character in tag name."), this.state = 36;
692
+ default: ae(t) || this.fail("disallowed character in tag name."), this.state = 36;
763
693
  }
764
694
  }
765
695
  sOpenTagSlash() {
766
- this.getCode() === ie ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
696
+ this.getCode() === Ie ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
767
697
  }
768
698
  sAttrib() {
769
699
  const t = this.skipSpaces();
770
- t !== Yt && (Ht(t) ? (this.unGet(), this.state = 37) : t === ie ? this.openTag() : 47 === t ? this.state = 35 : this.fail("disallowed character in attribute name."));
700
+ t !== we && (ce(t) ? (this.unGet(), this.state = 37) : t === Ie ? this.openTag() : 47 === t ? this.state = 35 : this.fail("disallowed character in attribute name."));
771
701
  }
772
702
  sAttribName() {
773
703
  const t = this.captureNameChars();
774
- t === ne ? this.state = 39 : Mt(t) ? this.state = 38 : t === ie ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== Yt && this.fail("disallowed character in attribute name.");
704
+ t === Ee ? this.state = 39 : ae(t) ? this.state = 38 : t === Ie ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== we && this.fail("disallowed character in attribute name.");
775
705
  }
776
706
  sAttribNameSawWhite() {
777
707
  const t = this.skipSpaces();
778
708
  switch (t) {
779
- case Yt: return;
780
- case ne:
709
+ case we: return;
710
+ case Ee:
781
711
  this.state = 39;
782
712
  break;
783
- default: this.fail("attribute without value."), this.text = "", this.name = "", t === ie ? this.openTag() : Ht(t) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
713
+ default: this.fail("attribute without value."), this.text = "", this.name = "", t === Ie ? this.openTag() : ce(t) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
784
714
  }
785
715
  }
786
716
  sAttribValue() {
787
717
  const t = this.getCodeNorm();
788
- le(t) ? (this.q = t, this.state = 40) : Mt(t) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
718
+ De(t) ? (this.q = t, this.state = 40) : ae(t) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
789
719
  }
790
720
  sAttribValueQuoted() {
791
721
  const { q: t, chunk: e } = this;
@@ -797,46 +727,46 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
797
727
  case 38:
798
728
  this.text += e.slice(s, this.prevI), this.state = 14, this.entityReturnState = 40;
799
729
  return;
800
- case oe:
801
- case te:
730
+ case ke:
731
+ case Te:
802
732
  case 9:
803
733
  this.text += `${e.slice(s, this.prevI)} `, s = this.i;
804
734
  break;
805
- case re:
735
+ case Ae:
806
736
  this.text += e.slice(s, this.prevI), this.fail("disallowed character.");
807
737
  return;
808
- case Yt:
738
+ case we:
809
739
  this.text += e.slice(s);
810
740
  return;
811
741
  }
812
742
  }
813
743
  sAttribValueClosed() {
814
744
  const t = this.getCodeNorm();
815
- Mt(t) ? this.state = 36 : t === ie ? this.openTag() : 47 === t ? this.state = 35 : Ht(t) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
745
+ ae(t) ? this.state = 36 : t === Ie ? this.openTag() : 47 === t ? this.state = 35 : ce(t) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
816
746
  }
817
747
  sAttribValueUnquoted() {
818
- const t = this.captureTo(fe);
748
+ const t = this.captureTo(Le);
819
749
  switch (t) {
820
750
  case 38:
821
751
  this.state = 14, this.entityReturnState = 42;
822
752
  break;
823
- case re:
753
+ case Ae:
824
754
  this.fail("disallowed character.");
825
755
  break;
826
- case Yt: break;
827
- default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", t === ie ? this.openTag() : this.state = 36;
756
+ case we: break;
757
+ default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", t === Ie ? this.openTag() : this.state = 36;
828
758
  }
829
759
  }
830
760
  sCloseTag() {
831
761
  const t = this.captureNameChars();
832
- t === ie ? this.closeTag() : Mt(t) ? this.state = 44 : t !== Yt && this.fail("disallowed character in closing tag.");
762
+ t === Ie ? this.closeTag() : ae(t) ? this.state = 44 : t !== we && this.fail("disallowed character in closing tag.");
833
763
  }
834
764
  sCloseTagSawWhite() {
835
765
  switch (this.skipSpaces()) {
836
- case ie:
766
+ case Ie:
837
767
  this.closeTag();
838
768
  break;
839
- case Yt: break;
769
+ case we: break;
840
770
  default: this.fail("disallowed character in closing tag.");
841
771
  }
842
772
  }
@@ -844,7 +774,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
844
774
  let { i: t, forbiddenState: e } = this;
845
775
  const { chunk: s, textHandler: o } = this;
846
776
  t: for (;;) switch (this.getCode()) {
847
- case re:
777
+ case Ae:
848
778
  if (this.state = 15, void 0 !== o) {
849
779
  const { text: e } = this, r = s.slice(t, this.prevI);
850
780
  0 !== e.length ? (o(e + r), this.text = "") : 0 !== r.length && o(r);
@@ -852,9 +782,9 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
852
782
  e = 0;
853
783
  break t;
854
784
  case 38:
855
- this.state = 14, this.entityReturnState = ee, void 0 !== o && (this.text += s.slice(t, this.prevI)), e = 0;
785
+ this.state = 14, this.entityReturnState = Se, void 0 !== o && (this.text += s.slice(t, this.prevI)), e = 0;
856
786
  break t;
857
- case ce:
787
+ case Oe:
858
788
  switch (e) {
859
789
  case 0:
860
790
  e = 1;
@@ -866,13 +796,13 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
866
796
  default: throw new Error("impossible state");
867
797
  }
868
798
  break;
869
- case ie:
799
+ case Ie:
870
800
  2 === e && this.fail("the string \"]]>\" is disallowed in char data."), e = 0;
871
801
  break;
872
- case te:
802
+ case Te:
873
803
  void 0 !== o && (this.text += `${s.slice(t, this.prevI)}\n`), t = this.i, e = 0;
874
804
  break;
875
- case Yt:
805
+ case we:
876
806
  void 0 !== o && (this.text += s.slice(t));
877
807
  break t;
878
808
  default: e = 0;
@@ -886,22 +816,22 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
886
816
  t: for (;;) {
887
817
  const r = this.getCode();
888
818
  switch (r) {
889
- case re:
819
+ case Ae:
890
820
  if (this.state = 15, void 0 !== s) {
891
821
  const { text: o } = this, r = e.slice(t, this.prevI);
892
822
  0 !== o.length ? (s(o + r), this.text = "") : 0 !== r.length && s(r);
893
823
  }
894
824
  break t;
895
825
  case 38:
896
- this.state = 14, this.entityReturnState = ee, void 0 !== s && (this.text += e.slice(t, this.prevI)), o = !0;
826
+ this.state = 14, this.entityReturnState = Se, void 0 !== s && (this.text += e.slice(t, this.prevI)), o = !0;
897
827
  break t;
898
- case te:
828
+ case Te:
899
829
  void 0 !== s && (this.text += `${e.slice(t, this.prevI)}\n`), t = this.i;
900
830
  break;
901
- case Yt:
831
+ case we:
902
832
  void 0 !== s && (this.text += e.slice(t));
903
833
  break t;
904
- default: Mt(r) || (o = !0);
834
+ default: ae(r) || (o = !0);
905
835
  }
906
836
  }
907
837
  o && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0));
@@ -915,10 +845,10 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
915
845
  };
916
846
  if (this.attribList.push(r), this.attributeHandler?.(r), "xmlns" === s) {
917
847
  const t = e.trim();
918
- "1.0" === this.currentXMLVersion && "" === t && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[o] = t, ge(this, o, t);
848
+ "1.0" === this.currentXMLVersion && "" === t && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[o] = t, Ve(this, o, t);
919
849
  } else if ("xmlns" === t) {
920
850
  const t = e.trim();
921
- this.topNS[""] = t, ge(this, "", t);
851
+ this.topNS[""] = t, Ve(this, "", t);
922
852
  }
923
853
  }
924
854
  pushAttribPlain(t, e) {
@@ -935,7 +865,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
935
865
  const e = t.pop();
936
866
  this.fail(`unclosed tag: ${e.name}`);
937
867
  }
938
- 0 !== this.state && this.state !== ee && this.fail("unexpected end.");
868
+ 0 !== this.state && this.state !== Se && this.fail("unexpected end.");
939
869
  const { text: e } = this;
940
870
  return 0 !== e.length && (this.textHandler?.(e), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
941
871
  }
@@ -971,7 +901,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
971
901
  for (const e of t) {
972
902
  const { name: t, prefix: r, local: n } = e;
973
903
  let i, a;
974
- "" === r ? (i = "xmlns" === t ? Jt : "", a = t) : (i = this.resolve(r), void 0 === i && (this.fail(`unbound namespace prefix: ${JSON.stringify(r)}.`), i = r), a = `{${i}}${n}`), o.has(a) && this.fail(`duplicate attribute: ${a}.`), o.add(a), e.uri = i, s[t] = e;
904
+ "" === r ? (i = "xmlns" === t ? xe : "", a = t) : (i = this.resolve(r), void 0 === i && (this.fail(`unbound namespace prefix: ${JSON.stringify(r)}.`), i = r), a = `{${i}}${n}`), o.has(a) && this.fail(`duplicate attribute: ${a}.`), o.add(a), e.uri = i, s[t] = e;
975
905
  }
976
906
  this.attribList = [];
977
907
  }
@@ -983,16 +913,16 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
983
913
  openTag() {
984
914
  this.processAttribs();
985
915
  const { tags: t } = this, e = this.tag;
986
- e.isSelfClosing = !1, this.openTagHandler?.(e), t.push(e), this.state = ee, this.name = "";
916
+ e.isSelfClosing = !1, this.openTagHandler?.(e), t.push(e), this.state = Se, this.name = "";
987
917
  }
988
918
  openSelfClosingTag() {
989
919
  this.processAttribs();
990
920
  const { tags: t } = this, e = this.tag;
991
- e.isSelfClosing = !0, this.openTagHandler?.(e), this.closeTagHandler?.(e), null === (this.tag = t[t.length - 1] ?? null) && (this.closedRoot = !0), this.state = ee, this.name = "";
921
+ e.isSelfClosing = !0, this.openTagHandler?.(e), this.closeTagHandler?.(e), null === (this.tag = t[t.length - 1] ?? null) && (this.closedRoot = !0), this.state = Se, this.name = "";
992
922
  }
993
923
  closeTag() {
994
924
  const { tags: t, name: e } = this;
995
- if (this.state = ee, this.name = "", "" === e) return this.fail("weird empty close tag."), void (this.text += "</>");
925
+ if (this.state = Se, this.name = "", "" === e) return this.fail("weird empty close tag."), void (this.text += "</>");
996
926
  const s = this.closeTagHandler;
997
927
  let o = t.length;
998
928
  for (; o-- > 0;) {
@@ -1010,21 +940,21 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
1010
940
  let e = NaN;
1011
941
  return "x" === t[1] && /^#x[0-9a-f]+$/i.test(t) ? e = parseInt(t.slice(2), 16) : /^#[0-9]+$/.test(t) && (e = parseInt(t.slice(1), 10)), this.isChar(e) ? String.fromCodePoint(e) : (this.fail("malformed character entity."), `&${t};`);
1012
942
  }
1013
- }, Te = /&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, we = {
943
+ }, We = /&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, ze = {
1014
944
  amp: "&",
1015
945
  lt: "<",
1016
946
  gt: ">",
1017
947
  quot: "\"",
1018
948
  apos: "'"
1019
- }, Se = (t, e) => {
1020
- const s = we[e];
949
+ }, Xe = (t, e) => {
950
+ const s = ze[e];
1021
951
  if (void 0 !== s) return s;
1022
952
  const o = 120 === e.charCodeAt(1) ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);
1023
953
  return o > 0 && o <= 1114111 ? String.fromCodePoint(o) : t;
1024
- }, Ce = (t) => {
954
+ }, qe = (t) => {
1025
955
  let e = t;
1026
- return -1 !== e.indexOf("\r") && (e = e.replace(/\r\n?/g, "\n")), -1 !== e.indexOf("&") && (e = e.replace(Te, Se)), e;
1027
- }, ke = (t) => {
956
+ return -1 !== e.indexOf("\r") && (e = e.replace(/\r\n?/g, "\n")), -1 !== e.indexOf("&") && (e = e.replace(We, Xe)), e;
957
+ }, Ue = (t) => {
1028
958
  let e = t;
1029
959
  const s = e.length;
1030
960
  for (let t = 0; t < s; t++) {
@@ -1034,8 +964,8 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
1034
964
  break;
1035
965
  }
1036
966
  }
1037
- return -1 !== e.indexOf("&") && (e = e.replace(Te, Se)), e;
1038
- }, Ae = (t) => 32 === t || 9 === t || 10 === t || 13 === t, Ee = class t {
967
+ return -1 !== e.indexOf("&") && (e = e.replace(We, Xe)), e;
968
+ }, Ge = (t) => 32 === t || 9 === t || 10 === t || 13 === t, Ze = class t {
1039
969
  constructor() {
1040
970
  this._openTagHandler = void 0, this._closeTagHandler = void 0, this._textHandler = void 0, this._cdataHandler = void 0, this._errorHandler = void 0, this._endHandler = void 0, this._scanners = null, this._carry = "", this._text = "", this._tags = [], this._sawRoot = !1, this._closed = !1;
1041
971
  }
@@ -1046,7 +976,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
1046
976
  this.NOT_HANDLED = -2;
1047
977
  }
1048
978
  static decodeText(t) {
1049
- return Ce(t);
979
+ return qe(t);
1050
980
  }
1051
981
  on(t, e) {
1052
982
  switch (t) {
@@ -1113,7 +1043,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
1113
1043
  if (0 === t.length) return;
1114
1044
  this._text = "";
1115
1045
  const e = this._textHandler;
1116
- void 0 !== e && 0 !== this._tags.length && e(Ce(t));
1046
+ void 0 !== e && 0 !== this._tags.length && e(qe(t));
1117
1047
  }
1118
1048
  _markup(e, s, o) {
1119
1049
  if (s + 1 >= o) return -1;
@@ -1152,7 +1082,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
1152
1082
  const r = s + 1 + i.name.length;
1153
1083
  if (r >= o) return -1;
1154
1084
  const n = e.charCodeAt(r);
1155
- if (62 === n || 47 === n || Ae(n)) {
1085
+ if (62 === n || 47 === n || Ge(n)) {
1156
1086
  this._flushText();
1157
1087
  const r = i.scan(e, s, o);
1158
1088
  if (r !== t.NOT_HANDLED) {
@@ -1170,12 +1100,12 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
1170
1100
  }
1171
1101
  _openTag(t, e, s) {
1172
1102
  let o = e + 1, r = 0;
1173
- for (; o < s && (r = t.charCodeAt(o), 62 !== r && 47 !== r && !Ae(r));) o++;
1103
+ for (; o < s && (r = t.charCodeAt(o), 62 !== r && 47 !== r && !Ge(r));) o++;
1174
1104
  if (o >= s) return -1;
1175
1105
  const n = t.slice(e + 1, o), i = {};
1176
1106
  let a = !1;
1177
1107
  for (;;) {
1178
- for (; o < s && Ae(r = t.charCodeAt(o));) o++;
1108
+ for (; o < s && Ge(r = t.charCodeAt(o));) o++;
1179
1109
  if (o >= s) return -1;
1180
1110
  if (62 === r) {
1181
1111
  o++;
@@ -1191,32 +1121,32 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
1191
1121
  break;
1192
1122
  }
1193
1123
  const e = o;
1194
- for (; o < s && (r = t.charCodeAt(o), 61 !== r && 62 !== r && 47 !== r && !Ae(r));) o++;
1124
+ for (; o < s && (r = t.charCodeAt(o), 61 !== r && 62 !== r && 47 !== r && !Ge(r));) o++;
1195
1125
  if (o >= s) return -1;
1196
1126
  const n = t.slice(e, o);
1197
- for (; o < s && Ae(r = t.charCodeAt(o));) o++;
1127
+ for (; o < s && Ge(r = t.charCodeAt(o));) o++;
1198
1128
  if (o >= s) return -1;
1199
1129
  if (61 !== r) {
1200
1130
  this.fail("attribute without value.");
1201
1131
  continue;
1202
1132
  }
1203
- for (o++; o < s && Ae(r = t.charCodeAt(o));) o++;
1133
+ for (o++; o < s && Ge(r = t.charCodeAt(o));) o++;
1204
1134
  if (o >= s) return -1;
1205
1135
  if (34 !== r && 39 !== r) {
1206
1136
  this.fail("unquoted attribute value.");
1207
1137
  continue;
1208
1138
  }
1209
- const c = t.indexOf(34 === r ? "\"" : "'", o + 1);
1210
- if (-1 === c) return -1;
1211
- "__proto__" !== n && (i[n] = ke(t.slice(o + 1, c))), o = c + 1;
1139
+ const l = t.indexOf(34 === r ? "\"" : "'", o + 1);
1140
+ if (-1 === l) return -1;
1141
+ "__proto__" !== n && (i[n] = Ue(t.slice(o + 1, l))), o = l + 1;
1212
1142
  }
1213
1143
  this._flushText(), this._sawRoot = !0;
1214
- const c = {
1144
+ const l = {
1215
1145
  name: n,
1216
1146
  attributes: i,
1217
1147
  isSelfClosing: a
1218
1148
  };
1219
- return this._openTagHandler?.(c), a ? this._closeTagHandler?.(c) : this._tags.push(c), o;
1149
+ return this._openTagHandler?.(l), a ? this._closeTagHandler?.(l) : this._tags.push(l), o;
1220
1150
  }
1221
1151
  _closeTag(t) {
1222
1152
  if ("" === t) return void this.fail("weird empty close tag.");
@@ -1248,7 +1178,7 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
1248
1178
  };
1249
1179
  t.parseStream = async (t, e, s) => {
1250
1180
  if (s?.lean) return (async (t, e) => {
1251
- const s = new Ee();
1181
+ const s = new Ze();
1252
1182
  let o;
1253
1183
  e.elementScanners && s.setElementScanners(e.elementScanners), e.onOpenTag && s.on("opentag", e.onOpenTag), e.onCloseTag && s.on("closetag", e.onCloseTag), e.onText && s.on("text", e.onText), e.onError && s.on("error", e.onError);
1254
1184
  const r = e.onEnd;
@@ -1261,18 +1191,18 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
1261
1191
  }
1262
1192
  return s.close(), o;
1263
1193
  })(t, e);
1264
- const o = new ve({
1194
+ const o = new Fe({
1265
1195
  position: !1,
1266
1196
  ...s
1267
1197
  });
1268
1198
  let r;
1269
- e.onOpenTagStart && o.on(me.Events.OpenTagStart, e.onOpenTagStart), e.onOpenTag && o.on(me.Events.OpenTag, e.onOpenTag), e.onCloseTag && o.on(me.Events.CloseTag, e.onCloseTag), e.onAttribute && o.on(me.Events.Attribute, e.onAttribute), e.onText && o.on(me.Events.Text, e.onText), e.onError && o.on(me.Events.Error, e.onError);
1199
+ e.onOpenTagStart && o.on(Me.Events.OpenTagStart, e.onOpenTagStart), e.onOpenTag && o.on(Me.Events.OpenTag, e.onOpenTag), e.onCloseTag && o.on(Me.Events.CloseTag, e.onCloseTag), e.onAttribute && o.on(Me.Events.Attribute, e.onAttribute), e.onText && o.on(Me.Events.Text, e.onText), e.onError && o.on(Me.Events.Error, e.onError);
1270
1200
  const n = e.onEnd;
1271
1201
  if (n) {
1272
1202
  const t = () => {
1273
1203
  r = n();
1274
1204
  };
1275
- o.on(me.Events.End, t);
1205
+ o.on(Me.Events.End, t);
1276
1206
  }
1277
1207
  for (;;) {
1278
1208
  const { value: e, done: s } = await t.read();
@@ -1281,14 +1211,14 @@ var me, xe = (t) => Gt.test(t), ye = (t) => zt.test(t), be = {
1281
1211
  }
1282
1212
  return o.close(), r;
1283
1213
  };
1284
- })(me || (me = {}));
1285
- var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, Oe = (t) => {
1214
+ })(Me || (Me = {}));
1215
+ var Ke = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, Je = (t) => {
1286
1216
  const e = parseInt(t);
1287
1217
  return isNaN(e) ? null : e;
1288
- }, Ie = (t) => {
1218
+ }, Qe = (t) => {
1289
1219
  const e = parseFloat(t);
1290
1220
  return isNaN(e) ? null : e;
1291
- }, De = null, Ne = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), _e = (t) => Ne(t).replace(/"/g, "&quot;"), Le = class {
1221
+ }, Ye = null, ts = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), es = (t) => ts(t).replace(/"/g, "&quot;"), ss = class {
1292
1222
  constructor() {
1293
1223
  this._registeredVisitors = /* @__PURE__ */ new Map();
1294
1224
  }
@@ -1297,15 +1227,15 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1297
1227
  }
1298
1228
  createEventHandler(t, e, s) {
1299
1229
  const o = this._registeredVisitors, r = [], n = [];
1300
- let i = null, a = null, c = null, l = null;
1230
+ let i = null, a = null, l = null, c = null;
1301
1231
  const h = [], u = {
1302
1232
  key: null,
1303
1233
  source: t,
1304
1234
  parent: null
1305
1235
  };
1306
1236
  let d = null, p = !1, f = null, g = null, m = null;
1307
- const x = (t, e) => {
1308
- let s = c.attributes[t];
1237
+ const b = (t, e) => {
1238
+ let s = l.attributes[t];
1309
1239
  if (e) if (Array.isArray(e)) {
1310
1240
  const t = e.length;
1311
1241
  for (let o = 0; o < t; o++) {
@@ -1317,7 +1247,7 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1317
1247
  if (s = e(s), null == s) return;
1318
1248
  }
1319
1249
  return s;
1320
- }, y = {
1250
+ }, x = {
1321
1251
  getSource: () => d?.source ?? null,
1322
1252
  setSource: (t) => {
1323
1253
  d.source = t;
@@ -1325,9 +1255,9 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1325
1255
  setKey: (t) => {
1326
1256
  d.key = t;
1327
1257
  },
1328
- getFrom: () => c,
1329
- getAttribute: (t, e) => x(t, e) ?? null,
1330
- hasAttribute: (t) => null !== y.getAttribute(t),
1258
+ getFrom: () => l,
1259
+ getAttribute: (t, e) => b(t, e) ?? null,
1260
+ hasAttribute: (t) => null !== x.getAttribute(t),
1331
1261
  getParent: () => {
1332
1262
  const t = h[h.length - 2];
1333
1263
  return t.parent ?? t.source;
@@ -1337,14 +1267,14 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1337
1267
  for (let s = 0; s < e; s++) t.push(n[s].local);
1338
1268
  return t.join("\\");
1339
1269
  },
1340
- parseAttribute: x,
1270
+ parseAttribute: b,
1341
1271
  getRawXml: () => m,
1342
1272
  copyToObject: (t, e, s, o) => {
1343
- const r = x(o ?? e, s);
1273
+ const r = b(o ?? e, s);
1344
1274
  void 0 !== r && (t[e] = r);
1345
1275
  },
1346
1276
  copyTo: (t, e, s) => {
1347
- const o = x(s ?? t, e);
1277
+ const o = b(s ?? t, e);
1348
1278
  void 0 !== o && (d.source[t] = o);
1349
1279
  },
1350
1280
  warn: (t, e) => {
@@ -1360,62 +1290,62 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1360
1290
  let s = `<${t.name}`;
1361
1291
  for (const t in e) {
1362
1292
  const o = e[t];
1363
- s += ` ${t}="${_e("string" == typeof o ? o : o?.value ?? "")}"`;
1293
+ s += ` ${t}="${es("string" == typeof o ? o : o?.value ?? "")}"`;
1364
1294
  }
1365
1295
  return s + ">";
1366
1296
  })(t)), i = {
1367
1297
  local: e,
1368
1298
  tag: t,
1369
1299
  destination: null
1370
- }, n.push(i), a = e, void (c = t);
1300
+ }, n.push(i), a = e, void (l = t);
1371
1301
  const m = (r.length > 0 ? r[r.length - 1] : o).get(e);
1372
1302
  if (i = {
1373
1303
  local: e,
1374
1304
  visitor: m,
1375
1305
  tag: t,
1376
1306
  destination: null
1377
- }, p) return n.push(i), a = e, void (c = t);
1378
- l = i?.visitor ?? null, a = e, c = t;
1379
- let x = !!m && null === m.to;
1380
- if (m && !x && m.scope) {
1381
- const t = m.scope(y);
1382
- null === t ? x = !0 : t && (r.push(t), i.pushedScope = !0);
1307
+ }, p) return n.push(i), a = e, void (l = t);
1308
+ c = i?.visitor ?? null, a = e, l = t;
1309
+ let b = !!m && null === m.to;
1310
+ if (m && !b && m.scope) {
1311
+ const t = m.scope(x);
1312
+ null === t ? b = !0 : t && (r.push(t), i.pushedScope = !0);
1383
1313
  }
1384
- m && (0 === n.length ? (d = u, i.destination = d, i.pushedDestination = !0, h.push(d)) : x ? (d = null, i.destination = null) : m.transparent ? i.destination = d : (d = {
1314
+ m && (0 === n.length ? (d = u, i.destination = d, i.pushedDestination = !0, h.push(d)) : b ? (d = null, i.destination = null) : m.transparent ? i.destination = d : (d = {
1385
1315
  key: null,
1386
1316
  source: {},
1387
1317
  parent: null
1388
- }, i.destination = d, i.pushedDestination = !0, h.push(d))), n.push(i), p = x;
1389
- const b = l?.openTag?.(y);
1390
- void 0 !== b && (d.parent = b), m?.raw && !x && (f = [], g = i);
1318
+ }, i.destination = d, i.pushedDestination = !0, h.push(d))), n.push(i), p = b;
1319
+ const v = c?.openTag?.(x);
1320
+ void 0 !== v && (d.parent = v), m?.raw && !b && (f = [], g = i);
1391
1321
  },
1392
1322
  onCloseTag: (t) => {
1393
1323
  let e = t.name;
1394
1324
  const o = e.indexOf(":");
1395
1325
  if (-1 !== o && (e = e.slice(o + 1)), e !== a) throw new Error(`mismatch open/close tag: '${e}'/'${a}'`);
1396
- let x = !1;
1326
+ let b = !1;
1397
1327
  if (f) {
1398
- if (n[n.length - 1] !== g) return f.push(`</${t.name}>`), n.pop(), i = n[n.length - 1] ?? null, a = i?.local ?? null, void (c = i?.tag ?? null);
1399
- m = f.join(""), f = null, g = null, x = !0;
1328
+ if (n[n.length - 1] !== g) return f.push(`</${t.name}>`), n.pop(), i = n[n.length - 1] ?? null, a = i?.local ?? null, void (l = i?.tag ?? null);
1329
+ m = f.join(""), f = null, g = null, b = !0;
1400
1330
  }
1401
- p || l?.closeTag?.(y), x && (m = null);
1402
- const b = n.pop() ?? null;
1403
- i = n[n.length - 1] ?? null, b?.pushedScope && r.pop();
1404
- const v = b?.destination;
1405
- if (v && b.pushedDestination) {
1331
+ p || c?.closeTag?.(x), b && (m = null);
1332
+ const v = n.pop() ?? null;
1333
+ i = n[n.length - 1] ?? null, v?.pushedScope && r.pop();
1334
+ const y = v?.destination;
1335
+ if (y && v.pushedDestination) {
1406
1336
  h.pop(), d = h[h.length - 1] ?? u;
1407
- const t = b.visitor;
1408
- t && t.to && void 0 !== v.source && (Array.isArray(t.to) ? d.source.push ? d.source.push(v.source) : s?.(`Unable to parse array for ${t.from} at ${y.getPath()}`) : v.key ? d.source[v.key] = v.source : "string" == typeof t.to && (d.source[t.to] = v.source));
1409
- } else v || (d = h[h.length - 1] ?? u);
1410
- a = i?.local ?? null, c = i?.tag ?? null, l = i?.visitor ?? null, p = !i?.destination;
1337
+ const t = v.visitor;
1338
+ t && t.to && void 0 !== y.source && (Array.isArray(t.to) ? d.source.push ? d.source.push(y.source) : s?.(`Unable to parse array for ${t.from} at ${x.getPath()}`) : y.key ? d.source[y.key] = y.source : "string" == typeof t.to && (d.source[t.to] = y.source));
1339
+ } else y || (d = h[h.length - 1] ?? u);
1340
+ a = i?.local ?? null, l = i?.tag ?? null, c = i?.visitor ?? null, p = !i?.destination;
1411
1341
  },
1412
1342
  onText: (t) => {
1413
- f ? f.push(Ne(t)) : l?.text?.(t, y);
1343
+ f ? f.push(ts(t)) : c?.text?.(t, x);
1414
1344
  },
1415
1345
  onEnd: e
1416
1346
  };
1417
1347
  }
1418
- }, $e = `IFERROR(${w}(`, Ve = $e.toUpperCase(), Re = S.toUpperCase(), je = { kind: "none" }, Me = { kind: "spilled" }, Be = (t, e) => {
1348
+ }, os = `IFERROR(${g}(`, rs = os.toUpperCase(), ns = l.toUpperCase(), is = { kind: "none" }, as = { kind: "spilled" }, ls = (t, e) => {
1419
1349
  if (34 !== t.charCodeAt(e)) return null;
1420
1350
  let s = "", o = e + 1;
1421
1351
  for (; o < t.length;) if (34 === t.charCodeAt(o)) {
@@ -1426,13 +1356,13 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1426
1356
  s += "\"", o += 2;
1427
1357
  } else s += t[o], o++;
1428
1358
  return null;
1429
- }, He = (t) => {
1359
+ }, cs = (t) => {
1430
1360
  const e = [];
1431
1361
  let s = 0;
1432
1362
  for (; s < t.length;) {
1433
1363
  const o = t.charCodeAt(s);
1434
1364
  if (34 === o) {
1435
- const e = Be(t, s);
1365
+ const e = ls(t, s);
1436
1366
  if (null === e) break;
1437
1367
  s = e.end;
1438
1368
  continue;
@@ -1450,7 +1380,192 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1450
1380
  40 === t.charCodeAt(r) && e.push(t.slice(s, r).toUpperCase().replace(/^_XLFN\./, "").replace(/^_XLWS\./, "")), s = r;
1451
1381
  }
1452
1382
  return e;
1453
- }, Fe = (t) => {
1383
+ }, hs = /^\s*TABLE\s*\(([^()]*)\)\s*$/i, us = /^\s*(\$?)([A-Za-z]{1,3})(\$?)(\d{1,7})\s*$/, ds = (t) => {
1384
+ const e = us.exec(t);
1385
+ if (!e) return null;
1386
+ const s = xt.fastStringToCol(e[2]), o = parseInt(e[4], 10) - 1;
1387
+ return s < 0 || o < 0 ? null : {
1388
+ row: o,
1389
+ col: s,
1390
+ colAbsolute: "$" === e[1],
1391
+ rowAbsolute: "$" === e[3]
1392
+ };
1393
+ }, ps = (t) => xt.cellToString({
1394
+ rowIndex: t.row,
1395
+ colIndex: t.col
1396
+ }), fs = (t, e) => {
1397
+ const s = hs.exec(t);
1398
+ if (!s) return null;
1399
+ const o = s[1].split(",");
1400
+ if (3 !== o.length && 5 !== o.length) return null;
1401
+ const r = [];
1402
+ for (let t = 0; t < o.length; t++) {
1403
+ const e = ds(o[t]);
1404
+ if (!e) return null;
1405
+ r.push(e);
1406
+ }
1407
+ const n = e.rowStart, i = e.colStart, a = (t) => t.colAbsolute && !t.rowAbsolute && t.col === i - 1 && t.row === n, l = (t) => t.rowAbsolute && !t.colAbsolute && t.row === n - 1 && t.col === i, c = xt.rangeToString(e), h = r[0];
1408
+ if (3 === r.length) {
1409
+ const [, t, e] = r;
1410
+ return a(e) && l(h) ? {
1411
+ ref: c,
1412
+ columnInput: ps(t)
1413
+ } : l(e) && a(h) ? {
1414
+ ref: c,
1415
+ rowInput: ps(t)
1416
+ } : null;
1417
+ }
1418
+ if (!h.rowAbsolute || !h.colAbsolute || h.row !== n - 1 || h.col !== i - 1) return null;
1419
+ const [, u, d, p, f] = r;
1420
+ return a(d) && l(f) ? {
1421
+ ref: c,
1422
+ rowInput: ps(p),
1423
+ columnInput: ps(u)
1424
+ } : l(d) && a(f) ? {
1425
+ ref: c,
1426
+ rowInput: ps(u),
1427
+ columnInput: ps(p)
1428
+ } : null;
1429
+ }, gs = /^(?:(\d{4})-(\d{2})-(\d{2}))?T?(?:(\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?)?(?:Z|[+-]\d{2}:?\d{2})?$/, ms = /^PT(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?$/, bs = (t, e, s) => {
1430
+ const o = Math.floor((14 - e) / 12), r = t + 4800 - o, n = e + 12 * o - 3;
1431
+ return s + Math.floor((153 * n + 2) / 5) + 365 * r + Math.floor(r / 4) - Math.floor(r / 100) + Math.floor(r / 400) - 32045;
1432
+ }, xs = bs(1899, 12, 30), vs = (t) => {
1433
+ const e = t.indexOf(":");
1434
+ return -1 === e ? t : t.slice(e + 1);
1435
+ }, ys = class {
1436
+ constructor() {
1437
+ this._runs = null, this._text = "", this._font = null, this._inRun = !1, this._inRPr = !1;
1438
+ }
1439
+ reset() {
1440
+ this._runs = null, this._inRun = !1, this._inRPr = !1;
1441
+ }
1442
+ onOpenTag(t, e) {
1443
+ "r" === t ? (this._inRun = !0, this._text = "", this._font = null, this._runs ??= []) : "rPr" === t ? this._inRun && (this._inRPr = !0) : this._inRPr && function(t, e, o) {
1444
+ switch (t) {
1445
+ case "b":
1446
+ o.weight = Ss(e) ? 700 : 400;
1447
+ break;
1448
+ case "i":
1449
+ o.style = Ss(e) ? Et.Style.Italic : Et.Style.Normal;
1450
+ break;
1451
+ case "strike":
1452
+ o.strike = s(Ss(e));
1453
+ break;
1454
+ case "outline":
1455
+ o.outline = Ss(e);
1456
+ break;
1457
+ case "shadow":
1458
+ o.shadow = Ss(e);
1459
+ break;
1460
+ case "condense":
1461
+ case "extend": {
1462
+ const s = r(t, Ss(e));
1463
+ void 0 !== s && (o.letterSpacing = s);
1464
+ break;
1465
+ }
1466
+ case "u":
1467
+ o.underline = u(e.val);
1468
+ break;
1469
+ case "vertAlign": {
1470
+ const t = ct(e.val);
1471
+ void 0 !== t && (o.baseline = t);
1472
+ break;
1473
+ }
1474
+ case "sz": {
1475
+ const t = parseFloat(e.val ?? "");
1476
+ isNaN(t) || (o.size = t);
1477
+ break;
1478
+ }
1479
+ case "rFont": {
1480
+ const t = e.val;
1481
+ t && (o.family = t);
1482
+ break;
1483
+ }
1484
+ case "family": {
1485
+ const t = Ts[e.val ?? ""];
1486
+ t && (o.fallbacks = [t]);
1487
+ break;
1488
+ }
1489
+ case "charset": {
1490
+ const t = parseInt(e.val ?? "", 10);
1491
+ isNaN(t) || (o.charset = t);
1492
+ break;
1493
+ }
1494
+ case "scheme":
1495
+ x(o, e.val);
1496
+ break;
1497
+ case "color": {
1498
+ const t = e.rgb;
1499
+ if (t && void 0 === e.theme) {
1500
+ o.color = "#" + (8 === t.length ? t.substring(2) : t).toUpperCase();
1501
+ break;
1502
+ }
1503
+ const s = nt((t) => e[t]);
1504
+ s && (o.color = s);
1505
+ break;
1506
+ }
1507
+ }
1508
+ }(t, e, this._font ??= {});
1509
+ }
1510
+ onText(t) {
1511
+ this._inRun && (this._text += t);
1512
+ }
1513
+ onCloseTag(t) {
1514
+ if ("rPr" === t) this._inRPr = !1, this._font ??= {};
1515
+ else if ("r" === t && this._inRun) {
1516
+ const t = w(this._text), e = this._font;
1517
+ this._runs.push(e ? {
1518
+ text: t,
1519
+ font: e
1520
+ } : { text: t }), this._inRun = !1;
1521
+ }
1522
+ }
1523
+ take() {
1524
+ const t = this._runs;
1525
+ if (this.reset(), !t) return null;
1526
+ for (let e = 0; e < t.length; e++) if (t[e].font) return t;
1527
+ return null;
1528
+ }
1529
+ };
1530
+ function ws(t, e) {
1531
+ const s = {
1532
+ family: "Calibri",
1533
+ size: 11,
1534
+ ...e,
1535
+ weight: 400,
1536
+ style: Et.Style.Normal,
1537
+ underline: Et.UnderlineStyle.None,
1538
+ strike: Et.StrikeStyle.None,
1539
+ baseline: 0
1540
+ }, o = new Array(t.length);
1541
+ for (let e = 0; e < t.length; e++) {
1542
+ const r = t[e];
1543
+ if (!r.font) {
1544
+ o[e] = r;
1545
+ continue;
1546
+ }
1547
+ const n = {
1548
+ ...s,
1549
+ ...r.font
1550
+ };
1551
+ o[e] = {
1552
+ text: r.text,
1553
+ font: n
1554
+ };
1555
+ }
1556
+ return o;
1557
+ }
1558
+ var Ts = {
1559
+ 1: "serif",
1560
+ 2: "sans-serif",
1561
+ 3: "monospace",
1562
+ 4: "cursive",
1563
+ 5: "fantasy"
1564
+ }, Ss = (t) => {
1565
+ const e = t.val;
1566
+ return void 0 === e || "1" === e || "true" === e;
1567
+ };
1568
+ var Cs = (t) => {
1454
1569
  const e = (e) => {
1455
1570
  if (t) return new RegExp(`<(?:[\\w.-]+:)?${e}\\b[^>]*>([^<]*)<`).exec(t)?.[1];
1456
1571
  }, s = (t) => {
@@ -1460,17 +1575,23 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1460
1575
  return {
1461
1576
  c: s(e("col")),
1462
1577
  r: s(e("row")),
1463
- x: m(e("colOff") ?? "0") ?? 0,
1464
- y: m(e("rowOff") ?? "0") ?? 0
1578
+ x: T(e("colOff") ?? "0") ?? 0,
1579
+ y: T(e("rowOff") ?? "0") ?? 0
1465
1580
  };
1466
- }, We = "formulaDialect", ze = (t, s, o, r, n, h, u, p) => {
1467
- const g = new Le(), m = p?.get("parseInlineDxf"), w = p?.get(We), S = (t) => w && t ? w.readDetached(t) : t, C = new rt.TransposedBuilder();
1468
- let k = null;
1469
- g.registerVisitor({
1581
+ }, ks = "formulaDialect", As = "date1904", Es = "richStrings", Is = "defaultFont", Ps = (t, e, s, r, a, l, c, u) => {
1582
+ const f = new ss(), g = (t) => {
1583
+ const e = t.getAttribute("dxfId", Je);
1584
+ if (null === e) return;
1585
+ return r?.get(e) || (l?.(`A color filter or sort names a format that does not exist (dxfId '${e}').`), {});
1586
+ };
1587
+ let m = !1;
1588
+ const x = u?.get("parseInlineDxf"), v = u?.get(ks), T = (t) => v && t ? v.readDetached(t) : t, C = new $t.TransposedBuilder();
1589
+ let k = null, O = "topLeft";
1590
+ f.registerVisitor({
1470
1591
  from: "autoFilter",
1471
1592
  to: "autoTable",
1472
1593
  openTag: (t) => {
1473
- const e = t.getAttribute("ref"), s = z.fastStringToRange(e);
1594
+ const e = t.getAttribute("ref"), s = xt.fastStringToRange(e);
1474
1595
  t.getSource().r = s, t.getSource().v = {};
1475
1596
  },
1476
1597
  closeTag: (t) => {
@@ -1480,7 +1601,7 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1480
1601
  0 === t ? s.hiddenButtons = !1 : t === n && (s.hiddenButtons = !0);
1481
1602
  }
1482
1603
  }
1483
- }), g.registerVisitor({
1604
+ }), f.registerVisitor({
1484
1605
  from: "conditionalFormatting",
1485
1606
  to: {},
1486
1607
  openTag: (t) => {
@@ -1491,10 +1612,10 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1491
1612
  const o = {
1492
1613
  r: s,
1493
1614
  conditionals: e.conditionals
1494
- }, r = t.getAttribute("pivot", Pe);
1615
+ }, r = t.getAttribute("pivot", Ke);
1495
1616
  null !== r && (o.pivot = r), t.setSource(o);
1496
1617
  }
1497
- }), g.registerVisitor({
1618
+ }), f.registerVisitor({
1498
1619
  from: "cfRule",
1499
1620
  to: {},
1500
1621
  openTag: (t) => {
@@ -1505,20 +1626,20 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1505
1626
  r: e.r,
1506
1627
  v: null,
1507
1628
  rule: s
1508
- }), t.copyToObject(s, "type", De), t.copyToObject(s, "priority", Oe), t.copyToObject(s, "stopIfTrue", Pe);
1509
- const o = t.getAttribute("dxfId", Oe);
1629
+ }), t.copyToObject(s, "type", Ye), t.copyToObject(s, "priority", Je), t.copyToObject(s, "stopIfTrue", Ke);
1630
+ const o = t.getAttribute("dxfId", Je);
1510
1631
  if (null !== o) {
1511
1632
  let e = r?.get(o);
1512
- e || (h?.(`Unable to load conditional color. Invalid dxfI: '${o}' at '${t.getPath()}'.`), e = {}), s.style = e;
1633
+ e || (l?.(`Unable to load conditional color. Invalid dxfI: '${o}' at '${t.getPath()}'.`), e = {}), s.style = e;
1513
1634
  }
1514
- t.copyToObject(s, "aboveAverage", Pe), t.copyToObject(s, "equalAverage", Pe), t.copyToObject(s, "stdDev", Oe), t.copyToObject(s, "bottom", Pe), t.copyToObject(s, "percent", Pe), t.copyToObject(s, "rank", Oe), t.copyToObject(s, "operator", De), t.copyToObject(s, "text", De), t.copyToObject(s, "timePeriod", De);
1635
+ t.copyToObject(s, "aboveAverage", Ke), t.copyToObject(s, "equalAverage", Ke), t.copyToObject(s, "stdDev", Je), t.copyToObject(s, "bottom", Ke), t.copyToObject(s, "percent", Ke), t.copyToObject(s, "rank", Je), t.copyToObject(s, "operator", Ye), t.copyToObject(s, "text", Ye), t.copyToObject(s, "timePeriod", Ye);
1515
1636
  },
1516
1637
  closeTag: (t) => {
1517
1638
  const e = t.getParent();
1518
1639
  if (!e?.r) return;
1519
1640
  const s = e.conditionals[e.conditionals.length - 1], o = s?.rule;
1520
1641
  if (!o) return;
1521
- const r = {}, n = P(o, h);
1642
+ const r = {}, n = _(o, l);
1522
1643
  n && (r.condition = n), o.style && (r.style = o.style), o.scale && (r.scale = o.scale), o.stopIfTrue && (r.stopIfTrue = !0), o.pivot && (r.pivot = !0), s.v = r, s.priority = o.priority, o.x14Id && (s.x14Id = o.x14Id), delete s.rule;
1523
1644
  }
1524
1645
  });
@@ -1530,7 +1651,7 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1530
1651
  }
1531
1652
  return s;
1532
1653
  };
1533
- g.registerVisitor({
1654
+ f.registerVisitor({
1534
1655
  from: "colorScale",
1535
1656
  to: {},
1536
1657
  openTag: (t) => {},
@@ -1538,67 +1659,67 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1538
1659
  const e = t.getSource(), s = e.colors ?? [], o = D(e);
1539
1660
  for (let t = 0; t < o.length; t++) o[t].color = s[t];
1540
1661
  t.getParent().scale = {
1541
- type: Q.ScaleType.ColorScale,
1662
+ type: kt.ScaleType.ColorScale,
1542
1663
  stops: o
1543
1664
  };
1544
1665
  }
1545
- }), g.registerVisitor({
1666
+ }), f.registerVisitor({
1546
1667
  from: "dataBar",
1547
1668
  to: {},
1548
1669
  openTag: (t) => {
1549
- t.copyTo("maxLength", Oe), t.copyTo("minLength", Oe), t.copyTo("showValue", Pe);
1670
+ t.copyTo("maxLength", Je), t.copyTo("minLength", Je), t.copyTo("showValue", Ke);
1550
1671
  },
1551
1672
  closeTag: (t) => {
1552
1673
  const e = t.getSource(), s = {
1553
- type: Q.ScaleType.DataBar,
1674
+ type: kt.ScaleType.DataBar,
1554
1675
  stops: D(e)
1555
1676
  }, o = e.colors?.[0];
1556
1677
  o && (s.color = o), void 0 !== e.minLength && (s.minLength = e.minLength), void 0 !== e.maxLength && (s.maxLength = e.maxLength), void 0 !== e.showValue && (s.showValue = e.showValue), t.getParent().scale = s;
1557
1678
  }
1558
- }), g.registerVisitor({
1679
+ }), f.registerVisitor({
1559
1680
  from: "iconSet",
1560
1681
  to: {},
1561
1682
  openTag: (t) => {
1562
- t.copyTo("iconSet", De), t.copyTo("reverse", Pe), t.copyTo("showValue", Pe);
1683
+ t.copyTo("iconSet", Ye), t.copyTo("reverse", Ke), t.copyTo("showValue", Ke);
1563
1684
  },
1564
1685
  closeTag: (t) => {
1565
1686
  const e = t.getSource(), s = {
1566
- type: Q.ScaleType.IconSet,
1687
+ type: kt.ScaleType.IconSet,
1567
1688
  stops: D(e)
1568
1689
  };
1569
1690
  void 0 !== e.iconSet && (s.iconSet = e.iconSet), void 0 !== e.reverse && (s.reverse = e.reverse), void 0 !== e.showValue && (s.showValue = e.showValue), t.getParent().scale = s;
1570
1691
  }
1571
- }), g.registerVisitor({
1692
+ }), f.registerVisitor({
1572
1693
  from: "formula",
1573
1694
  to: {},
1574
1695
  text: (t, e) => {
1575
1696
  const s = e.getParent();
1576
1697
  let o = s.formulas;
1577
- o || (o = [], s.formulas = o), o.push(S(t));
1698
+ o || (o = [], s.formulas = o), o.push(T(t));
1578
1699
  }
1579
- }), g.registerVisitor({
1700
+ }), f.registerVisitor({
1580
1701
  from: "cfvo",
1581
1702
  to: {},
1582
1703
  openTag: (t) => {
1583
1704
  const e = t.getParent();
1584
1705
  e.conditions || (e.conditions = []);
1585
1706
  const s = t.getSource();
1586
- if (e.conditions.push(s), t.copyTo("type", De), s.type === Q.ColorStopType.Formula) {
1707
+ if (e.conditions.push(s), t.copyTo("type", Ye), s.type === kt.ColorStopType.Formula) {
1587
1708
  const e = t.getAttribute("val");
1588
- null != e && (s.value = S(String(e)));
1589
- } else t.copyTo("value", Ie, "val");
1590
- !1 === t.getAttribute("gte", Pe) && (s.exclusive = !0);
1709
+ null != e && (s.value = T(String(e)));
1710
+ } else t.copyTo("value", Qe, "val");
1711
+ !1 === t.getAttribute("gte", Ke) && (s.exclusive = !0);
1591
1712
  }
1592
- }), g.registerVisitor({
1713
+ }), f.registerVisitor({
1593
1714
  from: "color",
1594
1715
  to: {},
1595
1716
  openTag: (t) => {
1596
1717
  const e = t.getParent();
1597
1718
  e.colors || (e.colors = []);
1598
- const s = bt((e) => t.getAttribute(e));
1719
+ const s = nt((e) => t.getAttribute(e));
1599
1720
  e.colors.push(s);
1600
1721
  }
1601
- }), g.registerVisitor({
1722
+ }), f.registerVisitor({
1602
1723
  from: "filterColumn",
1603
1724
  to: {},
1604
1725
  openTag: (t) => {
@@ -1607,106 +1728,121 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1607
1728
  let r = e.filter;
1608
1729
  r || (r = { conditions: [] }, e.filter = r);
1609
1730
  let n = r.conditions;
1610
- if (n || (n = [], r.conditions = n), n.push(o), t.getAttribute("hiddenButton", Pe) && e) {
1731
+ if (n || (n = [], r.conditions = n), n.push(o), t.getAttribute("hiddenButton", Ke) && e) {
1611
1732
  let t = e.hiddenButtons;
1612
1733
  t || (t = [], e.hiddenButtons = t), t.push(s);
1613
1734
  }
1614
- if (t.getAttribute("showButton", Pe) && e) {
1735
+ if (t.getAttribute("showButton", Ke) && e) {
1615
1736
  let t = e.showButtons;
1616
1737
  t || (t = [], e.showButtons = t), t.push(s);
1617
1738
  }
1618
1739
  return o;
1619
1740
  }
1620
- }), g.registerVisitor({
1741
+ }), f.registerVisitor({
1621
1742
  from: "colorFilter",
1622
1743
  openTag: (t) => {
1623
1744
  const e = t.getParent(), s = {};
1624
- e.operator = Z.BuiltInOperatorNames.Color, e.param = s, t.copyToObject(s, "cellColor", Pe), t.copyToObject(s, "styleId", Oe, "dxfId");
1745
+ e.operator = Ct.BuiltInOperatorNames.Color, e.param = s, t.copyToObject(s, "cellColor", Ke);
1746
+ const o = g(t);
1747
+ o && (s.style = o);
1625
1748
  }
1626
- }), g.registerVisitor({
1749
+ }), f.registerVisitor({
1627
1750
  from: "iconFilter",
1628
1751
  openTag: (t) => {
1629
1752
  const e = t.getParent(), s = {};
1630
- e.operator = Z.BuiltInOperatorNames.Icon, e.param = s, t.copyToObject(s, "iconId", Oe), t.copyToObject(s, "iconSet", De);
1753
+ e.operator = Ct.BuiltInOperatorNames.Icon, e.param = s, t.copyToObject(s, "iconId", Je), t.copyToObject(s, "iconSet", Ye);
1631
1754
  }
1632
- }), g.registerVisitor({
1755
+ }), f.registerVisitor({
1633
1756
  from: "top10",
1634
1757
  openTag: (t) => {
1635
1758
  const e = t.getParent(), s = {};
1636
- e.operator = Z.BuiltInOperatorNames.TopN, e.param = s, t.copyToObject(s, "filterVal", Ie), t.copyToObject(s, "percent", Pe), t.copyToObject(s, "top", Pe), t.copyToObject(s, "limit", Ie, "val");
1759
+ e.operator = Ct.BuiltInOperatorNames.TopN, e.param = s, t.copyToObject(s, "filterVal", Qe), t.copyToObject(s, "percent", Ke), t.copyToObject(s, "top", Ke), t.copyToObject(s, "limit", Qe, "val");
1637
1760
  }
1638
- }), g.registerVisitor({
1761
+ }), f.registerVisitor({
1639
1762
  from: "dynamicFilter",
1640
1763
  openTag: (t) => {
1641
- const e = t.getParent(), s = v(t.getAttribute("type"));
1764
+ const e = t.getParent(), s = R(t.getAttribute("type"));
1642
1765
  e.operator = s.operator, e.param = s.param;
1643
1766
  }
1644
1767
  });
1645
- const L = {
1768
+ const N = {
1646
1769
  from: "filters",
1647
1770
  to: {},
1648
1771
  openTag: (t) => {
1649
1772
  const e = t.getParent(), s = {};
1650
- return e.selector = Z.BuiltInSelectorNames.Display, e.operator = Z.BuiltInOperatorNames.InSet, e.param = s, t.copyToObject(s, "blank", Pe), t.copyToObject(s, "calendarType", De), s;
1773
+ return e.selector = Ct.BuiltInSelectorNames.Display, e.operator = Ct.BuiltInOperatorNames.InSet, e.param = s, t.copyToObject(s, "blank", Ke), t.copyToObject(s, "calendarType", Ye), s;
1651
1774
  }
1652
1775
  };
1653
- g.registerVisitor(L);
1776
+ f.registerVisitor(N);
1654
1777
  const $ = {
1655
1778
  from: "filter",
1656
1779
  openTag: (t) => {
1657
1780
  const e = t.getParent();
1658
1781
  let s = e.items;
1659
- s || (s = [], e.items = s), s.push(t.getAttribute("val", De));
1782
+ s || (s = [], e.items = s), s.push(t.getAttribute("val", Ye));
1660
1783
  }
1661
1784
  };
1662
- g.registerVisitor($);
1663
- const V = {
1785
+ f.registerVisitor($);
1786
+ const L = {
1664
1787
  from: "dateGroupItem",
1665
1788
  to: {},
1666
1789
  openTag: (t) => {
1667
1790
  const e = t.getParent();
1668
1791
  let s = e.dateGroups;
1669
- s || (s = [], e.dateGroups = s), s.push(t.getSource()), t.copyTo("group", De, "dateTimeGrouping"), t.copyTo("day", Oe), t.copyTo("hour", Oe), t.copyTo("minute", Oe), t.copyTo("month", Oe), t.copyTo("second", Oe), t.copyTo("year", Oe);
1792
+ s || (s = [], e.dateGroups = s), s.push(t.getSource()), t.copyTo("group", Ye, "dateTimeGrouping"), t.copyTo("day", Je), t.copyTo("hour", Je), t.copyTo("minute", Je), t.copyTo("month", Je), t.copyTo("second", Je), t.copyTo("year", Je);
1670
1793
  }
1671
1794
  };
1672
- g.registerVisitor(V);
1673
- const R = /* @__PURE__ */ new Map();
1674
- R.set("filterColumn", {
1795
+ f.registerVisitor(L);
1796
+ const V = /* @__PURE__ */ new Map();
1797
+ V.set("filterColumn", {
1675
1798
  from: "filterColumn",
1676
1799
  transparent: !0
1677
- }), R.set("filters", L), R.set("filter", $), R.set("dateGroupItem", V), g.registerVisitor({
1800
+ }), V.set("filters", N), V.set("filter", $), V.set("dateGroupItem", L), f.registerVisitor({
1678
1801
  from: "customFilters",
1679
1802
  openTag: (t) => {
1680
1803
  const e = t.getParent(), s = t.getAttribute("and"), o = "and" === s || "1" === s, r = [];
1681
- return e.operator = o ? Z.BuiltInOperatorNames.And : Z.BuiltInOperatorNames.Or, e.param = r, t.setSource(e), r;
1804
+ return e.operator = o ? Ct.BuiltInOperatorNames.And : Ct.BuiltInOperatorNames.Or, e.param = r, t.setSource(e), r;
1682
1805
  },
1683
1806
  closeTag: (t) => {
1684
1807
  const e = t.getSource(), s = e?.param;
1685
1808
  if (!e || !s) return;
1686
- const o = 1 === s.length ? s[0] : d(e);
1809
+ const o = 1 === s.length ? s[0] : ot(e);
1687
1810
  o !== e && (e.operator = o.operator, e.param = o.param);
1688
1811
  }
1689
- }), g.registerVisitor({
1812
+ }), f.registerVisitor({
1690
1813
  from: "customFilter",
1691
1814
  openTag: (t) => {
1692
1815
  const e = t.getParent();
1693
1816
  let s;
1694
1817
  Array.isArray(e) ? (s = {}, e.push(s)) : s = e;
1695
- const o = N({
1818
+ const o = et({
1696
1819
  operator: t.getAttribute("operator"),
1697
1820
  val: t.getAttribute("val")
1698
1821
  }, (e) => t.warn(e));
1699
1822
  o && (s.operator = o.operator, s.param = o.param);
1700
1823
  }
1701
- }), g.registerVisitor({
1824
+ });
1825
+ let W = {}, z = null;
1826
+ f.registerVisitor({
1702
1827
  from: "sortState",
1703
1828
  to: {},
1704
1829
  openTag: (t) => {
1705
1830
  const e = t.getParent();
1706
1831
  let s = e.v;
1707
- s && (s.sort = {}, t.setSource(e));
1708
- }
1709
- }), g.registerVisitor({
1832
+ if (!s) return;
1833
+ const o = {};
1834
+ W = {};
1835
+ const r = t.getAttribute("caseSensitive", Ke);
1836
+ null != r && (W.collatorOptions = r ? Nt.CaseSensitiveOptions : Nt.CaseInsensitiveOptions);
1837
+ const n = t.getAttribute("sortMethod");
1838
+ "stroke" !== n && "pinYin" !== n || (W.collatorOptions = {
1839
+ ...W.collatorOptions,
1840
+ collation: "stroke" === n ? "stroke" : "pinyin"
1841
+ }), t.getAttribute("columnSort", Ke) && (o.axis = It.Axis.Column);
1842
+ const a = t.getAttribute("ref"), l = e.r;
1843
+ z = a && l ? xt.fastStringToRange(a) : null, z && (o.extent = { range: i(l, z) }), s.sort = o, t.setSource(e);
1844
+ }
1845
+ }), f.registerVisitor({
1710
1846
  from: "sortCondition",
1711
1847
  to: {},
1712
1848
  openTag: (t) => {
@@ -1717,100 +1853,130 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1717
1853
  let r = o.sorts;
1718
1854
  r || (r = [], o.sorts = r);
1719
1855
  const n = t.getAttribute("ref");
1720
- let i = 0;
1856
+ let i = 0, a = null;
1721
1857
  if (n) {
1722
- const t = z.fastStringToRange(n, Ue).colStart, s = e.r, o = s.colStart;
1723
- i = s ? t - o : t;
1858
+ const t = xt.fastStringToRange(n, _s), s = t.colStart, o = e.r, r = o.colStart;
1859
+ i = o ? s - r : s, o && z && (a = d(o, z, t));
1724
1860
  }
1725
- const a = {};
1726
- t.copyToObject(a, "sortOn", De, "sortBy"), t.copyToObject(a, "dxfId", De, "sortBy"), t.copyToObject(a, "iconSet", De), t.copyToObject(a, "customList", De), a.reverse = t.getAttribute("descending", Pe) ?? !1;
1727
- const c = {
1861
+ o.extent && (o.extent.sorts ??= []).push(a);
1862
+ const l = { ...W }, c = Y(t.getAttribute("sortBy"));
1863
+ c && (l.sortOn = c);
1864
+ const h = g(t);
1865
+ h && (l.style = h), t.copyToObject(l, "iconSet", Ye), t.copyToObject(l, "customList", Ye), l.reverse = t.getAttribute("descending", Ke) ?? !1;
1866
+ const u = {
1728
1867
  index: i,
1729
- criteria: a
1868
+ criteria: l
1730
1869
  };
1731
- r.push(c);
1870
+ r.push(u);
1732
1871
  }
1733
1872
  });
1734
- const M = (t) => {
1735
- k = t.getSource(), t.copyTo("topLeft", De, "topLeftCell");
1736
- const e = j(t.getAttribute("defaultGridColor")), s = t.getAttribute("colorId");
1737
- null === s || e || (t.getSource().gridLineColor = "index" + parseFloat(s)), t.copyTo("showZeros", Pe), t.copyTo("showFormulas", Pe), t.copyTo("zoomScale", Oe), t.copyTo("showRowHeaders", Pe, "showRowColHeaders"), t.copyTo("showColumnHeaders", Pe, "showRowColHeaders"), t.copyTo("showRowGridlines", Pe, "showGridLines"), t.copyTo("showColumnGridlines", Pe, "showGridLines"), t.copyTo("rightToLeft", Pe), t.copyTo("showOutlineSymbols", Pe);
1873
+ const q = (t) => {
1874
+ k = t.getSource(), O = "topLeft", t.copyTo("topLeft", Ye, "topLeftCell");
1875
+ const e = y(t.getAttribute("defaultGridColor")), s = t.getAttribute("colorId");
1876
+ null === s || e || (t.getSource().gridLineColor = "index" + parseFloat(s)), t.copyTo("showZeros", Ke), t.copyTo("showFormulas", Ke), t.copyTo("zoomScale", Je), t.copyTo("viewMode", Ye, "view");
1877
+ const o = {};
1878
+ for (const [e, s] of it) {
1879
+ const r = t.getAttribute(s, Je);
1880
+ r && (o[e] = Math.min(400, Math.max(10, r)));
1881
+ }
1882
+ Object.keys(o).length > 0 && (t.getSource().zoomScales = o), t.copyTo("showRuler", Ke), t.copyTo("showWhitespace", Ke, "showWhiteSpace"), t.copyTo("windowProtection", Ke), t.copyTo("showRowHeaders", Ke, "showRowColHeaders"), t.copyTo("showColumnHeaders", Ke, "showRowColHeaders"), t.copyTo("showRowGridlines", Ke, "showGridLines"), t.copyTo("showColumnGridlines", Ke, "showGridLines"), t.copyTo("rightToLeft", Ke), t.copyTo("showOutlineSymbols", Ke);
1738
1883
  };
1739
- g.registerVisitor({
1884
+ f.registerVisitor({
1740
1885
  from: "sheetView",
1741
1886
  to: "view",
1742
1887
  openTag: (t) => {
1743
- M(t);
1888
+ q(t);
1744
1889
  },
1745
1890
  closeTag: () => {
1746
1891
  k = null;
1747
1892
  }
1748
- }), g.registerVisitor({
1893
+ }), f.registerVisitor({
1749
1894
  from: "customSheetViews",
1750
1895
  to: "customSheetViews",
1751
1896
  openTag: (t) => {
1752
1897
  t.setSource([]);
1753
1898
  }
1754
- }), g.registerVisitor({
1899
+ }), f.registerVisitor({
1755
1900
  from: "customSheetView",
1756
1901
  to: [],
1757
1902
  openTag: (t) => {
1758
- M(t);
1903
+ U = !0, q(t);
1759
1904
  },
1760
1905
  closeTag: () => {
1761
- k = null;
1906
+ U = !1, k = null;
1762
1907
  }
1763
- }), g.registerVisitor({
1908
+ }), f.registerVisitor({
1764
1909
  from: "selection",
1765
- to: "selection",
1910
+ to: null,
1766
1911
  openTag: (t) => {
1767
1912
  if (!k) return;
1768
- t.copyTo("cell", De, "activeCell"), t.copyTo("rangeIndex", Oe, "activeCellId");
1769
- const e = t.getAttribute("activeCell"), s = t.getAttribute("sqref");
1770
- if (s && s !== e) t.getSource().ranges = s.trim().split(/\s+/);
1913
+ const e = t.getAttribute("activeCell")?.replace(/\$/g, ""), s = t.getAttribute("sqref")?.replace(/\$/g, ""), o = t.getAttribute("pane") ?? "topLeft";
1914
+ if (o !== O) {
1915
+ const t = k.freezePanes;
1916
+ if (t && e) {
1917
+ const r = { activeCell: e };
1918
+ s && s !== e && (r.sqref = s), (t.paneSelections ??= {})[o] = r;
1919
+ }
1920
+ return;
1921
+ }
1922
+ const r = {};
1923
+ e && (r.cell = e);
1924
+ const n = t.getAttribute("activeCellId", Je);
1925
+ null !== n && (r.rangeIndex = n), s && s !== e && (r.ranges = s.trim().split(/\s+/)), k.selection = r;
1771
1926
  }
1772
- }), g.registerVisitor({
1927
+ }), f.registerVisitor({
1773
1928
  from: "pane",
1774
1929
  to: null,
1775
1930
  openTag: (t) => {
1776
1931
  if (!k) return;
1777
- if ("frozen" === t.getAttribute("state")) {
1932
+ O = t.getAttribute("activePane") ?? "topLeft";
1933
+ const e = t.getAttribute("state");
1934
+ if ("frozen" === e || "frozenSplit" === e) {
1778
1935
  const e = {};
1779
- k.freezePanes = e, t.copyToObject(e, "topLeft", De, "topLeftCell");
1780
- const s = (k.topLeft ? z.fastStringToCell(k.topLeft) : void 0) ?? {
1936
+ k.freezePanes = e, t.copyToObject(e, "topLeft", Ye, "topLeftCell");
1937
+ const s = (k.topLeft ? xt.fastStringToCell(k.topLeft) : void 0) ?? {
1781
1938
  colIndex: 0,
1782
1939
  rowIndex: 0
1783
1940
  }, o = {
1784
1941
  colIndex: 0,
1785
1942
  rowIndex: 0
1786
1943
  };
1787
- t.copyToObject(o, "colIndex", Oe, "xSplit"), t.copyToObject(o, "rowIndex", Oe, "ySplit");
1944
+ t.copyToObject(o, "colIndex", Je, "xSplit"), t.copyToObject(o, "rowIndex", Je, "ySplit");
1788
1945
  const r = {
1789
1946
  colIndex: s.colIndex + o.colIndex,
1790
1947
  rowIndex: s.rowIndex + o.rowIndex
1791
1948
  };
1792
- e.coords = z.cellToString(r);
1949
+ e.coords = xt.cellToString(r);
1793
1950
  }
1794
1951
  }
1795
- }), g.registerVisitor({
1952
+ }), f.registerVisitor({
1796
1953
  from: "sheetPr",
1797
1954
  transparent: !0,
1798
1955
  openTag: (e) => {
1799
1956
  const s = e.getAttribute("codeName");
1800
- s && (t.codeName = s), !1 === e.getAttribute("enableFormatConditionsCalculation", Pe) && (t.conditionalFormatCalculation = !1);
1957
+ s && (t.codeName = s), !1 === e.getAttribute("enableFormatConditionsCalculation", Ke) && (t.conditionalFormatCalculation = !1), !0 === e.getAttribute("transitionEvaluation", Ke) && (t.transitionFormulaEvaluation = !0), !0 === e.getAttribute("transitionEntry", Ke) && (t.transitionFormulaEntry = !0), !1 === e.getAttribute("published", Ke) && (t.excludeFromPublishing = !0);
1958
+ const o = {};
1959
+ !0 === e.getAttribute("syncHorizontal", Ke) && (o.horizontal = !0), !0 === e.getAttribute("syncVertical", Ke) && (o.vertical = !0);
1960
+ const r = e.getAttribute("syncRef");
1961
+ r && (o.anchor = r), Object.keys(o).length > 0 && (t.syncScroll = o);
1801
1962
  }
1802
- }), g.registerVisitor({
1963
+ }), f.registerVisitor({
1803
1964
  from: "tabColor",
1804
1965
  to: null,
1805
1966
  openTag: (e) => {
1806
- const s = bt((t) => e.getAttribute(t));
1967
+ const s = nt((t) => e.getAttribute(t));
1807
1968
  s && (t.tabColor = s);
1808
1969
  }
1809
- }), g.registerVisitor({
1970
+ });
1971
+ let U = !1;
1972
+ const G = () => t.pageLayout ??= {};
1973
+ f.registerVisitor({
1810
1974
  from: "pageSetUpPr",
1811
- to: "pageSetUpPr",
1812
- openTag: (t) => {}
1813
- }), g.registerVisitor({
1975
+ to: null,
1976
+ openTag: (t) => {
1977
+ !0 === t.getAttribute("fitToPage", Ke) && (G().fitToPage = !0), !1 === t.getAttribute("autoPageBreaks", Ke) && (G().hideAutoPageBreaks = !0);
1978
+ }
1979
+ }), f.registerVisitor({
1814
1980
  from: "outlinePr",
1815
1981
  to: null,
1816
1982
  openTag: (e) => {
@@ -1823,42 +1989,139 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1823
1989
  return "1" === s || "true" === s;
1824
1990
  })("applyStyles") && (o.automaticStyles = !0), Object.keys(o).length > 0 && (t.outline = o);
1825
1991
  }
1826
- }), g.registerVisitor({
1992
+ }), f.registerVisitor({
1827
1993
  from: "pageMargins",
1828
- to: "pageMargins",
1994
+ to: null,
1829
1995
  openTag: (t) => {
1830
- t.copyTo("bottom", Ie), t.copyTo("footer", Ie), t.copyTo("header", Ie), t.copyTo("left", Ie), t.copyTo("right", Ie), t.copyTo("top", Ie), t.copyTo("bottom", Ie);
1996
+ if (U) return;
1997
+ const e = (e, s) => t.getAttribute(e, Qe) ?? s, s = {
1998
+ left: e("left", .7),
1999
+ right: e("right", .7),
2000
+ top: e("top", .75),
2001
+ bottom: e("bottom", .75),
2002
+ header: e("header", .3),
2003
+ footer: e("footer", .3)
2004
+ };
2005
+ .7 === s.left && .7 === s.right && .75 === s.top && .75 === s.bottom && .3 === s.header && .3 === s.footer || (G().margins = s);
1831
2006
  }
1832
- }), g.registerVisitor({
2007
+ }), f.registerVisitor({
1833
2008
  from: "pageSetup",
1834
- to: "pageSetup",
2009
+ to: null,
1835
2010
  openTag: (t) => {
1836
- t.copyTo("blackAndWhite", Pe), t.copyTo("cellComments"), t.copyTo("copies", Oe), t.copyTo("draft", Pe), t.copyTo("errors"), t.copyTo("firstPageNumber", Oe), t.copyTo("fitToHeight", Oe), t.copyTo("fitToWidth", Oe), t.copyTo("horizontalDpi", Oe), t.copyTo("orientation"), t.copyTo("pageOrder"), t.copyTo("paperSize", Oe), t.copyTo("scale", Oe), t.copyTo("useFirstPageNumber", Pe), t.copyTo("usePrinterDefaults", Pe), t.copyTo("verticalDpi", Oe);
1837
- }
1838
- }), g.registerVisitor({
2011
+ if (U) return;
2012
+ const s = G(), o = (e) => t.getAttribute(e, Je) ?? void 0, r = (e) => t.getAttribute(e, Ke), n = t.getAttribute("orientation");
2013
+ "landscape" !== n && "portrait" !== n || (s.orientation = n);
2014
+ for (const t of [
2015
+ "paperSize",
2016
+ "scale",
2017
+ "fitToWidth",
2018
+ "fitToHeight",
2019
+ "firstPageNumber",
2020
+ "horizontalDpi",
2021
+ "verticalDpi",
2022
+ "copies"
2023
+ ]) {
2024
+ const e = o(t);
2025
+ void 0 !== e && (s[t] = e);
2026
+ }
2027
+ const i = t.getAttribute("paperHeight");
2028
+ i && (s.paperHeight = i);
2029
+ const a = t.getAttribute("paperWidth");
2030
+ a && (s.paperWidth = a), "overThenDown" === t.getAttribute("pageOrder") && (s.printOrder = "overThenDown"), !0 === r("blackAndWhite") && (s.blackAndWhite = !0), !0 === r("draft") && (s.draftMode = !0), !0 === r("useFirstPageNumber") && (s.useFirstPageNumber = !0), !1 === r("usePrinterDefaults") && (s.ignorePrinterDefaults = !0);
2031
+ const l = t.getAttribute("cellComments"), c = F.find(([t]) => t === l)?.[1];
2032
+ c && (s.printComments = c);
2033
+ const h = t.getAttribute("errors"), u = E.find(([t]) => t === h)?.[1];
2034
+ u && (s.printErrors = u);
2035
+ const d = t.getAttribute("r:id"), p = d ? e(d, "part") : null;
2036
+ p && (s.printerSettings = p);
2037
+ }
2038
+ }), f.registerVisitor({
1839
2039
  from: "printOptions",
1840
- to: "printOptions",
2040
+ to: null,
2041
+ openTag: (t) => {
2042
+ if (U) return;
2043
+ const e = (e) => !0 === t.getAttribute(e, Ke);
2044
+ e("horizontalCentered") && (G().centerHorizontally = !0), e("verticalCentered") && (G().centerVertically = !0), e("gridLines") && (G().printGridlines = !0), e("headings") && (G().printHeadings = !0);
2045
+ }
2046
+ }), f.registerVisitor({
2047
+ from: "headerFooter",
2048
+ to: {},
1841
2049
  openTag: (t) => {
1842
- t.copyTo("gridLines", Pe), t.copyTo("gridLinesSet", Pe), t.copyTo("headings", Pe), t.copyTo("horizontalCentered", Pe), t.copyTo("verticalCentered", Pe);
2050
+ if (U) return;
2051
+ const e = {}, s = (e) => t.getAttribute(e, Ke);
2052
+ !0 === s("differentOddEven") && (e.differentOddEven = !0), !0 === s("differentFirst") && (e.differentFirst = !0), !1 === s("scaleWithDoc") && (e.ignoreSheetScale = !0), !1 === s("alignWithMargins") && (e.ignoreSheetMargins = !0), Object.keys(e).length > 0 && (G().headerFooter = e);
2053
+ }
2054
+ });
2055
+ for (const t of j) f.registerVisitor({
2056
+ from: t,
2057
+ to: {},
2058
+ text: (e, s) => {
2059
+ if (U) return;
2060
+ const o = G(), r = o.headerFooter ??= {};
2061
+ r[t] = (r[t] ?? "") + w(e);
2062
+ }
2063
+ });
2064
+ let K = "rowBreaks";
2065
+ for (const [t, e] of [["rowBreaks", "rowBreaks"], ["colBreaks", "columnBreaks"]]) f.registerVisitor({
2066
+ from: t,
2067
+ to: {},
2068
+ openTag: () => {
2069
+ K = e;
2070
+ }
2071
+ });
2072
+ f.registerVisitor({
2073
+ from: "brk",
2074
+ to: null,
2075
+ openTag: (t) => {
2076
+ if (U) return;
2077
+ const e = t.getAttribute("id", Je);
2078
+ if (null == e) return;
2079
+ const s = { index: e }, o = t.getAttribute("min", Je);
2080
+ null != o && (s.min = o);
2081
+ const r = t.getAttribute("max", Je);
2082
+ null != r && (s.max = r), !0 !== t.getAttribute("man", Ke) && (s.automatic = !0), !0 === t.getAttribute("pt", Ke) && (s.pivot = !0);
2083
+ const n = G();
2084
+ (n[K] ??= []).push(s);
2085
+ }
2086
+ }), f.registerVisitor({
2087
+ from: "ignoredErrors",
2088
+ transparent: !0
2089
+ }), f.registerVisitor({
2090
+ from: "ignoredError",
2091
+ to: null,
2092
+ openTag: (e) => {
2093
+ const s = e.getAttribute("sqref");
2094
+ if (!s) return;
2095
+ const o = [];
2096
+ for (const t of n) !0 === e.getAttribute(t, Ke) && o.push(t);
2097
+ if (0 !== o.length) for (const e of s.trim().split(/\s+/)) (t.ignoredErrors ??= []).push({
2098
+ r: e,
2099
+ v: o
2100
+ });
1843
2101
  }
1844
- }), g.registerVisitor({
1845
- from: "headerFoot",
1846
- to: "headerFoot",
1847
- openTag: (t) => {}
1848
- }), g.registerVisitor({
2102
+ }), f.registerVisitor({
1849
2103
  from: "mergeCells",
1850
2104
  to: "merges",
1851
2105
  openTag: (t) => {
1852
2106
  t.setSource([]);
1853
2107
  }
1854
- }), g.registerVisitor({
2108
+ }), f.registerVisitor({
1855
2109
  from: "dataValidations",
1856
2110
  to: "validations",
1857
- openTag: (t) => {
1858
- t.setSource([]);
2111
+ openTag: (e) => {
2112
+ e.setSource([]);
2113
+ const s = {};
2114
+ !0 === e.getAttribute("disablePrompts", Ke) && (s.disablePrompts = !0);
2115
+ const o = e.getAttribute("xWindow", Je);
2116
+ null !== o && (s.windowX = o);
2117
+ const r = e.getAttribute("yWindow", Je);
2118
+ null !== r && (s.windowY = r), Object.keys(s).length > 0 && (t.validationSettings = {
2119
+ ...t.validationSettings,
2120
+ ...s
2121
+ });
1859
2122
  }
1860
2123
  });
1861
- const H = {
2124
+ const J = {
1862
2125
  from: "dataValidation",
1863
2126
  to: [],
1864
2127
  openTag: (t) => {
@@ -1872,53 +2135,53 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1872
2135
  operator: t.getAttribute("operator") ?? void 0
1873
2136
  }
1874
2137
  };
1875
- !0 === t.getAttribute("showDropDown", Pe) && (s.hideDropdown = !0), t.copyToObject(s, "alert", De, "error"), t.copyToObject(s, "alertTitle", De, "errorTitle"), t.copyToObject(s, "showAlertMessage", Pe, "showErrorMessage"), s.alertStyle = t.getAttribute("errorStyle") ?? "stop", t.copyToObject(s, "imeMode"), t.copyToObject(s, "prompt"), t.copyToObject(s, "promptTitle"), t.copyToObject(s, "showPromptMessage", Pe, "showInputMessage"), t.setSource(o);
2138
+ !0 === t.getAttribute("showDropDown", Ke) && (s.hideDropdown = !0), t.copyToObject(s, "alert", Ye, "error"), t.copyToObject(s, "alertTitle", Ye, "errorTitle"), t.copyToObject(s, "showAlertMessage", Ke, "showErrorMessage"), s.alertStyle = t.getAttribute("errorStyle") ?? "stop", t.copyToObject(s, "imeMode"), t.copyToObject(s, "prompt"), t.copyToObject(s, "promptTitle"), t.copyToObject(s, "showPromptMessage", Ke, "showInputMessage"), t.setSource(o);
1876
2139
  },
1877
2140
  closeTag: (t) => {
1878
2141
  const e = t.getSource();
1879
2142
  if (!e?.rule) return;
1880
- const s = y(e.rule, h);
1881
- s && (t.getAttribute("allowBlank", Pe) && (s.includeBlanks = !0), e.v.condition = s), delete e.rule;
2143
+ const s = p(e.rule, l);
2144
+ s && (t.getAttribute("allowBlank", Ke) && (s.includeBlanks = !0), e.v.condition = s), delete e.rule;
1882
2145
  }
1883
2146
  };
1884
- g.registerVisitor(H), g.registerVisitor({
2147
+ f.registerVisitor(J), f.registerVisitor({
1885
2148
  from: "formula1",
1886
2149
  to: {},
1887
2150
  text: (t, e) => {
1888
2151
  const s = e.getParent().rule;
1889
- s?.type && (s.formula1 = I(S(t), s.type));
2152
+ s?.type && (s.formula1 = S(T(t), s.type));
1890
2153
  }
1891
- }), g.registerVisitor({
2154
+ }), f.registerVisitor({
1892
2155
  from: "formula2",
1893
2156
  to: {},
1894
2157
  text: (t, e) => {
1895
2158
  const s = e.getParent().rule;
1896
- s?.type && (s.formula2 = I(S(t), s.type));
2159
+ s?.type && (s.formula2 = S(T(t), s.type));
1897
2160
  }
1898
- }), g.registerVisitor({
2161
+ }), f.registerVisitor({
1899
2162
  from: "picture",
1900
2163
  to: "picture",
1901
2164
  openTag: (t) => {
1902
- const e = t.getAttribute("r:id");
1903
- if (!e) return void t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.sheet.picture.noRel" });
1904
- const o = s(e, "resource");
2165
+ const s = t.getAttribute("r:id");
2166
+ if (!s) return void t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.sheet.picture.noRel" });
2167
+ const o = e(s, "resource");
1905
2168
  t.getSource().resId = o;
1906
2169
  }
1907
2170
  });
1908
- const F = {
2171
+ const Q = {
1909
2172
  from: "slicer",
1910
2173
  to: {},
1911
2174
  openTag: (t) => {
1912
- const e = t.getAttribute("r:id");
1913
- if (!e) return void t.warn("A slicer names no cache; it was not imported.", { onceKey: "xlsx.sheet.slicer.noRel" });
1914
- const o = s(e)?.slicers, r = t.getParent();
2175
+ const s = t.getAttribute("r:id");
2176
+ if (!s) return void t.warn("A slicer names no cache; it was not imported.", { onceKey: "xlsx.sheet.slicer.noRel" });
2177
+ const o = e(s)?.slicers, r = t.getParent();
1915
2178
  r.slicers || (r.slicers = {});
1916
2179
  const n = Object.keys(o);
1917
2180
  for (const t of n) r.slicers[t] = o[t];
1918
2181
  }
1919
2182
  };
1920
- g.registerVisitor(F);
1921
- const W = (t, e) => ({
2183
+ f.registerVisitor(Q);
2184
+ const tt = (t, e) => ({
1922
2185
  from: t,
1923
2186
  to: {},
1924
2187
  openTag: (t) => {
@@ -1930,8 +2193,8 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1930
2193
  closeTag: (t) => {
1931
2194
  e(String(t.getSource() ?? ""), t);
1932
2195
  }
1933
- }), X = /* @__PURE__ */ new Map();
1934
- X.set("dataValidations", {
2196
+ }), st = /* @__PURE__ */ new Map();
2197
+ st.set("dataValidations", {
1935
2198
  from: "dataValidations",
1936
2199
  to: "validations",
1937
2200
  openTag: (t) => {
@@ -1941,15 +2204,15 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1941
2204
  closeTag: (t) => {
1942
2205
  0 === (t.getSource()?.length ?? 0) && t.setSource(void 0);
1943
2206
  }
1944
- }), X.set("dataValidation", {
1945
- ...H,
2207
+ }), st.set("dataValidation", {
2208
+ ...J,
1946
2209
  closeTag: (t) => {
1947
- H.closeTag(t);
2210
+ J.closeTag(t);
1948
2211
  const e = t.getSource();
1949
2212
  e && !e.r && (t.warn("x14 dataValidation with no xm:sqref was dropped."), t.setSource(void 0));
1950
2213
  }
1951
2214
  });
1952
- const q = (t) => ({
2215
+ const rt = (t) => ({
1953
2216
  from: t,
1954
2217
  to: {},
1955
2218
  openTag: (e) => {
@@ -1959,18 +2222,18 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1959
2222
  });
1960
2223
  }
1961
2224
  });
1962
- X.set("formula1", q("formula1")), X.set("formula2", q("formula2")), X.set("f", W("f", (t, e) => {
2225
+ st.set("formula1", rt("formula1")), st.set("formula2", rt("formula2")), st.set("f", tt("f", (t, e) => {
1963
2226
  const s = e.getParent(), o = s?.rule;
1964
- o && (o[s.key] = I(S(t), o.type));
1965
- })), X.set("sqref", W("sqref", (t, e) => {
2227
+ o && (o[s.key] = S(T(t), o.type));
2228
+ })), st.set("sqref", tt("sqref", (t, e) => {
1966
2229
  const s = e.getParent(), o = t.trim();
1967
2230
  s && o && (s.r = o.split(/\s+/).join(","));
1968
2231
  }));
1969
- const U = /* @__PURE__ */ new Map(), G = [], K = /* @__PURE__ */ new Map();
1970
- K.set("conditionalFormattings", {
2232
+ const at = /* @__PURE__ */ new Map(), lt = [], ct = /* @__PURE__ */ new Map();
2233
+ ct.set("conditionalFormattings", {
1971
2234
  from: "conditionalFormattings",
1972
2235
  transparent: !0
1973
- }), K.set("conditionalFormatting", {
2236
+ }), ct.set("conditionalFormatting", {
1974
2237
  from: "conditionalFormatting",
1975
2238
  to: {},
1976
2239
  openTag: (t) => {
@@ -1980,85 +2243,85 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1980
2243
  const e = t.getSource(), s = e?.rules ?? [];
1981
2244
  for (let t = 0; t < s.length; t++) {
1982
2245
  const o = s[t];
1983
- o.sqref = e.sqref, o.id ? U.set(o.id, o) : G.push(o);
2246
+ o.sqref = e.sqref, o.id ? at.set(o.id, o) : lt.push(o);
1984
2247
  }
1985
2248
  }
1986
- }), K.set("cfRule", {
2249
+ }), ct.set("cfRule", {
1987
2250
  from: "cfRule",
1988
2251
  to: {},
1989
2252
  openTag: (t) => {
1990
- t.copyTo("id", De), t.copyTo("type", De), t.copyTo("priority", Oe), t.copyTo("stopIfTrue", Pe), t.copyTo("operator", De), t.copyTo("text", De), t.copyTo("timePeriod", De), t.copyTo("aboveAverage", Pe), t.copyTo("equalAverage", Pe), t.copyTo("stdDev", Oe), t.copyTo("bottom", Pe), t.copyTo("percent", Pe), t.copyTo("rank", Oe);
2253
+ t.copyTo("id", Ye), t.copyTo("type", Ye), t.copyTo("priority", Je), t.copyTo("stopIfTrue", Ke), t.copyTo("operator", Ye), t.copyTo("text", Ye), t.copyTo("timePeriod", Ye), t.copyTo("aboveAverage", Ke), t.copyTo("equalAverage", Ke), t.copyTo("stdDev", Je), t.copyTo("bottom", Ke), t.copyTo("percent", Ke), t.copyTo("rank", Je);
1991
2254
  },
1992
2255
  closeTag: (t) => {
1993
2256
  const e = t.getSource();
1994
2257
  e && t.getParent()?.rules?.push(e);
1995
2258
  }
1996
- }), K.set("sqref", W("sqref", (t, e) => {
2259
+ }), ct.set("sqref", tt("sqref", (t, e) => {
1997
2260
  const s = e.getParent(), o = t.trim();
1998
2261
  s && o && (s.sqref = o);
1999
- })), K.set("dataBar", {
2262
+ })), ct.set("dataBar", {
2000
2263
  from: "dataBar",
2001
2264
  to: {},
2002
2265
  openTag: (t) => {
2003
- t.copyTo("minLength", Oe), t.copyTo("maxLength", Oe), t.copyTo("gradient", Pe), t.copyTo("border", Pe), t.copyTo("direction", De), t.copyTo("axisPosition", De), t.copyTo("negativeBarColorSameAsPositive", Pe), t.copyTo("negativeBarBorderColorSameAsPositive", Pe);
2266
+ t.copyTo("minLength", Je), t.copyTo("maxLength", Je), t.copyTo("gradient", Ke), t.copyTo("border", Ke), t.copyTo("direction", Ye), t.copyTo("axisPosition", Ye), t.copyTo("negativeBarColorSameAsPositive", Ke), t.copyTo("negativeBarBorderColorSameAsPositive", Ke);
2004
2267
  },
2005
2268
  closeTag: (t) => {
2006
2269
  t.getParent().dataBar = t.getSource();
2007
2270
  }
2008
- }), K.set("iconSet", {
2271
+ }), ct.set("iconSet", {
2009
2272
  from: "iconSet",
2010
2273
  to: {},
2011
2274
  openTag: (t) => {
2012
- t.copyTo("iconSet", De), t.copyTo("custom", Pe), t.copyTo("reverse", Pe), t.copyTo("showValue", Pe);
2275
+ t.copyTo("iconSet", Ye), t.copyTo("custom", Ke), t.copyTo("reverse", Ke), t.copyTo("showValue", Ke);
2013
2276
  },
2014
2277
  closeTag: (t) => {
2015
2278
  t.getParent().iconSet = t.getSource();
2016
2279
  }
2017
2280
  });
2018
- const J = /* @__PURE__ */ new Map();
2019
- J.set("f", W("f", (t, e) => {
2281
+ const ht = /* @__PURE__ */ new Map();
2282
+ ht.set("f", tt("f", (t, e) => {
2020
2283
  const s = e.getParent();
2021
2284
  if (!s) return;
2022
2285
  const o = t.trim(), r = Number(o);
2023
- s.value = o.length > 0 && Number.isFinite(r) ? r : S(t);
2024
- })), K.set("cfvo", {
2286
+ s.value = o.length > 0 && Number.isFinite(r) ? r : T(t);
2287
+ })), ct.set("cfvo", {
2025
2288
  from: "cfvo",
2026
2289
  to: {},
2027
- scope: () => J,
2290
+ scope: () => ht,
2028
2291
  openTag: (t) => {
2029
2292
  const e = t.getParent();
2030
2293
  e.conditions || (e.conditions = []);
2031
2294
  const s = t.getSource();
2032
- e.conditions.push(s), t.copyTo("type", De), !1 === t.getAttribute("gte", Pe) && (s.exclusive = !0);
2295
+ e.conditions.push(s), t.copyTo("type", Ye), !1 === t.getAttribute("gte", Ke) && (s.exclusive = !0);
2033
2296
  }
2034
- }), K.set("f", W("f", (t, e) => {
2297
+ }), ct.set("f", tt("f", (t, e) => {
2035
2298
  const s = e.getParent();
2036
- s && (s.formulas ??= []).push(S(t));
2037
- })), K.set("dxf", {
2299
+ s && (s.formulas ??= []).push(T(t));
2300
+ })), ct.set("dxf", {
2038
2301
  from: "dxf",
2039
2302
  to: {},
2040
2303
  raw: !0,
2041
2304
  closeTag: (t) => {
2042
- if (!m) return;
2305
+ if (!x) return;
2043
2306
  const e = t.getParent();
2044
2307
  if (!e) return;
2045
- const s = m(t.getRawXml() ?? "");
2308
+ const s = x(t.getRawXml() ?? "");
2046
2309
  s && (e.style = s);
2047
2310
  }
2048
2311
  });
2049
- const Y = (t) => ({
2312
+ const pt = (t) => ({
2050
2313
  from: t,
2051
2314
  to: {},
2052
2315
  openTag: (e) => {
2053
- const s = bt((t) => e.getAttribute(t));
2316
+ const s = nt((t) => e.getAttribute(t));
2054
2317
  s && (e.getParent()[t] = s);
2055
2318
  }
2056
2319
  });
2057
- K.set("borderColor", Y("borderColor")), K.set("negativeFillColor", Y("negativeFillColor")), K.set("negativeBorderColor", Y("negativeBorderColor")), K.set("axisColor", Y("axisColor")), K.set("cfIcon", {
2320
+ ct.set("borderColor", pt("borderColor")), ct.set("negativeFillColor", pt("negativeFillColor")), ct.set("negativeBorderColor", pt("negativeBorderColor")), ct.set("axisColor", pt("axisColor")), ct.set("cfIcon", {
2058
2321
  from: "cfIcon",
2059
2322
  to: {},
2060
2323
  openTag: (t) => {
2061
- const e = t.getAttribute("iconSet"), s = t.getAttribute("iconId", Oe);
2324
+ const e = t.getAttribute("iconSet"), s = t.getAttribute("iconId", Je);
2062
2325
  if (null === e || null === s) return;
2063
2326
  const o = t.getParent();
2064
2327
  o.icons || (o.icons = []), o.icons.push({
@@ -2067,112 +2330,109 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2067
2330
  });
2068
2331
  }
2069
2332
  });
2070
- const tt = /* @__PURE__ */ new Map();
2071
- tt.set("id", W("id", (t, e) => {
2333
+ const ft = /* @__PURE__ */ new Map();
2334
+ ft.set("id", tt("id", (t, e) => {
2072
2335
  const s = e.getParent(), o = t.trim();
2073
2336
  s && o && (s.x14Id = o);
2074
2337
  }));
2075
- const et = /* @__PURE__ */ new Map();
2076
- et.set("slicerList", {
2338
+ const gt = /* @__PURE__ */ new Map();
2339
+ gt.set("slicerList", {
2077
2340
  from: "slicerList",
2078
2341
  transparent: !0
2079
- }), et.set("slicer", F);
2080
- const st = /* @__PURE__ */ new Map([
2081
- [T(B), X],
2082
- [T(l), K],
2083
- [T(f), K],
2084
- [T(a), tt],
2085
- [T(i), et],
2086
- [T(x), et],
2087
- [T(e), R]
2088
- ]), ot = /* @__PURE__ */ new Set();
2089
- g.registerVisitor({
2342
+ }), gt.set("slicer", Q);
2343
+ const mt = /* @__PURE__ */ new Map([
2344
+ [h(M), st],
2345
+ [h(X), ct],
2346
+ [h(H), ct],
2347
+ [h(Z), ft],
2348
+ [h(dt), gt],
2349
+ [h(I), gt],
2350
+ [h(A), V]
2351
+ ]), bt = /* @__PURE__ */ new Set();
2352
+ f.registerVisitor({
2090
2353
  from: "extLst",
2091
2354
  transparent: !0
2092
- }), g.registerVisitor({
2355
+ }), f.registerVisitor({
2093
2356
  from: "ext",
2094
2357
  transparent: !0,
2095
2358
  scope: (t) => {
2096
- const e = t.getAttribute("uri"), s = T(e), o = st.get(s);
2097
- if (o) return o;
2098
- if (!c.has(s) && !ot.has(s)) {
2099
- ot.add(s);
2100
- const o = b[s];
2101
- t.warn(o ? `Extension content '${o}' (${e}) is not read; it will be lost on resave.` : `Unknown extension content (uri ${e}) is not read; it will be lost on resave.`);
2359
+ const e = t.getAttribute("uri"), s = h(e), r = mt.get(s);
2360
+ if (r) return r;
2361
+ if (!b.has(s) && !bt.has(s)) {
2362
+ bt.add(s);
2363
+ const r = o[s];
2364
+ t.warn(r ? `Extension content '${r}' (${e}) is not read; it will be lost on resave.` : `Unknown extension content (uri ${e}) is not read; it will be lost on resave.`);
2102
2365
  }
2103
2366
  return null;
2104
2367
  }
2105
- }), g.registerVisitor({
2368
+ }), f.registerVisitor({
2106
2369
  from: "mergeCell",
2107
2370
  to: [],
2108
2371
  openTag: (t) => {
2109
2372
  const e = t.getAttribute("ref");
2110
2373
  t.setSource(e);
2111
2374
  }
2112
- }), g.registerVisitor({
2375
+ }), f.registerVisitor({
2113
2376
  from: "hyperlinks",
2114
2377
  to: "hyperlinks",
2115
2378
  openTag: (t) => {
2116
2379
  t.setSource([]);
2117
2380
  }
2118
- }), g.registerVisitor({
2381
+ }), f.registerVisitor({
2119
2382
  from: "hyperlink",
2120
2383
  to: [],
2121
2384
  openTag: (t) => {
2122
- const e = t.getAttribute("r:id"), o = t.getAttribute("ref");
2385
+ const s = t.getAttribute("r:id"), o = t.getAttribute("ref");
2123
2386
  if (!o) return void t.warn("A hyperlink has no ref; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.noRef" });
2124
2387
  t.setKey(o);
2125
- let r = e ? s(e) : "";
2388
+ let r = s ? e(s) : "";
2126
2389
  if ("string" != typeof r) return void t.warn("A hyperlink has an invalid address; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.address" });
2127
2390
  r.endsWith("\\") && (r = r.substring(0, r.length - 1));
2128
2391
  const n = t.getAttribute("location");
2129
2392
  if (n && (r += "#" + n), !r) return void t.warn("A hyperlink has no address; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.address" });
2130
2393
  let i;
2131
- const a = t.getAttribute("tooltip");
2132
- i = a ? {
2133
- address: r,
2134
- screenTip: a
2135
- } : r, t.setSource({
2394
+ const a = t.getAttribute("tooltip"), l = t.getAttribute("display");
2395
+ a || l ? (i = { address: r }, a && (i.screenTip = a), l && (i.display = l)) : i = r, t.setSource({
2136
2396
  r: o,
2137
2397
  v: i
2138
2398
  });
2139
2399
  }
2140
- }), g.registerVisitor({
2400
+ }), f.registerVisitor({
2141
2401
  from: "drawing",
2142
2402
  to: "movables",
2143
2403
  openTag: (t) => {
2144
- const e = t.getAttribute("r:id");
2145
- if (!e) return;
2146
- const o = s(e);
2404
+ const s = t.getAttribute("r:id");
2405
+ if (!s) return;
2406
+ const o = e(s);
2147
2407
  o ? t.setSource(o.movables) : t.warn("A drawing part is missing; its shapes were not imported.", { onceKey: "xlsx.sheet.drawing.missing" });
2148
2408
  }
2149
- }), g.registerVisitor({
2409
+ }), f.registerVisitor({
2150
2410
  from: "legacyDrawing",
2151
2411
  to: "legacyDrawing",
2152
2412
  openTag: (t) => {
2153
- t.setSource(s(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
2413
+ t.setSource(e(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
2154
2414
  }
2155
- }), g.registerVisitor({
2415
+ }), f.registerVisitor({
2156
2416
  from: "legacyDrawingHF",
2157
2417
  to: "legacyDrawingHF",
2158
2418
  openTag: (t) => {
2159
- t.setSource(s(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
2419
+ t.setSource(e(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
2160
2420
  }
2161
2421
  });
2162
- let nt = null, it = !1;
2163
- const at = /* @__PURE__ */ new Map(), ct = {
2422
+ let vt = null, yt = !1;
2423
+ const wt = /* @__PURE__ */ new Map(), Tt = {
2164
2424
  from: "Fallback",
2165
2425
  to: null
2166
- }, lt = {
2426
+ }, St = {
2167
2427
  from: "Choice",
2168
2428
  transparent: !0
2169
2429
  };
2170
- at.set("Fallback", ct), at.set("Choice", lt), at.set("control", {
2430
+ wt.set("Fallback", Tt), wt.set("Choice", St), wt.set("control", {
2171
2431
  from: "control",
2172
2432
  transparent: !0,
2173
2433
  openTag: (t) => {
2174
- const e = t.getAttribute("name"), o = t.getAttribute("r:id"), r = o ? s(o, "formControl") : null;
2175
- if (!r) return t.warn(`The form control '${e ?? ""}' has no properties and was not read.`, { onceKey: "xlsx.sheet.control.noProperties" }), void (nt = null);
2434
+ const s = t.getAttribute("name"), o = t.getAttribute("r:id"), r = o ? e(o, "formControl") : null;
2435
+ if (!r) return t.warn(`The form control '${s ?? ""}' has no properties and was not read.`, { onceKey: "xlsx.sheet.control.noProperties" }), void (vt = null);
2176
2436
  const n = r.json, i = parseInt(t.getAttribute("shapeId") ?? "", 10);
2177
2437
  isNaN(i) || (n.shapeId = i);
2178
2438
  const a = {
@@ -2195,96 +2455,96 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2195
2455
  json: n
2196
2456
  }
2197
2457
  };
2198
- e && (a.content.name = e), nt = {
2458
+ s && (a.content.name = s), vt = {
2199
2459
  movable: a,
2200
2460
  control: n
2201
2461
  };
2202
2462
  },
2203
2463
  closeTag: () => {
2204
- nt && (t.movables || (t.movables = []), t.movables.push(nt.movable), nt = null);
2464
+ vt && (t.movables || (t.movables = []), t.movables.push(vt.movable), vt = null);
2205
2465
  }
2206
- }), at.set("controlPr", {
2466
+ }), wt.set("controlPr", {
2207
2467
  from: "controlPr",
2208
2468
  transparent: !0,
2209
2469
  raw: !0,
2210
2470
  openTag: (t) => {
2211
- if (!nt) return;
2471
+ if (!vt) return;
2212
2472
  const e = t.getFrom().attributes ?? {}, s = {};
2213
2473
  for (const t in e) {
2214
2474
  const o = e[t];
2215
2475
  s[t] = "string" == typeof o ? o : o?.value ?? "";
2216
2476
  }
2217
- E(s, nt.control);
2477
+ B(s, vt.control);
2218
2478
  },
2219
2479
  closeTag: (t) => {
2220
- if (!nt) return;
2480
+ if (!vt) return;
2221
2481
  const e = ((t) => {
2222
2482
  const e = /<(?:[\w.-]+:)?anchor\b([^>]*)>([\s\S]*?)<\/(?:[\w.-]+:)?anchor>/.exec(t);
2223
2483
  if (!e) return null;
2224
2484
  const s = e[2], o = (t) => new RegExp(`<(?:[\\w.-]+:)?${t}\\b[^>]*>([\\s\\S]*?)<\\/(?:[\\w.-]+:)?${t}>`).exec(s)?.[1], r = e[1], n = /\bmoveWithCells="(?:1|true)"/.test(r), i = /\bsizeWithCells="(?:1|true)"/.test(r);
2225
2485
  return {
2226
2486
  anchor: {
2227
- tl: Fe(o("from")),
2228
- br: Fe(o("to"))
2487
+ tl: Cs(o("from")),
2488
+ br: Cs(o("to"))
2229
2489
  },
2230
2490
  anchorType: n ? i ? "twoCell" : "oneCell" : "absolute",
2231
2491
  rest: (t.slice(0, e.index) + t.slice(e.index + e[0].length)).trim()
2232
2492
  };
2233
2493
  })(t.getRawXml() ?? "");
2234
- e ? (nt.movable.anchor = e.anchor, "twoCell" !== e.anchorType && (nt.movable.anchorType = e.anchorType), e.rest && (nt.control.xml = e.rest)) : it || (it = !0, t.warn("A form control has no anchor; it is placed at the top left of the sheet."));
2494
+ e ? (vt.movable.anchor = e.anchor, "twoCell" !== e.anchorType && (vt.movable.anchorType = e.anchorType), e.rest && (vt.control.xml = e.rest)) : yt || (yt = !0, t.warn("A form control has no anchor; it is placed at the top left of the sheet."));
2235
2495
  }
2236
2496
  });
2237
- const ht = {
2497
+ const At = {
2238
2498
  from: "controls",
2239
2499
  transparent: !0,
2240
- scope: () => at
2500
+ scope: () => wt
2241
2501
  };
2242
- g.registerVisitor(ht);
2243
- const ut = /* @__PURE__ */ new Map([
2244
- ["Choice", lt],
2245
- ["Fallback", ct],
2246
- ["controls", ht]
2502
+ f.registerVisitor(At);
2503
+ const Et = /* @__PURE__ */ new Map([
2504
+ ["Choice", St],
2505
+ ["Fallback", Tt],
2506
+ ["controls", At]
2247
2507
  ]);
2248
- g.registerVisitor({
2508
+ f.registerVisitor({
2249
2509
  from: "AlternateContent",
2250
2510
  transparent: !0,
2251
- scope: () => ut
2252
- }), g.registerVisitor({
2511
+ scope: () => Et
2512
+ }), f.registerVisitor({
2253
2513
  from: "tableParts",
2254
2514
  to: "tables",
2255
2515
  openTag: (t) => {
2256
2516
  t.setSource([]);
2257
2517
  }
2258
- }), g.registerVisitor({
2518
+ }), f.registerVisitor({
2259
2519
  from: "tablePart",
2260
2520
  to: [],
2261
2521
  openTag: (t) => {
2262
- const e = t.getAttribute("r:id");
2263
- if (!e) return;
2264
- const o = s(e);
2522
+ const s = t.getAttribute("r:id");
2523
+ if (!s) return;
2524
+ const o = e(s);
2265
2525
  o ? t.setSource(o) : t.warn("A table part is missing; the table was not imported.", { onceKey: "xlsx.sheet.table.missing" });
2266
2526
  }
2267
2527
  });
2268
- const dt = (t, e) => {
2528
+ const Pt = (t, e) => {
2269
2529
  e.conditions?.length && (t.stops = D(e)), void 0 !== e.minLength && (t.minLength = e.minLength), void 0 !== e.maxLength && (t.maxLength = e.maxLength), (e.gradient ?? 1) && (t.gradient = !0), e.border && e.borderColor && (t.borderColor = e.borderColor), !e.negativeBarColorSameAsPositive && e.negativeFillColor && (t.negativeFillColor = e.negativeFillColor), !(e.negativeBarBorderColorSameAsPositive ?? 1) && e.negativeBorderColor && (t.negativeBorderColor = e.negativeBorderColor), e.axisColor && (t.axisColor = e.axisColor), "middle" !== e.axisPosition && "none" !== e.axisPosition || (t.axisPosition = e.axisPosition), "leftToRight" !== e.direction && "rightToLeft" !== e.direction || (t.direction = e.direction);
2270
- }, pt = (t, e) => {
2530
+ }, Ot = (t, e) => {
2271
2531
  e.conditions?.length && (t.stops = D(e)), e.iconSet && e.iconSet !== t.iconSet && (t.iconSet = e.iconSet), e.icons?.length && (t.icon = e.icons), void 0 !== e.reverse && (t.reverse = e.reverse), void 0 !== e.showValue && (t.showValue = e.showValue);
2272
- }, ft = (t) => {
2532
+ }, Dt = (t) => {
2273
2533
  if (!t.sqref) return null;
2274
2534
  const e = t.sqref.split(/\s+/).join(",");
2275
2535
  if ("iconSet" === t.type) {
2276
2536
  if (!t.iconSet) return null;
2277
2537
  const s = {
2278
- type: Q.ScaleType.IconSet,
2538
+ type: kt.ScaleType.IconSet,
2279
2539
  stops: []
2280
2540
  };
2281
- return pt(s, t.iconSet), {
2541
+ return Ot(s, t.iconSet), {
2282
2542
  r: e,
2283
2543
  v: { scale: s },
2284
2544
  priority: t.priority
2285
2545
  };
2286
2546
  }
2287
- const s = P(t, h);
2547
+ const s = _(t, l);
2288
2548
  if (!s) return null;
2289
2549
  const o = { condition: s };
2290
2550
  return t.style && (o.style = t.style), t.stopIfTrue && (o.stopIfTrue = !0), {
@@ -2293,7 +2553,7 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2293
2553
  priority: t.priority
2294
2554
  };
2295
2555
  };
2296
- g.registerVisitor({
2556
+ f.registerVisitor({
2297
2557
  from: "worksheet",
2298
2558
  to: {},
2299
2559
  openTag: (t) => {},
@@ -2304,28 +2564,28 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2304
2564
  const e = s[t], o = e.x14Id;
2305
2565
  if (!o) continue;
2306
2566
  delete e.x14Id;
2307
- const r = U.get(o);
2567
+ const r = at.get(o);
2308
2568
  if (!r) continue;
2309
- U.delete(o);
2569
+ at.delete(o);
2310
2570
  const n = e.v?.scale;
2311
- r.dataBar && n?.type === Q.ScaleType.DataBar ? dt(n, r.dataBar) : r.iconSet && n?.type === Q.ScaleType.IconSet && pt(n, r.iconSet);
2571
+ r.dataBar && n?.type === kt.ScaleType.DataBar ? Pt(n, r.dataBar) : r.iconSet && n?.type === kt.ScaleType.IconSet && Ot(n, r.iconSet);
2312
2572
  }
2313
- const o = [...U.values(), ...G], r = /* @__PURE__ */ new Set();
2573
+ const o = [...at.values(), ...lt], r = /* @__PURE__ */ new Set();
2314
2574
  let n = 0;
2315
2575
  for (let t = 0; t < o.length; t++) {
2316
- const i = ft(o[t]);
2576
+ const i = Dt(o[t]);
2317
2577
  i ? (s || (s = [], e.conditionals = s), s.push(i)) : (r.add(o[t].type ?? "unknown"), n++);
2318
2578
  }
2319
2579
  if (n > 0) {
2320
2580
  const t = [...r].map((t) => `'${t}'`).join(", ");
2321
- h?.(1 === n ? `An x14-only conditional formatting rule (type ${t}) is not read and will be lost on resave.` : `${n} x14-only conditional formatting rules (types ${t}) are not read and will be lost on resave.`);
2581
+ l?.(1 === n ? `An x14-only conditional formatting rule (type ${t}) is not read and will be lost on resave.` : `${n} x14-only conditional formatting rules (types ${t}) are not read and will be lost on resave.`);
2322
2582
  }
2323
2583
  if (s) {
2324
2584
  s.length > 1 && s.sort((t, e) => (t.priority ?? 1 / 0) - (e.priority ?? 1 / 0));
2325
2585
  for (let t = 0; t < s.length; t++) delete s[t].priority;
2326
2586
  }
2327
2587
  }
2328
- }), g.registerVisitor({
2588
+ }), f.registerVisitor({
2329
2589
  from: "customProperties",
2330
2590
  to: "customProperties",
2331
2591
  openTag: (t) => {
@@ -2335,37 +2595,37 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2335
2595
  const e = t.getSource();
2336
2596
  if (e.length > 0) t.getParent().customProperties = e;
2337
2597
  }
2338
- }), g.registerVisitor({
2598
+ }), f.registerVisitor({
2339
2599
  from: "customPr",
2340
2600
  to: {},
2341
2601
  openTag: (t) => {
2342
- const e = t.getParent();
2602
+ const s = t.getParent();
2343
2603
  t.copyTo("name");
2344
2604
  const o = t.getAttribute("r:id");
2345
2605
  if (!o) return void t.warn("A custom property names no part; it was not imported.", { onceKey: "xlsx.sheet.customProperty.noRel" });
2346
- const r = s(o, "resource"), n = t.getSource();
2347
- n.resId = r, e.push(n);
2606
+ const r = e(o, "resource"), n = t.getSource();
2607
+ n.resId = r, s.push(n);
2348
2608
  }
2349
- }), g.registerVisitor({
2609
+ }), f.registerVisitor({
2350
2610
  from: "sheetProtection",
2351
2611
  to: "protection",
2352
2612
  openTag: (t) => {
2353
2613
  const e = t.getSource();
2354
- for (const s of _) {
2614
+ for (const s of P) {
2355
2615
  const o = t.hasAttribute(s.attribute) ? t.getAttribute(s.attribute) : null;
2356
- e[s.key] = A(s, o);
2616
+ e[s.key] = ut(s, o);
2357
2617
  }
2358
2618
  if (e.sheet) return;
2359
2619
  const s = {};
2360
- if (t.copyToObject(s, "hash", De, "hashValue"), t.copyToObject(s, "algorithm", De, "algorithmName"), t.copyToObject(s, "salt", De, "saltValue"), t.copyToObject(s, "spinCount", Oe), Object.keys(s).length > 0) t.getSource().password = s;
2620
+ if (t.copyToObject(s, "hash", Ye, "hashValue"), t.copyToObject(s, "algorithm", Ye, "algorithmName"), t.copyToObject(s, "salt", Ye, "saltValue"), t.copyToObject(s, "spinCount", Je), t.copyToObject(s, "legacyHash", Ye, "password"), Object.keys(s).length > 0) t.getSource().password = s;
2361
2621
  }
2362
- }), g.registerVisitor({
2622
+ }), f.registerVisitor({
2363
2623
  from: "protectedRanges",
2364
2624
  to: "protectedRanges",
2365
2625
  openTag: (t) => {
2366
2626
  t.setSource([]);
2367
2627
  }
2368
- }), g.registerVisitor({
2628
+ }), f.registerVisitor({
2369
2629
  from: "protectedRange",
2370
2630
  to: [],
2371
2631
  openTag: (t) => {
@@ -2377,68 +2637,78 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2377
2637
  };
2378
2638
  t.copyToObject(s, "name"), t.copyToObject(s, "securityDescriptor");
2379
2639
  const r = {};
2380
- t.copyToObject(r, "hash", De, "hashValue"), t.copyToObject(r, "algorithm", De, "algorithmName"), t.copyToObject(r, "salt", De, "saltValue"), t.copyToObject(r, "spinCount", Oe), Object.keys(r).length > 0 && (s.password = r), t.setSource(o);
2640
+ t.copyToObject(r, "hash", Ye, "hashValue"), t.copyToObject(r, "algorithm", Ye, "algorithmName"), t.copyToObject(r, "salt", Ye, "saltValue"), t.copyToObject(r, "spinCount", Je), t.copyToObject(r, "legacyHash", Ye, "password"), Object.keys(r).length > 0 && (s.password = r), t.setSource(o);
2381
2641
  },
2382
2642
  closeTag: (t) => {
2383
2643
  const e = t.getSource();
2384
2644
  e?.r && e.v.name || t.setSource(void 0);
2385
2645
  }
2386
- }), g.registerVisitor({
2646
+ }), f.registerVisitor({
2387
2647
  from: "sheetFormatPr",
2388
2648
  to: "sheetFormatPr",
2389
2649
  openTag: (e) => {
2390
- e.copyToObject(t, "defaultColSize", Ie, "defaultColWidth");
2650
+ e.copyToObject(t, "defaultColSize", Qe, "defaultColWidth");
2391
2651
  const s = e.getAttribute("customHeight");
2392
- "1" !== s && "true" !== s || e.copyToObject(t, "defaultRowSize", Ie, "defaultRowHeight");
2652
+ "1" !== s && "true" !== s || e.copyToObject(t, "defaultRowSize", Qe, "defaultRowHeight");
2653
+ const o = e.getAttribute("baseColWidth", Je);
2654
+ o && 8 !== o && (t.baseColSize = o), m = !!e.getAttribute("zeroHeight", Ke);
2393
2655
  }
2394
- }), g.registerVisitor({
2656
+ }), f.registerVisitor({
2395
2657
  from: "cols",
2396
2658
  to: "cols",
2397
2659
  openTag: (t) => {
2398
2660
  t.setSource([]);
2399
2661
  }
2400
- }), g.registerVisitor({
2662
+ }), f.registerVisitor({
2401
2663
  from: "col",
2402
2664
  to: [],
2403
2665
  openTag: (t) => {
2404
2666
  const e = t.getSource(), s = t.getAttribute("min"), o = t.getAttribute("max"), r = void 0 === s ? 0 : parseInt(s) - 1, n = void 0 === o ? r : parseInt(o) - 1;
2405
- e.r = z.runToString(r, n, !0);
2667
+ e.r = xt.runToString(r, n, !0);
2406
2668
  const i = {};
2407
- e.v = i, t.copyToObject(i, "sz", Ie, "width"), t.copyToObject(i, "csz", Pe, "customWidth"), t.copyToObject(i, "h", Pe, "hidden"), t.copyToObject(i, "l", Oe, "outlineLevel"), t.copyToObject(i, "cl", Pe, "collapsed"), t.copyToObject(i, "s", Oe, "style");
2669
+ e.v = i, t.copyToObject(i, "sz", Qe, "width"), t.copyToObject(i, "csz", Ke, "customWidth"), t.copyToObject(i, "h", Ke, "hidden"), t.copyToObject(i, "l", Je, "outlineLevel"), t.copyToObject(i, "cl", Ke, "collapsed"), t.getAttribute("bestFit", Ke) && (i.bf = !0), t.copyToObject(i, "s", Je, "style");
2408
2670
  }
2409
- }), g.registerVisitor({
2671
+ }), f.registerVisitor({
2410
2672
  from: "oleObjects",
2411
2673
  to: null,
2412
2674
  openTag: (t) => {
2413
2675
  t.warn("'OLE Objects' are not supported.");
2414
2676
  }
2415
2677
  });
2416
- let gt = !1, mt = !1, xt = 0, yt = "";
2417
- const vt = (t) => {
2678
+ let _t = !1, Rt = !1, Lt = 0, Vt = "";
2679
+ const Mt = (t) => {
2418
2680
  const e = t.indexOf(":");
2419
2681
  return -1 === e ? t : t.slice(e + 1);
2420
- };
2421
- return Ge(C, t, g.createEventHandler(t, n, h), h, u, {
2682
+ }, jt = new ys();
2683
+ return Rs(C, t, f.createEventHandler(t, a, l), l, c, {
2422
2684
  onOpenTag: (t) => {
2423
- gt = !0;
2424
- const e = vt(t.name);
2425
- "t" === e || "v" === e ? 0 === xt && (mt = !0) : "rPh" !== e && "phoneticPr" !== e || xt++;
2685
+ _t = !0;
2686
+ const e = Mt(t.name);
2687
+ "t" === e || "v" === e ? 0 === Lt && (Rt = !0) : "rPh" === e || "phoneticPr" === e ? Lt++ : 0 === Lt && jt.onOpenTag(e, t.attributes);
2426
2688
  },
2427
2689
  onText: (t) => {
2428
- mt && (yt += t);
2690
+ Rt && (Vt += t, jt.onText(t));
2429
2691
  },
2430
2692
  onCloseTag: (t) => {
2431
- const e = vt(t.name);
2432
- "t" === e || "v" === e ? mt = !1 : "rPh" !== e && "phoneticPr" !== e || xt > 0 && xt--;
2693
+ const e = Mt(t.name);
2694
+ "t" === e || "v" === e ? Rt = !1 : "rPh" === e || "phoneticPr" === e ? Lt > 0 && Lt-- : jt.onCloseTag(e);
2433
2695
  },
2434
2696
  onEnd: () => {
2435
- if (!gt) return;
2436
- const t = o(O(yt));
2437
- return gt = !1, mt = !1, xt = 0, yt = "", t;
2697
+ if (!_t) return;
2698
+ const t = jt.take();
2699
+ _t = !1, Rt = !1, Lt = 0;
2700
+ const e = w(Vt);
2701
+ return Vt = "", t ? {
2702
+ t: "r",
2703
+ v: {
2704
+ type: "richText",
2705
+ data: { runs: ws(t, u?.get(Is)) }
2706
+ }
2707
+ } : s(e);
2438
2708
  },
2439
2709
  onError: (t) => {}
2440
- }, p);
2441
- }, Xe = class {
2710
+ }, u, s, () => m);
2711
+ }, Os = class {
2442
2712
  static {
2443
2713
  this.Collapsed = 1;
2444
2714
  }
@@ -2469,77 +2739,98 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2469
2739
  static {
2470
2740
  this.Spans = 512;
2471
2741
  }
2472
- static {
2473
- this.ThickBot = 1024;
2474
- }
2475
- static {
2476
- this.ThickTop = 2048;
2477
- }
2478
- }, qe = (t, e, s) => {
2742
+ }, Ds = (t, e, s) => {
2479
2743
  if (t[0].value[0] === t[1].value[0]) return e;
2480
- }, Ue = {
2744
+ }, Ns = /^\s*TABLE\s*\(/i, _s = {
2481
2745
  colStart: 0,
2482
2746
  colEnd: 0,
2483
2747
  rowStart: 0,
2484
2748
  rowEnd: 0
2485
- }, Ge = (t, e, s, o, r, n, i) => {
2486
- let a = !1, c = !1, l = [], h = !1, u = null, d = null, p = null, f = null, g = null, m = null;
2487
- const x = i?.get("richData") ?? X.EmptyArray, y = i?.get("dummyWrapped") ?? null, b = z.normalizeA1ToR1C1, v = q.createConflatingRanges(), T = /* @__PURE__ */ new Map(), w = [];
2488
- let S = !1, C = !1, k = null;
2489
- let A = !1;
2490
- const E = q.createConflatingRanges();
2491
- let P = !1, O = -1, I = -1, D = null, N = null, _ = null;
2492
- const L = [];
2493
- let $ = null, V = -2, R = 0, j = "", M = "", B = "", H = "", F = "", W = "", G = "", K = "", J = "", Z = "", Q = "", tt = "", et = "", st = "", ot = !0, rt = null, nt = !1, it = !1, at = !1, ct = null, lt = 0;
2494
- const ht = (t) => {
2749
+ }, $s = (t) => "1" === t || "true" === t, Rs = (t, e, s, o, r, n, i, a, l) => {
2750
+ let c = !1;
2751
+ const h = [], u = i?.get(Es), d = i?.get(Is), p = /* @__PURE__ */ new Map();
2752
+ let f = !1, g = [], m = !1, b = null, x = null, v = null, y = null, w = null, T = null;
2753
+ const S = i?.get("richData") ?? vt.EmptyArray, C = i?.get("dummyWrapped") ?? null, k = xt.normalizeA1ToR1C1, A = yt.createConflatingRanges(), E = /* @__PURE__ */ new Map(), I = [];
2754
+ let P = !1, O = !1, D = null;
2755
+ const N = (t) => {
2756
+ const e = (i?.get("metadata"))?.values;
2757
+ if (!e) return;
2758
+ const s = parseInt(t, 10);
2759
+ if (!Number.isFinite(s) || s < 1) return;
2760
+ const o = e[s - 1]?.get("XLRICHVALUE");
2761
+ return void 0 !== o?.richValueIndex ? S[o.richValueIndex] : void 0;
2762
+ };
2763
+ let _ = !1;
2764
+ const $ = yt.createConflatingRanges();
2765
+ let R = !1, L = -1, V = -1, M = null, j = null, B = null;
2766
+ const H = [];
2767
+ let F = null, W = -2, z = 0, X = "", q = "", U = "", G = "", Z = "", J = "", Q = "", Y = "", tt = "", et = "", st = "", ot = "", rt = "", nt = "", it = !0, at = null, lt = !1, ct = !1, ht = !1, ut = null, dt = 0;
2768
+ const pt = (t) => {
2495
2769
  let o = t.name;
2496
- const p = o.indexOf(":");
2497
- if (-1 !== p && (o = o.slice(p + 1)), lt++, lt % 196608 == 0 && r?.(lt), N) {
2498
- const e = t.attributes;
2770
+ const a = o.indexOf(":");
2771
+ if (-1 !== a && (o = o.slice(a + 1)), dt++, dt % 196608 == 0 && r?.(dt), j) {
2772
+ const s = t.attributes;
2499
2773
  switch (o) {
2500
2774
  case "v":
2501
- c = !0;
2775
+ f = !0;
2502
2776
  break;
2503
2777
  case "f":
2504
- switch (h = !0, e.t ?? null) {
2778
+ switch (m = !0, s.t ?? null) {
2505
2779
  case null:
2506
2780
  case "normal": break;
2507
2781
  case "shared":
2508
- const t = e.si;
2509
- d = e.ref, u = t;
2782
+ const t = s.si;
2783
+ x = s.ref, b = t;
2510
2784
  break;
2511
2785
  case "array":
2512
- d = e.ref, k = d;
2786
+ x = s.ref, D = x;
2513
2787
  break;
2514
- case "dataTable": d = e.ref, h = !0;
2788
+ case "dataTable": {
2789
+ const t = ((t, e, s) => {
2790
+ const o = t.r1;
2791
+ if (!o) return null;
2792
+ const r = { ref: t.ref ?? xt.cellToString({
2793
+ rowIndex: e,
2794
+ colIndex: s
2795
+ }) }, n = $s(t.del1);
2796
+ if ($s(t.dt2D)) {
2797
+ r.rowInput = o, n && (r.rowInputDeleted = !0);
2798
+ const e = t.r2;
2799
+ e && (r.columnInput = e, $s(t.del2) && (r.columnInputDeleted = !0));
2800
+ } else $s(t.dtr) ? (r.rowInput = o, n && (r.rowInputDeleted = !0)) : (r.columnInput = o, n && (r.columnInputDeleted = !0));
2801
+ return $s(t.ca) && (r.calculateAlways = !0), r;
2802
+ })(s, L, V);
2803
+ t && (e.dataTables ??= []).push(t);
2804
+ return;
2805
+ }
2515
2806
  }
2516
- const t = e.ca;
2517
- void 0 !== t && (A = "1" === t);
2807
+ const t = s.ca;
2808
+ void 0 !== t && (_ = "1" === t);
2518
2809
  break;
2519
2810
  case "is":
2520
- P = !0;
2811
+ R = !0;
2521
2812
  return;
2522
2813
  }
2523
- P && !h && n?.onOpenTag?.(t);
2814
+ R && !m && n?.onOpenTag?.(t);
2524
2815
  return;
2525
2816
  }
2526
- if (a) {
2817
+ if (c) {
2527
2818
  if ("c" === o) {
2528
- N = t;
2819
+ j = t;
2529
2820
  const e = t.attributes, s = e.r;
2530
- I = z.fastStringToCol(s);
2821
+ V = void 0 !== s ? xt.fastStringToCol(s) : V + 1;
2531
2822
  const o = e.t;
2532
- void 0 === o ? _ = null : (_ = o, "str" === _ && (P = !0));
2823
+ void 0 === o ? B = null : (B = o, "str" === B && (R = !0));
2533
2824
  let r = e.s;
2534
- void 0 === r && (null !== ct || at) && (r = "0"), void 0 !== r && (r = parseInt(r), rt && rt.value === r && rt.colEnd + 1 === I ? rt.colEnd = I : (rt = {
2535
- colStart: I,
2536
- rowStart: O,
2537
- colEnd: I,
2538
- rowEnd: O,
2825
+ void 0 === r && (null !== ut || ht) && (r = "0"), void 0 !== r && (r = parseInt(r), at && at.value === r && at.colEnd + 1 === V ? at.colEnd = V : (at = {
2826
+ colStart: V,
2827
+ rowStart: L,
2828
+ colEnd: V,
2829
+ rowEnd: L,
2539
2830
  value: r
2540
- }, l.push(rt))), k = null, C = !1;
2831
+ }, g.push(at))), D = null, O = !1;
2541
2832
  const n = e.cm;
2542
- S = void 0 !== n && ((t) => {
2833
+ P = void 0 !== n && ((t) => {
2543
2834
  const e = (i?.get("metadata"))?.cells;
2544
2835
  if (!e) return !1;
2545
2836
  const s = parseInt(t, 10);
@@ -2547,79 +2838,127 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2547
2838
  })(n);
2548
2839
  const a = e.vm;
2549
2840
  if (void 0 !== a) {
2550
- const t = x[parseInt(a) - 1];
2551
- if (U.isError(t)) {
2841
+ const t = N(a);
2842
+ if (wt.isError(t)) {
2552
2843
  const e = t.getCode();
2553
- D = {
2844
+ M = {
2554
2845
  t: "e",
2555
2846
  v: e
2556
- }, S && e === U.Code.Spill && (C = !0);
2847
+ }, P && e === wt.Code.Spill && (O = !0);
2557
2848
  }
2558
2849
  }
2559
2850
  }
2560
2851
  } else {
2561
- if (it && "row" === o) {
2562
- a = !0;
2852
+ if (ct && "row" === o) {
2853
+ c = !0;
2563
2854
  const e = t.attributes.r;
2564
- if (O = parseInt(e) - 1, R = 0, M = t.attributes.customHeight, void 0 !== M && (R |= Xe.CustomHeight), M !== J && (ot = !0, J = M), j = t.attributes.ht, void 0 !== j && (R |= Xe.Ht), j !== K && (ot = !0, K = j), B = t.attributes.hidden, void 0 !== B && (R |= Xe.Hidden), B !== Z && (ot = !0, Z = B), F = t.attributes.s, void 0 !== F && (R |= Xe.S), F !== tt && (ot = !0, tt = F), H = t.attributes.customFormat, void 0 !== H && (R |= Xe.CustomFormat), H !== Q && (ot = !0, Q = H), W = t.attributes.outlineLevel, void 0 !== W && (R |= Xe.OutlineLevel), W !== et && (ot = !0, et = W), G = t.attributes.collapsed, void 0 !== G && (R |= Xe.Collapsed), G !== st && (ot = !0, st = G), 0 !== R) if (V + 1 !== O || ot) {
2565
- const t = void 0 !== M && ("1" === M || "true" === M), e = void 0 !== H && ("1" === H || "true" === H);
2566
- ct = e && void 0 !== F ? F : null, e && null === ct && (ct = "0"), $ = {
2567
- min: O,
2568
- max: O,
2855
+ if (L = void 0 !== e ? parseInt(e) - 1 : L + 1, V = -1, l?.()) {
2856
+ const t = h[h.length - 1];
2857
+ t && t.max + 1 === L ? t.max = L : h.push({
2858
+ min: L,
2859
+ max: L
2860
+ });
2861
+ }
2862
+ if (z = 0, q = t.attributes.customHeight, void 0 !== q && (z |= Os.CustomHeight), q !== tt && (it = !0, tt = q), X = t.attributes.ht, void 0 !== X && (z |= Os.Ht), X !== Y && (it = !0, Y = X), U = t.attributes.hidden, void 0 !== U && (z |= Os.Hidden), U !== et && (it = !0, et = U), Z = t.attributes.s, void 0 !== Z && (z |= Os.S), Z !== ot && (it = !0, ot = Z), G = t.attributes.customFormat, void 0 !== G && (z |= Os.CustomFormat), G !== st && (it = !0, st = G), J = t.attributes.outlineLevel, void 0 !== J && (z |= Os.OutlineLevel), J !== rt && (it = !0, rt = J), Q = t.attributes.collapsed, void 0 !== Q && (z |= Os.Collapsed), Q !== nt && (it = !0, nt = Q), 0 !== z) if (W + 1 !== L || it) {
2863
+ const t = void 0 !== q && ("1" === q || "true" === q), e = void 0 !== G && ("1" === G || "true" === G);
2864
+ ut = e && void 0 !== Z ? Z : null, e && null === ut && (ut = "0"), F = {
2865
+ min: L,
2866
+ max: L,
2569
2867
  value: {
2570
- sz: void 0 === j ? -1 : parseFloat(j),
2868
+ sz: void 0 === X ? -1 : parseFloat(X),
2571
2869
  csz: t,
2572
- h: void 0 !== B && ("1" === B || "true" === B),
2573
- s: null === ct ? void 0 : "0" === ct ? 0 : parseInt(ct),
2574
- l: void 0 === W || "0" === W ? 0 : parseInt(W),
2575
- cl: void 0 !== G && ("1" === G || "true" === G)
2870
+ h: void 0 !== U && ("1" === U || "true" === U),
2871
+ s: null === ut ? void 0 : "0" === ut ? 0 : parseInt(ut),
2872
+ l: void 0 === J || "0" === J ? 0 : parseInt(J),
2873
+ cl: void 0 !== Q && ("1" === Q || "true" === Q)
2576
2874
  }
2577
- }, L.push($);
2578
- } else $.max = O;
2579
- V = O, ot = !1;
2875
+ }, H.push(F);
2876
+ } else F.max = L;
2877
+ W = L, it = !1;
2580
2878
  return;
2581
2879
  }
2582
- if ("sheetData" === o && (it = !0), !nt && "sheetData" === o) {
2583
- nt = !0;
2880
+ if ("sheetData" === o && (ct = !0), !lt && "sheetData" === o) {
2881
+ lt = !0;
2584
2882
  const t = e.cols, s = t ? t.length : 0;
2585
- for (let e = 0; !at && e < s; e++) t[e].v.s && (at = !0);
2883
+ for (let e = 0; !ht && e < s; e++) t[e].v.s && (ht = !0);
2586
2884
  }
2587
2885
  s?.onOpenTag?.(t);
2588
2886
  }
2589
- }, ut = (e) => {
2887
+ }, ft = (e) => {
2590
2888
  let o = e.name;
2591
- if ("sheetData" === o && (it = !1), !h || "c" !== o && "f" !== o || (u && (f = T.get(u) ?? null), f && (v.append(O, I, f), A && E.append(O, I)), null !== k && w.push([k, S ? C ? "error" : "dynamic" : "fixed"]), h = !1, f = null, u = null, d = null, c = !1, A = !1, k = null, S = !1, C = !1), N) {
2889
+ if ("sheetData" === o && (ct = !1), !m || "c" !== o && "f" !== o || (b && (y = E.get(b) ?? null), y && (A.append(L, V, y), _ && $.append(L, V)), null !== D && I.push([D, P ? O ? "error" : "dynamic" : "fixed"]), m = !1, y = null, b = null, x = null, f = !1, _ = !1, D = null, P = !1, O = !1), j) {
2592
2890
  const s = o.indexOf(":");
2593
- if (-1 !== s && (o = o.slice(s + 1)), P) if ("is" === o || "v" === o) {
2891
+ if (-1 !== s && (o = o.slice(s + 1)), R) if ("is" === o || "v" === o) {
2594
2892
  const e = n?.onEnd?.();
2595
- null != e && t.pushAt(O, I, "" + e);
2893
+ null != e && t.pushAt(L, V, "number" == typeof e ? "" + e : e);
2596
2894
  } else "f" !== o && n?.onCloseTag?.(e);
2597
- c && (c = !1), "c" === o && (N = null, P = !1);
2895
+ f && (f = !1), "c" === o && (j = null, R = !1);
2598
2896
  return;
2599
2897
  }
2600
- if (a) return a = !1, void (rt = null);
2898
+ if (c) return c = !1, void (at = null);
2601
2899
  s?.onCloseTag?.(e);
2602
- }, dt = (r) => {
2603
- const i = r.trim();
2604
- if (c) {
2605
- switch (D = null, _) {
2900
+ }, gt = (r) => {
2901
+ const l = r.trim();
2902
+ if (f) {
2903
+ switch (M = null, B) {
2606
2904
  case null:
2607
2905
  case "n":
2608
- D = parseFloat(i);
2906
+ M = parseFloat(l);
2609
2907
  break;
2610
2908
  case "b":
2611
- D = "1" === i || "true" === i;
2909
+ M = "1" === l || "true" === l;
2910
+ break;
2911
+ case "s": {
2912
+ const t = parseInt(l, 10);
2913
+ let e = p.get(t);
2914
+ if (void 0 === e) {
2915
+ const s = u?.get(t);
2916
+ e = s ? ws(s, d) : null, p.set(t, e);
2917
+ }
2918
+ M = e ? {
2919
+ t: "r",
2920
+ v: {
2921
+ type: "richText",
2922
+ data: { runs: e }
2923
+ }
2924
+ } : l;
2612
2925
  break;
2613
- case "s":
2614
- D = i;
2926
+ }
2927
+ case "d": {
2928
+ const t = ((t, e = !1) => {
2929
+ if (!t) return null;
2930
+ const s = ms.exec(t);
2931
+ if (s) {
2932
+ const [, t, e, o] = s;
2933
+ return void 0 === t && void 0 === e && void 0 === o ? null : (3600 * parseFloat(t ?? "0") + 60 * parseFloat(e ?? "0") + parseFloat(o ?? "0")) / 86400;
2934
+ }
2935
+ const o = gs.exec(t);
2936
+ if (!o) return null;
2937
+ const [, r, n, i, a, l, c, h] = o;
2938
+ if (void 0 === r && void 0 === a) return null;
2939
+ let u = 0;
2940
+ if (void 0 !== r) {
2941
+ const t = parseInt(r, 10), s = parseInt(n, 10), o = parseInt(i, 10);
2942
+ if (s < 1 || s > 12 || o < 1 || o > 31) return null;
2943
+ const a = bs(t, s, o) - xs;
2944
+ if (u = a <= 60 ? a - 1 : a, e && (u -= 1462), u < 0) return null;
2945
+ }
2946
+ void 0 !== a && (u += (3600 * parseInt(a, 10) + 60 * parseInt(l, 10) + (void 0 !== c ? parseInt(c, 10) : 0) + (void 0 !== h ? parseFloat(h) : 0)) / 86400);
2947
+ return u;
2948
+ })(l, !0 === i?.get(As));
2949
+ null !== t ? M = t : a && (o?.(`Date '${l}' in cell ${xt.cellToString({
2950
+ colIndex: V,
2951
+ rowIndex: L
2952
+ })} is not a date this workbook can hold; kept as text.`, void 0, "xlsx.cell.isoDateText"), M = "" + a(l));
2615
2953
  break;
2954
+ }
2616
2955
  case "e":
2617
- if ("#VALUE!" === i) {
2618
- const t = N.attributes.vm;
2956
+ if ("#VALUE!" === l) {
2957
+ const t = j.attributes.vm;
2619
2958
  if (void 0 !== t) {
2620
- const e = x[parseInt(t) - 1];
2621
- if (U.isError(e)) {
2622
- D = {
2959
+ const e = N(t);
2960
+ if (wt.isError(e)) {
2961
+ M = {
2623
2962
  t: "e",
2624
2963
  v: e.getCode()
2625
2964
  };
@@ -2627,90 +2966,90 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2627
2966
  }
2628
2967
  }
2629
2968
  }
2630
- const t = U.getBuiltInByLabel(i);
2631
- t ? D = {
2969
+ const t = wt.getBuiltInByLabel(l);
2970
+ t ? M = {
2632
2971
  t: "e",
2633
2972
  v: t.getCode()
2634
- } : (D = i, o?.(`Unknown formula error '${i}' in cell ${z.cellToString({
2635
- colIndex: I,
2636
- rowIndex: O
2973
+ } : (M = l, o?.(`Unknown formula error '${l}' in cell ${xt.cellToString({
2974
+ colIndex: V,
2975
+ rowIndex: L
2637
2976
  })}`));
2638
2977
  break;
2639
2978
  case "str":
2640
- case "inlineStr": P = !0;
2979
+ case "inlineStr": R = !0;
2641
2980
  }
2642
- null !== D && t.pushAt(O, I, D);
2981
+ null !== M && t.pushAt(L, V, M);
2643
2982
  }
2644
- if (u) {
2645
- if (g === u) f = m;
2983
+ if (b) {
2984
+ if (w === b) y = T;
2646
2985
  else {
2647
- if (f = T.get(u) ?? null, !f) {
2986
+ if (y = E.get(b) ?? null, !y) {
2648
2987
  const t = [];
2649
- p = b(i, O, I, t), f = [
2650
- p,
2988
+ v = k(l, L, V, t), y = [
2989
+ v,
2651
2990
  t,
2652
- i
2653
- ], T.set(u, f);
2991
+ l
2992
+ ], E.set(b, y);
2654
2993
  }
2655
- g = u, m = f;
2994
+ w = b, T = y;
2656
2995
  }
2657
- u = null;
2996
+ b = null;
2658
2997
  }
2659
- if (h) {
2660
- if (null !== y) {
2998
+ if (m) {
2999
+ if (null !== C) {
2661
3000
  const t = ((t) => {
2662
- if (t.length < $e.length) return je;
2663
- if (t.slice(0, $e.length).toUpperCase() !== Ve) return je;
2664
- const e = Be(t, $e.length);
2665
- if (null === e) return je;
2666
- if (41 !== t.charCodeAt(e.end)) return je;
2667
- if (44 !== t.charCodeAt(e.end + 1)) return je;
2668
- if (41 !== t.charCodeAt(t.length - 1)) return je;
3001
+ if (t.length < os.length) return is;
3002
+ if (t.slice(0, os.length).toUpperCase() !== rs) return is;
3003
+ const e = ls(t, os.length);
3004
+ if (null === e) return is;
3005
+ if (41 !== t.charCodeAt(e.end)) return is;
3006
+ if (44 !== t.charCodeAt(e.end + 1)) return is;
3007
+ if (41 !== t.charCodeAt(t.length - 1)) return is;
2669
3008
  const s = e.value;
2670
- return s.toUpperCase() === Re ? Me : 0 === s.length ? je : {
3009
+ return s.toUpperCase() === ns ? as : 0 === s.length ? is : {
2671
3010
  kind: "formula",
2672
3011
  formula: s
2673
3012
  };
2674
- })(i);
2675
- "none" !== t.kind && y.push({
3013
+ })(l);
3014
+ "none" !== t.kind && C.push({
2676
3015
  sheet: e,
2677
- rowIndex: O,
2678
- colIndex: I,
3016
+ rowIndex: L,
3017
+ colIndex: V,
2679
3018
  formula: "formula" === t.kind ? t.formula : null
2680
3019
  });
2681
3020
  }
2682
3021
  const t = [];
2683
- p = b(i, O, I, t), f = [
2684
- p,
3022
+ v = k(l, L, V, t), y = [
3023
+ v,
2685
3024
  t,
2686
- i
3025
+ l
2687
3026
  ];
2688
3027
  }
2689
- P ? n?.onText?.(r) : a || s?.onText?.(i);
2690
- }, pt = {
3028
+ R ? n?.onText?.(r) : c || s?.onText?.(l);
3029
+ }, mt = {
2691
3030
  r: void 0,
2692
3031
  t: void 0,
2693
3032
  s: void 0,
2694
3033
  cm: void 0,
2695
3034
  vm: void 0
2696
- }, ft = {
3035
+ }, bt = {
2697
3036
  name: "c",
2698
- attributes: pt,
3037
+ attributes: mt,
2699
3038
  isSelfClosing: !1
2700
- }, gt = {
3039
+ }, Tt = {
2701
3040
  t: void 0,
2702
3041
  si: void 0,
2703
3042
  ref: void 0,
2704
3043
  ca: void 0
2705
- }, mt = {
3044
+ }, St = {
2706
3045
  name: "f",
2707
- attributes: gt,
3046
+ attributes: Tt,
2708
3047
  isSelfClosing: !1
2709
- }, xt = {
3048
+ }, Ct = {
2710
3049
  name: "v",
2711
3050
  attributes: {},
2712
3051
  isSelfClosing: !1
2713
- }, yt = {
3052
+ }, kt = {
2714
3053
  r: void 0,
2715
3054
  s: void 0,
2716
3055
  ht: void 0,
@@ -2719,187 +3058,395 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2719
3058
  customHeight: void 0,
2720
3059
  customFormat: void 0,
2721
3060
  outlineLevel: void 0
2722
- }, bt = {
3061
+ }, At = {
2723
3062
  name: "row",
2724
- attributes: yt,
3063
+ attributes: kt,
2725
3064
  isSelfClosing: !1
2726
- }, vt = Ee.NEED_MORE, Tt = Ee.NOT_HANDLED, wt = Ee.decodeText;
2727
- let St = !1;
2728
- const Ct = (t, e, s, o) => {
3065
+ }, Et = Ze.NEED_MORE, Pt = Ze.NOT_HANDLED, Ot = Ze.decodeText;
3066
+ let Dt = !1;
3067
+ const Nt = (t, e, s, o) => {
2729
3068
  for (;;) {
2730
3069
  let r = 0;
2731
3070
  for (; e < s && (32 === (r = t.charCodeAt(e)) || 9 === r || 10 === r || 13 === r);) e++;
2732
- if (e >= s) return vt;
2733
- if (62 === r) return St = !1, e + 1;
2734
- if (47 === r) return e + 1 >= s ? vt : 62 !== t.charCodeAt(e + 1) ? Tt : (St = !0, e + 2);
3071
+ if (e >= s) return Et;
3072
+ if (62 === r) return Dt = !1, e + 1;
3073
+ if (47 === r) return e + 1 >= s ? Et : 62 !== t.charCodeAt(e + 1) ? Pt : (Dt = !0, e + 2);
2735
3074
  const n = e;
2736
3075
  for (; e < s && 61 !== (r = t.charCodeAt(e));) {
2737
- if (62 === r || 47 === r || 32 === r || 9 === r || 10 === r || 13 === r) return Tt;
3076
+ if (62 === r || 47 === r || 32 === r || 9 === r || 10 === r || 13 === r) return Pt;
2738
3077
  e++;
2739
3078
  }
2740
- if (e + 1 >= s) return vt;
3079
+ if (e + 1 >= s) return Et;
2741
3080
  const i = e - n, a = t.charCodeAt(e + 1);
2742
- if (34 !== a && 39 !== a) return Tt;
2743
- const c = e + 2;
2744
- let l = c;
2745
- for (; l < s && (r = t.charCodeAt(l)) !== a;) {
2746
- if (38 === r || r < 32) return Tt;
2747
- l++;
2748
- }
2749
- if (l >= s) return vt;
2750
- e = l + 1;
3081
+ if (34 !== a && 39 !== a) return Pt;
3082
+ const l = e + 2;
3083
+ let c = l;
3084
+ for (; c < s && (r = t.charCodeAt(c)) !== a;) {
3085
+ if (38 === r || r < 32) return Pt;
3086
+ c++;
3087
+ }
3088
+ if (c >= s) return Et;
3089
+ e = c + 1;
2751
3090
  const h = t.charCodeAt(n);
2752
3091
  if (2 === o) switch (i) {
2753
3092
  case 1:
2754
- 114 === h ? yt.r = t.slice(c, l) : 115 === h && (yt.s = t.slice(c, l));
3093
+ 114 === h ? kt.r = t.slice(l, c) : 115 === h && (kt.s = t.slice(l, c));
2755
3094
  break;
2756
3095
  case 2:
2757
- t.startsWith("ht", n) && (yt.ht = t.slice(c, l));
3096
+ t.startsWith("ht", n) && (kt.ht = t.slice(l, c));
2758
3097
  break;
2759
3098
  case 6:
2760
- t.startsWith("hidden", n) && (yt.hidden = t.slice(c, l));
3099
+ t.startsWith("hidden", n) && (kt.hidden = t.slice(l, c));
2761
3100
  break;
2762
3101
  case 9:
2763
- t.startsWith("collapsed", n) && (yt.collapsed = t.slice(c, l));
3102
+ t.startsWith("collapsed", n) && (kt.collapsed = t.slice(l, c));
2764
3103
  break;
2765
- case 12: t.startsWith("customHeight", n) ? yt.customHeight = t.slice(c, l) : t.startsWith("customFormat", n) ? yt.customFormat = t.slice(c, l) : t.startsWith("outlineLevel", n) && (yt.outlineLevel = t.slice(c, l));
3104
+ case 12: t.startsWith("customHeight", n) ? kt.customHeight = t.slice(l, c) : t.startsWith("customFormat", n) ? kt.customFormat = t.slice(l, c) : t.startsWith("outlineLevel", n) && (kt.outlineLevel = t.slice(l, c));
2766
3105
  }
2767
- else if (0 === o) 1 === i ? 114 === h ? pt.r = t.slice(c, l) : 116 === h ? pt.t = t.slice(c, l) : 115 === h && (pt.s = t.slice(c, l)) : 2 === i && 109 === t.charCodeAt(n + 1) && (99 === h ? pt.cm = t.slice(c, l) : 118 === h && (pt.vm = t.slice(c, l)));
2768
- else if (1 === i) 116 === h && (gt.t = t.slice(c, l));
3106
+ else if (0 === o) 1 === i ? 114 === h ? mt.r = t.slice(l, c) : 116 === h ? mt.t = t.slice(l, c) : 115 === h && (mt.s = t.slice(l, c)) : 2 === i && 109 === t.charCodeAt(n + 1) && (99 === h ? mt.cm = t.slice(l, c) : 118 === h && (mt.vm = t.slice(l, c)));
3107
+ else if (1 === i) 116 === h && (Tt.t = t.slice(l, c));
2769
3108
  else if (2 === i) {
2770
3109
  const e = t.charCodeAt(n + 1);
2771
- 115 === h && 105 === e ? gt.si = t.slice(c, l) : 99 === h && 97 === e && (gt.ca = t.slice(c, l));
2772
- } else 3 === i && t.startsWith("ref", n) && (gt.ref = t.slice(c, l));
3110
+ 115 === h && 105 === e ? Tt.si = t.slice(l, c) : 99 === h && 97 === e && (Tt.ca = t.slice(l, c));
3111
+ } else 3 === i && t.startsWith("ref", n) && (Tt.ref = t.slice(l, c));
2773
3112
  }
2774
- }, kt = (t, e, s) => 47 === t.charCodeAt(e + 1) && t.charCodeAt(e + 2) === s && 62 === t.charCodeAt(e + 3);
3113
+ }, _t = (t, e, s) => 47 === t.charCodeAt(e + 1) && t.charCodeAt(e + 2) === s && 62 === t.charCodeAt(e + 3);
2775
3114
  return {
2776
3115
  ...s,
2777
3116
  onEnd: () => {
2778
- L.length > 0 && (e.rows = z.runsToRefs(L, !1));
2779
- let o = v.done(qe);
3117
+ if (l?.()) {
3118
+ let t = 0;
3119
+ const e = [], s = (t, e) => ({
3120
+ min: t,
3121
+ max: e,
3122
+ value: {
3123
+ sz: -1,
3124
+ csz: !1,
3125
+ h: !0,
3126
+ s: void 0,
3127
+ l: 0,
3128
+ cl: !1
3129
+ }
3130
+ });
3131
+ for (const o of h) o.min > t && e.push(s(t, o.min - 1)), t = Math.max(t, o.max + 1);
3132
+ t <= K && e.push(s(t, K)), e.length > 0 && (H.push(...e), H.sort((t, e) => t.min - e.min));
3133
+ }
3134
+ H.length > 0 && (e.rows = xt.runsToRefs(H, !1));
3135
+ let o = A.done(Ds);
3136
+ o = ((t, e) => {
3137
+ let s = null;
3138
+ for (let e = 0; e < t.length; e++) {
3139
+ const o = t[e];
3140
+ if (!Ns.test(o.value[2])) continue;
3141
+ s ??= /* @__PURE__ */ new Map();
3142
+ const r = o.value[0], n = s.get(r);
3143
+ n ? n.push(o) : s.set(r, [o]);
3144
+ }
3145
+ if (null === s) return t;
3146
+ const o = /* @__PURE__ */ new Set();
3147
+ for (const t of s.values()) {
3148
+ const s = t[0], r = {
3149
+ rowStart: s.rowStart,
3150
+ colStart: s.colStart,
3151
+ rowEnd: s.rowEnd,
3152
+ colEnd: s.colEnd
3153
+ };
3154
+ let n = 0;
3155
+ for (let e = 0; e < t.length; e++) {
3156
+ const s = t[e];
3157
+ s.rowStart < r.rowStart && (r.rowStart = s.rowStart), s.colStart < r.colStart && (r.colStart = s.colStart), s.rowEnd > r.rowEnd && (r.rowEnd = s.rowEnd), s.colEnd > r.colEnd && (r.colEnd = s.colEnd), n += (s.rowEnd - s.rowStart + 1) * (s.colEnd - s.colStart + 1);
3158
+ }
3159
+ if (n !== (r.rowEnd - r.rowStart + 1) * (r.colEnd - r.colStart + 1)) continue;
3160
+ const a = fs(xt.resolveRelativeToA1(s.value[1], r.rowStart, r.colStart), r);
3161
+ if (a) {
3162
+ (e.dataTables ??= []).push(a);
3163
+ for (let e = 0; e < t.length; e++) o.add(t[e]);
3164
+ }
3165
+ }
3166
+ return 0 === o.size ? t : t.filter((t) => !o.has(t));
3167
+ })(o, e);
2780
3168
  const r = o.length;
2781
3169
  if (r > 0) {
2782
3170
  const t = new Array(r);
2783
3171
  for (let e = 0; e < r; e++) {
2784
- const s = o[e], r = z.rangeToString(s), n = s.value[1], i = z.resolveRelativeToA1(n, s.rowStart, s.colStart);
3172
+ const s = o[e], r = xt.rangeToString(s), n = s.value[1], i = xt.resolveRelativeToA1(n, s.rowStart, s.colStart);
2785
3173
  t[e] = [r, i];
2786
3174
  }
2787
3175
  e.formulas = t;
2788
3176
  }
2789
- const n = E.done(!0), i = n.length;
3177
+ const n = $.done(!0), i = n.length;
2790
3178
  if (i > 0) {
2791
3179
  const t = new Array(i);
2792
3180
  for (let e = 0; e < i; e++) {
2793
- const s = n[e], o = z.rangeToString(s);
3181
+ const s = n[e], o = xt.rangeToString(s);
2794
3182
  t[e] = o;
2795
3183
  }
2796
3184
  e.volatile = t;
2797
3185
  }
2798
- w.length > 0 && (e.formulaArray = [...w]);
2799
- const a = l.length;
3186
+ I.length > 0 && (e.formulaArray = [...I]);
3187
+ const a = g.length;
2800
3188
  if (a > 0) {
2801
- l.sort(q.createRangeComparator(Y.Axis.Column));
2802
- let t = l[0], s = t.colStart, o = t.colEnd, r = t.rowEnd, n = t.value;
3189
+ g.sort(yt.createRangeComparator(It.Axis.Column));
3190
+ let t = g[0], s = t.colStart, o = t.colEnd, r = t.rowEnd, n = t.value;
2803
3191
  const i = [];
2804
3192
  i.push(t);
2805
- let c = null;
2806
- for (let e = 1; e < a; e++) c = l[e], n !== c.value || s !== c.colStart || o !== c.colEnd || r + 1 !== c.rowEnd ? (i.push(c), t = c, s = t.colStart, o = t.colEnd, r = t.rowEnd, n = t.value) : (r = c.rowEnd, t.rowEnd = r);
2807
- const h = i.length, u = new Array(h);
2808
- for (let t = 0; t < h; t++) {
2809
- const e = i[t], s = z.rangeToString(e);
2810
- u[t] = [s, e.value];
3193
+ let l = null;
3194
+ for (let e = 1; e < a; e++) l = g[e], n !== l.value || s !== l.colStart || o !== l.colEnd || r + 1 !== l.rowEnd ? (i.push(l), t = l, s = t.colStart, o = t.colEnd, r = t.rowEnd, n = t.value) : (r = l.rowEnd, t.rowEnd = r);
3195
+ const c = i.length, h = new Array(c);
3196
+ for (let t = 0; t < c; t++) {
3197
+ const e = i[t], s = xt.rangeToString(e);
3198
+ h[t] = [s, e.value];
2811
3199
  }
2812
- e.directStyles = u;
3200
+ e.directStyles = h;
2813
3201
  }
2814
3202
  const c = t.build();
2815
3203
  c && (e.data = c.tuples), s?.onEnd?.();
2816
3204
  },
2817
- onOpenTag: ht,
2818
- onCloseTag: ut,
2819
- onText: dt,
3205
+ onOpenTag: pt,
3206
+ onCloseTag: ft,
3207
+ onText: gt,
2820
3208
  elementScanners: [{
2821
3209
  name: "c",
2822
3210
  scan: (t, e, s) => {
2823
- if (!a || null !== N) return Tt;
2824
- pt.r = pt.t = pt.s = pt.cm = pt.vm = void 0;
2825
- let o = Ct(t, e + 2, s, 0);
3211
+ if (!c || null !== j) return Pt;
3212
+ mt.r = mt.t = mt.s = mt.cm = mt.vm = void 0;
3213
+ let o = Nt(t, e + 2, s, 0);
2826
3214
  if (o < 0) return o;
2827
- const r = pt.t;
2828
- if (void 0 === pt.r || "str" === r || "inlineStr" === r) return Tt;
2829
- let n = !1, i = -1, c = -1, l = -1, h = -1, u = o;
2830
- if (!St) for (gt.t = gt.si = gt.ref = gt.ca = void 0;;) {
3215
+ const r = mt.t;
3216
+ if (void 0 === mt.r || "str" === r || "inlineStr" === r) return Pt;
3217
+ let n = !1, i = -1, a = -1, l = -1, h = -1, u = o;
3218
+ if (!Dt) for (Tt.t = Tt.si = Tt.ref = Tt.ca = void 0;;) {
2831
3219
  const e = t.indexOf("<", o);
2832
- if (-1 === e || e + 3 >= s) return vt;
3220
+ if (-1 === e || e + 3 >= s) return Et;
2833
3221
  for (let s = o; s < e; s++) {
2834
3222
  const e = t.charCodeAt(s);
2835
- if (32 !== e && 9 !== e && 10 !== e && 13 !== e) return Tt;
3223
+ if (32 !== e && 9 !== e && 10 !== e && 13 !== e) return Pt;
2836
3224
  }
2837
- const r = t.charCodeAt(e + 1), a = t.charCodeAt(e + 2);
3225
+ const r = t.charCodeAt(e + 1), c = t.charCodeAt(e + 2);
2838
3226
  if (47 === r) {
2839
- if (!kt(t, e, 99)) return Tt;
3227
+ if (!_t(t, e, 99)) return Pt;
2840
3228
  u = e + 4;
2841
3229
  break;
2842
3230
  }
2843
- if (102 === r && !n && -1 === l && (32 === a || 62 === a || 47 === a)) {
2844
- if (n = !0, o = Ct(t, e + 2, s, 1), o < 0) return o;
2845
- if (St) continue;
3231
+ if (102 === r && !n && -1 === l && (32 === c || 62 === c || 47 === c)) {
3232
+ if (n = !0, o = Nt(t, e + 2, s, 1), o < 0) return o;
3233
+ if ("dataTable" === Tt.t) return Pt;
3234
+ if (Dt) continue;
2846
3235
  const r = t.indexOf("<", o);
2847
- if (-1 === r || r + 3 >= s) return vt;
2848
- if (!kt(t, r, 102)) return Tt;
2849
- i = o, c = r, o = r + 4;
3236
+ if (-1 === r || r + 3 >= s) return Et;
3237
+ if (!_t(t, r, 102)) return Pt;
3238
+ i = o, a = r, o = r + 4;
2850
3239
  continue;
2851
3240
  }
2852
- if (118 === r && 62 === a && -1 === l) {
3241
+ if (118 === r && 62 === c && -1 === l) {
2853
3242
  const r = t.indexOf("<", e + 3);
2854
- if (-1 === r || r + 3 >= s) return vt;
2855
- if (!kt(t, r, 118)) return Tt;
3243
+ if (-1 === r || r + 3 >= s) return Et;
3244
+ if (!_t(t, r, 118)) return Pt;
2856
3245
  l = e + 3, h = r, o = r + 4;
2857
3246
  continue;
2858
3247
  }
2859
- return Tt;
3248
+ return Pt;
2860
3249
  }
2861
- return ht(ft), n && (ht(mt), c > i && dt(wt(t.slice(i, c))), ut(mt)), -1 !== l && (ht(xt), h > l && dt(wt(t.slice(l, h))), ut(xt)), ut(ft), u;
3250
+ return pt(bt), n && (pt(St), a > i && gt(Ot(t.slice(i, a))), ft(St)), -1 !== l && (pt(Ct), h > l && gt(Ot(t.slice(l, h))), ft(Ct)), ft(bt), u;
2862
3251
  }
2863
3252
  }, {
2864
3253
  name: "row",
2865
- openTag: bt,
3254
+ openTag: At,
2866
3255
  scan: (t, e, s) => {
2867
- if (!it || a || null !== N) return Tt;
2868
- yt.r = yt.s = yt.ht = yt.hidden = yt.collapsed = yt.customHeight = yt.customFormat = yt.outlineLevel = void 0;
2869
- const o = Ct(t, e + 4, s, 2);
2870
- return o < 0 ? o : St || void 0 === yt.r ? Tt : (ht(bt), o);
3256
+ if (!ct || c || null !== j) return Pt;
3257
+ kt.r = kt.s = kt.ht = kt.hidden = kt.collapsed = kt.customHeight = kt.customFormat = kt.outlineLevel = void 0;
3258
+ const o = Nt(t, e + 4, s, 2);
3259
+ return o < 0 ? o : Dt || void 0 === kt.r ? Pt : (pt(At), o);
2871
3260
  }
2872
3261
  }]
2873
3262
  };
2874
- }, Ke = "hiddenXfs", Je = (t) => (Array.isArray(t) ? t[1] : t?.v)?.s, Ze = (t) => {
3263
+ }, Ls = /* @__PURE__ */ new Map([
3264
+ ["urn:schemas-microsoft-com:vml", "v"],
3265
+ ["urn:schemas-microsoft-com:office:office", "o"],
3266
+ ["urn:schemas-microsoft-com:office:excel", "x"]
3267
+ ]), Vs = [...Ls].map(([t, e]) => ` xmlns:${e}="${t}"`).join(""), Ms = /<(\/?)([A-Za-z_][\w.-]*(?::[\w.-]+)?)((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>/g, js = /(\s+)([A-Za-z_][\w.-]*(?::[\w.-]+)?)(\s*=\s*)("[^"]*"|'[^']*')/g, Bs = /\sxmlns(?::([\w.-]+))?\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
3268
+ function Hs(t) {
3269
+ if (!t || !((t) => {
3270
+ let e;
3271
+ for (Bs.lastIndex = 0; null !== (e = Bs.exec(t));) {
3272
+ const t = Ls.get(e[2] ?? e[3] ?? "");
3273
+ if (t && t !== (e[1] ?? "")) return !0;
3274
+ }
3275
+ return !1;
3276
+ })(t)) return t;
3277
+ const e = [], s = (t, s, o) => {
3278
+ const r = t.indexOf(":");
3279
+ if (-1 === r && o) return null;
3280
+ const n = -1 === r ? "" : t.substring(0, r);
3281
+ if ("xmlns" === n) return null;
3282
+ const i = ((t, s) => {
3283
+ const o = s?.get(t);
3284
+ if (void 0 !== o) return o;
3285
+ for (let s = e.length - 1; s >= 0; s--) {
3286
+ const o = e[s].bindings.get(t);
3287
+ if (void 0 !== o) return o;
3288
+ }
3289
+ })(n, s), a = void 0 !== i ? Ls.get(i) : void 0;
3290
+ return a ? `${a}:${-1 === r ? t : t.substring(r + 1)}` : null;
3291
+ };
3292
+ let o = !1, r = !1;
3293
+ const n = t.replace(Ms, (t, n, i, a, l) => {
3294
+ if (n) {
3295
+ const o = e[e.length - 1], r = s(i, null, !1);
3296
+ return o && o.name === i && (o.nested > 0 ? o.nested-- : e.pop()), r ? `</${r}>` : t;
3297
+ }
3298
+ const c = ((t) => {
3299
+ let e, s = null;
3300
+ for (Bs.lastIndex = 0; null !== (e = Bs.exec(t));) (s ??= /* @__PURE__ */ new Map()).set(e[1] ?? "", e[2] ?? e[3] ?? "");
3301
+ return s;
3302
+ })(a);
3303
+ c?.forEach((t, e) => {
3304
+ const s = [...Ls].find(([, t]) => t === e)?.[0];
3305
+ s && s !== t && (o = !0);
3306
+ });
3307
+ const h = s(i, c, !1);
3308
+ let u = a.replace(js, (t, e, o, r, n) => {
3309
+ if ("xmlns" === o || o.startsWith("xmlns:")) {
3310
+ const e = n.slice(1, -1);
3311
+ return Ls.has(e) ? "" : t;
3312
+ }
3313
+ const i = s(o, c, !0);
3314
+ return i ? `${e}${i}${r}${n}` : t;
3315
+ });
3316
+ if (r || (r = !0, u = u.replace(/\s+$/, "") + Vs), !l) {
3317
+ const t = e[e.length - 1];
3318
+ c ? e.push({
3319
+ name: i,
3320
+ bindings: c,
3321
+ nested: 0
3322
+ }) : t && t.name === i && t.nested++;
3323
+ }
3324
+ return `<${h ?? i}${u}${l}>`;
3325
+ });
3326
+ return o ? t : n;
3327
+ }
3328
+ var Fs = {
3329
+ creator: "author",
3330
+ category: "category",
3331
+ description: "comments",
3332
+ contentStatus: "contentStatus",
3333
+ created: "creationDate",
3334
+ keywords: "keywords",
3335
+ lastModifiedBy: "lastAuthor",
3336
+ modified: "lastModifiedDate",
3337
+ lastPrinted: "lastPrinted",
3338
+ revision: "revisionNumber",
3339
+ subject: "subject",
3340
+ title: "title"
3341
+ }, Ws = {
3342
+ Company: "company",
3343
+ Manager: "manager"
3344
+ }, zs = {
3345
+ lpwstr: At.Type.String,
3346
+ lpstr: At.Type.String,
3347
+ bstr: At.Type.String,
3348
+ i1: At.Type.Number,
3349
+ i2: At.Type.Number,
3350
+ i4: At.Type.Number,
3351
+ i8: At.Type.Number,
3352
+ int: At.Type.Number,
3353
+ ui1: At.Type.Number,
3354
+ ui2: At.Type.Number,
3355
+ ui4: At.Type.Number,
3356
+ ui8: At.Type.Number,
3357
+ uint: At.Type.Number,
3358
+ r4: At.Type.Float,
3359
+ r8: At.Type.Float,
3360
+ decimal: At.Type.Float,
3361
+ bool: At.Type.Boolean,
3362
+ filetime: At.Type.Date,
3363
+ date: At.Type.Date
3364
+ }, Xs = (t) => {
3365
+ const e = t.kind ? zs[t.kind] : void 0;
3366
+ if (!e) return null;
3367
+ const s = t.value.trim();
3368
+ let o;
3369
+ if (e === At.Type.String) o = {
3370
+ key: t.key,
3371
+ type: e,
3372
+ value: t.value
3373
+ };
3374
+ else if (e === At.Type.Boolean) {
3375
+ if ("true" !== s && "false" !== s && "1" !== s && "0" !== s) return null;
3376
+ o = {
3377
+ key: t.key,
3378
+ type: e,
3379
+ value: "true" === s || "1" === s
3380
+ };
3381
+ } else if (e === At.Type.Date) {
3382
+ const r = new Date(s);
3383
+ if (!s || isNaN(r.getTime())) return null;
3384
+ o = {
3385
+ key: t.key,
3386
+ type: e,
3387
+ value: r.toISOString()
3388
+ };
3389
+ } else {
3390
+ const r = Number(s);
3391
+ if (!s || !Number.isFinite(r)) return null;
3392
+ const n = e === At.Type.Number && r >= -2147483648 && r <= 2147483647;
3393
+ o = {
3394
+ key: t.key,
3395
+ type: n ? e : At.Type.Float,
3396
+ value: r
3397
+ };
3398
+ }
3399
+ return t.linkTarget && (o.linkTarget = t.linkTarget), o;
3400
+ }, qs = "hiddenXfs", Us = (t) => (Array.isArray(t) ? t[1] : t?.v)?.s, Gs = (t) => {
2875
3401
  if (!t || 0 === t.length) return !1;
2876
- const e = z.refsToRuns(t, !0);
3402
+ const e = xt.refsToRuns(t, !0);
2877
3403
  let s = 0;
2878
3404
  for (const t of e) {
2879
3405
  if (t.min > s || void 0 === t.value?.s) return !1;
2880
3406
  s = Math.max(s, t.max + 1);
2881
3407
  }
2882
- return s > L;
2883
- }, Qe = (t, e) => {
3408
+ return s > V;
3409
+ }, Zs = (t, e) => {
2884
3410
  t.protection = {
2885
3411
  ...t.protection,
2886
3412
  showFormulas: e
2887
3413
  };
2888
- }, Ye = (t) => {
2889
- const e = t.indexOf(":");
2890
- return -1 === e ? t : t.slice(e + 1);
2891
- }, ts = {
3414
+ }, Ks = (t) => {
3415
+ const e = Array.isArray(t) ? t[1] : t.v;
3416
+ if (!e || !("s" in e)) return;
3417
+ const s = e.s;
3418
+ return delete e.s, s;
3419
+ }, Js = (t, e, s, o) => {
3420
+ if (!t) return;
3421
+ const r = e ? 2 : 1, n = e ? s.rowStart : s.colStart, i = e ? s.rowEnd : s.colEnd;
3422
+ let a, l = -1;
3423
+ for (const s of t) {
3424
+ const t = xt.refToRun(s, e), c = Ks(s);
3425
+ t && void 0 !== c ? c !== l || (e ? a.colEnd : a.rowEnd) + 1 !== t.min ? (a = {
3426
+ colStart: e ? t.min : n,
3427
+ rowStart: e ? n : t.min,
3428
+ colEnd: e ? t.max : i,
3429
+ rowEnd: e ? i : t.max,
3430
+ value: {
3431
+ kind: r,
3432
+ index: c
3433
+ }
3434
+ }, l = c, o.push(a)) : e ? a.colEnd = t.max : a.rowEnd = t.max : l = -1;
3435
+ }
3436
+ }, Qs = {
2892
3437
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
2893
3438
  "application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
2894
3439
  "application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
2895
3440
  "application/vnd.ms-excel.addin.macroEnabled.main+xml": "workbooks",
2896
3441
  "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": "workbooks",
3442
+ "application/vnd.ms-excel.template.macroEnabled.main+xml": "workbooks",
2897
3443
  "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": "sheets",
2898
3444
  "application/vnd.ms-excel.worksheet": "sheets",
2899
3445
  "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": "charts",
2900
3446
  "application/vnd.ms-excel.chartsheet": "charts",
2901
3447
  "application/vnd.ms-excel.macrosheet+xml": "macros",
2902
3448
  "application/vnd.ms-excel.macrosheet": "macros",
3449
+ "application/vnd.ms-excel.intlmacrosheet+xml": "macros",
2903
3450
  "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": "dialogs",
2904
3451
  "application/vnd.ms-excel.dialogsheet": "dialogs",
2905
3452
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml": "strs",
@@ -2918,51 +3465,67 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2918
3465
  "application/vnd.ms-excel.externalLink": "links",
2919
3466
  "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
2920
3467
  "application/vnd.openxmlformats-officedocument.theme+xml": "themes"
2921
- }, es = p({ readXLSX: () => ns }), ss = (t) => t.startsWith("/") ? t.slice(1) : t, os = /^xl\/(worksheets|chartsheets)\/[^/]+\.xml$/i, rs = (t) => "string" == typeof t ? t : (t?.runs ?? []).map((t) => t.text ?? "").join(""), ns = async (e, i) => {
2922
- const { password: a, onVBA: c, profile: l, calcOnLoad: h = "auto", createWorkbookOptions: d = {}, ...p } = i ?? {}, f = !!d.origin && "string" != typeof d.origin, m = l ? new St("function" == typeof l ? l : void 0) : null, x = [], y = (t, e, s) => {
2923
- x.push([
3468
+ }, Ys = v({ readXLSX: () => ro }), to = (t) => t.startsWith("/") ? t.slice(1) : t, eo = [
3469
+ 208,
3470
+ 207,
3471
+ 17,
3472
+ 224,
3473
+ 161,
3474
+ 177,
3475
+ 26,
3476
+ 225
3477
+ ], so = /^xl\/worksheets\/[^/]+\.xml$/i, oo = (t) => "string" == typeof t ? t : (t?.runs ?? []).map((t) => t.text ?? "").join(""), ro = async (s, o) => {
3478
+ const { password: r, onVBA: n, profile: i, calcOnLoad: l = "auto", createWorkbookOptions: h = {}, ...u } = o ?? {};
3479
+ await Tt.load();
3480
+ const d = !!h.origin && "string" != typeof h.origin, p = i ? new Xt("function" == typeof i ? i : void 0) : null, g = [], b = (t, e, s) => {
3481
+ g.push([
2924
3482
  t,
2925
3483
  e ?? "",
2926
3484
  s
2927
3485
  ]);
2928
- }, b = { onWarning: y }, v = i?.progress, T = v?.onProgress ? v.onProgress.bind(v) : void 0, w = e.byteLength;
3486
+ }, x = { onWarning: b }, v = o?.progress, y = v?.onProgress ? v.onProgress.bind(v) : void 0, T = s.byteLength;
2929
3487
  let S = 0, A = 0;
2930
- const E = T ? (t) => {
3488
+ const E = y ? (t) => {
2931
3489
  if (S <= 0) return;
2932
3490
  A += t;
2933
- const e = Math.min(w, Math.round(A / S * w));
2934
- T(e, w);
2935
- } : void 0, P = import("./BpxxiZ2oKPkUSfdB.mjs");
2936
- let I = null;
3491
+ const e = Math.min(T, Math.round(A / S * T));
3492
+ y(e, T);
3493
+ } : void 0, I = import("./Bpqm_PpGLpdjL47-.mjs");
3494
+ let P = null;
2937
3495
  try {
2938
- I = new DOMParser();
3496
+ P = new DOMParser();
2939
3497
  } catch (t) {}
2940
- let N = null;
3498
+ let _ = null;
2941
3499
  try {
2942
- N = new XMLSerializer();
3500
+ _ = new XMLSerializer();
2943
3501
  } catch (t) {}
2944
- let _, L, j, B = null;
2945
- I || (B = import("@xmldom/xmldom"));
3502
+ let R, M, j, B = null;
3503
+ P || (B = import("@xmldom/xmldom"));
2946
3504
  try {
2947
- const [t, e] = await Promise.all([B, P]);
2948
- _ = new e.DOMTransformer(), L = I ?? new t.DOMParser(), j = N ?? new t.XMLSerializer();
3505
+ const [t, e] = await Promise.all([B, I]);
3506
+ R = new e.DOMTransformer(), M = P ?? new t.DOMParser(), j = _ ?? new t.XMLSerializer();
2949
3507
  } catch (t) {
2950
3508
  throw new Error("Unable to load XLSX parser.", { cause: t });
2951
3509
  }
2952
- const X = (t) => j.serializeToString(t);
2953
- let q;
3510
+ const H = (t) => j.serializeToString(t);
3511
+ if (((t) => {
3512
+ if (t.byteLength < eo.length) return !1;
3513
+ const e = new Uint8Array(t, 0, eo.length);
3514
+ return eo.every((t, s) => e[s] === t);
3515
+ })(s)) throw new gt("This is an Excel 97-2003 workbook (.xls), which cannot be read. Save it as '.xlsx' and try again.");
3516
+ let F;
2954
3517
  try {
2955
- q = await wt.create(e);
3518
+ F = await zt.create(s);
2956
3519
  } catch (t) {
2957
- throw new W("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: t });
3520
+ throw new gt("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: t });
2958
3521
  }
2959
- m?.mark("zip-open");
3522
+ p?.mark("zip-open");
2960
3523
  try {
2961
- if (!q.has("[Content_Types].xml")) throw new W("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
2962
- const e = (t) => {
2963
- const e = q.getEntry(t);
3524
+ if (!F.has("[Content_Types].xml")) throw new gt("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
3525
+ const s = (t) => {
3526
+ const e = F.getEntry(t);
2964
3527
  return e ? { content: e } : void 0;
2965
- }, i = {
3528
+ }, o = {
2966
3529
  workbooks: [],
2967
3530
  sheets: [],
2968
3531
  charts: [],
@@ -2995,7 +3558,7 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2995
3558
  const e = o.ContentType, s = o.PartName;
2996
3559
  if (!e || !s) return;
2997
3560
  t.overrides[s.startsWith("/") ? s.slice(1) : s] = e;
2998
- const r = ts[e], n = r ? t[r] : void 0;
3561
+ const r = Qs[e], n = r ? t[r] : void 0;
2999
3562
  Array.isArray(n) && n.push(s);
3000
3563
  } else if ("Default" === s) {
3001
3564
  const e = o.Extension, s = o.ContentType;
@@ -3008,93 +3571,93 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3008
3571
  onError: (t) => {
3009
3572
  e?.(`Error parsing content types: ${t?.message ?? t}`);
3010
3573
  }
3011
- }))(i, (t) => {
3012
- x.push([t, "[Content_Types].xml"]);
3013
- }), e = await q.getTextStream("[Content_Types].xml");
3574
+ }))(o, (t) => {
3575
+ g.push([t, "[Content_Types].xml"]);
3576
+ }), e = await F.getTextStream("[Content_Types].xml");
3014
3577
  if (!e) throw new Error("Error parsing content types: '[Content_Types].xml'");
3015
3578
  try {
3016
- await me.parseStream(e, t, { xmlns: !1 });
3579
+ await Me.parseStream(e, t, { xmlns: !1 });
3017
3580
  } catch (t) {
3018
3581
  throw new Error("Error parsing content types: '[Content_Types].xml'", { cause: t });
3019
3582
  }
3020
- f && await q.getBuffer("[Content_Types].xml");
3021
- }
3022
- m?.mark("content-types");
3023
- const a = i.sst, p = /* @__PURE__ */ new Set();
3024
- for (const t of i.sheets) p.add(ss(t));
3025
- a && p.add(ss(a));
3026
- for (const t of p) S += q.uncompressedSize(t);
3027
- if (await q.prefetch((t) => !p.has(t) && !os.test(t)), m?.mark("prefetch-side-parts"), 0 === i.workbooks.length) {
3028
- const t = gt("_rels/.rels", e, L, _, b), s = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
3583
+ d && await F.getBuffer("[Content_Types].xml");
3584
+ }
3585
+ p?.mark("content-types");
3586
+ const r = o.sst, u = /* @__PURE__ */ new Set();
3587
+ for (const t of o.sheets) u.add(to(t));
3588
+ r && u.add(to(r));
3589
+ for (const t of u) S += F.uncompressedSize(t);
3590
+ if (await F.prefetch((t) => !u.has(t) && !so.test(t)), p?.mark("prefetch-side-parts"), 0 === o.workbooks.length) {
3591
+ const t = G("_rels/.rels", s, M, R, x), e = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
3029
3592
  if (t) {
3030
- for (const e of t.values()) if (e.type === s && e.target) {
3031
- i.workbooks.push(e.target);
3593
+ for (const s of t.values()) if (s.type === e && s.target) {
3594
+ o.workbooks.push(s.target);
3032
3595
  break;
3033
3596
  }
3034
3597
  }
3035
3598
  }
3036
- if (0 === i.workbooks.length) throw new W("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
3037
- i.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], i.richdata = ["/xl/richData/rdrichvalue.xml"];
3038
- const A = d?.resources ?? new st(), P = A.beginPersist(), I = {}, N = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Map();
3599
+ if (0 === o.workbooks.length) throw new gt("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
3600
+ o.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], o.richdata = ["/xl/richData/rdrichvalue.xml"];
3601
+ const A = h?.resources ?? new Dt(), I = A.beginPersist(), P = {}, _ = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Map();
3039
3602
  j.set("richTypes", []), j.set("parseInlineDxf", (t) => {
3040
3603
  if (!t) return;
3041
- const e = L.parseFromString(`<dxf xmlns:x14="${n}" xmlns:xm="${D}">${t}</dxf>`, "text/xml")?.documentElement;
3604
+ const e = M.parseFromString(`<dxf xmlns:x14="${m}" xmlns:xm="${lt}">${t}</dxf>`, "text/xml")?.documentElement;
3042
3605
  if (!e) return;
3043
- const s = _.parseDxf(e, "", b);
3606
+ const s = R.parseDxf(e, "", x);
3044
3607
  return Object.keys(s).length > 0 ? s : void 0;
3045
3608
  });
3046
3609
  const B = [];
3047
3610
  j.set("dummyWrapped", B);
3048
- const U = mt("metadata", i, e, L, _, b).entries().next()?.value?.[1]?.metadata;
3049
- U && j.set("metadata", U), j.set(We, C());
3050
- const J = /* @__PURE__ */ new Map(), Z = [], Q = /* @__PURE__ */ new Set(), Y = (t) => {
3051
- Q.add(ss(t));
3052
- }, tt = (t, s = J) => {
3611
+ const X = z("metadata", o, s, M, R, x).entries().next()?.value?.[1]?.metadata;
3612
+ X && j.set("metadata", X), j.set(ks, t());
3613
+ const U = /* @__PURE__ */ new Map(), Z = [], Y = /* @__PURE__ */ new Set(), et = (t) => {
3614
+ Y.add(to(t));
3615
+ }, ot = (t, e = U) => {
3053
3616
  const o = t.lastIndexOf("/"), r = t.substring(0, o + 1) + "_rels/" + t.substring(o + 1, t.length) + ".rels";
3054
- let n = s.get(r);
3055
- return n || (n = gt(r, e, L, _, wt), s.set(r, n)), n;
3056
- }, rt = (t, s, o, r = J) => {
3057
- let n = tt(s, r).get(t), i = n?.target;
3617
+ let n = e.get(r);
3618
+ return n || (n = G(r, s, M, R, It), e.set(r, n)), n;
3619
+ }, nt = (t, e, o, r = U) => {
3620
+ let n = ot(e, r).get(t), i = n?.target;
3058
3621
  if (!i) return null;
3059
3622
  if ("External" === n.targetMode) {
3060
3623
  if (!o) return n.target;
3061
3624
  const t = A.add({ source: { external: n.target } });
3062
- return t.addReference(I), N.add(t), P.toResourceId(t);
3625
+ return t.addReference(P), _.add(t), I.toResourceId(t);
3063
3626
  }
3064
- const a = s.lastIndexOf("/"), c = s.substring(0, a + 1);
3065
- i.startsWith("/") || (i = c + i), i = xt(i);
3066
- const l = _?.getVisitorParamsState().get("dxfs");
3627
+ const a = e.lastIndexOf("/"), l = e.substring(0, a + 1);
3628
+ i.startsWith("/") || (i = l + i), i = L(i);
3629
+ const c = R?.getVisitorParamsState().get("dxfs");
3067
3630
  let h = r.get(i);
3068
3631
  if (!h) {
3069
- const t = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", s = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink";
3632
+ const t = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", e = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink";
3070
3633
  if (n.type === t) {
3071
3634
  const t = {};
3072
3635
  h = t;
3073
3636
  const e = async () => {
3074
- const e = ze(t, (t, e) => "legacyDrawing" === e ? ct(t, i) : "formControl" === e ? lt(t, i) : "part" === e ? ht(t, i) : rt(t, i, "resource" === e) ?? null, Et, l, () => {}, (t, e, s) => {
3075
- y(t, e ? `${e} (${i})` : i, s);
3076
- }, void 0, j), s = await q.getTextStream(i, E);
3637
+ const e = Ps(t, (t, e) => "legacyDrawing" === e ? ut(t, i) : "formControl" === e ? dt(t, i) : "part" === e ? vt(t, i) : nt(t, i, "resource" === e) ?? null, Mt, c, () => {}, (t, e, s) => {
3638
+ b(t, e ? `${e} (${i})` : i, s);
3639
+ }, void 0, j), s = await F.getTextStream(i, E);
3077
3640
  if (s) try {
3078
- await me.parseStream(s, e, {
3641
+ await Me.parseStream(s, e, {
3079
3642
  xmlns: !1,
3080
3643
  lean: !0
3081
3644
  });
3082
3645
  } catch (t) {
3083
3646
  throw new Error(`Error parsing sheet: '${i}'`, { cause: t });
3084
3647
  }
3085
- const o = tt(i, r);
3648
+ const o = ot(i, r);
3086
3649
  if (o) {
3087
- at(t, i, o, r), $(t), k(t);
3650
+ ct(t, i, o, r), D(t), rt(t);
3088
3651
  const e = [];
3089
3652
  o.forEach((t, s) => {
3090
3653
  if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" !== t.type) return;
3091
- const o = ht(s, i, t.type, (t) => "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" !== t);
3654
+ const o = vt(s, i, t.type, (t) => "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" !== t);
3092
3655
  if (!o?.xml) return;
3093
3656
  const r = /<pivotTableDefinition\b[^>]*>/.exec(o.xml)?.[0] ?? "", n = parseInt(/\scacheId="(\d+)"/.exec(r)?.[1] ?? "", 10);
3094
- if (isNaN(n)) return void x.push([`Pivot table '${o.name}' names no cache and was dropped.`, i]);
3657
+ if (isNaN(n)) return void g.push([`Pivot table '${o.name}' names no cache and was dropped.`, i]);
3095
3658
  const a = /\sname="([^"]*)"/.exec(r)?.[1];
3096
3659
  e.push({
3097
- ...a ? { name: u(a) } : {},
3660
+ ...a ? { name: Q(a) } : {},
3098
3661
  cacheId: n,
3099
3662
  part: o
3100
3663
  });
@@ -3102,13 +3665,13 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3102
3665
  }
3103
3666
  };
3104
3667
  Z.push(e());
3105
- } else if (n.type === s) {
3106
- const t = ft(i, e, L, _, wt);
3668
+ } else if (n.type === e) {
3669
+ const t = O(i, s, M, R, It);
3107
3670
  if (t && 0 !== Object.keys(t).length) {
3108
3671
  const e = t, s = e.__bookRelId, o = e.__absoluteUrlRelId;
3109
3672
  delete e.__bookRelId, delete e.__absoluteUrlRelId;
3110
3673
  const n = [];
3111
- tt(i, r)?.forEach((t, e) => {
3674
+ ot(i, r)?.forEach((t, e) => {
3112
3675
  if ("External" === t.targetMode && t.type && t.target) {
3113
3676
  const r = {
3114
3677
  type: t.type,
@@ -3116,179 +3679,164 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3116
3679
  };
3117
3680
  e === s ? r.role = "book" : e === o && (r.role = "absoluteUrl"), n.push(r);
3118
3681
  }
3119
- }), n.sort((t, e) => ("book" === t.role ? 0 : 1) - ("book" === e.role ? 0 : 1)), e.sources = n, Y(i), h = e;
3682
+ }), n.sort((t, e) => ("book" === t.role ? 0 : 1) - ("book" === e.role ? 0 : 1)), e.sources = n, et(i), h = e;
3120
3683
  } else h = null;
3121
- } else h = o ? ((t, e, s, o = null) => {
3122
- if (!t) return null;
3123
- let r = t;
3124
- r.startsWith("/") && (r = r.substring(1));
3125
- let n = o?.parsedRefs?.get(t);
3126
- if (void 0 !== n) return n;
3127
- const i = e(r);
3128
- if (!i) return null;
3129
- let a = i.content;
3130
- try {
3131
- s && (a = s(a, t));
3132
- } catch (e) {
3133
- pt(t, e, o);
3134
- }
3135
- return o?.parsedRefs?.set(t, a), a;
3136
- })(i, e, (t, e) => {
3684
+ } else h = o ? tt(i, s, (t, e) => {
3137
3685
  const s = A.add({ source: { buffer: t } });
3138
- return s.addReference(I), N.add(s), P.toResourceId(s);
3139
- }, wt) : ft(i, e, L, _, wt);
3686
+ return s.addReference(P), _.add(s), I.toResourceId(s);
3687
+ }, It) : O(i, s, M, R, It);
3140
3688
  }
3141
3689
  return h;
3142
3690
  }, it = (t, e) => {
3143
3691
  if (!t) return null;
3144
- const s = tt(e, J)?.get(t);
3692
+ const s = ot(e, U)?.get(t);
3145
3693
  if (!s?.target || "External" === s.targetMode) return null;
3146
3694
  let o = s.target;
3147
- return o.startsWith("/") || (o = e.substring(0, e.lastIndexOf("/") + 1) + o), xt(o);
3148
- }, at = (t, e, s, o) => {
3149
- const r = [], n = /* @__PURE__ */ new Map(), i = [];
3150
- s.forEach((t, s) => {
3695
+ return o.startsWith("/") || (o = e.substring(0, e.lastIndexOf("/") + 1) + o), L(o);
3696
+ }, ct = (t, s, o, r) => {
3697
+ const n = [], i = /* @__PURE__ */ new Map(), a = [];
3698
+ o.forEach((t, e) => {
3151
3699
  if ("http://schemas.microsoft.com/office/2017/10/relationships/threadedComment" !== t.type) return;
3152
- const a = rt(s, e, !1, o)?.comments;
3153
- if (!a) return;
3154
- for (let t = 0; t < a.length; t++) {
3155
- const e = a[t];
3700
+ const o = nt(e, s, !1, r)?.comments;
3701
+ if (!o) return;
3702
+ for (let t = 0; t < o.length; t++) {
3703
+ const e = o[t];
3156
3704
  if (!e?.v?.id) continue;
3157
- const { parentId: s, done: o, content: c, ...l } = e.v, h = {
3158
- ...l,
3159
- content: rs(c)
3705
+ const { parentId: s, done: r, content: l, ...c } = e.v, h = {
3706
+ ...c,
3707
+ content: oo(l)
3160
3708
  };
3161
- s ? i.push({
3709
+ s ? a.push({
3162
3710
  parentId: s,
3163
3711
  json: h
3164
- }) : (o && (h.done = !0), n.set(h.id, h), r.push({
3712
+ }) : (r && (h.done = !0), i.set(h.id, h), n.push({
3165
3713
  r: e.r,
3166
3714
  v: h
3167
3715
  }));
3168
3716
  }
3169
- const c = it(s, e);
3170
- c && Y(c);
3717
+ const l = it(e, s);
3718
+ l && et(l);
3171
3719
  });
3172
- for (let t = 0; t < i.length; t++) {
3173
- const { parentId: e, json: s } = i[t], o = n.get(e);
3720
+ for (let t = 0; t < a.length; t++) {
3721
+ const { parentId: e, json: s } = a[t], o = i.get(e);
3174
3722
  o && (o.replies ??= []).push(s);
3175
3723
  }
3176
- const a = [];
3177
- if (s.forEach((t, s) => {
3724
+ const l = [];
3725
+ if (o.forEach((t, e) => {
3178
3726
  if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" !== t.type) return;
3179
- const r = rt(s, e, !1, o), i = r?.comments;
3180
- if (!i) return;
3181
- const c = r?.authors;
3182
- for (let t = 0; t < i.length; t++) {
3183
- const e = i[t];
3727
+ const o = nt(e, s, !1, r), n = o?.comments;
3728
+ if (!n) return;
3729
+ const a = o?.authors;
3730
+ for (let t = 0; t < n.length; t++) {
3731
+ const e = n[t];
3184
3732
  if (!e?.r) continue;
3185
- let s = c && void 0 !== e.v.authorId ? c[e.v.authorId] : void 0;
3733
+ let s = a && void 0 !== e.v.authorId ? a[e.v.authorId] : void 0;
3186
3734
  if (s && s.startsWith("tc=")) {
3187
- if (n.has(vt(s.substring(3)))) continue;
3735
+ if (i.has(N(s.substring(3)))) continue;
3188
3736
  s = void 0;
3189
3737
  }
3190
3738
  const o = {
3191
- id: F.uuidV4().toUpperCase(),
3739
+ id: ft.uuidV4().toUpperCase(),
3192
3740
  asNote: !0,
3193
3741
  content: e.v.content ?? ""
3194
- }, r = s ? Tt({ displayName: s }) : void 0;
3195
- r && (o.personId = r.id), a.push({
3742
+ }, r = s ? Et({ displayName: s }) : void 0;
3743
+ r && (o.personId = r.id), l.push({
3196
3744
  r: e.r,
3197
3745
  v: o
3198
3746
  });
3199
3747
  }
3200
- const l = it(s, e);
3201
- l && Y(l);
3202
- }), 0 === r.length && 0 === a.length) return;
3203
- const c = [...r, ...a], l = t.legacyDrawing;
3204
- if (l?.xml) {
3205
- const { rest: e, notes: s } = g(l.xml);
3206
- if (s.length > 0) {
3207
- const o = /* @__PURE__ */ new Map();
3208
- for (let t = 0; t < s.length; t++) {
3209
- const e = s[t];
3210
- o.set(z.cellToString({
3748
+ const c = it(e, s);
3749
+ c && et(c);
3750
+ }), 0 === n.length && 0 === l.length) return;
3751
+ const c = [...n, ...l], h = t.legacyDrawing;
3752
+ if (h?.xml) {
3753
+ const { rest: s, notes: o } = at(h.xml);
3754
+ if (o.length > 0) {
3755
+ const r = /* @__PURE__ */ new Map();
3756
+ for (let t = 0; t < o.length; t++) {
3757
+ const e = o[t];
3758
+ r.set(xt.cellToString({
3211
3759
  rowIndex: e.row,
3212
3760
  colIndex: e.col
3213
3761
  }), e);
3214
3762
  }
3215
3763
  for (let t = 0; t < c.length; t++) {
3216
- const e = c[t], s = o.get(String(e.r).toUpperCase());
3217
- if (!s) continue;
3218
- if (o.delete(String(e.r).toUpperCase()), !e.v.asNote) continue;
3219
- const r = R(s.xml), n = {};
3220
- if (r.anchor) {
3221
- const [t, e, o, i, a, c, l, h] = r.anchor;
3222
- n.anchor = {
3764
+ const s = c[t], o = r.get(String(s.r).toUpperCase());
3765
+ if (!o) continue;
3766
+ if (r.delete(String(s.r).toUpperCase()), !s.v.asNote) continue;
3767
+ const n = e(o.xml), i = {};
3768
+ if (n.anchor) {
3769
+ const [t, e, s, r, a, l, c, h] = n.anchor;
3770
+ i.anchor = {
3223
3771
  tl: {
3224
- c: t - s.col,
3772
+ c: t - o.col,
3225
3773
  x: e,
3226
- r: o - s.row,
3227
- y: i
3774
+ r: s - o.row,
3775
+ y: r
3228
3776
  },
3229
3777
  br: {
3230
- c: a - s.col,
3231
- x: c,
3232
- r: l - s.row,
3778
+ c: a - o.col,
3779
+ x: l,
3780
+ r: c - o.row,
3233
3781
  y: h
3234
3782
  }
3235
3783
  };
3236
- }
3237
- r.xml && (n.xml = r.xml), (n.anchor || n.xml) && (e.v.box = n), r.visible && (e.v.shown = !0), r.alt && (e.v.description = r.alt);
3784
+ } else n.bounds && (i.bounds = n.bounds);
3785
+ n.style.fill && (i.fill = n.style.fill), n.style.stroke && (i.stroke = n.style.stroke), n.xml && (i.xml = n.xml), (i.anchor || i.bounds || i.fill || i.stroke || i.xml) && (s.v.box = i), n.visible && (s.v.shown = !0), n.alt && (s.v.description = n.alt);
3238
3786
  }
3239
- const r = [];
3240
- o.forEach((t) => {
3241
- r.push(t.xml);
3787
+ const n = [];
3788
+ r.forEach((t) => {
3789
+ n.push(t.xml);
3242
3790
  });
3243
- const n = M(e, r);
3244
- n ? l.xml = n : delete t.legacyDrawing;
3791
+ const i = ht(s, n);
3792
+ i ? h.xml = i : delete t.legacyDrawing;
3245
3793
  }
3246
3794
  }
3247
3795
  t.comments = c;
3248
- }, ct = (t, s) => {
3249
- const o = it(t, s);
3796
+ }, ut = (t, e) => {
3797
+ const o = it(t, e);
3250
3798
  if (!o) return null;
3251
- const r = e(ss(o));
3799
+ const r = s(to(o));
3252
3800
  if (!r) return null;
3253
- const n = { xml: new TextDecoder("utf-8").decode(r.content) }, i = [];
3254
- return tt(o, J)?.forEach((t, e) => {
3801
+ const n = { xml: Hs(new TextDecoder("utf-8").decode(r.content)) }, i = [];
3802
+ return ot(o, U)?.forEach((t, e) => {
3255
3803
  if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" !== t.type) return;
3256
- const s = rt(e, o, !0);
3804
+ const s = nt(e, o, !0);
3257
3805
  "number" == typeof s && i.push({
3258
3806
  id: e,
3259
3807
  resId: s
3260
3808
  });
3261
- }), i.length > 0 && (n.images = i), Y(o), n;
3262
- }, lt = (t, s) => {
3263
- const o = it(t, s);
3809
+ }), i.length > 0 && (n.images = i), et(o), n;
3810
+ }, dt = (t, e) => {
3811
+ const o = it(t, e);
3264
3812
  if (!o) return null;
3265
- const r = ft(o, e, L, _, wt)?.formControl ?? null;
3266
- return r && Y(o), r;
3267
- }, ht = (t, s, o, r, n = /* @__PURE__ */ new Set()) => {
3268
- const a = it(t, s);
3269
- if (!a || n.has(a)) return null;
3270
- const c = o ?? tt(s, J)?.get(t)?.type;
3271
- if (!c) return null;
3272
- const l = e(ss(a));
3813
+ const r = O(o, s, M, R, It)?.formControl ?? null;
3814
+ return r && et(o), r;
3815
+ }, vt = (t, e, r, n, i = /* @__PURE__ */ new Set()) => {
3816
+ const a = it(t, e);
3817
+ if (!a || i.has(a)) return null;
3818
+ const l = r ?? ot(e, U)?.get(t)?.type;
3273
3819
  if (!l) return null;
3274
- n.add(a);
3275
- const h = a.substring(a.lastIndexOf("/") + 1), u = i.overrides[ss(a)] ?? i.defaults[h.substring(h.lastIndexOf(".") + 1).toLowerCase()], d = {
3820
+ const c = s(to(a));
3821
+ if (!c) return null;
3822
+ i.add(a);
3823
+ const h = a.substring(a.lastIndexOf("/") + 1), u = o.overrides[to(a)] ?? o.defaults[h.substring(h.lastIndexOf(".") + 1).toLowerCase()], d = {
3276
3824
  id: t,
3277
- type: c,
3825
+ type: l,
3278
3826
  name: h
3279
3827
  };
3280
- if (u && (d.contentType = u), ((t, e) => t ? t.endsWith("+xml") || "application/xml" === t : /\.(xml|rels|vml)$/i.test(e))(u, h)) d.xml = new TextDecoder("utf-8").decode(l.content);
3828
+ if (u && (d.contentType = u), ((t, e) => t ? t.endsWith("+xml") || "application/xml" === t : /\.(xml|rels|vml)$/i.test(e))(u, h)) d.xml = new TextDecoder("utf-8").decode(c.content);
3281
3829
  else {
3282
- const e = rt(t, s, !0);
3283
- if ("number" != typeof e) return null;
3284
- d.resId = e;
3830
+ const s = nt(t, e, !0);
3831
+ if ("number" != typeof s) return null;
3832
+ d.resId = s;
3285
3833
  }
3286
3834
  const p = [];
3287
- return tt(a, J)?.forEach((t, e) => {
3835
+ return ot(a, U)?.forEach((t, e) => {
3288
3836
  if (!t?.type) return;
3289
- if (r && !r(t.type)) return;
3837
+ if (n && !n(t.type)) return;
3290
3838
  if ("External" === t.targetMode) {
3291
- const s = rt(e, a, !0);
3839
+ const s = nt(e, a, !0);
3292
3840
  "number" == typeof s && p.push({
3293
3841
  id: e,
3294
3842
  type: t.type,
@@ -3296,104 +3844,112 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3296
3844
  });
3297
3845
  return;
3298
3846
  }
3299
- const s = ht(e, a, t.type, r, n);
3847
+ const s = vt(e, a, t.type, n, i);
3300
3848
  s && p.push(s);
3301
- }), p.length > 0 && (d.parts = p), Y(a), d;
3302
- };
3303
- mt("coreprops", i, e, L, _, b), mt("extprops", i, e, L, _, b);
3304
- const yt = new et(), bt = mt("people", i, e, L, _, b);
3305
- if (bt.size > 0) {
3306
- const [t, e] = bt.entries().next().value;
3307
- yt.fromJSON(e?.persons), Y(t);
3308
- }
3309
- const Tt = (t) => {
3310
- if (t) return yt.add(t).toJSON();
3311
- }, wt = {
3849
+ }), p.length > 0 && (d.parts = p), et(a), d;
3850
+ }, yt = z("coreprops", o, s, M, R, x), wt = z("extprops", o, s, M, R, x), Ct = z("custprops", o, s, M, R, x);
3851
+ Ct.forEach((t, e) => {
3852
+ t?.custom && et(e);
3853
+ });
3854
+ const kt = new Ot(), At = z("people", o, s, M, R, x);
3855
+ if (At.size > 0) {
3856
+ const [t, e] = At.entries().next().value;
3857
+ kt.fromJSON(e?.persons), et(t);
3858
+ }
3859
+ const Et = (t) => {
3860
+ if (t) return kt.add(t).toJSON();
3861
+ }, It = {
3312
3862
  paramMap: j,
3313
- getRefs: tt,
3314
- getRef: rt,
3315
- parsedRefs: J,
3316
- readEmbeddedPart: (t, e) => ht(t, e),
3317
- addPerson: Tt,
3318
- serializeElement: X,
3319
- onWarning: y
3320
- }, St = [];
3321
- if (a) {
3322
- const t = await q.getTextStream(a, E);
3863
+ getRefs: ot,
3864
+ getRef: nt,
3865
+ parsedRefs: U,
3866
+ readEmbeddedPart: (t, e) => vt(t, e),
3867
+ addPerson: Et,
3868
+ serializeElement: H,
3869
+ onWarning: b
3870
+ }, Pt = [], Nt = /* @__PURE__ */ new Map();
3871
+ if (j.set(Es, Nt), r) {
3872
+ const t = await F.getTextStream(r, E);
3323
3873
  if (t) {
3324
3874
  const e = ((t, e) => {
3325
3875
  let s = !1, o = !1, r = 0, n = "";
3876
+ const i = new ys();
3326
3877
  return {
3327
3878
  onOpenTag: (t) => {
3328
- const e = Ye(t.name);
3329
- "t" === e ? s && 0 === r && (o = !0) : "si" === e ? (s = !0, n = "", r = 0) : "rPh" !== e && "phoneticPr" !== e || r++;
3879
+ const e = vs(t.name);
3880
+ "t" === e ? s && 0 === r && (o = !0) : "si" === e ? (s = !0, n = "", i.reset(), r = 0) : "rPh" === e || "phoneticPr" === e ? r++ : s && 0 === r && i.onOpenTag(e, t.attributes);
3330
3881
  },
3331
3882
  onText: (t) => {
3332
- o && (n += t);
3883
+ o && (n += t, i.onText(t));
3333
3884
  },
3334
3885
  onCloseTag: (e) => {
3335
- const i = Ye(e.name);
3336
- "t" === i ? o = !1 : "si" === i ? (t(O(n)), s = !1, n = "") : "rPh" !== i && "phoneticPr" !== i || r > 0 && r--;
3886
+ const a = vs(e.name);
3887
+ "t" === a ? o = !1 : "si" === a ? (t(w(n), i.take() ?? void 0), s = !1, n = "") : "rPh" === a || "phoneticPr" === a ? r > 0 && r-- : i.onCloseTag(a);
3337
3888
  },
3338
3889
  onError: (t) => {
3339
3890
  e?.(`Error parsing shared strings: ${t?.message ?? t}`);
3340
3891
  }
3341
3892
  };
3342
- })((t) => {
3343
- St.push(t);
3893
+ })((t, e) => {
3894
+ e && Nt.set(Pt.length, e), Pt.push(t);
3344
3895
  }, (t) => {
3345
- y(t, a);
3896
+ b(t, r);
3346
3897
  });
3347
3898
  try {
3348
- await me.parseStream(t, e, { xmlns: !1 });
3899
+ await Me.parseStream(t, e, { xmlns: !1 });
3349
3900
  } catch (t) {
3350
- throw new Error(`Error parsing shared strings: '${a}'`, { cause: t });
3901
+ throw new Error(`Error parsing shared strings: '${r}'`, { cause: t });
3351
3902
  }
3352
3903
  }
3353
3904
  }
3354
- m?.mark("shared-strings");
3355
- let Ct = St.length;
3356
- const kt = /* @__PURE__ */ new Map();
3357
- let At = Ct;
3358
- const Et = (t) => {
3359
- const e = kt.get(t);
3905
+ p?.mark("shared-strings");
3906
+ let $t = Pt.length;
3907
+ const Lt = /* @__PURE__ */ new Map();
3908
+ let Vt = $t;
3909
+ const Mt = (t) => {
3910
+ const e = Lt.get(t);
3360
3911
  if (void 0 !== e) return e;
3361
- const s = At;
3362
- return kt.set(t, At++), St.push(t), s;
3363
- }, Pt = [];
3364
- i.slicersCache = Pt;
3365
- const Ot = q.getNames(), It = Ot.length;
3366
- for (let t = 0; t < It; t++) {
3367
- const e = Ot[t];
3368
- e && e.startsWith("xl/slicerCache") && Pt.push(`/${e}`);
3369
- }
3370
- const Dt = mt("slicersCache", i, e, L, _, wt), Nt = /* @__PURE__ */ new Map();
3371
- Dt.forEach((t, e) => {
3372
- t?.cacheName && (t.cachePath = e, Nt.set(t.cacheName, t));
3373
- }), j.set("slicerCaches", Nt);
3374
- const _t = [];
3375
- i.slicers = _t;
3376
- for (let t = 0; t < It; t++) {
3377
- const e = Ot[t];
3378
- e && e.startsWith("xl/slicers/") && e.endsWith(".xml") && _t.push(`/${e}`);
3379
- }
3380
- mt("richstructure", i, e, L, _, wt), mt("richdata", i, e, L, _, wt);
3381
- const Lt = mt("themes", i, e, L, _, wt);
3382
- let $t = null;
3383
- if (Lt && Lt.entries) {
3384
- let t = Lt.entries().next();
3385
- t?.value?.[1] && ($t = t.value[1]);
3386
- }
3387
- const Vt = new ot($t);
3388
- let Rt = mt("styles", i, e, L, _, wt).entries().next()?.value?.[1];
3389
- Rt && (Rt = JSON.parse(H.JSONStableStringify(Rt)));
3390
- const jt = mt("workbooks", i, e, L, _, wt);
3391
- m?.mark("side-parts-json"), await Promise.all(Z);
3912
+ const s = Vt;
3913
+ return Lt.set(t, Vt++), Pt.push(t), s;
3914
+ }, jt = [];
3915
+ o.slicersCache = jt;
3916
+ const Bt = F.getNames(), Wt = Bt.length;
3917
+ for (let t = 0; t < Wt; t++) {
3918
+ const e = Bt[t];
3919
+ e && e.startsWith("xl/slicerCache") && jt.push(`/${e}`);
3920
+ }
3921
+ const zt = z("slicersCache", o, s, M, R, It), Xt = /* @__PURE__ */ new Map();
3922
+ zt.forEach((t, e) => {
3923
+ t?.cacheName && (t.cachePath = e, Xt.set(t.cacheName, t));
3924
+ }), j.set("slicerCaches", Xt);
3925
+ const qt = [];
3926
+ o.slicers = qt;
3927
+ for (let t = 0; t < Wt; t++) {
3928
+ const e = Bt[t];
3929
+ e && e.startsWith("xl/slicers/") && e.endsWith(".xml") && qt.push(`/${e}`);
3930
+ }
3931
+ z("richstructure", o, s, M, R, It), z("richdata", o, s, M, R, It);
3932
+ const Ut = z("themes", o, s, M, R, It);
3933
+ let Gt = null;
3934
+ if (Ut && Ut.entries) {
3935
+ let t = Ut.entries().next();
3936
+ t?.value?.[1] && (Gt = t.value[1]);
3937
+ }
3938
+ const Zt = new _t(Gt);
3939
+ let Kt = z("styles", o, s, M, R, It).entries().next()?.value?.[1];
3940
+ Kt && (Kt = JSON.parse(pt.JSONStableStringify(Kt)));
3941
+ const Jt = z("workbooks", o, s, M, R, It);
3942
+ j.set(As, !0 === Jt.entries().next().value?.[1]?.date1904), p?.mark("side-parts-json"), await Promise.all(Z);
3392
3943
  {
3393
- const e = jt.entries().next().value?.[1], s = C(e?.names), o = e?.sheets ?? [];
3394
- for (let e = 0; e < o.length; e++) {
3395
- const r = o[e]?.sheet;
3396
- r && t(r, s);
3944
+ const e = Jt.entries().next().value?.[1], s = t(e?.names), o = e?.sheets ?? [];
3945
+ for (let t = 0; t < o.length; t++) {
3946
+ const e = o[t], r = c(e);
3947
+ if ("macro" === e?.kind && r?.part.xml) {
3948
+ r.part.xml = W(r.part.xml, Pt);
3949
+ continue;
3950
+ }
3951
+ const n = f(e);
3952
+ n && $(n, s);
3397
3953
  }
3398
3954
  const r = e?.names;
3399
3955
  if (r) for (let t = 0; t < r.length; t++) {
@@ -3401,29 +3957,50 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3401
3957
  "string" == typeof e && (r[t].ref = s.readDetached(e));
3402
3958
  }
3403
3959
  }
3404
- T && S > 0 && (T(w, w), await new Promise((t) => setTimeout(t, 0))), m?.mark("sheets");
3405
- const Mt = {
3406
- ...jt.entries().next().value?.[1],
3407
- styles: Rt,
3408
- theme: Vt.toJSON()
3409
- };
3410
- ((t, e) => {
3960
+ y && S > 0 && (y(T, T), await new Promise((t) => setTimeout(t, 0))), p?.mark("sheets");
3961
+ const Qt = {
3962
+ ...Jt.entries().next().value?.[1],
3963
+ styles: Kt,
3964
+ theme: Zt.toJSON()
3965
+ }, Yt = ((t, e, s, o) => {
3966
+ const r = {}, n = (t, e) => {
3967
+ if (t) for (const { key: s, value: o } of t) {
3968
+ const t = e[s];
3969
+ if (t && o) if ("revisionNumber" === t) {
3970
+ const t = parseInt(o, 10);
3971
+ Number.isFinite(t) && (r.revisionNumber = t);
3972
+ } else r[t] = o;
3973
+ }
3974
+ };
3975
+ if (n(t, Fs), n(e, Ws), s) {
3976
+ const t = [];
3977
+ for (const e of s) {
3978
+ const s = Xs(e);
3979
+ s ? t.push(s) : o?.(`The custom document property '${e.key}' holds a value of a kind that is not read (${e.kind ? "vt:" + e.kind : "none"}); it was dropped.`, "xlsx.docProps.custom.kind");
3980
+ }
3981
+ t.length > 0 && (r.custom = t);
3982
+ }
3983
+ return Object.keys(r).length > 0 ? r : void 0;
3984
+ })(yt.values().next().value?.properties, wt.values().next().value?.properties, Ct.values().next().value?.custom, (t, e) => {
3985
+ b(t, "docProps/custom.xml", e);
3986
+ });
3987
+ Yt && (Qt.properties = Yt), ((t, e) => {
3411
3988
  if (!e || 0 === e.size) return;
3412
3989
  const s = t.styles;
3413
3990
  if (!s) return;
3414
3991
  const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
3415
3992
  for (const s of t.sheets ?? []) {
3416
- const t = s?.sheet;
3993
+ const t = f(s);
3417
3994
  if (!t) continue;
3418
3995
  const n = /* @__PURE__ */ new Set();
3419
- Ze(t.cols) || n.add(0);
3996
+ Gs(t.cols) || n.add(0);
3420
3997
  for (const e of t.directStyles ?? []) n.add(Array.isArray(e) ? e[1] : e.v);
3421
3998
  for (const e of t.rows ?? []) {
3422
- const t = Je(e);
3999
+ const t = Us(e);
3423
4000
  void 0 !== t && n.add(t);
3424
4001
  }
3425
4002
  for (const e of t.cols ?? []) {
3426
- const t = Je(e);
4003
+ const t = Us(e);
3427
4004
  void 0 !== t && n.add(t);
3428
4005
  }
3429
4006
  let i = !1;
@@ -3441,104 +4018,147 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3441
4018
  }
3442
4019
  if (0 === o.size) return;
3443
4020
  const n = s.direct ?? (s.direct = []);
3444
- for (const t of o) 0 !== t && Qe(n[t] ?? (n[t] = {}), !0);
3445
- for (const t of r) 0 !== t && Qe(n[t] ?? (n[t] = {}), !1);
4021
+ for (const t of o) 0 !== t && Zs(n[t] ?? (n[t] = {}), !0);
4022
+ for (const t of r) 0 !== t && Zs(n[t] ?? (n[t] = {}), !1);
3446
4023
  if (o.has(0)) {
3447
- const t = s.named ?? (s.named = []), e = K.BuiltInName.Normal.toLowerCase();
4024
+ const t = s.named ?? (s.named = []), e = St.BuiltInName.Normal.toLowerCase();
3448
4025
  let o = t.find((t) => t.name?.toLowerCase() === e);
3449
4026
  o || (o = {
3450
- name: K.BuiltInName.Normal,
4027
+ name: St.BuiltInName.Normal,
3451
4028
  style: {}
3452
- }, t.push(o)), Qe(o.style, !0);
4029
+ }, t.push(o)), Zs(o.style, !0);
4030
+ }
4031
+ })(Qt, j.get(qs)), ((t) => {
4032
+ const e = {
4033
+ colStart: 0,
4034
+ rowStart: 0,
4035
+ colEnd: V,
4036
+ rowEnd: K
4037
+ };
4038
+ for (const s of t.sheets ?? []) {
4039
+ const t = f(s);
4040
+ if (!t) continue;
4041
+ const o = [];
4042
+ if (Js(t.cols, !0, e, o), Js(t.rows, !1, e, o), 0 === o.length) continue;
4043
+ const r = [];
4044
+ for (const [e, s] of t.directStyles ?? []) r.push({
4045
+ ...xt.fastStringToRange(e),
4046
+ value: {
4047
+ kind: 0,
4048
+ index: s
4049
+ }
4050
+ });
4051
+ r.push(...o);
4052
+ const n = [], i = new mt.IteratorInstance(r, { axis: bt.Column });
4053
+ for (let t = i.next(); !t.done; t = i.next()) {
4054
+ const s = t.value.overlaps;
4055
+ let o;
4056
+ if (1 === s.length) {
4057
+ if (o = s[0].value, 0 === o.index) continue;
4058
+ } else {
4059
+ let t, e, r;
4060
+ for (let o = 0; !t && o < s.length; o++) {
4061
+ const n = s[o].value;
4062
+ 0 === n.kind ? t = n : 1 === n.kind ? e = n : r = n;
4063
+ }
4064
+ o = t ?? e ?? r;
4065
+ }
4066
+ n.push([xt.rangeToString(t.value.range, e), o.index]);
4067
+ }
4068
+ n.length > 0 ? t.directStyles = n : delete t.directStyles;
3453
4069
  }
3454
- })(Mt, j.get(Ke));
4070
+ })(Qt);
3455
4071
  {
3456
4072
  const t = /* @__PURE__ */ new Map();
3457
- mt("slicers", i, e, L, _, wt).forEach((e, s) => {
4073
+ z("slicers", o, s, M, R, It).forEach((e, s) => {
3458
4074
  e?.slicers && t.set(s, e.slicers);
3459
4075
  }), function(t, e) {
3460
4076
  const s = t.sheets ?? [], o = /* @__PURE__ */ new Map();
3461
4077
  for (let t = 0; t < s.length; t++) {
3462
- const e = s[t]?.sheet?.tables ?? [];
3463
- for (let t = 0; t < e.length; t++) {
3464
- const s = e[t], r = Array.isArray(s) ? s[1] : s?.v;
3465
- if (!r?.id) continue;
3466
- const n = (r.columns ?? []).map((t) => "string" == typeof t ? { name: t } : t);
3467
- o.set(String(r.id), {
3468
- name: r.name ?? "",
4078
+ const e = s[t], r = f(e)?.tables ?? [];
4079
+ for (let t = 0; t < r.length; t++) {
4080
+ const e = r[t], s = Array.isArray(e) ? e[1] : e?.v;
4081
+ if (!s?.id) continue;
4082
+ const n = (s.columns ?? []).map((t) => "string" == typeof t ? { name: t } : t);
4083
+ o.set(String(s.id), {
4084
+ name: s.name ?? "",
3469
4085
  columns: n
3470
4086
  });
3471
4087
  }
3472
4088
  }
3473
4089
  const r = /* @__PURE__ */ new Set();
3474
4090
  for (let t = 0; t < s.length; t++) {
3475
- const n = s[t]?.sheet;
3476
- if (!n) continue;
3477
- const i = n.slicers, a = n.movables;
3478
- if (i && a) for (let t = a.length - 1; t >= 0; t--) {
3479
- const s = a[t].content;
4091
+ const n = s[t], i = f(n);
4092
+ if (!i) continue;
4093
+ const a = i.slicers, l = i.movables;
4094
+ if (a && l) for (let t = l.length - 1; t >= 0; t--) {
4095
+ const s = l[t].content;
3480
4096
  if ("slicer" !== s?.type || s.json?.source) continue;
3481
- const n = s.name ?? "", c = i[n];
3482
- if (!c?.tableId) continue;
3483
- const l = o.get(String(c.tableId)), h = l ? ut(l.columns, c.columnId) : null;
3484
- l && h ? (s.json = dt(c, s.json, G.structuredReference(l.name, h.name)), r.add(n), c.cachePath && e.markAbsorbed(c.cachePath)) : (e.warn("A slicer names no table; it was not imported.", "xlsx.slicer.cacheDefinition"), a.splice(t, 1));
4097
+ const n = s.name ?? "", i = a[n];
4098
+ if (!i?.tableId) continue;
4099
+ const c = o.get(String(i.tableId)), h = c ? Ht(c.columns, i.columnId) : null;
4100
+ c && h ? (s.json = Ft(i, s.json, Tt.structuredReference(c.name, h.name)), r.add(n), i.cachePath && e.markAbsorbed(i.cachePath)) : (e.warn("A slicer names no table; it was not imported.", "xlsx.slicer.cacheDefinition"), l.splice(t, 1));
3485
4101
  }
3486
- delete n.slicers;
4102
+ delete i.slicers;
3487
4103
  }
3488
4104
  e.slicerParts.forEach((t, s) => {
3489
4105
  const o = Object.keys(t);
3490
4106
  o.length > 0 && o.every((t) => r.has(t)) && e.markAbsorbed(s);
3491
4107
  });
3492
- }(Mt, {
4108
+ }(Qt, {
3493
4109
  warn: (t, e) => {
3494
- y(t, "xl/slicers", e);
4110
+ b(t, "xl/slicers", e);
3495
4111
  },
3496
- markAbsorbed: Y,
4112
+ markAbsorbed: et,
3497
4113
  slicerParts: t
3498
4114
  });
3499
4115
  }
3500
- Mt.calc = {
3501
- ...Mt.calc ?? {},
4116
+ Qt.calc = {
4117
+ ...Qt.calc ?? {},
3502
4118
  legacyIntersect: !0
3503
- }, St.length > 0 && (Mt.strings = St);
3504
- const Bt = yt.toJSON();
3505
- Bt && Bt.length > 0 && (Mt.people = Bt);
3506
- const Ht = q.getEntry("xl/vbaProject.bin");
3507
- if (Ht) try {
3508
- const { VBAProject: t } = await import("./O5mti2R9drFOlXc7.mjs"), e = t.extract(Ht);
4119
+ }, Pt.length > 0 && (Qt.strings = Pt);
4120
+ const te = kt.toJSON();
4121
+ te && te.length > 0 && (Qt.people = te);
4122
+ const ee = F.getEntry("xl/vbaProject.bin");
4123
+ if (ee) try {
4124
+ const { VBAProject: t } = await import("./fopiRR7OiVoEiF7B.mjs"), e = t.extract(ee);
3509
4125
  if (e) {
3510
4126
  const s = /* @__PURE__ */ new Map();
3511
- for (const t of Mt.sheets ?? []) {
3512
- const e = t?.sheet?.codeName;
3513
- e && s.set(e, t.sheet);
4127
+ for (const t of Qt.sheets ?? []) {
4128
+ const e = f(t), o = e?.codeName;
4129
+ o && s.set(o, e);
3514
4130
  }
3515
4131
  for (const o of e.modules) {
3516
4132
  const e = { language: "vba" }, { header: r, body: n } = t.splitAttributes(o.code);
3517
4133
  n && (e.source = n), r && (e.sourceHeader = r);
3518
4134
  const i = "document" === o.type ? s.get(o.name) : void 0;
3519
4135
  i || "document" !== o.type || (e.scope = "workbook");
3520
- const a = i ? i.modules ??= {} : Mt.modules ??= {};
4136
+ const a = i ? i.modules ??= {} : Qt.modules ??= {};
3521
4137
  a[o.name] || (a[o.name] = e);
3522
4138
  }
3523
- c?.(e);
3524
- } else x.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
4139
+ n?.(e);
4140
+ } else g.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
3525
4141
  } catch (t) {
3526
- x.push([`Error extracting VBA: ${t?.message ?? t}`, "xl/vbaProject.bin"]);
4142
+ g.push([`Error extracting VBA: ${t?.message ?? t}`, "xl/vbaProject.bin"]);
3527
4143
  }
3528
- const Ft = j.get("calcId"), Wt = void 0 === Ft || !(Number(Ft) >= 191029), zt = d.calcOnLoad ?? ("auto" === h && Wt ? "full" : h), Xt = {
3529
- ...d,
3530
- calcOnLoad: zt,
4144
+ const se = j.get("calcId"), oe = void 0 === se || !(Number(se) >= 191029), re = h.calcOnLoad ?? ("auto" === l && oe ? "full" : l), ne = {
4145
+ ...h,
4146
+ calcOnLoad: re,
3531
4147
  resources: A,
3532
- json: Mt
4148
+ json: Qt
3533
4149
  };
3534
- void 0 === Xt.disableLoadAutoFit && (Xt.disableLoadAutoFit = !1), m?.mark("json-assembled");
3535
- const qt = new nt(Xt);
3536
- if (m?.mark("workbook-constructed"), B.length > 0 && "none" !== zt) {
3537
- await qt.whenCalculationReady();
3538
- const t = /* @__PURE__ */ new Map(), e = Mt.sheets ?? [], s = qt.getSheets().getItems();
4150
+ if (void 0 === ne.disableLoadAutoFit) {
4151
+ const t = j.get(st);
4152
+ ne.disableLoadAutoFit = !!t?.declared && t.normalIsThemeFont && await q(t.faces);
4153
+ }
4154
+ p?.mark("json-assembled");
4155
+ const ie = new Rt(ne);
4156
+ if (p?.mark("workbook-constructed"), B.length > 0 && "none" !== re) {
4157
+ await ie.whenCalculationReady();
4158
+ const t = /* @__PURE__ */ new Map(), e = Qt.sheets ?? [], s = ie.getSheets({ visibility: "veryHidden" });
3539
4159
  for (let o = 0; o < e.length; o++) {
3540
- const r = e[o]?.sheet, n = s[o];
3541
- r && n && t.set(r, n);
4160
+ const r = e[o], n = s[o], i = f(r);
4161
+ i && n?.isIWorksheet && t.set(i, n);
3542
4162
  }
3543
4163
  ((t, e, s) => {
3544
4164
  if (0 === e.length) return;
@@ -3557,16 +4177,16 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3557
4177
  for (const t of e) null === t.formula && i.add(r(t.rowIndex, t.colIndex));
3558
4178
  for (const t of e) {
3559
4179
  if (null === t.formula) continue;
3560
- const e = He(t.formula);
4180
+ const e = cs(t.formula);
3561
4181
  let s = !0;
3562
4182
  for (const t of e) if (!n(t)) {
3563
4183
  s = !1;
3564
4184
  break;
3565
4185
  }
3566
4186
  if (!s) continue;
3567
- const a = [], c = [[t.rowIndex, t.colIndex]], l = /* @__PURE__ */ new Set([r(t.rowIndex, t.colIndex)]);
3568
- for (; c.length > 0;) {
3569
- const [t, e] = c.pop(), s = [
4187
+ const a = [], l = [[t.rowIndex, t.colIndex]], c = /* @__PURE__ */ new Set([r(t.rowIndex, t.colIndex)]);
4188
+ for (; l.length > 0;) {
4189
+ const [t, e] = l.pop(), s = [
3570
4190
  [t + 1, e],
3571
4191
  [t - 1, e],
3572
4192
  [t, e + 1],
@@ -3574,7 +4194,7 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3574
4194
  ];
3575
4195
  for (const [t, e] of s) {
3576
4196
  const s = r(t, e);
3577
- !l.has(s) && i.has(s) && (l.add(s), a.push([t, e]), c.push([t, e]));
4197
+ !c.has(s) && i.has(s) && (c.add(s), a.push([t, e]), l.push([t, e]));
3578
4198
  }
3579
4199
  }
3580
4200
  for (const [t, e] of a) i.delete(r(t, e)), o.getRange({
@@ -3591,20 +4211,20 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3591
4211
  }).setValue("=" + t.formula);
3592
4212
  }
3593
4213
  }
3594
- })(qt, B, t);
4214
+ })(ie, B, t);
3595
4215
  }
3596
- if (N.forEach((t) => {
3597
- t.deleteReference(I);
3598
- }), P.endPersist(), f) {
3599
- r(qt);
4216
+ if (_.forEach((t) => {
4217
+ t.deleteReference(P);
4218
+ }), I.endPersist(), d) {
4219
+ C(ie);
3600
4220
  const t = /* @__PURE__ */ new Map();
3601
4221
  let e = 0;
3602
- for (const s of q.getNames()) {
3603
- const o = q.getEntry(s);
4222
+ for (const s of F.getNames()) {
4223
+ const o = F.getEntry(s);
3604
4224
  if (!o) continue;
3605
- const r = q.getRawEntry(s), n = r ? {
4225
+ const r = F.getRawEntry(s), n = r ? {
3606
4226
  data: o,
3607
- uncompressedSize: q.uncompressedSize(s),
4227
+ uncompressedSize: F.uncompressedSize(s),
3608
4228
  raw: {
3609
4229
  compressedData: r.data,
3610
4230
  compressionMethod: r.compressionMethod,
@@ -3612,40 +4232,40 @@ var Pe = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3612
4232
  }
3613
4233
  } : {
3614
4234
  data: o,
3615
- uncompressedSize: q.uncompressedSize(s)
4235
+ uncompressedSize: F.uncompressedSize(s)
3616
4236
  };
3617
4237
  t.set(s, n), e += o.byteLength;
3618
4238
  }
3619
- if (e > 67108864) x.push([`Source package too large to retain (${e} bytes, limit ${s}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
4239
+ if (e > 67108864) g.push([`Source package too large to retain (${e} bytes, limit ${J}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
3620
4240
  else if (t.size > 0) {
3621
- const e = new V(t, Q);
3622
- o(qt, e);
3623
- let s = qt.getSheets().getItems();
3624
- const n = qt.getTransactions().addListener({ onCommitEnd: (t) => {
4241
+ const e = new a(t, Y);
4242
+ k(ie, e);
4243
+ let s = ie.getWorksheets().getItems();
4244
+ const o = ie.getTransactions().addListener({ onCommitEnd: (t) => {
3625
4245
  const s = t.getOperation()?.name;
3626
4246
  "insertCells" !== s && "deleteCells" !== s || e.markStructuralChange();
3627
- } }), i = qt.addListeners({ onSheetsChange: () => {
3628
- const t = qt.getSheets().getItems();
4247
+ } }), r = ie.addListeners({ onSheetsChange: () => {
4248
+ const t = ie.getWorksheets().getItems();
3629
4249
  (t.length !== s.length || t.some((t, e) => t !== s[e])) && e.markStructuralChange(), s = t;
3630
4250
  } });
3631
- qt.addListeners({ onClose: () => {
3632
- n(), i(), r(qt);
4251
+ ie.addListeners({ onClose: () => {
4252
+ o(), r(), C(ie);
3633
4253
  } });
3634
4254
  }
3635
4255
  }
3636
- if (x.length && v?.onWarning) {
4256
+ if (g.length && v?.onWarning) {
3637
4257
  const t = /* @__PURE__ */ new Set();
3638
- for (const e of x) {
4258
+ for (const e of g) {
3639
4259
  const [s, o, r] = e, n = r ?? s;
3640
4260
  t.has(n) || (t.add(n), v.onWarning(s, o));
3641
4261
  }
3642
4262
  }
3643
- return m && !0 === l && console.table(m.toTable()), qt;
4263
+ return p && !0 === i && console.table(p.toTable()), await ie.whenFontsReady(), ie;
3644
4264
  } catch (t) {
3645
4265
  let e = "Unable to parse XLSX.";
3646
- throw t instanceof tt && (e = "Unable to open XLSX. There are too many rows or columns."), new Error(e, { cause: t });
4266
+ throw t instanceof Pt && (e = "Unable to open XLSX. There are too many rows or columns."), new Error(e, { cause: t });
3647
4267
  } finally {
3648
- await q.close().catch(() => {});
4268
+ await F.close().catch(() => {});
3649
4269
  }
3650
4270
  };
3651
- export { vt as i, Ke as n, bt as r, ns as readXLSX, es as t };
4271
+ export { qs as n, Is as r, ro as readXLSX, Ys as t };