xls-codec 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +128 -23
  2. package/dist/biff/bof-writer.cjs +18 -0
  3. package/dist/biff/bof-writer.d.cts +5 -0
  4. package/dist/biff/bof-writer.d.ts +5 -0
  5. package/dist/biff/bof-writer.js +17 -0
  6. package/dist/biff/builder.cjs +48 -0
  7. package/dist/biff/builder.d.cts +17 -0
  8. package/dist/biff/builder.d.ts +17 -0
  9. package/dist/biff/builder.js +47 -0
  10. package/dist/biff/cursor.cjs +4 -0
  11. package/dist/biff/cursor.d.cts +1 -27
  12. package/dist/biff/cursor.d.ts +1 -27
  13. package/dist/biff/cursor.js +4 -0
  14. package/dist/biff/errors.cjs +7 -0
  15. package/dist/biff/errors.d.cts +3 -1
  16. package/dist/biff/errors.d.ts +3 -1
  17. package/dist/biff/errors.js +7 -1
  18. package/dist/biff/print-setup.cjs +108 -0
  19. package/dist/biff/print-setup.d.cts +2 -0
  20. package/dist/biff/print-setup.d.ts +2 -0
  21. package/dist/biff/print-setup.js +103 -0
  22. package/dist/biff/ptg-functions.cjs +383 -0
  23. package/dist/biff/ptg-functions.d.cts +7 -0
  24. package/dist/biff/ptg-functions.d.ts +7 -0
  25. package/dist/biff/ptg-functions.js +381 -0
  26. package/dist/biff/ptg.cjs +319 -0
  27. package/dist/biff/ptg.d.cts +2 -0
  28. package/dist/biff/ptg.d.ts +2 -0
  29. package/dist/biff/ptg.js +318 -0
  30. package/dist/biff/record-types.cjs +60 -0
  31. package/dist/biff/record-types.d.cts +41 -1
  32. package/dist/biff/record-types.d.ts +41 -1
  33. package/dist/biff/record-types.js +41 -1
  34. package/dist/biff/record-writer.cjs +29 -0
  35. package/dist/biff/record-writer.d.cts +7 -0
  36. package/dist/biff/record-writer.d.ts +7 -0
  37. package/dist/biff/record-writer.js +27 -0
  38. package/dist/biff/string-writer.cjs +58 -0
  39. package/dist/biff/string-writer.d.cts +13 -0
  40. package/dist/biff/string-writer.d.ts +13 -0
  41. package/dist/biff/string-writer.js +55 -0
  42. package/dist/biff/strings.d.cts +1 -1
  43. package/dist/biff/strings.d.ts +1 -1
  44. package/dist/biff/substreams.d.cts +1 -20
  45. package/dist/biff/substreams.d.ts +1 -20
  46. package/dist/biff/write-errors.cjs +10 -0
  47. package/dist/biff/write-errors.d.cts +6 -0
  48. package/dist/biff/write-errors.d.ts +6 -0
  49. package/dist/biff/write-errors.js +9 -0
  50. package/dist/biff/xf-colors.cjs +374 -0
  51. package/dist/biff/xf-colors.d.cts +2 -0
  52. package/dist/biff/xf-colors.d.ts +2 -0
  53. package/dist/biff/xf-colors.js +339 -0
  54. package/dist/biff/xf-writer.cjs +96 -0
  55. package/dist/biff/xf-writer.d.cts +29 -0
  56. package/dist/biff/xf-writer.d.ts +29 -0
  57. package/dist/biff/xf-writer.js +90 -0
  58. package/dist/container.cjs +13 -4
  59. package/dist/container.d.cts +10 -3
  60. package/dist/container.d.ts +10 -3
  61. package/dist/container.js +12 -4
  62. package/dist/content.cjs +123 -18
  63. package/dist/content.js +123 -18
  64. package/dist/cursor-VMtw9uVP.d.cts +30 -0
  65. package/dist/cursor-VMtw9uVP.d.ts +30 -0
  66. package/dist/index.cjs +71 -5
  67. package/dist/index.d.cts +20 -10
  68. package/dist/index.d.ts +20 -10
  69. package/dist/index.js +17 -7
  70. package/dist/metadata.cjs +14 -0
  71. package/dist/metadata.d.cts +6 -0
  72. package/dist/metadata.d.ts +6 -0
  73. package/dist/metadata.js +13 -0
  74. package/dist/print-names-D-njuzVw.d.cts +41 -0
  75. package/dist/print-names-DUlpVE00.d.ts +41 -0
  76. package/dist/print-setup-B_ihDvm5.d.cts +57 -0
  77. package/dist/print-setup-B_ihDvm5.d.ts +57 -0
  78. package/dist/ptg-B2K8t3js.d.cts +21 -0
  79. package/dist/ptg-B2K8t3js.d.ts +21 -0
  80. package/dist/serial.cjs +41 -0
  81. package/dist/serial.d.cts +7 -1
  82. package/dist/serial.d.ts +7 -1
  83. package/dist/serial.js +39 -1
  84. package/dist/substreams-D7dQiJbp.d.ts +21 -0
  85. package/dist/substreams-Ddtvn_Vr.d.cts +21 -0
  86. package/dist/units.cjs +37 -0
  87. package/dist/units.d.cts +15 -1
  88. package/dist/units.d.ts +15 -1
  89. package/dist/units.js +33 -1
  90. package/dist/workbook/globals-writer.cjs +122 -0
  91. package/dist/workbook/globals-writer.d.cts +39 -0
  92. package/dist/workbook/globals-writer.d.ts +39 -0
  93. package/dist/workbook/globals-writer.js +120 -0
  94. package/dist/workbook/globals.cjs +72 -8
  95. package/dist/workbook/globals.d.cts +26 -2
  96. package/dist/workbook/globals.d.ts +26 -2
  97. package/dist/workbook/globals.js +71 -7
  98. package/dist/workbook/print-names.cjs +241 -0
  99. package/dist/workbook/print-names.d.cts +2 -0
  100. package/dist/workbook/print-names.d.ts +2 -0
  101. package/dist/workbook/print-names.js +238 -0
  102. package/dist/workbook/sheet-writer.cjs +277 -0
  103. package/dist/workbook/sheet-writer.d.cts +12 -0
  104. package/dist/workbook/sheet-writer.d.ts +12 -0
  105. package/dist/workbook/sheet-writer.js +276 -0
  106. package/dist/workbook/sheet.cjs +125 -17
  107. package/dist/workbook/sheet.d.cts +38 -4
  108. package/dist/workbook/sheet.d.ts +38 -4
  109. package/dist/workbook/sheet.js +125 -17
  110. package/dist/write.cjs +311 -0
  111. package/dist/write.d.cts +13 -0
  112. package/dist/write.d.ts +13 -0
  113. package/dist/write.js +309 -0
  114. package/dist/written-cells.cjs +26 -0
  115. package/dist/written-cells.d.cts +16 -0
  116. package/dist/written-cells.d.ts +16 -0
  117. package/dist/written-cells.js +24 -0
  118. package/dist/xf-colors-CehHZtBy.d.cts +91 -0
  119. package/dist/xf-colors-CpykR3B9.d.ts +91 -0
  120. package/package.json +4 -3
  121. package/dist/number-format.cjs +0 -298
  122. package/dist/number-format.d.cts +0 -32
  123. package/dist/number-format.d.ts +0 -32
  124. package/dist/number-format.js +0 -296
@@ -0,0 +1,27 @@
1
+ import { MAX_RECORD_DATA_SIZE } from "./record-types.js";
2
+ import { BiffWriteError } from "./write-errors.js";
3
+ //#region src/biff/record-writer.ts
4
+ const HEADER_SIZE = 4;
5
+ /** Wraps one record's data in its type/size header. Throws BiffWriteError if the data exceeds the single-record maximum, rather than splitting it across Continue records. */
6
+ function writeRecord(type, data) {
7
+ if (data.length > 8224) throw new BiffWriteError(`record 0x${type.toString(16)} would carry ${data.length} bytes of data, above the ${MAX_RECORD_DATA_SIZE}-byte maximum a single record can hold ([MS-XLS] 2.1.4); this writer does not split oversized records into Continue chains`);
8
+ const out = new Uint8Array(HEADER_SIZE + data.length);
9
+ const view = new DataView(out.buffer);
10
+ view.setUint16(0, type, true);
11
+ view.setUint16(2, data.length, true);
12
+ out.set(data, HEADER_SIZE);
13
+ return out;
14
+ }
15
+ /** Concatenates already-framed records (or any byte sequences) into one stream, in the order given. */
16
+ function concatRecords(...parts) {
17
+ const total = parts.reduce((sum, part) => sum + part.length, 0);
18
+ const out = new Uint8Array(total);
19
+ let offset = 0;
20
+ for (const part of parts) {
21
+ out.set(part, offset);
22
+ offset += part.length;
23
+ }
24
+ return out;
25
+ }
26
+ //#endregion
27
+ export { concatRecords, writeRecord };
@@ -0,0 +1,58 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_biff_write_errors = require("./write-errors.cjs");
3
+ const require_biff_builder = require("./builder.cjs");
4
+ //#region src/biff/string-writer.ts
5
+ /** Bit 0 of a string's flags byte: set when each character occupies a full two-byte UTF-16 code unit ([MS-XLS] 2.5.293/2.5.294/2.5.240's own fHighByte). */
6
+ const FLAG_HIGH_BYTE = 1;
7
+ /** The largest character count a ShortXLUnicodeString's one-byte cch can name. */
8
+ const MAX_SHORT_STRING_LENGTH = 255;
9
+ /** The largest character count an XLUnicodeString/XLUnicodeRichExtendedString's two-byte cch can name. */
10
+ const MAX_STRING_LENGTH = 65535;
11
+ /** Whether every UTF-16 code unit in `text` fits in a single byte -- the compressed-encoding eligibility test, checked per code UNIT rather than per code point so an astral character (whose two surrogate units are each above 0xFF) is correctly ruled ineligible. */
12
+ function encodeCharacters(text) {
13
+ let needsHighByte = false;
14
+ for (let index = 0; index < text.length; index += 1) if (text.charCodeAt(index) > 255) {
15
+ needsHighByte = true;
16
+ break;
17
+ }
18
+ const builder = new require_biff_builder.RecordBuilder();
19
+ for (let index = 0; index < text.length; index += 1) {
20
+ const unit = text.charCodeAt(index);
21
+ if (needsHighByte) builder.u16(unit);
22
+ else builder.u8(unit);
23
+ }
24
+ return {
25
+ highByte: needsHighByte,
26
+ units: builder.build()
27
+ };
28
+ }
29
+ function checkedLength(text, max, shape) {
30
+ if (text.length > max) throw new require_biff_write_errors.BiffWriteError(`${shape} cannot hold ${text.length} UTF-16 code units, above its own ${max}-unit limit (text: ${JSON.stringify(text.length > 40 ? `${text.slice(0, 40)}...` : text)})`);
31
+ return text.length;
32
+ }
33
+ /** An XLUnicodeString ([MS-XLS] 2.5.294): a two-byte character count, a flags byte, then the characters. */
34
+ function writeXLUnicodeString(text) {
35
+ const cch = checkedLength(text, MAX_STRING_LENGTH, "XLUnicodeString");
36
+ const { highByte, units } = encodeCharacters(text);
37
+ return new require_biff_builder.RecordBuilder().u16(cch).u8(highByte ? FLAG_HIGH_BYTE : 0).bytes(units).build();
38
+ }
39
+ /** A ShortXLUnicodeString ([MS-XLS] 2.5.240): as above, with a one-byte character count. */
40
+ function writeShortXLUnicodeString(text) {
41
+ const cch = checkedLength(text, MAX_SHORT_STRING_LENGTH, "ShortXLUnicodeString");
42
+ const { highByte, units } = encodeCharacters(text);
43
+ return new require_biff_builder.RecordBuilder().u8(cch).u8(highByte ? FLAG_HIGH_BYTE : 0).bytes(units).build();
44
+ }
45
+ /**
46
+ * An XLUnicodeRichExtendedString ([MS-XLS] 2.5.293): the SST's own element shape.
47
+ *
48
+ * Always written with no formatting runs and no phonetic payload -- this package reads a shared string's text only (see biff/strings.ts's own readRichExtendedString), so there is never run or phonetic data to re-emit. The rich/extended flag bits are left clear accordingly.
49
+ */
50
+ function writeRichExtendedString(text) {
51
+ const cch = checkedLength(text, MAX_STRING_LENGTH, "XLUnicodeRichExtendedString");
52
+ const { highByte, units } = encodeCharacters(text);
53
+ return new require_biff_builder.RecordBuilder().u16(cch).u8(highByte ? FLAG_HIGH_BYTE : 0).bytes(units).build();
54
+ }
55
+ //#endregion
56
+ exports.writeRichExtendedString = writeRichExtendedString;
57
+ exports.writeShortXLUnicodeString = writeShortXLUnicodeString;
58
+ exports.writeXLUnicodeString = writeXLUnicodeString;
@@ -0,0 +1,13 @@
1
+ //#region src/biff/string-writer.d.ts
2
+ /** An XLUnicodeString ([MS-XLS] 2.5.294): a two-byte character count, a flags byte, then the characters. */
3
+ declare function writeXLUnicodeString(text: string): Uint8Array<ArrayBuffer>;
4
+ /** A ShortXLUnicodeString ([MS-XLS] 2.5.240): as above, with a one-byte character count. */
5
+ declare function writeShortXLUnicodeString(text: string): Uint8Array<ArrayBuffer>;
6
+ /**
7
+ * An XLUnicodeRichExtendedString ([MS-XLS] 2.5.293): the SST's own element shape.
8
+ *
9
+ * Always written with no formatting runs and no phonetic payload -- this package reads a shared string's text only (see biff/strings.ts's own readRichExtendedString), so there is never run or phonetic data to re-emit. The rich/extended flag bits are left clear accordingly.
10
+ */
11
+ declare function writeRichExtendedString(text: string): Uint8Array<ArrayBuffer>;
12
+ //#endregion
13
+ export { writeRichExtendedString, writeShortXLUnicodeString, writeXLUnicodeString };
@@ -0,0 +1,13 @@
1
+ //#region src/biff/string-writer.d.ts
2
+ /** An XLUnicodeString ([MS-XLS] 2.5.294): a two-byte character count, a flags byte, then the characters. */
3
+ declare function writeXLUnicodeString(text: string): Uint8Array<ArrayBuffer>;
4
+ /** A ShortXLUnicodeString ([MS-XLS] 2.5.240): as above, with a one-byte character count. */
5
+ declare function writeShortXLUnicodeString(text: string): Uint8Array<ArrayBuffer>;
6
+ /**
7
+ * An XLUnicodeRichExtendedString ([MS-XLS] 2.5.293): the SST's own element shape.
8
+ *
9
+ * Always written with no formatting runs and no phonetic payload -- this package reads a shared string's text only (see biff/strings.ts's own readRichExtendedString), so there is never run or phonetic data to re-emit. The rich/extended flag bits are left clear accordingly.
10
+ */
11
+ declare function writeRichExtendedString(text: string): Uint8Array<ArrayBuffer>;
12
+ //#endregion
13
+ export { writeRichExtendedString, writeShortXLUnicodeString, writeXLUnicodeString };
@@ -0,0 +1,55 @@
1
+ import { BiffWriteError } from "./write-errors.js";
2
+ import { RecordBuilder } from "./builder.js";
3
+ //#region src/biff/string-writer.ts
4
+ /** Bit 0 of a string's flags byte: set when each character occupies a full two-byte UTF-16 code unit ([MS-XLS] 2.5.293/2.5.294/2.5.240's own fHighByte). */
5
+ const FLAG_HIGH_BYTE = 1;
6
+ /** The largest character count a ShortXLUnicodeString's one-byte cch can name. */
7
+ const MAX_SHORT_STRING_LENGTH = 255;
8
+ /** The largest character count an XLUnicodeString/XLUnicodeRichExtendedString's two-byte cch can name. */
9
+ const MAX_STRING_LENGTH = 65535;
10
+ /** Whether every UTF-16 code unit in `text` fits in a single byte -- the compressed-encoding eligibility test, checked per code UNIT rather than per code point so an astral character (whose two surrogate units are each above 0xFF) is correctly ruled ineligible. */
11
+ function encodeCharacters(text) {
12
+ let needsHighByte = false;
13
+ for (let index = 0; index < text.length; index += 1) if (text.charCodeAt(index) > 255) {
14
+ needsHighByte = true;
15
+ break;
16
+ }
17
+ const builder = new RecordBuilder();
18
+ for (let index = 0; index < text.length; index += 1) {
19
+ const unit = text.charCodeAt(index);
20
+ if (needsHighByte) builder.u16(unit);
21
+ else builder.u8(unit);
22
+ }
23
+ return {
24
+ highByte: needsHighByte,
25
+ units: builder.build()
26
+ };
27
+ }
28
+ function checkedLength(text, max, shape) {
29
+ if (text.length > max) throw new BiffWriteError(`${shape} cannot hold ${text.length} UTF-16 code units, above its own ${max}-unit limit (text: ${JSON.stringify(text.length > 40 ? `${text.slice(0, 40)}...` : text)})`);
30
+ return text.length;
31
+ }
32
+ /** An XLUnicodeString ([MS-XLS] 2.5.294): a two-byte character count, a flags byte, then the characters. */
33
+ function writeXLUnicodeString(text) {
34
+ const cch = checkedLength(text, MAX_STRING_LENGTH, "XLUnicodeString");
35
+ const { highByte, units } = encodeCharacters(text);
36
+ return new RecordBuilder().u16(cch).u8(highByte ? FLAG_HIGH_BYTE : 0).bytes(units).build();
37
+ }
38
+ /** A ShortXLUnicodeString ([MS-XLS] 2.5.240): as above, with a one-byte character count. */
39
+ function writeShortXLUnicodeString(text) {
40
+ const cch = checkedLength(text, MAX_SHORT_STRING_LENGTH, "ShortXLUnicodeString");
41
+ const { highByte, units } = encodeCharacters(text);
42
+ return new RecordBuilder().u8(cch).u8(highByte ? FLAG_HIGH_BYTE : 0).bytes(units).build();
43
+ }
44
+ /**
45
+ * An XLUnicodeRichExtendedString ([MS-XLS] 2.5.293): the SST's own element shape.
46
+ *
47
+ * Always written with no formatting runs and no phonetic payload -- this package reads a shared string's text only (see biff/strings.ts's own readRichExtendedString), so there is never run or phonetic data to re-emit. The rich/extended flag bits are left clear accordingly.
48
+ */
49
+ function writeRichExtendedString(text) {
50
+ const cch = checkedLength(text, MAX_STRING_LENGTH, "XLUnicodeRichExtendedString");
51
+ const { highByte, units } = encodeCharacters(text);
52
+ return new RecordBuilder().u16(cch).u8(highByte ? FLAG_HIGH_BYTE : 0).bytes(units).build();
53
+ }
54
+ //#endregion
55
+ export { writeRichExtendedString, writeShortXLUnicodeString, writeXLUnicodeString };
@@ -1,4 +1,4 @@
1
- import { BlockCursor } from "./cursor.cjs";
1
+ import { t as BlockCursor } from "../cursor-VMtw9uVP.cjs";
2
2
  //#region src/biff/strings.d.ts
3
3
  /** An XLUnicodeString ([MS-XLS] 2.5.294): a two-byte character count, a flags byte, then the characters. Continuable, since the String record ([MS-XLS] 2.4.268) carrying a formula's string result is one of these and its own production admits trailing Continues. */
4
4
  declare function readXLUnicodeString(cursor: BlockCursor): string;
@@ -1,4 +1,4 @@
1
- import { BlockCursor } from "./cursor.js";
1
+ import { t as BlockCursor } from "../cursor-VMtw9uVP.js";
2
2
  //#region src/biff/strings.d.ts
3
3
  /** An XLUnicodeString ([MS-XLS] 2.5.294): a two-byte character count, a flags byte, then the characters. Continuable, since the String record ([MS-XLS] 2.4.268) carrying a formula's string result is one of these and its own production admits trailing Continues. */
4
4
  declare function readXLUnicodeString(cursor: BlockCursor): string;
@@ -1,21 +1,2 @@
1
- import { n as BiffRecord } from "../records-DVIqXFKk.cjs";
2
- //#region src/biff/substreams.d.ts
3
- /** One logical record: its type, its data blocks -- the base record's, then one per Continue that followed it -- and the base record's own offset in the stream. */
4
- interface RecordGroup {
5
- readonly type: number;
6
- readonly blocks: readonly Uint8Array<ArrayBuffer>[];
7
- readonly offset: number;
8
- }
9
- /** One substream: the document type its BOF declared, the records between that BOF and its EOF, its ordinal position among the stream's substreams, and the stream offset of its own BOF -- which is what a BoundSheet8's lbPlyPos names. */
10
- interface Substream {
11
- readonly documentType: number;
12
- readonly records: readonly RecordGroup[];
13
- readonly index: number;
14
- readonly offset: number;
15
- }
16
- /** Joins each record to the Continue records following it, keeping the blocks separate. */
17
- declare function groupRecords(records: readonly BiffRecord[]): readonly RecordGroup[];
18
- /** Splits a grouped record sequence into its substreams, verifying each BOF declares BIFF8. */
19
- declare function splitSubstreams(groups: readonly RecordGroup[]): readonly Substream[];
20
- //#endregion
1
+ import { i as splitSubstreams, n as Substream, r as groupRecords, t as RecordGroup } from "../substreams-Ddtvn_Vr.cjs";
21
2
  export { RecordGroup, Substream, groupRecords, splitSubstreams };
@@ -1,21 +1,2 @@
1
- import { n as BiffRecord } from "../records-DVIqXFKk.js";
2
- //#region src/biff/substreams.d.ts
3
- /** One logical record: its type, its data blocks -- the base record's, then one per Continue that followed it -- and the base record's own offset in the stream. */
4
- interface RecordGroup {
5
- readonly type: number;
6
- readonly blocks: readonly Uint8Array<ArrayBuffer>[];
7
- readonly offset: number;
8
- }
9
- /** One substream: the document type its BOF declared, the records between that BOF and its EOF, its ordinal position among the stream's substreams, and the stream offset of its own BOF -- which is what a BoundSheet8's lbPlyPos names. */
10
- interface Substream {
11
- readonly documentType: number;
12
- readonly records: readonly RecordGroup[];
13
- readonly index: number;
14
- readonly offset: number;
15
- }
16
- /** Joins each record to the Continue records following it, keeping the blocks separate. */
17
- declare function groupRecords(records: readonly BiffRecord[]): readonly RecordGroup[];
18
- /** Splits a grouped record sequence into its substreams, verifying each BOF declares BIFF8. */
19
- declare function splitSubstreams(groups: readonly RecordGroup[]): readonly Substream[];
20
- //#endregion
1
+ import { i as splitSubstreams, n as Substream, r as groupRecords, t as RecordGroup } from "../substreams-D7dQiJbp.js";
21
2
  export { RecordGroup, Substream, groupRecords, splitSubstreams };
@@ -0,0 +1,10 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/biff/write-errors.ts
3
+ var BiffWriteError = class extends Error {
4
+ constructor(message) {
5
+ super(message);
6
+ this.name = "BiffWriteError";
7
+ }
8
+ };
9
+ //#endregion
10
+ exports.BiffWriteError = BiffWriteError;
@@ -0,0 +1,6 @@
1
+ //#region src/biff/write-errors.d.ts
2
+ declare class BiffWriteError extends Error {
3
+ constructor(message: string);
4
+ }
5
+ //#endregion
6
+ export { BiffWriteError };
@@ -0,0 +1,6 @@
1
+ //#region src/biff/write-errors.d.ts
2
+ declare class BiffWriteError extends Error {
3
+ constructor(message: string);
4
+ }
5
+ //#endregion
6
+ export { BiffWriteError };
@@ -0,0 +1,9 @@
1
+ //#region src/biff/write-errors.ts
2
+ var BiffWriteError = class extends Error {
3
+ constructor(message) {
4
+ super(message);
5
+ this.name = "BiffWriteError";
6
+ }
7
+ };
8
+ //#endregion
9
+ export { BiffWriteError };
@@ -0,0 +1,374 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let document_schema_js = require("document-schema.js");
3
+ //#region src/biff/xf-colors.ts
4
+ /** FLSNULL: no fill pattern -- the cell's fill colour fields carry no meaning. */
5
+ const FILL_PATTERN_NONE = 0;
6
+ /** FLSSOLID: a solid fill, the only pattern this package maps onto ContentSheetCell.background -- "If this value is 1 ... then only icvFore is rendered" ([MS-XLS] CellXF). Every other pattern (50%/75%/25% gray, the stripe and crosshatch families, ...) is a real information-loss case this reader does not approximate: see resolveFillBackground below. */
7
+ const FILL_PATTERN_SOLID = 1;
8
+ const ALC_GENERAL = 0;
9
+ const ALC_LEFT = 1;
10
+ const ALC_CENTER = 2;
11
+ const ALC_RIGHT = 3;
12
+ const ALC_JUSTIFY = 5;
13
+ const ALCV_TOP = 0;
14
+ const ALCV_CENTER = 1;
15
+ const ALCV_BOTTOM = 2;
16
+ /** alc (a CellXF/StyleXF payload's word1, bits 0-2) -> ContentSheetCell.alignment, or undefined for ALCGEN (the value-kind default this field being absent already requests) and for the three HorizAlign members (ALCFILL/ALCCONTCTR/ALCDIST) Alignment has no member for -- matching ooxml.js's readHorizontalAlignment policy of only the four direct members surviving. */
17
+ function resolveHorizontalAlignment(alc) {
18
+ switch (alc) {
19
+ case ALC_LEFT: return "left";
20
+ case ALC_CENTER: return "center";
21
+ case ALC_RIGHT: return "right";
22
+ case ALC_JUSTIFY: return "justify";
23
+ default: return;
24
+ }
25
+ }
26
+ /** ContentSheetCell.alignment -> the alc token to pack into word1 -- undefined maps to ALCGEN, the "use the value-kind default" token every genuinely unaligned cell already carried before this module modelled alignment at all. */
27
+ function horizAlignTokenFor(alignment) {
28
+ switch (alignment) {
29
+ case "left": return ALC_LEFT;
30
+ case "center": return ALC_CENTER;
31
+ case "right": return ALC_RIGHT;
32
+ case "justify": return ALC_JUSTIFY;
33
+ default: return ALC_GENERAL;
34
+ }
35
+ }
36
+ /** alcV (word1, bits 4-6) -> ContentSheetCell.verticalAlignment, or undefined for ALCVBOT (the schema's own documented default for an absent verticalAlignment) and for the two VertAlign members (ALCVJUST/ALCVDIST) the schema has no member for -- matching ooxml.js's readVerticalAlignment policy. */
37
+ function resolveVerticalAlignment(alcV) {
38
+ switch (alcV) {
39
+ case ALCV_TOP: return "top";
40
+ case ALCV_CENTER: return "middle";
41
+ default: return;
42
+ }
43
+ }
44
+ /** ContentSheetCell.verticalAlignment -> the alcV token to pack into word1 -- undefined (meaning 'bottom', the schema's own documented default) and the literal 'bottom' both map to ALCVBOT, exactly what an unaligned cell already carried before this module modelled alignment at all. */
45
+ function vertAlignTokenFor(verticalAlignment) {
46
+ switch (verticalAlignment) {
47
+ case "top": return ALCV_TOP;
48
+ case "middle": return ALCV_CENTER;
49
+ default: return ALCV_BOTTOM;
50
+ }
51
+ }
52
+ const BORDER_STYLE_NONE = 0;
53
+ const BORDER_STYLE_THIN = 1;
54
+ const BORDER_STYLE_MEDIUM = 2;
55
+ const BORDER_STYLE_DASHED = 3;
56
+ const BORDER_STYLE_DOTTED = 4;
57
+ const BORDER_STYLE_THICK = 5;
58
+ const BORDER_STYLE_DOUBLE = 6;
59
+ const BORDER_STYLE_HAIR = 7;
60
+ const BORDER_STYLE_MEDIUM_DASHED = 8;
61
+ const BORDER_STYLE_DASHDOT = 9;
62
+ const BORDER_STYLE_MEDIUM_DASHDOT = 10;
63
+ const BORDER_STYLE_DASHDOTDOT = 11;
64
+ const BORDER_STYLE_MEDIUM_DASHDOTDOT = 12;
65
+ const BORDER_STYLE_SLANT_DASHDOT = 13;
66
+ /** IcvXF's two "Automatic" special values: the foreground/background pair a real Excel-written XF with no explicit fill carries, and what this package's own writer emits for an undecorated cell. */
67
+ const ICV_AUTOMATIC_FOREGROUND = 64;
68
+ const ICV_AUTOMATIC_BACKGROUND = 65;
69
+ const RGB_BYTE_MAX = 255;
70
+ function rgb255(r, g, b) {
71
+ return {
72
+ r: r / RGB_BYTE_MAX,
73
+ g: g / RGB_BYTE_MAX,
74
+ b: b / RGB_BYTE_MAX
75
+ };
76
+ }
77
+ /** Icv values 0x00-0x07: the eight fixed built-in colour constants every BIFF8 reader recognises regardless of a Palette record. This package's own writer never emits one of these (IcvXF's own field documentation: "This value SHOULD NOT be ... less than or equal to 0x07" -- the default-palette table below duplicates all eight at icv 8-15, which is what this writer uses instead), but a real third-party file may still carry one, so the read side resolves them. */
78
+ const FIXED_COLOR_TABLE = [
79
+ rgb255(0, 0, 0),
80
+ rgb255(255, 255, 255),
81
+ rgb255(255, 0, 0),
82
+ rgb255(0, 255, 0),
83
+ rgb255(0, 0, 255),
84
+ rgb255(255, 255, 0),
85
+ rgb255(255, 0, 255),
86
+ rgb255(0, 255, 255)
87
+ ];
88
+ /** icv 8-63's own base offset: icv 8 is rgColor[0] of a Palette record (or the default table's own entry 0) -- [MS-XLS] "Icv"'s own colour-table layout. */
89
+ const PALETTE_BASE_ICV = 8;
90
+ /** A Palette record's own fixed entry count ([MS-XLS] 2.4.188: "The value MUST be 56"). */
91
+ const PALETTE_ENTRY_COUNT = 56;
92
+ /** The 56-entry default colour table icv 8-63 resolve through when no Palette record is present ([MS-XLS] "Icv"'s own default-red/green/blue columns), in icv order (index 0 = icv 8). Entries 0-7 duplicate the eight fixed colours above at their own icv+8 position -- the reason this package's writer allocates a fixed colour there rather than at icv 0-7 directly. */
93
+ const DEFAULT_PALETTE_TABLE = [
94
+ rgb255(0, 0, 0),
95
+ rgb255(255, 255, 255),
96
+ rgb255(255, 0, 0),
97
+ rgb255(0, 255, 0),
98
+ rgb255(0, 0, 255),
99
+ rgb255(255, 255, 0),
100
+ rgb255(255, 0, 255),
101
+ rgb255(0, 255, 255),
102
+ rgb255(128, 0, 0),
103
+ rgb255(0, 128, 0),
104
+ rgb255(0, 0, 128),
105
+ rgb255(128, 128, 0),
106
+ rgb255(128, 0, 128),
107
+ rgb255(0, 128, 128),
108
+ rgb255(192, 192, 192),
109
+ rgb255(128, 128, 128),
110
+ rgb255(153, 153, 255),
111
+ rgb255(153, 51, 102),
112
+ rgb255(255, 255, 204),
113
+ rgb255(204, 255, 255),
114
+ rgb255(102, 0, 102),
115
+ rgb255(255, 128, 128),
116
+ rgb255(0, 102, 204),
117
+ rgb255(204, 204, 255),
118
+ rgb255(0, 0, 128),
119
+ rgb255(255, 0, 255),
120
+ rgb255(255, 255, 0),
121
+ rgb255(0, 255, 255),
122
+ rgb255(128, 0, 128),
123
+ rgb255(128, 0, 0),
124
+ rgb255(0, 128, 128),
125
+ rgb255(0, 0, 255),
126
+ rgb255(0, 204, 255),
127
+ rgb255(204, 255, 255),
128
+ rgb255(204, 255, 204),
129
+ rgb255(255, 255, 153),
130
+ rgb255(153, 204, 255),
131
+ rgb255(255, 153, 204),
132
+ rgb255(204, 153, 255),
133
+ rgb255(255, 204, 153),
134
+ rgb255(51, 102, 255),
135
+ rgb255(51, 204, 204),
136
+ rgb255(153, 204, 0),
137
+ rgb255(255, 204, 0),
138
+ rgb255(255, 153, 0),
139
+ rgb255(255, 102, 0),
140
+ rgb255(102, 102, 153),
141
+ rgb255(150, 150, 150),
142
+ rgb255(0, 51, 102),
143
+ rgb255(51, 153, 102),
144
+ rgb255(0, 51, 0),
145
+ rgb255(51, 51, 0),
146
+ rgb255(153, 51, 0),
147
+ rgb255(153, 51, 102),
148
+ rgb255(51, 51, 153),
149
+ rgb255(51, 51, 51)
150
+ ];
151
+ /** The reverse of DEFAULT_PALETTE_TABLE: a decoration colour's own hex string to the icv (8-63) it resolves to with NO Palette record present. write.ts's own colour-interning pass consults this to decide whether a workbook needs a real Palette record at all, or whether every distinct decoration colour it uses already has a home in the fixed default table. */
152
+ const DEFAULT_PALETTE_HEX_TO_ICV = new Map(DEFAULT_PALETTE_TABLE.map((color, index) => [(0, document_schema_js.colorToRgbHex)(color), 8 + index]));
153
+ /**
154
+ * Resolves an icv colour-table index to a real colour, or undefined when the index names something this package cannot express as a fixed RGB value: 0x40/0x41 ("Automatic", a display-setting colour with no fixed literal), 0x48/0x4D-0x51/0x7FFF (chart/tooltip display colours, out of scope for a cell's own fill/border), or anything else outside the documented ranges.
155
+ *
156
+ * `palette`, when given, is the workbook's own Palette record contents (56 entries, icv 8 first); when undefined, icv 8-63 resolve through the fixed default table instead -- [MS-XLS] "Icv"'s own documented fallback for a file carrying no Palette record.
157
+ */
158
+ function resolveIcvColor(icv, palette) {
159
+ if (icv >= 0 && icv < FIXED_COLOR_TABLE.length) return FIXED_COLOR_TABLE[icv];
160
+ if (icv >= 8 && icv < 64) {
161
+ const index = icv - 8;
162
+ return palette === void 0 ? DEFAULT_PALETTE_TABLE[index] : palette[index];
163
+ }
164
+ }
165
+ /** Every BorderStyle token this reader resolves to a (weight, pattern) pair -- BORDER_STYLE_NONE has no entry, since "no border" is handled by the caller before consulting this table. The dash-family tokens (dashDot/dashDotDot and their medium/slant variants) collapse to 'dashed', the closest ContentStrokeStyle member, exactly as ooxml.js's own XLSX_BORDER_STYLE table does for the equivalent xlsx tokens. */
166
+ const BIFF_BORDER_STYLE = {
167
+ [1]: {
168
+ weight: "thin",
169
+ pattern: "solid"
170
+ },
171
+ [2]: {
172
+ weight: "medium",
173
+ pattern: "solid"
174
+ },
175
+ [3]: {
176
+ weight: "thin",
177
+ pattern: "dashed"
178
+ },
179
+ [4]: {
180
+ weight: "thin",
181
+ pattern: "dotted"
182
+ },
183
+ [5]: {
184
+ weight: "thick",
185
+ pattern: "solid"
186
+ },
187
+ [6]: {
188
+ weight: "thin",
189
+ pattern: "double"
190
+ },
191
+ [7]: {
192
+ weight: "hair",
193
+ pattern: "solid"
194
+ },
195
+ [8]: {
196
+ weight: "medium",
197
+ pattern: "dashed"
198
+ },
199
+ [9]: {
200
+ weight: "thin",
201
+ pattern: "dashed"
202
+ },
203
+ [10]: {
204
+ weight: "medium",
205
+ pattern: "dashed"
206
+ },
207
+ [11]: {
208
+ weight: "thin",
209
+ pattern: "dashed"
210
+ },
211
+ [12]: {
212
+ weight: "medium",
213
+ pattern: "dashed"
214
+ },
215
+ [13]: {
216
+ weight: "medium",
217
+ pattern: "dashed"
218
+ }
219
+ };
220
+ /** Resolves one border edge to a ContentBorder, or undefined when the edge carries no border (style is BORDER_STYLE_NONE), names a reserved/unrecognised style token, or its colour does not resolve to a fixed RGB value (an "Automatic" or display-setting icv, which [MS-XLS] documents as illegal for a well-formed border but a malformed file could still carry). */
221
+ function resolveBorderEdge(edge, palette) {
222
+ if (edge.style === 0) return;
223
+ const resolved = BIFF_BORDER_STYLE[edge.style];
224
+ if (resolved === void 0) return;
225
+ const color = resolveIcvColor(edge.icv, palette);
226
+ if (color === void 0) return;
227
+ const result = {
228
+ color,
229
+ widthPt: document_schema_js.BORDER_WIDTH_PT[resolved.weight]
230
+ };
231
+ if (resolved.pattern !== "solid") result.style = resolved.pattern;
232
+ return result;
233
+ }
234
+ /** The BorderStyle token each named weight's own plain solid stroke is spelled with. */
235
+ const SOLID_BORDER_STYLE = {
236
+ hair: 7,
237
+ thin: 1,
238
+ medium: 2,
239
+ thick: 5
240
+ };
241
+ /** The inverse of resolveBorderEdge's style resolution: picks the BorderStyle token carrying a ContentBorder's own pattern at the closest named weight, bucketing a solid/dashed border's widthPt back to a weight through document-schema.js's own shared quantisation -- the same one resolveBorderEdge's widths came out of, and the same one ooxml.js's borderToXlsxStyle buckets xlsx's string tokens through. */
242
+ function borderStyleTokenFor(border) {
243
+ switch (border.style) {
244
+ case "double": return 6;
245
+ case "dotted": return 4;
246
+ case "dashed": return (0, document_schema_js.dashedBorderWeightForWidthPt)(border.widthPt) === "medium" ? 8 : 3;
247
+ case "solid":
248
+ case void 0: return SOLID_BORDER_STYLE[(0, document_schema_js.borderWeightForWidthPt)(border.widthPt)];
249
+ }
250
+ }
251
+ /** A solid fill's own foreground colour resolved to a real background, or undefined for every other FillPattern value -- FLSNULL (no fill at all) and every pattern beyond solid (50%/75%/25% gray, the stripe and crosshatch family) alike. A non-solid pattern is a real information-loss case rather than an oversight: ContentSheetCell.background models one flat colour, and approximating a striped or crosshatched fill as its foreground colour alone would misrepresent what the cell actually shows -- see xls-codec's README for this package's own stated judgment call. */
252
+ function resolveFillBackground(fillPattern, foregroundIcv, palette) {
253
+ if (fillPattern !== 1) return;
254
+ return resolveIcvColor(foregroundIcv, palette);
255
+ }
256
+ const UNDECORATED_EDGE = {
257
+ style: 0,
258
+ icv: 0
259
+ };
260
+ /** The fields a genuinely undecorated cell XF carries -- no fill, no borders -- matching exactly what xf-writer.ts wrote before this module existed (icvFore/icvBack at the "Automatic" special values, fls/dg all 0), so packXfDecorationWords() with no argument reproduces the identical bytes. */
261
+ const UNDECORATED_XF_FIELDS = {
262
+ fillPattern: 0,
263
+ fillForegroundIcv: 64,
264
+ left: UNDECORATED_EDGE,
265
+ right: UNDECORATED_EDGE,
266
+ top: UNDECORATED_EDGE,
267
+ bottom: UNDECORATED_EDGE
268
+ };
269
+ /** Unpacks word1 -- the CellXF/StyleXF trailing payload's leading word ([MS-XLS] 2.4.353's own field table, cited in full in xf-writer.ts's packAlignmentPrefix) -- into the two fields this package's schema can express: alc (bits 0-2) and alcV (bits 4-6). Every other field the word carries (fWrap, fJustLast, trot, cIndent, fShrinkToFit, iReadOrder, the fAtr* inheritance flags) has no ContentSheetCell counterpart and is not read. */
270
+ function unpackXfAlignment(word1) {
271
+ const alc = word1 & 7;
272
+ const alcV = word1 >>> 4 & 7;
273
+ return {
274
+ horizontal: resolveHorizontalAlignment(alc),
275
+ vertical: resolveVerticalAlignment(alcV)
276
+ };
277
+ }
278
+ /** Unpacks the three raw words a CellXF/StyleXF trailing payload's border/fill fields live in ([MS-XLS] 2.4.353's own field table, cited in full in xf-writer.ts's packXfDecorationWords below) into XfDecorationFields. word2 is the 32-bit border word (dgLeft/dgRight/dgTop/dgBottom/icvLeft/icvRight/grbitDiag), word3 the 32-bit fill-pattern word (icvTop/icvBottom/icvDiag/dgDiag/fHasXFExt/fls), word4 the 16-bit fill-colour word (icvFore/icvBack/...). */
279
+ function unpackXfDecoration(word2, word3, word4) {
280
+ const dgLeft = word2 & 15;
281
+ const dgRight = word2 >>> 4 & 15;
282
+ const dgTop = word2 >>> 8 & 15;
283
+ const dgBottom = word2 >>> 12 & 15;
284
+ const icvLeft = word2 >>> 16 & 127;
285
+ const icvRight = word2 >>> 23 & 127;
286
+ const icvTop = word3 & 127;
287
+ const icvBottom = word3 >>> 7 & 127;
288
+ return {
289
+ fillPattern: word3 >>> 26 & 63,
290
+ fillForegroundIcv: word4 & 127,
291
+ left: {
292
+ style: dgLeft,
293
+ icv: icvLeft
294
+ },
295
+ right: {
296
+ style: dgRight,
297
+ icv: icvRight
298
+ },
299
+ top: {
300
+ style: dgTop,
301
+ icv: icvTop
302
+ },
303
+ bottom: {
304
+ style: dgBottom,
305
+ icv: icvBottom
306
+ }
307
+ };
308
+ }
309
+ /**
310
+ * Packs XfDecorationFields back into the three raw words unpackXfDecoration reads -- the write-side mirror, and (with no argument) the exact bytes a genuinely undecorated XF always carried before this module existed: word2/word3 all zero (no borders, no fill pattern), word4 at the "Automatic" foreground/background pair. Diagonal fields (grbitDiag, dgDiag, icvDiag, fHasXFExt/reserved2) are always written as 0 -- this package's writer never emits a diagonal border.
311
+ *
312
+ * [MS-XLS] 2.4.353's own CellXF field table, the layout every bit position below is cited to: word2 = dgLeft(4) dgRight(4) dgTop(4) dgBottom(4) icvLeft(7) icvRight(7) grbitDiag(2); word3 = icvTop(7) icvBottom(7) icvDiag(7) dgDiag(4) fHasXFExt(1) fls(6); word4 = icvFore(7) icvBack(7) fsxButton(1) reserved3(1). https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/671c8577-901f-4215-9ebf-6f5890e5896d
313
+ */
314
+ function packXfDecorationWords(decoration = UNDECORATED_XF_FIELDS) {
315
+ const { left, right, top, bottom } = decoration;
316
+ return {
317
+ word2: left.style & 15 | (right.style & 15) << 4 | (top.style & 15) << 8 | (bottom.style & 15) << 12 | (left.icv & 127) << 16 | (right.icv & 127) << 23 | 0,
318
+ word3: top.icv & 127 | (bottom.icv & 127) << 7 | 0 | (decoration.fillPattern & 63) << 26,
319
+ word4: (decoration.fillPattern === 1 ? decoration.fillForegroundIcv : 64) & 127 | 8320
320
+ };
321
+ }
322
+ /** LongRGB: red, green, blue, then a reserved byte that MUST be 0 -- one entry of a Palette record's rgColor array, or of the fixed-length buffer this package's own writer emits. */
323
+ function readLongRgbColor(cursor) {
324
+ const r = cursor.u8();
325
+ const g = cursor.u8();
326
+ const b = cursor.u8();
327
+ cursor.u8();
328
+ return rgb255(r, g, b);
329
+ }
330
+ /** The inverse of readLongRgbColor: a colour's own red/green/blue/reserved bytes, rounded to the nearest byte (the same rounding colorToRgbHex applies) -- exact for any colour this package itself constructed via rgbHexToColor, which is what write.ts's own palette-colour interning does. */
331
+ function longRgbBytesOf(color) {
332
+ return [
333
+ Math.round(color.r * RGB_BYTE_MAX),
334
+ Math.round(color.g * RGB_BYTE_MAX),
335
+ Math.round(color.b * RGB_BYTE_MAX),
336
+ 0
337
+ ];
338
+ }
339
+ //#endregion
340
+ exports.BORDER_STYLE_DASHDOT = BORDER_STYLE_DASHDOT;
341
+ exports.BORDER_STYLE_DASHDOTDOT = BORDER_STYLE_DASHDOTDOT;
342
+ exports.BORDER_STYLE_DASHED = BORDER_STYLE_DASHED;
343
+ exports.BORDER_STYLE_DOTTED = BORDER_STYLE_DOTTED;
344
+ exports.BORDER_STYLE_DOUBLE = BORDER_STYLE_DOUBLE;
345
+ exports.BORDER_STYLE_HAIR = BORDER_STYLE_HAIR;
346
+ exports.BORDER_STYLE_MEDIUM = BORDER_STYLE_MEDIUM;
347
+ exports.BORDER_STYLE_MEDIUM_DASHDOT = BORDER_STYLE_MEDIUM_DASHDOT;
348
+ exports.BORDER_STYLE_MEDIUM_DASHDOTDOT = BORDER_STYLE_MEDIUM_DASHDOTDOT;
349
+ exports.BORDER_STYLE_MEDIUM_DASHED = BORDER_STYLE_MEDIUM_DASHED;
350
+ exports.BORDER_STYLE_NONE = BORDER_STYLE_NONE;
351
+ exports.BORDER_STYLE_SLANT_DASHDOT = BORDER_STYLE_SLANT_DASHDOT;
352
+ exports.BORDER_STYLE_THICK = BORDER_STYLE_THICK;
353
+ exports.BORDER_STYLE_THIN = BORDER_STYLE_THIN;
354
+ exports.DEFAULT_PALETTE_HEX_TO_ICV = DEFAULT_PALETTE_HEX_TO_ICV;
355
+ exports.FILL_PATTERN_NONE = FILL_PATTERN_NONE;
356
+ exports.FILL_PATTERN_SOLID = FILL_PATTERN_SOLID;
357
+ exports.ICV_AUTOMATIC_BACKGROUND = ICV_AUTOMATIC_BACKGROUND;
358
+ exports.ICV_AUTOMATIC_FOREGROUND = ICV_AUTOMATIC_FOREGROUND;
359
+ exports.PALETTE_BASE_ICV = PALETTE_BASE_ICV;
360
+ exports.PALETTE_ENTRY_COUNT = PALETTE_ENTRY_COUNT;
361
+ exports.UNDECORATED_XF_FIELDS = UNDECORATED_XF_FIELDS;
362
+ exports.borderStyleTokenFor = borderStyleTokenFor;
363
+ exports.horizAlignTokenFor = horizAlignTokenFor;
364
+ exports.longRgbBytesOf = longRgbBytesOf;
365
+ exports.packXfDecorationWords = packXfDecorationWords;
366
+ exports.readLongRgbColor = readLongRgbColor;
367
+ exports.resolveBorderEdge = resolveBorderEdge;
368
+ exports.resolveFillBackground = resolveFillBackground;
369
+ exports.resolveHorizontalAlignment = resolveHorizontalAlignment;
370
+ exports.resolveIcvColor = resolveIcvColor;
371
+ exports.resolveVerticalAlignment = resolveVerticalAlignment;
372
+ exports.unpackXfAlignment = unpackXfAlignment;
373
+ exports.unpackXfDecoration = unpackXfDecoration;
374
+ exports.vertAlignTokenFor = vertAlignTokenFor;
@@ -0,0 +1,2 @@
1
+ import { A as readLongRgbColor, C as XfAlignmentFields, D as horizAlignTokenFor, E as borderStyleTokenFor, F as resolveVerticalAlignment, I as unpackXfAlignment, L as unpackXfDecoration, M as resolveFillBackground, N as resolveHorizontalAlignment, O as longRgbBytesOf, P as resolveIcvColor, R as vertAlignTokenFor, S as UNDECORATED_XF_FIELDS, T as XfDecorationFields, _ as FILL_PATTERN_SOLID, a as BORDER_STYLE_DOUBLE, b as PALETTE_BASE_ICV, c as BORDER_STYLE_MEDIUM_DASHDOT, d as BORDER_STYLE_NONE, f as BORDER_STYLE_SLANT_DASHDOT, g as FILL_PATTERN_NONE, h as DEFAULT_PALETTE_HEX_TO_ICV, i as BORDER_STYLE_DOTTED, j as resolveBorderEdge, k as packXfDecorationWords, l as BORDER_STYLE_MEDIUM_DASHDOTDOT, m as BORDER_STYLE_THIN, n as BORDER_STYLE_DASHDOTDOT, o as BORDER_STYLE_HAIR, p as BORDER_STYLE_THICK, r as BORDER_STYLE_DASHED, s as BORDER_STYLE_MEDIUM, t as BORDER_STYLE_DASHDOT, u as BORDER_STYLE_MEDIUM_DASHED, v as ICV_AUTOMATIC_BACKGROUND, w as XfBorderEdge, x as PALETTE_ENTRY_COUNT, y as ICV_AUTOMATIC_FOREGROUND } from "../xf-colors-CehHZtBy.cjs";
2
+ export { BORDER_STYLE_DASHDOT, BORDER_STYLE_DASHDOTDOT, BORDER_STYLE_DASHED, BORDER_STYLE_DOTTED, BORDER_STYLE_DOUBLE, BORDER_STYLE_HAIR, BORDER_STYLE_MEDIUM, BORDER_STYLE_MEDIUM_DASHDOT, BORDER_STYLE_MEDIUM_DASHDOTDOT, BORDER_STYLE_MEDIUM_DASHED, BORDER_STYLE_NONE, BORDER_STYLE_SLANT_DASHDOT, BORDER_STYLE_THICK, BORDER_STYLE_THIN, DEFAULT_PALETTE_HEX_TO_ICV, FILL_PATTERN_NONE, FILL_PATTERN_SOLID, ICV_AUTOMATIC_BACKGROUND, ICV_AUTOMATIC_FOREGROUND, PALETTE_BASE_ICV, PALETTE_ENTRY_COUNT, UNDECORATED_XF_FIELDS, XfAlignmentFields, XfBorderEdge, XfDecorationFields, borderStyleTokenFor, horizAlignTokenFor, longRgbBytesOf, packXfDecorationWords, readLongRgbColor, resolveBorderEdge, resolveFillBackground, resolveHorizontalAlignment, resolveIcvColor, resolveVerticalAlignment, unpackXfAlignment, unpackXfDecoration, vertAlignTokenFor };