pptx-ts 0.0.1 → 4.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 (136) hide show
  1. package/README.md +116 -269
  2. package/dist/autopage-odPz7zZO.js +536 -0
  3. package/dist/autopage-odPz7zZO.js.map +1 -0
  4. package/dist/binary-string-CKVAYI3M.js +24 -0
  5. package/dist/binary-string-CKVAYI3M.js.map +1 -0
  6. package/dist/body-insets-Dw_BeWD_.js +54 -0
  7. package/dist/body-insets-Dw_BeWD_.js.map +1 -0
  8. package/dist/browser.d.ts +29 -9
  9. package/dist/browser.d.ts.map +1 -1
  10. package/dist/browser.js +41 -14
  11. package/dist/browser.js.map +1 -1
  12. package/dist/clip-Bl01BPcN.d.ts +67 -0
  13. package/dist/clip-Bl01BPcN.d.ts.map +1 -0
  14. package/dist/diagnostics-D8ot4Ei7.d.ts +244 -0
  15. package/dist/diagnostics-D8ot4Ei7.d.ts.map +1 -0
  16. package/dist/embedded-fonts-DarT9aoa.d.ts +20 -0
  17. package/dist/embedded-fonts-DarT9aoa.d.ts.map +1 -0
  18. package/dist/entry-compose-DCnvBZz2.d.ts +1046 -0
  19. package/dist/entry-compose-DCnvBZz2.d.ts.map +1 -0
  20. package/dist/{enums-CvRYniUA.d.ts → enums-BUKTUB6V.d.ts} +21 -13
  21. package/dist/{enums-CvRYniUA.d.ts.map → enums-BUKTUB6V.d.ts.map} +1 -1
  22. package/dist/{errors-Bvln0H-7.js → errors-C4oENPcu.js} +92 -2
  23. package/dist/errors-C4oENPcu.js.map +1 -0
  24. package/dist/families.d.ts +260 -0
  25. package/dist/families.d.ts.map +1 -0
  26. package/dist/families.js +57 -0
  27. package/dist/families.js.map +1 -0
  28. package/dist/{fit-BKs0zxMI.js → fit-Cb7naFj6.js} +249 -167
  29. package/dist/fit-Cb7naFj6.js.map +1 -0
  30. package/dist/font-metrics-v5fn7s7e.d.ts +613 -0
  31. package/dist/font-metrics-v5fn7s7e.d.ts.map +1 -0
  32. package/dist/grid-DikTjFey.js +187 -0
  33. package/dist/grid-DikTjFey.js.map +1 -0
  34. package/dist/{html-dom-B0I0QSbU.js → html-dom-Iuog2wdK.js} +121 -91
  35. package/dist/html-dom-Iuog2wdK.js.map +1 -0
  36. package/dist/html.d.ts +6 -6
  37. package/dist/html.d.ts.map +1 -1
  38. package/dist/html.js +7 -6
  39. package/dist/html.js.map +1 -1
  40. package/dist/image-size-CvN2iCA4.js +1611 -0
  41. package/dist/image-size-CvN2iCA4.js.map +1 -0
  42. package/dist/index.d.ts +24 -10
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +31 -11
  45. package/dist/index.js.map +1 -1
  46. package/dist/inspect.d.ts +40 -31
  47. package/dist/inspect.d.ts.map +1 -1
  48. package/dist/inspect.js +40 -48
  49. package/dist/inspect.js.map +1 -1
  50. package/dist/math.d.ts +7 -5
  51. package/dist/math.d.ts.map +1 -1
  52. package/dist/math.js +16 -7
  53. package/dist/math.js.map +1 -1
  54. package/dist/measure.d.ts +12 -225
  55. package/dist/measure.d.ts.map +1 -1
  56. package/dist/measure.js +3 -3
  57. package/dist/node.d.ts +22 -8
  58. package/dist/node.d.ts.map +1 -1
  59. package/dist/node.js +27 -7
  60. package/dist/node.js.map +1 -1
  61. package/dist/notes-Dh12JAbn.js +3264 -0
  62. package/dist/notes-Dh12JAbn.js.map +1 -0
  63. package/dist/options-internal-WqgMf720.js +43 -0
  64. package/dist/options-internal-WqgMf720.js.map +1 -0
  65. package/dist/{package-CaOLXSNi.d.ts → package-J49Ck6S2.d.ts} +27 -12
  66. package/dist/package-J49Ck6S2.d.ts.map +1 -0
  67. package/dist/playbtn-CUqQdoDf.js +22 -0
  68. package/dist/playbtn-CUqQdoDf.js.map +1 -0
  69. package/dist/{slide-js0QpRV-.d.ts → pres-C6qgOFAa.d.ts} +1021 -1370
  70. package/dist/pres-C6qgOFAa.d.ts.map +1 -0
  71. package/dist/{presentation-Cp7vzlAw.js → presentation-DGYlAWhl.js} +3208 -2727
  72. package/dist/presentation-DGYlAWhl.js.map +1 -0
  73. package/dist/{presentation-types-DP_8jog7.d.ts → presentation-types-8jLQHI4M.d.ts} +1070 -683
  74. package/dist/presentation-types-8jLQHI4M.d.ts.map +1 -0
  75. package/dist/read.d.ts +9 -9
  76. package/dist/read.d.ts.map +1 -1
  77. package/dist/read.js +4 -4
  78. package/dist/script.d.ts +80 -66
  79. package/dist/script.d.ts.map +1 -1
  80. package/dist/script.js +2399 -1139
  81. package/dist/script.js.map +1 -1
  82. package/dist/{shapes-BemroU-z.js → shapes-re0KyQk_.js} +2807 -1609
  83. package/dist/shapes-re0KyQk_.js.map +1 -0
  84. package/dist/slide-Dx2ZeVZ6.d.ts +1256 -0
  85. package/dist/slide-Dx2ZeVZ6.d.ts.map +1 -0
  86. package/dist/slide-size-BalTjFuv.js +88 -0
  87. package/dist/slide-size-BalTjFuv.js.map +1 -0
  88. package/dist/{units-internal-Dg95w_YD.js → table-cell-margins-EVg0EwxT.js} +235 -273
  89. package/dist/table-cell-margins-EVg0EwxT.js.map +1 -0
  90. package/dist/table-dom-BTDP3lEP.js +21 -0
  91. package/dist/table-dom-BTDP3lEP.js.map +1 -0
  92. package/dist/text-KnLOtEEu.js +3980 -0
  93. package/dist/text-KnLOtEEu.js.map +1 -0
  94. package/dist/text-anchor-CrYXAfUu.js +176 -0
  95. package/dist/text-anchor-CrYXAfUu.js.map +1 -0
  96. package/dist/transition-speed-kUEWDWTx.js +14 -0
  97. package/dist/transition-speed-kUEWDWTx.js.map +1 -0
  98. package/dist/units-internal-XJlf-hOl.js +649 -0
  99. package/dist/units-internal-XJlf-hOl.js.map +1 -0
  100. package/dist/zip-C0leZZMj.d.ts +67 -0
  101. package/dist/zip-C0leZZMj.d.ts.map +1 -0
  102. package/dist/zip-CKd8ihcf.js +177 -0
  103. package/dist/zip-CKd8ihcf.js.map +1 -0
  104. package/dist/zip.d.ts +3 -68
  105. package/dist/zip.js +3 -163
  106. package/dist/zoom-cX9sllpH.js +8865 -0
  107. package/dist/zoom-cX9sllpH.js.map +1 -0
  108. package/package.json +106 -19
  109. package/skills/ts-pptx-upstream/SKILL.md +58 -57
  110. package/dist/autopage-DkjYZUFD.js +0 -423
  111. package/dist/autopage-DkjYZUFD.js.map +0 -1
  112. package/dist/diagnostics-Du_s75MT.d.ts +0 -829
  113. package/dist/diagnostics-Du_s75MT.d.ts.map +0 -1
  114. package/dist/errors-Bvln0H-7.js.map +0 -1
  115. package/dist/errors-PflMPWBn.d.ts +0 -182
  116. package/dist/errors-PflMPWBn.d.ts.map +0 -1
  117. package/dist/fit-BKs0zxMI.js.map +0 -1
  118. package/dist/html-dom-B0I0QSbU.js.map +0 -1
  119. package/dist/namespaces-BVnNu7sg.js +0 -666
  120. package/dist/namespaces-BVnNu7sg.js.map +0 -1
  121. package/dist/notes-RLCwdlTE.js +0 -1703
  122. package/dist/notes-RLCwdlTE.js.map +0 -1
  123. package/dist/package-CaOLXSNi.d.ts.map +0 -1
  124. package/dist/pres-C5__xkDh.d.ts +0 -202
  125. package/dist/pres-C5__xkDh.d.ts.map +0 -1
  126. package/dist/presentation-Cp7vzlAw.js.map +0 -1
  127. package/dist/presentation-types-DP_8jog7.d.ts.map +0 -1
  128. package/dist/shapes-BemroU-z.js.map +0 -1
  129. package/dist/slide-js0QpRV-.d.ts.map +0 -1
  130. package/dist/text-CyetbF6p.js +0 -11278
  131. package/dist/text-CyetbF6p.js.map +0 -1
  132. package/dist/units-1kRzYShk.js +0 -231
  133. package/dist/units-1kRzYShk.js.map +0 -1
  134. package/dist/units-internal-Dg95w_YD.js.map +0 -1
  135. package/dist/zip.d.ts.map +0 -1
  136. package/dist/zip.js.map +0 -1
@@ -1,231 +0,0 @@
1
- import { n as InvalidOptionError } from "./errors-Bvln0H-7.js";
2
- //#region src/diagnostics.ts
3
- /** Prefix stamped on every warning so consumers can attribute console noise to this library. */
4
- const WARN_PREFIX = "ts-pptx";
5
- /** The default handler: one `console.warn` line per diagnostic, prefixed. */
6
- const consoleHandler = (diagnostic) => {
7
- console.warn(`${WARN_PREFIX}: ${diagnostic.message}`);
8
- };
9
- let handler = consoleHandler;
10
- /**
11
- * Route every library diagnostic to `handler`, or pass `null` to restore the default
12
- * (one prefixed `console.warn` per diagnostic).
13
- *
14
- * This is process-global rather than per-presentation, deliberately: the emitting code is a tree
15
- * of free functions in `gen/**` with no presentation in scope, and threading a handler through
16
- * every signature would be a far larger and worse change than the problem warrants. The practical
17
- * consequence is that a process building several decks concurrently cannot attribute a diagnostic
18
- * to one of them; if that matters, correlate on `code` or set the handler around each build.
19
- *
20
- * A throwing handler propagates out of whatever library call emitted the diagnostic, which is the
21
- * supported way to make a specific condition fatal:
22
- *
23
- * ```ts
24
- * setDiagnosticHandler((d) => {
25
- * if (d.code === 'coord/bare-number-is-inches') throw new Error(d.message)
26
- * })
27
- * ```
28
- * @param next - the receiver, or `null` to restore the console default
29
- */
30
- function setDiagnosticHandler(next) {
31
- handler = next ?? consoleHandler;
32
- }
33
- /**
34
- * Emit a library diagnostic.
35
- * @param code - the stable condition identifier ({@link DiagnosticCode})
36
- * @param message - explanation, without a `ts-pptx:` prefix (the default handler adds one)
37
- * @param detail - optional structured context
38
- */
39
- function warn(code, message, detail) {
40
- handler(detail === void 0 ? {
41
- code,
42
- message
43
- } : {
44
- code,
45
- message,
46
- detail
47
- });
48
- }
49
- const seen = /* @__PURE__ */ new Set();
50
- /**
51
- * Emit a library diagnostic at most once per distinct code+message.
52
- *
53
- * "Once" is **process-global**, the same scope {@link setDiagnosticHandler} has and for the
54
- * same reason: the emitting code is a tree of free functions in `gen/**` with no presentation
55
- * in scope. The consequence is different, though, and worth stating on its own — a process that
56
- * builds several decks does not get a second report of a condition an earlier deck already
57
- * tripped, so the second deck's diagnostics are incomplete rather than merely unattributed.
58
- * {@link resetDiagnosticState} is how a host that cares gets each build a clean slate.
59
- *
60
- * @param code - the stable condition identifier ({@link DiagnosticCode})
61
- * @param message - explanation (see {@link warn})
62
- * @param detail - optional structured context
63
- */
64
- function warnOnce(code, message, detail) {
65
- const key = `${code}\0${message}`;
66
- if (seen.has(key)) return;
67
- seen.add(key);
68
- warn(code, message, detail);
69
- }
70
- /**
71
- * Clear the {@link warnOnce} dedupe set, so a condition already reported reports again.
72
- *
73
- * Call it between builds in a host that builds more than one deck per process and wants each
74
- * build's diagnostics complete. Without it, deck two is silent about anything deck one already
75
- * warned for, which reads as "no problems found" rather than as "already mentioned".
76
- *
77
- * It also bounds the set. Most `warnOnce` messages interpolate the offending value, so a server
78
- * building decks from user input accumulates one entry per distinct bad value with no way to
79
- * release them.
80
- *
81
- * This does not touch the handler — {@link setDiagnosticHandler} owns that, and the two are
82
- * reset independently on purpose: a host usually installs its handler once and wants it to
83
- * survive.
84
- */
85
- function resetDiagnosticState() {
86
- seen.clear();
87
- }
88
- //#endregion
89
- //#region src/units.ts
90
- /**
91
- * Public unit conversion helpers and standard PowerPoint slide-layout constants.
92
- */
93
- const EMU_PER_INCH = 914400;
94
- const EMU_PER_POINT = 12700;
95
- const POINTS_PER_INCH = 72;
96
- /**
97
- * DrawingML angle unit. `ST_Angle` (`rot`, shadow `dir`, gradient `ang`, …) is measured in
98
- * sixtieths-of-a-thousandth of a degree, i.e. 60000 units per degree. Multiply a value in
99
- * degrees by this to get the OOXML integer.
100
- */
101
- const ANGLE_UNITS_PER_DEGREE = 6e4;
102
- /**
103
- * DrawingML fixed-point percentage scale. `ST_Percentage` / `ST_PositiveFixedPercentage` and
104
- * related types (`<a:alpha>`, `<a:spcPct>`, shape adjustment guides, `<p:tav tm>`, …) encode
105
- * 100% as the integer 100000. Multiply a 0-1 fraction by this to get the OOXML value.
106
- */
107
- const PERCENT_SCALE = 1e5;
108
- /**
109
- * Scale for a percentage supplied as 0-100 (rather than a 0-1 fraction) into the same
110
- * fixed-point percentage integer as {@link PERCENT_SCALE} (1% = 1000 units, i.e. thousandths
111
- * of a percent). Use for inputs documented as percents: transparency/alpha, image crop insets,
112
- * gradient stops, bullet size, connector adjust, etc.
113
- */
114
- const FIXED_PCT_PER_PERCENT = PERCENT_SCALE / 100;
115
- /**
116
- * DrawingML text measures font size (`sz`), character spacing (`spc`) and point line/paragraph
117
- * spacing (`<a:spcPts val>`) in hundredths of a point. Multiply a value in points by this to get
118
- * the OOXML integer.
119
- */
120
- const HUNDREDTHS_PER_POINT = 100;
121
- /**
122
- * Convert a value in points to hundredths of a point (rounded), the integer unit DrawingML uses
123
- * for `sz`, `spc`, and `<a:spcPts val>`. See {@link HUNDREDTHS_PER_POINT}.
124
- */
125
- function ptToHundredths(pt) {
126
- assertFiniteNumber(pt, "points");
127
- return Math.round(pt * 100);
128
- }
129
- /** A bare number larger than this (in inches) is almost certainly a mistake — likely a raw EMU
130
- * value passed where inches are expected. We interpret it as inches (the documented contract) but
131
- * warn, pointing at the explicit `"<n>emu"` form. ~1000in is far beyond any real slide. */
132
- const IMPLAUSIBLE_INCHES = 1e3;
133
- /** Default pixel density for the `"<n>px"` coordinate unit: CSS reference pixels, also the
134
- * density ts-pptx assumes when reading an image header's pixel dimensions. */
135
- const DEFAULT_PX_PER_INCH = 96;
136
- function inchesToEmu(inches) {
137
- assertFiniteNumber(inches, "inches");
138
- return Math.round(inches * EMU_PER_INCH);
139
- }
140
- function pointsToEmu(points) {
141
- assertFiniteNumber(points, "points");
142
- return Math.round(points * EMU_PER_POINT);
143
- }
144
- function pixelsToEmu(pixels, dpi) {
145
- assertFiniteNumber(pixels, "pixels");
146
- assertPositiveFiniteNumber(dpi, "dpi");
147
- return inchesToEmu(pixels / dpi);
148
- }
149
- /**
150
- * Resolve a percentage of an axis length to EMU.
151
- * @param percent - percentage value (e.g. `50` for 50%)
152
- * @param axisEmu - the axis length in EMU (slide width for x/w, height for y/h)
153
- */
154
- function percentToEmu(percent, axisEmu) {
155
- assertFiniteNumber(percent, "percent");
156
- assertFiniteNumber(axisEmu, "axisEmu");
157
- return Math.round(percent / 100 * axisEmu);
158
- }
159
- /**
160
- * The single user-coordinate → EMU boundary. Convert each user-supplied coordinate exactly once.
161
- *
162
- * Accepts (see {@link Coord}):
163
- * - a bare `number` → **always inches** (the documented unit); no magnitude guessing
164
- * - `"<n>%"` → percentage of `axisEmu`
165
- * - `"<n>in"` / `"<n>pt"` / `"<n>px"` / `"<n>emu"` → explicit units (the escape hatch for non-inch
166
- * values). `px` is resolved at {@link DEFAULT_PX_PER_INCH} (96), for authoring against a known
167
- * web/source canvas size.
168
- *
169
- * Throws on non-finite or unparseable input rather than silently emitting a degenerate 0-size.
170
- * @param value - user coordinate
171
- * @param axisEmu - axis length in EMU, used only to resolve percentages
172
- */
173
- function coordToEmu(value, axisEmu) {
174
- if (typeof value === "number") {
175
- assertFiniteNumber(value, "coordinate");
176
- if (Math.abs(value) > IMPLAUSIBLE_INCHES) warn("coord/bare-number-is-inches", `coordinate ${value} interpreted as ${value} inches. A bare number is always inches; if you meant EMU, pass it as a string like "${Math.round(value)}emu".`);
177
- return inchesToEmu(value);
178
- }
179
- const match = /^\s*(-?\d*\.?\d+)\s*(%|in|pt|px|emu)\s*$/.exec(value);
180
- if (!match) throw new InvalidOptionError("coord/invalid-format", `Invalid coordinate "${value}". Expected a number (inches) or a string like "50%", "5in", "72pt", "96px", or "914400emu".`);
181
- const n = Number(match[1]);
182
- switch (match[2]) {
183
- case "%": return percentToEmu(n, axisEmu);
184
- case "in": return inchesToEmu(n);
185
- case "pt": return pointsToEmu(n);
186
- case "px": return pixelsToEmu(n, 96);
187
- default:
188
- assertFiniteNumber(n, "coordinate");
189
- return Math.round(n);
190
- }
191
- }
192
- function emuToInches(emu) {
193
- assertFiniteNumber(emu, "emu");
194
- return emu / EMU_PER_INCH;
195
- }
196
- function emuToPoints(emu) {
197
- assertFiniteNumber(emu, "emu");
198
- return emu / EMU_PER_POINT;
199
- }
200
- function emuToPixels(emu, dpi) {
201
- assertFiniteNumber(emu, "emu");
202
- assertPositiveFiniteNumber(dpi, "dpi");
203
- return Math.round(emuToInches(emu) * dpi);
204
- }
205
- function standardLayout(layout, name, widthIn, heightIn) {
206
- return Object.freeze({
207
- layout,
208
- name,
209
- widthIn,
210
- heightIn,
211
- widthEmu: inchesToEmu(widthIn),
212
- heightEmu: inchesToEmu(heightIn)
213
- });
214
- }
215
- const STANDARD_LAYOUTS = Object.freeze({
216
- LAYOUT_4x3: standardLayout("LAYOUT_4x3", "screen4x3", 10, 7.5),
217
- LAYOUT_16x9: standardLayout("LAYOUT_16x9", "screen16x9", 10, 5.625),
218
- LAYOUT_16x10: standardLayout("LAYOUT_16x10", "screen16x10", 10, 6.25),
219
- LAYOUT_WIDE: standardLayout("LAYOUT_WIDE", "custom", 40 / 3, 7.5)
220
- });
221
- function assertFiniteNumber(value, name) {
222
- if (!Number.isFinite(value)) throw new InvalidOptionError("coord/non-finite", `${name} must be a finite number`);
223
- }
224
- function assertPositiveFiniteNumber(value, name) {
225
- assertFiniteNumber(value, name);
226
- if (value <= 0) throw new InvalidOptionError("coord/not-positive", `${name} must be greater than 0`);
227
- }
228
- //#endregion
229
- export { warnOnce as S, pointsToEmu as _, FIXED_PCT_PER_PERCENT as a, setDiagnosticHandler as b, POINTS_PER_INCH as c, emuToInches as d, emuToPixels as f, pixelsToEmu as g, percentToEmu as h, EMU_PER_POINT as i, STANDARD_LAYOUTS as l, inchesToEmu as m, DEFAULT_PX_PER_INCH as n, HUNDREDTHS_PER_POINT as o, emuToPoints as p, EMU_PER_INCH as r, PERCENT_SCALE as s, ANGLE_UNITS_PER_DEGREE as t, coordToEmu as u, ptToHundredths as v, warn as x, resetDiagnosticState as y };
230
-
231
- //# sourceMappingURL=units-1kRzYShk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"units-1kRzYShk.js","names":[],"sources":["../src/diagnostics.ts","../src/units.ts"],"sourcesContent":["/**\n * Central sink for library diagnostics.\n *\n * Every user-facing warning is routed through {@link warn} / {@link warnOnce} rather than calling\n * `console.warn` directly, so there is one place to apply a consistent prefix and one place a\n * consumer can take over — see {@link setDiagnosticHandler}. This module has no *runtime* imports\n * so it can be used from anywhere without risking an import cycle; `codes.ts` is types only and is\n * erased at compile time, so it does not cost that property.\n *\n * **A diagnostic's `code` is API; its `message` is not.** The code is a stable identifier a\n * consumer may branch on (`if (d.code === 'chart/non-finite-value')`); the wording behind it is\n * free to improve in any release. The vocabulary lives in `codes.ts` and is shared with the thrown\n * surface (`errors.ts`), so a condition that can both warn and throw reads the same either way.\n */\n\nimport type { DiagnosticCode } from './codes.js'\n\nexport type { DiagnosticCode }\n\n/** One diagnostic emitted by the library. */\nexport interface Diagnostic {\n\t/** Stable condition identifier — see {@link DiagnosticCode}. Branch on this, not on the text. */\n\treadonly code: DiagnosticCode\n\t/** Human-readable explanation. Free to change in any release; do not parse it. */\n\treadonly message: string\n\t/**\n\t * Structured context for the condition, when a site has any to give. No site populates it\n\t * today; it exists so one can start to without a breaking signature change.\n\t */\n\treadonly detail?: Readonly<Record<string, unknown>>\n}\n\n/** Receives every {@link Diagnostic} the library emits. See {@link setDiagnosticHandler}. */\nexport type DiagnosticHandler = (diagnostic: Diagnostic) => void\n\n/** Prefix stamped on every warning so consumers can attribute console noise to this library. */\nconst WARN_PREFIX = 'ts-pptx'\n\n/** The default handler: one `console.warn` line per diagnostic, prefixed. */\nconst consoleHandler: DiagnosticHandler = (diagnostic) => {\n\tconsole.warn(`${WARN_PREFIX}: ${diagnostic.message}`)\n}\n\nlet handler: DiagnosticHandler = consoleHandler\n\n/**\n * Route every library diagnostic to `handler`, or pass `null` to restore the default\n * (one prefixed `console.warn` per diagnostic).\n *\n * This is process-global rather than per-presentation, deliberately: the emitting code is a tree\n * of free functions in `gen/**` with no presentation in scope, and threading a handler through\n * every signature would be a far larger and worse change than the problem warrants. The practical\n * consequence is that a process building several decks concurrently cannot attribute a diagnostic\n * to one of them; if that matters, correlate on `code` or set the handler around each build.\n *\n * A throwing handler propagates out of whatever library call emitted the diagnostic, which is the\n * supported way to make a specific condition fatal:\n *\n * ```ts\n * setDiagnosticHandler((d) => {\n * if (d.code === 'coord/bare-number-is-inches') throw new Error(d.message)\n * })\n * ```\n * @param next - the receiver, or `null` to restore the console default\n */\nexport function setDiagnosticHandler(next: DiagnosticHandler | null): void {\n\thandler = next ?? consoleHandler\n}\n\n/**\n * Emit a library diagnostic.\n * @param code - the stable condition identifier ({@link DiagnosticCode})\n * @param message - explanation, without a `ts-pptx:` prefix (the default handler adds one)\n * @param detail - optional structured context\n */\nexport function warn(code: DiagnosticCode, message: string, detail?: Readonly<Record<string, unknown>>): void {\n\thandler(detail === undefined ? { code, message } : { code, message, detail })\n}\n\n// Track diagnostics already emitted so a recurring condition (e.g. the same out-of-range fontSize\n// on every cell of a table) is reported once instead of flooding the handler. Keyed on code AND\n// message, so a *different* offending value under the same code still reports.\nconst seen = new Set<string>()\n\n/**\n * Emit a library diagnostic at most once per distinct code+message.\n *\n * \"Once\" is **process-global**, the same scope {@link setDiagnosticHandler} has and for the\n * same reason: the emitting code is a tree of free functions in `gen/**` with no presentation\n * in scope. The consequence is different, though, and worth stating on its own — a process that\n * builds several decks does not get a second report of a condition an earlier deck already\n * tripped, so the second deck's diagnostics are incomplete rather than merely unattributed.\n * {@link resetDiagnosticState} is how a host that cares gets each build a clean slate.\n *\n * @param code - the stable condition identifier ({@link DiagnosticCode})\n * @param message - explanation (see {@link warn})\n * @param detail - optional structured context\n */\nexport function warnOnce(code: DiagnosticCode, message: string, detail?: Readonly<Record<string, unknown>>): void {\n\tconst key = `${code}\\0${message}`\n\tif (seen.has(key)) return\n\tseen.add(key)\n\twarn(code, message, detail)\n}\n\n/**\n * Clear the {@link warnOnce} dedupe set, so a condition already reported reports again.\n *\n * Call it between builds in a host that builds more than one deck per process and wants each\n * build's diagnostics complete. Without it, deck two is silent about anything deck one already\n * warned for, which reads as \"no problems found\" rather than as \"already mentioned\".\n *\n * It also bounds the set. Most `warnOnce` messages interpolate the offending value, so a server\n * building decks from user input accumulates one entry per distinct bad value with no way to\n * release them.\n *\n * This does not touch the handler — {@link setDiagnosticHandler} owns that, and the two are\n * reset independently on purpose: a host usually installs its handler once and wants it to\n * survive.\n */\nexport function resetDiagnosticState(): void {\n\tseen.clear()\n}\n","import { warn } from './diagnostics.js'\nimport { InvalidOptionError } from './errors.js'\n/**\n * Public unit conversion helpers and standard PowerPoint slide-layout constants.\n */\n\nexport const EMU_PER_INCH = 914400\nexport const EMU_PER_POINT = 12700\nexport const POINTS_PER_INCH = 72\n\n/**\n * DrawingML angle unit. `ST_Angle` (`rot`, shadow `dir`, gradient `ang`, …) is measured in\n * sixtieths-of-a-thousandth of a degree, i.e. 60000 units per degree. Multiply a value in\n * degrees by this to get the OOXML integer.\n */\nexport const ANGLE_UNITS_PER_DEGREE = 60000\n\n/**\n * DrawingML fixed-point percentage scale. `ST_Percentage` / `ST_PositiveFixedPercentage` and\n * related types (`<a:alpha>`, `<a:spcPct>`, shape adjustment guides, `<p:tav tm>`, …) encode\n * 100% as the integer 100000. Multiply a 0-1 fraction by this to get the OOXML value.\n */\nexport const PERCENT_SCALE = 100000\n\n/**\n * Scale for a percentage supplied as 0-100 (rather than a 0-1 fraction) into the same\n * fixed-point percentage integer as {@link PERCENT_SCALE} (1% = 1000 units, i.e. thousandths\n * of a percent). Use for inputs documented as percents: transparency/alpha, image crop insets,\n * gradient stops, bullet size, connector adjust, etc.\n */\nexport const FIXED_PCT_PER_PERCENT = PERCENT_SCALE / 100\n\n/**\n * DrawingML text measures font size (`sz`), character spacing (`spc`) and point line/paragraph\n * spacing (`<a:spcPts val>`) in hundredths of a point. Multiply a value in points by this to get\n * the OOXML integer.\n */\nexport const HUNDREDTHS_PER_POINT = 100\n\n/**\n * Convert a value in points to hundredths of a point (rounded), the integer unit DrawingML uses\n * for `sz`, `spc`, and `<a:spcPts val>`. See {@link HUNDREDTHS_PER_POINT}.\n */\nexport function ptToHundredths(pt: number): number {\n\tassertFiniteNumber(pt, 'points')\n\treturn Math.round(pt * HUNDREDTHS_PER_POINT)\n}\n\n/**\n * English Metric Units — the integer unit OOXML serializes geometry in (914400 per inch).\n *\n * Branded so a value that has already been resolved to EMU cannot be silently fed back into a\n * unit converter: {@link coordToEmu} only accepts a user `Coord`, so passing an `Emu` into it is\n * a compile-time error. This replaces the old runtime \"a number ≥ 100 must already be EMU\"\n * magnitude guess, which silently mis-rendered values near the threshold.\n */\nexport type Emu = number & { readonly __unit: 'emu' }\n\n/** A bare number larger than this (in inches) is almost certainly a mistake — likely a raw EMU\n * value passed where inches are expected. We interpret it as inches (the documented contract) but\n * warn, pointing at the explicit `\"<n>emu\"` form. ~1000in is far beyond any real slide. */\nconst IMPLAUSIBLE_INCHES = 1000\n\n/** Default pixel density for the `\"<n>px\"` coordinate unit: CSS reference pixels, also the\n * density ts-pptx assumes when reading an image header's pixel dimensions. */\nexport const DEFAULT_PX_PER_INCH = 96\n\nexport type StandardLayoutName = 'LAYOUT_4x3' | 'LAYOUT_16x9' | 'LAYOUT_16x10' | 'LAYOUT_WIDE'\n\nexport interface StandardLayout {\n\t/** ts-pptx layout key used with `pptx.layout`. */\n\treadonly layout: StandardLayoutName\n\t/** PresentationML slide-size preset name, or `custom` for PowerPoint widescreen. */\n\treadonly name: string\n\t/** Slide width in inches — inches is ts-pptx's default coordinate unit, so this is the value to use for `addText`/`addShape` math. */\n\treadonly widthIn: number\n\t/** Slide height in inches. */\n\treadonly heightIn: number\n\t/** Slide width in English Metric Units. */\n\treadonly widthEmu: number\n\t/** Slide height in English Metric Units. */\n\treadonly heightEmu: number\n}\n\nexport function inchesToEmu(inches: number): Emu {\n\tassertFiniteNumber(inches, 'inches')\n\treturn Math.round(inches * EMU_PER_INCH) as Emu\n}\n\nexport function pointsToEmu(points: number): Emu {\n\tassertFiniteNumber(points, 'points')\n\treturn Math.round(points * EMU_PER_POINT) as Emu\n}\n\nexport function pixelsToEmu(pixels: number, dpi: number): Emu {\n\tassertFiniteNumber(pixels, 'pixels')\n\tassertPositiveFiniteNumber(dpi, 'dpi')\n\treturn inchesToEmu(pixels / dpi)\n}\n\n/**\n * Resolve a percentage of an axis length to EMU.\n * @param percent - percentage value (e.g. `50` for 50%)\n * @param axisEmu - the axis length in EMU (slide width for x/w, height for y/h)\n */\nexport function percentToEmu(percent: number, axisEmu: number): Emu {\n\tassertFiniteNumber(percent, 'percent')\n\tassertFiniteNumber(axisEmu, 'axisEmu')\n\treturn Math.round((percent / 100) * axisEmu) as Emu\n}\n\n/**\n * The single user-coordinate → EMU boundary. Convert each user-supplied coordinate exactly once.\n *\n * Accepts (see {@link Coord}):\n * - a bare `number` → **always inches** (the documented unit); no magnitude guessing\n * - `\"<n>%\"` → percentage of `axisEmu`\n * - `\"<n>in\"` / `\"<n>pt\"` / `\"<n>px\"` / `\"<n>emu\"` → explicit units (the escape hatch for non-inch\n * values). `px` is resolved at {@link DEFAULT_PX_PER_INCH} (96), for authoring against a known\n * web/source canvas size.\n *\n * Throws on non-finite or unparseable input rather than silently emitting a degenerate 0-size.\n * @param value - user coordinate\n * @param axisEmu - axis length in EMU, used only to resolve percentages\n */\nexport function coordToEmu(value: number | string, axisEmu: number): Emu {\n\tif (typeof value === 'number') {\n\t\tassertFiniteNumber(value, 'coordinate')\n\t\tif (Math.abs(value) > IMPLAUSIBLE_INCHES) {\n\t\t\twarn(\n\t\t\t\t'coord/bare-number-is-inches',\n\t\t\t\t`coordinate ${value} interpreted as ${value} inches. A bare number is always inches; ` +\n\t\t\t\t\t`if you meant EMU, pass it as a string like \"${Math.round(value)}emu\".`\n\t\t\t)\n\t\t}\n\t\treturn inchesToEmu(value)\n\t}\n\n\tconst match = /^\\s*(-?\\d*\\.?\\d+)\\s*(%|in|pt|px|emu)\\s*$/.exec(value)\n\tif (!match) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'coord/invalid-format',\n\t\t\t`Invalid coordinate \"${value}\". Expected a number (inches) or a string like \"50%\", \"5in\", \"72pt\", \"96px\", or \"914400emu\".`\n\t\t)\n\t}\n\tconst n = Number(match[1])\n\tswitch (match[2]) {\n\t\tcase '%':\n\t\t\treturn percentToEmu(n, axisEmu)\n\t\tcase 'in':\n\t\t\treturn inchesToEmu(n)\n\t\tcase 'pt':\n\t\t\treturn pointsToEmu(n)\n\t\tcase 'px':\n\t\t\treturn pixelsToEmu(n, DEFAULT_PX_PER_INCH)\n\t\tdefault: // 'emu'\n\t\t\tassertFiniteNumber(n, 'coordinate')\n\t\t\treturn Math.round(n) as Emu\n\t}\n}\n\nexport function emuToInches(emu: number): number {\n\tassertFiniteNumber(emu, 'emu')\n\treturn emu / EMU_PER_INCH\n}\n\nexport function emuToPoints(emu: number): number {\n\tassertFiniteNumber(emu, 'emu')\n\treturn emu / EMU_PER_POINT\n}\n\nexport function emuToPixels(emu: number, dpi: number): number {\n\tassertFiniteNumber(emu, 'emu')\n\tassertPositiveFiniteNumber(dpi, 'dpi')\n\treturn Math.round(emuToInches(emu) * dpi)\n}\n\nfunction standardLayout(layout: StandardLayoutName, name: string, widthIn: number, heightIn: number): StandardLayout {\n\treturn Object.freeze({\n\t\tlayout,\n\t\tname,\n\t\twidthIn,\n\t\theightIn,\n\t\twidthEmu: inchesToEmu(widthIn),\n\t\theightEmu: inchesToEmu(heightIn),\n\t})\n}\n\nexport const STANDARD_LAYOUTS: Readonly<Record<StandardLayoutName, StandardLayout>> = Object.freeze({\n\tLAYOUT_4x3: standardLayout('LAYOUT_4x3', 'screen4x3', 10, 7.5),\n\tLAYOUT_16x9: standardLayout('LAYOUT_16x9', 'screen16x9', 10, 5.625),\n\tLAYOUT_16x10: standardLayout('LAYOUT_16x10', 'screen16x10', 10, 6.25),\n\tLAYOUT_WIDE: standardLayout('LAYOUT_WIDE', 'custom', 40 / 3, 7.5),\n})\n\nfunction assertFiniteNumber(value: number, name: string): void {\n\tif (!Number.isFinite(value)) throw new InvalidOptionError('coord/non-finite', `${name} must be a finite number`)\n}\n\nfunction assertPositiveFiniteNumber(value: number, name: string): void {\n\tassertFiniteNumber(value, name)\n\tif (value <= 0) throw new InvalidOptionError('coord/not-positive', `${name} must be greater than 0`)\n}\n"],"mappings":";;;AAoCA,MAAM,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EACA;EACA;EACA;EACA,UAAU,YAAY,OAAO;EAC7B,WAAW,YAAY,QAAQ;CAChC,CAAC;AACF;AAEA,MAAa,mBAAyE,OAAO,OAAO;CACnG,YAAY,eAAe,cAAc,aAAa,IAAI,GAAG;CAC7D,aAAa,eAAe,eAAe,cAAc,IAAI,KAAK;CAClE,cAAc,eAAe,gBAAgB,eAAe,IAAI,IAAI;CACpE,aAAa,eAAe,eAAe,UAAU,KAAK,GAAG,GAAG;AACjE,CAAC;AAED,SAAS,mBAAmB,OAAe,MAAoB;CAC9D,IAAI,CAAC,OAAO,SAAS,KAAK,GAAG,MAAM,IAAI,mBAAmB,oBAAoB,GAAG,KAAK,yBAAyB;AAChH;AAEA,SAAS,2BAA2B,OAAe,MAAoB;CACtE,mBAAmB,OAAO,IAAI;CAC9B,IAAI,SAAS,GAAG,MAAM,IAAI,mBAAmB,sBAAsB,GAAG,KAAK,wBAAwB;AACpG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"units-internal-Dg95w_YD.js","names":[],"sources":["../src/enums.ts","../src/constants-internal.ts","../src/units-internal.ts"],"sourcesContent":["/**\n * ts-pptx Enums\n * NOTE: `enum` wont work for objects, so use `Object.freeze`\n */\n\n/**\n * Output-type name accepted by the zip/write layer. Derived from the `OutputType`\n * enum (see below) so the two never drift: adding a member to the enum extends this\n * union automatically.\n */\nexport type ZIP_OUTPUT_TYPE = `${OutputType}`\nexport type WRITE_OUTPUT_TYPE = ZIP_OUTPUT_TYPE\n/**\n * Public chart-type name accepted by `addChart()`. Derived from the internal\n * `ChartType` enum (see below) so the two never drift: adding a member to the\n * enum extends this union automatically.\n */\nexport type CHART_NAME = `${ChartType}`\n/**\n * Public scheme-color name. Derived from the `SchemeColor` enum (see below) so the\n * two never drift.\n */\nexport type SCHEME_COLORS = `${SchemeColor}`\n\nexport enum TextAnchor {\n\tb = 'b',\n\tctr = 'ctr',\n\tt = 't',\n}\n\n// ENUM\nexport enum OutputType {\n\tarraybuffer = 'arraybuffer',\n\tbase64 = 'base64',\n\tbinarystring = 'binarystring',\n\tblob = 'blob',\n\tnodebuffer = 'nodebuffer',\n\tuint8array = 'uint8array',\n}\nexport enum ChartType {\n\tarea = 'area',\n\tbar = 'bar',\n\tbar3d = 'bar3D',\n\tbubble = 'bubble',\n\tbubble3d = 'bubble3D',\n\tdoughnut = 'doughnut',\n\tline = 'line',\n\tpie = 'pie',\n\tradar = 'radar',\n\tscatter = 'scatter',\n\tstock = 'stock',\n\tsurface = 'surface',\n\twaterfall = 'waterfall',\n\tfunnel = 'funnel',\n\ttreemap = 'treemap',\n\tsunburst = 'sunburst',\n\thistogram = 'histogram',\n\tpareto = 'pareto',\n\tboxWhisker = 'boxWhisker',\n\tregionMap = 'regionMap',\n}\nexport enum ShapeType {\n\taccentBorderCallout1 = 'accentBorderCallout1',\n\taccentBorderCallout2 = 'accentBorderCallout2',\n\taccentBorderCallout3 = 'accentBorderCallout3',\n\taccentCallout1 = 'accentCallout1',\n\taccentCallout2 = 'accentCallout2',\n\taccentCallout3 = 'accentCallout3',\n\tactionButtonBackPrevious = 'actionButtonBackPrevious',\n\tactionButtonBeginning = 'actionButtonBeginning',\n\tactionButtonBlank = 'actionButtonBlank',\n\tactionButtonDocument = 'actionButtonDocument',\n\tactionButtonEnd = 'actionButtonEnd',\n\tactionButtonForwardNext = 'actionButtonForwardNext',\n\tactionButtonHelp = 'actionButtonHelp',\n\tactionButtonHome = 'actionButtonHome',\n\tactionButtonInformation = 'actionButtonInformation',\n\tactionButtonMovie = 'actionButtonMovie',\n\tactionButtonReturn = 'actionButtonReturn',\n\tactionButtonSound = 'actionButtonSound',\n\tarc = 'arc',\n\tbentArrow = 'bentArrow',\n\tbentUpArrow = 'bentUpArrow',\n\tbevel = 'bevel',\n\tblockArc = 'blockArc',\n\tborderCallout1 = 'borderCallout1',\n\tborderCallout2 = 'borderCallout2',\n\tborderCallout3 = 'borderCallout3',\n\tbracePair = 'bracePair',\n\tbracketPair = 'bracketPair',\n\tcallout1 = 'callout1',\n\tcallout2 = 'callout2',\n\tcallout3 = 'callout3',\n\tcan = 'can',\n\tchartPlus = 'chartPlus',\n\tchartStar = 'chartStar',\n\tchartX = 'chartX',\n\tchevron = 'chevron',\n\tchord = 'chord',\n\tcircularArrow = 'circularArrow',\n\tcloud = 'cloud',\n\tcloudCallout = 'cloudCallout',\n\tcorner = 'corner',\n\tcornerTabs = 'cornerTabs',\n\tcube = 'cube',\n\tcurvedDownArrow = 'curvedDownArrow',\n\tcurvedLeftArrow = 'curvedLeftArrow',\n\tcurvedRightArrow = 'curvedRightArrow',\n\tcurvedUpArrow = 'curvedUpArrow',\n\tcustGeom = 'custGeom',\n\tdecagon = 'decagon',\n\tdiagStripe = 'diagStripe',\n\tdiamond = 'diamond',\n\tdodecagon = 'dodecagon',\n\tdonut = 'donut',\n\tdoubleWave = 'doubleWave',\n\tdownArrow = 'downArrow',\n\tdownArrowCallout = 'downArrowCallout',\n\tellipse = 'ellipse',\n\tellipseRibbon = 'ellipseRibbon',\n\tellipseRibbon2 = 'ellipseRibbon2',\n\tflowChartAlternateProcess = 'flowChartAlternateProcess',\n\tflowChartCollate = 'flowChartCollate',\n\tflowChartConnector = 'flowChartConnector',\n\tflowChartDecision = 'flowChartDecision',\n\tflowChartDelay = 'flowChartDelay',\n\tflowChartDisplay = 'flowChartDisplay',\n\tflowChartDocument = 'flowChartDocument',\n\tflowChartExtract = 'flowChartExtract',\n\tflowChartInputOutput = 'flowChartInputOutput',\n\tflowChartInternalStorage = 'flowChartInternalStorage',\n\tflowChartMagneticDisk = 'flowChartMagneticDisk',\n\tflowChartMagneticDrum = 'flowChartMagneticDrum',\n\tflowChartMagneticTape = 'flowChartMagneticTape',\n\tflowChartManualInput = 'flowChartManualInput',\n\tflowChartManualOperation = 'flowChartManualOperation',\n\tflowChartMerge = 'flowChartMerge',\n\tflowChartMultidocument = 'flowChartMultidocument',\n\tflowChartOfflineStorage = 'flowChartOfflineStorage',\n\tflowChartOffpageConnector = 'flowChartOffpageConnector',\n\tflowChartOnlineStorage = 'flowChartOnlineStorage',\n\tflowChartOr = 'flowChartOr',\n\tflowChartPredefinedProcess = 'flowChartPredefinedProcess',\n\tflowChartPreparation = 'flowChartPreparation',\n\tflowChartProcess = 'flowChartProcess',\n\tflowChartPunchedCard = 'flowChartPunchedCard',\n\tflowChartPunchedTape = 'flowChartPunchedTape',\n\tflowChartSort = 'flowChartSort',\n\tflowChartSummingJunction = 'flowChartSummingJunction',\n\tflowChartTerminator = 'flowChartTerminator',\n\tfoldedCorner = 'foldedCorner',\n\tframe = 'frame',\n\tfunnel = 'funnel',\n\tgear6 = 'gear6',\n\tgear9 = 'gear9',\n\thalfFrame = 'halfFrame',\n\theart = 'heart',\n\theptagon = 'heptagon',\n\thexagon = 'hexagon',\n\thomePlate = 'homePlate',\n\thorizontalScroll = 'horizontalScroll',\n\tirregularSeal1 = 'irregularSeal1',\n\tirregularSeal2 = 'irregularSeal2',\n\tleftArrow = 'leftArrow',\n\tleftArrowCallout = 'leftArrowCallout',\n\tleftBrace = 'leftBrace',\n\tleftBracket = 'leftBracket',\n\tleftCircularArrow = 'leftCircularArrow',\n\tleftRightArrow = 'leftRightArrow',\n\tleftRightArrowCallout = 'leftRightArrowCallout',\n\tleftRightCircularArrow = 'leftRightCircularArrow',\n\tleftRightRibbon = 'leftRightRibbon',\n\tleftRightUpArrow = 'leftRightUpArrow',\n\tleftUpArrow = 'leftUpArrow',\n\tlightningBolt = 'lightningBolt',\n\tline = 'line',\n\tlineInv = 'lineInv',\n\tmathDivide = 'mathDivide',\n\tmathEqual = 'mathEqual',\n\tmathMinus = 'mathMinus',\n\tmathMultiply = 'mathMultiply',\n\tmathNotEqual = 'mathNotEqual',\n\tmathPlus = 'mathPlus',\n\tmoon = 'moon',\n\tnoSmoking = 'noSmoking',\n\tnonIsoscelesTrapezoid = 'nonIsoscelesTrapezoid',\n\tnotchedRightArrow = 'notchedRightArrow',\n\toctagon = 'octagon',\n\tparallelogram = 'parallelogram',\n\tpentagon = 'pentagon',\n\tpie = 'pie',\n\tpieWedge = 'pieWedge',\n\tplaque = 'plaque',\n\tplaqueTabs = 'plaqueTabs',\n\tplus = 'plus',\n\tquadArrow = 'quadArrow',\n\tquadArrowCallout = 'quadArrowCallout',\n\trect = 'rect',\n\tribbon = 'ribbon',\n\tribbon2 = 'ribbon2',\n\trightArrow = 'rightArrow',\n\trightArrowCallout = 'rightArrowCallout',\n\trightBrace = 'rightBrace',\n\trightBracket = 'rightBracket',\n\tround1Rect = 'round1Rect',\n\tround2DiagRect = 'round2DiagRect',\n\tround2SameRect = 'round2SameRect',\n\troundRect = 'roundRect',\n\trtTriangle = 'rtTriangle',\n\tsmileyFace = 'smileyFace',\n\tsnip1Rect = 'snip1Rect',\n\tsnip2DiagRect = 'snip2DiagRect',\n\tsnip2SameRect = 'snip2SameRect',\n\tsnipRoundRect = 'snipRoundRect',\n\tsquareTabs = 'squareTabs',\n\tstar10 = 'star10',\n\tstar12 = 'star12',\n\tstar16 = 'star16',\n\tstar24 = 'star24',\n\tstar32 = 'star32',\n\tstar4 = 'star4',\n\tstar5 = 'star5',\n\tstar6 = 'star6',\n\tstar7 = 'star7',\n\tstar8 = 'star8',\n\tstripedRightArrow = 'stripedRightArrow',\n\tsun = 'sun',\n\tswooshArrow = 'swooshArrow',\n\tteardrop = 'teardrop',\n\ttrapezoid = 'trapezoid',\n\ttriangle = 'triangle',\n\tupArrow = 'upArrow',\n\tupArrowCallout = 'upArrowCallout',\n\tupDownArrow = 'upDownArrow',\n\tupDownArrowCallout = 'upDownArrowCallout',\n\tuturnArrow = 'uturnArrow',\n\tverticalScroll = 'verticalScroll',\n\twave = 'wave',\n\twedgeEllipseCallout = 'wedgeEllipseCallout',\n\twedgeRectCallout = 'wedgeRectCallout',\n\twedgeRoundRectCallout = 'wedgeRoundRectCallout',\n}\nexport enum SchemeColor {\n\ttext1 = 'tx1',\n\ttext2 = 'tx2',\n\tbackground1 = 'bg1',\n\tbackground2 = 'bg2',\n\taccent1 = 'accent1',\n\taccent2 = 'accent2',\n\taccent3 = 'accent3',\n\taccent4 = 'accent4',\n\taccent5 = 'accent5',\n\taccent6 = 'accent6',\n}\nexport enum AlignH {\n\tleft = 'left',\n\tcenter = 'center',\n\tright = 'right',\n\tjustify = 'justify',\n}\nexport enum AlignV {\n\ttop = 'top',\n\tmiddle = 'middle',\n\tbottom = 'bottom',\n}\n\nexport type SHAPE_NAME =\n\t| 'accentBorderCallout1'\n\t| 'accentBorderCallout2'\n\t| 'accentBorderCallout3'\n\t| 'accentCallout1'\n\t| 'accentCallout2'\n\t| 'accentCallout3'\n\t| 'actionButtonBackPrevious'\n\t| 'actionButtonBeginning'\n\t| 'actionButtonBlank'\n\t| 'actionButtonDocument'\n\t| 'actionButtonEnd'\n\t| 'actionButtonForwardNext'\n\t| 'actionButtonHelp'\n\t| 'actionButtonHome'\n\t| 'actionButtonInformation'\n\t| 'actionButtonMovie'\n\t| 'actionButtonReturn'\n\t| 'actionButtonSound'\n\t| 'arc'\n\t| 'bentArrow'\n\t| 'bentUpArrow'\n\t| 'bevel'\n\t| 'blockArc'\n\t| 'borderCallout1'\n\t| 'borderCallout2'\n\t| 'borderCallout3'\n\t| 'bracePair'\n\t| 'bracketPair'\n\t| 'callout1'\n\t| 'callout2'\n\t| 'callout3'\n\t| 'can'\n\t| 'chartPlus'\n\t| 'chartStar'\n\t| 'chartX'\n\t| 'chevron'\n\t| 'chord'\n\t| 'circularArrow'\n\t| 'cloud'\n\t| 'cloudCallout'\n\t| 'corner'\n\t| 'cornerTabs'\n\t| 'cube'\n\t| 'curvedDownArrow'\n\t| 'curvedLeftArrow'\n\t| 'curvedRightArrow'\n\t| 'curvedUpArrow'\n\t| 'custGeom'\n\t| 'decagon'\n\t| 'diagStripe'\n\t| 'diamond'\n\t| 'dodecagon'\n\t| 'donut'\n\t| 'doubleWave'\n\t| 'downArrow'\n\t| 'downArrowCallout'\n\t| 'ellipse'\n\t| 'ellipseRibbon'\n\t| 'ellipseRibbon2'\n\t| 'flowChartAlternateProcess'\n\t| 'flowChartCollate'\n\t| 'flowChartConnector'\n\t| 'flowChartDecision'\n\t| 'flowChartDelay'\n\t| 'flowChartDisplay'\n\t| 'flowChartDocument'\n\t| 'flowChartExtract'\n\t| 'flowChartInputOutput'\n\t| 'flowChartInternalStorage'\n\t| 'flowChartMagneticDisk'\n\t| 'flowChartMagneticDrum'\n\t| 'flowChartMagneticTape'\n\t| 'flowChartManualInput'\n\t| 'flowChartManualOperation'\n\t| 'flowChartMerge'\n\t| 'flowChartMultidocument'\n\t| 'flowChartOfflineStorage'\n\t| 'flowChartOffpageConnector'\n\t| 'flowChartOnlineStorage'\n\t| 'flowChartOr'\n\t| 'flowChartPredefinedProcess'\n\t| 'flowChartPreparation'\n\t| 'flowChartProcess'\n\t| 'flowChartPunchedCard'\n\t| 'flowChartPunchedTape'\n\t| 'flowChartSort'\n\t| 'flowChartSummingJunction'\n\t| 'flowChartTerminator'\n\t| 'foldedCorner'\n\t| 'frame'\n\t| 'funnel'\n\t| 'gear6'\n\t| 'gear9'\n\t| 'halfFrame'\n\t| 'heart'\n\t| 'heptagon'\n\t| 'hexagon'\n\t| 'homePlate'\n\t| 'horizontalScroll'\n\t| 'irregularSeal1'\n\t| 'irregularSeal2'\n\t| 'leftArrow'\n\t| 'leftArrowCallout'\n\t| 'leftBrace'\n\t| 'leftBracket'\n\t| 'leftCircularArrow'\n\t| 'leftRightArrow'\n\t| 'leftRightArrowCallout'\n\t| 'leftRightCircularArrow'\n\t| 'leftRightRibbon'\n\t| 'leftRightUpArrow'\n\t| 'leftUpArrow'\n\t| 'lightningBolt'\n\t| 'line'\n\t| 'lineInv'\n\t| 'mathDivide'\n\t| 'mathEqual'\n\t| 'mathMinus'\n\t| 'mathMultiply'\n\t| 'mathNotEqual'\n\t| 'mathPlus'\n\t| 'moon'\n\t| 'noSmoking'\n\t| 'nonIsoscelesTrapezoid'\n\t| 'notchedRightArrow'\n\t| 'octagon'\n\t| 'parallelogram'\n\t| 'pentagon'\n\t| 'pie'\n\t| 'pieWedge'\n\t| 'plaque'\n\t| 'plaqueTabs'\n\t| 'plus'\n\t| 'quadArrow'\n\t| 'quadArrowCallout'\n\t| 'rect'\n\t| 'ribbon'\n\t| 'ribbon2'\n\t| 'rightArrow'\n\t| 'rightArrowCallout'\n\t| 'rightBrace'\n\t| 'rightBracket'\n\t| 'round1Rect'\n\t| 'round2DiagRect'\n\t| 'round2SameRect'\n\t| 'roundRect'\n\t| 'rtTriangle'\n\t| 'smileyFace'\n\t| 'snip1Rect'\n\t| 'snip2DiagRect'\n\t| 'snip2SameRect'\n\t| 'snipRoundRect'\n\t| 'squareTabs'\n\t| 'star10'\n\t| 'star12'\n\t| 'star16'\n\t| 'star24'\n\t| 'star32'\n\t| 'star4'\n\t| 'star5'\n\t| 'star6'\n\t| 'star7'\n\t| 'star8'\n\t| 'stripedRightArrow'\n\t| 'sun'\n\t| 'swooshArrow'\n\t| 'teardrop'\n\t| 'trapezoid'\n\t| 'triangle'\n\t| 'upArrow'\n\t| 'upArrowCallout'\n\t| 'upDownArrow'\n\t| 'upDownArrowCallout'\n\t| 'uturnArrow'\n\t| 'verticalScroll'\n\t| 'wave'\n\t| 'wedgeEllipseCallout'\n\t| 'wedgeRectCallout'\n\t| 'wedgeRoundRectCallout'\n\t| CONNECTOR_PRESET_NAME\n\n/**\n * Valid ECMA-376 `ST_ShapeType` presets that are not surfaced with a friendly\n * `ShapeType` name. They are still legal geometries PowerPoint renders, so the\n * preset-validation set must accept them.\n */\nconst EXTRA_SHAPE_PRESETS = [\n\t'straightConnector1',\n\t'bentConnector2',\n\t'bentConnector3',\n\t'bentConnector4',\n\t'bentConnector5',\n\t'curvedConnector2',\n\t'curvedConnector3',\n\t'curvedConnector4',\n\t'curvedConnector5',\n] as const\n\n/**\n * Connector preset geometries (`straightConnector1` / `bentConnector{2-5}` /\n * `curvedConnector{2-5}`) that `addShape` can serialize but that are not surfaced\n * as friendly `ShapeType` names. Derived from `EXTRA_SHAPE_PRESETS` so the public\n * `SHAPE_NAME` union and the runtime `VALID_SHAPE_PRESETS` set share one source of\n * truth and cannot drift. Use `addConnector` for live, endpoint-bound connectors;\n * pass these to `addShape` for a static box-positioned connector geometry.\n */\nexport type CONNECTOR_PRESET_NAME = (typeof EXTRA_SHAPE_PRESETS)[number]\n\n/**\n * Every shape geometry name ts-pptx can serialize without corrupting the\n * package: the OOXML preset geometries (`ST_ShapeType` — `ShapeType` values\n * plus the unexposed connectors above) and `custGeom` (freeform paths, emitted\n * as `<a:custGeom>` rather than `<a:prstGeom>`). Used to reject bogus presets\n * before they become an invalid `<a:prstGeom prst=\"...\">` that triggers\n * PowerPoint's \"needs repair\" dialog and drops the shape.\n */\nexport const VALID_SHAPE_PRESETS: ReadonlySet<string> = new Set<string>([\n\t...Object.values(ShapeType),\n\t...EXTRA_SHAPE_PRESETS,\n])\n\n/**\n * Narrow a public `CHART_NAME` to the internal `ChartType` enum. Because\n * `CHART_NAME` is derived from `ChartType`, every `CHART_NAME` value is by\n * construction a valid enum value, so this conversion is total and safe — it is\n * the single boundary cast that lets internal code compare against the enum\n * (enum-to-enum) instead of enum-to-string.\n */\nexport function asChartType(name: CHART_NAME): ChartType {\n\treturn name as ChartType\n}\n\n/** Every {@link ChartType} value, for validating a caller-supplied `type` at the API boundary. */\nconst CHART_TYPES: ReadonlySet<string> = new Set<string>(Object.values(ChartType))\n\n/**\n * Is `name` a chart type this library emits?\n *\n * `CHART_NAME` constrains TypeScript callers, but `addChart` is reachable from plain JavaScript\n * where nothing enforces the union — and the two emitters partition the catalog between them by\n * `switch`, so an off-catalog string has no arm in either and cannot produce a plot. Checked once\n * at define time (`gen/define/chart.ts`) so the caller hears about it at the call that was wrong,\n * rather than getting a chart-shaped hole in the deck.\n */\nexport function isChartType(name: unknown): name is CHART_NAME {\n\treturn typeof name === 'string' && CHART_TYPES.has(name)\n}\n\n/**\n * The chartEx (`cx:` / Office 2016 chart-extension) chart types. Unlike the classic 2007 catalog\n * these do NOT emit a `<c:chartSpace>` chart part: they emit a separate `chartEx{N}.xml` part in\n * the `http://schemas.microsoft.com/office/drawing/2014/chartex` namespace, are referenced from\n * the slide through `<mc:AlternateContent>`, and render only in PowerPoint 2016+/Microsoft 365\n * (older Office, Google Slides, Keynote and LibreOffice show the `<mc:Fallback>` shape instead).\n * See `gen/chart/chartex-xml.ts`.\n */\nconst CHARTEX_TYPES: ReadonlySet<string> = new Set<string>([\n\tChartType.waterfall,\n\tChartType.funnel,\n\tChartType.treemap,\n\tChartType.sunburst,\n\tChartType.histogram,\n\tChartType.pareto,\n\tChartType.boxWhisker,\n\tChartType.regionMap,\n])\n\n/**\n * Is `type` a chartEx (cx:) chart? Accepts a `ChartType`/`CHART_NAME` string; anything else —\n * including a combo-chart `ChartMulti[]` array or `undefined` — is not a chartEx type (combos are\n * classic-only), so those return `false`.\n */\nexport function isChartExType(type: unknown): boolean {\n\treturn typeof type === 'string' && CHARTEX_TYPES.has(type)\n}\n\nexport enum SlideObjectType {\n\tchart = 'chart',\n\tconnector = 'connector',\n\tgroup = 'group',\n\thyperlink = 'hyperlink',\n\timage = 'image',\n\tmedia = 'media',\n\tmodel3d = 'model3d',\n\toleObject = 'oleObject',\n\tonline = 'online',\n\tplaceholder = 'placeholder',\n\ttable = 'table',\n\ttablecell = 'tablecell',\n\ttext = 'text',\n\tnotes = 'notes',\n\tzoom = 'zoom',\n}\n\n/**\n * Maps a friendly `ConnectorType` to its OOXML connector preset *family*. `straight`\n * has a single fixed preset; `elbow` and `curved` select a member by bend count\n * (`bentConnector{3,4,5}` / `curvedConnector{3,4,5}`) — see `connectorPresetFor`.\n */\nexport const CONNECTOR_PRESETS = {\n\tstraight: 'straightConnector1',\n\telbow: 'bentConnector',\n\tcurved: 'curvedConnector',\n} as const satisfies Record<'straight' | 'elbow' | 'curved', string>\n\n/**\n * Resolve the concrete connector preset geometry name for a `type` + bend count.\n * `straight` ignores `bends` (it has no adjustable jog). For `elbow` / `curved`, the\n * preset suffix is `bends + 2`, so `bends` of 1/2/3 maps to `…Connector3/4/5`, each\n * of which exposes exactly `bends` adjustable guides (`adj1…adjN`).\n * @param {'straight' | 'elbow' | 'curved'} type - friendly connector routing style\n * @param {number} bends - number of adjustable bends (1–3); ignored for `straight`\n * @return {CONNECTOR_PRESET_NAME} OOXML preset geometry name (e.g. `bentConnector4`)\n */\nexport function connectorPresetFor(type: 'straight' | 'elbow' | 'curved', bends: number): CONNECTOR_PRESET_NAME {\n\tif (type === 'straight') return CONNECTOR_PRESETS.straight\n\treturn `${CONNECTOR_PRESETS[type]}${bends + 2}` as CONNECTOR_PRESET_NAME\n}\nexport enum PlaceholderType {\n\ttitle = 'title',\n\tbody = 'body',\n\timage = 'pic',\n\tchart = 'chart',\n\ttable = 'tbl',\n\tmedia = 'media',\n}\n/**\n * Placeholder-type name. Derived from the `PlaceholderType` enum (above) so the two\n * never drift.\n */\nexport type PLACEHOLDER_TYPE = `${PlaceholderType}`\n\n/**\n * Bullet glyph presets. Only `DEFAULT` is currently wired through to output; the remaining entries are\n * reserved and not yet selectable via options.\n */\nexport enum BulletType {\n\tDEFAULT = '&#x2022;',\n\tCHECK = '&#x2713;',\n\tSTAR = '&#x2605;',\n\tTRIANGLE = '&#x25B6;',\n}\n\n/**\n * Built-in PowerPoint table style IDs.\n *\n * Each value is the GUID that goes into `<a:tableStyleId>` inside `<a:tblPr>`.\n * These 74 GUIDs are the complete set defined in [MS-OE376] §5.1.6.10 and are\n * resolved by PowerPoint without embedding any style definition in the file.\n *\n * Only these enum members are supported. Raw GUID strings are not accepted;\n * use `TableStyle` members exclusively.\n */\nexport enum TableStyle {\n\t// ── No style ────────────────────────────────────────────────────────────\n\tNO_STYLE_NO_GRID = '{2D5ABB26-0587-4C30-8999-92F81FD0307C}',\n\tNO_STYLE_TABLE_GRID = '{5940675A-B579-460E-94D1-54222C63F5DA}',\n\n\t// ── Themed Style 1 ──────────────────────────────────────────────────────\n\tTHEMED_STYLE_1_ACCENT_1 = '{3C2FFA5D-87B4-456A-9821-1D502468CF0F}',\n\tTHEMED_STYLE_1_ACCENT_2 = '{284E427A-3D55-4303-BF80-6455036E1DE7}',\n\tTHEMED_STYLE_1_ACCENT_3 = '{69C7853C-536D-4A76-A0AE-DD22124D55A5}',\n\tTHEMED_STYLE_1_ACCENT_4 = '{775DCB02-9BB8-47FD-8907-85C794F793BA}',\n\tTHEMED_STYLE_1_ACCENT_5 = '{35758FB7-9AC5-4552-8A53-C91805E547FA}',\n\tTHEMED_STYLE_1_ACCENT_6 = '{08FB837D-C827-4EFA-A057-4D05807E0F7C}',\n\n\t// ── Themed Style 2 ──────────────────────────────────────────────────────\n\tTHEMED_STYLE_2_ACCENT_1 = '{D113A9D2-9D6B-4929-AA2D-F23B5EE8CBE7}',\n\tTHEMED_STYLE_2_ACCENT_2 = '{18603FDC-E32A-4AB5-989C-0864C3EAD2B8}',\n\tTHEMED_STYLE_2_ACCENT_3 = '{306799F8-075E-4A3A-A7F6-7FBC6576F1A4}',\n\tTHEMED_STYLE_2_ACCENT_4 = '{E269D01E-BC32-4049-B463-5C60D7B0CCD2}',\n\tTHEMED_STYLE_2_ACCENT_5 = '{327F97BB-C833-4FB7-BDE5-3F7075034690}',\n\tTHEMED_STYLE_2_ACCENT_6 = '{638B1855-1B75-4FBE-930C-398BA8C253C6}',\n\n\t// ── Light Style 1 ───────────────────────────────────────────────────────\n\tLIGHT_STYLE_1 = '{9D7B26C5-4107-4FEC-AEDC-1716B250A1EF}',\n\tLIGHT_STYLE_1_ACCENT_1 = '{3B4B98B0-60AC-42C2-AFA5-B58CD77FA1E5}',\n\tLIGHT_STYLE_1_ACCENT_2 = '{0E3FDE45-AF77-4B5C-9715-49D594BDF05E}',\n\tLIGHT_STYLE_1_ACCENT_3 = '{C083E6E3-FA7D-4D7B-A595-EF9225AFEA82}',\n\tLIGHT_STYLE_1_ACCENT_4 = '{D27102A9-8310-4765-A935-A1911B00CA55}',\n\tLIGHT_STYLE_1_ACCENT_5 = '{5FD0F851-EC5A-4D38-B0AD-8093EC10F338}',\n\tLIGHT_STYLE_1_ACCENT_6 = '{68D230F3-CF80-4859-8CE7-A43EE81993B5}',\n\n\t// ── Light Style 2 ───────────────────────────────────────────────────────\n\tLIGHT_STYLE_2 = '{7E9639D4-E3E2-4D34-9284-5A2195B3D0D7}',\n\tLIGHT_STYLE_2_ACCENT_1 = '{69012ECD-51FC-41F1-AA8D-1B2483CD663E}',\n\tLIGHT_STYLE_2_ACCENT_2 = '{72833802-FEF1-4C79-8D5D-14CF1EAF98D9}',\n\tLIGHT_STYLE_2_ACCENT_3 = '{F2DE63D5-997A-4646-A377-4702673A728D}',\n\tLIGHT_STYLE_2_ACCENT_4 = '{17292A2E-F333-43FB-9621-5CBBE7FDCDCB}',\n\tLIGHT_STYLE_2_ACCENT_5 = '{5A111915-BE36-4E01-A7E5-04B1672EAD32}',\n\tLIGHT_STYLE_2_ACCENT_6 = '{912C8C85-51F0-491E-9774-3900AFEF0FD7}',\n\n\t// ── Light Style 3 ───────────────────────────────────────────────────────\n\tLIGHT_STYLE_3 = '{616DA210-FB5B-4158-B5E0-FEB733F419BA}',\n\tLIGHT_STYLE_3_ACCENT_1 = '{BC89EF96-8CEA-46FF-86C4-4CE0E7609802}',\n\tLIGHT_STYLE_3_ACCENT_2 = '{5DA37D80-6434-44D0-A028-1B22A696006F}',\n\tLIGHT_STYLE_3_ACCENT_3 = '{8799B23B-EC83-4686-B30A-512413B5E67A}',\n\tLIGHT_STYLE_3_ACCENT_4 = '{ED083AE6-46FA-4A59-8FB0-9F97EB10719F}',\n\tLIGHT_STYLE_3_ACCENT_5 = '{BDBED569-4797-4DF1-A0F4-6AAB3CD982D8}',\n\tLIGHT_STYLE_3_ACCENT_6 = '{E8B1032C-EA38-4F05-BA0D-38AFFFC7BED3}',\n\n\t// ── Medium Style 1 ──────────────────────────────────────────────────────\n\tMEDIUM_STYLE_1 = '{793D81CF-94F2-401A-BA57-92F5A7B2D0C5}',\n\tMEDIUM_STYLE_1_ACCENT_1 = '{B301B821-A1FF-4177-AEE7-76D212191A09}',\n\tMEDIUM_STYLE_1_ACCENT_2 = '{9DCAF9ED-07DC-4A11-8D7F-57B35C25682E}',\n\tMEDIUM_STYLE_1_ACCENT_3 = '{1FECB4D8-DB02-4DC6-A0A2-4F2EBAE1DC90}',\n\tMEDIUM_STYLE_1_ACCENT_4 = '{1E171933-4619-4E11-9A3F-F7608DF75F80}',\n\tMEDIUM_STYLE_1_ACCENT_5 = '{FABFCF23-3B69-468F-B69F-88F6DE6A72F2}',\n\tMEDIUM_STYLE_1_ACCENT_6 = '{10A1B5D5-9B99-4C35-A422-299274C87663}',\n\n\t// ── Medium Style 2 ──────────────────────────────────────────────────────\n\tMEDIUM_STYLE_2 = '{073A0DAA-6AF3-43AB-8588-CEC1D06C72B9}',\n\tMEDIUM_STYLE_2_ACCENT_1 = '{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}',\n\tMEDIUM_STYLE_2_ACCENT_2 = '{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}',\n\tMEDIUM_STYLE_2_ACCENT_3 = '{F5AB1C69-6EDB-4FF4-983F-18BD219EF322}',\n\tMEDIUM_STYLE_2_ACCENT_4 = '{00A15C55-8517-42AA-B614-E9B94910E393}',\n\tMEDIUM_STYLE_2_ACCENT_5 = '{7DF18680-E054-41AD-8BC1-D1AEF772440D}',\n\tMEDIUM_STYLE_2_ACCENT_6 = '{93296810-A885-4BE3-A3E7-6D5BEEA58F35}',\n\n\t// ── Medium Style 3 ──────────────────────────────────────────────────────\n\tMEDIUM_STYLE_3 = '{8EC20E35-A176-4012-BC5E-935CFFF8708E}',\n\tMEDIUM_STYLE_3_ACCENT_1 = '{6E25E649-3F16-4E02-A733-19D2CDBF48F0}',\n\tMEDIUM_STYLE_3_ACCENT_2 = '{85BE263C-DBD7-4A20-BB59-AAB30ACAA65A}',\n\tMEDIUM_STYLE_3_ACCENT_3 = '{EB344D84-9AFB-497E-A393-DC336BA19D2E}',\n\tMEDIUM_STYLE_3_ACCENT_4 = '{EB9631B5-78F2-41C9-869B-9F39066F8104}',\n\tMEDIUM_STYLE_3_ACCENT_5 = '{74C1A8A3-306A-4EB7-A6B1-4F7E0EB9C5D6}',\n\tMEDIUM_STYLE_3_ACCENT_6 = '{2A488322-F2BA-4B5B-9748-0D474271808F}',\n\n\t// ── Medium Style 4 ──────────────────────────────────────────────────────\n\tMEDIUM_STYLE_4 = '{D7AC3CCA-C797-4891-BE02-D94E43425B78}',\n\tMEDIUM_STYLE_4_ACCENT_1 = '{69CF1AB2-1976-4502-BF36-3FF5EA218861}',\n\tMEDIUM_STYLE_4_ACCENT_2 = '{8A107856-5554-42FB-B03E-39F5DBC370BA}',\n\tMEDIUM_STYLE_4_ACCENT_3 = '{0505E3EF-67EA-436B-97B2-0124C06EBD24}',\n\tMEDIUM_STYLE_4_ACCENT_4 = '{C4B1156A-380E-4F78-BDF5-A606A8083BF9}',\n\tMEDIUM_STYLE_4_ACCENT_5 = '{22838BEF-8BB2-4498-84A7-C5851F593DF1}',\n\tMEDIUM_STYLE_4_ACCENT_6 = '{16D9F66E-5EB9-4882-86FB-DCBF35E3C3E4}',\n\n\t// ── Dark Style 1 ────────────────────────────────────────────────────────\n\tDARK_STYLE_1 = '{E8034E78-7F5D-4C2E-B375-FC64B27BC917}',\n\tDARK_STYLE_1_ACCENT_1 = '{125E5076-3810-47DD-B79F-674D7AD40C01}',\n\tDARK_STYLE_1_ACCENT_2 = '{37CE84F3-28C3-443E-9E96-99CF82512B78}',\n\tDARK_STYLE_1_ACCENT_3 = '{D03447BB-5D67-496B-8E87-E561075AD55C}',\n\tDARK_STYLE_1_ACCENT_4 = '{E929F9F4-4A8F-4326-A1B4-22849713DDAB}',\n\tDARK_STYLE_1_ACCENT_5 = '{8FD4443E-F989-4FC4-A0C8-D5A2AF1F390B}',\n\tDARK_STYLE_1_ACCENT_6 = '{AF606853-7671-496A-8E4F-DF71F8EC918B}',\n\n\t// ── Dark Style 2 ────────────────────────────────────────────────────────\n\tDARK_STYLE_2 = '{5202B0CA-FC54-4496-8BCA-5EF66A818D29}',\n\t/** Header uses Accent 2, body rows use Accent 1 */\n\tDARK_STYLE_2_ACCENT_1_ACCENT_2 = '{0660B408-B3CF-4A94-85FC-2B1E0A45F4A2}',\n\t/** Header uses Accent 4, body rows use Accent 3 */\n\tDARK_STYLE_2_ACCENT_3_ACCENT_4 = '{91EBBBCC-DAD2-459C-BE2E-F6DE35CF9A28}',\n\t/** Header uses Accent 6, body rows use Accent 5 */\n\tDARK_STYLE_2_ACCENT_5_ACCENT_6 = '{46F890A9-2807-4EBB-B81D-B2AA78EC7F39}',\n}\n","/**\n * Generator-internal constants — the non-published half of the enums module.\n *\n * `enums.ts` holds the genuinely public surface (the `ChartType`/`ShapeType`/\n * `SchemeColor`/`AlignH`… enums, the shape-preset sets, and the `*_NAME` unions) and is\n * `export *`-ed by every entrypoint. This module holds the constants only the generators\n * need — default styling, fixed axis/field ids, colour palettes, layout bases, and the\n * base64 placeholder images — none of which are part of the public API. Splitting them out\n * keeps `export *` from leaking them onto the package surface, mirroring the\n * `units-internal.ts` / `types/internal.ts` split. Nothing here is exported from an entrypoint.\n */\n\nimport type { BorderProps, OptsChartGridLine } from './types/index.js'\nimport type { ShadowPropsInternal } from './types/internal.js'\n\n// CONST\nexport const CRLF = '\\r\\n' // AKA: Chr(13) & Chr(10)\n// Base for `<p:sldLayoutId id>` (layout N gets BASE + N). 2147483649 = 0x80000001:\n// ECMA-376 ST_SlideLayoutId requires id >= 0x80000000, and PowerPoint conventionally\n// starts layout IDs one past that. See `makeXmlMaster` in `gen/slide/master.ts`.\nexport const LAYOUT_IDX_SERIES_BASE = 2147483649\nexport const REGEX_HEX_COLOR = /^[0-9a-fA-F]{6}$/\nexport const LINEH_MODIFIER = 1.67 // AKA: Golden Ratio Typography\n\nexport const DEF_BULLET_MARGIN = 27\nexport const DEF_CELL_BORDER: BorderProps = { type: 'solid', color: '666666', width: 1 }\nexport const DEF_CELL_MARGIN_IN: [number, number, number, number] = [0.05, 0.1, 0.05, 0.1] // \"Normal\" margins in PPT-2021 (\"Narrow\" is `0.05` for all 4)\nexport const DEF_CHART_BORDER: BorderProps = { type: 'solid', color: '363636', width: 1 }\nexport const DEF_CHART_GRIDLINE: OptsChartGridLine = { color: '888888', style: 'solid', size: 1, cap: 'flat' }\nexport const DEF_FONT_COLOR = '000000'\nexport const DEF_FONT_SIZE = 12\nexport const DEF_FONT_TITLE_SIZE = 18\nexport const DEF_PRES_LAYOUT = 'LAYOUT_16x9'\nexport const DEF_PRES_LAYOUT_NAME = 'DEFAULT'\nexport const DEF_SHAPE_LINE_COLOR = '333333'\nexport const DEF_SHAPE_SHADOW: ShadowPropsInternal = {\n\ttype: 'outer',\n\tblur: 3,\n\toffset: 23000 / 12700,\n\tangle: 90,\n\tcolor: '000000',\n\t_alpha: 0.35,\n\trotateWithShape: true,\n}\nexport const DEF_SLIDE_MARGIN_IN: [number, number, number, number] = [0.5, 0.5, 0.5, 0.5] // TRBL-style\nexport const DEF_TEXT_SHADOW: ShadowPropsInternal = {\n\ttype: 'outer',\n\tblur: 8,\n\toffset: 4,\n\tangle: 270,\n\tcolor: '000000',\n\t_alpha: 0.75,\n}\nexport const DEF_TEXT_GLOW = { size: 8, color: 'FFFFFF', opacity: 0.75 }\n\n// Fixed `<c:axId val>` identifiers that wire each chart's axes together (e.g. a value\n// axis's `<c:crossAx>` points at its category axis by id). ECMA-376 only requires the id\n// be a unique unsigned int within the chart; these stable constants keep the emitted\n// cross-references deterministic across decks. Consumed throughout `gen/chart/`.\nexport const AXIS_ID_VALUE_PRIMARY = '2094734552'\nexport const AXIS_ID_VALUE_SECONDARY = '2094734553'\nexport const AXIS_ID_CATEGORY_PRIMARY = '2094734554'\nexport const AXIS_ID_CATEGORY_SECONDARY = '2094734555'\nexport const AXIS_ID_SERIES_PRIMARY = '2094734556'\n\nexport const LETTERS: string[] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')\n// The default series palettes hold their distinct entries once. Every consumer reaches them\n// through `paletteColor()` (`gen/chart/chart-parts.ts`), which wraps back to the start, so a\n// chart with more series or points than the palette has entries repeats it rather than\n// running off the end.\nexport const BARCHART_COLORS: string[] = [\n\t'C0504D',\n\t'4F81BD',\n\t'9BBB59',\n\t'8064A2',\n\t'4BACC6',\n\t'F79646',\n\t'628FC6',\n\t'C86360',\n]\nexport const PIECHART_COLORS: string[] = [\n\t'5DA5DA',\n\t'FAA43A',\n\t'60BD68',\n\t'F17CB0',\n\t'B2912F',\n\t'B276B2',\n\t'DECF3F',\n\t'F15854',\n\t'A7A7A7',\n]\n\n// Fixed GUID PowerPoint stamps on a slide-number field: `<a:fld id=\"{...}\" type=\"slidenum\">`.\n// Microsoft-specific (not defined by ECMA-376); reused verbatim so PowerPoint recognizes the\n// field and auto-updates the page number. Consumed in `gen/slide/object.ts` (`slideObjectToXml`).\nexport const SLDNUMFLDID = '{F7021451-1387-4CA6-816F-3879F97B5CBC}'\n\n// Cached text of a slide-number field on a part that has no slide number of its own — a master\n// or a layout. Guillemets around a hash, which is verbatim what PowerPoint caches there: every\n// en-US master and layout in `test/read/fixtures/` writes `<a:t>‹#›</a:t>`. (A German-locale\n// deck writes `‹Nr.›`; the cache is recomputed on open, so the en-US spelling is the one to\n// emit rather than a per-locale table.) Consumed in `gen/slide/object.ts`.\nexport const SLDNUM_PLACEHOLDER_TEXT = '‹#›'\n\n// The XML prolog every emitted OOXML part begins with. Kept as one constant so a\n// stray edit can't desync one part's declaration from the rest.\nexport const XML_DECL = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>'\n","/**\n * Generator-side unit conversion — the lenient layer over `units.ts`.\n *\n * `units.ts` holds the strict, public primitives: one branded `Emu` type and converters that\n * take a number and throw on anything they cannot represent. This module holds what the\n * generators actually need on top of that: converters that accept the loose shapes the\n * authoring API has always accepted (numeric strings, `\"5in\"`, `null`), that clamp to the\n * ranges PowerPoint will load without offering to repair the file, and that warn about legacy\n * inputs instead of failing.\n *\n * The split is deliberate: the leniency and the back-compat warnings are policy, not\n * arithmetic, and policy should not be part of the published API. Nothing here is exported\n * from an entrypoint.\n */\n\nimport { warn, warnOnce } from './diagnostics.js'\nimport { InvalidOptionError } from './errors.js'\nimport {\n\tEMU_PER_INCH,\n\tEMU_PER_POINT,\n\tANGLE_UNITS_PER_DEGREE,\n\tcoordToEmu,\n\tFIXED_PCT_PER_PERCENT,\n\tinchesToEmu,\n\tPERCENT_SCALE,\n\ttype Emu,\n} from './units.js'\nimport type { Coord, PresLayout } from './types/index.js'\n\n/**\n * Resolve a user `Coord` (x/y/w/h) to EMU — the single user-coordinate → EMU boundary.\n * - bare `number` → **inches** (no magnitude guessing); `\"<n>%\"` → percent of the slide axis;\n * `\"<n>in\"`/`\"<n>pt\"`/`\"<n>emu\"` → explicit units (see {@link Coord} / {@link coordToEmu})\n * - `null`/`undefined` → 0 (callers may omit a coordinate)\n * - throws on a non-finite number rather than silently collapsing the object to zero size\n * @param {Coord|null|undefined} size - user coordinate\n * @param {'X' | 'Y'} xyDir - axis (selects slide width vs height for percentages)\n * @param {PresLayout} layout - presentation layout (EMU dimensions)\n * @returns {Emu} resolved EMU value\n */\nexport function getSmartParseNumber(size: Coord | null | undefined, xyDir: 'X' | 'Y', layout: PresLayout): Emu {\n\tif (size === null || size === undefined) return 0 as Emu\n\n\t// GUARD: A NaN/Infinity coordinate is always a mistake (commonly arithmetic on an\n\t// `undefined` layout dimension). Fail loud with a targeted hint instead of the generic\n\t// converter message, since this is the most common way a deck collapses to zero-size.\n\tif (typeof size === 'number' && !isFinite(size)) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'coord/non-finite',\n\t\t\t`Invalid ${xyDir || 'coordinate'} value: expected a finite number but received ${String(size)}. ` +\n\t\t\t\t'This usually means a layout dimension was read from a missing property (e.g. `layout.width` returning `undefined`). ' +\n\t\t\t\t'Use `slide.width`/`slide.height` or `STANDARD_LAYOUTS.<NAME>.width`/`.height` (inches).'\n\t\t)\n\t}\n\n\treturn coordToEmu(size, xyDir === 'Y' ? layout.height : layout.width)\n}\n\n/**\n * Convert inches into EMU.\n * - accepts a number (inches) or a numeric/`\"<n>in\"` string\n * - no magnitude guessing: values are always treated as inches (use {@link coordToEmu} for\n * user coordinates that may carry other units)\n * @param {number|string} inches - inches as number or string\n * @returns {Emu} EMU value\n */\nexport function inch2Emu(inches: number | string): Emu {\n\tif (typeof inches === 'string') inches = Number(inches.replace(/in*/gi, ''))\n\treturn inchesToEmu(inches)\n}\n\n/**\n * Convert a single `margin` component (table cell/table margin, or text-box/placeholder body\n * inset) to EMU.\n *\n * Margins are INCHES, consistent with the positional API (`x`/`y`/`w`/`h`) and the value\n * PowerPoint's own dialog shows (both the table cell-margin and the text-box internal-margin\n * fields are inches). Historically the library read these as POINTS (table cells used a magnitude\n * heuristic — `>= 1` points, `< 1` inches; text-box margins were straight points), so a legitimate\n * fraction-of-an-inch value entered from the PowerPoint dialog became a tiny points value. Every\n * value is now inches. A `>= 1` value is honored as inches but warns once, because it is almost\n * certainly a legacy points value that should be divided by 72 (e.g. `10` points → `0.139` inches).\n *\n * Shared by every margin site so they stay in lockstep: the cell XML emitter and text-box/slide-\n * number insets (`gen/slide/object.ts`), the autoPage row-height pass (`gen/table/autopage.ts`), and the measured-fit pass\n * (`measure-fit`).\n * @param {number} inches - margin component in inches\n * @returns {Emu} EMU value\n */\nexport function marginToEmu(inches: number): Emu {\n\tif (inches >= 1)\n\t\twarnOnce(\n\t\t\t'margin/legacy-points',\n\t\t\t'margins (table cell and text-box) are interpreted as inches (matching the rest of the API and the ' +\n\t\t\t\t'PowerPoint dialog); a value >= 1 is likely a legacy points value — divide by 72 to convert (e.g. 10pt => 0.139in).'\n\t\t)\n\treturn inch2Emu(inches)\n}\n\n/**\n * Resolve a table's column widths to EMU, the single source of truth shared by the\n * table XML emitter and the measured-fit pass (so a fitted cell sees the same grid\n * the renderer draws).\n * - an explicit `colW` **array** is per-column inches (`inch2Emu`); a non-finite slot\n * falls back to the even-distribution width\n * - otherwise the table's already-resolved width (`totalWidthEmu`, EMU) is split evenly\n * across `colCount` columns. (A scalar `colW` never reaches here — `addTableDefinition`\n * converts it to `w` and clears `colW`.)\n *\n * IMPORTANT: the even path divides an **EMU** width. Passing the raw inches `options.w`\n * instead (the historical bug) produced ~0-EMU columns (e.g. `w=9` → `gridCol w=\"3\"`),\n * collapsing auto-width tables to a sliver in PowerPoint/LibreOffice.\n * @param {Coord[]|Coord|undefined} colW - explicit per-column inches, or scalar/undefined\n * @param {number} totalWidthEmu - the table's resolved width in EMU\n * @param {number} colCount - number of grid columns (counting colspans)\n * @returns {number[]} per-column widths in EMU (length `colCount`)\n */\nexport function resolveTableColWidthsEmu(\n\tcolW: Coord[] | Coord | undefined,\n\ttotalWidthEmu: number,\n\tcolCount: number\n): number[] {\n\tif (!(colCount > 0)) return []\n\tconst even = totalWidthEmu > 0 ? Math.round(totalWidthEmu / colCount) : EMU_PER_INCH\n\tif (Array.isArray(colW)) {\n\t\treturn Array.from({ length: colCount }, (_, i) => {\n\t\t\t// Guard before inch2Emu: it throws on non-finite input. A missing/NaN slot\n\t\t\t// falls back to the even-distribution width.\n\t\t\tconst n = colW[i]\n\t\t\treturn typeof n === 'number' && Number.isFinite(n) ? Math.round(inch2Emu(n)) : even\n\t\t})\n\t}\n\treturn new Array<number>(colCount).fill(even)\n}\n\n/**\n * Convert points to EMU, leniently: anything that does not read as a finite number — a `NaN`,\n * an `Infinity`, a non-numeric string, `null` — becomes `0` rather than throwing.\n *\n * That is the whole difference from {@link pointsToEmu} in `units.ts`, which throws on the same\n * input. Emitters use this one for the many optional size/width/offset options where a missing\n * or malformed value should collapse the feature (a zero-width line, no shadow offset) rather\n * than take the whole deck down.\n *\n * @param pt - points, as a number or a numeric string\n * @returns the value in EMU, or `0` if it does not read as a finite number\n */\nexport function ptsToEmuLenient(pt: number | string): number {\n\tconst points = Number(pt)\n\treturn Number.isFinite(points) ? Math.round(points * EMU_PER_POINT) : 0\n}\n\n/**\n * Convert a transparency percentage (0-100) into a schema-valid `<a:alpha>` value\n * (ST_PositiveFixedPercentage, 0-100000). Out-of-range transparency yields an\n * alpha that PowerPoint rejects as needing repair, so clamp into range and warn.\n */\nexport function transparencyToAlpha(transparency: number): number {\n\tconst pct = Math.min(100, Math.max(0, transparency))\n\tif (pct !== transparency)\n\t\twarn('transparency/out-of-range', `transparency ${transparency} is outside the valid range 0-100; using ${pct}.`)\n\treturn Math.round((100 - pct) * FIXED_PCT_PER_PERCENT)\n}\n\n/** Convert an opacity (0-1) into a schema-valid `<a:alpha>` value (0-100000); clamps + warns on out-of-range input. */\nexport function opacityToAlpha(opacity: number): number {\n\tconst o = Math.min(1, Math.max(0, opacity))\n\tif (o !== opacity) warn('opacity/out-of-range', `opacity ${opacity} is outside the valid range 0-1; using ${o}.`)\n\treturn Math.round(o * PERCENT_SCALE)\n}\n\n/**\n * Convert a line width (points) to EMU clamped into ST_LineWidth (0..20116800 EMU,\n * i.e. 0-1584pt). Out-of-range widths make PowerPoint report the package as needing\n * repair, so clamp into range and warn.\n */\nexport function lineWidthToEmu(widthPts: number | string): number {\n\tconst raw = ptsToEmuLenient(widthPts)\n\tconst clamped = Math.min(20116800, Math.max(0, raw))\n\tif (clamped !== raw)\n\t\twarn(\n\t\t\t'line/width-out-of-range',\n\t\t\t`line width ${widthPts} is outside the valid range 0-1584pt; using ${clamped / EMU_PER_POINT}.`\n\t\t)\n\treturn clamped\n}\n\n/**\n * Convert degrees to a DrawingML angle (60000ths of a degree), **without** wrapping.\n *\n * Most angles in the format are not modular: a connection site at 400 degrees, a polar adjust\n * handle whose range runs to 540, an arc that sweeps 400 degrees — each means something a\n * reduction into 0..360 would destroy. Use this for those, and {@link convertRotationDegrees}\n * for the ones that genuinely are a rotation.\n *\n * Non-finite input throws rather than reaching the attribute: `Math.round(Infinity * 60000)` is\n * `Infinity`, which serializes as `ang=\"Infinity\"` and makes PowerPoint offer to repair the file.\n *\n * @param d - degrees\n * @param what - what is being converted, for the error message\n * @param code - diagnostic code to throw under, where a caller has a more specific one\n */\nexport function convertAngleUnits(d: number, what: string, code: AngleErrorCode = 'coord/non-finite'): number {\n\tassertFiniteDegrees(d, what, code)\n\treturn Math.round(d * ANGLE_UNITS_PER_DEGREE)\n}\n\n/** The codes {@link convertAngleUnits} may throw under, each declared in `codes.ts`. */\ntype AngleErrorCode = 'coord/non-finite' | 'geometry/arc-angle-non-finite'\n\nfunction assertFiniteDegrees(d: number, what: string, code: AngleErrorCode): void {\n\tif (typeof d !== 'number' || !Number.isFinite(d))\n\t\tthrow new InvalidOptionError(code, `${what} must be a finite number of degrees; received ${String(d)}.`)\n}\n\n/**\n * Convert a shape or gradient rotation (degrees) to a DrawingML angle (60000ths of a degree).\n *\n * A rotation *is* modular — 800 degrees and 80 degrees point the same way — so the value is\n * reduced with `% 360`. The reduction keeps the sign: `-45` stays `-45` rather than becoming\n * `315`, because both are valid `ST_Angle`, PowerPoint writes negative rotations itself, and\n * the read side reports back what was authored. Only an input outside -360..360 moves.\n *\n * @param d - degrees\n * @returns the `rot` value in 60000ths of a degree\n */\nexport function convertRotationDegrees(d: number): number {\n\tconst degrees = d || 0\n\t// Guard before reducing, so `Infinity` is reported as itself rather than as the `NaN` that\n\t// `Infinity % 360` would hand on.\n\tassertFiniteDegrees(degrees, 'rotation', 'coord/non-finite')\n\treturn Math.round((degrees % 360) * ANGLE_UNITS_PER_DEGREE)\n}\n\n/**\n * Convert a freeform arc angle (degrees) to an `<a:arcTo>` ST_AdjAngle value (60000ths).\n * Unlike a shape rotation, a sweep is not modular: a 400 degree swAng draws a different\n * arc than a 40 degree one, so the value is never wrapped into 0..360.\n * @param {number} d degrees\n * @param {'stAng' | 'swAng'} attr - attribute being emitted, for the error message\n * @returns {number} ST_AdjAngle value (60000ths of a degree)\n */\nexport function convertArcAngle(d: number, attr: 'stAng' | 'swAng'): number {\n\treturn convertAngleUnits(d, `Arc ${attr}`, 'geometry/arc-angle-non-finite')\n}\n"],"mappings":";;;AAwBA,I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,UAAU,KAAK,IAAI,GAAG,GAAG,CAAC;CACnD,IAAI,YAAY,KACf,KACC,2BACA,cAAc,SAAS,8CAA8C,UAAU,cAAc,EAC9F;CACD,OAAO;AACR;;;;;;;;;;;;;;;;AAiBA,SAAgB,kBAAkB,GAAW,MAAc,OAAuB,oBAA4B;CAC7G,oBAAoB,GAAG,MAAM,IAAI;CACjC,OAAO,KAAK,MAAM,IAAI,sBAAsB;AAC7C;AAKA,SAAS,oBAAoB,GAAW,MAAc,MAA4B;CACjF,IAAI,OAAO,MAAM,YAAY,CAAC,OAAO,SAAS,CAAC,GAC9C,MAAM,IAAI,mBAAmB,MAAM,GAAG,KAAK,gDAAgD,OAAO,CAAC,EAAE,EAAE;AACzG;;;;;;;;;;;;AAaA,SAAgB,uBAAuB,GAAmB;CACzD,MAAM,UAAU,KAAK;CAGrB,oBAAoB,SAAS,YAAY,kBAAkB;CAC3D,OAAO,KAAK,MAAO,UAAU,MAAO,sBAAsB;AAC3D;;;;;;;;;AAUA,SAAgB,gBAAgB,GAAW,MAAiC;CAC3E,OAAO,kBAAkB,GAAG,OAAO,QAAQ,+BAA+B;AAC3E"}
package/dist/zip.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"zip.d.ts","names":[],"sources":["../src/zip.ts"],"mappings":";;;cAwBa;;;;;;;;EASZ,IAAI,cAAc,eAAe,YAAY;IAAS;;;;;;;;;;EAgBtD,WAAW;IAAQ;IAAc,MAAM;IAAY;;;;;;EAWnD,QAAQ,wBAAqB;;;;;;EAUvB,SACL,MAAM,iBACN;IAAQ;MACN,iBAAiB,cAAc,OAAO;;;;;;;;;;;;;;KAkBrC,oCAAoC,aAAa,cAAc;KACxD,WAAW,gBAAgB,QAAQ;;;;;;;;;;iBAWzB,QAAQ,OAAO,WAAW,QAAQ,YAAY"}
package/dist/zip.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"zip.js","names":["#entries","exhaustive"],"sources":["../src/zip.ts"],"sourcesContent":["import { strToU8, unzipSync, zipSync, type Unzipped, type Zippable, type ZipOptions } from 'fflate'\nimport type { ZIP_OUTPUT_TYPE } from './enums.js'\nimport { InvalidOptionError, PackageReadError, UnsupportedFeatureError } from './errors.js'\n\n/**\n * ZIP backend seam for the write path.\n *\n * fflate is functional — one `{path: bytes}` map in, one `Uint8Array` out — so\n * every contact with the backend is isolated here rather than spread across the\n * incremental builder calls the JSZip API encouraged. Callers accumulate entries\n * with {@link ZipWriter.add} (strings are UTF-8 encoded; already-decoded media\n * passes bytes directly) and finalize with {@link ZipWriter.generate}, which maps\n * fflate's single `Uint8Array` to the requested output shape.\n *\n * Unlike JSZip there is no folder/directory concept: keys are full slash-paths and\n * fflate emits no directory entries, so the package carries only real parts.\n */\n/**\n * Fixed modification time (2001-01-01 UTC) stamped on every entry so archive\n * bytes are reproducible across runs. fflate encodes DOS dates, which are bounded\n * to 1980-2099, so 0/epoch is not usable here.\n */\nconst FIXED_MTIME = Date.UTC(2001, 0, 1)\n\nexport class ZipWriter {\n\treadonly #entries: Zippable = {}\n\n\t/**\n\t * Add a package part.\n\t * @param path - full zip path, e.g. `ppt/slides/slide1.xml`\n\t * @param data - XML string (UTF-8 encoded) or already-decoded bytes (media)\n\t * @param opts.store - skip DEFLATE for this entry (already-compressed media)\n\t */\n\tadd(path: string, data: string | Uint8Array, opts?: { store?: boolean }): void {\n\t\tconst bytes = typeof data === 'string' ? strToU8(data) : data\n\t\t// Pin mtime so archive bytes are reproducible across runs (stable fixtures).\n\t\tconst fileOpts: ZipOptions = { mtime: FIXED_MTIME }\n\t\tif (opts?.store) fileOpts.level = 0\n\t\tthis.#entries[path] = [bytes, fileOpts]\n\t}\n\n\t/**\n\t * Snapshot the accumulated entries in insertion order, before zipping. Each\n\t * entry carries its already-encoded bytes and whether it was added with\n\t * `store` (recovered from the per-entry level). This is the seam the\n\t * package-parts path reads: the same accumulator {@link generate} would zip,\n\t * exposed without running DEFLATE. Every value in `#entries` is the\n\t * `[bytes, opts]` tuple {@link add} writes, so the cast is total.\n\t */\n\tentries(): Array<{ path: string; data: Uint8Array; store: boolean }> {\n\t\treturn Object.entries(this.#entries).map(([path, value]) => {\n\t\t\tconst [bytes, fileOpts] = value as [Uint8Array, ZipOptions]\n\t\t\treturn { path, data: bytes, store: fileOpts.level === 0 }\n\t\t})\n\t}\n\n\t/**\n\t * Compress all accumulated entries to raw zip bytes.\n\t * @param compression - false stores every entry uncompressed (level 0)\n\t */\n\ttoBytes(compression = true): Uint8Array {\n\t\t// Global level is the per-entry default; entries added with `store` keep their level 0.\n\t\treturn zipSync(this.#entries, { level: compression ? 6 : 0, mtime: FIXED_MTIME })\n\t}\n\n\t/**\n\t * Finalize the archive in the requested output shape.\n\t * @param type - one of the supported {@link ZIP_OUTPUT_TYPE} output shapes\n\t * @param opts.compression - false stores every entry uncompressed\n\t */\n\tasync generate(\n\t\ttype: ZIP_OUTPUT_TYPE,\n\t\topts: { compression: boolean }\n\t): Promise<string | ArrayBuffer | Blob | Uint8Array> {\n\t\tconst bytes = this.toBytes(opts.compression)\n\t\treturn convertZipOutput(bytes, type)\n\t}\n}\n\n/**\n * Inputs the read path accepts. A `string` is a **filesystem path** (Node) read\n * from disk; in-memory archives are passed as `Uint8Array`/`ArrayBuffer`/`Blob`/\n * `number[]`. A `Promise` wrapper is allowed so callers can forward an unawaited\n * byte source.\n *\n * Note: unlike JSZip's `loadAsync`, a string is NOT a latin1 binary-content\n * string. That JSZip-compat interpretation was a footgun — every real consumer\n * passes a path, and a path silently became garbage bytes → \"Not a valid ZIP\n * archive\". To read a `binarystring`/`base64` write-path output back in, convert\n * it to bytes first (e.g. `Uint8Array.from(atob(b64), c => c.charCodeAt(0))`).\n */\ntype ZipInputValue = string | number[] | Uint8Array | ArrayBuffer | Blob\nexport type ZipInput = ZipInputValue | Promise<ZipInputValue>\n\n/**\n * Decompress a zip archive to a `path → bytes` map in central-directory order.\n *\n * Read-path counterpart to {@link ZipWriter}: fflate's `unzipSync` needs a\n * `Uint8Array`, so the JSZip-style input auto-detection that `loadAsync` did is\n * reproduced by {@link toUint8Array} first. Directory markers (keys ending in\n * `/`) are dropped — fflate surfaces them but no consumer wants empty-dir\n * entries, and the write path emits none.\n */\nexport async function readZip(input: ZipInput): Promise<Map<string, Uint8Array>> {\n\tconst bytes = await toUint8Array(input)\n\tlet entries: Unzipped\n\ttry {\n\t\tentries = unzipSync(bytes)\n\t} catch (cause) {\n\t\tthrow new PackageReadError('zip/not-a-zip-archive', 'Not a valid ZIP archive', { cause })\n\t}\n\tconst out = new Map<string, Uint8Array>()\n\tfor (const [path, body] of Object.entries(entries)) {\n\t\tif (path.endsWith('/')) continue\n\t\tout.set(path, body)\n\t}\n\treturn out\n}\n\n/**\n * Normalize a read-path input to `Uint8Array`: a `Buffer`/`Uint8Array` passes\n * through, `ArrayBuffer`/`Blob`/`number[]` are copied/wrapped, and a `string` is\n * a **filesystem path** read from disk (Node). See {@link ZipInput} for why a\n * string is a path rather than JSZip's latin1 binary-content string.\n */\nasync function toUint8Array(input: ZipInput): Promise<Uint8Array> {\n\tconst data = await input\n\tif (data instanceof Uint8Array) return data\n\tif (data instanceof ArrayBuffer) return new Uint8Array(data)\n\tif (typeof data === 'string') return readFileAsBytes(data)\n\tif (Array.isArray(data)) return Uint8Array.from(data)\n\tif (typeof Blob !== 'undefined' && data instanceof Blob) return new Uint8Array(await data.arrayBuffer())\n\tthrow new InvalidOptionError(\n\t\t'zip/unsupported-input',\n\t\t'Unsupported zip input type; expected a filesystem path (string), number[], Uint8Array, ArrayBuffer, or Blob'\n\t)\n}\n\n/**\n * Read a `.pptx` (or any zip) from a filesystem path into bytes. Node-only:\n * `node:fs` is imported lazily so the browser build stays free of a Node\n * dependency, and a missing filesystem (browser) or missing file both throw a\n * clear error naming the path — never the opaque \"Not a valid ZIP archive\".\n */\nasync function readFileAsBytes(filePath: string): Promise<Uint8Array> {\n\tlet readFile: (typeof import('node:fs/promises'))['readFile']\n\ttry {\n\t\t;({ readFile } = await import('node:fs/promises'))\n\t} catch {\n\t\tthrow new UnsupportedFeatureError(\n\t\t\t'zip/filesystem-unavailable',\n\t\t\t`Cannot read zip from path \"${filePath}\": filesystem access requires Node. ` +\n\t\t\t\t'Pass a Uint8Array/ArrayBuffer/Blob for an in-memory archive.'\n\t\t)\n\t}\n\ttry {\n\t\treturn new Uint8Array(await readFile(filePath))\n\t} catch (cause) {\n\t\tthrow new PackageReadError(\n\t\t\t'zip/file-read-failed',\n\t\t\t`Cannot read .pptx at \"${filePath}\": ${(cause as Error).message}`,\n\t\t\t{\n\t\t\t\tcause,\n\t\t\t}\n\t\t)\n\t}\n}\n\nconst PPTX_MIME = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'\n\n/** Map fflate's `Uint8Array` to the requested {@link ZIP_OUTPUT_TYPE} output shape. */\nfunction convertZipOutput(bytes: Uint8Array, type: ZIP_OUTPUT_TYPE): string | ArrayBuffer | Blob | Uint8Array {\n\tswitch (type) {\n\t\tcase 'uint8array':\n\t\t\treturn bytes\n\t\tcase 'arraybuffer': {\n\t\t\t// Copy into a fresh (non-shared) ArrayBuffer; fflate's output buffer is\n\t\t\t// typed ArrayBufferLike, which may be a SharedArrayBuffer.\n\t\t\tconst out = new ArrayBuffer(bytes.byteLength)\n\t\t\tnew Uint8Array(out).set(bytes)\n\t\t\treturn out\n\t\t}\n\t\tcase 'nodebuffer':\n\t\t\t// Buffer.from(Uint8Array) copies, so the result owns its memory.\n\t\t\treturn Buffer.from(bytes)\n\t\tcase 'blob':\n\t\t\t// Copy into an ArrayBuffer-backed view so it is a valid BlobPart.\n\t\t\treturn new Blob([new Uint8Array(bytes)], { type: PPTX_MIME })\n\t\tcase 'base64':\n\t\t\treturn bytesToBinaryString(bytes, true)\n\t\tcase 'binarystring':\n\t\t\treturn bytesToBinaryString(bytes, false)\n\t\tdefault: {\n\t\t\tconst exhaustive: never = type\n\t\t\tthrow new InvalidOptionError('zip/unsupported-output', `Unsupported zip output type: ${String(exhaustive)}`)\n\t\t}\n\t}\n}\n\n/**\n * Build a latin1 binary string from bytes (chunked to dodge the argument-count\n * limit of `String.fromCharCode(...spread)` on large archives), optionally\n * base64-encoding it. `btoa` is isomorphic (Node and browsers).\n */\nfunction bytesToBinaryString(bytes: Uint8Array, base64: boolean): string {\n\tlet binary = ''\n\tconst CHUNK = 0x8000\n\tfor (let i = 0; i < bytes.length; i += CHUNK) {\n\t\tbinary += String.fromCharCode(...bytes.subarray(i, i + CHUNK))\n\t}\n\treturn base64 ? btoa(binary) : binary\n}\n\n// Error taxonomy — see `entry-errors.ts`. Re-exported from every entry so `instanceof`\n// works whichever subpath a consumer imports.\nexport * from './entry-errors.js'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,cAAc,KAAK,IAAI,MAAM,GAAG,CAAC;AAEvC,IAAa,YAAb,MAAuB;CACtB,WAA8B,CAAC;;;;;;;CAQ/B,IAAI,MAAc,MAA2B,MAAkC;EAC9E,MAAM,QAAQ,OAAO,SAAS,WAAW,QAAQ,IAAI,IAAI;EAEzD,MAAM,WAAuB,EAAE,OAAO,YAAY;EAClD,IAAI,MAAM,OAAO,SAAS,QAAQ;EAClC,KAAKA,SAAS,QAAQ,CAAC,OAAO,QAAQ;CACvC;;;;;;;;;CAUA,UAAqE;EACpE,OAAO,OAAO,QAAQ,KAAKA,QAAQ,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW;GAC3D,MAAM,CAAC,OAAO,YAAY;GAC1B,OAAO;IAAE;IAAM,MAAM;IAAO,OAAO,SAAS,UAAU;GAAE;EACzD,CAAC;CACF;;;;;CAMA,QAAQ,cAAc,MAAkB;EAEvC,OAAO,QAAQ,KAAKA,UAAU;GAAE,OAAO,cAAc,IAAI;GAAG,OAAO;EAAY,CAAC;CACjF;;;;;;CAOA,MAAM,SACL,MACA,MACoD;EAEpD,OAAO,iBADO,KAAK,QAAQ,KAAK,WACJ,GAAG,IAAI;CACpC;AACD;;;;;;;;;;AA0BA,eAAsB,QAAQ,OAAmD;CACh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